@viamedici-spc/configurator-react 0.1.0 → 0.1.1

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.js CHANGED
@@ -1,543 +1,762 @@
1
- import { Eq as f, Str as g, O as s, RA as o, RR as J, pipe as r, flow as W, some as U, none as I, identity as he, constVoid as Se } from "@viamedici/fp-ts-extensions";
2
- import { match as ye } from "ts-pattern";
3
- import { deepEqual as $ } from "fast-equals";
4
- import { createContext as D, useContext as N, useMemo as m, useEffect as L } from "react";
5
- import { jsx as x, Fragment as Ee } from "react/jsx-runtime";
6
- import { createMachine as H, assign as p, sendParent as ee, spawn as Q, forwardTo as R, send as be } from "xstate";
7
- import { log as C, pure as qe, stop as X } from "xstate/lib/actions";
8
- import { eqNullable as F } from "@viamedici/fp-ts-extensions/Eq";
9
- import { useMachine as Pe } from "@xstate/react";
1
+ import "ts-pattern";
2
+ import { deepEqual as ge } from "fast-equals";
3
+ import { createContext as $, useContext as B, useMemo as m, useEffect as re } from "react";
4
+ import { jsx as k, Fragment as We } from "react/jsx-runtime";
5
+ import { createMachine as ne, assign as C, sendParent as de, spawn as ae, forwardTo as F, send as Ge } from "xstate";
6
+ import { log as S, pure as Ke, stop as ue } from "xstate/lib/actions";
7
+ import { useMachine as Qe } from "@xstate/react";
8
+ var Xe = globalThis && globalThis.__spreadArray || function(e, n, t) {
9
+ if (t || arguments.length === 2)
10
+ for (var i = 0, o = n.length, s; i < o; i++)
11
+ (s || !(i in n)) && (s || (s = Array.prototype.slice.call(n, 0, i)), s[i] = n[i]);
12
+ return e.concat(s || Array.prototype.slice.call(n));
13
+ };
14
+ function O(e) {
15
+ return e;
16
+ }
17
+ function pe(e) {
18
+ return function() {
19
+ return e;
20
+ };
21
+ }
22
+ var Ye = /* @__PURE__ */ pe(null), Ce = /* @__PURE__ */ pe(void 0), Je = Ce;
23
+ function he(e, n, t, i, o, s, a, c, u) {
24
+ switch (arguments.length) {
25
+ case 1:
26
+ return e;
27
+ case 2:
28
+ return function() {
29
+ return n(e.apply(this, arguments));
30
+ };
31
+ case 3:
32
+ return function() {
33
+ return t(n(e.apply(this, arguments)));
34
+ };
35
+ case 4:
36
+ return function() {
37
+ return i(t(n(e.apply(this, arguments))));
38
+ };
39
+ case 5:
40
+ return function() {
41
+ return o(i(t(n(e.apply(this, arguments)))));
42
+ };
43
+ case 6:
44
+ return function() {
45
+ return s(o(i(t(n(e.apply(this, arguments))))));
46
+ };
47
+ case 7:
48
+ return function() {
49
+ return a(s(o(i(t(n(e.apply(this, arguments)))))));
50
+ };
51
+ case 8:
52
+ return function() {
53
+ return c(a(s(o(i(t(n(e.apply(this, arguments))))))));
54
+ };
55
+ case 9:
56
+ return function() {
57
+ return u(c(a(s(o(i(t(n(e.apply(this, arguments)))))))));
58
+ };
59
+ }
60
+ }
61
+ function r(e, n, t, i, o, s, a, c, u) {
62
+ switch (arguments.length) {
63
+ case 1:
64
+ return e;
65
+ case 2:
66
+ return n(e);
67
+ case 3:
68
+ return t(n(e));
69
+ case 4:
70
+ return i(t(n(e)));
71
+ case 5:
72
+ return o(i(t(n(e))));
73
+ case 6:
74
+ return s(o(i(t(n(e)))));
75
+ case 7:
76
+ return a(s(o(i(t(n(e))))));
77
+ case 8:
78
+ return c(a(s(o(i(t(n(e)))))));
79
+ case 9:
80
+ return u(c(a(s(o(i(t(n(e))))))));
81
+ default: {
82
+ for (var d = arguments[0], p = 1; p < arguments.length; p++)
83
+ d = arguments[p](d);
84
+ return d;
85
+ }
86
+ }
87
+ }
88
+ var te = function(e, n) {
89
+ var t = typeof e == "number" ? function(i) {
90
+ return i.length >= e;
91
+ } : e;
92
+ return function() {
93
+ var i = Array.from(arguments);
94
+ return t(arguments) ? n.apply(this, i) : function(o) {
95
+ return n.apply(void 0, Xe([o], i, !1));
96
+ };
97
+ };
98
+ };
10
99
  globalThis && globalThis.__spreadArray;
11
- var ve = function(e) {
100
+ var me = function(e) {
12
101
  return e._tag === "Some";
102
+ }, Se = { _tag: "None" }, ye = function(e) {
103
+ return { _tag: "Some", value: e };
104
+ }, Le = function(e) {
105
+ return e.length > 0;
106
+ }, Ze = [], en = Object.prototype.hasOwnProperty;
107
+ function nn(e) {
108
+ return function(n, t) {
109
+ return e.chain(n, function(i) {
110
+ return e.map(t(i), function() {
111
+ return i;
112
+ });
113
+ });
114
+ };
115
+ }
116
+ var E = function(e) {
117
+ return {
118
+ equals: function(n, t) {
119
+ return n === t || e(n, t);
120
+ }
121
+ };
122
+ }, M = function(e) {
123
+ return E(function(n, t) {
124
+ for (var i in e)
125
+ if (!e[i].equals(n[i], t[i]))
126
+ return !1;
127
+ return !0;
128
+ });
129
+ }, ve = {
130
+ equals: function(e, n) {
131
+ return e === n;
132
+ }
133
+ };
134
+ ve.equals;
135
+ var y = Se, q = ye;
136
+ function j(e) {
137
+ return function(n) {
138
+ return e(n) ? q(n) : y;
139
+ };
140
+ }
141
+ var tn = function(e, n) {
142
+ return r(e, A(n));
143
+ }, on = function(e, n) {
144
+ return r(e, an(n));
145
+ }, sn = "Option", rn = function(e) {
146
+ return {
147
+ equals: function(n, t) {
148
+ return n === t || (v(n) ? v(t) : v(t) ? !1 : e.equals(n.value, t.value));
149
+ }
150
+ };
151
+ }, A = function(e) {
152
+ return function(n) {
153
+ return v(n) ? y : q(e(n.value));
154
+ };
155
+ }, an = function(e) {
156
+ return function(n) {
157
+ return v(n) || v(e) ? y : q(n.value(e.value));
158
+ };
159
+ }, Ee = /* @__PURE__ */ te(2, function(e, n) {
160
+ return v(e) ? y : n(e.value);
161
+ }), un = {
162
+ URI: sn,
163
+ map: tn,
164
+ ap: on,
165
+ chain: Ee
166
+ }, R = function(e) {
167
+ return function(n) {
168
+ return v(n) ? y : e(n.value) ? n : y;
169
+ };
170
+ }, v = function(e) {
171
+ return e._tag === "None";
172
+ }, cn = function(e, n) {
173
+ return function(t) {
174
+ return v(t) ? e() : n(t.value);
175
+ };
176
+ }, ie = cn, ln = function(e) {
177
+ return function(n) {
178
+ return v(n) ? e() : n.value;
179
+ };
180
+ }, D = ln, fn = /* @__PURE__ */ te(2, nn(un)), l = function(e) {
181
+ return e == null ? y : q(e);
182
+ }, V = /* @__PURE__ */ ie(Ye, O), b = /* @__PURE__ */ ie(Ce, O), gn = Ee, dn = fn;
183
+ globalThis && globalThis.__spreadArray;
184
+ var pn = Ze, Cn = Le;
185
+ globalThis && globalThis.__spreadArray;
186
+ var hn = function(e) {
187
+ return e.length === 0;
188
+ }, Ae = Cn, mn = function(e) {
189
+ return function(n) {
190
+ if (hn(n))
191
+ return vn;
192
+ for (var t = [], i = 0; i < n.length; i++)
193
+ t.push.apply(t, e(i, n[i]));
194
+ return t;
195
+ };
196
+ };
197
+ function Pe(e) {
198
+ return function(n) {
199
+ for (var t = 0; t < n.length; t++)
200
+ if (e(n[t]))
201
+ return ye(n[t]);
202
+ return Se;
203
+ };
204
+ }
205
+ var Sn = function(e, n, t) {
206
+ for (var i = [], o = Math.min(e.length, n.length), s = 0; s < o; s++)
207
+ i[s] = t(e[s], n[s]);
208
+ return i;
13
209
  };
14
- function w(e) {
210
+ function Me(e, n) {
211
+ return n === void 0 ? function(t) {
212
+ return Me(t, e);
213
+ } : Sn(e, n, function(t, i) {
214
+ return [t, i];
215
+ });
216
+ }
217
+ var qe = /* @__PURE__ */ te(2, function(e, n) {
218
+ return r(e, mn(function(t, i) {
219
+ return n(i, t);
220
+ }));
221
+ }), Re = /* @__PURE__ */ qe(O), P = function(e) {
222
+ return function(n) {
223
+ return n.map(function(t) {
224
+ return e(t);
225
+ });
226
+ };
227
+ }, h = function(e) {
228
+ return function(n) {
229
+ return n.filter(e);
230
+ };
231
+ }, yn = function(e) {
232
+ return function(n) {
233
+ for (var t = [], i = 0; i < n.length; i++) {
234
+ var o = e(i, n[i]);
235
+ me(o) && t.push(o.value);
236
+ }
237
+ return t;
238
+ };
239
+ }, U = function(e) {
240
+ return yn(function(n, t) {
241
+ return e(t);
242
+ });
243
+ }, Y = /* @__PURE__ */ U(O), H = function(e) {
244
+ return E(function(n, t) {
245
+ return n.length === t.length && n.every(function(i, o) {
246
+ return e.equals(i, t[o]);
247
+ });
248
+ });
249
+ }, vn = pn;
250
+ function En(e) {
251
+ return function(n) {
252
+ return n.every(e);
253
+ };
254
+ }
255
+ var An = qe, g = {
256
+ equals: function(e, n) {
257
+ return e === n;
258
+ }
259
+ };
260
+ g.equals;
261
+ function Ue(e) {
262
+ return function(n, t) {
263
+ if (t === void 0) {
264
+ var i = Ue(e);
265
+ return function(s) {
266
+ return i(s, n);
267
+ };
268
+ }
269
+ for (var o in n)
270
+ if (!en.call(t, o) || !e.equals(n[o], t[o]))
271
+ return !1;
272
+ return !0;
273
+ };
274
+ }
275
+ function xe(e) {
276
+ var n = Ue(e);
277
+ return E(function(t, i) {
278
+ return n(t)(i) && n(i)(t);
279
+ });
280
+ }
281
+ function W(e) {
15
282
  return {
16
283
  equals(n, t) {
17
284
  return n == null && t == null ? !0 : n == null || t === null || t === void 0 ? !1 : e.equals(n, t);
18
285
  }
19
286
  };
20
287
  }
21
- function q(e) {
288
+ function _(e) {
22
289
  return {
23
290
  equals(n, t) {
24
- const i = r(s.fromNullable(n), s.getOrElse(() => [])), a = r(s.fromNullable(t), s.getOrElse(() => []));
25
- return o.getEq(e).equals(i, a);
291
+ const i = r(l(n), D(() => [])), o = r(l(t), D(() => []));
292
+ return H(e).equals(i, o);
26
293
  }
27
294
  };
28
295
  }
29
- const V = f.struct({
30
- localId: g.Eq,
31
- componentPath: q(g.Eq),
32
- sharedConfigurationModel: w(g.Eq)
33
- }), Ae = s.getEq(o.getEq(f.struct({
34
- attributeId: V,
35
- decisions: q(V)
296
+ const ce = M({
297
+ localId: g,
298
+ componentPath: _(g),
299
+ sharedConfigurationModel: W(g)
300
+ }), Pn = rn(H(M({
301
+ attributeId: ce,
302
+ decisions: _(ce)
36
303
  })));
37
- f.struct({
38
- configurationModelSource: f.fromEquals((e, n) => $(e, n)),
39
- decisionsToRespect: Ae,
40
- usageRuleParameters: J.getEq(g.Eq)
304
+ M({
305
+ configurationModelSource: E((e, n) => ge(e, n)),
306
+ decisionsToRespect: Pn,
307
+ usageRuleParameters: xe(g)
41
308
  });
42
- const xe = {
43
- equals: (e, n) => e.choiceValueId !== n.choiceValueId ? !1 : e.state === n.state
44
- }, Me = {
45
- equals(e, n) {
46
- return e.value === n.value;
47
- }
48
- }, Re = {
49
- equals(e, n) {
50
- return e.value === n.value;
51
- }
52
- }, Ue = {
53
- equals(e, n) {
54
- return e.state === n.state;
55
- }
56
- }, Ie = {
57
- equals(e, n) {
58
- return V.equals(e.attributeId, n.attributeId) ? ye({ x: e, y: n }).with({
59
- x: {
60
- type: "Choice"
61
- /* Choice */
62
- },
63
- y: {
64
- type: "Choice"
65
- /* Choice */
66
- }
67
- }, (t, i) => xe.equals(i.x, i.y)).with({
68
- x: {
69
- type: "Numeric"
70
- /* Numeric */
71
- },
72
- y: {
73
- type: "Numeric"
74
- /* Numeric */
75
- }
76
- }, (t, i) => Me.equals(i.x, i.y)).with({
77
- x: {
78
- type: "Boolean"
79
- /* Boolean */
80
- },
81
- y: {
82
- type: "Boolean"
83
- /* Boolean */
84
- }
85
- }, (t, i) => Re.equals(i.x, i.y)).with({
86
- x: {
87
- type: "Component"
88
- /* Component */
89
- },
90
- y: {
91
- type: "Component"
92
- /* Component */
93
- }
94
- }, (t, i) => Ue.equals(i.x, i.y)).otherwise(() => !1) : !1;
95
- }
96
- };
97
- o.getEq(Ie);
98
- const ne = f.struct({
99
- localId: g.Eq,
100
- componentPath: q(g.Eq),
101
- sharedConfigurationModelId: w(g.Eq)
102
- }), De = f.struct({
103
- localId: g.Eq,
104
- componentPath: q(g.Eq),
105
- sharedConfigurationModelId: w(g.Eq)
309
+ const Ie = M({
310
+ localId: g,
311
+ componentPath: _(g),
312
+ sharedConfigurationModelId: W(g)
313
+ }), Mn = M({
314
+ localId: g,
315
+ componentPath: _(g),
316
+ sharedConfigurationModelId: W(g)
106
317
  });
107
- var j = /* @__PURE__ */ ((e) => (e.Choice = "Choice", e.ChoiceValue = "ChoiceValue", e))(j || {}), d = /* @__PURE__ */ ((e) => (e.Boolean = "Boolean", e.Numeric = "Numeric", e.Choice = "Choice", e.Component = "Component", e))(d || {}), k = /* @__PURE__ */ ((e) => (e.Implicit = "Implicit", e.Explicit = "Explicit", e))(k || {});
108
- f.struct({
109
- localId: g.Eq,
110
- componentPath: q(g.Eq),
111
- sharedConfigurationModelId: w(g.Eq)
318
+ var Z = /* @__PURE__ */ ((e) => (e.Choice = "Choice", e.ChoiceValue = "ChoiceValue", e))(Z || {}), f = /* @__PURE__ */ ((e) => (e.Boolean = "Boolean", e.Numeric = "Numeric", e.Choice = "Choice", e.Component = "Component", e))(f || {}), G = /* @__PURE__ */ ((e) => (e.Implicit = "Implicit", e.Explicit = "Explicit", e))(G || {});
319
+ M({
320
+ localId: g,
321
+ componentPath: _(g),
322
+ sharedConfigurationModelId: W(g)
112
323
  });
113
- function Ne(e, n) {
324
+ function qn(e, n) {
114
325
  return r(
115
326
  e.values,
116
- o.filterMap((t) => r(
327
+ U((t) => r(
117
328
  t.decision,
118
- s.fromNullable,
119
- s.filter((i) => i.kind === n)
329
+ l,
330
+ R((i) => i.kind === n)
120
331
  ))
121
332
  );
122
333
  }
123
- function we(e) {
334
+ function Rn(e) {
124
335
  return r(
125
336
  e.decision,
126
- s.fromNullable,
127
- s.filter((n) => n.kind === k.Explicit),
128
- s.toNullable
337
+ l,
338
+ R((n) => n.kind === G.Explicit),
339
+ V
129
340
  );
130
341
  }
131
- function ke(e) {
342
+ function Un(e) {
132
343
  return r(
133
344
  e.decision,
134
- s.fromNullable,
135
- s.filter((n) => n.kind === k.Explicit),
136
- s.toNullable
345
+ l,
346
+ R((n) => n.kind === G.Explicit),
347
+ V
137
348
  );
138
349
  }
139
- function Oe(e) {
350
+ function xn(e) {
140
351
  return r(
141
352
  e.decision,
142
- s.fromNullable,
143
- s.toNullable
353
+ l,
354
+ V
144
355
  );
145
356
  }
146
- const te = (e) => e.type === d.Boolean, ie = (e) => e.type === d.Choice, se = (e) => e.type === d.Numeric, oe = (e) => e.type === d.Component, _e = q(g.Eq);
147
- function ze(e, n, t) {
357
+ const De = (e) => e.type === f.Boolean, be = (e) => e.type === f.Choice, _e = (e) => e.type === f.Numeric, we = (e) => e.type === f.Component, In = _(g);
358
+ function Dn(e, n, t) {
148
359
  var i;
149
- const a = ((i = n.componentPath) == null ? void 0 : i.length) ?? 0;
150
- return r(e, o.filter((l) => {
151
- var c;
152
- const h = ((c = l.id.componentPath) == null ? void 0 : c.length) ?? 0;
153
- return t ? a > h ? !1 : r(
154
- l.id.componentPath ?? [],
155
- o.zip(n.componentPath ?? []),
156
- o.every(([u, S]) => u === S)
157
- ) : _e.equals(l.id.componentPath, n.componentPath);
360
+ const o = ((i = n.componentPath) == null ? void 0 : i.length) ?? 0;
361
+ return r(e, h((s) => {
362
+ var a;
363
+ const c = ((a = s.id.componentPath) == null ? void 0 : a.length) ?? 0;
364
+ return t ? o > c ? !1 : r(
365
+ s.id.componentPath ?? [],
366
+ Me(n.componentPath ?? []),
367
+ En(([u, d]) => u === d)
368
+ ) : In.equals(s.id.componentPath, n.componentPath);
158
369
  }));
159
370
  }
160
- function Te(e, n, t) {
371
+ function bn(e, n, t) {
161
372
  return [];
162
373
  }
163
- function Be(e) {
164
- return r(e, o.filter((n) => {
374
+ function _n(e) {
375
+ return r(e, h((n) => {
165
376
  const t = r(
166
377
  n.id.componentPath,
167
- s.fromNullable,
168
- s.map((a) => a.length === 0),
169
- s.getOrElse(() => !0)
378
+ l,
379
+ A((o) => o.length === 0),
380
+ D(() => !0)
170
381
  ), i = r(
171
382
  n.id.sharedConfigurationModelId,
172
- s.fromNullable,
173
- s.match(() => !0, () => !1)
383
+ l,
384
+ ie(() => !0, () => !1)
174
385
  );
175
386
  return t && i;
176
387
  }));
177
388
  }
178
- function Fe(e, n) {
389
+ function wn(e, n) {
179
390
  return r(
180
- re(e),
181
- o.map((t) => Ne(t, n)),
182
- o.flatten,
183
- o.filterMap((t) => s.fromNullable(t))
391
+ Ne(e),
392
+ P((t) => qn(t, n)),
393
+ Re,
394
+ U((t) => l(t))
184
395
  );
185
396
  }
186
- function Ve(e, n) {
397
+ function Nn(e, n) {
187
398
  return r(
188
- le(e),
189
- o.filter((t) => {
399
+ ke(e),
400
+ h((t) => {
190
401
  var i;
191
402
  return ((i = t.decision) == null ? void 0 : i.kind) === n;
192
403
  }),
193
- o.map((t) => we(t)),
194
- o.filterMap((t) => s.fromNullable(t))
404
+ P((t) => Rn(t)),
405
+ U((t) => l(t))
195
406
  );
196
407
  }
197
- function je(e, n) {
408
+ function Tn(e, n) {
198
409
  return r(
199
- ue(e),
200
- o.filter((t) => {
410
+ Oe(e),
411
+ h((t) => {
201
412
  var i;
202
413
  return ((i = t.decision) == null ? void 0 : i.kind) === n;
203
414
  }),
204
- o.map((t) => ke(t)),
205
- o.filterMap((t) => s.fromNullable(t))
415
+ P((t) => Un(t)),
416
+ U((t) => l(t))
206
417
  );
207
418
  }
208
- function He(e, n) {
419
+ function kn(e, n) {
209
420
  return r(
210
- ae(e),
211
- o.filter((t) => {
421
+ Te(e),
422
+ h((t) => {
212
423
  var i;
213
424
  return ((i = t.decision) == null ? void 0 : i.kind) === n;
214
425
  }),
215
- o.map((t) => Oe(t)),
216
- o.filterMap((t) => s.fromNullable(t))
426
+ P((t) => xn(t)),
427
+ U((t) => l(t))
217
428
  );
218
429
  }
219
- function re(e) {
430
+ function Ne(e) {
220
431
  return r(
221
432
  e.attributes,
222
- o.filter(ie)
433
+ h(be)
223
434
  );
224
435
  }
225
- function ae(e) {
436
+ function Te(e) {
226
437
  return r(
227
438
  e.attributes,
228
- o.filter(oe)
439
+ h(we)
229
440
  );
230
441
  }
231
- function le(e) {
442
+ function ke(e) {
232
443
  return r(
233
444
  e.attributes,
234
- o.filter(se)
445
+ h(_e)
235
446
  );
236
447
  }
237
- function ue(e) {
448
+ function Oe(e) {
238
449
  return r(
239
450
  e.attributes,
240
- o.filter(te)
451
+ h(De)
241
452
  );
242
453
  }
243
- function Ke(e, n) {
454
+ function On(e, n) {
244
455
  return r(
245
- M(e, n),
246
- s.toUndefined
456
+ z(e, n),
457
+ b
247
458
  );
248
459
  }
249
- function Ge(e, n) {
460
+ function zn(e, n) {
250
461
  return r(
251
- ce(e, n),
252
- s.toUndefined
462
+ ze(e, n),
463
+ b
253
464
  );
254
465
  }
255
- function Le(e, n, t) {
466
+ function Fn(e, n, t) {
256
467
  return r(
257
- ce(e, n),
258
- s.map((i) => i.values),
259
- s.chain(W(o.findFirst((i) => i.id === t))),
260
- s.toUndefined
468
+ ze(e, n),
469
+ A((i) => i.values),
470
+ gn(he(Pe((i) => i.id === t))),
471
+ b
261
472
  );
262
473
  }
263
- function Qe(e, n) {
474
+ function $n(e, n) {
264
475
  return r(
265
- M(e, n),
266
- s.filter(se),
267
- s.toUndefined
476
+ z(e, n),
477
+ R(_e),
478
+ b
268
479
  );
269
480
  }
270
- function Xe(e, n) {
481
+ function Bn(e, n) {
271
482
  return r(
272
- M(e, n),
273
- s.filter(te),
274
- s.toUndefined
483
+ z(e, n),
484
+ R(De),
485
+ b
275
486
  );
276
487
  }
277
- function Ye(e, n) {
488
+ function jn(e, n) {
278
489
  return r(
279
- M(e, n),
280
- s.filter(oe),
281
- s.toUndefined
490
+ z(e, n),
491
+ R(we),
492
+ b
282
493
  );
283
494
  }
284
- function M(e, n) {
495
+ function z(e, n) {
285
496
  return r(
286
497
  e.attributes,
287
- o.findFirst((t) => ne.equals(t.id, n))
498
+ Pe((t) => Ie.equals(t.id, n))
288
499
  );
289
500
  }
290
- function ce(e, n) {
501
+ function ze(e, n) {
291
502
  return r(
292
- M(e, n),
293
- s.filter(ie)
503
+ z(e, n),
504
+ R(be)
294
505
  );
295
506
  }
296
- const P = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
507
+ const w = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
297
508
  __proto__: null,
298
- filterAttributesOfComponent: ze,
299
- filterAttributesOfRoot: Be,
300
- filterAttributesOfShared: Te,
301
- getAttribute: Ke,
302
- getBooleanAttribute: Xe,
303
- getBooleanAttributes: ue,
304
- getBooleanDecisions: je,
305
- getChoiceAttribute: Ge,
306
- getChoiceAttributes: re,
307
- getChoiceDecisions: Fe,
308
- getChoiceValue: Le,
309
- getComponentAttribute: Ye,
310
- getComponentAttributes: ae,
311
- getComponentDecisions: He,
312
- getNumericAttribute: Qe,
313
- getNumericAttributes: le,
314
- getNumericDecisions: Ve
315
- }, Symbol.toStringTag, { value: "Module" })), Y = ne.equals;
316
- De.equals;
317
- const de = D(null), fe = D(null), ge = D(null), pe = D(null), K = () => N(de), v = () => N(pe), me = "The configuration is not initialized. Consider using the ConfigurationSuspender or unload components manually that make use of any unsafe hook while the configuration is initializing. Check the hooks documentation to see if it is safe to use while the configuration is initializing.";
318
- function G(e) {
509
+ filterAttributesOfComponent: Dn,
510
+ filterAttributesOfRoot: _n,
511
+ filterAttributesOfShared: bn,
512
+ getAttribute: On,
513
+ getBooleanAttribute: Bn,
514
+ getBooleanAttributes: Oe,
515
+ getBooleanDecisions: Tn,
516
+ getChoiceAttribute: zn,
517
+ getChoiceAttributes: Ne,
518
+ getChoiceDecisions: wn,
519
+ getChoiceValue: Fn,
520
+ getComponentAttribute: jn,
521
+ getComponentAttributes: Te,
522
+ getComponentDecisions: kn,
523
+ getNumericAttribute: $n,
524
+ getNumericAttributes: ke,
525
+ getNumericDecisions: Nn
526
+ }, Symbol.toStringTag, { value: "Module" })), le = Ie.equals;
527
+ Mn.equals;
528
+ function ee(e) {
529
+ return E(
530
+ (n, t) => {
531
+ const i = n == null, o = t == null;
532
+ return i && o || !i && !o && e.equals(n, t);
533
+ }
534
+ );
535
+ }
536
+ const Fe = $(null), $e = $(null), Be = $(null), je = $(null), oe = () => B(Fe), N = () => B(je), Ve = "The configuration is not initialized. Consider using the ConfigurationSuspender or unload components manually that make use of any unsafe hook while the configuration is initializing. Check the hooks documentation to see if it is safe to use while the configuration is initializing.";
537
+ function se(e) {
319
538
  if (!e)
320
- throw new Error(me);
539
+ throw new Error(Ve);
321
540
  }
322
- function A(e) {
541
+ function T(e) {
323
542
  if (!e)
324
- throw new Error(me);
543
+ throw new Error(Ve);
325
544
  }
326
- function Ze() {
327
- const e = K();
328
- return G(e), m(() => ({
545
+ function Vn() {
546
+ const e = oe();
547
+ return se(e), m(() => ({
329
548
  explainChoiceAttributeConsequence: (n, t, i) => e.explain({
330
- type: j.ChoiceValue,
549
+ type: Z.ChoiceValue,
331
550
  attributeId: n,
332
551
  choiceValueId: t,
333
552
  question: i
334
553
  }),
335
554
  explainChoiceAttributeConsequences: (n, t) => e.explain({
336
- type: j.Choice,
555
+ type: Z.Choice,
337
556
  attributeId: n,
338
557
  question: t
339
558
  }),
340
559
  applySolution: (n) => e.applySolution(n)
341
560
  }), [e]);
342
561
  }
343
- function O() {
344
- const e = K();
345
- return G(e), m(() => ({
562
+ function K() {
563
+ const e = oe();
564
+ return se(e), m(() => ({
346
565
  makeDecision: (n) => e.makeDecision(n),
347
566
  setManyDecision: (n, t) => e.setMany(n, t)
348
567
  }), [e]);
349
568
  }
350
- var _ = function(e) {
569
+ var Q = function(e) {
351
570
  return function(n) {
352
- return ve(e(n));
571
+ return me(e(n));
353
572
  };
354
573
  };
355
- const Je = _((e) => e.type === d.Choice ? U(e) : I), We = _((e) => e.type === d.Numeric ? U(e) : I), $e = _((e) => e.type === d.Boolean ? U(e) : I), en = _((e) => e.type === d.Component ? U(e) : I);
356
- function z(e) {
357
- return e.decision != null && e.decision.kind === k.Explicit;
574
+ const Hn = Q((e) => e.type === f.Choice ? q(e) : y), Wn = Q((e) => e.type === f.Numeric ? q(e) : y), Gn = Q((e) => e.type === f.Boolean ? q(e) : y), Kn = Q((e) => e.type === f.Component ? q(e) : y);
575
+ function X(e) {
576
+ return e.decision != null && e.decision.kind === G.Explicit;
358
577
  }
359
- function Ce(e) {
578
+ function He(e) {
360
579
  return r(
361
580
  e.values,
362
- o.filter(z),
363
- o.map((n) => ({
364
- type: d.Choice,
581
+ h(X),
582
+ P((n) => ({
583
+ type: f.Choice,
365
584
  attributeId: e.id,
366
585
  choiceValueId: n.id,
367
586
  state: null
368
587
  }))
369
588
  );
370
589
  }
371
- function nn(e) {
590
+ function Qn(e) {
372
591
  return r(
373
592
  e,
374
- s.fromPredicate(z),
375
- s.map(() => ({
376
- type: d.Numeric,
593
+ j(X),
594
+ A(() => ({
595
+ type: f.Numeric,
377
596
  attributeId: e.id,
378
597
  state: null
379
598
  }))
380
599
  );
381
600
  }
382
- function tn(e) {
601
+ function Xn(e) {
383
602
  return r(
384
603
  e,
385
- s.fromPredicate(z),
386
- s.map(() => ({
387
- type: d.Boolean,
604
+ j(X),
605
+ A(() => ({
606
+ type: f.Boolean,
388
607
  attributeId: e.id,
389
608
  state: null
390
609
  }))
391
610
  );
392
611
  }
393
- function sn(e) {
612
+ function Yn(e) {
394
613
  return r(
395
614
  e,
396
- s.fromPredicate(z),
397
- s.map(() => ({
398
- type: d.Component,
615
+ j(X),
616
+ A(() => ({
617
+ type: f.Component,
399
618
  attributeId: e.id,
400
619
  state: null
401
620
  }))
402
621
  );
403
622
  }
404
- function on(e, n) {
623
+ function Jn(e, n) {
405
624
  return r(
406
- P.filterAttributesOfComponent(n, e, !0),
625
+ w.filterAttributesOfComponent(n, e, !0),
407
626
  (t) => [
408
627
  r(
409
628
  t,
410
- o.filter(Je),
411
- o.chain(Ce)
629
+ h(Hn),
630
+ An(He)
412
631
  ),
413
632
  r(
414
633
  t,
415
- o.filter(We),
416
- o.map(nn),
417
- o.compact
634
+ h(Wn),
635
+ P(Qn),
636
+ Y
418
637
  ),
419
638
  r(
420
639
  t,
421
- o.filter($e),
422
- o.map(tn),
423
- o.compact
640
+ h(Gn),
641
+ P(Xn),
642
+ Y
424
643
  ),
425
644
  r(
426
645
  t,
427
- o.filter(en),
428
- o.map(sn),
429
- o.compact
646
+ h(Kn),
647
+ P(Yn),
648
+ Y
430
649
  )
431
650
  ],
432
- o.flatten
651
+ Re
433
652
  );
434
653
  }
435
- function xn(e, n) {
436
- const t = v();
437
- return A(t), m(
654
+ function ht(e, n) {
655
+ const t = N();
656
+ return T(t), m(
438
657
  () => r(
439
- s.fromNullable(e),
440
- s.map(W(
441
- o.map((i) => P.getAttribute(t, i)),
442
- n ?? !1 ? he : o.filterMap(s.fromNullable)
658
+ l(e),
659
+ A(he(
660
+ P((i) => w.getAttribute(t, i)),
661
+ n ?? !1 ? O : U(l)
443
662
  )),
444
- s.getOrElse(() => t.attributes)
663
+ D(() => t.attributes)
445
664
  ),
446
665
  [e, t, n]
447
666
  );
448
667
  }
449
- function Mn(e) {
450
- const n = v(), { explainChoiceAttributeConsequence: t, explainChoiceAttributeConsequences: i, applySolution: a } = Ze(), { makeDecision: l, setManyDecision: c } = O();
451
- A(n);
452
- const h = P.getChoiceAttribute(n, e), u = m(() => ({
453
- explainConsequence: (y, E) => t(e, y, E),
454
- explainConsequences: (y) => i(e, y),
455
- makeDecision: (y, E) => l({
456
- type: d.Choice,
668
+ function mt(e) {
669
+ const n = N(), { explainChoiceAttributeConsequence: t, explainChoiceAttributeConsequences: i, applySolution: o } = Vn(), { makeDecision: s, setManyDecision: a } = K();
670
+ T(n);
671
+ const c = w.getChoiceAttribute(n, e), u = m(() => ({
672
+ explainConsequence: (p, x) => t(e, p, x),
673
+ explainConsequences: (p) => i(e, p),
674
+ makeDecision: (p, x) => s({
675
+ type: f.Choice,
457
676
  attributeId: e,
458
- choiceValueId: y,
459
- state: E
677
+ choiceValueId: p,
678
+ state: x
460
679
  }),
461
680
  clearDecisions: r(
462
- h,
463
- s.fromNullable,
464
- s.map(Ce),
681
+ c,
682
+ l,
683
+ A(He),
465
684
  // Only setMany if there are decisions to clear.
466
- s.filter(o.isNonEmpty),
467
- s.map((y) => () => c(y, { type: "Default" })),
468
- s.getOrElse(() => () => Promise.resolve())
685
+ R(Ae),
686
+ A((p) => () => a(p, { type: "Default" })),
687
+ D(() => () => Promise.resolve())
469
688
  ),
470
- applySolution: a
471
- }), [e, h, l, c, t, i, a]), S = m(() => ({
689
+ applySolution: o
690
+ }), [e, c, s, a, t, i, o]), d = m(() => ({
472
691
  ...u,
473
- attribute: h
474
- }), [h, u]);
475
- if (h)
476
- return S;
692
+ attribute: c
693
+ }), [c, u]);
694
+ if (c)
695
+ return d;
477
696
  }
478
- function Rn(e) {
479
- const n = v(), { makeDecision: t } = O();
480
- A(n);
481
- const i = P.getNumericAttribute(n, e), a = m(() => ({
482
- makeDecision: (c) => t({
483
- type: d.Numeric,
697
+ function St(e) {
698
+ const n = N(), { makeDecision: t } = K();
699
+ T(n);
700
+ const i = w.getNumericAttribute(n, e), o = m(() => ({
701
+ makeDecision: (a) => t({
702
+ type: f.Numeric,
484
703
  attributeId: e,
485
- state: c
704
+ state: a
486
705
  })
487
- }), [e, t]), l = m(() => ({
488
- ...a,
706
+ }), [e, t]), s = m(() => ({
707
+ ...o,
489
708
  attribute: i
490
- }), [i, a]);
709
+ }), [i, o]);
491
710
  if (i)
492
- return l;
711
+ return s;
493
712
  }
494
- function Un(e) {
495
- const n = v(), { makeDecision: t } = O();
496
- A(n);
497
- const i = P.getBooleanAttribute(n, e), a = m(() => ({
498
- makeDecision: (c) => t({
499
- type: d.Boolean,
713
+ function yt(e) {
714
+ const n = N(), { makeDecision: t } = K();
715
+ T(n);
716
+ const i = w.getBooleanAttribute(n, e), o = m(() => ({
717
+ makeDecision: (a) => t({
718
+ type: f.Boolean,
500
719
  attributeId: e,
501
- state: c
720
+ state: a
502
721
  })
503
- }), [e, t]), l = m(() => ({
504
- ...a,
722
+ }), [e, t]), s = m(() => ({
723
+ ...o,
505
724
  attribute: i
506
- }), [i, a]);
725
+ }), [i, o]);
507
726
  if (i)
508
- return l;
727
+ return s;
509
728
  }
510
- function In(e) {
511
- const n = v(), { makeDecision: t, setManyDecision: i } = O();
512
- A(n);
513
- const a = n.attributes, l = P.getComponentAttribute(n, e), c = m(() => ({
729
+ function vt(e) {
730
+ const n = N(), { makeDecision: t, setManyDecision: i } = K();
731
+ T(n);
732
+ const o = n.attributes, s = w.getComponentAttribute(n, e), a = m(() => ({
514
733
  makeDecision: (u) => t({
515
- type: d.Component,
734
+ type: f.Component,
516
735
  attributeId: e,
517
736
  state: u
518
737
  }),
519
738
  clearSubtree: r(
520
- on(e, a),
739
+ Jn(e, o),
521
740
  // Only setMany if there are decisions to clear.
522
- s.fromPredicate(o.isNonEmpty),
523
- s.map((u) => () => i(u, { type: "Default" })),
524
- s.getOrElse(() => () => Promise.resolve())
741
+ j(Ae),
742
+ A((u) => () => i(u, { type: "Default" })),
743
+ D(() => () => Promise.resolve())
525
744
  )
526
- }), [e, t, a, i]), h = m(() => ({
527
- ...c,
528
- attribute: l
529
- }), [l, c]);
530
- if (l)
531
- return h;
745
+ }), [e, t, o, i]), c = m(() => ({
746
+ ...a,
747
+ attribute: s
748
+ }), [s, a]);
749
+ if (s)
750
+ return c;
532
751
  }
533
- const rn = f.fromEquals((e, n) => J.getEq(g.Eq).equals(e ?? {}, n ?? {})), an = f.struct({
534
- attributeId: f.fromEquals(Y),
535
- decisions: o.getEq(f.fromEquals(Y))
536
- }), ln = f.fromEquals((e, n) => o.getEq(an).equals(e ?? [], n ?? [])), T = f.struct({
537
- configurationModelSource: f.fromEquals((e, n) => $(e, n)),
538
- attributeRelations: ln,
539
- usageRuleParameters: rn
540
- }), un = f.eqStrict, B = F(un), cn = () => H({
752
+ const Ln = E((e, n) => xe(g).equals(e ?? {}, n ?? {})), Zn = M({
753
+ attributeId: E(le),
754
+ decisions: H(E(le))
755
+ }), et = E((e, n) => H(Zn).equals(e ?? [], n ?? [])), J = M({
756
+ configurationModelSource: E((e, n) => ge(e, n)),
757
+ attributeRelations: et,
758
+ usageRuleParameters: Ln
759
+ }), nt = ve, L = ee(nt), tt = () => ne({
541
760
  predictableActionArguments: !0,
542
761
  preserveActionOrder: !0,
543
762
  schema: {
@@ -563,14 +782,14 @@ const rn = f.fromEquals((e, n) => J.getEq(g.Eq).equals(e ?? {}, n ?? {})), an =
563
782
  }
564
783
  },
565
784
  exit: [
566
- C("Shutting down", "SessionManagement:"),
785
+ S("Shutting down", "SessionManagement:"),
567
786
  "disposeOldSession"
568
787
  ],
569
788
  states: {
570
789
  ProcessChanges: {
571
790
  entry: [
572
- C("Entering ProcessChanges", "SessionManagement:"),
573
- b(
791
+ S("Entering ProcessChanges", "SessionManagement:"),
792
+ I(
574
793
  2
575
794
  /* Other */
576
795
  )
@@ -583,8 +802,8 @@ const rn = f.fromEquals((e, n) => J.getEq(g.Eq).equals(e ?? {}, n ?? {})), an =
583
802
  },
584
803
  DisposeSession: {
585
804
  entry: [
586
- C("Entering DisposeSession", "SessionManagement:"),
587
- b(
805
+ S("Entering DisposeSession", "SessionManagement:"),
806
+ I(
588
807
  2
589
808
  /* Other */
590
809
  )
@@ -596,8 +815,8 @@ const rn = f.fromEquals((e, n) => J.getEq(g.Eq).equals(e ?? {}, n ?? {})), an =
596
815
  },
597
816
  CreateSession: {
598
817
  entry: [
599
- C("Entering CreateSession", "SessionManagement:"),
600
- b(
818
+ S("Entering CreateSession", "SessionManagement:"),
819
+ I(
601
820
  0
602
821
  /* CreateSession */
603
822
  )
@@ -617,8 +836,8 @@ const rn = f.fromEquals((e, n) => J.getEq(g.Eq).equals(e ?? {}, n ?? {})), an =
617
836
  },
618
837
  SessionCreationFailed: {
619
838
  entry: [
620
- C("Entering SessionCreationFailed", "SessionManagement:"),
621
- b(
839
+ S("Entering SessionCreationFailed", "SessionManagement:"),
840
+ I(
622
841
  2
623
842
  /* Other */
624
843
  )
@@ -630,20 +849,20 @@ const rn = f.fromEquals((e, n) => J.getEq(g.Eq).equals(e ?? {}, n ?? {})), an =
630
849
  cond: "shallImmediatelyProcessChangesAfterSessionCreationError"
631
850
  },
632
851
  exit: [
633
- C("Exiting SessionCreationFailed", "SessionManagement:"),
852
+ S("Exiting SessionCreationFailed", "SessionManagement:"),
634
853
  "clearSessionCreationError"
635
854
  ],
636
855
  on: {
637
856
  RetrySessionCreation: {
638
857
  target: "ProcessChanges",
639
- actions: C("Retrying session creation", "SessionManagement:")
858
+ actions: S("Retrying session creation", "SessionManagement:")
640
859
  }
641
860
  }
642
861
  },
643
862
  UpdateSession: {
644
863
  entry: [
645
- C("Entering UpdateSession", "SessionManagement:"),
646
- b(
864
+ S("Entering UpdateSession", "SessionManagement:"),
865
+ I(
647
866
  1
648
867
  /* UpdateSession */
649
868
  )
@@ -662,8 +881,8 @@ const rn = f.fromEquals((e, n) => J.getEq(g.Eq).equals(e ?? {}, n ?? {})), an =
662
881
  },
663
882
  SessionUpdateFailed: {
664
883
  entry: [
665
- C("Entering SessionUpdateFailed", "SessionManagement:"),
666
- b(
884
+ S("Entering SessionUpdateFailed", "SessionManagement:"),
885
+ I(
667
886
  2
668
887
  /* Other */
669
888
  )
@@ -675,43 +894,43 @@ const rn = f.fromEquals((e, n) => J.getEq(g.Eq).equals(e ?? {}, n ?? {})), an =
675
894
  cond: "shallImmediatelyProcessChangesAfterSessionUpdateError"
676
895
  },
677
896
  exit: [
678
- C("Exiting SessionUpdateFailed", "SessionManagement:"),
897
+ S("Exiting SessionUpdateFailed", "SessionManagement:"),
679
898
  "clearSessionUpdateError"
680
899
  ],
681
900
  on: {
682
901
  RetrySessionUpdate: {
683
902
  target: "ProcessChanges",
684
- actions: C("Retrying session update", "SessionManagement:")
903
+ actions: S("Retrying session update", "SessionManagement:")
685
904
  }
686
905
  }
687
906
  }
688
907
  }
689
908
  }, {
690
909
  actions: {
691
- saveDesiredClient: p({
910
+ saveDesiredClient: C({
692
911
  desiredClient: (e, n) => n.client
693
912
  }),
694
- saveDesiredSessionContext: p({
913
+ saveDesiredSessionContext: C({
695
914
  desiredSessionContext: (e, n) => n.sessionContext
696
915
  }),
697
- disposeOldSession: p((e, n) => (e.session && e.session.close().then(Se).catch((t) => {
916
+ disposeOldSession: C((e, n) => (e.session && e.session.close().then(Je).catch((t) => {
698
917
  }), {
699
918
  session: null,
700
919
  actualClient: null
701
920
  })),
702
- setSessionCreationResult: p((e, n) => ({
921
+ setSessionCreationResult: C((e, n) => ({
703
922
  session: n.data.session,
704
923
  actualClient: n.data.client
705
924
  })),
706
- setSessionCreationError: p((e, n) => ({
925
+ setSessionCreationError: C((e, n) => ({
707
926
  sessionCreationError: n.data
708
927
  })),
709
- clearSessionCreationError: p({ sessionCreationError: () => null }),
710
- setSessionUpdateError: p((e, n) => ({
928
+ clearSessionCreationError: C({ sessionCreationError: () => null }),
929
+ setSessionUpdateError: C((e, n) => ({
711
930
  sessionUpdateError: n.data
712
931
  })),
713
- clearSessionUpdateError: p({ sessionUpdateError: () => null }),
714
- setHasEverSuccessfullyCreatedSession: p({
932
+ clearSessionUpdateError: C({ sessionUpdateError: () => null }),
933
+ setHasEverSuccessfullyCreatedSession: C({
715
934
  hasEverSuccessfullyCreatedSession: () => !0
716
935
  })
717
936
  },
@@ -730,38 +949,38 @@ const rn = f.fromEquals((e, n) => J.getEq(g.Eq).equals(e ?? {}, n ?? {})), an =
730
949
  }))
731
950
  },
732
951
  guards: {
733
- shallDisposeSession: (e) => e.session != null && (e.desiredSessionContext == null || e.desiredClient == null || !B.equals(e.actualClient, e.desiredClient)),
952
+ shallDisposeSession: (e) => e.session != null && (e.desiredSessionContext == null || e.desiredClient == null || !L.equals(e.actualClient, e.desiredClient)),
734
953
  shallCreateSession: (e) => e.session == null && e.desiredClient != null && e.desiredSessionContext != null,
735
- shallUpdateSession: (e) => e.session != null && !T.equals(e.session.getSessionContext(), e.desiredSessionContext),
954
+ shallUpdateSession: (e) => e.session != null && !J.equals(e.session.getSessionContext(), e.desiredSessionContext),
736
955
  shallImmediatelyProcessChangesAfterSessionCreationError: (e) => (
737
956
  // The desired client and the desired session context is not the same that resulted in the error.
738
- !B.equals(e.desiredClient, e.sessionCreationError.client) || !F(T).equals(e.desiredSessionContext, e.sessionCreationError.sessionContext)
957
+ !L.equals(e.desiredClient, e.sessionCreationError.client) || !ee(J).equals(e.desiredSessionContext, e.sessionCreationError.sessionContext)
739
958
  ),
740
959
  shallImmediatelyProcessChangesAfterSessionUpdateError: (e) => (
741
960
  // The desired client was changed
742
- !B.equals(e.desiredClient, e.actualClient) || !F(T).equals(e.desiredSessionContext, e.sessionUpdateError.sessionContext)
961
+ !L.equals(e.desiredClient, e.actualClient) || !ee(J).equals(e.desiredSessionContext, e.sessionUpdateError.sessionContext)
743
962
  )
744
963
  }
745
964
  });
746
- function b(e) {
965
+ function I(e) {
747
966
  const n = e === 0, t = e === 1;
748
- return qe((i, a) => {
749
- const l = {
967
+ return Ke((i, o) => {
968
+ const s = {
750
969
  isInitializing: (!i.hasEverSuccessfullyCreatedSession || n) && i.sessionCreationError == null,
751
970
  errorType: i.sessionCreationError && i.sessionCreationError.type
752
- }, c = {
971
+ }, a = {
753
972
  isUpdating: t && i.sessionUpdateError == null,
754
973
  errorType: i.sessionUpdateError && i.sessionUpdateError.type
755
974
  };
756
- return ee({
975
+ return de({
757
976
  type: "SessionManagementStateChanged",
758
- sessionInitialization: l,
759
- sessionUpdating: c,
977
+ sessionInitialization: s,
978
+ sessionUpdating: a,
760
979
  session: i.session
761
980
  });
762
981
  });
763
982
  }
764
- const dn = (e) => (n) => (n({
983
+ const it = (e) => (n) => (n({
765
984
  type: "ConfigurationChanged",
766
985
  session: e,
767
986
  configuration: e.getConfiguration()
@@ -773,7 +992,7 @@ const dn = (e) => (n) => (n({
773
992
  });
774
993
  }), () => {
775
994
  e.setOnConfigurationChangedHandler(null);
776
- }), fn = () => H({
995
+ }), ot = () => ne({
777
996
  predictableActionArguments: !0,
778
997
  preserveActionOrder: !0,
779
998
  schema: {
@@ -787,7 +1006,7 @@ const dn = (e) => (n) => (n({
787
1006
  // Forward the configuration data to the parent.
788
1007
  ConfigurationChanged: {
789
1008
  actions: [
790
- ee((e, n) => n)
1009
+ de((e, n) => n)
791
1010
  ]
792
1011
  }
793
1012
  },
@@ -795,7 +1014,7 @@ const dn = (e) => (n) => (n({
795
1014
  states: {
796
1015
  ProcessChanges: {
797
1016
  entry: [
798
- C("Entering ProcessChanges", "ConfigurationSubscriptionManagement:")
1017
+ S("Entering ProcessChanges", "ConfigurationSubscriptionManagement:")
799
1018
  ],
800
1019
  on: {
801
1020
  ChangeSession: {
@@ -813,7 +1032,7 @@ const dn = (e) => (n) => (n({
813
1032
  },
814
1033
  Subscribe: {
815
1034
  entry: [
816
- C("Entering Subscribe", "ConfigurationSubscriptionManagement:")
1035
+ S("Entering Subscribe", "ConfigurationSubscriptionManagement:")
817
1036
  ],
818
1037
  on: {
819
1038
  ChangeSession: {
@@ -826,33 +1045,33 @@ const dn = (e) => (n) => (n({
826
1045
  },
827
1046
  invoke: {
828
1047
  id: "configurationSubscriptionActor",
829
- src: (e, n) => dn(e.session)
1048
+ src: (e, n) => it(e.session)
830
1049
  }
831
1050
  }
832
1051
  }
833
1052
  }, {
834
1053
  actions: {
835
- saveSession: p((e, n) => ({
1054
+ saveSession: C((e, n) => ({
836
1055
  session: n.session
837
1056
  }))
838
1057
  }
839
- }), gn = () => {
1058
+ }), st = () => {
840
1059
  let e, n;
841
1060
  return {
842
- promise: new Promise((i, a) => {
843
- e = i, n = a;
1061
+ promise: new Promise((i, o) => {
1062
+ e = i, n = o;
844
1063
  }),
845
1064
  resolve: e,
846
1065
  reject: n
847
1066
  };
848
- }, Z = () => {
849
- const e = gn();
1067
+ }, fe = () => {
1068
+ const e = st();
850
1069
  return {
851
1070
  capsule: { promise: e.promise },
852
1071
  resolve: e.resolve,
853
1072
  reject: e.reject
854
1073
  };
855
- }, pn = () => H({
1074
+ }, rt = () => ne({
856
1075
  predictableActionArguments: !0,
857
1076
  preserveActionOrder: !0,
858
1077
  schema: {
@@ -866,50 +1085,50 @@ const dn = (e) => (n) => (n({
866
1085
  sessionUpdating: null,
867
1086
  session: null,
868
1087
  configuration: null,
869
- isReadyPromise: Z()
1088
+ isReadyPromise: fe()
870
1089
  },
871
1090
  entry: [
872
- p({
873
- sessionManagementActor: () => Q(cn()),
874
- configurationSubscriptionManagementActor: () => Q(fn())
1091
+ C({
1092
+ sessionManagementActor: () => ae(tt()),
1093
+ configurationSubscriptionManagementActor: () => ae(ot())
875
1094
  })
876
1095
  ],
877
1096
  exit: [
878
- X((e) => e.sessionManagementActor),
879
- X((e) => e.configurationSubscriptionManagementActor)
1097
+ ue((e) => e.sessionManagementActor),
1098
+ ue((e) => e.configurationSubscriptionManagementActor)
880
1099
  ],
881
1100
  on: {
882
1101
  // Forward events for sessionManagement
883
1102
  ChangeConfigurationClient: {
884
1103
  actions: [
885
- R((e) => e.sessionManagementActor)
1104
+ F((e) => e.sessionManagementActor)
886
1105
  ]
887
1106
  },
888
1107
  ChangeSessionContext: {
889
1108
  actions: [
890
- R((e) => e.sessionManagementActor)
1109
+ F((e) => e.sessionManagementActor)
891
1110
  ]
892
1111
  },
893
1112
  RetrySessionCreation: {
894
1113
  actions: [
895
- R((e) => e.sessionManagementActor)
1114
+ F((e) => e.sessionManagementActor)
896
1115
  ]
897
1116
  },
898
1117
  RetrySessionUpdate: {
899
1118
  actions: [
900
- R((e) => e.sessionManagementActor)
1119
+ F((e) => e.sessionManagementActor)
901
1120
  ]
902
1121
  },
903
1122
  SessionManagementStateChanged: {
904
1123
  actions: [
905
1124
  // Assign the received data
906
- p((e, n) => ({
1125
+ C((e, n) => ({
907
1126
  session: n.session,
908
1127
  sessionInitialization: n.sessionInitialization,
909
1128
  sessionUpdating: n.sessionUpdating
910
1129
  })),
911
1130
  // Forward the session to the configuration subscription
912
- be((e) => ({
1131
+ Ge((e) => ({
913
1132
  type: "ChangeSession",
914
1133
  session: e.session
915
1134
  }), { to: (e) => e.configurationSubscriptionManagementActor }),
@@ -918,7 +1137,7 @@ const dn = (e) => (n) => (n({
918
1137
  },
919
1138
  ConfigurationChanged: {
920
1139
  actions: [
921
- p((e, n) => ({
1140
+ C((e, n) => ({
922
1141
  configuration: {
923
1142
  session: n.session,
924
1143
  configuration: n.configuration
@@ -934,30 +1153,30 @@ const dn = (e) => (n) => (n({
934
1153
  }
935
1154
  }, {
936
1155
  actions: {
937
- calculateReadyState: p((e, n) => {
938
- var a;
939
- const t = !((a = e.sessionInitialization) != null && a.isInitializing) && e.session != null && e.configuration != null && e.configuration.session === e.session;
1156
+ calculateReadyState: C((e, n) => {
1157
+ var o;
1158
+ const t = !((o = e.sessionInitialization) != null && o.isInitializing) && e.session != null && e.configuration != null && e.configuration.session === e.session;
940
1159
  return e.isReadyPromise && t && (e.isReadyPromise.resolve(), e.isReadyPromise.capsule.promise = null), {
941
- isReadyPromise: (() => t ? null : e.isReadyPromise != null ? e.isReadyPromise : Z())()
1160
+ isReadyPromise: (() => t ? null : e.isReadyPromise != null ? e.isReadyPromise : fe())()
942
1161
  };
943
1162
  })
944
1163
  }
945
1164
  });
946
- function mn(e) {
947
- var c, h;
948
- const [n, t] = Pe(pn, {
1165
+ function at(e) {
1166
+ var a, c;
1167
+ const [n, t] = Qe(rt, {
949
1168
  logger: (...u) => console.log("ConfigurationManagement:", ...u)
950
1169
  });
951
- L(() => {
1170
+ re(() => {
952
1171
  t({
953
1172
  type: "ChangeConfigurationClient",
954
1173
  client: e.configuratorClient
955
1174
  }), e.configuratorClient || console.warn("The configurator client is null or undefined. This will dispose the session that may exist. If this was not intended, make sure you pass a valid client.");
956
- }, [e.configuratorClient]), L(() => {
1175
+ }, [e.configuratorClient]), re(() => {
957
1176
  const u = r(
958
- s.fromNullable(e.sessionContext),
959
- s.chainFirst((S) => s.fromNullable(S.configurationModelSource)),
960
- s.toNullable
1177
+ l(e.sessionContext),
1178
+ dn((d) => l(d.configurationModelSource)),
1179
+ V
961
1180
  );
962
1181
  t({
963
1182
  type: "ChangeSessionContext",
@@ -966,74 +1185,74 @@ function mn(e) {
966
1185
  }, [e.sessionContext]);
967
1186
  const i = m(
968
1187
  () => {
969
- var u, S, y, E;
1188
+ var u, d, p, x;
970
1189
  return {
971
- isInitializing: ((S = (u = n.context.isReadyPromise) == null ? void 0 : u.capsule) == null ? void 0 : S.promise) != null,
972
- isInitializingPromise: (y = n.context.isReadyPromise) == null ? void 0 : y.capsule,
973
- error: ((E = n.context.sessionInitialization) == null ? void 0 : E.errorType) && {
1190
+ isInitializing: ((d = (u = n.context.isReadyPromise) == null ? void 0 : u.capsule) == null ? void 0 : d.promise) != null,
1191
+ isInitializingPromise: (p = n.context.isReadyPromise) == null ? void 0 : p.capsule,
1192
+ error: ((x = n.context.sessionInitialization) == null ? void 0 : x.errorType) && {
974
1193
  type: n.context.sessionInitialization.errorType,
975
1194
  retry: () => t({ type: "RetrySessionCreation" })
976
1195
  }
977
1196
  };
978
1197
  },
979
1198
  [n.context.sessionInitialization, n.context.isReadyPromise]
980
- ), a = m(
1199
+ ), o = m(
981
1200
  () => {
982
- var u, S;
1201
+ var u, d;
983
1202
  return {
984
1203
  isUpdating: (u = n.context.sessionUpdating) == null ? void 0 : u.isUpdating,
985
- error: ((S = n.context.sessionUpdating) == null ? void 0 : S.errorType) && {
1204
+ error: ((d = n.context.sessionUpdating) == null ? void 0 : d.errorType) && {
986
1205
  type: n.context.sessionUpdating.errorType,
987
1206
  retry: () => t({ type: "RetrySessionUpdate" })
988
1207
  }
989
1208
  };
990
1209
  },
991
1210
  [n.context.sessionUpdating]
992
- ), l = ((c = n.context.configuration) == null ? void 0 : c.session) === n.context.session ? (h = n.context.configuration) == null ? void 0 : h.configuration : null;
1211
+ ), s = ((a = n.context.configuration) == null ? void 0 : a.session) === n.context.session ? (c = n.context.configuration) == null ? void 0 : c.configuration : null;
993
1212
  return {
994
1213
  configurationInitialization: i,
995
- configurationUpdating: a,
1214
+ configurationUpdating: o,
996
1215
  session: n.context.session,
997
- configuration: l
1216
+ configuration: s
998
1217
  };
999
1218
  }
1000
- function Dn(e) {
1001
- const { configurationInitialization: n, configurationUpdating: t, session: i, configuration: a } = mn({
1219
+ function Et(e) {
1220
+ const { configurationInitialization: n, configurationUpdating: t, session: i, configuration: o } = at({
1002
1221
  configuratorClient: e.configuratorClient,
1003
1222
  sessionContext: e
1004
1223
  });
1005
- return /* @__PURE__ */ x(fe.Provider, { value: n, children: /* @__PURE__ */ x(ge.Provider, { value: t, children: /* @__PURE__ */ x(de.Provider, { value: i, children: /* @__PURE__ */ x(pe.Provider, { value: a, children: e.children }) }) }) });
1224
+ return /* @__PURE__ */ k($e.Provider, { value: n, children: /* @__PURE__ */ k(Be.Provider, { value: t, children: /* @__PURE__ */ k(Fe.Provider, { value: i, children: /* @__PURE__ */ k(je.Provider, { value: o, children: e.children }) }) }) });
1006
1225
  }
1007
- function Cn() {
1008
- return N(fe);
1226
+ function ut() {
1227
+ return B($e);
1009
1228
  }
1010
- function Nn() {
1011
- return N(ge);
1229
+ function At() {
1230
+ return B(Be);
1012
1231
  }
1013
- function wn(e) {
1014
- const { children: n } = e, { isInitializingPromise: t } = Cn();
1232
+ function Pt(e) {
1233
+ const { children: n } = e, { isInitializingPromise: t } = ut();
1015
1234
  if (t != null && t.promise)
1016
1235
  throw t.promise;
1017
- return /* @__PURE__ */ x(Ee, { children: n });
1236
+ return /* @__PURE__ */ k(We, { children: n });
1018
1237
  }
1019
- function kn() {
1020
- const e = K(), n = v();
1021
- return G(e), A(n), m(() => ({
1238
+ function Mt() {
1239
+ const e = oe(), n = N();
1240
+ return se(e), T(n), m(() => ({
1022
1241
  configuration: n,
1023
1242
  restoreConfiguration: (t) => e.restoreConfiguration(t)
1024
1243
  }), [n, e]);
1025
1244
  }
1026
1245
  export {
1027
- Dn as Configuration,
1028
- wn as ConfigurationSuspender,
1029
- xn as useAttributes,
1030
- Un as useBooleanAttribute,
1031
- Mn as useChoiceAttribute,
1032
- In as useComponentAttribute,
1033
- kn as useConfiguration,
1034
- Cn as useConfigurationInitialization,
1035
- Nn as useConfigurationUpdating,
1036
- O as useDecision,
1037
- Ze as useExplain,
1038
- Rn as useNumericAttribute
1246
+ Et as Configuration,
1247
+ Pt as ConfigurationSuspender,
1248
+ ht as useAttributes,
1249
+ yt as useBooleanAttribute,
1250
+ mt as useChoiceAttribute,
1251
+ vt as useComponentAttribute,
1252
+ Mt as useConfiguration,
1253
+ ut as useConfigurationInitialization,
1254
+ At as useConfigurationUpdating,
1255
+ K as useDecision,
1256
+ Vn as useExplain,
1257
+ St as useNumericAttribute
1039
1258
  };