@viamedici-spc/configurator-react 0.1.2 → 0.1.3

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