@kosdev-code/kos-dispense-sdk 2.1.6 → 2.1.8
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-pB5e_YT1.js → dispense-registration-manager-Mh8b5sDW.js} +3 -3
- package/{dispense-registration-manager-pB5e_YT1.js.map → dispense-registration-manager-Mh8b5sDW.js.map} +1 -1
- package/{extension-utils-siWT4ZuD.js → extension-utils-BwiFbuRe.js} +2 -2
- package/{extension-utils-siWT4ZuD.js.map → extension-utils-BwiFbuRe.js.map} +1 -1
- package/extensions/control-pour-extension.d.ts +2 -12
- package/extensions/control-pour-extension.d.ts.map +1 -1
- package/index.cjs +1 -1
- package/index.cjs.map +1 -1
- package/index.js +127 -108
- package/index.js.map +1 -1
- package/models.js +2 -2
- package/package.json +6 -3
- package/pump-provider-BK8kyTyX.js +1303 -0
- package/pump-provider-BK8kyTyX.js.map +1 -0
- package/pump-provider-DwmITxr8.cjs +2 -0
- package/pump-provider-DwmITxr8.cjs.map +1 -0
- package/ui.cjs +1 -1
- package/ui.js +3 -3
- package/control-pour-extension-BAEKgAmw.cjs +0 -2
- package/control-pour-extension-BAEKgAmw.cjs.map +0 -1
- package/control-pour-extension-DLJOCOIC.js +0 -1611
- package/control-pour-extension-DLJOCOIC.js.map +0 -1
|
@@ -1,1611 +0,0 @@
|
|
|
1
|
-
var vt = Object.defineProperty;
|
|
2
|
-
var wt = (e, t, s) => t in e ? vt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
-
var D = (e, t, s) => (wt(e, typeof t != "symbol" ? t + "" : t, s), s);
|
|
4
|
-
import { jsx as h } from "@emotion/react/jsx-runtime";
|
|
5
|
-
import { A as _e, b as Ne, e as gt, d as Ke, N as Pt, f as Me, H as $t, g as He, I as Le, h as De, G as It, P as Oe } from "./dispense-registration-manager-pB5e_YT1.js";
|
|
6
|
-
import { useKosModel as k, getKosCompanionModel as ye, kosAutoEffect as Ye, KosLog as $, usePressGesture as Ae, EventBus as P, TimerManager as Ve } from "@kosdev-code/kos-ui-sdk";
|
|
7
|
-
import xt, { createContext as N, useMemo as R, useContext as C, useState as T, useCallback as d, useEffect as F, useRef as le } from "react";
|
|
8
|
-
import { z as G } from "zod";
|
|
9
|
-
const Ge = () => {
|
|
10
|
-
const e = _e.type;
|
|
11
|
-
return k({
|
|
12
|
-
modelId: e,
|
|
13
|
-
modelType: _e.type,
|
|
14
|
-
options: {}
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
function ps(e) {
|
|
18
|
-
return (t) => {
|
|
19
|
-
const { model: s, status: n, KosModelLoader: r } = Ge();
|
|
20
|
-
return /* @__PURE__ */ h(r, { ...n, children: /* @__PURE__ */ h(e, { ...t, assembly: s }) });
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
const qe = () => {
|
|
24
|
-
const e = Ne.type;
|
|
25
|
-
return k({
|
|
26
|
-
modelId: e,
|
|
27
|
-
modelType: Ne.type,
|
|
28
|
-
options: {}
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
function ms(e) {
|
|
32
|
-
return (t) => {
|
|
33
|
-
const { model: s, status: n, KosModelLoader: r } = qe();
|
|
34
|
-
return /* @__PURE__ */ h(r, { ...n, children: /* @__PURE__ */ h(e, { ...t, beverage: s }) });
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
const We = (e) => k({
|
|
38
|
-
modelId: e,
|
|
39
|
-
modelType: gt.type,
|
|
40
|
-
options: {}
|
|
41
|
-
});
|
|
42
|
-
function fs(e) {
|
|
43
|
-
return (t) => (s) => {
|
|
44
|
-
const { model: n, status: r, KosModelLoader: o } = We(t);
|
|
45
|
-
return /* @__PURE__ */ h(o, { ...r, children: /* @__PURE__ */ h(e, { ...s, board: n }) });
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
const Xe = () => {
|
|
49
|
-
const e = Ke.type;
|
|
50
|
-
return k({
|
|
51
|
-
modelId: e,
|
|
52
|
-
modelType: Ke.type,
|
|
53
|
-
options: {}
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
function hs(e) {
|
|
57
|
-
return (t) => {
|
|
58
|
-
const { model: s, status: n, KosModelLoader: r } = Xe();
|
|
59
|
-
return /* @__PURE__ */ h(r, { ...n, children: /* @__PURE__ */ h(e, { ...t, boardContainer: s }) });
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
const Ze = (e) => k({
|
|
63
|
-
modelId: e,
|
|
64
|
-
modelType: Pt.type,
|
|
65
|
-
options: {
|
|
66
|
-
path: e
|
|
67
|
-
}
|
|
68
|
-
}), Je = N(void 0), Tt = ({ children: e, path: t }) => {
|
|
69
|
-
const { model: s, ready: n } = Ze(t), r = R(() => n && s ? { model: s } : {}, [n, s]);
|
|
70
|
-
return /* @__PURE__ */ h(Je.Provider, { value: r, children: e });
|
|
71
|
-
}, B = () => {
|
|
72
|
-
const e = C(Je);
|
|
73
|
-
if (!e)
|
|
74
|
-
throw new Error("useNozzleContext must be used within a NozzleProvider");
|
|
75
|
-
return e;
|
|
76
|
-
}, Rt = ({
|
|
77
|
-
onBeverageSelected: e,
|
|
78
|
-
onClearBeverage: t,
|
|
79
|
-
companionType: s
|
|
80
|
-
}) => {
|
|
81
|
-
const { model: n } = B(), [r, o] = T([]), [i, a] = T(null), m = R(() => s ? r.map(
|
|
82
|
-
(l) => ye(l, s)
|
|
83
|
-
) : [], [r, s]), p = d(
|
|
84
|
-
async (l) => {
|
|
85
|
-
a(l), await (n == null ? void 0 : n.setSelectedPourable({ beverage: l })), e == null || e(l);
|
|
86
|
-
},
|
|
87
|
-
[n, e]
|
|
88
|
-
), u = d(async () => {
|
|
89
|
-
a(null), await (n == null ? void 0 : n.setSelectedPourable({ beverage: void 0 })), t == null || t();
|
|
90
|
-
}, [n, t]);
|
|
91
|
-
return F(() => {
|
|
92
|
-
const l = Ye(() => {
|
|
93
|
-
if (!n)
|
|
94
|
-
return;
|
|
95
|
-
const w = n.selectedBrand;
|
|
96
|
-
if (!w) {
|
|
97
|
-
const v = n.getGroupAvailabilityItems("beverages").filter((f) => f.visible);
|
|
98
|
-
o(v ?? []);
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
const g = n.getAvailabilityByParent(w.id).filter((v) => v.visible);
|
|
102
|
-
o(g ?? []);
|
|
103
|
-
});
|
|
104
|
-
return () => {
|
|
105
|
-
l();
|
|
106
|
-
};
|
|
107
|
-
}, [n]), {
|
|
108
|
-
beverages: r,
|
|
109
|
-
beverageCompanions: m,
|
|
110
|
-
selectBeverage: p,
|
|
111
|
-
selectedBeverage: i,
|
|
112
|
-
clearBeverage: u
|
|
113
|
-
};
|
|
114
|
-
}, Et = ({
|
|
115
|
-
onBrandSelected: e,
|
|
116
|
-
onBrandCleared: t,
|
|
117
|
-
companionType: s
|
|
118
|
-
}) => {
|
|
119
|
-
const { model: n } = B(), [r, o] = T(null), [i, a] = T([]), m = R(() => s ? i.map((l) => ye(l, s)) : [], [i, s]), p = d(
|
|
120
|
-
async (l) => {
|
|
121
|
-
o(l), n == null || n.setSelectedBrand(l), e == null || e(l);
|
|
122
|
-
},
|
|
123
|
-
[n, e]
|
|
124
|
-
), u = d(() => {
|
|
125
|
-
o(null), n == null || n.setSelectedBrand(void 0), t == null || t();
|
|
126
|
-
}, [n, t]);
|
|
127
|
-
return F(() => {
|
|
128
|
-
const l = Ye(() => {
|
|
129
|
-
n && a(n.visibleBrands);
|
|
130
|
-
});
|
|
131
|
-
return () => {
|
|
132
|
-
l();
|
|
133
|
-
};
|
|
134
|
-
}, [n]), {
|
|
135
|
-
brands: i,
|
|
136
|
-
brandCompanions: m,
|
|
137
|
-
selectedBrand: r,
|
|
138
|
-
selectBrand: p,
|
|
139
|
-
clearBrand: u
|
|
140
|
-
};
|
|
141
|
-
};
|
|
142
|
-
class Qe {
|
|
143
|
-
constructor() {
|
|
144
|
-
D(this, "_data", /* @__PURE__ */ new Map());
|
|
145
|
-
}
|
|
146
|
-
get(t) {
|
|
147
|
-
return this._data.get(t);
|
|
148
|
-
}
|
|
149
|
-
set(t, s) {
|
|
150
|
-
this._data.set(t, s);
|
|
151
|
-
}
|
|
152
|
-
remove(t) {
|
|
153
|
-
this._data.delete(t);
|
|
154
|
-
}
|
|
155
|
-
has(t) {
|
|
156
|
-
return this._data.has(t);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
const yt = $.createLogger({
|
|
160
|
-
name: "HoldToPourStrategy",
|
|
161
|
-
group: "kos-hooks"
|
|
162
|
-
}), ze = {
|
|
163
|
-
name: "HoldToPourStrategy",
|
|
164
|
-
async initiate(e) {
|
|
165
|
-
if (!(e != null && e.canPour)) {
|
|
166
|
-
yt.debug(`Nozzle ${e == null ? void 0 : e.id} cannot pour. Returning early.`);
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
await (e == null ? void 0 : e.pour());
|
|
170
|
-
},
|
|
171
|
-
async initiateEnded(e) {
|
|
172
|
-
await (e == null ? void 0 : e.cancelPour());
|
|
173
|
-
}
|
|
174
|
-
}, ce = $.createLogger({
|
|
175
|
-
name: "useNozzlePour",
|
|
176
|
-
group: "kos-hooks"
|
|
177
|
-
}), At = ({
|
|
178
|
-
onPour: e,
|
|
179
|
-
onPourCancel: t,
|
|
180
|
-
onBeforePour: s,
|
|
181
|
-
onBeforePourRejected: n,
|
|
182
|
-
pourContext: r,
|
|
183
|
-
strategy: o = ze
|
|
184
|
-
}) => {
|
|
185
|
-
const { model: i } = B(), [a, m] = T(
|
|
186
|
-
r || new Qe()
|
|
187
|
-
), p = d(async () => {
|
|
188
|
-
(s ? await (s == null ? void 0 : s(a)) : !0) ? (ce.debug(
|
|
189
|
-
`[${o == null ? void 0 : o.name}] - Pour initiated for nozzle ${i == null ? void 0 : i.id}.`
|
|
190
|
-
), o == null || o.initiate(i), e == null || e()) : (ce.debug(
|
|
191
|
-
`[${o == null ? void 0 : o.name}] - Did not pass onBeforePour gate for nozzle ${i == null ? void 0 : i.id}. Cancelling pour.`
|
|
192
|
-
), n == null || n());
|
|
193
|
-
}, [
|
|
194
|
-
e,
|
|
195
|
-
i,
|
|
196
|
-
o,
|
|
197
|
-
s,
|
|
198
|
-
t,
|
|
199
|
-
a,
|
|
200
|
-
n
|
|
201
|
-
]), u = d(() => {
|
|
202
|
-
var f;
|
|
203
|
-
ce.debug(
|
|
204
|
-
`[${o == null ? void 0 : o.name}] - Pour initiate ended called for nozzle ${i == null ? void 0 : i.id}.`
|
|
205
|
-
), (f = o == null ? void 0 : o.initiateEnded) == null || f.call(o, i), t == null || t();
|
|
206
|
-
}, [t, i, o]), l = d(() => {
|
|
207
|
-
ce.debug(`Force cancelling pour for nozzle ${i == null ? void 0 : i.id}.`), i == null || i.cancelPour(), t == null || t();
|
|
208
|
-
}, [t, i]), w = d(
|
|
209
|
-
(f, c) => {
|
|
210
|
-
a.set(f, c);
|
|
211
|
-
},
|
|
212
|
-
[a]
|
|
213
|
-
), g = d(
|
|
214
|
-
(f) => {
|
|
215
|
-
a.remove(f);
|
|
216
|
-
},
|
|
217
|
-
[a]
|
|
218
|
-
);
|
|
219
|
-
return {
|
|
220
|
-
handlers: Ae({
|
|
221
|
-
onPressed: p,
|
|
222
|
-
onRelease: u
|
|
223
|
-
}).dom,
|
|
224
|
-
cancel: l,
|
|
225
|
-
updatePourContext: w,
|
|
226
|
-
removeFromPourContext: g,
|
|
227
|
-
status: i
|
|
228
|
-
};
|
|
229
|
-
}, kt = ({
|
|
230
|
-
onFlavorSelected: e,
|
|
231
|
-
onFlavorCleared: t,
|
|
232
|
-
companionType: s
|
|
233
|
-
}) => {
|
|
234
|
-
const { model: n } = B(), r = R(
|
|
235
|
-
() => (n == null ? void 0 : n.getGroupAvailabilityItems("flavors").filter((u) => u.visible)) ?? [],
|
|
236
|
-
[n]
|
|
237
|
-
), o = R(() => s ? r.map(
|
|
238
|
-
(u) => ye(u, s)
|
|
239
|
-
) : [], [r, s]), [i, a] = T([]), m = d(
|
|
240
|
-
async (u) => {
|
|
241
|
-
if (a(
|
|
242
|
-
(l) => l != null && l.includes(u) ? [...l.filter((w) => w !== u)] : [...l ?? [], u]
|
|
243
|
-
), n != null && n.selectedPourable) {
|
|
244
|
-
const { beverage: l } = n.selectedPourable;
|
|
245
|
-
await n.setSelectedPourable({
|
|
246
|
-
beverage: l,
|
|
247
|
-
additional: i ?? []
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
e == null || e(u, i ?? []);
|
|
251
|
-
},
|
|
252
|
-
[n, e, i]
|
|
253
|
-
), p = d(async () => {
|
|
254
|
-
if (a([]), n != null && n.selectedPourable) {
|
|
255
|
-
const { beverage: u } = n.selectedPourable;
|
|
256
|
-
n.setSelectedPourable({ beverage: u }), t == null || t();
|
|
257
|
-
}
|
|
258
|
-
}, [n, t]);
|
|
259
|
-
return {
|
|
260
|
-
flavors: r,
|
|
261
|
-
flavorCompanions: o,
|
|
262
|
-
selectFlavor: m,
|
|
263
|
-
selectedFlavors: i,
|
|
264
|
-
clearFlavors: p
|
|
265
|
-
};
|
|
266
|
-
}, te = "brands", de = "beverages", se = "flavors", j = $.createLogger({ name: "use-cui-kit" }), Ct = ({
|
|
267
|
-
initialGroup: e = te,
|
|
268
|
-
options: t = {}
|
|
269
|
-
}) => {
|
|
270
|
-
var ie, oe, ae;
|
|
271
|
-
const [s, n] = T(e), { model: r } = B(), o = le([]), i = le(), a = le(), m = d(
|
|
272
|
-
(b) => {
|
|
273
|
-
n(se);
|
|
274
|
-
const x = `/kos/dispense/${r == null ? void 0 : r.path}/brand/selected/`;
|
|
275
|
-
P.publish(x, b);
|
|
276
|
-
},
|
|
277
|
-
[r == null ? void 0 : r.path]
|
|
278
|
-
), p = d(() => {
|
|
279
|
-
const b = `/kos/dispense/${r == null ? void 0 : r.path}/brand/cleared/`;
|
|
280
|
-
P.publish(b, {});
|
|
281
|
-
}, [r == null ? void 0 : r.path]), u = d(
|
|
282
|
-
(b) => {
|
|
283
|
-
var ee;
|
|
284
|
-
n(se), (ee = i.current) == null || ee.call(i, "selectedBeverage", b);
|
|
285
|
-
const x = `/kos/dispense/${r == null ? void 0 : r.path}/beverage/selected/`;
|
|
286
|
-
P.publish(x, b);
|
|
287
|
-
},
|
|
288
|
-
[r == null ? void 0 : r.path]
|
|
289
|
-
), l = d(() => {
|
|
290
|
-
var x;
|
|
291
|
-
const b = `/kos/dispense/${r == null ? void 0 : r.path}/beverage/cleared/`;
|
|
292
|
-
(x = a.current) == null || x.call(a, "selectedBeverage"), P.publish(b, {});
|
|
293
|
-
}, [r == null ? void 0 : r.path]), w = d(
|
|
294
|
-
(b) => {
|
|
295
|
-
const x = `/kos/dispense/${r == null ? void 0 : r.path}/flavor/selected/`;
|
|
296
|
-
P.publish(x, b);
|
|
297
|
-
},
|
|
298
|
-
[r == null ? void 0 : r.path]
|
|
299
|
-
), g = d(() => {
|
|
300
|
-
const b = `/kos/dispense/${r == null ? void 0 : r.path}/flavor/cleared/`;
|
|
301
|
-
P.publish(b, {});
|
|
302
|
-
}, [r == null ? void 0 : r.path]), v = d(() => {
|
|
303
|
-
const b = `/kos/dispense/${r == null ? void 0 : r.path}/pour/`;
|
|
304
|
-
P.publish(b, {});
|
|
305
|
-
}, [r == null ? void 0 : r.path]), f = d(
|
|
306
|
-
async (b) => {
|
|
307
|
-
const x = `/kos/dispense/${r == null ? void 0 : r.path}/pre/pour/`;
|
|
308
|
-
return P.publish(x, {}), await (L == null ? void 0 : L(b)) || !0;
|
|
309
|
-
},
|
|
310
|
-
[r == null ? void 0 : r.path]
|
|
311
|
-
), c = d(async () => {
|
|
312
|
-
const b = `/kos/dispense/${r == null ? void 0 : r.path}/pre/pour/rejected/`;
|
|
313
|
-
P.publish(b, {});
|
|
314
|
-
}, [r == null ? void 0 : r.path]), q = d(() => {
|
|
315
|
-
const b = `/kos/dispense/${r == null ? void 0 : r.path}/pour/cancel/`;
|
|
316
|
-
P.publish(b, {});
|
|
317
|
-
}, [r == null ? void 0 : r.path]), { brands: M, selectBrand: A, selectedBrand: Q, clearBrand: U, brandCompanions: me } = Et({
|
|
318
|
-
companionType: (ie = t.companionTypes) == null ? void 0 : ie.brand,
|
|
319
|
-
onBrandSelected: m,
|
|
320
|
-
onBrandCleared: p
|
|
321
|
-
}), {
|
|
322
|
-
beverages: fe,
|
|
323
|
-
selectBeverage: K,
|
|
324
|
-
selectedBeverage: H,
|
|
325
|
-
clearBeverage: S,
|
|
326
|
-
beverageCompanions: he
|
|
327
|
-
} = Rt({
|
|
328
|
-
companionType: (oe = t.companionTypes) == null ? void 0 : oe.beverage,
|
|
329
|
-
onBeverageSelected: u,
|
|
330
|
-
onClearBeverage: l
|
|
331
|
-
}), {
|
|
332
|
-
clearFlavors: W,
|
|
333
|
-
flavors: I,
|
|
334
|
-
selectFlavor: _,
|
|
335
|
-
selectedFlavors: X,
|
|
336
|
-
flavorCompanions: E
|
|
337
|
-
} = kt({
|
|
338
|
-
companionType: (ae = t.companionTypes) == null ? void 0 : ae.flavor,
|
|
339
|
-
onFlavorSelected: w,
|
|
340
|
-
onFlavorCleared: g
|
|
341
|
-
}), [L, Z] = T(), J = d((b) => {
|
|
342
|
-
Z(() => b);
|
|
343
|
-
}, []), z = At({
|
|
344
|
-
onPour: v,
|
|
345
|
-
onPourCancel: q,
|
|
346
|
-
onBeforePour: f,
|
|
347
|
-
onBeforePourRejected: c
|
|
348
|
-
});
|
|
349
|
-
i.current = z.updatePourContext, a.current = z.removeFromPourContext;
|
|
350
|
-
const be = d(() => {
|
|
351
|
-
switch (j.debug(`Navigating back from group: ${s}`), s) {
|
|
352
|
-
case te:
|
|
353
|
-
S(), U();
|
|
354
|
-
break;
|
|
355
|
-
case de:
|
|
356
|
-
case se:
|
|
357
|
-
n(e), S(), U();
|
|
358
|
-
break;
|
|
359
|
-
}
|
|
360
|
-
}, [S, U, s, e]), ve = d(() => {
|
|
361
|
-
const b = `/kos/dispense/${r == null ? void 0 : r.path}/home/`;
|
|
362
|
-
P.publish(b, {}), n(e), e === te && (S(), U()), e === de && S();
|
|
363
|
-
}, [S, U, e]), we = d(() => {
|
|
364
|
-
if (o.current.length === 0) {
|
|
365
|
-
j.debug("No timers to pause.");
|
|
366
|
-
return;
|
|
367
|
-
}
|
|
368
|
-
j.debug(`Pausing ${o.current.length} timers.`), o.current.forEach((b) => {
|
|
369
|
-
j.debug(`Pausing timer with id ${b.id}.`), b.pause();
|
|
370
|
-
});
|
|
371
|
-
}, []), ge = d(() => {
|
|
372
|
-
if (o.current.length === 0) {
|
|
373
|
-
j.debug("No timers to restart.");
|
|
374
|
-
return;
|
|
375
|
-
}
|
|
376
|
-
j.debug(`Restarting ${o.current.length} timers.`), o.current.forEach((b) => {
|
|
377
|
-
j.debug(`Restarting timer with id ${b.id}.`), b.restart();
|
|
378
|
-
});
|
|
379
|
-
}, []);
|
|
380
|
-
return {
|
|
381
|
-
timers: {
|
|
382
|
-
add: d((b) => {
|
|
383
|
-
if (b) {
|
|
384
|
-
if (o.current.some((x) => x.id === b.id)) {
|
|
385
|
-
j.debug(`Timer with id ${b.id} already exists.`);
|
|
386
|
-
return;
|
|
387
|
-
}
|
|
388
|
-
o.current.push(b);
|
|
389
|
-
}
|
|
390
|
-
}, []),
|
|
391
|
-
pause: we,
|
|
392
|
-
restart: ge
|
|
393
|
-
},
|
|
394
|
-
nav: {
|
|
395
|
-
currentGroup: s,
|
|
396
|
-
back: be,
|
|
397
|
-
home: ve
|
|
398
|
-
},
|
|
399
|
-
pour: z,
|
|
400
|
-
updateOnBeforePour: J,
|
|
401
|
-
selections: {
|
|
402
|
-
[te]: Q,
|
|
403
|
-
[de]: H,
|
|
404
|
-
[se]: X
|
|
405
|
-
},
|
|
406
|
-
[te]: {
|
|
407
|
-
models: M,
|
|
408
|
-
companions: me,
|
|
409
|
-
clear: U,
|
|
410
|
-
handlers: {
|
|
411
|
-
onSelected: A
|
|
412
|
-
}
|
|
413
|
-
},
|
|
414
|
-
[de]: {
|
|
415
|
-
models: fe,
|
|
416
|
-
companions: he,
|
|
417
|
-
clear: S,
|
|
418
|
-
handlers: {
|
|
419
|
-
onSelected: K
|
|
420
|
-
}
|
|
421
|
-
},
|
|
422
|
-
[se]: {
|
|
423
|
-
models: I,
|
|
424
|
-
companions: E,
|
|
425
|
-
clear: W,
|
|
426
|
-
handlers: {
|
|
427
|
-
onSelected: _
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
};
|
|
431
|
-
}, St = (e) => {
|
|
432
|
-
const { model: t } = B(), [s, n] = T(null), {
|
|
433
|
-
onAmbientTimer: r,
|
|
434
|
-
onAttractTimer: o,
|
|
435
|
-
onResetAttractTimer: i,
|
|
436
|
-
onResumeAttractTimer: a,
|
|
437
|
-
defaultAttractTime: m,
|
|
438
|
-
defaultAmbientTime: p
|
|
439
|
-
} = e, u = d(() => {
|
|
440
|
-
r && ($.info("Ambient timer expired. Calling callback"), r == null || r());
|
|
441
|
-
}, [r]), l = d(() => {
|
|
442
|
-
o && ($.info("Attract timer expired. Calling callback"), o == null || o());
|
|
443
|
-
}, [o]), w = d(() => {
|
|
444
|
-
s && (s.restart(), i == null || i());
|
|
445
|
-
}, [s, i]), g = d(() => {
|
|
446
|
-
s && (s.reset(), i == null || i());
|
|
447
|
-
}, [s, i]), v = d(() => {
|
|
448
|
-
s && (s.pause(), a == null || a());
|
|
449
|
-
}, [s, a]);
|
|
450
|
-
return F(() => {
|
|
451
|
-
if (t && m) {
|
|
452
|
-
$.info("Nozzle is available. Creating timers");
|
|
453
|
-
const f = Ve.createTimer(
|
|
454
|
-
"attract-timer-" + t.path,
|
|
455
|
-
m
|
|
456
|
-
);
|
|
457
|
-
return m && (f == null || f.addTimeoutAction({
|
|
458
|
-
name: "attract-timer",
|
|
459
|
-
remainingTime: 0,
|
|
460
|
-
action: l
|
|
461
|
-
})), p && (f == null || f.addTimeoutAction({
|
|
462
|
-
name: "ambient-timer",
|
|
463
|
-
remainingTime: p,
|
|
464
|
-
action: u
|
|
465
|
-
})), m && (f == null || f.start()), n(f ?? null), () => {
|
|
466
|
-
f == null || f.reset(), n(null);
|
|
467
|
-
};
|
|
468
|
-
}
|
|
469
|
-
return () => {
|
|
470
|
-
$.info("Nozzle is not available. No timers to clear");
|
|
471
|
-
};
|
|
472
|
-
}, [
|
|
473
|
-
p,
|
|
474
|
-
m,
|
|
475
|
-
u,
|
|
476
|
-
l,
|
|
477
|
-
t
|
|
478
|
-
]), {
|
|
479
|
-
attractTimer: s,
|
|
480
|
-
restart: w,
|
|
481
|
-
pause: g,
|
|
482
|
-
resume: v
|
|
483
|
-
};
|
|
484
|
-
}, _t = (e, t) => {
|
|
485
|
-
if (t)
|
|
486
|
-
return P.subscribe(e, t).unsubscribe;
|
|
487
|
-
}, Nt = ({
|
|
488
|
-
onInit: e,
|
|
489
|
-
onBrandSelected: t,
|
|
490
|
-
onBrandCleared: s,
|
|
491
|
-
onBeverageCleared: n,
|
|
492
|
-
onBeverageSelected: r,
|
|
493
|
-
onFlavorCleared: o,
|
|
494
|
-
onFlavorSelected: i,
|
|
495
|
-
onReturnToHome: a,
|
|
496
|
-
onPour: m,
|
|
497
|
-
onPourCancel: p,
|
|
498
|
-
onBeforePourRejected: u,
|
|
499
|
-
onAmbientTimer: l,
|
|
500
|
-
onAttractTimer: w,
|
|
501
|
-
onResumeAttractTimer: g,
|
|
502
|
-
onIdleTimeout: v,
|
|
503
|
-
onAreYouThereTimeout: f
|
|
504
|
-
}) => {
|
|
505
|
-
const { model: c } = B();
|
|
506
|
-
F(() => {
|
|
507
|
-
const M = [
|
|
508
|
-
{
|
|
509
|
-
topic: `/kos/dispense/${c == null ? void 0 : c.path}/brand/selected/`,
|
|
510
|
-
callback: t
|
|
511
|
-
},
|
|
512
|
-
{
|
|
513
|
-
topic: `/kos/dispense/${c == null ? void 0 : c.path}/brand/cleared/`,
|
|
514
|
-
callback: s
|
|
515
|
-
},
|
|
516
|
-
{
|
|
517
|
-
topic: `/kos/dispense/${c == null ? void 0 : c.path}/beverage/selected/`,
|
|
518
|
-
callback: r
|
|
519
|
-
},
|
|
520
|
-
{
|
|
521
|
-
topic: `/kos/dispense/${c == null ? void 0 : c.path}/beverage/cleared/`,
|
|
522
|
-
callback: n
|
|
523
|
-
},
|
|
524
|
-
{
|
|
525
|
-
topic: `/kos/dispense/${c == null ? void 0 : c.path}/flavor/selected/`,
|
|
526
|
-
callback: i
|
|
527
|
-
},
|
|
528
|
-
{
|
|
529
|
-
topic: `/kos/dispense/${c == null ? void 0 : c.path}/flavor/cleared/`,
|
|
530
|
-
callback: o
|
|
531
|
-
},
|
|
532
|
-
{ topic: `/kos/dispense/${c == null ? void 0 : c.path}/pour/`, callback: m },
|
|
533
|
-
{
|
|
534
|
-
topic: `/kos/dispense/${c == null ? void 0 : c.path}/pour/cancel/`,
|
|
535
|
-
callback: p
|
|
536
|
-
},
|
|
537
|
-
{
|
|
538
|
-
topic: `/kos/dispense/${c == null ? void 0 : c.path}/pre/pour/rejected/`,
|
|
539
|
-
callback: u
|
|
540
|
-
},
|
|
541
|
-
{
|
|
542
|
-
topic: `/kos/dispense/${c == null ? void 0 : c.path}/ambient/start/`,
|
|
543
|
-
callback: l
|
|
544
|
-
},
|
|
545
|
-
{
|
|
546
|
-
topic: `/kos/dispense/${c == null ? void 0 : c.path}/attract/start/`,
|
|
547
|
-
callback: w
|
|
548
|
-
},
|
|
549
|
-
{
|
|
550
|
-
topic: `/kos/dispense/${c == null ? void 0 : c.path}/attract/resume/`,
|
|
551
|
-
callback: g
|
|
552
|
-
},
|
|
553
|
-
{
|
|
554
|
-
topic: `/kos/dispense/${c == null ? void 0 : c.path}/idle/timeout/`,
|
|
555
|
-
callback: v
|
|
556
|
-
},
|
|
557
|
-
{
|
|
558
|
-
topic: `/kos/dispense/${c == null ? void 0 : c.path}/are-you-there/timeout/`,
|
|
559
|
-
callback: f
|
|
560
|
-
},
|
|
561
|
-
{
|
|
562
|
-
topic: `/kos/dispense/${c == null ? void 0 : c.path}/init/`,
|
|
563
|
-
callback: e
|
|
564
|
-
},
|
|
565
|
-
{
|
|
566
|
-
topic: `/kos/dispense/${c == null ? void 0 : c.path}/home/`,
|
|
567
|
-
callback: a
|
|
568
|
-
}
|
|
569
|
-
].map(
|
|
570
|
-
({ topic: A, callback: Q }) => _t(A, Q)
|
|
571
|
-
);
|
|
572
|
-
return () => {
|
|
573
|
-
M.forEach((A) => A == null ? void 0 : A());
|
|
574
|
-
};
|
|
575
|
-
}, [
|
|
576
|
-
c == null ? void 0 : c.path,
|
|
577
|
-
l,
|
|
578
|
-
w,
|
|
579
|
-
n,
|
|
580
|
-
r,
|
|
581
|
-
s,
|
|
582
|
-
t,
|
|
583
|
-
o,
|
|
584
|
-
i,
|
|
585
|
-
m,
|
|
586
|
-
p,
|
|
587
|
-
g,
|
|
588
|
-
v,
|
|
589
|
-
f,
|
|
590
|
-
e,
|
|
591
|
-
a
|
|
592
|
-
]);
|
|
593
|
-
}, O = $.createLogger({ name: "useCuiKitTimers" }), Be = (e) => {
|
|
594
|
-
const { model: t } = B(), [s, n] = T(null), {
|
|
595
|
-
onAreYouThereTimer: r,
|
|
596
|
-
onIdleTimer: o,
|
|
597
|
-
onResetIdleTimer: i,
|
|
598
|
-
defaultAreYouThereTime: a = 10,
|
|
599
|
-
defaultIdleTime: m = 20
|
|
600
|
-
} = e, p = le(!1), u = d(() => {
|
|
601
|
-
!p.current && r && ($.info("Are you there timer expired. Calling callback"), p.current = !0, r == null || r());
|
|
602
|
-
}, [r]), l = d(() => {
|
|
603
|
-
O.debug(
|
|
604
|
-
"handleIdleTimer called in useCuiKitTimers, onIdleTimer exists:",
|
|
605
|
-
!!o
|
|
606
|
-
), o ? (O.debug("Idle timer expired. Calling callback"), o == null || o()) : O.debug("No onIdleTimer callback provided!");
|
|
607
|
-
}, [o]), w = d(() => {
|
|
608
|
-
O.debug(`TIMER RESTART called for ${e.prefix ?? ""}timer`), s && (s.restart(), p.current = !1, i == null || i());
|
|
609
|
-
}, [s, i, e.prefix]), g = d(() => {
|
|
610
|
-
O.debug(`TIMER PAUSE/RESET called for ${e.prefix ?? ""}timer`), s && (s.reset(), p.current = !1, i == null || i());
|
|
611
|
-
}, [s, i, e.prefix]);
|
|
612
|
-
return F(() => {
|
|
613
|
-
if (O.debug(
|
|
614
|
-
`useCuiKitTimers effect triggered - nozzle: ${!!t}, path: ${t == null ? void 0 : t.path}, callbacks: handleIdle=${!!l}, handleAreYouThere=${!!u}`
|
|
615
|
-
), t) {
|
|
616
|
-
O.info("Nozzle is available. Creating timers");
|
|
617
|
-
const v = Ve.createTimer(
|
|
618
|
-
`${e.prefix ?? ""}idle-timer-${t.path}`,
|
|
619
|
-
m
|
|
620
|
-
);
|
|
621
|
-
return O.debug(
|
|
622
|
-
`Adding idle timer action for ${e.prefix ?? ""}idle-timer-${t.path} with callback:`,
|
|
623
|
-
!!l
|
|
624
|
-
), v == null || v.addTimeoutAction({
|
|
625
|
-
name: "idle-timer",
|
|
626
|
-
remainingTime: 0,
|
|
627
|
-
action: l
|
|
628
|
-
}), v == null || v.addTimeoutAction({
|
|
629
|
-
name: "are-you-there-timer",
|
|
630
|
-
remainingTime: a,
|
|
631
|
-
action: u
|
|
632
|
-
}), n(v ?? null), () => {
|
|
633
|
-
v == null || v.reset(), n(null);
|
|
634
|
-
};
|
|
635
|
-
}
|
|
636
|
-
return () => {
|
|
637
|
-
O.info("Nozzle is not available. No timers to clear");
|
|
638
|
-
};
|
|
639
|
-
}, [
|
|
640
|
-
a,
|
|
641
|
-
m,
|
|
642
|
-
u,
|
|
643
|
-
l,
|
|
644
|
-
t,
|
|
645
|
-
e.prefix
|
|
646
|
-
]), {
|
|
647
|
-
idleTimer: s,
|
|
648
|
-
restart: w,
|
|
649
|
-
pause: g
|
|
650
|
-
};
|
|
651
|
-
}, V = $.createLogger({ name: "useDefaultCuiKitLifecycle" }), bs = ({
|
|
652
|
-
kit: e,
|
|
653
|
-
inactivity: t,
|
|
654
|
-
pour: s,
|
|
655
|
-
screens: n,
|
|
656
|
-
onBeforeAreYouThereTimer: r,
|
|
657
|
-
areYouThereRejectionPolicy: o = "pause"
|
|
658
|
-
}) => {
|
|
659
|
-
var x, ee, Ce, Se;
|
|
660
|
-
const [i, a] = T(!1), [m, p] = T(!1), { model: u } = B(), [l, w] = T(!1), g = (t == null ? void 0 : t.idleTimeout) ?? 15, v = (t == null ? void 0 : t.areYouThereTimeoutOffset) ?? 10, f = (s == null ? void 0 : s.idleTimeout) ?? (t == null ? void 0 : t.idleTimeout) ?? 10, c = (s == null ? void 0 : s.areYouThereTimeoutOffset) ?? (t == null ? void 0 : t.areYouThereTimeoutOffset) ?? 5, q = n == null ? void 0 : n.ambientTimeoutOffset, M = n == null ? void 0 : n.attractTimeout, A = d(() => {
|
|
661
|
-
if (V.info("handleIdleTimeout called - navigating home and publishing event"), W(!1), e == null || e.nav.home(), u) {
|
|
662
|
-
const y = `/kos/dispense/${u.path}/idle/timeout/`;
|
|
663
|
-
P.publish(y, {});
|
|
664
|
-
}
|
|
665
|
-
}, [(x = e == null ? void 0 : e.nav) == null ? void 0 : x.home, u]), Q = d(() => {
|
|
666
|
-
V.info("handleResetIdleTimer called - resetting idle timer"), W(!1);
|
|
667
|
-
}, []), U = d(() => {
|
|
668
|
-
if (q && (a(!0), p(!1), u)) {
|
|
669
|
-
const y = `/kos/dispense/${u.path}/ambient/start/`;
|
|
670
|
-
P.publish(y, {});
|
|
671
|
-
}
|
|
672
|
-
}, [q, u]), me = d(() => {
|
|
673
|
-
if (M && (p(!0), a(!1), u)) {
|
|
674
|
-
const y = `/kos/dispense/${u.path}/attract/start/`;
|
|
675
|
-
P.publish(y, {});
|
|
676
|
-
}
|
|
677
|
-
}, [M, u]), fe = d(() => {
|
|
678
|
-
if (M && (p(!1), a(!1), e == null || e.nav.home(), u)) {
|
|
679
|
-
const y = `/kos/dispense/${u.path}/attract/resume/`;
|
|
680
|
-
P.publish(y, {});
|
|
681
|
-
}
|
|
682
|
-
}, [e == null ? void 0 : e.nav, M, u]), {
|
|
683
|
-
pause: K,
|
|
684
|
-
restart: H,
|
|
685
|
-
attractTimer: S
|
|
686
|
-
} = St({
|
|
687
|
-
defaultAmbientTime: q,
|
|
688
|
-
defaultAttractTime: M,
|
|
689
|
-
onAmbientTimer: U,
|
|
690
|
-
onAttractTimer: me,
|
|
691
|
-
onResumeAttractTimer: fe
|
|
692
|
-
});
|
|
693
|
-
(ee = e == null ? void 0 : e.timers) == null || ee.add(S);
|
|
694
|
-
const [he, W] = T(!1);
|
|
695
|
-
V.info(
|
|
696
|
-
"Creating idle timer with timeout:",
|
|
697
|
-
g,
|
|
698
|
-
"seconds and callback:",
|
|
699
|
-
!!A
|
|
700
|
-
);
|
|
701
|
-
const { pause: I, restart: _, idleTimer: X } = Be({
|
|
702
|
-
defaultAreYouThereTime: v,
|
|
703
|
-
defaultIdleTime: g,
|
|
704
|
-
onIdleTimer: A,
|
|
705
|
-
onResetIdleTimer: Q
|
|
706
|
-
});
|
|
707
|
-
V.info(
|
|
708
|
-
`Creating pour timer with timeout: ${f} seconds and callback: ${!!A}`
|
|
709
|
-
);
|
|
710
|
-
const {
|
|
711
|
-
pause: E,
|
|
712
|
-
restart: L,
|
|
713
|
-
idleTimer: Z
|
|
714
|
-
} = Be({
|
|
715
|
-
defaultAreYouThereTime: c,
|
|
716
|
-
defaultIdleTime: f,
|
|
717
|
-
onIdleTimer: A,
|
|
718
|
-
prefix: "pour-"
|
|
719
|
-
}), J = d(async () => {
|
|
720
|
-
let y = !0;
|
|
721
|
-
if (r)
|
|
722
|
-
try {
|
|
723
|
-
y = await r();
|
|
724
|
-
} catch (Pe) {
|
|
725
|
-
V.error(`onBeforeAreYouThereTimer callback failed: ${Pe}`), y = !1;
|
|
726
|
-
}
|
|
727
|
-
if (y) {
|
|
728
|
-
if (u) {
|
|
729
|
-
const Pe = `/kos/dispense/${u.path}/are-you-there/timeout/`;
|
|
730
|
-
P.publish(Pe, {});
|
|
731
|
-
}
|
|
732
|
-
W(!0), l ? E() : I();
|
|
733
|
-
} else
|
|
734
|
-
switch (o) {
|
|
735
|
-
case "pause":
|
|
736
|
-
l ? E() : I();
|
|
737
|
-
break;
|
|
738
|
-
case "restart":
|
|
739
|
-
l ? L() : _();
|
|
740
|
-
break;
|
|
741
|
-
}
|
|
742
|
-
}, [r, u, o, l]), z = d(() => {
|
|
743
|
-
W(!1), K(), l ? (L(), I()) : (_(), E());
|
|
744
|
-
}, [l, I, E, _, L]);
|
|
745
|
-
F(() => {
|
|
746
|
-
X && X.addTimeoutAction({
|
|
747
|
-
name: "are-you-there-timer",
|
|
748
|
-
remainingTime: v,
|
|
749
|
-
action: J
|
|
750
|
-
});
|
|
751
|
-
}, [X, v, J]), F(() => {
|
|
752
|
-
Z && Z.addTimeoutAction({
|
|
753
|
-
name: "pour-are-you-there-timer",
|
|
754
|
-
remainingTime: c,
|
|
755
|
-
action: J
|
|
756
|
-
});
|
|
757
|
-
}, [Z, c, J]), (Ce = e == null ? void 0 : e.timers) == null || Ce.add(X), (Se = e == null ? void 0 : e.timers) == null || Se.add(Z);
|
|
758
|
-
const be = d(() => {
|
|
759
|
-
w(!1), E(), I(), K();
|
|
760
|
-
}, [I, E]), ve = d(() => {
|
|
761
|
-
w(!0), V.info("restarting pour timer"), L(), K(), I();
|
|
762
|
-
}, [I, L]), we = d(() => {
|
|
763
|
-
w(!1), V.info("restarting pour timer on before pour rejected"), E(), _();
|
|
764
|
-
}, []), ge = d(() => {
|
|
765
|
-
K(), p(!1), a(!1), _();
|
|
766
|
-
}, [K, _]), ke = d(() => {
|
|
767
|
-
p(!1), a(!1), w(!1), E(), H();
|
|
768
|
-
}, [H, E]), ie = d(() => {
|
|
769
|
-
p(!1), a(!1), w(!1), K(), _();
|
|
770
|
-
}, [K, _]), oe = d(() => {
|
|
771
|
-
p(!1), a(!1), w(!1), H(), I(), E();
|
|
772
|
-
}, [H, I, E]), ae = d(() => {
|
|
773
|
-
p(!1), a(!1), H(), I();
|
|
774
|
-
}, [H, I]);
|
|
775
|
-
Nt({
|
|
776
|
-
onBrandSelected: ge,
|
|
777
|
-
onBrandCleared: ke,
|
|
778
|
-
onBeverageSelected: ie,
|
|
779
|
-
onBeverageCleared: oe,
|
|
780
|
-
onPour: be,
|
|
781
|
-
onPourCancel: ve,
|
|
782
|
-
onBeforePourRejected: we,
|
|
783
|
-
onInit: ae
|
|
784
|
-
// Note: Timer-related handlers (onIdleTimeout, onAmbientTimer, onAttractTimer,
|
|
785
|
-
// onResumeAttractTimer, onAreYouThereTimeout) are NOT included here since this
|
|
786
|
-
// component's own timer hooks call those handlers directly. Including them would
|
|
787
|
-
// create circular event loops.
|
|
788
|
-
});
|
|
789
|
-
const b = l ? c : v;
|
|
790
|
-
return F(() => {
|
|
791
|
-
if (u && S) {
|
|
792
|
-
const y = `/kos/dispense/${u == null ? void 0 : u.path}/init/`;
|
|
793
|
-
P.publish(y, {});
|
|
794
|
-
}
|
|
795
|
-
}, [u, S]), {
|
|
796
|
-
showAreYouThere: he,
|
|
797
|
-
clearAreYouThere: z,
|
|
798
|
-
pauseIdleTimer: I,
|
|
799
|
-
restartIdleTimer: _,
|
|
800
|
-
areYouThereCountdown: b,
|
|
801
|
-
showAmbientScreen: i,
|
|
802
|
-
showAttractScreen: m,
|
|
803
|
-
pauseScreenTimer: K,
|
|
804
|
-
restartScreenTimer: H
|
|
805
|
-
};
|
|
806
|
-
}, et = () => {
|
|
807
|
-
const e = Me.type;
|
|
808
|
-
return k({
|
|
809
|
-
modelId: e,
|
|
810
|
-
modelType: Me.type,
|
|
811
|
-
options: {}
|
|
812
|
-
});
|
|
813
|
-
};
|
|
814
|
-
function vs(e) {
|
|
815
|
-
return (t) => {
|
|
816
|
-
const { model: s, status: n, KosModelLoader: r } = et();
|
|
817
|
-
return /* @__PURE__ */ h(r, { ...n, children: /* @__PURE__ */ h(e, { ...t, deviceAssembly: s }) });
|
|
818
|
-
};
|
|
819
|
-
}
|
|
820
|
-
const tt = (e) => k({
|
|
821
|
-
modelId: e,
|
|
822
|
-
modelType: $t.type,
|
|
823
|
-
options: {}
|
|
824
|
-
});
|
|
825
|
-
function ws(e, t) {
|
|
826
|
-
return (s) => {
|
|
827
|
-
const { model: n, status: r, KosModelLoader: o } = tt(e);
|
|
828
|
-
return /* @__PURE__ */ h(o, { ...r, children: /* @__PURE__ */ h(t, { ...s, holder: n }) });
|
|
829
|
-
};
|
|
830
|
-
}
|
|
831
|
-
const st = () => {
|
|
832
|
-
const e = He.type;
|
|
833
|
-
return k({
|
|
834
|
-
modelId: e,
|
|
835
|
-
modelType: He.type,
|
|
836
|
-
options: {}
|
|
837
|
-
});
|
|
838
|
-
};
|
|
839
|
-
function gs(e) {
|
|
840
|
-
return (t) => {
|
|
841
|
-
const { model: s, status: n, KosModelLoader: r } = st();
|
|
842
|
-
return /* @__PURE__ */ h(r, { ...n, children: /* @__PURE__ */ h(e, { ...t, holderContainer: s }) });
|
|
843
|
-
};
|
|
844
|
-
}
|
|
845
|
-
const rt = () => {
|
|
846
|
-
const e = Le.type;
|
|
847
|
-
return k({
|
|
848
|
-
modelId: e,
|
|
849
|
-
modelType: Le.type,
|
|
850
|
-
options: {}
|
|
851
|
-
});
|
|
852
|
-
}, $e = $.createLogger({
|
|
853
|
-
name: "HoldToPourIntentStrategy",
|
|
854
|
-
group: "kos-hooks"
|
|
855
|
-
}), Kt = {
|
|
856
|
-
name: "HoldToPourIntentStrategy",
|
|
857
|
-
async initiate(e, t) {
|
|
858
|
-
if (!(e != null && e.canPour)) {
|
|
859
|
-
$e.debug(`${e == null ? void 0 : e.id} cannot pour. Returning early.`);
|
|
860
|
-
return;
|
|
861
|
-
}
|
|
862
|
-
t ? ($e.debug(`performing intent: ${t}`), await (e == null ? void 0 : e.performIntent(t))) : $e.debug("no intent provided. Returning early.");
|
|
863
|
-
},
|
|
864
|
-
async initiateEnded(e) {
|
|
865
|
-
await (e == null ? void 0 : e.cancelPour());
|
|
866
|
-
}
|
|
867
|
-
}, Ie = $.createLogger({
|
|
868
|
-
name: "useNozzlePour",
|
|
869
|
-
group: "kos-hooks"
|
|
870
|
-
}), Ps = ({
|
|
871
|
-
onPour: e,
|
|
872
|
-
onPourCancel: t,
|
|
873
|
-
intentContainer: s,
|
|
874
|
-
strategy: n = Kt
|
|
875
|
-
}) => {
|
|
876
|
-
const r = d(() => {
|
|
877
|
-
Ie.debug(
|
|
878
|
-
`[${n == null ? void 0 : n.name}] - Pour initiated for model ${s == null ? void 0 : s.id}.`
|
|
879
|
-
), n == null || n.initiate(s), e == null || e();
|
|
880
|
-
}, [e, s, n]), o = d(() => {
|
|
881
|
-
var m;
|
|
882
|
-
Ie.debug(
|
|
883
|
-
`[${n == null ? void 0 : n.name}] - Pour initiate ended called for nozzle ${s == null ? void 0 : s.id}.`
|
|
884
|
-
), (m = n == null ? void 0 : n.initiateEnded) == null || m.call(n, s), t == null || t();
|
|
885
|
-
}, [t, s, n]), i = d(() => {
|
|
886
|
-
Ie.debug(`Force cancelling pour for nozzle ${s == null ? void 0 : s.id}.`), s == null || s.cancelPour(), t == null || t();
|
|
887
|
-
}, [t, s]);
|
|
888
|
-
return {
|
|
889
|
-
handlers: Ae({
|
|
890
|
-
onPressed: r,
|
|
891
|
-
onRelease: o
|
|
892
|
-
}).dom,
|
|
893
|
-
cancel: i,
|
|
894
|
-
status: s
|
|
895
|
-
};
|
|
896
|
-
};
|
|
897
|
-
function $s(e) {
|
|
898
|
-
return (t) => {
|
|
899
|
-
const { model: s, status: n, KosModelLoader: r } = rt();
|
|
900
|
-
return /* @__PURE__ */ h(r, { ...n, children: /* @__PURE__ */ h(e, { ...t, ingredient: s }) });
|
|
901
|
-
};
|
|
902
|
-
}
|
|
903
|
-
const nt = () => {
|
|
904
|
-
const e = De.type;
|
|
905
|
-
return k({
|
|
906
|
-
modelId: e,
|
|
907
|
-
modelType: De.type,
|
|
908
|
-
options: {}
|
|
909
|
-
});
|
|
910
|
-
};
|
|
911
|
-
function Is(e) {
|
|
912
|
-
return (t) => {
|
|
913
|
-
const { model: s, status: n, KosModelLoader: r } = nt();
|
|
914
|
-
return /* @__PURE__ */ h(r, { ...n, children: /* @__PURE__ */ h(e, { ...t, ingredientContainer: s }) });
|
|
915
|
-
};
|
|
916
|
-
}
|
|
917
|
-
function xs(e, t) {
|
|
918
|
-
return (s) => {
|
|
919
|
-
const { model: n, status: r, KosModelLoader: o } = Ze(e);
|
|
920
|
-
return /* @__PURE__ */ h(o, { ...r, children: /* @__PURE__ */ h(t, { ...s, nozzle: n }) });
|
|
921
|
-
};
|
|
922
|
-
}
|
|
923
|
-
const re = $.createLogger({
|
|
924
|
-
name: "usePour",
|
|
925
|
-
group: "kos-hooks"
|
|
926
|
-
}), Ts = ({
|
|
927
|
-
onBeforePour: e,
|
|
928
|
-
onPour: t,
|
|
929
|
-
onPourCancel: s,
|
|
930
|
-
onPourAbort: n,
|
|
931
|
-
pourTarget: r,
|
|
932
|
-
pourContext: o,
|
|
933
|
-
strategy: i = ze
|
|
934
|
-
}) => {
|
|
935
|
-
const [a, m] = T(
|
|
936
|
-
o || new Qe()
|
|
937
|
-
), p = d(async () => {
|
|
938
|
-
re.debug(
|
|
939
|
-
`[${i == null ? void 0 : i.name}] - calling before pour for pour target ${r == null ? void 0 : r.id}.`
|
|
940
|
-
), (e ? await (e == null ? void 0 : e(a)) : !0) ? (re.debug(
|
|
941
|
-
`[${i == null ? void 0 : i.name}] - Pour initiated for pour target ${r == null ? void 0 : r.id}.`
|
|
942
|
-
), await (i == null ? void 0 : i.initiate(r)), t == null || t(), r != null && r.isPouring || n == null || n()) : (re.debug(
|
|
943
|
-
`[${i == null ? void 0 : i.name}] - Pour cancelled for pour target ${r == null ? void 0 : r.id}.`
|
|
944
|
-
), s == null || s());
|
|
945
|
-
}, [t, e, n, r, i, a]), u = d(async () => {
|
|
946
|
-
var c;
|
|
947
|
-
re.debug(
|
|
948
|
-
`[${i == null ? void 0 : i.name}] - Pour initiate ended called for pour target ${r == null ? void 0 : r.id}.`
|
|
949
|
-
), await ((c = i == null ? void 0 : i.initiateEnded) == null ? void 0 : c.call(i, r)) || s == null || s();
|
|
950
|
-
}, [s, r, i]), l = d(async () => {
|
|
951
|
-
re.debug(`Force cancelling pour for pour target ${r == null ? void 0 : r.id}.`), await (r == null ? void 0 : r.cancelPour()), s == null || s();
|
|
952
|
-
}, [s, r]), w = d(
|
|
953
|
-
(f, c) => {
|
|
954
|
-
a.set(f, c);
|
|
955
|
-
},
|
|
956
|
-
[a]
|
|
957
|
-
), g = d(
|
|
958
|
-
(f) => {
|
|
959
|
-
a.remove(f);
|
|
960
|
-
},
|
|
961
|
-
[a]
|
|
962
|
-
);
|
|
963
|
-
return {
|
|
964
|
-
handlers: Ae({
|
|
965
|
-
onPressed: p,
|
|
966
|
-
onRelease: u
|
|
967
|
-
}).dom,
|
|
968
|
-
cancel: l,
|
|
969
|
-
updatePourContext: w,
|
|
970
|
-
removeFromPourContext: g,
|
|
971
|
-
status: r
|
|
972
|
-
};
|
|
973
|
-
}, ne = $.createLogger({
|
|
974
|
-
name: "TapOrHoldIntentStrategy",
|
|
975
|
-
group: "kos-hooks"
|
|
976
|
-
});
|
|
977
|
-
class Rs {
|
|
978
|
-
constructor(t) {
|
|
979
|
-
D(this, "intent");
|
|
980
|
-
D(this, "name", "TapOrHoldIntentStrategy");
|
|
981
|
-
D(this, "isHold", !1);
|
|
982
|
-
D(this, "disposer", null);
|
|
983
|
-
this.intent = t;
|
|
984
|
-
}
|
|
985
|
-
async initiate(t, s) {
|
|
986
|
-
if (this.disposer = setTimeout(() => {
|
|
987
|
-
this.isHold = !0;
|
|
988
|
-
}, 250), t != null && t.isPouring && !this.isHold) {
|
|
989
|
-
ne.debug("additional tap detected. cancelling pour"), await t.cancelPour();
|
|
990
|
-
return;
|
|
991
|
-
}
|
|
992
|
-
if (!(t != null && t.canPour)) {
|
|
993
|
-
ne.debug(`${t == null ? void 0 : t.id} cannot pour. Returning early.`);
|
|
994
|
-
return;
|
|
995
|
-
}
|
|
996
|
-
s ? (ne.debug(`performing intent: ${s}`), await (t == null ? void 0 : t.performIntent(s))) : ne.debug("no intent provided. Returning early.");
|
|
997
|
-
}
|
|
998
|
-
async initiateEnded(t) {
|
|
999
|
-
return this.disposer && clearTimeout(this.disposer), this.disposer = null, this.isHold ? (await (t == null ? void 0 : t.cancelPour()), !1) : (ne.debug("Tap detected. don't cancel and return."), !0);
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
const ue = $.createLogger({
|
|
1003
|
-
name: "TapToPourIntentStrategy",
|
|
1004
|
-
group: "kos-hooks"
|
|
1005
|
-
}), Es = {
|
|
1006
|
-
name: "TapToPourIntentStrategy",
|
|
1007
|
-
async initiate(e, t) {
|
|
1008
|
-
if (e != null && e.isPouring) {
|
|
1009
|
-
ue.debug(`Nozzle ${e == null ? void 0 : e.id} is already pouring. cancelling pour`), await e.cancelPour();
|
|
1010
|
-
return;
|
|
1011
|
-
}
|
|
1012
|
-
if (!(e != null && e.canPour)) {
|
|
1013
|
-
ue.debug(`Nozzle ${e == null ? void 0 : e.id} cannot pour. Returning early.`);
|
|
1014
|
-
return;
|
|
1015
|
-
}
|
|
1016
|
-
t ? (ue.debug(`performing intent: ${t}`), await (e == null ? void 0 : e.performIntent(t))) : ue.debug("no intent provided. Returning early.");
|
|
1017
|
-
},
|
|
1018
|
-
async initiateEnded(e) {
|
|
1019
|
-
return !0;
|
|
1020
|
-
}
|
|
1021
|
-
}, Ue = $.createLogger({
|
|
1022
|
-
name: "HoldToPourStrategy",
|
|
1023
|
-
group: "kos-hooks"
|
|
1024
|
-
}), ys = {
|
|
1025
|
-
name: "TapToPourStrategy",
|
|
1026
|
-
async initiate(e) {
|
|
1027
|
-
if (e != null && e.isPouring) {
|
|
1028
|
-
Ue.debug(`Nozzle ${e == null ? void 0 : e.id} is already pouring. cancelling pour`), await e.cancelPour();
|
|
1029
|
-
return;
|
|
1030
|
-
}
|
|
1031
|
-
if (!(e != null && e.canPour)) {
|
|
1032
|
-
Ue.debug(`Nozzle ${e == null ? void 0 : e.id} cannot pour. Returning early.`);
|
|
1033
|
-
return;
|
|
1034
|
-
}
|
|
1035
|
-
await (e == null ? void 0 : e.pour());
|
|
1036
|
-
},
|
|
1037
|
-
async initiateEnded(e) {
|
|
1038
|
-
return !0;
|
|
1039
|
-
}
|
|
1040
|
-
}, Mt = (e, t, s) => k({
|
|
1041
|
-
modelId: e,
|
|
1042
|
-
modelType: It.type,
|
|
1043
|
-
options: {
|
|
1044
|
-
servicePathFactory: t,
|
|
1045
|
-
selectedId: s
|
|
1046
|
-
}
|
|
1047
|
-
});
|
|
1048
|
-
function As(e) {
|
|
1049
|
-
return (t) => {
|
|
1050
|
-
const { model: s, status: n, KosModelLoader: r } = Mt(
|
|
1051
|
-
t.id,
|
|
1052
|
-
t.servicePathFactory,
|
|
1053
|
-
t.itemId
|
|
1054
|
-
);
|
|
1055
|
-
return /* @__PURE__ */ h(r, { ...n, children: /* @__PURE__ */ h(e, { ...t, genericPour: s }) });
|
|
1056
|
-
};
|
|
1057
|
-
}
|
|
1058
|
-
const it = N(void 0), ks = ({ children: e }) => {
|
|
1059
|
-
const { model: t, ready: s } = Ge(), n = R(() => s && t ? { model: t } : {}, [s, t]);
|
|
1060
|
-
return /* @__PURE__ */ h(it.Provider, { value: n, children: e });
|
|
1061
|
-
}, Cs = () => {
|
|
1062
|
-
const e = C(
|
|
1063
|
-
it
|
|
1064
|
-
);
|
|
1065
|
-
if (!e)
|
|
1066
|
-
throw new Error(
|
|
1067
|
-
"useAssemblyContext must be used within a AssemblyProvider"
|
|
1068
|
-
);
|
|
1069
|
-
return e;
|
|
1070
|
-
}, ot = N(void 0), Ss = ({ children: e }) => {
|
|
1071
|
-
const { model: t, ready: s } = qe(), n = R(() => s && t ? { model: t } : {}, [s, t]);
|
|
1072
|
-
return /* @__PURE__ */ h(ot.Provider, { value: n, children: e });
|
|
1073
|
-
}, _s = () => {
|
|
1074
|
-
const e = C(ot);
|
|
1075
|
-
if (!e)
|
|
1076
|
-
throw new Error(
|
|
1077
|
-
"useAvailabilityContext must be used within a AvailabilityProvider"
|
|
1078
|
-
);
|
|
1079
|
-
return e;
|
|
1080
|
-
}, at = N(void 0), Ns = ({ children: e, id: t }) => {
|
|
1081
|
-
const { model: s, ready: n } = We(t), r = R(() => n && s ? { model: s } : {}, [n, s]);
|
|
1082
|
-
return /* @__PURE__ */ h(at.Provider, { value: r, children: e });
|
|
1083
|
-
}, Ks = () => {
|
|
1084
|
-
const e = C(at);
|
|
1085
|
-
if (!e)
|
|
1086
|
-
throw new Error("useBoardContext must be used within a BoardProvider");
|
|
1087
|
-
return e;
|
|
1088
|
-
}, ct = N(void 0), Ms = ({ children: e }) => {
|
|
1089
|
-
const { model: t, ready: s } = Xe(), n = R(() => s && t ? { model: t } : {}, [s, t]);
|
|
1090
|
-
return /* @__PURE__ */ h(ct.Provider, { value: n, children: e });
|
|
1091
|
-
}, Hs = () => {
|
|
1092
|
-
const e = C(ct);
|
|
1093
|
-
if (!e)
|
|
1094
|
-
throw new Error(
|
|
1095
|
-
"useBoardContainerContext must be used within a BoardContainerProvider"
|
|
1096
|
-
);
|
|
1097
|
-
return e;
|
|
1098
|
-
}, dt = N(
|
|
1099
|
-
void 0
|
|
1100
|
-
), Ht = ({ children: e }) => {
|
|
1101
|
-
const { model: t, ready: s } = et(), n = R(() => {
|
|
1102
|
-
if (s && t) {
|
|
1103
|
-
const o = t.nozzlePaths;
|
|
1104
|
-
return { model: t, nozzlePaths: o };
|
|
1105
|
-
}
|
|
1106
|
-
return {};
|
|
1107
|
-
}, [s, t]), r = s && t ? e : null;
|
|
1108
|
-
return /* @__PURE__ */ h(dt.Provider, { value: n, children: r });
|
|
1109
|
-
}, Lt = () => {
|
|
1110
|
-
const e = C(dt);
|
|
1111
|
-
if (!e)
|
|
1112
|
-
throw new Error(
|
|
1113
|
-
"useDeviceAssemblyContext must be used within a DeviceAssemblyProvider"
|
|
1114
|
-
);
|
|
1115
|
-
return e;
|
|
1116
|
-
};
|
|
1117
|
-
function Dt() {
|
|
1118
|
-
const e = xt.createContext(null);
|
|
1119
|
-
return [() => {
|
|
1120
|
-
const s = C(e);
|
|
1121
|
-
if (s === void 0)
|
|
1122
|
-
throw new Error("useDispenseKitContext must be used within a Provider");
|
|
1123
|
-
return s;
|
|
1124
|
-
}, e.Provider];
|
|
1125
|
-
}
|
|
1126
|
-
function Ot({
|
|
1127
|
-
children: e,
|
|
1128
|
-
provider: t,
|
|
1129
|
-
props: s,
|
|
1130
|
-
nozzleProps: n
|
|
1131
|
-
}) {
|
|
1132
|
-
const r = Ct(s);
|
|
1133
|
-
return /* @__PURE__ */ h(t, { value: r, children: e(n || {}) });
|
|
1134
|
-
}
|
|
1135
|
-
function Bt({
|
|
1136
|
-
children: e,
|
|
1137
|
-
provider: t,
|
|
1138
|
-
props: s
|
|
1139
|
-
}) {
|
|
1140
|
-
const { nozzlePaths: n } = Lt(), r = (n == null ? void 0 : n.length) || 0;
|
|
1141
|
-
return (n == null ? void 0 : n.map((i, a) => /* @__PURE__ */ h(Tt, { path: i, children: /* @__PURE__ */ h(
|
|
1142
|
-
Ot,
|
|
1143
|
-
{
|
|
1144
|
-
provider: t,
|
|
1145
|
-
props: s,
|
|
1146
|
-
nozzleProps: {
|
|
1147
|
-
nozzleIndex: a,
|
|
1148
|
-
nozzlePath: i,
|
|
1149
|
-
totalNozzles: r,
|
|
1150
|
-
isFirstNozzle: a === 0,
|
|
1151
|
-
isLastNozzle: a === r - 1
|
|
1152
|
-
},
|
|
1153
|
-
children: e
|
|
1154
|
-
}
|
|
1155
|
-
) }, i))) || [];
|
|
1156
|
-
}
|
|
1157
|
-
function Ut({
|
|
1158
|
-
provider: e,
|
|
1159
|
-
props: t
|
|
1160
|
-
}) {
|
|
1161
|
-
return ({ children: s }) => e ? /* @__PURE__ */ h(Ht, { children: /* @__PURE__ */ h(
|
|
1162
|
-
Bt,
|
|
1163
|
-
{
|
|
1164
|
-
provider: e,
|
|
1165
|
-
props: t,
|
|
1166
|
-
children: s
|
|
1167
|
-
}
|
|
1168
|
-
) }) : null;
|
|
1169
|
-
}
|
|
1170
|
-
function Ls(e) {
|
|
1171
|
-
const [t, s] = Dt();
|
|
1172
|
-
return [
|
|
1173
|
-
t,
|
|
1174
|
-
Ut({ provider: s, props: e })
|
|
1175
|
-
];
|
|
1176
|
-
}
|
|
1177
|
-
const ut = N(void 0), Ds = ({ children: e, id: t }) => {
|
|
1178
|
-
const { model: s, ready: n } = tt(t || ""), r = R(() => n && s ? { model: s } : {}, [n, s]);
|
|
1179
|
-
return /* @__PURE__ */ h(ut.Provider, { value: r, children: e });
|
|
1180
|
-
}, Os = () => {
|
|
1181
|
-
const e = C(ut);
|
|
1182
|
-
if (!e)
|
|
1183
|
-
throw new Error("useHolderContext must be used within a HolderProvider");
|
|
1184
|
-
return e;
|
|
1185
|
-
}, lt = N(
|
|
1186
|
-
void 0
|
|
1187
|
-
), Bs = ({ children: e }) => {
|
|
1188
|
-
const { model: t, ready: s } = st(), n = R(() => s && t ? { model: t } : {}, [s, t]);
|
|
1189
|
-
return /* @__PURE__ */ h(lt.Provider, { value: n, children: e });
|
|
1190
|
-
}, Us = () => {
|
|
1191
|
-
const e = C(lt);
|
|
1192
|
-
if (!e)
|
|
1193
|
-
throw new Error(
|
|
1194
|
-
"useHolderContainerContext must be used within a HolderContainerProvider"
|
|
1195
|
-
);
|
|
1196
|
-
return e;
|
|
1197
|
-
}, pt = N(void 0), js = ({ children: e }) => {
|
|
1198
|
-
const { model: t, ready: s } = rt(), n = R(() => s && t ? { model: t } : {}, [s, t]);
|
|
1199
|
-
return /* @__PURE__ */ h(pt.Provider, { value: n, children: e });
|
|
1200
|
-
}, Fs = () => {
|
|
1201
|
-
const e = C(pt);
|
|
1202
|
-
if (!e)
|
|
1203
|
-
throw new Error(
|
|
1204
|
-
"useIngredientContext must be used within a IngredientProvider"
|
|
1205
|
-
);
|
|
1206
|
-
return e;
|
|
1207
|
-
}, mt = N(
|
|
1208
|
-
void 0
|
|
1209
|
-
), Ys = ({ children: e }) => {
|
|
1210
|
-
const { model: t, ready: s } = nt(), n = R(() => s && t ? { model: t } : {}, [s, t]);
|
|
1211
|
-
return /* @__PURE__ */ h(mt.Provider, { value: n, children: e });
|
|
1212
|
-
}, Vs = () => {
|
|
1213
|
-
const e = C(mt);
|
|
1214
|
-
if (!e)
|
|
1215
|
-
throw new Error(
|
|
1216
|
-
"useIngredientContainerContext must be used within a IngredientContainerProvider"
|
|
1217
|
-
);
|
|
1218
|
-
return e;
|
|
1219
|
-
}, jt = () => {
|
|
1220
|
-
const e = Oe.type;
|
|
1221
|
-
return k({
|
|
1222
|
-
modelId: e,
|
|
1223
|
-
modelType: Oe.type,
|
|
1224
|
-
options: {}
|
|
1225
|
-
});
|
|
1226
|
-
}, ft = N(void 0), Gs = ({ children: e }) => {
|
|
1227
|
-
const { model: t, ready: s } = jt(), n = R(() => s && t ? { model: t } : {}, [s, t]);
|
|
1228
|
-
return /* @__PURE__ */ h(ft.Provider, { value: n, children: e });
|
|
1229
|
-
}, qs = () => {
|
|
1230
|
-
const e = C(ft);
|
|
1231
|
-
if (!e)
|
|
1232
|
-
throw new Error("usePumpContext must be used within a PumpProvider");
|
|
1233
|
-
return e;
|
|
1234
|
-
};
|
|
1235
|
-
function Ft(e) {
|
|
1236
|
-
var t;
|
|
1237
|
-
try {
|
|
1238
|
-
if ("shape" in e) {
|
|
1239
|
-
const s = e, n = [];
|
|
1240
|
-
for (const [r, o] of Object.entries(
|
|
1241
|
-
s.shape
|
|
1242
|
-
)) {
|
|
1243
|
-
const i = o, a = {
|
|
1244
|
-
name: r,
|
|
1245
|
-
required: !i.isOptional()
|
|
1246
|
-
};
|
|
1247
|
-
if (i._def && i._def.description && (a.description = i._def.description), i._def) {
|
|
1248
|
-
let m = i._def.typeName || "unknown";
|
|
1249
|
-
m === "ZodOptional" && i._def.innerType && (m = ((t = i._def.innerType._def) == null ? void 0 : t.typeName) || "unknown"), a.type = m.replace("Zod", "").toLowerCase();
|
|
1250
|
-
}
|
|
1251
|
-
n.push(a);
|
|
1252
|
-
}
|
|
1253
|
-
return n;
|
|
1254
|
-
}
|
|
1255
|
-
return [];
|
|
1256
|
-
} catch (s) {
|
|
1257
|
-
return console.warn("Failed to extract schema field info:", s), [];
|
|
1258
|
-
}
|
|
1259
|
-
}
|
|
1260
|
-
class Yt {
|
|
1261
|
-
constructor() {
|
|
1262
|
-
D(this, "issues", []);
|
|
1263
|
-
}
|
|
1264
|
-
addError(t) {
|
|
1265
|
-
this.issues.push({ type: "error", message: t });
|
|
1266
|
-
}
|
|
1267
|
-
addWarning(t) {
|
|
1268
|
-
this.issues.push({ type: "warning", message: t });
|
|
1269
|
-
}
|
|
1270
|
-
addInfo(t) {
|
|
1271
|
-
this.issues.push({ type: "info", message: t });
|
|
1272
|
-
}
|
|
1273
|
-
hasErrors() {
|
|
1274
|
-
return this.issues.some((t) => t.type === "error");
|
|
1275
|
-
}
|
|
1276
|
-
hasIssues() {
|
|
1277
|
-
return this.issues.length > 0;
|
|
1278
|
-
}
|
|
1279
|
-
getIssues() {
|
|
1280
|
-
return [...this.issues];
|
|
1281
|
-
}
|
|
1282
|
-
}
|
|
1283
|
-
class Vt {
|
|
1284
|
-
constructor() {
|
|
1285
|
-
D(this, "cache", /* @__PURE__ */ new Map());
|
|
1286
|
-
}
|
|
1287
|
-
set(t, s) {
|
|
1288
|
-
this.cache.set(t, s);
|
|
1289
|
-
}
|
|
1290
|
-
get(t) {
|
|
1291
|
-
return this.cache.get(t) || [];
|
|
1292
|
-
}
|
|
1293
|
-
clear() {
|
|
1294
|
-
this.cache.clear();
|
|
1295
|
-
}
|
|
1296
|
-
}
|
|
1297
|
-
const xe = new Vt();
|
|
1298
|
-
class Gt {
|
|
1299
|
-
constructor() {
|
|
1300
|
-
D(this, "extensionPoints", /* @__PURE__ */ new Map());
|
|
1301
|
-
}
|
|
1302
|
-
define(t) {
|
|
1303
|
-
if (this.extensionPoints.has(t.id))
|
|
1304
|
-
return console.warn(`Extension point ${t.id} is already defined`), this.extensionPoints.get(t.id);
|
|
1305
|
-
const s = {
|
|
1306
|
-
config: t,
|
|
1307
|
-
id: t.id,
|
|
1308
|
-
isRegistered: !1,
|
|
1309
|
-
getExtensions: (n) => n[t.id] || {},
|
|
1310
|
-
register: () => {
|
|
1311
|
-
if (s.isRegistered) {
|
|
1312
|
-
console.warn(`Extension point ${t.id} is already registered`);
|
|
1313
|
-
return;
|
|
1314
|
-
}
|
|
1315
|
-
this.createReducer(t), s.isRegistered = !0;
|
|
1316
|
-
}
|
|
1317
|
-
};
|
|
1318
|
-
return t.schema && (s.getSchemaFieldInfo = () => Ft(t.schema)), this.extensionPoints.set(t.id, s), s;
|
|
1319
|
-
}
|
|
1320
|
-
createReducer(t) {
|
|
1321
|
-
return (s, n, r) => {
|
|
1322
|
-
const o = n[t.contributionKey];
|
|
1323
|
-
return !o || typeof o != "object" || Object.entries(o).forEach(
|
|
1324
|
-
([i, a]) => {
|
|
1325
|
-
var l, w;
|
|
1326
|
-
if (!a)
|
|
1327
|
-
return;
|
|
1328
|
-
const m = {
|
|
1329
|
-
remote: a.remote || "",
|
|
1330
|
-
sectionId: a.sectionId || i,
|
|
1331
|
-
experiences: r,
|
|
1332
|
-
contributions: n
|
|
1333
|
-
};
|
|
1334
|
-
if (t.validate) {
|
|
1335
|
-
const g = new Yt();
|
|
1336
|
-
if (t.validate(
|
|
1337
|
-
a,
|
|
1338
|
-
g
|
|
1339
|
-
) === "skip") {
|
|
1340
|
-
xe.set(i, [
|
|
1341
|
-
{
|
|
1342
|
-
type: "warning",
|
|
1343
|
-
message: "Plugin marked to skip processing"
|
|
1344
|
-
}
|
|
1345
|
-
]);
|
|
1346
|
-
return;
|
|
1347
|
-
}
|
|
1348
|
-
if (g.hasIssues()) {
|
|
1349
|
-
const f = g.getIssues().map((c) => ({
|
|
1350
|
-
...c,
|
|
1351
|
-
message: `Extension point validation: ${c.message}`
|
|
1352
|
-
}));
|
|
1353
|
-
if (xe.set(i, f), g.hasErrors()) {
|
|
1354
|
-
console.error(
|
|
1355
|
-
`Validation failed for ${t.id} contribution "${i}":`,
|
|
1356
|
-
f.filter((c) => c.type === "error").map((c) => c.message).join(", ")
|
|
1357
|
-
);
|
|
1358
|
-
return;
|
|
1359
|
-
}
|
|
1360
|
-
} else
|
|
1361
|
-
xe.set(i, []);
|
|
1362
|
-
}
|
|
1363
|
-
const p = t.transform ? t.transform(a, m) : a;
|
|
1364
|
-
s[t.id] || (s[t.id] = {});
|
|
1365
|
-
const u = {
|
|
1366
|
-
id: i,
|
|
1367
|
-
type: t.contributionKey,
|
|
1368
|
-
data: p,
|
|
1369
|
-
remote: m.remote,
|
|
1370
|
-
sectionId: m.sectionId
|
|
1371
|
-
};
|
|
1372
|
-
if (t.isRankable && typeof a.rank == "number" && (u.rank = a.rank), p && typeof p == "object" && ("component" in p && (u.component = p.component), "view" in p && (u.view = p.view), "location" in p && (u.location = p.location)), s[t.id][i] = u, t.hasView && ((l = t.relatedPoints) != null && l.view)) {
|
|
1373
|
-
const g = a.experienceId, v = r == null ? void 0 : r[g];
|
|
1374
|
-
v && (s[t.relatedPoints.view] || (s[t.relatedPoints.view] = {}), s[t.relatedPoints.view][i] = {
|
|
1375
|
-
id: i,
|
|
1376
|
-
type: `${t.contributionKey}.view`,
|
|
1377
|
-
data: v,
|
|
1378
|
-
remote: m.remote,
|
|
1379
|
-
sectionId: m.sectionId
|
|
1380
|
-
});
|
|
1381
|
-
}
|
|
1382
|
-
(w = t.relatedPoints) != null && w.definition && (s[t.relatedPoints.definition] || (s[t.relatedPoints.definition] = {}), s[t.relatedPoints.definition][i] = {
|
|
1383
|
-
id: i,
|
|
1384
|
-
type: `${t.contributionKey}.definition`,
|
|
1385
|
-
data: p,
|
|
1386
|
-
remote: m.remote,
|
|
1387
|
-
sectionId: m.sectionId
|
|
1388
|
-
});
|
|
1389
|
-
}
|
|
1390
|
-
), s;
|
|
1391
|
-
};
|
|
1392
|
-
}
|
|
1393
|
-
/**
|
|
1394
|
-
* Get all registered extension points (for discovery/documentation)
|
|
1395
|
-
*/
|
|
1396
|
-
getAllExtensionPoints() {
|
|
1397
|
-
return Array.from(this.extensionPoints.values()).filter(
|
|
1398
|
-
(t) => t.isRegistered
|
|
1399
|
-
);
|
|
1400
|
-
}
|
|
1401
|
-
/**
|
|
1402
|
-
* Get all defined extension points (registered and unregistered)
|
|
1403
|
-
*/
|
|
1404
|
-
getAllDefinedExtensionPoints() {
|
|
1405
|
-
return Array.from(this.extensionPoints.values());
|
|
1406
|
-
}
|
|
1407
|
-
/**
|
|
1408
|
-
* Get a specific extension point definition
|
|
1409
|
-
*/
|
|
1410
|
-
getExtensionPoint(t) {
|
|
1411
|
-
return this.extensionPoints.get(t);
|
|
1412
|
-
}
|
|
1413
|
-
/**
|
|
1414
|
-
* Check if an extension point is registered
|
|
1415
|
-
*/
|
|
1416
|
-
hasExtensionPoint(t) {
|
|
1417
|
-
return this.extensionPoints.has(t);
|
|
1418
|
-
}
|
|
1419
|
-
}
|
|
1420
|
-
const qt = new Gt();
|
|
1421
|
-
var Wt = {}, Y = {};
|
|
1422
|
-
Object.defineProperty(Y, "__esModule", { value: !0 });
|
|
1423
|
-
Y.loadRemoteModule = Y.setRemoteDefinitions = Y.setRemoteUrlResolver = void 0;
|
|
1424
|
-
let pe, Re;
|
|
1425
|
-
const Te = /* @__PURE__ */ new Map(), Ee = /* @__PURE__ */ new Map();
|
|
1426
|
-
let je = !1;
|
|
1427
|
-
function Xt(e) {
|
|
1428
|
-
Re = e;
|
|
1429
|
-
}
|
|
1430
|
-
Y.setRemoteUrlResolver = Xt;
|
|
1431
|
-
function Zt(e) {
|
|
1432
|
-
pe = e;
|
|
1433
|
-
}
|
|
1434
|
-
Y.setRemoteDefinitions = Zt;
|
|
1435
|
-
async function Jt(e, t) {
|
|
1436
|
-
const s = `${e}:${t}`;
|
|
1437
|
-
if (Te.has(s))
|
|
1438
|
-
return Te.get(s);
|
|
1439
|
-
const o = (await (Ee.has(e) ? Ee.get(e) : await zt(e)).get(t))();
|
|
1440
|
-
return Te.set(s, o), o;
|
|
1441
|
-
}
|
|
1442
|
-
Y.loadRemoteModule = Jt;
|
|
1443
|
-
const Qt = (e, t) => new Promise((s, n) => {
|
|
1444
|
-
const r = document.createElement("script");
|
|
1445
|
-
r.src = e, r.type = "text/javascript", r.async = !0, r.onload = () => {
|
|
1446
|
-
s({
|
|
1447
|
-
get: (i) => window[t].get(i),
|
|
1448
|
-
init: (i) => {
|
|
1449
|
-
try {
|
|
1450
|
-
window[t].init(i);
|
|
1451
|
-
} catch (a) {
|
|
1452
|
-
console.error(`Failed to initialize remote ${t}`, a), n(a);
|
|
1453
|
-
}
|
|
1454
|
-
}
|
|
1455
|
-
});
|
|
1456
|
-
}, r.onerror = () => n(new Error(`Remote ${t} not found`)), document.head.appendChild(r);
|
|
1457
|
-
});
|
|
1458
|
-
async function zt(e) {
|
|
1459
|
-
if (!Re && !pe)
|
|
1460
|
-
throw new Error("Call setRemoteDefinitions or setRemoteUrlResolver to allow Dynamic Federation to find the remote apps correctly.");
|
|
1461
|
-
je || (je = !0, await __webpack_init_sharing__("default"));
|
|
1462
|
-
const t = pe ? pe[e] : await Re(e);
|
|
1463
|
-
let s = t;
|
|
1464
|
-
!t.endsWith(".mjs") && !t.endsWith(".js") && (s = `${t}${t.endsWith("/") ? "" : "/"}remoteEntry.js`);
|
|
1465
|
-
const n = await Qt(s, e);
|
|
1466
|
-
return await n.init(__webpack_share_scopes__.default), Ee.set(e, n), n;
|
|
1467
|
-
}
|
|
1468
|
-
(function(e) {
|
|
1469
|
-
Object.defineProperty(e, "__esModule", { value: !0 }), e.setRemoteUrlResolver = e.setRemoteDefinitions = e.loadRemoteModule = void 0;
|
|
1470
|
-
var t = Y;
|
|
1471
|
-
Object.defineProperty(e, "loadRemoteModule", { enumerable: !0, get: function() {
|
|
1472
|
-
return t.loadRemoteModule;
|
|
1473
|
-
} }), Object.defineProperty(e, "setRemoteDefinitions", { enumerable: !0, get: function() {
|
|
1474
|
-
return t.setRemoteDefinitions;
|
|
1475
|
-
} }), Object.defineProperty(e, "setRemoteUrlResolver", { enumerable: !0, get: function() {
|
|
1476
|
-
return t.setRemoteUrlResolver;
|
|
1477
|
-
} });
|
|
1478
|
-
})(Wt);
|
|
1479
|
-
function es(e, t, ...s) {
|
|
1480
|
-
return [e, t, ...s].filter(Boolean).join(".");
|
|
1481
|
-
}
|
|
1482
|
-
function ts(e = {}) {
|
|
1483
|
-
const {
|
|
1484
|
-
experienceIdProperty: t = "experienceId",
|
|
1485
|
-
flattenComponentProperties: s = !0,
|
|
1486
|
-
customTransform: n
|
|
1487
|
-
} = e;
|
|
1488
|
-
return (r, o) => {
|
|
1489
|
-
var p;
|
|
1490
|
-
const i = r[t], a = i ? ((p = o.experiences) == null ? void 0 : p[i]) || {} : {};
|
|
1491
|
-
let m = {
|
|
1492
|
-
...r,
|
|
1493
|
-
view: a
|
|
1494
|
-
};
|
|
1495
|
-
return s && a && (a.component && (m.component = a.component), a.location && (m.location = a.location)), n && (m = n(r, a, o) || m), m;
|
|
1496
|
-
};
|
|
1497
|
-
}
|
|
1498
|
-
function ss(e) {
|
|
1499
|
-
return qt.define(e);
|
|
1500
|
-
}
|
|
1501
|
-
const ht = G.object({
|
|
1502
|
-
id: G.string().min(1, "ID is required").describe("Unique identifier for this extension"),
|
|
1503
|
-
title: G.string().min(1, "Title is required").describe("Display title shown in the interface"),
|
|
1504
|
-
namespace: G.string().min(1, "Namespace is required").describe("Namespace for organizing related extensions"),
|
|
1505
|
-
experienceId: G.string().min(1, "Experience ID is required").describe("Reference to the UI component experience for rendering")
|
|
1506
|
-
}), rs = ht.extend({
|
|
1507
|
-
rank: G.number().int().min(0).optional().describe("Optional ranking for ordering (higher = preferred)")
|
|
1508
|
-
});
|
|
1509
|
-
function ns(e, t, s) {
|
|
1510
|
-
const n = e.safeParse(t);
|
|
1511
|
-
return n.success ? !0 : (n.error.errors.forEach((r) => {
|
|
1512
|
-
s.addError(`${r.path.join(".")}: ${r.message}`);
|
|
1513
|
-
}), !1);
|
|
1514
|
-
}
|
|
1515
|
-
function is(e, t = {}) {
|
|
1516
|
-
return (t.rankable ? rs : ht).extend(e);
|
|
1517
|
-
}
|
|
1518
|
-
const Fe = is(
|
|
1519
|
-
{
|
|
1520
|
-
type: G.literal("control.pour").describe("Type identifier for control pour extensions")
|
|
1521
|
-
},
|
|
1522
|
-
{ rankable: !1 }
|
|
1523
|
-
), bt = es("cui", "control", "pour"), Ws = ss({
|
|
1524
|
-
id: bt,
|
|
1525
|
-
contributionKey: "controlPour",
|
|
1526
|
-
displayName: "Control Pour",
|
|
1527
|
-
description: "Extension point for controlled pour plugin configurations with view support",
|
|
1528
|
-
hasView: !0,
|
|
1529
|
-
isRankable: !1,
|
|
1530
|
-
schema: Fe,
|
|
1531
|
-
metadata: {
|
|
1532
|
-
exportName: "ControlPourExtension",
|
|
1533
|
-
category: "Dispense",
|
|
1534
|
-
tags: ["pour", "control", "beverage"]
|
|
1535
|
-
},
|
|
1536
|
-
validate: (e, t) => {
|
|
1537
|
-
ns(Fe, e, t);
|
|
1538
|
-
},
|
|
1539
|
-
transform: ts()
|
|
1540
|
-
}), Xs = bt;
|
|
1541
|
-
export {
|
|
1542
|
-
Is as $,
|
|
1543
|
-
ks as A,
|
|
1544
|
-
Ns as B,
|
|
1545
|
-
Ot as C,
|
|
1546
|
-
Ht as D,
|
|
1547
|
-
Et as E,
|
|
1548
|
-
te as F,
|
|
1549
|
-
de as G,
|
|
1550
|
-
Ds as H,
|
|
1551
|
-
js as I,
|
|
1552
|
-
se as J,
|
|
1553
|
-
Ct as K,
|
|
1554
|
-
bs as L,
|
|
1555
|
-
Nt as M,
|
|
1556
|
-
Tt as N,
|
|
1557
|
-
Be as O,
|
|
1558
|
-
Gs as P,
|
|
1559
|
-
kt as Q,
|
|
1560
|
-
et as R,
|
|
1561
|
-
vs as S,
|
|
1562
|
-
tt as T,
|
|
1563
|
-
ws as U,
|
|
1564
|
-
st as V,
|
|
1565
|
-
gs as W,
|
|
1566
|
-
rt as X,
|
|
1567
|
-
Ps as Y,
|
|
1568
|
-
$s as Z,
|
|
1569
|
-
nt as _,
|
|
1570
|
-
Ss as a,
|
|
1571
|
-
Ze as a0,
|
|
1572
|
-
xs as a1,
|
|
1573
|
-
At as a2,
|
|
1574
|
-
Ts as a3,
|
|
1575
|
-
Kt as a4,
|
|
1576
|
-
ze as a5,
|
|
1577
|
-
Rs as a6,
|
|
1578
|
-
Es as a7,
|
|
1579
|
-
ys as a8,
|
|
1580
|
-
Mt as a9,
|
|
1581
|
-
As as aa,
|
|
1582
|
-
Qe as ab,
|
|
1583
|
-
Ws as ac,
|
|
1584
|
-
Xs as ad,
|
|
1585
|
-
_s as b,
|
|
1586
|
-
Ks as c,
|
|
1587
|
-
Ms as d,
|
|
1588
|
-
Hs as e,
|
|
1589
|
-
Ut as f,
|
|
1590
|
-
Lt as g,
|
|
1591
|
-
Os as h,
|
|
1592
|
-
Ls as i,
|
|
1593
|
-
Bs as j,
|
|
1594
|
-
Us as k,
|
|
1595
|
-
Fs as l,
|
|
1596
|
-
Ys as m,
|
|
1597
|
-
Vs as n,
|
|
1598
|
-
B as o,
|
|
1599
|
-
qs as p,
|
|
1600
|
-
Ge as q,
|
|
1601
|
-
qe as r,
|
|
1602
|
-
ms as s,
|
|
1603
|
-
We as t,
|
|
1604
|
-
Cs as u,
|
|
1605
|
-
fs as v,
|
|
1606
|
-
ps as w,
|
|
1607
|
-
Xe as x,
|
|
1608
|
-
hs as y,
|
|
1609
|
-
Rt as z
|
|
1610
|
-
};
|
|
1611
|
-
//# sourceMappingURL=control-pour-extension-DLJOCOIC.js.map
|