@kosdev-code/kos-dispense-sdk 2.0.35 → 2.0.37
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/index.cjs +1 -1
- package/index.js +1 -1
- package/package.json +3 -3
- package/{pump-provider-BgSHNZEC.js → pump-provider-Dm4nQHtl.js} +371 -368
- package/pump-provider-Dm4nQHtl.js.map +1 -0
- package/pump-provider-Dw_WM4Zu.cjs +2 -0
- package/pump-provider-Dw_WM4Zu.cjs.map +1 -0
- package/ui/hooks/cui-kit/use-default-cui-kit-lifecycle.d.ts.map +1 -1
- package/ui.cjs +1 -1
- package/ui.js +1 -1
- package/pump-provider-BgSHNZEC.js.map +0 -1
- package/pump-provider-BkfgOMJx.cjs +0 -2
- package/pump-provider-BkfgOMJx.cjs.map +0 -1
|
@@ -1,83 +1,83 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var J = (e, t, r) => (
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { A as Ie, b as Ae, e as
|
|
6
|
-
import { useKosModel as
|
|
7
|
-
import
|
|
1
|
+
var at = Object.defineProperty;
|
|
2
|
+
var ot = (e, t, r) => t in e ? at(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var J = (e, t, r) => (ot(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
|
+
import { jsx as m } from "@emotion/react/jsx-runtime";
|
|
5
|
+
import { A as Ie, b as Ae, e as ct, d as xe, N as dt, f as ke, H as ut, g as Ee, I as Se, h as Ne, G as lt, P as He } from "./dispense-registration-manager-eOOE05xT.js";
|
|
6
|
+
import { useKosModel as H, getKosCompanionModel as be, kosAutoEffect as Re, KosLog as T, usePressGesture as ve, EventBus as g, TimerManager as Be } from "@kosdev-code/kos-ui-sdk";
|
|
7
|
+
import mt, { createContext as L, useMemo as I, useContext as K, useState as S, useCallback as o, useEffect as O, useRef as Ce } from "react";
|
|
8
8
|
const ye = () => {
|
|
9
9
|
const e = Ie.type;
|
|
10
|
-
return
|
|
10
|
+
return H({
|
|
11
11
|
modelId: e,
|
|
12
12
|
modelType: Ie.type,
|
|
13
13
|
options: {}
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
-
function
|
|
16
|
+
function Dt(e) {
|
|
17
17
|
return (t) => {
|
|
18
18
|
const { model: r, status: n, KosModelLoader: s } = ye();
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ m(s, { ...n, children: /* @__PURE__ */ m(e, { ...t, assembly: r }) });
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
const De = () => {
|
|
23
23
|
const e = Ae.type;
|
|
24
|
-
return
|
|
24
|
+
return H({
|
|
25
25
|
modelId: e,
|
|
26
26
|
modelType: Ae.type,
|
|
27
27
|
options: {}
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
|
-
function
|
|
30
|
+
function Mt(e) {
|
|
31
31
|
return (t) => {
|
|
32
32
|
const { model: r, status: n, KosModelLoader: s } = De();
|
|
33
|
-
return /* @__PURE__ */
|
|
33
|
+
return /* @__PURE__ */ m(s, { ...n, children: /* @__PURE__ */ m(e, { ...t, beverage: r }) });
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
const Me = (e) =>
|
|
36
|
+
const Me = (e) => H({
|
|
37
37
|
modelId: e,
|
|
38
|
-
modelType:
|
|
38
|
+
modelType: ct.type,
|
|
39
39
|
options: {}
|
|
40
40
|
});
|
|
41
|
-
function
|
|
41
|
+
function Ot(e) {
|
|
42
42
|
return (t) => (r) => {
|
|
43
43
|
const { model: n, status: s, KosModelLoader: i } = Me(t);
|
|
44
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ m(i, { ...s, children: /* @__PURE__ */ m(e, { ...r, board: n }) });
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
const Oe = () => {
|
|
48
48
|
const e = xe.type;
|
|
49
|
-
return
|
|
49
|
+
return H({
|
|
50
50
|
modelId: e,
|
|
51
51
|
modelType: xe.type,
|
|
52
52
|
options: {}
|
|
53
53
|
});
|
|
54
54
|
};
|
|
55
|
-
function
|
|
55
|
+
function Yt(e) {
|
|
56
56
|
return (t) => {
|
|
57
57
|
const { model: r, status: n, KosModelLoader: s } = Oe();
|
|
58
|
-
return /* @__PURE__ */
|
|
58
|
+
return /* @__PURE__ */ m(s, { ...n, children: /* @__PURE__ */ m(e, { ...t, boardContainer: r }) });
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
const Ye = (e) =>
|
|
61
|
+
const Ye = (e) => H({
|
|
62
62
|
modelId: e,
|
|
63
|
-
modelType:
|
|
63
|
+
modelType: dt.type,
|
|
64
64
|
options: {
|
|
65
65
|
path: e
|
|
66
66
|
}
|
|
67
67
|
}), _e = L(void 0), pt = ({ children: e, path: t }) => {
|
|
68
|
-
const { model: r, ready: n } = Ye(t), s =
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
-
},
|
|
71
|
-
const e =
|
|
68
|
+
const { model: r, ready: n } = Ye(t), s = I(() => n && r ? { model: r } : {}, [n, r]);
|
|
69
|
+
return /* @__PURE__ */ m(_e.Provider, { value: s, children: e });
|
|
70
|
+
}, D = () => {
|
|
71
|
+
const e = K(_e);
|
|
72
72
|
if (!e)
|
|
73
73
|
throw new Error("useNozzleContext must be used within a NozzleProvider");
|
|
74
74
|
return e;
|
|
75
|
-
},
|
|
75
|
+
}, ht = ({
|
|
76
76
|
onBeverageSelected: e,
|
|
77
77
|
onClearBeverage: t,
|
|
78
78
|
companionType: r
|
|
79
79
|
}) => {
|
|
80
|
-
const { model: n } =
|
|
80
|
+
const { model: n } = D(), [s, i] = S([]), [u, l] = S(null), f = I(() => r ? s.map(
|
|
81
81
|
(d) => be(d, r)
|
|
82
82
|
) : [], [s, r]), h = o(
|
|
83
83
|
async (d) => {
|
|
@@ -88,7 +88,7 @@ const Ye = (e) => N({
|
|
|
88
88
|
l(null), await (n == null ? void 0 : n.setSelectedPourable({ beverage: void 0 })), t == null || t();
|
|
89
89
|
}, [n, t]);
|
|
90
90
|
return O(() => {
|
|
91
|
-
const d =
|
|
91
|
+
const d = Re(() => {
|
|
92
92
|
if (!n)
|
|
93
93
|
return;
|
|
94
94
|
const $ = n.selectedBrand;
|
|
@@ -97,8 +97,8 @@ const Ye = (e) => N({
|
|
|
97
97
|
i(b ?? []);
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
|
-
const
|
|
101
|
-
i(
|
|
100
|
+
const A = n.getAvailabilityByParent($.id).filter((b) => b.visible);
|
|
101
|
+
i(A ?? []);
|
|
102
102
|
});
|
|
103
103
|
return () => {
|
|
104
104
|
d();
|
|
@@ -110,12 +110,12 @@ const Ye = (e) => N({
|
|
|
110
110
|
selectedBeverage: u,
|
|
111
111
|
clearBeverage: c
|
|
112
112
|
};
|
|
113
|
-
},
|
|
113
|
+
}, ft = ({
|
|
114
114
|
onBrandSelected: e,
|
|
115
115
|
onBrandCleared: t,
|
|
116
116
|
companionType: r
|
|
117
117
|
}) => {
|
|
118
|
-
const { model: n } =
|
|
118
|
+
const { model: n } = D(), [s, i] = S(null), [u, l] = S([]), f = I(() => r ? u.map((d) => be(d, r)) : [], [u, r]), h = o(
|
|
119
119
|
async (d) => {
|
|
120
120
|
i(d), n == null || n.setSelectedBrand(d), e == null || e(d);
|
|
121
121
|
},
|
|
@@ -124,7 +124,7 @@ const Ye = (e) => N({
|
|
|
124
124
|
i(null), n == null || n.setSelectedBrand(void 0), t == null || t();
|
|
125
125
|
}, [n, t]);
|
|
126
126
|
return O(() => {
|
|
127
|
-
const d =
|
|
127
|
+
const d = Re(() => {
|
|
128
128
|
n && l(n.visibleBrands);
|
|
129
129
|
});
|
|
130
130
|
return () => {
|
|
@@ -137,14 +137,14 @@ const Ye = (e) => N({
|
|
|
137
137
|
selectBrand: h,
|
|
138
138
|
clearBrand: c
|
|
139
139
|
};
|
|
140
|
-
},
|
|
140
|
+
}, bt = T.createLogger({
|
|
141
141
|
name: "HoldToPourStrategy",
|
|
142
142
|
group: "kos-hooks"
|
|
143
143
|
}), Ge = {
|
|
144
144
|
name: "HoldToPourStrategy",
|
|
145
145
|
async initiate(e) {
|
|
146
146
|
if (!(e != null && e.canPour)) {
|
|
147
|
-
|
|
147
|
+
bt.debug(`Nozzle ${e == null ? void 0 : e.id} cannot pour. Returning early.`);
|
|
148
148
|
return;
|
|
149
149
|
}
|
|
150
150
|
await (e == null ? void 0 : e.pour());
|
|
@@ -155,14 +155,14 @@ const Ye = (e) => N({
|
|
|
155
155
|
}, re = T.createLogger({
|
|
156
156
|
name: "useNozzlePour",
|
|
157
157
|
group: "kos-hooks"
|
|
158
|
-
}),
|
|
158
|
+
}), vt = ({
|
|
159
159
|
onPour: e,
|
|
160
160
|
onPourCancel: t,
|
|
161
161
|
onBeforePour: r,
|
|
162
162
|
onBeforePourRejected: n,
|
|
163
163
|
strategy: s = Ge
|
|
164
164
|
}) => {
|
|
165
|
-
const { model: i } =
|
|
165
|
+
const { model: i } = D(), u = o(async () => {
|
|
166
166
|
(r ? await (r == null ? void 0 : r()) : !0) ? (re.debug(
|
|
167
167
|
`[${s == null ? void 0 : s.name}] - Pour initiated for nozzle ${i == null ? void 0 : i.id}.`
|
|
168
168
|
), s == null || s.initiate(i), e == null || e()) : (re.debug(
|
|
@@ -184,15 +184,15 @@ const Ye = (e) => N({
|
|
|
184
184
|
cancel: f,
|
|
185
185
|
status: i
|
|
186
186
|
};
|
|
187
|
-
},
|
|
187
|
+
}, $t = ({
|
|
188
188
|
onFlavorSelected: e,
|
|
189
189
|
onFlavorCleared: t,
|
|
190
190
|
companionType: r
|
|
191
191
|
}) => {
|
|
192
|
-
const { model: n } =
|
|
192
|
+
const { model: n } = D(), s = I(
|
|
193
193
|
() => (n == null ? void 0 : n.getGroupAvailabilityItems("flavors").filter((c) => c.visible)) ?? [],
|
|
194
194
|
[n]
|
|
195
|
-
), i =
|
|
195
|
+
), i = I(() => r ? s.map(
|
|
196
196
|
(c) => be(c, r)
|
|
197
197
|
) : [], [s, r]), [u, l] = S([]), f = o(
|
|
198
198
|
async (c) => {
|
|
@@ -221,166 +221,166 @@ const Ye = (e) => N({
|
|
|
221
221
|
selectedFlavors: u,
|
|
222
222
|
clearFlavors: h
|
|
223
223
|
};
|
|
224
|
-
}, Q = "brands", ne = "beverages", X = "flavors", M = T.createLogger({ name: "use-cui-kit" }),
|
|
224
|
+
}, Q = "brands", ne = "beverages", X = "flavors", M = T.createLogger({ name: "use-cui-kit" }), gt = ({
|
|
225
225
|
initialGroup: e = Q,
|
|
226
226
|
options: t = {}
|
|
227
227
|
}) => {
|
|
228
228
|
var ee, te, se;
|
|
229
|
-
const [r, n] = S(e), { model: s } =
|
|
230
|
-
(
|
|
229
|
+
const [r, n] = S(e), { model: s } = D(), i = Ce([]), u = o(
|
|
230
|
+
(p) => {
|
|
231
231
|
n(X);
|
|
232
232
|
const C = `/kos/dispense/${s == null ? void 0 : s.path}/brand/selected/`;
|
|
233
|
-
g.publish(C,
|
|
233
|
+
g.publish(C, p);
|
|
234
234
|
},
|
|
235
235
|
[s == null ? void 0 : s.path]
|
|
236
236
|
), l = o(() => {
|
|
237
|
-
const
|
|
238
|
-
g.publish(
|
|
237
|
+
const p = `/kos/dispense/${s == null ? void 0 : s.path}/brand/cleared/`;
|
|
238
|
+
g.publish(p, {});
|
|
239
239
|
}, [s == null ? void 0 : s.path]), f = o(
|
|
240
|
-
(
|
|
240
|
+
(p) => {
|
|
241
241
|
n(X);
|
|
242
242
|
const C = `/kos/dispense/${s == null ? void 0 : s.path}/beverage/selected/`;
|
|
243
|
-
g.publish(C,
|
|
243
|
+
g.publish(C, p);
|
|
244
244
|
},
|
|
245
245
|
[s == null ? void 0 : s.path]
|
|
246
246
|
), h = o(() => {
|
|
247
|
-
const
|
|
248
|
-
g.publish(
|
|
247
|
+
const p = `/kos/dispense/${s == null ? void 0 : s.path}/beverage/cleared/`;
|
|
248
|
+
g.publish(p, {});
|
|
249
249
|
}, [s == null ? void 0 : s.path]), c = o(
|
|
250
|
-
(
|
|
250
|
+
(p) => {
|
|
251
251
|
const C = `/kos/dispense/${s == null ? void 0 : s.path}/flavor/selected/`;
|
|
252
|
-
g.publish(C,
|
|
252
|
+
g.publish(C, p);
|
|
253
253
|
},
|
|
254
254
|
[s == null ? void 0 : s.path]
|
|
255
255
|
), d = o(() => {
|
|
256
|
-
const
|
|
257
|
-
g.publish(
|
|
256
|
+
const p = `/kos/dispense/${s == null ? void 0 : s.path}/flavor/cleared/`;
|
|
257
|
+
g.publish(p, {});
|
|
258
258
|
}, [s == null ? void 0 : s.path]), $ = o(() => {
|
|
259
|
-
const
|
|
260
|
-
g.publish(
|
|
261
|
-
}, [s == null ? void 0 : s.path]),
|
|
262
|
-
const
|
|
263
|
-
return g.publish(
|
|
259
|
+
const p = `/kos/dispense/${s == null ? void 0 : s.path}/pour/`;
|
|
260
|
+
g.publish(p, {});
|
|
261
|
+
}, [s == null ? void 0 : s.path]), A = o(async () => {
|
|
262
|
+
const p = `/kos/dispense/${s == null ? void 0 : s.path}/pre/pour/`;
|
|
263
|
+
return g.publish(p, {}), await (x == null ? void 0 : x()) || !0;
|
|
264
264
|
}, [s == null ? void 0 : s.path]), b = o(async () => {
|
|
265
|
-
const
|
|
266
|
-
g.publish(
|
|
265
|
+
const p = `/kos/dispense/${s == null ? void 0 : s.path}/pre/pour/rejected/`;
|
|
266
|
+
g.publish(p, {});
|
|
267
267
|
}, [s == null ? void 0 : s.path]), v = o(() => {
|
|
268
|
-
const
|
|
269
|
-
g.publish(
|
|
270
|
-
}, [s == null ? void 0 : s.path]), { brands: a, selectBrand:
|
|
268
|
+
const p = `/kos/dispense/${s == null ? void 0 : s.path}/pour/cancel/`;
|
|
269
|
+
g.publish(p, {});
|
|
270
|
+
}, [s == null ? void 0 : s.path]), { brands: a, selectBrand: G, selectedBrand: R, clearBrand: w, brandCompanions: W } = ft({
|
|
271
271
|
companionType: (ee = t.companionTypes) == null ? void 0 : ee.brand,
|
|
272
272
|
onBrandSelected: u,
|
|
273
273
|
onBrandCleared: l
|
|
274
274
|
}), {
|
|
275
275
|
beverages: ae,
|
|
276
276
|
selectBeverage: oe,
|
|
277
|
-
selectedBeverage:
|
|
278
|
-
clearBeverage:
|
|
279
|
-
beverageCompanions:
|
|
280
|
-
} =
|
|
277
|
+
selectedBeverage: ce,
|
|
278
|
+
clearBeverage: N,
|
|
279
|
+
beverageCompanions: B
|
|
280
|
+
} = ht({
|
|
281
281
|
companionType: (te = t.companionTypes) == null ? void 0 : te.beverage,
|
|
282
282
|
onBeverageSelected: f,
|
|
283
283
|
onClearBeverage: h
|
|
284
284
|
}), {
|
|
285
|
-
clearFlavors:
|
|
286
|
-
flavors:
|
|
287
|
-
selectFlavor:
|
|
288
|
-
selectedFlavors:
|
|
289
|
-
flavorCompanions:
|
|
290
|
-
} =
|
|
285
|
+
clearFlavors: de,
|
|
286
|
+
flavors: q,
|
|
287
|
+
selectFlavor: ue,
|
|
288
|
+
selectedFlavors: F,
|
|
289
|
+
flavorCompanions: P
|
|
290
|
+
} = $t({
|
|
291
291
|
companionType: (se = t.companionTypes) == null ? void 0 : se.flavor,
|
|
292
292
|
onFlavorSelected: c,
|
|
293
293
|
onFlavorCleared: d
|
|
294
|
-
}), [
|
|
295
|
-
|
|
296
|
-
}, []),
|
|
294
|
+
}), [x, U] = S(), k = o((p) => {
|
|
295
|
+
U(() => p);
|
|
296
|
+
}, []), Y = vt({
|
|
297
297
|
onPour: $,
|
|
298
298
|
onPourCancel: v,
|
|
299
|
-
onBeforePour:
|
|
299
|
+
onBeforePour: A,
|
|
300
300
|
onBeforePourRejected: b
|
|
301
|
-
}),
|
|
301
|
+
}), j = o(() => {
|
|
302
302
|
switch (M.debug(`Navigating back from group: ${r}`), r) {
|
|
303
303
|
case Q:
|
|
304
|
-
|
|
304
|
+
N(), w();
|
|
305
305
|
break;
|
|
306
306
|
case ne:
|
|
307
307
|
case X:
|
|
308
|
-
n(e),
|
|
308
|
+
n(e), N(), w();
|
|
309
309
|
break;
|
|
310
310
|
}
|
|
311
|
-
}, [
|
|
312
|
-
const
|
|
313
|
-
g.publish(
|
|
314
|
-
}, [
|
|
311
|
+
}, [N, w, r, e]), V = o(() => {
|
|
312
|
+
const p = `/kos/dispense/${s == null ? void 0 : s.path}/home/`;
|
|
313
|
+
g.publish(p, {}), n(e), e === Q && (N(), w()), e === ne && N();
|
|
314
|
+
}, [N, w, e]), le = o(() => {
|
|
315
315
|
if (i.current.length === 0) {
|
|
316
316
|
M.debug("No timers to pause.");
|
|
317
317
|
return;
|
|
318
318
|
}
|
|
319
|
-
M.debug(`Pausing ${i.current.length} timers.`), i.current.forEach((
|
|
320
|
-
M.debug(`Pausing timer with id ${
|
|
319
|
+
M.debug(`Pausing ${i.current.length} timers.`), i.current.forEach((p) => {
|
|
320
|
+
M.debug(`Pausing timer with id ${p.id}.`), p.pause();
|
|
321
321
|
});
|
|
322
|
-
}, []),
|
|
322
|
+
}, []), me = o(() => {
|
|
323
323
|
if (i.current.length === 0) {
|
|
324
324
|
M.debug("No timers to restart.");
|
|
325
325
|
return;
|
|
326
326
|
}
|
|
327
|
-
M.debug(`Restarting ${i.current.length} timers.`), i.current.forEach((
|
|
328
|
-
M.debug(`Restarting timer with id ${
|
|
327
|
+
M.debug(`Restarting ${i.current.length} timers.`), i.current.forEach((p) => {
|
|
328
|
+
M.debug(`Restarting timer with id ${p.id}.`), p.restart();
|
|
329
329
|
});
|
|
330
330
|
}, []);
|
|
331
331
|
return {
|
|
332
332
|
timers: {
|
|
333
|
-
add: o((
|
|
334
|
-
if (
|
|
335
|
-
if (i.current.some((C) => C.id ===
|
|
336
|
-
M.debug(`Timer with id ${
|
|
333
|
+
add: o((p) => {
|
|
334
|
+
if (p) {
|
|
335
|
+
if (i.current.some((C) => C.id === p.id)) {
|
|
336
|
+
M.debug(`Timer with id ${p.id} already exists.`);
|
|
337
337
|
return;
|
|
338
338
|
}
|
|
339
|
-
i.current.push(
|
|
339
|
+
i.current.push(p);
|
|
340
340
|
}
|
|
341
341
|
}, []),
|
|
342
342
|
pause: le,
|
|
343
|
-
restart:
|
|
343
|
+
restart: me
|
|
344
344
|
},
|
|
345
345
|
nav: {
|
|
346
346
|
currentGroup: r,
|
|
347
|
-
back:
|
|
348
|
-
home:
|
|
347
|
+
back: j,
|
|
348
|
+
home: V
|
|
349
349
|
},
|
|
350
|
-
pour:
|
|
351
|
-
updateOnBeforePour:
|
|
350
|
+
pour: Y,
|
|
351
|
+
updateOnBeforePour: k,
|
|
352
352
|
selections: {
|
|
353
|
-
[Q]:
|
|
354
|
-
[ne]:
|
|
355
|
-
[X]:
|
|
353
|
+
[Q]: R,
|
|
354
|
+
[ne]: ce,
|
|
355
|
+
[X]: F
|
|
356
356
|
},
|
|
357
357
|
[Q]: {
|
|
358
358
|
models: a,
|
|
359
|
-
companions:
|
|
359
|
+
companions: W,
|
|
360
360
|
clear: w,
|
|
361
361
|
handlers: {
|
|
362
|
-
onSelected:
|
|
362
|
+
onSelected: G
|
|
363
363
|
}
|
|
364
364
|
},
|
|
365
365
|
[ne]: {
|
|
366
366
|
models: ae,
|
|
367
|
-
companions:
|
|
368
|
-
clear:
|
|
367
|
+
companions: B,
|
|
368
|
+
clear: N,
|
|
369
369
|
handlers: {
|
|
370
370
|
onSelected: oe
|
|
371
371
|
}
|
|
372
372
|
},
|
|
373
373
|
[X]: {
|
|
374
|
-
models:
|
|
375
|
-
companions:
|
|
376
|
-
clear:
|
|
374
|
+
models: q,
|
|
375
|
+
companions: P,
|
|
376
|
+
clear: de,
|
|
377
377
|
handlers: {
|
|
378
|
-
onSelected:
|
|
378
|
+
onSelected: ue
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
381
|
};
|
|
382
|
-
},
|
|
383
|
-
const { model: t } =
|
|
382
|
+
}, wt = (e) => {
|
|
383
|
+
const { model: t } = D(), [r, n] = S(null), {
|
|
384
384
|
onAmbientTimer: s,
|
|
385
385
|
onAttractTimer: i,
|
|
386
386
|
onResetAttractTimer: u,
|
|
@@ -393,7 +393,7 @@ const Ye = (e) => N({
|
|
|
393
393
|
i && (T.info("Attract timer expired. Calling callback"), i == null || i());
|
|
394
394
|
}, [i]), $ = o(() => {
|
|
395
395
|
r && (r.restart(), u == null || u());
|
|
396
|
-
}, [r, u]),
|
|
396
|
+
}, [r, u]), A = o(() => {
|
|
397
397
|
r && (r.reset(), u == null || u());
|
|
398
398
|
}, [r, u]), b = o(() => {
|
|
399
399
|
r && (r.pause(), l == null || l());
|
|
@@ -401,7 +401,7 @@ const Ye = (e) => N({
|
|
|
401
401
|
return O(() => {
|
|
402
402
|
if (t && f) {
|
|
403
403
|
T.info("Nozzle is available. Creating timers");
|
|
404
|
-
const v =
|
|
404
|
+
const v = Be.createTimer(
|
|
405
405
|
"attract-timer-" + t.path,
|
|
406
406
|
f
|
|
407
407
|
);
|
|
@@ -429,13 +429,13 @@ const Ye = (e) => N({
|
|
|
429
429
|
]), {
|
|
430
430
|
attractTimer: r,
|
|
431
431
|
restart: $,
|
|
432
|
-
pause:
|
|
432
|
+
pause: A,
|
|
433
433
|
resume: b
|
|
434
434
|
};
|
|
435
|
-
},
|
|
435
|
+
}, Tt = (e, t) => {
|
|
436
436
|
if (t)
|
|
437
437
|
return g.subscribe(e, t).unsubscribe;
|
|
438
|
-
},
|
|
438
|
+
}, Pt = ({
|
|
439
439
|
onInit: e,
|
|
440
440
|
onBrandSelected: t,
|
|
441
441
|
onBrandCleared: r,
|
|
@@ -449,13 +449,13 @@ const Ye = (e) => N({
|
|
|
449
449
|
onBeforePourRejected: c,
|
|
450
450
|
onAmbientTimer: d,
|
|
451
451
|
onAttractTimer: $,
|
|
452
|
-
onResumeAttractTimer:
|
|
452
|
+
onResumeAttractTimer: A,
|
|
453
453
|
onIdleTimeout: b,
|
|
454
454
|
onAreYouThereTimeout: v
|
|
455
455
|
}) => {
|
|
456
|
-
const { model: a } =
|
|
456
|
+
const { model: a } = D();
|
|
457
457
|
O(() => {
|
|
458
|
-
const
|
|
458
|
+
const R = [
|
|
459
459
|
{
|
|
460
460
|
topic: `/kos/dispense/${a == null ? void 0 : a.path}/brand/selected/`,
|
|
461
461
|
callback: t
|
|
@@ -499,7 +499,7 @@ const Ye = (e) => N({
|
|
|
499
499
|
},
|
|
500
500
|
{
|
|
501
501
|
topic: `/kos/dispense/${a == null ? void 0 : a.path}/attract/resume/`,
|
|
502
|
-
callback:
|
|
502
|
+
callback: A
|
|
503
503
|
},
|
|
504
504
|
{
|
|
505
505
|
topic: `/kos/dispense/${a == null ? void 0 : a.path}/idle/timeout/`,
|
|
@@ -518,10 +518,10 @@ const Ye = (e) => N({
|
|
|
518
518
|
callback: l
|
|
519
519
|
}
|
|
520
520
|
].map(
|
|
521
|
-
({ topic: w, callback:
|
|
521
|
+
({ topic: w, callback: W }) => Tt(w, W)
|
|
522
522
|
);
|
|
523
523
|
return () => {
|
|
524
|
-
|
|
524
|
+
R.forEach((w) => w == null ? void 0 : w());
|
|
525
525
|
};
|
|
526
526
|
}, [
|
|
527
527
|
a == null ? void 0 : a.path,
|
|
@@ -535,41 +535,41 @@ const Ye = (e) => N({
|
|
|
535
535
|
u,
|
|
536
536
|
f,
|
|
537
537
|
h,
|
|
538
|
-
|
|
538
|
+
A,
|
|
539
539
|
b,
|
|
540
540
|
v,
|
|
541
541
|
e,
|
|
542
542
|
l
|
|
543
543
|
]);
|
|
544
|
-
},
|
|
545
|
-
const { model: t } =
|
|
544
|
+
}, y = T.createLogger({ name: "useCuiKitTimers" }), Ke = (e) => {
|
|
545
|
+
const { model: t } = D(), [r, n] = S(null), {
|
|
546
546
|
onAreYouThereTimer: s,
|
|
547
547
|
onIdleTimer: i,
|
|
548
548
|
onResetIdleTimer: u,
|
|
549
549
|
defaultAreYouThereTime: l = 10,
|
|
550
550
|
defaultIdleTime: f = 20
|
|
551
|
-
} = e, h =
|
|
551
|
+
} = e, h = Ce(!1), c = o(() => {
|
|
552
552
|
!h.current && s && (T.info("Are you there timer expired. Calling callback"), h.current = !0, s == null || s());
|
|
553
553
|
}, [s]), d = o(() => {
|
|
554
|
-
|
|
554
|
+
y.debug(
|
|
555
555
|
"handleIdleTimer called in useCuiKitTimers, onIdleTimer exists:",
|
|
556
556
|
!!i
|
|
557
|
-
), i ? (
|
|
557
|
+
), i ? (y.debug("Idle timer expired. Calling callback"), i == null || i()) : y.debug("No onIdleTimer callback provided!");
|
|
558
558
|
}, [i]), $ = o(() => {
|
|
559
|
-
|
|
560
|
-
}, [r, u, e.prefix]),
|
|
561
|
-
|
|
559
|
+
y.debug(`TIMER RESTART called for ${e.prefix ?? ""}timer`), r && (r.restart(), h.current = !1, u == null || u());
|
|
560
|
+
}, [r, u, e.prefix]), A = o(() => {
|
|
561
|
+
y.debug(`⏸TIMER PAUSE/RESET called for ${e.prefix ?? ""}timer`), r && (r.reset(), h.current = !1, u == null || u());
|
|
562
562
|
}, [r, u, e.prefix]);
|
|
563
563
|
return O(() => {
|
|
564
|
-
if (
|
|
564
|
+
if (y.debug(
|
|
565
565
|
`useCuiKitTimers effect triggered - nozzle: ${!!t}, path: ${t == null ? void 0 : t.path}, callbacks: handleIdle=${!!d}, handleAreYouThere=${!!c}`
|
|
566
566
|
), t) {
|
|
567
|
-
|
|
568
|
-
const b =
|
|
567
|
+
y.info("Nozzle is available. Creating timers");
|
|
568
|
+
const b = Be.createTimer(
|
|
569
569
|
`${e.prefix ?? ""}idle-timer-${t.path}`,
|
|
570
570
|
f
|
|
571
571
|
);
|
|
572
|
-
return
|
|
572
|
+
return y.debug(
|
|
573
573
|
`⏱Adding idle timer action for ${e.prefix ?? ""}idle-timer-${t.path} with callback:`,
|
|
574
574
|
!!d
|
|
575
575
|
), b == null || b.addTimeoutAction({
|
|
@@ -585,7 +585,7 @@ const Ye = (e) => N({
|
|
|
585
585
|
};
|
|
586
586
|
}
|
|
587
587
|
return () => {
|
|
588
|
-
|
|
588
|
+
y.info("Nozzle is not available. No timers to clear");
|
|
589
589
|
};
|
|
590
590
|
}, [
|
|
591
591
|
l,
|
|
@@ -597,9 +597,9 @@ const Ye = (e) => N({
|
|
|
597
597
|
]), {
|
|
598
598
|
idleTimer: r,
|
|
599
599
|
restart: $,
|
|
600
|
-
pause:
|
|
600
|
+
pause: A
|
|
601
601
|
};
|
|
602
|
-
},
|
|
602
|
+
}, _ = T.createLogger({ name: "useDefaultCuiKitLifecycle" }), _t = ({
|
|
603
603
|
kit: e,
|
|
604
604
|
inactivity: t,
|
|
605
605
|
pour: r,
|
|
@@ -608,52 +608,55 @@ const Ye = (e) => N({
|
|
|
608
608
|
areYouThereRejectionPolicy: i = "pause"
|
|
609
609
|
}) => {
|
|
610
610
|
var ge, we, Te, Pe;
|
|
611
|
-
const [u, l] = S(!1), [f, h] = S(!1), { model: c } =
|
|
612
|
-
if (
|
|
611
|
+
const [u, l] = S(!1), [f, h] = S(!1), { model: c } = D(), [d, $] = S(!1), A = (t == null ? void 0 : t.idleTimeout) ?? 15, b = (t == null ? void 0 : t.areYouThereTimeoutOffset) ?? 10, v = (r == null ? void 0 : r.idleTimeout) ?? (t == null ? void 0 : t.idleTimeout) ?? 10, a = (r == null ? void 0 : r.areYouThereTimeoutOffset) ?? (t == null ? void 0 : t.areYouThereTimeoutOffset) ?? 5, G = n == null ? void 0 : n.ambientTimeoutOffset, R = n == null ? void 0 : n.attractTimeout, w = o(() => {
|
|
612
|
+
if (_.info("handleIdleTimeout called - navigating home and publishing event"), F(!1), e == null || e.nav.home(), c) {
|
|
613
613
|
const E = `/kos/dispense/${c.path}/idle/timeout/`;
|
|
614
614
|
g.publish(E, {});
|
|
615
615
|
}
|
|
616
|
-
}, [(ge = e == null ? void 0 : e.nav) == null ? void 0 : ge.home, c]),
|
|
617
|
-
|
|
616
|
+
}, [(ge = e == null ? void 0 : e.nav) == null ? void 0 : ge.home, c]), W = o(() => {
|
|
617
|
+
_.info("handleResetIdleTimer called - resetting idle timer"), F(!1);
|
|
618
|
+
}, []), ae = o(() => {
|
|
619
|
+
if (G && (l(!0), h(!1), c)) {
|
|
618
620
|
const E = `/kos/dispense/${c.path}/ambient/start/`;
|
|
619
621
|
g.publish(E, {});
|
|
620
622
|
}
|
|
621
|
-
}, [
|
|
622
|
-
if (
|
|
623
|
+
}, [G, c]), oe = o(() => {
|
|
624
|
+
if (R && (h(!0), l(!1), c)) {
|
|
623
625
|
const E = `/kos/dispense/${c.path}/attract/start/`;
|
|
624
626
|
g.publish(E, {});
|
|
625
627
|
}
|
|
626
|
-
}, [
|
|
627
|
-
if (
|
|
628
|
+
}, [R, c]), ce = o(() => {
|
|
629
|
+
if (R && (h(!1), l(!1), e == null || e.nav.home(), c)) {
|
|
628
630
|
const E = `/kos/dispense/${c.path}/attract/resume/`;
|
|
629
631
|
g.publish(E, {});
|
|
630
632
|
}
|
|
631
|
-
}, [e == null ? void 0 : e.nav,
|
|
632
|
-
pause:
|
|
633
|
-
restart:
|
|
634
|
-
resume:
|
|
635
|
-
attractTimer:
|
|
636
|
-
} =
|
|
637
|
-
defaultAmbientTime:
|
|
638
|
-
defaultAttractTime:
|
|
639
|
-
onAmbientTimer:
|
|
640
|
-
onAttractTimer:
|
|
641
|
-
onResumeAttractTimer:
|
|
633
|
+
}, [e == null ? void 0 : e.nav, R, c]), {
|
|
634
|
+
pause: N,
|
|
635
|
+
restart: B,
|
|
636
|
+
resume: de,
|
|
637
|
+
attractTimer: q
|
|
638
|
+
} = wt({
|
|
639
|
+
defaultAmbientTime: G,
|
|
640
|
+
defaultAttractTime: R,
|
|
641
|
+
onAmbientTimer: ae,
|
|
642
|
+
onAttractTimer: oe,
|
|
643
|
+
onResumeAttractTimer: ce
|
|
642
644
|
});
|
|
643
|
-
(we = e == null ? void 0 : e.timers) == null || we.add(
|
|
644
|
-
const [
|
|
645
|
-
|
|
645
|
+
(we = e == null ? void 0 : e.timers) == null || we.add(q);
|
|
646
|
+
const [ue, F] = S(!1);
|
|
647
|
+
_.info(
|
|
646
648
|
"Creating idle timer with timeout:",
|
|
647
|
-
|
|
649
|
+
A,
|
|
648
650
|
"seconds and callback:",
|
|
649
651
|
!!w
|
|
650
652
|
);
|
|
651
|
-
const { pause:
|
|
653
|
+
const { pause: P, restart: x, idleTimer: U } = Ke({
|
|
652
654
|
defaultAreYouThereTime: b,
|
|
653
|
-
defaultIdleTime:
|
|
654
|
-
onIdleTimer: w
|
|
655
|
+
defaultIdleTime: A,
|
|
656
|
+
onIdleTimer: w,
|
|
657
|
+
onResetIdleTimer: W
|
|
655
658
|
});
|
|
656
|
-
|
|
659
|
+
_.info(
|
|
657
660
|
"Creating pour timer with timeout:",
|
|
658
661
|
v,
|
|
659
662
|
"seconds and callback:",
|
|
@@ -662,141 +665,141 @@ const Ye = (e) => N({
|
|
|
662
665
|
const {
|
|
663
666
|
pause: k,
|
|
664
667
|
restart: Y,
|
|
665
|
-
idleTimer:
|
|
668
|
+
idleTimer: j
|
|
666
669
|
} = Ke({
|
|
667
670
|
defaultAreYouThereTime: a,
|
|
668
671
|
defaultIdleTime: v,
|
|
669
672
|
onIdleTimer: w,
|
|
670
673
|
prefix: "pour-"
|
|
671
|
-
}),
|
|
674
|
+
}), V = o(async () => {
|
|
672
675
|
let E = !0;
|
|
673
676
|
if (s)
|
|
674
677
|
try {
|
|
675
678
|
E = await s();
|
|
676
|
-
} catch (
|
|
677
|
-
|
|
679
|
+
} catch (pe) {
|
|
680
|
+
_.error(`onBeforeAreYouThereTimer callback failed: ${pe}`), E = !1;
|
|
678
681
|
}
|
|
679
682
|
if (E) {
|
|
680
683
|
if (c) {
|
|
681
|
-
const
|
|
682
|
-
g.publish(
|
|
684
|
+
const pe = `/kos/dispense/${c.path}/are-you-there/timeout/`;
|
|
685
|
+
g.publish(pe, {});
|
|
683
686
|
}
|
|
684
|
-
|
|
687
|
+
F(!0), d ? k() : P();
|
|
685
688
|
} else
|
|
686
689
|
switch (i) {
|
|
687
690
|
case "pause":
|
|
688
|
-
d ? k() :
|
|
691
|
+
d ? k() : P();
|
|
689
692
|
break;
|
|
690
693
|
case "restart":
|
|
691
|
-
d ? Y() :
|
|
694
|
+
d ? Y() : x();
|
|
692
695
|
break;
|
|
693
696
|
}
|
|
694
|
-
}, [s, c, i, d]),
|
|
695
|
-
|
|
696
|
-
}, [d,
|
|
697
|
+
}, [s, c, i, d]), le = o(() => {
|
|
698
|
+
F(!1), d ? (Y(), P()) : (x(), k());
|
|
699
|
+
}, [d, P, k, x, Y]);
|
|
697
700
|
O(() => {
|
|
698
|
-
|
|
701
|
+
U && U.addTimeoutAction({
|
|
699
702
|
name: "are-you-there-timer",
|
|
700
703
|
remainingTime: b,
|
|
701
|
-
action:
|
|
704
|
+
action: V
|
|
702
705
|
});
|
|
703
|
-
}, [
|
|
704
|
-
|
|
706
|
+
}, [U, b, V]), O(() => {
|
|
707
|
+
j && j.addTimeoutAction({
|
|
705
708
|
name: "pour-are-you-there-timer",
|
|
706
709
|
remainingTime: a,
|
|
707
|
-
action:
|
|
710
|
+
action: V
|
|
708
711
|
});
|
|
709
|
-
}, [
|
|
710
|
-
const
|
|
711
|
-
$(!1), k(),
|
|
712
|
-
}, [
|
|
713
|
-
$(!0),
|
|
714
|
-
}, [
|
|
715
|
-
$(!1),
|
|
716
|
-
}, []),
|
|
717
|
-
|
|
718
|
-
}, [
|
|
719
|
-
h(!1), l(!1), $(!1), k(),
|
|
720
|
-
}, [
|
|
721
|
-
h(!1), l(!1), $(!1),
|
|
722
|
-
}, [
|
|
723
|
-
h(!1), l(!1), $(!1),
|
|
724
|
-
}, [
|
|
725
|
-
h(!1), l(!1),
|
|
726
|
-
}, [
|
|
727
|
-
|
|
728
|
-
onBrandSelected:
|
|
729
|
-
onBrandCleared:
|
|
730
|
-
onBeverageSelected:
|
|
731
|
-
onBeverageCleared:
|
|
732
|
-
onPour:
|
|
733
|
-
onPourCancel:
|
|
734
|
-
onBeforePourRejected:
|
|
735
|
-
onInit:
|
|
712
|
+
}, [j, a, V]), (Te = e == null ? void 0 : e.timers) == null || Te.add(U), (Pe = e == null ? void 0 : e.timers) == null || Pe.add(j);
|
|
713
|
+
const me = o(() => {
|
|
714
|
+
$(!1), k(), P();
|
|
715
|
+
}, [P, k]), $e = o(() => {
|
|
716
|
+
$(!0), _.info("restarting pour timer"), Y(), P();
|
|
717
|
+
}, [P, Y]), ee = o(() => {
|
|
718
|
+
$(!1), _.info("restarting pour timer on before pour rejected"), k(), x();
|
|
719
|
+
}, []), te = o(() => {
|
|
720
|
+
N(), h(!1), l(!1), x();
|
|
721
|
+
}, [N, x]), se = o(() => {
|
|
722
|
+
h(!1), l(!1), $(!1), k(), B();
|
|
723
|
+
}, [B, k]), p = o(() => {
|
|
724
|
+
h(!1), l(!1), $(!1), N(), x();
|
|
725
|
+
}, [N, x]), C = o(() => {
|
|
726
|
+
h(!1), l(!1), $(!1), B(), P(), k();
|
|
727
|
+
}, [B, P, k]), nt = o(() => {
|
|
728
|
+
h(!1), l(!1), B(), P();
|
|
729
|
+
}, [B, P]);
|
|
730
|
+
Pt({
|
|
731
|
+
onBrandSelected: te,
|
|
732
|
+
onBrandCleared: se,
|
|
733
|
+
onBeverageSelected: p,
|
|
734
|
+
onBeverageCleared: C,
|
|
735
|
+
onPour: me,
|
|
736
|
+
onPourCancel: $e,
|
|
737
|
+
onBeforePourRejected: ee,
|
|
738
|
+
onInit: nt
|
|
736
739
|
// Note: Timer-related handlers (onIdleTimeout, onAmbientTimer, onAttractTimer,
|
|
737
740
|
// onResumeAttractTimer, onAreYouThereTimeout) are NOT included here since this
|
|
738
741
|
// component's own timer hooks call those handlers directly. Including them would
|
|
739
742
|
// create circular event loops.
|
|
740
743
|
});
|
|
741
|
-
const
|
|
744
|
+
const it = d ? a : b;
|
|
742
745
|
return O(() => {
|
|
743
|
-
if (c &&
|
|
746
|
+
if (c && q) {
|
|
744
747
|
const E = `/kos/dispense/${c == null ? void 0 : c.path}/init/`;
|
|
745
748
|
g.publish(E, {});
|
|
746
749
|
}
|
|
747
|
-
}, [c,
|
|
748
|
-
showAreYouThere:
|
|
749
|
-
clearAreYouThere:
|
|
750
|
-
pauseIdleTimer:
|
|
751
|
-
restartIdleTimer:
|
|
752
|
-
areYouThereCountdown:
|
|
750
|
+
}, [c, q]), {
|
|
751
|
+
showAreYouThere: ue,
|
|
752
|
+
clearAreYouThere: le,
|
|
753
|
+
pauseIdleTimer: P,
|
|
754
|
+
restartIdleTimer: x,
|
|
755
|
+
areYouThereCountdown: it,
|
|
753
756
|
showAmbientScreen: u,
|
|
754
757
|
showAttractScreen: f,
|
|
755
|
-
pauseScreenTimer:
|
|
756
|
-
restartScreenTimer:
|
|
758
|
+
pauseScreenTimer: de,
|
|
759
|
+
restartScreenTimer: B
|
|
757
760
|
};
|
|
758
761
|
}, Fe = () => {
|
|
759
762
|
const e = ke.type;
|
|
760
|
-
return
|
|
763
|
+
return H({
|
|
761
764
|
modelId: e,
|
|
762
765
|
modelType: ke.type,
|
|
763
766
|
options: {}
|
|
764
767
|
});
|
|
765
768
|
};
|
|
766
|
-
function
|
|
769
|
+
function Gt(e) {
|
|
767
770
|
return (t) => {
|
|
768
771
|
const { model: r, status: n, KosModelLoader: s } = Fe();
|
|
769
|
-
return /* @__PURE__ */
|
|
772
|
+
return /* @__PURE__ */ m(s, { ...n, children: /* @__PURE__ */ m(e, { ...t, deviceAssembly: r }) });
|
|
770
773
|
};
|
|
771
774
|
}
|
|
772
|
-
const Ue = (e) =>
|
|
775
|
+
const Ue = (e) => H({
|
|
773
776
|
modelId: e,
|
|
774
|
-
modelType:
|
|
777
|
+
modelType: ut.type,
|
|
775
778
|
options: {}
|
|
776
779
|
});
|
|
777
|
-
function
|
|
780
|
+
function Ft(e, t) {
|
|
778
781
|
return (r) => {
|
|
779
782
|
const { model: n, status: s, KosModelLoader: i } = Ue(e);
|
|
780
|
-
return /* @__PURE__ */
|
|
783
|
+
return /* @__PURE__ */ m(i, { ...s, children: /* @__PURE__ */ m(t, { ...r, holder: n }) });
|
|
781
784
|
};
|
|
782
785
|
}
|
|
783
786
|
const je = () => {
|
|
784
787
|
const e = Ee.type;
|
|
785
|
-
return
|
|
788
|
+
return H({
|
|
786
789
|
modelId: e,
|
|
787
790
|
modelType: Ee.type,
|
|
788
791
|
options: {}
|
|
789
792
|
});
|
|
790
793
|
};
|
|
791
|
-
function
|
|
794
|
+
function Ut(e) {
|
|
792
795
|
return (t) => {
|
|
793
796
|
const { model: r, status: n, KosModelLoader: s } = je();
|
|
794
|
-
return /* @__PURE__ */
|
|
797
|
+
return /* @__PURE__ */ m(s, { ...n, children: /* @__PURE__ */ m(e, { ...t, holderContainer: r }) });
|
|
795
798
|
};
|
|
796
799
|
}
|
|
797
800
|
const Ve = () => {
|
|
798
801
|
const e = Se.type;
|
|
799
|
-
return
|
|
802
|
+
return H({
|
|
800
803
|
modelId: e,
|
|
801
804
|
modelType: Se.type,
|
|
802
805
|
options: {}
|
|
@@ -804,7 +807,7 @@ const Ve = () => {
|
|
|
804
807
|
}, he = T.createLogger({
|
|
805
808
|
name: "HoldToPourIntentStrategy",
|
|
806
809
|
group: "kos-hooks"
|
|
807
|
-
}),
|
|
810
|
+
}), It = {
|
|
808
811
|
name: "HoldToPourIntentStrategy",
|
|
809
812
|
async initiate(e, t) {
|
|
810
813
|
if (!(e != null && e.canPour)) {
|
|
@@ -819,11 +822,11 @@ const Ve = () => {
|
|
|
819
822
|
}, fe = T.createLogger({
|
|
820
823
|
name: "useNozzlePour",
|
|
821
824
|
group: "kos-hooks"
|
|
822
|
-
}),
|
|
825
|
+
}), jt = ({
|
|
823
826
|
onPour: e,
|
|
824
827
|
onPourCancel: t,
|
|
825
828
|
intentContainer: r,
|
|
826
|
-
strategy: n =
|
|
829
|
+
strategy: n = It
|
|
827
830
|
}) => {
|
|
828
831
|
const s = o(() => {
|
|
829
832
|
fe.debug(
|
|
@@ -846,36 +849,36 @@ const Ve = () => {
|
|
|
846
849
|
status: r
|
|
847
850
|
};
|
|
848
851
|
};
|
|
849
|
-
function
|
|
852
|
+
function Vt(e) {
|
|
850
853
|
return (t) => {
|
|
851
854
|
const { model: r, status: n, KosModelLoader: s } = Ve();
|
|
852
|
-
return /* @__PURE__ */
|
|
855
|
+
return /* @__PURE__ */ m(s, { ...n, children: /* @__PURE__ */ m(e, { ...t, ingredient: r }) });
|
|
853
856
|
};
|
|
854
857
|
}
|
|
855
858
|
const We = () => {
|
|
856
859
|
const e = Ne.type;
|
|
857
|
-
return
|
|
860
|
+
return H({
|
|
858
861
|
modelId: e,
|
|
859
862
|
modelType: Ne.type,
|
|
860
863
|
options: {}
|
|
861
864
|
});
|
|
862
865
|
};
|
|
863
|
-
function
|
|
866
|
+
function Wt(e) {
|
|
864
867
|
return (t) => {
|
|
865
868
|
const { model: r, status: n, KosModelLoader: s } = We();
|
|
866
|
-
return /* @__PURE__ */
|
|
869
|
+
return /* @__PURE__ */ m(s, { ...n, children: /* @__PURE__ */ m(e, { ...t, ingredientContainer: r }) });
|
|
867
870
|
};
|
|
868
871
|
}
|
|
869
|
-
function
|
|
872
|
+
function qt(e, t) {
|
|
870
873
|
return (r) => {
|
|
871
874
|
const { model: n, status: s, KosModelLoader: i } = Ye(e);
|
|
872
|
-
return /* @__PURE__ */
|
|
875
|
+
return /* @__PURE__ */ m(i, { ...s, children: /* @__PURE__ */ m(t, { ...r, nozzle: n }) });
|
|
873
876
|
};
|
|
874
877
|
}
|
|
875
878
|
const Z = T.createLogger({
|
|
876
879
|
name: "usePour",
|
|
877
880
|
group: "kos-hooks"
|
|
878
|
-
}),
|
|
881
|
+
}), Jt = ({
|
|
879
882
|
onBeforePour: e,
|
|
880
883
|
onPour: t,
|
|
881
884
|
onPourCancel: r,
|
|
@@ -911,7 +914,7 @@ const Z = T.createLogger({
|
|
|
911
914
|
name: "TapOrHoldIntentStrategy",
|
|
912
915
|
group: "kos-hooks"
|
|
913
916
|
});
|
|
914
|
-
class
|
|
917
|
+
class Qt {
|
|
915
918
|
constructor(t) {
|
|
916
919
|
J(this, "intent");
|
|
917
920
|
J(this, "name", "TapOrHoldIntentStrategy");
|
|
@@ -939,7 +942,7 @@ class Jt {
|
|
|
939
942
|
const ie = T.createLogger({
|
|
940
943
|
name: "TapToPourIntentStrategy",
|
|
941
944
|
group: "kos-hooks"
|
|
942
|
-
}),
|
|
945
|
+
}), Xt = {
|
|
943
946
|
name: "TapToPourIntentStrategy",
|
|
944
947
|
async initiate(e, t) {
|
|
945
948
|
if (e != null && e.isPouring) {
|
|
@@ -958,7 +961,7 @@ const ie = T.createLogger({
|
|
|
958
961
|
}, Le = T.createLogger({
|
|
959
962
|
name: "HoldToPourStrategy",
|
|
960
963
|
group: "kos-hooks"
|
|
961
|
-
}),
|
|
964
|
+
}), Zt = {
|
|
962
965
|
name: "TapToPourStrategy",
|
|
963
966
|
async initiate(e) {
|
|
964
967
|
if (e != null && e.isPouring) {
|
|
@@ -974,29 +977,29 @@ const ie = T.createLogger({
|
|
|
974
977
|
async initiateEnded(e) {
|
|
975
978
|
return !0;
|
|
976
979
|
}
|
|
977
|
-
},
|
|
980
|
+
}, At = (e, t, r) => H({
|
|
978
981
|
modelId: e,
|
|
979
|
-
modelType:
|
|
982
|
+
modelType: lt.type,
|
|
980
983
|
options: {
|
|
981
984
|
servicePathFactory: t,
|
|
982
985
|
selectedId: r
|
|
983
986
|
}
|
|
984
987
|
});
|
|
985
|
-
function
|
|
988
|
+
function zt(e) {
|
|
986
989
|
return (t) => {
|
|
987
|
-
const { model: r, status: n, KosModelLoader: s } =
|
|
990
|
+
const { model: r, status: n, KosModelLoader: s } = At(
|
|
988
991
|
t.id,
|
|
989
992
|
t.servicePathFactory,
|
|
990
993
|
t.itemId
|
|
991
994
|
);
|
|
992
|
-
return /* @__PURE__ */
|
|
995
|
+
return /* @__PURE__ */ m(s, { ...n, children: /* @__PURE__ */ m(e, { ...t, genericPour: r }) });
|
|
993
996
|
};
|
|
994
997
|
}
|
|
995
|
-
const qe = L(void 0),
|
|
996
|
-
const { model: t, ready: r } = ye(), n =
|
|
997
|
-
return /* @__PURE__ */
|
|
998
|
-
},
|
|
999
|
-
const e =
|
|
998
|
+
const qe = L(void 0), es = ({ children: e }) => {
|
|
999
|
+
const { model: t, ready: r } = ye(), n = I(() => r && t ? { model: t } : {}, [r, t]);
|
|
1000
|
+
return /* @__PURE__ */ m(qe.Provider, { value: n, children: e });
|
|
1001
|
+
}, ts = () => {
|
|
1002
|
+
const e = K(
|
|
1000
1003
|
qe
|
|
1001
1004
|
);
|
|
1002
1005
|
if (!e)
|
|
@@ -1004,29 +1007,29 @@ const qe = L(void 0), zt = ({ children: e }) => {
|
|
|
1004
1007
|
"useAssemblyContext must be used within a AssemblyProvider"
|
|
1005
1008
|
);
|
|
1006
1009
|
return e;
|
|
1007
|
-
}, Je = L(void 0),
|
|
1008
|
-
const { model: t, ready: r } = De(), n =
|
|
1009
|
-
return /* @__PURE__ */
|
|
1010
|
-
},
|
|
1011
|
-
const e =
|
|
1010
|
+
}, Je = L(void 0), ss = ({ children: e }) => {
|
|
1011
|
+
const { model: t, ready: r } = De(), n = I(() => r && t ? { model: t } : {}, [r, t]);
|
|
1012
|
+
return /* @__PURE__ */ m(Je.Provider, { value: n, children: e });
|
|
1013
|
+
}, rs = () => {
|
|
1014
|
+
const e = K(Je);
|
|
1012
1015
|
if (!e)
|
|
1013
1016
|
throw new Error(
|
|
1014
1017
|
"useAvailabilityContext must be used within a AvailabilityProvider"
|
|
1015
1018
|
);
|
|
1016
1019
|
return e;
|
|
1017
|
-
}, Qe = L(void 0),
|
|
1018
|
-
const { model: r, ready: n } = Me(t), s =
|
|
1019
|
-
return /* @__PURE__ */
|
|
1020
|
-
},
|
|
1021
|
-
const e =
|
|
1020
|
+
}, Qe = L(void 0), ns = ({ children: e, id: t }) => {
|
|
1021
|
+
const { model: r, ready: n } = Me(t), s = I(() => n && r ? { model: r } : {}, [n, r]);
|
|
1022
|
+
return /* @__PURE__ */ m(Qe.Provider, { value: s, children: e });
|
|
1023
|
+
}, is = () => {
|
|
1024
|
+
const e = K(Qe);
|
|
1022
1025
|
if (!e)
|
|
1023
1026
|
throw new Error("useBoardContext must be used within a BoardProvider");
|
|
1024
1027
|
return e;
|
|
1025
|
-
}, Xe = L(void 0),
|
|
1026
|
-
const { model: t, ready: r } = Oe(), n =
|
|
1027
|
-
return /* @__PURE__ */
|
|
1028
|
-
},
|
|
1029
|
-
const e =
|
|
1028
|
+
}, Xe = L(void 0), as = ({ children: e }) => {
|
|
1029
|
+
const { model: t, ready: r } = Oe(), n = I(() => r && t ? { model: t } : {}, [r, t]);
|
|
1030
|
+
return /* @__PURE__ */ m(Xe.Provider, { value: n, children: e });
|
|
1031
|
+
}, os = () => {
|
|
1032
|
+
const e = K(Xe);
|
|
1030
1033
|
if (!e)
|
|
1031
1034
|
throw new Error(
|
|
1032
1035
|
"useBoardContainerContext must be used within a BoardContainerProvider"
|
|
@@ -1034,49 +1037,49 @@ const qe = L(void 0), zt = ({ children: e }) => {
|
|
|
1034
1037
|
return e;
|
|
1035
1038
|
}, Ze = L(
|
|
1036
1039
|
void 0
|
|
1037
|
-
),
|
|
1038
|
-
const { model: t, ready: r } = Fe(), n =
|
|
1040
|
+
), xt = ({ children: e }) => {
|
|
1041
|
+
const { model: t, ready: r } = Fe(), n = I(() => {
|
|
1039
1042
|
if (r && t) {
|
|
1040
1043
|
const i = t.nozzlePaths;
|
|
1041
1044
|
return { model: t, nozzlePaths: i };
|
|
1042
1045
|
}
|
|
1043
1046
|
return {};
|
|
1044
1047
|
}, [r, t]), s = r && t ? e : null;
|
|
1045
|
-
return /* @__PURE__ */
|
|
1046
|
-
},
|
|
1047
|
-
const e =
|
|
1048
|
+
return /* @__PURE__ */ m(Ze.Provider, { value: n, children: s });
|
|
1049
|
+
}, kt = () => {
|
|
1050
|
+
const e = K(Ze);
|
|
1048
1051
|
if (!e)
|
|
1049
1052
|
throw new Error(
|
|
1050
1053
|
"useDeviceAssemblyContext must be used within a DeviceAssemblyProvider"
|
|
1051
1054
|
);
|
|
1052
1055
|
return e;
|
|
1053
1056
|
};
|
|
1054
|
-
function
|
|
1055
|
-
const e =
|
|
1057
|
+
function Et() {
|
|
1058
|
+
const e = mt.createContext(null);
|
|
1056
1059
|
return [() => {
|
|
1057
|
-
const r =
|
|
1060
|
+
const r = K(e);
|
|
1058
1061
|
if (r === void 0)
|
|
1059
1062
|
throw new Error("useDispenseKitContext must be used within a Provider");
|
|
1060
1063
|
return r;
|
|
1061
1064
|
}, e.Provider];
|
|
1062
1065
|
}
|
|
1063
|
-
function
|
|
1066
|
+
function St({
|
|
1064
1067
|
children: e,
|
|
1065
1068
|
provider: t,
|
|
1066
1069
|
props: r,
|
|
1067
1070
|
nozzleProps: n
|
|
1068
1071
|
}) {
|
|
1069
|
-
const s =
|
|
1070
|
-
return /* @__PURE__ */
|
|
1072
|
+
const s = gt(r);
|
|
1073
|
+
return /* @__PURE__ */ m(t, { value: s, children: e(n || {}) });
|
|
1071
1074
|
}
|
|
1072
|
-
function
|
|
1075
|
+
function Nt({
|
|
1073
1076
|
children: e,
|
|
1074
1077
|
provider: t,
|
|
1075
1078
|
props: r
|
|
1076
1079
|
}) {
|
|
1077
|
-
const { nozzlePaths: n } =
|
|
1078
|
-
return (n == null ? void 0 : n.map((u, l) => /* @__PURE__ */
|
|
1079
|
-
|
|
1080
|
+
const { nozzlePaths: n } = kt(), s = (n == null ? void 0 : n.length) || 0;
|
|
1081
|
+
return (n == null ? void 0 : n.map((u, l) => /* @__PURE__ */ m(pt, { path: u, children: /* @__PURE__ */ m(
|
|
1082
|
+
St,
|
|
1080
1083
|
{
|
|
1081
1084
|
provider: t,
|
|
1082
1085
|
props: r,
|
|
@@ -1091,12 +1094,12 @@ function St({
|
|
|
1091
1094
|
}
|
|
1092
1095
|
) }, u))) || [];
|
|
1093
1096
|
}
|
|
1094
|
-
function
|
|
1097
|
+
function Ht({
|
|
1095
1098
|
provider: e,
|
|
1096
1099
|
props: t
|
|
1097
1100
|
}) {
|
|
1098
|
-
return ({ children: r }) => e ? /* @__PURE__ */
|
|
1099
|
-
|
|
1101
|
+
return ({ children: r }) => e ? /* @__PURE__ */ m(xt, { children: /* @__PURE__ */ m(
|
|
1102
|
+
Nt,
|
|
1100
1103
|
{
|
|
1101
1104
|
provider: e,
|
|
1102
1105
|
props: t,
|
|
@@ -1104,38 +1107,38 @@ function Nt({
|
|
|
1104
1107
|
}
|
|
1105
1108
|
) }) : null;
|
|
1106
1109
|
}
|
|
1107
|
-
function
|
|
1108
|
-
const [t, r] =
|
|
1110
|
+
function cs(e) {
|
|
1111
|
+
const [t, r] = Et();
|
|
1109
1112
|
return [
|
|
1110
1113
|
t,
|
|
1111
|
-
|
|
1114
|
+
Ht({ provider: r, props: e })
|
|
1112
1115
|
];
|
|
1113
1116
|
}
|
|
1114
|
-
const ze = L(void 0),
|
|
1115
|
-
const { model: r, ready: n } = Ue(t || ""), s =
|
|
1116
|
-
return /* @__PURE__ */
|
|
1117
|
-
},
|
|
1118
|
-
const e =
|
|
1117
|
+
const ze = L(void 0), ds = ({ children: e, id: t }) => {
|
|
1118
|
+
const { model: r, ready: n } = Ue(t || ""), s = I(() => n && r ? { model: r } : {}, [n, r]);
|
|
1119
|
+
return /* @__PURE__ */ m(ze.Provider, { value: s, children: e });
|
|
1120
|
+
}, us = () => {
|
|
1121
|
+
const e = K(ze);
|
|
1119
1122
|
if (!e)
|
|
1120
1123
|
throw new Error("useHolderContext must be used within a HolderProvider");
|
|
1121
1124
|
return e;
|
|
1122
1125
|
}, et = L(
|
|
1123
1126
|
void 0
|
|
1124
|
-
),
|
|
1125
|
-
const { model: t, ready: r } = je(), n =
|
|
1126
|
-
return /* @__PURE__ */
|
|
1127
|
-
},
|
|
1128
|
-
const e =
|
|
1127
|
+
), ls = ({ children: e }) => {
|
|
1128
|
+
const { model: t, ready: r } = je(), n = I(() => r && t ? { model: t } : {}, [r, t]);
|
|
1129
|
+
return /* @__PURE__ */ m(et.Provider, { value: n, children: e });
|
|
1130
|
+
}, ms = () => {
|
|
1131
|
+
const e = K(et);
|
|
1129
1132
|
if (!e)
|
|
1130
1133
|
throw new Error(
|
|
1131
1134
|
"useHolderContainerContext must be used within a HolderContainerProvider"
|
|
1132
1135
|
);
|
|
1133
1136
|
return e;
|
|
1134
1137
|
}, tt = L(void 0), ps = ({ children: e }) => {
|
|
1135
|
-
const { model: t, ready: r } = Ve(), n =
|
|
1136
|
-
return /* @__PURE__ */
|
|
1137
|
-
},
|
|
1138
|
-
const e =
|
|
1138
|
+
const { model: t, ready: r } = Ve(), n = I(() => r && t ? { model: t } : {}, [r, t]);
|
|
1139
|
+
return /* @__PURE__ */ m(tt.Provider, { value: n, children: e });
|
|
1140
|
+
}, hs = () => {
|
|
1141
|
+
const e = K(tt);
|
|
1139
1142
|
if (!e)
|
|
1140
1143
|
throw new Error(
|
|
1141
1144
|
"useIngredientContext must be used within a IngredientProvider"
|
|
@@ -1143,97 +1146,97 @@ const ze = L(void 0), cs = ({ children: e, id: t }) => {
|
|
|
1143
1146
|
return e;
|
|
1144
1147
|
}, st = L(
|
|
1145
1148
|
void 0
|
|
1146
|
-
),
|
|
1147
|
-
const { model: t, ready: r } = We(), n =
|
|
1148
|
-
return /* @__PURE__ */
|
|
1149
|
-
},
|
|
1150
|
-
const e =
|
|
1149
|
+
), fs = ({ children: e }) => {
|
|
1150
|
+
const { model: t, ready: r } = We(), n = I(() => r && t ? { model: t } : {}, [r, t]);
|
|
1151
|
+
return /* @__PURE__ */ m(st.Provider, { value: n, children: e });
|
|
1152
|
+
}, bs = () => {
|
|
1153
|
+
const e = K(st);
|
|
1151
1154
|
if (!e)
|
|
1152
1155
|
throw new Error(
|
|
1153
1156
|
"useIngredientContainerContext must be used within a IngredientContainerProvider"
|
|
1154
1157
|
);
|
|
1155
1158
|
return e;
|
|
1156
|
-
},
|
|
1159
|
+
}, Kt = () => {
|
|
1157
1160
|
const e = He.type;
|
|
1158
|
-
return
|
|
1161
|
+
return H({
|
|
1159
1162
|
modelId: e,
|
|
1160
1163
|
modelType: He.type,
|
|
1161
1164
|
options: {}
|
|
1162
1165
|
});
|
|
1163
|
-
}, rt = L(void 0),
|
|
1164
|
-
const { model: t, ready: r } =
|
|
1165
|
-
return /* @__PURE__ */
|
|
1166
|
-
},
|
|
1167
|
-
const e =
|
|
1166
|
+
}, rt = L(void 0), vs = ({ children: e }) => {
|
|
1167
|
+
const { model: t, ready: r } = Kt(), n = I(() => r && t ? { model: t } : {}, [r, t]);
|
|
1168
|
+
return /* @__PURE__ */ m(rt.Provider, { value: n, children: e });
|
|
1169
|
+
}, $s = () => {
|
|
1170
|
+
const e = K(rt);
|
|
1168
1171
|
if (!e)
|
|
1169
1172
|
throw new Error("usePumpContext must be used within a PumpProvider");
|
|
1170
1173
|
return e;
|
|
1171
1174
|
};
|
|
1172
1175
|
export {
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1176
|
+
Wt as $,
|
|
1177
|
+
es as A,
|
|
1178
|
+
ns as B,
|
|
1179
|
+
St as C,
|
|
1180
|
+
xt as D,
|
|
1181
|
+
ft as E,
|
|
1179
1182
|
Q as F,
|
|
1180
1183
|
ne as G,
|
|
1181
|
-
|
|
1184
|
+
ds as H,
|
|
1182
1185
|
ps as I,
|
|
1183
1186
|
X as J,
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
+
gt as K,
|
|
1188
|
+
_t as L,
|
|
1189
|
+
Pt as M,
|
|
1187
1190
|
pt as N,
|
|
1188
1191
|
Ke as O,
|
|
1189
|
-
|
|
1190
|
-
|
|
1192
|
+
vs as P,
|
|
1193
|
+
$t as Q,
|
|
1191
1194
|
Fe as R,
|
|
1192
|
-
|
|
1195
|
+
Gt as S,
|
|
1193
1196
|
Ue as T,
|
|
1194
|
-
|
|
1197
|
+
Ft as U,
|
|
1195
1198
|
je as V,
|
|
1196
|
-
|
|
1199
|
+
Ut as W,
|
|
1197
1200
|
Ve as X,
|
|
1198
|
-
|
|
1199
|
-
|
|
1201
|
+
jt as Y,
|
|
1202
|
+
Vt as Z,
|
|
1200
1203
|
We as _,
|
|
1201
|
-
|
|
1204
|
+
ss as a,
|
|
1202
1205
|
Ye as a0,
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1206
|
+
qt as a1,
|
|
1207
|
+
vt as a2,
|
|
1208
|
+
Jt as a3,
|
|
1209
|
+
It as a4,
|
|
1207
1210
|
Ge as a5,
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1211
|
+
Qt as a6,
|
|
1212
|
+
Xt as a7,
|
|
1213
|
+
Zt as a8,
|
|
1214
|
+
At as a9,
|
|
1215
|
+
zt as aa,
|
|
1216
|
+
rs as b,
|
|
1217
|
+
is as c,
|
|
1218
|
+
as as d,
|
|
1219
|
+
os as e,
|
|
1220
|
+
Ht as f,
|
|
1221
|
+
kt as g,
|
|
1222
|
+
us as h,
|
|
1223
|
+
cs as i,
|
|
1224
|
+
ls as j,
|
|
1225
|
+
ms as k,
|
|
1226
|
+
hs as l,
|
|
1227
|
+
fs as m,
|
|
1228
|
+
bs as n,
|
|
1229
|
+
D as o,
|
|
1230
|
+
$s as p,
|
|
1228
1231
|
ye as q,
|
|
1229
1232
|
De as r,
|
|
1230
|
-
|
|
1233
|
+
Mt as s,
|
|
1231
1234
|
Me as t,
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
+
ts as u,
|
|
1236
|
+
Ot as v,
|
|
1237
|
+
Dt as w,
|
|
1235
1238
|
Oe as x,
|
|
1236
|
-
|
|
1237
|
-
|
|
1239
|
+
Yt as y,
|
|
1240
|
+
ht as z
|
|
1238
1241
|
};
|
|
1239
|
-
//# sourceMappingURL=pump-provider-
|
|
1242
|
+
//# sourceMappingURL=pump-provider-Dm4nQHtl.js.map
|