@isettingkit/business-rules 0.1.21 → 0.1.22

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.
@@ -1,8 +1,11 @@
1
1
  import { IRuleDecision } from '@isettingkit/input';
2
2
  import { JSX as JSX_2 } from 'react/jsx-runtime';
3
+ import { ReactPortal } from 'react';
3
4
 
4
5
  export declare const BusinessRuleCard: (props: IBusinessRuleCard) => JSX_2.Element;
5
6
 
7
+ export declare const BusinessRules: ({ decisions, textValues, decisionTemplate, isModalOpen, selectedDecision, loading, handleOpenModal, handleCloseModal, handleSubmitForm, handleDelete, }: IBusinessRules) => JSX_2.Element;
8
+
6
9
  export declare const BusinessRuleView: (props: IBusinessRuleView) => JSX_2.Element;
7
10
 
8
11
  export declare interface IBusinessRuleCard {
@@ -13,12 +16,32 @@ export declare interface IBusinessRuleCard {
13
16
  id: string;
14
17
  }
15
18
 
19
+ declare interface IBusinessRules {
20
+ decisions: IRuleDecision[];
21
+ textValues: IRulesFormTextValues;
22
+ decisionTemplate: IRuleDecision;
23
+ isModalOpen: boolean;
24
+ selectedDecision: IRuleDecision | null;
25
+ loading: boolean;
26
+ handleOpenModal: (decision?: IRuleDecision | null) => void;
27
+ handleCloseModal: () => void;
28
+ handleSubmitForm: (dataDecision: IRuleDecision) => void;
29
+ handleDelete: (id: string) => void;
30
+ }
31
+
16
32
  export declare interface IBusinessRuleView {
17
33
  decision?: IRuleDecision;
18
34
  loading?: boolean;
19
35
  textValues?: IRulesFormTextValues;
20
36
  }
21
37
 
38
+ declare interface IModalRules {
39
+ children: React.ReactNode;
40
+ onCloseModal: () => void;
41
+ portalId: string;
42
+ title: string;
43
+ }
44
+
22
45
  export declare interface IRulesForm {
23
46
  id: string;
24
47
  decision: IRuleDecision;
@@ -46,6 +69,8 @@ declare interface IRulesFormTextValues {
46
69
  termStart: string;
47
70
  }
48
71
 
72
+ export declare const ModalRules: (props: IModalRules) => ReactPortal;
73
+
49
74
  export declare const RulesForm: (prop: IRulesForm) => JSX_2.Element;
50
75
 
51
76
  export { }
package/dist/index.es.js CHANGED
@@ -1,143 +1,148 @@
1
- import { jsxs as p, Fragment as R, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as p, Fragment as A, jsx as t } from "react/jsx-runtime";
2
2
  import { useFormik as ee } from "formik";
3
- import { useState as y, useEffect as Q } from "react";
4
- import { Divider as C } from "@inubekit/divider";
5
- import { Stack as u } from "@inubekit/stack";
6
- import { Text as D } from "@inubekit/text";
7
- import { Toggle as Z } from "@inubekit/toggle";
8
- import { ValueHowToSetUp as m, ValueDataType as I, DecisionConditionRenderer as z } from "@isettingkit/input";
9
- import { Button as _ } from "@inubekit/button";
10
- import { object as J, string as L, number as N, mixed as H } from "yup";
11
- import { Date as q } from "@inubekit/date";
3
+ import { useState as k, useEffect as Z } from "react";
4
+ import { Divider as S } from "@inubekit/divider";
5
+ import { Stack as l } from "@inubekit/stack";
6
+ import { Text as f } from "@inubekit/text";
7
+ import { Toggle as J } from "@inubekit/toggle";
8
+ import { ValueHowToSetUp as b, ValueDataType as O, DecisionConditionRenderer as _ } from "@isettingkit/input";
9
+ import { Button as L } from "@inubekit/button";
10
+ import { object as K, string as H, number as $, mixed as q } from "yup";
11
+ import { Date as G } from "@inubekit/date";
12
12
  import { Checkbox as te } from "@inubekit/checkbox";
13
- import { inube as V } from "@inubekit/foundations";
14
- import x, { keyframes as K, css as W } from "styled-components";
15
- import { DecisionViewConditionRenderer as F } from "@isettingkit/view";
16
- import { MdOutlineEdit as ne, MdOutlineDelete as re } from "react-icons/md";
17
- import { Icon as G } from "@inubekit/icon";
18
- const P = (t) => {
19
- if ("value" in t && "valueUse" in t && t.value !== void 0) {
20
- const e = t.value, a = typeof e == "object" && "from" in e && typeof e.from == "number" ? e.from : 0, o = typeof e == "object" && "to" in e && typeof e.to == "number" ? e.to : 1 / 0;
21
- switch (t.valueUse) {
22
- case m.LIST_OF_VALUES:
13
+ import { inube as w } from "@inubekit/foundations";
14
+ import g, { keyframes as ne } from "styled-components";
15
+ import { DecisionViewConditionRenderer as z } from "@isettingkit/view";
16
+ import { SkeletonLine as V } from "@inubekit/skeleton";
17
+ import { MdOutlineEdit as re, MdOutlineDelete as ae, MdClear as ie, MdAdd as oe } from "react-icons/md";
18
+ import { Icon as F } from "@inubekit/icon";
19
+ import { createPortal as le } from "react-dom";
20
+ import { Blanket as de } from "@inubekit/blanket";
21
+ import { Grid as ce } from "@inubekit/grid";
22
+ import { useMediaQuery as se } from "@inubekit/hooks";
23
+ const B = (n) => {
24
+ if ("value" in n && "valueUse" in n && n.value !== void 0) {
25
+ const e = n.value, a = typeof e == "object" && "from" in e && typeof e.from == "number" ? e.from : 0, i = typeof e == "object" && "to" in e && typeof e.to == "number" ? e.to : 1 / 0;
26
+ switch (n.valueUse) {
27
+ case b.LIST_OF_VALUES:
23
28
  return {
24
- schema: H().test(
29
+ schema: q().test(
25
30
  "isArrayOrString",
26
31
  "Must be an array of strings/numbers or a single string",
27
- (l) => Array.isArray(l) ? l.every(
28
- (s) => typeof s == "string" || typeof s == "number"
29
- ) : typeof l == "string"
32
+ (d) => Array.isArray(d) ? d.every(
33
+ (u) => typeof u == "string" || typeof u == "number"
34
+ ) : typeof d == "string"
30
35
  ),
31
36
  value: e
32
37
  };
33
- case m.LIST_OF_VALUES_MULTI:
38
+ case b.LIST_OF_VALUES_MULTI:
34
39
  return {
35
- schema: H().test(
40
+ schema: q().test(
36
41
  "isArrayOrString",
37
42
  "Must be an array of strings/numbers or a single string",
38
- (l) => Array.isArray(l) ? l.every(
39
- (s) => typeof s == "string" || typeof s == "number"
40
- ) : typeof l == "string"
43
+ (d) => Array.isArray(d) ? d.every(
44
+ (u) => typeof u == "string" || typeof u == "number"
45
+ ) : typeof d == "string"
41
46
  ),
42
47
  value: e
43
48
  };
44
- case m.RANGE:
49
+ case b.RANGE:
45
50
  return {
46
- schema: J({
47
- from: N().required("Range From is required").max(o, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
48
- to: N().required("Range To is required").min(a, "'Range To' cannot be less than 'Range From'").min(0, "'Range To' cannot be less than 0")
51
+ schema: K({
52
+ from: $().required("Range From is required").max(i, "'Range From' cannot be greater than 'Range To'").min(0, "'Range From' cannot be less than 0"),
53
+ to: $().required("Range To is required").min(a, "'Range To' cannot be less than 'Range From'").min(0, "'Range To' cannot be less than 0")
49
54
  }),
50
55
  value: {
51
56
  from: a,
52
- to: o
57
+ to: i
53
58
  }
54
59
  };
55
- case m.GREATER_THAN:
56
- case m.LESS_THAN:
57
- case m.EQUAL:
58
- return t.dataType === I.PERCENTAGE ? {
59
- schema: N().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
60
+ case b.GREATER_THAN:
61
+ case b.LESS_THAN:
62
+ case b.EQUAL:
63
+ return n.dataType === O.PERCENTAGE ? {
64
+ schema: $().required("Percentage is required").min(0, "Percentage cannot be less than 0").max(100, "Percentage cannot be greater than 100"),
60
65
  value: e
61
66
  } : {
62
- schema: L().required("Required"),
67
+ schema: H().required("Required"),
63
68
  value: e
64
69
  };
65
70
  default:
66
71
  return {
67
- schema: L(),
72
+ schema: H(),
68
73
  value: void 0
69
74
  };
70
75
  }
71
76
  }
72
- }, ae = (t) => {
77
+ }, pe = (n) => {
73
78
  const e = {}, a = {};
74
- if (t) {
75
- const o = P(t);
76
- o && (e[t.name] = o.schema, a[t.name] = o.value);
79
+ if (n) {
80
+ const i = B(n);
81
+ i && (e[n.name] = i.schema, a[n.name] = i.value);
77
82
  }
78
- return t.conditions && t.conditions.forEach((o) => {
79
- const l = P(o);
80
- l && (e[o.name] = l.schema, a[o.name] = l.value);
81
- }), { validationSchema: J().shape(e), initialValues: a };
82
- }, M = (t) => {
83
- if (typeof t == "string")
84
- return t;
85
- if (typeof t == "object" && ("from" in t || "to" in t))
83
+ return n.conditions && n.conditions.forEach((i) => {
84
+ const d = B(i);
85
+ d && (e[i.name] = d.schema, a[i.name] = d.value);
86
+ }), { validationSchema: K().shape(e), initialValues: a };
87
+ }, U = (n) => {
88
+ if (typeof n == "string")
89
+ return n;
90
+ if (typeof n == "object" && ("from" in n || "to" in n))
86
91
  return {
87
- from: t.from || "",
88
- to: t.to || ""
92
+ from: n.from || "",
93
+ to: n.to || ""
89
94
  };
90
- for (const e in t)
91
- if (Object.prototype.hasOwnProperty.call(t, e)) {
92
- const a = M(t[e]);
95
+ for (const e in n)
96
+ if (Object.prototype.hasOwnProperty.call(n, e)) {
97
+ const a = U(n[e]);
93
98
  if (a) return a;
94
99
  }
95
100
  return "";
96
- }, oe = (t) => {
101
+ }, ue = (n) => {
97
102
  const {
98
103
  checked: e,
99
104
  children: a,
100
- handleToggleChange: o,
101
- id: l,
102
- labelToggle: s,
105
+ handleToggleChange: i,
106
+ id: d,
107
+ labelToggle: u,
103
108
  name: c,
104
- valueToggle: d = ""
105
- } = t, [g, h] = y(e), b = (f) => {
106
- h(f.target.checked), o(f);
109
+ valueToggle: s = ""
110
+ } = n, [x, m] = k(e), y = (h) => {
111
+ m(h.target.checked), i(h);
107
112
  };
108
- return Q(() => {
109
- h(e);
110
- }, [e]), /* @__PURE__ */ p(R, { children: [
111
- /* @__PURE__ */ n(u, { children: /* @__PURE__ */ n(
112
- Z,
113
+ return Z(() => {
114
+ m(e);
115
+ }, [e]), /* @__PURE__ */ p(A, { children: [
116
+ /* @__PURE__ */ t(l, { children: /* @__PURE__ */ t(
117
+ J,
113
118
  {
114
- checked: g,
115
- id: l,
119
+ checked: x,
120
+ id: d,
116
121
  margin: "10px",
117
122
  name: c,
118
- onChange: b,
123
+ onChange: y,
119
124
  size: "small",
120
- value: d,
121
- children: /* @__PURE__ */ n(D, { size: "medium", type: "label", weight: "bold", children: s })
125
+ value: s,
126
+ children: /* @__PURE__ */ t(f, { size: "medium", type: "label", weight: "bold", children: u })
122
127
  }
123
128
  ) }),
124
- g && /* @__PURE__ */ n(R, { children: a })
129
+ x && /* @__PURE__ */ t(A, { children: a })
125
130
  ] });
126
- }, ie = (t) => {
131
+ }, he = (n) => {
127
132
  const {
128
133
  onHandleStartChange: e,
129
134
  onHandleEndChange: a,
130
- labelStart: o,
131
- labelEnd: l,
132
- checkedClosed: s = !1,
135
+ labelStart: i,
136
+ labelEnd: d,
137
+ checkedClosed: u = !1,
133
138
  required: c = !1,
134
- valueStart: d = "",
135
- valueEnd: g = ""
136
- } = t, [h, b] = y(s), [f, E] = y(d), [w, S] = y(g);
137
- return /* @__PURE__ */ p(R, { children: [
138
- /* @__PURE__ */ p(u, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
139
- /* @__PURE__ */ n(u, { children: /* @__PURE__ */ n(
140
- D,
139
+ valueStart: s = "",
140
+ valueEnd: x = ""
141
+ } = n, [m, y] = k(u), [h, v] = k(s), [E, T] = k(x);
142
+ return /* @__PURE__ */ p(A, { children: [
143
+ /* @__PURE__ */ p(l, { direction: "row", justifyContent: "space-between", margin: "10px 0", children: [
144
+ /* @__PURE__ */ t(l, { children: /* @__PURE__ */ t(
145
+ f,
141
146
  {
142
147
  appearance: "gray",
143
148
  margin: "10px 0",
@@ -147,62 +152,62 @@ const P = (t) => {
147
152
  children: "Vigencia"
148
153
  }
149
154
  ) }),
150
- /* @__PURE__ */ n(
151
- u,
155
+ /* @__PURE__ */ t(
156
+ l,
152
157
  {
153
158
  alignContent: "center",
154
159
  justifyContent: "center",
155
160
  wrap: "wrap",
156
161
  gap: "4px",
157
- children: /* @__PURE__ */ n(
162
+ children: /* @__PURE__ */ t(
158
163
  te,
159
164
  {
160
165
  label: "Cerrada",
161
- onChange: ({ target: i }) => {
162
- b(i.checked);
166
+ onChange: ({ target: o }) => {
167
+ y(o.checked);
163
168
  },
164
- checked: h,
169
+ checked: m,
165
170
  value: ""
166
171
  }
167
172
  )
168
173
  }
169
174
  )
170
175
  ] }),
171
- /* @__PURE__ */ p(u, { justifyContent: "space-between", gap: "24px", children: [
172
- /* @__PURE__ */ n(u, { width: "189px", children: /* @__PURE__ */ n(
173
- q,
176
+ /* @__PURE__ */ p(l, { justifyContent: "space-between", gap: "24px", children: [
177
+ /* @__PURE__ */ t(l, { width: "189px", children: /* @__PURE__ */ t(
178
+ G,
174
179
  {
175
180
  id: "dateStart",
176
- label: o,
177
- onChange: (i) => {
178
- E(i.target.value), e(i);
181
+ label: i,
182
+ onChange: (o) => {
183
+ v(o.target.value), e(o);
179
184
  },
180
- value: f,
185
+ value: h,
181
186
  required: c,
182
187
  size: "compact"
183
188
  }
184
189
  ) }),
185
- h && /* @__PURE__ */ n(u, { width: "189px", children: /* @__PURE__ */ n(
186
- q,
190
+ m && /* @__PURE__ */ t(l, { width: "189px", children: /* @__PURE__ */ t(
191
+ G,
187
192
  {
188
193
  id: "dateEnd",
189
- label: l,
190
- onChange: (i) => {
191
- S(i.target.value), a(i);
194
+ label: d,
195
+ onChange: (o) => {
196
+ T(o.target.value), a(o);
192
197
  },
193
- value: w,
198
+ value: E,
194
199
  required: c,
195
200
  size: "compact"
196
201
  }
197
202
  ) })
198
203
  ] })
199
204
  ] });
200
- }, le = x.div`
205
+ }, ge = g.div`
201
206
  & > div {
202
207
  border-radius: 8px;
203
- border: 1px solid ${V.palette.neutral.N30};
208
+ border: 1px solid ${w.palette.neutral.N30};
204
209
  }
205
- `, de = x.div`
210
+ `, me = g.div`
206
211
  width: 100%;
207
212
  height: 100%;
208
213
  overflow-y: auto;
@@ -219,45 +224,45 @@ const P = (t) => {
219
224
  background-color: #ebecf0;
220
225
  border-radius: 8px;
221
226
  }
222
- `, ce = (t) => {
227
+ `, be = (n) => {
223
228
  const {
224
229
  decision: e,
225
230
  formik: a,
226
- onChangeCondition: o,
227
- onChangeDecision: l,
228
- onStartChange: s,
231
+ onChangeCondition: i,
232
+ onChangeDecision: d,
233
+ onStartChange: u,
229
234
  onEndChange: c,
230
- textValues: d,
231
- onCancel: g,
232
- onSubmit: h
233
- } = t, [b, f] = y(!0), [E] = y(!0), w = {
235
+ textValues: s,
236
+ onCancel: x,
237
+ onSubmit: m
238
+ } = n, [y, h] = k(!0), [v] = k(!0), E = {
234
239
  name: e.name,
235
240
  dataType: e.dataType,
236
241
  value: e.value,
237
242
  valueUse: e.valueUse,
238
243
  possibleValue: e.possibleValue
239
244
  };
240
- Q(() => {
245
+ Z(() => {
241
246
  console.log("Updated formik.errors in RulesFormUI:", a.errors);
242
247
  }, [a.errors]);
243
- const S = (r) => {
244
- f(r.target.checked);
245
- }, k = (r) => {
246
- const i = M(a.errors[r] || {});
247
- return typeof i == "string" ? i ? "invalid" : "pending" : i;
248
- }, T = (r) => {
249
- const i = M(a.errors[r] || {});
250
- return i;
248
+ const T = (r) => {
249
+ h(r.target.checked);
250
+ }, C = (r) => {
251
+ const o = U(a.errors[r] || {});
252
+ return typeof o == "string" ? o ? "invalid" : "pending" : o;
253
+ }, D = (r) => {
254
+ const o = U(a.errors[r] || {});
255
+ return o;
251
256
  };
252
- return /* @__PURE__ */ p(u, { direction: "column", gap: "24px", children: [
253
- e && /* @__PURE__ */ n(
254
- z,
257
+ return /* @__PURE__ */ p(l, { direction: "column", gap: "24px", children: [
258
+ e && /* @__PURE__ */ t(
259
+ _,
255
260
  {
256
- element: w,
257
- onDecision: l,
261
+ element: E,
262
+ onDecision: d,
258
263
  valueData: a.values[e.name],
259
264
  message: a.errors[e.name],
260
- status: k(e.name),
265
+ status: C(e.name),
261
266
  textValues: {
262
267
  selectOptions: "Select an option",
263
268
  selectOption: "Option selected",
@@ -266,34 +271,34 @@ const P = (t) => {
266
271
  }
267
272
  }
268
273
  ),
269
- /* @__PURE__ */ n(C, { dashed: !0 }),
270
- /* @__PURE__ */ n(le, { children: /* @__PURE__ */ n(de, { children: /* @__PURE__ */ p(
271
- u,
274
+ /* @__PURE__ */ t(S, { dashed: !0 }),
275
+ /* @__PURE__ */ t(ge, { children: /* @__PURE__ */ t(me, { children: /* @__PURE__ */ p(
276
+ l,
272
277
  {
273
278
  direction: "column",
274
279
  padding: "6px 12px",
275
280
  gap: "16px",
276
281
  height: "272px",
277
282
  children: [
278
- /* @__PURE__ */ p(u, { direction: "row", justifyContent: "space-between", children: [
279
- /* @__PURE__ */ n(D, { children: d.factsThatConditionIt }),
280
- /* @__PURE__ */ n(
281
- Z,
283
+ /* @__PURE__ */ p(l, { direction: "row", justifyContent: "space-between", children: [
284
+ /* @__PURE__ */ t(f, { children: s.factsThatConditionIt }),
285
+ /* @__PURE__ */ t(
286
+ J,
282
287
  {
283
288
  id: "toogleNone",
284
- onChange: S,
285
- checked: b,
289
+ onChange: T,
290
+ checked: y,
286
291
  size: "small",
287
- children: /* @__PURE__ */ n(D, { size: "medium", type: "label", weight: "bold", children: d.none })
292
+ children: /* @__PURE__ */ t(f, { size: "medium", type: "label", weight: "bold", children: s.none })
288
293
  }
289
294
  )
290
295
  ] }),
291
- /* @__PURE__ */ n(u, { direction: "column", gap: "20px", children: e.conditions && e.conditions.filter((r) => !r.hidden).map((r) => /* @__PURE__ */ n(
292
- oe,
296
+ /* @__PURE__ */ t(l, { direction: "column", gap: "20px", children: e.conditions && e.conditions.filter((r) => !r.hidden).map((r) => /* @__PURE__ */ t(
297
+ ue,
293
298
  {
294
- checked: !b,
295
- handleToggleChange: (i) => {
296
- i.target.checked || o(
299
+ checked: !y,
300
+ handleToggleChange: (o) => {
301
+ o.target.checked || i(
297
302
  {
298
303
  value: "",
299
304
  to: 0,
@@ -306,19 +311,19 @@ const P = (t) => {
306
311
  id: r.name.replace(" ", ""),
307
312
  labelToggle: r.name.split(/(?=[A-Z])/).join(" "),
308
313
  name: r.name.replace(" ", ""),
309
- children: /* @__PURE__ */ n(
310
- z,
314
+ children: /* @__PURE__ */ t(
315
+ _,
311
316
  {
312
317
  element: r,
313
- onDecision: o,
318
+ onDecision: i,
314
319
  valueData: a.values[r.name],
315
- message: T(r.name),
316
- status: k(r.name),
320
+ message: D(r.name),
321
+ status: C(r.name),
317
322
  textValues: {
318
323
  selectOptions: "Select an option",
319
324
  selectOption: "Option selected",
320
- rangeMin: (i) => `Minimum ${i}`,
321
- rangeMax: (i) => `Maximum ${i}`
325
+ rangeMin: (o) => `Minimum ${o}`,
326
+ rangeMax: (o) => `Maximum ${o}`
322
327
  },
323
328
  type: "condition"
324
329
  }
@@ -329,102 +334,102 @@ const P = (t) => {
329
334
  ]
330
335
  }
331
336
  ) }) }),
332
- /* @__PURE__ */ n(C, { dashed: !0 }),
333
- /* @__PURE__ */ n(u, { direction: "column", children: e && /* @__PURE__ */ n(
334
- ie,
337
+ /* @__PURE__ */ t(S, { dashed: !0 }),
338
+ /* @__PURE__ */ t(l, { direction: "column", children: e && /* @__PURE__ */ t(
339
+ he,
335
340
  {
336
- onHandleStartChange: (r) => s(r.target.value),
341
+ onHandleStartChange: (r) => u(r.target.value),
337
342
  onHandleEndChange: (r) => c(r.target.value),
338
- labelStart: d.termStart,
339
- labelEnd: d.termEnd,
343
+ labelStart: s.termStart,
344
+ labelEnd: s.termEnd,
340
345
  checkedClosed: !!e.endDate,
341
346
  valueStart: String(e.startDate),
342
347
  valueEnd: String(e.endDate) || ""
343
348
  }
344
349
  ) }),
345
- /* @__PURE__ */ n(C, {}),
346
- /* @__PURE__ */ p(u, { direction: "row", justifyContent: "end", gap: "16px", children: [
347
- /* @__PURE__ */ n(_, { appearance: "gray", onClick: g, children: d.cancel }),
348
- /* @__PURE__ */ n(
349
- _,
350
+ /* @__PURE__ */ t(S, {}),
351
+ /* @__PURE__ */ p(l, { direction: "row", justifyContent: "end", gap: "16px", children: [
352
+ /* @__PURE__ */ t(L, { appearance: "gray", onClick: x, children: s.cancel }),
353
+ /* @__PURE__ */ t(
354
+ L,
350
355
  {
351
- onClick: h,
352
- disabled: E || !a.isValid,
356
+ onClick: m,
357
+ disabled: v || !a.isValid,
353
358
  type: "submit",
354
- children: d.confirm
359
+ children: s.confirm
355
360
  }
356
361
  )
357
362
  ] })
358
363
  ] });
359
- }, Oe = (t) => {
360
- const { id: e, decision: a, onCancel: o, onSubmitEvent: l, textValues: s } = t, [c, d] = y(a), g = (r, i) => {
361
- k.setFieldValue(r, i), k.validateField(r);
362
- }, h = (r, i) => {
363
- const A = r instanceof Date ? r.toISOString() : r;
364
- d((O) => {
365
- if (!O.conditions)
366
- return O;
367
- const Y = O.conditions.map((U) => U.name === i ? { ...U, value: A } : U);
364
+ }, fe = (n) => {
365
+ const { id: e, decision: a, onCancel: i, onSubmitEvent: d, textValues: u } = n, [c, s] = k(a), x = (r, o) => {
366
+ C.setFieldValue(r, o), C.validateField(r);
367
+ }, m = (r, o) => {
368
+ const I = r instanceof Date ? r.toISOString() : r;
369
+ s((j) => {
370
+ if (!j.conditions)
371
+ return j;
372
+ const X = j.conditions.map((R) => R.name === o ? { ...R, value: I } : R);
368
373
  return {
369
- ...O,
370
- conditions: Y
374
+ ...j,
375
+ conditions: X
371
376
  };
372
- }), g(i, A);
373
- }, b = (r) => {
374
- d(
375
- (i) => T(i, "value", r)
377
+ }), x(o, I);
378
+ }, y = (r) => {
379
+ s(
380
+ (o) => D(o, "value", r)
376
381
  );
377
- }, f = (r) => {
378
- d(
379
- (i) => T(i, "endDate", r)
382
+ }, h = (r) => {
383
+ s(
384
+ (o) => D(o, "endDate", r)
380
385
  );
381
- }, E = (r) => {
382
- d(
383
- (i) => T(i, "startDate", r)
386
+ }, v = (r) => {
387
+ s(
388
+ (o) => D(o, "startDate", r)
384
389
  );
385
- }, { validationSchema: w, initialValues: S } = ae(c);
386
- w.validate(S, { abortEarly: !1 }).then(() => console.log("Validation passed")).catch((r) => console.log("Validation failed:", r.errors));
387
- const k = ee({
388
- initialValues: S,
389
- validationSchema: w,
390
+ }, { validationSchema: E, initialValues: T } = pe(c);
391
+ E.validate(T, { abortEarly: !1 }).then(() => console.log("Validation passed")).catch((r) => console.log("Validation failed:", r.errors));
392
+ const C = ee({
393
+ initialValues: T,
394
+ validationSchema: E,
390
395
  validateOnChange: !0,
391
396
  validateOnBlur: !0,
392
397
  onSubmit: () => {
393
- l(c);
398
+ d(c);
394
399
  }
395
- }), T = (r, i, A) => ({
400
+ }), D = (r, o, I) => ({
396
401
  ...r,
397
402
  ...r.decision,
398
- [i]: A
403
+ [o]: I
399
404
  });
400
- return /* @__PURE__ */ n(
401
- ce,
405
+ return /* @__PURE__ */ t(
406
+ be,
402
407
  {
403
408
  id: e,
404
- formik: k,
409
+ formik: C,
405
410
  decision: c,
406
- onCancel: o,
407
- onSubmit: () => l(c),
408
- onChangeCondition: h,
409
- onChangeDecision: b,
410
- onStartChange: E,
411
- onEndChange: f,
412
- textValues: s
411
+ onCancel: i,
412
+ onSubmit: () => d(c),
413
+ onChangeCondition: m,
414
+ onChangeDecision: y,
415
+ onStartChange: v,
416
+ onEndChange: h,
417
+ textValues: u
413
418
  }
414
419
  );
415
- }, j = (t) => {
416
- if (!t)
420
+ }, N = (n) => {
421
+ if (!n)
417
422
  return;
418
- const e = t.value;
423
+ const e = n.value;
419
424
  if (!e)
420
425
  return;
421
- if (((o) => typeof o == "object" && o !== null)(e))
422
- switch (t.valueUse) {
423
- case m.LIST_OF_VALUES_MULTI:
426
+ if (((i) => typeof i == "object" && i !== null)(e))
427
+ switch (n.valueUse) {
428
+ case b.LIST_OF_VALUES_MULTI:
424
429
  return e;
425
- case m.LIST_OF_VALUES:
430
+ case b.LIST_OF_VALUES:
426
431
  return e;
427
- case m.RANGE:
432
+ case b.RANGE:
428
433
  return {
429
434
  from: e.from,
430
435
  to: e.to
@@ -433,12 +438,12 @@ const P = (t) => {
433
438
  return e.value;
434
439
  }
435
440
  return e;
436
- }, B = x.div`
441
+ }, P = g.div`
437
442
  & > div {
438
443
  border-radius: 8px;
439
- border: 1px solid ${V.palette.neutral.N30};
444
+ border: 1px solid ${w.palette.neutral.N30};
440
445
  }
441
- `, X = x.div`
446
+ `, Q = g.div`
442
447
  width: 100%;
443
448
  height: 100%;
444
449
  overflow-y: auto;
@@ -456,201 +461,117 @@ const P = (t) => {
456
461
  background-color: #ebecf0;
457
462
  border-radius: 8px;
458
463
  }
459
- `, v = {
460
- background: {
461
- color: V.palette.neutral.N30
462
- },
463
- animation: {
464
- color: V.palette.neutral.N10
465
- }
466
- }, se = K`
467
- 0% {
468
- transform: translateX(-100%);
469
- }
470
- 100% {
471
- transform: translateX(100%);
472
- }
473
- `;
474
- x.div`
475
- position: relative;
476
- border-radius: 6px;
477
- overflow: hidden;
478
- width: ${({ $size: t }) => t};
479
- height: ${({ $size: t }) => t};
480
- background: ${({ theme: t }) => {
481
- var e, a;
482
- return ((a = (e = t == null ? void 0 : t.skeleton) == null ? void 0 : e.background) == null ? void 0 : a.color) || v.background.color;
483
- }};
484
-
485
- ${({ $animated: t }) => t && W`
486
- &::after {
487
- content: "";
488
- position: absolute;
489
- height: 100%;
490
- width: 100%;
491
- background: ${({ theme: e }) => {
492
- var a, o, l, s, c, d;
493
- return `linear-gradient(
494
- 100deg,
495
- ${((o = (a = e == null ? void 0 : e.skeleton) == null ? void 0 : a.background) == null ? void 0 : o.color) || v.background.color} 0%,
496
- ${((s = (l = e == null ? void 0 : e.skeleton) == null ? void 0 : l.animation) == null ? void 0 : s.color) || v.animation.color} 50%,
497
- ${((d = (c = e == null ? void 0 : e.skeleton) == null ? void 0 : c.background) == null ? void 0 : d.color) || v.background.color} 100%
498
- );`;
499
- }};
500
- animation: ${se} 2s linear infinite;
501
- }
502
- `}
503
- `;
504
- const ue = K`
505
- 0% {
506
- transform: translateX(-100%);
507
- }
508
- 100% {
509
- transform: translateX(100%);
510
- }
511
- `, pe = x.div`
512
- position: relative;
513
- border-radius: 6px;
514
- overflow: hidden;
515
- height: 16px;
516
- width: ${({ $width: t }) => t};
517
- background: ${({ theme: t }) => {
518
- var e, a;
519
- return ((a = (e = t == null ? void 0 : t.skeleton) == null ? void 0 : e.background) == null ? void 0 : a.color) || v.background.color;
520
- }};
521
-
522
- ${({ $animated: t }) => t && W`
523
- &::after {
524
- content: "";
525
- position: absolute;
526
- height: 100%;
527
- width: 100%;
528
- background: ${({ theme: e }) => {
529
- var a, o, l, s, c, d;
530
- return `linear-gradient(
531
- 100deg,
532
- ${((o = (a = e == null ? void 0 : e.skeleton) == null ? void 0 : a.background) == null ? void 0 : o.color) || v.background.color} 0%,
533
- ${((s = (l = e == null ? void 0 : e.skeleton) == null ? void 0 : l.animation) == null ? void 0 : s.color) || v.animation.color} 50%,
534
- ${((d = (c = e == null ? void 0 : e.skeleton) == null ? void 0 : c.background) == null ? void 0 : d.color) || v.background.color} 100%
535
- );`;
536
- }};
537
- animation: ${ue} 2s linear infinite;
538
- }
539
- `}
540
- `, $ = (t) => {
541
- const { width: e = "100%", animated: a = !1 } = t;
542
- return /* @__PURE__ */ n(pe, { $width: e, $animated: a });
543
- }, je = (t) => {
544
- const { decision: e, loading: a = !1, textValues: o } = t, l = (c) => c && Object.keys(c).length > 0, s = {
464
+ `, Y = (n) => {
465
+ const { decision: e, loading: a = !1, textValues: i } = n, d = (c) => c && Object.keys(c).length > 0, u = {
545
466
  name: (e == null ? void 0 : e.name) || "",
546
467
  dataType: (e == null ? void 0 : e.dataType) || "alphabetical",
547
- value: j(e),
468
+ value: N(e),
548
469
  valueUse: (e == null ? void 0 : e.valueUse) || "equal"
549
470
  };
550
- return !a && e && o ? /* @__PURE__ */ p(u, { direction: "column", gap: "12px", children: [
551
- e && /* @__PURE__ */ n(u, { direction: "column", alignItems: "center", children: /* @__PURE__ */ n(
552
- F,
471
+ return !a && e && i ? /* @__PURE__ */ p(l, { direction: "column", gap: "12px", children: [
472
+ e && /* @__PURE__ */ t(l, { direction: "column", alignItems: "center", children: /* @__PURE__ */ t(
473
+ z,
553
474
  {
554
- element: s,
555
- valueData: j(s),
475
+ element: u,
476
+ valueData: N(u),
556
477
  type: "decision"
557
478
  }
558
479
  ) }, e.name),
559
- /* @__PURE__ */ n(C, { dashed: !0 }),
560
- /* @__PURE__ */ n(X, { children: /* @__PURE__ */ p(
561
- u,
480
+ /* @__PURE__ */ t(S, { dashed: !0 }),
481
+ /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ p(
482
+ l,
562
483
  {
563
484
  direction: "column",
564
485
  gap: "12px",
565
486
  justifyContent: "space-between",
566
487
  height: "203px",
567
488
  children: [
568
- /* @__PURE__ */ n(
569
- D,
489
+ /* @__PURE__ */ t(
490
+ f,
570
491
  {
571
492
  type: "label",
572
493
  size: "large",
573
494
  appearance: "dark",
574
495
  weight: "bold",
575
496
  textAlign: "center",
576
- children: o.factsThatConditionIt
497
+ children: i.factsThatConditionIt
577
498
  }
578
499
  ),
579
500
  e.conditions && e.conditions.map((c) => {
580
501
  if (c.hidden) return null;
581
- const d = c.value;
582
- return (typeof d == "object" && l(d) || d) && /* @__PURE__ */ n(B, { children: /* @__PURE__ */ n(u, { direction: "column", padding: "8px", children: /* @__PURE__ */ n(
583
- F,
502
+ const s = c.value;
503
+ return (typeof s == "object" && d(s) || s) && /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(l, { direction: "column", padding: "8px", children: /* @__PURE__ */ t(
504
+ z,
584
505
  {
585
506
  element: {
586
507
  ...c,
587
- value: d
508
+ value: s
588
509
  },
589
- valueData: j(c)
510
+ valueData: N(c)
590
511
  }
591
512
  ) }) }, c.name);
592
513
  }),
593
- /* @__PURE__ */ n(C, { dashed: !0 }),
594
- /* @__PURE__ */ n(u, { direction: "column", gap: "12px", children: (e == null ? void 0 : e.startDate) && (e == null ? void 0 : e.endDate) && /* @__PURE__ */ n(
595
- F,
514
+ /* @__PURE__ */ t(S, { dashed: !0 }),
515
+ /* @__PURE__ */ t(l, { direction: "column", gap: "12px", children: (e == null ? void 0 : e.startDate) && (e == null ? void 0 : e.endDate) && /* @__PURE__ */ t(
516
+ z,
596
517
  {
597
518
  element: {
598
- name: o.terms,
519
+ name: i.terms,
599
520
  value: String(e.startDate),
600
- valueUse: m.RANGE,
601
- dataType: I.DATE
521
+ valueUse: b.RANGE,
522
+ dataType: O.DATE
602
523
  },
603
- valueData: j({
604
- name: o.terms,
524
+ valueData: N({
525
+ name: i.terms,
605
526
  value: {
606
527
  from: String(e.startDate),
607
528
  to: String(e.endDate)
608
529
  },
609
- valueUse: m.RANGE,
610
- dataType: I.DATE
530
+ valueUse: b.RANGE,
531
+ dataType: O.DATE
611
532
  }),
612
533
  type: "decision"
613
534
  },
614
- o.terms
535
+ i.terms
615
536
  ) })
616
537
  ]
617
538
  }
618
539
  ) })
619
- ] }) : /* @__PURE__ */ p(u, { direction: "column", gap: "12px", children: [
620
- /* @__PURE__ */ p(u, { direction: "column", alignItems: "center", gap: "4px", children: [
621
- /* @__PURE__ */ n($, { animated: !0, width: "180px" }),
622
- /* @__PURE__ */ n($, { animated: !0, width: "85px" })
540
+ ] }) : /* @__PURE__ */ p(l, { direction: "column", gap: "12px", children: [
541
+ /* @__PURE__ */ p(l, { direction: "column", alignItems: "center", gap: "4px", children: [
542
+ /* @__PURE__ */ t(V, { animated: !0, width: "180px" }),
543
+ /* @__PURE__ */ t(V, { animated: !0, width: "85px" })
623
544
  ] }, "loading"),
624
- /* @__PURE__ */ p(u, { direction: "column", gap: "12px", alignItems: "center", children: [
625
- /* @__PURE__ */ n(C, { dashed: !0 }),
626
- /* @__PURE__ */ n($, { animated: !0, width: "150px" })
545
+ /* @__PURE__ */ p(l, { direction: "column", gap: "12px", alignItems: "center", children: [
546
+ /* @__PURE__ */ t(S, { dashed: !0 }),
547
+ /* @__PURE__ */ t(V, { animated: !0, width: "150px" })
627
548
  ] }),
628
- /* @__PURE__ */ n(X, { children: /* @__PURE__ */ n(
629
- u,
549
+ /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(
550
+ l,
630
551
  {
631
552
  direction: "column",
632
553
  gap: "12px",
633
554
  justifyContent: "space-between",
634
555
  height: "203px",
635
- children: Array.from({ length: 5 }).map((c, d) => /* @__PURE__ */ n(B, { children: /* @__PURE__ */ p(
636
- u,
556
+ children: Array.from({ length: 5 }).map((c, s) => /* @__PURE__ */ t(P, { children: /* @__PURE__ */ p(
557
+ l,
637
558
  {
638
559
  direction: "column",
639
560
  gap: "12px",
640
561
  alignItems: "start",
641
562
  padding: "8px",
642
563
  children: [
643
- /* @__PURE__ */ n($, { animated: !0, width: "180px" }),
644
- /* @__PURE__ */ n($, { animated: !0, width: "85px" })
564
+ /* @__PURE__ */ t(V, { animated: !0, width: "180px" }),
565
+ /* @__PURE__ */ t(V, { animated: !0, width: "85px" })
645
566
  ]
646
567
  }
647
- ) }, `condition-${d}`))
568
+ ) }, `condition-${s}`))
648
569
  }
649
570
  ) })
650
571
  ] });
651
- }, me = x.div`
572
+ }, xe = g.div`
652
573
  border-radius: 8px;
653
- border: 1px solid ${V.palette.neutral.N30};
574
+ border: 1px solid ${w.palette.neutral.N30};
654
575
  box-sizing: border-box;
655
576
  display: flex;
656
577
  flex-direction: column;
@@ -660,7 +581,7 @@ const ue = K`
660
581
  height: 100%;
661
582
  box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
662
583
  `;
663
- x.div`
584
+ g.div`
664
585
  width: 100%;
665
586
  height: 100%;
666
587
  overflow-y: auto;
@@ -679,43 +600,342 @@ x.div`
679
600
  border-radius: 8px;
680
601
  }
681
602
  `;
682
- const Re = (t) => {
683
- const { children: e, controls: a = !0, handleDelete: o, handleView: l, id: s } = t;
684
- return /* @__PURE__ */ n(me, { children: /* @__PURE__ */ p(u, { direction: "column", gap: "16px", padding: "12px 16px", children: [
603
+ const M = (n) => {
604
+ const { children: e, controls: a = !0, handleDelete: i, handleView: d, id: u } = n;
605
+ return /* @__PURE__ */ t(xe, { children: /* @__PURE__ */ p(l, { direction: "column", gap: "16px", padding: "12px 16px", children: [
685
606
  e,
686
- a && /* @__PURE__ */ p(R, { children: [
687
- /* @__PURE__ */ n(C, {}),
688
- /* @__PURE__ */ p(u, { gap: "16px", justifyContent: "end", children: [
689
- /* @__PURE__ */ n(
690
- G,
607
+ a && /* @__PURE__ */ p(A, { children: [
608
+ /* @__PURE__ */ t(S, {}),
609
+ /* @__PURE__ */ p(l, { gap: "16px", justifyContent: "end", children: [
610
+ /* @__PURE__ */ t(
611
+ F,
691
612
  {
692
613
  appearance: "dark",
693
614
  size: "24px",
694
615
  cursorHover: !0,
695
- icon: /* @__PURE__ */ n(ne, {}),
616
+ icon: /* @__PURE__ */ t(re, {}),
696
617
  onClick: () => {
697
- l(s);
618
+ d(u);
698
619
  }
699
620
  }
700
621
  ),
701
- /* @__PURE__ */ n(
702
- G,
622
+ /* @__PURE__ */ t(
623
+ F,
703
624
  {
704
625
  cursorHover: !0,
705
626
  appearance: "dark",
706
627
  size: "24px",
707
- icon: /* @__PURE__ */ n(re, {}),
628
+ icon: /* @__PURE__ */ t(ae, {}),
708
629
  onClick: () => {
709
- o(s);
630
+ i(u);
710
631
  }
711
632
  }
712
633
  )
713
634
  ] })
714
635
  ] })
715
636
  ] }) });
637
+ }, ye = g.div`
638
+ position: relative;
639
+ & > div {
640
+ padding: 24px 16px;
641
+ }
642
+ `, ve = g.div`
643
+ background-color: ${({ theme: n }) => {
644
+ var e, a;
645
+ return ((a = (e = n == null ? void 0 : n.palette) == null ? void 0 : e.neutral) == null ? void 0 : a.N0) || w.palette.neutral.N0;
646
+ }};
647
+ max-width: 450px;
648
+ max-height: 90vh;
649
+ overflow-y: hidden;
650
+ border-radius: 8px;
651
+ transition: overflow-y 0.3s ease-in-out;
652
+ & > div {
653
+ padding: 24px;
654
+ }
655
+
656
+ &:hover {
657
+ overflow-y: auto;
658
+ }
659
+
660
+ &::-webkit-scrollbar {
661
+ width: 4px;
662
+ }
663
+
664
+ &::-webkit-scrollbar-thumb {
665
+ background-color: #c1c7d0;
666
+ border-radius: 8px;
667
+ }
668
+
669
+ &::-webkit-scrollbar-track {
670
+ background-color: #ebecf0;
671
+ border-radius: 8px;
672
+ }
673
+ `, we = (n) => {
674
+ const { children: e, portalId: a, onCloseModal: i, title: d } = n, u = document.getElementById(a);
675
+ if (!u)
676
+ throw new Error(
677
+ "The portal node is not defined. This can occur when the specific node used to render the portal has not been defined correctly."
678
+ );
679
+ return le(
680
+ /* @__PURE__ */ t(ye, { children: /* @__PURE__ */ t(de, { children: /* @__PURE__ */ t(ve, { children: /* @__PURE__ */ p(l, { direction: "column", gap: "24px", children: [
681
+ /* @__PURE__ */ t(l, { direction: "column", gap: "24px", children: /* @__PURE__ */ p(l, { alignItems: "center", justifyContent: "space-between", children: [
682
+ /* @__PURE__ */ t(f, { type: "title", size: "large", appearance: "dark", weight: "bold", children: d }),
683
+ /* @__PURE__ */ t(ie, { size: "24px", cursor: "pointer", onClick: i })
684
+ ] }) }),
685
+ e
686
+ ] }) }) }) }),
687
+ u
688
+ );
689
+ }, Ce = ne`
690
+ from {
691
+ opacity: 0;
692
+ transform: translateY(20px);
693
+ }
694
+ to {
695
+ opacity: 1;
696
+ transform: translateY(0);
697
+ }
698
+ `, W = g.div`
699
+ width: 100%;
700
+ height: 100%;
701
+ & > div {
702
+ animation: ${Ce} 600ms ease-out;
703
+ }
704
+ `;
705
+ g.div`
706
+ border-radius: 8px;
707
+ border: 1px solid ${w.palette.neutral.N30};
708
+ box-sizing: border-box;
709
+ display: flex;
710
+ flex-direction: column;
711
+ // height: 364px;
712
+ // width: 332px;
713
+ width: 100%;
714
+ height: 100%;
715
+ box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
716
+ `;
717
+ const ke = g.div`
718
+ & > div {
719
+ width: 100%;
720
+ height: 100%;
721
+ overflow-y: auto;
722
+
723
+ &::-webkit-scrollbar {
724
+ width: 8px;
725
+ }
726
+
727
+ &::-webkit-scrollbar-thumb {
728
+ background-color: #c1c7d0;
729
+ border-radius: 8px;
730
+ }
731
+
732
+ &::-webkit-scrollbar-track {
733
+ background-color: #ebecf0;
734
+ border-radius: 8px;
735
+ }
736
+ }
737
+ `, Se = g.div`
738
+ & > div > div {
739
+ border-radius: 8px;
740
+ border: 1px solid ${w.palette.neutral.N30};
741
+ box-sizing: border-box;
742
+ box-shadow: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
743
+ }
744
+ `, Ee = g.div`
745
+ & > div {
746
+ background-color: ${w.palette.neutral.N30};
747
+ justify-content: center;
748
+ }
749
+ min-height: 300px;
750
+ width: 100%;
751
+ height: 100%;
752
+ padding-bottom: 12px;
753
+ `;
754
+ g.div`
755
+ & > div {
756
+ border-radius: 8px;
757
+ border: 1px solid ${w.palette.neutral.N30};
758
+ }
759
+ `;
760
+ const Ye = ({
761
+ decisions: n,
762
+ textValues: e,
763
+ decisionTemplate: a,
764
+ isModalOpen: i,
765
+ selectedDecision: d,
766
+ loading: u,
767
+ handleOpenModal: c,
768
+ handleCloseModal: s,
769
+ handleSubmitForm: x,
770
+ handleDelete: m
771
+ }) => {
772
+ const y = se("(max-width: 681px)");
773
+ return /* @__PURE__ */ p(A, { children: [
774
+ /* @__PURE__ */ t(Se, { children: /* @__PURE__ */ t(ke, { children: /* @__PURE__ */ p(l, { direction: "column", gap: "16px", padding: "6px", children: [
775
+ n.length === 0 && /* @__PURE__ */ p(f, { as: "span", type: "label", size: "large", appearance: "gray", children: [
776
+ "Aún no tienes definidas tasas de interés efectivas. Presiona",
777
+ " ",
778
+ /* @__PURE__ */ t(
779
+ f,
780
+ {
781
+ as: "span",
782
+ type: "label",
783
+ size: "large",
784
+ appearance: "gray",
785
+ weight: "bold",
786
+ children: "“+ Agregar decisión”"
787
+ }
788
+ ),
789
+ " ",
790
+ "para empezar."
791
+ ] }),
792
+ /* @__PURE__ */ p(
793
+ ce,
794
+ {
795
+ templateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
796
+ autoFlow: "row dense",
797
+ gap: "24px",
798
+ alignItems: "start",
799
+ justifyContent: "center",
800
+ autoRows: "1fr",
801
+ justifyItems: "center",
802
+ padding: "6px",
803
+ height: y ? "auto" : "484px",
804
+ children: [
805
+ u ? Array.from({ length: 3 }).map((h, v) => /* @__PURE__ */ t(
806
+ M,
807
+ {
808
+ id: `loading-card-${v}`,
809
+ handleDelete: () => {
810
+ },
811
+ handleView: () => c(),
812
+ controls: !1,
813
+ children: /* @__PURE__ */ t(Y, { loading: !0 })
814
+ },
815
+ `loading-card-${v}`
816
+ )) : n.map((h) => /* @__PURE__ */ t(W, { children: /* @__PURE__ */ p(
817
+ l,
818
+ {
819
+ direction: "column",
820
+ gap: "4px",
821
+ width: "100%",
822
+ padding: "0 0 12px 0",
823
+ children: [
824
+ /* @__PURE__ */ t(
825
+ f,
826
+ {
827
+ type: "title",
828
+ size: "medium",
829
+ appearance: "gray",
830
+ weight: "bold",
831
+ children: h.id
832
+ }
833
+ ),
834
+ /* @__PURE__ */ t(
835
+ M,
836
+ {
837
+ id: h.id,
838
+ handleDelete: () => m(h.id),
839
+ handleView: () => c(h),
840
+ children: /* @__PURE__ */ t(
841
+ Y,
842
+ {
843
+ decision: h,
844
+ textValues: e
845
+ }
846
+ )
847
+ }
848
+ )
849
+ ]
850
+ },
851
+ h.id
852
+ ) }, h.id)),
853
+ (n.length === 0 || n.length < Math.floor(window.innerWidth / 300)) && !u && /* @__PURE__ */ t(W, { children: /* @__PURE__ */ p(
854
+ l,
855
+ {
856
+ direction: "column",
857
+ gap: "4px",
858
+ width: "100%",
859
+ height: "100%",
860
+ children: [
861
+ /* @__PURE__ */ t(
862
+ f,
863
+ {
864
+ type: "title",
865
+ size: "medium",
866
+ appearance: "gray",
867
+ weight: "bold",
868
+ children: "Nueva decisión"
869
+ }
870
+ ),
871
+ /* @__PURE__ */ t(
872
+ Ee,
873
+ {
874
+ onClick: () => c(),
875
+ children: /* @__PURE__ */ t(
876
+ M,
877
+ {
878
+ id: `add-decision-${n.length}`,
879
+ handleDelete: () => {
880
+ },
881
+ handleView: () => c(),
882
+ controls: !1,
883
+ children: /* @__PURE__ */ p(
884
+ l,
885
+ {
886
+ direction: "column",
887
+ gap: "12px",
888
+ alignItems: "center",
889
+ children: [
890
+ /* @__PURE__ */ t(
891
+ F,
892
+ {
893
+ appearance: "gray",
894
+ icon: /* @__PURE__ */ t(oe, {}),
895
+ size: "35px"
896
+ }
897
+ ),
898
+ /* @__PURE__ */ t(f, { appearance: "gray", type: "body", size: "large", children: "Agregar decisión" })
899
+ ]
900
+ }
901
+ )
902
+ }
903
+ )
904
+ }
905
+ )
906
+ ]
907
+ },
908
+ `add-decision-${n.length}`
909
+ ) }, `add-decision-${n.length}`)
910
+ ]
911
+ }
912
+ )
913
+ ] }) }) }),
914
+ i && /* @__PURE__ */ t(
915
+ we,
916
+ {
917
+ portalId: "modal-portal",
918
+ onCloseModal: s,
919
+ title: d ? "Editar Decisión" : "Nueva decisión",
920
+ children: /* @__PURE__ */ t(
921
+ fe,
922
+ {
923
+ id: d ? d.id : `decision-${n.length + 1}`,
924
+ decision: d || a,
925
+ onCloseModal: s,
926
+ onSubmitEvent: x,
927
+ textValues: e,
928
+ onCancel: () => s()
929
+ }
930
+ )
931
+ }
932
+ )
933
+ ] });
716
934
  };
717
935
  export {
718
- Re as BusinessRuleCard,
719
- je as BusinessRuleView,
720
- Oe as RulesForm
936
+ M as BusinessRuleCard,
937
+ Y as BusinessRuleView,
938
+ Ye as BusinessRules,
939
+ we as ModalRules,
940
+ fe as RulesForm
721
941
  };
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "description": "",
12
12
  "private": false,
13
- "version": "0.1.21",
13
+ "version": "0.1.22",
14
14
  "type": "module",
15
15
  "exports": {
16
16
  ".": {