@isettingkit/business-rules 1.0.17 → 1.0.18
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/index.es.d.ts +1 -1
- package/dist/index.es.js +896 -665
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { MdOutlineDelete as
|
|
3
|
-
import { inube as
|
|
4
|
-
import
|
|
5
|
-
import { ValueDataType as
|
|
6
|
-
import { DecisionViewConditionRenderer as
|
|
7
|
-
import { createPortal as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import { franc as
|
|
13
|
-
const
|
|
1
|
+
import { jsx as o, jsxs as p, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import { MdOutlineDelete as Ce, MdClear as pe, MdAdd as ge, MdClose as Se, MdOutlineFilterAltOff as me, MdOutlineFilterAlt as be } from "react-icons/md";
|
|
3
|
+
import { inube as y, Stack as g, Divider as I, Icon as M, Text as C, SkeletonLine as _, useMediaQuery as V, Blanket as fe, Button as L, Grid as J, Tag as B, OptionList as De, Checkpicker as ke, Toggle as Te, Checkbox as Ne, Date as ae } from "@inubekit/inubekit";
|
|
4
|
+
import v, { keyframes as Ee, ThemeContext as $e } from "styled-components";
|
|
5
|
+
import { ValueDataType as z, ValueHowToSetUp as q, DecisionConditionRender as ie } from "@isettingkit/input";
|
|
6
|
+
import { DecisionViewConditionRenderer as G } from "@isettingkit/view";
|
|
7
|
+
import { createPortal as ye } from "react-dom";
|
|
8
|
+
import Ae, { useState as R, useRef as H, useEffect as X, useContext as Fe } from "react";
|
|
9
|
+
import { useFormik as Ie } from "formik";
|
|
10
|
+
import { string as Z, mixed as ve, object as P, number as W, lazy as re, date as le } from "yup";
|
|
11
|
+
import Re from "axios";
|
|
12
|
+
import { franc as Oe } from "franc-min";
|
|
13
|
+
const Me = v.div`
|
|
14
14
|
border-radius: 8px;
|
|
15
15
|
border: 1px solid
|
|
16
16
|
${({ theme: e }) => {
|
|
17
17
|
var t, n;
|
|
18
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) ||
|
|
18
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || y.palette.neutral.N30;
|
|
19
19
|
}};
|
|
20
20
|
box-sizing: border-box;
|
|
21
21
|
display: flex;
|
|
@@ -26,7 +26,7 @@ const Ee = f.div`
|
|
|
26
26
|
height: 100%;
|
|
27
27
|
box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
|
|
28
28
|
`;
|
|
29
|
-
|
|
29
|
+
v.div`
|
|
30
30
|
width: 100%;
|
|
31
31
|
height: 100%;
|
|
32
32
|
overflow-y: auto;
|
|
@@ -45,36 +45,36 @@ f.div`
|
|
|
45
45
|
border-radius: 8px;
|
|
46
46
|
}
|
|
47
47
|
`;
|
|
48
|
-
const
|
|
49
|
-
const { children: t, controls: n = !0, handleDelete:
|
|
50
|
-
return /* @__PURE__ */
|
|
48
|
+
const ee = (e) => {
|
|
49
|
+
const { children: t, controls: n = !0, handleDelete: a, id: i } = e;
|
|
50
|
+
return /* @__PURE__ */ o(Me, { children: /* @__PURE__ */ p(g, { direction: "column", gap: "16px", padding: "12px 16px", children: [
|
|
51
51
|
t,
|
|
52
|
-
n && /* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
52
|
+
n && /* @__PURE__ */ p(A, { children: [
|
|
53
|
+
/* @__PURE__ */ o(I, {}),
|
|
54
|
+
/* @__PURE__ */ o(g, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ o(
|
|
55
55
|
M,
|
|
56
56
|
{
|
|
57
57
|
cursorHover: !0,
|
|
58
58
|
appearance: "danger",
|
|
59
59
|
size: "24px",
|
|
60
|
-
icon: /* @__PURE__ */
|
|
60
|
+
icon: /* @__PURE__ */ o(Ce, {}),
|
|
61
61
|
onClick: () => {
|
|
62
|
-
i
|
|
62
|
+
a(i);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
) })
|
|
66
66
|
] })
|
|
67
67
|
] }) });
|
|
68
|
-
},
|
|
68
|
+
}, se = v.div`
|
|
69
69
|
& > div {
|
|
70
70
|
border-radius: 8px;
|
|
71
71
|
border: 1px solid
|
|
72
72
|
${({ theme: e }) => {
|
|
73
73
|
var t, n;
|
|
74
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) ||
|
|
74
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || y.palette.neutral.N30;
|
|
75
75
|
}};
|
|
76
76
|
}
|
|
77
|
-
`,
|
|
77
|
+
`, de = v.div`
|
|
78
78
|
width: 100%;
|
|
79
79
|
height: 100%;
|
|
80
80
|
overflow-y: auto;
|
|
@@ -92,182 +92,182 @@ const P = (e) => {
|
|
|
92
92
|
background-color: #ebecf0;
|
|
93
93
|
border-radius: 8px;
|
|
94
94
|
}
|
|
95
|
-
`,
|
|
95
|
+
`, Le = (e) => e.value, ze = (e) => e.value, Ve = (e) => e.value, _e = (e) => ({
|
|
96
96
|
from: e.from ?? "",
|
|
97
97
|
to: e.to ?? ""
|
|
98
|
-
}),
|
|
99
|
-
var
|
|
100
|
-
const
|
|
101
|
-
[
|
|
102
|
-
[
|
|
103
|
-
[
|
|
104
|
-
[
|
|
105
|
-
[
|
|
106
|
-
[
|
|
107
|
-
},
|
|
108
|
-
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t),
|
|
109
|
-
return n &&
|
|
110
|
-
},
|
|
98
|
+
}), Ue = (e) => e.value, je = (e) => e.value, qe = (e) => e.value;
|
|
99
|
+
var D = /* @__PURE__ */ ((e) => (e.EQUAL = "EqualTo", e.GREATER_THAN = "GreaterThan", e.LESS_THAN = "LessThan", e.LIST_OF_VALUES = "ListOfValues", e.LIST_OF_VALUES_MULTI = "ListOfValuesMulti", e.RANGE = "Range", e))(D || {});
|
|
100
|
+
const Be = {
|
|
101
|
+
[D.LIST_OF_VALUES]: ze,
|
|
102
|
+
[D.LIST_OF_VALUES_MULTI]: Ve,
|
|
103
|
+
[D.RANGE]: _e,
|
|
104
|
+
[D.GREATER_THAN]: Ue,
|
|
105
|
+
[D.LESS_THAN]: je,
|
|
106
|
+
[D.EQUAL]: qe
|
|
107
|
+
}, j = (e) => {
|
|
108
|
+
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), a = Be[e == null ? void 0 : e.howToSetTheDecision] || Le;
|
|
109
|
+
return n && a(t) || t || void 0;
|
|
110
|
+
}, He = (e) => {
|
|
111
111
|
const {
|
|
112
112
|
conditionsAlignment: t,
|
|
113
113
|
decision: n,
|
|
114
|
-
decisionDateElement:
|
|
115
|
-
decisionMapper:
|
|
114
|
+
decisionDateElement: a,
|
|
115
|
+
decisionMapper: i,
|
|
116
116
|
loading: r,
|
|
117
117
|
skeleton: h,
|
|
118
118
|
terms: l,
|
|
119
|
-
textValues:
|
|
120
|
-
visibleConditions:
|
|
119
|
+
textValues: d,
|
|
120
|
+
visibleConditions: c
|
|
121
121
|
} = e;
|
|
122
|
-
return r ? /* @__PURE__ */
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
|
|
122
|
+
return r ? /* @__PURE__ */ p(g, { direction: "column", gap: "12px", children: [
|
|
123
|
+
/* @__PURE__ */ o(g, { direction: "column", alignItems: "center", children: /* @__PURE__ */ o(
|
|
124
|
+
G,
|
|
125
125
|
{
|
|
126
|
-
element:
|
|
127
|
-
valueData:
|
|
128
|
-
|
|
126
|
+
element: i,
|
|
127
|
+
valueData: j(
|
|
128
|
+
i
|
|
129
129
|
),
|
|
130
130
|
type: "decision"
|
|
131
131
|
}
|
|
132
132
|
) }, n.ruleName),
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
|
|
133
|
+
/* @__PURE__ */ o(I, { dashed: !0 }),
|
|
134
|
+
/* @__PURE__ */ o(de, { children: /* @__PURE__ */ p(
|
|
135
|
+
g,
|
|
136
136
|
{
|
|
137
137
|
direction: "column",
|
|
138
138
|
gap: "12px",
|
|
139
139
|
justifyContent: t,
|
|
140
140
|
height: "203px",
|
|
141
141
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
|
|
142
|
+
/* @__PURE__ */ o(
|
|
143
|
+
C,
|
|
144
144
|
{
|
|
145
145
|
type: "label",
|
|
146
146
|
size: "large",
|
|
147
147
|
appearance: "dark",
|
|
148
148
|
weight: "bold",
|
|
149
149
|
textAlign: "center",
|
|
150
|
-
children:
|
|
150
|
+
children: d.factsThatConditionIt
|
|
151
151
|
}
|
|
152
152
|
),
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
c.map((u) => /* @__PURE__ */ o(se, { children: /* @__PURE__ */ o(g, { direction: "column", padding: "8px", children: /* @__PURE__ */ o(
|
|
154
|
+
G,
|
|
155
155
|
{
|
|
156
|
-
element: { ...
|
|
157
|
-
valueData:
|
|
158
|
-
|
|
156
|
+
element: { ...u, value: u.value },
|
|
157
|
+
valueData: j(
|
|
158
|
+
u
|
|
159
159
|
)
|
|
160
160
|
}
|
|
161
|
-
) }) },
|
|
162
|
-
l && /* @__PURE__ */
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
|
|
165
|
-
|
|
161
|
+
) }) }, u.conditionName)),
|
|
162
|
+
l && /* @__PURE__ */ p(A, { children: [
|
|
163
|
+
/* @__PURE__ */ o(I, { dashed: !0 }),
|
|
164
|
+
a && /* @__PURE__ */ o(
|
|
165
|
+
G,
|
|
166
166
|
{
|
|
167
|
-
element:
|
|
168
|
-
valueData:
|
|
167
|
+
element: a.element,
|
|
168
|
+
valueData: a.valueData,
|
|
169
169
|
type: "decision"
|
|
170
170
|
},
|
|
171
|
-
|
|
171
|
+
d.terms
|
|
172
172
|
)
|
|
173
173
|
] })
|
|
174
174
|
]
|
|
175
175
|
}
|
|
176
176
|
) })
|
|
177
|
-
] }) : /* @__PURE__ */
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
/* @__PURE__ */
|
|
177
|
+
] }) : /* @__PURE__ */ p(g, { direction: "column", gap: "12px", children: [
|
|
178
|
+
/* @__PURE__ */ p(g, { direction: "column", alignItems: "center", gap: "4px", children: [
|
|
179
|
+
/* @__PURE__ */ o(_, { animated: !0, width: "180px" }),
|
|
180
|
+
/* @__PURE__ */ o(_, { animated: !0, width: "85px" })
|
|
181
181
|
] }, "loading"),
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ p(g, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
183
|
+
/* @__PURE__ */ o(I, { dashed: !0 }),
|
|
184
|
+
/* @__PURE__ */ o(_, { animated: !0, width: "150px" })
|
|
185
185
|
] }),
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
|
|
186
|
+
/* @__PURE__ */ o(de, { children: /* @__PURE__ */ o(
|
|
187
|
+
g,
|
|
188
188
|
{
|
|
189
189
|
direction: "column",
|
|
190
190
|
gap: "12px",
|
|
191
191
|
justifyContent: "space-between",
|
|
192
192
|
height: "203px",
|
|
193
|
-
children: h.map((
|
|
194
|
-
|
|
193
|
+
children: h.map((u, s) => /* @__PURE__ */ o(se, { children: /* @__PURE__ */ p(
|
|
194
|
+
g,
|
|
195
195
|
{
|
|
196
196
|
direction: "column",
|
|
197
197
|
gap: "12px",
|
|
198
198
|
alignItems: "start",
|
|
199
199
|
padding: "8px",
|
|
200
200
|
children: [
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ o(_, { animated: !0, width: "180px" }),
|
|
202
|
+
/* @__PURE__ */ o(_, { animated: !0, width: "85px" })
|
|
203
203
|
]
|
|
204
204
|
}
|
|
205
|
-
) }, `condition-${
|
|
205
|
+
) }, `condition-${s}`))
|
|
206
206
|
}
|
|
207
207
|
) })
|
|
208
208
|
] });
|
|
209
|
-
},
|
|
210
|
-
var
|
|
211
|
-
const { decision: t, loading: n = !1, textValues:
|
|
209
|
+
}, xe = (e) => {
|
|
210
|
+
var f;
|
|
211
|
+
const { decision: t, loading: n = !1, textValues: a } = e, i = !!(t != null && t.effectiveFrom), r = !!(t != null && t.validUntil), h = i && r ? {
|
|
212
212
|
element: {
|
|
213
|
-
labelName:
|
|
213
|
+
labelName: a == null ? void 0 : a.terms,
|
|
214
214
|
value: String(t.effectiveFrom),
|
|
215
|
-
howToSetTheDecision:
|
|
216
|
-
decisionDataType:
|
|
215
|
+
howToSetTheDecision: q.RANGE,
|
|
216
|
+
decisionDataType: z.DATE
|
|
217
217
|
},
|
|
218
|
-
valueData:
|
|
219
|
-
labelName:
|
|
218
|
+
valueData: j({
|
|
219
|
+
labelName: a == null ? void 0 : a.terms,
|
|
220
220
|
value: {
|
|
221
221
|
from: String(t.effectiveFrom),
|
|
222
222
|
to: String(t.validUntil)
|
|
223
223
|
},
|
|
224
|
-
howToSetTheDecision:
|
|
225
|
-
decisionDataType:
|
|
224
|
+
howToSetTheDecision: q.RANGE,
|
|
225
|
+
decisionDataType: z.DATE
|
|
226
226
|
})
|
|
227
|
-
} :
|
|
227
|
+
} : i && !r ? {
|
|
228
228
|
element: {
|
|
229
|
-
labelName:
|
|
229
|
+
labelName: a == null ? void 0 : a.terms,
|
|
230
230
|
value: String(t.effectiveFrom),
|
|
231
|
-
howToSetTheDecision:
|
|
232
|
-
decisionDataType:
|
|
231
|
+
howToSetTheDecision: q.EQUAL,
|
|
232
|
+
decisionDataType: z.DATE
|
|
233
233
|
},
|
|
234
|
-
valueData:
|
|
235
|
-
labelName:
|
|
234
|
+
valueData: j({
|
|
235
|
+
labelName: a == null ? void 0 : a.terms,
|
|
236
236
|
value: String(t.effectiveFrom),
|
|
237
|
-
howToSetTheDecision:
|
|
238
|
-
decisionDataType:
|
|
237
|
+
howToSetTheDecision: q.EQUAL,
|
|
238
|
+
decisionDataType: z.DATE
|
|
239
239
|
})
|
|
240
240
|
} : null, l = t ? {
|
|
241
241
|
labelName: t.labelName || "",
|
|
242
242
|
decisionDataType: t.decisionDataType || "alphabetical",
|
|
243
|
-
value:
|
|
243
|
+
value: j(t),
|
|
244
244
|
howToSetTheDecision: t.howToSetTheDecision || "EqualTo"
|
|
245
|
-
} : null,
|
|
245
|
+
} : null, d = ((f = t == null ? void 0 : t.conditionsThatEstablishesTheDecision) == null ? void 0 : f.filter(
|
|
246
246
|
(T) => !T.hidden
|
|
247
|
-
)) || [],
|
|
248
|
-
return /* @__PURE__ */
|
|
249
|
-
|
|
247
|
+
)) || [], c = Array.from({ length: 5 }), u = !!(!n && t && a && l), s = d.length < 2 ? "start" : "space-between";
|
|
248
|
+
return /* @__PURE__ */ o(
|
|
249
|
+
He,
|
|
250
250
|
{
|
|
251
|
-
conditionsAlignment:
|
|
251
|
+
conditionsAlignment: s,
|
|
252
252
|
decision: t,
|
|
253
253
|
decisionDateElement: h,
|
|
254
254
|
decisionMapper: l,
|
|
255
|
-
loading:
|
|
256
|
-
skeleton:
|
|
257
|
-
terms: !!(
|
|
258
|
-
textValues:
|
|
259
|
-
visibleConditions:
|
|
255
|
+
loading: u,
|
|
256
|
+
skeleton: c,
|
|
257
|
+
terms: !!(a != null && a.terms),
|
|
258
|
+
textValues: a,
|
|
259
|
+
visibleConditions: d
|
|
260
260
|
}
|
|
261
261
|
);
|
|
262
|
-
},
|
|
262
|
+
}, Pe = v.div`
|
|
263
263
|
position: relative;
|
|
264
264
|
& > div {
|
|
265
265
|
padding: 24px 16px;
|
|
266
266
|
}
|
|
267
|
-
`,
|
|
267
|
+
`, Ge = v.div`
|
|
268
268
|
background-color: ${({ theme: e }) => {
|
|
269
269
|
var t, n;
|
|
270
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) ||
|
|
270
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || y.palette.neutral.N0;
|
|
271
271
|
}};
|
|
272
272
|
max-width: 450px;
|
|
273
273
|
max-height: 90vh;
|
|
@@ -295,24 +295,24 @@ const Me = {
|
|
|
295
295
|
background-color: #ebecf0;
|
|
296
296
|
border-radius: 8px;
|
|
297
297
|
}
|
|
298
|
-
`,
|
|
299
|
-
const { children: t, portalId: n, onCloseModal:
|
|
298
|
+
`, Qe = (e) => {
|
|
299
|
+
const { children: t, portalId: n, onCloseModal: a, title: i } = e, r = document.getElementById(n);
|
|
300
300
|
if (!r)
|
|
301
301
|
throw new Error(
|
|
302
302
|
"The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
|
|
303
303
|
);
|
|
304
|
-
const h =
|
|
305
|
-
return
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
/* @__PURE__ */
|
|
309
|
-
/* @__PURE__ */
|
|
304
|
+
const h = V("(max-width: 400px)");
|
|
305
|
+
return ye(
|
|
306
|
+
/* @__PURE__ */ o(Pe, { smallScreen: h, children: /* @__PURE__ */ o(fe, { children: /* @__PURE__ */ o(Ge, { children: /* @__PURE__ */ p(g, { direction: "column", gap: "24px", children: [
|
|
307
|
+
/* @__PURE__ */ o(g, { direction: "column", gap: "24px", children: /* @__PURE__ */ p(g, { alignItems: "center", justifyContent: "space-between", children: [
|
|
308
|
+
/* @__PURE__ */ o(C, { type: "title", size: "large", appearance: "dark", weight: "bold", children: i }),
|
|
309
|
+
/* @__PURE__ */ o(pe, { size: "24px", cursor: "pointer", onClick: a })
|
|
310
310
|
] }) }),
|
|
311
311
|
t
|
|
312
312
|
] }) }) }) }),
|
|
313
313
|
r
|
|
314
314
|
);
|
|
315
|
-
},
|
|
315
|
+
}, We = Ee`
|
|
316
316
|
from {
|
|
317
317
|
opacity: 0;
|
|
318
318
|
transform: translateY(20px);
|
|
@@ -322,12 +322,12 @@ const Me = {
|
|
|
322
322
|
transform: translateY(0);
|
|
323
323
|
}
|
|
324
324
|
`;
|
|
325
|
-
|
|
325
|
+
v.div`
|
|
326
326
|
border-radius: 8px;
|
|
327
327
|
border: 1px solid
|
|
328
328
|
${({ theme: e }) => {
|
|
329
329
|
var t, n;
|
|
330
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) ||
|
|
330
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || y.palette.neutral.N30;
|
|
331
331
|
}};
|
|
332
332
|
box-sizing: border-box;
|
|
333
333
|
display: flex;
|
|
@@ -336,21 +336,21 @@ f.div`
|
|
|
336
336
|
height: 100%;
|
|
337
337
|
box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
|
|
338
338
|
`;
|
|
339
|
-
|
|
339
|
+
v.div`
|
|
340
340
|
& > div {
|
|
341
341
|
border-radius: 8px;
|
|
342
342
|
border: 1px solid
|
|
343
343
|
${({ theme: e }) => {
|
|
344
344
|
var t, n;
|
|
345
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) ||
|
|
345
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || y.palette.neutral.N30;
|
|
346
346
|
}};
|
|
347
347
|
}
|
|
348
348
|
`;
|
|
349
|
-
const
|
|
349
|
+
const Ye = v.div`
|
|
350
350
|
& > div {
|
|
351
351
|
background-color: ${({ theme: e }) => {
|
|
352
352
|
var t, n;
|
|
353
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N10) ||
|
|
353
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N10) || y.palette.neutral.N10;
|
|
354
354
|
}};
|
|
355
355
|
justify-content: center;
|
|
356
356
|
}
|
|
@@ -358,18 +358,18 @@ const Ue = f.div`
|
|
|
358
358
|
width: 100%;
|
|
359
359
|
height: 100%;
|
|
360
360
|
padding-bottom: 12px;
|
|
361
|
-
`,
|
|
361
|
+
`, we = v.div`
|
|
362
362
|
width: 100%;
|
|
363
363
|
height: 100%;
|
|
364
364
|
& > div {
|
|
365
|
-
animation: ${
|
|
365
|
+
animation: ${We} 600ms ease-out;
|
|
366
366
|
}
|
|
367
|
-
`,
|
|
367
|
+
`, Ke = v.div`
|
|
368
368
|
& > div > div {
|
|
369
369
|
border-radius: 8px;
|
|
370
370
|
box-sizing: border-box;
|
|
371
371
|
}
|
|
372
|
-
`,
|
|
372
|
+
`, Je = v.div`
|
|
373
373
|
& > div {
|
|
374
374
|
width: 100%;
|
|
375
375
|
height: 100%;
|
|
@@ -390,61 +390,61 @@ const Ue = f.div`
|
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
`;
|
|
393
|
-
function
|
|
393
|
+
function Xe(e) {
|
|
394
394
|
const { index: t, handleOpenModal: n } = e;
|
|
395
|
-
return /* @__PURE__ */
|
|
396
|
-
|
|
395
|
+
return /* @__PURE__ */ o(
|
|
396
|
+
ee,
|
|
397
397
|
{
|
|
398
398
|
id: `loading-card-${t}`,
|
|
399
399
|
handleDelete: () => {
|
|
400
400
|
},
|
|
401
401
|
handleView: () => n ? n() : null,
|
|
402
402
|
controls: !1,
|
|
403
|
-
children: /* @__PURE__ */
|
|
403
|
+
children: /* @__PURE__ */ o(xe, { loading: !0 })
|
|
404
404
|
},
|
|
405
405
|
`loading-card-${t}`
|
|
406
406
|
);
|
|
407
407
|
}
|
|
408
|
-
function
|
|
409
|
-
const { decision: t, controls: n, handleOpenModal:
|
|
410
|
-
return t ? /* @__PURE__ */
|
|
411
|
-
/* @__PURE__ */
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
|
|
408
|
+
function Ze(e) {
|
|
409
|
+
const { decision: t, controls: n, handleOpenModal: a, handleDelete: i, textValues: r } = e;
|
|
410
|
+
return t ? /* @__PURE__ */ o(we, { children: /* @__PURE__ */ p(g, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
|
|
411
|
+
/* @__PURE__ */ o(C, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: t.decisionId }),
|
|
412
|
+
/* @__PURE__ */ o(
|
|
413
|
+
ee,
|
|
414
414
|
{
|
|
415
415
|
id: t.decisionId,
|
|
416
|
-
handleDelete: () =>
|
|
417
|
-
handleView: () =>
|
|
416
|
+
handleDelete: () => i ? i(t.decisionId) : null,
|
|
417
|
+
handleView: () => a ? a(t) : null,
|
|
418
418
|
controls: n,
|
|
419
|
-
children: /* @__PURE__ */
|
|
419
|
+
children: /* @__PURE__ */ o(xe, { decision: t, textValues: r })
|
|
420
420
|
}
|
|
421
421
|
)
|
|
422
422
|
] }) }, t.decisionId) : null;
|
|
423
423
|
}
|
|
424
|
-
function
|
|
424
|
+
function et(e) {
|
|
425
425
|
const {
|
|
426
426
|
customTitleContentAddCard: t,
|
|
427
427
|
index: n,
|
|
428
|
-
handleOpenModal:
|
|
429
|
-
shouldRenderEmptyMessage:
|
|
428
|
+
handleOpenModal: a,
|
|
429
|
+
shouldRenderEmptyMessage: i
|
|
430
430
|
} = e, r = t || "Agregar decisión";
|
|
431
|
-
return /* @__PURE__ */
|
|
432
|
-
/* @__PURE__ */
|
|
433
|
-
/* @__PURE__ */
|
|
434
|
-
|
|
431
|
+
return /* @__PURE__ */ o(we, { children: i ? null : /* @__PURE__ */ p(g, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
|
|
432
|
+
/* @__PURE__ */ o(C, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
|
|
433
|
+
/* @__PURE__ */ o(
|
|
434
|
+
Ye,
|
|
435
435
|
{
|
|
436
|
-
onClick: () =>
|
|
437
|
-
children: /* @__PURE__ */
|
|
438
|
-
|
|
436
|
+
onClick: () => a ? a() : null,
|
|
437
|
+
children: /* @__PURE__ */ o(
|
|
438
|
+
ee,
|
|
439
439
|
{
|
|
440
440
|
id: `add-decision-${n}`,
|
|
441
441
|
handleDelete: () => {
|
|
442
442
|
},
|
|
443
|
-
handleView: () =>
|
|
443
|
+
handleView: () => a ? a() : null,
|
|
444
444
|
controls: !1,
|
|
445
|
-
children: /* @__PURE__ */
|
|
446
|
-
/* @__PURE__ */
|
|
447
|
-
/* @__PURE__ */
|
|
445
|
+
children: /* @__PURE__ */ p(g, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
446
|
+
/* @__PURE__ */ o(M, { appearance: "gray", icon: /* @__PURE__ */ o(ge, {}), size: "35px" }),
|
|
447
|
+
/* @__PURE__ */ o(C, { appearance: "gray", type: "body", size: "large", children: r })
|
|
448
448
|
] })
|
|
449
449
|
}
|
|
450
450
|
)
|
|
@@ -452,86 +452,86 @@ function Pe(e) {
|
|
|
452
452
|
)
|
|
453
453
|
] }) }, `add-decision-${n}`);
|
|
454
454
|
}
|
|
455
|
-
const
|
|
456
|
-
loading:
|
|
457
|
-
decision:
|
|
458
|
-
add:
|
|
459
|
-
},
|
|
460
|
-
const { type: t } = e, n =
|
|
455
|
+
const tt = {
|
|
456
|
+
loading: Xe,
|
|
457
|
+
decision: Ze,
|
|
458
|
+
add: et
|
|
459
|
+
}, Y = (e) => {
|
|
460
|
+
const { type: t } = e, n = tt[t];
|
|
461
461
|
return n ? n(e) : null;
|
|
462
|
-
},
|
|
462
|
+
}, nt = (e) => {
|
|
463
463
|
const {
|
|
464
464
|
controls: t,
|
|
465
465
|
customTitleContentAddCard: n,
|
|
466
|
-
decisions:
|
|
467
|
-
loading:
|
|
466
|
+
decisions: a,
|
|
467
|
+
loading: i,
|
|
468
468
|
handleOpenModal: r,
|
|
469
469
|
handleDelete: h,
|
|
470
470
|
textValues: l
|
|
471
|
-
} = e,
|
|
472
|
-
(
|
|
471
|
+
} = e, d = i ? Array.from({ length: 3 }).map(
|
|
472
|
+
(u, s) => Y({
|
|
473
473
|
type: "loading",
|
|
474
|
-
index:
|
|
474
|
+
index: s,
|
|
475
475
|
controls: t,
|
|
476
476
|
customTitleContentAddCard: n,
|
|
477
|
-
loading:
|
|
477
|
+
loading: i,
|
|
478
478
|
handleOpenModal: r,
|
|
479
479
|
handleDelete: h,
|
|
480
480
|
textValues: l
|
|
481
481
|
})
|
|
482
|
-
) :
|
|
483
|
-
(
|
|
482
|
+
) : a == null ? void 0 : a.map(
|
|
483
|
+
(u) => Y({
|
|
484
484
|
type: "decision",
|
|
485
|
-
decision:
|
|
485
|
+
decision: u,
|
|
486
486
|
controls: t,
|
|
487
487
|
customTitleContentAddCard: n,
|
|
488
|
-
loading:
|
|
488
|
+
loading: i,
|
|
489
489
|
handleOpenModal: r,
|
|
490
490
|
handleDelete: h,
|
|
491
491
|
textValues: l
|
|
492
492
|
})
|
|
493
|
-
),
|
|
494
|
-
return { renderedCards:
|
|
495
|
-
},
|
|
493
|
+
), c = ((a == null ? void 0 : a.length) === 0 || a.length < Math.floor(window.innerWidth / 300)) && !i && t;
|
|
494
|
+
return { renderedCards: d, shouldRenderAddCard: c };
|
|
495
|
+
}, Pt = (e) => {
|
|
496
496
|
const {
|
|
497
497
|
controls: t = !0,
|
|
498
498
|
customTitleContentAddCard: n,
|
|
499
|
-
customMessageEmptyDecisions:
|
|
500
|
-
decisions:
|
|
499
|
+
customMessageEmptyDecisions: a,
|
|
500
|
+
decisions: i,
|
|
501
501
|
textValues: r,
|
|
502
502
|
decisionTemplate: h,
|
|
503
503
|
isModalOpen: l,
|
|
504
|
-
selectedDecision:
|
|
505
|
-
loading:
|
|
506
|
-
handleOpenModal:
|
|
507
|
-
handleCloseModal:
|
|
508
|
-
handleSubmitForm:
|
|
504
|
+
selectedDecision: d,
|
|
505
|
+
loading: c,
|
|
506
|
+
handleOpenModal: u,
|
|
507
|
+
handleCloseModal: s,
|
|
508
|
+
handleSubmitForm: f,
|
|
509
509
|
handleDelete: T,
|
|
510
|
-
terms:
|
|
511
|
-
} = e,
|
|
510
|
+
terms: b = !0
|
|
511
|
+
} = e, x = V("(max-width: 681px)"), w = V("(max-width: 400px)"), { renderedCards: S, shouldRenderAddCard: k } = nt({
|
|
512
512
|
controls: t,
|
|
513
513
|
customTitleContentAddCard: n,
|
|
514
|
-
decisions:
|
|
515
|
-
loading:
|
|
516
|
-
handleOpenModal:
|
|
514
|
+
decisions: i,
|
|
515
|
+
loading: c,
|
|
516
|
+
handleOpenModal: u,
|
|
517
517
|
handleDelete: T,
|
|
518
518
|
textValues: r
|
|
519
|
-
}),
|
|
520
|
-
return /* @__PURE__ */
|
|
521
|
-
/* @__PURE__ */
|
|
522
|
-
|
|
519
|
+
}), F = (i == null ? void 0 : i.length) === 0 && !c;
|
|
520
|
+
return /* @__PURE__ */ p(A, { children: [
|
|
521
|
+
/* @__PURE__ */ o(Ke, { children: /* @__PURE__ */ o(Je, { children: /* @__PURE__ */ o(g, { direction: "column", gap: "16px", padding: "6px", children: F ? /* @__PURE__ */ p(
|
|
522
|
+
g,
|
|
523
523
|
{
|
|
524
524
|
direction: "column",
|
|
525
525
|
gap: "28px",
|
|
526
526
|
width: "100%",
|
|
527
|
-
height:
|
|
527
|
+
height: x ? "auto" : "435px",
|
|
528
528
|
justifyContent: "center",
|
|
529
529
|
alignItems: "center",
|
|
530
530
|
children: [
|
|
531
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ o(C, { as: "span", type: "label", size: "large", appearance: "gray", children: a || /* @__PURE__ */ p(A, { children: [
|
|
532
532
|
"Aún NO tienes definidas tasas de interés efectivas . Presiona",
|
|
533
|
-
/* @__PURE__ */
|
|
534
|
-
|
|
533
|
+
/* @__PURE__ */ p(
|
|
534
|
+
C,
|
|
535
535
|
{
|
|
536
536
|
as: "span",
|
|
537
537
|
type: "label",
|
|
@@ -547,20 +547,20 @@ const Ge = {
|
|
|
547
547
|
),
|
|
548
548
|
"para empezar."
|
|
549
549
|
] }) }),
|
|
550
|
-
/* @__PURE__ */
|
|
551
|
-
|
|
550
|
+
/* @__PURE__ */ o(
|
|
551
|
+
L,
|
|
552
552
|
{
|
|
553
|
-
iconBefore: /* @__PURE__ */
|
|
554
|
-
onClick: () =>
|
|
553
|
+
iconBefore: /* @__PURE__ */ o(ge, {}),
|
|
554
|
+
onClick: () => u ? u() : null,
|
|
555
555
|
children: n || "Agregar decisión"
|
|
556
556
|
}
|
|
557
557
|
)
|
|
558
558
|
]
|
|
559
559
|
}
|
|
560
|
-
) : /* @__PURE__ */
|
|
561
|
-
|
|
560
|
+
) : /* @__PURE__ */ p(
|
|
561
|
+
J,
|
|
562
562
|
{
|
|
563
|
-
templateColumns:
|
|
563
|
+
templateColumns: w ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(auto-fill, minmax(300px, 1fr))",
|
|
564
564
|
autoFlow: "row dense",
|
|
565
565
|
gap: "24px",
|
|
566
566
|
alignItems: "start",
|
|
@@ -568,117 +568,122 @@ const Ge = {
|
|
|
568
568
|
autoRows: "1fr",
|
|
569
569
|
justifyItems: "center",
|
|
570
570
|
padding: "6px",
|
|
571
|
-
height:
|
|
571
|
+
height: x ? "auto" : "484px",
|
|
572
572
|
children: [
|
|
573
|
-
|
|
574
|
-
|
|
573
|
+
S,
|
|
574
|
+
k && Y({
|
|
575
575
|
type: "add",
|
|
576
|
-
index:
|
|
576
|
+
index: i == null ? void 0 : i.length,
|
|
577
577
|
controls: t,
|
|
578
578
|
customTitleContentAddCard: n,
|
|
579
|
-
customMessageEmptyDecisions:
|
|
580
|
-
loading:
|
|
581
|
-
handleOpenModal:
|
|
579
|
+
customMessageEmptyDecisions: a,
|
|
580
|
+
loading: c,
|
|
581
|
+
handleOpenModal: u,
|
|
582
582
|
handleDelete: T,
|
|
583
583
|
textValues: r,
|
|
584
|
-
shouldRenderEmptyMessage:
|
|
585
|
-
terms:
|
|
584
|
+
shouldRenderEmptyMessage: F,
|
|
585
|
+
terms: b
|
|
586
586
|
})
|
|
587
587
|
]
|
|
588
588
|
}
|
|
589
589
|
) }) }) }),
|
|
590
|
-
l && /* @__PURE__ */
|
|
591
|
-
|
|
590
|
+
l && /* @__PURE__ */ o(
|
|
591
|
+
Qe,
|
|
592
592
|
{
|
|
593
593
|
portalId: "modal-portal",
|
|
594
|
-
onCloseModal:
|
|
595
|
-
title:
|
|
596
|
-
children: /* @__PURE__ */
|
|
597
|
-
|
|
594
|
+
onCloseModal: s,
|
|
595
|
+
title: d ? "Editar Decisión" : "Nueva decisión",
|
|
596
|
+
children: /* @__PURE__ */ o(
|
|
597
|
+
Dt,
|
|
598
598
|
{
|
|
599
|
-
decision:
|
|
600
|
-
onSubmitEvent:
|
|
599
|
+
decision: d || h,
|
|
600
|
+
onSubmitEvent: f,
|
|
601
601
|
textValues: r,
|
|
602
|
-
onCancel: () =>
|
|
602
|
+
onCancel: () => s ? s() : () => {
|
|
603
603
|
}
|
|
604
604
|
}
|
|
605
605
|
)
|
|
606
606
|
}
|
|
607
607
|
)
|
|
608
608
|
] });
|
|
609
|
-
},
|
|
609
|
+
}, ot = v.div`
|
|
610
610
|
display: flex;
|
|
611
|
-
justify-content: ${({ justifyContent: e }) => e};
|
|
612
|
-
align-items: ${({ alignItems: e }) => e};
|
|
613
|
-
align-content: ${({ alignContent: e }) => e};
|
|
611
|
+
justify-content: ${({ $justifyContent: e }) => e};
|
|
612
|
+
align-items: ${({ $alignItems: e }) => e};
|
|
613
|
+
align-content: ${({ $alignContent: e }) => e};
|
|
614
614
|
flex-direction: ${({ direction: e }) => e};
|
|
615
|
-
flex-wrap: ${({ wrap: e }) => e};
|
|
615
|
+
flex-wrap: ${({ $wrap: e }) => e};
|
|
616
616
|
height: ${({ height: e }) => e};
|
|
617
617
|
width: ${({ width: e }) => e};
|
|
618
|
-
gap: ${({ gap: e }) => e};
|
|
619
|
-
margin: ${({ margin: e }) => e};
|
|
620
|
-
padding: ${({ padding: e }) => e};
|
|
621
|
-
background: ${({ background: e, theme: t }) => {
|
|
622
|
-
var n,
|
|
623
|
-
return e ? `${((
|
|
618
|
+
gap: ${({ $gap: e }) => e};
|
|
619
|
+
margin: ${({ $margin: e }) => e};
|
|
620
|
+
padding: ${({ $padding: e }) => e};
|
|
621
|
+
background: ${({ $background: e, theme: t }) => {
|
|
622
|
+
var n, a, i, r;
|
|
623
|
+
return e ? `${((a = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : a.N10) || y.palette.neutral.N10}` : `${((r = (i = t == null ? void 0 : t.palette) == null ? void 0 : i.neutral) == null ? void 0 : r.N0) || y.palette.neutral.N0}`;
|
|
624
624
|
}};
|
|
625
|
-
border: ${({ border: e, theme: t }) => {
|
|
626
|
-
var n,
|
|
627
|
-
return e ? `1px solid ${((
|
|
625
|
+
border: ${({ $border: e, theme: t }) => {
|
|
626
|
+
var n, a;
|
|
627
|
+
return e ? `1px solid ${((a = (n = t == null ? void 0 : t.palette) == null ? void 0 : n.neutral) == null ? void 0 : a.N40) || y.palette.neutral.N40}` : "none";
|
|
628
628
|
}};
|
|
629
|
-
border-radius: ${({ borderRadius: e }) => e};
|
|
630
|
-
box-sizing: ${({ boxSizing: e }) => e};
|
|
631
|
-
overflow-y: ${({ scroll: e }) => e ? "scroll" : "none"};
|
|
632
|
-
`,
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
}
|
|
629
|
+
border-radius: ${({ $borderRadius: e }) => e};
|
|
630
|
+
box-sizing: ${({ $boxSizing: e }) => e};
|
|
631
|
+
overflow-y: ${({ $scroll: e }) => e ? "scroll" : "none"};
|
|
632
|
+
`, te = Ae.forwardRef(
|
|
633
|
+
(e, t) => {
|
|
634
|
+
const {
|
|
635
|
+
children: n,
|
|
636
|
+
wrap: a,
|
|
637
|
+
direction: i = "column",
|
|
638
|
+
justifyContent: r,
|
|
639
|
+
alignItems: h,
|
|
640
|
+
alignContent: l,
|
|
641
|
+
height: d,
|
|
642
|
+
width: c,
|
|
643
|
+
gap: u,
|
|
644
|
+
background: s,
|
|
645
|
+
borderRadius: f,
|
|
646
|
+
border: T,
|
|
647
|
+
margin: b = "0px",
|
|
648
|
+
padding: x = "0px",
|
|
649
|
+
boxSizing: w,
|
|
650
|
+
scroll: S = !1
|
|
651
|
+
} = e;
|
|
652
|
+
return /* @__PURE__ */ o(
|
|
653
|
+
ot,
|
|
654
|
+
{
|
|
655
|
+
ref: t,
|
|
656
|
+
direction: i,
|
|
657
|
+
$justifyContent: r,
|
|
658
|
+
$alignItems: h,
|
|
659
|
+
$alignContent: l,
|
|
660
|
+
height: d,
|
|
661
|
+
width: c,
|
|
662
|
+
wrap: a,
|
|
663
|
+
$gap: u,
|
|
664
|
+
$background: s,
|
|
665
|
+
$border: T,
|
|
666
|
+
$margin: b,
|
|
667
|
+
$padding: x,
|
|
668
|
+
$borderRadius: f,
|
|
669
|
+
$boxSizing: w,
|
|
670
|
+
$scroll: S,
|
|
671
|
+
children: n
|
|
672
|
+
}
|
|
673
|
+
);
|
|
674
|
+
}
|
|
675
|
+
);
|
|
676
|
+
te.displayName = "BorderStack";
|
|
677
|
+
const at = {
|
|
673
678
|
border: {
|
|
674
|
-
color:
|
|
679
|
+
color: y.palette.neutral.N40
|
|
675
680
|
}
|
|
676
|
-
},
|
|
681
|
+
}, it = v.div`
|
|
677
682
|
border-width: 1px;
|
|
678
683
|
border-style: solid;
|
|
679
684
|
border-color: ${({ theme: e }) => {
|
|
680
685
|
var t, n;
|
|
681
|
-
return ((n = (t = e == null ? void 0 : e.box) == null ? void 0 : t.border) == null ? void 0 : n.color) ||
|
|
686
|
+
return ((n = (t = e == null ? void 0 : e.box) == null ? void 0 : t.border) == null ? void 0 : n.color) || at.border.color;
|
|
682
687
|
}};
|
|
683
688
|
border-radius: ${({ $borderRadius: e }) => e};
|
|
684
689
|
margin: ${({ $margin: e }) => e};
|
|
@@ -687,90 +692,316 @@ const Ge = {
|
|
|
687
692
|
height: ${({ $height: e }) => e};
|
|
688
693
|
box-sizing: border-box;
|
|
689
694
|
`;
|
|
690
|
-
function
|
|
695
|
+
function rt(e) {
|
|
691
696
|
const {
|
|
692
697
|
children: t,
|
|
693
698
|
padding: n = "16px",
|
|
694
|
-
margin:
|
|
695
|
-
borderRadius:
|
|
699
|
+
margin: a,
|
|
700
|
+
borderRadius: i = "8px",
|
|
696
701
|
width: r,
|
|
697
702
|
height: h
|
|
698
703
|
} = e;
|
|
699
|
-
return /* @__PURE__ */
|
|
700
|
-
|
|
704
|
+
return /* @__PURE__ */ o(
|
|
705
|
+
it,
|
|
701
706
|
{
|
|
702
707
|
$padding: n,
|
|
703
|
-
$margin:
|
|
704
|
-
$borderRadius:
|
|
708
|
+
$margin: a,
|
|
709
|
+
$borderRadius: i,
|
|
705
710
|
$width: r,
|
|
706
711
|
$height: h,
|
|
707
712
|
children: t
|
|
708
713
|
}
|
|
709
714
|
);
|
|
710
715
|
}
|
|
711
|
-
const
|
|
716
|
+
const lt = (e, t) => {
|
|
717
|
+
const [n, a] = R([]), [i, r] = R([]), [h, l] = R(!1), d = H(null);
|
|
718
|
+
return X(() => {
|
|
719
|
+
if (!e.current || !d.current) return;
|
|
720
|
+
const c = e.current, u = d.current, s = () => {
|
|
721
|
+
var F;
|
|
722
|
+
const T = c.clientWidth, b = Array.from(
|
|
723
|
+
u.querySelectorAll('[data-filter-tag="true"]')
|
|
724
|
+
), x = 48;
|
|
725
|
+
let w = 0;
|
|
726
|
+
const S = [], k = [];
|
|
727
|
+
for (let $ = 0; $ < t.length; $++) {
|
|
728
|
+
const m = ((F = b[$]) == null ? void 0 : F.offsetWidth) ?? 0;
|
|
729
|
+
w + m + x <= T ? (S.push(t[$]), w += m) : k.push(t[$]);
|
|
730
|
+
}
|
|
731
|
+
a(S), r(k), l(k.length > 0);
|
|
732
|
+
}, f = new ResizeObserver(() => {
|
|
733
|
+
requestAnimationFrame(s);
|
|
734
|
+
});
|
|
735
|
+
return f.observe(c), () => f.disconnect();
|
|
736
|
+
}, [t, e]), { visible: n, hidden: i, showOverflowIndicator: h, measurementRef: d };
|
|
737
|
+
};
|
|
738
|
+
v.div`
|
|
739
|
+
& > div {
|
|
740
|
+
width: 100%;
|
|
741
|
+
}
|
|
742
|
+
`;
|
|
743
|
+
const st = v.div`
|
|
744
|
+
position: absolute;
|
|
745
|
+
top: calc(100% + 4px);
|
|
746
|
+
right: 0;
|
|
747
|
+
z-index: 1000;
|
|
748
|
+
width: 170px;
|
|
749
|
+
`, dt = v.div`
|
|
750
|
+
position: absolute;
|
|
751
|
+
visibility: hidden;
|
|
752
|
+
pointer-events: none;
|
|
753
|
+
height: 0;
|
|
754
|
+
overflow: hidden;
|
|
755
|
+
`, ct = v.div`
|
|
756
|
+
cursor: pointer;
|
|
757
|
+
`, K = {
|
|
758
|
+
border: {
|
|
759
|
+
color: {
|
|
760
|
+
regular: y.palette.neutral.N40,
|
|
761
|
+
disabled: y.palette.neutral.N40,
|
|
762
|
+
focus: y.palette.blue.B300,
|
|
763
|
+
invalid: y.palette.red.R400
|
|
764
|
+
}
|
|
765
|
+
},
|
|
766
|
+
background: {
|
|
767
|
+
color: {
|
|
768
|
+
regular: y.palette.neutral.N0,
|
|
769
|
+
disabled: y.palette.neutral.N10
|
|
770
|
+
}
|
|
771
|
+
},
|
|
772
|
+
content: {
|
|
773
|
+
color: {
|
|
774
|
+
regular: y.palette.neutral.N900,
|
|
775
|
+
disabled: y.palette.neutral.N70
|
|
776
|
+
}
|
|
777
|
+
},
|
|
778
|
+
placeholder: {
|
|
779
|
+
color: {
|
|
780
|
+
regular: y.palette.neutral.N300
|
|
781
|
+
}
|
|
782
|
+
},
|
|
783
|
+
option: {
|
|
784
|
+
appearance: {
|
|
785
|
+
regular: "dark",
|
|
786
|
+
hover: "primary"
|
|
787
|
+
},
|
|
788
|
+
background: {
|
|
789
|
+
regular: y.palette.neutral.N0,
|
|
790
|
+
hover: y.palette.neutral.N30
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
}, ut = v.li`
|
|
794
|
+
display: flex;
|
|
795
|
+
align-items: center;
|
|
796
|
+
align-self: stretch;
|
|
797
|
+
min-height: 40px;
|
|
798
|
+
border-left: 4px solid transparent;
|
|
799
|
+
padding: 4px 16px 4px 12px;
|
|
800
|
+
cursor: pointer;
|
|
801
|
+
|
|
802
|
+
border-left-width: 4px;
|
|
803
|
+
border-left-style: solid;
|
|
804
|
+
|
|
805
|
+
&:hover {
|
|
806
|
+
background-color: ${({ theme: e }) => {
|
|
807
|
+
var t, n, a;
|
|
808
|
+
return ((a = (n = (t = e == null ? void 0 : e.input) == null ? void 0 : t.background) == null ? void 0 : n.color) == null ? void 0 : a.regular) || K.background.color.regular;
|
|
809
|
+
}};
|
|
810
|
+
}
|
|
811
|
+
`, ht = (e) => {
|
|
812
|
+
var f, T, b, x, w, S;
|
|
813
|
+
const { id: t, label: n, leadingIcon: a, onClose: i } = e, [r, h] = R(!1), l = () => h(!0), d = () => h(!1), c = Fe($e), u = ((b = (T = (f = c == null ? void 0 : c.input) == null ? void 0 : f.option) == null ? void 0 : T.appearance) == null ? void 0 : b.hover) ?? K.option.appearance.hover, s = ((S = (w = (x = c == null ? void 0 : c.input) == null ? void 0 : x.option) == null ? void 0 : w.appearance) == null ? void 0 : S.regular) ?? K.option.appearance.regular;
|
|
814
|
+
return /* @__PURE__ */ o(
|
|
815
|
+
ut,
|
|
816
|
+
{
|
|
817
|
+
id: t,
|
|
818
|
+
onMouseEnter: l,
|
|
819
|
+
onMouseLeave: d,
|
|
820
|
+
onClick: (k) => {
|
|
821
|
+
k.stopPropagation();
|
|
822
|
+
},
|
|
823
|
+
children: /* @__PURE__ */ p(
|
|
824
|
+
J,
|
|
825
|
+
{
|
|
826
|
+
alignItems: "center",
|
|
827
|
+
gap: "8px",
|
|
828
|
+
templateColumns: "auto 1fr auto",
|
|
829
|
+
width: "100%",
|
|
830
|
+
children: [
|
|
831
|
+
a && /* @__PURE__ */ o(
|
|
832
|
+
M,
|
|
833
|
+
{
|
|
834
|
+
icon: a,
|
|
835
|
+
size: "medium",
|
|
836
|
+
appearance: r ? u : s
|
|
837
|
+
}
|
|
838
|
+
),
|
|
839
|
+
/* @__PURE__ */ o(
|
|
840
|
+
C,
|
|
841
|
+
{
|
|
842
|
+
textAlign: "start",
|
|
843
|
+
size: "medium",
|
|
844
|
+
appearance: r ? u : s,
|
|
845
|
+
children: n
|
|
846
|
+
}
|
|
847
|
+
),
|
|
848
|
+
/* @__PURE__ */ o(
|
|
849
|
+
M,
|
|
850
|
+
{
|
|
851
|
+
icon: /* @__PURE__ */ o(Se, {}),
|
|
852
|
+
size: "small",
|
|
853
|
+
onClick: (k) => {
|
|
854
|
+
k.stopPropagation(), i == null || i();
|
|
855
|
+
},
|
|
856
|
+
appearance: r ? u : s,
|
|
857
|
+
cursorHover: !0
|
|
858
|
+
}
|
|
859
|
+
)
|
|
860
|
+
]
|
|
861
|
+
}
|
|
862
|
+
)
|
|
863
|
+
}
|
|
864
|
+
);
|
|
865
|
+
}, Gt = (e) => {
|
|
712
866
|
const {
|
|
713
|
-
appliedFilters: t,
|
|
867
|
+
appliedFilters: t = [],
|
|
714
868
|
onClear: n,
|
|
715
|
-
onClick:
|
|
716
|
-
noFiltersLabel:
|
|
869
|
+
onClick: a,
|
|
870
|
+
noFiltersLabel: i,
|
|
717
871
|
titleClearFilter: r,
|
|
718
872
|
titleFilter: h
|
|
719
|
-
} = e, l =
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
),
|
|
746
|
-
|
|
747
|
-
N,
|
|
748
|
-
{
|
|
749
|
-
cursorHover: !0,
|
|
750
|
-
disabled: l,
|
|
751
|
-
iconBefore: /* @__PURE__ */ a(ie, {}),
|
|
752
|
-
onClick: n,
|
|
753
|
-
variant: "outlined",
|
|
754
|
-
children: r
|
|
755
|
-
}
|
|
756
|
-
),
|
|
757
|
-
/* @__PURE__ */ a(
|
|
758
|
-
N,
|
|
873
|
+
} = e, l = H(null), d = H(null), c = H(null), {
|
|
874
|
+
visible: u,
|
|
875
|
+
hidden: s,
|
|
876
|
+
showOverflowIndicator: f,
|
|
877
|
+
measurementRef: T
|
|
878
|
+
} = lt(l, t), [b, x] = R(!1), w = (m) => {
|
|
879
|
+
m.stopPropagation(), x((N) => !N);
|
|
880
|
+
};
|
|
881
|
+
X(() => {
|
|
882
|
+
const m = (N) => {
|
|
883
|
+
var ne, oe;
|
|
884
|
+
const O = N.target;
|
|
885
|
+
!((ne = d.current) != null && ne.contains(O)) && !((oe = c.current) != null && oe.contains(O)) && x(!1);
|
|
886
|
+
};
|
|
887
|
+
return b && window.addEventListener("mousedown", m), () => window.removeEventListener("mousedown", m);
|
|
888
|
+
}, [b]);
|
|
889
|
+
const S = t.length === 0, k = b && s.length > 0, F = s.map((m) => ({
|
|
890
|
+
id: m.label,
|
|
891
|
+
value: m.label,
|
|
892
|
+
label: m.label,
|
|
893
|
+
icon: m.icon
|
|
894
|
+
})), $ = (m) => {
|
|
895
|
+
var N, O;
|
|
896
|
+
(O = (N = s.find((E) => E.label === m)) == null ? void 0 : N.onClose) == null || O.call(N), x(!1);
|
|
897
|
+
};
|
|
898
|
+
return /* @__PURE__ */ p(rt, { borderRadius: "8px", width: "100%", children: [
|
|
899
|
+
/* @__PURE__ */ o(dt, { ref: T, children: t.map((m) => /* @__PURE__ */ o("div", { "data-filter-tag": "true", children: /* @__PURE__ */ o(
|
|
900
|
+
B,
|
|
759
901
|
{
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
902
|
+
appearance: "primary",
|
|
903
|
+
displayIcon: !0,
|
|
904
|
+
removable: !0,
|
|
905
|
+
icon: m.icon,
|
|
906
|
+
label: m.label,
|
|
907
|
+
onClose: m.onClose
|
|
765
908
|
}
|
|
766
|
-
)
|
|
767
|
-
|
|
768
|
-
|
|
909
|
+
) }, m.label)) }),
|
|
910
|
+
/* @__PURE__ */ p(J, { gap: "12px", templateColumns: "1fr auto auto", width: "100%", children: [
|
|
911
|
+
/* @__PURE__ */ o(
|
|
912
|
+
te,
|
|
913
|
+
{
|
|
914
|
+
ref: l,
|
|
915
|
+
background: !0,
|
|
916
|
+
borderRadius: "8px",
|
|
917
|
+
height: "100%",
|
|
918
|
+
direction: "row",
|
|
919
|
+
gap: "8px",
|
|
920
|
+
alignItems: "center",
|
|
921
|
+
padding: "0px 8px",
|
|
922
|
+
border: !0,
|
|
923
|
+
children: S ? /* @__PURE__ */ o(C, { size: "small", type: "label", appearance: "gray", children: i }) : /* @__PURE__ */ p(A, { children: [
|
|
924
|
+
u.map((m) => /* @__PURE__ */ o(
|
|
925
|
+
B,
|
|
926
|
+
{
|
|
927
|
+
"data-filter-tag": "true",
|
|
928
|
+
appearance: "primary",
|
|
929
|
+
displayIcon: !0,
|
|
930
|
+
removable: !0,
|
|
931
|
+
icon: m.icon,
|
|
932
|
+
label: m.label,
|
|
933
|
+
onClose: m.onClose
|
|
934
|
+
},
|
|
935
|
+
m.label
|
|
936
|
+
)),
|
|
937
|
+
f && /* @__PURE__ */ p(
|
|
938
|
+
"div",
|
|
939
|
+
{
|
|
940
|
+
ref: c,
|
|
941
|
+
style: { position: "relative", display: "inline-block" },
|
|
942
|
+
children: [
|
|
943
|
+
/* @__PURE__ */ o(ct, { onClick: w, children: /* @__PURE__ */ o(
|
|
944
|
+
B,
|
|
945
|
+
{
|
|
946
|
+
appearance: "primary",
|
|
947
|
+
label: `+${s.length}`
|
|
948
|
+
}
|
|
949
|
+
) }),
|
|
950
|
+
k && /* @__PURE__ */ o(st, { ref: d, children: /* @__PURE__ */ o(
|
|
951
|
+
De,
|
|
952
|
+
{
|
|
953
|
+
options: F,
|
|
954
|
+
onOptionClick: $,
|
|
955
|
+
children: s.map((m) => /* @__PURE__ */ o(
|
|
956
|
+
ht,
|
|
957
|
+
{
|
|
958
|
+
id: m.label,
|
|
959
|
+
label: m.label,
|
|
960
|
+
leadingIcon: m.icon,
|
|
961
|
+
onClose: () => {
|
|
962
|
+
var N;
|
|
963
|
+
(N = m.onClose) == null || N.call(m), x(!1);
|
|
964
|
+
}
|
|
965
|
+
},
|
|
966
|
+
m.label
|
|
967
|
+
))
|
|
968
|
+
}
|
|
969
|
+
) })
|
|
970
|
+
]
|
|
971
|
+
}
|
|
972
|
+
)
|
|
973
|
+
] })
|
|
974
|
+
}
|
|
975
|
+
),
|
|
976
|
+
/* @__PURE__ */ o(
|
|
977
|
+
L,
|
|
978
|
+
{
|
|
979
|
+
cursorHover: !0,
|
|
980
|
+
disabled: S,
|
|
981
|
+
iconBefore: /* @__PURE__ */ o(me, {}),
|
|
982
|
+
onClick: n,
|
|
983
|
+
variant: "outlined",
|
|
984
|
+
children: r
|
|
985
|
+
}
|
|
986
|
+
),
|
|
987
|
+
/* @__PURE__ */ o(
|
|
988
|
+
L,
|
|
989
|
+
{
|
|
990
|
+
cursorHover: !0,
|
|
991
|
+
iconBefore: /* @__PURE__ */ o(be, {}),
|
|
992
|
+
onClick: a,
|
|
993
|
+
variant: "outlined",
|
|
994
|
+
children: h
|
|
995
|
+
}
|
|
996
|
+
)
|
|
997
|
+
] })
|
|
998
|
+
] });
|
|
999
|
+
}, pt = v.div`
|
|
769
1000
|
display: flex;
|
|
770
1001
|
flex-direction: column;
|
|
771
1002
|
background-color: ${({ theme: e }) => {
|
|
772
1003
|
var t, n;
|
|
773
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) ||
|
|
1004
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N0) || y.palette.neutral.N0;
|
|
774
1005
|
}};
|
|
775
1006
|
width: ${({ $smallScreen: e }) => e ? "auto" : "450px"};
|
|
776
1007
|
height: auto;
|
|
@@ -778,59 +1009,59 @@ const Ft = (e) => {
|
|
|
778
1009
|
padding: 24px;
|
|
779
1010
|
gap: 24px;
|
|
780
1011
|
box-sizing: border-box;
|
|
781
|
-
`,
|
|
1012
|
+
`, Qt = (e) => {
|
|
782
1013
|
const {
|
|
783
1014
|
actionButtonLabel: t,
|
|
784
1015
|
cancelButtonLabel: n,
|
|
785
|
-
children:
|
|
786
|
-
loading:
|
|
1016
|
+
children: a,
|
|
1017
|
+
loading: i,
|
|
787
1018
|
onClick: r,
|
|
788
1019
|
onCloseModal: h,
|
|
789
1020
|
portalId: l,
|
|
790
|
-
title:
|
|
791
|
-
} = e,
|
|
792
|
-
if (!
|
|
1021
|
+
title: d
|
|
1022
|
+
} = e, c = V("(max-width: 768px)"), u = document.getElementById(l);
|
|
1023
|
+
if (!u)
|
|
793
1024
|
throw new Error(
|
|
794
1025
|
"The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
|
|
795
1026
|
);
|
|
796
|
-
return
|
|
797
|
-
/* @__PURE__ */
|
|
798
|
-
/* @__PURE__ */
|
|
799
|
-
/* @__PURE__ */
|
|
800
|
-
/* @__PURE__ */
|
|
801
|
-
/* @__PURE__ */
|
|
802
|
-
/* @__PURE__ */
|
|
803
|
-
/* @__PURE__ */
|
|
1027
|
+
return ye(
|
|
1028
|
+
/* @__PURE__ */ o(fe, { children: /* @__PURE__ */ p(pt, { $smallScreen: c, children: [
|
|
1029
|
+
/* @__PURE__ */ p(g, { direction: "column", gap: "16px", children: [
|
|
1030
|
+
/* @__PURE__ */ p(g, { alignContent: "center", justifyContent: "space-between", children: [
|
|
1031
|
+
/* @__PURE__ */ o(C, { appearance: "dark", size: "small", type: "headline", children: d }),
|
|
1032
|
+
/* @__PURE__ */ p(g, { alignItems: "center", children: [
|
|
1033
|
+
/* @__PURE__ */ o(C, { children: "Cerrar" }),
|
|
1034
|
+
/* @__PURE__ */ o(
|
|
804
1035
|
M,
|
|
805
1036
|
{
|
|
806
1037
|
appearance: "dark",
|
|
807
|
-
icon: /* @__PURE__ */
|
|
1038
|
+
icon: /* @__PURE__ */ o(pe, {}),
|
|
808
1039
|
onClick: h,
|
|
809
1040
|
cursorHover: !0
|
|
810
1041
|
}
|
|
811
1042
|
)
|
|
812
1043
|
] })
|
|
813
1044
|
] }),
|
|
814
|
-
/* @__PURE__ */
|
|
1045
|
+
/* @__PURE__ */ o(I, {})
|
|
815
1046
|
] }),
|
|
816
|
-
|
|
817
|
-
/* @__PURE__ */
|
|
818
|
-
/* @__PURE__ */
|
|
819
|
-
|
|
1047
|
+
a,
|
|
1048
|
+
/* @__PURE__ */ p(g, { gap: "20px", justifyContent: "flex-end", children: [
|
|
1049
|
+
/* @__PURE__ */ o(
|
|
1050
|
+
L,
|
|
820
1051
|
{
|
|
821
1052
|
appearance: "gray",
|
|
822
1053
|
onClick: h,
|
|
823
|
-
iconBefore: /* @__PURE__ */
|
|
1054
|
+
iconBefore: /* @__PURE__ */ o(me, {}),
|
|
824
1055
|
spacing: "wide",
|
|
825
1056
|
variant: "outlined",
|
|
826
1057
|
children: n
|
|
827
1058
|
}
|
|
828
1059
|
),
|
|
829
|
-
/* @__PURE__ */
|
|
830
|
-
|
|
1060
|
+
/* @__PURE__ */ o(
|
|
1061
|
+
L,
|
|
831
1062
|
{
|
|
832
1063
|
appearance: "primary",
|
|
833
|
-
loading:
|
|
1064
|
+
loading: i,
|
|
834
1065
|
onClick: r,
|
|
835
1066
|
spacing: "wide",
|
|
836
1067
|
variant: "filled",
|
|
@@ -839,16 +1070,16 @@ const Ft = (e) => {
|
|
|
839
1070
|
)
|
|
840
1071
|
] })
|
|
841
1072
|
] }) }),
|
|
842
|
-
|
|
1073
|
+
u
|
|
843
1074
|
);
|
|
844
|
-
},
|
|
845
|
-
const { appliedFilters: t, fields: n, onChange:
|
|
846
|
-
return /* @__PURE__ */
|
|
847
|
-
r && /* @__PURE__ */
|
|
848
|
-
/* @__PURE__ */
|
|
849
|
-
/* @__PURE__ */
|
|
850
|
-
/* @__PURE__ */
|
|
851
|
-
|
|
1075
|
+
}, Wt = (e) => {
|
|
1076
|
+
const { appliedFilters: t, fields: n, onChange: a, noFiltersLabel: i } = e, r = V("(max-width: 768px)"), h = !t || t.length === 0;
|
|
1077
|
+
return /* @__PURE__ */ p(g, { direction: "column", gap: "16px", children: [
|
|
1078
|
+
r && /* @__PURE__ */ p(A, { children: [
|
|
1079
|
+
/* @__PURE__ */ p(g, { gap: "6px", width: "100%", alignItems: "center", children: [
|
|
1080
|
+
/* @__PURE__ */ o(M, { appearance: "gray", icon: /* @__PURE__ */ o(be, {}) }),
|
|
1081
|
+
/* @__PURE__ */ o(
|
|
1082
|
+
te,
|
|
852
1083
|
{
|
|
853
1084
|
background: !0,
|
|
854
1085
|
borderRadius: "8px",
|
|
@@ -858,9 +1089,9 @@ const Ft = (e) => {
|
|
|
858
1089
|
padding: "0px 8px",
|
|
859
1090
|
border: !0,
|
|
860
1091
|
width: "100%",
|
|
861
|
-
height: "
|
|
862
|
-
children: h ? /* @__PURE__ */
|
|
863
|
-
|
|
1092
|
+
height: "36px",
|
|
1093
|
+
children: h ? /* @__PURE__ */ o(C, { size: "small", type: "label", appearance: "gray", children: i }) : t == null ? void 0 : t.map((l) => /* @__PURE__ */ o(
|
|
1094
|
+
B,
|
|
864
1095
|
{
|
|
865
1096
|
appearance: "primary",
|
|
866
1097
|
displayIcon: !0,
|
|
@@ -874,19 +1105,19 @@ const Ft = (e) => {
|
|
|
874
1105
|
}
|
|
875
1106
|
)
|
|
876
1107
|
] }),
|
|
877
|
-
/* @__PURE__ */
|
|
1108
|
+
/* @__PURE__ */ o(I, { dashed: !0 })
|
|
878
1109
|
] }),
|
|
879
|
-
n.map((l) => /* @__PURE__ */
|
|
880
|
-
/* @__PURE__ */
|
|
881
|
-
/* @__PURE__ */
|
|
882
|
-
|
|
1110
|
+
n.map((l) => /* @__PURE__ */ p(g, { gap: "6px", alignItems: "center", children: [
|
|
1111
|
+
/* @__PURE__ */ o(g, { padding: "22px 0 0 0", children: /* @__PURE__ */ o(M, { appearance: "primary", icon: l.icon }) }),
|
|
1112
|
+
/* @__PURE__ */ o(
|
|
1113
|
+
ke,
|
|
883
1114
|
{
|
|
884
1115
|
disabled: l.disabled,
|
|
885
1116
|
invalid: l.invalid,
|
|
886
1117
|
label: l.label,
|
|
887
1118
|
message: l.message,
|
|
888
1119
|
name: l.name,
|
|
889
|
-
onChange:
|
|
1120
|
+
onChange: a,
|
|
890
1121
|
options: l.options,
|
|
891
1122
|
placeholder: l.placeholder,
|
|
892
1123
|
required: l.required,
|
|
@@ -897,9 +1128,9 @@ const Ft = (e) => {
|
|
|
897
1128
|
)
|
|
898
1129
|
] }, l.name))
|
|
899
1130
|
] });
|
|
900
|
-
},
|
|
1131
|
+
}, Yt = (e) => {
|
|
901
1132
|
console.log(e);
|
|
902
|
-
const { dataDecision: t, originalDecision: n } = e,
|
|
1133
|
+
const { dataDecision: t, originalDecision: n } = e, a = {
|
|
903
1134
|
conditionName: t.ruleName || "",
|
|
904
1135
|
labelName: t.labelName || "",
|
|
905
1136
|
conditionDataType: t.decisionDataType || "alphabetical",
|
|
@@ -911,17 +1142,17 @@ const Ft = (e) => {
|
|
|
911
1142
|
return {
|
|
912
1143
|
...n,
|
|
913
1144
|
conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
|
|
914
|
-
(
|
|
1145
|
+
(i) => i.hidden ? { ...a } : i
|
|
915
1146
|
)
|
|
916
1147
|
};
|
|
917
|
-
},
|
|
1148
|
+
}, Kt = (e) => {
|
|
918
1149
|
const { decisions: t } = e;
|
|
919
1150
|
return t == null ? void 0 : t.map((n) => {
|
|
920
|
-
var
|
|
921
|
-
const
|
|
1151
|
+
var i;
|
|
1152
|
+
const a = (i = n.conditionsThatEstablishesTheDecision) == null ? void 0 : i.find(
|
|
922
1153
|
(r) => r.hidden
|
|
923
1154
|
);
|
|
924
|
-
return
|
|
1155
|
+
return a ? {
|
|
925
1156
|
...n,
|
|
926
1157
|
ruleName: n.ruleName,
|
|
927
1158
|
labelName: n.labelName,
|
|
@@ -929,19 +1160,19 @@ const Ft = (e) => {
|
|
|
929
1160
|
value: n.value,
|
|
930
1161
|
howToSetTheDecision: n.howToSetTheDecision,
|
|
931
1162
|
conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
|
|
932
|
-
(r) => r.hidden ? { ...
|
|
1163
|
+
(r) => r.hidden ? { ...a, hidden: !1 } : r
|
|
933
1164
|
)
|
|
934
1165
|
} : n;
|
|
935
1166
|
});
|
|
936
|
-
},
|
|
937
|
-
schema:
|
|
1167
|
+
}, gt = (e) => ({
|
|
1168
|
+
schema: Z().required("Required").test(
|
|
938
1169
|
"non-empty",
|
|
939
1170
|
"Value cannot be empty",
|
|
940
1171
|
(t) => t != null && t.trim() !== ""
|
|
941
1172
|
),
|
|
942
1173
|
value: e
|
|
943
|
-
}),
|
|
944
|
-
schema:
|
|
1174
|
+
}), mt = (e) => ({
|
|
1175
|
+
schema: ve().test(
|
|
945
1176
|
"isArrayOrString",
|
|
946
1177
|
"Must be an array of strings/numbers or a single string",
|
|
947
1178
|
(t) => Array.isArray(t) ? t.every(
|
|
@@ -949,8 +1180,8 @@ const Ft = (e) => {
|
|
|
949
1180
|
) : typeof t == "string"
|
|
950
1181
|
),
|
|
951
1182
|
value: e
|
|
952
|
-
}),
|
|
953
|
-
schema:
|
|
1183
|
+
}), bt = (e) => ({
|
|
1184
|
+
schema: ve().test(
|
|
954
1185
|
"isArrayOrString",
|
|
955
1186
|
"Must be an array of strings/numbers or a single string",
|
|
956
1187
|
(t) => Array.isArray(t) ? t.every(
|
|
@@ -958,44 +1189,44 @@ const Ft = (e) => {
|
|
|
958
1189
|
) : typeof t == "string"
|
|
959
1190
|
),
|
|
960
1191
|
value: e
|
|
961
|
-
}),
|
|
1192
|
+
}), ft = (e) => {
|
|
962
1193
|
const t = (e == null ? void 0 : e.from) ?? 0, n = (e == null ? void 0 : e.to) ?? 0;
|
|
963
1194
|
return {
|
|
964
|
-
schema:
|
|
965
|
-
from:
|
|
966
|
-
to:
|
|
1195
|
+
schema: P({
|
|
1196
|
+
from: W().required("Range From is required").max(n, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
|
|
1197
|
+
to: W().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
|
|
967
1198
|
"is-greater",
|
|
968
1199
|
"To value must be greater than From value",
|
|
969
|
-
function(
|
|
970
|
-
const { from:
|
|
971
|
-
return
|
|
1200
|
+
function(a) {
|
|
1201
|
+
const { from: i } = this.parent;
|
|
1202
|
+
return a > i;
|
|
972
1203
|
}
|
|
973
1204
|
)
|
|
974
1205
|
}),
|
|
975
1206
|
value: { from: t, to: n }
|
|
976
1207
|
};
|
|
977
|
-
},
|
|
978
|
-
schema:
|
|
1208
|
+
}, Q = (e, t) => t === z.PERCENTAGE ? {
|
|
1209
|
+
schema: W().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
|
|
979
1210
|
value: e
|
|
980
1211
|
} : {
|
|
981
|
-
schema:
|
|
1212
|
+
schema: Z().required("Required"),
|
|
982
1213
|
value: e
|
|
983
|
-
},
|
|
984
|
-
[
|
|
985
|
-
[
|
|
986
|
-
[
|
|
987
|
-
[
|
|
988
|
-
[
|
|
989
|
-
[
|
|
990
|
-
},
|
|
991
|
-
function
|
|
1214
|
+
}, Tt = {
|
|
1215
|
+
[D.LIST_OF_VALUES]: mt,
|
|
1216
|
+
[D.LIST_OF_VALUES_MULTI]: bt,
|
|
1217
|
+
[D.RANGE]: ft,
|
|
1218
|
+
[D.GREATER_THAN]: Q,
|
|
1219
|
+
[D.LESS_THAN]: Q,
|
|
1220
|
+
[D.EQUAL]: Q
|
|
1221
|
+
}, ce = (e) => Tt[e] || gt;
|
|
1222
|
+
function yt({
|
|
992
1223
|
decision: e,
|
|
993
1224
|
onSubmitEvent: t,
|
|
994
1225
|
textValues: n
|
|
995
1226
|
}) {
|
|
996
|
-
const
|
|
1227
|
+
const a = {
|
|
997
1228
|
ruleName: e.ruleName || "",
|
|
998
|
-
decisionDataType: e.decisionDataType ||
|
|
1229
|
+
decisionDataType: e.decisionDataType || z.ALPHABETICAL,
|
|
999
1230
|
howToSetTheDecision: e.howToSetTheDecision || "",
|
|
1000
1231
|
value: e.value || "",
|
|
1001
1232
|
effectiveFrom: e.effectiveFrom || "",
|
|
@@ -1005,108 +1236,108 @@ function it({
|
|
|
1005
1236
|
checkClosed: !1,
|
|
1006
1237
|
terms: !0
|
|
1007
1238
|
};
|
|
1008
|
-
let
|
|
1239
|
+
let i;
|
|
1009
1240
|
const r = {
|
|
1010
|
-
ruleName:
|
|
1011
|
-
value:
|
|
1012
|
-
|
|
1241
|
+
ruleName: Z().required("Name is required"),
|
|
1242
|
+
value: re(() => ce(
|
|
1243
|
+
i.values.howToSetTheDecision
|
|
1013
1244
|
)(
|
|
1014
|
-
|
|
1015
|
-
|
|
1245
|
+
i.values.value,
|
|
1246
|
+
i.values.decisionDataType
|
|
1016
1247
|
).schema),
|
|
1017
|
-
conditionsThatEstablishesTheDecision:
|
|
1018
|
-
var
|
|
1019
|
-
if ((
|
|
1020
|
-
const
|
|
1021
|
-
(T,
|
|
1022
|
-
if (
|
|
1023
|
-
const
|
|
1024
|
-
|
|
1248
|
+
conditionsThatEstablishesTheDecision: re((d, { parent: c }) => {
|
|
1249
|
+
var f;
|
|
1250
|
+
if ((c == null ? void 0 : c.toggleNone) && Object.keys(c.conditionsThatEstablishesTheDecision || {}).length > 0) return P().shape({});
|
|
1251
|
+
const s = (f = e.conditionsThatEstablishesTheDecision) == null ? void 0 : f.reduce(
|
|
1252
|
+
(T, b) => {
|
|
1253
|
+
if (i.values.conditionsThatEstablishesTheDecision[b.conditionName] !== void 0) {
|
|
1254
|
+
const w = ce(
|
|
1255
|
+
b.howToSetTheCondition
|
|
1025
1256
|
);
|
|
1026
|
-
T[
|
|
1027
|
-
|
|
1028
|
-
|
|
1257
|
+
T[b.conditionName] = w(
|
|
1258
|
+
b.value,
|
|
1259
|
+
b.conditionDataType
|
|
1029
1260
|
).schema;
|
|
1030
1261
|
}
|
|
1031
1262
|
return T;
|
|
1032
1263
|
},
|
|
1033
1264
|
{}
|
|
1034
1265
|
);
|
|
1035
|
-
return
|
|
1266
|
+
return P(s).test(
|
|
1036
1267
|
"at-least-one-condition",
|
|
1037
1268
|
"It must be at least one condition in order for the decision to be validated correctly.",
|
|
1038
1269
|
(T) => T ? Object.values(T).some(
|
|
1039
|
-
(
|
|
1270
|
+
(b) => b != null && b !== ""
|
|
1040
1271
|
) : !1
|
|
1041
1272
|
);
|
|
1042
1273
|
})
|
|
1043
1274
|
};
|
|
1044
|
-
n.terms && (r.effectiveFrom =
|
|
1275
|
+
n.terms && (r.effectiveFrom = le().required(
|
|
1045
1276
|
"effective From date is required"
|
|
1046
|
-
), r.validUntil =
|
|
1277
|
+
), r.validUntil = le().when(
|
|
1047
1278
|
"checkClosed",
|
|
1048
|
-
(
|
|
1279
|
+
(d, c, { parent: u }) => (u == null ? void 0 : u.checkClosed) ? c.required("valid Until date is required").test(
|
|
1049
1280
|
"is-after-startDate",
|
|
1050
1281
|
"valid Until date must be greater than or equal to Start date",
|
|
1051
|
-
function(
|
|
1282
|
+
function(f) {
|
|
1052
1283
|
const T = this.parent.effectiveFrom;
|
|
1053
|
-
return !T || !
|
|
1284
|
+
return !T || !f ? !0 : new Date(f) >= new Date(T);
|
|
1054
1285
|
}
|
|
1055
|
-
) :
|
|
1286
|
+
) : c.notRequired()
|
|
1056
1287
|
));
|
|
1057
|
-
const h =
|
|
1058
|
-
return
|
|
1059
|
-
initialValues:
|
|
1288
|
+
const h = P(r);
|
|
1289
|
+
return i = Ie({
|
|
1290
|
+
initialValues: a,
|
|
1060
1291
|
validationSchema: h,
|
|
1061
1292
|
validateOnBlur: !0,
|
|
1062
|
-
onSubmit: (
|
|
1063
|
-
var
|
|
1064
|
-
const
|
|
1293
|
+
onSubmit: (d) => {
|
|
1294
|
+
var u;
|
|
1295
|
+
const c = {
|
|
1065
1296
|
...e,
|
|
1066
|
-
ruleName:
|
|
1067
|
-
decisionDataType:
|
|
1068
|
-
howToSetTheDecision:
|
|
1069
|
-
value:
|
|
1070
|
-
effectiveFrom:
|
|
1071
|
-
validUntil:
|
|
1072
|
-
conditionsThatEstablishesTheDecision: (
|
|
1073
|
-
const
|
|
1074
|
-
return
|
|
1075
|
-
}).map((
|
|
1076
|
-
...
|
|
1077
|
-
value:
|
|
1297
|
+
ruleName: d.ruleName,
|
|
1298
|
+
decisionDataType: d.decisionDataType,
|
|
1299
|
+
howToSetTheDecision: d.howToSetTheDecision,
|
|
1300
|
+
value: d.value,
|
|
1301
|
+
effectiveFrom: d.effectiveFrom,
|
|
1302
|
+
validUntil: d.validUntil,
|
|
1303
|
+
conditionsThatEstablishesTheDecision: (u = e.conditionsThatEstablishesTheDecision) == null ? void 0 : u.filter((s) => {
|
|
1304
|
+
const f = d.conditionsThatEstablishesTheDecision[s.conditionName];
|
|
1305
|
+
return f != null && f !== "";
|
|
1306
|
+
}).map((s) => ({
|
|
1307
|
+
...s,
|
|
1308
|
+
value: d.conditionsThatEstablishesTheDecision[s.conditionName]
|
|
1078
1309
|
}))
|
|
1079
1310
|
};
|
|
1080
|
-
t(
|
|
1311
|
+
t(c);
|
|
1081
1312
|
}
|
|
1082
|
-
}), { formik:
|
|
1083
|
-
var
|
|
1084
|
-
|
|
1085
|
-
if (
|
|
1086
|
-
|
|
1087
|
-
`conditionsThatEstablishesTheDecision.${
|
|
1313
|
+
}), { formik: i, handleToggleNoneChange: (d) => {
|
|
1314
|
+
var c;
|
|
1315
|
+
i.setFieldValue("toggleNone", d), (c = e.conditionsThatEstablishesTheDecision) == null || c.forEach((u) => {
|
|
1316
|
+
if (d)
|
|
1317
|
+
i.setFieldValue(
|
|
1318
|
+
`conditionsThatEstablishesTheDecision.${u.conditionName}`,
|
|
1088
1319
|
void 0
|
|
1089
1320
|
);
|
|
1090
1321
|
else {
|
|
1091
|
-
const
|
|
1092
|
-
|
|
1093
|
-
`conditionsThatEstablishesTheDecision.${
|
|
1094
|
-
|
|
1322
|
+
const s = u.howToSetTheCondition === D.LIST_OF_VALUES_MULTI ? [] : "";
|
|
1323
|
+
i.setFieldValue(
|
|
1324
|
+
`conditionsThatEstablishesTheDecision.${u.conditionName}`,
|
|
1325
|
+
s
|
|
1095
1326
|
);
|
|
1096
1327
|
}
|
|
1097
1328
|
});
|
|
1098
1329
|
} };
|
|
1099
1330
|
}
|
|
1100
|
-
const
|
|
1331
|
+
const vt = v.div`
|
|
1101
1332
|
& > div {
|
|
1102
1333
|
border-radius: 8px;
|
|
1103
1334
|
border: 1px solid
|
|
1104
1335
|
${({ theme: e }) => {
|
|
1105
1336
|
var t, n;
|
|
1106
|
-
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) ||
|
|
1337
|
+
return ((n = (t = e == null ? void 0 : e.palette) == null ? void 0 : t.neutral) == null ? void 0 : n.N30) || y.palette.neutral.N30;
|
|
1107
1338
|
}};
|
|
1108
1339
|
}
|
|
1109
|
-
`,
|
|
1340
|
+
`, xt = v.div`
|
|
1110
1341
|
width: 100%;
|
|
1111
1342
|
height: 100%;
|
|
1112
1343
|
overflow-y: auto;
|
|
@@ -1123,61 +1354,61 @@ const ot = f.div`
|
|
|
1123
1354
|
background-color: #ebecf0;
|
|
1124
1355
|
border-radius: 8px;
|
|
1125
1356
|
}
|
|
1126
|
-
`,
|
|
1357
|
+
`, wt = (e) => {
|
|
1127
1358
|
const {
|
|
1128
1359
|
checked: t,
|
|
1129
1360
|
children: n,
|
|
1130
|
-
handleToggleChange:
|
|
1131
|
-
id:
|
|
1361
|
+
handleToggleChange: a,
|
|
1362
|
+
id: i,
|
|
1132
1363
|
labelToggle: r,
|
|
1133
1364
|
name: h,
|
|
1134
1365
|
valueToggle: l = ""
|
|
1135
|
-
} = e, [
|
|
1136
|
-
|
|
1366
|
+
} = e, [d, c] = R(t), u = (s) => {
|
|
1367
|
+
c(s.target.checked), a(s);
|
|
1137
1368
|
};
|
|
1138
|
-
return
|
|
1139
|
-
|
|
1140
|
-
}, [t]), /* @__PURE__ */
|
|
1141
|
-
/* @__PURE__ */
|
|
1142
|
-
|
|
1369
|
+
return X(() => {
|
|
1370
|
+
c(t);
|
|
1371
|
+
}, [t]), /* @__PURE__ */ p(A, { children: [
|
|
1372
|
+
/* @__PURE__ */ o(g, { children: /* @__PURE__ */ o(
|
|
1373
|
+
Te,
|
|
1143
1374
|
{
|
|
1144
|
-
checked:
|
|
1145
|
-
id:
|
|
1375
|
+
checked: d,
|
|
1376
|
+
id: i,
|
|
1146
1377
|
name: h,
|
|
1147
|
-
onChange:
|
|
1378
|
+
onChange: u,
|
|
1148
1379
|
size: "small",
|
|
1149
1380
|
value: l,
|
|
1150
|
-
children: /* @__PURE__ */
|
|
1381
|
+
children: /* @__PURE__ */ o(C, { size: "medium", type: "label", weight: "bold", children: r })
|
|
1151
1382
|
}
|
|
1152
1383
|
) }),
|
|
1153
|
-
|
|
1384
|
+
d && /* @__PURE__ */ o(A, { children: n })
|
|
1154
1385
|
] });
|
|
1155
|
-
},
|
|
1386
|
+
}, Ct = (e) => {
|
|
1156
1387
|
const {
|
|
1157
1388
|
onHandleStartChange: t,
|
|
1158
1389
|
onHandleEndChange: n,
|
|
1159
|
-
onCheckClosedChange:
|
|
1160
|
-
labelStart:
|
|
1390
|
+
onCheckClosedChange: a,
|
|
1391
|
+
labelStart: i,
|
|
1161
1392
|
labelEnd: r,
|
|
1162
1393
|
checkedClosed: h = !1,
|
|
1163
1394
|
required: l = !1,
|
|
1164
|
-
valueStart:
|
|
1165
|
-
valueEnd:
|
|
1166
|
-
messageStart:
|
|
1167
|
-
messageEnd:
|
|
1168
|
-
statusStart:
|
|
1395
|
+
valueStart: d = "",
|
|
1396
|
+
valueEnd: c = "",
|
|
1397
|
+
messageStart: u = "",
|
|
1398
|
+
messageEnd: s = "",
|
|
1399
|
+
statusStart: f = "pending",
|
|
1169
1400
|
statusEnd: T = "pending"
|
|
1170
|
-
} = e, [
|
|
1171
|
-
|
|
1172
|
-
},
|
|
1173
|
-
|
|
1174
|
-
},
|
|
1175
|
-
|
|
1176
|
-
},
|
|
1177
|
-
return /* @__PURE__ */
|
|
1178
|
-
/* @__PURE__ */
|
|
1179
|
-
/* @__PURE__ */
|
|
1180
|
-
|
|
1401
|
+
} = e, [b, x] = R(h), [w, S] = R(d), [k, F] = R(c), $ = ({ target: E }) => {
|
|
1402
|
+
x(E.checked), a && a(E.checked);
|
|
1403
|
+
}, m = (E) => {
|
|
1404
|
+
S(E.target.value), t(E);
|
|
1405
|
+
}, N = (E) => {
|
|
1406
|
+
F(E.target.value), n(E);
|
|
1407
|
+
}, O = V("(max-width: 400px)");
|
|
1408
|
+
return /* @__PURE__ */ p(A, { children: [
|
|
1409
|
+
/* @__PURE__ */ p(g, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
|
|
1410
|
+
/* @__PURE__ */ o(
|
|
1411
|
+
C,
|
|
1181
1412
|
{
|
|
1182
1413
|
appearance: "gray",
|
|
1183
1414
|
margin: "10px 0",
|
|
@@ -1187,133 +1418,133 @@ const ot = f.div`
|
|
|
1187
1418
|
children: "Vigencia"
|
|
1188
1419
|
}
|
|
1189
1420
|
),
|
|
1190
|
-
/* @__PURE__ */
|
|
1191
|
-
|
|
1421
|
+
/* @__PURE__ */ o(
|
|
1422
|
+
g,
|
|
1192
1423
|
{
|
|
1193
1424
|
alignContent: "center",
|
|
1194
1425
|
justifyContent: "center",
|
|
1195
1426
|
wrap: "wrap",
|
|
1196
1427
|
gap: "4px",
|
|
1197
|
-
children: /* @__PURE__ */
|
|
1198
|
-
|
|
1428
|
+
children: /* @__PURE__ */ o(
|
|
1429
|
+
Ne,
|
|
1199
1430
|
{
|
|
1200
1431
|
label: "Cerrada",
|
|
1201
|
-
onChange:
|
|
1202
|
-
checked:
|
|
1432
|
+
onChange: $,
|
|
1433
|
+
checked: b,
|
|
1203
1434
|
value: ""
|
|
1204
1435
|
}
|
|
1205
1436
|
)
|
|
1206
1437
|
}
|
|
1207
1438
|
)
|
|
1208
1439
|
] }),
|
|
1209
|
-
/* @__PURE__ */
|
|
1210
|
-
|
|
1440
|
+
/* @__PURE__ */ p(
|
|
1441
|
+
g,
|
|
1211
1442
|
{
|
|
1212
|
-
direction:
|
|
1443
|
+
direction: O ? "column" : "row",
|
|
1213
1444
|
justifyContent: "space-between",
|
|
1214
1445
|
gap: "24px",
|
|
1215
1446
|
children: [
|
|
1216
|
-
/* @__PURE__ */
|
|
1217
|
-
|
|
1447
|
+
/* @__PURE__ */ o(
|
|
1448
|
+
ae,
|
|
1218
1449
|
{
|
|
1219
1450
|
id: "dateStart",
|
|
1220
|
-
label:
|
|
1221
|
-
onChange:
|
|
1222
|
-
value:
|
|
1451
|
+
label: i,
|
|
1452
|
+
onChange: m,
|
|
1453
|
+
value: w,
|
|
1223
1454
|
required: l,
|
|
1224
1455
|
size: "compact",
|
|
1225
|
-
status:
|
|
1226
|
-
message:
|
|
1456
|
+
status: f,
|
|
1457
|
+
message: u
|
|
1227
1458
|
}
|
|
1228
1459
|
),
|
|
1229
|
-
|
|
1230
|
-
|
|
1460
|
+
b && /* @__PURE__ */ o(
|
|
1461
|
+
ae,
|
|
1231
1462
|
{
|
|
1232
1463
|
id: "dateEnd",
|
|
1233
1464
|
label: r,
|
|
1234
|
-
onChange:
|
|
1235
|
-
value:
|
|
1465
|
+
onChange: N,
|
|
1466
|
+
value: k,
|
|
1236
1467
|
required: l,
|
|
1237
1468
|
size: "compact",
|
|
1238
1469
|
status: T,
|
|
1239
|
-
message:
|
|
1470
|
+
message: s
|
|
1240
1471
|
}
|
|
1241
1472
|
)
|
|
1242
1473
|
]
|
|
1243
1474
|
}
|
|
1244
1475
|
)
|
|
1245
1476
|
] });
|
|
1246
|
-
},
|
|
1477
|
+
}, St = (e) => {
|
|
1247
1478
|
const {
|
|
1248
1479
|
formik: t,
|
|
1249
1480
|
textValues: n,
|
|
1250
|
-
onCancel:
|
|
1251
|
-
visibleConditions:
|
|
1481
|
+
onCancel: a,
|
|
1482
|
+
visibleConditions: i,
|
|
1252
1483
|
normalizedDecision: r,
|
|
1253
1484
|
handleToggleNoneChange: h,
|
|
1254
1485
|
handleConditionToggleChange: l,
|
|
1255
|
-
showConditionsError:
|
|
1256
|
-
termStartStatus:
|
|
1257
|
-
termEndStatus:
|
|
1486
|
+
showConditionsError: d,
|
|
1487
|
+
termStartStatus: c,
|
|
1488
|
+
termEndStatus: u
|
|
1258
1489
|
} = e;
|
|
1259
|
-
return /* @__PURE__ */
|
|
1260
|
-
|
|
1490
|
+
return /* @__PURE__ */ o("form", { onSubmit: t.handleSubmit, children: /* @__PURE__ */ p(g, { direction: "column", gap: "24px", children: [
|
|
1491
|
+
ie({
|
|
1261
1492
|
condition: r,
|
|
1262
1493
|
formik: t,
|
|
1263
1494
|
isDecision: !0
|
|
1264
1495
|
}),
|
|
1265
|
-
/* @__PURE__ */
|
|
1266
|
-
/* @__PURE__ */
|
|
1267
|
-
|
|
1496
|
+
/* @__PURE__ */ o(I, { dashed: !0 }),
|
|
1497
|
+
/* @__PURE__ */ o(vt, { children: /* @__PURE__ */ o(xt, { children: /* @__PURE__ */ p(
|
|
1498
|
+
g,
|
|
1268
1499
|
{
|
|
1269
1500
|
direction: "column",
|
|
1270
1501
|
padding: "6px 12px",
|
|
1271
1502
|
gap: "16px",
|
|
1272
1503
|
height: "272px",
|
|
1273
1504
|
children: [
|
|
1274
|
-
/* @__PURE__ */
|
|
1275
|
-
|
|
1505
|
+
/* @__PURE__ */ p(
|
|
1506
|
+
g,
|
|
1276
1507
|
{
|
|
1277
1508
|
justifyContent: "space-between",
|
|
1278
1509
|
alignItems: "center",
|
|
1279
1510
|
gap: "64px",
|
|
1280
1511
|
children: [
|
|
1281
|
-
/* @__PURE__ */
|
|
1282
|
-
/* @__PURE__ */
|
|
1283
|
-
|
|
1512
|
+
/* @__PURE__ */ o(C, { type: "title", size: "small", weight: "bold", appearance: "gray", children: n.factsThatConditionIt }),
|
|
1513
|
+
/* @__PURE__ */ o(
|
|
1514
|
+
Te,
|
|
1284
1515
|
{
|
|
1285
1516
|
id: "toggleNone",
|
|
1286
1517
|
onChange: () => h(!t.values.toggleNone),
|
|
1287
1518
|
checked: t.values.toggleNone,
|
|
1288
1519
|
size: "small",
|
|
1289
|
-
children: /* @__PURE__ */
|
|
1520
|
+
children: /* @__PURE__ */ o(C, { as: "span", size: "medium", type: "label", weight: "bold", children: n.none })
|
|
1290
1521
|
}
|
|
1291
1522
|
)
|
|
1292
1523
|
]
|
|
1293
1524
|
}
|
|
1294
1525
|
),
|
|
1295
|
-
/* @__PURE__ */
|
|
1296
|
-
|
|
1526
|
+
/* @__PURE__ */ o(g, { direction: "column", gap: "20px", children: i == null ? void 0 : i.map((s) => /* @__PURE__ */ o(
|
|
1527
|
+
wt,
|
|
1297
1528
|
{
|
|
1298
|
-
id: `toggle-${
|
|
1299
|
-
name: `toggle.${
|
|
1300
|
-
labelToggle:
|
|
1301
|
-
checked: !t.values.toggleNone && t.values.conditionsThatEstablishesTheDecision[
|
|
1302
|
-
handleToggleChange: (
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
)(
|
|
1306
|
-
children:
|
|
1529
|
+
id: `toggle-${s.conditionName}`,
|
|
1530
|
+
name: `toggle.${s.conditionName}`,
|
|
1531
|
+
labelToggle: s.labelName,
|
|
1532
|
+
checked: !t.values.toggleNone && t.values.conditionsThatEstablishesTheDecision[s.conditionName] !== void 0,
|
|
1533
|
+
handleToggleChange: (f) => l(
|
|
1534
|
+
s.conditionName,
|
|
1535
|
+
s.howToSetTheCondition === D.LIST_OF_VALUES_MULTI
|
|
1536
|
+
)(f.target.checked),
|
|
1537
|
+
children: ie({ condition: s, formik: t })
|
|
1307
1538
|
},
|
|
1308
|
-
|
|
1539
|
+
s.conditionName
|
|
1309
1540
|
)) })
|
|
1310
1541
|
]
|
|
1311
1542
|
}
|
|
1312
1543
|
) }) }),
|
|
1313
|
-
n.terms && /* @__PURE__ */
|
|
1314
|
-
/* @__PURE__ */
|
|
1315
|
-
/* @__PURE__ */
|
|
1316
|
-
|
|
1544
|
+
n.terms && /* @__PURE__ */ p(A, { children: [
|
|
1545
|
+
/* @__PURE__ */ o(I, { dashed: !0 }),
|
|
1546
|
+
/* @__PURE__ */ o(
|
|
1547
|
+
Ct,
|
|
1317
1548
|
{
|
|
1318
1549
|
labelStart: n.termStart,
|
|
1319
1550
|
labelEnd: n.termEnd,
|
|
@@ -1321,118 +1552,118 @@ const ot = f.div`
|
|
|
1321
1552
|
valueEnd: t.values.validUntil,
|
|
1322
1553
|
messageStart: t.errors.effectiveFrom,
|
|
1323
1554
|
messageEnd: t.errors.validUntil,
|
|
1324
|
-
statusStart:
|
|
1325
|
-
statusEnd:
|
|
1326
|
-
onHandleStartChange: (
|
|
1327
|
-
onHandleEndChange: (
|
|
1328
|
-
onCheckClosedChange: (
|
|
1329
|
-
t.setFieldValue("checkClosed",
|
|
1555
|
+
statusStart: c,
|
|
1556
|
+
statusEnd: u,
|
|
1557
|
+
onHandleStartChange: (s) => t.setFieldValue("effectiveFrom", s.target.value),
|
|
1558
|
+
onHandleEndChange: (s) => t.setFieldValue("validUntil", s.target.value),
|
|
1559
|
+
onCheckClosedChange: (s) => {
|
|
1560
|
+
t.setFieldValue("checkClosed", s), s && t.setFieldValue("validUntil", "");
|
|
1330
1561
|
},
|
|
1331
1562
|
checkedClosed: t.values.checkClosed
|
|
1332
1563
|
}
|
|
1333
1564
|
)
|
|
1334
1565
|
] }),
|
|
1335
|
-
/* @__PURE__ */
|
|
1336
|
-
|
|
1337
|
-
/* @__PURE__ */
|
|
1338
|
-
/* @__PURE__ */
|
|
1339
|
-
/* @__PURE__ */
|
|
1566
|
+
/* @__PURE__ */ o(I, {}),
|
|
1567
|
+
d && /* @__PURE__ */ o(C, { type: "label", size: "medium", appearance: "danger", children: String(t.errors.conditionsThatEstablishesTheDecision) }),
|
|
1568
|
+
/* @__PURE__ */ p(g, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
1569
|
+
/* @__PURE__ */ o(L, { appearance: "gray", onClick: a, children: n.cancel }),
|
|
1570
|
+
/* @__PURE__ */ o(L, { type: "submit", children: n.confirm })
|
|
1340
1571
|
] })
|
|
1341
1572
|
] }) });
|
|
1342
|
-
},
|
|
1573
|
+
}, Dt = (e) => {
|
|
1343
1574
|
var T;
|
|
1344
|
-
const { decision: t, onSubmitEvent: n, textValues:
|
|
1575
|
+
const { decision: t, onSubmitEvent: n, textValues: a, onCancel: i } = e, { formik: r, handleToggleNoneChange: h } = yt({
|
|
1345
1576
|
decision: t,
|
|
1346
1577
|
onSubmitEvent: n,
|
|
1347
|
-
textValues:
|
|
1578
|
+
textValues: a
|
|
1348
1579
|
}), l = {
|
|
1349
1580
|
ruleName: t.ruleName,
|
|
1350
1581
|
labelName: t.labelName,
|
|
1351
1582
|
howToSetTheCondition: t.howToSetTheDecision,
|
|
1352
1583
|
decisionDataType: t.decisionDataType,
|
|
1353
1584
|
listOfPossibleValues: t.listOfPossibleValues
|
|
1354
|
-
},
|
|
1355
|
-
(
|
|
1356
|
-
)) || [],
|
|
1357
|
-
return /* @__PURE__ */
|
|
1358
|
-
|
|
1585
|
+
}, d = ((T = t.conditionsThatEstablishesTheDecision) == null ? void 0 : T.filter(
|
|
1586
|
+
(b) => !b.hidden
|
|
1587
|
+
)) || [], c = !!r.errors.conditionsThatEstablishesTheDecision && r.submitCount > 0, u = r.touched.effectiveFrom ? r.errors.effectiveFrom ? "invalid" : "valid" : void 0, s = r.touched.validUntil ? r.errors.validUntil ? "invalid" : "valid" : void 0;
|
|
1588
|
+
return /* @__PURE__ */ o(
|
|
1589
|
+
St,
|
|
1359
1590
|
{
|
|
1360
1591
|
formik: r,
|
|
1361
|
-
onCancel:
|
|
1362
|
-
textValues:
|
|
1592
|
+
onCancel: i,
|
|
1593
|
+
textValues: a,
|
|
1363
1594
|
decision: t,
|
|
1364
|
-
visibleConditions:
|
|
1595
|
+
visibleConditions: d,
|
|
1365
1596
|
normalizedDecision: l,
|
|
1366
1597
|
handleToggleNoneChange: h,
|
|
1367
|
-
handleConditionToggleChange: (
|
|
1368
|
-
if (!
|
|
1598
|
+
handleConditionToggleChange: (b, x) => (w) => {
|
|
1599
|
+
if (!w)
|
|
1369
1600
|
r.setFieldValue(
|
|
1370
|
-
`conditionsThatEstablishesTheDecision.${
|
|
1601
|
+
`conditionsThatEstablishesTheDecision.${b}`,
|
|
1371
1602
|
void 0
|
|
1372
1603
|
), r.setFieldTouched(
|
|
1373
|
-
`conditionsThatEstablishesTheDecision.${
|
|
1604
|
+
`conditionsThatEstablishesTheDecision.${b}`,
|
|
1374
1605
|
!1,
|
|
1375
1606
|
!1
|
|
1376
1607
|
);
|
|
1377
1608
|
else {
|
|
1378
|
-
const
|
|
1609
|
+
const S = x ? [] : "";
|
|
1379
1610
|
r.setFieldValue(
|
|
1380
|
-
`conditionsThatEstablishesTheDecision.${
|
|
1381
|
-
|
|
1611
|
+
`conditionsThatEstablishesTheDecision.${b}`,
|
|
1612
|
+
S
|
|
1382
1613
|
);
|
|
1383
1614
|
}
|
|
1384
1615
|
},
|
|
1385
|
-
showConditionsError:
|
|
1386
|
-
termStartStatus:
|
|
1387
|
-
termEndStatus:
|
|
1616
|
+
showConditionsError: c,
|
|
1617
|
+
termStartStatus: u,
|
|
1618
|
+
termEndStatus: s
|
|
1388
1619
|
}
|
|
1389
1620
|
);
|
|
1390
|
-
},
|
|
1391
|
-
var
|
|
1392
|
-
const { decisionTemplate: t } = e, n = { ...t },
|
|
1621
|
+
}, Jt = (e) => {
|
|
1622
|
+
var i;
|
|
1623
|
+
const { decisionTemplate: t } = e, n = { ...t }, a = (i = n.conditionsThatEstablishesTheDecision) == null ? void 0 : i.find(
|
|
1393
1624
|
(r) => r.switchPlaces
|
|
1394
1625
|
);
|
|
1395
|
-
return
|
|
1626
|
+
return a ? {
|
|
1396
1627
|
...n,
|
|
1397
|
-
ruleName:
|
|
1398
|
-
labelName:
|
|
1399
|
-
decisionDataType:
|
|
1400
|
-
value:
|
|
1401
|
-
howToSetTheDecision:
|
|
1628
|
+
ruleName: a.conditionName,
|
|
1629
|
+
labelName: a.labelName,
|
|
1630
|
+
decisionDataType: a.conditionDataType,
|
|
1631
|
+
value: a.value,
|
|
1632
|
+
howToSetTheDecision: a.howToSetTheCondition,
|
|
1402
1633
|
conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
|
|
1403
|
-
(r) => r.conditionName ===
|
|
1634
|
+
(r) => r.conditionName === a.conditionName ? { ...r, hidden: !0 } : r
|
|
1404
1635
|
)
|
|
1405
1636
|
} : n;
|
|
1406
|
-
},
|
|
1637
|
+
}, Xt = (e) => {
|
|
1407
1638
|
const { decisions: t } = e;
|
|
1408
1639
|
return t == null ? void 0 : t.map((n) => {
|
|
1409
|
-
var
|
|
1410
|
-
const
|
|
1640
|
+
var i;
|
|
1641
|
+
const a = (i = n.conditionsThatEstablishesTheDecision) == null ? void 0 : i.find(
|
|
1411
1642
|
(r) => r.switchPlaces
|
|
1412
1643
|
);
|
|
1413
|
-
return
|
|
1644
|
+
return a ? {
|
|
1414
1645
|
...n,
|
|
1415
|
-
ruleName:
|
|
1416
|
-
labelName:
|
|
1417
|
-
decisionDataType:
|
|
1418
|
-
value:
|
|
1419
|
-
howToSetTheDecision:
|
|
1646
|
+
ruleName: a.conditionName,
|
|
1647
|
+
labelName: a.labelName,
|
|
1648
|
+
decisionDataType: a.conditionDataType,
|
|
1649
|
+
value: a.value,
|
|
1650
|
+
howToSetTheDecision: a.howToSetTheCondition,
|
|
1420
1651
|
conditionsThatEstablishesTheDecision: n.conditionsThatEstablishesTheDecision.map(
|
|
1421
|
-
(r) => r.conditionName ===
|
|
1652
|
+
(r) => r.conditionName === a.conditionName ? { ...r, hidden: !0 } : r
|
|
1422
1653
|
)
|
|
1423
1654
|
} : n;
|
|
1424
1655
|
});
|
|
1425
|
-
},
|
|
1426
|
-
const
|
|
1427
|
-
if (
|
|
1428
|
-
const
|
|
1429
|
-
|
|
1656
|
+
}, U = /* @__PURE__ */ new Map(), kt = (e, t) => U.get(`${t}:${e}`), Nt = (e, t, n) => {
|
|
1657
|
+
const a = `${t}:${e}`;
|
|
1658
|
+
if (U.set(a, n), U.size > 1e3) {
|
|
1659
|
+
const i = U.keys().next().value;
|
|
1660
|
+
i !== void 0 && U.delete(i);
|
|
1430
1661
|
}
|
|
1431
|
-
},
|
|
1432
|
-
const t = Date.now(), n =
|
|
1433
|
-
return t - n <
|
|
1434
|
-
},
|
|
1435
|
-
const t =
|
|
1662
|
+
}, ue = /* @__PURE__ */ new Map(), Et = 1e3, $t = (e) => {
|
|
1663
|
+
const t = Date.now(), n = ue.get(e) || 0;
|
|
1664
|
+
return t - n < Et ? !0 : (ue.set(e, t), !1);
|
|
1665
|
+
}, At = (e) => {
|
|
1666
|
+
const t = Oe(e);
|
|
1436
1667
|
return {
|
|
1437
1668
|
spa: "es",
|
|
1438
1669
|
eng: "en",
|
|
@@ -1441,66 +1672,66 @@ const ot = f.div`
|
|
|
1441
1672
|
ita: "it",
|
|
1442
1673
|
por: "pt"
|
|
1443
1674
|
}[t] || "en";
|
|
1444
|
-
},
|
|
1445
|
-
const
|
|
1675
|
+
}, Ft = async (e, t, { url: n, apiKey: a }) => {
|
|
1676
|
+
const i = `${t}:${e}`, r = kt(e, t);
|
|
1446
1677
|
if (r) return r;
|
|
1447
|
-
if (
|
|
1678
|
+
if ($t(i))
|
|
1448
1679
|
return console.warn(`[Throttle] Skipped translation for: "${e}"`), e;
|
|
1449
|
-
const h =
|
|
1680
|
+
const h = At(e);
|
|
1450
1681
|
try {
|
|
1451
|
-
const { data: l } = await
|
|
1682
|
+
const { data: l } = await Re.post(
|
|
1452
1683
|
n,
|
|
1453
1684
|
{
|
|
1454
1685
|
q: e,
|
|
1455
1686
|
source: h,
|
|
1456
1687
|
target: t,
|
|
1457
|
-
api_key:
|
|
1688
|
+
api_key: a
|
|
1458
1689
|
},
|
|
1459
1690
|
{
|
|
1460
1691
|
headers: {
|
|
1461
1692
|
"Content-Type": "application/json"
|
|
1462
1693
|
}
|
|
1463
1694
|
}
|
|
1464
|
-
),
|
|
1465
|
-
return
|
|
1695
|
+
), d = (l == null ? void 0 : l.translatedText) || e;
|
|
1696
|
+
return Nt(e, t, d), d;
|
|
1466
1697
|
} catch (l) {
|
|
1467
1698
|
return console.warn(`[Translation] Failed for: "${e}"`, l), e;
|
|
1468
1699
|
}
|
|
1469
|
-
},
|
|
1470
|
-
const
|
|
1471
|
-
Object.entries(e).map(async ([
|
|
1472
|
-
if (
|
|
1473
|
-
const h = await
|
|
1474
|
-
return [
|
|
1700
|
+
}, It = (e) => typeof e == "string" && e.trim().length > 0, he = async (e, t, n) => {
|
|
1701
|
+
const a = await Promise.all(
|
|
1702
|
+
Object.entries(e).map(async ([i, r]) => {
|
|
1703
|
+
if (It(r)) {
|
|
1704
|
+
const h = await Ft(r, t, n);
|
|
1705
|
+
return [i, h];
|
|
1475
1706
|
} else if (Array.isArray(r)) {
|
|
1476
1707
|
const h = await Promise.all(
|
|
1477
1708
|
r.map(
|
|
1478
|
-
async (l) => typeof l == "object" && l !== null ? await
|
|
1709
|
+
async (l) => typeof l == "object" && l !== null ? await he(l, t, n) : l
|
|
1479
1710
|
)
|
|
1480
1711
|
);
|
|
1481
|
-
return [
|
|
1712
|
+
return [i, h];
|
|
1482
1713
|
} else if (typeof r == "object" && r !== null) {
|
|
1483
|
-
const h = await
|
|
1484
|
-
return [
|
|
1714
|
+
const h = await he(r, t, n);
|
|
1715
|
+
return [i, h];
|
|
1485
1716
|
} else
|
|
1486
|
-
return [
|
|
1717
|
+
return [i, r];
|
|
1487
1718
|
})
|
|
1488
1719
|
);
|
|
1489
|
-
return Object.fromEntries(
|
|
1720
|
+
return Object.fromEntries(a);
|
|
1490
1721
|
};
|
|
1491
1722
|
export {
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1723
|
+
ee as BusinessRuleCard,
|
|
1724
|
+
xe as BusinessRuleView,
|
|
1725
|
+
Pt as BusinessRules,
|
|
1726
|
+
Gt as Filter,
|
|
1727
|
+
Qt as FilterModal,
|
|
1728
|
+
Wt as FormFilter,
|
|
1729
|
+
Qe as ModalRules,
|
|
1730
|
+
Dt as RulesForm,
|
|
1731
|
+
Yt as revertSortedDataSampleSwitchPlaces,
|
|
1732
|
+
Kt as revertSortedDataSwitchPlaces,
|
|
1733
|
+
Jt as sortDisplayDataSampleSwitchPlaces,
|
|
1734
|
+
Xt as sortDisplayDataSwitchPlaces,
|
|
1735
|
+
he as translateObject,
|
|
1736
|
+
Ft as translateText
|
|
1506
1737
|
};
|