@kosdev-code/kos-freestyle-sdk 2.0.2
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/extension-utils-D_CXSnlW.cjs +2 -0
- package/extension-utils-D_CXSnlW.cjs.map +1 -0
- package/extension-utils-uYGl3TGm.js +201 -0
- package/extension-utils-uYGl3TGm.js.map +1 -0
- package/freestyle-registration-manager-pbtzJUqS.js +765 -0
- package/freestyle-registration-manager-pbtzJUqS.js.map +1 -0
- package/freestyle-registration-manager-yxRMbjlE.cjs +2 -0
- package/freestyle-registration-manager-yxRMbjlE.cjs.map +1 -0
- package/index.cjs +2 -0
- package/index.cjs.map +1 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.js +33 -0
- package/index.js.map +1 -0
- package/models/constants/index.d.ts +2 -0
- package/models/constants/index.d.ts.map +1 -0
- package/models/index.d.ts +6 -0
- package/models/index.d.ts.map +1 -0
- package/models/models/agitation-required-trouble/agitation-required-trouble-model.d.ts +23 -0
- package/models/models/agitation-required-trouble/agitation-required-trouble-model.d.ts.map +1 -0
- package/models/models/agitation-required-trouble/agitation-required-trouble-registration.d.ts +87 -0
- package/models/models/agitation-required-trouble/agitation-required-trouble-registration.d.ts.map +1 -0
- package/models/models/agitation-required-trouble/index.d.ts +4 -0
- package/models/models/agitation-required-trouble/index.d.ts.map +1 -0
- package/models/models/agitation-required-trouble/types/index.d.ts +8 -0
- package/models/models/carb-agitator/carb-agitator-model.d.ts +14 -0
- package/models/models/carb-agitator/carb-agitator-model.d.ts.map +1 -0
- package/models/models/carb-agitator/carb-agitator-registration.d.ts +84 -0
- package/models/models/carb-agitator/carb-agitator-registration.d.ts.map +1 -0
- package/models/models/carb-agitator/index.d.ts +3 -0
- package/models/models/carb-agitator/index.d.ts.map +1 -0
- package/models/models/carb-agitator/types/index.d.ts +14 -0
- package/models/models/cartridge-agitator/cartridge-agitator-container-model.d.ts +20 -0
- package/models/models/cartridge-agitator/cartridge-agitator-container-model.d.ts.map +1 -0
- package/models/models/cartridge-agitator/cartridge-agitator-container-registration.d.ts +87 -0
- package/models/models/cartridge-agitator/cartridge-agitator-container-registration.d.ts.map +1 -0
- package/models/models/cartridge-agitator/cartridge-agitator-model.d.ts +27 -0
- package/models/models/cartridge-agitator/cartridge-agitator-model.d.ts.map +1 -0
- package/models/models/cartridge-agitator/cartridge-agitator-registration.d.ts +87 -0
- package/models/models/cartridge-agitator/cartridge-agitator-registration.d.ts.map +1 -0
- package/models/models/cartridge-agitator/index.d.ts +6 -0
- package/models/models/cartridge-agitator/index.d.ts.map +1 -0
- package/models/models/cartridge-agitator/services/cartridge-agitator-services.d.ts +8 -0
- package/models/models/cartridge-agitator/services/cartridge-agitator-services.d.ts.map +1 -0
- package/models/models/cartridge-agitator/types/index.d.ts +14 -0
- package/models/models/freestyle-assembly/freestyle-assembly-model.d.ts +38 -0
- package/models/models/freestyle-assembly/freestyle-assembly-model.d.ts.map +1 -0
- package/models/models/freestyle-assembly/freestyle-assembly-registration.d.ts +89 -0
- package/models/models/freestyle-assembly/freestyle-assembly-registration.d.ts.map +1 -0
- package/models/models/freestyle-assembly/index.d.ts +4 -0
- package/models/models/freestyle-assembly/index.d.ts.map +1 -0
- package/models/models/freestyle-assembly/types/index.d.ts +8 -0
- package/models/models/freestyle-holder/freestyle-holder-model.d.ts +19 -0
- package/models/models/freestyle-holder/freestyle-holder-model.d.ts.map +1 -0
- package/models/models/freestyle-holder/freestyle-holder-registration.d.ts +87 -0
- package/models/models/freestyle-holder/freestyle-holder-registration.d.ts.map +1 -0
- package/models/models/freestyle-holder/index.d.ts +4 -0
- package/models/models/freestyle-holder/index.d.ts.map +1 -0
- package/models/models/freestyle-holder/types/index.d.ts +8 -0
- package/models/models/freestyle-nozzle/freestyle-nozzle-model.d.ts +21 -0
- package/models/models/freestyle-nozzle/freestyle-nozzle-model.d.ts.map +1 -0
- package/models/models/freestyle-nozzle/freestyle-nozzle-registration.d.ts +87 -0
- package/models/models/freestyle-nozzle/freestyle-nozzle-registration.d.ts.map +1 -0
- package/models/models/freestyle-nozzle/index.d.ts +5 -0
- package/models/models/freestyle-nozzle/index.d.ts.map +1 -0
- package/models/models/freestyle-nozzle/services/freestyle-nozzle-services.d.ts +32 -0
- package/models/models/freestyle-nozzle/services/freestyle-nozzle-services.d.ts.map +1 -0
- package/models/models/freestyle-nozzle/services/index.d.ts +2 -0
- package/models/models/freestyle-nozzle/services/index.d.ts.map +1 -0
- package/models/models/freestyle-nozzle/types/index.d.ts +8 -0
- package/models/models/freestyle-pump/freestyle-pump-model.d.ts +14 -0
- package/models/models/freestyle-pump/freestyle-pump-model.d.ts.map +1 -0
- package/models/models/freestyle-pump/freestyle-pump-registration.d.ts +87 -0
- package/models/models/freestyle-pump/freestyle-pump-registration.d.ts.map +1 -0
- package/models/models/freestyle-pump/index.d.ts +5 -0
- package/models/models/freestyle-pump/index.d.ts.map +1 -0
- package/models/models/freestyle-pump/services/freestyle-pump-services.d.ts +10 -0
- package/models/models/freestyle-pump/services/freestyle-pump-services.d.ts.map +1 -0
- package/models/models/freestyle-pump/services/index.d.ts +2 -0
- package/models/models/freestyle-pump/services/index.d.ts.map +1 -0
- package/models/models/freestyle-pump/types/index.d.ts +5 -0
- package/models/models/ice-agitator/ice-agitator-model.d.ts +28 -0
- package/models/models/ice-agitator/ice-agitator-model.d.ts.map +1 -0
- package/models/models/ice-agitator/ice-agitator-registration.d.ts +84 -0
- package/models/models/ice-agitator/ice-agitator-registration.d.ts.map +1 -0
- package/models/models/ice-agitator/index.d.ts +3 -0
- package/models/models/ice-agitator/index.d.ts.map +1 -0
- package/models/models/ice-agitator/services/ice-agitator-services.d.ts +8 -0
- package/models/models/ice-agitator/services/ice-agitator-services.d.ts.map +1 -0
- package/models/models/ice-agitator/services/index.d.ts +2 -0
- package/models/models/ice-agitator/services/index.d.ts.map +1 -0
- package/models/models/ice-agitator/types/index.d.ts +28 -0
- package/models/models/index.d.ts +11 -0
- package/models/models/index.d.ts.map +1 -0
- package/models/models/types/assembly.d.ts +16 -0
- package/models/models/types/assembly.d.ts.map +1 -0
- package/models/models/types/ingredients.d.ts +33 -0
- package/models/models/types/ingredients.d.ts.map +1 -0
- package/models/models/types/pumps.d.ts +6 -0
- package/models/models/types/pumps.d.ts.map +1 -0
- package/models/utils/extension-utils.d.ts +37 -0
- package/models/utils/extension-utils.d.ts.map +1 -0
- package/models/utils/extensions/assembly/assembly-data-mapper.d.ts +19 -0
- package/models/utils/extensions/assembly/assembly-data-mapper.d.ts.map +1 -0
- package/models/utils/extensions/assembly/types.d.ts +130 -0
- package/models/utils/extensions/assembly/types.d.ts.map +1 -0
- package/models/utils/extensions/availability/freestyle-loader.d.ts +31 -0
- package/models/utils/extensions/availability/freestyle-loader.d.ts.map +1 -0
- package/models/utils/extensions/availability/freestyle-mapper.d.ts +14 -0
- package/models/utils/extensions/availability/freestyle-mapper.d.ts.map +1 -0
- package/models/utils/extensions/availability/middleware/assets.d.ts +10 -0
- package/models/utils/extensions/availability/middleware/assets.d.ts.map +1 -0
- package/models/utils/extensions/availability/middleware/beverage-screen.d.ts +14 -0
- package/models/utils/extensions/availability/middleware/beverage-screen.d.ts.map +1 -0
- package/models/utils/extensions/availability/middleware/beverages.d.ts +10 -0
- package/models/utils/extensions/availability/middleware/beverages.d.ts.map +1 -0
- package/models/utils/extensions/availability/middleware/brand-screen.d.ts +5 -0
- package/models/utils/extensions/availability/middleware/brand-screen.d.ts.map +1 -0
- package/models/utils/extensions/availability/middleware/brands.d.ts +10 -0
- package/models/utils/extensions/availability/middleware/brands.d.ts.map +1 -0
- package/models/utils/extensions/availability/middleware/copy-input.d.ts +4 -0
- package/models/utils/extensions/availability/middleware/copy-input.d.ts.map +1 -0
- package/models/utils/extensions/availability/middleware/flavors.d.ts +10 -0
- package/models/utils/extensions/availability/middleware/flavors.d.ts.map +1 -0
- package/models/utils/extensions/availability/middleware/nutrition.d.ts +10 -0
- package/models/utils/extensions/availability/middleware/nutrition.d.ts.map +1 -0
- package/models/utils/extensions/availability/middleware/related-brands.d.ts +14 -0
- package/models/utils/extensions/availability/middleware/related-brands.d.ts.map +1 -0
- package/models/utils/extensions/availability/types.d.ts +251 -0
- package/models/utils/extensions/availability/types.d.ts.map +1 -0
- package/models/utils/extensions/availability/util/locate-brand.d.ts +2 -0
- package/models/utils/extensions/availability/util/locate-brand.d.ts.map +1 -0
- package/models/utils/extensions/availability/util/process-related-brand.d.ts +4 -0
- package/models/utils/extensions/availability/util/process-related-brand.d.ts.map +1 -0
- package/models/utils/extensions/ingredient/index.d.ts +2 -0
- package/models/utils/extensions/ingredient/index.d.ts.map +1 -0
- package/models/utils/extensions/ingredient/model-extension.d.ts +7 -0
- package/models/utils/extensions/ingredient/model-extension.d.ts.map +1 -0
- package/models/utils/extensions/pourable/select-pourable-mapper.d.ts +6 -0
- package/models/utils/extensions/pourable/select-pourable-mapper.d.ts.map +1 -0
- package/models/utils/freestyle-registration-manager.d.ts +39 -0
- package/models/utils/freestyle-registration-manager.d.ts.map +1 -0
- package/models/utils/index.d.ts +5 -0
- package/models/utils/index.d.ts.map +1 -0
- package/models.cjs +2 -0
- package/models.cjs.map +1 -0
- package/models.d.ts +1 -0
- package/models.js +25 -0
- package/models.js.map +1 -0
- package/package.json +37 -0
- package/ui/contexts/index.d.ts +2 -0
- package/ui/contexts/index.d.ts.map +1 -0
- package/ui/hooks/freestyle-assembly/index.d.ts +2 -0
- package/ui/hooks/freestyle-assembly/index.d.ts.map +1 -0
- package/ui/hooks/freestyle-assembly/use-freestyle-assembly.d.ts +4 -0
- package/ui/hooks/freestyle-assembly/use-freestyle-assembly.d.ts.map +1 -0
- package/ui/hooks/freestyle-nozzle/index.d.ts +2 -0
- package/ui/hooks/freestyle-nozzle/index.d.ts.map +1 -0
- package/ui/hooks/freestyle-nozzle/use-freestyle-nozzle.d.ts +4 -0
- package/ui/hooks/freestyle-nozzle/use-freestyle-nozzle.d.ts.map +1 -0
- package/ui/hooks/ice-agitator/index.d.ts +3 -0
- package/ui/hooks/ice-agitator/index.d.ts.map +1 -0
- package/ui/hooks/ice-agitator/use-ice-agitator.d.ts +14 -0
- package/ui/hooks/ice-agitator/use-ice-agitator.d.ts.map +1 -0
- package/ui/hooks/ice-agitator/with-ice-agitator.d.ts +7 -0
- package/ui/hooks/ice-agitator/with-ice-agitator.d.ts.map +1 -0
- package/ui/hooks/index.d.ts +5 -0
- package/ui/hooks/index.d.ts.map +1 -0
- package/ui/hooks/nutrition/index.d.ts +2 -0
- package/ui/hooks/nutrition/index.d.ts.map +1 -0
- package/ui/hooks/nutrition/use-nutrition-info.d.ts +4 -0
- package/ui/hooks/nutrition/use-nutrition-info.d.ts.map +1 -0
- package/ui/index.d.ts +3 -0
- package/ui/index.d.ts.map +1 -0
- package/ui.cjs +2 -0
- package/ui.cjs.map +1 -0
- package/ui.d.ts +1 -0
- package/ui.js +14 -0
- package/ui.js.map +1 -0
- package/use-nutrition-info-CGrmEGIR.cjs +2 -0
- package/use-nutrition-info-CGrmEGIR.cjs.map +1 -0
- package/use-nutrition-info-D-wbfIlj.js +52 -0
- package/use-nutrition-info-D-wbfIlj.js.map +1 -0
|
@@ -0,0 +1,765 @@
|
|
|
1
|
+
var pe = Object.defineProperty;
|
|
2
|
+
var he = (e, t, r) => t in e ? pe(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var i = (e, t, r) => (he(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
4
|
+
import { KosModelRegistry as ye, registerDispenseModels as fe, Nozzle as me, Assembly as be, Pump as _e, Holder as ve, PumpContainer as Pe, PumpIndex as Ae } from "@kosdev-code/kos-dispense-sdk";
|
|
5
|
+
import { kosModel as f, KosModelRegistrationFactory as m, KosModelContainer as Ie, kosChild as $e, resolveServiceUrl as E, ServiceFactory as M, createPropKey as Oe, kosStateProp as Ee, kosFuture as Me, FutureHandler as Ce, kosEffect as Te, EventBus as K, SingletonKosModelRegistrationFactory as W, KosFeatureFlags as U, KosContextManager as we, KosLog as C, FutureManager as ze, kosParentAware as De, kosAutoEffect as Se, kosAction as Z, FetchError as Re, kosConfigProperty as p, KOS_MODEL_ID as y, getKosModelSync as A, RegistrationManager as g, registerCoreModels as Fe, Trouble as je, ExtensionManager as w, EXTENSION_TROUBLE_DATA_MAPPER as z } from "@kosdev-code/kos-ui-sdk";
|
|
6
|
+
var Le = Object.defineProperty, Ne = Object.getOwnPropertyDescriptor, Be = (e, t, r, o) => {
|
|
7
|
+
for (var s = o > 1 ? void 0 : o ? Ne(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
8
|
+
(n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
|
|
9
|
+
return o && s && Le(t, r, s), s;
|
|
10
|
+
};
|
|
11
|
+
const Q = "carb-agitator-model";
|
|
12
|
+
let S = class {
|
|
13
|
+
constructor(e, t, r) {
|
|
14
|
+
i(this, "id");
|
|
15
|
+
i(this, "name");
|
|
16
|
+
i(this, "path");
|
|
17
|
+
i(this, "logger");
|
|
18
|
+
this.id = e, this.name = t.name, this.path = t.path, this.logger = r.logger;
|
|
19
|
+
}
|
|
20
|
+
// -------------------LIFECYCLE----------------------------
|
|
21
|
+
async init() {
|
|
22
|
+
this.logger.debug(`initializing carb-agitator ${this.id}`);
|
|
23
|
+
}
|
|
24
|
+
async load() {
|
|
25
|
+
this.logger.debug(`loading carb-agitator ${this.id}`);
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
S = Be([
|
|
29
|
+
f(Q)
|
|
30
|
+
], S);
|
|
31
|
+
const X = new m({
|
|
32
|
+
class: S,
|
|
33
|
+
type: Q
|
|
34
|
+
});
|
|
35
|
+
var xe = Object.defineProperty, Ge = Object.getOwnPropertyDescriptor, J = (e, t, r, o) => {
|
|
36
|
+
for (var s = o > 1 ? void 0 : o ? Ge(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
37
|
+
(n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
|
|
38
|
+
return o && s && xe(t, r, s), s;
|
|
39
|
+
};
|
|
40
|
+
const k = "cartridge-agitator-container-model";
|
|
41
|
+
let I = class {
|
|
42
|
+
constructor(e, t, r) {
|
|
43
|
+
i(this, "id");
|
|
44
|
+
i(this, "logger");
|
|
45
|
+
i(this, "_models");
|
|
46
|
+
this.id = e, this.logger = r.logger, this._models = new Ie({
|
|
47
|
+
parentId: e
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
getModel(e) {
|
|
51
|
+
return this._models.getModel(e);
|
|
52
|
+
}
|
|
53
|
+
get models() {
|
|
54
|
+
return this._models;
|
|
55
|
+
}
|
|
56
|
+
get data() {
|
|
57
|
+
return this._models.data;
|
|
58
|
+
}
|
|
59
|
+
addModel(e) {
|
|
60
|
+
this._models.addModel(e);
|
|
61
|
+
}
|
|
62
|
+
removeModel(e) {
|
|
63
|
+
this._models.removeModel(e);
|
|
64
|
+
}
|
|
65
|
+
// -------------------LIFECYCLE----------------------------
|
|
66
|
+
async init() {
|
|
67
|
+
this.logger.debug(
|
|
68
|
+
`initializing cartridge-agitator-container container ${this.id}`
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
async load() {
|
|
72
|
+
this.logger.debug(
|
|
73
|
+
`loading cartridge-agitator-container container ${this.id}`
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
J([
|
|
78
|
+
$e
|
|
79
|
+
], I.prototype, "_models", 2);
|
|
80
|
+
I = J([
|
|
81
|
+
f(k)
|
|
82
|
+
], I);
|
|
83
|
+
const { URL: ee } = E("CARTRIDGE_AGITATOR_SERVICE"), { postModel: Ke } = M.build({
|
|
84
|
+
basePath: `${ee}/api/ext/freestyle/freestyle/ice`
|
|
85
|
+
}), Ue = async (e, t) => {
|
|
86
|
+
const r = await Ke({
|
|
87
|
+
model: {},
|
|
88
|
+
tracker: t,
|
|
89
|
+
urlOverride: `${ee}/api/handle/${e}/test`
|
|
90
|
+
});
|
|
91
|
+
if (!(r != null && r.data))
|
|
92
|
+
throw new Error("No response from server");
|
|
93
|
+
return r.data;
|
|
94
|
+
};
|
|
95
|
+
var He = Object.defineProperty, qe = Object.getOwnPropertyDescriptor, B = (e, t, r, o) => {
|
|
96
|
+
for (var s = o > 1 ? void 0 : o ? qe(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
97
|
+
(n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
|
|
98
|
+
return o && s && He(t, r, s), s;
|
|
99
|
+
};
|
|
100
|
+
const te = "cartridge-agitator-model";
|
|
101
|
+
class $ {
|
|
102
|
+
}
|
|
103
|
+
i($, "TOPIC_AGITATION_STARTED", "/kos/events/ddk/agitation-started"), i($, "TOPIC_AGITATION_ENDED", "/kos/events/ddk/agitation-ended");
|
|
104
|
+
const Ye = Oe("statePath");
|
|
105
|
+
let _ = class {
|
|
106
|
+
constructor(e, t, r) {
|
|
107
|
+
i(this, "id");
|
|
108
|
+
i(this, "futureHandler");
|
|
109
|
+
i(this, "logger");
|
|
110
|
+
i(this, "disposer");
|
|
111
|
+
i(this, "agitating");
|
|
112
|
+
i(this, "path");
|
|
113
|
+
i(this, "statePath");
|
|
114
|
+
i(this, "name");
|
|
115
|
+
this.id = e, this.logger = r.logger, this.futureHandler = new Ce(this), this.path = t.path, this.name = t.name, this.statePath = t.statePath;
|
|
116
|
+
}
|
|
117
|
+
get isAgitating() {
|
|
118
|
+
return !!this.agitating.value;
|
|
119
|
+
}
|
|
120
|
+
get future() {
|
|
121
|
+
return this.futureHandler.future;
|
|
122
|
+
}
|
|
123
|
+
async testAgitate(e) {
|
|
124
|
+
if (!e)
|
|
125
|
+
throw new Error("No tracker provided");
|
|
126
|
+
return this.logger.info(`agitating cartridge-agitator ${this.id}`), Ue(this.path, e);
|
|
127
|
+
}
|
|
128
|
+
// -------------------LIFECYCLE----------------------------
|
|
129
|
+
async init() {
|
|
130
|
+
this.logger.debug(`initializing cartridge-agitator ${this.id}`);
|
|
131
|
+
}
|
|
132
|
+
unload() {
|
|
133
|
+
var e;
|
|
134
|
+
(e = this.disposer) == null || e.call(this);
|
|
135
|
+
}
|
|
136
|
+
async load() {
|
|
137
|
+
this.logger.debug(`loading cartridge-agitator ${this.id}`), this.disposer = Te(
|
|
138
|
+
() => this.isAgitating,
|
|
139
|
+
() => {
|
|
140
|
+
var e;
|
|
141
|
+
this.isAgitating ? (this.logger.info(`agitating cartridge-agitator ${this.id}`), K.publish($.TOPIC_AGITATION_STARTED, {
|
|
142
|
+
path: this.path,
|
|
143
|
+
futureId: (e = this.futureHandler.future) == null ? void 0 : e.futureId
|
|
144
|
+
})) : K.publish($.TOPIC_AGITATION_ENDED, {
|
|
145
|
+
path: this.path
|
|
146
|
+
});
|
|
147
|
+
},
|
|
148
|
+
{}
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
B([
|
|
153
|
+
Ee({ path: Ye, attribute: "agitating" })
|
|
154
|
+
], _.prototype, "agitating", 2);
|
|
155
|
+
B([
|
|
156
|
+
Me()
|
|
157
|
+
], _.prototype, "testAgitate", 1);
|
|
158
|
+
_ = B([
|
|
159
|
+
f(te)
|
|
160
|
+
], _);
|
|
161
|
+
const re = new m({
|
|
162
|
+
class: _,
|
|
163
|
+
type: te
|
|
164
|
+
}), x = new W({
|
|
165
|
+
class: I,
|
|
166
|
+
type: k
|
|
167
|
+
});
|
|
168
|
+
x.addRelatedModel(re);
|
|
169
|
+
var Ve = Object.defineProperty, We = Object.getOwnPropertyDescriptor, Ze = (e, t, r, o) => {
|
|
170
|
+
for (var s = o > 1 ? void 0 : o ? We(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
171
|
+
(n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
|
|
172
|
+
return o && s && Ve(t, r, s), s;
|
|
173
|
+
};
|
|
174
|
+
const se = "freestyle-assembly-model", Qe = "iceAgitator", Xe = "carbAgitator";
|
|
175
|
+
let R = class {
|
|
176
|
+
constructor(e, t, r) {
|
|
177
|
+
i(this, "id");
|
|
178
|
+
i(this, "logger");
|
|
179
|
+
i(this, "assembly");
|
|
180
|
+
this.id = e, this.logger = r.logger, this.assembly = t.companionParent;
|
|
181
|
+
}
|
|
182
|
+
get holderGroups() {
|
|
183
|
+
return this.assembly.holderGroups;
|
|
184
|
+
}
|
|
185
|
+
get nozzlePaths() {
|
|
186
|
+
return this.assembly.nozzlePaths;
|
|
187
|
+
}
|
|
188
|
+
get allHolders() {
|
|
189
|
+
return this.assembly.allHolders;
|
|
190
|
+
}
|
|
191
|
+
getHoldersByGroup(e) {
|
|
192
|
+
return this.assembly.getHoldersByGroup(e);
|
|
193
|
+
}
|
|
194
|
+
getHoldersByNozzle(e) {
|
|
195
|
+
return this.assembly.getHoldersByNozzle(e);
|
|
196
|
+
}
|
|
197
|
+
get pumpsByNozzle() {
|
|
198
|
+
return this.assembly.pumpsByNozzle;
|
|
199
|
+
}
|
|
200
|
+
get pumpPaths() {
|
|
201
|
+
return this.assembly.pumpPaths;
|
|
202
|
+
}
|
|
203
|
+
get boards() {
|
|
204
|
+
return this.assembly.boards;
|
|
205
|
+
}
|
|
206
|
+
updateModel(e) {
|
|
207
|
+
return this.assembly.updateModel(e);
|
|
208
|
+
}
|
|
209
|
+
get iceAgitator() {
|
|
210
|
+
return this.assembly.iceAgitator;
|
|
211
|
+
}
|
|
212
|
+
get carbAgitator() {
|
|
213
|
+
return this.assembly.carbAgitator;
|
|
214
|
+
}
|
|
215
|
+
get cartridgeAgitators() {
|
|
216
|
+
return this.assembly.cartridgeAgitators;
|
|
217
|
+
}
|
|
218
|
+
get defaultCartridgeAgitator() {
|
|
219
|
+
return this.assembly.cartridgeAgitators.data[0];
|
|
220
|
+
}
|
|
221
|
+
get cartridgeAgitatorModels() {
|
|
222
|
+
return this.assembly.cartridgeAgitators.data;
|
|
223
|
+
}
|
|
224
|
+
get hasCartridgeAgitators() {
|
|
225
|
+
return this.assembly.cartridgeAgitators.data.length > 0;
|
|
226
|
+
}
|
|
227
|
+
// -------------------LIFECYCLE----------------------------
|
|
228
|
+
get supportsIce() {
|
|
229
|
+
return U.isFeatureEnabled(Qe);
|
|
230
|
+
}
|
|
231
|
+
get supportsCarb() {
|
|
232
|
+
return U.isFeatureEnabled(Xe);
|
|
233
|
+
}
|
|
234
|
+
async init() {
|
|
235
|
+
this.logger.debug(`initializing freestyle-assembly ${this.id}`);
|
|
236
|
+
}
|
|
237
|
+
async load() {
|
|
238
|
+
this.logger.debug(`loading freestyle-assembly ${this.id}`);
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
R = Ze([
|
|
242
|
+
f(se)
|
|
243
|
+
], R);
|
|
244
|
+
const F = new W({
|
|
245
|
+
class: R,
|
|
246
|
+
type: se
|
|
247
|
+
});
|
|
248
|
+
var Je = Object.defineProperty, ke = Object.getOwnPropertyDescriptor, et = (e, t, r, o) => {
|
|
249
|
+
for (var s = o > 1 ? void 0 : o ? ke(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
250
|
+
(n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
|
|
251
|
+
return o && s && Je(t, r, s), s;
|
|
252
|
+
};
|
|
253
|
+
const oe = "freestyle-holder-model";
|
|
254
|
+
function tt(e) {
|
|
255
|
+
const t = we.getContext(e), r = t == null ? void 0 : t.get(
|
|
256
|
+
F.type
|
|
257
|
+
);
|
|
258
|
+
if (!r) {
|
|
259
|
+
C.error("Freestyle assembly not found");
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
return r;
|
|
263
|
+
}
|
|
264
|
+
async function rt(e, t) {
|
|
265
|
+
if (!e || !t)
|
|
266
|
+
return;
|
|
267
|
+
const r = await e[t]();
|
|
268
|
+
if (r != null && r.tracker)
|
|
269
|
+
return ze.getFuture(r.tracker);
|
|
270
|
+
}
|
|
271
|
+
let j = class {
|
|
272
|
+
constructor(e, t, r) {
|
|
273
|
+
i(this, "id");
|
|
274
|
+
i(this, "logger");
|
|
275
|
+
i(this, "holder");
|
|
276
|
+
i(this, "future");
|
|
277
|
+
this.id = e, this.logger = r.logger, this.holder = t.companionParent;
|
|
278
|
+
}
|
|
279
|
+
get agitated() {
|
|
280
|
+
return this.holder.data.agitated;
|
|
281
|
+
}
|
|
282
|
+
async agitate() {
|
|
283
|
+
if (!this.holder.data.agitated)
|
|
284
|
+
return;
|
|
285
|
+
this.future = void 0;
|
|
286
|
+
const e = tt(this.id);
|
|
287
|
+
if (!e)
|
|
288
|
+
return;
|
|
289
|
+
if (!e.defaultCartridgeAgitator) {
|
|
290
|
+
this.logger.error("Agitator not found");
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
return this.future = await rt(
|
|
294
|
+
e.defaultCartridgeAgitator,
|
|
295
|
+
"testAgitate"
|
|
296
|
+
), this.future;
|
|
297
|
+
}
|
|
298
|
+
// -------------------LIFECYCLE----------------------------
|
|
299
|
+
async init() {
|
|
300
|
+
this.logger.debug(`initializing freestyle-holder ${this.id}`);
|
|
301
|
+
}
|
|
302
|
+
async load() {
|
|
303
|
+
this.logger.debug(`loading freestyle-holder ${this.id}`);
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
j = et([
|
|
307
|
+
f(oe)
|
|
308
|
+
], j);
|
|
309
|
+
const H = new m({
|
|
310
|
+
class: j,
|
|
311
|
+
type: oe
|
|
312
|
+
}), { URL: st } = E("FREESTYLE-NOZZLE_SERVICE"), { getOne: ot } = M.build({
|
|
313
|
+
basePath: `${st}/api/freestyle-nozzle`
|
|
314
|
+
}), P = C.createLogger({
|
|
315
|
+
name: "freestyle-nozzle-service",
|
|
316
|
+
group: "Services"
|
|
317
|
+
});
|
|
318
|
+
class it extends Error {
|
|
319
|
+
constructor(t) {
|
|
320
|
+
super(t), this.name = "NutritionInfoError";
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
class q extends Error {
|
|
324
|
+
constructor(t) {
|
|
325
|
+
super(t), this.name = "InvalidRequestError";
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
const at = async (e, t, r, o = "http://localhost:8081") => {
|
|
329
|
+
if (P.debug("sending GET for freestyle-nozzle"), !t)
|
|
330
|
+
throw P.error("Invalid freestyle-nozzle request: beverageId is required"), new q("No beverageId provided");
|
|
331
|
+
if (!r || r.length === 0)
|
|
332
|
+
throw P.error("Invalid freestyle-nozzle request: volumes are required"), new q("No volumes provided");
|
|
333
|
+
const s = await ot({
|
|
334
|
+
urlOverride: `${o}${e}/pipeline/beverage/engine/nutrition/${t}?volumes=${r.join(
|
|
335
|
+
","
|
|
336
|
+
)}`
|
|
337
|
+
});
|
|
338
|
+
if (!(s != null && s.data))
|
|
339
|
+
throw P.error("Failed to retrieve freestyle-nozzle data"), new Error("Failed to retrieve freestyle-nozzle data");
|
|
340
|
+
if (s.data.error)
|
|
341
|
+
throw new it(s.data.error);
|
|
342
|
+
return s.data;
|
|
343
|
+
};
|
|
344
|
+
var nt = Object.defineProperty, lt = Object.getOwnPropertyDescriptor, gt = (e, t, r, o) => {
|
|
345
|
+
for (var s = o > 1 ? void 0 : o ? lt(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
346
|
+
(n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
|
|
347
|
+
return o && s && nt(t, r, s), s;
|
|
348
|
+
};
|
|
349
|
+
const ie = "freestyle-nozzle-model";
|
|
350
|
+
let L = class {
|
|
351
|
+
constructor(e, t, r) {
|
|
352
|
+
i(this, "id");
|
|
353
|
+
i(this, "logger");
|
|
354
|
+
i(this, "nozzleModel");
|
|
355
|
+
i(this, "_cupSizes");
|
|
356
|
+
i(this, "_nutritionInfo");
|
|
357
|
+
i(this, "_disposer", null);
|
|
358
|
+
this.id = e, this.logger = r.logger, this.nozzleModel = t.companionParent, this._cupSizes = [100];
|
|
359
|
+
}
|
|
360
|
+
set cupSizes(e) {
|
|
361
|
+
this._cupSizes = e;
|
|
362
|
+
}
|
|
363
|
+
get nutritionInfo() {
|
|
364
|
+
return this._nutritionInfo;
|
|
365
|
+
}
|
|
366
|
+
// -------------------LIFECYCLE----------------------------
|
|
367
|
+
async init() {
|
|
368
|
+
this.logger.debug(`initializing freestyle-nozzle ${this.id}`), this._disposer = Se(async () => {
|
|
369
|
+
if (this.nozzleModel.selectedPourable.beverage && this._cupSizes.length) {
|
|
370
|
+
this.logger.debug(
|
|
371
|
+
`selected beverage: ${this.nozzleModel.selectedPourable.beverage.rawId}. Volume: ${this._cupSizes.join(", ")}`
|
|
372
|
+
);
|
|
373
|
+
const e = this.nozzleModel.selectedPourable.beverage.rawId, t = this.nozzleModel.urlPrefix;
|
|
374
|
+
try {
|
|
375
|
+
const r = await at(
|
|
376
|
+
t,
|
|
377
|
+
e,
|
|
378
|
+
this._cupSizes
|
|
379
|
+
);
|
|
380
|
+
Z(() => {
|
|
381
|
+
this._nutritionInfo = r;
|
|
382
|
+
});
|
|
383
|
+
} catch (r) {
|
|
384
|
+
this.logger.error(`Error fetching nutrition info: ${r}`);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
unload() {
|
|
390
|
+
this.logger.debug(`unloading freestyle-nozzle ${this.id}`), this._disposer && this._disposer();
|
|
391
|
+
}
|
|
392
|
+
async load() {
|
|
393
|
+
this.logger.debug(`loading freestyle-nozzle ${this.id}`);
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
L = gt([
|
|
397
|
+
De(),
|
|
398
|
+
f(ie)
|
|
399
|
+
], L);
|
|
400
|
+
const Y = new m({
|
|
401
|
+
class: L,
|
|
402
|
+
type: ie
|
|
403
|
+
}), { URL: ae } = E("PUMP_SERVICE"), { postModel: ct } = M.build({
|
|
404
|
+
basePath: `${ae}/api/ext/freestyle/microCalibration`
|
|
405
|
+
}), D = C.createLogger({
|
|
406
|
+
name: "freestyle-pump-service",
|
|
407
|
+
group: "Services"
|
|
408
|
+
}), dt = async (e, t) => {
|
|
409
|
+
var r, o, s, a, n;
|
|
410
|
+
D.debug(
|
|
411
|
+
`replacePump - sending POST request to /api/ext/freestyle/microCalibration/cal/${e}/code/${t}`
|
|
412
|
+
);
|
|
413
|
+
try {
|
|
414
|
+
const l = await ct({
|
|
415
|
+
model: {},
|
|
416
|
+
urlOverride: `${ae}/api/ext/freestyle/microCalibration/cal/${e}/code/${t}`
|
|
417
|
+
});
|
|
418
|
+
return D.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];
|
|
419
|
+
} catch (l) {
|
|
420
|
+
if (D.error(
|
|
421
|
+
`replacePump - sending POST request to /api/cal/${e}/code/${t}`,
|
|
422
|
+
l
|
|
423
|
+
), l instanceof Re) {
|
|
424
|
+
const d = ((s = (o = l.payload) == null ? void 0 : o.data) == null ? void 0 : s.error) || ((a = l.payload) == null ? void 0 : a.error) || "unknownError";
|
|
425
|
+
return [d, ((n = l.payload) == null ? void 0 : n.data) || { error: d }];
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
return ["unknownError", { error: "unknownError" }];
|
|
429
|
+
};
|
|
430
|
+
var ut = Object.defineProperty, pt = Object.getOwnPropertyDescriptor, ht = (e, t, r, o) => {
|
|
431
|
+
for (var s = o > 1 ? void 0 : o ? pt(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
432
|
+
(n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
|
|
433
|
+
return o && s && ut(t, r, s), s;
|
|
434
|
+
};
|
|
435
|
+
const ne = "freestyle-pump-model";
|
|
436
|
+
let N = class {
|
|
437
|
+
constructor(e, t, r) {
|
|
438
|
+
i(this, "id");
|
|
439
|
+
i(this, "logger");
|
|
440
|
+
i(this, "pump");
|
|
441
|
+
this.id = e, this.logger = r.logger, this.pump = t.companionParent;
|
|
442
|
+
}
|
|
443
|
+
// -------------------LIFECYCLE----------------------------
|
|
444
|
+
async replacePump(e) {
|
|
445
|
+
const [t, r] = await dt(this.pump.path, e);
|
|
446
|
+
return t && this.logger.error(`Failed to replace the pump, ${this.pump.id}`, t), [t, r];
|
|
447
|
+
}
|
|
448
|
+
};
|
|
449
|
+
N = ht([
|
|
450
|
+
f(ne)
|
|
451
|
+
], N);
|
|
452
|
+
const V = new m({
|
|
453
|
+
class: N,
|
|
454
|
+
type: ne
|
|
455
|
+
}), { URL: T } = E("ICE_AGITATOR_SERVICE"), { getAll: le, postModel: yt } = M.build({
|
|
456
|
+
basePath: `${T}/api/ext/freestyle/freestyle/ice`
|
|
457
|
+
}), ge = C.createLogger({
|
|
458
|
+
name: "ice-agitator-service",
|
|
459
|
+
group: "Services"
|
|
460
|
+
}), ft = async () => (ge.debug("sending GET for ice types"), await le({
|
|
461
|
+
urlOverride: `${T}/api/ext/freestyle/freestyle/ice/types`
|
|
462
|
+
})), mt = async (e, t) => (ge.debug("sending POST for ice types"), await yt({
|
|
463
|
+
urlOverride: `${T}/api/ext/freestyle/freestyle/ice/type/${e}/${t}`,
|
|
464
|
+
model: {}
|
|
465
|
+
})), bt = async () => await le({
|
|
466
|
+
urlOverride: `${T}/api/kos/config/details/assembly.core.board:macro.iceAgitator/4`
|
|
467
|
+
});
|
|
468
|
+
var _t = Object.defineProperty, vt = Object.getOwnPropertyDescriptor, h = (e, t, r, o) => {
|
|
469
|
+
for (var s = o > 1 ? void 0 : o ? vt(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
470
|
+
(n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
|
|
471
|
+
return o && s && _t(t, r, s), s;
|
|
472
|
+
};
|
|
473
|
+
const ce = "ice-agitator-model";
|
|
474
|
+
let c = class {
|
|
475
|
+
constructor(e, t, r) {
|
|
476
|
+
i(this, "id");
|
|
477
|
+
i(this, "name");
|
|
478
|
+
i(this, "path");
|
|
479
|
+
i(this, "volWithoutIceMl");
|
|
480
|
+
i(this, "durationSec");
|
|
481
|
+
i(this, "enableIceChuteClear");
|
|
482
|
+
i(this, "iceChuteClearDurationMs");
|
|
483
|
+
i(this, "iceChuteClearIntervalSec");
|
|
484
|
+
i(this, "iceChuteClearRetryIntervalSec");
|
|
485
|
+
i(this, "maxDispenseSec");
|
|
486
|
+
i(this, "type");
|
|
487
|
+
i(this, "dilutionOffset");
|
|
488
|
+
i(this, "inactivitySec");
|
|
489
|
+
i(this, "_allIceTypes");
|
|
490
|
+
i(this, "logger");
|
|
491
|
+
i(this, "resetDefaultValues", async () => await bt());
|
|
492
|
+
this.id = e, this.name = t.name, this.path = t.path, this._allIceTypes = [], this.logger = r.logger;
|
|
493
|
+
}
|
|
494
|
+
get iceTypes() {
|
|
495
|
+
return this._allIceTypes;
|
|
496
|
+
}
|
|
497
|
+
// -------------------LIFECYCLE----------------------------
|
|
498
|
+
async updateIceType(e) {
|
|
499
|
+
await mt(this.id, e);
|
|
500
|
+
}
|
|
501
|
+
async init() {
|
|
502
|
+
this.logger.debug(`initializing ice-agitator ${this.id}`);
|
|
503
|
+
}
|
|
504
|
+
async load() {
|
|
505
|
+
this.logger.debug(`loading ice-agitator ${this.id}`);
|
|
506
|
+
const e = await ft();
|
|
507
|
+
(e == null ? void 0 : e.status) === 200 && Z(() => {
|
|
508
|
+
this._allIceTypes = e.data || [];
|
|
509
|
+
});
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
h([
|
|
513
|
+
p({
|
|
514
|
+
path: y,
|
|
515
|
+
attribute: "settings.volWithoutIceMl"
|
|
516
|
+
})
|
|
517
|
+
], c.prototype, "volWithoutIceMl", 2);
|
|
518
|
+
h([
|
|
519
|
+
p({
|
|
520
|
+
path: y,
|
|
521
|
+
attribute: "settings.durationSec",
|
|
522
|
+
converter: {
|
|
523
|
+
to: "second"
|
|
524
|
+
}
|
|
525
|
+
})
|
|
526
|
+
], c.prototype, "durationSec", 2);
|
|
527
|
+
h([
|
|
528
|
+
p({
|
|
529
|
+
path: y,
|
|
530
|
+
attribute: "enableIceChuteClear"
|
|
531
|
+
})
|
|
532
|
+
], c.prototype, "enableIceChuteClear", 2);
|
|
533
|
+
h([
|
|
534
|
+
p({
|
|
535
|
+
path: y,
|
|
536
|
+
attribute: "iceChuteClearDurationMs"
|
|
537
|
+
})
|
|
538
|
+
], c.prototype, "iceChuteClearDurationMs", 2);
|
|
539
|
+
h([
|
|
540
|
+
p({
|
|
541
|
+
path: y,
|
|
542
|
+
attribute: "iceChuteClearIntervalSec"
|
|
543
|
+
})
|
|
544
|
+
], c.prototype, "iceChuteClearIntervalSec", 2);
|
|
545
|
+
h([
|
|
546
|
+
p({
|
|
547
|
+
path: y,
|
|
548
|
+
attribute: "iceChuteClearRetryIntervalSec"
|
|
549
|
+
})
|
|
550
|
+
], c.prototype, "iceChuteClearRetryIntervalSec", 2);
|
|
551
|
+
h([
|
|
552
|
+
p({
|
|
553
|
+
path: y,
|
|
554
|
+
attribute: "maxDispenseSec"
|
|
555
|
+
})
|
|
556
|
+
], c.prototype, "maxDispenseSec", 2);
|
|
557
|
+
h([
|
|
558
|
+
p({
|
|
559
|
+
path: y,
|
|
560
|
+
attribute: "type"
|
|
561
|
+
})
|
|
562
|
+
], c.prototype, "type", 2);
|
|
563
|
+
h([
|
|
564
|
+
p({
|
|
565
|
+
path: y,
|
|
566
|
+
attribute: "settings.dilutionOffset"
|
|
567
|
+
})
|
|
568
|
+
], c.prototype, "dilutionOffset", 2);
|
|
569
|
+
h([
|
|
570
|
+
p({
|
|
571
|
+
path: y,
|
|
572
|
+
attribute: "settings.inactivitySec",
|
|
573
|
+
converter: {
|
|
574
|
+
to: "minute"
|
|
575
|
+
}
|
|
576
|
+
})
|
|
577
|
+
], c.prototype, "inactivitySec", 2);
|
|
578
|
+
c = h([
|
|
579
|
+
f(ce)
|
|
580
|
+
], c);
|
|
581
|
+
const de = new m({
|
|
582
|
+
class: c,
|
|
583
|
+
type: ce
|
|
584
|
+
});
|
|
585
|
+
var Pt = Object.defineProperty, At = Object.getOwnPropertyDescriptor, ue = (e, t, r, o) => {
|
|
586
|
+
for (var s = o > 1 ? void 0 : o ? At(t, r) : t, a = e.length - 1, n; a >= 0; a--)
|
|
587
|
+
(n = e[a]) && (s = (o ? n(t, r, s) : n(s)) || s);
|
|
588
|
+
return o && s && Pt(t, r, s), s;
|
|
589
|
+
};
|
|
590
|
+
const G = "agitation-required-trouble-model", It = (e) => {
|
|
591
|
+
if (e.data.agitationRequired)
|
|
592
|
+
return G;
|
|
593
|
+
}, $t = "InsufficientAgitationTrouble";
|
|
594
|
+
let O = class {
|
|
595
|
+
constructor(e, t, r) {
|
|
596
|
+
i(this, "id");
|
|
597
|
+
i(this, "logger");
|
|
598
|
+
i(this, "trouble");
|
|
599
|
+
i(this, "_deferred");
|
|
600
|
+
i(this, "agitateBeforePour");
|
|
601
|
+
this.id = e, this.logger = r.logger, this._deferred = !1, this.trouble = t.companionParent;
|
|
602
|
+
}
|
|
603
|
+
async resolve() {
|
|
604
|
+
return this.trouble.resolve();
|
|
605
|
+
}
|
|
606
|
+
get holder() {
|
|
607
|
+
const e = this.trouble.data.holderPaths[0], t = A(e);
|
|
608
|
+
return t == null ? void 0 : t.model;
|
|
609
|
+
}
|
|
610
|
+
get shouldDefer() {
|
|
611
|
+
var o, s;
|
|
612
|
+
const t = (((o = this.holder) == null ? void 0 : o.troublesByType[$t]) || []).length > 0;
|
|
613
|
+
return !!((s = this.agitateBeforePour) != null && s.value) && t;
|
|
614
|
+
}
|
|
615
|
+
get deferred() {
|
|
616
|
+
return this._deferred;
|
|
617
|
+
}
|
|
618
|
+
defer() {
|
|
619
|
+
this._deferred = !0;
|
|
620
|
+
}
|
|
621
|
+
clearDefer() {
|
|
622
|
+
this._deferred = !1;
|
|
623
|
+
}
|
|
624
|
+
};
|
|
625
|
+
ue([
|
|
626
|
+
p({
|
|
627
|
+
path: "app:kosdev.ddk:app",
|
|
628
|
+
attribute: "ncui.agitateBeforePour"
|
|
629
|
+
})
|
|
630
|
+
], O.prototype, "agitateBeforePour", 2);
|
|
631
|
+
O = ue([
|
|
632
|
+
f(G)
|
|
633
|
+
], O);
|
|
634
|
+
const Ot = new m({
|
|
635
|
+
class: O,
|
|
636
|
+
type: G
|
|
637
|
+
}), Et = ["iceAgitator", "carbAgitator"], Mt = {
|
|
638
|
+
iceAgitator: de.factory,
|
|
639
|
+
carbAgitator: X.factory
|
|
640
|
+
}, Dt = async (e) => {
|
|
641
|
+
const t = x.instance().options({}).build(), r = e.assemblies.reduce((a, n) => {
|
|
642
|
+
var l;
|
|
643
|
+
return Et.forEach((d) => {
|
|
644
|
+
const b = n[d];
|
|
645
|
+
if (b) {
|
|
646
|
+
const v = Mt[d](b.path);
|
|
647
|
+
a[d] = v({
|
|
648
|
+
name: b.name,
|
|
649
|
+
path: b.path
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
}), (l = n.cartridgeAgitators) == null || l.forEach((d) => {
|
|
653
|
+
var v;
|
|
654
|
+
const b = re.instance(
|
|
655
|
+
d.path
|
|
656
|
+
).options({
|
|
657
|
+
name: d.name,
|
|
658
|
+
path: d.path,
|
|
659
|
+
statePath: ((v = d.state) == null ? void 0 : v.path) || ""
|
|
660
|
+
}).build();
|
|
661
|
+
t.addModel(b);
|
|
662
|
+
}), a;
|
|
663
|
+
}, {}), o = !!r.iceAgitator, s = !!r.carbAgitator;
|
|
664
|
+
return {
|
|
665
|
+
...r,
|
|
666
|
+
cartridgeAgitators: t,
|
|
667
|
+
supportsCarb: s,
|
|
668
|
+
supportsIce: o
|
|
669
|
+
};
|
|
670
|
+
}, Ct = (e) => () => (Fe(e)(), fe(e)(), Y.register(), F.register(), de.register(), X.register(), x.register(), V.register(), H.register(), g.companion.register(e)(
|
|
671
|
+
me.type,
|
|
672
|
+
Y.type
|
|
673
|
+
), g.companion.register(e)(
|
|
674
|
+
be.type,
|
|
675
|
+
F.type
|
|
676
|
+
), Ot.register(), g.companion.register(e)(
|
|
677
|
+
je.type,
|
|
678
|
+
It
|
|
679
|
+
), g.companion.register(e)(_e.type, V.type), g.companion.register(e)(
|
|
680
|
+
ve.type,
|
|
681
|
+
H.type
|
|
682
|
+
), w[z].register(
|
|
683
|
+
"EnjoyByTrouble",
|
|
684
|
+
async (t) => {
|
|
685
|
+
if (t.data.enjoyByDate) {
|
|
686
|
+
const r = new Date(t.data.enjoyByDate);
|
|
687
|
+
return {
|
|
688
|
+
enjoyByDays: Math.floor(
|
|
689
|
+
((/* @__PURE__ */ new Date()).getTime() - r.getTime()) / (1e3 * 60 * 60 * 24)
|
|
690
|
+
) || ""
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
return {};
|
|
694
|
+
}
|
|
695
|
+
), w[z].register(
|
|
696
|
+
"SuperPumpRequiredTrouble",
|
|
697
|
+
// This is the trouble type
|
|
698
|
+
async (t) => {
|
|
699
|
+
const { model: r } = A(
|
|
700
|
+
Pe.type
|
|
701
|
+
);
|
|
702
|
+
return r ? {
|
|
703
|
+
superPumps: r.models.getIndexByKey(
|
|
704
|
+
Ae.byType,
|
|
705
|
+
"microSuper"
|
|
706
|
+
).map((a) => a.name).join(", ")
|
|
707
|
+
} : {};
|
|
708
|
+
}
|
|
709
|
+
), w[z].register(
|
|
710
|
+
"MicroPumpAirDetectTrouble",
|
|
711
|
+
async (t) => {
|
|
712
|
+
if (t.ifaces.includes("container"))
|
|
713
|
+
return {};
|
|
714
|
+
if (t.data.pumpPath) {
|
|
715
|
+
const { model: r } = A(
|
|
716
|
+
t.data.pumpPath
|
|
717
|
+
);
|
|
718
|
+
if (r) {
|
|
719
|
+
const o = r.ingredientId ? A(r.ingredientId).model : void 0;
|
|
720
|
+
return {
|
|
721
|
+
ingredientId: r.ingredientId,
|
|
722
|
+
ingredientName: (o == null ? void 0 : o.name) || ""
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
return {};
|
|
727
|
+
}
|
|
728
|
+
), {
|
|
729
|
+
preload: g.model.preloadModel(e),
|
|
730
|
+
model: g.model.register(e),
|
|
731
|
+
companion: g.companion.register(e),
|
|
732
|
+
legacy: g.model.registerLegacyModel(e)
|
|
733
|
+
}), u = {
|
|
734
|
+
...ye
|
|
735
|
+
};
|
|
736
|
+
u.freestyle = {
|
|
737
|
+
models: Ct(u)
|
|
738
|
+
};
|
|
739
|
+
u.preload = g.model.preloadModel(u);
|
|
740
|
+
u.model = g.model.register(u);
|
|
741
|
+
u.companion = g.companion.register(u);
|
|
742
|
+
u.legacy = g.model.registerLegacyModel(u);
|
|
743
|
+
const St = u;
|
|
744
|
+
export {
|
|
745
|
+
$t as A,
|
|
746
|
+
X as C,
|
|
747
|
+
F,
|
|
748
|
+
de as I,
|
|
749
|
+
St as K,
|
|
750
|
+
it as N,
|
|
751
|
+
x as a,
|
|
752
|
+
$ as b,
|
|
753
|
+
re as c,
|
|
754
|
+
H as d,
|
|
755
|
+
Y as e,
|
|
756
|
+
V as f,
|
|
757
|
+
Ot as g,
|
|
758
|
+
q as h,
|
|
759
|
+
at as i,
|
|
760
|
+
dt as j,
|
|
761
|
+
Dt as k,
|
|
762
|
+
Qe as l,
|
|
763
|
+
Ct as r
|
|
764
|
+
};
|
|
765
|
+
//# sourceMappingURL=freestyle-registration-manager-pbtzJUqS.js.map
|