@kosdev-code/kos-dispense-sdk 2.0.19 → 2.0.20
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-2GNw1Ct_.cjs +2 -0
- package/pump-provider-2GNw1Ct_.cjs.map +1 -0
- package/{pump-provider-D7OslYhd.js → pump-provider-35ZRKNvH.js} +316 -309
- package/pump-provider-35ZRKNvH.js.map +1 -0
- package/ui/hooks/cui-kit/use-cui-kit.d.ts +1 -0
- package/ui/hooks/cui-kit/use-cui-kit.d.ts.map +1 -1
- package/ui/hooks/nozzle-pour/use-nozzle-pour.d.ts +2 -1
- package/ui/hooks/nozzle-pour/use-nozzle-pour.d.ts.map +1 -1
- package/ui.cjs +1 -1
- package/ui.js +1 -1
- package/pump-provider-BU_HZL2F.cjs +0 -2
- package/pump-provider-BU_HZL2F.cjs.map +0 -1
- package/pump-provider-D7OslYhd.js.map +0 -1
|
@@ -1,74 +1,74 @@
|
|
|
1
1
|
var Ve = Object.defineProperty;
|
|
2
2
|
var je = (e, t, s) => t in e ? Ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
-
var
|
|
3
|
+
var C = (e, t, s) => (je(e, typeof t != "symbol" ? t + "" : t, s), s);
|
|
4
4
|
import { jsx as u } from "@emotion/react/jsx-runtime";
|
|
5
|
-
import { useKosModel as
|
|
6
|
-
import qe, { createContext as k, useMemo as
|
|
7
|
-
import { A as
|
|
8
|
-
const
|
|
9
|
-
const e =
|
|
10
|
-
return
|
|
5
|
+
import { useKosModel as A, getKosCompanionModel as ie, kosAutoEffect as We, KosLog as w, usePressGesture as ae, EventBus as H, TimerManager as $e } from "@kosdev-code/kos-ui-sdk";
|
|
6
|
+
import qe, { createContext as k, useMemo as $, useContext as x, useState as T, useCallback as a, useEffect as F } from "react";
|
|
7
|
+
import { A as de, a as ue, d as Je, c as le, N as Qe, e as me, H as Xe, f as fe, I as he, g as pe, G as Ze, P as be } from "./dispense-registration-manager-BX9C7jzd.js";
|
|
8
|
+
const Pe = () => {
|
|
9
|
+
const e = de.type;
|
|
10
|
+
return A({
|
|
11
11
|
modelId: e,
|
|
12
|
-
modelType:
|
|
12
|
+
modelType: de.type,
|
|
13
13
|
options: {}
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
16
|
function At(e) {
|
|
17
17
|
return (t) => {
|
|
18
|
-
const { model: s, status: r, KosModelLoader: n } =
|
|
18
|
+
const { model: s, status: r, KosModelLoader: n } = Pe();
|
|
19
19
|
return /* @__PURE__ */ u(n, { ...r, children: /* @__PURE__ */ u(e, { ...t, assembly: s }) });
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
const e =
|
|
24
|
-
return
|
|
22
|
+
const Ie = () => {
|
|
23
|
+
const e = ue.type;
|
|
24
|
+
return A({
|
|
25
25
|
modelId: e,
|
|
26
|
-
modelType:
|
|
26
|
+
modelType: ue.type,
|
|
27
27
|
options: {}
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
30
|
function xt(e) {
|
|
31
31
|
return (t) => {
|
|
32
|
-
const { model: s, status: r, KosModelLoader: n } =
|
|
32
|
+
const { model: s, status: r, KosModelLoader: n } = Ie();
|
|
33
33
|
return /* @__PURE__ */ u(n, { ...r, children: /* @__PURE__ */ u(e, { ...t, beverage: s }) });
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
|
-
const
|
|
36
|
+
const Te = (e) => A({
|
|
37
37
|
modelId: e,
|
|
38
38
|
modelType: Je.type,
|
|
39
39
|
options: {}
|
|
40
40
|
});
|
|
41
41
|
function gt(e) {
|
|
42
42
|
return (t) => (s) => {
|
|
43
|
-
const { model: r, status: n, KosModelLoader: o } =
|
|
43
|
+
const { model: r, status: n, KosModelLoader: o } = Te(t);
|
|
44
44
|
return /* @__PURE__ */ u(o, { ...n, children: /* @__PURE__ */ u(e, { ...s, board: r }) });
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
const
|
|
48
|
-
const e =
|
|
49
|
-
return
|
|
47
|
+
const Ae = () => {
|
|
48
|
+
const e = le.type;
|
|
49
|
+
return A({
|
|
50
50
|
modelId: e,
|
|
51
|
-
modelType:
|
|
51
|
+
modelType: le.type,
|
|
52
52
|
options: {}
|
|
53
53
|
});
|
|
54
54
|
};
|
|
55
55
|
function kt(e) {
|
|
56
56
|
return (t) => {
|
|
57
|
-
const { model: s, status: r, KosModelLoader: n } =
|
|
57
|
+
const { model: s, status: r, KosModelLoader: n } = Ae();
|
|
58
58
|
return /* @__PURE__ */ u(n, { ...r, children: /* @__PURE__ */ u(e, { ...t, boardContainer: s }) });
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
|
-
const
|
|
61
|
+
const xe = (e) => A({
|
|
62
62
|
modelId: e,
|
|
63
63
|
modelType: Qe.type,
|
|
64
64
|
options: {
|
|
65
65
|
path: e
|
|
66
66
|
}
|
|
67
|
-
}),
|
|
68
|
-
const { model: s, ready: r } =
|
|
69
|
-
return /* @__PURE__ */ u(
|
|
70
|
-
},
|
|
71
|
-
const e =
|
|
67
|
+
}), ge = k(void 0), ze = ({ children: e, path: t }) => {
|
|
68
|
+
const { model: s, ready: r } = xe(t), n = $(() => r && s ? { model: s } : {}, [r, s]);
|
|
69
|
+
return /* @__PURE__ */ u(ge.Provider, { value: n, children: e });
|
|
70
|
+
}, K = () => {
|
|
71
|
+
const e = x(ge);
|
|
72
72
|
if (!e)
|
|
73
73
|
throw new Error("useNozzleContext must be used within a NozzleProvider");
|
|
74
74
|
return e;
|
|
@@ -77,9 +77,9 @@ const Ie = (e) => T({
|
|
|
77
77
|
onClearBeverage: t,
|
|
78
78
|
companionType: s
|
|
79
79
|
}) => {
|
|
80
|
-
const { model: r } =
|
|
81
|
-
(m) =>
|
|
82
|
-
) : [], [n, s]),
|
|
80
|
+
const { model: r } = K(), [n, o] = T([]), [c, l] = T(null), h = $(() => s ? n.map(
|
|
81
|
+
(m) => ie(m, s)
|
|
82
|
+
) : [], [n, s]), f = a(
|
|
83
83
|
async (m) => {
|
|
84
84
|
l(m), await (r == null ? void 0 : r.setSelectedPourable({ beverage: m })), e == null || e(m);
|
|
85
85
|
},
|
|
@@ -93,11 +93,11 @@ const Ie = (e) => T({
|
|
|
93
93
|
return;
|
|
94
94
|
const i = r.selectedBrand;
|
|
95
95
|
if (!i) {
|
|
96
|
-
const
|
|
97
|
-
o(
|
|
96
|
+
const P = r.getGroupAvailabilityItems("beverages").filter((p) => p.visible);
|
|
97
|
+
o(P ?? []);
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
|
-
const b = r.getAvailabilityByParent(i.id).filter((
|
|
100
|
+
const b = r.getAvailabilityByParent(i.id).filter((P) => P.visible);
|
|
101
101
|
o(b ?? []);
|
|
102
102
|
});
|
|
103
103
|
return () => {
|
|
@@ -105,8 +105,8 @@ const Ie = (e) => T({
|
|
|
105
105
|
};
|
|
106
106
|
}, [r]), {
|
|
107
107
|
beverages: n,
|
|
108
|
-
beverageCompanions:
|
|
109
|
-
selectBeverage:
|
|
108
|
+
beverageCompanions: h,
|
|
109
|
+
selectBeverage: f,
|
|
110
110
|
selectedBeverage: c,
|
|
111
111
|
clearBeverage: d
|
|
112
112
|
};
|
|
@@ -115,28 +115,28 @@ const Ie = (e) => T({
|
|
|
115
115
|
onBrandCleared: t,
|
|
116
116
|
companionType: s
|
|
117
117
|
}) => {
|
|
118
|
-
const { model: r } =
|
|
118
|
+
const { model: r } = K(), [n, o] = T(null), c = $(
|
|
119
119
|
() => (r == null ? void 0 : r.getGroupAvailabilityItems("brands").filter((d) => d.visible)) ?? [],
|
|
120
120
|
[r]
|
|
121
|
-
), l =
|
|
121
|
+
), l = $(() => s ? c.map((d) => ie(d, s)) : [], [c, s]), h = a(
|
|
122
122
|
async (d) => {
|
|
123
123
|
o(d), r == null || r.setSelectedBrand(d), e == null || e(d);
|
|
124
124
|
},
|
|
125
125
|
[r, e]
|
|
126
|
-
),
|
|
126
|
+
), f = a(() => {
|
|
127
127
|
o(null), r == null || r.setSelectedBrand(void 0), t == null || t();
|
|
128
128
|
}, [r, t]);
|
|
129
129
|
return {
|
|
130
130
|
brands: c,
|
|
131
131
|
brandCompanions: l,
|
|
132
132
|
selectedBrand: n,
|
|
133
|
-
selectBrand:
|
|
134
|
-
clearBrand:
|
|
133
|
+
selectBrand: h,
|
|
134
|
+
clearBrand: f
|
|
135
135
|
};
|
|
136
136
|
}, st = w.createLogger({
|
|
137
137
|
name: "HoldToPourStrategy",
|
|
138
138
|
group: "kos-hooks"
|
|
139
|
-
}),
|
|
139
|
+
}), ke = {
|
|
140
140
|
name: "HoldToPourStrategy",
|
|
141
141
|
async initiate(e) {
|
|
142
142
|
if (!(e != null && e.canPour)) {
|
|
@@ -148,45 +148,48 @@ const Ie = (e) => T({
|
|
|
148
148
|
async initiateEnded(e) {
|
|
149
149
|
await (e == null ? void 0 : e.cancelPour());
|
|
150
150
|
}
|
|
151
|
-
},
|
|
151
|
+
}, Q = w.createLogger({
|
|
152
152
|
name: "useNozzlePour",
|
|
153
153
|
group: "kos-hooks"
|
|
154
154
|
}), rt = ({
|
|
155
155
|
onPour: e,
|
|
156
156
|
onPourCancel: t,
|
|
157
|
-
|
|
157
|
+
onBeforePour: s,
|
|
158
|
+
strategy: r = ke
|
|
158
159
|
}) => {
|
|
159
|
-
const { model:
|
|
160
|
-
|
|
161
|
-
`[${
|
|
162
|
-
),
|
|
163
|
-
|
|
160
|
+
const { model: n } = K(), o = a(async () => {
|
|
161
|
+
(s ? await (s == null ? void 0 : s()) : !0) ? (Q.debug(
|
|
162
|
+
`[${r == null ? void 0 : r.name}] - Pour initiated for nozzle ${n == null ? void 0 : n.id}.`
|
|
163
|
+
), r == null || r.initiate(n), e == null || e()) : (Q.debug(
|
|
164
|
+
`[${r == null ? void 0 : r.name}] - Pour cancelled for nozzle ${n == null ? void 0 : n.id}.`
|
|
165
|
+
), t == null || t());
|
|
166
|
+
}, [e, n, r, s, t]), c = a(() => {
|
|
164
167
|
var f;
|
|
165
|
-
|
|
166
|
-
`[${
|
|
167
|
-
), (f =
|
|
168
|
-
}, [t,
|
|
169
|
-
|
|
170
|
-
}, [t,
|
|
168
|
+
Q.debug(
|
|
169
|
+
`[${r == null ? void 0 : r.name}] - Pour initiate ended called for nozzle ${n == null ? void 0 : n.id}.`
|
|
170
|
+
), (f = r == null ? void 0 : r.initiateEnded) == null || f.call(r, n), t == null || t();
|
|
171
|
+
}, [t, n, r]), l = a(() => {
|
|
172
|
+
Q.debug(`Force cancelling pour for nozzle ${n == null ? void 0 : n.id}.`), n == null || n.cancelPour(), t == null || t();
|
|
173
|
+
}, [t, n]);
|
|
171
174
|
return {
|
|
172
|
-
handlers:
|
|
173
|
-
onPressed:
|
|
174
|
-
onRelease:
|
|
175
|
+
handlers: ae({
|
|
176
|
+
onPressed: o,
|
|
177
|
+
onRelease: c
|
|
175
178
|
}).dom,
|
|
176
|
-
cancel:
|
|
177
|
-
status:
|
|
179
|
+
cancel: l,
|
|
180
|
+
status: n
|
|
178
181
|
};
|
|
179
182
|
}, nt = ({
|
|
180
183
|
onFlavorSelected: e,
|
|
181
184
|
onFlavorCleared: t,
|
|
182
185
|
companionType: s
|
|
183
186
|
}) => {
|
|
184
|
-
const { model: r } =
|
|
187
|
+
const { model: r } = K(), n = $(
|
|
185
188
|
() => (r == null ? void 0 : r.getGroupAvailabilityItems("flavors").filter((d) => d.visible)) ?? [],
|
|
186
189
|
[r]
|
|
187
|
-
), o =
|
|
188
|
-
(d) =>
|
|
189
|
-
) : [], [n, s]), [c, l] =
|
|
190
|
+
), o = $(() => s ? n.map(
|
|
191
|
+
(d) => ie(d, s)
|
|
192
|
+
) : [], [n, s]), [c, l] = T([]), h = a(
|
|
190
193
|
async (d) => {
|
|
191
194
|
if (l(
|
|
192
195
|
(m) => m != null && m.includes(d) ? [...m.filter((i) => i !== d)] : [...m ?? [], d]
|
|
@@ -200,7 +203,7 @@ const Ie = (e) => T({
|
|
|
200
203
|
e == null || e(d, c ?? []);
|
|
201
204
|
},
|
|
202
205
|
[r, e, c]
|
|
203
|
-
),
|
|
206
|
+
), f = a(async () => {
|
|
204
207
|
if (l([]), r != null && r.selectedPourable) {
|
|
205
208
|
const { beverage: d } = r.selectedPourable;
|
|
206
209
|
r.setSelectedPourable({ beverage: d }), t == null || t();
|
|
@@ -209,16 +212,16 @@ const Ie = (e) => T({
|
|
|
209
212
|
return {
|
|
210
213
|
flavors: n,
|
|
211
214
|
flavorCompanions: o,
|
|
212
|
-
selectFlavor:
|
|
215
|
+
selectFlavor: h,
|
|
213
216
|
selectedFlavors: c,
|
|
214
|
-
clearFlavors:
|
|
217
|
+
clearFlavors: f
|
|
215
218
|
};
|
|
216
|
-
},
|
|
217
|
-
initialGroup: e =
|
|
219
|
+
}, y = "brands", X = "beverages", O = "flavors", ot = ({
|
|
220
|
+
initialGroup: e = y,
|
|
218
221
|
options: t = {}
|
|
219
222
|
}) => {
|
|
220
|
-
var
|
|
221
|
-
const [s, r] =
|
|
223
|
+
var W, q, J;
|
|
224
|
+
const [s, r] = T(e), { model: n } = K(), o = a(
|
|
222
225
|
(v) => {
|
|
223
226
|
r(O);
|
|
224
227
|
const D = `/kos/dispense/${n == null ? void 0 : n.path}/brand/selected/`;
|
|
@@ -235,10 +238,10 @@ const Ie = (e) => T({
|
|
|
235
238
|
H.publish(D, v);
|
|
236
239
|
},
|
|
237
240
|
[n == null ? void 0 : n.path]
|
|
238
|
-
),
|
|
241
|
+
), h = a(() => {
|
|
239
242
|
const v = `/kos/dispense/${n == null ? void 0 : n.path}/beverage/cleared/`;
|
|
240
243
|
H.publish(v, {});
|
|
241
|
-
}, [n == null ? void 0 : n.path]),
|
|
244
|
+
}, [n == null ? void 0 : n.path]), f = a(
|
|
242
245
|
(v) => {
|
|
243
246
|
const D = `/kos/dispense/${n == null ? void 0 : n.path}/flavor/selected/`;
|
|
244
247
|
H.publish(D, v);
|
|
@@ -253,8 +256,8 @@ const Ie = (e) => T({
|
|
|
253
256
|
}, [n == null ? void 0 : n.path]), i = a(() => {
|
|
254
257
|
const v = `/kos/dispense/${n == null ? void 0 : n.path}/pour/cancel/`;
|
|
255
258
|
H.publish(v, {});
|
|
256
|
-
}, [n == null ? void 0 : n.path]), { brands: b, selectBrand:
|
|
257
|
-
companionType: (
|
|
259
|
+
}, [n == null ? void 0 : n.path]), { brands: b, selectBrand: P, selectedBrand: p, clearBrand: g, brandCompanions: Y } = tt({
|
|
260
|
+
companionType: (W = t.companionTypes) == null ? void 0 : W.brand,
|
|
258
261
|
onBrandSelected: o,
|
|
259
262
|
onBrandCleared: c
|
|
260
263
|
}), {
|
|
@@ -262,82 +265,86 @@ const Ie = (e) => T({
|
|
|
262
265
|
selectBeverage: U,
|
|
263
266
|
selectedBeverage: V,
|
|
264
267
|
clearBeverage: S,
|
|
265
|
-
beverageCompanions:
|
|
268
|
+
beverageCompanions: z
|
|
266
269
|
} = et({
|
|
267
|
-
companionType: (
|
|
270
|
+
companionType: (q = t.companionTypes) == null ? void 0 : q.beverage,
|
|
268
271
|
onBeverageSelected: l,
|
|
269
|
-
onClearBeverage:
|
|
272
|
+
onClearBeverage: h
|
|
270
273
|
}), {
|
|
271
|
-
clearFlavors:
|
|
272
|
-
flavors:
|
|
273
|
-
selectFlavor:
|
|
274
|
-
selectedFlavors:
|
|
274
|
+
clearFlavors: ee,
|
|
275
|
+
flavors: R,
|
|
276
|
+
selectFlavor: N,
|
|
277
|
+
selectedFlavors: te,
|
|
275
278
|
flavorCompanions: j
|
|
276
279
|
} = nt({
|
|
277
|
-
companionType: (
|
|
278
|
-
onFlavorSelected:
|
|
280
|
+
companionType: (J = t.companionTypes) == null ? void 0 : J.flavor,
|
|
281
|
+
onFlavorSelected: f,
|
|
279
282
|
onFlavorCleared: d
|
|
280
|
-
}), I =
|
|
283
|
+
}), [I, B] = T(), E = a((v) => {
|
|
284
|
+
B(() => v);
|
|
285
|
+
}, []), M = rt({
|
|
281
286
|
onPour: m,
|
|
282
|
-
onPourCancel: i
|
|
283
|
-
|
|
287
|
+
onPourCancel: i,
|
|
288
|
+
onBeforePour: I
|
|
289
|
+
}), se = a(() => {
|
|
284
290
|
switch (s) {
|
|
285
|
-
case
|
|
286
|
-
S(),
|
|
291
|
+
case y:
|
|
292
|
+
S(), g();
|
|
287
293
|
break;
|
|
288
|
-
case
|
|
294
|
+
case X:
|
|
289
295
|
case O:
|
|
290
|
-
r(e), S(),
|
|
296
|
+
r(e), S(), g();
|
|
291
297
|
break;
|
|
292
298
|
}
|
|
293
|
-
}, [S,
|
|
294
|
-
r(e), e ===
|
|
295
|
-
}, [S,
|
|
299
|
+
}, [S, g, s, e]), re = a(() => {
|
|
300
|
+
r(e), e === y && (S(), g()), e === X && S();
|
|
301
|
+
}, [S, g, e]);
|
|
296
302
|
return {
|
|
297
303
|
nav: {
|
|
298
304
|
currentGroup: s,
|
|
299
|
-
back:
|
|
300
|
-
home:
|
|
305
|
+
back: se,
|
|
306
|
+
home: re
|
|
301
307
|
},
|
|
302
|
-
pour:
|
|
308
|
+
pour: M,
|
|
309
|
+
updateOnBeforePour: E,
|
|
303
310
|
selections: {
|
|
304
|
-
[
|
|
305
|
-
[
|
|
306
|
-
[O]:
|
|
311
|
+
[y]: p,
|
|
312
|
+
[X]: V,
|
|
313
|
+
[O]: te
|
|
307
314
|
},
|
|
308
|
-
[
|
|
315
|
+
[y]: {
|
|
309
316
|
models: b,
|
|
310
|
-
companions:
|
|
311
|
-
clear:
|
|
317
|
+
companions: Y,
|
|
318
|
+
clear: g,
|
|
312
319
|
handlers: {
|
|
313
|
-
onSelected:
|
|
320
|
+
onSelected: P
|
|
314
321
|
}
|
|
315
322
|
},
|
|
316
|
-
[
|
|
323
|
+
[X]: {
|
|
317
324
|
models: L,
|
|
318
|
-
companions:
|
|
325
|
+
companions: z,
|
|
319
326
|
clear: S,
|
|
320
327
|
handlers: {
|
|
321
328
|
onSelected: U
|
|
322
329
|
}
|
|
323
330
|
},
|
|
324
331
|
[O]: {
|
|
325
|
-
models:
|
|
332
|
+
models: R,
|
|
326
333
|
companions: j,
|
|
327
|
-
clear:
|
|
334
|
+
clear: ee,
|
|
328
335
|
handlers: {
|
|
329
|
-
onSelected:
|
|
336
|
+
onSelected: N
|
|
330
337
|
}
|
|
331
338
|
}
|
|
332
339
|
};
|
|
333
340
|
}, it = (e) => {
|
|
334
|
-
const { model: t } =
|
|
341
|
+
const { model: t } = K(), [s, r] = T(null), {
|
|
335
342
|
onAmbientTimer: n,
|
|
336
343
|
onAttractTimer: o,
|
|
337
344
|
onResetAttractTimer: c,
|
|
338
345
|
onResumeAttractTimer: l,
|
|
339
|
-
defaultAttractTime:
|
|
340
|
-
defaultAmbientTime:
|
|
346
|
+
defaultAttractTime: h,
|
|
347
|
+
defaultAmbientTime: f
|
|
341
348
|
} = e, d = a(() => {
|
|
342
349
|
n && (w.info("Ambient timer expired. Calling callback"), n == null || n());
|
|
343
350
|
}, [n]), m = a(() => {
|
|
@@ -346,25 +353,25 @@ const Ie = (e) => T({
|
|
|
346
353
|
s && (s.restart(), c == null || c());
|
|
347
354
|
}, [s, c]), b = a(() => {
|
|
348
355
|
s && (s.reset(), c == null || c());
|
|
349
|
-
}, [s, c]),
|
|
356
|
+
}, [s, c]), P = a(() => {
|
|
350
357
|
s && (s.pause(), l == null || l());
|
|
351
358
|
}, [s, l]);
|
|
352
359
|
return F(() => {
|
|
353
|
-
if (t &&
|
|
360
|
+
if (t && h) {
|
|
354
361
|
w.info("Nozzle is available. Creating timers");
|
|
355
|
-
const p =
|
|
362
|
+
const p = $e.createTimer(
|
|
356
363
|
"attract-timer-" + t.path,
|
|
357
|
-
|
|
364
|
+
h
|
|
358
365
|
);
|
|
359
|
-
return
|
|
366
|
+
return h && (p == null || p.addTimeoutAction({
|
|
360
367
|
name: "attract-timer",
|
|
361
368
|
remainingTime: 0,
|
|
362
369
|
action: m
|
|
363
|
-
})),
|
|
370
|
+
})), f && (p == null || p.addTimeoutAction({
|
|
364
371
|
name: "ambient-timer",
|
|
365
|
-
remainingTime:
|
|
372
|
+
remainingTime: f,
|
|
366
373
|
action: d
|
|
367
|
-
})),
|
|
374
|
+
})), h && (p == null || p.start()), r(p ?? null), () => {
|
|
368
375
|
p == null || p.reset(), r(null);
|
|
369
376
|
};
|
|
370
377
|
}
|
|
@@ -372,8 +379,8 @@ const Ie = (e) => T({
|
|
|
372
379
|
w.info("Nozzle is not available. No timers to clear");
|
|
373
380
|
};
|
|
374
381
|
}, [
|
|
375
|
-
h,
|
|
376
382
|
f,
|
|
383
|
+
h,
|
|
377
384
|
d,
|
|
378
385
|
m,
|
|
379
386
|
t
|
|
@@ -381,7 +388,7 @@ const Ie = (e) => T({
|
|
|
381
388
|
attractTimer: s,
|
|
382
389
|
restart: i,
|
|
383
390
|
pause: b,
|
|
384
|
-
resume:
|
|
391
|
+
resume: P
|
|
385
392
|
};
|
|
386
393
|
}, at = (e, t) => {
|
|
387
394
|
if (t)
|
|
@@ -395,14 +402,14 @@ const Ie = (e) => T({
|
|
|
395
402
|
onFlavorCleared: o,
|
|
396
403
|
onFlavorSelected: c,
|
|
397
404
|
onPour: l,
|
|
398
|
-
onPourCancel:
|
|
399
|
-
onAmbientTimer:
|
|
405
|
+
onPourCancel: h,
|
|
406
|
+
onAmbientTimer: f,
|
|
400
407
|
onAttractTimer: d,
|
|
401
408
|
onResumeAttractTimer: m
|
|
402
409
|
}) => {
|
|
403
|
-
const { model: i } =
|
|
410
|
+
const { model: i } = K();
|
|
404
411
|
F(() => {
|
|
405
|
-
const
|
|
412
|
+
const P = [
|
|
406
413
|
{
|
|
407
414
|
topic: `/kos/dispense/${i == null ? void 0 : i.path}/brand/selected/`,
|
|
408
415
|
callback: t
|
|
@@ -430,11 +437,11 @@ const Ie = (e) => T({
|
|
|
430
437
|
{ topic: `/kos/dispense/${i == null ? void 0 : i.path}/pour/`, callback: l },
|
|
431
438
|
{
|
|
432
439
|
topic: `/kos/dispense/${i == null ? void 0 : i.path}/pour/cancel/`,
|
|
433
|
-
callback:
|
|
440
|
+
callback: h
|
|
434
441
|
},
|
|
435
442
|
{
|
|
436
443
|
topic: `/kos/dispense/${i == null ? void 0 : i.path}/ambient/start/`,
|
|
437
|
-
callback:
|
|
444
|
+
callback: f
|
|
438
445
|
},
|
|
439
446
|
{
|
|
440
447
|
topic: `/kos/dispense/${i == null ? void 0 : i.path}/attract/start/`,
|
|
@@ -449,14 +456,14 @@ const Ie = (e) => T({
|
|
|
449
456
|
callback: e
|
|
450
457
|
}
|
|
451
458
|
].map(
|
|
452
|
-
({ topic: p, callback:
|
|
459
|
+
({ topic: p, callback: g }) => at(p, g)
|
|
453
460
|
);
|
|
454
461
|
return () => {
|
|
455
|
-
|
|
462
|
+
P.forEach((p) => p == null ? void 0 : p());
|
|
456
463
|
};
|
|
457
464
|
}, [
|
|
458
465
|
i == null ? void 0 : i.path,
|
|
459
|
-
|
|
466
|
+
f,
|
|
460
467
|
d,
|
|
461
468
|
r,
|
|
462
469
|
n,
|
|
@@ -465,18 +472,18 @@ const Ie = (e) => T({
|
|
|
465
472
|
o,
|
|
466
473
|
c,
|
|
467
474
|
l,
|
|
468
|
-
|
|
475
|
+
h,
|
|
469
476
|
m,
|
|
470
477
|
e
|
|
471
478
|
]);
|
|
472
|
-
},
|
|
473
|
-
const { model: t } =
|
|
479
|
+
}, ve = (e) => {
|
|
480
|
+
const { model: t } = K(), [s, r] = T(null), {
|
|
474
481
|
onAreYouThereTimer: n,
|
|
475
482
|
onIdleTimer: o,
|
|
476
483
|
onResetIdleTimer: c,
|
|
477
484
|
defaultAreYouThereTime: l = 10,
|
|
478
|
-
defaultIdleTime:
|
|
479
|
-
} = e,
|
|
485
|
+
defaultIdleTime: h = 20
|
|
486
|
+
} = e, f = a(() => {
|
|
480
487
|
n && (w.info("Are you there timer expired. Calling callback"), n == null || n());
|
|
481
488
|
}, [n]), d = a(() => {
|
|
482
489
|
o && (w.info("Idle timer expired. Calling callback"), o == null || o());
|
|
@@ -488,9 +495,9 @@ const Ie = (e) => T({
|
|
|
488
495
|
return F(() => {
|
|
489
496
|
if (t) {
|
|
490
497
|
w.info("Nozzle is available. Creating timers");
|
|
491
|
-
const b =
|
|
498
|
+
const b = $e.createTimer(
|
|
492
499
|
`${e.prefix ?? ""}idle-timer-${t.path}`,
|
|
493
|
-
|
|
500
|
+
h
|
|
494
501
|
);
|
|
495
502
|
return b == null || b.addTimeoutAction({
|
|
496
503
|
name: "idle-timer",
|
|
@@ -499,7 +506,7 @@ const Ie = (e) => T({
|
|
|
499
506
|
}), b == null || b.addTimeoutAction({
|
|
500
507
|
name: "are-you-there-timer",
|
|
501
508
|
remainingTime: l,
|
|
502
|
-
action:
|
|
509
|
+
action: f
|
|
503
510
|
}), r(b ?? null), () => {
|
|
504
511
|
b == null || b.reset(), r(null);
|
|
505
512
|
};
|
|
@@ -509,8 +516,8 @@ const Ie = (e) => T({
|
|
|
509
516
|
};
|
|
510
517
|
}, [
|
|
511
518
|
l,
|
|
512
|
-
f,
|
|
513
519
|
h,
|
|
520
|
+
f,
|
|
514
521
|
d,
|
|
515
522
|
t,
|
|
516
523
|
e.prefix
|
|
@@ -525,66 +532,66 @@ const Ie = (e) => T({
|
|
|
525
532
|
pour: s,
|
|
526
533
|
screens: r
|
|
527
534
|
}) => {
|
|
528
|
-
var
|
|
529
|
-
const [n, o] =
|
|
535
|
+
var ce;
|
|
536
|
+
const [n, o] = T(!1), [c, l] = T(!1), [h, f] = T(!1), { model: d } = K(), [m, i] = T(!1), b = (t == null ? void 0 : t.idleTimeout) ?? 15, P = (t == null ? void 0 : t.areYouThereTimeoutOffset) ?? 10, p = (s == null ? void 0 : s.idleTimeout) ?? (t == null ? void 0 : t.idleTimeout) ?? 10, g = (s == null ? void 0 : s.areYouThereTimeoutOffset) ?? (t == null ? void 0 : t.areYouThereTimeoutOffset) ?? 5, Y = r == null ? void 0 : r.ambientTimeoutOffset, L = r == null ? void 0 : r.attractTimeout, U = a(() => {
|
|
530
537
|
o(!0);
|
|
531
538
|
}, []), V = a(() => {
|
|
532
539
|
o(!1), e == null || e.nav.home();
|
|
533
|
-
}, [(
|
|
534
|
-
|
|
535
|
-
}, [
|
|
536
|
-
L && (
|
|
537
|
-
}, [L]),
|
|
538
|
-
L && (
|
|
540
|
+
}, [(ce = e == null ? void 0 : e.nav) == null ? void 0 : ce.home]), S = a(() => {
|
|
541
|
+
Y && (l(!0), f(!1));
|
|
542
|
+
}, [Y]), z = a(() => {
|
|
543
|
+
L && (f(!0), l(!1));
|
|
544
|
+
}, [L]), ee = a(() => {
|
|
545
|
+
L && (f(!1), l(!1), e == null || e.nav.home());
|
|
539
546
|
}, [e == null ? void 0 : e.nav, L]), {
|
|
540
|
-
pause:
|
|
541
|
-
restart:
|
|
542
|
-
resume:
|
|
547
|
+
pause: R,
|
|
548
|
+
restart: N,
|
|
549
|
+
resume: te,
|
|
543
550
|
attractTimer: j
|
|
544
551
|
} = it({
|
|
545
|
-
defaultAmbientTime:
|
|
552
|
+
defaultAmbientTime: Y,
|
|
546
553
|
defaultAttractTime: L,
|
|
547
554
|
onAmbientTimer: S,
|
|
548
|
-
onAttractTimer:
|
|
549
|
-
onResumeAttractTimer:
|
|
550
|
-
}), { pause: I, restart:
|
|
551
|
-
defaultAreYouThereTime:
|
|
555
|
+
onAttractTimer: z,
|
|
556
|
+
onResumeAttractTimer: ee
|
|
557
|
+
}), { pause: I, restart: B } = ve({
|
|
558
|
+
defaultAreYouThereTime: P,
|
|
552
559
|
defaultIdleTime: b,
|
|
553
560
|
onAreYouThereTimer: U,
|
|
554
561
|
onIdleTimer: V
|
|
555
|
-
}), { pause: E, restart:
|
|
556
|
-
defaultAreYouThereTime:
|
|
562
|
+
}), { pause: E, restart: M } = ve({
|
|
563
|
+
defaultAreYouThereTime: g,
|
|
557
564
|
defaultIdleTime: p,
|
|
558
565
|
onAreYouThereTimer: U,
|
|
559
566
|
onIdleTimer: V,
|
|
560
567
|
prefix: "pour-"
|
|
561
|
-
}),
|
|
568
|
+
}), se = a(() => {
|
|
562
569
|
i(!1), E(), I();
|
|
563
|
-
}, [I, E]),
|
|
564
|
-
i(!0), console.log("restarting pour timer"),
|
|
565
|
-
}, [I,
|
|
566
|
-
o(!1), m ? (
|
|
567
|
-
}, [m, I, E,
|
|
568
|
-
|
|
569
|
-
}, [
|
|
570
|
-
|
|
571
|
-
}, [
|
|
572
|
-
|
|
573
|
-
}, [
|
|
574
|
-
|
|
575
|
-
}, [
|
|
576
|
-
|
|
577
|
-
}, [
|
|
570
|
+
}, [I, E]), re = a(() => {
|
|
571
|
+
i(!0), console.log("restarting pour timer"), M(), I();
|
|
572
|
+
}, [I, M]), W = a(() => {
|
|
573
|
+
o(!1), m ? (M(), I()) : (B(), E());
|
|
574
|
+
}, [m, I, E, B, M]), q = a(() => {
|
|
575
|
+
R(), f(!1), l(!1), B();
|
|
576
|
+
}, [R, B]), J = a(() => {
|
|
577
|
+
f(!1), l(!1), i(!1), E(), N();
|
|
578
|
+
}, [N, E]), v = a(() => {
|
|
579
|
+
f(!1), l(!1), i(!1), R(), B();
|
|
580
|
+
}, [R, B]), D = a(() => {
|
|
581
|
+
f(!1), l(!1), i(!1), N(), I(), E();
|
|
582
|
+
}, [N, I, E]), _e = a(() => {
|
|
583
|
+
f(!1), l(!1), N(), I();
|
|
584
|
+
}, [N, I]);
|
|
578
585
|
ct({
|
|
579
|
-
onBrandSelected:
|
|
580
|
-
onBrandCleared:
|
|
581
|
-
onBeverageSelected:
|
|
582
|
-
onBeverageCleared:
|
|
583
|
-
onPour:
|
|
584
|
-
onPourCancel:
|
|
586
|
+
onBrandSelected: q,
|
|
587
|
+
onBrandCleared: J,
|
|
588
|
+
onBeverageSelected: v,
|
|
589
|
+
onBeverageCleared: D,
|
|
590
|
+
onPour: se,
|
|
591
|
+
onPourCancel: re,
|
|
585
592
|
onInit: _e
|
|
586
593
|
});
|
|
587
|
-
const Fe = m ?
|
|
594
|
+
const Fe = m ? g : P;
|
|
588
595
|
return F(() => {
|
|
589
596
|
if (d && j) {
|
|
590
597
|
const Ue = `/kos/dispense/${d == null ? void 0 : d.path}/init/`;
|
|
@@ -592,96 +599,96 @@ const Ie = (e) => T({
|
|
|
592
599
|
}
|
|
593
600
|
}, [d, j]), {
|
|
594
601
|
showAreYouThere: n,
|
|
595
|
-
clearAreYouThere:
|
|
602
|
+
clearAreYouThere: W,
|
|
596
603
|
areYouThereCountdown: Fe,
|
|
597
604
|
showAmbientScreen: c,
|
|
598
|
-
showAttractScreen:
|
|
599
|
-
pauseScreenTimer:
|
|
605
|
+
showAttractScreen: h,
|
|
606
|
+
pauseScreenTimer: te
|
|
600
607
|
};
|
|
601
|
-
},
|
|
602
|
-
const e =
|
|
603
|
-
return
|
|
608
|
+
}, Ee = () => {
|
|
609
|
+
const e = me.type;
|
|
610
|
+
return A({
|
|
604
611
|
modelId: e,
|
|
605
|
-
modelType:
|
|
612
|
+
modelType: me.type,
|
|
606
613
|
options: {}
|
|
607
614
|
});
|
|
608
615
|
};
|
|
609
616
|
function Ht(e) {
|
|
610
617
|
return (t) => {
|
|
611
|
-
const { model: s, status: r, KosModelLoader: n } =
|
|
618
|
+
const { model: s, status: r, KosModelLoader: n } = Ee();
|
|
612
619
|
return /* @__PURE__ */ u(n, { ...r, children: /* @__PURE__ */ u(e, { ...t, deviceAssembly: s }) });
|
|
613
620
|
};
|
|
614
621
|
}
|
|
615
|
-
const
|
|
622
|
+
const He = (e) => A({
|
|
616
623
|
modelId: e,
|
|
617
624
|
modelType: Xe.type,
|
|
618
625
|
options: {}
|
|
619
626
|
});
|
|
620
627
|
function St(e, t) {
|
|
621
628
|
return (s) => {
|
|
622
|
-
const { model: r, status: n, KosModelLoader: o } =
|
|
629
|
+
const { model: r, status: n, KosModelLoader: o } = He(e);
|
|
623
630
|
return /* @__PURE__ */ u(o, { ...n, children: /* @__PURE__ */ u(t, { ...s, holder: r }) });
|
|
624
631
|
};
|
|
625
632
|
}
|
|
626
|
-
const
|
|
627
|
-
const e =
|
|
628
|
-
return
|
|
633
|
+
const Se = () => {
|
|
634
|
+
const e = fe.type;
|
|
635
|
+
return A({
|
|
629
636
|
modelId: e,
|
|
630
|
-
modelType:
|
|
637
|
+
modelType: fe.type,
|
|
631
638
|
options: {}
|
|
632
639
|
});
|
|
633
640
|
};
|
|
634
|
-
function
|
|
641
|
+
function Kt(e) {
|
|
635
642
|
return (t) => {
|
|
636
|
-
const { model: s, status: r, KosModelLoader: n } =
|
|
643
|
+
const { model: s, status: r, KosModelLoader: n } = Se();
|
|
637
644
|
return /* @__PURE__ */ u(n, { ...r, children: /* @__PURE__ */ u(e, { ...t, holderContainer: s }) });
|
|
638
645
|
};
|
|
639
646
|
}
|
|
640
|
-
const
|
|
641
|
-
const e =
|
|
642
|
-
return
|
|
647
|
+
const Ke = () => {
|
|
648
|
+
const e = he.type;
|
|
649
|
+
return A({
|
|
643
650
|
modelId: e,
|
|
644
|
-
modelType:
|
|
651
|
+
modelType: he.type,
|
|
645
652
|
options: {}
|
|
646
653
|
});
|
|
647
|
-
},
|
|
654
|
+
}, ne = w.createLogger({
|
|
648
655
|
name: "HoldToPourIntentStrategy",
|
|
649
656
|
group: "kos-hooks"
|
|
650
657
|
}), dt = {
|
|
651
658
|
name: "HoldToPourIntentStrategy",
|
|
652
659
|
async initiate(e, t) {
|
|
653
660
|
if (!(e != null && e.canPour)) {
|
|
654
|
-
|
|
661
|
+
ne.debug(`${e == null ? void 0 : e.id} cannot pour. Returning early.`);
|
|
655
662
|
return;
|
|
656
663
|
}
|
|
657
|
-
t ? (
|
|
664
|
+
t ? (ne.debug(`performing intent: ${t}`), await (e == null ? void 0 : e.performIntent(t))) : ne.debug("no intent provided. Returning early.");
|
|
658
665
|
},
|
|
659
666
|
async initiateEnded(e) {
|
|
660
667
|
await (e == null ? void 0 : e.cancelPour());
|
|
661
668
|
}
|
|
662
|
-
},
|
|
669
|
+
}, oe = w.createLogger({
|
|
663
670
|
name: "useNozzlePour",
|
|
664
671
|
group: "kos-hooks"
|
|
665
|
-
}),
|
|
672
|
+
}), Nt = ({
|
|
666
673
|
onPour: e,
|
|
667
674
|
onPourCancel: t,
|
|
668
675
|
intentContainer: s,
|
|
669
676
|
strategy: r = dt
|
|
670
677
|
}) => {
|
|
671
678
|
const n = a(() => {
|
|
672
|
-
|
|
679
|
+
oe.debug(
|
|
673
680
|
`[${r == null ? void 0 : r.name}] - Pour initiated for model ${s == null ? void 0 : s.id}.`
|
|
674
681
|
), r == null || r.initiate(s), e == null || e();
|
|
675
682
|
}, [e, s, r]), o = a(() => {
|
|
676
|
-
var
|
|
677
|
-
|
|
683
|
+
var h;
|
|
684
|
+
oe.debug(
|
|
678
685
|
`[${r == null ? void 0 : r.name}] - Pour initiate ended called for nozzle ${s == null ? void 0 : s.id}.`
|
|
679
|
-
), (
|
|
686
|
+
), (h = r == null ? void 0 : r.initiateEnded) == null || h.call(r, s), t == null || t();
|
|
680
687
|
}, [t, s, r]), c = a(() => {
|
|
681
|
-
|
|
688
|
+
oe.debug(`Force cancelling pour for nozzle ${s == null ? void 0 : s.id}.`), s == null || s.cancelPour(), t == null || t();
|
|
682
689
|
}, [t, s]);
|
|
683
690
|
return {
|
|
684
|
-
handlers:
|
|
691
|
+
handlers: ae({
|
|
685
692
|
onPressed: n,
|
|
686
693
|
onRelease: o
|
|
687
694
|
}).dom,
|
|
@@ -689,42 +696,42 @@ const Ee = () => {
|
|
|
689
696
|
status: s
|
|
690
697
|
};
|
|
691
698
|
};
|
|
692
|
-
function
|
|
699
|
+
function Bt(e) {
|
|
693
700
|
return (t) => {
|
|
694
|
-
const { model: s, status: r, KosModelLoader: n } =
|
|
701
|
+
const { model: s, status: r, KosModelLoader: n } = Ke();
|
|
695
702
|
return /* @__PURE__ */ u(n, { ...r, children: /* @__PURE__ */ u(e, { ...t, ingredient: s }) });
|
|
696
703
|
};
|
|
697
704
|
}
|
|
698
|
-
const
|
|
699
|
-
const e =
|
|
700
|
-
return
|
|
705
|
+
const Ne = () => {
|
|
706
|
+
const e = pe.type;
|
|
707
|
+
return A({
|
|
701
708
|
modelId: e,
|
|
702
|
-
modelType:
|
|
709
|
+
modelType: pe.type,
|
|
703
710
|
options: {}
|
|
704
711
|
});
|
|
705
712
|
};
|
|
706
713
|
function Lt(e) {
|
|
707
714
|
return (t) => {
|
|
708
|
-
const { model: s, status: r, KosModelLoader: n } =
|
|
715
|
+
const { model: s, status: r, KosModelLoader: n } = Ne();
|
|
709
716
|
return /* @__PURE__ */ u(n, { ...r, children: /* @__PURE__ */ u(e, { ...t, ingredientContainer: s }) });
|
|
710
717
|
};
|
|
711
718
|
}
|
|
712
|
-
function
|
|
719
|
+
function Dt(e, t) {
|
|
713
720
|
return (s) => {
|
|
714
|
-
const { model: r, status: n, KosModelLoader: o } =
|
|
721
|
+
const { model: r, status: n, KosModelLoader: o } = xe(e);
|
|
715
722
|
return /* @__PURE__ */ u(o, { ...n, children: /* @__PURE__ */ u(t, { ...s, nozzle: r }) });
|
|
716
723
|
};
|
|
717
724
|
}
|
|
718
725
|
const G = w.createLogger({
|
|
719
726
|
name: "usePour",
|
|
720
727
|
group: "kos-hooks"
|
|
721
|
-
}),
|
|
728
|
+
}), Rt = ({
|
|
722
729
|
onBeforePour: e,
|
|
723
730
|
onPour: t,
|
|
724
731
|
onPourCancel: s,
|
|
725
732
|
onPourAbort: r,
|
|
726
733
|
pourTarget: n,
|
|
727
|
-
strategy: o =
|
|
734
|
+
strategy: o = ke
|
|
728
735
|
}) => {
|
|
729
736
|
const c = a(async () => {
|
|
730
737
|
G.debug(
|
|
@@ -739,27 +746,27 @@ const G = w.createLogger({
|
|
|
739
746
|
G.debug(
|
|
740
747
|
`[${o == null ? void 0 : o.name}] - Pour initiate ended called for pour target ${n == null ? void 0 : n.id}.`
|
|
741
748
|
), await ((m = o == null ? void 0 : o.initiateEnded) == null ? void 0 : m.call(o, n)) || s == null || s();
|
|
742
|
-
}, [s, n, o]),
|
|
749
|
+
}, [s, n, o]), h = a(async () => {
|
|
743
750
|
G.debug(`Force cancelling pour for pour target ${n == null ? void 0 : n.id}.`), await (n == null ? void 0 : n.cancelPour()), s == null || s();
|
|
744
751
|
}, [s, n]);
|
|
745
752
|
return {
|
|
746
|
-
handlers:
|
|
753
|
+
handlers: ae({
|
|
747
754
|
onPressed: c,
|
|
748
755
|
onRelease: l
|
|
749
756
|
}).dom,
|
|
750
|
-
cancel:
|
|
757
|
+
cancel: h,
|
|
751
758
|
status: n
|
|
752
759
|
};
|
|
753
760
|
}, _ = w.createLogger({
|
|
754
761
|
name: "TapOrHoldIntentStrategy",
|
|
755
762
|
group: "kos-hooks"
|
|
756
763
|
});
|
|
757
|
-
class
|
|
764
|
+
class Mt {
|
|
758
765
|
constructor(t) {
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
766
|
+
C(this, "intent");
|
|
767
|
+
C(this, "name", "TapOrHoldIntentStrategy");
|
|
768
|
+
C(this, "isHold", !1);
|
|
769
|
+
C(this, "disposer", null);
|
|
763
770
|
this.intent = t;
|
|
764
771
|
}
|
|
765
772
|
async initiate(t, s) {
|
|
@@ -779,37 +786,37 @@ class yt {
|
|
|
779
786
|
return this.disposer && clearTimeout(this.disposer), this.disposer = null, this.isHold ? (await (t == null ? void 0 : t.cancelPour()), !1) : (_.debug("Tap detected. don't cancel and return."), !0);
|
|
780
787
|
}
|
|
781
788
|
}
|
|
782
|
-
const
|
|
789
|
+
const Z = w.createLogger({
|
|
783
790
|
name: "TapToPourIntentStrategy",
|
|
784
791
|
group: "kos-hooks"
|
|
785
|
-
}),
|
|
792
|
+
}), Yt = {
|
|
786
793
|
name: "TapToPourIntentStrategy",
|
|
787
794
|
async initiate(e, t) {
|
|
788
795
|
if (e != null && e.isPouring) {
|
|
789
|
-
|
|
796
|
+
Z.debug(`Nozzle ${e == null ? void 0 : e.id} is already pouring. cancelling pour`), await e.cancelPour();
|
|
790
797
|
return;
|
|
791
798
|
}
|
|
792
799
|
if (!(e != null && e.canPour)) {
|
|
793
|
-
|
|
800
|
+
Z.debug(`Nozzle ${e == null ? void 0 : e.id} cannot pour. Returning early.`);
|
|
794
801
|
return;
|
|
795
802
|
}
|
|
796
|
-
t ? (
|
|
803
|
+
t ? (Z.debug(`performing intent: ${t}`), await (e == null ? void 0 : e.performIntent(t))) : Z.debug("no intent provided. Returning early.");
|
|
797
804
|
},
|
|
798
805
|
async initiateEnded(e) {
|
|
799
806
|
return !0;
|
|
800
807
|
}
|
|
801
|
-
},
|
|
808
|
+
}, we = w.createLogger({
|
|
802
809
|
name: "HoldToPourStrategy",
|
|
803
810
|
group: "kos-hooks"
|
|
804
|
-
}),
|
|
811
|
+
}), Ct = {
|
|
805
812
|
name: "TapToPourStrategy",
|
|
806
813
|
async initiate(e) {
|
|
807
814
|
if (e != null && e.isPouring) {
|
|
808
|
-
|
|
815
|
+
we.debug(`Nozzle ${e == null ? void 0 : e.id} is already pouring. cancelling pour`), await e.cancelPour();
|
|
809
816
|
return;
|
|
810
817
|
}
|
|
811
818
|
if (!(e != null && e.canPour)) {
|
|
812
|
-
|
|
819
|
+
we.debug(`Nozzle ${e == null ? void 0 : e.id} cannot pour. Returning early.`);
|
|
813
820
|
return;
|
|
814
821
|
}
|
|
815
822
|
await (e == null ? void 0 : e.pour());
|
|
@@ -817,7 +824,7 @@ const Q = w.createLogger({
|
|
|
817
824
|
async initiateEnded(e) {
|
|
818
825
|
return !0;
|
|
819
826
|
}
|
|
820
|
-
}, ut = (e, t, s) =>
|
|
827
|
+
}, ut = (e, t, s) => A({
|
|
821
828
|
modelId: e,
|
|
822
829
|
modelType: Ze.type,
|
|
823
830
|
options: {
|
|
@@ -825,7 +832,7 @@ const Q = w.createLogger({
|
|
|
825
832
|
selectedId: s
|
|
826
833
|
}
|
|
827
834
|
});
|
|
828
|
-
function
|
|
835
|
+
function yt(e) {
|
|
829
836
|
return (t) => {
|
|
830
837
|
const { model: s, status: r, KosModelLoader: n } = ut(
|
|
831
838
|
t.id,
|
|
@@ -835,59 +842,59 @@ function Yt(e) {
|
|
|
835
842
|
return /* @__PURE__ */ u(n, { ...r, children: /* @__PURE__ */ u(e, { ...t, genericPour: s }) });
|
|
836
843
|
};
|
|
837
844
|
}
|
|
838
|
-
const
|
|
839
|
-
const { model: t, ready: s } =
|
|
840
|
-
return /* @__PURE__ */ u(
|
|
845
|
+
const Be = k(void 0), Ot = ({ children: e }) => {
|
|
846
|
+
const { model: t, ready: s } = Pe(), r = $(() => s && t ? { model: t } : {}, [s, t]);
|
|
847
|
+
return /* @__PURE__ */ u(Be.Provider, { value: r, children: e });
|
|
841
848
|
}, Gt = () => {
|
|
842
|
-
const e =
|
|
843
|
-
|
|
849
|
+
const e = x(
|
|
850
|
+
Be
|
|
844
851
|
);
|
|
845
852
|
if (!e)
|
|
846
853
|
throw new Error(
|
|
847
854
|
"useAssemblyContext must be used within a AssemblyProvider"
|
|
848
855
|
);
|
|
849
856
|
return e;
|
|
850
|
-
},
|
|
851
|
-
const { model: t, ready: s } =
|
|
852
|
-
return /* @__PURE__ */ u(
|
|
857
|
+
}, Le = k(void 0), _t = ({ children: e }) => {
|
|
858
|
+
const { model: t, ready: s } = Ie(), r = $(() => s && t ? { model: t } : {}, [s, t]);
|
|
859
|
+
return /* @__PURE__ */ u(Le.Provider, { value: r, children: e });
|
|
853
860
|
}, Ft = () => {
|
|
854
|
-
const e =
|
|
861
|
+
const e = x(Le);
|
|
855
862
|
if (!e)
|
|
856
863
|
throw new Error(
|
|
857
864
|
"useAvailabilityContext must be used within a AvailabilityProvider"
|
|
858
865
|
);
|
|
859
866
|
return e;
|
|
860
|
-
},
|
|
861
|
-
const { model: s, ready: r } =
|
|
862
|
-
return /* @__PURE__ */ u(
|
|
867
|
+
}, De = k(void 0), Ut = ({ children: e, id: t }) => {
|
|
868
|
+
const { model: s, ready: r } = Te(t), n = $(() => r && s ? { model: s } : {}, [r, s]);
|
|
869
|
+
return /* @__PURE__ */ u(De.Provider, { value: n, children: e });
|
|
863
870
|
}, Vt = () => {
|
|
864
|
-
const e =
|
|
871
|
+
const e = x(De);
|
|
865
872
|
if (!e)
|
|
866
873
|
throw new Error("useBoardContext must be used within a BoardProvider");
|
|
867
874
|
return e;
|
|
868
|
-
},
|
|
869
|
-
const { model: t, ready: s } =
|
|
870
|
-
return /* @__PURE__ */ u(
|
|
875
|
+
}, Re = k(void 0), jt = ({ children: e }) => {
|
|
876
|
+
const { model: t, ready: s } = Ae(), r = $(() => s && t ? { model: t } : {}, [s, t]);
|
|
877
|
+
return /* @__PURE__ */ u(Re.Provider, { value: r, children: e });
|
|
871
878
|
}, Wt = () => {
|
|
872
|
-
const e =
|
|
879
|
+
const e = x(Re);
|
|
873
880
|
if (!e)
|
|
874
881
|
throw new Error(
|
|
875
882
|
"useBoardContainerContext must be used within a BoardContainerProvider"
|
|
876
883
|
);
|
|
877
884
|
return e;
|
|
878
|
-
},
|
|
885
|
+
}, Me = k(
|
|
879
886
|
void 0
|
|
880
887
|
), lt = ({ children: e }) => {
|
|
881
|
-
const { model: t, ready: s } =
|
|
888
|
+
const { model: t, ready: s } = Ee(), r = $(() => {
|
|
882
889
|
if (s && t) {
|
|
883
890
|
const o = t.nozzlePaths;
|
|
884
891
|
return { model: t, nozzlePaths: o };
|
|
885
892
|
}
|
|
886
893
|
return {};
|
|
887
894
|
}, [s, t]), n = s && t ? e : null;
|
|
888
|
-
return /* @__PURE__ */ u(
|
|
895
|
+
return /* @__PURE__ */ u(Me.Provider, { value: r, children: n });
|
|
889
896
|
}, mt = () => {
|
|
890
|
-
const e =
|
|
897
|
+
const e = x(Me);
|
|
891
898
|
if (!e)
|
|
892
899
|
throw new Error(
|
|
893
900
|
"useDeviceAssemblyContext must be used within a DeviceAssemblyProvider"
|
|
@@ -897,7 +904,7 @@ const Se = k(void 0), Ot = ({ children: e }) => {
|
|
|
897
904
|
function ft() {
|
|
898
905
|
const e = qe.createContext(null);
|
|
899
906
|
return [() => {
|
|
900
|
-
const s =
|
|
907
|
+
const s = x(e);
|
|
901
908
|
if (s === void 0)
|
|
902
909
|
throw new Error("useDispenseKitContext must be used within a Provider");
|
|
903
910
|
return s;
|
|
@@ -942,60 +949,60 @@ function qt(e) {
|
|
|
942
949
|
bt({ provider: s, props: e })
|
|
943
950
|
];
|
|
944
951
|
}
|
|
945
|
-
const
|
|
946
|
-
const { model: s, ready: r } =
|
|
947
|
-
return /* @__PURE__ */ u(
|
|
952
|
+
const Ye = k(void 0), Jt = ({ children: e, id: t }) => {
|
|
953
|
+
const { model: s, ready: r } = He(t || ""), n = $(() => r && s ? { model: s } : {}, [r, s]);
|
|
954
|
+
return /* @__PURE__ */ u(Ye.Provider, { value: n, children: e });
|
|
948
955
|
}, Qt = () => {
|
|
949
|
-
const e =
|
|
956
|
+
const e = x(Ye);
|
|
950
957
|
if (!e)
|
|
951
958
|
throw new Error("useHolderContext must be used within a HolderProvider");
|
|
952
959
|
return e;
|
|
953
|
-
},
|
|
960
|
+
}, Ce = k(
|
|
954
961
|
void 0
|
|
955
962
|
), Xt = ({ children: e }) => {
|
|
956
|
-
const { model: t, ready: s } =
|
|
957
|
-
return /* @__PURE__ */ u(
|
|
963
|
+
const { model: t, ready: s } = Se(), r = $(() => s && t ? { model: t } : {}, [s, t]);
|
|
964
|
+
return /* @__PURE__ */ u(Ce.Provider, { value: r, children: e });
|
|
958
965
|
}, Zt = () => {
|
|
959
|
-
const e =
|
|
966
|
+
const e = x(Ce);
|
|
960
967
|
if (!e)
|
|
961
968
|
throw new Error(
|
|
962
969
|
"useHolderContainerContext must be used within a HolderContainerProvider"
|
|
963
970
|
);
|
|
964
971
|
return e;
|
|
965
972
|
}, ye = k(void 0), zt = ({ children: e }) => {
|
|
966
|
-
const { model: t, ready: s } =
|
|
973
|
+
const { model: t, ready: s } = Ke(), r = $(() => s && t ? { model: t } : {}, [s, t]);
|
|
967
974
|
return /* @__PURE__ */ u(ye.Provider, { value: r, children: e });
|
|
968
975
|
}, es = () => {
|
|
969
|
-
const e =
|
|
976
|
+
const e = x(ye);
|
|
970
977
|
if (!e)
|
|
971
978
|
throw new Error(
|
|
972
979
|
"useIngredientContext must be used within a IngredientProvider"
|
|
973
980
|
);
|
|
974
981
|
return e;
|
|
975
|
-
},
|
|
982
|
+
}, Oe = k(
|
|
976
983
|
void 0
|
|
977
984
|
), ts = ({ children: e }) => {
|
|
978
|
-
const { model: t, ready: s } =
|
|
979
|
-
return /* @__PURE__ */ u(
|
|
985
|
+
const { model: t, ready: s } = Ne(), r = $(() => s && t ? { model: t } : {}, [s, t]);
|
|
986
|
+
return /* @__PURE__ */ u(Oe.Provider, { value: r, children: e });
|
|
980
987
|
}, ss = () => {
|
|
981
|
-
const e =
|
|
988
|
+
const e = x(Oe);
|
|
982
989
|
if (!e)
|
|
983
990
|
throw new Error(
|
|
984
991
|
"useIngredientContainerContext must be used within a IngredientContainerProvider"
|
|
985
992
|
);
|
|
986
993
|
return e;
|
|
987
994
|
}, vt = () => {
|
|
988
|
-
const e =
|
|
989
|
-
return
|
|
995
|
+
const e = be.type;
|
|
996
|
+
return A({
|
|
990
997
|
modelId: e,
|
|
991
|
-
modelType:
|
|
998
|
+
modelType: be.type,
|
|
992
999
|
options: {}
|
|
993
1000
|
});
|
|
994
|
-
},
|
|
995
|
-
const { model: t, ready: s } = vt(), r =
|
|
996
|
-
return /* @__PURE__ */ u(
|
|
1001
|
+
}, Ge = k(void 0), rs = ({ children: e }) => {
|
|
1002
|
+
const { model: t, ready: s } = vt(), r = $(() => s && t ? { model: t } : {}, [s, t]);
|
|
1003
|
+
return /* @__PURE__ */ u(Ge.Provider, { value: r, children: e });
|
|
997
1004
|
}, ns = () => {
|
|
998
|
-
const e =
|
|
1005
|
+
const e = x(Ge);
|
|
999
1006
|
if (!e)
|
|
1000
1007
|
throw new Error("usePumpContext must be used within a PumpProvider");
|
|
1001
1008
|
return e;
|
|
@@ -1007,8 +1014,8 @@ export {
|
|
|
1007
1014
|
ht as C,
|
|
1008
1015
|
lt as D,
|
|
1009
1016
|
tt as E,
|
|
1010
|
-
|
|
1011
|
-
|
|
1017
|
+
y as F,
|
|
1018
|
+
X as G,
|
|
1012
1019
|
Jt as H,
|
|
1013
1020
|
zt as I,
|
|
1014
1021
|
O as J,
|
|
@@ -1016,31 +1023,31 @@ export {
|
|
|
1016
1023
|
Et as L,
|
|
1017
1024
|
ct as M,
|
|
1018
1025
|
ze as N,
|
|
1019
|
-
|
|
1026
|
+
ve as O,
|
|
1020
1027
|
rs as P,
|
|
1021
1028
|
nt as Q,
|
|
1022
|
-
|
|
1029
|
+
Ee as R,
|
|
1023
1030
|
Ht as S,
|
|
1024
|
-
|
|
1031
|
+
He as T,
|
|
1025
1032
|
St as U,
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1033
|
+
Se as V,
|
|
1034
|
+
Kt as W,
|
|
1035
|
+
Ke as X,
|
|
1036
|
+
Nt as Y,
|
|
1037
|
+
Bt as Z,
|
|
1038
|
+
Ne as _,
|
|
1032
1039
|
_t as a,
|
|
1033
|
-
|
|
1034
|
-
|
|
1040
|
+
xe as a0,
|
|
1041
|
+
Dt as a1,
|
|
1035
1042
|
rt as a2,
|
|
1036
|
-
|
|
1043
|
+
Rt as a3,
|
|
1037
1044
|
dt as a4,
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1045
|
+
ke as a5,
|
|
1046
|
+
Mt as a6,
|
|
1047
|
+
Yt as a7,
|
|
1048
|
+
Ct as a8,
|
|
1042
1049
|
ut as a9,
|
|
1043
|
-
|
|
1050
|
+
yt as aa,
|
|
1044
1051
|
Ft as b,
|
|
1045
1052
|
Vt as c,
|
|
1046
1053
|
jt as d,
|
|
@@ -1054,17 +1061,17 @@ export {
|
|
|
1054
1061
|
es as l,
|
|
1055
1062
|
ts as m,
|
|
1056
1063
|
ss as n,
|
|
1057
|
-
|
|
1064
|
+
K as o,
|
|
1058
1065
|
ns as p,
|
|
1059
|
-
|
|
1060
|
-
|
|
1066
|
+
Pe as q,
|
|
1067
|
+
Ie as r,
|
|
1061
1068
|
xt as s,
|
|
1062
|
-
|
|
1069
|
+
Te as t,
|
|
1063
1070
|
Gt as u,
|
|
1064
1071
|
gt as v,
|
|
1065
1072
|
At as w,
|
|
1066
|
-
|
|
1073
|
+
Ae as x,
|
|
1067
1074
|
kt as y,
|
|
1068
1075
|
et as z
|
|
1069
1076
|
};
|
|
1070
|
-
//# sourceMappingURL=pump-provider-
|
|
1077
|
+
//# sourceMappingURL=pump-provider-35ZRKNvH.js.map
|