@isettingkit/business-rules 1.0.17 → 1.0.18

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