@kosdev-code/kos-freestyle-sdk 0.1.0-dev.5092 → 0.1.0-dev.5096

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/extension-utils-BUUtrM-T.cjs +2 -0
  2. package/{extension-utils-z9pjqLGA.cjs.map → extension-utils-BUUtrM-T.cjs.map} +1 -1
  3. package/extension-utils-sj0P_x9E.js +220 -0
  4. package/{extension-utils-m2DUoUsn.js.map → extension-utils-sj0P_x9E.js.map} +1 -1
  5. package/freestyle-registration-manager-DSugLmqT.js +1739 -0
  6. package/freestyle-registration-manager-DSugLmqT.js.map +1 -0
  7. package/freestyle-registration-manager-rmrOsUZq.cjs +2 -0
  8. package/freestyle-registration-manager-rmrOsUZq.cjs.map +1 -0
  9. package/index.cjs +1 -1
  10. package/index.js +34 -27
  11. package/models/models/cgp-pump/cgp-pump-model.d.ts +24 -0
  12. package/models/models/cgp-pump/cgp-pump-model.d.ts.map +1 -0
  13. package/models/models/cgp-pump/index.d.ts +4 -0
  14. package/models/models/cgp-pump/index.d.ts.map +1 -0
  15. package/models/models/cgp-pump/types/index.d.ts +5 -0
  16. package/models/models/fcm-pump/fcm-pump-model.d.ts +28 -0
  17. package/models/models/fcm-pump/fcm-pump-model.d.ts.map +1 -0
  18. package/models/models/fcm-pump/fcm-pump-registration.d.ts +87 -0
  19. package/models/models/fcm-pump/fcm-pump-registration.d.ts.map +1 -0
  20. package/models/models/fcm-pump/index.d.ts +5 -0
  21. package/models/models/fcm-pump/index.d.ts.map +1 -0
  22. package/models/models/fcm-pump/services/fcm-pump-services.d.ts +17 -0
  23. package/models/models/fcm-pump/services/fcm-pump-services.d.ts.map +1 -0
  24. package/models/models/fcm-pump/services/index.d.ts +2 -0
  25. package/models/models/fcm-pump/services/index.d.ts.map +1 -0
  26. package/models/models/fcm-pump/types/index.d.ts +5 -0
  27. package/models/models/index.d.ts +4 -0
  28. package/models/models/index.d.ts.map +1 -1
  29. package/models/models/lfcv-pump/index.d.ts +5 -0
  30. package/models/models/lfcv-pump/index.d.ts.map +1 -0
  31. package/models/models/lfcv-pump/lfcv-pump-model.d.ts +20 -0
  32. package/models/models/lfcv-pump/lfcv-pump-model.d.ts.map +1 -0
  33. package/models/models/lfcv-pump/lfcv-pump-registration.d.ts +87 -0
  34. package/models/models/lfcv-pump/lfcv-pump-registration.d.ts.map +1 -0
  35. package/models/models/lfcv-pump/services/index.d.ts +2 -0
  36. package/models/models/lfcv-pump/services/index.d.ts.map +1 -0
  37. package/models/models/lfcv-pump/services/lfcv-pump-services.d.ts +10 -0
  38. package/models/models/lfcv-pump/services/lfcv-pump-services.d.ts.map +1 -0
  39. package/models/models/lfcv-pump/types/index.d.ts +5 -0
  40. package/models/models/spm-pump/index.d.ts +5 -0
  41. package/models/models/spm-pump/index.d.ts.map +1 -0
  42. package/models/models/spm-pump/services/index.d.ts +2 -0
  43. package/models/models/spm-pump/services/index.d.ts.map +1 -0
  44. package/models/models/spm-pump/services/spm-pump-services.d.ts +7 -0
  45. package/models/models/spm-pump/services/spm-pump-services.d.ts.map +1 -0
  46. package/models/models/spm-pump/spm-pump-model.d.ts +26 -0
  47. package/models/models/spm-pump/spm-pump-model.d.ts.map +1 -0
  48. package/models/models/spm-pump/spm-pump-registration.d.ts +87 -0
  49. package/models/models/spm-pump/spm-pump-registration.d.ts.map +1 -0
  50. package/models/models/spm-pump/types/index.d.ts +5 -0
  51. package/models/utils/freestyle-registration-manager.d.ts.map +1 -1
  52. package/models.cjs +1 -1
  53. package/models.js +27 -20
  54. package/package.json +4 -4
  55. package/ui.cjs +1 -1
  56. package/ui.js +2 -2
  57. package/{use-nutrition-info-BfMITXJ8.cjs → use-nutrition-info-DSdA_SRp.cjs} +2 -2
  58. package/{use-nutrition-info-BfMITXJ8.cjs.map → use-nutrition-info-DSdA_SRp.cjs.map} +1 -1
  59. package/{use-nutrition-info-BFA7IT1r.js → use-nutrition-info-DtcZs7dL.js} +5 -5
  60. package/{use-nutrition-info-BFA7IT1r.js.map → use-nutrition-info-DtcZs7dL.js.map} +1 -1
  61. package/extension-utils-m2DUoUsn.js +0 -201
  62. package/extension-utils-z9pjqLGA.cjs +0 -2
  63. package/freestyle-registration-manager-CymJYnwk.js +0 -1260
  64. package/freestyle-registration-manager-CymJYnwk.js.map +0 -1
  65. package/freestyle-registration-manager-Dt77hR6f.cjs +0 -2
  66. package/freestyle-registration-manager-Dt77hR6f.cjs.map +0 -1
@@ -1,1260 +0,0 @@
1
- var ke = Object.defineProperty;
2
- var xe = (e, t, r) => t in e ? ke(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
- var o = (e, t, r) => (xe(e, typeof t != "symbol" ? t + "" : t, r), r);
4
- import { resolveServiceUrl as M, ServiceFactory as D, KosLog as C, createPropKey as R, kosStateProp as O, kosConfigProperty as y, kosStateEntry as ee, kosStateExit as He, kosStateGuard as te, kosFuture as N, kosModel as b, kosLoggerAware as re, kosCompanion as Ve, kosFutureAware as pe, kosStateMachine as Ye, DependencyLifecycle as ye, KosModelContainer as qe, kosChild as fe, kosModelEffect as ae, EventBus as F, KosModelRegistrationFactory as _, SingletonKosModelRegistrationFactory as oe, kosParentAware as me, KosFeatureFlags as V, getKosCompanionModel as Ze, getKosModelSync as v, kosContainerAware as We, KosContextManager as Qe, FutureManager as Xe, kosAction as L, FetchError as Je, KOS_MODEL_ID as I, kosMultipleFutureAware as et, kosTopicHandler as tt, modelTypeEventTopicFactory as rt, RegistrationManager as p, registerCoreModels as at, Trouble as ot, ExtensionManager as Y, EXTENSION_TROUBLE_DATA_MAPPER as q } from "@kosdev-code/kos-ui-sdk";
5
- import { PourState as c, Assembly as be, KosModelRegistry as it, registerDispenseModels as st, Nozzle as nt, Pump as lt, Holder as dt, PumpContainer as ct, PumpIndex as ut } from "@kosdev-code/kos-dispense-sdk";
6
- const { URL: Ie } = M("ICE_AGITATOR_SERVICE"), { postModel: gt } = D.build({
7
- basePath: `${Ie}/api/ext/freestyle/ice`
8
- });
9
- C.createLogger({
10
- name: "carb-tank-service",
11
- group: "Services"
12
- });
13
- const ht = async (e, t) => {
14
- const r = await gt({
15
- model: {},
16
- tracker: t,
17
- urlOverride: `${Ie}/api/handle/${e}/test`
18
- });
19
- if (!(r != null && r.data))
20
- throw new Error("No response from server");
21
- return r == null ? void 0 : r.data;
22
- };
23
- var Pe = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, yt = (e, t, r) => t in e ? Pe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, f = (e, t, r, i) => {
24
- for (var a = i > 1 ? void 0 : i ? pt(t, r) : t, s = e.length - 1, n; s >= 0; s--)
25
- (n = e[s]) && (a = (i ? n(t, r, a) : n(a)) || a);
26
- return i && a && Pe(t, r, a), a;
27
- }, ft = (e, t, r) => (yt(e, t + "", r), r);
28
- const mt = "carb-agitator-model", ie = R("statePath");
29
- let g = class {
30
- constructor(e, t, r) {
31
- o(this, "id");
32
- o(this, "name");
33
- o(this, "path");
34
- o(this, "statePath");
35
- o(this, "highProbeWet");
36
- o(this, "lowProbeWet");
37
- o(this, "filling");
38
- o(this, "enabled");
39
- var a;
40
- this.id = e, this.name = t.name, this.path = ((a = r.kosContext.get("assembly-feature-carbTank")) == null ? void 0 : a.path) || "";
41
- const i = r.kosContext.get("assembly-state-path-carbTank");
42
- this.statePath = i;
43
- }
44
- get holder() {
45
- var t;
46
- return (t = this.getCompanionParent()) == null ? void 0 : t.getHoldersByGroup("carb")[0];
47
- }
48
- get pump() {
49
- var e;
50
- return (e = this.holder) == null ? void 0 : e.pumps.data[0];
51
- }
52
- get isFilling() {
53
- return !!this.filling.value;
54
- }
55
- get isCarbInitialized() {
56
- return !!this.enabled.value;
57
- }
58
- get canActivate() {
59
- return !this.enabled.value;
60
- }
61
- get canProceed() {
62
- return this.isInState(
63
- "INITIALIZED"
64
- /* INITIALIZED */
65
- ) || this.isInState(
66
- "SKIPPED"
67
- /* SKIPPED */
68
- );
69
- }
70
- handleActivationStart() {
71
- this.logger.info("Carb tank activation started");
72
- }
73
- handleActivationComplete() {
74
- this.logger.info("Carb tank initialized");
75
- }
76
- handleInitialized() {
77
- this.logger.info("Carb tank ready to proceed");
78
- }
79
- handleSkipped() {
80
- this.logger.info("Proceeding without carbinator");
81
- }
82
- async activateCarbTank() {
83
- this.transition("ACTIVATE"), this.enabled.updateProperty(!0), this.transition("ACTIVATION_COMPLETE");
84
- }
85
- async deactivateCarbTank() {
86
- this.enabled.updateProperty(!1), this.transition("RESET");
87
- }
88
- skip() {
89
- this.transition("SKIP");
90
- }
91
- reset() {
92
- this.enabled.updateProperty(!1), this.transition("RESET");
93
- }
94
- toggleCarbTank() {
95
- this.enabled.value ? this.deactivateCarbTank() : this.activateCarbTank();
96
- }
97
- handleTestCarbTank(e) {
98
- if (!e)
99
- throw new Error("No tracker provided");
100
- return this.logger.info(`testing carb tank: ${this.id}`), ht(this.path, e);
101
- }
102
- };
103
- ft(g, "Registration");
104
- f([
105
- O({
106
- path: ie,
107
- attribute: "highProbeWet"
108
- })
109
- ], g.prototype, "highProbeWet", 2);
110
- f([
111
- O({
112
- path: ie,
113
- attribute: "lowProbeWet"
114
- })
115
- ], g.prototype, "lowProbeWet", 2);
116
- f([
117
- O({
118
- path: ie,
119
- attribute: "filling"
120
- })
121
- ], g.prototype, "filling", 2);
122
- f([
123
- y({
124
- path: "assembly:core:board:macksm:carbTank:carbTank",
125
- attribute: "enabled"
126
- })
127
- ], g.prototype, "enabled", 2);
128
- f([
129
- ee(
130
- "ACTIVATING"
131
- /* ACTIVATING */
132
- )
133
- ], g.prototype, "handleActivationStart", 1);
134
- f([
135
- He(
136
- "ACTIVATING"
137
- /* ACTIVATING */
138
- )
139
- ], g.prototype, "handleActivationComplete", 1);
140
- f([
141
- ee(
142
- "INITIALIZED"
143
- /* INITIALIZED */
144
- )
145
- ], g.prototype, "handleInitialized", 1);
146
- f([
147
- ee(
148
- "SKIPPED"
149
- /* SKIPPED */
150
- )
151
- ], g.prototype, "handleSkipped", 1);
152
- f([
153
- te({ allowedStates: [
154
- "UNINITIALIZED"
155
- /* UNINITIALIZED */
156
- ] })
157
- ], g.prototype, "activateCarbTank", 1);
158
- f([
159
- te({ allowedStates: [
160
- "UNINITIALIZED"
161
- /* UNINITIALIZED */
162
- ] })
163
- ], g.prototype, "skip", 1);
164
- f([
165
- te({
166
- allowedStates: [
167
- "INITIALIZED",
168
- "SKIPPED"
169
- /* SKIPPED */
170
- ]
171
- })
172
- ], g.prototype, "reset", 1);
173
- f([
174
- N()
175
- ], g.prototype, "handleTestCarbTank", 1);
176
- g = f([
177
- b({ modelTypeId: mt, singleton: !1 }),
178
- re(),
179
- Ve({ mode: "composition", lifecycle: ye.LOAD }),
180
- pe(),
181
- Ye(
182
- {
183
- initial: "UNINITIALIZED",
184
- states: {
185
- UNINITIALIZED: {
186
- on: {
187
- ACTIVATE: "ACTIVATING",
188
- SKIP: "SKIPPED"
189
- /* SKIPPED */
190
- }
191
- },
192
- ACTIVATING: {
193
- on: {
194
- ACTIVATION_COMPLETE: "INITIALIZED"
195
- /* INITIALIZED */
196
- }
197
- },
198
- INITIALIZED: {
199
- on: {
200
- RESET: "UNINITIALIZED"
201
- /* UNINITIALIZED */
202
- }
203
- },
204
- SKIPPED: {
205
- on: {
206
- RESET: "UNINITIALIZED"
207
- /* UNINITIALIZED */
208
- }
209
- }
210
- }
211
- },
212
- {
213
- throwOnInvalid: !1
214
- // Graceful handling for button clicks
215
- }
216
- )
217
- ], g);
218
- const Te = g.Registration;
219
- var bt = Object.defineProperty, It = Object.getOwnPropertyDescriptor, ve = (e, t, r, i) => {
220
- for (var a = i > 1 ? void 0 : i ? It(t, r) : t, s = e.length - 1, n; s >= 0; s--)
221
- (n = e[s]) && (a = (i ? n(t, r, a) : n(a)) || a);
222
- return i && a && bt(t, r, a), a;
223
- };
224
- const _e = "cartridge-agitator-container-model";
225
- let G = class {
226
- constructor(e, t, r) {
227
- o(this, "id");
228
- o(this, "logger");
229
- o(this, "_models");
230
- this.id = e, this.logger = r.logger, this._models = new qe({
231
- parentId: e
232
- });
233
- }
234
- getModel(e) {
235
- return this._models.getModel(e);
236
- }
237
- get models() {
238
- return this._models;
239
- }
240
- get data() {
241
- return this._models.data;
242
- }
243
- addModel(e) {
244
- this._models.addModel(e);
245
- }
246
- removeModel(e) {
247
- this._models.removeModel(e);
248
- }
249
- // -------------------LIFECYCLE----------------------------
250
- async init() {
251
- this.logger.debug(
252
- `initializing cartridge-agitator-container container ${this.id}`
253
- );
254
- }
255
- async load() {
256
- this.logger.debug(
257
- `loading cartridge-agitator-container container ${this.id}`
258
- );
259
- }
260
- };
261
- ve([
262
- fe
263
- ], G.prototype, "_models", 2);
264
- G = ve([
265
- b(_e)
266
- ], G);
267
- const { URL: Ee } = M("CARTRIDGE_AGITATOR_SERVICE"), { postModel: Pt } = D.build({
268
- basePath: `${Ee}/api/ext/freestyle/freestyle/ice`
269
- }), Tt = async (e, t) => {
270
- const r = await Pt({
271
- model: {},
272
- tracker: t,
273
- urlOverride: `${Ee}/api/handle/${e}/test`
274
- });
275
- if (!(r != null && r.data))
276
- throw new Error("No response from server");
277
- return r.data;
278
- };
279
- var vt = Object.defineProperty, _t = Object.getOwnPropertyDescriptor, x = (e, t, r, i) => {
280
- for (var a = i > 1 ? void 0 : i ? _t(t, r) : t, s = e.length - 1, n; s >= 0; s--)
281
- (n = e[s]) && (a = (i ? n(t, r, a) : n(a)) || a);
282
- return i && a && vt(t, r, a), a;
283
- };
284
- const Ae = "cartridge-agitator-model";
285
- class U {
286
- }
287
- o(U, "TOPIC_AGITATION_STARTED", "/kos/events/ddk/agitation-started"), o(U, "TOPIC_AGITATION_ENDED", "/kos/events/ddk/agitation-ended");
288
- const Et = R("statePath");
289
- let A = class {
290
- constructor(e, t) {
291
- o(this, "id");
292
- o(this, "agitating");
293
- o(this, "path");
294
- o(this, "statePath");
295
- o(this, "name");
296
- this.id = e, this.path = t.path, this.name = t.name, this.statePath = t.statePath;
297
- }
298
- get isAgitating() {
299
- return !!this.agitating.value;
300
- }
301
- async testAgitate(e) {
302
- if (!e)
303
- throw new Error("No tracker provided");
304
- return this.logger.info(`agitating cartridge-agitator ${this.id}`), Tt(this.path, e);
305
- }
306
- handleAgitation() {
307
- var e;
308
- this.isAgitating ? (this.logger.info(`agitating cartridge-agitator ${this.id}`), F.publish(U.TOPIC_AGITATION_STARTED, {
309
- path: this.path,
310
- futureId: (e = this.future) == null ? void 0 : e.futureId
311
- })) : F.publish(U.TOPIC_AGITATION_ENDED, {
312
- path: this.path
313
- });
314
- }
315
- };
316
- x([
317
- O({ path: Et, attribute: "agitating" })
318
- ], A.prototype, "agitating", 2);
319
- x([
320
- N()
321
- ], A.prototype, "testAgitate", 1);
322
- x([
323
- ae({
324
- dependencies: (e) => [e.isAgitating]
325
- })
326
- ], A.prototype, "handleAgitation", 1);
327
- A = x([
328
- b(Ae),
329
- pe(),
330
- re()
331
- ], A);
332
- const Ce = new _({
333
- class: A,
334
- type: Ae
335
- }), se = new oe({
336
- class: G,
337
- type: _e
338
- });
339
- se.addRelatedModel(Ce);
340
- var At = Object.defineProperty, Ct = Object.getOwnPropertyDescriptor, Oe = (e, t, r, i) => {
341
- for (var a = i > 1 ? void 0 : i ? Ct(t, r) : t, s = e.length - 1, n; s >= 0; s--)
342
- (n = e[s]) && (a = (i ? n(t, r, a) : n(a)) || a);
343
- return i && a && At(t, r, a), a;
344
- };
345
- const $e = "freestyle-assembly-model", Ot = "iceAgitator", $t = "carbTank", wt = "remoteTrays";
346
- let j = class {
347
- constructor(e, t, r) {
348
- o(this, "id");
349
- o(this, "_carbTankModel");
350
- o(this, "logger");
351
- o(this, "assembly");
352
- o(this, "_remoteTrays");
353
- this.id = e, this.logger = r.logger, this.assembly = t.companionParent;
354
- }
355
- get holderGroups() {
356
- return this.assembly.holderGroups;
357
- }
358
- get nozzlePaths() {
359
- return this.assembly.nozzlePaths;
360
- }
361
- get allHolders() {
362
- return this.assembly.allHolders;
363
- }
364
- getHoldersByGroup(e) {
365
- return this.assembly.getHoldersByGroup(e);
366
- }
367
- getHoldersByNozzle(e) {
368
- return this.assembly.getHoldersByNozzle(e);
369
- }
370
- get pumpsByNozzle() {
371
- return this.assembly.pumpsByNozzle;
372
- }
373
- get pumpPaths() {
374
- return this.assembly.pumpPaths;
375
- }
376
- get boards() {
377
- return this.assembly.boards;
378
- }
379
- updateModel(e) {
380
- return this.assembly.updateModel(e);
381
- }
382
- get iceAgitator() {
383
- return this.assembly.iceAgitator;
384
- }
385
- get carbTank() {
386
- return this._carbTankModel;
387
- }
388
- get cartridgeAgitators() {
389
- return this.assembly.cartridgeAgitators;
390
- }
391
- get defaultCartridgeAgitator() {
392
- return this.assembly.cartridgeAgitators.data[0];
393
- }
394
- get cartridgeAgitatorModels() {
395
- return this.assembly.cartridgeAgitators.data;
396
- }
397
- get hasCartridgeAgitators() {
398
- return this.assembly.cartridgeAgitators.data.length > 0;
399
- }
400
- get remoteTrays() {
401
- return this.assembly.remoteTrays;
402
- }
403
- get hasRemoteTrays() {
404
- return this.assembly.remoteTrays ? this.assembly.remoteTrays.data.length > 0 : !1;
405
- }
406
- // -------------------LIFECYCLE----------------------------
407
- get supportsRemoteTrays() {
408
- return V.isFeatureEnabled(wt);
409
- }
410
- get supportsIce() {
411
- return V.isFeatureEnabled(Ot);
412
- }
413
- get supportsCarb() {
414
- return V.isFeatureEnabled($t);
415
- }
416
- async init() {
417
- this.logger.debug(`initializing freestyle-assembly ${this.id}`);
418
- }
419
- async ready() {
420
- const e = Ze(
421
- this.assembly,
422
- Te.type
423
- );
424
- this._carbTankModel = e;
425
- }
426
- };
427
- Oe([
428
- fe
429
- ], j.prototype, "_remoteTrays", 2);
430
- j = Oe([
431
- me(),
432
- b($e)
433
- ], j);
434
- const W = new oe({
435
- class: j,
436
- type: $e
437
- });
438
- var St = Object.defineProperty, Mt = Object.getOwnPropertyDescriptor, we = (e, t, r, i) => {
439
- for (var a = i > 1 ? void 0 : i ? Mt(t, r) : t, s = e.length - 1, n; s >= 0; s--)
440
- (n = e[s]) && (a = (i ? n(t, r, a) : n(a)) || a);
441
- return i && a && St(t, r, a), a;
442
- };
443
- const Se = "remote-tray-model";
444
- R("holderPath");
445
- const Dt = R("configPath");
446
- let B = class {
447
- constructor(e, t, r) {
448
- /** Unique identifier for the remote tray instance */
449
- o(this, "id");
450
- o(this, "logger");
451
- /** Path reference to the associated holder model */
452
- o(this, "holderPath");
453
- /** Configuration path for tray-specific settings */
454
- o(this, "configPath");
455
- /** Display name of the remote tray */
456
- o(this, "name");
457
- o(this, "remoteTrayEnabled");
458
- this.id = e, this.logger = r.logger, this.holderPath = t.holderPath, this.configPath = t.configPath, this.name = t.name;
459
- }
460
- /**
461
- * Gets the troubles from the associated holder model.
462
- * Propagates trouble states from the holder to this remote tray.
463
- *
464
- * @returns Array of trouble models from the holder, or empty array if no holder
465
- */
466
- get troubles() {
467
- var e;
468
- return ((e = this.holder) == null ? void 0 : e.troubles) ?? [];
469
- }
470
- /**
471
- * Gets the highest priority trouble status.
472
- * Currently returns empty string as troubles are managed by the holder.
473
- *
474
- * @returns Empty string (trouble status handled by holder)
475
- */
476
- get troubleStatus() {
477
- return "";
478
- }
479
- /**
480
- * Gets troubles grouped by type from the associated holder.
481
- *
482
- * @returns Record of troubles grouped by type from the holder, or empty object if no holder
483
- */
484
- get troublesByType() {
485
- var e;
486
- return ((e = this.holder) == null ? void 0 : e.troublesByType) ?? {};
487
- }
488
- /**
489
- * Updates the model with new configuration options.
490
- * Can be used to modify the holder path, config path, or name after initialization.
491
- *
492
- * @param _options - New configuration options for the remote tray
493
- */
494
- updateModel(e) {
495
- }
496
- /**
497
- * Gets the associated holder model for this remote tray.
498
- * Uses synchronous model lookup to retrieve the holder by path.
499
- *
500
- * @returns The HolderModel instance referenced by holderPath, or undefined if not found
501
- */
502
- get holder() {
503
- return v(this.holderPath).model;
504
- }
505
- /**
506
- * Determines if the remote tray is currently active.
507
- * Active state is based on the remoteTrayEnabled configuration property.
508
- *
509
- * @returns true if the tray is enabled, false otherwise
510
- */
511
- get active() {
512
- return !!this.remoteTrayEnabled.value;
513
- }
514
- // -------------------LIFECYCLE----------------------------
515
- /**
516
- * Initializes the remote tray model.
517
- * Called during the model lifecycle initialization phase.
518
- * Sets up initial state and prepares the model for use.
519
- *
520
- * @returns Promise that resolves when initialization is complete
521
- */
522
- async init() {
523
- this.logger.debug(`initializing remote-tray ${this.id}`);
524
- }
525
- /**
526
- * Loads the remote tray configuration and associated data.
527
- * Called during the model lifecycle load phase.
528
- * Typically loads configuration settings and establishes holder references.
529
- *
530
- * @returns Promise that resolves when loading is complete
531
- */
532
- async load() {
533
- this.logger.debug(`loading remote-tray ${this.id}`);
534
- }
535
- };
536
- we([
537
- y({
538
- path: Dt,
539
- attribute: "enabled"
540
- })
541
- ], B.prototype, "remoteTrayEnabled", 2);
542
- B = we([
543
- b(Se)
544
- ], B);
545
- const w = new _({
546
- class: B,
547
- type: Se
548
- });
549
- var Rt = Object.getOwnPropertyDescriptor, Nt = (e, t, r, i) => {
550
- for (var a = i > 1 ? void 0 : i ? Rt(t, r) : t, s = e.length - 1, n; s >= 0; s--)
551
- (n = e[s]) && (a = n(a) || a);
552
- return a;
553
- };
554
- const Me = "remote-tray-container-model";
555
- let Q = class {
556
- constructor(e) {
557
- o(this, "id");
558
- this.id = e;
559
- }
560
- };
561
- Q = Nt([
562
- b(Me),
563
- re(),
564
- We()
565
- ], Q);
566
- const ne = new oe({
567
- class: Q,
568
- type: Me
569
- });
570
- ne.addRelatedModel(w);
571
- var zt = Object.getOwnPropertyDescriptor, Lt = (e, t, r, i) => {
572
- for (var a = i > 1 ? void 0 : i ? zt(t, r) : t, s = e.length - 1, n; s >= 0; s--)
573
- (n = e[s]) && (a = n(a) || a);
574
- return a;
575
- };
576
- const De = "freestyle-holder-model";
577
- function Ft(e) {
578
- const t = Qe.getContext(e), r = t == null ? void 0 : t.get(
579
- W.type
580
- );
581
- if (!r) {
582
- C.error("Freestyle assembly not found");
583
- return;
584
- }
585
- return r;
586
- }
587
- async function Gt(e, t) {
588
- if (!e || !t)
589
- return;
590
- const r = await e[t]();
591
- if (r != null && r.tracker)
592
- return Xe.getFuture(r.tracker);
593
- }
594
- let X = class {
595
- constructor(e, t, r) {
596
- o(this, "id");
597
- o(this, "logger");
598
- o(this, "holder");
599
- o(this, "context");
600
- o(this, "future");
601
- this.id = e, this.logger = r.logger, this.context = r.kosContext, this.holder = t.companionParent;
602
- }
603
- get agitated() {
604
- return this.holder.data.agitated;
605
- }
606
- async agitate() {
607
- if (!this.holder.data.agitated)
608
- return;
609
- this.future = void 0;
610
- const e = Ft(this.id);
611
- if (!e)
612
- return;
613
- if (!e.defaultCartridgeAgitator) {
614
- this.logger.error("Agitator not found");
615
- return;
616
- }
617
- return this.future = await Gt(
618
- e.defaultCartridgeAgitator,
619
- "testAgitate"
620
- ), this.future;
621
- }
622
- get isRemote() {
623
- const e = `${w.type}-${this.holder.path}`, t = v(e);
624
- return t != null && t.model ? !!t.model.remoteTrayEnabled.value : !1;
625
- }
626
- // -------------------LIFECYCLE----------------------------
627
- async init() {
628
- this.logger.debug(`initializing freestyle-holder ${this.id}`);
629
- }
630
- async load() {
631
- this.logger.debug(`loading freestyle-holder ${this.id}`);
632
- }
633
- };
634
- X = Lt([
635
- b(De)
636
- ], X);
637
- const ce = new _({
638
- class: X,
639
- type: De
640
- }), { URL: Ut } = M("FREESTYLE-NOZZLE_SERVICE"), { getOne: jt } = D.build({
641
- basePath: `${Ut}/api/freestyle-nozzle`
642
- }), z = C.createLogger({
643
- name: "freestyle-nozzle-service",
644
- group: "Services"
645
- });
646
- class Bt extends Error {
647
- constructor(t) {
648
- super(t), this.name = "NutritionInfoError";
649
- }
650
- }
651
- class ue extends Error {
652
- constructor(t) {
653
- super(t), this.name = "InvalidRequestError";
654
- }
655
- }
656
- const Kt = async (e, t, r, i = "http://localhost:8081") => {
657
- if (z.debug("sending GET for freestyle-nozzle"), !t)
658
- throw z.error("Invalid freestyle-nozzle request: beverageId is required"), new ue("No beverageId provided");
659
- if (!r || r.length === 0)
660
- throw z.error("Invalid freestyle-nozzle request: volumes are required"), new ue("No volumes provided");
661
- const a = await jt({
662
- urlOverride: `${i}${e}/pipeline/beverage/engine/nutrition/${t}?volumes=${r.join(
663
- ","
664
- )}`
665
- });
666
- if (!(a != null && a.data))
667
- throw z.error("Failed to retrieve freestyle-nozzle data"), new Error("Failed to retrieve freestyle-nozzle data");
668
- if (a.data.error)
669
- throw new Bt(a.data.error);
670
- return a.data;
671
- };
672
- var kt = Object.defineProperty, xt = Object.getOwnPropertyDescriptor, Re = (e, t, r, i) => {
673
- for (var a = i > 1 ? void 0 : i ? xt(t, r) : t, s = e.length - 1, n; s >= 0; s--)
674
- (n = e[s]) && (a = (i ? n(t, r, a) : n(a)) || a);
675
- return i && a && kt(t, r, a), a;
676
- };
677
- const Ne = "freestyle-nozzle-model";
678
- let K = class {
679
- constructor(e, t, r) {
680
- o(this, "id");
681
- o(this, "logger");
682
- o(this, "nozzleModel");
683
- o(this, "_cupSizes");
684
- o(this, "_nutritionInfo");
685
- this.id = e, this.logger = r.logger, this.nozzleModel = t.companionParent, this._cupSizes = [100];
686
- }
687
- set cupSizes(e) {
688
- this._cupSizes = e;
689
- }
690
- get nutritionInfo() {
691
- return this._nutritionInfo;
692
- }
693
- get selectedPourable() {
694
- return this.nozzleModel.selectedPourable;
695
- }
696
- async handleBeverageSelection() {
697
- if (this.nozzleModel.selectedPourable.beverage && this._cupSizes.length) {
698
- this.logger.debug(
699
- `selected beverage: ${this.nozzleModel.selectedPourable.beverage.rawId}. Volume: ${this._cupSizes.join(", ")}`
700
- );
701
- const e = this.nozzleModel.selectedPourable.beverage.rawId, t = this.nozzleModel.urlPrefix;
702
- try {
703
- const r = await Kt(
704
- t,
705
- e,
706
- this._cupSizes
707
- );
708
- L(() => {
709
- this._nutritionInfo = r;
710
- });
711
- } catch (r) {
712
- this.logger.error(`Error fetching nutrition info: ${r}`);
713
- }
714
- }
715
- }
716
- // -------------------LIFECYCLE----------------------------
717
- async init() {
718
- this.logger.debug(`initializing freestyle-nozzle ${this.id}`);
719
- }
720
- unload() {
721
- this.logger.debug(`unloading freestyle-nozzle ${this.id}`);
722
- }
723
- async load() {
724
- this.logger.debug(`loading freestyle-nozzle ${this.id}`);
725
- }
726
- };
727
- Re([
728
- ae({
729
- dependencies: (e) => [
730
- e.selectedPourable.beverage
731
- ]
732
- })
733
- ], K.prototype, "handleBeverageSelection", 1);
734
- K = Re([
735
- me(),
736
- b(Ne)
737
- ], K);
738
- const ge = new _({
739
- class: K,
740
- type: Ne
741
- }), { URL: ze } = M("PUMP_SERVICE"), { postModel: Ht } = D.build({
742
- basePath: `${ze}/api/ext/freestyle/microCalibration`
743
- }), Z = C.createLogger({
744
- name: "freestyle-pump-service",
745
- group: "Services"
746
- }), Vt = async (e, t) => {
747
- var r, i, a, s, n;
748
- Z.debug(
749
- `replacePump - sending POST request to /api/ext/freestyle/microCalibration/cal/${e}/code/${t}`
750
- );
751
- try {
752
- const l = await Ht({
753
- model: {},
754
- urlOverride: `${ze}/api/ext/freestyle/microCalibration/cal/${e}/code/${t}`
755
- });
756
- return Z.debug("replacePump - response:", l), ((l == null ? void 0 : l.status) === 200 || (l == null ? void 0 : l.status) === 499) && ((r = l.data) != null && r.error) ? [l.data.error || "unknownError", l.data] : [void 0, l == null ? void 0 : l.data];
757
- } catch (l) {
758
- if (Z.error(
759
- `replacePump - sending POST request to /api/cal/${e}/code/${t}`,
760
- l
761
- ), l instanceof Je) {
762
- const $ = ((a = (i = l.payload) == null ? void 0 : i.data) == null ? void 0 : a.error) || ((s = l.payload) == null ? void 0 : s.error) || "unknownError";
763
- return [$, ((n = l.payload) == null ? void 0 : n.data) || { error: $ }];
764
- }
765
- }
766
- return ["unknownError", { error: "unknownError" }];
767
- };
768
- var Yt = Object.getOwnPropertyDescriptor, qt = (e, t, r, i) => {
769
- for (var a = i > 1 ? void 0 : i ? Yt(t, r) : t, s = e.length - 1, n; s >= 0; s--)
770
- (n = e[s]) && (a = n(a) || a);
771
- return a;
772
- };
773
- const Le = "freestyle-pump-model";
774
- let J = class {
775
- constructor(e, t, r) {
776
- o(this, "id");
777
- o(this, "logger");
778
- o(this, "pump");
779
- this.id = e, this.logger = r.logger, this.pump = t.companionParent;
780
- }
781
- // -------------------LIFECYCLE----------------------------
782
- async replacePump(e) {
783
- const [t, r] = await Vt(this.pump.path, e);
784
- return t && this.logger.error(`Failed to replace the pump, ${this.pump.id}`, t), [t, r];
785
- }
786
- };
787
- J = qt([
788
- b(Le)
789
- ], J);
790
- const he = new _({
791
- class: J,
792
- type: Le
793
- }), { URL: E } = M("ICE_AGITATOR_SERVICE"), { getAll: Fe, postModel: H } = D.build({
794
- basePath: `${E}/api/ext/freestyle/ice`
795
- }), Ge = C.createLogger({
796
- name: "ice-agitator-service",
797
- group: "Services"
798
- }), Zt = async (e) => (Ge.debug("sending GET for ice types"), await Fe({
799
- urlOverride: `${E}/api/handle/${e}/types`
800
- })), Wt = async (e, t) => (Ge.debug("sending POST for ice types"), await H({
801
- urlOverride: `${E}/api/handle/${e}/type/${t}`,
802
- model: {}
803
- })), Qt = async (e) => await Fe({
804
- urlOverride: `${E}/api/kos/config/details/${e}/4`
805
- }), Xt = async (e, t) => {
806
- const r = await H({
807
- model: {},
808
- tracker: t,
809
- urlOverride: `${E}/api/handle/${e}/pour`
810
- });
811
- if (!(r != null && r.data))
812
- throw new Error("No response from server");
813
- return r == null ? void 0 : r.data;
814
- }, Jt = async (e, t) => {
815
- const r = await H({
816
- model: {},
817
- tracker: t,
818
- urlOverride: `${E}/api/handle/${e}/test/agitation`
819
- });
820
- if (!(r != null && r.data))
821
- throw new Error("No response from server");
822
- return r == null ? void 0 : r.data;
823
- }, er = async (e, t) => {
824
- const r = await H({
825
- model: {},
826
- tracker: t,
827
- urlOverride: `${E}/api/handle/${e}/test/gate`
828
- });
829
- if (!(r != null && r.data))
830
- throw new Error("No response from server");
831
- return r == null ? void 0 : r.data;
832
- };
833
- var tr = Object.defineProperty, rr = Object.getOwnPropertyDescriptor, u = (e, t, r, i) => {
834
- for (var a = i > 1 ? void 0 : i ? rr(t, r) : t, s = e.length - 1, n; s >= 0; s--)
835
- (n = e[s]) && (a = (i ? n(t, r, a) : n(a)) || a);
836
- return i && a && tr(t, r, a), a;
837
- };
838
- class k {
839
- }
840
- o(k, "TOPIC_AGITATION_STARTED", "/kos/events/ddk/ice-agitation-started"), o(k, "TOPIC_AGITATION_ENDED", "/kos/events/ddk/ice-agitation-ended");
841
- const Ue = "ice-agitator-model", je = R("statePath");
842
- let d = class {
843
- constructor(e, t, r) {
844
- o(this, "id");
845
- o(this, "name");
846
- o(this, "path");
847
- o(this, "volWithoutIceMl");
848
- o(this, "durationSec");
849
- o(this, "enableIceChuteClear");
850
- o(this, "iceChuteClearDurationMs");
851
- o(this, "iceChuteClearIntervalSec");
852
- o(this, "iceChuteClearRetryIntervalSec");
853
- o(this, "maxDispenseSec");
854
- o(this, "type");
855
- o(this, "dilutionOffset");
856
- o(this, "inactivitySec");
857
- o(this, "agitating");
858
- o(this, "iceChuteOpen");
859
- o(this, "statePath");
860
- o(this, "_allIceTypes");
861
- o(this, "logger");
862
- o(this, "currentState", c.IDLE);
863
- o(this, "resetDefaultValues", async () => await Qt(this.path));
864
- this.id = e, this.name = t.name, this.path = t.path, this.statePath = t.statePath, this._allIceTypes = [], this.logger = r.logger;
865
- }
866
- get iceTypes() {
867
- return this._allIceTypes;
868
- }
869
- get isAgitating() {
870
- return !!this.agitating.value;
871
- }
872
- get isIceChuteOpen() {
873
- return !!this.iceChuteOpen.value;
874
- }
875
- // future, pourFuture, agitateFuture, gateFuture getters are now provided by @kosMultipleFutureAware decorator
876
- /**
877
- * A derived value that indicates if the nozzle is currently pouring a beverage.
878
- * @readonly
879
- */
880
- get isPouring() {
881
- var e;
882
- return !!(this.pourFuture && !((e = this.pourFuture) != null && e.endState)) || this.currentState === c.POUR_STARTING || this.currentState === c.POURING || this.currentState === c.POUR_CANCELING;
883
- }
884
- /**
885
- * A derived value that indicates if it is possible to dispense ice.
886
- *
887
- * The value is observable and will change as the current dispense state changes
888
- * @readonly
889
- * */
890
- get canPour() {
891
- return this.currentState === c.IDLE;
892
- }
893
- updateIfCurrent(e, t) {
894
- this.currentState === e && L(() => {
895
- this.currentState = t;
896
- });
897
- }
898
- async pourIce(e) {
899
- try {
900
- if (this.currentState === c.IDLE) {
901
- if (this.updateIfCurrent(c.IDLE, c.POUR_STARTING), !e)
902
- throw new Error("No tracker provided");
903
- const t = await Xt(this.path, e);
904
- return this.updateIfCurrent(c.POUR_STARTING, c.POURING), t != null && t.endState && this.updateIfCurrent(c.POURING, c.IDLE), t;
905
- } else
906
- throw new Error(`Cannot pour in state ${this.currentState}`);
907
- } catch (t) {
908
- throw this.logger.error(t), this.currentState = c.IDLE, t;
909
- }
910
- }
911
- /**
912
- * An action that will cancel the ice dispense if it is currently in progress.
913
- * */
914
- async cancelIceDispense() {
915
- var e;
916
- this.currentState === c.POURING || this.currentState === c.POUR_STARTING ? (this.currentState = c.POUR_CANCELING, await ((e = this.pourFuture) == null ? void 0 : e.cancelFuture()), L(() => {
917
- this.currentState = c.IDLE;
918
- })) : this.logger.warn(
919
- `Cannot cancel ice dispense in state ${this.currentState}`
920
- );
921
- }
922
- async testAgitate(e) {
923
- if (!e)
924
- throw new Error("No tracker provided");
925
- return this.logger.info(`agitating ice-agitator ${this.id}`), Jt(this.path, e);
926
- }
927
- async testGate(e) {
928
- if (!e)
929
- throw new Error("No tracker provided");
930
- return this.logger.info(`testing ice gate: ${this.id}`), er(this.path, e);
931
- }
932
- handleAgitationChange() {
933
- var e;
934
- this.isAgitating ? (this.logger.info(`agitating ice-agitator ${this.id}`), F.publish(k.TOPIC_AGITATION_STARTED, {
935
- path: this.path,
936
- futureId: (e = this.futureHandler.future) == null ? void 0 : e.futureId
937
- })) : F.publish(k.TOPIC_AGITATION_ENDED, {
938
- path: this.path
939
- });
940
- }
941
- async updateIceType(e) {
942
- await Wt(this.path, e);
943
- }
944
- async init() {
945
- this.logger.debug(`initializing ice-agitator ${this.id}`);
946
- }
947
- async load() {
948
- this.logger.debug(`loading ice-agitator ${this.id}`);
949
- const e = await Zt(this.path);
950
- (e == null ? void 0 : e.status) === 200 && L(() => {
951
- this._allIceTypes = e.data || [];
952
- });
953
- }
954
- };
955
- u([
956
- y({
957
- path: I,
958
- attribute: "settings.volWithoutIceMl"
959
- })
960
- ], d.prototype, "volWithoutIceMl", 2);
961
- u([
962
- y({
963
- path: I,
964
- attribute: "settings.durationSec",
965
- converter: {
966
- to: "second"
967
- }
968
- })
969
- ], d.prototype, "durationSec", 2);
970
- u([
971
- y({
972
- path: I,
973
- attribute: "enableIceChuteClear"
974
- })
975
- ], d.prototype, "enableIceChuteClear", 2);
976
- u([
977
- y({
978
- path: I,
979
- attribute: "iceChuteClearDurationMs"
980
- })
981
- ], d.prototype, "iceChuteClearDurationMs", 2);
982
- u([
983
- y({
984
- path: I,
985
- attribute: "iceChuteClearIntervalSec"
986
- })
987
- ], d.prototype, "iceChuteClearIntervalSec", 2);
988
- u([
989
- y({
990
- path: I,
991
- attribute: "iceChuteClearRetryIntervalSec"
992
- })
993
- ], d.prototype, "iceChuteClearRetryIntervalSec", 2);
994
- u([
995
- y({
996
- path: I,
997
- attribute: "maxDispenseSec"
998
- })
999
- ], d.prototype, "maxDispenseSec", 2);
1000
- u([
1001
- y({
1002
- path: I,
1003
- attribute: "type"
1004
- })
1005
- ], d.prototype, "type", 2);
1006
- u([
1007
- y({
1008
- path: I,
1009
- attribute: "settings.dilutionOffset"
1010
- })
1011
- ], d.prototype, "dilutionOffset", 2);
1012
- u([
1013
- y({
1014
- path: I,
1015
- attribute: "settings.inactivitySec",
1016
- converter: {
1017
- to: "minute"
1018
- }
1019
- })
1020
- ], d.prototype, "inactivitySec", 2);
1021
- u([
1022
- O({ path: je, attribute: "agitating" })
1023
- ], d.prototype, "agitating", 2);
1024
- u([
1025
- O({ path: je, attribute: "iceChuteOpen" })
1026
- ], d.prototype, "iceChuteOpen", 2);
1027
- u([
1028
- N({ alias: "pour" })
1029
- ], d.prototype, "pourIce", 1);
1030
- u([
1031
- N({ alias: "agitate" })
1032
- ], d.prototype, "testAgitate", 1);
1033
- u([
1034
- N({
1035
- alias: "gate"
1036
- })
1037
- ], d.prototype, "testGate", 1);
1038
- u([
1039
- ae({
1040
- dependencies: (e) => [e.isAgitating]
1041
- })
1042
- ], d.prototype, "handleAgitationChange", 1);
1043
- d = u([
1044
- b(Ue),
1045
- et()
1046
- ], d);
1047
- const Be = new _({
1048
- class: d,
1049
- type: Ue
1050
- });
1051
- var ar = Object.defineProperty, or = Object.getOwnPropertyDescriptor, le = (e, t, r, i) => {
1052
- for (var a = i > 1 ? void 0 : i ? or(t, r) : t, s = e.length - 1, n; s >= 0; s--)
1053
- (n = e[s]) && (a = (i ? n(t, r, a) : n(a)) || a);
1054
- return i && a && ar(t, r, a), a;
1055
- };
1056
- const de = "agitation-required-trouble-model", ir = (e) => {
1057
- if (e.data.agitationRequired)
1058
- return de;
1059
- }, sr = "InsufficientAgitationTrouble";
1060
- let S = class {
1061
- constructor(e, t, r) {
1062
- o(this, "id");
1063
- o(this, "logger");
1064
- o(this, "trouble");
1065
- o(this, "_deferred");
1066
- o(this, "_holdersLoaded", !1);
1067
- o(this, "agitateBeforePour");
1068
- this.id = e, this.logger = r.logger, this._deferred = !1, this.trouble = t.companionParent;
1069
- }
1070
- async resolve() {
1071
- return this.trouble.resolve();
1072
- }
1073
- get holder() {
1074
- const e = this.trouble.data.holderPaths[0], t = v(e);
1075
- if (!(!this._holdersLoaded && !t.model))
1076
- return t == null ? void 0 : t.model;
1077
- }
1078
- updateHolder() {
1079
- if (!this._holdersLoaded) {
1080
- const e = this.trouble.data.holderPaths[0];
1081
- v(e).model && (this._holdersLoaded = !0);
1082
- }
1083
- }
1084
- get shouldDefer() {
1085
- var i, a;
1086
- if (!this.holder)
1087
- return !0;
1088
- const t = (((i = this.holder) == null ? void 0 : i.troublesByType[sr]) || []).length > 0;
1089
- return !!((a = this.agitateBeforePour) != null && a.value) && t;
1090
- }
1091
- get deferred() {
1092
- return this._deferred;
1093
- }
1094
- defer() {
1095
- this._deferred = !0;
1096
- }
1097
- clearDefer() {
1098
- this._deferred = !1;
1099
- }
1100
- };
1101
- le([
1102
- y({
1103
- path: "app:kosdev.ddk:app",
1104
- attribute: "ncui.agitateBeforePour"
1105
- })
1106
- ], S.prototype, "agitateBeforePour", 2);
1107
- le([
1108
- tt({
1109
- topic: rt(be.type),
1110
- lifecycle: ye.INIT
1111
- })
1112
- ], S.prototype, "updateHolder", 1);
1113
- S = le([
1114
- b(de)
1115
- ], S);
1116
- const nr = new _({
1117
- class: S,
1118
- type: de
1119
- }), lr = ["iceAgitator"], dr = {
1120
- iceAgitator: Be.factory
1121
- }, cr = C.createLogger({ name: "freestyle-assembly-data-mapper" }), yr = async (e) => {
1122
- const t = se.instance().options({}).build(), r = ne.instance().options({}).build(), i = e.assemblies.reduce((n, l) => {
1123
- var $;
1124
- return lr.forEach((h) => {
1125
- var T;
1126
- const P = l[h];
1127
- if (P) {
1128
- const Ke = dr[h](P.path);
1129
- n[h] = Ke({
1130
- name: P.name,
1131
- path: P.path,
1132
- statePath: ((T = P.state) == null ? void 0 : T.path) || ""
1133
- });
1134
- }
1135
- }), ($ = l.cartridgeAgitators) == null || $.forEach((h) => {
1136
- var T;
1137
- const P = Ce.instance(
1138
- h.path
1139
- ).options({
1140
- name: h.name,
1141
- path: h.path,
1142
- statePath: ((T = h.state) == null ? void 0 : T.path) || ""
1143
- }).build();
1144
- t.addModel(P);
1145
- }), l.remoteTrays && l.remoteTrays.forEach((h) => {
1146
- cr.info(`Found remote tray ${h.name} with path ${h.path}`);
1147
- const P = `${w.type}-${h.holderPath}`, T = w.instance(P).options({
1148
- holderPath: h.holderPath,
1149
- configPath: h.path,
1150
- name: h.name
1151
- }).build();
1152
- r.addModel(T);
1153
- }), n;
1154
- }, {}), a = !!i.iceAgitator, s = !!i.carbTank;
1155
- return {
1156
- ...i,
1157
- cartridgeAgitators: t,
1158
- remoteTrays: r,
1159
- supportsCarb: s,
1160
- supportsIce: a
1161
- };
1162
- }, ur = (e) => () => (at(e)(), st(e)(), ge.register(), W.register(), Be.register(), Te.register(), se.register(), he.register(), ce.register(), w.register(), ne.register(), p.companion.register(e)(
1163
- nt.type,
1164
- ge.type
1165
- ), p.companion.register(e)(
1166
- be.type,
1167
- W.type
1168
- ), nr.register(), p.companion.register(e)(
1169
- ot.type,
1170
- ir
1171
- ), p.companion.register(e)(lt.type, he.type), p.companion.register(e)(
1172
- dt.type,
1173
- ce.type
1174
- ), Y[q].register(
1175
- "EnjoyByTrouble",
1176
- async (t) => {
1177
- if (t.data.enjoyByDate) {
1178
- const r = new Date(t.data.enjoyByDate);
1179
- return {
1180
- enjoyByDays: Math.floor(
1181
- ((/* @__PURE__ */ new Date()).getTime() - r.getTime()) / (1e3 * 60 * 60 * 24)
1182
- ) || ""
1183
- };
1184
- }
1185
- return {};
1186
- }
1187
- ), Y[q].register(
1188
- "SuperPumpRequiredTrouble",
1189
- // This is the trouble type
1190
- async (t) => {
1191
- const { model: r } = v(
1192
- ct.type
1193
- );
1194
- return r ? {
1195
- superPumps: r.models.getIndexByKey(
1196
- ut.byType,
1197
- "microSuper"
1198
- ).map((s) => s.name).join(", ")
1199
- } : {};
1200
- }
1201
- ), Y[q].register(
1202
- "MicroPumpAirDetectTrouble",
1203
- async (t) => {
1204
- if (t.ifaces.includes("container"))
1205
- return {};
1206
- if (t.data.pumpPath) {
1207
- const { model: r } = v(
1208
- t.data.pumpPath
1209
- );
1210
- if (r) {
1211
- const i = r.ingredientId ? v(r.ingredientId).model : void 0;
1212
- return {
1213
- ingredientId: r.ingredientId,
1214
- ingredientName: (i == null ? void 0 : i.name) || ""
1215
- };
1216
- }
1217
- }
1218
- return {};
1219
- }
1220
- ), {
1221
- preload: p.model.preloadModel(e),
1222
- model: p.model.register(e),
1223
- companion: p.companion.register(e),
1224
- legacy: p.model.registerLegacyModel(e)
1225
- }), m = {
1226
- ...it
1227
- };
1228
- m.freestyle = {
1229
- models: ur(m)
1230
- };
1231
- m.preload = p.model.preloadModel(m);
1232
- m.model = p.model.register(m);
1233
- m.companion = p.companion.register(m);
1234
- m.legacy = p.model.registerLegacyModel(m);
1235
- const fr = m;
1236
- export {
1237
- sr as A,
1238
- Te as C,
1239
- W as F,
1240
- k as I,
1241
- fr as K,
1242
- Bt as N,
1243
- ne as R,
1244
- se as a,
1245
- U as b,
1246
- Ce as c,
1247
- ce as d,
1248
- ge as e,
1249
- he as f,
1250
- Be as g,
1251
- nr as h,
1252
- w as i,
1253
- ue as j,
1254
- Kt as k,
1255
- Vt as l,
1256
- yr as m,
1257
- Ot as n,
1258
- ur as r
1259
- };
1260
- //# sourceMappingURL=freestyle-registration-manager-CymJYnwk.js.map