@isettingkit/business-rules 1.0.19 → 1.0.20
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 +65 -9
- package/dist/index.es.js +1483 -925
- package/package.json +13 -15
package/dist/index.es.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { MdOutlineDelete as
|
|
3
|
-
import { inube as
|
|
4
|
-
import x, { keyframes as
|
|
5
|
-
import { ValueDataType as
|
|
6
|
-
import { DecisionViewConditionRenderer as G } from "@isettingkit/view";
|
|
7
|
-
import { createPortal as
|
|
8
|
-
import
|
|
9
|
-
import { useFormik as
|
|
10
|
-
import { string as
|
|
11
|
-
import
|
|
12
|
-
import { franc as
|
|
13
|
-
const
|
|
1
|
+
import { jsx as o, jsxs as h, Fragment as k } from "react/jsx-runtime";
|
|
2
|
+
import { MdOutlineDelete as Te, MdClear as xe, MdAdd as Y, MdExpandLess as Re, MdExpandMore as Oe, MdClose as Me, MdOutlineFilterAltOff as ve, MdOutlineFilterAlt as ye } from "react-icons/md";
|
|
3
|
+
import { inube as v, Stack as g, Divider as R, Icon as L, Text as S, SkeletonLine as z, useMediaQuery as B, Blanket as we, Button as U, Grid as K, Box as Le, Tag as H, SkeletonIcon as Ue, OptionList as ze, Checkpicker as Ve, Toggle as Ce, Checkbox as je, Date as de } from "@inubekit/inubekit";
|
|
4
|
+
import x, { keyframes as De, ThemeContext as Be } from "styled-components";
|
|
5
|
+
import { ValueDataType as I, ValueHowToSetUp as V, DecisionConditionRender as ce } from "@isettingkit/input";
|
|
6
|
+
import { DecisionViewConditionRenderer as X, DecisionViewConditionRendererNew as G } from "@isettingkit/view";
|
|
7
|
+
import { createPortal as Se } from "react-dom";
|
|
8
|
+
import _e, { useState as O, useRef as Q, useEffect as oe, useContext as He } from "react";
|
|
9
|
+
import { useFormik as qe } from "formik";
|
|
10
|
+
import { string as ie, mixed as Ne, object as W, number as ee, lazy as ue, date as pe } from "yup";
|
|
11
|
+
import Pe from "axios";
|
|
12
|
+
import { franc as Ge } from "franc-min";
|
|
13
|
+
const Qe = x.div`
|
|
14
14
|
border-radius: 8px;
|
|
15
15
|
border: 1px solid
|
|
16
16
|
${({ theme: e }) => {
|
|
17
|
-
var
|
|
18
|
-
return ((
|
|
17
|
+
var n, t;
|
|
18
|
+
return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
|
|
19
19
|
}};
|
|
20
20
|
box-sizing: border-box;
|
|
21
21
|
display: flex;
|
|
@@ -45,36 +45,51 @@ x.div`
|
|
|
45
45
|
border-radius: 8px;
|
|
46
46
|
}
|
|
47
47
|
`;
|
|
48
|
-
const
|
|
49
|
-
const { children:
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
|
|
48
|
+
const re = (e) => {
|
|
49
|
+
const { children: n, controls: t = !0, handleDelete: a, id: i } = e;
|
|
50
|
+
return /* @__PURE__ */ o(Qe, { children: /* @__PURE__ */ h(g, { direction: "column", gap: "16px", padding: "12px 16px", children: [
|
|
51
|
+
n,
|
|
52
|
+
t && /* @__PURE__ */ h(k, { children: [
|
|
53
|
+
/* @__PURE__ */ o(R, {}),
|
|
54
|
+
/* @__PURE__ */ o(g, { gap: "16px", justifyContent: "end", children: /* @__PURE__ */ o(
|
|
55
|
+
L,
|
|
56
56
|
{
|
|
57
57
|
cursorHover: !0,
|
|
58
58
|
appearance: "danger",
|
|
59
59
|
size: "24px",
|
|
60
|
-
icon: /* @__PURE__ */
|
|
60
|
+
icon: /* @__PURE__ */ o(Te, {}),
|
|
61
61
|
onClick: () => {
|
|
62
|
-
|
|
62
|
+
a(i);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
) })
|
|
66
66
|
] })
|
|
67
67
|
] }) });
|
|
68
|
-
},
|
|
68
|
+
}, We = (e) => e.value, Ye = (e) => e.value, Ke = (e) => e.value, Je = (e) => ({
|
|
69
|
+
from: e.from ?? "",
|
|
70
|
+
to: e.to ?? ""
|
|
71
|
+
}), Xe = (e) => e.value, Ze = (e) => e.value, en = (e) => e.value;
|
|
72
|
+
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 || {});
|
|
73
|
+
const nn = {
|
|
74
|
+
[D.LIST_OF_VALUES]: Ye,
|
|
75
|
+
[D.LIST_OF_VALUES_MULTI]: Ke,
|
|
76
|
+
[D.RANGE]: Je,
|
|
77
|
+
[D.GREATER_THAN]: Xe,
|
|
78
|
+
[D.LESS_THAN]: Ze,
|
|
79
|
+
[D.EQUAL]: en
|
|
80
|
+
}, q = (e) => {
|
|
81
|
+
const n = e == null ? void 0 : e.value, t = typeof n == "object" && n !== null && !Array.isArray(n), a = nn[e == null ? void 0 : e.howToSetTheDecision] || We;
|
|
82
|
+
return t && a(n) || n || void 0;
|
|
83
|
+
}, he = x.div`
|
|
69
84
|
& > div {
|
|
70
85
|
border-radius: 8px;
|
|
71
86
|
border: 1px solid
|
|
72
87
|
${({ theme: e }) => {
|
|
73
|
-
var
|
|
74
|
-
return ((
|
|
88
|
+
var n, t;
|
|
89
|
+
return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
|
|
75
90
|
}};
|
|
76
91
|
}
|
|
77
|
-
`,
|
|
92
|
+
`, ge = x.div`
|
|
78
93
|
width: 100%;
|
|
79
94
|
height: 100%;
|
|
80
95
|
overflow-y: auto;
|
|
@@ -92,105 +107,90 @@ const ee = (e) => {
|
|
|
92
107
|
background-color: #ebecf0;
|
|
93
108
|
border-radius: 8px;
|
|
94
109
|
}
|
|
95
|
-
`,
|
|
96
|
-
from: e.from ?? "",
|
|
97
|
-
to: e.to ?? ""
|
|
98
|
-
}), _e = (e) => e.value, Ue = (e) => e.value, Be = (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 qe = {
|
|
101
|
-
[D.LIST_OF_VALUES]: ze,
|
|
102
|
-
[D.LIST_OF_VALUES_MULTI]: Ve,
|
|
103
|
-
[D.RANGE]: je,
|
|
104
|
-
[D.GREATER_THAN]: _e,
|
|
105
|
-
[D.LESS_THAN]: Ue,
|
|
106
|
-
[D.EQUAL]: Be
|
|
107
|
-
}, U = (e) => {
|
|
108
|
-
const t = e == null ? void 0 : e.value, n = typeof t == "object" && t !== null && !Array.isArray(t), o = qe[e == null ? void 0 : e.howToSetTheDecision] || Le;
|
|
109
|
-
return n && o(t) || t || void 0;
|
|
110
|
-
}, He = (e) => {
|
|
110
|
+
`, tn = (e) => {
|
|
111
111
|
const {
|
|
112
|
-
conditionsAlignment:
|
|
113
|
-
decision:
|
|
114
|
-
decisionDateElement:
|
|
115
|
-
decisionMapper:
|
|
116
|
-
loading:
|
|
117
|
-
skeleton:
|
|
112
|
+
conditionsAlignment: n,
|
|
113
|
+
decision: t,
|
|
114
|
+
decisionDateElement: a,
|
|
115
|
+
decisionMapper: i,
|
|
116
|
+
loading: r,
|
|
117
|
+
skeleton: p,
|
|
118
118
|
terms: l,
|
|
119
|
-
textValues:
|
|
120
|
-
visibleConditions:
|
|
119
|
+
textValues: s,
|
|
120
|
+
visibleConditions: c
|
|
121
121
|
} = e;
|
|
122
|
-
return
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
|
|
122
|
+
return r ? /* @__PURE__ */ h(g, { direction: "column", gap: "12px", children: [
|
|
123
|
+
/* @__PURE__ */ o(g, { direction: "column", alignItems: "center", children: /* @__PURE__ */ o(
|
|
124
|
+
X,
|
|
125
125
|
{
|
|
126
|
-
element:
|
|
127
|
-
valueData:
|
|
128
|
-
|
|
126
|
+
element: i,
|
|
127
|
+
valueData: q(
|
|
128
|
+
i
|
|
129
129
|
),
|
|
130
130
|
type: "decision"
|
|
131
131
|
}
|
|
132
|
-
) },
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
/* @__PURE__ */
|
|
132
|
+
) }, t.ruleName),
|
|
133
|
+
/* @__PURE__ */ o(R, { dashed: !0 }),
|
|
134
|
+
/* @__PURE__ */ o(ge, { children: /* @__PURE__ */ h(
|
|
135
135
|
g,
|
|
136
136
|
{
|
|
137
137
|
direction: "column",
|
|
138
138
|
gap: "12px",
|
|
139
|
-
justifyContent:
|
|
139
|
+
justifyContent: n,
|
|
140
140
|
height: "203px",
|
|
141
141
|
children: [
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
|
|
142
|
+
/* @__PURE__ */ o(
|
|
143
|
+
S,
|
|
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: s.factsThatConditionIt
|
|
151
151
|
}
|
|
152
152
|
),
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
c.map((u) => /* @__PURE__ */ o(he, { children: /* @__PURE__ */ o(g, { direction: "column", padding: "8px", children: /* @__PURE__ */ o(
|
|
154
|
+
X,
|
|
155
155
|
{
|
|
156
156
|
element: { ...u, value: u.value },
|
|
157
|
-
valueData:
|
|
157
|
+
valueData: q(
|
|
158
158
|
u
|
|
159
159
|
)
|
|
160
160
|
}
|
|
161
161
|
) }) }, u.conditionName)),
|
|
162
|
-
l && /* @__PURE__ */
|
|
163
|
-
/* @__PURE__ */
|
|
164
|
-
|
|
165
|
-
|
|
162
|
+
l && /* @__PURE__ */ h(k, { children: [
|
|
163
|
+
/* @__PURE__ */ o(R, { dashed: !0 }),
|
|
164
|
+
a && /* @__PURE__ */ o(
|
|
165
|
+
X,
|
|
166
166
|
{
|
|
167
|
-
element:
|
|
168
|
-
valueData:
|
|
167
|
+
element: a.element,
|
|
168
|
+
valueData: a.valueData,
|
|
169
169
|
type: "decision"
|
|
170
170
|
},
|
|
171
|
-
|
|
171
|
+
s.terms
|
|
172
172
|
)
|
|
173
173
|
] })
|
|
174
174
|
]
|
|
175
175
|
}
|
|
176
176
|
) })
|
|
177
|
-
] }) : /* @__PURE__ */
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
/* @__PURE__ */
|
|
180
|
-
/* @__PURE__ */
|
|
177
|
+
] }) : /* @__PURE__ */ h(g, { direction: "column", gap: "12px", children: [
|
|
178
|
+
/* @__PURE__ */ h(g, { direction: "column", alignItems: "center", gap: "4px", children: [
|
|
179
|
+
/* @__PURE__ */ o(z, { animated: !0, width: "180px" }),
|
|
180
|
+
/* @__PURE__ */ o(z, { animated: !0, width: "85px" })
|
|
181
181
|
] }, "loading"),
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ h(g, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
183
|
+
/* @__PURE__ */ o(R, { dashed: !0 }),
|
|
184
|
+
/* @__PURE__ */ o(z, { animated: !0, width: "150px" })
|
|
185
185
|
] }),
|
|
186
|
-
/* @__PURE__ */
|
|
186
|
+
/* @__PURE__ */ o(ge, { children: /* @__PURE__ */ o(
|
|
187
187
|
g,
|
|
188
188
|
{
|
|
189
189
|
direction: "column",
|
|
190
190
|
gap: "12px",
|
|
191
191
|
justifyContent: "space-between",
|
|
192
192
|
height: "203px",
|
|
193
|
-
children:
|
|
193
|
+
children: p.map((u, d) => /* @__PURE__ */ o(he, { children: /* @__PURE__ */ h(
|
|
194
194
|
g,
|
|
195
195
|
{
|
|
196
196
|
direction: "column",
|
|
@@ -198,76 +198,76 @@ const qe = {
|
|
|
198
198
|
alignItems: "start",
|
|
199
199
|
padding: "8px",
|
|
200
200
|
children: [
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ o(z, { animated: !0, width: "180px" }),
|
|
202
|
+
/* @__PURE__ */ o(z, { animated: !0, width: "85px" })
|
|
203
203
|
]
|
|
204
204
|
}
|
|
205
|
-
) }, `condition-${
|
|
205
|
+
) }, `condition-${d}`))
|
|
206
206
|
}
|
|
207
207
|
) })
|
|
208
208
|
] });
|
|
209
|
-
},
|
|
210
|
-
var
|
|
211
|
-
const { decision:
|
|
209
|
+
}, Ee = (e) => {
|
|
210
|
+
var b;
|
|
211
|
+
const { decision: n, loading: t = !1, textValues: a } = e, i = !!(n != null && n.effectiveFrom), r = !!(n != null && n.validUntil), p = i && r ? {
|
|
212
212
|
element: {
|
|
213
|
-
labelName:
|
|
214
|
-
value: String(
|
|
215
|
-
howToSetTheDecision:
|
|
216
|
-
decisionDataType:
|
|
213
|
+
labelName: a == null ? void 0 : a.terms,
|
|
214
|
+
value: String(n.effectiveFrom),
|
|
215
|
+
howToSetTheDecision: V.RANGE,
|
|
216
|
+
decisionDataType: I.DATE
|
|
217
217
|
},
|
|
218
|
-
valueData:
|
|
219
|
-
labelName:
|
|
218
|
+
valueData: q({
|
|
219
|
+
labelName: a == null ? void 0 : a.terms,
|
|
220
220
|
value: {
|
|
221
|
-
from: String(
|
|
222
|
-
to: String(
|
|
221
|
+
from: String(n.effectiveFrom),
|
|
222
|
+
to: String(n.validUntil)
|
|
223
223
|
},
|
|
224
|
-
howToSetTheDecision:
|
|
225
|
-
decisionDataType:
|
|
224
|
+
howToSetTheDecision: V.RANGE,
|
|
225
|
+
decisionDataType: I.DATE
|
|
226
226
|
})
|
|
227
|
-
} :
|
|
227
|
+
} : i && !r ? {
|
|
228
228
|
element: {
|
|
229
|
-
labelName:
|
|
230
|
-
value: String(
|
|
231
|
-
howToSetTheDecision:
|
|
232
|
-
decisionDataType:
|
|
229
|
+
labelName: a == null ? void 0 : a.terms,
|
|
230
|
+
value: String(n.effectiveFrom),
|
|
231
|
+
howToSetTheDecision: V.EQUAL,
|
|
232
|
+
decisionDataType: I.DATE
|
|
233
233
|
},
|
|
234
|
-
valueData:
|
|
235
|
-
labelName:
|
|
236
|
-
value: String(
|
|
237
|
-
howToSetTheDecision:
|
|
238
|
-
decisionDataType:
|
|
234
|
+
valueData: q({
|
|
235
|
+
labelName: a == null ? void 0 : a.terms,
|
|
236
|
+
value: String(n.effectiveFrom),
|
|
237
|
+
howToSetTheDecision: V.EQUAL,
|
|
238
|
+
decisionDataType: I.DATE
|
|
239
239
|
})
|
|
240
|
-
} : null, l =
|
|
241
|
-
labelName:
|
|
242
|
-
decisionDataType:
|
|
243
|
-
value:
|
|
244
|
-
howToSetTheDecision:
|
|
245
|
-
} : null,
|
|
246
|
-
(
|
|
247
|
-
)) || [],
|
|
248
|
-
return /* @__PURE__ */
|
|
249
|
-
|
|
240
|
+
} : null, l = n ? {
|
|
241
|
+
labelName: n.labelName || "",
|
|
242
|
+
decisionDataType: n.decisionDataType || "alphabetical",
|
|
243
|
+
value: q(n),
|
|
244
|
+
howToSetTheDecision: n.howToSetTheDecision || "EqualTo"
|
|
245
|
+
} : null, s = ((b = n == null ? void 0 : n.conditionsThatEstablishesTheDecision) == null ? void 0 : b.filter(
|
|
246
|
+
(m) => !m.hidden
|
|
247
|
+
)) || [], c = Array.from({ length: 5 }), u = !!(!t && n && a && l), d = s.length < 2 ? "start" : "space-between";
|
|
248
|
+
return /* @__PURE__ */ o(
|
|
249
|
+
tn,
|
|
250
250
|
{
|
|
251
|
-
conditionsAlignment:
|
|
252
|
-
decision:
|
|
253
|
-
decisionDateElement:
|
|
251
|
+
conditionsAlignment: d,
|
|
252
|
+
decision: n,
|
|
253
|
+
decisionDateElement: p,
|
|
254
254
|
decisionMapper: l,
|
|
255
255
|
loading: u,
|
|
256
|
-
skeleton:
|
|
257
|
-
terms: !!(
|
|
258
|
-
textValues:
|
|
259
|
-
visibleConditions:
|
|
256
|
+
skeleton: c,
|
|
257
|
+
terms: !!(a != null && a.terms),
|
|
258
|
+
textValues: a,
|
|
259
|
+
visibleConditions: s
|
|
260
260
|
}
|
|
261
261
|
);
|
|
262
|
-
},
|
|
262
|
+
}, an = x.div`
|
|
263
263
|
position: relative;
|
|
264
264
|
& > div {
|
|
265
265
|
padding: 24px 16px;
|
|
266
266
|
}
|
|
267
|
-
`,
|
|
267
|
+
`, on = x.div`
|
|
268
268
|
background-color: ${({ theme: e }) => {
|
|
269
|
-
var
|
|
270
|
-
return ((
|
|
269
|
+
var n, t;
|
|
270
|
+
return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N0) || v.palette.neutral.N0;
|
|
271
271
|
}};
|
|
272
272
|
max-width: 450px;
|
|
273
273
|
max-height: 90vh;
|
|
@@ -295,24 +295,24 @@ const qe = {
|
|
|
295
295
|
background-color: #ebecf0;
|
|
296
296
|
border-radius: 8px;
|
|
297
297
|
}
|
|
298
|
-
`,
|
|
299
|
-
const { children:
|
|
300
|
-
if (!
|
|
298
|
+
`, ke = (e) => {
|
|
299
|
+
const { children: n, portalId: t, onCloseModal: a, title: i } = e, r = document.getElementById(t);
|
|
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
|
|
305
|
-
return
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
/* @__PURE__ */
|
|
308
|
-
/* @__PURE__ */
|
|
309
|
-
/* @__PURE__ */
|
|
304
|
+
const p = B("(max-width: 400px)");
|
|
305
|
+
return Se(
|
|
306
|
+
/* @__PURE__ */ o(an, { smallScreen: p, children: /* @__PURE__ */ o(we, { children: /* @__PURE__ */ o(on, { children: /* @__PURE__ */ h(g, { direction: "column", gap: "24px", children: [
|
|
307
|
+
/* @__PURE__ */ o(g, { direction: "column", gap: "24px", children: /* @__PURE__ */ h(g, { alignItems: "center", justifyContent: "space-between", children: [
|
|
308
|
+
/* @__PURE__ */ o(S, { type: "title", size: "large", appearance: "dark", weight: "bold", children: i }),
|
|
309
|
+
/* @__PURE__ */ o(xe, { size: "24px", cursor: "pointer", onClick: a })
|
|
310
310
|
] }) }),
|
|
311
|
-
|
|
311
|
+
n
|
|
312
312
|
] }) }) }) }),
|
|
313
|
-
|
|
313
|
+
r
|
|
314
314
|
);
|
|
315
|
-
},
|
|
315
|
+
}, rn = De`
|
|
316
316
|
from {
|
|
317
317
|
opacity: 0;
|
|
318
318
|
transform: translateY(20px);
|
|
@@ -326,8 +326,8 @@ x.div`
|
|
|
326
326
|
border-radius: 8px;
|
|
327
327
|
border: 1px solid
|
|
328
328
|
${({ theme: e }) => {
|
|
329
|
-
var
|
|
330
|
-
return ((
|
|
329
|
+
var n, t;
|
|
330
|
+
return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
|
|
331
331
|
}};
|
|
332
332
|
box-sizing: border-box;
|
|
333
333
|
display: flex;
|
|
@@ -341,36 +341,32 @@ x.div`
|
|
|
341
341
|
border-radius: 8px;
|
|
342
342
|
border: 1px solid
|
|
343
343
|
${({ theme: e }) => {
|
|
344
|
-
var
|
|
345
|
-
return ((
|
|
344
|
+
var n, t;
|
|
345
|
+
return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
|
|
346
346
|
}};
|
|
347
347
|
}
|
|
348
348
|
`;
|
|
349
|
-
const
|
|
349
|
+
const Ae = x.div`
|
|
350
350
|
& > div {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
351
|
+
box-shadow: 0px 2px 3px 0px
|
|
352
|
+
${({ theme: e }) => {
|
|
353
|
+
var n, t;
|
|
354
|
+
return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutralAlpha) == null ? void 0 : t.N700A) || v.palette.neutralAlpha.N30A;
|
|
354
355
|
}};
|
|
355
|
-
|
|
356
|
+
cursor: pointer;
|
|
356
357
|
}
|
|
357
|
-
|
|
358
|
-
width: 100%;
|
|
359
|
-
height: 100%;
|
|
360
|
-
padding-bottom: 12px;
|
|
361
|
-
cursor: pointer;
|
|
362
|
-
`, we = x.div`
|
|
358
|
+
`, J = x.div`
|
|
363
359
|
width: 100%;
|
|
364
360
|
height: 100%;
|
|
365
361
|
& > div {
|
|
366
|
-
animation: ${
|
|
362
|
+
animation: ${rn} 600ms ease-out;
|
|
367
363
|
}
|
|
368
|
-
`,
|
|
364
|
+
`, ln = x.div`
|
|
369
365
|
& > div > div {
|
|
370
366
|
border-radius: 8px;
|
|
371
367
|
box-sizing: border-box;
|
|
372
368
|
}
|
|
373
|
-
`,
|
|
369
|
+
`, sn = x.div`
|
|
374
370
|
& > div {
|
|
375
371
|
width: 100%;
|
|
376
372
|
height: 100%;
|
|
@@ -390,149 +386,145 @@ const Ye = x.div`
|
|
|
390
386
|
border-radius: 8px;
|
|
391
387
|
}
|
|
392
388
|
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
ee,
|
|
389
|
+
`, dn = (e) => {
|
|
390
|
+
const { index: n, handleOpenModal: t } = e;
|
|
391
|
+
return /* @__PURE__ */ o(
|
|
392
|
+
re,
|
|
398
393
|
{
|
|
399
|
-
id: `loading-card-${
|
|
394
|
+
id: `loading-card-${n}`,
|
|
400
395
|
handleDelete: () => {
|
|
401
396
|
},
|
|
402
|
-
handleView: () =>
|
|
397
|
+
handleView: () => t ? t() : null,
|
|
403
398
|
controls: !1,
|
|
404
|
-
children: /* @__PURE__ */
|
|
399
|
+
children: /* @__PURE__ */ o(Ee, { loading: !0 })
|
|
405
400
|
},
|
|
406
|
-
`loading-card-${
|
|
401
|
+
`loading-card-${n}`
|
|
407
402
|
);
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
/* @__PURE__ */
|
|
413
|
-
|
|
414
|
-
ee,
|
|
403
|
+
}, cn = (e) => {
|
|
404
|
+
const { decision: n, controls: t, handleOpenModal: a, handleDelete: i, textValues: r } = e;
|
|
405
|
+
return n ? /* @__PURE__ */ o(J, { children: /* @__PURE__ */ h(g, { direction: "column", gap: "4px", width: "100%", padding: "0 0 12px 0", children: [
|
|
406
|
+
/* @__PURE__ */ o(S, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: n.decisionId }),
|
|
407
|
+
/* @__PURE__ */ o(
|
|
408
|
+
re,
|
|
415
409
|
{
|
|
416
|
-
id:
|
|
417
|
-
handleDelete: () =>
|
|
418
|
-
handleView: () =>
|
|
419
|
-
controls:
|
|
420
|
-
children: /* @__PURE__ */
|
|
410
|
+
id: n.decisionId,
|
|
411
|
+
handleDelete: () => i ? i(n.decisionId) : null,
|
|
412
|
+
handleView: () => a ? a(n) : null,
|
|
413
|
+
controls: t,
|
|
414
|
+
children: /* @__PURE__ */ o(Ee, { decision: n, textValues: r })
|
|
421
415
|
}
|
|
422
416
|
)
|
|
423
|
-
] }) },
|
|
424
|
-
}
|
|
425
|
-
function et(e) {
|
|
417
|
+
] }) }, n.decisionId) : null;
|
|
418
|
+
}, un = (e) => {
|
|
426
419
|
const {
|
|
427
|
-
customTitleContentAddCard:
|
|
428
|
-
index:
|
|
429
|
-
handleOpenModal:
|
|
430
|
-
shouldRenderEmptyMessage:
|
|
431
|
-
} = e,
|
|
432
|
-
return /* @__PURE__ */
|
|
433
|
-
/* @__PURE__ */
|
|
434
|
-
/* @__PURE__ */
|
|
435
|
-
|
|
420
|
+
customTitleContentAddCard: n,
|
|
421
|
+
index: t,
|
|
422
|
+
handleOpenModal: a,
|
|
423
|
+
shouldRenderEmptyMessage: i
|
|
424
|
+
} = e, r = n || "Agregar decisión";
|
|
425
|
+
return /* @__PURE__ */ o(J, { children: i ? null : /* @__PURE__ */ h(g, { direction: "column", gap: "4px", width: "100%", height: "100%", children: [
|
|
426
|
+
/* @__PURE__ */ o(S, { type: "title", size: "medium", appearance: "gray", weight: "bold", children: "Nueva decisión" }),
|
|
427
|
+
/* @__PURE__ */ o(
|
|
428
|
+
Ae,
|
|
436
429
|
{
|
|
437
|
-
onClick: () =>
|
|
438
|
-
children: /* @__PURE__ */
|
|
439
|
-
|
|
430
|
+
onClick: () => a ? a() : null,
|
|
431
|
+
children: /* @__PURE__ */ o(
|
|
432
|
+
re,
|
|
440
433
|
{
|
|
441
|
-
id: `add-decision-${
|
|
434
|
+
id: `add-decision-${t}`,
|
|
442
435
|
handleDelete: () => {
|
|
443
436
|
},
|
|
444
|
-
handleView: () =>
|
|
437
|
+
handleView: () => a ? a() : null,
|
|
445
438
|
controls: !1,
|
|
446
|
-
children: /* @__PURE__ */
|
|
447
|
-
/* @__PURE__ */
|
|
448
|
-
/* @__PURE__ */
|
|
439
|
+
children: /* @__PURE__ */ h(g, { direction: "column", gap: "12px", alignItems: "center", children: [
|
|
440
|
+
/* @__PURE__ */ o(L, { appearance: "gray", icon: /* @__PURE__ */ o(Y, {}), size: "35px" }),
|
|
441
|
+
/* @__PURE__ */ o(S, { appearance: "gray", type: "body", size: "large", children: r })
|
|
449
442
|
] })
|
|
450
443
|
}
|
|
451
444
|
)
|
|
452
445
|
}
|
|
453
446
|
)
|
|
454
|
-
] }) }, `add-decision-${
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
}, nt = (e) => {
|
|
447
|
+
] }) }, `add-decision-${t}`);
|
|
448
|
+
}, pn = {
|
|
449
|
+
loading: dn,
|
|
450
|
+
decision: cn,
|
|
451
|
+
add: un
|
|
452
|
+
}, ne = (e) => {
|
|
453
|
+
const { type: n } = e, t = pn[n];
|
|
454
|
+
return t ? t(e) : null;
|
|
455
|
+
}, hn = (e) => {
|
|
464
456
|
const {
|
|
465
|
-
controls:
|
|
466
|
-
customTitleContentAddCard:
|
|
467
|
-
decisions:
|
|
468
|
-
loading:
|
|
469
|
-
handleOpenModal:
|
|
470
|
-
handleDelete:
|
|
457
|
+
controls: n,
|
|
458
|
+
customTitleContentAddCard: t,
|
|
459
|
+
decisions: a,
|
|
460
|
+
loading: i,
|
|
461
|
+
handleOpenModal: r,
|
|
462
|
+
handleDelete: p,
|
|
471
463
|
textValues: l
|
|
472
|
-
} = e,
|
|
473
|
-
(u,
|
|
464
|
+
} = e, s = i ? Array.from({ length: 3 }).map(
|
|
465
|
+
(u, d) => ne({
|
|
474
466
|
type: "loading",
|
|
475
|
-
index:
|
|
476
|
-
controls:
|
|
477
|
-
customTitleContentAddCard:
|
|
478
|
-
loading:
|
|
479
|
-
handleOpenModal:
|
|
480
|
-
handleDelete:
|
|
467
|
+
index: d,
|
|
468
|
+
controls: n,
|
|
469
|
+
customTitleContentAddCard: t,
|
|
470
|
+
loading: i,
|
|
471
|
+
handleOpenModal: r,
|
|
472
|
+
handleDelete: p,
|
|
481
473
|
textValues: l
|
|
482
474
|
})
|
|
483
|
-
) :
|
|
484
|
-
(u) =>
|
|
475
|
+
) : a == null ? void 0 : a.map(
|
|
476
|
+
(u) => ne({
|
|
485
477
|
type: "decision",
|
|
486
478
|
decision: u,
|
|
487
|
-
controls:
|
|
488
|
-
customTitleContentAddCard:
|
|
489
|
-
loading:
|
|
490
|
-
handleOpenModal:
|
|
491
|
-
handleDelete:
|
|
479
|
+
controls: n,
|
|
480
|
+
customTitleContentAddCard: t,
|
|
481
|
+
loading: i,
|
|
482
|
+
handleOpenModal: r,
|
|
483
|
+
handleDelete: p,
|
|
492
484
|
textValues: l
|
|
493
485
|
})
|
|
494
|
-
),
|
|
495
|
-
return { renderedCards:
|
|
496
|
-
},
|
|
486
|
+
), c = ((a == null ? void 0 : a.length) === 0 || a.length < Math.floor(window.innerWidth / 300)) && !i && n;
|
|
487
|
+
return { renderedCards: s, shouldRenderAddCard: c };
|
|
488
|
+
}, xt = (e) => {
|
|
497
489
|
const {
|
|
498
|
-
controls:
|
|
499
|
-
customTitleContentAddCard:
|
|
500
|
-
customMessageEmptyDecisions:
|
|
501
|
-
decisions:
|
|
502
|
-
textValues:
|
|
503
|
-
decisionTemplate:
|
|
490
|
+
controls: n = !0,
|
|
491
|
+
customTitleContentAddCard: t,
|
|
492
|
+
customMessageEmptyDecisions: a,
|
|
493
|
+
decisions: i,
|
|
494
|
+
textValues: r,
|
|
495
|
+
decisionTemplate: p,
|
|
504
496
|
isModalOpen: l,
|
|
505
|
-
selectedDecision:
|
|
506
|
-
loading:
|
|
497
|
+
selectedDecision: s,
|
|
498
|
+
loading: c,
|
|
507
499
|
handleOpenModal: u,
|
|
508
|
-
handleCloseModal:
|
|
509
|
-
handleSubmitForm:
|
|
510
|
-
handleDelete:
|
|
511
|
-
terms:
|
|
512
|
-
} = e,
|
|
513
|
-
controls:
|
|
514
|
-
customTitleContentAddCard:
|
|
515
|
-
decisions:
|
|
516
|
-
loading:
|
|
500
|
+
handleCloseModal: d,
|
|
501
|
+
handleSubmitForm: b,
|
|
502
|
+
handleDelete: m,
|
|
503
|
+
terms: f = !0
|
|
504
|
+
} = e, y = B("(max-width: 681px)"), C = B("(max-width: 400px)"), { renderedCards: w, shouldRenderAddCard: E } = hn({
|
|
505
|
+
controls: n,
|
|
506
|
+
customTitleContentAddCard: t,
|
|
507
|
+
decisions: i,
|
|
508
|
+
loading: c,
|
|
517
509
|
handleOpenModal: u,
|
|
518
|
-
handleDelete:
|
|
519
|
-
textValues:
|
|
520
|
-
}),
|
|
521
|
-
return /* @__PURE__ */
|
|
522
|
-
/* @__PURE__ */
|
|
510
|
+
handleDelete: m,
|
|
511
|
+
textValues: r
|
|
512
|
+
}), $ = (i == null ? void 0 : i.length) === 0 && !c;
|
|
513
|
+
return /* @__PURE__ */ h(k, { children: [
|
|
514
|
+
/* @__PURE__ */ o(ln, { children: /* @__PURE__ */ o(sn, { children: /* @__PURE__ */ o(g, { direction: "column", gap: "16px", padding: "6px", children: $ ? /* @__PURE__ */ h(
|
|
523
515
|
g,
|
|
524
516
|
{
|
|
525
517
|
direction: "column",
|
|
526
518
|
gap: "28px",
|
|
527
519
|
width: "100%",
|
|
528
|
-
height:
|
|
520
|
+
height: y ? "auto" : "435px",
|
|
529
521
|
justifyContent: "center",
|
|
530
522
|
alignItems: "center",
|
|
531
523
|
children: [
|
|
532
|
-
/* @__PURE__ */
|
|
524
|
+
/* @__PURE__ */ o(S, { as: "span", type: "label", size: "large", appearance: "gray", children: a || /* @__PURE__ */ h(k, { children: [
|
|
533
525
|
"Aún NO tienes definidas tasas de interés efectivas . Presiona",
|
|
534
|
-
/* @__PURE__ */
|
|
535
|
-
|
|
526
|
+
/* @__PURE__ */ h(
|
|
527
|
+
S,
|
|
536
528
|
{
|
|
537
529
|
as: "span",
|
|
538
530
|
type: "label",
|
|
@@ -541,27 +533,27 @@ const tt = {
|
|
|
541
533
|
weight: "bold",
|
|
542
534
|
children: [
|
|
543
535
|
"“",
|
|
544
|
-
|
|
536
|
+
t || "+ Agregar decisión",
|
|
545
537
|
"”"
|
|
546
538
|
]
|
|
547
539
|
}
|
|
548
540
|
),
|
|
549
541
|
"para empezar."
|
|
550
542
|
] }) }),
|
|
551
|
-
/* @__PURE__ */
|
|
552
|
-
|
|
543
|
+
/* @__PURE__ */ o(
|
|
544
|
+
U,
|
|
553
545
|
{
|
|
554
|
-
iconBefore: /* @__PURE__ */
|
|
546
|
+
iconBefore: /* @__PURE__ */ o(Y, {}),
|
|
555
547
|
onClick: () => u ? u() : null,
|
|
556
|
-
children:
|
|
548
|
+
children: t || "Agregar decisión"
|
|
557
549
|
}
|
|
558
550
|
)
|
|
559
551
|
]
|
|
560
552
|
}
|
|
561
|
-
) : /* @__PURE__ */
|
|
562
|
-
|
|
553
|
+
) : /* @__PURE__ */ h(
|
|
554
|
+
K,
|
|
563
555
|
{
|
|
564
|
-
templateColumns:
|
|
556
|
+
templateColumns: C ? "repeat(auto-fill, minmax(200px, 1fr))" : "repeat(auto-fill, minmax(300px, 1fr))",
|
|
565
557
|
autoFlow: "row dense",
|
|
566
558
|
gap: "24px",
|
|
567
559
|
alignItems: "start",
|
|
@@ -569,45 +561,77 @@ const tt = {
|
|
|
569
561
|
autoRows: "1fr",
|
|
570
562
|
justifyItems: "center",
|
|
571
563
|
padding: "6px",
|
|
572
|
-
height:
|
|
564
|
+
height: y ? "auto" : "484px",
|
|
573
565
|
children: [
|
|
574
|
-
|
|
575
|
-
|
|
566
|
+
w,
|
|
567
|
+
E && ne({
|
|
576
568
|
type: "add",
|
|
577
|
-
index:
|
|
578
|
-
controls:
|
|
579
|
-
customTitleContentAddCard:
|
|
580
|
-
customMessageEmptyDecisions:
|
|
581
|
-
loading:
|
|
569
|
+
index: i == null ? void 0 : i.length,
|
|
570
|
+
controls: n,
|
|
571
|
+
customTitleContentAddCard: t,
|
|
572
|
+
customMessageEmptyDecisions: a,
|
|
573
|
+
loading: c,
|
|
582
574
|
handleOpenModal: u,
|
|
583
|
-
handleDelete:
|
|
584
|
-
textValues:
|
|
585
|
-
shouldRenderEmptyMessage:
|
|
586
|
-
terms:
|
|
575
|
+
handleDelete: m,
|
|
576
|
+
textValues: r,
|
|
577
|
+
shouldRenderEmptyMessage: $,
|
|
578
|
+
terms: f
|
|
587
579
|
})
|
|
588
580
|
]
|
|
589
581
|
}
|
|
590
582
|
) }) }) }),
|
|
591
|
-
l && /* @__PURE__ */
|
|
592
|
-
|
|
583
|
+
l && /* @__PURE__ */ o(
|
|
584
|
+
ke,
|
|
593
585
|
{
|
|
594
586
|
portalId: "modal-portal",
|
|
595
|
-
onCloseModal:
|
|
596
|
-
title:
|
|
597
|
-
children: /* @__PURE__ */
|
|
598
|
-
|
|
587
|
+
onCloseModal: d,
|
|
588
|
+
title: s ? "Editar Decisión" : "Nueva decisión",
|
|
589
|
+
children: /* @__PURE__ */ o(
|
|
590
|
+
Ie,
|
|
599
591
|
{
|
|
600
|
-
decision:
|
|
601
|
-
onSubmitEvent:
|
|
602
|
-
textValues:
|
|
603
|
-
onCancel: () =>
|
|
592
|
+
decision: s || p,
|
|
593
|
+
onSubmitEvent: b,
|
|
594
|
+
textValues: r,
|
|
595
|
+
onCancel: () => d ? d() : () => {
|
|
604
596
|
}
|
|
605
597
|
}
|
|
606
598
|
)
|
|
607
599
|
}
|
|
608
600
|
)
|
|
609
601
|
] });
|
|
610
|
-
},
|
|
602
|
+
}, $e = (e) => {
|
|
603
|
+
const { children: n, controls: t = !0, handleDelete: a, id: i } = e;
|
|
604
|
+
return /* @__PURE__ */ h(Le, { width: "100%", children: [
|
|
605
|
+
n,
|
|
606
|
+
t && /* @__PURE__ */ o(k, { children: /* @__PURE__ */ o(g, { gap: "16px", justifyContent: "end", margin: "16px 0 0 0", children: /* @__PURE__ */ o(
|
|
607
|
+
U,
|
|
608
|
+
{
|
|
609
|
+
cursorHover: !0,
|
|
610
|
+
appearance: "danger",
|
|
611
|
+
spacing: "compact",
|
|
612
|
+
variant: "outlined",
|
|
613
|
+
iconBefore: /* @__PURE__ */ o(Te, {}),
|
|
614
|
+
onClick: () => {
|
|
615
|
+
a(i);
|
|
616
|
+
},
|
|
617
|
+
children: "Eliminar"
|
|
618
|
+
}
|
|
619
|
+
) }) })
|
|
620
|
+
] });
|
|
621
|
+
}, gn = (e) => e.value, mn = (e) => e.value, bn = (e) => e.value, fn = (e) => ({
|
|
622
|
+
from: e.from ?? "",
|
|
623
|
+
to: e.to ?? ""
|
|
624
|
+
}), Tn = (e) => e.value, xn = (e) => e.value, vn = (e) => e.value, yn = {
|
|
625
|
+
[D.LIST_OF_VALUES]: mn,
|
|
626
|
+
[D.LIST_OF_VALUES_MULTI]: bn,
|
|
627
|
+
[D.RANGE]: fn,
|
|
628
|
+
[D.GREATER_THAN]: Tn,
|
|
629
|
+
[D.LESS_THAN]: xn,
|
|
630
|
+
[D.EQUAL]: vn
|
|
631
|
+
}, P = (e) => {
|
|
632
|
+
const n = e == null ? void 0 : e.value, t = typeof n == "object" && n !== null && !Array.isArray(n), a = yn[e == null ? void 0 : e.howToSetTheDecision] || gn;
|
|
633
|
+
return t && a(n) || n || void 0;
|
|
634
|
+
}, wn = x.div`
|
|
611
635
|
display: flex;
|
|
612
636
|
justify-content: ${({ $justifyContent: e }) => e};
|
|
613
637
|
align-items: ${({ $alignItems: e }) => e};
|
|
@@ -619,72 +643,603 @@ const tt = {
|
|
|
619
643
|
gap: ${({ $gap: e }) => e};
|
|
620
644
|
margin: ${({ $margin: e }) => e};
|
|
621
645
|
padding: ${({ $padding: e }) => e};
|
|
622
|
-
background: ${({ $background: e, theme:
|
|
623
|
-
var
|
|
624
|
-
return e ? `${((
|
|
646
|
+
background: ${({ $background: e, theme: n }) => {
|
|
647
|
+
var t, a, i, r;
|
|
648
|
+
return e ? `${((a = (t = n == null ? void 0 : n.palette) == null ? void 0 : t.neutral) == null ? void 0 : a.N10) || v.palette.neutral.N10}` : `${((r = (i = n == null ? void 0 : n.palette) == null ? void 0 : i.neutral) == null ? void 0 : r.N0) || v.palette.neutral.N0}`;
|
|
625
649
|
}};
|
|
626
|
-
border: ${({ $border: e, theme:
|
|
627
|
-
var
|
|
628
|
-
return e ? `1px solid ${((
|
|
650
|
+
border: ${({ $border: e, theme: n }) => {
|
|
651
|
+
var t, a;
|
|
652
|
+
return e ? `1px solid ${((a = (t = n == null ? void 0 : n.palette) == null ? void 0 : t.neutral) == null ? void 0 : a.N40) || v.palette.neutral.N40}` : "none";
|
|
629
653
|
}};
|
|
630
654
|
border-radius: ${({ $borderRadius: e }) => e};
|
|
631
655
|
box-sizing: ${({ $boxSizing: e }) => e};
|
|
632
656
|
overflow-y: ${({ $scroll: e }) => e ? "scroll" : "none"};
|
|
633
|
-
`,
|
|
634
|
-
(e,
|
|
657
|
+
`, j = _e.forwardRef(
|
|
658
|
+
(e, n) => {
|
|
635
659
|
const {
|
|
636
|
-
children:
|
|
637
|
-
wrap:
|
|
638
|
-
direction:
|
|
639
|
-
justifyContent:
|
|
640
|
-
alignItems:
|
|
660
|
+
children: t,
|
|
661
|
+
wrap: a,
|
|
662
|
+
direction: i = "column",
|
|
663
|
+
justifyContent: r,
|
|
664
|
+
alignItems: p,
|
|
641
665
|
alignContent: l,
|
|
642
|
-
height:
|
|
643
|
-
width:
|
|
666
|
+
height: s,
|
|
667
|
+
width: c,
|
|
644
668
|
gap: u,
|
|
645
|
-
background:
|
|
646
|
-
borderRadius:
|
|
647
|
-
border:
|
|
648
|
-
margin:
|
|
649
|
-
padding:
|
|
650
|
-
boxSizing:
|
|
651
|
-
scroll:
|
|
669
|
+
background: d,
|
|
670
|
+
borderRadius: b,
|
|
671
|
+
border: m,
|
|
672
|
+
margin: f = "0px",
|
|
673
|
+
padding: y = "0px",
|
|
674
|
+
boxSizing: C,
|
|
675
|
+
scroll: w = !1
|
|
652
676
|
} = e;
|
|
653
|
-
return /* @__PURE__ */
|
|
654
|
-
|
|
677
|
+
return /* @__PURE__ */ o(
|
|
678
|
+
wn,
|
|
655
679
|
{
|
|
656
|
-
ref:
|
|
657
|
-
direction:
|
|
658
|
-
$justifyContent:
|
|
659
|
-
$alignItems:
|
|
680
|
+
ref: n,
|
|
681
|
+
direction: i,
|
|
682
|
+
$justifyContent: r,
|
|
683
|
+
$alignItems: p,
|
|
660
684
|
$alignContent: l,
|
|
661
|
-
height:
|
|
662
|
-
width:
|
|
663
|
-
wrap:
|
|
685
|
+
height: s,
|
|
686
|
+
width: c,
|
|
687
|
+
wrap: a,
|
|
664
688
|
$gap: u,
|
|
665
|
-
$background:
|
|
666
|
-
$border:
|
|
667
|
-
$margin:
|
|
668
|
-
$padding:
|
|
669
|
-
$borderRadius:
|
|
670
|
-
$boxSizing:
|
|
671
|
-
$scroll:
|
|
672
|
-
children:
|
|
689
|
+
$background: d,
|
|
690
|
+
$border: m,
|
|
691
|
+
$margin: f,
|
|
692
|
+
$padding: y,
|
|
693
|
+
$borderRadius: b,
|
|
694
|
+
$boxSizing: C,
|
|
695
|
+
$scroll: w,
|
|
696
|
+
children: t
|
|
673
697
|
}
|
|
674
698
|
);
|
|
675
699
|
}
|
|
676
700
|
);
|
|
677
|
-
|
|
678
|
-
const
|
|
701
|
+
j.displayName = "BorderStack";
|
|
702
|
+
const Cn = (e) => {
|
|
703
|
+
const {
|
|
704
|
+
conditionsAlignment: n,
|
|
705
|
+
decision: t,
|
|
706
|
+
decisionMapper: a,
|
|
707
|
+
loading: i,
|
|
708
|
+
textValues: r,
|
|
709
|
+
visibleConditions: p,
|
|
710
|
+
tagLabel: l,
|
|
711
|
+
isOpen: s,
|
|
712
|
+
onToggle: c,
|
|
713
|
+
hasEffectiveFrom: u,
|
|
714
|
+
hasValidUntil: d,
|
|
715
|
+
effectiveFromRenderer: b,
|
|
716
|
+
validUntilRenderer: m
|
|
717
|
+
} = e;
|
|
718
|
+
return i ? /* @__PURE__ */ h(g, { direction: "column", gap: "16px", children: [
|
|
719
|
+
/* @__PURE__ */ h(
|
|
720
|
+
g,
|
|
721
|
+
{
|
|
722
|
+
alignItems: "start",
|
|
723
|
+
justifyContent: "space-between",
|
|
724
|
+
children: [
|
|
725
|
+
/* @__PURE__ */ o(
|
|
726
|
+
G,
|
|
727
|
+
{
|
|
728
|
+
element: a,
|
|
729
|
+
valueData: P(
|
|
730
|
+
a
|
|
731
|
+
),
|
|
732
|
+
type: "decision"
|
|
733
|
+
}
|
|
734
|
+
),
|
|
735
|
+
/* @__PURE__ */ h(g, { gap: "8px", children: [
|
|
736
|
+
/* @__PURE__ */ o(H, { appearance: "gray", label: l, displayIcon: !1 }),
|
|
737
|
+
/* @__PURE__ */ o(
|
|
738
|
+
L,
|
|
739
|
+
{
|
|
740
|
+
appearance: "dark",
|
|
741
|
+
icon: s ? /* @__PURE__ */ o(Re, {}) : /* @__PURE__ */ o(Oe, {}),
|
|
742
|
+
onClick: c,
|
|
743
|
+
size: "24px",
|
|
744
|
+
cursorHover: !0
|
|
745
|
+
}
|
|
746
|
+
)
|
|
747
|
+
] })
|
|
748
|
+
]
|
|
749
|
+
},
|
|
750
|
+
t.ruleName
|
|
751
|
+
),
|
|
752
|
+
s && /* @__PURE__ */ h(k, { children: [
|
|
753
|
+
/* @__PURE__ */ o(R, { dashed: !0 }),
|
|
754
|
+
/* @__PURE__ */ h(g, { direction: "column", gap: "12px", children: [
|
|
755
|
+
/* @__PURE__ */ o(
|
|
756
|
+
S,
|
|
757
|
+
{
|
|
758
|
+
type: "label",
|
|
759
|
+
size: "large",
|
|
760
|
+
appearance: "dark",
|
|
761
|
+
weight: "bold",
|
|
762
|
+
textAlign: "start",
|
|
763
|
+
padding: "0 12px",
|
|
764
|
+
children: r.factsThatConditionIt
|
|
765
|
+
}
|
|
766
|
+
),
|
|
767
|
+
/* @__PURE__ */ h(
|
|
768
|
+
g,
|
|
769
|
+
{
|
|
770
|
+
direction: "column",
|
|
771
|
+
gap: "8px",
|
|
772
|
+
justifyContent: n,
|
|
773
|
+
children: [
|
|
774
|
+
p.map((f) => /* @__PURE__ */ o(
|
|
775
|
+
j,
|
|
776
|
+
{
|
|
777
|
+
direction: "column",
|
|
778
|
+
padding: "6px 12px",
|
|
779
|
+
borderRadius: "8px",
|
|
780
|
+
background: !0,
|
|
781
|
+
children: /* @__PURE__ */ o(
|
|
782
|
+
G,
|
|
783
|
+
{
|
|
784
|
+
element: { ...f, value: f.value },
|
|
785
|
+
valueData: P(
|
|
786
|
+
f
|
|
787
|
+
)
|
|
788
|
+
}
|
|
789
|
+
)
|
|
790
|
+
},
|
|
791
|
+
f.conditionName
|
|
792
|
+
)),
|
|
793
|
+
u && b && /* @__PURE__ */ o(
|
|
794
|
+
j,
|
|
795
|
+
{
|
|
796
|
+
direction: "column",
|
|
797
|
+
padding: "6px 12px",
|
|
798
|
+
borderRadius: "8px",
|
|
799
|
+
background: !0,
|
|
800
|
+
children: /* @__PURE__ */ o(
|
|
801
|
+
G,
|
|
802
|
+
{
|
|
803
|
+
element: b.element,
|
|
804
|
+
valueData: b.valueData
|
|
805
|
+
},
|
|
806
|
+
"effectiveFrom"
|
|
807
|
+
)
|
|
808
|
+
}
|
|
809
|
+
),
|
|
810
|
+
d && m && /* @__PURE__ */ o(
|
|
811
|
+
j,
|
|
812
|
+
{
|
|
813
|
+
direction: "column",
|
|
814
|
+
padding: "6px 12px",
|
|
815
|
+
borderRadius: "8px",
|
|
816
|
+
background: !0,
|
|
817
|
+
children: /* @__PURE__ */ o(
|
|
818
|
+
G,
|
|
819
|
+
{
|
|
820
|
+
element: m.element,
|
|
821
|
+
valueData: m.valueData
|
|
822
|
+
},
|
|
823
|
+
"validUntil"
|
|
824
|
+
)
|
|
825
|
+
}
|
|
826
|
+
)
|
|
827
|
+
]
|
|
828
|
+
}
|
|
829
|
+
)
|
|
830
|
+
] })
|
|
831
|
+
] })
|
|
832
|
+
] }) : /* @__PURE__ */ h(g, { justifyContent: "space-between", children: [
|
|
833
|
+
/* @__PURE__ */ h(g, { alignItems: "center", gap: "8px", children: [
|
|
834
|
+
/* @__PURE__ */ o(z, { animated: !0, width: "150px" }),
|
|
835
|
+
/* @__PURE__ */ o(z, { animated: !0, width: "70px" })
|
|
836
|
+
] }),
|
|
837
|
+
/* @__PURE__ */ h(g, { alignItems: "center", gap: "8px", children: [
|
|
838
|
+
/* @__PURE__ */ o(z, { animated: !0, width: "50px" }),
|
|
839
|
+
/* @__PURE__ */ o(Ue, { animated: !0 })
|
|
840
|
+
] })
|
|
841
|
+
] });
|
|
842
|
+
}, Fe = (e) => {
|
|
843
|
+
var w;
|
|
844
|
+
const {
|
|
845
|
+
decision: n,
|
|
846
|
+
loading: t = !1,
|
|
847
|
+
textValues: a,
|
|
848
|
+
position: i,
|
|
849
|
+
isOpen: r = !1,
|
|
850
|
+
onToggle: p
|
|
851
|
+
} = e, l = !!(n != null && n.effectiveFrom), s = !!(n != null && n.validUntil), c = l ? {
|
|
852
|
+
element: {
|
|
853
|
+
labelName: a == null ? void 0 : a.effectiveFrom,
|
|
854
|
+
value: String(n.effectiveFrom),
|
|
855
|
+
howToSetTheDecision: V.EQUAL,
|
|
856
|
+
decisionDataType: I.DATE
|
|
857
|
+
},
|
|
858
|
+
valueData: P({
|
|
859
|
+
labelName: a == null ? void 0 : a.effectiveFrom,
|
|
860
|
+
value: String(n.effectiveFrom),
|
|
861
|
+
howToSetTheDecision: V.EQUAL,
|
|
862
|
+
decisionDataType: I.DATE
|
|
863
|
+
})
|
|
864
|
+
} : null, u = s ? {
|
|
865
|
+
element: {
|
|
866
|
+
labelName: a == null ? void 0 : a.validUntil,
|
|
867
|
+
value: String(n.validUntil),
|
|
868
|
+
howToSetTheDecision: V.EQUAL,
|
|
869
|
+
decisionDataType: I.DATE
|
|
870
|
+
},
|
|
871
|
+
valueData: P({
|
|
872
|
+
labelName: a == null ? void 0 : a.validUntil,
|
|
873
|
+
value: String(n.validUntil),
|
|
874
|
+
howToSetTheDecision: V.EQUAL,
|
|
875
|
+
decisionDataType: I.DATE
|
|
876
|
+
})
|
|
877
|
+
} : null, d = n ? {
|
|
878
|
+
labelName: n.labelName || "",
|
|
879
|
+
decisionDataType: n.decisionDataType || "alphabetical",
|
|
880
|
+
value: P(n),
|
|
881
|
+
howToSetTheDecision: n.howToSetTheDecision || "EqualTo"
|
|
882
|
+
} : null, b = ((w = n == null ? void 0 : n.conditionsThatEstablishesTheDecision) == null ? void 0 : w.filter(
|
|
883
|
+
(E) => !E.hidden
|
|
884
|
+
)) || [], m = Array.from({ length: 5 }), f = !!(!t && n && a && d), y = b.length < 2 ? "start" : "space-between", C = `N° ${String((i ?? 0) + 1).padStart(2, "0")}`;
|
|
885
|
+
return /* @__PURE__ */ o(
|
|
886
|
+
Cn,
|
|
887
|
+
{
|
|
888
|
+
conditionsAlignment: y,
|
|
889
|
+
decision: n,
|
|
890
|
+
decisionMapper: d,
|
|
891
|
+
loading: f,
|
|
892
|
+
skeleton: m,
|
|
893
|
+
textValues: a,
|
|
894
|
+
visibleConditions: b,
|
|
895
|
+
tagLabel: C,
|
|
896
|
+
isOpen: r,
|
|
897
|
+
onToggle: p,
|
|
898
|
+
hasEffectiveFrom: l,
|
|
899
|
+
hasValidUntil: s,
|
|
900
|
+
effectiveFromRenderer: c,
|
|
901
|
+
validUntilRenderer: u
|
|
902
|
+
}
|
|
903
|
+
);
|
|
904
|
+
}, Dn = De`
|
|
905
|
+
from {
|
|
906
|
+
opacity: 0;
|
|
907
|
+
transform: translateY(20px);
|
|
908
|
+
}
|
|
909
|
+
to {
|
|
910
|
+
opacity: 1;
|
|
911
|
+
transform: translateY(0);
|
|
912
|
+
}
|
|
913
|
+
`;
|
|
914
|
+
x.div`
|
|
915
|
+
border-radius: 8px;
|
|
916
|
+
border: 1px solid
|
|
917
|
+
${({ theme: e }) => {
|
|
918
|
+
var n, t;
|
|
919
|
+
return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
|
|
920
|
+
}};
|
|
921
|
+
box-sizing: border-box;
|
|
922
|
+
display: flex;
|
|
923
|
+
flex-direction: column;
|
|
924
|
+
width: 100%;
|
|
925
|
+
height: 100%;
|
|
926
|
+
box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
|
|
927
|
+
`;
|
|
928
|
+
x.div`
|
|
929
|
+
& > div {
|
|
930
|
+
border-radius: 8px;
|
|
931
|
+
border: 1px solid
|
|
932
|
+
${({ theme: e }) => {
|
|
933
|
+
var n, t;
|
|
934
|
+
return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
|
|
935
|
+
}};
|
|
936
|
+
}
|
|
937
|
+
`;
|
|
938
|
+
x.div`
|
|
939
|
+
& > div {
|
|
940
|
+
background-color: ${({ theme: e }) => {
|
|
941
|
+
var n, t;
|
|
942
|
+
return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N10) || v.palette.neutral.N10;
|
|
943
|
+
}};
|
|
944
|
+
justify-content: center;
|
|
945
|
+
}
|
|
946
|
+
min-height: 350px;
|
|
947
|
+
width: 100%;
|
|
948
|
+
height: 100%;
|
|
949
|
+
padding-bottom: 12px;
|
|
950
|
+
cursor: pointer;
|
|
951
|
+
`;
|
|
952
|
+
x.div`
|
|
953
|
+
width: 100%;
|
|
954
|
+
height: 100%;
|
|
955
|
+
& > div {
|
|
956
|
+
animation: ${Dn} 600ms ease-out;
|
|
957
|
+
}
|
|
958
|
+
`;
|
|
959
|
+
const Sn = x.div`
|
|
960
|
+
& > div > div {
|
|
961
|
+
border-radius: 8px;
|
|
962
|
+
box-sizing: border-box;
|
|
963
|
+
}
|
|
964
|
+
`, Nn = x.div`
|
|
965
|
+
& > div {
|
|
966
|
+
width: 100%;
|
|
967
|
+
height: 100%;
|
|
968
|
+
overflow-y: auto;
|
|
969
|
+
|
|
970
|
+
&::-webkit-scrollbar {
|
|
971
|
+
width: 8px;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
&::-webkit-scrollbar-thumb {
|
|
975
|
+
background-color: #c1c7d0;
|
|
976
|
+
border-radius: 8px;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
&::-webkit-scrollbar-track {
|
|
980
|
+
background-color: #ebecf0;
|
|
981
|
+
border-radius: 8px;
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
`, En = (e) => {
|
|
985
|
+
const { index: n, handleOpenModal: t } = e;
|
|
986
|
+
return /* @__PURE__ */ o(
|
|
987
|
+
$e,
|
|
988
|
+
{
|
|
989
|
+
id: `loading-card-${n}`,
|
|
990
|
+
handleDelete: () => {
|
|
991
|
+
},
|
|
992
|
+
handleView: () => t ? t() : null,
|
|
993
|
+
controls: !1,
|
|
994
|
+
children: /* @__PURE__ */ o(Fe, { loading: !0 })
|
|
995
|
+
},
|
|
996
|
+
`loading-card-${n}`
|
|
997
|
+
);
|
|
998
|
+
}, kn = (e) => {
|
|
999
|
+
const {
|
|
1000
|
+
decision: n,
|
|
1001
|
+
controls: t,
|
|
1002
|
+
handleOpenModal: a,
|
|
1003
|
+
handleDelete: i,
|
|
1004
|
+
textValues: r,
|
|
1005
|
+
index: p,
|
|
1006
|
+
isOpen: l,
|
|
1007
|
+
onToggle: s
|
|
1008
|
+
} = e;
|
|
1009
|
+
return n ? /* @__PURE__ */ o(J, { children: /* @__PURE__ */ o(g, { direction: "column", gap: "4px", width: "100%", children: /* @__PURE__ */ o(
|
|
1010
|
+
$e,
|
|
1011
|
+
{
|
|
1012
|
+
id: n.decisionId,
|
|
1013
|
+
handleDelete: () => i ? i(n.decisionId) : null,
|
|
1014
|
+
handleView: () => a ? a(n) : null,
|
|
1015
|
+
controls: t,
|
|
1016
|
+
children: /* @__PURE__ */ o(
|
|
1017
|
+
Fe,
|
|
1018
|
+
{
|
|
1019
|
+
decision: n,
|
|
1020
|
+
textValues: r,
|
|
1021
|
+
position: p,
|
|
1022
|
+
isOpen: !!l,
|
|
1023
|
+
onToggle: () => s == null ? void 0 : s(!l)
|
|
1024
|
+
}
|
|
1025
|
+
)
|
|
1026
|
+
}
|
|
1027
|
+
) }) }, n.decisionId) : null;
|
|
1028
|
+
}, An = (e) => {
|
|
1029
|
+
const {
|
|
1030
|
+
customTitleContentAddCard: n,
|
|
1031
|
+
index: t,
|
|
1032
|
+
handleOpenModal: a,
|
|
1033
|
+
shouldRenderEmptyMessage: i
|
|
1034
|
+
} = e;
|
|
1035
|
+
return /* @__PURE__ */ o(J, { children: i ? null : /* @__PURE__ */ o(
|
|
1036
|
+
Ae,
|
|
1037
|
+
{
|
|
1038
|
+
onClick: () => a ? a() : null,
|
|
1039
|
+
children: /* @__PURE__ */ o(
|
|
1040
|
+
j,
|
|
1041
|
+
{
|
|
1042
|
+
direction: "column",
|
|
1043
|
+
gap: "4px",
|
|
1044
|
+
width: "100%",
|
|
1045
|
+
height: "100%",
|
|
1046
|
+
background: !0,
|
|
1047
|
+
borderRadius: "8px",
|
|
1048
|
+
children: /* @__PURE__ */ h(
|
|
1049
|
+
g,
|
|
1050
|
+
{
|
|
1051
|
+
justifyContent: "space-between",
|
|
1052
|
+
alignItems: "center",
|
|
1053
|
+
padding: "16px",
|
|
1054
|
+
children: [
|
|
1055
|
+
/* @__PURE__ */ o(S, { appearance: "gray", type: "label", size: "large", weight: "bold", children: n || "Agregar decisión" }),
|
|
1056
|
+
/* @__PURE__ */ o(
|
|
1057
|
+
L,
|
|
1058
|
+
{
|
|
1059
|
+
appearance: "gray",
|
|
1060
|
+
icon: /* @__PURE__ */ o(Y, {}),
|
|
1061
|
+
size: "24px",
|
|
1062
|
+
cursorHover: !0
|
|
1063
|
+
}
|
|
1064
|
+
)
|
|
1065
|
+
]
|
|
1066
|
+
}
|
|
1067
|
+
)
|
|
1068
|
+
}
|
|
1069
|
+
)
|
|
1070
|
+
}
|
|
1071
|
+
) }, `add-decision-${t}`);
|
|
1072
|
+
}, $n = {
|
|
1073
|
+
loading: En,
|
|
1074
|
+
decision: kn,
|
|
1075
|
+
add: An
|
|
1076
|
+
}, te = (e) => {
|
|
1077
|
+
const { type: n } = e, t = $n[n];
|
|
1078
|
+
return t ? t(e) : null;
|
|
1079
|
+
}, Fn = (e) => {
|
|
1080
|
+
const {
|
|
1081
|
+
controls: n,
|
|
1082
|
+
customTitleContentAddCard: t,
|
|
1083
|
+
decisions: a,
|
|
1084
|
+
loading: i,
|
|
1085
|
+
handleOpenModal: r,
|
|
1086
|
+
handleDelete: p,
|
|
1087
|
+
textValues: l,
|
|
1088
|
+
isOpenFor: s,
|
|
1089
|
+
toggleAt: c
|
|
1090
|
+
} = e, u = i ? Array.from({ length: 3 }).map(
|
|
1091
|
+
(b, m) => te({
|
|
1092
|
+
type: "loading",
|
|
1093
|
+
index: m,
|
|
1094
|
+
controls: n,
|
|
1095
|
+
customTitleContentAddCard: t,
|
|
1096
|
+
loading: i,
|
|
1097
|
+
handleOpenModal: r,
|
|
1098
|
+
handleDelete: p,
|
|
1099
|
+
textValues: l
|
|
1100
|
+
})
|
|
1101
|
+
) : a == null ? void 0 : a.map(
|
|
1102
|
+
(b, m) => te({
|
|
1103
|
+
type: "decision",
|
|
1104
|
+
decision: b,
|
|
1105
|
+
controls: s ? s(m) : !1,
|
|
1106
|
+
customTitleContentAddCard: t,
|
|
1107
|
+
loading: i,
|
|
1108
|
+
handleOpenModal: r,
|
|
1109
|
+
handleDelete: p,
|
|
1110
|
+
textValues: l,
|
|
1111
|
+
index: m,
|
|
1112
|
+
isOpen: s ? s(m) : !1,
|
|
1113
|
+
onToggle: c ? () => c(m) : void 0
|
|
1114
|
+
})
|
|
1115
|
+
), d = ((a == null ? void 0 : a.length) === 0 || a.length < Math.floor(window.innerWidth / 300)) && !i && n;
|
|
1116
|
+
return { renderedCards: u, shouldRenderAddCard: d };
|
|
1117
|
+
}, vt = (e) => {
|
|
1118
|
+
const {
|
|
1119
|
+
controls: n = !0,
|
|
1120
|
+
customTitleContentAddCard: t,
|
|
1121
|
+
customMessageEmptyDecisions: a,
|
|
1122
|
+
decisions: i,
|
|
1123
|
+
textValues: r,
|
|
1124
|
+
decisionTemplate: p,
|
|
1125
|
+
isModalOpen: l,
|
|
1126
|
+
selectedDecision: s,
|
|
1127
|
+
loading: c,
|
|
1128
|
+
handleOpenModal: u,
|
|
1129
|
+
handleCloseModal: d,
|
|
1130
|
+
handleSubmitForm: b,
|
|
1131
|
+
handleDelete: m,
|
|
1132
|
+
terms: f = !0
|
|
1133
|
+
} = e, [y, C] = O(null), w = B("(max-width: 681px)"), { renderedCards: E, shouldRenderAddCard: $ } = Fn({
|
|
1134
|
+
controls: n,
|
|
1135
|
+
customTitleContentAddCard: t,
|
|
1136
|
+
decisions: i,
|
|
1137
|
+
loading: c,
|
|
1138
|
+
handleOpenModal: u,
|
|
1139
|
+
handleDelete: m,
|
|
1140
|
+
textValues: r,
|
|
1141
|
+
isOpenFor: (N) => y === N,
|
|
1142
|
+
toggleAt: (N) => C((M) => M === N ? null : N)
|
|
1143
|
+
}), A = (i == null ? void 0 : i.length) === 0 && !c;
|
|
1144
|
+
return /* @__PURE__ */ h(k, { children: [
|
|
1145
|
+
/* @__PURE__ */ o(Sn, { children: /* @__PURE__ */ o(Nn, { children: /* @__PURE__ */ o(g, { direction: "column", gap: "16px", padding: "6px", children: A ? /* @__PURE__ */ h(
|
|
1146
|
+
g,
|
|
1147
|
+
{
|
|
1148
|
+
direction: "column",
|
|
1149
|
+
gap: "28px",
|
|
1150
|
+
width: "100%",
|
|
1151
|
+
height: w ? "auto" : "435px",
|
|
1152
|
+
justifyContent: "center",
|
|
1153
|
+
alignItems: "center",
|
|
1154
|
+
children: [
|
|
1155
|
+
/* @__PURE__ */ o(S, { as: "span", type: "label", size: "large", appearance: "gray", children: a || /* @__PURE__ */ h(k, { children: [
|
|
1156
|
+
"Aún NO tienes definidas tasas de interés efectivas . Presiona",
|
|
1157
|
+
/* @__PURE__ */ h(
|
|
1158
|
+
S,
|
|
1159
|
+
{
|
|
1160
|
+
as: "span",
|
|
1161
|
+
type: "label",
|
|
1162
|
+
size: "large",
|
|
1163
|
+
appearance: "gray",
|
|
1164
|
+
weight: "bold",
|
|
1165
|
+
children: [
|
|
1166
|
+
"“",
|
|
1167
|
+
t || "+ Agregar decisión",
|
|
1168
|
+
"”"
|
|
1169
|
+
]
|
|
1170
|
+
}
|
|
1171
|
+
),
|
|
1172
|
+
"para empezar."
|
|
1173
|
+
] }) }),
|
|
1174
|
+
/* @__PURE__ */ o(
|
|
1175
|
+
U,
|
|
1176
|
+
{
|
|
1177
|
+
iconBefore: /* @__PURE__ */ o(Y, {}),
|
|
1178
|
+
onClick: () => u ? u() : null,
|
|
1179
|
+
children: t || "Agregar decisión"
|
|
1180
|
+
}
|
|
1181
|
+
)
|
|
1182
|
+
]
|
|
1183
|
+
}
|
|
1184
|
+
) : /* @__PURE__ */ h(
|
|
1185
|
+
K,
|
|
1186
|
+
{
|
|
1187
|
+
templateColumns: "1fr",
|
|
1188
|
+
autoFlow: "row dense",
|
|
1189
|
+
gap: "16px",
|
|
1190
|
+
alignItems: "start",
|
|
1191
|
+
justifyContent: "center",
|
|
1192
|
+
autoRows: "auto",
|
|
1193
|
+
justifyItems: "center",
|
|
1194
|
+
padding: "6px",
|
|
1195
|
+
height: w ? "auto" : "484px",
|
|
1196
|
+
children: [
|
|
1197
|
+
E,
|
|
1198
|
+
$ && te({
|
|
1199
|
+
type: "add",
|
|
1200
|
+
index: i == null ? void 0 : i.length,
|
|
1201
|
+
controls: n,
|
|
1202
|
+
customTitleContentAddCard: t,
|
|
1203
|
+
customMessageEmptyDecisions: a,
|
|
1204
|
+
loading: c,
|
|
1205
|
+
handleOpenModal: u,
|
|
1206
|
+
handleDelete: m,
|
|
1207
|
+
textValues: r,
|
|
1208
|
+
shouldRenderEmptyMessage: A,
|
|
1209
|
+
terms: f
|
|
1210
|
+
})
|
|
1211
|
+
]
|
|
1212
|
+
}
|
|
1213
|
+
) }) }) }),
|
|
1214
|
+
l && /* @__PURE__ */ o(
|
|
1215
|
+
ke,
|
|
1216
|
+
{
|
|
1217
|
+
portalId: "modal-portal",
|
|
1218
|
+
onCloseModal: d,
|
|
1219
|
+
title: s ? "Editar Decisión" : "Nueva decisión",
|
|
1220
|
+
children: /* @__PURE__ */ o(
|
|
1221
|
+
Ie,
|
|
1222
|
+
{
|
|
1223
|
+
decision: s || p,
|
|
1224
|
+
onSubmitEvent: b,
|
|
1225
|
+
textValues: r,
|
|
1226
|
+
onCancel: () => d ? d() : () => {
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
)
|
|
1230
|
+
}
|
|
1231
|
+
)
|
|
1232
|
+
] });
|
|
1233
|
+
}, In = {
|
|
679
1234
|
border: {
|
|
680
|
-
color:
|
|
1235
|
+
color: v.palette.neutral.N40
|
|
681
1236
|
}
|
|
682
|
-
},
|
|
1237
|
+
}, Rn = x.div`
|
|
683
1238
|
border-width: 1px;
|
|
684
1239
|
border-style: solid;
|
|
685
1240
|
border-color: ${({ theme: e }) => {
|
|
686
|
-
var
|
|
687
|
-
return ((
|
|
1241
|
+
var n, t;
|
|
1242
|
+
return ((t = (n = e == null ? void 0 : e.box) == null ? void 0 : n.border) == null ? void 0 : t.color) || In.border.color;
|
|
688
1243
|
}};
|
|
689
1244
|
border-radius: ${({ $borderRadius: e }) => e};
|
|
690
1245
|
margin: ${({ $margin: e }) => e};
|
|
@@ -693,92 +1248,92 @@ const at = {
|
|
|
693
1248
|
height: ${({ $height: e }) => e};
|
|
694
1249
|
box-sizing: border-box;
|
|
695
1250
|
`;
|
|
696
|
-
function
|
|
1251
|
+
function On(e) {
|
|
697
1252
|
const {
|
|
698
|
-
children:
|
|
699
|
-
padding:
|
|
700
|
-
margin:
|
|
701
|
-
borderRadius:
|
|
702
|
-
width:
|
|
703
|
-
height:
|
|
1253
|
+
children: n,
|
|
1254
|
+
padding: t = "16px",
|
|
1255
|
+
margin: a,
|
|
1256
|
+
borderRadius: i = "8px",
|
|
1257
|
+
width: r,
|
|
1258
|
+
height: p
|
|
704
1259
|
} = e;
|
|
705
|
-
return /* @__PURE__ */
|
|
706
|
-
|
|
1260
|
+
return /* @__PURE__ */ o(
|
|
1261
|
+
Rn,
|
|
707
1262
|
{
|
|
708
|
-
$padding:
|
|
709
|
-
$margin:
|
|
710
|
-
$borderRadius:
|
|
711
|
-
$width:
|
|
712
|
-
$height:
|
|
713
|
-
children:
|
|
1263
|
+
$padding: t,
|
|
1264
|
+
$margin: a,
|
|
1265
|
+
$borderRadius: i,
|
|
1266
|
+
$width: r,
|
|
1267
|
+
$height: p,
|
|
1268
|
+
children: n
|
|
714
1269
|
}
|
|
715
1270
|
);
|
|
716
1271
|
}
|
|
717
|
-
const
|
|
718
|
-
const [
|
|
719
|
-
return
|
|
720
|
-
if (!e.current || !
|
|
721
|
-
const
|
|
722
|
-
var
|
|
723
|
-
const
|
|
1272
|
+
const Mn = (e, n) => {
|
|
1273
|
+
const [t, a] = O([]), [i, r] = O([]), [p, l] = O(!1), s = Q(null);
|
|
1274
|
+
return oe(() => {
|
|
1275
|
+
if (!e.current || !s.current) return;
|
|
1276
|
+
const c = e.current, u = s.current, d = () => {
|
|
1277
|
+
var $;
|
|
1278
|
+
const m = c.clientWidth, f = Array.from(
|
|
724
1279
|
u.querySelectorAll('[data-filter-tag="true"]')
|
|
725
|
-
),
|
|
726
|
-
let
|
|
727
|
-
const
|
|
728
|
-
for (let
|
|
729
|
-
const
|
|
730
|
-
|
|
1280
|
+
), y = 48;
|
|
1281
|
+
let C = 0;
|
|
1282
|
+
const w = [], E = [];
|
|
1283
|
+
for (let A = 0; A < n.length; A++) {
|
|
1284
|
+
const T = (($ = f[A]) == null ? void 0 : $.offsetWidth) ?? 0;
|
|
1285
|
+
C + T + y <= m ? (w.push(n[A]), C += T) : E.push(n[A]);
|
|
731
1286
|
}
|
|
732
|
-
|
|
733
|
-
},
|
|
734
|
-
requestAnimationFrame(
|
|
1287
|
+
a(w), r(E), l(E.length > 0);
|
|
1288
|
+
}, b = new ResizeObserver(() => {
|
|
1289
|
+
requestAnimationFrame(d);
|
|
735
1290
|
});
|
|
736
|
-
return
|
|
737
|
-
}, [
|
|
1291
|
+
return b.observe(c), () => b.disconnect();
|
|
1292
|
+
}, [n, e]), { visible: t, hidden: i, showOverflowIndicator: p, measurementRef: s };
|
|
738
1293
|
};
|
|
739
1294
|
x.div`
|
|
740
1295
|
& > div {
|
|
741
1296
|
width: 100%;
|
|
742
1297
|
}
|
|
743
1298
|
`;
|
|
744
|
-
const
|
|
1299
|
+
const Ln = x.div`
|
|
745
1300
|
position: absolute;
|
|
746
1301
|
top: calc(100% + 4px);
|
|
747
1302
|
right: 0;
|
|
748
1303
|
z-index: 1000;
|
|
749
1304
|
width: 170px;
|
|
750
|
-
`,
|
|
1305
|
+
`, Un = x.div`
|
|
751
1306
|
position: absolute;
|
|
752
1307
|
visibility: hidden;
|
|
753
1308
|
pointer-events: none;
|
|
754
1309
|
height: 0;
|
|
755
1310
|
overflow: hidden;
|
|
756
|
-
`,
|
|
1311
|
+
`, zn = x.div`
|
|
757
1312
|
cursor: pointer;
|
|
758
|
-
`,
|
|
1313
|
+
`, ae = {
|
|
759
1314
|
border: {
|
|
760
1315
|
color: {
|
|
761
|
-
regular:
|
|
762
|
-
disabled:
|
|
763
|
-
focus:
|
|
764
|
-
invalid:
|
|
1316
|
+
regular: v.palette.neutral.N40,
|
|
1317
|
+
disabled: v.palette.neutral.N40,
|
|
1318
|
+
focus: v.palette.blue.B300,
|
|
1319
|
+
invalid: v.palette.red.R400
|
|
765
1320
|
}
|
|
766
1321
|
},
|
|
767
1322
|
background: {
|
|
768
1323
|
color: {
|
|
769
|
-
regular:
|
|
770
|
-
disabled:
|
|
1324
|
+
regular: v.palette.neutral.N0,
|
|
1325
|
+
disabled: v.palette.neutral.N10
|
|
771
1326
|
}
|
|
772
1327
|
},
|
|
773
1328
|
content: {
|
|
774
1329
|
color: {
|
|
775
|
-
regular:
|
|
776
|
-
disabled:
|
|
1330
|
+
regular: v.palette.neutral.N900,
|
|
1331
|
+
disabled: v.palette.neutral.N70
|
|
777
1332
|
}
|
|
778
1333
|
},
|
|
779
1334
|
placeholder: {
|
|
780
1335
|
color: {
|
|
781
|
-
regular:
|
|
1336
|
+
regular: v.palette.neutral.N300
|
|
782
1337
|
}
|
|
783
1338
|
},
|
|
784
1339
|
option: {
|
|
@@ -787,11 +1342,11 @@ const st = x.div`
|
|
|
787
1342
|
hover: "primary"
|
|
788
1343
|
},
|
|
789
1344
|
background: {
|
|
790
|
-
regular:
|
|
791
|
-
hover:
|
|
1345
|
+
regular: v.palette.neutral.N0,
|
|
1346
|
+
hover: v.palette.neutral.N30
|
|
792
1347
|
}
|
|
793
1348
|
}
|
|
794
|
-
},
|
|
1349
|
+
}, Vn = x.li`
|
|
795
1350
|
display: flex;
|
|
796
1351
|
align-items: center;
|
|
797
1352
|
align-self: stretch;
|
|
@@ -805,56 +1360,56 @@ const st = x.div`
|
|
|
805
1360
|
|
|
806
1361
|
&:hover {
|
|
807
1362
|
background-color: ${({ theme: e }) => {
|
|
808
|
-
var
|
|
809
|
-
return ((
|
|
1363
|
+
var n, t, a;
|
|
1364
|
+
return ((a = (t = (n = e == null ? void 0 : e.input) == null ? void 0 : n.background) == null ? void 0 : t.color) == null ? void 0 : a.regular) || ae.background.color.regular;
|
|
810
1365
|
}};
|
|
811
1366
|
}
|
|
812
|
-
`,
|
|
813
|
-
var
|
|
814
|
-
const { id:
|
|
815
|
-
return /* @__PURE__ */
|
|
816
|
-
|
|
1367
|
+
`, jn = (e) => {
|
|
1368
|
+
var b, m, f, y, C, w;
|
|
1369
|
+
const { id: n, label: t, leadingIcon: a, onClose: i } = e, [r, p] = O(!1), l = () => p(!0), s = () => p(!1), c = He(Be), u = ((f = (m = (b = c == null ? void 0 : c.input) == null ? void 0 : b.option) == null ? void 0 : m.appearance) == null ? void 0 : f.hover) ?? ae.option.appearance.hover, d = ((w = (C = (y = c == null ? void 0 : c.input) == null ? void 0 : y.option) == null ? void 0 : C.appearance) == null ? void 0 : w.regular) ?? ae.option.appearance.regular;
|
|
1370
|
+
return /* @__PURE__ */ o(
|
|
1371
|
+
Vn,
|
|
817
1372
|
{
|
|
818
|
-
id:
|
|
1373
|
+
id: n,
|
|
819
1374
|
onMouseEnter: l,
|
|
820
|
-
onMouseLeave:
|
|
821
|
-
onClick: (
|
|
822
|
-
|
|
1375
|
+
onMouseLeave: s,
|
|
1376
|
+
onClick: (E) => {
|
|
1377
|
+
E.stopPropagation();
|
|
823
1378
|
},
|
|
824
|
-
children: /* @__PURE__ */
|
|
825
|
-
|
|
1379
|
+
children: /* @__PURE__ */ h(
|
|
1380
|
+
K,
|
|
826
1381
|
{
|
|
827
1382
|
alignItems: "center",
|
|
828
1383
|
gap: "8px",
|
|
829
1384
|
templateColumns: "auto 1fr auto",
|
|
830
1385
|
width: "100%",
|
|
831
1386
|
children: [
|
|
832
|
-
|
|
833
|
-
|
|
1387
|
+
a && /* @__PURE__ */ o(
|
|
1388
|
+
L,
|
|
834
1389
|
{
|
|
835
|
-
icon:
|
|
1390
|
+
icon: a,
|
|
836
1391
|
size: "medium",
|
|
837
|
-
appearance:
|
|
1392
|
+
appearance: r ? u : d
|
|
838
1393
|
}
|
|
839
1394
|
),
|
|
840
|
-
/* @__PURE__ */
|
|
841
|
-
|
|
1395
|
+
/* @__PURE__ */ o(
|
|
1396
|
+
S,
|
|
842
1397
|
{
|
|
843
1398
|
textAlign: "start",
|
|
844
1399
|
size: "medium",
|
|
845
|
-
appearance:
|
|
846
|
-
children:
|
|
1400
|
+
appearance: r ? u : d,
|
|
1401
|
+
children: t
|
|
847
1402
|
}
|
|
848
1403
|
),
|
|
849
|
-
/* @__PURE__ */
|
|
850
|
-
|
|
1404
|
+
/* @__PURE__ */ o(
|
|
1405
|
+
L,
|
|
851
1406
|
{
|
|
852
|
-
icon: /* @__PURE__ */
|
|
1407
|
+
icon: /* @__PURE__ */ o(Me, {}),
|
|
853
1408
|
size: "small",
|
|
854
|
-
onClick: (
|
|
855
|
-
|
|
1409
|
+
onClick: (E) => {
|
|
1410
|
+
E.stopPropagation(), i == null || i();
|
|
856
1411
|
},
|
|
857
|
-
appearance:
|
|
1412
|
+
appearance: r ? u : d,
|
|
858
1413
|
cursorHover: !0
|
|
859
1414
|
}
|
|
860
1415
|
)
|
|
@@ -863,54 +1418,54 @@ const st = x.div`
|
|
|
863
1418
|
)
|
|
864
1419
|
}
|
|
865
1420
|
);
|
|
866
|
-
},
|
|
1421
|
+
}, yt = (e) => {
|
|
867
1422
|
const {
|
|
868
|
-
appliedFilters:
|
|
869
|
-
onClear:
|
|
870
|
-
onClick:
|
|
871
|
-
noFiltersLabel:
|
|
872
|
-
titleClearFilter:
|
|
873
|
-
titleFilter:
|
|
874
|
-
} = e, l =
|
|
1423
|
+
appliedFilters: n = [],
|
|
1424
|
+
onClear: t,
|
|
1425
|
+
onClick: a,
|
|
1426
|
+
noFiltersLabel: i,
|
|
1427
|
+
titleClearFilter: r,
|
|
1428
|
+
titleFilter: p
|
|
1429
|
+
} = e, l = Q(null), s = Q(null), c = Q(null), {
|
|
875
1430
|
visible: u,
|
|
876
|
-
hidden:
|
|
877
|
-
showOverflowIndicator:
|
|
878
|
-
measurementRef:
|
|
879
|
-
} =
|
|
880
|
-
|
|
1431
|
+
hidden: d,
|
|
1432
|
+
showOverflowIndicator: b,
|
|
1433
|
+
measurementRef: m
|
|
1434
|
+
} = Mn(l, n), [f, y] = O(!1), C = (T) => {
|
|
1435
|
+
T.stopPropagation(), y((N) => !N);
|
|
881
1436
|
};
|
|
882
|
-
|
|
883
|
-
const
|
|
884
|
-
var
|
|
885
|
-
const
|
|
886
|
-
!((
|
|
1437
|
+
oe(() => {
|
|
1438
|
+
const T = (N) => {
|
|
1439
|
+
var le, se;
|
|
1440
|
+
const M = N.target;
|
|
1441
|
+
!((le = s.current) != null && le.contains(M)) && !((se = c.current) != null && se.contains(M)) && y(!1);
|
|
887
1442
|
};
|
|
888
|
-
return
|
|
889
|
-
}, [
|
|
890
|
-
const
|
|
891
|
-
id:
|
|
892
|
-
value:
|
|
893
|
-
label:
|
|
894
|
-
icon:
|
|
895
|
-
})),
|
|
896
|
-
var N,
|
|
897
|
-
(
|
|
1443
|
+
return f && window.addEventListener("mousedown", T), () => window.removeEventListener("mousedown", T);
|
|
1444
|
+
}, [f]);
|
|
1445
|
+
const w = n.length === 0, E = f && d.length > 0, $ = d.map((T) => ({
|
|
1446
|
+
id: T.label,
|
|
1447
|
+
value: T.label,
|
|
1448
|
+
label: T.label,
|
|
1449
|
+
icon: T.icon
|
|
1450
|
+
})), A = (T) => {
|
|
1451
|
+
var N, M;
|
|
1452
|
+
(M = (N = d.find((F) => F.label === T)) == null ? void 0 : N.onClose) == null || M.call(N), y(!1);
|
|
898
1453
|
};
|
|
899
|
-
return /* @__PURE__ */
|
|
900
|
-
/* @__PURE__ */
|
|
901
|
-
|
|
1454
|
+
return /* @__PURE__ */ h(On, { borderRadius: "8px", width: "100%", children: [
|
|
1455
|
+
/* @__PURE__ */ o(Un, { ref: m, children: n.map((T) => /* @__PURE__ */ o("div", { "data-filter-tag": "true", children: /* @__PURE__ */ o(
|
|
1456
|
+
H,
|
|
902
1457
|
{
|
|
903
1458
|
appearance: "primary",
|
|
904
1459
|
displayIcon: !0,
|
|
905
1460
|
removable: !0,
|
|
906
|
-
icon:
|
|
907
|
-
label:
|
|
908
|
-
onClose:
|
|
1461
|
+
icon: T.icon,
|
|
1462
|
+
label: T.label,
|
|
1463
|
+
onClose: T.onClose
|
|
909
1464
|
}
|
|
910
|
-
) },
|
|
911
|
-
/* @__PURE__ */
|
|
912
|
-
/* @__PURE__ */
|
|
913
|
-
|
|
1465
|
+
) }, T.label)) }),
|
|
1466
|
+
/* @__PURE__ */ h(K, { gap: "12px", templateColumns: "1fr auto auto", width: "100%", children: [
|
|
1467
|
+
/* @__PURE__ */ o(
|
|
1468
|
+
j,
|
|
914
1469
|
{
|
|
915
1470
|
ref: l,
|
|
916
1471
|
background: !0,
|
|
@@ -921,50 +1476,50 @@ const st = x.div`
|
|
|
921
1476
|
alignItems: "center",
|
|
922
1477
|
padding: "0px 8px",
|
|
923
1478
|
border: !0,
|
|
924
|
-
children:
|
|
925
|
-
u.map((
|
|
926
|
-
|
|
1479
|
+
children: w ? /* @__PURE__ */ o(S, { size: "small", type: "label", appearance: "gray", children: i }) : /* @__PURE__ */ h(k, { children: [
|
|
1480
|
+
u.map((T) => /* @__PURE__ */ o(
|
|
1481
|
+
H,
|
|
927
1482
|
{
|
|
928
1483
|
"data-filter-tag": "true",
|
|
929
1484
|
appearance: "primary",
|
|
930
1485
|
displayIcon: !0,
|
|
931
1486
|
removable: !0,
|
|
932
|
-
icon:
|
|
933
|
-
label:
|
|
934
|
-
onClose:
|
|
1487
|
+
icon: T.icon,
|
|
1488
|
+
label: T.label,
|
|
1489
|
+
onClose: T.onClose
|
|
935
1490
|
},
|
|
936
|
-
|
|
1491
|
+
T.label
|
|
937
1492
|
)),
|
|
938
|
-
|
|
1493
|
+
b && /* @__PURE__ */ h(
|
|
939
1494
|
"div",
|
|
940
1495
|
{
|
|
941
|
-
ref:
|
|
1496
|
+
ref: c,
|
|
942
1497
|
style: { position: "relative", display: "inline-block" },
|
|
943
1498
|
children: [
|
|
944
|
-
/* @__PURE__ */
|
|
945
|
-
|
|
1499
|
+
/* @__PURE__ */ o(zn, { onClick: C, children: /* @__PURE__ */ o(
|
|
1500
|
+
H,
|
|
946
1501
|
{
|
|
947
1502
|
appearance: "primary",
|
|
948
|
-
label: `+${
|
|
1503
|
+
label: `+${d.length}`
|
|
949
1504
|
}
|
|
950
1505
|
) }),
|
|
951
|
-
|
|
952
|
-
|
|
1506
|
+
E && /* @__PURE__ */ o(Ln, { ref: s, children: /* @__PURE__ */ o(
|
|
1507
|
+
ze,
|
|
953
1508
|
{
|
|
954
|
-
options:
|
|
955
|
-
onOptionClick:
|
|
956
|
-
children:
|
|
957
|
-
|
|
1509
|
+
options: $,
|
|
1510
|
+
onOptionClick: A,
|
|
1511
|
+
children: d.map((T) => /* @__PURE__ */ o(
|
|
1512
|
+
jn,
|
|
958
1513
|
{
|
|
959
|
-
id:
|
|
960
|
-
label:
|
|
961
|
-
leadingIcon:
|
|
1514
|
+
id: T.label,
|
|
1515
|
+
label: T.label,
|
|
1516
|
+
leadingIcon: T.icon,
|
|
962
1517
|
onClose: () => {
|
|
963
1518
|
var N;
|
|
964
|
-
(N =
|
|
1519
|
+
(N = T.onClose) == null || N.call(T), y(!1);
|
|
965
1520
|
}
|
|
966
1521
|
},
|
|
967
|
-
|
|
1522
|
+
T.label
|
|
968
1523
|
))
|
|
969
1524
|
}
|
|
970
1525
|
) })
|
|
@@ -974,35 +1529,35 @@ const st = x.div`
|
|
|
974
1529
|
] })
|
|
975
1530
|
}
|
|
976
1531
|
),
|
|
977
|
-
/* @__PURE__ */
|
|
978
|
-
|
|
1532
|
+
/* @__PURE__ */ o(
|
|
1533
|
+
U,
|
|
979
1534
|
{
|
|
980
1535
|
cursorHover: !0,
|
|
981
|
-
disabled:
|
|
982
|
-
iconBefore: /* @__PURE__ */
|
|
983
|
-
onClick:
|
|
1536
|
+
disabled: w,
|
|
1537
|
+
iconBefore: /* @__PURE__ */ o(ve, {}),
|
|
1538
|
+
onClick: t,
|
|
984
1539
|
variant: "outlined",
|
|
985
|
-
children:
|
|
1540
|
+
children: r
|
|
986
1541
|
}
|
|
987
1542
|
),
|
|
988
|
-
/* @__PURE__ */
|
|
989
|
-
|
|
1543
|
+
/* @__PURE__ */ o(
|
|
1544
|
+
U,
|
|
990
1545
|
{
|
|
991
1546
|
cursorHover: !0,
|
|
992
|
-
iconBefore: /* @__PURE__ */
|
|
993
|
-
onClick:
|
|
1547
|
+
iconBefore: /* @__PURE__ */ o(ye, {}),
|
|
1548
|
+
onClick: a,
|
|
994
1549
|
variant: "outlined",
|
|
995
|
-
children:
|
|
1550
|
+
children: p
|
|
996
1551
|
}
|
|
997
1552
|
)
|
|
998
1553
|
] })
|
|
999
1554
|
] });
|
|
1000
|
-
},
|
|
1555
|
+
}, Bn = x.div`
|
|
1001
1556
|
display: flex;
|
|
1002
1557
|
flex-direction: column;
|
|
1003
1558
|
background-color: ${({ theme: e }) => {
|
|
1004
|
-
var
|
|
1005
|
-
return ((
|
|
1559
|
+
var n, t;
|
|
1560
|
+
return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N0) || v.palette.neutral.N0;
|
|
1006
1561
|
}};
|
|
1007
1562
|
width: ${({ $smallScreen: e }) => e ? "auto" : "450px"};
|
|
1008
1563
|
height: auto;
|
|
@@ -1010,77 +1565,77 @@ const st = x.div`
|
|
|
1010
1565
|
padding: 24px;
|
|
1011
1566
|
gap: 24px;
|
|
1012
1567
|
box-sizing: border-box;
|
|
1013
|
-
`,
|
|
1568
|
+
`, wt = (e) => {
|
|
1014
1569
|
const {
|
|
1015
|
-
actionButtonLabel:
|
|
1016
|
-
cancelButtonLabel:
|
|
1017
|
-
children:
|
|
1018
|
-
loading:
|
|
1019
|
-
onClick:
|
|
1020
|
-
onCloseModal:
|
|
1570
|
+
actionButtonLabel: n,
|
|
1571
|
+
cancelButtonLabel: t,
|
|
1572
|
+
children: a,
|
|
1573
|
+
loading: i,
|
|
1574
|
+
onClick: r,
|
|
1575
|
+
onCloseModal: p,
|
|
1021
1576
|
portalId: l,
|
|
1022
|
-
title:
|
|
1023
|
-
} = e,
|
|
1577
|
+
title: s
|
|
1578
|
+
} = e, c = B("(max-width: 768px)"), u = document.getElementById(l);
|
|
1024
1579
|
if (!u)
|
|
1025
1580
|
throw new Error(
|
|
1026
1581
|
"The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
|
|
1027
1582
|
);
|
|
1028
|
-
return
|
|
1029
|
-
/* @__PURE__ */
|
|
1030
|
-
/* @__PURE__ */
|
|
1031
|
-
/* @__PURE__ */
|
|
1032
|
-
/* @__PURE__ */
|
|
1033
|
-
/* @__PURE__ */
|
|
1034
|
-
/* @__PURE__ */
|
|
1035
|
-
/* @__PURE__ */
|
|
1036
|
-
|
|
1583
|
+
return Se(
|
|
1584
|
+
/* @__PURE__ */ o(we, { children: /* @__PURE__ */ h(Bn, { $smallScreen: c, children: [
|
|
1585
|
+
/* @__PURE__ */ h(g, { direction: "column", gap: "16px", children: [
|
|
1586
|
+
/* @__PURE__ */ h(g, { alignContent: "center", justifyContent: "space-between", children: [
|
|
1587
|
+
/* @__PURE__ */ o(S, { appearance: "dark", size: "small", type: "headline", children: s }),
|
|
1588
|
+
/* @__PURE__ */ h(g, { alignItems: "center", children: [
|
|
1589
|
+
/* @__PURE__ */ o(S, { children: "Cerrar" }),
|
|
1590
|
+
/* @__PURE__ */ o(
|
|
1591
|
+
L,
|
|
1037
1592
|
{
|
|
1038
1593
|
appearance: "dark",
|
|
1039
|
-
icon: /* @__PURE__ */
|
|
1040
|
-
onClick:
|
|
1594
|
+
icon: /* @__PURE__ */ o(xe, {}),
|
|
1595
|
+
onClick: p,
|
|
1041
1596
|
cursorHover: !0
|
|
1042
1597
|
}
|
|
1043
1598
|
)
|
|
1044
1599
|
] })
|
|
1045
1600
|
] }),
|
|
1046
|
-
/* @__PURE__ */
|
|
1601
|
+
/* @__PURE__ */ o(R, {})
|
|
1047
1602
|
] }),
|
|
1048
|
-
|
|
1049
|
-
/* @__PURE__ */
|
|
1050
|
-
/* @__PURE__ */
|
|
1051
|
-
|
|
1603
|
+
a,
|
|
1604
|
+
/* @__PURE__ */ h(g, { gap: "20px", justifyContent: "flex-end", children: [
|
|
1605
|
+
/* @__PURE__ */ o(
|
|
1606
|
+
U,
|
|
1052
1607
|
{
|
|
1053
1608
|
appearance: "gray",
|
|
1054
|
-
onClick:
|
|
1055
|
-
iconBefore: /* @__PURE__ */
|
|
1609
|
+
onClick: p,
|
|
1610
|
+
iconBefore: /* @__PURE__ */ o(ve, {}),
|
|
1056
1611
|
spacing: "wide",
|
|
1057
1612
|
variant: "outlined",
|
|
1058
|
-
children:
|
|
1613
|
+
children: t
|
|
1059
1614
|
}
|
|
1060
1615
|
),
|
|
1061
|
-
/* @__PURE__ */
|
|
1062
|
-
|
|
1616
|
+
/* @__PURE__ */ o(
|
|
1617
|
+
U,
|
|
1063
1618
|
{
|
|
1064
1619
|
appearance: "primary",
|
|
1065
|
-
loading:
|
|
1066
|
-
onClick:
|
|
1620
|
+
loading: i,
|
|
1621
|
+
onClick: r,
|
|
1067
1622
|
spacing: "wide",
|
|
1068
1623
|
variant: "filled",
|
|
1069
|
-
children:
|
|
1624
|
+
children: n
|
|
1070
1625
|
}
|
|
1071
1626
|
)
|
|
1072
1627
|
] })
|
|
1073
1628
|
] }) }),
|
|
1074
1629
|
u
|
|
1075
1630
|
);
|
|
1076
|
-
},
|
|
1077
|
-
const { appliedFilters:
|
|
1078
|
-
return /* @__PURE__ */
|
|
1079
|
-
|
|
1080
|
-
/* @__PURE__ */
|
|
1081
|
-
/* @__PURE__ */
|
|
1082
|
-
/* @__PURE__ */
|
|
1083
|
-
|
|
1631
|
+
}, Ct = (e) => {
|
|
1632
|
+
const { appliedFilters: n, fields: t, onChange: a, noFiltersLabel: i } = e, r = B("(max-width: 768px)"), p = !n || n.length === 0;
|
|
1633
|
+
return /* @__PURE__ */ h(g, { direction: "column", gap: "16px", children: [
|
|
1634
|
+
r && /* @__PURE__ */ h(k, { children: [
|
|
1635
|
+
/* @__PURE__ */ h(g, { gap: "6px", width: "100%", alignItems: "center", children: [
|
|
1636
|
+
/* @__PURE__ */ o(L, { appearance: "gray", icon: /* @__PURE__ */ o(ye, {}) }),
|
|
1637
|
+
/* @__PURE__ */ o(
|
|
1638
|
+
j,
|
|
1084
1639
|
{
|
|
1085
1640
|
background: !0,
|
|
1086
1641
|
borderRadius: "8px",
|
|
@@ -1091,8 +1646,8 @@ const st = x.div`
|
|
|
1091
1646
|
border: !0,
|
|
1092
1647
|
width: "100%",
|
|
1093
1648
|
height: "36px",
|
|
1094
|
-
children:
|
|
1095
|
-
|
|
1649
|
+
children: p ? /* @__PURE__ */ o(S, { size: "small", type: "label", appearance: "gray", children: i }) : n == null ? void 0 : n.map((l) => /* @__PURE__ */ o(
|
|
1650
|
+
H,
|
|
1096
1651
|
{
|
|
1097
1652
|
appearance: "primary",
|
|
1098
1653
|
displayIcon: !0,
|
|
@@ -1106,19 +1661,19 @@ const st = x.div`
|
|
|
1106
1661
|
}
|
|
1107
1662
|
)
|
|
1108
1663
|
] }),
|
|
1109
|
-
/* @__PURE__ */
|
|
1664
|
+
/* @__PURE__ */ o(R, { dashed: !0 })
|
|
1110
1665
|
] }),
|
|
1111
|
-
|
|
1112
|
-
/* @__PURE__ */
|
|
1113
|
-
/* @__PURE__ */
|
|
1114
|
-
|
|
1666
|
+
t.map((l) => /* @__PURE__ */ h(g, { gap: "6px", alignItems: "center", children: [
|
|
1667
|
+
/* @__PURE__ */ o(g, { padding: "22px 0 0 0", children: /* @__PURE__ */ o(L, { appearance: "primary", icon: l.icon }) }),
|
|
1668
|
+
/* @__PURE__ */ o(
|
|
1669
|
+
Ve,
|
|
1115
1670
|
{
|
|
1116
1671
|
disabled: l.disabled,
|
|
1117
1672
|
invalid: l.invalid,
|
|
1118
1673
|
label: l.label,
|
|
1119
1674
|
message: l.message,
|
|
1120
1675
|
name: l.name,
|
|
1121
|
-
onChange:
|
|
1676
|
+
onChange: a,
|
|
1122
1677
|
options: l.options,
|
|
1123
1678
|
placeholder: l.placeholder,
|
|
1124
1679
|
required: l.required,
|
|
@@ -1129,137 +1684,137 @@ const st = x.div`
|
|
|
1129
1684
|
)
|
|
1130
1685
|
] }, l.name))
|
|
1131
1686
|
] });
|
|
1132
|
-
},
|
|
1133
|
-
const
|
|
1134
|
-
return e.from !== void 0 && e.from !== null &&
|
|
1135
|
-
},
|
|
1136
|
-
var
|
|
1137
|
-
const { decision:
|
|
1138
|
-
var
|
|
1139
|
-
const
|
|
1140
|
-
return
|
|
1141
|
-
...(
|
|
1687
|
+
}, _n = (e) => {
|
|
1688
|
+
const n = [];
|
|
1689
|
+
return e.from !== void 0 && e.from !== null && n.push(`>${e.from}`), e.to !== void 0 && e.to !== null && n.push(`<${e.to}`), n.join(";");
|
|
1690
|
+
}, Dt = (e) => {
|
|
1691
|
+
var p;
|
|
1692
|
+
const { decision: n, fallbackId: t, template: a } = e, i = (l) => typeof l == "object" && l !== null && "from" in l && "to" in l ? _n(l) : l, r = ((p = n.conditionsThatEstablishesTheDecision) == null ? void 0 : p.map((l, s) => {
|
|
1693
|
+
var d;
|
|
1694
|
+
const c = l == null ? void 0 : l.value;
|
|
1695
|
+
return c == null || typeof c == "string" && c.trim() === "" || Array.isArray(c) && c.length === 0 ? null : {
|
|
1696
|
+
...(d = a.conditionsThatEstablishesTheDecision) == null ? void 0 : d[s],
|
|
1142
1697
|
...l,
|
|
1143
|
-
value:
|
|
1698
|
+
value: i(c)
|
|
1144
1699
|
};
|
|
1145
1700
|
}).filter(Boolean)) ?? [];
|
|
1146
1701
|
return {
|
|
1147
|
-
...
|
|
1148
|
-
...
|
|
1149
|
-
decisionId:
|
|
1150
|
-
value:
|
|
1151
|
-
conditionsThatEstablishesTheDecision:
|
|
1702
|
+
...a,
|
|
1703
|
+
...n,
|
|
1704
|
+
decisionId: t,
|
|
1705
|
+
value: i(n.value),
|
|
1706
|
+
conditionsThatEstablishesTheDecision: r
|
|
1152
1707
|
};
|
|
1153
|
-
},
|
|
1708
|
+
}, St = (e) => {
|
|
1154
1709
|
if (typeof e != "string") return e;
|
|
1155
|
-
const
|
|
1156
|
-
for (const
|
|
1157
|
-
if (
|
|
1158
|
-
const
|
|
1159
|
-
isNaN(
|
|
1160
|
-
} else if (
|
|
1161
|
-
const
|
|
1162
|
-
isNaN(
|
|
1710
|
+
const n = e.split(";").map((a) => a.trim()), t = {};
|
|
1711
|
+
for (const a of n)
|
|
1712
|
+
if (a.startsWith(">")) {
|
|
1713
|
+
const i = parseFloat(a.slice(1));
|
|
1714
|
+
isNaN(i) || (t.from = i);
|
|
1715
|
+
} else if (a.startsWith("<")) {
|
|
1716
|
+
const i = parseFloat(a.slice(1));
|
|
1717
|
+
isNaN(i) || (t.to = i);
|
|
1163
1718
|
}
|
|
1164
|
-
return
|
|
1165
|
-
},
|
|
1166
|
-
const { dataDecision:
|
|
1167
|
-
conditionName:
|
|
1168
|
-
labelName:
|
|
1169
|
-
conditionDataType:
|
|
1170
|
-
value:
|
|
1171
|
-
howToSetTheCondition:
|
|
1719
|
+
return t.from !== void 0 || t.to !== void 0 ? t : e;
|
|
1720
|
+
}, Nt = (e) => {
|
|
1721
|
+
const { dataDecision: n, originalDecision: t } = e, a = {
|
|
1722
|
+
conditionName: n.ruleName || "",
|
|
1723
|
+
labelName: n.labelName || "",
|
|
1724
|
+
conditionDataType: n.decisionDataType || "alphabetical",
|
|
1725
|
+
value: n.value || "",
|
|
1726
|
+
howToSetTheCondition: n.howToSetTheDecision || "EqualTo",
|
|
1172
1727
|
switchPlaces: !0,
|
|
1173
1728
|
hidden: !1
|
|
1174
1729
|
};
|
|
1175
1730
|
return {
|
|
1176
|
-
...
|
|
1177
|
-
conditionsThatEstablishesTheDecision:
|
|
1178
|
-
(
|
|
1731
|
+
...t,
|
|
1732
|
+
conditionsThatEstablishesTheDecision: t.conditionsThatEstablishesTheDecision.map(
|
|
1733
|
+
(i) => i.hidden ? { ...a } : i
|
|
1179
1734
|
)
|
|
1180
1735
|
};
|
|
1181
|
-
},
|
|
1182
|
-
const { decisions:
|
|
1183
|
-
return
|
|
1184
|
-
var
|
|
1185
|
-
const
|
|
1186
|
-
(
|
|
1736
|
+
}, Et = (e) => {
|
|
1737
|
+
const { decisions: n } = e;
|
|
1738
|
+
return n == null ? void 0 : n.map((t) => {
|
|
1739
|
+
var i;
|
|
1740
|
+
const a = (i = t.conditionsThatEstablishesTheDecision) == null ? void 0 : i.find(
|
|
1741
|
+
(r) => r.hidden
|
|
1187
1742
|
);
|
|
1188
|
-
return
|
|
1189
|
-
...
|
|
1190
|
-
ruleName:
|
|
1191
|
-
labelName:
|
|
1192
|
-
decisionDataType:
|
|
1193
|
-
value:
|
|
1194
|
-
howToSetTheDecision:
|
|
1195
|
-
conditionsThatEstablishesTheDecision:
|
|
1196
|
-
(
|
|
1743
|
+
return a ? {
|
|
1744
|
+
...t,
|
|
1745
|
+
ruleName: t.ruleName,
|
|
1746
|
+
labelName: t.labelName,
|
|
1747
|
+
decisionDataType: t.decisionDataType,
|
|
1748
|
+
value: t.value,
|
|
1749
|
+
howToSetTheDecision: t.howToSetTheDecision,
|
|
1750
|
+
conditionsThatEstablishesTheDecision: t.conditionsThatEstablishesTheDecision.map(
|
|
1751
|
+
(r) => r.hidden ? { ...a, hidden: !1 } : r
|
|
1197
1752
|
)
|
|
1198
|
-
} :
|
|
1753
|
+
} : t;
|
|
1199
1754
|
});
|
|
1200
|
-
},
|
|
1201
|
-
schema:
|
|
1755
|
+
}, Hn = (e) => ({
|
|
1756
|
+
schema: ie().required("Required").test(
|
|
1202
1757
|
"non-empty",
|
|
1203
1758
|
"Value cannot be empty",
|
|
1204
|
-
(
|
|
1759
|
+
(n) => n != null && n.trim() !== ""
|
|
1205
1760
|
),
|
|
1206
1761
|
value: e
|
|
1207
|
-
}),
|
|
1208
|
-
schema:
|
|
1762
|
+
}), qn = (e) => ({
|
|
1763
|
+
schema: Ne().test(
|
|
1209
1764
|
"isArrayOrString",
|
|
1210
1765
|
"Must be an array of strings/numbers or a single string",
|
|
1211
|
-
(
|
|
1212
|
-
(
|
|
1213
|
-
) : typeof
|
|
1766
|
+
(n) => Array.isArray(n) ? n.every(
|
|
1767
|
+
(t) => typeof t == "string" || typeof t == "number"
|
|
1768
|
+
) : typeof n == "string"
|
|
1214
1769
|
),
|
|
1215
1770
|
value: e
|
|
1216
|
-
}),
|
|
1217
|
-
schema:
|
|
1771
|
+
}), Pn = (e) => ({
|
|
1772
|
+
schema: Ne().test(
|
|
1218
1773
|
"isArrayOrString",
|
|
1219
1774
|
"Must be an array of strings/numbers or a single string",
|
|
1220
|
-
(
|
|
1221
|
-
(
|
|
1222
|
-
) : typeof
|
|
1775
|
+
(n) => Array.isArray(n) ? n.every(
|
|
1776
|
+
(t) => typeof t == "string" || typeof t == "number"
|
|
1777
|
+
) : typeof n == "string"
|
|
1223
1778
|
),
|
|
1224
1779
|
value: e
|
|
1225
|
-
}),
|
|
1226
|
-
const
|
|
1780
|
+
}), Gn = (e) => {
|
|
1781
|
+
const n = (e == null ? void 0 : e.from) ?? 0, t = (e == null ? void 0 : e.to) ?? 0;
|
|
1227
1782
|
return {
|
|
1228
|
-
schema:
|
|
1229
|
-
from:
|
|
1230
|
-
to:
|
|
1783
|
+
schema: W({
|
|
1784
|
+
from: ee().required("Range From is required").max(t, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
|
|
1785
|
+
to: ee().min(0, "To value must be greater than or equal to 0").required("To value is required").test(
|
|
1231
1786
|
"is-greater",
|
|
1232
1787
|
"To value must be greater than From value",
|
|
1233
|
-
function(
|
|
1234
|
-
const { from:
|
|
1235
|
-
return
|
|
1788
|
+
function(a) {
|
|
1789
|
+
const { from: i } = this.parent;
|
|
1790
|
+
return a > i;
|
|
1236
1791
|
}
|
|
1237
1792
|
)
|
|
1238
1793
|
}),
|
|
1239
|
-
value: { from:
|
|
1794
|
+
value: { from: n, to: t }
|
|
1240
1795
|
};
|
|
1241
|
-
},
|
|
1242
|
-
schema:
|
|
1796
|
+
}, Z = (e, n) => n === I.PERCENTAGE ? {
|
|
1797
|
+
schema: ee().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
|
|
1243
1798
|
value: e
|
|
1244
1799
|
} : {
|
|
1245
|
-
schema:
|
|
1800
|
+
schema: ie().required("Required"),
|
|
1246
1801
|
value: e
|
|
1247
|
-
},
|
|
1248
|
-
[D.LIST_OF_VALUES]:
|
|
1249
|
-
[D.LIST_OF_VALUES_MULTI]:
|
|
1250
|
-
[D.RANGE]:
|
|
1251
|
-
[D.GREATER_THAN]:
|
|
1252
|
-
[D.LESS_THAN]:
|
|
1253
|
-
[D.EQUAL]:
|
|
1254
|
-
},
|
|
1255
|
-
function
|
|
1802
|
+
}, Qn = {
|
|
1803
|
+
[D.LIST_OF_VALUES]: qn,
|
|
1804
|
+
[D.LIST_OF_VALUES_MULTI]: Pn,
|
|
1805
|
+
[D.RANGE]: Gn,
|
|
1806
|
+
[D.GREATER_THAN]: Z,
|
|
1807
|
+
[D.LESS_THAN]: Z,
|
|
1808
|
+
[D.EQUAL]: Z
|
|
1809
|
+
}, me = (e) => Qn[e] || Hn;
|
|
1810
|
+
function Wn({
|
|
1256
1811
|
decision: e,
|
|
1257
|
-
onSubmitEvent:
|
|
1258
|
-
textValues:
|
|
1812
|
+
onSubmitEvent: n,
|
|
1813
|
+
textValues: t
|
|
1259
1814
|
}) {
|
|
1260
|
-
const
|
|
1815
|
+
const a = {
|
|
1261
1816
|
ruleName: e.ruleName || "",
|
|
1262
|
-
decisionDataType: e.decisionDataType ||
|
|
1817
|
+
decisionDataType: e.decisionDataType || I.ALPHABETICAL,
|
|
1263
1818
|
howToSetTheDecision: e.howToSetTheDecision || "",
|
|
1264
1819
|
value: e.value || "",
|
|
1265
1820
|
effectiveFrom: e.effectiveFrom || "",
|
|
@@ -1269,108 +1824,108 @@ function xt({
|
|
|
1269
1824
|
checkClosed: !1,
|
|
1270
1825
|
terms: !0
|
|
1271
1826
|
};
|
|
1272
|
-
let
|
|
1273
|
-
const
|
|
1274
|
-
ruleName:
|
|
1275
|
-
value:
|
|
1276
|
-
|
|
1827
|
+
let i;
|
|
1828
|
+
const r = {
|
|
1829
|
+
ruleName: ie().required("Name is required"),
|
|
1830
|
+
value: ue(() => me(
|
|
1831
|
+
i.values.howToSetTheDecision
|
|
1277
1832
|
)(
|
|
1278
|
-
|
|
1279
|
-
|
|
1833
|
+
i.values.value,
|
|
1834
|
+
i.values.decisionDataType
|
|
1280
1835
|
).schema),
|
|
1281
|
-
conditionsThatEstablishesTheDecision:
|
|
1282
|
-
var
|
|
1283
|
-
if ((
|
|
1284
|
-
const
|
|
1285
|
-
(
|
|
1286
|
-
if (
|
|
1287
|
-
const
|
|
1288
|
-
|
|
1836
|
+
conditionsThatEstablishesTheDecision: ue((s, { parent: c }) => {
|
|
1837
|
+
var b;
|
|
1838
|
+
if ((c == null ? void 0 : c.toggleNone) && Object.keys(c.conditionsThatEstablishesTheDecision || {}).length > 0) return W().shape({});
|
|
1839
|
+
const d = (b = e.conditionsThatEstablishesTheDecision) == null ? void 0 : b.reduce(
|
|
1840
|
+
(m, f) => {
|
|
1841
|
+
if (i.values.conditionsThatEstablishesTheDecision[f.conditionName] !== void 0) {
|
|
1842
|
+
const C = me(
|
|
1843
|
+
f.howToSetTheCondition
|
|
1289
1844
|
);
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1845
|
+
m[f.conditionName] = C(
|
|
1846
|
+
f.value,
|
|
1847
|
+
f.conditionDataType
|
|
1293
1848
|
).schema;
|
|
1294
1849
|
}
|
|
1295
|
-
return
|
|
1850
|
+
return m;
|
|
1296
1851
|
},
|
|
1297
1852
|
{}
|
|
1298
1853
|
);
|
|
1299
|
-
return
|
|
1854
|
+
return W(d).test(
|
|
1300
1855
|
"at-least-one-condition",
|
|
1301
1856
|
"It must be at least one condition in order for the decision to be validated correctly.",
|
|
1302
|
-
(
|
|
1303
|
-
(
|
|
1857
|
+
(m) => m ? Object.values(m).some(
|
|
1858
|
+
(f) => f != null && f !== ""
|
|
1304
1859
|
) : !1
|
|
1305
1860
|
);
|
|
1306
1861
|
})
|
|
1307
1862
|
};
|
|
1308
|
-
|
|
1863
|
+
t.terms && (r.effectiveFrom = pe().required(
|
|
1309
1864
|
"effective From date is required"
|
|
1310
|
-
),
|
|
1865
|
+
), r.validUntil = pe().when(
|
|
1311
1866
|
"checkClosed",
|
|
1312
|
-
(
|
|
1867
|
+
(s, c, { parent: u }) => (u == null ? void 0 : u.checkClosed) ? c.required("valid Until date is required").test(
|
|
1313
1868
|
"is-after-startDate",
|
|
1314
1869
|
"valid Until date must be greater than or equal to Start date",
|
|
1315
|
-
function(
|
|
1316
|
-
const
|
|
1317
|
-
return !
|
|
1870
|
+
function(b) {
|
|
1871
|
+
const m = this.parent.effectiveFrom;
|
|
1872
|
+
return !m || !b ? !0 : new Date(b) >= new Date(m);
|
|
1318
1873
|
}
|
|
1319
|
-
) :
|
|
1874
|
+
) : c.notRequired()
|
|
1320
1875
|
));
|
|
1321
|
-
const
|
|
1322
|
-
return
|
|
1323
|
-
initialValues:
|
|
1324
|
-
validationSchema:
|
|
1876
|
+
const p = W(r);
|
|
1877
|
+
return i = qe({
|
|
1878
|
+
initialValues: a,
|
|
1879
|
+
validationSchema: p,
|
|
1325
1880
|
validateOnBlur: !0,
|
|
1326
|
-
onSubmit: (
|
|
1881
|
+
onSubmit: (s) => {
|
|
1327
1882
|
var u;
|
|
1328
|
-
const
|
|
1883
|
+
const c = {
|
|
1329
1884
|
...e,
|
|
1330
|
-
ruleName:
|
|
1331
|
-
decisionDataType:
|
|
1332
|
-
howToSetTheDecision:
|
|
1333
|
-
value:
|
|
1334
|
-
effectiveFrom:
|
|
1335
|
-
validUntil:
|
|
1336
|
-
conditionsThatEstablishesTheDecision: (u = e.conditionsThatEstablishesTheDecision) == null ? void 0 : u.filter((
|
|
1337
|
-
const
|
|
1338
|
-
return
|
|
1339
|
-
}).map((
|
|
1340
|
-
...
|
|
1341
|
-
value:
|
|
1885
|
+
ruleName: s.ruleName,
|
|
1886
|
+
decisionDataType: s.decisionDataType,
|
|
1887
|
+
howToSetTheDecision: s.howToSetTheDecision,
|
|
1888
|
+
value: s.value,
|
|
1889
|
+
effectiveFrom: s.effectiveFrom,
|
|
1890
|
+
validUntil: s.validUntil,
|
|
1891
|
+
conditionsThatEstablishesTheDecision: (u = e.conditionsThatEstablishesTheDecision) == null ? void 0 : u.filter((d) => {
|
|
1892
|
+
const b = s.conditionsThatEstablishesTheDecision[d.conditionName];
|
|
1893
|
+
return b != null && b !== "";
|
|
1894
|
+
}).map((d) => ({
|
|
1895
|
+
...d,
|
|
1896
|
+
value: s.conditionsThatEstablishesTheDecision[d.conditionName]
|
|
1342
1897
|
}))
|
|
1343
1898
|
};
|
|
1344
|
-
|
|
1899
|
+
n(c);
|
|
1345
1900
|
}
|
|
1346
|
-
}), { formik:
|
|
1347
|
-
var
|
|
1348
|
-
|
|
1349
|
-
if (
|
|
1350
|
-
|
|
1901
|
+
}), { formik: i, handleToggleNoneChange: (s) => {
|
|
1902
|
+
var c;
|
|
1903
|
+
i.setFieldValue("toggleNone", s), (c = e.conditionsThatEstablishesTheDecision) == null || c.forEach((u) => {
|
|
1904
|
+
if (s)
|
|
1905
|
+
i.setFieldValue(
|
|
1351
1906
|
`conditionsThatEstablishesTheDecision.${u.conditionName}`,
|
|
1352
1907
|
void 0
|
|
1353
1908
|
);
|
|
1354
1909
|
else {
|
|
1355
|
-
const
|
|
1356
|
-
|
|
1910
|
+
const d = u.howToSetTheCondition === D.LIST_OF_VALUES_MULTI ? [] : "";
|
|
1911
|
+
i.setFieldValue(
|
|
1357
1912
|
`conditionsThatEstablishesTheDecision.${u.conditionName}`,
|
|
1358
|
-
|
|
1913
|
+
d
|
|
1359
1914
|
);
|
|
1360
1915
|
}
|
|
1361
1916
|
});
|
|
1362
1917
|
} };
|
|
1363
1918
|
}
|
|
1364
|
-
const
|
|
1919
|
+
const Yn = x.div`
|
|
1365
1920
|
& > div {
|
|
1366
1921
|
border-radius: 8px;
|
|
1367
1922
|
border: 1px solid
|
|
1368
1923
|
${({ theme: e }) => {
|
|
1369
|
-
var
|
|
1370
|
-
return ((
|
|
1924
|
+
var n, t;
|
|
1925
|
+
return ((t = (n = e == null ? void 0 : e.palette) == null ? void 0 : n.neutral) == null ? void 0 : t.N30) || v.palette.neutral.N30;
|
|
1371
1926
|
}};
|
|
1372
1927
|
}
|
|
1373
|
-
`,
|
|
1928
|
+
`, Kn = x.div`
|
|
1374
1929
|
width: 100%;
|
|
1375
1930
|
height: 100%;
|
|
1376
1931
|
overflow-y: auto;
|
|
@@ -1387,61 +1942,61 @@ const vt = x.div`
|
|
|
1387
1942
|
background-color: #ebecf0;
|
|
1388
1943
|
border-radius: 8px;
|
|
1389
1944
|
}
|
|
1390
|
-
`,
|
|
1945
|
+
`, Jn = (e) => {
|
|
1391
1946
|
const {
|
|
1392
|
-
checked:
|
|
1393
|
-
children:
|
|
1394
|
-
handleToggleChange:
|
|
1395
|
-
id:
|
|
1396
|
-
labelToggle:
|
|
1397
|
-
name:
|
|
1947
|
+
checked: n,
|
|
1948
|
+
children: t,
|
|
1949
|
+
handleToggleChange: a,
|
|
1950
|
+
id: i,
|
|
1951
|
+
labelToggle: r,
|
|
1952
|
+
name: p,
|
|
1398
1953
|
valueToggle: l = ""
|
|
1399
|
-
} = e, [
|
|
1400
|
-
d
|
|
1954
|
+
} = e, [s, c] = O(n), u = (d) => {
|
|
1955
|
+
c(d.target.checked), a(d);
|
|
1401
1956
|
};
|
|
1402
|
-
return
|
|
1403
|
-
|
|
1404
|
-
}, [
|
|
1405
|
-
/* @__PURE__ */
|
|
1406
|
-
|
|
1957
|
+
return oe(() => {
|
|
1958
|
+
c(n);
|
|
1959
|
+
}, [n]), /* @__PURE__ */ h(k, { children: [
|
|
1960
|
+
/* @__PURE__ */ o(g, { children: /* @__PURE__ */ o(
|
|
1961
|
+
Ce,
|
|
1407
1962
|
{
|
|
1408
|
-
checked:
|
|
1409
|
-
id:
|
|
1410
|
-
name:
|
|
1963
|
+
checked: s,
|
|
1964
|
+
id: i,
|
|
1965
|
+
name: p,
|
|
1411
1966
|
onChange: u,
|
|
1412
1967
|
size: "small",
|
|
1413
1968
|
value: l,
|
|
1414
|
-
children: /* @__PURE__ */
|
|
1969
|
+
children: /* @__PURE__ */ o(S, { size: "medium", type: "label", weight: "bold", children: r })
|
|
1415
1970
|
}
|
|
1416
1971
|
) }),
|
|
1417
|
-
|
|
1972
|
+
s && /* @__PURE__ */ o(k, { children: t })
|
|
1418
1973
|
] });
|
|
1419
|
-
},
|
|
1974
|
+
}, Xn = (e) => {
|
|
1420
1975
|
const {
|
|
1421
|
-
onHandleStartChange:
|
|
1422
|
-
onHandleEndChange:
|
|
1423
|
-
onCheckClosedChange:
|
|
1424
|
-
labelStart:
|
|
1425
|
-
labelEnd:
|
|
1426
|
-
checkedClosed:
|
|
1976
|
+
onHandleStartChange: n,
|
|
1977
|
+
onHandleEndChange: t,
|
|
1978
|
+
onCheckClosedChange: a,
|
|
1979
|
+
labelStart: i,
|
|
1980
|
+
labelEnd: r,
|
|
1981
|
+
checkedClosed: p = !1,
|
|
1427
1982
|
required: l = !1,
|
|
1428
|
-
valueStart:
|
|
1429
|
-
valueEnd:
|
|
1983
|
+
valueStart: s = "",
|
|
1984
|
+
valueEnd: c = "",
|
|
1430
1985
|
messageStart: u = "",
|
|
1431
|
-
messageEnd:
|
|
1432
|
-
statusStart:
|
|
1433
|
-
statusEnd:
|
|
1434
|
-
} = e, [
|
|
1435
|
-
|
|
1436
|
-
},
|
|
1437
|
-
|
|
1438
|
-
}, N = (
|
|
1439
|
-
F
|
|
1440
|
-
},
|
|
1441
|
-
return /* @__PURE__ */
|
|
1442
|
-
/* @__PURE__ */
|
|
1443
|
-
/* @__PURE__ */
|
|
1444
|
-
|
|
1986
|
+
messageEnd: d = "",
|
|
1987
|
+
statusStart: b = "pending",
|
|
1988
|
+
statusEnd: m = "pending"
|
|
1989
|
+
} = e, [f, y] = O(p), [C, w] = O(s), [E, $] = O(c), A = ({ target: F }) => {
|
|
1990
|
+
y(F.checked), a && a(F.checked);
|
|
1991
|
+
}, T = (F) => {
|
|
1992
|
+
w(F.target.value), n(F);
|
|
1993
|
+
}, N = (F) => {
|
|
1994
|
+
$(F.target.value), t(F);
|
|
1995
|
+
}, M = B("(max-width: 400px)");
|
|
1996
|
+
return /* @__PURE__ */ h(k, { children: [
|
|
1997
|
+
/* @__PURE__ */ h(g, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
|
|
1998
|
+
/* @__PURE__ */ o(
|
|
1999
|
+
S,
|
|
1445
2000
|
{
|
|
1446
2001
|
appearance: "gray",
|
|
1447
2002
|
margin: "10px 0",
|
|
@@ -1451,83 +2006,83 @@ const vt = x.div`
|
|
|
1451
2006
|
children: "Vigencia"
|
|
1452
2007
|
}
|
|
1453
2008
|
),
|
|
1454
|
-
/* @__PURE__ */
|
|
2009
|
+
/* @__PURE__ */ o(
|
|
1455
2010
|
g,
|
|
1456
2011
|
{
|
|
1457
2012
|
alignContent: "center",
|
|
1458
2013
|
justifyContent: "center",
|
|
1459
2014
|
wrap: "wrap",
|
|
1460
2015
|
gap: "4px",
|
|
1461
|
-
children: /* @__PURE__ */
|
|
1462
|
-
|
|
2016
|
+
children: /* @__PURE__ */ o(
|
|
2017
|
+
je,
|
|
1463
2018
|
{
|
|
1464
2019
|
label: "Cerrada",
|
|
1465
|
-
onChange:
|
|
1466
|
-
checked:
|
|
2020
|
+
onChange: A,
|
|
2021
|
+
checked: f,
|
|
1467
2022
|
value: ""
|
|
1468
2023
|
}
|
|
1469
2024
|
)
|
|
1470
2025
|
}
|
|
1471
2026
|
)
|
|
1472
2027
|
] }),
|
|
1473
|
-
/* @__PURE__ */
|
|
2028
|
+
/* @__PURE__ */ h(
|
|
1474
2029
|
g,
|
|
1475
2030
|
{
|
|
1476
|
-
direction:
|
|
2031
|
+
direction: M ? "column" : "row",
|
|
1477
2032
|
justifyContent: "space-between",
|
|
1478
2033
|
gap: "24px",
|
|
1479
2034
|
children: [
|
|
1480
|
-
/* @__PURE__ */
|
|
1481
|
-
|
|
2035
|
+
/* @__PURE__ */ o(
|
|
2036
|
+
de,
|
|
1482
2037
|
{
|
|
1483
2038
|
id: "dateStart",
|
|
1484
|
-
label:
|
|
1485
|
-
onChange:
|
|
1486
|
-
value:
|
|
2039
|
+
label: i,
|
|
2040
|
+
onChange: T,
|
|
2041
|
+
value: C,
|
|
1487
2042
|
required: l,
|
|
1488
2043
|
size: "compact",
|
|
1489
|
-
status:
|
|
2044
|
+
status: b,
|
|
1490
2045
|
message: u
|
|
1491
2046
|
}
|
|
1492
2047
|
),
|
|
1493
|
-
|
|
1494
|
-
|
|
2048
|
+
f && /* @__PURE__ */ o(
|
|
2049
|
+
de,
|
|
1495
2050
|
{
|
|
1496
2051
|
id: "dateEnd",
|
|
1497
|
-
label:
|
|
2052
|
+
label: r,
|
|
1498
2053
|
onChange: N,
|
|
1499
|
-
value:
|
|
2054
|
+
value: E,
|
|
1500
2055
|
required: l,
|
|
1501
2056
|
size: "compact",
|
|
1502
|
-
status:
|
|
1503
|
-
message:
|
|
2057
|
+
status: m,
|
|
2058
|
+
message: d
|
|
1504
2059
|
}
|
|
1505
2060
|
)
|
|
1506
2061
|
]
|
|
1507
2062
|
}
|
|
1508
2063
|
)
|
|
1509
2064
|
] });
|
|
1510
|
-
},
|
|
2065
|
+
}, Zn = (e) => {
|
|
1511
2066
|
const {
|
|
1512
|
-
formik:
|
|
1513
|
-
textValues:
|
|
1514
|
-
onCancel:
|
|
1515
|
-
visibleConditions:
|
|
1516
|
-
normalizedDecision:
|
|
1517
|
-
handleToggleNoneChange:
|
|
2067
|
+
formik: n,
|
|
2068
|
+
textValues: t,
|
|
2069
|
+
onCancel: a,
|
|
2070
|
+
visibleConditions: i,
|
|
2071
|
+
normalizedDecision: r,
|
|
2072
|
+
handleToggleNoneChange: p,
|
|
1518
2073
|
handleConditionToggleChange: l,
|
|
1519
|
-
showConditionsError:
|
|
1520
|
-
termStartStatus:
|
|
2074
|
+
showConditionsError: s,
|
|
2075
|
+
termStartStatus: c,
|
|
1521
2076
|
termEndStatus: u
|
|
1522
2077
|
} = e;
|
|
1523
|
-
return /* @__PURE__ */
|
|
1524
|
-
|
|
1525
|
-
condition:
|
|
1526
|
-
formik:
|
|
2078
|
+
return /* @__PURE__ */ o("form", { onSubmit: n.handleSubmit, children: /* @__PURE__ */ h(g, { direction: "column", gap: "24px", children: [
|
|
2079
|
+
ce({
|
|
2080
|
+
condition: r,
|
|
2081
|
+
formik: n,
|
|
1527
2082
|
isDecision: !0
|
|
1528
2083
|
}),
|
|
1529
|
-
/* @__PURE__ */
|
|
1530
|
-
/* @__PURE__ */
|
|
2084
|
+
/* @__PURE__ */ o(R, { dashed: !0 }),
|
|
2085
|
+
/* @__PURE__ */ o(Yn, { children: /* @__PURE__ */ o(Kn, { children: /* @__PURE__ */ h(
|
|
1531
2086
|
g,
|
|
1532
2087
|
{
|
|
1533
2088
|
direction: "column",
|
|
@@ -1535,168 +2090,168 @@ const vt = x.div`
|
|
|
1535
2090
|
gap: "16px",
|
|
1536
2091
|
height: "272px",
|
|
1537
2092
|
children: [
|
|
1538
|
-
/* @__PURE__ */
|
|
2093
|
+
/* @__PURE__ */ h(
|
|
1539
2094
|
g,
|
|
1540
2095
|
{
|
|
1541
2096
|
justifyContent: "space-between",
|
|
1542
2097
|
alignItems: "center",
|
|
1543
2098
|
gap: "64px",
|
|
1544
2099
|
children: [
|
|
1545
|
-
/* @__PURE__ */
|
|
1546
|
-
/* @__PURE__ */
|
|
1547
|
-
|
|
2100
|
+
/* @__PURE__ */ o(S, { type: "title", size: "small", weight: "bold", appearance: "gray", children: t.factsThatConditionIt }),
|
|
2101
|
+
/* @__PURE__ */ o(
|
|
2102
|
+
Ce,
|
|
1548
2103
|
{
|
|
1549
2104
|
id: "toggleNone",
|
|
1550
|
-
onChange: () =>
|
|
1551
|
-
checked:
|
|
2105
|
+
onChange: () => p(!n.values.toggleNone),
|
|
2106
|
+
checked: n.values.toggleNone,
|
|
1552
2107
|
size: "small",
|
|
1553
|
-
children: /* @__PURE__ */
|
|
2108
|
+
children: /* @__PURE__ */ o(S, { as: "span", size: "medium", type: "label", weight: "bold", children: t.none })
|
|
1554
2109
|
}
|
|
1555
2110
|
)
|
|
1556
2111
|
]
|
|
1557
2112
|
}
|
|
1558
2113
|
),
|
|
1559
|
-
/* @__PURE__ */
|
|
1560
|
-
|
|
2114
|
+
/* @__PURE__ */ o(g, { direction: "column", gap: "20px", children: i == null ? void 0 : i.map((d) => /* @__PURE__ */ o(
|
|
2115
|
+
Jn,
|
|
1561
2116
|
{
|
|
1562
|
-
id: `toggle-${
|
|
1563
|
-
name: `toggle.${
|
|
1564
|
-
labelToggle:
|
|
1565
|
-
checked: !
|
|
1566
|
-
handleToggleChange: (
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
)(
|
|
1570
|
-
children:
|
|
2117
|
+
id: `toggle-${d.conditionName}`,
|
|
2118
|
+
name: `toggle.${d.conditionName}`,
|
|
2119
|
+
labelToggle: d.labelName,
|
|
2120
|
+
checked: !n.values.toggleNone && n.values.conditionsThatEstablishesTheDecision[d.conditionName] !== void 0,
|
|
2121
|
+
handleToggleChange: (b) => l(
|
|
2122
|
+
d.conditionName,
|
|
2123
|
+
d.howToSetTheCondition === D.LIST_OF_VALUES_MULTI
|
|
2124
|
+
)(b.target.checked),
|
|
2125
|
+
children: ce({ condition: d, formik: n })
|
|
1571
2126
|
},
|
|
1572
|
-
|
|
2127
|
+
d.conditionName
|
|
1573
2128
|
)) })
|
|
1574
2129
|
]
|
|
1575
2130
|
}
|
|
1576
2131
|
) }) }),
|
|
1577
|
-
|
|
1578
|
-
/* @__PURE__ */
|
|
1579
|
-
/* @__PURE__ */
|
|
1580
|
-
|
|
2132
|
+
t.terms && /* @__PURE__ */ h(k, { children: [
|
|
2133
|
+
/* @__PURE__ */ o(R, { dashed: !0 }),
|
|
2134
|
+
/* @__PURE__ */ o(
|
|
2135
|
+
Xn,
|
|
1581
2136
|
{
|
|
1582
|
-
labelStart:
|
|
1583
|
-
labelEnd:
|
|
1584
|
-
valueStart:
|
|
1585
|
-
valueEnd:
|
|
1586
|
-
messageStart:
|
|
1587
|
-
messageEnd:
|
|
1588
|
-
statusStart:
|
|
2137
|
+
labelStart: t.termStart,
|
|
2138
|
+
labelEnd: t.termEnd,
|
|
2139
|
+
valueStart: n.values.effectiveFrom,
|
|
2140
|
+
valueEnd: n.values.validUntil,
|
|
2141
|
+
messageStart: n.errors.effectiveFrom,
|
|
2142
|
+
messageEnd: n.errors.validUntil,
|
|
2143
|
+
statusStart: c,
|
|
1589
2144
|
statusEnd: u,
|
|
1590
|
-
onHandleStartChange: (
|
|
1591
|
-
onHandleEndChange: (
|
|
1592
|
-
onCheckClosedChange: (
|
|
1593
|
-
|
|
2145
|
+
onHandleStartChange: (d) => n.setFieldValue("effectiveFrom", d.target.value),
|
|
2146
|
+
onHandleEndChange: (d) => n.setFieldValue("validUntil", d.target.value),
|
|
2147
|
+
onCheckClosedChange: (d) => {
|
|
2148
|
+
n.setFieldValue("checkClosed", d), d && n.setFieldValue("validUntil", "");
|
|
1594
2149
|
},
|
|
1595
|
-
checkedClosed:
|
|
2150
|
+
checkedClosed: n.values.checkClosed
|
|
1596
2151
|
}
|
|
1597
2152
|
)
|
|
1598
2153
|
] }),
|
|
1599
|
-
/* @__PURE__ */
|
|
1600
|
-
|
|
1601
|
-
/* @__PURE__ */
|
|
1602
|
-
/* @__PURE__ */
|
|
1603
|
-
/* @__PURE__ */
|
|
2154
|
+
/* @__PURE__ */ o(R, {}),
|
|
2155
|
+
s && /* @__PURE__ */ o(S, { type: "label", size: "medium", appearance: "danger", children: String(n.errors.conditionsThatEstablishesTheDecision) }),
|
|
2156
|
+
/* @__PURE__ */ h(g, { direction: "row", justifyContent: "end", gap: "16px", children: [
|
|
2157
|
+
/* @__PURE__ */ o(U, { appearance: "gray", onClick: a, children: t.cancel }),
|
|
2158
|
+
/* @__PURE__ */ o(U, { type: "submit", children: t.confirm })
|
|
1604
2159
|
] })
|
|
1605
2160
|
] }) });
|
|
1606
|
-
},
|
|
1607
|
-
var
|
|
1608
|
-
const { decision:
|
|
1609
|
-
decision:
|
|
1610
|
-
onSubmitEvent:
|
|
1611
|
-
textValues:
|
|
2161
|
+
}, Ie = (e) => {
|
|
2162
|
+
var m;
|
|
2163
|
+
const { decision: n, onSubmitEvent: t, textValues: a, onCancel: i } = e, { formik: r, handleToggleNoneChange: p } = Wn({
|
|
2164
|
+
decision: n,
|
|
2165
|
+
onSubmitEvent: t,
|
|
2166
|
+
textValues: a
|
|
1612
2167
|
}), l = {
|
|
1613
|
-
ruleName:
|
|
1614
|
-
labelName:
|
|
1615
|
-
howToSetTheCondition:
|
|
1616
|
-
decisionDataType:
|
|
1617
|
-
listOfPossibleValues:
|
|
1618
|
-
},
|
|
1619
|
-
(
|
|
1620
|
-
)) || [],
|
|
1621
|
-
return /* @__PURE__ */
|
|
1622
|
-
|
|
2168
|
+
ruleName: n.ruleName,
|
|
2169
|
+
labelName: n.labelName,
|
|
2170
|
+
howToSetTheCondition: n.howToSetTheDecision,
|
|
2171
|
+
decisionDataType: n.decisionDataType,
|
|
2172
|
+
listOfPossibleValues: n.listOfPossibleValues
|
|
2173
|
+
}, s = ((m = n.conditionsThatEstablishesTheDecision) == null ? void 0 : m.filter(
|
|
2174
|
+
(f) => !f.hidden
|
|
2175
|
+
)) || [], c = !!r.errors.conditionsThatEstablishesTheDecision && r.submitCount > 0, u = r.touched.effectiveFrom ? r.errors.effectiveFrom ? "invalid" : "valid" : void 0, d = r.touched.validUntil ? r.errors.validUntil ? "invalid" : "valid" : void 0;
|
|
2176
|
+
return /* @__PURE__ */ o(
|
|
2177
|
+
Zn,
|
|
1623
2178
|
{
|
|
1624
|
-
formik:
|
|
1625
|
-
onCancel:
|
|
1626
|
-
textValues:
|
|
1627
|
-
decision:
|
|
1628
|
-
visibleConditions:
|
|
2179
|
+
formik: r,
|
|
2180
|
+
onCancel: i,
|
|
2181
|
+
textValues: a,
|
|
2182
|
+
decision: n,
|
|
2183
|
+
visibleConditions: s,
|
|
1629
2184
|
normalizedDecision: l,
|
|
1630
|
-
handleToggleNoneChange:
|
|
1631
|
-
handleConditionToggleChange: (
|
|
1632
|
-
if (!
|
|
1633
|
-
|
|
1634
|
-
`conditionsThatEstablishesTheDecision.${
|
|
2185
|
+
handleToggleNoneChange: p,
|
|
2186
|
+
handleConditionToggleChange: (f, y) => (C) => {
|
|
2187
|
+
if (!C)
|
|
2188
|
+
r.setFieldValue(
|
|
2189
|
+
`conditionsThatEstablishesTheDecision.${f}`,
|
|
1635
2190
|
void 0
|
|
1636
|
-
),
|
|
1637
|
-
`conditionsThatEstablishesTheDecision.${
|
|
2191
|
+
), r.setFieldTouched(
|
|
2192
|
+
`conditionsThatEstablishesTheDecision.${f}`,
|
|
1638
2193
|
!1,
|
|
1639
2194
|
!1
|
|
1640
2195
|
);
|
|
1641
2196
|
else {
|
|
1642
|
-
const
|
|
1643
|
-
|
|
1644
|
-
`conditionsThatEstablishesTheDecision.${
|
|
1645
|
-
|
|
2197
|
+
const w = y ? [] : "";
|
|
2198
|
+
r.setFieldValue(
|
|
2199
|
+
`conditionsThatEstablishesTheDecision.${f}`,
|
|
2200
|
+
w
|
|
1646
2201
|
);
|
|
1647
2202
|
}
|
|
1648
2203
|
},
|
|
1649
|
-
showConditionsError:
|
|
2204
|
+
showConditionsError: c,
|
|
1650
2205
|
termStartStatus: u,
|
|
1651
|
-
termEndStatus:
|
|
2206
|
+
termEndStatus: d
|
|
1652
2207
|
}
|
|
1653
2208
|
);
|
|
1654
|
-
},
|
|
1655
|
-
var
|
|
1656
|
-
const { decisionTemplate:
|
|
1657
|
-
(
|
|
2209
|
+
}, kt = (e) => {
|
|
2210
|
+
var i;
|
|
2211
|
+
const { decisionTemplate: n } = e, t = { ...n }, a = (i = t.conditionsThatEstablishesTheDecision) == null ? void 0 : i.find(
|
|
2212
|
+
(r) => r.switchPlaces
|
|
1658
2213
|
);
|
|
1659
|
-
return
|
|
1660
|
-
...
|
|
1661
|
-
ruleName:
|
|
1662
|
-
labelName:
|
|
1663
|
-
decisionDataType:
|
|
1664
|
-
value:
|
|
1665
|
-
howToSetTheDecision:
|
|
1666
|
-
conditionsThatEstablishesTheDecision:
|
|
1667
|
-
(
|
|
2214
|
+
return a ? {
|
|
2215
|
+
...t,
|
|
2216
|
+
ruleName: a.conditionName,
|
|
2217
|
+
labelName: a.labelName,
|
|
2218
|
+
decisionDataType: a.conditionDataType,
|
|
2219
|
+
value: a.value,
|
|
2220
|
+
howToSetTheDecision: a.howToSetTheCondition,
|
|
2221
|
+
conditionsThatEstablishesTheDecision: t.conditionsThatEstablishesTheDecision.map(
|
|
2222
|
+
(r) => r.conditionName === a.conditionName ? { ...r, hidden: !0 } : r
|
|
1668
2223
|
)
|
|
1669
|
-
} :
|
|
1670
|
-
},
|
|
1671
|
-
const { decisions:
|
|
1672
|
-
return
|
|
1673
|
-
var
|
|
1674
|
-
const
|
|
1675
|
-
(
|
|
2224
|
+
} : t;
|
|
2225
|
+
}, At = (e) => {
|
|
2226
|
+
const { decisions: n } = e;
|
|
2227
|
+
return n == null ? void 0 : n.map((t) => {
|
|
2228
|
+
var i;
|
|
2229
|
+
const a = (i = t.conditionsThatEstablishesTheDecision) == null ? void 0 : i.find(
|
|
2230
|
+
(r) => r.switchPlaces
|
|
1676
2231
|
);
|
|
1677
|
-
return
|
|
1678
|
-
...
|
|
1679
|
-
ruleName:
|
|
1680
|
-
labelName:
|
|
1681
|
-
decisionDataType:
|
|
1682
|
-
value:
|
|
1683
|
-
howToSetTheDecision:
|
|
1684
|
-
conditionsThatEstablishesTheDecision:
|
|
1685
|
-
(
|
|
2232
|
+
return a ? {
|
|
2233
|
+
...t,
|
|
2234
|
+
ruleName: a.conditionName,
|
|
2235
|
+
labelName: a.labelName,
|
|
2236
|
+
decisionDataType: a.conditionDataType,
|
|
2237
|
+
value: a.value,
|
|
2238
|
+
howToSetTheDecision: a.howToSetTheCondition,
|
|
2239
|
+
conditionsThatEstablishesTheDecision: t.conditionsThatEstablishesTheDecision.map(
|
|
2240
|
+
(r) => r.conditionName === a.conditionName ? { ...r, hidden: !0 } : r
|
|
1686
2241
|
)
|
|
1687
|
-
} :
|
|
2242
|
+
} : t;
|
|
1688
2243
|
});
|
|
1689
|
-
}, _ = /* @__PURE__ */ new Map(),
|
|
1690
|
-
const
|
|
1691
|
-
if (_.set(
|
|
1692
|
-
const
|
|
1693
|
-
|
|
2244
|
+
}, _ = /* @__PURE__ */ new Map(), et = (e, n) => _.get(`${n}:${e}`), nt = (e, n, t) => {
|
|
2245
|
+
const a = `${n}:${e}`;
|
|
2246
|
+
if (_.set(a, t), _.size > 1e3) {
|
|
2247
|
+
const i = _.keys().next().value;
|
|
2248
|
+
i !== void 0 && _.delete(i);
|
|
1694
2249
|
}
|
|
1695
|
-
},
|
|
1696
|
-
const
|
|
1697
|
-
return
|
|
1698
|
-
},
|
|
1699
|
-
const
|
|
2250
|
+
}, be = /* @__PURE__ */ new Map(), tt = 1e3, at = (e) => {
|
|
2251
|
+
const n = Date.now(), t = be.get(e) || 0;
|
|
2252
|
+
return n - t < tt ? !0 : (be.set(e, n), !1);
|
|
2253
|
+
}, ot = (e) => {
|
|
2254
|
+
const n = Ge(e);
|
|
1700
2255
|
return {
|
|
1701
2256
|
spa: "es",
|
|
1702
2257
|
eng: "en",
|
|
@@ -1704,70 +2259,73 @@ const vt = x.div`
|
|
|
1704
2259
|
fra: "fr",
|
|
1705
2260
|
ita: "it",
|
|
1706
2261
|
por: "pt"
|
|
1707
|
-
}[
|
|
1708
|
-
},
|
|
1709
|
-
const
|
|
1710
|
-
if (
|
|
1711
|
-
if (
|
|
2262
|
+
}[n] || "en";
|
|
2263
|
+
}, it = async (e, n, { url: t, apiKey: a }) => {
|
|
2264
|
+
const i = `${n}:${e}`, r = et(e, n);
|
|
2265
|
+
if (r) return r;
|
|
2266
|
+
if (at(i))
|
|
1712
2267
|
return console.warn(`[Throttle] Skipped translation for: "${e}"`), e;
|
|
1713
|
-
const
|
|
2268
|
+
const p = ot(e);
|
|
1714
2269
|
try {
|
|
1715
|
-
const { data: l } = await
|
|
1716
|
-
|
|
2270
|
+
const { data: l } = await Pe.post(
|
|
2271
|
+
t,
|
|
1717
2272
|
{
|
|
1718
2273
|
q: e,
|
|
1719
|
-
source:
|
|
1720
|
-
target:
|
|
1721
|
-
api_key:
|
|
2274
|
+
source: p,
|
|
2275
|
+
target: n,
|
|
2276
|
+
api_key: a
|
|
1722
2277
|
},
|
|
1723
2278
|
{
|
|
1724
2279
|
headers: {
|
|
1725
2280
|
"Content-Type": "application/json"
|
|
1726
2281
|
}
|
|
1727
2282
|
}
|
|
1728
|
-
),
|
|
1729
|
-
return
|
|
2283
|
+
), s = (l == null ? void 0 : l.translatedText) || e;
|
|
2284
|
+
return nt(e, n, s), s;
|
|
1730
2285
|
} catch (l) {
|
|
1731
2286
|
return console.warn(`[Translation] Failed for: "${e}"`, l), e;
|
|
1732
2287
|
}
|
|
1733
|
-
},
|
|
1734
|
-
const
|
|
1735
|
-
Object.entries(e).map(async ([
|
|
1736
|
-
if (
|
|
1737
|
-
const
|
|
1738
|
-
return [
|
|
1739
|
-
} else if (Array.isArray(
|
|
1740
|
-
const
|
|
1741
|
-
|
|
1742
|
-
async (l) => typeof l == "object" && l !== null ? await
|
|
2288
|
+
}, rt = (e) => typeof e == "string" && e.trim().length > 0, fe = async (e, n, t) => {
|
|
2289
|
+
const a = await Promise.all(
|
|
2290
|
+
Object.entries(e).map(async ([i, r]) => {
|
|
2291
|
+
if (rt(r)) {
|
|
2292
|
+
const p = await it(r, n, t);
|
|
2293
|
+
return [i, p];
|
|
2294
|
+
} else if (Array.isArray(r)) {
|
|
2295
|
+
const p = await Promise.all(
|
|
2296
|
+
r.map(
|
|
2297
|
+
async (l) => typeof l == "object" && l !== null ? await fe(l, n, t) : l
|
|
1743
2298
|
)
|
|
1744
2299
|
);
|
|
1745
|
-
return [
|
|
1746
|
-
} else if (typeof
|
|
1747
|
-
const
|
|
1748
|
-
return [
|
|
2300
|
+
return [i, p];
|
|
2301
|
+
} else if (typeof r == "object" && r !== null) {
|
|
2302
|
+
const p = await fe(r, n, t);
|
|
2303
|
+
return [i, p];
|
|
1749
2304
|
} else
|
|
1750
|
-
return [
|
|
2305
|
+
return [i, r];
|
|
1751
2306
|
})
|
|
1752
2307
|
);
|
|
1753
|
-
return Object.fromEntries(
|
|
2308
|
+
return Object.fromEntries(a);
|
|
1754
2309
|
};
|
|
1755
2310
|
export {
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
2311
|
+
re as BusinessRuleCard,
|
|
2312
|
+
$e as BusinessRuleCardNew,
|
|
2313
|
+
Ee as BusinessRuleView,
|
|
2314
|
+
Fe as BusinessRuleViewNew,
|
|
2315
|
+
xt as BusinessRules,
|
|
2316
|
+
vt as BusinessRulesNew,
|
|
2317
|
+
yt as Filter,
|
|
2318
|
+
wt as FilterModal,
|
|
2319
|
+
Ct as FormFilter,
|
|
2320
|
+
ke as ModalRules,
|
|
2321
|
+
Ie as RulesForm,
|
|
2322
|
+
_n as convertRangeToString,
|
|
2323
|
+
Dt as formatDecisionForBackend,
|
|
2324
|
+
St as parseRangeFromString,
|
|
2325
|
+
Nt as revertSortedDataSampleSwitchPlaces,
|
|
2326
|
+
Et as revertSortedDataSwitchPlaces,
|
|
2327
|
+
kt as sortDisplayDataSampleSwitchPlaces,
|
|
2328
|
+
At as sortDisplayDataSwitchPlaces,
|
|
2329
|
+
fe as translateObject,
|
|
2330
|
+
it as translateText
|
|
1773
2331
|
};
|