@kosdev-code/kos-dispense-sdk 0.1.0-dev.5264 → 0.1.0-dev.5344
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/{dispense-registration-manager-BkJ1ggtS.cjs → dispense-registration-manager-BP5wXKEC.cjs} +2 -2
- package/{dispense-registration-manager-BkJ1ggtS.cjs.map → dispense-registration-manager-BP5wXKEC.cjs.map} +1 -1
- package/{dispense-registration-manager-CcFUS_KM.js → dispense-registration-manager-Ba4UWXju.js} +14 -18
- package/{dispense-registration-manager-CcFUS_KM.js.map → dispense-registration-manager-Ba4UWXju.js.map} +1 -1
- package/{extension-utils-DeLiIgFH.js → extension-utils-CNDUJVak.js} +2 -2
- package/{extension-utils-DeLiIgFH.js.map → extension-utils-CNDUJVak.js.map} +1 -1
- package/{extension-utils-DUV7OQR1.cjs → extension-utils-CxlY9mef.cjs} +2 -2
- package/{extension-utils-DUV7OQR1.cjs.map → extension-utils-CxlY9mef.cjs.map} +1 -1
- package/index.cjs +1 -1
- package/index.js +3 -3
- package/models/models/nozzle/nozzle-model.d.ts +2 -2
- package/models/models/nozzle/nozzle-model.d.ts.map +1 -1
- package/models.cjs +1 -1
- package/models.js +2 -2
- package/package.json +4 -4
- package/{pump-provider-BTnIydH2.js → pump-provider-Dhh0rg1k.js} +247 -241
- package/pump-provider-Dhh0rg1k.js.map +1 -0
- package/pump-provider-m3YekBzj.cjs +2 -0
- package/pump-provider-m3YekBzj.cjs.map +1 -0
- package/ui/hooks/cui-kit/use-beverages.d.ts +1 -1
- package/ui/hooks/cui-kit/use-beverages.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-brands.d.ts +1 -1
- package/ui/hooks/cui-kit/use-brands.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-cui-kit.d.ts +1 -1
- package/ui/hooks/cui-kit/use-cui-kit.d.ts.map +1 -1
- package/ui/hooks/cui-kit/use-flavors.d.ts +1 -1
- package/ui/hooks/cui-kit/use-flavors.d.ts.map +1 -1
- package/ui.cjs +1 -1
- package/ui.js +2 -2
- package/pump-provider-BTnIydH2.js.map +0 -1
- package/pump-provider-BUfMtaXv.cjs +0 -2
- package/pump-provider-BUfMtaXv.cjs.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var ot = Object.defineProperty;
|
|
2
2
|
var it = (e, t, r) => t in e ? ot(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
-
var
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { useKosModel as C, getKosCompanionModel as
|
|
6
|
-
import { A as Ae, b as Ke, e as ct, d as Ee, N as dt, f as ye, H as ut, j as Ce, I as Se, k as ke, G as lt, P as Ne } from "./dispense-registration-manager-
|
|
3
|
+
var U = (e, t, r) => (it(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
|
+
import { jsx as m } from "@emotion/react/jsx-runtime";
|
|
5
|
+
import { useKosModel as C, getKosCompanionModel as $e, kosAutoEffect as De, KosLog as P, usePressGesture as Pe, EventBus as w, TimerManager as Be } from "@kosdev-code/kos-ui-sdk";
|
|
6
|
+
import { A as Ae, b as Ke, e as ct, d as Ee, N as dt, f as ye, H as ut, j as Ce, I as Se, k as ke, G as lt, P as Ne } from "./dispense-registration-manager-Ba4UWXju.js";
|
|
7
7
|
import mt, { createContext as N, useMemo as A, useContext as S, useState as x, useCallback as i, useEffect as V, useRef as le } from "react";
|
|
8
8
|
const Le = () => {
|
|
9
9
|
const e = Ae.type;
|
|
@@ -16,7 +16,7 @@ const Le = () => {
|
|
|
16
16
|
function _t(e) {
|
|
17
17
|
return (t) => {
|
|
18
18
|
const { model: r, status: n, KosModelLoader: s } = Le();
|
|
19
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ m(s, { ...n, children: /* @__PURE__ */ m(e, { ...t, assembly: r }) });
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
const Me = () => {
|
|
@@ -30,7 +30,7 @@ const Me = () => {
|
|
|
30
30
|
function Ot(e) {
|
|
31
31
|
return (t) => {
|
|
32
32
|
const { model: r, status: n, KosModelLoader: s } = Me();
|
|
33
|
-
return /* @__PURE__ */
|
|
33
|
+
return /* @__PURE__ */ m(s, { ...n, children: /* @__PURE__ */ m(e, { ...t, beverage: r }) });
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
const _e = (e) => C({
|
|
@@ -41,7 +41,7 @@ const _e = (e) => C({
|
|
|
41
41
|
function Yt(e) {
|
|
42
42
|
return (t) => (r) => {
|
|
43
43
|
const { model: n, status: s, KosModelLoader: o } = _e(t);
|
|
44
|
-
return /* @__PURE__ */
|
|
44
|
+
return /* @__PURE__ */ m(o, { ...s, children: /* @__PURE__ */ m(e, { ...r, board: n }) });
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
const Oe = () => {
|
|
@@ -55,7 +55,7 @@ const Oe = () => {
|
|
|
55
55
|
function Ft(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
61
|
const Ye = (e) => C({
|
|
@@ -66,7 +66,7 @@ const Ye = (e) => C({
|
|
|
66
66
|
}
|
|
67
67
|
}), Fe = N(void 0), ht = ({ children: e, path: t }) => {
|
|
68
68
|
const { model: r, ready: n } = Ye(t), s = A(() => n && r ? { model: r } : {}, [n, r]);
|
|
69
|
-
return /* @__PURE__ */
|
|
69
|
+
return /* @__PURE__ */ m(Fe.Provider, { value: s, children: e });
|
|
70
70
|
}, M = () => {
|
|
71
71
|
const e = S(Fe);
|
|
72
72
|
if (!e)
|
|
@@ -78,28 +78,28 @@ const Ye = (e) => C({
|
|
|
78
78
|
onClearBeverage: r,
|
|
79
79
|
companionType: n
|
|
80
80
|
}) => {
|
|
81
|
-
const { model: s } = M(), [o, a] = x([]), [d,
|
|
82
|
-
(p) =>
|
|
81
|
+
const { model: s } = M(), [o, a] = x([]), [d, T] = x(null), f = A(() => n ? o.map(
|
|
82
|
+
(p) => $e(p, n)
|
|
83
83
|
) : [], [o, n]), c = i(
|
|
84
|
-
async (p) => {
|
|
85
|
-
|
|
84
|
+
async (p, v, b) => {
|
|
85
|
+
T(p), await (s == null ? void 0 : s.setSelectedPourable({ beverage: p, context: v }, b)), e == null || e(p);
|
|
86
86
|
},
|
|
87
87
|
[s, e]
|
|
88
|
-
),
|
|
89
|
-
|
|
88
|
+
), h = i(async () => {
|
|
89
|
+
T(null), await (s == null ? void 0 : s.setSelectedPourable({ beverage: void 0 })), r == null || r();
|
|
90
90
|
}, [s, r]);
|
|
91
91
|
return V(() => {
|
|
92
92
|
const p = De(() => {
|
|
93
93
|
if (!s)
|
|
94
94
|
return;
|
|
95
|
-
const
|
|
96
|
-
if (
|
|
97
|
-
const
|
|
98
|
-
a(
|
|
95
|
+
const v = s.selectedBrand;
|
|
96
|
+
if (!v) {
|
|
97
|
+
const u = s.getGroupAvailabilityItems("beverages").filter((g) => g.visible);
|
|
98
|
+
a(u ?? []), t == null || t(u);
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
const
|
|
102
|
-
a(
|
|
101
|
+
const b = s.getAvailabilityByParent(v.id).filter((u) => u.visible);
|
|
102
|
+
a(b ?? []), t == null || t(b);
|
|
103
103
|
});
|
|
104
104
|
return () => {
|
|
105
105
|
p();
|
|
@@ -109,31 +109,33 @@ const Ye = (e) => C({
|
|
|
109
109
|
beverageCompanions: f,
|
|
110
110
|
selectBeverage: c,
|
|
111
111
|
selectedBeverage: d,
|
|
112
|
-
clearBeverage:
|
|
112
|
+
clearBeverage: h
|
|
113
113
|
};
|
|
114
114
|
}, pt = ({
|
|
115
115
|
onBrandSelected: e,
|
|
116
116
|
onBrandCleared: t,
|
|
117
117
|
companionType: r
|
|
118
118
|
}) => {
|
|
119
|
-
const { model: n } = M(), [s, o] = x(null), [a, d] = x([]),
|
|
120
|
-
async (
|
|
121
|
-
o(
|
|
119
|
+
const { model: n } = M(), [s, o] = x(null), [a, d] = x([]), T = A(() => r ? a.map((h) => $e(h, r)) : [], [a, r]), f = i(
|
|
120
|
+
async (h, p, v) => {
|
|
121
|
+
o(h), v && P.warn(
|
|
122
|
+
"forceUpdate is not currently supported when setting brand"
|
|
123
|
+
), n == null || n.setSelectedBrand(h, p), e == null || e(h);
|
|
122
124
|
},
|
|
123
125
|
[n, e]
|
|
124
126
|
), c = i(() => {
|
|
125
127
|
o(null), n == null || n.setSelectedBrand(void 0), t == null || t();
|
|
126
128
|
}, [n, t]);
|
|
127
129
|
return V(() => {
|
|
128
|
-
const
|
|
130
|
+
const h = De(() => {
|
|
129
131
|
n && d(n.visibleBrands);
|
|
130
132
|
});
|
|
131
133
|
return () => {
|
|
132
|
-
|
|
134
|
+
h();
|
|
133
135
|
};
|
|
134
136
|
}, [n]), {
|
|
135
137
|
brands: a,
|
|
136
|
-
brandCompanions:
|
|
138
|
+
brandCompanions: T,
|
|
137
139
|
selectedBrand: s,
|
|
138
140
|
selectBrand: f,
|
|
139
141
|
clearBrand: c
|
|
@@ -141,7 +143,7 @@ const Ye = (e) => C({
|
|
|
141
143
|
};
|
|
142
144
|
class Ge {
|
|
143
145
|
constructor() {
|
|
144
|
-
|
|
146
|
+
U(this, "_data", /* @__PURE__ */ new Map());
|
|
145
147
|
}
|
|
146
148
|
get(t) {
|
|
147
149
|
return this._data.get(t);
|
|
@@ -182,7 +184,7 @@ const bt = P.createLogger({
|
|
|
182
184
|
pourContext: s,
|
|
183
185
|
strategy: o = Ve
|
|
184
186
|
}) => {
|
|
185
|
-
const { model: a } = M(), [d,
|
|
187
|
+
const { model: a } = M(), [d, T] = x(
|
|
186
188
|
s || new Ge()
|
|
187
189
|
), f = i(async () => {
|
|
188
190
|
(r ? await (r == null ? void 0 : r(d)) : !0) ? (ce.debug(
|
|
@@ -199,20 +201,20 @@ const bt = P.createLogger({
|
|
|
199
201
|
d,
|
|
200
202
|
n
|
|
201
203
|
]), c = i(() => {
|
|
202
|
-
var
|
|
204
|
+
var u;
|
|
203
205
|
ce.debug(
|
|
204
206
|
`[${o == null ? void 0 : o.name}] - Pour initiate ended called for nozzle ${a == null ? void 0 : a.id}.`
|
|
205
|
-
), (
|
|
206
|
-
}, [t, a, o]),
|
|
207
|
+
), (u = o == null ? void 0 : o.initiateEnded) == null || u.call(o, a), t == null || t();
|
|
208
|
+
}, [t, a, o]), h = i(() => {
|
|
207
209
|
ce.debug(`Force cancelling pour for nozzle ${a == null ? void 0 : a.id}.`), a == null || a.cancelPour(), t == null || t();
|
|
208
210
|
}, [t, a]), p = i(
|
|
209
|
-
(
|
|
210
|
-
d.set(
|
|
211
|
+
(u, g) => {
|
|
212
|
+
d.set(u, g);
|
|
211
213
|
},
|
|
212
214
|
[d]
|
|
213
|
-
),
|
|
214
|
-
(
|
|
215
|
-
d.remove(
|
|
215
|
+
), v = i(
|
|
216
|
+
(u) => {
|
|
217
|
+
d.remove(u);
|
|
216
218
|
},
|
|
217
219
|
[d]
|
|
218
220
|
);
|
|
@@ -221,9 +223,9 @@ const bt = P.createLogger({
|
|
|
221
223
|
onPressed: f,
|
|
222
224
|
onRelease: c
|
|
223
225
|
}).dom,
|
|
224
|
-
cancel:
|
|
226
|
+
cancel: h,
|
|
225
227
|
updatePourContext: p,
|
|
226
|
-
removeFromPourContext:
|
|
228
|
+
removeFromPourContext: v,
|
|
227
229
|
status: a
|
|
228
230
|
};
|
|
229
231
|
}, Tt = ({
|
|
@@ -235,17 +237,21 @@ const bt = P.createLogger({
|
|
|
235
237
|
() => (n == null ? void 0 : n.getGroupAvailabilityItems("flavors").filter((c) => c.visible)) ?? [],
|
|
236
238
|
[n]
|
|
237
239
|
), o = A(() => r ? s.map(
|
|
238
|
-
(c) =>
|
|
239
|
-
) : [], [s, r]), [a, d] = x([]),
|
|
240
|
-
async (c) => {
|
|
240
|
+
(c) => $e(c, r)
|
|
241
|
+
) : [], [s, r]), [a, d] = x([]), T = i(
|
|
242
|
+
async (c, h, p) => {
|
|
241
243
|
if (d(
|
|
242
|
-
(
|
|
244
|
+
(v) => v != null && v.includes(c) ? [...v.filter((b) => b !== c)] : [...v ?? [], c]
|
|
243
245
|
), n != null && n.selectedPourable) {
|
|
244
|
-
const { beverage:
|
|
245
|
-
await n.setSelectedPourable(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
246
|
+
const { beverage: v } = n.selectedPourable;
|
|
247
|
+
await n.setSelectedPourable(
|
|
248
|
+
{
|
|
249
|
+
beverage: v,
|
|
250
|
+
additional: a ?? [],
|
|
251
|
+
context: h
|
|
252
|
+
},
|
|
253
|
+
p
|
|
254
|
+
);
|
|
249
255
|
}
|
|
250
256
|
e == null || e(c, a ?? []);
|
|
251
257
|
},
|
|
@@ -259,80 +265,80 @@ const bt = P.createLogger({
|
|
|
259
265
|
return {
|
|
260
266
|
flavors: s,
|
|
261
267
|
flavorCompanions: o,
|
|
262
|
-
selectFlavor:
|
|
268
|
+
selectFlavor: T,
|
|
263
269
|
selectedFlavors: a,
|
|
264
270
|
clearFlavors: f
|
|
265
271
|
};
|
|
266
|
-
}, te = "brands", de = "beverages", se = "flavors", G = P.createLogger({ name: "use-cui-kit" }),
|
|
272
|
+
}, te = "brands", de = "beverages", se = "flavors", G = P.createLogger({ name: "use-cui-kit" }), wt = ({
|
|
267
273
|
initialGroup: e = te,
|
|
268
274
|
options: t = {}
|
|
269
275
|
}) => {
|
|
270
276
|
var ae, oe, ie;
|
|
271
|
-
const [r, n] = x(e), { model: s } = M(), o = le([]), a = le(), d = le(),
|
|
272
|
-
(
|
|
277
|
+
const [r, n] = x(e), { model: s } = M(), o = le([]), a = le(), d = le(), T = i(
|
|
278
|
+
(l) => {
|
|
273
279
|
n(se);
|
|
274
|
-
const
|
|
275
|
-
|
|
280
|
+
const $ = `/kos/dispense/${s == null ? void 0 : s.path}/brand/selected/`;
|
|
281
|
+
w.publish($, l);
|
|
276
282
|
},
|
|
277
283
|
[s == null ? void 0 : s.path]
|
|
278
284
|
), f = i(() => {
|
|
279
|
-
const
|
|
280
|
-
|
|
285
|
+
const l = `/kos/dispense/${s == null ? void 0 : s.path}/brand/cleared/`;
|
|
286
|
+
w.publish(l, {});
|
|
281
287
|
}, [s == null ? void 0 : s.path]), c = i(
|
|
282
|
-
(
|
|
283
|
-
const
|
|
284
|
-
|
|
288
|
+
(l) => {
|
|
289
|
+
const $ = `/kos/dispense/${s == null ? void 0 : s.path}/beverage/list/updated/`;
|
|
290
|
+
w.publish($, l);
|
|
285
291
|
},
|
|
286
292
|
[s == null ? void 0 : s.path]
|
|
287
|
-
),
|
|
288
|
-
(
|
|
293
|
+
), h = i(
|
|
294
|
+
(l) => {
|
|
289
295
|
var ee;
|
|
290
|
-
n(se), (ee = a.current) == null || ee.call(a, "selectedBeverage",
|
|
291
|
-
const
|
|
292
|
-
|
|
296
|
+
n(se), (ee = a.current) == null || ee.call(a, "selectedBeverage", l);
|
|
297
|
+
const $ = `/kos/dispense/${s == null ? void 0 : s.path}/beverage/selected/`;
|
|
298
|
+
w.publish($, l);
|
|
293
299
|
},
|
|
294
300
|
[s == null ? void 0 : s.path]
|
|
295
301
|
), p = i(() => {
|
|
296
|
-
var
|
|
297
|
-
const
|
|
298
|
-
(
|
|
299
|
-
}, [s == null ? void 0 : s.path]),
|
|
300
|
-
(
|
|
301
|
-
const
|
|
302
|
-
|
|
302
|
+
var $;
|
|
303
|
+
const l = `/kos/dispense/${s == null ? void 0 : s.path}/beverage/cleared/`;
|
|
304
|
+
($ = d.current) == null || $.call(d, "selectedBeverage"), w.publish(l, {});
|
|
305
|
+
}, [s == null ? void 0 : s.path]), v = i(
|
|
306
|
+
(l) => {
|
|
307
|
+
const $ = `/kos/dispense/${s == null ? void 0 : s.path}/flavor/selected/`;
|
|
308
|
+
w.publish($, l);
|
|
303
309
|
},
|
|
304
310
|
[s == null ? void 0 : s.path]
|
|
305
|
-
),
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
}, [s == null ? void 0 : s.path]),
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
+
), b = i(() => {
|
|
312
|
+
const l = `/kos/dispense/${s == null ? void 0 : s.path}/flavor/cleared/`;
|
|
313
|
+
w.publish(l, {});
|
|
314
|
+
}, [s == null ? void 0 : s.path]), u = i(() => {
|
|
315
|
+
const l = `/kos/dispense/${s == null ? void 0 : s.path}/pour/`;
|
|
316
|
+
w.publish(l, {});
|
|
311
317
|
}, [s == null ? void 0 : s.path]), g = i(
|
|
312
|
-
async (
|
|
313
|
-
const
|
|
314
|
-
return
|
|
318
|
+
async (l) => {
|
|
319
|
+
const $ = `/kos/dispense/${s == null ? void 0 : s.path}/pre/pour/`;
|
|
320
|
+
return w.publish($, {}), await (F == null ? void 0 : F(l)) || !0;
|
|
315
321
|
},
|
|
316
322
|
[s == null ? void 0 : s.path]
|
|
317
323
|
), y = i(async () => {
|
|
318
|
-
const
|
|
319
|
-
|
|
324
|
+
const l = `/kos/dispense/${s == null ? void 0 : s.path}/pre/pour/rejected/`;
|
|
325
|
+
w.publish(l, {});
|
|
320
326
|
}, [s == null ? void 0 : s.path]), _ = i(() => {
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
}, [s == null ? void 0 : s.path]), { brands: O, selectBrand: R, selectedBrand:
|
|
327
|
+
const l = `/kos/dispense/${s == null ? void 0 : s.path}/pour/cancel/`;
|
|
328
|
+
w.publish(l, {});
|
|
329
|
+
}, [s == null ? void 0 : s.path]), { brands: O, selectBrand: R, selectedBrand: X, clearBrand: Y, brandCompanions: me } = pt({
|
|
324
330
|
companionType: (ae = t.companionTypes) == null ? void 0 : ae.brand,
|
|
325
|
-
onBrandSelected:
|
|
331
|
+
onBrandSelected: T,
|
|
326
332
|
onBrandCleared: f
|
|
327
333
|
}), {
|
|
328
334
|
beverages: H,
|
|
329
335
|
selectBeverage: D,
|
|
330
|
-
selectedBeverage:
|
|
336
|
+
selectedBeverage: Z,
|
|
331
337
|
clearBeverage: B,
|
|
332
338
|
beverageCompanions: q
|
|
333
339
|
} = ft({
|
|
334
340
|
companionType: (oe = t.companionTypes) == null ? void 0 : oe.beverage,
|
|
335
|
-
onBeverageSelected:
|
|
341
|
+
onBeverageSelected: h,
|
|
336
342
|
onClearBeverage: p,
|
|
337
343
|
onBeverageListUpdated: c
|
|
338
344
|
}), {
|
|
@@ -343,12 +349,12 @@ const bt = P.createLogger({
|
|
|
343
349
|
flavorCompanions: j
|
|
344
350
|
} = Tt({
|
|
345
351
|
companionType: (ie = t.companionTypes) == null ? void 0 : ie.flavor,
|
|
346
|
-
onFlavorSelected:
|
|
347
|
-
onFlavorCleared:
|
|
348
|
-
}), [F, Q] = x(), he = i((
|
|
349
|
-
Q(() =>
|
|
352
|
+
onFlavorSelected: v,
|
|
353
|
+
onFlavorCleared: b
|
|
354
|
+
}), [F, Q] = x(), he = i((l) => {
|
|
355
|
+
Q(() => l);
|
|
350
356
|
}, []), z = vt({
|
|
351
|
-
onPour:
|
|
357
|
+
onPour: u,
|
|
352
358
|
onPourCancel: _,
|
|
353
359
|
onBeforePour: g,
|
|
354
360
|
onBeforePourRejected: y
|
|
@@ -365,34 +371,34 @@ const bt = P.createLogger({
|
|
|
365
371
|
break;
|
|
366
372
|
}
|
|
367
373
|
}, [B, Y, r, e]), pe = i(() => {
|
|
368
|
-
const
|
|
369
|
-
|
|
374
|
+
const l = `/kos/dispense/${s == null ? void 0 : s.path}/home/`;
|
|
375
|
+
w.publish(l, {}), n(e), e === te && (B(), Y()), e === de && B();
|
|
370
376
|
}, [B, Y, e]), be = i(() => {
|
|
371
377
|
if (o.current.length === 0) {
|
|
372
378
|
G.debug("No timers to pause.");
|
|
373
379
|
return;
|
|
374
380
|
}
|
|
375
|
-
G.debug(`Pausing ${o.current.length} timers.`), o.current.forEach((
|
|
376
|
-
G.debug(`Pausing timer with id ${
|
|
381
|
+
G.debug(`Pausing ${o.current.length} timers.`), o.current.forEach((l) => {
|
|
382
|
+
G.debug(`Pausing timer with id ${l.id}.`), l.pause();
|
|
377
383
|
});
|
|
378
384
|
}, []), ve = i(() => {
|
|
379
385
|
if (o.current.length === 0) {
|
|
380
386
|
G.debug("No timers to restart.");
|
|
381
387
|
return;
|
|
382
388
|
}
|
|
383
|
-
G.debug(`Restarting ${o.current.length} timers.`), o.current.forEach((
|
|
384
|
-
G.debug(`Restarting timer with id ${
|
|
389
|
+
G.debug(`Restarting ${o.current.length} timers.`), o.current.forEach((l) => {
|
|
390
|
+
G.debug(`Restarting timer with id ${l.id}.`), l.restart();
|
|
385
391
|
});
|
|
386
392
|
}, []);
|
|
387
393
|
return {
|
|
388
394
|
timers: {
|
|
389
|
-
add: i((
|
|
390
|
-
if (
|
|
391
|
-
if (o.current.some((
|
|
392
|
-
G.debug(`Timer with id ${
|
|
395
|
+
add: i((l) => {
|
|
396
|
+
if (l) {
|
|
397
|
+
if (o.current.some(($) => $.id === l.id)) {
|
|
398
|
+
G.debug(`Timer with id ${l.id} already exists.`);
|
|
393
399
|
return;
|
|
394
400
|
}
|
|
395
|
-
o.current.push(
|
|
401
|
+
o.current.push(l);
|
|
396
402
|
}
|
|
397
403
|
}, []),
|
|
398
404
|
pause: be,
|
|
@@ -406,8 +412,8 @@ const bt = P.createLogger({
|
|
|
406
412
|
pour: z,
|
|
407
413
|
updateOnBeforePour: he,
|
|
408
414
|
selections: {
|
|
409
|
-
[te]:
|
|
410
|
-
[de]:
|
|
415
|
+
[te]: X,
|
|
416
|
+
[de]: Z,
|
|
411
417
|
[se]: K
|
|
412
418
|
},
|
|
413
419
|
[te]: {
|
|
@@ -441,36 +447,36 @@ const bt = P.createLogger({
|
|
|
441
447
|
onAttractTimer: o,
|
|
442
448
|
onResetAttractTimer: a,
|
|
443
449
|
onResumeAttractTimer: d,
|
|
444
|
-
defaultAttractTime:
|
|
450
|
+
defaultAttractTime: T,
|
|
445
451
|
defaultAmbientTime: f
|
|
446
452
|
} = e, c = i(() => {
|
|
447
453
|
s && (P.info("Ambient timer expired. Calling callback"), s == null || s());
|
|
448
|
-
}, [s]),
|
|
454
|
+
}, [s]), h = i(() => {
|
|
449
455
|
o && (P.info("Attract timer expired. Calling callback"), o == null || o());
|
|
450
456
|
}, [o]), p = i(() => {
|
|
451
457
|
r && (r.restart(), a == null || a());
|
|
452
|
-
}, [r, a]), $ = i(() => {
|
|
453
|
-
r && (r.reset(), a == null || a());
|
|
454
458
|
}, [r, a]), v = i(() => {
|
|
459
|
+
r && (r.reset(), a == null || a());
|
|
460
|
+
}, [r, a]), b = i(() => {
|
|
455
461
|
r && (r.pause(), d == null || d());
|
|
456
462
|
}, [r, d]);
|
|
457
463
|
return V(() => {
|
|
458
|
-
if (t &&
|
|
464
|
+
if (t && T) {
|
|
459
465
|
P.info("Nozzle is available. Creating timers");
|
|
460
|
-
const
|
|
466
|
+
const u = Be.createTimer(
|
|
461
467
|
"attract-timer-" + t.path,
|
|
462
|
-
|
|
468
|
+
T
|
|
463
469
|
);
|
|
464
|
-
return
|
|
470
|
+
return T && (u == null || u.addTimeoutAction({
|
|
465
471
|
name: "attract-timer",
|
|
466
472
|
remainingTime: 0,
|
|
467
|
-
action:
|
|
468
|
-
})), f && (
|
|
473
|
+
action: h
|
|
474
|
+
})), f && (u == null || u.addTimeoutAction({
|
|
469
475
|
name: "ambient-timer",
|
|
470
476
|
remainingTime: f,
|
|
471
477
|
action: c
|
|
472
|
-
})),
|
|
473
|
-
|
|
478
|
+
})), T && (u == null || u.start()), n(u ?? null), () => {
|
|
479
|
+
u == null || u.reset(), n(null);
|
|
474
480
|
};
|
|
475
481
|
}
|
|
476
482
|
return () => {
|
|
@@ -478,17 +484,17 @@ const bt = P.createLogger({
|
|
|
478
484
|
};
|
|
479
485
|
}, [
|
|
480
486
|
f,
|
|
481
|
-
|
|
487
|
+
T,
|
|
482
488
|
c,
|
|
483
|
-
|
|
489
|
+
h,
|
|
484
490
|
t
|
|
485
491
|
]), {
|
|
486
492
|
attractTimer: r,
|
|
487
493
|
restart: p,
|
|
488
|
-
pause:
|
|
489
|
-
resume:
|
|
494
|
+
pause: v,
|
|
495
|
+
resume: b
|
|
490
496
|
};
|
|
491
|
-
},
|
|
497
|
+
}, $t = [
|
|
492
498
|
{ path: "brand/selected", callbackKey: "onBrandSelected" },
|
|
493
499
|
{ path: "brand/cleared", callbackKey: "onBrandCleared" },
|
|
494
500
|
{ path: "beverage/list/updated", callbackKey: "onBeverageListUpdated" },
|
|
@@ -508,7 +514,7 @@ const bt = P.createLogger({
|
|
|
508
514
|
{ path: "home", callbackKey: "onReturnToHome" }
|
|
509
515
|
];
|
|
510
516
|
function Pt(e, t) {
|
|
511
|
-
return e ?
|
|
517
|
+
return e ? $t.filter(
|
|
512
518
|
(r) => t[r.callbackKey] !== void 0
|
|
513
519
|
).map((r) => ({
|
|
514
520
|
topic: `/kos/dispense/${e}/${r.path}/`,
|
|
@@ -520,7 +526,7 @@ const It = (e, t) => {
|
|
|
520
526
|
const r = (s) => {
|
|
521
527
|
s && s.body && t(s.body);
|
|
522
528
|
};
|
|
523
|
-
return
|
|
529
|
+
return w.subscribe(e, r).unsubscribe;
|
|
524
530
|
}
|
|
525
531
|
}, xt = ({
|
|
526
532
|
onInit: e,
|
|
@@ -531,14 +537,14 @@ const It = (e, t) => {
|
|
|
531
537
|
onBeverageListUpdated: o,
|
|
532
538
|
onFlavorCleared: a,
|
|
533
539
|
onFlavorSelected: d,
|
|
534
|
-
onReturnToHome:
|
|
540
|
+
onReturnToHome: T,
|
|
535
541
|
onPour: f,
|
|
536
542
|
onPourCancel: c,
|
|
537
|
-
onBeforePourRejected:
|
|
543
|
+
onBeforePourRejected: h,
|
|
538
544
|
onAmbientTimer: p,
|
|
539
|
-
onAttractTimer:
|
|
540
|
-
onResumeAttractTimer:
|
|
541
|
-
onIdleTimeout:
|
|
545
|
+
onAttractTimer: v,
|
|
546
|
+
onResumeAttractTimer: b,
|
|
547
|
+
onIdleTimeout: u,
|
|
542
548
|
onAreYouThereTimeout: g
|
|
543
549
|
}) => {
|
|
544
550
|
const { model: y } = M();
|
|
@@ -553,16 +559,16 @@ const It = (e, t) => {
|
|
|
553
559
|
onFlavorCleared: a,
|
|
554
560
|
onPour: f,
|
|
555
561
|
onPourCancel: c,
|
|
556
|
-
onBeforePourRejected:
|
|
562
|
+
onBeforePourRejected: h,
|
|
557
563
|
onAmbientTimer: p,
|
|
558
|
-
onAttractTimer:
|
|
559
|
-
onResumeAttractTimer:
|
|
560
|
-
onIdleTimeout:
|
|
564
|
+
onAttractTimer: v,
|
|
565
|
+
onResumeAttractTimer: b,
|
|
566
|
+
onIdleTimeout: u,
|
|
561
567
|
onAreYouThereTimeout: g,
|
|
562
568
|
onInit: e,
|
|
563
|
-
onReturnToHome:
|
|
569
|
+
onReturnToHome: T
|
|
564
570
|
}).map(
|
|
565
|
-
({ topic: R, callback:
|
|
571
|
+
({ topic: R, callback: X }) => It(R, X)
|
|
566
572
|
);
|
|
567
573
|
return () => {
|
|
568
574
|
O.forEach((R) => R == null ? void 0 : R());
|
|
@@ -570,7 +576,7 @@ const It = (e, t) => {
|
|
|
570
576
|
}, [
|
|
571
577
|
y == null ? void 0 : y.path,
|
|
572
578
|
p,
|
|
573
|
-
|
|
579
|
+
v,
|
|
574
580
|
n,
|
|
575
581
|
s,
|
|
576
582
|
o,
|
|
@@ -580,12 +586,12 @@ const It = (e, t) => {
|
|
|
580
586
|
d,
|
|
581
587
|
f,
|
|
582
588
|
c,
|
|
589
|
+
h,
|
|
590
|
+
b,
|
|
583
591
|
u,
|
|
584
|
-
v,
|
|
585
|
-
l,
|
|
586
592
|
g,
|
|
587
593
|
e,
|
|
588
|
-
|
|
594
|
+
T
|
|
589
595
|
]);
|
|
590
596
|
}, L = P.createLogger({ name: "useCuiKitTimers" }), He = (e) => {
|
|
591
597
|
const { model: t } = M(), [r, n] = x(null), {
|
|
@@ -593,41 +599,41 @@ const It = (e, t) => {
|
|
|
593
599
|
onIdleTimer: o,
|
|
594
600
|
onResetIdleTimer: a,
|
|
595
601
|
defaultAreYouThereTime: d = 10,
|
|
596
|
-
defaultIdleTime:
|
|
602
|
+
defaultIdleTime: T = 20
|
|
597
603
|
} = e, f = le(!1), c = i(() => {
|
|
598
604
|
!f.current && s && (P.info("Are you there timer expired. Calling callback"), f.current = !0, s == null || s());
|
|
599
|
-
}, [s]),
|
|
605
|
+
}, [s]), h = i(() => {
|
|
600
606
|
L.debug(
|
|
601
607
|
"handleIdleTimer called in useCuiKitTimers, onIdleTimer exists:",
|
|
602
608
|
!!o
|
|
603
609
|
), o ? (L.debug("Idle timer expired. Calling callback"), o == null || o()) : L.debug("No onIdleTimer callback provided!");
|
|
604
610
|
}, [o]), p = i(() => {
|
|
605
611
|
L.debug(`TIMER RESTART called for ${e.prefix ?? ""}timer`), r && (r.restart(), f.current = !1, a == null || a());
|
|
606
|
-
}, [r, a, e.prefix]),
|
|
612
|
+
}, [r, a, e.prefix]), v = i(() => {
|
|
607
613
|
L.debug(`TIMER PAUSE/RESET called for ${e.prefix ?? ""}timer`), r && (r.reset(), f.current = !1, a == null || a());
|
|
608
614
|
}, [r, a, e.prefix]);
|
|
609
615
|
return V(() => {
|
|
610
616
|
if (L.debug(
|
|
611
|
-
`useCuiKitTimers effect triggered - nozzle: ${!!t}, path: ${t == null ? void 0 : t.path}, callbacks: handleIdle=${!!
|
|
617
|
+
`useCuiKitTimers effect triggered - nozzle: ${!!t}, path: ${t == null ? void 0 : t.path}, callbacks: handleIdle=${!!h}, handleAreYouThere=${!!c}`
|
|
612
618
|
), t) {
|
|
613
619
|
L.info("Nozzle is available. Creating timers");
|
|
614
|
-
const
|
|
620
|
+
const b = Be.createTimer(
|
|
615
621
|
`${e.prefix ?? ""}idle-timer-${t.path}`,
|
|
616
|
-
|
|
622
|
+
T
|
|
617
623
|
);
|
|
618
624
|
return L.debug(
|
|
619
625
|
`Adding idle timer action for ${e.prefix ?? ""}idle-timer-${t.path} with callback:`,
|
|
620
|
-
!!
|
|
621
|
-
),
|
|
626
|
+
!!h
|
|
627
|
+
), b == null || b.addTimeoutAction({
|
|
622
628
|
name: "idle-timer",
|
|
623
629
|
remainingTime: 0,
|
|
624
|
-
action:
|
|
625
|
-
}),
|
|
630
|
+
action: h
|
|
631
|
+
}), b == null || b.addTimeoutAction({
|
|
626
632
|
name: "are-you-there-timer",
|
|
627
633
|
remainingTime: d,
|
|
628
634
|
action: c
|
|
629
|
-
}), n(
|
|
630
|
-
|
|
635
|
+
}), n(b ?? null), () => {
|
|
636
|
+
b == null || b.reset(), n(null);
|
|
631
637
|
};
|
|
632
638
|
}
|
|
633
639
|
return () => {
|
|
@@ -635,15 +641,15 @@ const It = (e, t) => {
|
|
|
635
641
|
};
|
|
636
642
|
}, [
|
|
637
643
|
d,
|
|
638
|
-
|
|
644
|
+
T,
|
|
639
645
|
c,
|
|
640
|
-
|
|
646
|
+
h,
|
|
641
647
|
t,
|
|
642
648
|
e.prefix
|
|
643
649
|
]), {
|
|
644
650
|
idleTimer: r,
|
|
645
651
|
restart: p,
|
|
646
|
-
pause:
|
|
652
|
+
pause: v
|
|
647
653
|
};
|
|
648
654
|
}, W = P.createLogger({ name: "useDefaultCuiKitLifecycle" }), Gt = ({
|
|
649
655
|
kit: e,
|
|
@@ -653,56 +659,56 @@ const It = (e, t) => {
|
|
|
653
659
|
onBeforeAreYouThereTimer: s,
|
|
654
660
|
areYouThereRejectionPolicy: o = "pause"
|
|
655
661
|
}) => {
|
|
656
|
-
var
|
|
657
|
-
const [a, d] = x(!1), [
|
|
662
|
+
var l, $, ee, xe;
|
|
663
|
+
const [a, d] = x(!1), [T, f] = x(!1), { model: c } = M(), [h, p] = x(!1), v = (t == null ? void 0 : t.idleTimeout) ?? 15, b = (t == null ? void 0 : t.areYouThereTimeoutOffset) ?? 10, u = (r == null ? void 0 : r.idleTimeout) ?? (t == null ? void 0 : t.idleTimeout) ?? 10, g = (r == null ? void 0 : r.areYouThereTimeoutOffset) ?? (t == null ? void 0 : t.areYouThereTimeoutOffset) ?? 5, y = n == null ? void 0 : n.ambientTimeoutOffset, _ = n == null ? void 0 : n.attractTimeout, O = i(() => {
|
|
658
664
|
if (W.info("handleIdleTimeout called - navigating home and publishing event"), q(!1), e == null || e.nav.home(), c) {
|
|
659
665
|
const E = `/kos/dispense/${c.path}/idle/timeout/`;
|
|
660
|
-
|
|
666
|
+
w.publish(E, {});
|
|
661
667
|
}
|
|
662
|
-
}, [(
|
|
668
|
+
}, [(l = e == null ? void 0 : e.nav) == null ? void 0 : l.home, c]), R = i(() => {
|
|
663
669
|
W.info("handleResetIdleTimer called - resetting idle timer"), q(!1);
|
|
664
|
-
}, []),
|
|
670
|
+
}, []), X = i(() => {
|
|
665
671
|
if (y && (d(!0), f(!1), c)) {
|
|
666
672
|
const E = `/kos/dispense/${c.path}/ambient/start/`;
|
|
667
|
-
|
|
673
|
+
w.publish(E, {});
|
|
668
674
|
}
|
|
669
675
|
}, [y, c]), Y = i(() => {
|
|
670
676
|
if (_ && (f(!0), d(!1), c)) {
|
|
671
677
|
const E = `/kos/dispense/${c.path}/attract/start/`;
|
|
672
|
-
|
|
678
|
+
w.publish(E, {});
|
|
673
679
|
}
|
|
674
680
|
}, [_, c]), me = i(() => {
|
|
675
681
|
if (_ && (f(!1), d(!1), e == null || e.nav.home(), c)) {
|
|
676
682
|
const E = `/kos/dispense/${c.path}/attract/resume/`;
|
|
677
|
-
|
|
683
|
+
w.publish(E, {});
|
|
678
684
|
}
|
|
679
685
|
}, [e == null ? void 0 : e.nav, _, c]), {
|
|
680
686
|
pause: H,
|
|
681
687
|
restart: D,
|
|
682
|
-
attractTimer:
|
|
688
|
+
attractTimer: Z
|
|
683
689
|
} = gt({
|
|
684
690
|
defaultAmbientTime: y,
|
|
685
691
|
defaultAttractTime: _,
|
|
686
|
-
onAmbientTimer:
|
|
692
|
+
onAmbientTimer: X,
|
|
687
693
|
onAttractTimer: Y,
|
|
688
694
|
onResumeAttractTimer: me
|
|
689
695
|
});
|
|
690
|
-
(
|
|
696
|
+
($ = e == null ? void 0 : e.timers) == null || $.add(Z);
|
|
691
697
|
const [B, q] = x(!1);
|
|
692
698
|
W.info(
|
|
693
699
|
"Creating idle timer with timeout:",
|
|
694
|
-
|
|
700
|
+
v,
|
|
695
701
|
"seconds and callback:",
|
|
696
702
|
!!O
|
|
697
703
|
);
|
|
698
704
|
const { pause: I, restart: k, idleTimer: J } = He({
|
|
699
|
-
defaultAreYouThereTime:
|
|
700
|
-
defaultIdleTime:
|
|
705
|
+
defaultAreYouThereTime: b,
|
|
706
|
+
defaultIdleTime: v,
|
|
701
707
|
onIdleTimer: O,
|
|
702
708
|
onResetIdleTimer: R
|
|
703
709
|
});
|
|
704
710
|
W.info(
|
|
705
|
-
`Creating pour timer with timeout: ${
|
|
711
|
+
`Creating pour timer with timeout: ${u} seconds and callback: ${!!O}`
|
|
706
712
|
);
|
|
707
713
|
const {
|
|
708
714
|
pause: K,
|
|
@@ -710,7 +716,7 @@ const It = (e, t) => {
|
|
|
710
716
|
idleTimer: F
|
|
711
717
|
} = He({
|
|
712
718
|
defaultAreYouThereTime: g,
|
|
713
|
-
defaultIdleTime:
|
|
719
|
+
defaultIdleTime: u,
|
|
714
720
|
onIdleTimer: O,
|
|
715
721
|
prefix: "pour-"
|
|
716
722
|
}), Q = i(async () => {
|
|
@@ -724,28 +730,28 @@ const It = (e, t) => {
|
|
|
724
730
|
if (E) {
|
|
725
731
|
if (c) {
|
|
726
732
|
const Te = `/kos/dispense/${c.path}/are-you-there/timeout/`;
|
|
727
|
-
|
|
733
|
+
w.publish(Te, {});
|
|
728
734
|
}
|
|
729
|
-
q(!0),
|
|
735
|
+
q(!0), h ? K() : I();
|
|
730
736
|
} else
|
|
731
737
|
switch (o) {
|
|
732
738
|
case "pause":
|
|
733
|
-
|
|
739
|
+
h ? K() : I();
|
|
734
740
|
break;
|
|
735
741
|
case "restart":
|
|
736
|
-
|
|
742
|
+
h ? j() : k();
|
|
737
743
|
break;
|
|
738
744
|
}
|
|
739
|
-
}, [s, c, o,
|
|
740
|
-
q(!1), H(),
|
|
741
|
-
}, [
|
|
745
|
+
}, [s, c, o, h]), he = i(() => {
|
|
746
|
+
q(!1), H(), h ? (j(), I()) : (k(), K());
|
|
747
|
+
}, [h, I, K, k, j]);
|
|
742
748
|
V(() => {
|
|
743
749
|
J && J.addTimeoutAction({
|
|
744
750
|
name: "are-you-there-timer",
|
|
745
|
-
remainingTime:
|
|
751
|
+
remainingTime: b,
|
|
746
752
|
action: Q
|
|
747
753
|
});
|
|
748
|
-
}, [J,
|
|
754
|
+
}, [J, b, Q]), V(() => {
|
|
749
755
|
F && F.addTimeoutAction({
|
|
750
756
|
name: "pour-are-you-there-timer",
|
|
751
757
|
remainingTime: g,
|
|
@@ -783,20 +789,20 @@ const It = (e, t) => {
|
|
|
783
789
|
// component's own timer hooks call those handlers directly. Including them would
|
|
784
790
|
// create circular event loops.
|
|
785
791
|
});
|
|
786
|
-
const ie =
|
|
792
|
+
const ie = h ? g : b;
|
|
787
793
|
return V(() => {
|
|
788
|
-
if (c &&
|
|
794
|
+
if (c && Z) {
|
|
789
795
|
const E = `/kos/dispense/${c == null ? void 0 : c.path}/init/`;
|
|
790
|
-
|
|
796
|
+
w.publish(E, {});
|
|
791
797
|
}
|
|
792
|
-
}, [c,
|
|
798
|
+
}, [c, Z]), {
|
|
793
799
|
showAreYouThere: B,
|
|
794
800
|
clearAreYouThere: he,
|
|
795
801
|
pauseIdleTimer: I,
|
|
796
802
|
restartIdleTimer: k,
|
|
797
803
|
areYouThereCountdown: ie,
|
|
798
804
|
showAmbientScreen: a,
|
|
799
|
-
showAttractScreen:
|
|
805
|
+
showAttractScreen: T,
|
|
800
806
|
pauseScreenTimer: H,
|
|
801
807
|
restartScreenTimer: D
|
|
802
808
|
};
|
|
@@ -811,7 +817,7 @@ const It = (e, t) => {
|
|
|
811
817
|
function Vt(e) {
|
|
812
818
|
return (t) => {
|
|
813
819
|
const { model: r, status: n, KosModelLoader: s } = je();
|
|
814
|
-
return /* @__PURE__ */
|
|
820
|
+
return /* @__PURE__ */ m(s, { ...n, children: /* @__PURE__ */ m(e, { ...t, deviceAssembly: r }) });
|
|
815
821
|
};
|
|
816
822
|
}
|
|
817
823
|
const We = (e) => C({
|
|
@@ -822,7 +828,7 @@ const We = (e) => C({
|
|
|
822
828
|
function jt(e, t) {
|
|
823
829
|
return (r) => {
|
|
824
830
|
const { model: n, status: s, KosModelLoader: o } = We(e);
|
|
825
|
-
return /* @__PURE__ */
|
|
831
|
+
return /* @__PURE__ */ m(o, { ...s, children: /* @__PURE__ */ m(t, { ...r, holder: n }) });
|
|
826
832
|
};
|
|
827
833
|
}
|
|
828
834
|
const qe = () => {
|
|
@@ -836,7 +842,7 @@ const qe = () => {
|
|
|
836
842
|
function Wt(e) {
|
|
837
843
|
return (t) => {
|
|
838
844
|
const { model: r, status: n, KosModelLoader: s } = qe();
|
|
839
|
-
return /* @__PURE__ */
|
|
845
|
+
return /* @__PURE__ */ m(s, { ...n, children: /* @__PURE__ */ m(e, { ...t, holderContainer: r }) });
|
|
840
846
|
};
|
|
841
847
|
}
|
|
842
848
|
const Je = () => {
|
|
@@ -846,17 +852,17 @@ const Je = () => {
|
|
|
846
852
|
modelType: Se.type,
|
|
847
853
|
options: {}
|
|
848
854
|
});
|
|
849
|
-
},
|
|
855
|
+
}, we = P.createLogger({
|
|
850
856
|
name: "HoldToPourIntentStrategy",
|
|
851
857
|
group: "kos-hooks"
|
|
852
858
|
}), At = {
|
|
853
859
|
name: "HoldToPourIntentStrategy",
|
|
854
860
|
async initiate(e, t) {
|
|
855
861
|
if (!(e != null && e.canPour)) {
|
|
856
|
-
|
|
862
|
+
we.debug(`${e == null ? void 0 : e.id} cannot pour. Returning early.`);
|
|
857
863
|
return;
|
|
858
864
|
}
|
|
859
|
-
t ? (
|
|
865
|
+
t ? (we.debug(`performing intent: ${t}`), await (e == null ? void 0 : e.performIntent(t))) : we.debug("no intent provided. Returning early.");
|
|
860
866
|
},
|
|
861
867
|
async initiateEnded(e) {
|
|
862
868
|
await (e == null ? void 0 : e.cancelPour());
|
|
@@ -875,10 +881,10 @@ const Je = () => {
|
|
|
875
881
|
`[${n == null ? void 0 : n.name}] - Pour initiated for model ${r == null ? void 0 : r.id}.`
|
|
876
882
|
), n == null || n.initiate(r), e == null || e();
|
|
877
883
|
}, [e, r, n]), o = i(() => {
|
|
878
|
-
var
|
|
884
|
+
var T;
|
|
879
885
|
ge.debug(
|
|
880
886
|
`[${n == null ? void 0 : n.name}] - Pour initiate ended called for nozzle ${r == null ? void 0 : r.id}.`
|
|
881
|
-
), (
|
|
887
|
+
), (T = n == null ? void 0 : n.initiateEnded) == null || T.call(n, r), t == null || t();
|
|
882
888
|
}, [t, r, n]), a = i(() => {
|
|
883
889
|
ge.debug(`Force cancelling pour for nozzle ${r == null ? void 0 : r.id}.`), r == null || r.cancelPour(), t == null || t();
|
|
884
890
|
}, [t, r]);
|
|
@@ -894,7 +900,7 @@ const Je = () => {
|
|
|
894
900
|
function Jt(e) {
|
|
895
901
|
return (t) => {
|
|
896
902
|
const { model: r, status: n, KosModelLoader: s } = Je();
|
|
897
|
-
return /* @__PURE__ */
|
|
903
|
+
return /* @__PURE__ */ m(s, { ...n, children: /* @__PURE__ */ m(e, { ...t, ingredient: r }) });
|
|
898
904
|
};
|
|
899
905
|
}
|
|
900
906
|
const Qe = () => {
|
|
@@ -908,19 +914,19 @@ const Qe = () => {
|
|
|
908
914
|
function Qt(e) {
|
|
909
915
|
return (t) => {
|
|
910
916
|
const { model: r, status: n, KosModelLoader: s } = Qe();
|
|
911
|
-
return /* @__PURE__ */
|
|
917
|
+
return /* @__PURE__ */ m(s, { ...n, children: /* @__PURE__ */ m(e, { ...t, ingredientContainer: r }) });
|
|
912
918
|
};
|
|
913
919
|
}
|
|
914
|
-
function
|
|
920
|
+
function Ut(e, t) {
|
|
915
921
|
return (r) => {
|
|
916
922
|
const { model: n, status: s, KosModelLoader: o } = Ye(e);
|
|
917
|
-
return /* @__PURE__ */
|
|
923
|
+
return /* @__PURE__ */ m(o, { ...s, children: /* @__PURE__ */ m(t, { ...r, nozzle: n }) });
|
|
918
924
|
};
|
|
919
925
|
}
|
|
920
926
|
const re = P.createLogger({
|
|
921
927
|
name: "usePour",
|
|
922
928
|
group: "kos-hooks"
|
|
923
|
-
}),
|
|
929
|
+
}), Xt = ({
|
|
924
930
|
onBeforePour: e,
|
|
925
931
|
onPour: t,
|
|
926
932
|
onPourCancel: r,
|
|
@@ -929,7 +935,7 @@ const re = P.createLogger({
|
|
|
929
935
|
pourContext: o,
|
|
930
936
|
strategy: a = Ve
|
|
931
937
|
}) => {
|
|
932
|
-
const [d,
|
|
938
|
+
const [d, T] = x(
|
|
933
939
|
o || new Ge()
|
|
934
940
|
), f = i(async () => {
|
|
935
941
|
re.debug(
|
|
@@ -944,16 +950,16 @@ const re = P.createLogger({
|
|
|
944
950
|
re.debug(
|
|
945
951
|
`[${a == null ? void 0 : a.name}] - Pour initiate ended called for pour target ${s == null ? void 0 : s.id}.`
|
|
946
952
|
), await ((g = a == null ? void 0 : a.initiateEnded) == null ? void 0 : g.call(a, s)) || r == null || r();
|
|
947
|
-
}, [r, s, a]),
|
|
953
|
+
}, [r, s, a]), h = i(async () => {
|
|
948
954
|
re.debug(`Force cancelling pour for pour target ${s == null ? void 0 : s.id}.`), await (s == null ? void 0 : s.cancelPour()), r == null || r();
|
|
949
955
|
}, [r, s]), p = i(
|
|
950
|
-
(
|
|
951
|
-
d.set(
|
|
956
|
+
(u, g) => {
|
|
957
|
+
d.set(u, g);
|
|
952
958
|
},
|
|
953
959
|
[d]
|
|
954
|
-
),
|
|
955
|
-
(
|
|
956
|
-
d.remove(
|
|
960
|
+
), v = i(
|
|
961
|
+
(u) => {
|
|
962
|
+
d.remove(u);
|
|
957
963
|
},
|
|
958
964
|
[d]
|
|
959
965
|
);
|
|
@@ -962,21 +968,21 @@ const re = P.createLogger({
|
|
|
962
968
|
onPressed: f,
|
|
963
969
|
onRelease: c
|
|
964
970
|
}).dom,
|
|
965
|
-
cancel:
|
|
971
|
+
cancel: h,
|
|
966
972
|
updatePourContext: p,
|
|
967
|
-
removeFromPourContext:
|
|
973
|
+
removeFromPourContext: v,
|
|
968
974
|
status: s
|
|
969
975
|
};
|
|
970
976
|
}, ne = P.createLogger({
|
|
971
977
|
name: "TapOrHoldIntentStrategy",
|
|
972
978
|
group: "kos-hooks"
|
|
973
979
|
});
|
|
974
|
-
class
|
|
980
|
+
class Zt {
|
|
975
981
|
constructor(t) {
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
982
|
+
U(this, "intent");
|
|
983
|
+
U(this, "name", "TapOrHoldIntentStrategy");
|
|
984
|
+
U(this, "isHold", !1);
|
|
985
|
+
U(this, "disposer", null);
|
|
980
986
|
this.intent = t;
|
|
981
987
|
}
|
|
982
988
|
async initiate(t, r) {
|
|
@@ -1051,42 +1057,42 @@ function ts(e) {
|
|
|
1051
1057
|
t.servicePathFactory,
|
|
1052
1058
|
t.itemId
|
|
1053
1059
|
);
|
|
1054
|
-
return /* @__PURE__ */
|
|
1060
|
+
return /* @__PURE__ */ m(s, { ...n, children: /* @__PURE__ */ m(e, { ...t, genericPour: r }) });
|
|
1055
1061
|
};
|
|
1056
1062
|
}
|
|
1057
|
-
const
|
|
1063
|
+
const Ue = N(void 0), ss = ({ children: e }) => {
|
|
1058
1064
|
const { model: t, ready: r } = Le(), n = A(() => r && t ? { model: t } : {}, [r, t]);
|
|
1059
|
-
return /* @__PURE__ */
|
|
1065
|
+
return /* @__PURE__ */ m(Ue.Provider, { value: n, children: e });
|
|
1060
1066
|
}, rs = () => {
|
|
1061
1067
|
const e = S(
|
|
1062
|
-
|
|
1068
|
+
Ue
|
|
1063
1069
|
);
|
|
1064
1070
|
if (!e)
|
|
1065
1071
|
throw new Error(
|
|
1066
1072
|
"useAssemblyContext must be used within a AssemblyProvider"
|
|
1067
1073
|
);
|
|
1068
1074
|
return e;
|
|
1069
|
-
},
|
|
1075
|
+
}, Xe = N(void 0), ns = ({ children: e }) => {
|
|
1070
1076
|
const { model: t, ready: r } = Me(), n = A(() => r && t ? { model: t } : {}, [r, t]);
|
|
1071
|
-
return /* @__PURE__ */
|
|
1077
|
+
return /* @__PURE__ */ m(Xe.Provider, { value: n, children: e });
|
|
1072
1078
|
}, as = () => {
|
|
1073
|
-
const e = S(
|
|
1079
|
+
const e = S(Xe);
|
|
1074
1080
|
if (!e)
|
|
1075
1081
|
throw new Error(
|
|
1076
1082
|
"useAvailabilityContext must be used within a AvailabilityProvider"
|
|
1077
1083
|
);
|
|
1078
1084
|
return e;
|
|
1079
|
-
},
|
|
1085
|
+
}, Ze = N(void 0), os = ({ children: e, id: t }) => {
|
|
1080
1086
|
const { model: r, ready: n } = _e(t), s = A(() => n && r ? { model: r } : {}, [n, r]);
|
|
1081
|
-
return /* @__PURE__ */
|
|
1087
|
+
return /* @__PURE__ */ m(Ze.Provider, { value: s, children: e });
|
|
1082
1088
|
}, is = () => {
|
|
1083
|
-
const e = S(
|
|
1089
|
+
const e = S(Ze);
|
|
1084
1090
|
if (!e)
|
|
1085
1091
|
throw new Error("useBoardContext must be used within a BoardProvider");
|
|
1086
1092
|
return e;
|
|
1087
1093
|
}, ze = N(void 0), cs = ({ children: e }) => {
|
|
1088
1094
|
const { model: t, ready: r } = Oe(), n = A(() => r && t ? { model: t } : {}, [r, t]);
|
|
1089
|
-
return /* @__PURE__ */
|
|
1095
|
+
return /* @__PURE__ */ m(ze.Provider, { value: n, children: e });
|
|
1090
1096
|
}, ds = () => {
|
|
1091
1097
|
const e = S(ze);
|
|
1092
1098
|
if (!e)
|
|
@@ -1104,7 +1110,7 @@ const Xe = N(void 0), ss = ({ children: e }) => {
|
|
|
1104
1110
|
}
|
|
1105
1111
|
return {};
|
|
1106
1112
|
}, [r, t]), s = r && t ? e : null;
|
|
1107
|
-
return /* @__PURE__ */
|
|
1113
|
+
return /* @__PURE__ */ m(et.Provider, { value: n, children: s });
|
|
1108
1114
|
}, yt = () => {
|
|
1109
1115
|
const e = S(et);
|
|
1110
1116
|
if (!e)
|
|
@@ -1128,8 +1134,8 @@ function St({
|
|
|
1128
1134
|
props: r,
|
|
1129
1135
|
nozzleProps: n
|
|
1130
1136
|
}) {
|
|
1131
|
-
const s =
|
|
1132
|
-
return /* @__PURE__ */
|
|
1137
|
+
const s = wt(r);
|
|
1138
|
+
return /* @__PURE__ */ m(t, { value: s, children: e(n || {}) });
|
|
1133
1139
|
}
|
|
1134
1140
|
function kt({
|
|
1135
1141
|
children: e,
|
|
@@ -1137,7 +1143,7 @@ function kt({
|
|
|
1137
1143
|
props: r
|
|
1138
1144
|
}) {
|
|
1139
1145
|
const { nozzlePaths: n } = yt(), s = (n == null ? void 0 : n.length) || 0;
|
|
1140
|
-
return (n == null ? void 0 : n.map((a, d) => /* @__PURE__ */
|
|
1146
|
+
return (n == null ? void 0 : n.map((a, d) => /* @__PURE__ */ m(ht, { path: a, children: /* @__PURE__ */ m(
|
|
1141
1147
|
St,
|
|
1142
1148
|
{
|
|
1143
1149
|
provider: t,
|
|
@@ -1157,7 +1163,7 @@ function Nt({
|
|
|
1157
1163
|
provider: e,
|
|
1158
1164
|
props: t
|
|
1159
1165
|
}) {
|
|
1160
|
-
return ({ children: r }) => e ? /* @__PURE__ */
|
|
1166
|
+
return ({ children: r }) => e ? /* @__PURE__ */ m(Et, { children: /* @__PURE__ */ m(
|
|
1161
1167
|
kt,
|
|
1162
1168
|
{
|
|
1163
1169
|
provider: e,
|
|
@@ -1175,7 +1181,7 @@ function us(e) {
|
|
|
1175
1181
|
}
|
|
1176
1182
|
const tt = N(void 0), ls = ({ children: e, id: t }) => {
|
|
1177
1183
|
const { model: r, ready: n } = We(t || ""), s = A(() => n && r ? { model: r } : {}, [n, r]);
|
|
1178
|
-
return /* @__PURE__ */
|
|
1184
|
+
return /* @__PURE__ */ m(tt.Provider, { value: s, children: e });
|
|
1179
1185
|
}, ms = () => {
|
|
1180
1186
|
const e = S(tt);
|
|
1181
1187
|
if (!e)
|
|
@@ -1185,7 +1191,7 @@ const tt = N(void 0), ls = ({ children: e, id: t }) => {
|
|
|
1185
1191
|
void 0
|
|
1186
1192
|
), hs = ({ children: e }) => {
|
|
1187
1193
|
const { model: t, ready: r } = qe(), n = A(() => r && t ? { model: t } : {}, [r, t]);
|
|
1188
|
-
return /* @__PURE__ */
|
|
1194
|
+
return /* @__PURE__ */ m(st.Provider, { value: n, children: e });
|
|
1189
1195
|
}, fs = () => {
|
|
1190
1196
|
const e = S(st);
|
|
1191
1197
|
if (!e)
|
|
@@ -1195,7 +1201,7 @@ const tt = N(void 0), ls = ({ children: e, id: t }) => {
|
|
|
1195
1201
|
return e;
|
|
1196
1202
|
}, rt = N(void 0), ps = ({ children: e }) => {
|
|
1197
1203
|
const { model: t, ready: r } = Je(), n = A(() => r && t ? { model: t } : {}, [r, t]);
|
|
1198
|
-
return /* @__PURE__ */
|
|
1204
|
+
return /* @__PURE__ */ m(rt.Provider, { value: n, children: e });
|
|
1199
1205
|
}, bs = () => {
|
|
1200
1206
|
const e = S(rt);
|
|
1201
1207
|
if (!e)
|
|
@@ -1207,7 +1213,7 @@ const tt = N(void 0), ls = ({ children: e, id: t }) => {
|
|
|
1207
1213
|
void 0
|
|
1208
1214
|
), vs = ({ children: e }) => {
|
|
1209
1215
|
const { model: t, ready: r } = Qe(), n = A(() => r && t ? { model: t } : {}, [r, t]);
|
|
1210
|
-
return /* @__PURE__ */
|
|
1216
|
+
return /* @__PURE__ */ m(nt.Provider, { value: n, children: e });
|
|
1211
1217
|
}, Ts = () => {
|
|
1212
1218
|
const e = S(nt);
|
|
1213
1219
|
if (!e)
|
|
@@ -1222,9 +1228,9 @@ const tt = N(void 0), ls = ({ children: e, id: t }) => {
|
|
|
1222
1228
|
modelType: Ne.type,
|
|
1223
1229
|
options: {}
|
|
1224
1230
|
});
|
|
1225
|
-
}, at = N(void 0),
|
|
1231
|
+
}, at = N(void 0), ws = ({ children: e }) => {
|
|
1226
1232
|
const { model: t, ready: r } = Ht(), n = A(() => r && t ? { model: t } : {}, [r, t]);
|
|
1227
|
-
return /* @__PURE__ */
|
|
1233
|
+
return /* @__PURE__ */ m(at.Provider, { value: n, children: e });
|
|
1228
1234
|
}, gs = () => {
|
|
1229
1235
|
const e = S(at);
|
|
1230
1236
|
if (!e)
|
|
@@ -1243,12 +1249,12 @@ export {
|
|
|
1243
1249
|
ls as H,
|
|
1244
1250
|
ps as I,
|
|
1245
1251
|
se as J,
|
|
1246
|
-
|
|
1252
|
+
wt as K,
|
|
1247
1253
|
Gt as L,
|
|
1248
1254
|
xt as M,
|
|
1249
1255
|
ht as N,
|
|
1250
1256
|
He as O,
|
|
1251
|
-
|
|
1257
|
+
ws as P,
|
|
1252
1258
|
Tt as Q,
|
|
1253
1259
|
je as R,
|
|
1254
1260
|
Vt as S,
|
|
@@ -1262,12 +1268,12 @@ export {
|
|
|
1262
1268
|
Qe as _,
|
|
1263
1269
|
ns as a,
|
|
1264
1270
|
Ye as a0,
|
|
1265
|
-
|
|
1271
|
+
Ut as a1,
|
|
1266
1272
|
vt as a2,
|
|
1267
|
-
|
|
1273
|
+
Xt as a3,
|
|
1268
1274
|
At as a4,
|
|
1269
1275
|
Ve as a5,
|
|
1270
|
-
|
|
1276
|
+
Zt as a6,
|
|
1271
1277
|
zt as a7,
|
|
1272
1278
|
es as a8,
|
|
1273
1279
|
Kt as a9,
|
|
@@ -1299,4 +1305,4 @@ export {
|
|
|
1299
1305
|
Ft as y,
|
|
1300
1306
|
ft as z
|
|
1301
1307
|
};
|
|
1302
|
-
//# sourceMappingURL=pump-provider-
|
|
1308
|
+
//# sourceMappingURL=pump-provider-Dhh0rg1k.js.map
|