@selfdecode/sd-component-library 4.0.78-1 → 4.0.78-test
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/lib/components/utils/anchor/interfaces.d.ts +2 -2
- package/lib/components/utils/anchor/refs-manager.d.ts +4 -4
- package/lib/sd-component-library101.js +2 -2
- package/lib/sd-component-library107.js +1 -1
- package/lib/sd-component-library112.js +1 -1
- package/lib/sd-component-library113.js +2 -2
- package/lib/sd-component-library115.js +1 -1
- package/lib/sd-component-library116.js +1 -1
- package/lib/sd-component-library121.js +2 -2
- package/lib/sd-component-library122.js +2 -2
- package/lib/sd-component-library124.js +1 -1
- package/lib/sd-component-library127.js +3 -3
- package/lib/sd-component-library128.js +1 -1
- package/lib/sd-component-library130.js +2 -2
- package/lib/sd-component-library15.js +1 -1
- package/lib/sd-component-library161.js +1 -1
- package/lib/sd-component-library162.js +1 -1
- package/lib/sd-component-library165.js +1 -1
- package/lib/sd-component-library166.js +4 -4
- package/lib/sd-component-library167.js +24 -23
- package/lib/sd-component-library167.js.map +1 -1
- package/lib/sd-component-library190.js +3 -3
- package/lib/sd-component-library191.js +3 -75
- package/lib/sd-component-library191.js.map +1 -1
- package/lib/sd-component-library192.js +75 -3
- package/lib/sd-component-library192.js.map +1 -1
- package/lib/sd-component-library194.js +3 -2
- package/lib/sd-component-library194.js.map +1 -1
- package/lib/sd-component-library195.js +25 -30
- package/lib/sd-component-library195.js.map +1 -1
- package/lib/sd-component-library196.js +57 -599
- package/lib/sd-component-library196.js.map +1 -1
- package/lib/sd-component-library197.js +2 -57
- package/lib/sd-component-library197.js.map +1 -1
- package/lib/sd-component-library198.js +30 -3
- package/lib/sd-component-library198.js.map +1 -1
- package/lib/sd-component-library199.js +598 -24
- package/lib/sd-component-library199.js.map +1 -1
- package/lib/sd-component-library2.js +1 -1
- package/lib/sd-component-library203.js +64 -18
- package/lib/sd-component-library203.js.map +1 -1
- package/lib/sd-component-library204.js +18 -21
- package/lib/sd-component-library204.js.map +1 -1
- package/lib/sd-component-library205.js +64 -3
- package/lib/sd-component-library205.js.map +1 -1
- package/lib/sd-component-library206.js +23 -3
- package/lib/sd-component-library206.js.map +1 -1
- package/lib/sd-component-library207.js +20 -63
- package/lib/sd-component-library207.js.map +1 -1
- package/lib/sd-component-library208.js +3 -40
- package/lib/sd-component-library208.js.map +1 -1
- package/lib/sd-component-library209.js +3 -14
- package/lib/sd-component-library209.js.map +1 -1
- package/lib/sd-component-library210.js +40 -3
- package/lib/sd-component-library210.js.map +1 -1
- package/lib/sd-component-library211.js +26 -3
- package/lib/sd-component-library211.js.map +1 -1
- package/lib/sd-component-library214.js +14 -3
- package/lib/sd-component-library214.js.map +1 -1
- package/lib/sd-component-library215.js +3 -52
- package/lib/sd-component-library215.js.map +1 -1
- package/lib/sd-component-library216.js +3 -46
- package/lib/sd-component-library216.js.map +1 -1
- package/lib/sd-component-library217.js +61 -12
- package/lib/sd-component-library217.js.map +1 -1
- package/lib/sd-component-library218.js +3 -65
- package/lib/sd-component-library218.js.map +1 -1
- package/lib/sd-component-library220.js +44 -62
- package/lib/sd-component-library220.js.map +1 -1
- package/lib/sd-component-library221.js +48 -19
- package/lib/sd-component-library221.js.map +1 -1
- package/lib/sd-component-library222.js +16 -3
- package/lib/sd-component-library222.js.map +1 -1
- package/lib/sd-component-library223.js +325 -31
- package/lib/sd-component-library223.js.map +1 -1
- package/lib/sd-component-library224.js +5 -19
- package/lib/sd-component-library224.js.map +1 -1
- package/lib/sd-component-library225.js +3 -20
- package/lib/sd-component-library225.js.map +1 -1
- package/lib/sd-component-library226.js +31 -28
- package/lib/sd-component-library226.js.map +1 -1
- package/lib/sd-component-library227.js +19 -33
- package/lib/sd-component-library227.js.map +1 -1
- package/lib/sd-component-library228.js +20 -3
- package/lib/sd-component-library228.js.map +1 -1
- package/lib/sd-component-library229.js +26 -127
- package/lib/sd-component-library229.js.map +1 -1
- package/lib/sd-component-library230.js +31 -41
- package/lib/sd-component-library230.js.map +1 -1
- package/lib/sd-component-library231.js +3 -47
- package/lib/sd-component-library231.js.map +1 -1
- package/lib/sd-component-library232.js +129 -8
- package/lib/sd-component-library232.js.map +1 -1
- package/lib/sd-component-library233.js +41 -62
- package/lib/sd-component-library233.js.map +1 -1
- package/lib/sd-component-library234.js +40 -36
- package/lib/sd-component-library234.js.map +1 -1
- package/lib/sd-component-library235.js +7 -12
- package/lib/sd-component-library235.js.map +1 -1
- package/lib/sd-component-library236.js +64 -21
- package/lib/sd-component-library236.js.map +1 -1
- package/lib/sd-component-library237.js +41 -107
- package/lib/sd-component-library237.js.map +1 -1
- package/lib/sd-component-library238.js +12 -46
- package/lib/sd-component-library238.js.map +1 -1
- package/lib/sd-component-library239.js +21 -24
- package/lib/sd-component-library239.js.map +1 -1
- package/lib/sd-component-library240.js +103 -47
- package/lib/sd-component-library240.js.map +1 -1
- package/lib/sd-component-library241.js +45 -46
- package/lib/sd-component-library241.js.map +1 -1
- package/lib/sd-component-library242.js +23 -74
- package/lib/sd-component-library242.js.map +1 -1
- package/lib/sd-component-library243.js +52 -40
- package/lib/sd-component-library243.js.map +1 -1
- package/lib/sd-component-library244.js +47 -26
- package/lib/sd-component-library244.js.map +1 -1
- package/lib/sd-component-library245.js +72 -18
- package/lib/sd-component-library245.js.map +1 -1
- package/lib/sd-component-library246.js +2 -20
- package/lib/sd-component-library246.js.map +1 -1
- package/lib/sd-component-library247.js +21 -2
- package/lib/sd-component-library247.js.map +1 -1
- package/lib/sd-component-library248.js +20 -26
- package/lib/sd-component-library248.js.map +1 -1
- package/lib/sd-component-library249.js +40 -324
- package/lib/sd-component-library249.js.map +1 -1
- package/lib/sd-component-library25.js +1 -1
- package/lib/sd-component-library250.js +27 -5
- package/lib/sd-component-library250.js.map +1 -1
- package/lib/sd-component-library255.js +114 -17
- package/lib/sd-component-library255.js.map +1 -1
- package/lib/sd-component-library256.js +23 -15
- package/lib/sd-component-library256.js.map +1 -1
- package/lib/sd-component-library257.js +20 -29
- package/lib/sd-component-library257.js.map +1 -1
- package/lib/sd-component-library258.js +118 -44
- package/lib/sd-component-library258.js.map +1 -1
- package/lib/sd-component-library259.js +9 -130
- package/lib/sd-component-library259.js.map +1 -1
- package/lib/sd-component-library260.js +41 -65
- package/lib/sd-component-library260.js.map +1 -1
- package/lib/sd-component-library261.js +38 -63
- package/lib/sd-component-library261.js.map +1 -1
- package/lib/sd-component-library262.js +27 -27
- package/lib/sd-component-library262.js.map +1 -1
- package/lib/sd-component-library263.js +126 -16
- package/lib/sd-component-library263.js.map +1 -1
- package/lib/sd-component-library264.js +63 -114
- package/lib/sd-component-library264.js.map +1 -1
- package/lib/sd-component-library265.js +61 -107
- package/lib/sd-component-library265.js.map +1 -1
- package/lib/sd-component-library266.js +9 -10
- package/lib/sd-component-library266.js.map +1 -1
- package/lib/sd-component-library267.js +49 -48
- package/lib/sd-component-library267.js.map +1 -1
- package/lib/sd-component-library268.js +89 -8
- package/lib/sd-component-library268.js.map +1 -1
- package/lib/sd-component-library269.js +89 -48
- package/lib/sd-component-library269.js.map +1 -1
- package/lib/sd-component-library270.js +24 -89
- package/lib/sd-component-library270.js.map +1 -1
- package/lib/sd-component-library271.js +20 -90
- package/lib/sd-component-library271.js.map +1 -1
- package/lib/sd-component-library272.js +51 -2
- package/lib/sd-component-library272.js.map +1 -1
- package/lib/sd-component-library273.js +2 -2
- package/lib/sd-component-library274.js +2 -49
- package/lib/sd-component-library274.js.map +1 -1
- package/lib/sd-component-library277.js +10 -70
- package/lib/sd-component-library277.js.map +1 -1
- package/lib/sd-component-library278.js +69 -101
- package/lib/sd-component-library278.js.map +1 -1
- package/lib/sd-component-library279.js +91 -95
- package/lib/sd-component-library279.js.map +1 -1
- package/lib/sd-component-library280.js +106 -10
- package/lib/sd-component-library280.js.map +1 -1
- package/lib/sd-component-library284.js +4 -4
- package/lib/sd-component-library285.js +3 -2
- package/lib/sd-component-library285.js.map +1 -1
- package/lib/sd-component-library286.js +3 -8
- package/lib/sd-component-library286.js.map +1 -1
- package/lib/sd-component-library287.js +3 -328
- package/lib/sd-component-library287.js.map +1 -1
- package/lib/sd-component-library288.js +2 -51
- package/lib/sd-component-library288.js.map +1 -1
- package/lib/sd-component-library289.js +8 -3
- package/lib/sd-component-library289.js.map +1 -1
- package/lib/sd-component-library290.js +328 -3
- package/lib/sd-component-library290.js.map +1 -1
- package/lib/sd-component-library291.js +51 -3
- package/lib/sd-component-library291.js.map +1 -1
- package/lib/sd-component-library292.js +9 -2
- package/lib/sd-component-library292.js.map +1 -1
- package/lib/sd-component-library293.js +4 -76
- package/lib/sd-component-library293.js.map +1 -1
- package/lib/sd-component-library294.js +4 -93
- package/lib/sd-component-library294.js.map +1 -1
- package/lib/sd-component-library295.js +19 -53
- package/lib/sd-component-library295.js.map +1 -1
- package/lib/sd-component-library296.js +3 -9
- package/lib/sd-component-library296.js.map +1 -1
- package/lib/sd-component-library297.js +2 -5
- package/lib/sd-component-library297.js.map +1 -1
- package/lib/sd-component-library298.js +73 -49
- package/lib/sd-component-library298.js.map +1 -1
- package/lib/sd-component-library299.js +93 -2
- package/lib/sd-component-library299.js.map +1 -1
- package/lib/sd-component-library300.js +53 -2
- package/lib/sd-component-library300.js.map +1 -1
- package/lib/sd-component-library301.js +8 -8
- package/lib/sd-component-library301.js.map +1 -1
- package/lib/sd-component-library302.js +4 -4
- package/lib/sd-component-library302.js.map +1 -1
- package/lib/sd-component-library303.js +53 -4
- package/lib/sd-component-library303.js.map +1 -1
- package/lib/sd-component-library304.js +6 -19
- package/lib/sd-component-library304.js.map +1 -1
- package/lib/sd-component-library305.js +2 -3
- package/lib/sd-component-library305.js.map +1 -1
- package/lib/sd-component-library306.js +2 -6
- package/lib/sd-component-library306.js.map +1 -1
- package/lib/sd-component-library309.js +1 -1
- package/lib/sd-component-library310.js +2 -2
- package/lib/sd-component-library316.js +1 -1
- package/lib/sd-component-library32.js +1 -1
- package/lib/sd-component-library33.js +1 -1
- package/lib/sd-component-library49.js +1 -1
- package/lib/sd-component-library5.js +1 -1
- package/lib/sd-component-library50.js +1 -1
- package/lib/sd-component-library51.js +1 -1
- package/lib/sd-component-library52.js +3 -3
- package/lib/sd-component-library53.js +2 -2
- package/lib/sd-component-library54.js +2 -2
- package/lib/sd-component-library55.js +1 -1
- package/lib/sd-component-library57.js +3 -3
- package/lib/sd-component-library58.js +1 -1
- package/lib/sd-component-library59.js +2 -2
- package/lib/sd-component-library6.js +1 -1
- package/lib/sd-component-library60.js +1 -1
- package/lib/sd-component-library67.js +3 -3
- package/lib/sd-component-library69.js +2 -2
- package/lib/sd-component-library70.js +2 -2
- package/lib/sd-component-library71.js +1 -1
- package/lib/sd-component-library72.js +1 -1
- package/lib/sd-component-library74.js +1 -1
- package/lib/sd-component-library75.js +1 -1
- package/lib/sd-component-library80.js +1 -1
- package/lib/sd-component-library81.js +6 -6
- package/lib/sd-component-library82.js +2 -2
- package/lib/sd-component-library83.js +1 -1
- package/lib/sd-component-library84.js +5 -5
- package/lib/sd-component-library85.js +1 -1
- package/lib/sd-component-library87.js +6 -6
- package/lib/sd-component-library88.js +1 -1
- package/lib/sd-component-library89.js +7 -7
- package/lib/sd-component-library90.js +1 -1
- package/lib/sd-component-library93.js +2 -2
- package/lib/sd-component-library94.js +3 -3
- package/lib/sd-component-library95.js +2 -2
- package/lib/sd-component-library96.js +3 -3
- package/lib/sd-component-library97.js +2 -2
- package/package.json +2 -2
|
@@ -1,95 +1,25 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
pointerColor: r
|
|
21
|
-
}, u) => {
|
|
22
|
-
const f = t === "bottom" ? {
|
|
23
|
-
top: "100%"
|
|
24
|
-
} : {
|
|
25
|
-
bottom: "100%"
|
|
26
|
-
}, i = {
|
|
27
|
-
size: `${m}px`,
|
|
28
|
-
color: r,
|
|
29
|
-
sx: {
|
|
30
|
-
my: "auto",
|
|
31
|
-
...x
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
return /* @__PURE__ */ o.jsxs(
|
|
35
|
-
j,
|
|
36
|
-
{
|
|
37
|
-
flexDirection: "column",
|
|
38
|
-
sx: {
|
|
39
|
-
position: "absolute",
|
|
40
|
-
left: "50%",
|
|
41
|
-
transform: "translateX(-50%)",
|
|
42
|
-
cursor: "default",
|
|
43
|
-
alignItems: "center",
|
|
44
|
-
opacity: h === "entered" ? 1 : 0,
|
|
45
|
-
transition: `opacity ${b}ms`,
|
|
46
|
-
zIndex: 1,
|
|
47
|
-
...f,
|
|
48
|
-
...a
|
|
49
|
-
},
|
|
50
|
-
ref: u,
|
|
51
|
-
"data-test": "tooltip-content",
|
|
52
|
-
children: [
|
|
53
|
-
t === "bottom" && /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
54
|
-
/* @__PURE__ */ o.jsx(s, { height: `${e}px` }),
|
|
55
|
-
/* @__PURE__ */ o.jsx(n, { direction: "top", ...i })
|
|
56
|
-
] }),
|
|
57
|
-
/* @__PURE__ */ o.jsx(
|
|
58
|
-
y,
|
|
59
|
-
{
|
|
60
|
-
fontSizeWeight: [14, "regular"],
|
|
61
|
-
sx: {
|
|
62
|
-
width: c,
|
|
63
|
-
lineHeight: "16px",
|
|
64
|
-
bg: "cl_white",
|
|
65
|
-
px: p,
|
|
66
|
-
py: l,
|
|
67
|
-
borderColor: "cl_lightGrey",
|
|
68
|
-
borderWidth: "1px",
|
|
69
|
-
borderStyle: "solid",
|
|
70
|
-
...t === "top" ? {
|
|
71
|
-
borderBottomWidth: "2px",
|
|
72
|
-
borderBottomColor: r,
|
|
73
|
-
borderRadius: "3px 3px 0 0"
|
|
74
|
-
} : {
|
|
75
|
-
borderTopWidth: "2px",
|
|
76
|
-
borderTopColor: r,
|
|
77
|
-
borderRadius: "0 0 3px 3px"
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
children: d
|
|
81
|
-
}
|
|
82
|
-
),
|
|
83
|
-
t === "top" && /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
84
|
-
/* @__PURE__ */ o.jsx(n, { direction: "bottom", ...i }),
|
|
85
|
-
/* @__PURE__ */ o.jsx(s, { height: `${e}px` })
|
|
86
|
-
] })
|
|
87
|
-
]
|
|
88
|
-
}
|
|
89
|
-
);
|
|
1
|
+
import { j as r } from "./sd-component-library190.js";
|
|
2
|
+
import { ResponsiveTextV2 as t } from "./sd-component-library144.js";
|
|
3
|
+
const n = ({
|
|
4
|
+
children: e
|
|
5
|
+
}) => /* @__PURE__ */ r.jsx(
|
|
6
|
+
t,
|
|
7
|
+
{
|
|
8
|
+
fontSizeWeight: [18, "regular"],
|
|
9
|
+
sx: {
|
|
10
|
+
display: "flex",
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
justifyContent: "center",
|
|
13
|
+
height: "100%",
|
|
14
|
+
borderRadius: "5px",
|
|
15
|
+
borderWidth: "1px",
|
|
16
|
+
borderColor: "cl_lightGrey",
|
|
17
|
+
borderStyle: "solid"
|
|
18
|
+
},
|
|
19
|
+
children: e
|
|
90
20
|
}
|
|
91
21
|
);
|
|
92
22
|
export {
|
|
93
|
-
|
|
23
|
+
n as PaginationBarCurrentPage
|
|
94
24
|
};
|
|
95
25
|
//# sourceMappingURL=sd-component-library271.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library271.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"sd-component-library271.js","sources":["../src/components/pagination-bars/pagination-bar-mobile/partials/pagination-bar-current-page/pagination-bar-current-page.tsx"],"sourcesContent":["import React, { PropsWithChildren } from \"react\";\n\nimport { ResponsiveTextV2 } from \"../../../../texts\";\n\nexport const PaginationBarCurrentPage: React.FC<PropsWithChildren<{}>> = ({\n children,\n}) => {\n return (\n <ResponsiveTextV2\n fontSizeWeight={[18, \"regular\"]}\n sx={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n height: \"100%\",\n borderRadius: \"5px\",\n borderWidth: \"1px\",\n borderColor: \"cl_lightGrey\",\n borderStyle: \"solid\",\n }}\n >\n {children}\n </ResponsiveTextV2>\n );\n};\n"],"names":["PaginationBarCurrentPage","children","jsx","ResponsiveTextV2"],"mappings":";;AAIO,MAAMA,IAA4D,CAAC;AAAA,EACxE,UAAAC;AACF,MAEIC,gBAAAA,EAAA;AAAA,EAACC;AAAA,EAAA;AAAA,IACC,gBAAgB,CAAC,IAAI,SAAS;AAAA,IAC9B,IAAI;AAAA,MACF,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,gBAAgB;AAAA,MAChB,QAAQ;AAAA,MACR,cAAc;AAAA,MACd,aAAa;AAAA,MACb,aAAa;AAAA,MACb,aAAa;AAAA,IACf;AAAA,IAEC,UAAAF;AAAA,EAAA;AAAA;"}
|
|
@@ -1,5 +1,54 @@
|
|
|
1
|
-
var
|
|
1
|
+
var n = Object.defineProperty;
|
|
2
|
+
var h = (s, e, t) => e in s ? n(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
3
|
+
var o = (s, e, t) => (h(s, typeof e != "symbol" ? e + "" : e, t), t);
|
|
4
|
+
class g {
|
|
5
|
+
constructor() {
|
|
6
|
+
o(this, "refRegistry", {});
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Check if ref is registered for a component with provided ID.
|
|
10
|
+
* @param id ID for the component.
|
|
11
|
+
*/
|
|
12
|
+
doesRefExist(e) {
|
|
13
|
+
return !!this.refRegistry[e];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Register a ref.
|
|
17
|
+
*
|
|
18
|
+
* @param id ID for the component.
|
|
19
|
+
* @param ref React Ref object for the component. Used for scrolling.
|
|
20
|
+
*/
|
|
21
|
+
addRef(e, t) {
|
|
22
|
+
this.refRegistry[i(e)] = t;
|
|
23
|
+
}
|
|
24
|
+
getRef(e) {
|
|
25
|
+
return this.refRegistry[i(e)];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Remove a ref from registry.
|
|
29
|
+
*
|
|
30
|
+
* @param id ID for the component.
|
|
31
|
+
*/
|
|
32
|
+
removeRef(e) {
|
|
33
|
+
this.doesRefExist(e) ? delete this.refRegistry[e] : console.error(`Ref with ID ${e} does not exist in the registry`);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Scroll the component with provided ID into the view.
|
|
37
|
+
*
|
|
38
|
+
* @param id ID for the component.
|
|
39
|
+
* @param behavior Scroll behavior.
|
|
40
|
+
*/
|
|
41
|
+
scrollToRef(e, { behavior: t = "smooth", block: f, inline: R }) {
|
|
42
|
+
var r;
|
|
43
|
+
this.doesRefExist(e) ? (r = this.getRef(e)) == null || r.scrollIntoView({
|
|
44
|
+
behavior: t,
|
|
45
|
+
block: f,
|
|
46
|
+
inline: R
|
|
47
|
+
}) : console.error(`Ref with ID ${e} does not exist in the registry`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const i = (s) => s.startsWith("#") ? s : `#${s}`, y = new g();
|
|
2
51
|
export {
|
|
3
|
-
|
|
52
|
+
y as refsManager
|
|
4
53
|
};
|
|
5
54
|
//# sourceMappingURL=sd-component-library272.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library272.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"sd-component-library272.js","sources":["../src/components/utils/anchor/refs-manager.ts"],"sourcesContent":["import { NodesMap } from \"./interfaces\";\n\n/**\n * Refs Manager class to keep record of registered refs on the page.\n */\nclass RefsManager {\n refRegistry: NodesMap = {};\n\n /**\n * Check if ref is registered for a component with provided ID.\n * @param id ID for the component.\n */\n public doesRefExist(id: string) {\n return !!this.refRegistry[id];\n }\n\n /**\n * Register a ref.\n *\n * @param id ID for the component.\n * @param ref React Ref object for the component. Used for scrolling.\n */\n public addRef(\n id: string,\n ref: HTMLDivElement | undefined\n ) {\n this.refRegistry[getKey(id)] = ref;\n }\n\n public getRef(id: string) {\n return this.refRegistry[getKey(id)]\n }\n\n /**\n * Remove a ref from registry.\n *\n * @param id ID for the component.\n */\n public removeRef(id: string) {\n if (this.doesRefExist(id)) delete this.refRegistry[id];\n else console.error(`Ref with ID ${id} does not exist in the registry`);\n }\n\n /**\n * Scroll the component with provided ID into the view.\n *\n * @param id ID for the component.\n * @param behavior Scroll behavior.\n */\n public scrollToRef(\n id: string,\n { behavior = \"smooth\", block, inline }: ScrollIntoViewOptions\n ) {\n if (this.doesRefExist(id))\n this.getRef(id)?.scrollIntoView({\n behavior,\n block,\n inline,\n });\n else console.error(`Ref with ID ${id} does not exist in the registry`);\n }\n}\n\nconst getKey = (id: string) => id.startsWith(\"#\") ? id : `#${id}`\n\nexport const refsManager = new RefsManager();\n"],"names":["RefsManager","__publicField","id","ref","getKey","behavior","block","inline","_a","refsManager"],"mappings":";;;AAKA,MAAMA,EAAY;AAAA,EAAlB;AACE,IAAAC,EAAA,qBAAwB,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMjB,aAAaC,GAAY;AAC9B,WAAO,CAAC,CAAC,KAAK,YAAYA,CAAE;AAAA,EAC9B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,OACLA,GACAC,GACA;AACA,SAAK,YAAYC,EAAOF,CAAE,CAAC,IAAIC;AAAA,EACjC;AAAA,EAEO,OAAOD,GAAY;AACxB,WAAO,KAAK,YAAYE,EAAOF,CAAE,CAAC;AAAA,EACpC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOO,UAAUA,GAAY;AACvB,IAAA,KAAK,aAAaA,CAAE,IAAU,OAAA,KAAK,YAAYA,CAAE,IACxC,QAAA,MAAM,eAAeA,CAAE,iCAAiC;AAAA,EACvE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQO,YACLA,GACA,EAAE,UAAAG,IAAW,UAAU,OAAAC,GAAO,QAAAC,KAC9B;AA/CJ,QAAAC;AAgDQ,IAAA,KAAK,aAAaN,CAAE,KACjBM,IAAA,KAAA,OAAON,CAAE,MAAT,QAAAM,EAAY,eAAe;AAAA,MAC9B,UAAAH;AAAA,MACA,OAAAC;AAAA,MACA,QAAAC;AAAA,IAAA,KAES,QAAA,MAAM,eAAeL,CAAE,iCAAiC;AAAA,EACvE;AACF;AAEA,MAAME,IAAS,CAACF,MAAeA,EAAG,WAAW,GAAG,IAAIA,IAAK,IAAIA,CAAE,IAElDO,IAAc,IAAIT,EAAY;"}
|
|
@@ -1,52 +1,5 @@
|
|
|
1
|
-
var
|
|
2
|
-
var R = (t, e, s) => e in t ? n(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
3
|
-
var i = (t, e, s) => (R(t, typeof e != "symbol" ? e + "" : e, s), s);
|
|
4
|
-
class h {
|
|
5
|
-
constructor() {
|
|
6
|
-
i(this, "refRegistry", {});
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Check if ref is registered for a component with provided ID.
|
|
10
|
-
* @param id ID for the component.
|
|
11
|
-
*/
|
|
12
|
-
doesRefExist(e) {
|
|
13
|
-
return !!this.refRegistry[e];
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Register a ref.
|
|
17
|
-
*
|
|
18
|
-
* @param id ID for the component.
|
|
19
|
-
* @param ref React Ref object for the component. Used for scrolling.
|
|
20
|
-
*/
|
|
21
|
-
addRef(e, s) {
|
|
22
|
-
const r = e.startsWith("#") ? e : `#${e}`;
|
|
23
|
-
this.refRegistry[r] = s;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Remove a ref from registry.
|
|
27
|
-
*
|
|
28
|
-
* @param id ID for the component.
|
|
29
|
-
*/
|
|
30
|
-
removeRef(e) {
|
|
31
|
-
this.doesRefExist(e) ? delete this.refRegistry[e] : console.error(`Ref with ID ${e} does not exist in the registry`);
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Scroll the component with provided ID into the view.
|
|
35
|
-
*
|
|
36
|
-
* @param id ID for the component.
|
|
37
|
-
* @param behavior Scroll behavior.
|
|
38
|
-
*/
|
|
39
|
-
scrollToRef(e, { behavior: s = "smooth", block: r, inline: f }) {
|
|
40
|
-
var o;
|
|
41
|
-
this.doesRefExist(e) ? (o = this.refRegistry[e].current) == null || o.scrollIntoView({
|
|
42
|
-
behavior: s,
|
|
43
|
-
block: r,
|
|
44
|
-
inline: f
|
|
45
|
-
}) : console.error(`Ref with ID ${e} does not exist in the registry`);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
const g = new h();
|
|
1
|
+
var e = {};
|
|
49
2
|
export {
|
|
50
|
-
|
|
3
|
+
e as __exports
|
|
51
4
|
};
|
|
52
5
|
//# sourceMappingURL=sd-component-library274.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library274.js","sources":[
|
|
1
|
+
{"version":3,"file":"sd-component-library274.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,73 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
startDate: y(l(/* @__PURE__ */ new Date(), -1)),
|
|
11
|
-
endDate: i(l(/* @__PURE__ */ new Date(), -1))
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
label: "Last Week",
|
|
15
|
-
startDate: O(n(/* @__PURE__ */ new Date(), -1), { weekStartsOn: 1 }),
|
|
16
|
-
endDate: S(n(/* @__PURE__ */ new Date(), -1), { weekStartsOn: 1 })
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
label: "Last 2 Weeks",
|
|
20
|
-
startDate: O(n(/* @__PURE__ */ new Date(), -2), { weekStartsOn: 1 }),
|
|
21
|
-
endDate: S(n(/* @__PURE__ */ new Date(), -1), { weekStartsOn: 1 })
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
label: "Last Month",
|
|
25
|
-
startDate: u(f(/* @__PURE__ */ new Date(), -1)),
|
|
26
|
-
endDate: M(f(/* @__PURE__ */ new Date(), -1))
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
label: "Last Year",
|
|
30
|
-
startDate: b(c(/* @__PURE__ */ new Date(), -1)),
|
|
31
|
-
endDate: C(c(/* @__PURE__ */ new Date(), -1))
|
|
32
|
-
}
|
|
33
|
-
], _ = (t, e, E, k, m, h) => {
|
|
34
|
-
const o = (m || Y).map(
|
|
35
|
-
({ label: s, startDate: d, endDate: w }) => ({
|
|
36
|
-
label: s,
|
|
37
|
-
range: (a) => ({
|
|
38
|
-
startDate: d,
|
|
39
|
-
endDate: w
|
|
40
|
-
}),
|
|
41
|
-
isSelected: (a) => a.startDate && a.endDate ? r(a.startDate, d) && r(a.endDate, w) : !1
|
|
42
|
-
})
|
|
43
|
-
);
|
|
44
|
-
return h ? o.concat({
|
|
45
|
-
label: "Custom Range",
|
|
46
|
-
range: (s) => (e(), {
|
|
47
|
-
startDate: (t == null ? void 0 : t.startDate) || /* @__PURE__ */ new Date(),
|
|
48
|
-
endDate: (t == null ? void 0 : t.endDate) || /* @__PURE__ */ new Date()
|
|
49
|
-
}),
|
|
50
|
-
isSelected: (s) => k
|
|
51
|
-
}) : o;
|
|
52
|
-
}, g = (t) => ({
|
|
53
|
-
...t,
|
|
54
|
-
rangeColors: [t.color ?? "#9E1CB5"],
|
|
55
|
-
weekStartsOn: 1,
|
|
56
|
-
inputRanges: [],
|
|
57
|
-
ranges: [
|
|
58
|
-
t.selectedRange ?? {
|
|
59
|
-
startDate: /* @__PURE__ */ new Date(),
|
|
60
|
-
endDate: /* @__PURE__ */ new Date()
|
|
61
|
-
}
|
|
62
|
-
],
|
|
63
|
-
months: t.months,
|
|
64
|
-
onChange: (e) => {
|
|
65
|
-
t.setSelectedRange(e.range1);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const a = (t) => /* @__PURE__ */ e.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 18.2, height: 20, viewBox: "0 0 18.2 20", ...t }, /* @__PURE__ */ e.createElement("defs", null, /* @__PURE__ */ e.createElement("style", null, `
|
|
3
|
+
.calendar{
|
|
4
|
+
fill:none;
|
|
5
|
+
stroke-linecap:round;
|
|
6
|
+
stroke-linejoin:round;
|
|
7
|
+
stroke-width:2px;
|
|
8
|
+
}
|
|
9
|
+
`)), /* @__PURE__ */ e.createElement("g", { transform: "translate(-3.5 -2)" }, /* @__PURE__ */ e.createElement("path", { className: "calendar", stroke: "current", d: "M6.3,6H18.9a1.8,1.8,0,0,1,1.8,1.8V20.4a1.8,1.8,0,0,1-1.8,1.8H6.3a1.8,1.8,0,0,1-1.8-1.8V7.8A1.8,1.8,0,0,1,6.3,6Z", transform: "translate(0 -1.2)" }), /* @__PURE__ */ e.createElement("path", { className: "calendar", stroke: "current", d: "M24,3V6.6", transform: "translate(-7.8 0)" }), /* @__PURE__ */ e.createElement("path", { className: "calendar", stroke: "current", d: "M12,3V6.6", transform: "translate(-3 0)" }), /* @__PURE__ */ e.createElement("path", { className: "calendar", stroke: "current", d: "M4.5,15H20.7", transform: "translate(0 -4.8)" })));
|
|
68
10
|
export {
|
|
69
|
-
|
|
70
|
-
x as getSelectedRangeText,
|
|
71
|
-
_ as getStaticRanges
|
|
11
|
+
a as ReactComponent
|
|
72
12
|
};
|
|
73
13
|
//# sourceMappingURL=sd-component-library277.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library277.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"sd-component-library277.js","sources":["../src/components/icons/calendar-icon/calendar.svg"],"sourcesCont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
|
|
37
|
-
borderWidth: "1px",
|
|
38
|
-
borderColor: "cl_lightGrey",
|
|
39
|
-
minWidth: "352px",
|
|
40
|
-
width: "max-content",
|
|
41
|
-
backgroundColor: "#fff",
|
|
42
|
-
m: "auto",
|
|
43
|
-
borderRadius: "4px",
|
|
44
|
-
zIndex: n,
|
|
45
|
-
".rdrDateRangePickerWrapper": {
|
|
46
|
-
width: "100%",
|
|
47
|
-
flexDirection: "column"
|
|
48
|
-
},
|
|
49
|
-
".rdrDefinedRangesWrapper": {
|
|
50
|
-
width: "100%"
|
|
51
|
-
},
|
|
52
|
-
".rdrCalendarWrapper": {
|
|
53
|
-
display: a ? "inline-flex" : "none"
|
|
54
|
-
},
|
|
55
|
-
".rdrInputRanges": {
|
|
56
|
-
display: "none"
|
|
57
|
-
},
|
|
58
|
-
".rdrStaticRanges:before": {
|
|
59
|
-
fontSize: "16px",
|
|
60
|
-
fontFamily: "proxima-nova",
|
|
61
|
-
color: "#9BA2B4",
|
|
62
|
-
fontWeight: "300",
|
|
63
|
-
p: "10px 20px"
|
|
64
|
-
},
|
|
65
|
-
".rdrStaticRange": {
|
|
66
|
-
fontSize: "16px",
|
|
67
|
-
fontFamily: "proxima-nova",
|
|
68
|
-
color: "#434A54",
|
|
69
|
-
borderBottomWidth: "0"
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
children: [
|
|
73
|
-
/* @__PURE__ */ r.jsx(f, { fontSizeWeight: [12, "semi-bold"], ref: i, children: /* @__PURE__ */ r.jsx(
|
|
74
|
-
s,
|
|
75
|
-
{
|
|
76
|
-
...c(e),
|
|
77
|
-
direction: "vertical",
|
|
78
|
-
staticRanges: d(!0)
|
|
79
|
-
}
|
|
80
|
-
) }),
|
|
81
|
-
/* @__PURE__ */ r.jsx(h, { ...e, isMobile: !0 }),
|
|
82
|
-
/* @__PURE__ */ r.jsxs(g, { p: "10px 20px", children: [
|
|
83
|
-
/* @__PURE__ */ r.jsx(
|
|
84
|
-
u,
|
|
85
|
-
{
|
|
86
|
-
onClick: o,
|
|
87
|
-
height: "42px",
|
|
88
|
-
color: "cl_darkGrey",
|
|
89
|
-
padding: "0",
|
|
90
|
-
children: "Cancel"
|
|
91
|
-
}
|
|
92
|
-
),
|
|
93
|
-
/* @__PURE__ */ r.jsx(R, { ...e })
|
|
94
|
-
] })
|
|
95
|
-
]
|
|
96
|
-
}
|
|
97
|
-
)
|
|
98
|
-
}
|
|
99
|
-
);
|
|
1
|
+
import { startOfDay as y, addDays as l, endOfDay as i, startOfWeek as O, addWeeks as n, endOfWeek as S, startOfMonth as u, addMonths as f, endOfMonth as M, startOfYear as b, addYears as c, endOfYear as C, isSameDay as r, format as W } from "date-fns";
|
|
2
|
+
const D = (t) => W(t, "EEE d MMM yyyy"), x = (t) => {
|
|
3
|
+
const e = "No date selected";
|
|
4
|
+
return !t || !t.startDate || !t.endDate ? e : r(t.startDate, t.endDate) ? D(t.startDate) : `${D(t.startDate)} - ${D(
|
|
5
|
+
t.endDate
|
|
6
|
+
)}`;
|
|
7
|
+
}, Y = [
|
|
8
|
+
{
|
|
9
|
+
label: "Yesterday",
|
|
10
|
+
startDate: y(l(/* @__PURE__ */ new Date(), -1)),
|
|
11
|
+
endDate: i(l(/* @__PURE__ */ new Date(), -1))
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
label: "Last Week",
|
|
15
|
+
startDate: O(n(/* @__PURE__ */ new Date(), -1), { weekStartsOn: 1 }),
|
|
16
|
+
endDate: S(n(/* @__PURE__ */ new Date(), -1), { weekStartsOn: 1 })
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: "Last 2 Weeks",
|
|
20
|
+
startDate: O(n(/* @__PURE__ */ new Date(), -2), { weekStartsOn: 1 }),
|
|
21
|
+
endDate: S(n(/* @__PURE__ */ new Date(), -1), { weekStartsOn: 1 })
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
label: "Last Month",
|
|
25
|
+
startDate: u(f(/* @__PURE__ */ new Date(), -1)),
|
|
26
|
+
endDate: M(f(/* @__PURE__ */ new Date(), -1))
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
label: "Last Year",
|
|
30
|
+
startDate: b(c(/* @__PURE__ */ new Date(), -1)),
|
|
31
|
+
endDate: C(c(/* @__PURE__ */ new Date(), -1))
|
|
100
32
|
}
|
|
101
|
-
)
|
|
33
|
+
], _ = (t, e, E, k, m, h) => {
|
|
34
|
+
const o = (m || Y).map(
|
|
35
|
+
({ label: s, startDate: d, endDate: w }) => ({
|
|
36
|
+
label: s,
|
|
37
|
+
range: (a) => ({
|
|
38
|
+
startDate: d,
|
|
39
|
+
endDate: w
|
|
40
|
+
}),
|
|
41
|
+
isSelected: (a) => a.startDate && a.endDate ? r(a.startDate, d) && r(a.endDate, w) : !1
|
|
42
|
+
})
|
|
43
|
+
);
|
|
44
|
+
return h ? o.concat({
|
|
45
|
+
label: "Custom Range",
|
|
46
|
+
range: (s) => (e(), {
|
|
47
|
+
startDate: (t == null ? void 0 : t.startDate) || /* @__PURE__ */ new Date(),
|
|
48
|
+
endDate: (t == null ? void 0 : t.endDate) || /* @__PURE__ */ new Date()
|
|
49
|
+
}),
|
|
50
|
+
isSelected: (s) => k
|
|
51
|
+
}) : o;
|
|
52
|
+
}, g = (t) => ({
|
|
53
|
+
...t,
|
|
54
|
+
rangeColors: [t.color ?? "#9E1CB5"],
|
|
55
|
+
weekStartsOn: 1,
|
|
56
|
+
inputRanges: [],
|
|
57
|
+
ranges: [
|
|
58
|
+
t.selectedRange ?? {
|
|
59
|
+
startDate: /* @__PURE__ */ new Date(),
|
|
60
|
+
endDate: /* @__PURE__ */ new Date()
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
months: t.months,
|
|
64
|
+
onChange: (e) => {
|
|
65
|
+
t.setSelectedRange(e.range1);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
102
68
|
export {
|
|
103
|
-
|
|
69
|
+
g as getCalendarProps,
|
|
70
|
+
x as getSelectedRangeText,
|
|
71
|
+
_ as getStaticRanges
|
|
104
72
|
};
|
|
105
73
|
//# sourceMappingURL=sd-component-library278.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sd-component-library278.js","sources":["../src/components/inputs/date-inputs/base-date-range-input/
|
|
1
|
+
{"version":3,"file":"sd-component-library278.js","sources":["../src/components/inputs/date-inputs/base-date-range-input/utils.ts"],"sourcesContent":["import { OnChangeProps, Range, StaticRange } from \"react-date-range\";\n\nimport {\n addDays,\n addMonths,\n addWeeks,\n addYears,\n endOfDay,\n endOfMonth,\n endOfWeek,\n endOfYear,\n format,\n isSameDay,\n startOfDay,\n startOfMonth,\n startOfWeek,\n startOfYear,\n} from \"date-fns\";\n\nimport { OnRangeSelection, StaticRangeOption } from \"./interfaces\";\nimport { BaseDateRangeInputMobileProps } from \"./partials/base-date-range-input-mobile/interfaces\";\n\nconst getFormattedDate = (date: Date) => format(date, \"EEE d MMM yyyy\");\n\nexport const getSelectedRangeText = (range: Range | null | undefined) => {\n const defaultText = \"No date selected\";\n\n return !range || !range.startDate || !range.endDate\n ? defaultText\n : isSameDay(range.startDate, range.endDate)\n ? getFormattedDate(range.startDate)\n : `${getFormattedDate(range.startDate)} - ${getFormattedDate(\n range.endDate\n )}`;\n};\n\nconst ranges = [\n {\n label: \"Yesterday\",\n startDate: startOfDay(addDays(new Date(), -1)),\n endDate: endOfDay(addDays(new Date(), -1)),\n },\n {\n label: \"Last Week\",\n startDate: startOfWeek(addWeeks(new Date(), -1), { weekStartsOn: 1 }),\n endDate: endOfWeek(addWeeks(new Date(), -1), { weekStartsOn: 1 }),\n },\n {\n label: \"Last 2 Weeks\",\n startDate: startOfWeek(addWeeks(new Date(), -2), { weekStartsOn: 1 }),\n endDate: endOfWeek(addWeeks(new Date(), -1), { weekStartsOn: 1 }),\n },\n {\n label: \"Last Month\",\n startDate: startOfMonth(addMonths(new Date(), -1)),\n endDate: endOfMonth(addMonths(new Date(), -1)),\n },\n {\n label: \"Last Year\",\n startDate: startOfYear(addYears(new Date(), -1)),\n endDate: endOfYear(addYears(new Date(), -1)),\n },\n];\n\nexport const getStaticRanges = (\n selectedRange: Range | undefined | null,\n onCustomRangeSelect: () => void,\n deselectCustomRange: () => void,\n customOptionSelected: boolean,\n customRanges?: StaticRangeOption[],\n mobile?: boolean\n): StaticRange[] => {\n const rangesToShow = customRanges || ranges;\n const staticRanges: StaticRange[] = rangesToShow.map(\n ({ label, startDate, endDate }) => ({\n label,\n range: (_) => ({\n startDate,\n endDate,\n }),\n isSelected: (range) =>\n range.startDate && range.endDate\n ? isSameDay(range.startDate, startDate) &&\n isSameDay(range.endDate, endDate)\n : false,\n })\n );\n\n return !mobile\n ? staticRanges\n : staticRanges.concat({\n label: \"Custom Range\",\n range: (_) => {\n onCustomRangeSelect();\n return {\n startDate: selectedRange?.startDate || new Date(),\n endDate: selectedRange?.endDate || new Date(),\n };\n },\n isSelected: (_) => customOptionSelected,\n });\n};\n\nexport const getCalendarProps = (props: BaseDateRangeInputMobileProps) => ({\n ...props,\n rangeColors: [props.color ?? \"#9E1CB5\"],\n weekStartsOn: 1,\n inputRanges: [],\n ranges: [\n props.selectedRange ?? {\n startDate: new Date(),\n endDate: new Date(),\n },\n ],\n months: props.months,\n onChange: (value: OnChangeProps) => {\n props.setSelectedRange((value as OnRangeSelection).range1);\n },\n});\n"],"names":["getFormattedDate","date","format","getSelectedRangeText","range","defaultText","isSameDay","ranges","startOfDay","addDays","endOfDay","startOfWeek","addWeeks","endOfWeek","startOfMonth","addMonths","endOfMonth","startOfYear","addYears","endOfYear","getStaticRanges","selectedRange","onCustomRangeSelect","deselectCustomRange","customOptionSelected","customRanges","mobile","staticRanges","label","startDate","endDate","_","getCalendarProps","props","value"],"mappings":";AAsBA,MAAMA,IAAmB,CAACC,MAAeC,EAAOD,GAAM,gBAAgB,GAEzDE,IAAuB,CAACC,MAAoC;AACvE,QAAMC,IAAc;AAEb,SAAA,CAACD,KAAS,CAACA,EAAM,aAAa,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