@kosdev-code/kos-dispense-sdk 2.1.22 → 2.1.23

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.
Files changed (47) hide show
  1. package/{dispense-registration-manager-DEyW37S3.cjs → dispense-registration-manager-BkJ1ggtS.cjs} +2 -2
  2. package/{dispense-registration-manager-DEyW37S3.cjs.map → dispense-registration-manager-BkJ1ggtS.cjs.map} +1 -1
  3. package/{dispense-registration-manager-C36ULeOU.js → dispense-registration-manager-CcFUS_KM.js} +72 -69
  4. package/{dispense-registration-manager-C36ULeOU.js.map → dispense-registration-manager-CcFUS_KM.js.map} +1 -1
  5. package/{extension-utils-C3CjcNm5.cjs → extension-utils-DUV7OQR1.cjs} +2 -2
  6. package/{extension-utils-C3CjcNm5.cjs.map → extension-utils-DUV7OQR1.cjs.map} +1 -1
  7. package/{extension-utils-dTIk56MQ.js → extension-utils-DeLiIgFH.js} +2 -2
  8. package/{extension-utils-dTIk56MQ.js.map → extension-utils-DeLiIgFH.js.map} +1 -1
  9. package/index.cjs +1 -1
  10. package/index.cjs.map +1 -1
  11. package/index.js +112 -113
  12. package/index.js.map +1 -1
  13. package/models/models/generic-pour/generic-pour-model.d.ts +2 -1
  14. package/models/models/generic-pour/generic-pour-model.d.ts.map +1 -1
  15. package/models/models/generic-pour/types/index.d.ts +1 -0
  16. package/models/models/nozzle/index.d.ts +1 -1
  17. package/models/models/nozzle/index.d.ts.map +1 -1
  18. package/models/models/nozzle/nozzle-model.d.ts +2 -2
  19. package/models/models/nozzle/nozzle-model.d.ts.map +1 -1
  20. package/models/models/nozzle/types/index.d.ts +8 -0
  21. package/models.cjs +1 -1
  22. package/models.js +2 -2
  23. package/package.json +2 -2
  24. package/pump-provider-BfSGayrQ.js +1317 -0
  25. package/pump-provider-BfSGayrQ.js.map +1 -0
  26. package/pump-provider-BjaBZfDP.cjs +2 -0
  27. package/pump-provider-BjaBZfDP.cjs.map +1 -0
  28. package/ui/hooks/cui-kit/use-beverages.d.ts +2 -1
  29. package/ui/hooks/cui-kit/use-beverages.d.ts.map +1 -1
  30. package/ui/hooks/cui-kit/use-cui-kit.d.ts.map +1 -1
  31. package/ui/hooks/cui-kit/use-dispense-lifecycle.d.ts +2 -1
  32. package/ui/hooks/cui-kit/use-dispense-lifecycle.d.ts.map +1 -1
  33. package/ui/hooks/generic-pour/use-generic-pour.d.ts +2 -2
  34. package/ui/hooks/generic-pour/use-generic-pour.d.ts.map +1 -1
  35. package/ui/hooks/pour/use-pour.d.ts +2 -1
  36. package/ui/hooks/pour/use-pour.d.ts.map +1 -1
  37. package/ui/hooks/utils/pour-strategy/hold-to-pour-strategy.d.ts.map +1 -1
  38. package/ui/hooks/utils/pour-strategy/pour-strategy.d.ts +2 -9
  39. package/ui/hooks/utils/pour-strategy/pour-strategy.d.ts.map +1 -1
  40. package/ui/hooks/utils/pour-strategy/tap-to-pour-strategy.d.ts.map +1 -1
  41. package/ui.cjs +1 -1
  42. package/ui.js +67 -68
  43. package/ui.js.map +1 -1
  44. package/pump-provider-BXvrC3jL.js +0 -1304
  45. package/pump-provider-BXvrC3jL.js.map +0 -1
  46. package/pump-provider-Bp45210p.cjs +0 -2
  47. package/pump-provider-Bp45210p.cjs.map +0 -1
@@ -1,1304 +0,0 @@
1
- var at = Object.defineProperty;
2
- var ot = (e, t, s) => t in e ? at(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
- var J = (e, t, s) => (ot(e, typeof t != "symbol" ? t + "" : t, s), s);
4
- import { jsx as m } from "@emotion/react/jsx-runtime";
5
- import { GenericPour as ct } from "@kosdev-code/kos-dispense-sdk";
6
- import { useKosModel as S, getKosCompanionModel as we, kosAutoEffect as Be, KosLog as T, usePressGesture as Te, EventBus as g, TimerManager as ye } from "@kosdev-code/kos-ui-sdk";
7
- import dt, { createContext as L, useMemo as A, useContext as N, useState as x, useCallback as c, useEffect as F, useRef as de } from "react";
8
- import { A as Ae, b as ke, e as ut, d as Ee, N as lt, f as Ce, H as mt, j as Se, I as Ne, k as He, P as Ke } from "./dispense-registration-manager-C36ULeOU.js";
9
- const De = () => {
10
- const e = Ae.type;
11
- return S({
12
- modelId: e,
13
- modelType: Ae.type,
14
- options: {}
15
- });
16
- };
17
- function Mt(e) {
18
- return (t) => {
19
- const { model: s, status: n, KosModelLoader: r } = De();
20
- return /* @__PURE__ */ m(r, { ...n, children: /* @__PURE__ */ m(e, { ...t, assembly: s }) });
21
- };
22
- }
23
- const Me = () => {
24
- const e = ke.type;
25
- return S({
26
- modelId: e,
27
- modelType: ke.type,
28
- options: {}
29
- });
30
- };
31
- function _t(e) {
32
- return (t) => {
33
- const { model: s, status: n, KosModelLoader: r } = Me();
34
- return /* @__PURE__ */ m(r, { ...n, children: /* @__PURE__ */ m(e, { ...t, beverage: s }) });
35
- };
36
- }
37
- const _e = (e) => S({
38
- modelId: e,
39
- modelType: ut.type,
40
- options: {}
41
- });
42
- function Ot(e) {
43
- return (t) => (s) => {
44
- const { model: n, status: r, KosModelLoader: a } = _e(t);
45
- return /* @__PURE__ */ m(a, { ...r, children: /* @__PURE__ */ m(e, { ...s, board: n }) });
46
- };
47
- }
48
- const Oe = () => {
49
- const e = Ee.type;
50
- return S({
51
- modelId: e,
52
- modelType: Ee.type,
53
- options: {}
54
- });
55
- };
56
- function Yt(e) {
57
- return (t) => {
58
- const { model: s, status: n, KosModelLoader: r } = Oe();
59
- return /* @__PURE__ */ m(r, { ...n, children: /* @__PURE__ */ m(e, { ...t, boardContainer: s }) });
60
- };
61
- }
62
- const Ye = (e) => S({
63
- modelId: e,
64
- modelType: lt.type,
65
- options: {
66
- path: e
67
- }
68
- }), Fe = L(void 0), pt = ({ children: e, path: t }) => {
69
- const { model: s, ready: n } = Ye(t), r = A(() => n && s ? { model: s } : {}, [n, s]);
70
- return /* @__PURE__ */ m(Fe.Provider, { value: r, children: e });
71
- }, _ = () => {
72
- const e = N(Fe);
73
- if (!e)
74
- throw new Error("useNozzleContext must be used within a NozzleProvider");
75
- return e;
76
- }, ht = ({
77
- onBeverageSelected: e,
78
- onClearBeverage: t,
79
- companionType: s
80
- }) => {
81
- const { model: n } = _(), [r, a] = x([]), [i, d] = x(null), v = A(() => s ? r.map(
82
- (l) => we(l, s)
83
- ) : [], [r, s]), f = c(
84
- async (l) => {
85
- d(l), await (n == null ? void 0 : n.setSelectedPourable({ beverage: l })), e == null || e(l);
86
- },
87
- [n, e]
88
- ), u = c(async () => {
89
- d(null), await (n == null ? void 0 : n.setSelectedPourable({ beverage: void 0 })), t == null || t();
90
- }, [n, t]);
91
- return F(() => {
92
- const l = Be(() => {
93
- if (!n)
94
- return;
95
- const $ = n.selectedBrand;
96
- if (!$) {
97
- const b = n.getGroupAvailabilityItems("beverages").filter((p) => p.visible);
98
- a(b ?? []);
99
- return;
100
- }
101
- const w = n.getAvailabilityByParent($.id).filter((b) => b.visible);
102
- a(w ?? []);
103
- });
104
- return () => {
105
- l();
106
- };
107
- }, [n]), {
108
- beverages: r,
109
- beverageCompanions: v,
110
- selectBeverage: f,
111
- selectedBeverage: i,
112
- clearBeverage: u
113
- };
114
- }, ft = ({
115
- onBrandSelected: e,
116
- onBrandCleared: t,
117
- companionType: s
118
- }) => {
119
- const { model: n } = _(), [r, a] = x(null), [i, d] = x([]), v = A(() => s ? i.map((l) => we(l, s)) : [], [i, s]), f = c(
120
- async (l) => {
121
- a(l), n == null || n.setSelectedBrand(l), e == null || e(l);
122
- },
123
- [n, e]
124
- ), u = c(() => {
125
- a(null), n == null || n.setSelectedBrand(void 0), t == null || t();
126
- }, [n, t]);
127
- return F(() => {
128
- const l = Be(() => {
129
- n && d(n.visibleBrands);
130
- });
131
- return () => {
132
- l();
133
- };
134
- }, [n]), {
135
- brands: i,
136
- brandCompanions: v,
137
- selectedBrand: r,
138
- selectBrand: f,
139
- clearBrand: u
140
- };
141
- };
142
- class Ue {
143
- constructor() {
144
- J(this, "_data", /* @__PURE__ */ new Map());
145
- }
146
- get(t) {
147
- return this._data.get(t);
148
- }
149
- set(t, s) {
150
- this._data.set(t, s);
151
- }
152
- remove(t) {
153
- this._data.delete(t);
154
- }
155
- has(t) {
156
- return this._data.has(t);
157
- }
158
- }
159
- const bt = T.createLogger({
160
- name: "HoldToPourStrategy",
161
- group: "kos-hooks"
162
- }), Ge = {
163
- name: "HoldToPourStrategy",
164
- async initiate(e) {
165
- if (!(e != null && e.canPour)) {
166
- bt.debug(`Nozzle ${e == null ? void 0 : e.id} cannot pour. Returning early.`);
167
- return;
168
- }
169
- await (e == null ? void 0 : e.pour());
170
- },
171
- async initiateEnded(e) {
172
- await (e == null ? void 0 : e.cancelPour());
173
- }
174
- }, ae = T.createLogger({
175
- name: "useNozzlePour",
176
- group: "kos-hooks"
177
- }), vt = ({
178
- onPour: e,
179
- onPourCancel: t,
180
- onBeforePour: s,
181
- onBeforePourRejected: n,
182
- pourContext: r,
183
- strategy: a = Ge
184
- }) => {
185
- const { model: i } = _(), [d, v] = x(
186
- r || new Ue()
187
- ), f = c(async () => {
188
- (s ? await (s == null ? void 0 : s(d)) : !0) ? (ae.debug(
189
- `[${a == null ? void 0 : a.name}] - Pour initiated for nozzle ${i == null ? void 0 : i.id}.`
190
- ), a == null || a.initiate(i), e == null || e()) : (ae.debug(
191
- `[${a == null ? void 0 : a.name}] - Did not pass onBeforePour gate for nozzle ${i == null ? void 0 : i.id}. Cancelling pour.`
192
- ), n == null || n());
193
- }, [
194
- e,
195
- i,
196
- a,
197
- s,
198
- t,
199
- d,
200
- n
201
- ]), u = c(() => {
202
- var p;
203
- ae.debug(
204
- `[${a == null ? void 0 : a.name}] - Pour initiate ended called for nozzle ${i == null ? void 0 : i.id}.`
205
- ), (p = a == null ? void 0 : a.initiateEnded) == null || p.call(a, i), t == null || t();
206
- }, [t, i, a]), l = c(() => {
207
- ae.debug(`Force cancelling pour for nozzle ${i == null ? void 0 : i.id}.`), i == null || i.cancelPour(), t == null || t();
208
- }, [t, i]), $ = c(
209
- (p, o) => {
210
- d.set(p, o);
211
- },
212
- [d]
213
- ), w = c(
214
- (p) => {
215
- d.remove(p);
216
- },
217
- [d]
218
- );
219
- return {
220
- handlers: Te({
221
- onPressed: f,
222
- onRelease: u
223
- }).dom,
224
- cancel: l,
225
- updatePourContext: $,
226
- removeFromPourContext: w,
227
- status: i
228
- };
229
- }, $t = ({
230
- onFlavorSelected: e,
231
- onFlavorCleared: t,
232
- companionType: s
233
- }) => {
234
- const { model: n } = _(), r = A(
235
- () => (n == null ? void 0 : n.getGroupAvailabilityItems("flavors").filter((u) => u.visible)) ?? [],
236
- [n]
237
- ), a = A(() => s ? r.map(
238
- (u) => we(u, s)
239
- ) : [], [r, s]), [i, d] = x([]), v = c(
240
- async (u) => {
241
- if (d(
242
- (l) => l != null && l.includes(u) ? [...l.filter(($) => $ !== u)] : [...l ?? [], u]
243
- ), n != null && n.selectedPourable) {
244
- const { beverage: l } = n.selectedPourable;
245
- await n.setSelectedPourable({
246
- beverage: l,
247
- additional: i ?? []
248
- });
249
- }
250
- e == null || e(u, i ?? []);
251
- },
252
- [n, e, i]
253
- ), f = c(async () => {
254
- if (d([]), n != null && n.selectedPourable) {
255
- const { beverage: u } = n.selectedPourable;
256
- n.setSelectedPourable({ beverage: u }), t == null || t();
257
- }
258
- }, [n, t]);
259
- return {
260
- flavors: r,
261
- flavorCompanions: a,
262
- selectFlavor: v,
263
- selectedFlavors: i,
264
- clearFlavors: f
265
- };
266
- }, z = "brands", oe = "beverages", ee = "flavors", Y = T.createLogger({ name: "use-cui-kit" }), gt = ({
267
- initialGroup: e = z,
268
- options: t = {}
269
- }) => {
270
- var re, ne, ie;
271
- const [s, n] = x(e), { model: r } = _(), a = de([]), i = de(), d = de(), v = c(
272
- (h) => {
273
- n(ee);
274
- const I = `/kos/dispense/${r == null ? void 0 : r.path}/brand/selected/`;
275
- g.publish(I, h);
276
- },
277
- [r == null ? void 0 : r.path]
278
- ), f = c(() => {
279
- const h = `/kos/dispense/${r == null ? void 0 : r.path}/brand/cleared/`;
280
- g.publish(h, {});
281
- }, [r == null ? void 0 : r.path]), u = c(
282
- (h) => {
283
- var Z;
284
- n(ee), (Z = i.current) == null || Z.call(i, "selectedBeverage", h);
285
- const I = `/kos/dispense/${r == null ? void 0 : r.path}/beverage/selected/`;
286
- g.publish(I, h);
287
- },
288
- [r == null ? void 0 : r.path]
289
- ), l = c(() => {
290
- var I;
291
- const h = `/kos/dispense/${r == null ? void 0 : r.path}/beverage/cleared/`;
292
- (I = d.current) == null || I.call(d, "selectedBeverage"), g.publish(h, {});
293
- }, [r == null ? void 0 : r.path]), $ = c(
294
- (h) => {
295
- const I = `/kos/dispense/${r == null ? void 0 : r.path}/flavor/selected/`;
296
- g.publish(I, h);
297
- },
298
- [r == null ? void 0 : r.path]
299
- ), w = c(() => {
300
- const h = `/kos/dispense/${r == null ? void 0 : r.path}/flavor/cleared/`;
301
- g.publish(h, {});
302
- }, [r == null ? void 0 : r.path]), b = c(() => {
303
- const h = `/kos/dispense/${r == null ? void 0 : r.path}/pour/`;
304
- g.publish(h, {});
305
- }, [r == null ? void 0 : r.path]), p = c(
306
- async (h) => {
307
- const I = `/kos/dispense/${r == null ? void 0 : r.path}/pre/pour/`;
308
- return g.publish(I, {}), await (D == null ? void 0 : D(h)) || !0;
309
- },
310
- [r == null ? void 0 : r.path]
311
- ), o = c(async () => {
312
- const h = `/kos/dispense/${r == null ? void 0 : r.path}/pre/pour/rejected/`;
313
- g.publish(h, {});
314
- }, [r == null ? void 0 : r.path]), G = c(() => {
315
- const h = `/kos/dispense/${r == null ? void 0 : r.path}/pour/cancel/`;
316
- g.publish(h, {});
317
- }, [r == null ? void 0 : r.path]), { brands: B, selectBrand: C, selectedBrand: Q, clearBrand: O, brandCompanions: ue } = ft({
318
- companionType: (re = t.companionTypes) == null ? void 0 : re.brand,
319
- onBrandSelected: v,
320
- onBrandCleared: f
321
- }), {
322
- beverages: le,
323
- selectBeverage: R,
324
- selectedBeverage: y,
325
- clearBeverage: H,
326
- beverageCompanions: me
327
- } = ht({
328
- companionType: (ne = t.companionTypes) == null ? void 0 : ne.beverage,
329
- onBeverageSelected: u,
330
- onClearBeverage: l
331
- }), {
332
- clearFlavors: j,
333
- flavors: P,
334
- selectFlavor: K,
335
- selectedFlavors: V,
336
- flavorCompanions: k
337
- } = $t({
338
- companionType: (ie = t.companionTypes) == null ? void 0 : ie.flavor,
339
- onFlavorSelected: $,
340
- onFlavorCleared: w
341
- }), [D, W] = x(), q = c((h) => {
342
- W(() => h);
343
- }, []), X = vt({
344
- onPour: b,
345
- onPourCancel: G,
346
- onBeforePour: p,
347
- onBeforePourRejected: o
348
- });
349
- i.current = X.updatePourContext, d.current = X.removeFromPourContext;
350
- const pe = c(() => {
351
- switch (Y.debug(`Navigating back from group: ${s}`), s) {
352
- case z:
353
- H(), O();
354
- break;
355
- case oe:
356
- case ee:
357
- n(e), H(), O();
358
- break;
359
- }
360
- }, [H, O, s, e]), he = c(() => {
361
- const h = `/kos/dispense/${r == null ? void 0 : r.path}/home/`;
362
- g.publish(h, {}), n(e), e === z && (H(), O()), e === oe && H();
363
- }, [H, O, e]), fe = c(() => {
364
- if (a.current.length === 0) {
365
- Y.debug("No timers to pause.");
366
- return;
367
- }
368
- Y.debug(`Pausing ${a.current.length} timers.`), a.current.forEach((h) => {
369
- Y.debug(`Pausing timer with id ${h.id}.`), h.pause();
370
- });
371
- }, []), be = c(() => {
372
- if (a.current.length === 0) {
373
- Y.debug("No timers to restart.");
374
- return;
375
- }
376
- Y.debug(`Restarting ${a.current.length} timers.`), a.current.forEach((h) => {
377
- Y.debug(`Restarting timer with id ${h.id}.`), h.restart();
378
- });
379
- }, []);
380
- return {
381
- timers: {
382
- add: c((h) => {
383
- if (h) {
384
- if (a.current.some((I) => I.id === h.id)) {
385
- Y.debug(`Timer with id ${h.id} already exists.`);
386
- return;
387
- }
388
- a.current.push(h);
389
- }
390
- }, []),
391
- pause: fe,
392
- restart: be
393
- },
394
- nav: {
395
- currentGroup: s,
396
- back: pe,
397
- home: he
398
- },
399
- pour: X,
400
- updateOnBeforePour: q,
401
- selections: {
402
- [z]: Q,
403
- [oe]: y,
404
- [ee]: V
405
- },
406
- [z]: {
407
- models: B,
408
- companions: ue,
409
- clear: O,
410
- handlers: {
411
- onSelected: C
412
- }
413
- },
414
- [oe]: {
415
- models: le,
416
- companions: me,
417
- clear: H,
418
- handlers: {
419
- onSelected: R
420
- }
421
- },
422
- [ee]: {
423
- models: P,
424
- companions: k,
425
- clear: j,
426
- handlers: {
427
- onSelected: K
428
- }
429
- }
430
- };
431
- }, wt = (e) => {
432
- const { model: t } = _(), [s, n] = x(null), {
433
- onAmbientTimer: r,
434
- onAttractTimer: a,
435
- onResetAttractTimer: i,
436
- onResumeAttractTimer: d,
437
- defaultAttractTime: v,
438
- defaultAmbientTime: f
439
- } = e, u = c(() => {
440
- r && (T.info("Ambient timer expired. Calling callback"), r == null || r());
441
- }, [r]), l = c(() => {
442
- a && (T.info("Attract timer expired. Calling callback"), a == null || a());
443
- }, [a]), $ = c(() => {
444
- s && (s.restart(), i == null || i());
445
- }, [s, i]), w = c(() => {
446
- s && (s.reset(), i == null || i());
447
- }, [s, i]), b = c(() => {
448
- s && (s.pause(), d == null || d());
449
- }, [s, d]);
450
- return F(() => {
451
- if (t && v) {
452
- T.info("Nozzle is available. Creating timers");
453
- const p = ye.createTimer(
454
- "attract-timer-" + t.path,
455
- v
456
- );
457
- return v && (p == null || p.addTimeoutAction({
458
- name: "attract-timer",
459
- remainingTime: 0,
460
- action: l
461
- })), f && (p == null || p.addTimeoutAction({
462
- name: "ambient-timer",
463
- remainingTime: f,
464
- action: u
465
- })), v && (p == null || p.start()), n(p ?? null), () => {
466
- p == null || p.reset(), n(null);
467
- };
468
- }
469
- return () => {
470
- T.info("Nozzle is not available. No timers to clear");
471
- };
472
- }, [
473
- f,
474
- v,
475
- u,
476
- l,
477
- t
478
- ]), {
479
- attractTimer: s,
480
- restart: $,
481
- pause: w,
482
- resume: b
483
- };
484
- }, Tt = (e, t) => {
485
- if (t)
486
- return g.subscribe(e, t).unsubscribe;
487
- }, Pt = ({
488
- onInit: e,
489
- onBrandSelected: t,
490
- onBrandCleared: s,
491
- onBeverageCleared: n,
492
- onBeverageSelected: r,
493
- onFlavorCleared: a,
494
- onFlavorSelected: i,
495
- onReturnToHome: d,
496
- onPour: v,
497
- onPourCancel: f,
498
- onBeforePourRejected: u,
499
- onAmbientTimer: l,
500
- onAttractTimer: $,
501
- onResumeAttractTimer: w,
502
- onIdleTimeout: b,
503
- onAreYouThereTimeout: p
504
- }) => {
505
- const { model: o } = _();
506
- F(() => {
507
- const B = [
508
- {
509
- topic: `/kos/dispense/${o == null ? void 0 : o.path}/brand/selected/`,
510
- callback: t
511
- },
512
- {
513
- topic: `/kos/dispense/${o == null ? void 0 : o.path}/brand/cleared/`,
514
- callback: s
515
- },
516
- {
517
- topic: `/kos/dispense/${o == null ? void 0 : o.path}/beverage/selected/`,
518
- callback: r
519
- },
520
- {
521
- topic: `/kos/dispense/${o == null ? void 0 : o.path}/beverage/cleared/`,
522
- callback: n
523
- },
524
- {
525
- topic: `/kos/dispense/${o == null ? void 0 : o.path}/flavor/selected/`,
526
- callback: i
527
- },
528
- {
529
- topic: `/kos/dispense/${o == null ? void 0 : o.path}/flavor/cleared/`,
530
- callback: a
531
- },
532
- { topic: `/kos/dispense/${o == null ? void 0 : o.path}/pour/`, callback: v },
533
- {
534
- topic: `/kos/dispense/${o == null ? void 0 : o.path}/pour/cancel/`,
535
- callback: f
536
- },
537
- {
538
- topic: `/kos/dispense/${o == null ? void 0 : o.path}/pre/pour/rejected/`,
539
- callback: u
540
- },
541
- {
542
- topic: `/kos/dispense/${o == null ? void 0 : o.path}/ambient/start/`,
543
- callback: l
544
- },
545
- {
546
- topic: `/kos/dispense/${o == null ? void 0 : o.path}/attract/start/`,
547
- callback: $
548
- },
549
- {
550
- topic: `/kos/dispense/${o == null ? void 0 : o.path}/attract/resume/`,
551
- callback: w
552
- },
553
- {
554
- topic: `/kos/dispense/${o == null ? void 0 : o.path}/idle/timeout/`,
555
- callback: b
556
- },
557
- {
558
- topic: `/kos/dispense/${o == null ? void 0 : o.path}/are-you-there/timeout/`,
559
- callback: p
560
- },
561
- {
562
- topic: `/kos/dispense/${o == null ? void 0 : o.path}/init/`,
563
- callback: e
564
- },
565
- {
566
- topic: `/kos/dispense/${o == null ? void 0 : o.path}/home/`,
567
- callback: d
568
- }
569
- ].map(
570
- ({ topic: C, callback: Q }) => Tt(C, Q)
571
- );
572
- return () => {
573
- B.forEach((C) => C == null ? void 0 : C());
574
- };
575
- }, [
576
- o == null ? void 0 : o.path,
577
- l,
578
- $,
579
- n,
580
- r,
581
- s,
582
- t,
583
- a,
584
- i,
585
- v,
586
- f,
587
- w,
588
- b,
589
- p,
590
- e,
591
- d
592
- ]);
593
- }, M = T.createLogger({ name: "useCuiKitTimers" }), Le = (e) => {
594
- const { model: t } = _(), [s, n] = x(null), {
595
- onAreYouThereTimer: r,
596
- onIdleTimer: a,
597
- onResetIdleTimer: i,
598
- defaultAreYouThereTime: d = 10,
599
- defaultIdleTime: v = 20
600
- } = e, f = de(!1), u = c(() => {
601
- !f.current && r && (T.info("Are you there timer expired. Calling callback"), f.current = !0, r == null || r());
602
- }, [r]), l = c(() => {
603
- M.debug(
604
- "handleIdleTimer called in useCuiKitTimers, onIdleTimer exists:",
605
- !!a
606
- ), a ? (M.debug("Idle timer expired. Calling callback"), a == null || a()) : M.debug("No onIdleTimer callback provided!");
607
- }, [a]), $ = c(() => {
608
- M.debug(`TIMER RESTART called for ${e.prefix ?? ""}timer`), s && (s.restart(), f.current = !1, i == null || i());
609
- }, [s, i, e.prefix]), w = c(() => {
610
- M.debug(`TIMER PAUSE/RESET called for ${e.prefix ?? ""}timer`), s && (s.reset(), f.current = !1, i == null || i());
611
- }, [s, i, e.prefix]);
612
- return F(() => {
613
- if (M.debug(
614
- `useCuiKitTimers effect triggered - nozzle: ${!!t}, path: ${t == null ? void 0 : t.path}, callbacks: handleIdle=${!!l}, handleAreYouThere=${!!u}`
615
- ), t) {
616
- M.info("Nozzle is available. Creating timers");
617
- const b = ye.createTimer(
618
- `${e.prefix ?? ""}idle-timer-${t.path}`,
619
- v
620
- );
621
- return M.debug(
622
- `Adding idle timer action for ${e.prefix ?? ""}idle-timer-${t.path} with callback:`,
623
- !!l
624
- ), b == null || b.addTimeoutAction({
625
- name: "idle-timer",
626
- remainingTime: 0,
627
- action: l
628
- }), b == null || b.addTimeoutAction({
629
- name: "are-you-there-timer",
630
- remainingTime: d,
631
- action: u
632
- }), n(b ?? null), () => {
633
- b == null || b.reset(), n(null);
634
- };
635
- }
636
- return () => {
637
- M.info("Nozzle is not available. No timers to clear");
638
- };
639
- }, [
640
- d,
641
- v,
642
- u,
643
- l,
644
- t,
645
- e.prefix
646
- ]), {
647
- idleTimer: s,
648
- restart: $,
649
- pause: w
650
- };
651
- }, U = T.createLogger({ name: "useDefaultCuiKitLifecycle" }), Ft = ({
652
- kit: e,
653
- inactivity: t,
654
- pour: s,
655
- screens: n,
656
- onBeforeAreYouThereTimer: r,
657
- areYouThereRejectionPolicy: a = "pause"
658
- }) => {
659
- var I, Z, Ie, xe;
660
- const [i, d] = x(!1), [v, f] = x(!1), { model: u } = _(), [l, $] = x(!1), w = (t == null ? void 0 : t.idleTimeout) ?? 15, b = (t == null ? void 0 : t.areYouThereTimeoutOffset) ?? 10, p = (s == null ? void 0 : s.idleTimeout) ?? (t == null ? void 0 : t.idleTimeout) ?? 10, o = (s == null ? void 0 : s.areYouThereTimeoutOffset) ?? (t == null ? void 0 : t.areYouThereTimeoutOffset) ?? 5, G = n == null ? void 0 : n.ambientTimeoutOffset, B = n == null ? void 0 : n.attractTimeout, C = c(() => {
661
- if (U.info("handleIdleTimeout called - navigating home and publishing event"), j(!1), e == null || e.nav.home(), u) {
662
- const E = `/kos/dispense/${u.path}/idle/timeout/`;
663
- g.publish(E, {});
664
- }
665
- }, [(I = e == null ? void 0 : e.nav) == null ? void 0 : I.home, u]), Q = c(() => {
666
- U.info("handleResetIdleTimer called - resetting idle timer"), j(!1);
667
- }, []), O = c(() => {
668
- if (G && (d(!0), f(!1), u)) {
669
- const E = `/kos/dispense/${u.path}/ambient/start/`;
670
- g.publish(E, {});
671
- }
672
- }, [G, u]), ue = c(() => {
673
- if (B && (f(!0), d(!1), u)) {
674
- const E = `/kos/dispense/${u.path}/attract/start/`;
675
- g.publish(E, {});
676
- }
677
- }, [B, u]), le = c(() => {
678
- if (B && (f(!1), d(!1), e == null || e.nav.home(), u)) {
679
- const E = `/kos/dispense/${u.path}/attract/resume/`;
680
- g.publish(E, {});
681
- }
682
- }, [e == null ? void 0 : e.nav, B, u]), {
683
- pause: R,
684
- restart: y,
685
- attractTimer: H
686
- } = wt({
687
- defaultAmbientTime: G,
688
- defaultAttractTime: B,
689
- onAmbientTimer: O,
690
- onAttractTimer: ue,
691
- onResumeAttractTimer: le
692
- });
693
- (Z = e == null ? void 0 : e.timers) == null || Z.add(H);
694
- const [me, j] = x(!1);
695
- U.info(
696
- "Creating idle timer with timeout:",
697
- w,
698
- "seconds and callback:",
699
- !!C
700
- );
701
- const { pause: P, restart: K, idleTimer: V } = Le({
702
- defaultAreYouThereTime: b,
703
- defaultIdleTime: w,
704
- onIdleTimer: C,
705
- onResetIdleTimer: Q
706
- });
707
- U.info(
708
- `Creating pour timer with timeout: ${p} seconds and callback: ${!!C}`
709
- );
710
- const {
711
- pause: k,
712
- restart: D,
713
- idleTimer: W
714
- } = Le({
715
- defaultAreYouThereTime: o,
716
- defaultIdleTime: p,
717
- onIdleTimer: C,
718
- prefix: "pour-"
719
- }), q = c(async () => {
720
- let E = !0;
721
- if (r)
722
- try {
723
- E = await r();
724
- } catch (ve) {
725
- U.error(`onBeforeAreYouThereTimer callback failed: ${ve}`), E = !1;
726
- }
727
- if (E) {
728
- if (u) {
729
- const ve = `/kos/dispense/${u.path}/are-you-there/timeout/`;
730
- g.publish(ve, {});
731
- }
732
- j(!0), l ? k() : P();
733
- } else
734
- switch (a) {
735
- case "pause":
736
- l ? k() : P();
737
- break;
738
- case "restart":
739
- l ? D() : K();
740
- break;
741
- }
742
- }, [r, u, a, l]), X = c(() => {
743
- j(!1), R(), l ? (D(), P()) : (K(), k());
744
- }, [l, P, k, K, D]);
745
- F(() => {
746
- V && V.addTimeoutAction({
747
- name: "are-you-there-timer",
748
- remainingTime: b,
749
- action: q
750
- });
751
- }, [V, b, q]), F(() => {
752
- W && W.addTimeoutAction({
753
- name: "pour-are-you-there-timer",
754
- remainingTime: o,
755
- action: q
756
- });
757
- }, [W, o, q]), (Ie = e == null ? void 0 : e.timers) == null || Ie.add(V), (xe = e == null ? void 0 : e.timers) == null || xe.add(W);
758
- const pe = c(() => {
759
- $(!1), k(), P(), R();
760
- }, [P, k]), he = c(() => {
761
- $(!0), U.info("restarting pour timer"), D(), R(), P();
762
- }, [P, D]), fe = c(() => {
763
- $(!1), U.info("restarting pour timer on before pour rejected"), k(), K();
764
- }, []), be = c(() => {
765
- R(), f(!1), d(!1), K();
766
- }, [R, K]), Pe = c(() => {
767
- f(!1), d(!1), $(!1), k(), y();
768
- }, [y, k]), re = c(() => {
769
- f(!1), d(!1), $(!1), R(), K();
770
- }, [R, K]), ne = c(() => {
771
- f(!1), d(!1), $(!1), y(), P(), k();
772
- }, [y, P, k]), ie = c(() => {
773
- f(!1), d(!1), y(), P();
774
- }, [y, P]);
775
- Pt({
776
- onBrandSelected: be,
777
- onBrandCleared: Pe,
778
- onBeverageSelected: re,
779
- onBeverageCleared: ne,
780
- onPour: pe,
781
- onPourCancel: he,
782
- onBeforePourRejected: fe,
783
- onInit: ie
784
- // Note: Timer-related handlers (onIdleTimeout, onAmbientTimer, onAttractTimer,
785
- // onResumeAttractTimer, onAreYouThereTimeout) are NOT included here since this
786
- // component's own timer hooks call those handlers directly. Including them would
787
- // create circular event loops.
788
- });
789
- const h = l ? o : b;
790
- return F(() => {
791
- if (u && H) {
792
- const E = `/kos/dispense/${u == null ? void 0 : u.path}/init/`;
793
- g.publish(E, {});
794
- }
795
- }, [u, H]), {
796
- showAreYouThere: me,
797
- clearAreYouThere: X,
798
- pauseIdleTimer: P,
799
- restartIdleTimer: K,
800
- areYouThereCountdown: h,
801
- showAmbientScreen: i,
802
- showAttractScreen: v,
803
- pauseScreenTimer: R,
804
- restartScreenTimer: y
805
- };
806
- }, je = () => {
807
- const e = Ce.type;
808
- return S({
809
- modelId: e,
810
- modelType: Ce.type,
811
- options: {}
812
- });
813
- };
814
- function Ut(e) {
815
- return (t) => {
816
- const { model: s, status: n, KosModelLoader: r } = je();
817
- return /* @__PURE__ */ m(r, { ...n, children: /* @__PURE__ */ m(e, { ...t, deviceAssembly: s }) });
818
- };
819
- }
820
- const Ve = (e) => S({
821
- modelId: e,
822
- modelType: mt.type,
823
- options: {}
824
- });
825
- function Gt(e, t) {
826
- return (s) => {
827
- const { model: n, status: r, KosModelLoader: a } = Ve(e);
828
- return /* @__PURE__ */ m(a, { ...r, children: /* @__PURE__ */ m(t, { ...s, holder: n }) });
829
- };
830
- }
831
- const We = () => {
832
- const e = Se.type;
833
- return S({
834
- modelId: e,
835
- modelType: Se.type,
836
- options: {}
837
- });
838
- };
839
- function jt(e) {
840
- return (t) => {
841
- const { model: s, status: n, KosModelLoader: r } = We();
842
- return /* @__PURE__ */ m(r, { ...n, children: /* @__PURE__ */ m(e, { ...t, holderContainer: s }) });
843
- };
844
- }
845
- const qe = () => {
846
- const e = Ne.type;
847
- return S({
848
- modelId: e,
849
- modelType: Ne.type,
850
- options: {}
851
- });
852
- }, $e = T.createLogger({
853
- name: "HoldToPourIntentStrategy",
854
- group: "kos-hooks"
855
- }), It = {
856
- name: "HoldToPourIntentStrategy",
857
- async initiate(e, t) {
858
- if (!(e != null && e.canPour)) {
859
- $e.debug(`${e == null ? void 0 : e.id} cannot pour. Returning early.`);
860
- return;
861
- }
862
- t ? ($e.debug(`performing intent: ${t}`), await (e == null ? void 0 : e.performIntent(t))) : $e.debug("no intent provided. Returning early.");
863
- },
864
- async initiateEnded(e) {
865
- await (e == null ? void 0 : e.cancelPour());
866
- }
867
- }, ge = T.createLogger({
868
- name: "useNozzlePour",
869
- group: "kos-hooks"
870
- }), Vt = ({
871
- onPour: e,
872
- onPourCancel: t,
873
- intentContainer: s,
874
- strategy: n = It
875
- }) => {
876
- const r = c(() => {
877
- ge.debug(
878
- `[${n == null ? void 0 : n.name}] - Pour initiated for model ${s == null ? void 0 : s.id}.`
879
- ), n == null || n.initiate(s), e == null || e();
880
- }, [e, s, n]), a = c(() => {
881
- var v;
882
- ge.debug(
883
- `[${n == null ? void 0 : n.name}] - Pour initiate ended called for nozzle ${s == null ? void 0 : s.id}.`
884
- ), (v = n == null ? void 0 : n.initiateEnded) == null || v.call(n, s), t == null || t();
885
- }, [t, s, n]), i = c(() => {
886
- ge.debug(`Force cancelling pour for nozzle ${s == null ? void 0 : s.id}.`), s == null || s.cancelPour(), t == null || t();
887
- }, [t, s]);
888
- return {
889
- handlers: Te({
890
- onPressed: r,
891
- onRelease: a
892
- }).dom,
893
- cancel: i,
894
- status: s
895
- };
896
- };
897
- function Wt(e) {
898
- return (t) => {
899
- const { model: s, status: n, KosModelLoader: r } = qe();
900
- return /* @__PURE__ */ m(r, { ...n, children: /* @__PURE__ */ m(e, { ...t, ingredient: s }) });
901
- };
902
- }
903
- const Je = () => {
904
- const e = He.type;
905
- return S({
906
- modelId: e,
907
- modelType: He.type,
908
- options: {}
909
- });
910
- };
911
- function qt(e) {
912
- return (t) => {
913
- const { model: s, status: n, KosModelLoader: r } = Je();
914
- return /* @__PURE__ */ m(r, { ...n, children: /* @__PURE__ */ m(e, { ...t, ingredientContainer: s }) });
915
- };
916
- }
917
- function Jt(e, t) {
918
- return (s) => {
919
- const { model: n, status: r, KosModelLoader: a } = Ye(e);
920
- return /* @__PURE__ */ m(a, { ...r, children: /* @__PURE__ */ m(t, { ...s, nozzle: n }) });
921
- };
922
- }
923
- const te = T.createLogger({
924
- name: "usePour",
925
- group: "kos-hooks"
926
- }), Qt = ({
927
- onBeforePour: e,
928
- onPour: t,
929
- onPourCancel: s,
930
- onPourAbort: n,
931
- pourTarget: r,
932
- pourContext: a,
933
- strategy: i = Ge
934
- }) => {
935
- const [d, v] = x(
936
- a || new Ue()
937
- ), f = c(async () => {
938
- te.debug(
939
- `[${i == null ? void 0 : i.name}] - calling before pour for pour target ${r == null ? void 0 : r.id}.`
940
- ), (e ? await (e == null ? void 0 : e(d)) : !0) ? (te.debug(
941
- `[${i == null ? void 0 : i.name}] - Pour initiated for pour target ${r == null ? void 0 : r.id}.`
942
- ), await (i == null ? void 0 : i.initiate(r)), t == null || t(), r != null && r.isPouring || n == null || n()) : (te.debug(
943
- `[${i == null ? void 0 : i.name}] - Pour cancelled for pour target ${r == null ? void 0 : r.id}.`
944
- ), s == null || s());
945
- }, [t, e, n, r, i, d]), u = c(async () => {
946
- var o;
947
- te.debug(
948
- `[${i == null ? void 0 : i.name}] - Pour initiate ended called for pour target ${r == null ? void 0 : r.id}.`
949
- ), await ((o = i == null ? void 0 : i.initiateEnded) == null ? void 0 : o.call(i, r)) || s == null || s();
950
- }, [s, r, i]), l = c(async () => {
951
- te.debug(`Force cancelling pour for pour target ${r == null ? void 0 : r.id}.`), await (r == null ? void 0 : r.cancelPour()), s == null || s();
952
- }, [s, r]), $ = c(
953
- (p, o) => {
954
- d.set(p, o);
955
- },
956
- [d]
957
- ), w = c(
958
- (p) => {
959
- d.remove(p);
960
- },
961
- [d]
962
- );
963
- return {
964
- handlers: Te({
965
- onPressed: f,
966
- onRelease: u
967
- }).dom,
968
- cancel: l,
969
- updatePourContext: $,
970
- removeFromPourContext: w,
971
- status: r
972
- };
973
- }, se = T.createLogger({
974
- name: "TapOrHoldIntentStrategy",
975
- group: "kos-hooks"
976
- });
977
- class Xt {
978
- constructor(t) {
979
- J(this, "intent");
980
- J(this, "name", "TapOrHoldIntentStrategy");
981
- J(this, "isHold", !1);
982
- J(this, "disposer", null);
983
- this.intent = t;
984
- }
985
- async initiate(t, s) {
986
- if (this.disposer = setTimeout(() => {
987
- this.isHold = !0;
988
- }, 250), t != null && t.isPouring && !this.isHold) {
989
- se.debug("additional tap detected. cancelling pour"), await t.cancelPour();
990
- return;
991
- }
992
- if (!(t != null && t.canPour)) {
993
- se.debug(`${t == null ? void 0 : t.id} cannot pour. Returning early.`);
994
- return;
995
- }
996
- s ? (se.debug(`performing intent: ${s}`), await (t == null ? void 0 : t.performIntent(s))) : se.debug("no intent provided. Returning early.");
997
- }
998
- async initiateEnded(t) {
999
- return this.disposer && clearTimeout(this.disposer), this.disposer = null, this.isHold ? (await (t == null ? void 0 : t.cancelPour()), !1) : (se.debug("Tap detected. don't cancel and return."), !0);
1000
- }
1001
- }
1002
- const ce = T.createLogger({
1003
- name: "TapToPourIntentStrategy",
1004
- group: "kos-hooks"
1005
- }), Zt = {
1006
- name: "TapToPourIntentStrategy",
1007
- async initiate(e, t) {
1008
- if (e != null && e.isPouring) {
1009
- ce.debug(`Nozzle ${e == null ? void 0 : e.id} is already pouring. cancelling pour`), await e.cancelPour();
1010
- return;
1011
- }
1012
- if (!(e != null && e.canPour)) {
1013
- ce.debug(`Nozzle ${e == null ? void 0 : e.id} cannot pour. Returning early.`);
1014
- return;
1015
- }
1016
- t ? (ce.debug(`performing intent: ${t}`), await (e == null ? void 0 : e.performIntent(t))) : ce.debug("no intent provided. Returning early.");
1017
- },
1018
- async initiateEnded(e) {
1019
- return !0;
1020
- }
1021
- }, Re = T.createLogger({
1022
- name: "HoldToPourStrategy",
1023
- group: "kos-hooks"
1024
- }), zt = {
1025
- name: "TapToPourStrategy",
1026
- async initiate(e) {
1027
- if (e != null && e.isPouring) {
1028
- Re.debug(`Nozzle ${e == null ? void 0 : e.id} is already pouring. cancelling pour`), await e.cancelPour();
1029
- return;
1030
- }
1031
- if (!(e != null && e.canPour)) {
1032
- Re.debug(`Nozzle ${e == null ? void 0 : e.id} cannot pour. Returning early.`);
1033
- return;
1034
- }
1035
- await (e == null ? void 0 : e.pour());
1036
- },
1037
- async initiateEnded(e) {
1038
- return !0;
1039
- }
1040
- }, xt = (e, t, s) => S({
1041
- modelId: e,
1042
- modelType: ct.type,
1043
- forceUpdate: !0,
1044
- options: {
1045
- servicePathFactory: t,
1046
- selectedId: s
1047
- }
1048
- });
1049
- function es(e) {
1050
- return (t) => {
1051
- const { model: s, status: n, KosModelLoader: r } = xt(
1052
- t.id,
1053
- t.servicePathFactory,
1054
- t.itemId
1055
- );
1056
- return /* @__PURE__ */ m(r, { ...n, children: /* @__PURE__ */ m(e, { ...t, genericPour: s }) });
1057
- };
1058
- }
1059
- const Qe = L(void 0), ts = ({ children: e }) => {
1060
- const { model: t, ready: s } = De(), n = A(() => s && t ? { model: t } : {}, [s, t]);
1061
- return /* @__PURE__ */ m(Qe.Provider, { value: n, children: e });
1062
- }, ss = () => {
1063
- const e = N(
1064
- Qe
1065
- );
1066
- if (!e)
1067
- throw new Error(
1068
- "useAssemblyContext must be used within a AssemblyProvider"
1069
- );
1070
- return e;
1071
- }, Xe = L(void 0), rs = ({ children: e }) => {
1072
- const { model: t, ready: s } = Me(), n = A(() => s && t ? { model: t } : {}, [s, t]);
1073
- return /* @__PURE__ */ m(Xe.Provider, { value: n, children: e });
1074
- }, ns = () => {
1075
- const e = N(Xe);
1076
- if (!e)
1077
- throw new Error(
1078
- "useAvailabilityContext must be used within a AvailabilityProvider"
1079
- );
1080
- return e;
1081
- }, Ze = L(void 0), is = ({ children: e, id: t }) => {
1082
- const { model: s, ready: n } = _e(t), r = A(() => n && s ? { model: s } : {}, [n, s]);
1083
- return /* @__PURE__ */ m(Ze.Provider, { value: r, children: e });
1084
- }, as = () => {
1085
- const e = N(Ze);
1086
- if (!e)
1087
- throw new Error("useBoardContext must be used within a BoardProvider");
1088
- return e;
1089
- }, ze = L(void 0), os = ({ children: e }) => {
1090
- const { model: t, ready: s } = Oe(), n = A(() => s && t ? { model: t } : {}, [s, t]);
1091
- return /* @__PURE__ */ m(ze.Provider, { value: n, children: e });
1092
- }, cs = () => {
1093
- const e = N(ze);
1094
- if (!e)
1095
- throw new Error(
1096
- "useBoardContainerContext must be used within a BoardContainerProvider"
1097
- );
1098
- return e;
1099
- }, et = L(
1100
- void 0
1101
- ), At = ({ children: e }) => {
1102
- const { model: t, ready: s } = je(), n = A(() => {
1103
- if (s && t) {
1104
- const a = t.nozzlePaths;
1105
- return { model: t, nozzlePaths: a };
1106
- }
1107
- return {};
1108
- }, [s, t]), r = s && t ? e : null;
1109
- return /* @__PURE__ */ m(et.Provider, { value: n, children: r });
1110
- }, kt = () => {
1111
- const e = N(et);
1112
- if (!e)
1113
- throw new Error(
1114
- "useDeviceAssemblyContext must be used within a DeviceAssemblyProvider"
1115
- );
1116
- return e;
1117
- };
1118
- function Et() {
1119
- const e = dt.createContext(null);
1120
- return [() => {
1121
- const s = N(e);
1122
- if (s === void 0)
1123
- throw new Error("useDispenseKitContext must be used within a Provider");
1124
- return s;
1125
- }, e.Provider];
1126
- }
1127
- function Ct({
1128
- children: e,
1129
- provider: t,
1130
- props: s,
1131
- nozzleProps: n
1132
- }) {
1133
- const r = gt(s);
1134
- return /* @__PURE__ */ m(t, { value: r, children: e(n || {}) });
1135
- }
1136
- function St({
1137
- children: e,
1138
- provider: t,
1139
- props: s
1140
- }) {
1141
- const { nozzlePaths: n } = kt(), r = (n == null ? void 0 : n.length) || 0;
1142
- return (n == null ? void 0 : n.map((i, d) => /* @__PURE__ */ m(pt, { path: i, children: /* @__PURE__ */ m(
1143
- Ct,
1144
- {
1145
- provider: t,
1146
- props: s,
1147
- nozzleProps: {
1148
- nozzleIndex: d,
1149
- nozzlePath: i,
1150
- totalNozzles: r,
1151
- isFirstNozzle: d === 0,
1152
- isLastNozzle: d === r - 1
1153
- },
1154
- children: e
1155
- }
1156
- ) }, i))) || [];
1157
- }
1158
- function Nt({
1159
- provider: e,
1160
- props: t
1161
- }) {
1162
- return ({ children: s }) => e ? /* @__PURE__ */ m(At, { children: /* @__PURE__ */ m(
1163
- St,
1164
- {
1165
- provider: e,
1166
- props: t,
1167
- children: s
1168
- }
1169
- ) }) : null;
1170
- }
1171
- function ds(e) {
1172
- const [t, s] = Et();
1173
- return [
1174
- t,
1175
- Nt({ provider: s, props: e })
1176
- ];
1177
- }
1178
- const tt = L(void 0), us = ({ children: e, id: t }) => {
1179
- const { model: s, ready: n } = Ve(t || ""), r = A(() => n && s ? { model: s } : {}, [n, s]);
1180
- return /* @__PURE__ */ m(tt.Provider, { value: r, children: e });
1181
- }, ls = () => {
1182
- const e = N(tt);
1183
- if (!e)
1184
- throw new Error("useHolderContext must be used within a HolderProvider");
1185
- return e;
1186
- }, st = L(
1187
- void 0
1188
- ), ms = ({ children: e }) => {
1189
- const { model: t, ready: s } = We(), n = A(() => s && t ? { model: t } : {}, [s, t]);
1190
- return /* @__PURE__ */ m(st.Provider, { value: n, children: e });
1191
- }, ps = () => {
1192
- const e = N(st);
1193
- if (!e)
1194
- throw new Error(
1195
- "useHolderContainerContext must be used within a HolderContainerProvider"
1196
- );
1197
- return e;
1198
- }, rt = L(void 0), hs = ({ children: e }) => {
1199
- const { model: t, ready: s } = qe(), n = A(() => s && t ? { model: t } : {}, [s, t]);
1200
- return /* @__PURE__ */ m(rt.Provider, { value: n, children: e });
1201
- }, fs = () => {
1202
- const e = N(rt);
1203
- if (!e)
1204
- throw new Error(
1205
- "useIngredientContext must be used within a IngredientProvider"
1206
- );
1207
- return e;
1208
- }, nt = L(
1209
- void 0
1210
- ), bs = ({ children: e }) => {
1211
- const { model: t, ready: s } = Je(), n = A(() => s && t ? { model: t } : {}, [s, t]);
1212
- return /* @__PURE__ */ m(nt.Provider, { value: n, children: e });
1213
- }, vs = () => {
1214
- const e = N(nt);
1215
- if (!e)
1216
- throw new Error(
1217
- "useIngredientContainerContext must be used within a IngredientContainerProvider"
1218
- );
1219
- return e;
1220
- }, Ht = () => {
1221
- const e = Ke.type;
1222
- return S({
1223
- modelId: e,
1224
- modelType: Ke.type,
1225
- options: {}
1226
- });
1227
- }, it = L(void 0), $s = ({ children: e }) => {
1228
- const { model: t, ready: s } = Ht(), n = A(() => s && t ? { model: t } : {}, [s, t]);
1229
- return /* @__PURE__ */ m(it.Provider, { value: n, children: e });
1230
- }, gs = () => {
1231
- const e = N(it);
1232
- if (!e)
1233
- throw new Error("usePumpContext must be used within a PumpProvider");
1234
- return e;
1235
- };
1236
- export {
1237
- qt as $,
1238
- ts as A,
1239
- is as B,
1240
- Ct as C,
1241
- At as D,
1242
- ft as E,
1243
- z as F,
1244
- oe as G,
1245
- us as H,
1246
- hs as I,
1247
- ee as J,
1248
- gt as K,
1249
- Ft as L,
1250
- Pt as M,
1251
- pt as N,
1252
- Le as O,
1253
- $s as P,
1254
- $t as Q,
1255
- je as R,
1256
- Ut as S,
1257
- Ve as T,
1258
- Gt as U,
1259
- We as V,
1260
- jt as W,
1261
- qe as X,
1262
- Vt as Y,
1263
- Wt as Z,
1264
- Je as _,
1265
- rs as a,
1266
- Ye as a0,
1267
- Jt as a1,
1268
- vt as a2,
1269
- Qt as a3,
1270
- It as a4,
1271
- Ge as a5,
1272
- Xt as a6,
1273
- Zt as a7,
1274
- zt as a8,
1275
- xt as a9,
1276
- es as aa,
1277
- Ue as ab,
1278
- ns as b,
1279
- as as c,
1280
- os as d,
1281
- cs as e,
1282
- Nt as f,
1283
- kt as g,
1284
- ls as h,
1285
- ds as i,
1286
- ms as j,
1287
- ps as k,
1288
- fs as l,
1289
- bs as m,
1290
- vs as n,
1291
- _ as o,
1292
- gs as p,
1293
- De as q,
1294
- Me as r,
1295
- _t as s,
1296
- _e as t,
1297
- ss as u,
1298
- Ot as v,
1299
- Mt as w,
1300
- Oe as x,
1301
- Yt as y,
1302
- ht as z
1303
- };
1304
- //# sourceMappingURL=pump-provider-BXvrC3jL.js.map