@danidoble/webserial 4.2.3 → 4.2.5

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/dist/boardroid.js CHANGED
@@ -1,20 +1,21 @@
1
- var de = Object.defineProperty;
2
- var q = (d) => {
3
- throw TypeError(d);
1
+ var oe = Object.defineProperty;
2
+ var D = (l) => {
3
+ throw TypeError(l);
4
4
  };
5
- var ue = (d, u, t) => u in d ? de(d, u, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[u] = t;
6
- var b = (d, u, t) => ue(d, typeof u != "symbol" ? u + "" : u, t), F = (d, u, t) => u.has(d) || q("Cannot " + t);
7
- var v = (d, u, t) => (F(d, u, "read from private field"), t ? t.call(d) : u.get(d)), C = (d, u, t) => u.has(d) ? q("Cannot add the same private member more than once") : u instanceof WeakSet ? u.add(d) : u.set(d, t), _ = (d, u, t, e) => (F(d, u, "write to private field"), e ? e.call(d, t) : u.set(d, t), t), a = (d, u, t) => (F(d, u, "access private method"), t);
8
- import { K as pe, c as D } from "./kernel-B15wfB2x.js";
9
- var w, f, y, s, M, H, x, N, O, U, j, A, L, Q, m, R, z, W, K, V, Y, G, J, X, Z, g, $, ee, te, ne, p, T, se, ie, re, ae, B, I, oe, ce, S, P, E;
10
- class _e extends pe {
11
- constructor({ filters: t = null, config_port: e = null, no_device: n = 1 } = {}) {
12
- super({ filters: t, config_port: e, no_device: n });
13
- C(this, s);
14
- b(this, "__coin_purse", {
5
+ var ce = (l, p, n) => p in l ? oe(l, p, { enumerable: !0, configurable: !0, writable: !0, value: n }) : l[p] = n;
6
+ var h = (l, p, n) => ce(l, typeof p != "symbol" ? p + "" : p, n), I = (l, p, n) => p.has(l) || D("Cannot " + n);
7
+ var y = (l, p, n) => (I(l, p, "read from private field"), n ? n.call(l) : p.get(l)), w = (l, p, n) => p.has(l) ? D("Cannot add the same private member more than once") : p instanceof WeakSet ? p.add(l) : p.set(l, n), b = (l, p, n, e) => (I(l, p, "write to private field"), e ? e.call(l, n) : p.set(l, n), n), a = (l, p, n) => (I(l, p, "access private method"), n);
8
+ import { K as le, _ as x } from "./kernel-Bquzoyqh.js";
9
+ import { l as d } from "./relay-Dop4mFk-.js";
10
+ var f, _, k, i, E, M, v, S, Q, N, F, j, O, U, A, T, L, z, W, K, V, Y, m, G, H, J, X, Z, g, ee, ne, te, ie, se, R, C, re, ae, P, $, B;
11
+ class he extends le {
12
+ constructor({ filters: n = null, config_port: e = null, no_device: t = 1 } = {}) {
13
+ super({ filters: n, config_port: e, no_device: t });
14
+ w(this, i);
15
+ h(this, "__coin_purse", {
15
16
  available: !0
16
17
  });
17
- b(this, "__banknote_purse", {
18
+ h(this, "__banknote_purse", {
18
19
  available: !0,
19
20
  isRecycler: !0,
20
21
  recycler: {
@@ -23,7 +24,7 @@ class _e extends pe {
23
24
  // 0: $20, 1: $50, 2: $100, 3: $200, 4: $500
24
25
  }
25
26
  });
26
- b(this, "__sale", {
27
+ h(this, "__sale", {
27
28
  price: 0,
28
29
  change: 0,
29
30
  change_verified: 0,
@@ -33,41 +34,41 @@ class _e extends pe {
33
34
  this.price = 0, this.change = 0, this.change_verified = 0, this.dispense_all = !0, this.last_change = 0;
34
35
  }
35
36
  });
36
- b(this, "__money_session", {
37
+ h(this, "__money_session", {
37
38
  inserted: 0,
38
39
  retired: 0,
39
40
  clear() {
40
41
  this.inserted = 0, this.retired = 0;
41
42
  }
42
43
  });
43
- b(this, "coins", {
44
+ h(this, "coins", {
44
45
  tubes: { g50: 0, c50: 0, p1: 0, p2: 0, p5: 0, p10: 0 },
45
46
  box: { g50: 0, c50: 0, p1: 0, p2: 0, p5: 0, p10: 0 },
46
47
  totals: { g50: 0, c50: 0, p1: 0, p2: 0, p5: 0, p10: 0 },
47
48
  total: 0
48
49
  });
49
- b(this, "banknotes", {
50
+ h(this, "banknotes", {
50
51
  stacker: { p20: 0, p50: 0, p100: 0, p200: 0, p500: 0, p1000: 0 },
51
52
  recycler: { p20: 0, p50: 0, p100: 0, p200: 0, p500: 0, p1000: 0 },
52
53
  out: { p20: 0, p50: 0, p100: 0, p200: 0, p500: 0, p1000: 0 },
53
54
  totals: { p20: 0, p50: 0, p100: 0, p200: 0, p500: 0, p1000: 0 },
54
55
  total: 0
55
56
  });
56
- b(this, "card_reader", {
57
+ h(this, "card_reader", {
57
58
  available: !1,
58
59
  max_pre_credit: 0
59
60
  });
60
- C(this, w, !1);
61
- C(this, f, 0);
62
- C(this, y, 0);
63
- if (this.__internal__.device.type = "boardroid", D.getCustom(this.typeDevice, n))
64
- throw new Error(`Device ${this.typeDevice} ${n} already exists`);
61
+ w(this, f, !1);
62
+ w(this, _, 0);
63
+ w(this, k, 0);
64
+ if (this.__internal__.device.type = "boardroid", x.getCustom(this.typeDevice, t))
65
+ throw new Error(`Device ${this.typeDevice} ${t} already exists`);
65
66
  this.__internal__.serial.config_port.baudRate = 115200, this.__internal__.serial.response.length = 14, this.__internal__.time.response_connection = 600, this.__internal__.time.response_general = 4e3, this.__internal__.time.response_engines = 15e3, this.__internal__.dispense.limit_counter = 15, this.__internal__.dispense.custom_limit_counter = null, this.__internal__.dispense.backup_dispense = {
66
67
  channel: 1,
67
68
  second_channel: null,
68
69
  sensor: !0,
69
70
  seconds: null
70
- }, a(this, s, M).call(this), a(this, s, H).call(this);
71
+ }, a(this, i, E).call(this), a(this, i, M).call(this);
71
72
  }
72
73
  get totalInTubes() {
73
74
  return this.coins.tubes.g50 * 0.5 + this.coins.tubes.c50 * 0.5 + this.coins.tubes.p1 + this.coins.tubes.p2 * 2 + this.coins.tubes.p5 * 5 + this.coins.tubes.p10 * 10;
@@ -78,18 +79,18 @@ class _e extends pe {
78
79
  get hasRecycler() {
79
80
  return this.__banknote_purse.available && this.__banknote_purse.isRecycler;
80
81
  }
81
- set hasRecycler(t) {
82
- this.__banknote_purse.isRecycler = t;
82
+ set hasRecycler(n) {
83
+ this.__banknote_purse.isRecycler = n;
83
84
  }
84
85
  get hasICT() {
85
86
  return this.hasRecycler && this.__banknote_purse.recycler.ict;
86
87
  }
87
- set hasICT(t) {
88
- this.__banknote_purse.recycler.ict = t;
88
+ set hasICT(n) {
89
+ this.__banknote_purse.recycler.ict = n;
89
90
  }
90
- set banknoteICT(t) {
91
- if (![20, 50, 100, 200, 500].includes(t)) throw new Error(`Invalid banknote value: ${t}`);
92
- t = [20, 50, 100, 200, 500].indexOf(t), this.__banknote_purse.recycler.banknote = t;
91
+ set banknoteICT(n) {
92
+ if (![20, 50, 100, 200, 500].includes(n)) throw new Error(`Invalid banknote value: ${n}`);
93
+ n = [20, 50, 100, 200, 500].indexOf(n), this.__banknote_purse.recycler.banknote = n;
93
94
  }
94
95
  get banknoteICT() {
95
96
  return [20, 50, 100, 200, 500][this.__banknote_purse.recycler.banknote];
@@ -97,13 +98,13 @@ class _e extends pe {
97
98
  get hasCoinPurse() {
98
99
  return this.__coin_purse.available;
99
100
  }
100
- set hasCoinPurse(t) {
101
- if (typeof t != "boolean")
102
- throw new Error(`Invalid value: ${t}`);
103
- this.__coin_purse.available = t;
101
+ set hasCoinPurse(n) {
102
+ if (typeof n != "boolean")
103
+ throw new Error(`Invalid value: ${n}`);
104
+ this.__coin_purse.available = n;
104
105
  }
105
- set price(t) {
106
- let e = parseFloat(t);
106
+ set price(n) {
107
+ let e = parseFloat(n);
107
108
  (isNaN(e) || e < 0) && (e = 0), this.__sale.price = e;
108
109
  }
109
110
  get price() {
@@ -115,63 +116,57 @@ class _e extends pe {
115
116
  softReload() {
116
117
  super.softReload(), this.__sale.clear(), this.__money_session.clear();
117
118
  }
118
- serialBoardroidSumHex(t) {
119
- let e = 0;
120
- return t.forEach((n, i) => {
121
- i !== 0 && i !== 11 && (e += parseInt(n, 16));
122
- }), e.toString(16).toUpperCase();
123
- }
124
- serialMessage(t) {
119
+ serialMessage(n) {
125
120
  let e = {
126
- code: t,
121
+ code: n,
127
122
  name: null,
128
123
  description: null,
129
124
  request: null,
130
125
  no_code: 0
131
126
  };
132
- const n = (5 + this.deviceNumber).toString(16).padStart(2, "0").toLowerCase();
133
- switch (t[1]) {
134
- case n:
135
- e.request = "connect", e = a(this, s, O).call(this, e);
127
+ const t = (5 + this.deviceNumber).toString(16).padStart(2, "0").toLowerCase();
128
+ switch (n[1]) {
129
+ case t:
130
+ e.request = "connect", e = a(this, i, Q).call(this, e);
136
131
  break;
137
132
  case "a0":
138
- e.request = "--automatic", e = a(this, s, z).call(this, t, e);
133
+ e.request = "--automatic", e = a(this, i, L).call(this, n, e);
139
134
  break;
140
135
  case "b0":
141
- e.request = "--automatic", e = a(this, s, W).call(this, t, e);
136
+ e.request = "--automatic", e = a(this, i, z).call(this, n, e);
142
137
  break;
143
138
  case "d0":
144
- e.request = "coin-purse:config", e = a(this, s, K).call(this, t[2], e);
139
+ e.request = "coin-purse:config", e = a(this, i, W).call(this, n[2], e);
145
140
  break;
146
141
  case "d1":
147
- e.request = "banknote-purse:config", e.additional = { scrow: null }, e = a(this, s, V).call(this, t, e);
142
+ e.request = "banknote-purse:config", e.additional = { scrow: null }, e = a(this, i, K).call(this, n, e);
148
143
  break;
149
144
  case "d2":
150
- e.request = "coin-purse:read-tubes", e = a(this, s, Y).call(this, t, e);
145
+ e.request = "coin-purse:read-tubes", e = a(this, i, V).call(this, n, e);
151
146
  break;
152
147
  case "d3":
153
- e.request = "banknote-purse:read-recycler", e = a(this, s, G).call(this, t, e);
148
+ e.request = "banknote-purse:read-recycler", e = a(this, i, Y).call(this, n, e);
154
149
  break;
155
150
  case "d4":
156
- e.request = "banknote-purse:banknote-scrow-status", e = a(this, s, J).call(this, t[2], e);
151
+ e.request = "banknote-purse:banknote-scrow-status", e = a(this, i, m).call(this, n[2], e);
157
152
  break;
158
153
  case "d5":
159
- e.request = "banknote-purse:dispense", e = a(this, s, X).call(this, t, e);
154
+ e.request = "banknote-purse:dispense", e = a(this, i, G).call(this, n, e);
160
155
  break;
161
156
  case "d6":
162
- e.request = "coin-purse:dispense", e = a(this, s, Z).call(this, t, e);
157
+ e.request = "coin-purse:dispense", e = a(this, i, H).call(this, n, e);
163
158
  break;
164
159
  case "d7":
165
- e.request = "dispense", e = a(this, s, g).call(this, t[5], e);
160
+ e.request = "dispense", e = a(this, i, J).call(this, n[5], e);
166
161
  break;
167
162
  case "d8":
168
- e.request = "--automatic", e = a(this, s, $).call(this, t[13], e);
163
+ e.request = "--automatic", e = a(this, i, X).call(this, n[13], e);
169
164
  break;
170
165
  case "d9":
171
- e.request = "status:temperature", e = a(this, s, ee).call(this, t, e);
166
+ e.request = "status:temperature", e = a(this, i, Z).call(this, n, e);
172
167
  break;
173
168
  case "da":
174
- e.request = "status:relay", e = a(this, s, te).call(this, t[2], e);
169
+ e.request = "status:relay", e = a(this, i, g).call(this, n[2], e);
175
170
  break;
176
171
  case "db":
177
172
  e.request = "banknote-purse:save-memory", e.no_code = 18, e.name = "Bill purse memory saved?", e.description = "The memory of bill purse was saved successfully?", this.dispatch("banknote-purse:save-memory", { message: e });
@@ -180,7 +175,7 @@ class _e extends pe {
180
175
  e.request = "coin-purse:read-memory", e.no_code = 19, e.name = "Coin purse memory read?", e.description = "The memory of coin purse was read successfully?", this.dispatch("banknote-purse:read-memory", { message: e });
181
176
  break;
182
177
  case "dd":
183
- e.request = "card-reader", a(this, s, ne).call(this, t, e);
178
+ e.request = "card-reader", a(this, i, ee).call(this, n, e);
184
179
  break;
185
180
  default:
186
181
  e.request = "--unknown", e.name = "Response unrecognized", e.description = "The response of application was received, but dont identify with any of current parameters", e.no_code = 400, this.dispatch("unknown", e);
@@ -188,14 +183,15 @@ class _e extends pe {
188
183
  }
189
184
  this.dispatch("serial:message", e);
190
185
  }
191
- serialSetConnectionConstant(t = 1) {
192
- let e = ["F1", "06", "00", "00", "00", "00", "00", "00", "00", "00", "F2", "F8"];
193
- return e[1] = this.hexMaker(this.decToHex((5 + t).toString())), e[11] = this.serialBoardroidSumHex(e), this.add0x(e);
186
+ serialSetConnectionConstant(n = 1) {
187
+ return d.connection({ channel: n });
194
188
  }
195
- async coinPurseConfigure({ enable: t = !1, high: e = "FF", low: n = "FF" } = {}) {
189
+ async coinPurseConfigure({ enable: n = !1, high: e = "FF", low: t = "FF" } = {}) {
196
190
  if (!this.__coin_purse.available) throw new Error("Coin purse not available");
197
- const r = ["F1", "C1", t ? "01" : "00", e, n, "00", "00", "00", "00", "00", "F2", "00"];
198
- await a(this, s, p).call(this, r, "coin-purse:config");
191
+ return e = this.hexToDec(e), t = this.hexToDec(t), await this.appendToQueue(
192
+ d.coinPurseConfiguration({ enable: n, high: e, low: t }),
193
+ "coin-purse:config"
194
+ );
199
195
  }
200
196
  async coinPurseEnable() {
201
197
  await this.coinPurseConfigure({ enable: !0 });
@@ -203,121 +199,115 @@ class _e extends pe {
203
199
  async coinPurseDisable() {
204
200
  await this.coinPurseConfigure({ enable: !1 });
205
201
  }
206
- async coinPurseDispense({ $_50c: t = 0, $_1: e = 0, $_2: n = 0, $_5: i = 0, $_10: r = 0 } = {}) {
202
+ async coinPurseDispense({ $_50c: n = 0, $_1: e = 0, $_2: t = 0, $_5: s = 0, $_10: r = 0 } = {}) {
207
203
  if (!this.__coin_purse.available) throw new Error("Coin purse not available");
208
- if ([t, e, n, i, r].some((o) => isNaN(o) || typeof o == "string"))
209
- throw new Error("One of the values is not a number");
210
- if (t < 1 && e < 1 && n < 1 && i < 1 && r < 1) throw new Error("No coins to dispense");
211
- [t, e, n, i, r] = [
212
- this.decToHex(t),
213
- this.decToHex(e),
214
- this.decToHex(n),
215
- this.decToHex(i),
216
- this.decToHex(r)
217
- ];
218
- let c = ["F1", "C6", t, e, n, i, r, "00", "00", "00", "F2", "00"];
219
- await a(this, s, p).call(this, c, "coin-purse:dispense");
204
+ return await this.appendToQueue(
205
+ d.coinPurseDispense({
206
+ $50c: n,
207
+ $1: e,
208
+ $2: t,
209
+ $5: s,
210
+ $10: r
211
+ }),
212
+ "coin-purse:dispense"
213
+ );
220
214
  }
221
215
  async coinPurseReadTubes() {
222
- const t = ["F1", "C2", "00", "00", "00", "00", "00", "00", "00", "00", "F2", "00"];
223
- await a(this, s, p).call(this, t, "coin-purse:read-tubes");
216
+ return await this.appendToQueue(d.coinPurseReadTubes(), "coin-purse:read-tubes");
224
217
  }
225
- async banknotePurseConfigure({ enable: t = !1, scrow: e = !1 } = {}) {
218
+ async banknotePurseConfigure({ enable: n = !1, scrow: e = !1 } = {}) {
226
219
  if (!this.__banknote_purse.available) throw new Error("Banknote purse not available");
227
- let n;
228
- return a(this, s, x).call(this) ? n = a(this, s, se).call(this, { enable: t, scrow: e }) : n = a(this, s, ie).call(this, { enable: t, scrow: e }), await a(this, s, p).call(this, n, "banknote-purse:config");
220
+ let t;
221
+ return a(this, i, v).call(this) ? t = a(this, i, ne).call(this, { enable: n, scrow: e }) : t = a(this, i, te).call(this, { enable: n, scrow: e }), await this.appendToQueue(t, "banknote-purse:config");
229
222
  }
230
- async banknotePurseDispense({ $_20: t = 0, $_50: e = 0, $_100: n = 0, $_200: i = 0, $_500: r = 0, $_1000: c = 0 } = {}) {
223
+ async banknotePurseDispense({ $_20: n = 0, $_50: e = 0, $_100: t = 0, $_200: s = 0, $_500: r = 0, $_1000: c = 0 } = {}) {
231
224
  if (!this.__banknote_purse.available) throw new Error("Banknote purse not available");
232
225
  if (!this.__banknote_purse.isRecycler) throw new Error("Banknote purse is not recycler");
233
226
  let o;
234
- if (a(this, s, x).call(this)) {
235
- const l = [t, e, n, i, r];
236
- o = a(this, s, re).call(this, l[this.__banknote_purse.recycler.banknote]);
227
+ if (a(this, i, v).call(this)) {
228
+ const u = [n, e, t, s, r];
229
+ o = a(this, i, ie).call(this, u[this.__banknote_purse.recycler.banknote]);
237
230
  } else
238
- o = a(this, s, ae).call(this, { $_20: t, $_50: e, $_100: n, $_200: i, $_500: r, $_1000: c });
239
- await a(this, s, p).call(this, o, "banknote-purse:dispense");
231
+ o = a(this, i, se).call(this, { $_20: n, $_50: e, $_100: t, $_200: s, $_500: r, $_1000: c });
232
+ await this.appendToQueue(o, "banknote-purse:dispense");
240
233
  }
241
- async banknotePurseEnable({ scrow: t = !1 }) {
242
- return await this.banknotePurseConfigure({ enable: !0, scrow: t });
234
+ async banknotePurseEnable({ scrow: n = !1 }) {
235
+ return await this.banknotePurseConfigure({ enable: !0, scrow: n });
243
236
  }
244
237
  async banknotePurseDisable() {
245
238
  return await this.banknotePurseConfigure({ enable: !1 });
246
239
  }
247
240
  async banknotePurseAcceptInScrow() {
248
241
  if (!this.__banknote_purse.available) throw new Error("Banknote purse not available");
249
- const t = ["F1", "C4", "01", "00", "00", "00", "00", "00", "00", "00", "F2", "00"];
250
- await a(this, s, p).call(this, t, "banknote-purse:banknote-scrow-status");
242
+ return await this.appendToQueue(
243
+ d.banknotePurseAcceptInScrow(),
244
+ "banknote-purse:banknote-scrow-status"
245
+ );
251
246
  }
252
247
  async banknotePurseRejectInScrow() {
253
248
  if (!this.__banknote_purse.available) throw new Error("Banknote purse not available");
254
- const t = ["F1", "C4", "00", "00", "00", "00", "00", "00", "00", "00", "F2", "00"];
255
- await a(this, s, p).call(this, t, "banknote-purse:banknote-scrow-status");
249
+ return await this.appendToQueue(
250
+ d.banknotePurseRejectInScrow(),
251
+ "banknote-purse:banknote-scrow-status"
252
+ );
256
253
  }
257
254
  async banknotePurseSaveMemory({
258
- channel: t = null,
255
+ channel: n = null,
259
256
  $_20: e = null,
260
- $_50: n = null,
261
- $_100: i = null,
257
+ $_50: t = null,
258
+ $_100: s = null,
262
259
  $_200: r = null,
263
260
  $_500: c = null,
264
261
  $_1000: o = null
265
262
  } = {}) {
266
263
  if (!this.__banknote_purse.available) throw new Error("Banknote purse not available");
267
- if (t === null || e === null || n === null || i === null || r === null || c === null || o === null)
268
- throw new Error("One of the values is not defined");
269
- const l = [
270
- "F1",
271
- "C8",
272
- this.decToHex(t),
273
- "00",
274
- this.decToHex(e),
275
- this.decToHex(n),
276
- this.decToHex(i),
277
- this.decToHex(r),
278
- this.decToHex(c),
279
- this.decToHex(o),
280
- "F2",
281
- "00"
282
- ];
283
- await a(this, s, p).call(this, l, "banknote-purse:save-memory");
264
+ return await this.appendToQueue(
265
+ d.banknotePurseSaveMemory({
266
+ channel: n,
267
+ $20: e,
268
+ $50: t,
269
+ $100: s,
270
+ $200: r,
271
+ $500: c,
272
+ $1000: o
273
+ }),
274
+ "banknote-purse:save-memory"
275
+ );
284
276
  }
285
277
  async banknotePurseReadRecycler() {
286
278
  if (!this.__banknote_purse.available) throw new Error("Banknote purse not available");
287
279
  if (!this.__banknote_purse.isRecycler) throw new Error("Banknote purse is not recycler");
288
- const t = ["F1", "C3", "00", "00", "00", "00", "00", "00", "00", "00", "F2", "B5"];
289
- return await a(this, s, p).call(this, t, "banknote-purse:read-recycler");
280
+ return await this.appendToQueue(d.banknotePurseReadRecycler(), "banknote-purse:read-recycler");
290
281
  }
291
282
  async cardReaderDisable() {
292
283
  if (!this.card_reader.available) throw new Error("Card reader not available");
293
- const t = ["F1", "CD", "00", "00", "00", "00", "00", "00", "00", "00", "F2", "00"];
294
- return await a(this, s, p).call(this, t, "card-reader:disable");
284
+ return await this.appendToQueue(d.cardReaderDisable(), "card-reader:disable");
295
285
  }
296
- async cardReaderDispense({ channel: t = 1, second_channel: e = null, sensor: n = !0, seconds: i = null, price: r = 0 } = {}) {
286
+ async cardReaderDispense({ channel: n = 1, second_channel: e = null, sensor: t = !0, seconds: s = null, price: r = 0 } = {}) {
297
287
  if (!this.card_reader.available) throw new Error("Card reader not available");
298
- if (isNaN(this.card_reader.max_pre_credit) || this.card_reader.max_pre_credit === 0)
299
- throw new Error("Card reader pre-credit not configured");
300
- if (isNaN(r) || r <= 0) throw new Error("Price must be greater than 0");
288
+ if ((isNaN(this.card_reader.max_pre_credit) || this.card_reader.max_pre_credit === 0) && (this.card_reader.max_pre_credit = r), isNaN(r) || r <= 0) throw new Error("Price must be greater than 0");
301
289
  if (r > this.card_reader.max_pre_credit) throw new Error("Price is greater than pre-credit configured");
302
- if (!n && (i === null || i <= 0 || i > 40))
290
+ if (!t && (s === null || s <= 0 || s > 40))
303
291
  throw new Error("Invalid time to dispense without sensor, must be between 0.1 and 40.0 seconds");
304
- const c = this.decToHex(r / 256), o = this.decToHex(r % 256), l = this.decToHex(t + 9);
305
- let h = "00";
306
- e && (h = this.decToHex(e + 9));
307
- let k = "00";
308
- n || (k = this.decToHex(i * 10));
309
- const le = ["F1", "CD", "01", l, h, k, c, o, "00", "00", "F2", "00"];
310
- await a(this, s, p).call(this, le, "card-reader:dispense");
292
+ return this.appendToQueue(
293
+ d.cardReaderDispense({
294
+ selection: n,
295
+ second_selection: e,
296
+ sensor: t,
297
+ seconds: s,
298
+ price: r
299
+ }),
300
+ "card-reader:dispense"
301
+ );
311
302
  }
312
- async paymentPursesDisable({ coin: t = !0, banknote: e = !0, cardReader: n = !1 } = {}) {
313
- t && await this.coinPurseDisable(), e && await this.banknotePurseDisable(), n && await this.cardReaderDisable();
303
+ async paymentPursesDisable({ coin: n = !0, banknote: e = !0, cardReader: t = !1 } = {}) {
304
+ n && this.__coin_purse.available && await this.coinPurseDisable(), e && this.__banknote_purse.available && await this.banknotePurseDisable(), t && this.card_reader.available && await this.cardReaderDisable();
314
305
  }
315
- async paymentPursesEnable({ coin: t = !0, banknote: e = !0, scrowBanknote: n = !1 } = {}) {
316
- t && await this.coinPurseEnable(), e && await this.banknotePurseEnable({ scrow: n });
306
+ async paymentPursesEnable({ coin: n = !0, banknote: e = !0, scrowBanknote: t = !1 } = {}) {
307
+ n && this.__coin_purse.available && await this.coinPurseEnable(), e && this.__banknote_purse.available && await this.banknotePurseEnable({ scrow: t });
317
308
  }
318
- async coolingRelayConfigure({ enable: t = !1 } = {}) {
319
- const n = ["F1", "CC", t ? "01" : "00", "00", "00", "00", "00", "00", "00", "00", "F2", "00"];
320
- return await a(this, s, p).call(this, n, "status:relay");
309
+ async coolingRelayConfigure({ enable: n = !1 } = {}) {
310
+ return await this.appendToQueue(d.coolingRelayConfigure({ enable: n }), "status:relay");
321
311
  }
322
312
  async coolingRelayEnable() {
323
313
  return await this.coolingRelayConfigure({ enable: !0 });
@@ -326,8 +316,7 @@ class _e extends pe {
326
316
  return await this.coolingRelayConfigure({ enable: !1 });
327
317
  }
328
318
  async readTemperature() {
329
- const t = ["F1", "CB", "00", "00", "00", "00", "00", "00", "00", "00", "F2", "00"];
330
- return await a(this, s, p).call(this, t, "status:temperature");
319
+ return await this.appendToQueue(d.readTemperature(), "status:temperature");
331
320
  }
332
321
  /**
333
322
  * Dispense a product from the machine
@@ -338,79 +327,66 @@ class _e extends pe {
338
327
  * @param {boolean} retry
339
328
  * @return {Promise<unknown>}
340
329
  */
341
- async dispense({ selection: t = 1, second_selection: e = null, sensor: n = !0, seconds: i = null, retry: r = !0 } = {}) {
342
- if (t = parseInt(t), isNaN(t) || t < 1 || t > 80) throw new Error("Invalid channel number");
343
- if (e !== null && (e < 1 || e > 80 || e === t))
330
+ async dispense({ selection: n = 1, second_selection: e = null, sensor: t = !0, seconds: s = null, retry: r = !0 } = {}) {
331
+ if (n = parseInt(n), isNaN(n) || n < 1 || n > 80) throw new Error("Invalid channel number");
332
+ if (e !== null && (e < 1 || e > 80 || e === n))
344
333
  throw new Error("Invalid second channel number");
345
- if (!n && (i === null || i <= 0 || i > 40))
334
+ if (!t && (s === null || s <= 0 || s > 40))
346
335
  throw new Error("Invalid time to dispense without sensor, must be between 0.1 and 40.0 seconds");
347
336
  r && (this.__internal__.dispense.backup_dispense = {
348
- selection: t,
337
+ selection: n,
349
338
  second_selection: e,
350
- sensor: n,
351
- seconds: i
352
- }), t += 9;
353
- const c = this.decToHex(t);
354
- let o = "00";
355
- e && (e += 9, o = this.decToHex(e));
356
- let l = "00";
357
- n || (l = this.decToHex(Math.round(i * 6.2)), this.__internal__.dispense.custom_limit_counter = i);
358
- const h = a(this, s, T).call(this, [
359
- "F1",
360
- "C7",
361
- c,
362
- o,
363
- l,
364
- "00",
365
- "00",
366
- "00",
367
- "00",
368
- "00",
369
- "F2",
370
- "00"
371
- ]);
372
- let k = await this.internalDispense(h);
373
- return !k.dispensed && r && (k = await this.internalDispense(h)), this.__internal__.dispense.custom_limit_counter = null, k;
374
- }
375
- async testEngines({ singleEngine: t = !1 } = {}) {
339
+ sensor: t,
340
+ seconds: s
341
+ });
342
+ const c = d.dispense({
343
+ selection: n,
344
+ second_selection: e,
345
+ sensor: t,
346
+ seconds: s
347
+ });
348
+ t || (s || (s = 1.5), this.__internal__.dispense.custom_limit_counter = s + 0.2);
349
+ let o = await this.internalDispense(c);
350
+ return !o.dispensed && r && (o = await this.internalDispense(c)), this.__internal__.dispense.custom_limit_counter = null, o;
351
+ }
352
+ async testEngines({ singleEngine: n = !1 } = {}) {
376
353
  if (this.isDispensing) throw new Error("Another dispensing process is running");
377
- if (v(this, w)) throw new Error("Another test is running");
378
- a(this, s, B).call(this), _(this, w, !0);
354
+ if (y(this, f)) throw new Error("Another test is running");
355
+ a(this, i, R).call(this), b(this, f, !0);
379
356
  const e = [];
380
- a(this, s, I).call(this);
381
- for (let n = 1; n <= 80; n++) {
382
- const i = await this.dispense({
383
- selection: n,
384
- second_selection: t ? null : n + 1,
357
+ a(this, i, C).call(this);
358
+ for (let t = 1; t <= 80; t++) {
359
+ const s = await this.dispense({
360
+ selection: t,
361
+ second_selection: n ? null : t + 1,
385
362
  sensor: !1,
386
363
  seconds: 0.4,
387
364
  retry: !1
388
365
  });
389
- e.push(i), _(this, f, n), a(this, s, I).call(this), t || n++;
366
+ e.push(s), b(this, _, t), a(this, i, C).call(this), n || t++;
390
367
  }
391
- _(this, f, 80), a(this, s, I).call(this, { dispensed: e }), a(this, s, B).call(this);
368
+ b(this, _, 80), a(this, i, C).call(this, { dispensed: e }), a(this, i, R).call(this);
392
369
  }
393
- async sendCustomCode({ code: t = [] } = {}) {
394
- if (t.length === 0) throw new Error("Invalid code");
395
- const e = a(this, s, T).call(this, t);
396
- await this.appendToQueue(e, "custom");
370
+ async sendCustomCode({ code: n = [] } = {}) {
371
+ if (n.length === 0) throw new Error("Invalid code");
372
+ return await this.appendToQueue(d.customCode(n), "custom");
397
373
  }
398
- hasToReturnChange(t = 0) {
399
- let e = t;
400
- return e <= 0 ? !0 : (e = a(this, s, S).call(this, e).pending, e = a(this, s, P).call(this, e).pending, !(e > 0));
374
+ hasToReturnChange(n = 0) {
375
+ let e = n;
376
+ return e <= 0 ? !0 : (e = a(this, i, P).call(this, e).pending, e = a(this, i, $).call(this, e).pending, !(e > 0));
401
377
  }
402
378
  async returnChange() {
403
- return await a(this, s, E).call(this);
379
+ return await a(this, i, B).call(this);
404
380
  }
405
381
  async returnInsertedMoney() {
406
- return this.__money_session.inserted <= 0 ? !1 : await a(this, s, E).call(this, this.__money_session.inserted);
382
+ return this.__money_session.inserted <= 0 ? !1 : await a(this, i, B).call(this, this.__money_session.inserted);
407
383
  }
408
- async serialCorruptMessage(t, e) {
409
- this.dispatch("corrupt:message", { data: t, message: e });
384
+ async serialCorruptMessage(n, e) {
385
+ this.dispatch("corrupt:message", { data: n, message: e });
410
386
  }
411
387
  }
412
- w = new WeakMap(), f = new WeakMap(), y = new WeakMap(), s = new WeakSet(), M = function() {
413
- const t = [
388
+ f = new WeakMap(), _ = new WeakMap(), k = new WeakMap(), i = new WeakSet(), E = function() {
389
+ const n = [
414
390
  "banknote-purse:banknote-scrow-status",
415
391
  "banknote-purse:config",
416
392
  "banknote-purse:event-banknote",
@@ -434,17 +410,17 @@ w = new WeakMap(), f = new WeakMap(), y = new WeakMap(), s = new WeakSet(), M =
434
410
  "status:relay",
435
411
  "status:temperature"
436
412
  ];
437
- for (const e of t)
413
+ for (const e of n)
438
414
  this.serialRegisterAvailableListener(e);
439
- }, H = function() {
440
- D.add(this);
441
- }, x = function() {
415
+ }, M = function() {
416
+ x.add(this);
417
+ }, v = function() {
442
418
  return this.__banknote_purse.isRecycler && this.__banknote_purse.recycler.ict;
443
- }, N = function() {
419
+ }, S = function() {
444
420
  return this.hasCoinPurse || this.hasRecycler;
445
- }, O = function(t) {
446
- return t.name = "Connection with the serial device completed.", t.description = "Your connection with the serial device was successfully completed.", t.no_code = 1, this.dispatch("run:default-load", {}), t;
447
- }, U = function(t) {
421
+ }, Q = function(n) {
422
+ return n.name = "Connection with the serial device completed.", n.description = "Your connection with the serial device was successfully completed.", n.no_code = 1, this.dispatch("run:default-load", {}), n;
423
+ }, N = function(n) {
448
424
  const e = {
449
425
  g50: ["40", "50", "60", "70", "90"],
450
426
  c50: ["41", "51", "61", "71", "91"],
@@ -454,13 +430,13 @@ w = new WeakMap(), f = new WeakMap(), y = new WeakMap(), s = new WeakSet(), M =
454
430
  p10: ["45", "55", "65", "75", "95"],
455
431
  p20: ["47", "57", "67", "77", "97"]
456
432
  };
457
- let n = null;
433
+ let t = null;
458
434
  for (let r in e)
459
- if (e[r].includes(t)) {
460
- n = r;
435
+ if (e[r].includes(n)) {
436
+ t = r;
461
437
  break;
462
438
  }
463
- return n ? [{
439
+ return t ? [{
464
440
  g50: "50 pennies (the big one)",
465
441
  c0: "50 pennies (the little one)",
466
442
  p1: "1 peso",
@@ -468,10 +444,10 @@ w = new WeakMap(), f = new WeakMap(), y = new WeakMap(), s = new WeakSet(), M =
468
444
  p5: "5 pesos",
469
445
  p10: "10 pesos",
470
446
  p20: "20 pesos"
471
- }[n], n] : [`Undefined value: ¿${t}?`, null];
472
- }, j = function(t) {
473
- return ["g50", "c50", "p1", "p2", "p5", "p10", "p20"].includes(t);
474
- }, A = function(t) {
447
+ }[t], t] : [`Undefined value: ¿${n}?`, null];
448
+ }, F = function(n) {
449
+ return ["g50", "c50", "p1", "p2", "p5", "p10", "p20"].includes(n);
450
+ }, j = function(n) {
475
451
  const e = {
476
452
  p20: ["80", "90", "a0", "b0"],
477
453
  p50: ["81", "91", "a1", "b1"],
@@ -480,99 +456,99 @@ w = new WeakMap(), f = new WeakMap(), y = new WeakMap(), s = new WeakSet(), M =
480
456
  p500: ["84", "94", "a4", "b4"],
481
457
  p1000: ["85", "95", "a5", "b5"]
482
458
  };
483
- let n = null;
459
+ let t = null;
484
460
  for (let r in e)
485
- if (e[r].includes(t)) {
486
- n = r;
461
+ if (e[r].includes(n)) {
462
+ t = r;
487
463
  break;
488
464
  }
489
- return n ? [{
465
+ return t ? [{
490
466
  p20: "20 pesos",
491
467
  p50: "50 pesos",
492
468
  p100: "100 pesos",
493
469
  p200: "200 pesos",
494
470
  p500: "500 pesos",
495
471
  p1000: "1000 pesos"
496
- }[n], n] : [`Undefined value: ¿${t}?`, null];
497
- }, L = function(t) {
498
- return ["p20", "p50", "p100", "p200", "p500", "p1000"].includes(t);
499
- }, Q = function(t) {
500
- return ["r20", "r50", "r100"].includes(t);
501
- }, m = function() {
472
+ }[t], t] : [`Undefined value: ¿${n}?`, null];
473
+ }, O = function(n) {
474
+ return ["p20", "p50", "p100", "p200", "p500", "p1000"].includes(n);
475
+ }, U = function(n) {
476
+ return ["r20", "r50", "r100"].includes(n);
477
+ }, A = function() {
502
478
  return ["r20", "r50", "r100", "r200", "r500"][this.__banknote_purse.recycler.banknote];
503
- }, R = function(t, e, n) {
504
- if (!t) return;
505
- let i = !0;
506
- if (a(this, s, j).call(this, t) && n === "coin") {
507
- if (typeof this.coins.tubes[t] > "u") return;
508
- e === "tube" ? this.coins.tubes[t] += 1 : e === "box" && (this.coins.box[t] += 1);
479
+ }, T = function(n, e, t) {
480
+ if (!n) return;
481
+ let s = !0;
482
+ if (a(this, i, F).call(this, n) && t === "coin") {
483
+ if (typeof this.coins.tubes[n] > "u") return;
484
+ e === "tube" ? this.coins.tubes[n] += 1 : e === "box" && (this.coins.box[n] += 1);
509
485
  let r = 0;
510
- ["g50", "c50"].includes(t) ? r = 0.5 : r += parseInt(t.slice(1)), this.coins.totals[t] += r, this.__money_session.inserted += r, this.coins.total += r;
511
- } else if (a(this, s, L).call(this, t) && n === "banknote") {
512
- if (typeof this.banknotes.recycler[t] > "u") return;
513
- e === "recycler" ? this.banknotes.recycler[t] += 1 : e === "stacker" && (this.banknotes.stacker[t] += 1);
514
- let r = parseInt(t.slice(1));
515
- this.banknotes.totals[t] += r, this.__money_session.inserted += r, this.banknotes.total += r;
516
- } else if (a(this, s, Q).call(this, t) && e === "out" && n === "banknote") {
517
- if (typeof this.banknotes.out[t.replace("r", "p")] > "u") return;
518
- this.banknotes.out[t.replace("r", "p")] += 1;
519
- let r = parseInt(t.slice(1));
520
- this.__money_session.retired += r, this.banknotes.recycler[t.replace("r", "p")] -= 1, this.banknotes.total -= r, i = !1, this.dispatch("session:money-dispensed", { type_money: t, retired: r, finish: !1, type: "banknotes" });
521
- }
522
- i && this.dispatch("session:money-request", {});
523
- }, z = function(t, e) {
524
- const n = parseInt(t[2], 16);
525
- return e.name = "Coin Inserted", e.no_code = 2, e.additional = { where: null, coin: null }, n === 1 ? (e.name = "Lever pressed", e.description = "Reject lever", e.no_code = 100, this.dispatch("coin-purse:reject-lever", {})) : n === 2 ? (e.name = "Reset coin purse", e.description = "The configuration of coin purse was reset", e.no_code = 101, this.dispatch("coin-purse:reset", {})) : n >= 64 && n <= 79 ? (e.name = "Coin inserted in profit box", e.additional.where = "box") : n >= 80 && n <= 95 ? (e.name = "Coin inserted in tube", e.additional.where = "tube") : n >= 96 && n <= 111 ? (e.name = "Unused coin", e.description = "Something come from coin changer but in MDB Docs is unused", e.additional.where = "unused") : n >= 112 && n <= 127 ? (e.name = "Coin rejected", e.additional.where = "rejected") : n >= 144 && n <= 159 ? (e.name = "Coin dispensed", e.additional.where = "out", e.description = `Undefined value: ¿${t[2]}?`) : (e.name = "Coin inserted", e.description = "Undefined status. Without information of this", e.no_code = 400), n === 1 || n === 2 || n >= 160 || n >= 128 && n <= 143 || ([e.description, e.additional.coin] = a(this, s, U).call(this, t[2]), e.no_code = 38 + n, a(this, s, R).call(this, e.additional.coin, e.additional.where, "coin"), ["tube", "out"].includes(e.additional.where) && this.dispatch("coin-purse:tubes", this.coins.tubes), this.dispatch("coin-purse:coin-event", this.coins)), e;
526
- }, W = function(t, e) {
527
- const n = parseInt(t[2], 16);
528
- return e.name = "Banknote Inserted", e.no_code = 2, e.additional = { where: null, banknote: null }, n === 42 ? (e.name = "Banknote dispensed", e.description = "Banknote dispensed by request.", e.additional.banknote = a(this, s, m).call(this), e.additional.where = "out", e.no_code = 200) : n >= 128 && n <= 143 ? (e.name = "Banknote inserted", e.additional.where = "stacker") : n >= 144 && n <= 159 ? (e.name = "Banknote inserted in pre stacker", e.additional.where = "tmp") : n >= 160 && n <= 175 ? (e.name = "Banknote rejected", e.additional.where = "nothing") : n >= 176 && n <= 191 && (e.name = "Banknote inserted", e.additional.where = "recycler"), n >= 128 && n <= 191 && ([e.description, e.additional.banknote] = a(this, s, A).call(this, t[2]), e.no_code = 74 + n), a(this, s, R).call(this, e.additional.banknote, e.additional.where, "banknote"), this.dispatch("banknote-purse:event-banknote", this.banknotes), e;
529
- }, K = function(t, e) {
530
- const n = parseInt(t, 16);
531
- return n === 1 ? (e.name = "Coin purse enabled", e.description = "Configuration complete, enabled", e.no_code = 3) : n === 0 ? (e.name = "Coin purse disabled", e.description = "Disabled by system request", e.no_code = 4) : (e.name = "Status unknown", e.description = "The response of coin purse doesn't identify successfully", e.no_code = 400), this.dispatch("coin-purse:config", { enabled: n === 1 }), e;
532
- }, V = function(t, e) {
533
- const n = parseInt(t[2], 16), i = parseInt(t[3], 16);
534
- return n === 0 ? (e.name = "Bill purse disabled", e.description = "Configuration complete, disabled") : n === 1 && (e.name = "Bill purse enabled", e.description = "Configuration complete, enabled"), i === 0 ? e.additional.scrow = "Scrow disabled, banknote received automatic" : i === 1 && (e.additional.scrow = "Scrow enabled, require manual action"), e.no_code = 5, this.dispatch("banknote-purse:config", { enabled: n === 1, scrow: i === 1 }), e;
535
- }, Y = function(t, e) {
486
+ ["g50", "c50"].includes(n) ? r = 0.5 : r += parseInt(n.slice(1)), this.coins.totals[n] += r, this.__money_session.inserted += r, this.coins.total += r;
487
+ } else if (a(this, i, O).call(this, n) && t === "banknote") {
488
+ if (typeof this.banknotes.recycler[n] > "u") return;
489
+ e === "recycler" ? this.banknotes.recycler[n] += 1 : e === "stacker" && (this.banknotes.stacker[n] += 1);
490
+ let r = parseInt(n.slice(1));
491
+ this.banknotes.totals[n] += r, this.__money_session.inserted += r, this.banknotes.total += r;
492
+ } else if (a(this, i, U).call(this, n) && e === "out" && t === "banknote") {
493
+ if (typeof this.banknotes.out[n.replace("r", "p")] > "u") return;
494
+ this.banknotes.out[n.replace("r", "p")] += 1;
495
+ let r = parseInt(n.slice(1));
496
+ this.__money_session.retired += r, this.banknotes.recycler[n.replace("r", "p")] -= 1, this.banknotes.total -= r, s = !1, this.dispatch("session:money-dispensed", { type_money: n, retired: r, finish: !1, type: "banknotes" });
497
+ }
498
+ s && this.dispatch("session:money-request", {});
499
+ }, L = function(n, e) {
500
+ const t = parseInt(n[2], 16);
501
+ return e.name = "Coin Inserted", e.no_code = 2, e.additional = { where: null, coin: null }, t === 1 ? (e.name = "Lever pressed", e.description = "Reject lever", e.no_code = 100, this.dispatch("coin-purse:reject-lever", {})) : t === 2 ? (e.name = "Reset coin purse", e.description = "The configuration of coin purse was reset", e.no_code = 101, this.dispatch("coin-purse:reset", {})) : t >= 64 && t <= 79 ? (e.name = "Coin inserted in profit box", e.additional.where = "box") : t >= 80 && t <= 95 ? (e.name = "Coin inserted in tube", e.additional.where = "tube") : t >= 96 && t <= 111 ? (e.name = "Unused coin", e.description = "Something come from coin changer but in MDB Docs is unused", e.additional.where = "unused") : t >= 112 && t <= 127 ? (e.name = "Coin rejected", e.additional.where = "rejected") : t >= 144 && t <= 159 ? (e.name = "Coin dispensed", e.additional.where = "out", e.description = `Undefined value: ¿${n[2]}?`) : (e.name = "Coin inserted", e.description = "Undefined status. Without information of this", e.no_code = 400), t === 1 || t === 2 || t >= 160 || t >= 128 && t <= 143 || ([e.description, e.additional.coin] = a(this, i, N).call(this, n[2]), e.no_code = 38 + t, a(this, i, T).call(this, e.additional.coin, e.additional.where, "coin"), ["tube", "out"].includes(e.additional.where) && this.dispatch("coin-purse:tubes", this.coins.tubes), this.dispatch("coin-purse:coin-event", this.coins)), e;
502
+ }, z = function(n, e) {
503
+ const t = parseInt(n[2], 16);
504
+ return e.name = "Banknote Inserted", e.no_code = 2, e.additional = { where: null, banknote: null }, t === 42 ? (e.name = "Banknote dispensed", e.description = "Banknote dispensed by request.", e.additional.banknote = a(this, i, A).call(this), e.additional.where = "out", e.no_code = 200) : t >= 128 && t <= 143 ? (e.name = "Banknote inserted", e.additional.where = "stacker") : t >= 144 && t <= 159 ? (e.name = "Banknote inserted in pre stacker", e.additional.where = "tmp") : t >= 160 && t <= 175 ? (e.name = "Banknote rejected", e.additional.where = "nothing") : t >= 176 && t <= 191 && (e.name = "Banknote inserted", e.additional.where = "recycler"), t >= 128 && t <= 191 && ([e.description, e.additional.banknote] = a(this, i, j).call(this, n[2]), e.no_code = 74 + t), a(this, i, T).call(this, e.additional.banknote, e.additional.where, "banknote"), this.dispatch("banknote-purse:event-banknote", this.banknotes), e;
505
+ }, W = function(n, e) {
506
+ const t = parseInt(n, 16);
507
+ return t === 1 ? (e.name = "Coin purse enabled", e.description = "Configuration complete, enabled", e.no_code = 3) : t === 0 ? (e.name = "Coin purse disabled", e.description = "Disabled by system request", e.no_code = 4) : (e.name = "Status unknown", e.description = "The response of coin purse doesn't identify successfully", e.no_code = 400), this.dispatch("coin-purse:config", { enabled: t === 1 }), e;
508
+ }, K = function(n, e) {
509
+ const t = parseInt(n[2], 16), s = parseInt(n[3], 16);
510
+ return t === 0 ? (e.name = "Bill purse disabled", e.description = "Configuration complete, disabled") : t === 1 && (e.name = "Bill purse enabled", e.description = "Configuration complete, enabled"), s === 0 ? e.additional.scrow = "Scrow disabled, banknote received automatic" : s === 1 && (e.additional.scrow = "Scrow enabled, require manual action"), e.no_code = 5, this.dispatch("banknote-purse:config", { enabled: t === 1, scrow: s === 1 }), e;
511
+ }, V = function(n, e) {
536
512
  e.no_code = 6;
537
- const [n, i, r, c, o, l] = [
538
- parseInt(t[2], 16),
539
- parseInt(t[3], 16),
540
- parseInt(t[4], 16),
541
- parseInt(t[5], 16),
542
- parseInt(t[6], 16),
543
- parseInt(t[7], 16)
513
+ const [t, s, r, c, o, u] = [
514
+ parseInt(n[2], 16),
515
+ parseInt(n[3], 16),
516
+ parseInt(n[4], 16),
517
+ parseInt(n[5], 16),
518
+ parseInt(n[6], 16),
519
+ parseInt(n[7], 16)
544
520
  ];
545
521
  return e.additional = {
546
- coins: { g50: n, c50: i, p1: r, p2: c, p5: o, p10: l }
547
- }, this.coins.tubes.g50 = n, this.coins.tubes.c50 = i, this.coins.tubes.p1 = r, this.coins.tubes.p2 = c, this.coins.tubes.p5 = o, this.coins.tubes.p10 = l, this.coins.totals.g50 = (this.coins.box.g50 + n) * 0.5, this.coins.totals.c50 = (this.coins.box.c50 + i) * 0.5, this.coins.totals.p1 = this.coins.box.p1 + r, this.coins.totals.p2 = (this.coins.box.p2 + c) * 2, this.coins.totals.p5 = (this.coins.box.p5 + o) * 5, this.coins.totals.p10 = (this.coins.box.p10 + l) * 10, this.coins.total = this.coins.totals.g50 + this.coins.totals.c50 + this.coins.totals.p1 + this.coins.totals.p2 + this.coins.totals.p5 + this.coins.totals.p10, e.name = "Read tubes", e.description = "Quantity of coins approximated", this.dispatch("coin-purse:tubes", this.coins.tubes), e;
548
- }, G = function(t, e) {
522
+ coins: { g50: t, c50: s, p1: r, p2: c, p5: o, p10: u }
523
+ }, this.coins.tubes.g50 = t, this.coins.tubes.c50 = s, this.coins.tubes.p1 = r, this.coins.tubes.p2 = c, this.coins.tubes.p5 = o, this.coins.tubes.p10 = u, this.coins.totals.g50 = (this.coins.box.g50 + t) * 0.5, this.coins.totals.c50 = (this.coins.box.c50 + s) * 0.5, this.coins.totals.p1 = this.coins.box.p1 + r, this.coins.totals.p2 = (this.coins.box.p2 + c) * 2, this.coins.totals.p5 = (this.coins.box.p5 + o) * 5, this.coins.totals.p10 = (this.coins.box.p10 + u) * 10, this.coins.total = this.coins.totals.g50 + this.coins.totals.c50 + this.coins.totals.p1 + this.coins.totals.p2 + this.coins.totals.p5 + this.coins.totals.p10, e.name = "Read tubes", e.description = "Quantity of coins approximated", this.dispatch("coin-purse:tubes", this.coins.tubes), e;
524
+ }, Y = function(n, e) {
549
525
  e.no_code = 7;
550
- const [n, i, r, c, o, l] = [
551
- parseInt(t[2], 16),
552
- parseInt(t[3], 16),
553
- parseInt(t[4], 16),
554
- parseInt(t[5], 16),
555
- parseInt(t[6], 16),
556
- parseInt(t[7], 16)
526
+ const [t, s, r, c, o, u] = [
527
+ parseInt(n[2], 16),
528
+ parseInt(n[3], 16),
529
+ parseInt(n[4], 16),
530
+ parseInt(n[5], 16),
531
+ parseInt(n[6], 16),
532
+ parseInt(n[7], 16)
557
533
  ];
558
534
  return e.additional = {
559
- banknotes: { b20: n, b50: i, b100: r, b200: c, b500: o, b1000: l }
560
- }, this.banknotes.recycler.p20 = n, this.banknotes.recycler.p50 = i, this.banknotes.recycler.p100 = r, this.banknotes.recycler.p200 = c, this.banknotes.recycler.p500 = o, this.banknotes.recycler.p1000 = l, this.banknotes.totals.p20 = (this.banknotes.stacker.p20 + n) * 20, this.banknotes.totals.p50 = (this.banknotes.stacker.p50 + i) * 50, this.banknotes.totals.p100 = (this.banknotes.stacker.p100 + r) * 100, this.banknotes.totals.p200 = (this.banknotes.stacker.p200 + c) * 200, this.banknotes.totals.p500 = (this.banknotes.stacker.p500 + o) * 500, this.banknotes.totals.p1000 = (this.banknotes.stacker.p1000 + l) * 1e3, this.banknotes.total = this.banknotes.totals.p20 + this.banknotes.totals.p50 + this.banknotes.totals.p100 + this.banknotes.totals.p200 + this.banknotes.totals.p500 + this.banknotes.totals.p1000, e.name = "Read recycler", e.description = "Quantity of banknotes approximated", this.dispatch("banknote-purse:recycler", this.banknotes.recycler), e;
561
- }, J = function(t, e) {
562
- const n = parseInt(t, 16);
563
- return n === 1 ? e.name = "Banknote accepted" : n === 0 ? e.name = "Banknote rejected" : e.name = "Unknown status banknote", e.no_code = 8, this.dispatch("banknote-purse:banknote-scrow-status", { status: n === 1 }), e;
564
- }, X = function(t, e) {
565
- const [n, i, r, c, o, l] = [
566
- parseInt(t[2], 16),
567
- parseInt(t[3], 16),
568
- parseInt(t[4], 16),
569
- parseInt(t[5], 16),
570
- parseInt(t[6], 16),
571
- parseInt(t[7], 16)
572
- ], h = n * 20 + i * 50 + r * 100 + c * 200 + o * 500 + l * 1e3;
573
- return e.name = "Banknotes dispensed", e.description = h > 0 ? "Banknotes dispensed by request" : "No banknotes dispensed, recycler empty", e.no_code = 9, e.additional = {
574
- banknotes: { b20: n, b50: i, b100: r, b200: c, b500: o, b1000: l },
575
- total_dispensed: h
535
+ banknotes: { b20: t, b50: s, b100: r, b200: c, b500: o, b1000: u }
536
+ }, this.banknotes.recycler.p20 = t, this.banknotes.recycler.p50 = s, this.banknotes.recycler.p100 = r, this.banknotes.recycler.p200 = c, this.banknotes.recycler.p500 = o, this.banknotes.recycler.p1000 = u, this.banknotes.totals.p20 = (this.banknotes.stacker.p20 + t) * 20, this.banknotes.totals.p50 = (this.banknotes.stacker.p50 + s) * 50, this.banknotes.totals.p100 = (this.banknotes.stacker.p100 + r) * 100, this.banknotes.totals.p200 = (this.banknotes.stacker.p200 + c) * 200, this.banknotes.totals.p500 = (this.banknotes.stacker.p500 + o) * 500, this.banknotes.totals.p1000 = (this.banknotes.stacker.p1000 + u) * 1e3, this.banknotes.total = this.banknotes.totals.p20 + this.banknotes.totals.p50 + this.banknotes.totals.p100 + this.banknotes.totals.p200 + this.banknotes.totals.p500 + this.banknotes.totals.p1000, e.name = "Read recycler", e.description = "Quantity of banknotes approximated", this.dispatch("banknote-purse:recycler", this.banknotes.recycler), e;
537
+ }, m = function(n, e) {
538
+ const t = parseInt(n, 16);
539
+ return t === 1 ? e.name = "Banknote accepted" : t === 0 ? e.name = "Banknote rejected" : e.name = "Unknown status banknote", e.no_code = 8, this.dispatch("banknote-purse:banknote-scrow-status", { status: t === 1 }), e;
540
+ }, G = function(n, e) {
541
+ const [t, s, r, c, o, u] = [
542
+ parseInt(n[2], 16),
543
+ parseInt(n[3], 16),
544
+ parseInt(n[4], 16),
545
+ parseInt(n[5], 16),
546
+ parseInt(n[6], 16),
547
+ parseInt(n[7], 16)
548
+ ], q = t * 20 + s * 50 + r * 100 + c * 200 + o * 500 + u * 1e3;
549
+ return e.name = "Banknotes dispensed", e.description = q > 0 ? "Banknotes dispensed by request" : "No banknotes dispensed, recycler empty", e.no_code = 9, e.additional = {
550
+ banknotes: { b20: t, b50: s, b100: r, b200: c, b500: o, b1000: u },
551
+ total_dispensed: q
576
552
  }, this.dispatch("session:money-dispensed", {
577
553
  type_money: null,
578
554
  retired: null,
@@ -580,7 +556,7 @@ w = new WeakMap(), f = new WeakMap(), y = new WeakMap(), s = new WeakSet(), M =
580
556
  type: "banknotes",
581
557
  data: e
582
558
  }), e;
583
- }, Z = function(t, e) {
559
+ }, H = function(n, e) {
584
560
  return e.name = "Coins dispensed", e.no_code = 10, e.description = "Coins dispensed by request", isNaN(this.__sale.last_change) && (this.__sale.last_change = 0), this.__money_session.retired += this.__sale.last_change, this.dispatchAsync(
585
561
  "session:money-dispensed",
586
562
  {
@@ -591,139 +567,129 @@ w = new WeakMap(), f = new WeakMap(), y = new WeakMap(), s = new WeakSet(), M =
591
567
  },
592
568
  500
593
569
  ), e;
594
- }, g = function(t, e) {
595
- const n = parseInt(t, 16);
596
- return n === 1 ? (e.name = "Product not delivered", e.description = "The product requested wasn't delivered", e.no_code = 11, this.__internal__.dispense.status = !1) : n === 0 ? (e.name = "Product delivered", e.description = "The product requested was delivered", e.no_code = 12, this.__internal__.dispense.status = !0) : (e.name = "Unknown status product", e.description = "The response of product doesn't identify successfully", e.no_code = 400, this.__internal__.dispense.status = !1), this.dispatch("dispensed", {}), e;
597
- }, $ = function(t, e) {
598
- let n = "closed";
599
- return t === "db" ? (e.name = "Door closed", e.no_code = 13) : t === "dc" ? (e.name = "Door open", e.no_code = 14, n = "open") : (e.name = "Unknown status door", e.description = "The response of door doesn't identify successfully", e.no_code = 400, n = "unknown"), this.__internal__.device.door_open = n === "open", this.dispatch("event:door", { open: n === "open" }), this.dispatch("door:event", { open: n === "open" }), e;
600
- }, ee = function(t, e) {
601
- const n = parseInt(t[2], 16) * 255, i = parseInt(t[3], 16), r = (n + i) * 0.1;
570
+ }, J = function(n, e) {
571
+ const t = parseInt(n, 16);
572
+ return t === 1 ? (e.name = "Product not delivered", e.description = "The product requested wasn't delivered", e.no_code = 11, this.__internal__.dispense.status = !1) : t === 0 ? (e.name = "Product delivered", e.description = "The product requested was delivered", e.no_code = 12, this.__internal__.dispense.status = !0) : (e.name = "Unknown status product", e.description = "The response of product doesn't identify successfully", e.no_code = 400, this.__internal__.dispense.status = !1), this.dispatch("dispensed", {}), e;
573
+ }, X = function(n, e) {
574
+ let t = "closed";
575
+ return n === "db" ? (e.name = "Door closed", e.no_code = 13) : n === "dc" ? (e.name = "Door open", e.no_code = 14, t = "open") : (e.name = "Unknown status door", e.description = "The response of door doesn't identify successfully", e.no_code = 400, t = "unknown"), this.__internal__.device.door_open = t === "open", this.dispatch("event:door", { open: t === "open" }), this.dispatch("door:event", { open: t === "open" }), e;
576
+ }, Z = function(n, e) {
577
+ const t = parseInt(n[2], 16) * 255, s = parseInt(n[3], 16), r = (t + s) * 0.1;
602
578
  return e.no_code = 15, e.name = "Temperature status", e.description = `Temperature: ${r}`, e.additional = {
603
- high: n,
604
- low: i,
579
+ high: t,
580
+ low: s,
605
581
  temperature: parseFloat(r.toString())
606
582
  }, this.dispatch("status:temperature", e.additional), e;
607
- }, te = function(t, e) {
608
- const n = parseInt(t, 16);
609
- let i = "unknown";
610
- return n === 1 ? (e.name = "Relay on", e.description = "Relay on", e.no_code = 16, i = "on") : n === 0 ? (e.name = "Relay off", e.description = "Relay off", e.no_code = 17, i = "off") : (e.name = "Status unknown", e.description = "Status unknown", e.no_code = 400), this.dispatch("status:relay", { enabled: i === "on" }), e;
611
- }, ne = function(t, e) {
612
- const n = parseInt(t[2], 16);
613
- if (e.no_code = 20 + n, e.name = "Status unknown", e.description = "The status of card reader does not identified correctly", n === 0)
583
+ }, g = function(n, e) {
584
+ const t = parseInt(n, 16);
585
+ let s = "unknown";
586
+ return t === 1 ? (e.name = "Relay on", e.description = "Relay on", e.no_code = 16, s = "on") : t === 0 ? (e.name = "Relay off", e.description = "Relay off", e.no_code = 17, s = "off") : (e.name = "Status unknown", e.description = "Status unknown", e.no_code = 400), this.dispatch("status:relay", { enabled: s === "on" }), e;
587
+ }, ee = function(n, e) {
588
+ const t = parseInt(n[2], 16);
589
+ if (e.no_code = 20 + t, e.name = "Status unknown", e.description = "The status of card reader does not identified correctly", t === 0)
614
590
  e.request += ":disable", e.name = "Card reader disabled", e.description = "Card reader device was disabled successfully";
615
- else if (n === 1 || n === 2)
591
+ else if (t === 1 || t === 2)
616
592
  e.request += ":dispense", e.name = "Card reader enabled", e.description = "Card reader device is now enabled";
617
- else if (n === 3)
593
+ else if (t === 3)
618
594
  e.request += ":pre-authorize", e.name = "Pre-authorized credit", e.description = "The pre credit was authorized successfully";
619
- else if (n === 4)
595
+ else if (t === 4)
620
596
  e.request += ":cancel", e.name = "Cancellation in progress", e.description = "Cancellation request done successfully";
621
- else if (n === 5)
597
+ else if (t === 5)
622
598
  e.request += ":sell", e.name = "Sell approved", e.description = "Sell approved, starting dispense product";
623
- else if (n === 6)
599
+ else if (t === 6)
624
600
  e.request += ":sell", e.name = "Sell denied", e.description = "This sell was denied, try again";
625
- else if (n === 7)
601
+ else if (t === 7)
626
602
  e.request += ":end", e.name = "Session ended", e.description = "The session ended";
627
- else if (n === 8)
603
+ else if (t === 8)
628
604
  e.request += ":cancel", e.name = "Cancelled", e.description = "Cancellation complete";
629
- else if (n === 10) {
630
- const i = parseInt(t[8], 16);
631
- i === 1 ? (e.no_code = 30, e.name = "product not dispensed", e.description = "The product requested wasn't delivered") : i === 0 ? (e.no_code = 31, e.name = "product dispensed", e.description = "The product requested was delivered") : (e.name = "finished-unknown", e.no_code = 400);
605
+ else if (t === 10) {
606
+ const s = parseInt(n[8], 16);
607
+ s === 1 ? (e.no_code = 30, e.name = "product not dispensed", e.description = "The product requested wasn't delivered") : s === 0 ? (e.no_code = 31, e.name = "product dispensed", e.description = "The product requested was delivered") : (e.name = "finished-unknown", e.no_code = 400);
632
608
  } else
633
609
  e.no_code = 400;
634
610
  return this.dispatch("card-reader:event", e), e;
635
- }, p = function(t, e) {
636
- return this.appendToQueue(a(this, s, T).call(this, t), e);
637
- }, T = function(t) {
638
- return t[11] = this.serialBoardroidSumHex(t), t.map((e, n) => {
639
- t[n] = this.hexMaker(e);
640
- }), t;
641
- }, se = function({ enable: t = !1, scrow: e = !1 } = {}) {
642
- const n = t ? "FF" : "00", i = e ? "FF" : "00";
643
- return ["F1", "C0", n, n, i, i, "00", "00", "00", "00", "F2", "00"];
644
- }, ie = function({ enable: t = !1, scrow: e = !1 } = {}) {
645
- return ["F1", "C0", t ? "01" : "00", e ? "01" : "00", "00", "00", "00", "00", "00", "00", "F2", "00"];
646
- }, re = function(t = 1) {
647
- if (t < 1) throw new Error("No banknotes to dispense");
648
- return t = this.decToHex(t), ["F1", "C5", this.decToHex(this.__banknote_purse.recycler.banknote.toString()), t, "00", "00", "00", "00", "00", "00", "F2", "00"];
649
- }, ae = function({ $_20: t = 0, $_50: e = 0, $_100: n = 0, $_200: i = 0, $_500: r = 0, $_1000: c = 0 } = {}) {
650
- if ([t, e, n, i, r, c].some((o) => isNaN(o) || typeof o == "string"))
651
- throw new Error("One of the values is not a number");
652
- if (t < 1 && e < 1 && n < 1 && i < 1 && r < 1 && c < 1)
653
- throw new Error("No banknotes to dispense");
654
- return [t, e, n, i, r, c] = [
655
- this.decToHex(t),
656
- this.decToHex(e),
657
- this.decToHex(n),
658
- this.decToHex(i),
659
- this.decToHex(r),
660
- this.decToHex(c)
661
- ], ["F1", "C5", t, e, n, i, r, c, "00", "00", "F2", "00"];
662
- }, B = function() {
663
- _(this, w, !1), _(this, f, 0), _(this, y, 0);
611
+ }, ne = function({ enable: n = !1, scrow: e = !1 } = {}) {
612
+ return d.banknotePurseICTConfigure({ enable: n, scrow: e });
613
+ }, te = function({ enable: n = !1, scrow: e = !1 } = {}) {
614
+ return d.banknotePurseOtherConfigure({ enable: n, scrow: e });
615
+ }, ie = function(n = 1) {
616
+ if (n < 1) throw new Error("No banknotes to dispense");
617
+ const e = [20, 50, 100, 200, 500][this.__banknote_purse.recycler.banknote];
618
+ return d.banknotePurseICTDispense({ quantity: n, denomination: e });
619
+ }, se = function({ $_20: n = 0, $_50: e = 0, $_100: t = 0, $_200: s = 0, $_500: r = 0, $_1000: c = 0 } = {}) {
620
+ return d.banknotePurseOtherDispense({
621
+ $20: n,
622
+ $50: e,
623
+ $100: t,
624
+ $200: s,
625
+ $500: r,
626
+ $1000: c
627
+ });
628
+ }, R = function() {
629
+ b(this, f, !1), b(this, _, 0), b(this, k, 0);
664
630
  }, /**
665
631
  *
666
632
  * @param {null|object} dispensed
667
633
  * @param {number} limit
668
634
  */
669
- I = function({ dispensed: t = null, limit: e = 80 } = {}) {
670
- _(this, y, Math.round(v(this, f) * 100 / e)), this.dispatch("percentage:test", { percentage: v(this, y), dispensed: t });
671
- }, oe = function(t) {
672
- const e = ["20", "50", "100", "200", "500"], n = this.__banknote_purse.recycler.banknote, i = "$_" + e[n], r = parseInt(e[n]), c = this.banknotes.recycler[`p${e[n]}`], o = Math.min(Math.floor(t / r), c), l = {
635
+ C = function({ dispensed: n = null, limit: e = 80 } = {}) {
636
+ b(this, k, Math.round(y(this, _) * 100 / e)), this.dispatch("percentage:test", { percentage: y(this, k), dispensed: n });
637
+ }, re = function(n) {
638
+ const e = ["20", "50", "100", "200", "500"], t = this.__banknote_purse.recycler.banknote, s = "$_" + e[t], r = parseInt(e[t]), c = this.banknotes.recycler[`p${e[t]}`], o = Math.min(Math.floor(n / r), c), u = {
673
639
  banknotes: { $_20: 0, $_50: 0, $_100: 0, $_200: 0, $_500: 0, $_1000: 0 },
674
- pending: t,
640
+ pending: n,
675
641
  will_dispense: o > 0
676
642
  };
677
- return this.totalInRecycler === 0 || o < 1 || t === 0 || (l.banknotes[i] = o, l.pending = parseFloat((t - o * r).toFixed(2))), l;
678
- }, ce = function(t) {
643
+ return this.totalInRecycler === 0 || o < 1 || n === 0 || (u.banknotes[s] = o, u.pending = parseFloat((n - o * r).toFixed(2))), u;
644
+ }, ae = function(n) {
679
645
  const e = {
680
646
  banknotes: { $_20: 0, $_50: 0, $_100: 0, $_200: 0, $_500: 0, $_1000: 0 },
681
- pending: t,
647
+ pending: n,
682
648
  will_dispense: !1
683
649
  };
684
- if (this.totalInRecycler === 0 || t === 0) return e;
685
- const n = (i, r) => {
650
+ if (this.totalInRecycler === 0 || n === 0) return e;
651
+ const t = (s, r) => {
686
652
  if (this.banknotes.recycler[r] > 0) {
687
- const c = Math.floor(e.pending / i), o = Math.min(c, this.banknotes.recycler[r]);
688
- e.banknotes[`$_${i}`] = o, e.pending = parseFloat((e.pending - o * i).toFixed(2));
653
+ const c = Math.floor(e.pending / s), o = Math.min(c, this.banknotes.recycler[r]);
654
+ e.banknotes[`$_${s}`] = o, e.pending = parseFloat((e.pending - o * s).toFixed(2));
689
655
  }
690
656
  };
691
- return n(1e3, "p1000"), n(500, "p500"), n(200, "p200"), n(100, "p100"), n(50, "p50"), n(20, "p20"), e.will_dispense = Object.values(e.banknotes).some((i) => i > 0), e;
692
- }, S = function(t) {
693
- return this.hasRecycler ? a(this, s, x).call(this) ? a(this, s, oe).call(this, t) : a(this, s, ce).call(this, t) : {
657
+ return t(1e3, "p1000"), t(500, "p500"), t(200, "p200"), t(100, "p100"), t(50, "p50"), t(20, "p20"), e.will_dispense = Object.values(e.banknotes).some((s) => s > 0), e;
658
+ }, P = function(n) {
659
+ return this.hasRecycler ? a(this, i, v).call(this) ? a(this, i, re).call(this, n) : a(this, i, ae).call(this, n) : {
694
660
  banknotes: { $_20: 0, $_50: 0, $_100: 0, $_200: 0, $_500: 0, $_1000: 0 },
695
- pending: t,
661
+ pending: n,
696
662
  will_dispense: !1
697
663
  };
698
- }, P = function(t) {
664
+ }, $ = function(n) {
699
665
  const e = {
700
666
  coins: { $_50c: 0, $_1: 0, $_2: 0, $_5: 0, $_10: 0 },
701
- pending: t,
667
+ pending: n,
702
668
  will_dispense: !1
703
669
  };
704
- if (!this.hasCoinPurse || t <= 0 || this.totalInTubes === 0) return e;
705
- const n = (i, r, c = null) => {
670
+ if (!this.hasCoinPurse || n <= 0 || this.totalInTubes === 0) return e;
671
+ const t = (s, r, c = null) => {
706
672
  if (this.coins.tubes[r] > 0) {
707
- c === null && (c = "$_" + i);
708
- const o = Math.floor(e.pending / i), l = Math.min(o, this.coins.tubes[r]);
709
- e.coins[c] = l, e.pending = parseFloat((e.pending - l * i).toFixed(2));
673
+ c === null && (c = "$_" + s);
674
+ const o = Math.floor(e.pending / s), u = Math.min(o, this.coins.tubes[r]);
675
+ e.coins[c] = u, e.pending = parseFloat((e.pending - u * s).toFixed(2));
710
676
  }
711
677
  };
712
- return n(10, "p10"), n(5, "p5"), n(2, "p2"), n(1, "p1"), n(0.5, "g50", "$_50c"), e.will_dispense = Object.values(e.coins).some((i) => i > 0), e;
713
- }, E = async function(t = null) {
714
- if (!a(this, s, N).call(this)) throw new Error("Change not available");
715
- let e = this.change, n = this.change;
716
- if (t !== null && (e = t, n = t), n <= 0) return !1;
717
- const i = a(this, s, S).call(this, n);
718
- n = i.pending;
719
- const r = a(this, s, P).call(this, n);
720
- return n = r.pending, n > 0 && this.dispatch("change:pending", { pending: n }), this.dispatch("change:dispense", {
721
- recycler: i.banknotes,
678
+ return t(10, "p10"), t(5, "p5"), t(2, "p2"), t(1, "p1"), t(0.5, "g50", "$_50c"), e.will_dispense = Object.values(e.coins).some((s) => s > 0), e;
679
+ }, B = async function(n = null) {
680
+ if (!a(this, i, S).call(this)) throw new Error("Change not available");
681
+ let e = this.change, t = this.change;
682
+ if (n !== null && (e = n, t = n), t <= 0) return !1;
683
+ const s = a(this, i, P).call(this, t);
684
+ t = s.pending;
685
+ const r = a(this, i, $).call(this, t);
686
+ return t = r.pending, t > 0 && this.dispatch("change:pending", { pending: t }), this.dispatch("change:dispense", {
687
+ recycler: s.banknotes,
722
688
  coins: r.coins,
723
- pending: n,
724
- delivery: e - n
725
- }), n === e ? !1 : (i.will_dispense && await this.banknotePurseDispense(i.banknotes), r.will_dispense && await this.coinPurseDispense(r.coins), !0);
689
+ pending: t,
690
+ delivery: e - t
691
+ }), t === e ? !1 : (s.will_dispense && await this.banknotePurseDispense(s.banknotes), r.will_dispense && await this.coinPurseDispense(r.coins), !0);
726
692
  };
727
693
  export {
728
- _e as Boardroid
694
+ he as Boardroid
729
695
  };