@danidoble/webserial 4.2.15 → 4.2.16

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.
@@ -1,40 +1,40 @@
1
- var ue = Object.defineProperty;
1
+ var de = Object.defineProperty;
2
2
  var Q = (l) => {
3
3
  throw TypeError(l);
4
4
  };
5
- var he = (l, e, t) => e in l ? ue(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
6
- var U = (l, e, t) => he(l, typeof e != "symbol" ? e + "" : e, t), R = (l, e, t) => e.has(l) || Q("Cannot " + t);
7
- var v = (l, e, t) => (R(l, e, "read from private field"), t ? t.call(l) : e.get(l)), I = (l, e, t) => e.has(l) ? Q("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(l) : e.set(l, t), $ = (l, e, t, n) => (R(l, e, "write to private field"), n ? n.call(l, t) : e.set(l, t), t), a = (l, e, t) => (R(l, e, "access private method"), t);
8
- function de(l = 100) {
5
+ var fe = (l, e, t) => e in l ? de(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t;
6
+ var R = (l, e, t) => fe(l, typeof e != "symbol" ? e + "" : e, t), N = (l, e, t) => e.has(l) || Q("Cannot " + t);
7
+ var v = (l, e, t) => (N(l, e, "read from private field"), t ? t.call(l) : e.get(l)), L = (l, e, t) => e.has(l) ? Q("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(l) : e.set(l, t), $ = (l, e, t, n) => (N(l, e, "write to private field"), n ? n.call(l, t) : e.set(l, t), t), a = (l, e, t) => (N(l, e, "access private method"), t);
8
+ function pe(l = 100) {
9
9
  return new Promise((e) => setTimeout(() => e(), l));
10
10
  }
11
- function Se() {
11
+ function ke() {
12
12
  return "serial" in navigator;
13
13
  }
14
- function ke() {
14
+ function De() {
15
15
  return "geolocation" in navigator;
16
16
  }
17
- function xe() {
17
+ function Ee() {
18
18
  return "crypto" in window;
19
19
  }
20
- function De(l = 1) {
20
+ function Te(l = 1) {
21
21
  return l * 1e3;
22
22
  }
23
- function Ee(l) {
23
+ function Ae(l) {
24
24
  return l == null || l === "";
25
25
  }
26
- var S, x, s, ee, te, c, j, m, p, L, o, O, M;
26
+ var x, k, s, ee, te, c, O, y, m, U, o, q, B;
27
27
  const i = class i {
28
28
  static status(e = null) {
29
29
  var n, r;
30
30
  if (!a(n = i, s, c).call(n, e)) return !1;
31
31
  let t = [];
32
- switch (v(i, S)) {
32
+ switch (v(i, x)) {
33
33
  case "locker":
34
34
  t = ["0", "8"];
35
35
  break;
36
36
  case "boardroid":
37
- t = ["2", (5 + v(i, x)).toString(16).toUpperCase()];
37
+ t = ["2", (5 + v(i, k)).toString(16).toUpperCase()];
38
38
  break;
39
39
  case "jofemar":
40
40
  t = ["6"];
@@ -48,7 +48,7 @@ const i = class i {
48
48
  var n, r;
49
49
  if (!a(n = i, s, c).call(n, e)) return !1;
50
50
  let t = [];
51
- switch (v(i, S)) {
51
+ switch (v(i, x)) {
52
52
  case "locker":
53
53
  t = ["0", "7", "4", "4", "4"];
54
54
  break;
@@ -67,7 +67,7 @@ const i = class i {
67
67
  var n, r;
68
68
  if (!a(n = i, s, c).call(n, e)) return !1;
69
69
  let t = [];
70
- switch (v(i, S)) {
70
+ switch (v(i, x)) {
71
71
  case "locker":
72
72
  t = ["0", "7", "5", "5", "5"];
73
73
  break;
@@ -84,26 +84,26 @@ const i = class i {
84
84
  }
85
85
  static gateInactive(e = null) {
86
86
  var t;
87
- if (!a(t = i, s, c).call(t, e) || !a(this, s, j).call(this)) return !1;
87
+ if (!a(t = i, s, c).call(t, e) || !a(this, s, O).call(this)) return !1;
88
88
  a(this, s, o).call(this, ["0", "7", "5", "5", "5"]);
89
89
  }
90
90
  static gateConfigured(e = null) {
91
91
  var t;
92
- if (!a(t = i, s, c).call(t, e) || !a(this, s, j).call(this)) return !1;
92
+ if (!a(t = i, s, c).call(t, e) || !a(this, s, O).call(this)) return !1;
93
93
  a(this, s, o).call(this, ["0", "6"]);
94
94
  }
95
95
  static keyPressed(e = null) {
96
- var _, f, h;
97
- if (!a(_ = i, s, c).call(_, e) || !a(f = i, s, p).call(f)) return !1;
98
- const t = ["30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "2A", "23", "41", "42", "43", "44"], n = (128 + v(i, x)).toString(16), r = Math.floor(Math.random() * 15);
96
+ var _, g, h;
97
+ if (!a(_ = i, s, c).call(_, e) || !a(g = i, s, m).call(g)) return !1;
98
+ const t = ["30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "2A", "23", "41", "42", "43", "44"], n = (128 + v(i, k)).toString(16), r = Math.floor(Math.random() * 15);
99
99
  a(h = i, s, o).call(h, ["2", n, "54", t[r]]);
100
100
  }
101
101
  static doorOpened(e = null) {
102
102
  var r, _;
103
- if (!a(r = i, s, c).call(r, e) || !a(this, s, L).call(this)) return !1;
103
+ if (!a(r = i, s, c).call(r, e) || !a(this, s, U).call(this)) return !1;
104
104
  let t = [];
105
- const n = (128 + v(i, x)).toString(16);
106
- switch (v(i, S)) {
105
+ const n = (128 + v(i, k)).toString(16);
106
+ switch (v(i, x)) {
107
107
  case "boardroid":
108
108
  t = ["2", "D8", "dc"];
109
109
  break;
@@ -115,10 +115,10 @@ const i = class i {
115
115
  }
116
116
  static doorClosed(e = null) {
117
117
  var r, _;
118
- if (!a(r = i, s, c).call(r, e) || !a(this, s, L).call(this)) return !1;
118
+ if (!a(r = i, s, c).call(r, e) || !a(this, s, U).call(this)) return !1;
119
119
  let t = [];
120
- const n = (128 + v(i, x)).toString(16);
121
- switch (v(i, S)) {
120
+ const n = (128 + v(i, k)).toString(16);
121
+ switch (v(i, x)) {
122
122
  case "boardroid":
123
123
  t = ["2", "D8", "db"];
124
124
  break;
@@ -130,34 +130,34 @@ const i = class i {
130
130
  }
131
131
  static channelDisconnected(e = null) {
132
132
  var n, r, _;
133
- if (!a(n = i, s, c).call(n, e) || !a(r = i, s, p).call(r)) return !1;
134
- const t = (128 + v(i, x)).toString(16);
133
+ if (!a(n = i, s, c).call(n, e) || !a(r = i, s, m).call(r)) return !1;
134
+ const t = (128 + v(i, k)).toString(16);
135
135
  a(_ = i, s, o).call(_, ["2", t, "43", "43", "43", "FD"]);
136
136
  }
137
137
  static channelConnected(e = null) {
138
138
  var n, r, _;
139
- if (!a(n = i, s, c).call(n, e) || !a(r = i, s, p).call(r)) return !1;
140
- const t = (128 + v(i, x)).toString(16);
139
+ if (!a(n = i, s, c).call(n, e) || !a(r = i, s, m).call(r)) return !1;
140
+ const t = (128 + v(i, k)).toString(16);
141
141
  a(_ = i, s, o).call(_, ["2", t, "43", "43", "43", "FC"]);
142
142
  }
143
143
  static channelEmpty(e = null) {
144
144
  var n, r, _;
145
- if (!a(n = i, s, c).call(n, e) || !a(r = i, s, p).call(r)) return !1;
146
- const t = (128 + v(i, x)).toString(16);
145
+ if (!a(n = i, s, c).call(n, e) || !a(r = i, s, m).call(r)) return !1;
146
+ const t = (128 + v(i, k)).toString(16);
147
147
  a(_ = i, s, o).call(_, ["2", t, "43", "43", "43", "FF"]);
148
148
  }
149
149
  static workingTemperature(e = null) {
150
150
  var n, r, _;
151
- if (!a(n = i, s, c).call(n, e) || !a(r = i, s, p).call(r)) return !1;
152
- const t = (128 + v(i, x)).toString(16);
151
+ if (!a(n = i, s, c).call(n, e) || !a(r = i, s, m).call(r)) return !1;
152
+ const t = (128 + v(i, k)).toString(16);
153
153
  a(_ = i, s, o).call(_, ["2", t, "43", "54", "16"]);
154
154
  }
155
155
  static currentTemperature(e = null) {
156
- var r, _, f;
157
- if (!a(r = i, s, c).call(r, e) || !a(_ = i, s, L).call(_)) return !1;
156
+ var r, _, g;
157
+ if (!a(r = i, s, c).call(r, e) || !a(_ = i, s, U).call(_)) return !1;
158
158
  let t = [];
159
- const n = (128 + v(i, x)).toString(16);
160
- switch (v(i, S)) {
159
+ const n = (128 + v(i, k)).toString(16);
160
+ switch (v(i, x)) {
161
161
  case "boardroid":
162
162
  t = ["2", "D9", "44", "30"];
163
163
  break;
@@ -165,217 +165,217 @@ const i = class i {
165
165
  t = ["2", n, "43", "74", "2B", "30", "39", "2E", "31", "7F", "43"];
166
166
  break;
167
167
  }
168
- a(f = i, s, o).call(f, t);
168
+ a(g = i, s, o).call(g, t);
169
169
  }
170
170
  static ready(e = null) {
171
171
  var t, n, r;
172
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
172
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
173
173
  a(r = i, s, o).call(r, ["6", "30"]);
174
174
  }
175
175
  static busy(e = null) {
176
176
  var t, n, r;
177
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
177
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
178
178
  a(r = i, s, o).call(r, ["6", "31"]);
179
179
  }
180
180
  static invalidTray(e = null) {
181
181
  var t, n, r;
182
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
182
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
183
183
  a(r = i, s, o).call(r, ["6", "32"]);
184
184
  }
185
185
  static invalidChannel(e = null) {
186
186
  var t, n, r;
187
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
187
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
188
188
  a(r = i, s, o).call(r, ["6", "33"]);
189
189
  }
190
190
  static emptyChannel(e = null) {
191
191
  var t, n, r;
192
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
192
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
193
193
  a(r = i, s, o).call(r, ["6", "34"]);
194
194
  }
195
195
  static elevatorJam(e = null) {
196
196
  var t, n, r;
197
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
197
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
198
198
  a(r = i, s, o).call(r, ["6", "35"]);
199
199
  }
200
200
  static elevatorMalfunction(e = null) {
201
201
  var t, n, r;
202
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
202
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
203
203
  a(r = i, s, o).call(r, ["6", "36"]);
204
204
  }
205
205
  static phototransistorFailure(e = null) {
206
206
  var t, n, r;
207
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
207
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
208
208
  a(r = i, s, o).call(r, ["6", "37"]);
209
209
  }
210
210
  static allChannelsEmpty(e = null) {
211
211
  var t, n, r;
212
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
212
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
213
213
  a(r = i, s, o).call(r, ["6", "38"]);
214
214
  }
215
215
  static productDetectorFailure(e = null) {
216
216
  var t, n, r;
217
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
217
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
218
218
  a(r = i, s, o).call(r, ["6", "39"]);
219
219
  }
220
220
  static displayDisconnected(e = null) {
221
221
  var t, n, r;
222
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
222
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
223
223
  a(r = i, s, o).call(r, ["6", "41"]);
224
224
  }
225
225
  static productUnderElevator(e = null) {
226
226
  var t, n, r;
227
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
227
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
228
228
  a(r = i, s, o).call(r, ["6", "42"]);
229
229
  }
230
230
  static elevatorSettingAlarm(e = null) {
231
231
  var t, n, r;
232
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
232
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
233
233
  a(r = i, s, o).call(r, ["6", "43"]);
234
234
  }
235
235
  static buttonPanelFailure(e = null) {
236
236
  var t, n, r;
237
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
237
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
238
238
  a(r = i, s, o).call(r, ["6", "44"]);
239
239
  }
240
240
  static errorWritingEeprom(e = null) {
241
241
  var t, n, r;
242
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
242
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
243
243
  a(r = i, s, o).call(r, ["6", "45"]);
244
244
  }
245
245
  static errorControlTemperature(e = null) {
246
246
  var t, n, r;
247
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
247
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
248
248
  a(r = i, s, o).call(r, ["6", "46"]);
249
249
  }
250
250
  static thermometerDisconnected(e = null) {
251
251
  var t, n, r;
252
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
252
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
253
253
  a(r = i, s, o).call(r, ["6", "47"]);
254
254
  }
255
255
  static thermometerMisconfigured(e = null) {
256
256
  var t, n, r;
257
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
257
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
258
258
  a(r = i, s, o).call(r, ["6", "48"]);
259
259
  }
260
260
  static thermometerFailure(e = null) {
261
261
  var t, n, r;
262
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
262
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
263
263
  a(r = i, s, o).call(r, ["6", "49"]);
264
264
  }
265
265
  static errorExtractorConsumption(e = null) {
266
266
  var t, n, r;
267
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
267
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
268
268
  a(r = i, s, o).call(r, ["6", "4A"]);
269
269
  }
270
270
  static channelSearchError(e = null) {
271
271
  var t, n, r;
272
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
272
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
273
273
  a(r = i, s, o).call(r, ["6", "4B"]);
274
274
  }
275
275
  static productExitMouthSearchError(e = null) {
276
276
  var t, n, r;
277
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
277
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
278
278
  a(r = i, s, o).call(r, ["6", "4C"]);
279
279
  }
280
280
  static elevatorInteriorLocked(e = null) {
281
281
  var t, n, r;
282
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
282
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
283
283
  a(r = i, s, o).call(r, ["6", "4D"]);
284
284
  }
285
285
  static productDetectorVerifierError(e = null) {
286
286
  var t, n, r;
287
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
287
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
288
288
  a(r = i, s, o).call(r, ["6", "4E"]);
289
289
  }
290
290
  static waitingForProductRecall(e = null) {
291
291
  var t, n, r;
292
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
292
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
293
293
  a(r = i, s, o).call(r, ["6", "4F"]);
294
294
  }
295
295
  static productExpiredByTemperature(e = null) {
296
296
  var t, n, r;
297
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
297
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
298
298
  a(r = i, s, o).call(r, ["6", "50"]);
299
299
  }
300
300
  static faultyAutomaticDoor(e = null) {
301
301
  var t, n, r;
302
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
302
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
303
303
  a(r = i, s, o).call(r, ["6", "51"]);
304
304
  }
305
305
  static rejectLever(e = null) {
306
306
  var t, n, r;
307
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
307
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
308
308
  a(r = i, s, o).call(r, ["2", "A0", "1"]);
309
309
  }
310
310
  static resetCoinPurse(e = null) {
311
311
  var t, n, r;
312
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
312
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
313
313
  a(r = i, s, o).call(r, ["2", "A0", "2"]);
314
314
  }
315
315
  static coinInsertedBox(e = null, t = null) {
316
- var _, f, h, d;
317
- if (!a(_ = i, s, c).call(_, e) || !a(f = i, s, m).call(f)) return !1;
318
- const n = ["40", "41", "42", "43", "44", "45"], r = a(h = i, s, O).call(h, n, t);
316
+ var _, g, h, d;
317
+ if (!a(_ = i, s, c).call(_, e) || !a(g = i, s, y).call(g)) return !1;
318
+ const n = ["40", "41", "42", "43", "44", "45"], r = a(h = i, s, q).call(h, n, t);
319
319
  a(d = i, s, o).call(d, ["2", "A0", r]);
320
320
  }
321
321
  static coinInsertedTube(e = null, t = null) {
322
- var _, f, h, d;
323
- if (!a(_ = i, s, c).call(_, e) || !a(f = i, s, m).call(f)) return !1;
324
- const n = ["50", "51", "52", "53", "54", "55"], r = a(h = i, s, O).call(h, n, t);
322
+ var _, g, h, d;
323
+ if (!a(_ = i, s, c).call(_, e) || !a(g = i, s, y).call(g)) return !1;
324
+ const n = ["50", "51", "52", "53", "54", "55"], r = a(h = i, s, q).call(h, n, t);
325
325
  a(d = i, s, o).call(d, ["2", "A0", r]);
326
326
  }
327
327
  static banknoteInsertedStacker(e = null, t = null) {
328
- var _, f, h, d;
329
- if (!a(_ = i, s, c).call(_, e) || !a(f = i, s, m).call(f)) return !1;
330
- const n = ["80", "81", "82", "83", "84"], r = a(h = i, s, M).call(h, n, t);
328
+ var _, g, h, d;
329
+ if (!a(_ = i, s, c).call(_, e) || !a(g = i, s, y).call(g)) return !1;
330
+ const n = ["80", "81", "82", "83", "84"], r = a(h = i, s, B).call(h, n, t);
331
331
  a(d = i, s, o).call(d, ["2", "B0", r]);
332
332
  }
333
333
  static banknoteInsertedEscrow(e = null, t = null) {
334
- var _, f, h, d;
335
- if (!a(_ = i, s, c).call(_, e) || !a(f = i, s, m).call(f)) return !1;
336
- const n = ["90", "91", "92", "93", "94"], r = a(h = i, s, M).call(h, n, t);
334
+ var _, g, h, d;
335
+ if (!a(_ = i, s, c).call(_, e) || !a(g = i, s, y).call(g)) return !1;
336
+ const n = ["90", "91", "92", "93", "94"], r = a(h = i, s, B).call(h, n, t);
337
337
  a(d = i, s, o).call(d, ["2", "B0", r]);
338
338
  }
339
339
  static banknoteEjected(e = null, t = null) {
340
- var _, f, h, d;
341
- if (!a(_ = i, s, c).call(_, e) || !a(f = i, s, m).call(f)) return !1;
342
- const n = ["A0", "A1", "A2", "A3", "A4"], r = a(h = i, s, M).call(h, n, t);
340
+ var _, g, h, d;
341
+ if (!a(_ = i, s, c).call(_, e) || !a(g = i, s, y).call(g)) return !1;
342
+ const n = ["A0", "A1", "A2", "A3", "A4"], r = a(h = i, s, B).call(h, n, t);
343
343
  a(d = i, s, o).call(d, ["2", "B0", r]);
344
344
  }
345
345
  static banknoteInsertedRecycler(e = null, t = null) {
346
- var _, f, h, d;
347
- if (!a(_ = i, s, c).call(_, e) || !a(f = i, s, m).call(f)) return !1;
348
- const n = ["B0", "B1", "B2", "B3", "B4"], r = a(h = i, s, M).call(h, n, t);
346
+ var _, g, h, d;
347
+ if (!a(_ = i, s, c).call(_, e) || !a(g = i, s, y).call(g)) return !1;
348
+ const n = ["B0", "B1", "B2", "B3", "B4"], r = a(h = i, s, B).call(h, n, t);
349
349
  a(d = i, s, o).call(d, ["2", "B0", r]);
350
350
  }
351
351
  static banknoteTaken(e = null) {
352
352
  var t, n, r;
353
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
353
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
354
354
  a(r = i, s, o).call(r, ["2", "B0", "2a"]);
355
355
  }
356
356
  static coinPurseEnabled(e = null) {
357
357
  var t, n, r;
358
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
358
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
359
359
  a(r = i, s, o).call(r, ["2", "D0", "1"]);
360
360
  }
361
361
  static coinPurseDisabled(e = null) {
362
362
  var t, n, r;
363
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
363
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
364
364
  a(r = i, s, o).call(r, ["2", "D0", "0"]);
365
365
  }
366
366
  static billPurseDisabled(e = null) {
367
367
  var t, n, r;
368
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
368
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
369
369
  a(r = i, s, o).call(r, ["2", "D1", "0", "0"]);
370
370
  }
371
371
  static billPurseEnabled(e = null) {
372
372
  var t, n, r;
373
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
373
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
374
374
  a(r = i, s, o).call(r, ["2", "D1", "1", "1"]);
375
375
  }
376
376
  static readTubes(e = null) {
377
- var w, C, k;
378
- if (!a(w = i, s, c).call(w, e) || !a(C = i, s, m).call(C)) return !1;
377
+ var w, C, S;
378
+ if (!a(w = i, s, c).call(w, e) || !a(C = i, s, y).call(C)) return !1;
379
379
  const t = [
380
380
  "0",
381
381
  "1",
@@ -409,7 +409,7 @@ const i = class i {
409
409
  "1d",
410
410
  "1e",
411
411
  "1f"
412
- ], [n, r, _, f, h, d] = [
412
+ ], [n, r, _, g, h, d] = [
413
413
  t[Math.floor(Math.random() * 30)],
414
414
  t[Math.floor(Math.random() * 30)],
415
415
  t[Math.floor(Math.random() * 30)],
@@ -417,11 +417,11 @@ const i = class i {
417
417
  t[Math.floor(Math.random() * 30)],
418
418
  t[Math.floor(Math.random() * 30)]
419
419
  ];
420
- a(k = i, s, o).call(k, ["2", "D2", n, r, _, f, h, d]);
420
+ a(S = i, s, o).call(S, ["2", "D2", n, r, _, g, h, d]);
421
421
  }
422
422
  static readBillPurse(e = null, t = null) {
423
- var r, _, f, h;
424
- if (!a(r = i, s, c).call(r, e) || !a(_ = i, s, m).call(_)) return !1;
423
+ var r, _, g, h;
424
+ if (!a(r = i, s, c).call(r, e) || !a(_ = i, s, y).call(_)) return !1;
425
425
  let n = [
426
426
  "0",
427
427
  "1",
@@ -455,7 +455,7 @@ const i = class i {
455
455
  ];
456
456
  if (e._recycler.ict) {
457
457
  const d = n[Math.floor(Math.random() * 31)];
458
- let w = "0", C = "0", k = "0", D = "0", A = "0";
458
+ let w = "0", C = "0", S = "0", D = "0", M = "0";
459
459
  if (t !== null && !isNaN(parseInt(t)))
460
460
  switch (t.toString()) {
461
461
  case "20":
@@ -465,13 +465,13 @@ const i = class i {
465
465
  C = d;
466
466
  break;
467
467
  case "100":
468
- k = d;
468
+ S = d;
469
469
  break;
470
470
  case "200":
471
471
  D = d;
472
472
  break;
473
473
  case "500":
474
- A = d;
474
+ M = d;
475
475
  break;
476
476
  }
477
477
  else
@@ -483,18 +483,18 @@ const i = class i {
483
483
  C = d;
484
484
  break;
485
485
  case 2:
486
- k = d;
486
+ S = d;
487
487
  break;
488
488
  case 3:
489
489
  D = d;
490
490
  break;
491
491
  case 4:
492
- A = d;
492
+ M = d;
493
493
  break;
494
494
  }
495
- a(f = i, s, o).call(f, ["2", "D3", w, C, k, D, A, "0"]);
495
+ a(g = i, s, o).call(g, ["2", "D3", w, C, S, D, M, "0"]);
496
496
  } else {
497
- const [d, w, C, k, D, A] = [
497
+ const [d, w, C, S, D, M] = [
498
498
  n[Math.floor(Math.random() * 30)],
499
499
  n[Math.floor(Math.random() * 30)],
500
500
  n[Math.floor(Math.random() * 30)],
@@ -502,22 +502,22 @@ const i = class i {
502
502
  n[Math.floor(Math.random())],
503
503
  n[Math.floor(Math.random())]
504
504
  ];
505
- a(h = i, s, o).call(h, ["2", "D3", d, w, C, k, D, A]);
505
+ a(h = i, s, o).call(h, ["2", "D3", d, w, C, S, D, M]);
506
506
  }
507
507
  }
508
508
  static banknoteAccepted(e = null) {
509
509
  var t, n, r;
510
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
510
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
511
511
  a(r = i, s, o).call(r, ["2", "D4", "1"]);
512
512
  }
513
513
  static banknoteRejected(e = null) {
514
514
  var t, n, r;
515
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
515
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
516
516
  a(r = i, s, o).call(r, ["2", "D4", "0"]);
517
517
  }
518
518
  static banknotesDispensed(e = null) {
519
- var n, r, _, f;
520
- if (!a(n = i, s, c).call(n, e) || !a(r = i, s, m).call(r)) return !1;
519
+ var n, r, _, g;
520
+ if (!a(n = i, s, c).call(n, e) || !a(r = i, s, y).call(r)) return !1;
521
521
  let t = [
522
522
  "1",
523
523
  "2",
@@ -550,7 +550,7 @@ const i = class i {
550
550
  ];
551
551
  if (e._recycler.ict) {
552
552
  const h = t[Math.floor(Math.random() * 30)];
553
- let d = "0", w = "0", C = "0", k = "0", D = "0";
553
+ let d = "0", w = "0", C = "0", S = "0", D = "0";
554
554
  switch (e._recycler.bill) {
555
555
  case 0:
556
556
  d = h;
@@ -562,15 +562,15 @@ const i = class i {
562
562
  C = h;
563
563
  break;
564
564
  case 3:
565
- k = h;
565
+ S = h;
566
566
  break;
567
567
  case 4:
568
568
  D = h;
569
569
  break;
570
570
  }
571
- a(_ = i, s, o).call(_, ["2", "D5", d, w, C, k, D, "0"]);
571
+ a(_ = i, s, o).call(_, ["2", "D5", d, w, C, S, D, "0"]);
572
572
  } else {
573
- const [h, d, w, C, k, D] = [
573
+ const [h, d, w, C, S, D] = [
574
574
  t[Math.floor(Math.random() * 30)],
575
575
  t[Math.floor(Math.random() * 30)],
576
576
  t[Math.floor(Math.random() * 30)],
@@ -578,77 +578,77 @@ const i = class i {
578
578
  t[Math.floor(Math.random())],
579
579
  t[Math.floor(Math.random())]
580
580
  ];
581
- a(f = i, s, o).call(f, ["2", "D5", h, d, w, C, k, D]);
581
+ a(g = i, s, o).call(g, ["2", "D5", h, d, w, C, S, D]);
582
582
  }
583
583
  }
584
584
  static coinsDispensed(e = null) {
585
585
  var t, n, r;
586
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
586
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
587
587
  a(r = i, s, o).call(r, ["2", "D6"]);
588
588
  }
589
589
  static relayOn(e = null) {
590
590
  var t, n, r;
591
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
591
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
592
592
  a(r = i, s, o).call(r, ["2", "DA", "1"]);
593
593
  }
594
594
  static relayOff(e = null) {
595
595
  var t, n, r;
596
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
596
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
597
597
  a(r = i, s, o).call(r, ["2", "DA", "0"]);
598
598
  }
599
599
  static nayaxEnabled(e = null) {
600
600
  var t, n, r;
601
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
601
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
602
602
  a(r = i, s, o).call(r, ["2", "DD", "1"]);
603
603
  }
604
604
  static nayaxDisabled(e = null) {
605
605
  var t, n, r;
606
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
606
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
607
607
  a(r = i, s, o).call(r, ["2", "DD", "0"]);
608
608
  }
609
609
  static nayaxPreCreditAuthorized(e = null) {
610
610
  var t, n, r;
611
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
611
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
612
612
  a(r = i, s, o).call(r, ["2", "DD", "3"]);
613
613
  }
614
614
  static nayaxCancelRequest(e = null) {
615
615
  var t, n, r;
616
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
616
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
617
617
  a(r = i, s, o).call(r, ["2", "DD", "4"]);
618
618
  }
619
619
  static nayaxSellApproved(e = null) {
620
620
  var t, n, r;
621
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
621
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
622
622
  a(r = i, s, o).call(r, ["2", "DD", "5"]);
623
623
  }
624
624
  static nayaxSellDenied(e = null) {
625
625
  var t, n, r;
626
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
626
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
627
627
  a(r = i, s, o).call(r, ["2", "DD", "6"]);
628
628
  }
629
629
  static nayaxEndSession(e = null) {
630
630
  var t, n, r;
631
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
631
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
632
632
  a(r = i, s, o).call(r, ["2", "DD", "7"]);
633
633
  }
634
634
  static nayaxCancelled(e = null) {
635
635
  var t, n, r;
636
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
636
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
637
637
  a(r = i, s, o).call(r, ["2", "DD", "8"]);
638
638
  }
639
639
  static nayaxDispensed(e = null) {
640
640
  var t, n, r;
641
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
641
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
642
642
  a(r = i, s, o).call(r, ["2", "DD", "A", "0"]);
643
643
  }
644
644
  static nayaxNotDispensed(e = null) {
645
645
  var t, n, r;
646
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
646
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, y).call(n)) return !1;
647
647
  a(r = i, s, o).call(r, ["2", "DD", "A", "1"]);
648
648
  }
649
649
  static fullTray(e = null) {
650
650
  var t, n, r;
651
- if (!a(t = i, s, c).call(t, e) || !a(n = i, s, p).call(n)) return !1;
651
+ if (!a(t = i, s, c).call(t, e) || !a(n = i, s, m).call(n)) return !1;
652
652
  a(r = i, s, o).call(r, ["6", "4F"]);
653
653
  }
654
654
  static setConnection(e = null) {
@@ -657,32 +657,32 @@ const i = class i {
657
657
  e.__internal__.serial.connected = !0;
658
658
  }
659
659
  };
660
- S = new WeakMap(), x = new WeakMap(), s = new WeakSet(), ee = function() {
660
+ x = new WeakMap(), k = new WeakMap(), s = new WeakSet(), ee = function() {
661
661
  if (i.enable === !1) throw new Error("Emulator is disabled");
662
662
  return i.enable;
663
663
  }, te = function(e) {
664
- if (typeof e != "object" || !(e instanceof ve))
664
+ if (typeof e != "object" || !(e instanceof xe))
665
665
  throw new Error(`Type ${e.typeDevice} is not supported`);
666
- return i.instance = e, $(i, S, e.typeDevice), $(i, x, e.deviceNumber), !0;
666
+ return i.instance = e, $(i, x, e.typeDevice), $(i, k, e.deviceNumber), !0;
667
667
  }, c = function(e = null) {
668
668
  var t, n;
669
669
  return !a(t = i, s, ee).call(t) || e === null && i.instance === null ? !1 : (i.instance === null && a(n = i, s, te).call(n, e), !0);
670
- }, j = function() {
671
- if (v(i, S) !== "locker") throw new Error("This function is only available for Locker devices");
670
+ }, O = function() {
671
+ if (v(i, x) !== "locker") throw new Error("This function is only available for Locker devices");
672
672
  return !0;
673
- }, m = function() {
674
- if (v(i, S) !== "boardroid")
673
+ }, y = function() {
674
+ if (v(i, x) !== "boardroid")
675
675
  throw new Error("This function is only available for Boardroid devices");
676
676
  return !0;
677
- }, p = function() {
678
- if (v(i, S) !== "jofemar") throw new Error("This function is only available for Jofemar devices");
677
+ }, m = function() {
678
+ if (v(i, x) !== "jofemar") throw new Error("This function is only available for Jofemar devices");
679
679
  return !0;
680
- }, L = function() {
681
- if (v(i, S) === "locker") throw new Error("This function is not available for Locker devices");
680
+ }, U = function() {
681
+ if (v(i, x) === "locker") throw new Error("This function is not available for Locker devices");
682
682
  return !0;
683
683
  }, o = function(e) {
684
684
  i.instance.__emulate({ code: e });
685
- }, O = function(e, t = null) {
685
+ }, q = function(e, t = null) {
686
686
  let n = e[Math.floor(Math.random() * 5)];
687
687
  if (t !== null && !isNaN(parseFloat(t)))
688
688
  switch (t.toString()) {
@@ -703,7 +703,7 @@ S = new WeakMap(), x = new WeakMap(), s = new WeakSet(), ee = function() {
703
703
  break;
704
704
  }
705
705
  return n;
706
- }, M = function(e, t = null) {
706
+ }, B = function(e, t = null) {
707
707
  let n = e[Math.floor(Math.random() * 4)];
708
708
  if (t !== null && !isNaN(parseFloat(t)))
709
709
  switch (t.toString()) {
@@ -724,11 +724,11 @@ S = new WeakMap(), x = new WeakMap(), s = new WeakSet(), ee = function() {
724
724
  break;
725
725
  }
726
726
  return n;
727
- }, I(i, s), U(i, "enable", !1), U(i, "instance", null), I(i, S, null), I(i, x, 1);
728
- let F = i;
729
- var fe = Object.defineProperty, ne = (l) => {
727
+ }, L(i, s), R(i, "enable", !1), R(i, "instance", null), L(i, x, null), L(i, k, 1);
728
+ let j = i;
729
+ var ge = Object.defineProperty, ne = (l) => {
730
730
  throw TypeError(l);
731
- }, pe = (l, e, t) => e in l ? fe(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t, P = (l, e, t) => pe(l, typeof e != "symbol" ? e + "" : e, t), ge = (l, e, t) => e.has(l) || ne("Cannot " + t), me = (l, e, t) => e.has(l) ? ne("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(l) : e.set(l, t), y = (l, e, t) => (ge(l, e, "access private method"), t);
731
+ }, me = (l, e, t) => e in l ? ge(l, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : l[e] = t, I = (l, e, t) => me(l, typeof e != "symbol" ? e + "" : e, t), ye = (l, e, t) => e.has(l) || ne("Cannot " + t), be = (l, e, t) => e.has(l) ? ne("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(l) : e.set(l, t), p = (l, e, t) => (ye(l, e, "access private method"), t);
732
732
  class J extends CustomEvent {
733
733
  constructor(e, t) {
734
734
  super(e, t);
@@ -736,9 +736,9 @@ class J extends CustomEvent {
736
736
  }
737
737
  class ie extends EventTarget {
738
738
  constructor() {
739
- super(...arguments), P(this, "__listeners__", {
739
+ super(...arguments), I(this, "__listeners__", {
740
740
  debug: !1
741
- }), P(this, "__debug__", !1);
741
+ }), I(this, "__debug__", !1);
742
742
  }
743
743
  dispatch(e, t = null) {
744
744
  const n = new J(e, { detail: t });
@@ -766,7 +766,7 @@ class ie extends EventTarget {
766
766
  }));
767
767
  }
768
768
  }
769
- const q = class b extends ie {
769
+ const H = class b extends ie {
770
770
  constructor() {
771
771
  super(), ["change"].forEach((e) => {
772
772
  this.serialRegisterAvailableListener(e);
@@ -806,18 +806,18 @@ const q = class b extends ie {
806
806
  return typeof b.devices[e] > "u" && b.typeError(e), Object.values(b.devices[e]).find((n) => n.deviceNumber === t) ?? null;
807
807
  }
808
808
  };
809
- P(q, "instance"), P(q, "devices", {});
810
- let u = q;
809
+ I(H, "instance"), I(H, "devices", {});
810
+ let u = H;
811
811
  u.instance || (u.instance = new u());
812
- function H(l = 100) {
812
+ function re(l = 100) {
813
813
  return new Promise(
814
814
  (e) => setTimeout(() => e(), l)
815
815
  );
816
816
  }
817
- function ye() {
817
+ function we() {
818
818
  return "serial" in navigator;
819
819
  }
820
- const N = {
820
+ const F = {
821
821
  baudRate: 9600,
822
822
  dataBits: 8,
823
823
  stopBits: 1,
@@ -825,22 +825,22 @@ const N = {
825
825
  bufferSize: 32768,
826
826
  flowControl: "none"
827
827
  };
828
- var g, T, B, W, V, E, re, z, G, K, X, se, ae, le, oe, Y, Z, ce, _e;
829
- class be extends ie {
828
+ var f, T, P, se, W, V, E, ae, z, K, G, X, le, A, oe, ce, _e, Y, Z, ue, he;
829
+ class ve extends ie {
830
830
  constructor({
831
831
  filters: e = null,
832
- config_port: t = N,
832
+ config_port: t = F,
833
833
  no_device: n = 1,
834
834
  device_listen_on_channel: r = 1,
835
835
  bypassSerialBytesConnection: _ = !1
836
836
  } = {
837
837
  filters: null,
838
- config_port: N,
838
+ config_port: F,
839
839
  no_device: 1,
840
840
  device_listen_on_channel: 1,
841
841
  bypassSerialBytesConnection: !1
842
842
  }) {
843
- if (super(), me(this, g), P(this, "__internal__", {
843
+ if (super(), be(this, f), I(this, "__internal__", {
844
844
  bypassSerialBytesConnection: !1,
845
845
  auto_response: !1,
846
846
  device_number: 1,
@@ -852,6 +852,8 @@ class be extends ie {
852
852
  no_code: 0
853
853
  },
854
854
  serial: {
855
+ aux_connecting: "idle",
856
+ connecting: !1,
855
857
  connected: !1,
856
858
  port: null,
857
859
  last_action: null,
@@ -875,7 +877,7 @@ class be extends ie {
875
877
  delay_first_connection: 200,
876
878
  bytes_connection: null,
877
879
  filters: [],
878
- config_port: N,
880
+ config_port: F,
879
881
  queue: [],
880
882
  auto_response: ["DD", "DD"],
881
883
  free_timeout_ms: 50,
@@ -900,7 +902,7 @@ class be extends ie {
900
902
  }
901
903
  }), !("serial" in navigator))
902
904
  throw new Error("Web Serial not supported");
903
- e && (this.serialFilters = e), t && (this.serialConfigPort = t), _ && (this.__internal__.bypassSerialBytesConnection = _), n && y(this, g, ce).call(this, n), r && ["number", "string"].includes(typeof r) && (this.listenOnChannel = r), y(this, g, le).call(this), y(this, g, oe).call(this);
905
+ e && (this.serialFilters = e), t && (this.serialConfigPort = t), _ && (this.__internal__.bypassSerialBytesConnection = _), n && p(this, f, ue).call(this, n), r && ["number", "string"].includes(typeof r) && (this.listenOnChannel = r), p(this, f, ce).call(this), p(this, f, _e).call(this);
904
906
  }
905
907
  set listenOnChannel(e) {
906
908
  if (typeof e == "string" && (e = parseInt(e)), isNaN(e) || e < 1 || e > 255)
@@ -934,12 +936,15 @@ class be extends ie {
934
936
  this.__internal__.serial.useRTSCTS = e;
935
937
  }
936
938
  get isConnected() {
937
- const e = this.__internal__.serial.connected, t = y(this, g, T).call(this, this.__internal__.serial.port);
938
- return e && !t && y(this, g, B).call(this, { error: "Port is closed, not readable or writable." }), this.__internal__.serial.connected = t, this.__internal__.serial.connected;
939
+ const e = this.__internal__.serial.connected, t = p(this, f, T).call(this, this.__internal__.serial.port);
940
+ return e && !t && p(this, f, P).call(this, { error: "Port is closed, not readable or writable." }), this.__internal__.serial.connected = t, this.__internal__.serial.connected;
941
+ }
942
+ get isConnecting() {
943
+ return this.__internal__.serial.connecting;
939
944
  }
940
945
  get isDisconnected() {
941
- const e = this.__internal__.serial.connected, t = y(this, g, T).call(this, this.__internal__.serial.port);
942
- return !e && t && (this.dispatch("serial:connected"), u.$dispatchChange(this)), this.__internal__.serial.connected = t, !this.__internal__.serial.connected;
946
+ const e = this.__internal__.serial.connected, t = p(this, f, T).call(this, this.__internal__.serial.port);
947
+ return !e && t && (this.dispatch("serial:connected"), p(this, f, A).call(this, !1), u.$dispatchChange(this)), this.__internal__.serial.connected = t, !this.__internal__.serial.connected;
943
948
  }
944
949
  get deviceNumber() {
945
950
  return this.__internal__.device_number;
@@ -1017,14 +1022,18 @@ class be extends ie {
1017
1022
  });
1018
1023
  }
1019
1024
  async disconnect(e = null) {
1020
- await this.serialDisconnect(), y(this, g, B).call(this, e);
1025
+ await this.serialDisconnect(), p(this, f, P).call(this, e);
1021
1026
  }
1022
1027
  async connect() {
1023
- return this.isConnected ? `${this.typeDevice} device ${this.deviceNumber} already connected` : new Promise((e, t) => {
1024
- ye() || t("Web Serial not supported"), setTimeout(async () => {
1025
- await H(499), await this.serialConnect(), this.isConnected ? e(`${this.typeDevice} device ${this.deviceNumber} connected`) : t(`${this.typeDevice} device ${this.deviceNumber} not connected`);
1026
- }, 1);
1027
- });
1028
+ return this.isConnected ? !0 : (this.__internal__.serial.aux_connecting = "idle", new Promise((e, t) => {
1029
+ we() || t("Web Serial not supported");
1030
+ const n = p(this, f, se).bind(this);
1031
+ this.on("serial:connecting", n);
1032
+ const r = setInterval(() => {
1033
+ this.__internal__.serial.aux_connecting === "finished" ? (clearInterval(r), this.__internal__.serial.aux_connecting = "idle", this.off("serial:connecting", n), this.isConnected ? e(!0) : t(`${this.typeDevice} device ${this.deviceNumber} not connected`)) : this.__internal__.serial.aux_connecting === "connecting" && (this.__internal__.serial.aux_connecting = "idle", this.dispatch("serial:connecting", { active: !0 }));
1034
+ }, 100);
1035
+ this.serialConnect();
1036
+ }));
1028
1037
  }
1029
1038
  async serialDisconnect() {
1030
1039
  try {
@@ -1109,8 +1118,8 @@ class be extends ie {
1109
1118
  }
1110
1119
  async serialConnect() {
1111
1120
  try {
1112
- this.dispatch("serial:connecting", {});
1113
- const e = await y(this, g, re).call(this);
1121
+ p(this, f, A).call(this, !0);
1122
+ const e = await p(this, f, ae).call(this);
1114
1123
  if (e.length > 0)
1115
1124
  await this.serialPortsSaved(e);
1116
1125
  else {
@@ -1125,21 +1134,22 @@ class be extends ie {
1125
1134
  await t.open(this.serialConfigPort);
1126
1135
  const n = this;
1127
1136
  t.onconnect = (r) => {
1128
- console.log(r), n.dispatch("serial:connected", r), u.$dispatchChange(this), n.__internal__.serial.queue.length > 0 && n.dispatch("internal:queue", {});
1137
+ var _;
1138
+ n.dispatch("serial:connected", r), p(_ = n, f, A).call(_, !1), u.$dispatchChange(this), n.__internal__.serial.queue.length > 0 && n.dispatch("internal:queue", {});
1129
1139
  }, t.ondisconnect = async () => {
1130
1140
  await n.disconnect();
1131
- }, await H(this.__internal__.serial.delay_first_connection), this.__internal__.timeout.until_response = setTimeout(async () => {
1141
+ }, await re(this.__internal__.serial.delay_first_connection), this.__internal__.timeout.until_response = setTimeout(async () => {
1132
1142
  await n.timeout(n.__internal__.serial.bytes_connection ?? [], "connection:start");
1133
- }, this.__internal__.time.response_connection), this.__internal__.serial.last_action = "connect", await y(this, g, W).call(this, this.__internal__.serial.bytes_connection ?? []), this.dispatch("serial:sent", {
1143
+ }, this.__internal__.time.response_connection), this.__internal__.serial.last_action = "connect", await p(this, f, W).call(this, this.__internal__.serial.bytes_connection ?? []), this.dispatch("serial:sent", {
1134
1144
  action: "connect",
1135
1145
  bytes: this.__internal__.serial.bytes_connection
1136
- }), this.__internal__.auto_response && y(this, g, E).call(this, this.__internal__.serial.auto_response), await y(this, g, se).call(this);
1146
+ }), this.__internal__.auto_response && p(this, f, E).call(this, this.__internal__.serial.auto_response), await p(this, f, le).call(this);
1137
1147
  } catch (e) {
1138
- this.serialErrors(e);
1148
+ p(this, f, A).call(this, !1), this.serialErrors(e);
1139
1149
  }
1140
1150
  }
1141
1151
  async serialForget() {
1142
- return await y(this, g, ae).call(this);
1152
+ return await p(this, f, oe).call(this);
1143
1153
  }
1144
1154
  decToHex(e) {
1145
1155
  return typeof e == "string" && (e = parseInt(e, 10)), e.toString(16);
@@ -1184,7 +1194,7 @@ class be extends ie {
1184
1194
  }
1185
1195
  serialSetConnectionConstant(e = 1) {
1186
1196
  if (this.__internal__.bypassSerialBytesConnection) return this.__internal__.serial.bytes_connection;
1187
- throw console.warn("wtf?", this.bypassSerialBytesConnection), new Error(`Method not implemented 'serialSetConnectionConstant' to listen on channel ${e}`);
1197
+ throw new Error(`Method not implemented 'serialSetConnectionConstant' to listen on channel ${e}`);
1188
1198
  }
1189
1199
  serialMessage(e) {
1190
1200
  throw console.log(e), this.dispatch("serial:message", { code: e }), new Error("Method not implemented 'serialMessage'");
@@ -1211,7 +1221,7 @@ class be extends ie {
1211
1221
  });
1212
1222
  }
1213
1223
  softReload() {
1214
- y(this, g, _e).call(this), this.dispatch("serial:soft-reload", {});
1224
+ p(this, f, he).call(this), this.dispatch("serial:soft-reload", {});
1215
1225
  }
1216
1226
  async sendConnect() {
1217
1227
  if (!this.__internal__.serial.bytes_connection)
@@ -1278,16 +1288,18 @@ class be extends ie {
1278
1288
  return this.isConnected;
1279
1289
  }
1280
1290
  }
1281
- g = /* @__PURE__ */ new WeakSet(), T = function(l) {
1291
+ f = /* @__PURE__ */ new WeakSet(), T = function(l) {
1282
1292
  return !!(l && l.readable && l.writable);
1283
- }, B = function(l = null) {
1293
+ }, P = function(l = null) {
1284
1294
  this.__internal__.serial.connected = !1, this.__internal__.aux_port_connector = 0, this.dispatch("serial:disconnected", l), u.$dispatchChange(this);
1295
+ }, se = function(l) {
1296
+ this.__internal__.serial.aux_connecting = l.detail.active ? "connecting" : "finished";
1285
1297
  }, W = async function(l) {
1286
1298
  const e = this.__internal__.serial.port;
1287
1299
  if (!e || e && (!e.readable || !e.writable))
1288
- throw y(this, g, B).call(this, { error: "Port is closed, not readable or writable." }), new Error("The port is closed or is not readable/writable");
1300
+ throw p(this, f, P).call(this, { error: "Port is closed, not readable or writable." }), new Error("The port is closed or is not readable/writable");
1289
1301
  const t = this.validateBytes(l);
1290
- if (this.useRTSCTS && await y(this, g, V).call(this, e, 5e3), e.writable === null) return;
1302
+ if (this.useRTSCTS && await p(this, f, V).call(this, e, 5e3), e.writable === null) return;
1291
1303
  const n = e.writable.getWriter();
1292
1304
  await n.write(t), n.releaseLock();
1293
1305
  }, V = async function(l, e = 5e3) {
@@ -1297,12 +1309,12 @@ g = /* @__PURE__ */ new WeakSet(), T = function(l) {
1297
1309
  throw new Error("Timeout waiting for clearToSend signal");
1298
1310
  const { clearToSend: n } = await l.getSignals();
1299
1311
  if (n) return;
1300
- await H(100);
1312
+ await re(100);
1301
1313
  }
1302
1314
  }, E = function(l = new Uint8Array([]), e = !1) {
1303
1315
  if (l && l.length > 0) {
1304
1316
  const t = this.__internal__.serial.connected;
1305
- if (this.__internal__.serial.connected = y(this, g, T).call(this, this.__internal__.serial.port), u.$dispatchChange(this), !t && this.__internal__.serial.connected && this.dispatch("serial:connected"), this.__internal__.interval.reconnection && (clearInterval(this.__internal__.interval.reconnection), this.__internal__.interval.reconnection = 0), this.__internal__.timeout.until_response && (clearTimeout(this.__internal__.timeout.until_response), this.__internal__.timeout.until_response = 0), this.__internal__.serial.response.as === "hex")
1317
+ if (this.__internal__.serial.connected = p(this, f, T).call(this, this.__internal__.serial.port), u.$dispatchChange(this), !t && this.__internal__.serial.connected && (this.dispatch("serial:connected"), p(this, f, A).call(this, !1)), this.__internal__.interval.reconnection && (clearInterval(this.__internal__.interval.reconnection), this.__internal__.interval.reconnection = 0), this.__internal__.timeout.until_response && (clearTimeout(this.__internal__.timeout.until_response), this.__internal__.timeout.until_response = 0), this.__internal__.serial.response.as === "hex")
1306
1318
  e ? this.serialCorruptMessage(this.parseUint8ToHex(l)) : this.serialMessage(this.parseUint8ToHex(l));
1307
1319
  else if (this.__internal__.serial.response.as === "uint8")
1308
1320
  e ? this.serialCorruptMessage(l) : this.serialMessage(l);
@@ -1320,31 +1332,31 @@ g = /* @__PURE__ */ new WeakSet(), T = function(l) {
1320
1332
  }
1321
1333
  }
1322
1334
  this.__internal__.serial.queue.length !== 0 && this.dispatch("internal:queue", {});
1323
- }, re = async function() {
1335
+ }, ae = async function() {
1324
1336
  const l = this.serialFilters, e = await navigator.serial.getPorts({ filters: l });
1325
1337
  return l.length === 0 ? e : e.filter((t) => {
1326
1338
  const n = t.getInfo();
1327
1339
  return l.some((r) => n.usbProductId === r.usbProductId && n.usbVendorId === r.usbVendorId);
1328
- }).filter((t) => !y(this, g, T).call(this, t));
1340
+ }).filter((t) => !p(this, f, T).call(this, t));
1329
1341
  }, z = function(l) {
1330
1342
  if (l) {
1331
1343
  const e = this.__internal__.serial.response.buffer, t = new Uint8Array(e.length + l.byteLength);
1332
1344
  t.set(e, 0), t.set(new Uint8Array(l), e.length), this.__internal__.serial.response.buffer = t;
1333
1345
  }
1334
- }, G = async function() {
1346
+ }, K = async function() {
1335
1347
  this.__internal__.serial.time_until_send_bytes && (clearTimeout(this.__internal__.serial.time_until_send_bytes), this.__internal__.serial.time_until_send_bytes = 0), this.__internal__.serial.time_until_send_bytes = setTimeout(() => {
1336
- this.__internal__.serial.response.buffer && y(this, g, E).call(this, this.__internal__.serial.response.buffer), this.__internal__.serial.response.buffer = new Uint8Array(0);
1348
+ this.__internal__.serial.response.buffer && p(this, f, E).call(this, this.__internal__.serial.response.buffer), this.__internal__.serial.response.buffer = new Uint8Array(0);
1337
1349
  }, this.__internal__.serial.free_timeout_ms || 50);
1338
- }, K = async function() {
1350
+ }, G = async function() {
1339
1351
  const l = this.__internal__.serial.response.length;
1340
1352
  let e = this.__internal__.serial.response.buffer;
1341
1353
  if (this.__internal__.serial.time_until_send_bytes && (clearTimeout(this.__internal__.serial.time_until_send_bytes), this.__internal__.serial.time_until_send_bytes = 0), !(l === null || !e || e.length === 0)) {
1342
1354
  for (; e.length >= l; ) {
1343
1355
  const t = e.slice(0, l);
1344
- y(this, g, E).call(this, t), e = e.slice(l);
1356
+ p(this, f, E).call(this, t), e = e.slice(l);
1345
1357
  }
1346
1358
  this.__internal__.serial.response.buffer = e, e.length > 0 && (this.__internal__.serial.time_until_send_bytes = setTimeout(() => {
1347
- y(this, g, E).call(this, this.__internal__.serial.response.buffer, !0);
1359
+ p(this, f, E).call(this, this.__internal__.serial.response.buffer, !0);
1348
1360
  }, this.__internal__.serial.free_timeout_ms || 50));
1349
1361
  }
1350
1362
  }, X = async function() {
@@ -1395,12 +1407,12 @@ g = /* @__PURE__ */ new WeakSet(), T = function(l) {
1395
1407
  r = r.slice(d);
1396
1408
  }
1397
1409
  for (const h of _)
1398
- y(this, g, E).call(this, h);
1399
- const f = new TextEncoder().encode(r);
1400
- this.__internal__.serial.response.buffer = f, f.length > 0 && (this.__internal__.serial.time_until_send_bytes = setTimeout(() => {
1401
- y(this, g, E).call(this, this.__internal__.serial.response.buffer, !0), this.__internal__.serial.response.buffer = new Uint8Array(0);
1410
+ p(this, f, E).call(this, h);
1411
+ const g = new TextEncoder().encode(r);
1412
+ this.__internal__.serial.response.buffer = g, g.length > 0 && (this.__internal__.serial.time_until_send_bytes = setTimeout(() => {
1413
+ p(this, f, E).call(this, this.__internal__.serial.response.buffer, !0), this.__internal__.serial.response.buffer = new Uint8Array(0);
1402
1414
  }, this.__internal__.serial.free_timeout_ms ?? 50));
1403
- }, se = async function() {
1415
+ }, le = async function() {
1404
1416
  const l = this.__internal__.serial.port;
1405
1417
  if (!l || !l.readable) throw new Error("Port is not readable");
1406
1418
  const e = l.readable.getReader();
@@ -1409,16 +1421,18 @@ g = /* @__PURE__ */ new WeakSet(), T = function(l) {
1409
1421
  for (; this.__internal__.serial.keep_reading; ) {
1410
1422
  const { value: t, done: n } = await e.read();
1411
1423
  if (n) break;
1412
- y(this, g, z).call(this, t), this.__internal__.serial.response.delimited ? await y(this, g, X).call(this) : this.__internal__.serial.response.length === null ? await y(this, g, G).call(this) : await y(this, g, K).call(this);
1424
+ p(this, f, z).call(this, t), this.__internal__.serial.response.delimited ? await p(this, f, X).call(this) : this.__internal__.serial.response.length === null ? await p(this, f, K).call(this) : await p(this, f, G).call(this);
1413
1425
  }
1414
1426
  } catch (t) {
1415
1427
  this.serialErrors(t);
1416
1428
  } finally {
1417
1429
  e.releaseLock(), this.__internal__.serial.keep_reading = !0, this.__internal__.serial.port && await this.__internal__.serial.port.close();
1418
1430
  }
1419
- }, ae = async function() {
1431
+ }, A = function(l) {
1432
+ l !== this.__internal__.serial.connecting && (this.__internal__.serial.connecting = l, l ? this.dispatch("serial:connecting", { active: !0 }) : this.dispatch("serial:connecting", { active: !1 }));
1433
+ }, oe = async function() {
1420
1434
  return typeof window > "u" ? !1 : "serial" in navigator && "forget" in SerialPort.prototype && this.__internal__.serial.port ? (await this.__internal__.serial.port.forget(), !0) : !1;
1421
- }, le = function() {
1435
+ }, ce = function() {
1422
1436
  [
1423
1437
  "serial:connected",
1424
1438
  "serial:connecting",
@@ -1438,12 +1452,12 @@ g = /* @__PURE__ */ new WeakSet(), T = function(l) {
1438
1452
  ].forEach((l) => {
1439
1453
  this.serialRegisterAvailableListener(l);
1440
1454
  });
1441
- }, oe = function() {
1455
+ }, _e = function() {
1442
1456
  const l = this;
1443
1457
  this.on("internal:queue", async () => {
1444
1458
  var e;
1445
- await y(e = l, g, Z).call(e);
1446
- }), y(this, g, Y).call(this);
1459
+ await p(e = l, f, Z).call(e);
1460
+ }), p(this, f, Y).call(this);
1447
1461
  }, Y = function() {
1448
1462
  const l = this;
1449
1463
  navigator.serial.addEventListener("connect", async () => {
@@ -1451,8 +1465,8 @@ g = /* @__PURE__ */ new WeakSet(), T = function(l) {
1451
1465
  });
1452
1466
  });
1453
1467
  }, Z = async function() {
1454
- if (!y(this, g, T).call(this, this.__internal__.serial.port)) {
1455
- y(this, g, B).call(this, { error: "Port is closed, not readable or writable." }), await this.serialConnect();
1468
+ if (!p(this, f, T).call(this, this.__internal__.serial.port)) {
1469
+ p(this, f, P).call(this, { error: "Port is closed, not readable or writable." }), await this.serialConnect();
1456
1470
  return;
1457
1471
  }
1458
1472
  if (this.__internal__.timeout.until_response || this.__internal__.serial.queue.length === 0) return;
@@ -1460,7 +1474,7 @@ g = /* @__PURE__ */ new WeakSet(), T = function(l) {
1460
1474
  let e = this.__internal__.time.response_general;
1461
1475
  if (l.action === "connect" && (e = this.__internal__.time.response_connection), this.__internal__.timeout.until_response = setTimeout(async () => {
1462
1476
  await this.timeout(l.bytes, l.action);
1463
- }, e), this.__internal__.serial.last_action = l.action ?? "unknown", await y(this, g, W).call(this, l.bytes), this.dispatch("serial:sent", {
1477
+ }, e), this.__internal__.serial.last_action = l.action ?? "unknown", await p(this, f, W).call(this, l.bytes), this.dispatch("serial:sent", {
1464
1478
  action: l.action,
1465
1479
  bytes: l.bytes
1466
1480
  }), this.__internal__.auto_response) {
@@ -1470,13 +1484,13 @@ g = /* @__PURE__ */ new WeakSet(), T = function(l) {
1470
1484
  } catch (r) {
1471
1485
  this.serialErrors(r);
1472
1486
  }
1473
- y(this, g, E).call(this, n);
1487
+ p(this, f, E).call(this, n);
1474
1488
  }
1475
1489
  const t = [...this.__internal__.serial.queue];
1476
1490
  this.__internal__.serial.queue = t.splice(1);
1477
- }, ce = function(l = 1) {
1491
+ }, ue = function(l = 1) {
1478
1492
  this.__internal__.device_number = l, !this.__internal__.bypassSerialBytesConnection && (this.__internal__.serial.bytes_connection = this.serialSetConnectionConstant(l));
1479
- }, _e = function() {
1493
+ }, he = function() {
1480
1494
  this.__internal__.last_error = {
1481
1495
  message: null,
1482
1496
  action: null,
@@ -1485,7 +1499,7 @@ g = /* @__PURE__ */ new WeakSet(), T = function(l) {
1485
1499
  };
1486
1500
  };
1487
1501
  u.instance || (u.instance = new u());
1488
- const we = {
1502
+ const Ce = {
1489
1503
  relay: [],
1490
1504
  locker: [],
1491
1505
  jofemar: [],
@@ -1494,7 +1508,7 @@ const we = {
1494
1508
  pinpad: [],
1495
1509
  pinpax: []
1496
1510
  };
1497
- u.devices = { ...u.devices, ...we };
1511
+ u.devices = { ...u.devices, ...Ce };
1498
1512
  u.addCustom = (l, e) => {
1499
1513
  u.registerType(l), u.add(e);
1500
1514
  };
@@ -1513,7 +1527,7 @@ u.getRelay = (l = 1) => u.getByNumber("relay", l);
1513
1527
  u.getArduino = (l = 1) => u.getByNumber("arduino", l);
1514
1528
  u.getPinPad = (l = 1) => u.getByNumber("pinpad", l);
1515
1529
  u.getPinPax = (l = 1) => u.getByNumber("pinpax", l);
1516
- class ve extends be {
1530
+ class xe extends ve {
1517
1531
  constructor(e) {
1518
1532
  super(e), this.__internal__ = structuredClone(this.__internal__), this.getResponseAsArrayHex(), this.__internal__.device.door_open = !1, this.__internal__.time.response_engines = 2e3, this.__internal__.time.sense = 100, this.__internal__.interval.waiting_sense = 0, this.__internal__.dispense = {
1519
1533
  must_response: !1,
@@ -1556,7 +1570,7 @@ class ve extends be {
1556
1570
  }), null);
1557
1571
  }
1558
1572
  async internalDispenseStatus() {
1559
- if (this.__internal__.dispense.must_response && (await de(this.__internal__.time.response_engines + 10), this.__internal__.dispense.status === "no-response"))
1573
+ if (this.__internal__.dispense.must_response && (await pe(this.__internal__.time.response_engines + 10), this.__internal__.dispense.status === "no-response"))
1560
1574
  return this.internalClearSensing(), this.__internal__.dispense.status = !1, this.dispatch("not-dispensed", { reason: "no-response" }), { status: !1, error: "no-response" };
1561
1575
  this.__internal__.dispense.status = null, this.__internal__.dispense.dispensing = !0, this.dispatch("internal:dispense:running", {});
1562
1576
  const e = this;
@@ -1584,7 +1598,7 @@ class ve extends be {
1584
1598
  }
1585
1599
  async internalDispense(e) {
1586
1600
  if (this.isDispensing) throw new Error("Another dispensing process is running");
1587
- if (!F.enable && !this.__internal__.serial.connected && (await this.serialConnect(), !this.__internal__.serial.connected))
1601
+ if (!j.enable && !this.__internal__.serial.connected && (await this.serialConnect(), !this.__internal__.serial.connected))
1588
1602
  throw new Error("Serial device not connected");
1589
1603
  return this.__internal__.serial.queue.length === 0 ? (await this.appendToQueue(e, "dispense"), await this.internalDispenseStatus()) : new Promise((t) => {
1590
1604
  const n = setInterval(async () => {
@@ -1621,13 +1635,13 @@ class ve extends be {
1621
1635
  }
1622
1636
  }
1623
1637
  export {
1624
- F as E,
1625
- ve as K,
1626
- xe as a,
1627
- ke as b,
1628
- De as g,
1638
+ j as E,
1639
+ xe as K,
1640
+ Ee as a,
1641
+ De as b,
1642
+ Te as g,
1629
1643
  u as h,
1630
- Ee as i,
1631
- Se as s,
1632
- de as w
1644
+ Ae as i,
1645
+ ke as s,
1646
+ pe as w
1633
1647
  };