tabby-rdp 0.5.3 → 0.5.6

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.
@@ -66,14 +66,14 @@ export async function createBackend (__trdModule, __trdLevel = 'INFO') {
66
66
  var __defProp = Object.defineProperty;
67
67
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
68
68
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
69
- class Z {
69
+ class d {
70
70
  static __wrap(A) {
71
- const I = Object.create(Z.prototype);
72
- return I.__wbg_ptr = A, u.register(I, I.__wbg_ptr, I), I;
71
+ const I = Object.create(d.prototype);
72
+ return I.__wbg_ptr = A, $.register(I, I.__wbg_ptr, I), I;
73
73
  }
74
74
  __destroy_into_raw() {
75
75
  const A = this.__wbg_ptr;
76
- return this.__wbg_ptr = 0, u.unregister(this), A;
76
+ return this.__wbg_ptr = 0, $.unregister(this), A;
77
77
  }
78
78
  free() {
79
79
  const A = this.__destroy_into_raw();
@@ -84,7 +84,7 @@ class Z {
84
84
  * @param {Uint8Array} binary
85
85
  */
86
86
  addBinary(A, I) {
87
- const g = R(A, C.__wbindgen_malloc, C.__wbindgen_realloc), B = k, E = lA(I, C.__wbindgen_malloc), D = k;
87
+ const g = F(A, C.__wbindgen_malloc, C.__wbindgen_realloc), B = R, E = mA(I, C.__wbindgen_malloc), D = R;
88
88
  C.clipboarddata_addBinary(this.__wbg_ptr, g, B, E, D);
89
89
  }
90
90
  /**
@@ -92,12 +92,12 @@ class Z {
92
92
  * @param {string} text
93
93
  */
94
94
  addText(A, I) {
95
- const g = R(A, C.__wbindgen_malloc, C.__wbindgen_realloc), B = k, E = R(I, C.__wbindgen_malloc, C.__wbindgen_realloc), D = k;
95
+ const g = F(A, C.__wbindgen_malloc, C.__wbindgen_realloc), B = R, E = F(I, C.__wbindgen_malloc, C.__wbindgen_realloc), D = R;
96
96
  C.clipboarddata_addText(this.__wbg_ptr, g, B, E, D);
97
97
  }
98
98
  constructor() {
99
99
  const A = C.clipboarddata_create();
100
- return this.__wbg_ptr = A, u.register(this, this.__wbg_ptr, this), this;
100
+ return this.__wbg_ptr = A, $.register(this, this.__wbg_ptr, this), this;
101
101
  }
102
102
  /**
103
103
  * @returns {boolean}
@@ -110,19 +110,19 @@ class Z {
110
110
  */
111
111
  items() {
112
112
  const A = C.clipboarddata_items(this.__wbg_ptr);
113
- var I = pA(A[0], A[1]).slice();
113
+ var I = OA(A[0], A[1]).slice();
114
114
  return C.__wbindgen_free(A[0], A[1] * 4, 4), I;
115
115
  }
116
116
  }
117
- Symbol.dispose && (Z.prototype[Symbol.dispose] = Z.prototype.free);
118
- class f {
117
+ Symbol.dispose && (d.prototype[Symbol.dispose] = d.prototype.free);
118
+ class r {
119
119
  static __wrap(A) {
120
- const I = Object.create(f.prototype);
121
- return I.__wbg_ptr = A, CA.register(I, I.__wbg_ptr, I), I;
120
+ const I = Object.create(r.prototype);
121
+ return I.__wbg_ptr = A, wA.register(I, I.__wbg_ptr, I), I;
122
122
  }
123
123
  __destroy_into_raw() {
124
124
  const A = this.__wbg_ptr;
125
- return this.__wbg_ptr = 0, CA.unregister(this), A;
125
+ return this.__wbg_ptr = 0, wA.unregister(this), A;
126
126
  }
127
127
  free() {
128
128
  const A = this.__destroy_into_raw();
@@ -147,15 +147,15 @@ class f {
147
147
  return C.clipboarditem_value(this.__wbg_ptr);
148
148
  }
149
149
  }
150
- Symbol.dispose && (f.prototype[Symbol.dispose] = f.prototype.free);
151
- class p {
150
+ Symbol.dispose && (r.prototype[Symbol.dispose] = r.prototype.free);
151
+ class V {
152
152
  static __wrap(A) {
153
- const I = Object.create(p.prototype);
154
- return I.__wbg_ptr = A, _.register(I, I.__wbg_ptr, I), I;
153
+ const I = Object.create(V.prototype);
154
+ return I.__wbg_ptr = A, AA.register(I, I.__wbg_ptr, I), I;
155
155
  }
156
156
  __destroy_into_raw() {
157
157
  const A = this.__wbg_ptr;
158
- return this.__wbg_ptr = 0, _.unregister(this), A;
158
+ return this.__wbg_ptr = 0, AA.unregister(this), A;
159
159
  }
160
160
  free() {
161
161
  const A = this.__destroy_into_raw();
@@ -167,7 +167,7 @@ class p {
167
167
  */
168
168
  constructor(A, I) {
169
169
  const g = C.desktopsize_create(A, I);
170
- return this.__wbg_ptr = g, _.register(this, this.__wbg_ptr, this), this;
170
+ return this.__wbg_ptr = g, AA.register(this, this.__wbg_ptr, this), this;
171
171
  }
172
172
  /**
173
173
  * @returns {number}
@@ -194,15 +194,15 @@ class p {
194
194
  C.__wbg_set_desktopsize_width(this.__wbg_ptr, A);
195
195
  }
196
196
  }
197
- Symbol.dispose && (p.prototype[Symbol.dispose] = p.prototype.free);
198
- class K {
197
+ Symbol.dispose && (V.prototype[Symbol.dispose] = V.prototype.free);
198
+ class h {
199
199
  static __wrap(A) {
200
- const I = Object.create(K.prototype);
201
- return I.__wbg_ptr = A, EA.register(I, I.__wbg_ptr, I), I;
200
+ const I = Object.create(h.prototype);
201
+ return I.__wbg_ptr = A, GA.register(I, I.__wbg_ptr, I), I;
202
202
  }
203
203
  __destroy_into_raw() {
204
204
  const A = this.__wbg_ptr;
205
- return this.__wbg_ptr = 0, EA.unregister(this), A;
205
+ return this.__wbg_ptr = 0, GA.unregister(this), A;
206
206
  }
207
207
  free() {
208
208
  const A = this.__destroy_into_raw();
@@ -214,7 +214,7 @@ class K {
214
214
  */
215
215
  static keyPressed(A) {
216
216
  const I = C.deviceevent_keyPressed(A);
217
- return K.__wrap(I);
217
+ return h.__wrap(I);
218
218
  }
219
219
  /**
220
220
  * @param {number} scancode
@@ -222,7 +222,7 @@ class K {
222
222
  */
223
223
  static keyReleased(A) {
224
224
  const I = C.deviceevent_keyReleased(A);
225
- return K.__wrap(I);
225
+ return h.__wrap(I);
226
226
  }
227
227
  /**
228
228
  * @param {number} button
@@ -230,7 +230,7 @@ class K {
230
230
  */
231
231
  static mouseButtonPressed(A) {
232
232
  const I = C.deviceevent_mouseButtonPressed(A);
233
- return K.__wrap(I);
233
+ return h.__wrap(I);
234
234
  }
235
235
  /**
236
236
  * @param {number} button
@@ -238,7 +238,7 @@ class K {
238
238
  */
239
239
  static mouseButtonReleased(A) {
240
240
  const I = C.deviceevent_mouseButtonReleased(A);
241
- return K.__wrap(I);
241
+ return h.__wrap(I);
242
242
  }
243
243
  /**
244
244
  * @param {number} x
@@ -247,7 +247,7 @@ class K {
247
247
  */
248
248
  static mouseMove(A, I) {
249
249
  const g = C.deviceevent_mouseMove(A, I);
250
- return K.__wrap(g);
250
+ return h.__wrap(g);
251
251
  }
252
252
  /**
253
253
  * @param {string} unicode
@@ -255,9 +255,9 @@ class K {
255
255
  */
256
256
  static unicodePressed(A) {
257
257
  const I = A.codePointAt(0);
258
- FA(I);
258
+ MA(I);
259
259
  const g = C.deviceevent_unicodePressed(I);
260
- return K.__wrap(g);
260
+ return h.__wrap(g);
261
261
  }
262
262
  /**
263
263
  * @param {string} unicode
@@ -265,9 +265,9 @@ class K {
265
265
  */
266
266
  static unicodeReleased(A) {
267
267
  const I = A.codePointAt(0);
268
- FA(I);
268
+ MA(I);
269
269
  const g = C.deviceevent_unicodeReleased(I);
270
- return K.__wrap(g);
270
+ return h.__wrap(g);
271
271
  }
272
272
  /**
273
273
  * @param {boolean} vertical
@@ -277,14 +277,14 @@ class K {
277
277
  */
278
278
  static wheelRotations(A, I, g) {
279
279
  const B = C.deviceevent_wheelRotations(A, I, g);
280
- return K.__wrap(B);
280
+ return h.__wrap(B);
281
281
  }
282
282
  }
283
- Symbol.dispose && (K.prototype[Symbol.dispose] = K.prototype.free);
284
- class N {
283
+ Symbol.dispose && (h.prototype[Symbol.dispose] = h.prototype.free);
284
+ class k {
285
285
  __destroy_into_raw() {
286
286
  const A = this.__wbg_ptr;
287
- return this.__wbg_ptr = 0, DA.unregister(this), A;
287
+ return this.__wbg_ptr = 0, oA.unregister(this), A;
288
288
  }
289
289
  free() {
290
290
  const A = this.__destroy_into_raw();
@@ -295,15 +295,15 @@ class N {
295
295
  * @param {any} value
296
296
  */
297
297
  constructor(A, I) {
298
- const g = R(A, C.__wbindgen_malloc, C.__wbindgen_realloc), B = k, E = C.extension_create(g, B, I);
299
- return this.__wbg_ptr = E, DA.register(this, this.__wbg_ptr, this), this;
298
+ const g = F(A, C.__wbindgen_malloc, C.__wbindgen_realloc), B = R, E = C.extension_create(g, B, I);
299
+ return this.__wbg_ptr = E, oA.register(this, this.__wbg_ptr, this), this;
300
300
  }
301
301
  }
302
- Symbol.dispose && (N.prototype[Symbol.dispose] = N.prototype.free);
303
- class e {
302
+ Symbol.dispose && (k.prototype[Symbol.dispose] = k.prototype.free);
303
+ class _ {
304
304
  __destroy_into_raw() {
305
305
  const A = this.__wbg_ptr;
306
- return this.__wbg_ptr = 0, iA.unregister(this), A;
306
+ return this.__wbg_ptr = 0, NA.unregister(this), A;
307
307
  }
308
308
  free() {
309
309
  const A = this.__destroy_into_raw();
@@ -313,24 +313,24 @@ class e {
313
313
  * @param {DeviceEvent} event
314
314
  */
315
315
  addEvent(A) {
316
- V(A, K);
316
+ x(A, h);
317
317
  var I = A.__destroy_into_raw();
318
318
  C.inputtransaction_addEvent(this.__wbg_ptr, I);
319
319
  }
320
320
  constructor() {
321
321
  const A = C.inputtransaction_create();
322
- return this.__wbg_ptr = A, iA.register(this, this.__wbg_ptr, this), this;
322
+ return this.__wbg_ptr = A, NA.register(this, this.__wbg_ptr, this), this;
323
323
  }
324
324
  }
325
- Symbol.dispose && (e.prototype[Symbol.dispose] = e.prototype.free);
326
- class T {
325
+ Symbol.dispose && (_.prototype[Symbol.dispose] = _.prototype.free);
326
+ class n {
327
327
  static __wrap(A) {
328
- const I = Object.create(T.prototype);
329
- return I.__wbg_ptr = A, wA.register(I, I.__wbg_ptr, I), I;
328
+ const I = Object.create(n.prototype);
329
+ return I.__wbg_ptr = A, kA.register(I, I.__wbg_ptr, I), I;
330
330
  }
331
331
  __destroy_into_raw() {
332
332
  const A = this.__wbg_ptr;
333
- return this.__wbg_ptr = 0, wA.unregister(this), A;
333
+ return this.__wbg_ptr = 0, kA.unregister(this), A;
334
334
  }
335
335
  free() {
336
336
  const A = this.__destroy_into_raw();
@@ -359,18 +359,18 @@ class T {
359
359
  */
360
360
  rdcleanpathDetails() {
361
361
  const A = C.ironerror_rdcleanpathDetails(this.__wbg_ptr);
362
- return A === 0 ? void 0 : n.__wrap(A);
362
+ return A === 0 ? void 0 : z.__wrap(A);
363
363
  }
364
364
  }
365
- Symbol.dispose && (T.prototype[Symbol.dispose] = T.prototype.free);
366
- class n {
365
+ Symbol.dispose && (n.prototype[Symbol.dispose] = n.prototype.free);
366
+ class z {
367
367
  static __wrap(A) {
368
- const I = Object.create(n.prototype);
369
- return I.__wbg_ptr = A, GA.register(I, I.__wbg_ptr, I), I;
368
+ const I = Object.create(z.prototype);
369
+ return I.__wbg_ptr = A, RA.register(I, I.__wbg_ptr, I), I;
370
370
  }
371
371
  __destroy_into_raw() {
372
372
  const A = this.__wbg_ptr;
373
- return this.__wbg_ptr = 0, GA.unregister(this), A;
373
+ return this.__wbg_ptr = 0, RA.unregister(this), A;
374
374
  }
375
375
  free() {
376
376
  const A = this.__destroy_into_raw();
@@ -422,11 +422,11 @@ class n {
422
422
  return A === 16777215 ? void 0 : A;
423
423
  }
424
424
  }
425
- Symbol.dispose && (n.prototype[Symbol.dispose] = n.prototype.free);
426
- class QA {
425
+ Symbol.dispose && (z.prototype[Symbol.dispose] = z.prototype.free);
426
+ class iA {
427
427
  __destroy_into_raw() {
428
428
  const A = this.__wbg_ptr;
429
- return this.__wbg_ptr = 0, oA.unregister(this), A;
429
+ return this.__wbg_ptr = 0, FA.unregister(this), A;
430
430
  }
431
431
  free() {
432
432
  const A = this.__destroy_into_raw();
@@ -434,14 +434,14 @@ class QA {
434
434
  }
435
435
  constructor() {
436
436
  const A = C.rdpfile_create();
437
- return this.__wbg_ptr = A, oA.register(this, this.__wbg_ptr, this), this;
437
+ return this.__wbg_ptr = A, FA.register(this, this.__wbg_ptr, this), this;
438
438
  }
439
439
  /**
440
440
  * @param {string} key
441
441
  * @returns {number | undefined}
442
442
  */
443
443
  getInt(A) {
444
- const I = R(A, C.__wbindgen_malloc, C.__wbindgen_realloc), g = k, B = C.rdpfile_getInt(this.__wbg_ptr, I, g);
444
+ const I = F(A, C.__wbindgen_malloc, C.__wbindgen_realloc), g = R, B = C.rdpfile_getInt(this.__wbg_ptr, I, g);
445
445
  return B === Number.MAX_SAFE_INTEGER ? void 0 : B;
446
446
  }
447
447
  /**
@@ -449,7 +449,7 @@ class QA {
449
449
  * @returns {string | undefined}
450
450
  */
451
451
  getStr(A) {
452
- const I = R(A, C.__wbindgen_malloc, C.__wbindgen_realloc), g = k, B = C.rdpfile_getStr(this.__wbg_ptr, I, g);
452
+ const I = F(A, C.__wbindgen_malloc, C.__wbindgen_realloc), g = R, B = C.rdpfile_getStr(this.__wbg_ptr, I, g);
453
453
  let E;
454
454
  return B[0] !== 0 && (E = y(B[0], B[1]).slice(), C.__wbindgen_free(B[0], B[1] * 1, 1)), E;
455
455
  }
@@ -458,7 +458,7 @@ class QA {
458
458
  * @param {number} value
459
459
  */
460
460
  insertInt(A, I) {
461
- const g = R(A, C.__wbindgen_malloc, C.__wbindgen_realloc), B = k;
461
+ const g = F(A, C.__wbindgen_malloc, C.__wbindgen_realloc), B = R;
462
462
  C.rdpfile_insertInt(this.__wbg_ptr, g, B, I);
463
463
  }
464
464
  /**
@@ -466,14 +466,14 @@ class QA {
466
466
  * @param {string} value
467
467
  */
468
468
  insertStr(A, I) {
469
- const g = R(A, C.__wbindgen_malloc, C.__wbindgen_realloc), B = k, E = R(I, C.__wbindgen_malloc, C.__wbindgen_realloc), D = k;
469
+ const g = F(A, C.__wbindgen_malloc, C.__wbindgen_realloc), B = R, E = F(I, C.__wbindgen_malloc, C.__wbindgen_realloc), D = R;
470
470
  C.rdpfile_insertStr(this.__wbg_ptr, g, B, E, D);
471
471
  }
472
472
  /**
473
473
  * @param {string} config
474
474
  */
475
475
  parse(A) {
476
- const I = R(A, C.__wbindgen_malloc, C.__wbindgen_realloc), g = k;
476
+ const I = F(A, C.__wbindgen_malloc, C.__wbindgen_realloc), g = R;
477
477
  C.rdpfile_parse(this.__wbg_ptr, I, g);
478
478
  }
479
479
  /**
@@ -489,15 +489,15 @@ class QA {
489
489
  }
490
490
  }
491
491
  }
492
- Symbol.dispose && (QA.prototype[Symbol.dispose] = QA.prototype.free);
493
- class r {
492
+ Symbol.dispose && (iA.prototype[Symbol.dispose] = iA.prototype.free);
493
+ class P {
494
494
  static __wrap(A) {
495
- const I = Object.create(r.prototype);
496
- return I.__wbg_ptr = A, NA.register(I, I.__wbg_ptr, I), I;
495
+ const I = Object.create(P.prototype);
496
+ return I.__wbg_ptr = A, yA.register(I, I.__wbg_ptr, I), I;
497
497
  }
498
498
  __destroy_into_raw() {
499
499
  const A = this.__wbg_ptr;
500
- return this.__wbg_ptr = 0, NA.unregister(this), A;
500
+ return this.__wbg_ptr = 0, yA.unregister(this), A;
501
501
  }
502
502
  free() {
503
503
  const A = this.__destroy_into_raw();
@@ -507,42 +507,42 @@ class r {
507
507
  * @param {InputTransaction} transaction
508
508
  */
509
509
  applyInputs(A) {
510
- V(A, e);
510
+ x(A, _);
511
511
  var I = A.__destroy_into_raw();
512
512
  const g = C.session_applyInputs(this.__wbg_ptr, I);
513
513
  if (g[1])
514
- throw q(g[0]);
514
+ throw p(g[0]);
515
515
  }
516
516
  /**
517
517
  * @returns {DesktopSize}
518
518
  */
519
519
  desktopSize() {
520
520
  const A = C.session_desktopSize(this.__wbg_ptr);
521
- return p.__wrap(A);
521
+ return V.__wrap(A);
522
522
  }
523
523
  /**
524
524
  * @param {Extension} ext
525
525
  * @returns {any}
526
526
  */
527
527
  invokeExtension(A) {
528
- V(A, N);
528
+ x(A, k);
529
529
  var I = A.__destroy_into_raw();
530
530
  const g = C.session_invokeExtension(this.__wbg_ptr, I);
531
531
  if (g[2])
532
- throw q(g[1]);
533
- return q(g[0]);
532
+ throw p(g[1]);
533
+ return p(g[0]);
534
534
  }
535
535
  /**
536
536
  * @param {ClipboardData} content
537
537
  * @returns {Promise<void>}
538
538
  */
539
539
  onClipboardPaste(A) {
540
- return V(A, Z), C.session_onClipboardPaste(this.__wbg_ptr, A.__wbg_ptr);
540
+ return x(A, d), C.session_onClipboardPaste(this.__wbg_ptr, A.__wbg_ptr);
541
541
  }
542
542
  releaseAllInputs() {
543
543
  const A = C.session_releaseAllInputs(this.__wbg_ptr);
544
544
  if (A[1])
545
- throw q(A[0]);
545
+ throw p(A[0]);
546
546
  }
547
547
  /**
548
548
  * @param {number} width
@@ -552,7 +552,7 @@ class r {
552
552
  * @param {number | null} [physical_height]
553
553
  */
554
554
  resize(A, I, g, B, E) {
555
- C.session_resize(this.__wbg_ptr, A, I, h(g) ? Number.MAX_SAFE_INTEGER : g >>> 0, h(B) ? Number.MAX_SAFE_INTEGER : B >>> 0, h(E) ? Number.MAX_SAFE_INTEGER : E >>> 0);
555
+ C.session_resize(this.__wbg_ptr, A, I, H(g) ? Number.MAX_SAFE_INTEGER : g >>> 0, H(B) ? Number.MAX_SAFE_INTEGER : B >>> 0, H(E) ? Number.MAX_SAFE_INTEGER : E >>> 0);
556
556
  }
557
557
  /**
558
558
  * @returns {Promise<SessionTerminationInfo>}
@@ -563,7 +563,7 @@ class r {
563
563
  shutdown() {
564
564
  const A = C.session_shutdown(this.__wbg_ptr);
565
565
  if (A[1])
566
- throw q(A[0]);
566
+ throw p(A[0]);
567
567
  }
568
568
  /**
569
569
  * @returns {boolean}
@@ -580,18 +580,18 @@ class r {
580
580
  synchronizeLockKeys(A, I, g, B) {
581
581
  const E = C.session_synchronizeLockKeys(this.__wbg_ptr, A, I, g, B);
582
582
  if (E[1])
583
- throw q(E[0]);
583
+ throw p(E[0]);
584
584
  }
585
585
  }
586
- Symbol.dispose && (r.prototype[Symbol.dispose] = r.prototype.free);
587
- class c {
586
+ Symbol.dispose && (P.prototype[Symbol.dispose] = P.prototype.free);
587
+ class J {
588
588
  static __wrap(A) {
589
- const I = Object.create(c.prototype);
590
- return I.__wbg_ptr = A, $.register(I, I.__wbg_ptr, I), I;
589
+ const I = Object.create(J.prototype);
590
+ return I.__wbg_ptr = A, IA.register(I, I.__wbg_ptr, I), I;
591
591
  }
592
592
  __destroy_into_raw() {
593
593
  const A = this.__wbg_ptr;
594
- return this.__wbg_ptr = 0, $.unregister(this), A;
594
+ return this.__wbg_ptr = 0, IA.unregister(this), A;
595
595
  }
596
596
  free() {
597
597
  const A = this.__destroy_into_raw();
@@ -602,8 +602,8 @@ class c {
602
602
  * @returns {SessionBuilder}
603
603
  */
604
604
  authToken(A) {
605
- const I = R(A, C.__wbindgen_malloc, C.__wbindgen_realloc), g = k, B = C.sessionbuilder_authToken(this.__wbg_ptr, I, g);
606
- return c.__wrap(B);
605
+ const I = F(A, C.__wbindgen_malloc, C.__wbindgen_realloc), g = R, B = C.sessionbuilder_authToken(this.__wbg_ptr, I, g);
606
+ return J.__wrap(B);
607
607
  }
608
608
  /**
609
609
  * @param {Function} callback
@@ -611,7 +611,7 @@ class c {
611
611
  */
612
612
  canvasResizedCallback(A) {
613
613
  const I = C.sessionbuilder_canvasResizedCallback(this.__wbg_ptr, A);
614
- return c.__wrap(I);
614
+ return J.__wrap(I);
615
615
  }
616
616
  /**
617
617
  * @returns {Promise<Session>}
@@ -621,35 +621,35 @@ class c {
621
621
  }
622
622
  constructor() {
623
623
  const A = C.sessionbuilder_create();
624
- return this.__wbg_ptr = A, $.register(this, this.__wbg_ptr, this), this;
624
+ return this.__wbg_ptr = A, IA.register(this, this.__wbg_ptr, this), this;
625
625
  }
626
626
  /**
627
627
  * @param {DesktopSize} desktop_size
628
628
  * @returns {SessionBuilder}
629
629
  */
630
630
  desktopSize(A) {
631
- V(A, p);
631
+ x(A, V);
632
632
  var I = A.__destroy_into_raw();
633
633
  const g = C.sessionbuilder_desktopSize(this.__wbg_ptr, I);
634
- return c.__wrap(g);
634
+ return J.__wrap(g);
635
635
  }
636
636
  /**
637
637
  * @param {string} destination
638
638
  * @returns {SessionBuilder}
639
639
  */
640
640
  destination(A) {
641
- const I = R(A, C.__wbindgen_malloc, C.__wbindgen_realloc), g = k, B = C.sessionbuilder_destination(this.__wbg_ptr, I, g);
642
- return c.__wrap(B);
641
+ const I = F(A, C.__wbindgen_malloc, C.__wbindgen_realloc), g = R, B = C.sessionbuilder_destination(this.__wbg_ptr, I, g);
642
+ return J.__wrap(B);
643
643
  }
644
644
  /**
645
645
  * @param {Extension} ext
646
646
  * @returns {SessionBuilder}
647
647
  */
648
648
  extension(A) {
649
- V(A, N);
649
+ x(A, k);
650
650
  var I = A.__destroy_into_raw();
651
651
  const g = C.sessionbuilder_extension(this.__wbg_ptr, I);
652
- return c.__wrap(g);
652
+ return J.__wrap(g);
653
653
  }
654
654
  /**
655
655
  * @param {Function} callback
@@ -657,23 +657,23 @@ class c {
657
657
  */
658
658
  forceClipboardUpdateCallback(A) {
659
659
  const I = C.sessionbuilder_forceClipboardUpdateCallback(this.__wbg_ptr, A);
660
- return c.__wrap(I);
660
+ return J.__wrap(I);
661
661
  }
662
662
  /**
663
663
  * @param {string} password
664
664
  * @returns {SessionBuilder}
665
665
  */
666
666
  password(A) {
667
- const I = R(A, C.__wbindgen_malloc, C.__wbindgen_realloc), g = k, B = C.sessionbuilder_password(this.__wbg_ptr, I, g);
668
- return c.__wrap(B);
667
+ const I = F(A, C.__wbindgen_malloc, C.__wbindgen_realloc), g = R, B = C.sessionbuilder_password(this.__wbg_ptr, I, g);
668
+ return J.__wrap(B);
669
669
  }
670
670
  /**
671
671
  * @param {string} address
672
672
  * @returns {SessionBuilder}
673
673
  */
674
674
  proxyAddress(A) {
675
- const I = R(A, C.__wbindgen_malloc, C.__wbindgen_realloc), g = k, B = C.sessionbuilder_proxyAddress(this.__wbg_ptr, I, g);
676
- return c.__wrap(B);
675
+ const I = F(A, C.__wbindgen_malloc, C.__wbindgen_realloc), g = R, B = C.sessionbuilder_proxyAddress(this.__wbg_ptr, I, g);
676
+ return J.__wrap(B);
677
677
  }
678
678
  /**
679
679
  * @param {Function} callback
@@ -681,7 +681,7 @@ class c {
681
681
  */
682
682
  remoteClipboardChangedCallback(A) {
683
683
  const I = C.sessionbuilder_remoteClipboardChangedCallback(this.__wbg_ptr, A);
684
- return c.__wrap(I);
684
+ return J.__wrap(I);
685
685
  }
686
686
  /**
687
687
  * @param {HTMLCanvasElement} canvas
@@ -689,15 +689,15 @@ class c {
689
689
  */
690
690
  renderCanvas(A) {
691
691
  const I = C.sessionbuilder_renderCanvas(this.__wbg_ptr, A);
692
- return c.__wrap(I);
692
+ return J.__wrap(I);
693
693
  }
694
694
  /**
695
695
  * @param {string} server_domain
696
696
  * @returns {SessionBuilder}
697
697
  */
698
698
  serverDomain(A) {
699
- const I = R(A, C.__wbindgen_malloc, C.__wbindgen_realloc), g = k, B = C.sessionbuilder_serverDomain(this.__wbg_ptr, I, g);
700
- return c.__wrap(B);
699
+ const I = F(A, C.__wbindgen_malloc, C.__wbindgen_realloc), g = R, B = C.sessionbuilder_serverDomain(this.__wbg_ptr, I, g);
700
+ return J.__wrap(B);
701
701
  }
702
702
  /**
703
703
  * @param {Function} callback
@@ -705,7 +705,7 @@ class c {
705
705
  */
706
706
  setCursorStyleCallback(A) {
707
707
  const I = C.sessionbuilder_setCursorStyleCallback(this.__wbg_ptr, A);
708
- return c.__wrap(I);
708
+ return J.__wrap(I);
709
709
  }
710
710
  /**
711
711
  * @param {any} context
@@ -713,26 +713,26 @@ class c {
713
713
  */
714
714
  setCursorStyleCallbackContext(A) {
715
715
  const I = C.sessionbuilder_setCursorStyleCallbackContext(this.__wbg_ptr, A);
716
- return c.__wrap(I);
716
+ return J.__wrap(I);
717
717
  }
718
718
  /**
719
719
  * @param {string} username
720
720
  * @returns {SessionBuilder}
721
721
  */
722
722
  username(A) {
723
- const I = R(A, C.__wbindgen_malloc, C.__wbindgen_realloc), g = k, B = C.sessionbuilder_username(this.__wbg_ptr, I, g);
724
- return c.__wrap(B);
723
+ const I = F(A, C.__wbindgen_malloc, C.__wbindgen_realloc), g = R, B = C.sessionbuilder_username(this.__wbg_ptr, I, g);
724
+ return J.__wrap(B);
725
725
  }
726
726
  }
727
- Symbol.dispose && (c.prototype[Symbol.dispose] = c.prototype.free);
728
- class P {
727
+ Symbol.dispose && (J.prototype[Symbol.dispose] = J.prototype.free);
728
+ class v {
729
729
  static __wrap(A) {
730
- const I = Object.create(P.prototype);
731
- return I.__wbg_ptr = A, kA.register(I, I.__wbg_ptr, I), I;
730
+ const I = Object.create(v.prototype);
731
+ return I.__wbg_ptr = A, YA.register(I, I.__wbg_ptr, I), I;
732
732
  }
733
733
  __destroy_into_raw() {
734
734
  const A = this.__wbg_ptr;
735
- return this.__wbg_ptr = 0, kA.unregister(this), A;
735
+ return this.__wbg_ptr = 0, YA.unregister(this), A;
736
736
  }
737
737
  free() {
738
738
  const A = this.__destroy_into_raw();
@@ -751,23 +751,23 @@ class P {
751
751
  }
752
752
  }
753
753
  }
754
- Symbol.dispose && (P.prototype[Symbol.dispose] = P.prototype.free);
755
- function JA(Q) {
756
- const A = R(Q, C.__wbindgen_malloc, C.__wbindgen_realloc), I = k;
754
+ Symbol.dispose && (v.prototype[Symbol.dispose] = v.prototype.free);
755
+ function hA(Q) {
756
+ const A = F(Q, C.__wbindgen_malloc, C.__wbindgen_realloc), I = R;
757
757
  C.setup(A, I);
758
758
  }
759
- function UA() {
759
+ function aA() {
760
760
  return {
761
761
  __proto__: null,
762
762
  "./ironrdp_web_bg.js": {
763
763
  __proto__: null,
764
764
  __wbg___wbindgen_boolean_get_fa956cfa2d1bd751: function(A) {
765
765
  const I = A, g = typeof I == "boolean" ? I : void 0;
766
- return h(g) ? 16777215 : g ? 1 : 0;
766
+ return H(g) ? 16777215 : g ? 1 : 0;
767
767
  },
768
768
  __wbg___wbindgen_debug_string_c25d447a39f5578f: function(A, I) {
769
- const g = gA(I), B = R(g, C.__wbindgen_malloc, C.__wbindgen_realloc), E = k;
770
- M().setInt32(A + 4, E, true), M().setInt32(A + 0, B, true);
769
+ const g = QA(I), B = F(g, C.__wbindgen_malloc, C.__wbindgen_realloc), E = R;
770
+ Y().setInt32(A + 4, E, true), Y().setInt32(A + 0, B, true);
771
771
  },
772
772
  __wbg___wbindgen_is_function_1ff95bcc5517c252: function(A) {
773
773
  return typeof A == "function";
@@ -787,12 +787,12 @@ function UA() {
787
787
  },
788
788
  __wbg___wbindgen_number_get_394265ed1e1b84ee: function(A, I) {
789
789
  const g = I, B = typeof g == "number" ? g : void 0;
790
- M().setFloat64(A + 8, h(B) ? 0 : B, true), M().setInt32(A + 0, !h(B), true);
790
+ Y().setFloat64(A + 8, H(B) ? 0 : B, true), Y().setInt32(A + 0, !H(B), true);
791
791
  },
792
792
  __wbg___wbindgen_string_get_b0ca35b86a603356: function(A, I) {
793
793
  const g = I, B = typeof g == "string" ? g : void 0;
794
- var E = h(B) ? 0 : R(B, C.__wbindgen_malloc, C.__wbindgen_realloc), D = k;
795
- M().setInt32(A + 4, D, true), M().setInt32(A + 0, E, true);
794
+ var E = H(B) ? 0 : F(B, C.__wbindgen_malloc, C.__wbindgen_realloc), D = R;
795
+ Y().setInt32(A + 4, D, true), Y().setInt32(A + 0, E, true);
796
796
  },
797
797
  __wbg___wbindgen_throw_344f42d3211c4765: function(A, I) {
798
798
  throw new Error(y(A, I));
@@ -847,10 +847,10 @@ function UA() {
847
847
  return clearTimeout(A);
848
848
  },
849
849
  __wbg_clipboarddata_new: function(A) {
850
- return Z.__wrap(A);
850
+ return d.__wrap(A);
851
851
  },
852
852
  __wbg_clipboarditem_new: function(A) {
853
- return f.__wrap(A);
853
+ return r.__wrap(A);
854
854
  },
855
855
  __wbg_close_c65ca0257e895318: function() {
856
856
  return o(function(A) {
@@ -891,22 +891,22 @@ function UA() {
891
891
  __wbg_getContext_e79ddf6a9cb3cc76: function() {
892
892
  return o(function(A, I, g) {
893
893
  const B = A.getContext(y(I, g));
894
- return h(B) ? 0 : L(B);
894
+ return H(B) ? 0 : q(B);
895
895
  }, arguments);
896
896
  },
897
897
  __wbg_getRandomValues_3f44b700395062e5: function() {
898
898
  return o(function(A, I) {
899
- globalThis.crypto.getRandomValues(t(A, I));
899
+ globalThis.crypto.getRandomValues(m(A, I));
900
900
  }, arguments);
901
901
  },
902
902
  __wbg_getRandomValues_bf16787eede473f5: function() {
903
903
  return o(function(A, I) {
904
- globalThis.crypto.getRandomValues(t(A, I));
904
+ globalThis.crypto.getRandomValues(m(A, I));
905
905
  }, arguments);
906
906
  },
907
907
  __wbg_getRandomValues_cc7f052a444bb2ce: function() {
908
908
  return o(function(A, I) {
909
- globalThis.crypto.getRandomValues(t(A, I));
909
+ globalThis.crypto.getRandomValues(m(A, I));
910
910
  }, arguments);
911
911
  },
912
912
  __wbg_getTime_d6f070c088c9b5ed: function(A) {
@@ -993,7 +993,7 @@ function UA() {
993
993
  return I;
994
994
  },
995
995
  __wbg_ironerror_new: function(A) {
996
- return T.__wrap(A);
996
+ return n.__wrap(A);
997
997
  },
998
998
  __wbg_isArray_0677c962b281d01a: function(A) {
999
999
  return Array.isArray(A);
@@ -1049,10 +1049,10 @@ function UA() {
1049
1049
  }, arguments);
1050
1050
  },
1051
1051
  __wbg_new_from_slice_7568ba55b4a7e81f: function(A, I) {
1052
- return new Uint32Array(dA(A, I));
1052
+ return new Uint32Array(WA(A, I));
1053
1053
  },
1054
1054
  __wbg_new_from_slice_77cdfb7977362f3c: function(A, I) {
1055
- return new Uint8Array(t(A, I));
1055
+ return new Uint8Array(m(A, I));
1056
1056
  },
1057
1057
  __wbg_new_typed_1824d93f294193e5: function(A, I) {
1058
1058
  try {
@@ -1060,7 +1060,7 @@ function UA() {
1060
1060
  const w = g.a;
1061
1061
  g.a = 0;
1062
1062
  try {
1063
- return sA(w, g.b, D, i);
1063
+ return pA(w, g.b, D, i);
1064
1064
  } finally {
1065
1065
  g.a = w;
1066
1066
  }
@@ -1092,7 +1092,7 @@ function UA() {
1092
1092
  },
1093
1093
  __wbg_new_with_u8_clamped_array_and_sh_2767e4741c267d25: function() {
1094
1094
  return o(function(A, I, g, B) {
1095
- return new ImageData(VA(A, I), g >>> 0, B >>> 0);
1095
+ return new ImageData(xA(A, I), g >>> 0, B >>> 0);
1096
1096
  }, arguments);
1097
1097
  },
1098
1098
  __wbg_now_390768da5ee9e776: function(A) {
@@ -1112,13 +1112,13 @@ function UA() {
1112
1112
  },
1113
1113
  __wbg_performance_3ef602e13d6c3b56: function(A) {
1114
1114
  const I = A.performance;
1115
- return h(I) ? 0 : L(I);
1115
+ return H(I) ? 0 : q(I);
1116
1116
  },
1117
1117
  __wbg_performance_3fcf6e32a7e1ed0a: function(A) {
1118
1118
  return A.performance;
1119
1119
  },
1120
1120
  __wbg_prototypesetcall_4770620bbe4688a0: function(A, I, g) {
1121
- Uint8Array.prototype.set.call(t(A, I), g);
1121
+ Uint8Array.prototype.set.call(m(A, I), g);
1122
1122
  },
1123
1123
  __wbg_push_d2ae3af0c1217ae6: function(A, I) {
1124
1124
  return A.push(I);
@@ -1138,8 +1138,8 @@ function UA() {
1138
1138
  return A.readyState;
1139
1139
  },
1140
1140
  __wbg_reason_5dc8e429d537d6a9: function(A, I) {
1141
- const g = I.reason, B = R(g, C.__wbindgen_malloc, C.__wbindgen_realloc), E = k;
1142
- M().setInt32(A + 4, E, true), M().setInt32(A + 0, B, true);
1141
+ const g = I.reason, B = F(g, C.__wbindgen_malloc, C.__wbindgen_realloc), E = R;
1142
+ Y().setInt32(A + 4, E, true), Y().setInt32(A + 0, B, true);
1143
1143
  },
1144
1144
  __wbg_removeEventListener_a3f23c70077bdcc1: function() {
1145
1145
  return o(function(A, I, g, B) {
@@ -1150,8 +1150,8 @@ function UA() {
1150
1150
  return Promise.resolve(A);
1151
1151
  },
1152
1152
  __wbg_search_c905fb82fd20bc6b: function(A, I) {
1153
- const g = I.search, B = R(g, C.__wbindgen_malloc, C.__wbindgen_realloc), E = k;
1154
- M().setInt32(A + 4, E, true), M().setInt32(A + 0, B, true);
1153
+ const g = I.search, B = F(g, C.__wbindgen_malloc, C.__wbindgen_realloc), E = R;
1154
+ Y().setInt32(A + 4, E, true), Y().setInt32(A + 0, B, true);
1155
1155
  },
1156
1156
  __wbg_send_1733c45567a373ff: function() {
1157
1157
  return o(function(A, I) {
@@ -1164,10 +1164,10 @@ function UA() {
1164
1164
  }, arguments);
1165
1165
  },
1166
1166
  __wbg_session_new: function(A) {
1167
- return r.__wrap(A);
1167
+ return P.__wrap(A);
1168
1168
  },
1169
1169
  __wbg_sessionterminationinfo_new: function(A) {
1170
- return P.__wrap(A);
1170
+ return v.__wrap(A);
1171
1171
  },
1172
1172
  __wbg_setInterval_cbf1c35c6a692d37: function() {
1173
1173
  return o(function(A, I) {
@@ -1190,7 +1190,7 @@ function UA() {
1190
1190
  }, arguments);
1191
1191
  },
1192
1192
  __wbg_set_binaryType_a37b086c78ca7c29: function(A, I) {
1193
- A.binaryType = ZA[I];
1193
+ A.binaryType = VA[I];
1194
1194
  },
1195
1195
  __wbg_set_body_029f2d171e0a005f: function(A, I) {
1196
1196
  A.body = I;
@@ -1220,28 +1220,28 @@ function UA() {
1220
1220
  A.width = I >>> 0;
1221
1221
  },
1222
1222
  __wbg_stack_3b0d974bbf31e44f: function(A, I) {
1223
- const g = I.stack, B = R(g, C.__wbindgen_malloc, C.__wbindgen_realloc), E = k;
1224
- M().setInt32(A + 4, E, true), M().setInt32(A + 0, B, true);
1223
+ const g = I.stack, B = F(g, C.__wbindgen_malloc, C.__wbindgen_realloc), E = R;
1224
+ Y().setInt32(A + 4, E, true), Y().setInt32(A + 0, B, true);
1225
1225
  },
1226
1226
  __wbg_static_accessor_GLOBAL_4ef717fb391d88b7: function() {
1227
1227
  const A = typeof global > "u" ? null : global;
1228
- return h(A) ? 0 : L(A);
1228
+ return H(A) ? 0 : q(A);
1229
1229
  },
1230
1230
  __wbg_static_accessor_GLOBAL_THIS_8d1badc68b5a74f4: function() {
1231
1231
  const A = typeof globalThis > "u" ? null : globalThis;
1232
- return h(A) ? 0 : L(A);
1232
+ return H(A) ? 0 : q(A);
1233
1233
  },
1234
1234
  __wbg_static_accessor_SELF_146583524fe1469b: function() {
1235
1235
  const A = typeof self > "u" ? null : self;
1236
- return h(A) ? 0 : L(A);
1236
+ return H(A) ? 0 : q(A);
1237
1237
  },
1238
1238
  __wbg_static_accessor_WINDOW_f2829a2234d7819e: function() {
1239
1239
  const A = typeof window > "u" ? null : window;
1240
- return h(A) ? 0 : L(A);
1240
+ return H(A) ? 0 : q(A);
1241
1241
  },
1242
1242
  __wbg_statusText_9f08c32741a99815: function(A, I) {
1243
- const g = I.statusText, B = R(g, C.__wbindgen_malloc, C.__wbindgen_realloc), E = k;
1244
- M().setInt32(A + 4, E, true), M().setInt32(A + 0, B, true);
1243
+ const g = I.statusText, B = F(g, C.__wbindgen_malloc, C.__wbindgen_realloc), E = R;
1244
+ Y().setInt32(A + 4, E, true), Y().setInt32(A + 0, B, true);
1245
1245
  },
1246
1246
  __wbg_status_c45b3b9b3033184a: function(A) {
1247
1247
  return A.status;
@@ -1259,13 +1259,13 @@ function UA() {
1259
1259
  return A.toString();
1260
1260
  },
1261
1261
  __wbg_url_f6cd241d61f89b82: function(A, I) {
1262
- const g = I.url, B = R(g, C.__wbindgen_malloc, C.__wbindgen_realloc), E = k;
1263
- M().setInt32(A + 4, E, true), M().setInt32(A + 0, B, true);
1262
+ const g = I.url, B = F(g, C.__wbindgen_malloc, C.__wbindgen_realloc), E = R;
1263
+ Y().setInt32(A + 4, E, true), Y().setInt32(A + 0, B, true);
1264
1264
  },
1265
1265
  __wbg_userAgent_0558f0ac642f7771: function() {
1266
1266
  return o(function(A, I) {
1267
- const g = I.userAgent, B = R(g, C.__wbindgen_malloc, C.__wbindgen_realloc), E = k;
1268
- M().setInt32(A + 4, E, true), M().setInt32(A + 0, B, true);
1267
+ const g = I.userAgent, B = F(g, C.__wbindgen_malloc, C.__wbindgen_realloc), E = R;
1268
+ Y().setInt32(A + 4, E, true), Y().setInt32(A + 0, B, true);
1269
1269
  }, arguments);
1270
1270
  },
1271
1271
  __wbg_warn_b1370d804fa3e259: function(A) {
@@ -1278,25 +1278,25 @@ function UA() {
1278
1278
  return A.width;
1279
1279
  },
1280
1280
  __wbindgen_cast_0000000000000001: function(A, I) {
1281
- return S(A, I, LA);
1281
+ return s(A, I, ZA);
1282
1282
  },
1283
1283
  __wbindgen_cast_0000000000000002: function(A, I) {
1284
- return S(A, I, aA);
1284
+ return s(A, I, LA);
1285
1285
  },
1286
1286
  __wbindgen_cast_0000000000000003: function(A, I) {
1287
- return S(A, I, HA);
1287
+ return s(A, I, sA);
1288
1288
  },
1289
1289
  __wbindgen_cast_0000000000000004: function(A, I) {
1290
- return S(A, I, SA);
1290
+ return s(A, I, qA);
1291
1291
  },
1292
1292
  __wbindgen_cast_0000000000000005: function(A, I) {
1293
- return S(A, I, qA);
1293
+ return s(A, I, dA);
1294
1294
  },
1295
1295
  __wbindgen_cast_0000000000000006: function(A, I) {
1296
- return S(A, I, KA);
1296
+ return s(A, I, HA);
1297
1297
  },
1298
1298
  __wbindgen_cast_0000000000000007: function(A, I) {
1299
- return S(A, I, hA);
1299
+ return s(A, I, SA);
1300
1300
  },
1301
1301
  __wbindgen_cast_0000000000000008: function(A) {
1302
1302
  return A;
@@ -1311,72 +1311,72 @@ function UA() {
1311
1311
  }
1312
1312
  };
1313
1313
  }
1314
- function KA(Q, A) {
1314
+ function HA(Q, A) {
1315
1315
  C.wasm_bindgen__convert__closures_____invoke__h38edb88495230029(Q, A);
1316
1316
  }
1317
- function hA(Q, A) {
1317
+ function SA(Q, A) {
1318
1318
  C.wasm_bindgen__convert__closures_____invoke__h59fff34e32ed8cec(Q, A);
1319
1319
  }
1320
- function aA(Q, A, I) {
1320
+ function LA(Q, A, I) {
1321
1321
  C.wasm_bindgen__convert__closures_____invoke__h64a57be2ca3e0d69(Q, A, I);
1322
1322
  }
1323
- function HA(Q, A, I) {
1323
+ function sA(Q, A, I) {
1324
1324
  C.wasm_bindgen__convert__closures_____invoke__h64a57be2ca3e0d69_2(Q, A, I);
1325
1325
  }
1326
- function SA(Q, A, I) {
1326
+ function qA(Q, A, I) {
1327
1327
  C.wasm_bindgen__convert__closures_____invoke__h64a57be2ca3e0d69_3(Q, A, I);
1328
1328
  }
1329
- function LA(Q, A, I) {
1329
+ function ZA(Q, A, I) {
1330
1330
  const g = C.wasm_bindgen__convert__closures_____invoke__hfbb046a5343bcac9(Q, A, I);
1331
1331
  if (g[1])
1332
- throw q(g[0]);
1332
+ throw p(g[0]);
1333
1333
  }
1334
- function sA(Q, A, I, g) {
1334
+ function pA(Q, A, I, g) {
1335
1335
  C.wasm_bindgen__convert__closures_____invoke__h4cc111f3c9bb2945(Q, A, I, g);
1336
1336
  }
1337
- function qA(Q, A, I, g, B) {
1337
+ function dA(Q, A, I, g, B) {
1338
1338
  C.wasm_bindgen__convert__closures_____invoke__h777de2c1fe9da8ab(Q, A, I, g, B);
1339
1339
  }
1340
- const ZA = ["blob", "arraybuffer"], u = typeof FinalizationRegistry > "u" ? { register: () => {
1340
+ const VA = ["blob", "arraybuffer"], $ = typeof FinalizationRegistry > "u" ? { register: () => {
1341
1341
  }, unregister: () => {
1342
- } } : new FinalizationRegistry((Q) => C.__wbg_clipboarddata_free(Q, 1)), CA = typeof FinalizationRegistry > "u" ? { register: () => {
1342
+ } } : new FinalizationRegistry((Q) => C.__wbg_clipboarddata_free(Q, 1)), wA = typeof FinalizationRegistry > "u" ? { register: () => {
1343
1343
  }, unregister: () => {
1344
- } } : new FinalizationRegistry((Q) => C.__wbg_clipboarditem_free(Q, 1)), _ = typeof FinalizationRegistry > "u" ? { register: () => {
1344
+ } } : new FinalizationRegistry((Q) => C.__wbg_clipboarditem_free(Q, 1)), AA = typeof FinalizationRegistry > "u" ? { register: () => {
1345
1345
  }, unregister: () => {
1346
- } } : new FinalizationRegistry((Q) => C.__wbg_desktopsize_free(Q, 1)), EA = typeof FinalizationRegistry > "u" ? { register: () => {
1346
+ } } : new FinalizationRegistry((Q) => C.__wbg_desktopsize_free(Q, 1)), GA = typeof FinalizationRegistry > "u" ? { register: () => {
1347
1347
  }, unregister: () => {
1348
- } } : new FinalizationRegistry((Q) => C.__wbg_deviceevent_free(Q, 1)), DA = typeof FinalizationRegistry > "u" ? { register: () => {
1348
+ } } : new FinalizationRegistry((Q) => C.__wbg_deviceevent_free(Q, 1)), oA = typeof FinalizationRegistry > "u" ? { register: () => {
1349
1349
  }, unregister: () => {
1350
- } } : new FinalizationRegistry((Q) => C.__wbg_extension_free(Q, 1)), iA = typeof FinalizationRegistry > "u" ? { register: () => {
1350
+ } } : new FinalizationRegistry((Q) => C.__wbg_extension_free(Q, 1)), NA = typeof FinalizationRegistry > "u" ? { register: () => {
1351
1351
  }, unregister: () => {
1352
- } } : new FinalizationRegistry((Q) => C.__wbg_inputtransaction_free(Q, 1)), wA = typeof FinalizationRegistry > "u" ? { register: () => {
1352
+ } } : new FinalizationRegistry((Q) => C.__wbg_inputtransaction_free(Q, 1)), kA = typeof FinalizationRegistry > "u" ? { register: () => {
1353
1353
  }, unregister: () => {
1354
- } } : new FinalizationRegistry((Q) => C.__wbg_ironerror_free(Q, 1)), GA = typeof FinalizationRegistry > "u" ? { register: () => {
1354
+ } } : new FinalizationRegistry((Q) => C.__wbg_ironerror_free(Q, 1)), RA = typeof FinalizationRegistry > "u" ? { register: () => {
1355
1355
  }, unregister: () => {
1356
- } } : new FinalizationRegistry((Q) => C.__wbg_rdcleanpathdetails_free(Q, 1)), oA = typeof FinalizationRegistry > "u" ? { register: () => {
1356
+ } } : new FinalizationRegistry((Q) => C.__wbg_rdcleanpathdetails_free(Q, 1)), FA = typeof FinalizationRegistry > "u" ? { register: () => {
1357
1357
  }, unregister: () => {
1358
- } } : new FinalizationRegistry((Q) => C.__wbg_rdpfile_free(Q, 1)), NA = typeof FinalizationRegistry > "u" ? { register: () => {
1358
+ } } : new FinalizationRegistry((Q) => C.__wbg_rdpfile_free(Q, 1)), yA = typeof FinalizationRegistry > "u" ? { register: () => {
1359
1359
  }, unregister: () => {
1360
- } } : new FinalizationRegistry((Q) => C.__wbg_session_free(Q, 1)), $ = typeof FinalizationRegistry > "u" ? { register: () => {
1360
+ } } : new FinalizationRegistry((Q) => C.__wbg_session_free(Q, 1)), IA = typeof FinalizationRegistry > "u" ? { register: () => {
1361
1361
  }, unregister: () => {
1362
- } } : new FinalizationRegistry((Q) => C.__wbg_sessionbuilder_free(Q, 1)), kA = typeof FinalizationRegistry > "u" ? { register: () => {
1362
+ } } : new FinalizationRegistry((Q) => C.__wbg_sessionbuilder_free(Q, 1)), YA = typeof FinalizationRegistry > "u" ? { register: () => {
1363
1363
  }, unregister: () => {
1364
1364
  } } : new FinalizationRegistry((Q) => C.__wbg_sessionterminationinfo_free(Q, 1));
1365
- function L(Q) {
1365
+ function q(Q) {
1366
1366
  const A = C.__externref_table_alloc();
1367
1367
  return C.__wbindgen_externrefs.set(A, Q), A;
1368
1368
  }
1369
- function FA(Q) {
1369
+ function MA(Q) {
1370
1370
  if (typeof Q == "number" && (Q >= 1114112 || Q >= 55296 && Q < 57344)) throw new Error(`expected a valid Unicode scalar value, found ${Q}`);
1371
1371
  }
1372
- function V(Q, A) {
1372
+ function x(Q, A) {
1373
1373
  if (!(Q instanceof A))
1374
1374
  throw new Error(`expected instance of ${A.name}`);
1375
1375
  }
1376
- const RA = typeof FinalizationRegistry > "u" ? { register: () => {
1376
+ const JA = typeof FinalizationRegistry > "u" ? { register: () => {
1377
1377
  }, unregister: () => {
1378
1378
  } } : new FinalizationRegistry((Q) => C.__wbindgen_destroy_closure(Q.a, Q.b));
1379
- function gA(Q) {
1379
+ function QA(Q) {
1380
1380
  const A = typeof Q;
1381
1381
  if (A == "number" || A == "boolean" || Q == null)
1382
1382
  return `${Q}`;
@@ -1393,9 +1393,9 @@ function gA(Q) {
1393
1393
  if (Array.isArray(Q)) {
1394
1394
  const B = Q.length;
1395
1395
  let E = "[";
1396
- B > 0 && (E += gA(Q[0]));
1396
+ B > 0 && (E += QA(Q[0]));
1397
1397
  for (let D = 1; D < B; D++)
1398
- E += ", " + gA(Q[D]);
1398
+ E += ", " + QA(Q[D]);
1399
1399
  return E += "]", E;
1400
1400
  }
1401
1401
  const I = /\[object ([^\]]+)\]/.exec(toString.call(Q));
@@ -1413,53 +1413,53 @@ function gA(Q) {
1413
1413
  return Q instanceof Error ? `${Q.name}: ${Q.message}
1414
1414
  ${Q.stack}` : g;
1415
1415
  }
1416
- function pA(Q, A) {
1416
+ function OA(Q, A) {
1417
1417
  Q = Q >>> 0;
1418
- const I = M(), g = [];
1418
+ const I = Y(), g = [];
1419
1419
  for (let B = Q; B < Q + 4 * A; B += 4)
1420
1420
  g.push(C.__wbindgen_externrefs.get(I.getUint32(B, true)));
1421
1421
  return C.__externref_drop_slice(Q, A), g;
1422
1422
  }
1423
- function dA(Q, A) {
1424
- return Q = Q >>> 0, WA().subarray(Q / 4, Q / 4 + A);
1423
+ function WA(Q, A) {
1424
+ return Q = Q >>> 0, tA().subarray(Q / 4, Q / 4 + A);
1425
1425
  }
1426
- function t(Q, A) {
1427
- return Q = Q >>> 0, W().subarray(Q / 1, Q / 1 + A);
1426
+ function m(Q, A) {
1427
+ return Q = Q >>> 0, t().subarray(Q / 1, Q / 1 + A);
1428
1428
  }
1429
- function VA(Q, A) {
1430
- return Q = Q >>> 0, xA().subarray(Q / 1, Q / 1 + A);
1429
+ function xA(Q, A) {
1430
+ return Q = Q >>> 0, lA().subarray(Q / 1, Q / 1 + A);
1431
1431
  }
1432
- let s = null;
1433
- function M() {
1434
- return (s === null || s.buffer.detached === true || s.buffer.detached === void 0 && s.buffer !== C.memory.buffer) && (s = new DataView(C.memory.buffer)), s;
1432
+ let Z = null;
1433
+ function Y() {
1434
+ return (Z === null || Z.buffer.detached === true || Z.buffer.detached === void 0 && Z.buffer !== C.memory.buffer) && (Z = new DataView(C.memory.buffer)), Z;
1435
1435
  }
1436
1436
  function y(Q, A) {
1437
- return jA(Q >>> 0, A);
1437
+ return bA(Q >>> 0, A);
1438
1438
  }
1439
1439
  let b = null;
1440
- function WA() {
1440
+ function tA() {
1441
1441
  return (b === null || b.byteLength === 0) && (b = new Uint32Array(C.memory.buffer)), b;
1442
1442
  }
1443
- let m = null;
1444
- function W() {
1445
- return (m === null || m.byteLength === 0) && (m = new Uint8Array(C.memory.buffer)), m;
1443
+ let T = null;
1444
+ function t() {
1445
+ return (T === null || T.byteLength === 0) && (T = new Uint8Array(C.memory.buffer)), T;
1446
1446
  }
1447
- let O = null;
1448
- function xA() {
1449
- return (O === null || O.byteLength === 0) && (O = new Uint8ClampedArray(C.memory.buffer)), O;
1447
+ let X = null;
1448
+ function lA() {
1449
+ return (X === null || X.byteLength === 0) && (X = new Uint8ClampedArray(C.memory.buffer)), X;
1450
1450
  }
1451
1451
  function o(Q, A) {
1452
1452
  try {
1453
1453
  return Q.apply(this, A);
1454
1454
  } catch (I) {
1455
- const g = L(I);
1455
+ const g = q(I);
1456
1456
  C.__wbindgen_exn_store(g);
1457
1457
  }
1458
1458
  }
1459
- function h(Q) {
1459
+ function H(Q) {
1460
1460
  return Q == null;
1461
1461
  }
1462
- function S(Q, A, I) {
1462
+ function s(Q, A, I) {
1463
1463
  const g = { a: Q, b: A, cnt: 1 }, B = (...E) => {
1464
1464
  g.cnt++;
1465
1465
  const D = g.a;
@@ -1471,20 +1471,20 @@ function S(Q, A, I) {
1471
1471
  }
1472
1472
  };
1473
1473
  return B._wbg_cb_unref = () => {
1474
- --g.cnt === 0 && (C.__wbindgen_destroy_closure(g.a, g.b), g.a = 0, RA.unregister(g));
1475
- }, RA.register(B, g, g), B;
1474
+ --g.cnt === 0 && (C.__wbindgen_destroy_closure(g.a, g.b), g.a = 0, JA.unregister(g));
1475
+ }, JA.register(B, g, g), B;
1476
1476
  }
1477
- function lA(Q, A) {
1477
+ function mA(Q, A) {
1478
1478
  const I = A(Q.length * 1, 1) >>> 0;
1479
- return W().set(Q, I / 1), k = Q.length, I;
1479
+ return t().set(Q, I / 1), R = Q.length, I;
1480
1480
  }
1481
- function R(Q, A, I) {
1481
+ function F(Q, A, I) {
1482
1482
  if (I === void 0) {
1483
- const i = X.encode(Q), w = A(i.length, 1) >>> 0;
1484
- return W().subarray(w, w + i.length).set(i), k = i.length, w;
1483
+ const i = f.encode(Q), w = A(i.length, 1) >>> 0;
1484
+ return t().subarray(w, w + i.length).set(i), R = i.length, w;
1485
1485
  }
1486
1486
  let g = Q.length, B = A(g, 1) >>> 0;
1487
- const E = W();
1487
+ const E = t();
1488
1488
  let D = 0;
1489
1489
  for (; D < g; D++) {
1490
1490
  const i = Q.charCodeAt(D);
@@ -1493,35 +1493,35 @@ function R(Q, A, I) {
1493
1493
  }
1494
1494
  if (D !== g) {
1495
1495
  D !== 0 && (Q = Q.slice(D)), B = I(B, g, g = D + Q.length * 3, 1) >>> 0;
1496
- const i = W().subarray(B + D, B + g), w = X.encodeInto(Q, i);
1496
+ const i = t().subarray(B + D, B + g), w = f.encodeInto(Q, i);
1497
1497
  D += w.written, B = I(B, g, D, 1) >>> 0;
1498
1498
  }
1499
- return k = D, B;
1499
+ return R = D, B;
1500
1500
  }
1501
- function q(Q) {
1501
+ function p(Q) {
1502
1502
  const A = C.__wbindgen_externrefs.get(Q);
1503
1503
  return C.__externref_table_dealloc(Q), A;
1504
1504
  }
1505
- let z = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
1506
- z.decode();
1507
- const tA = 2146435072;
1508
- let AA = 0;
1509
- function jA(Q, A) {
1510
- return AA += A, AA >= tA && (z = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }), z.decode(), AA = A), z.decode(W().subarray(Q, Q + A));
1505
+ let u = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
1506
+ u.decode();
1507
+ const jA = 2146435072;
1508
+ let gA = 0;
1509
+ function bA(Q, A) {
1510
+ return gA += A, gA >= jA && (u = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true }), u.decode(), gA = A), u.decode(t().subarray(Q, Q + A));
1511
1511
  }
1512
- const X = new TextEncoder();
1513
- "encodeInto" in X || (X.encodeInto = function(Q, A) {
1514
- const I = X.encode(Q);
1512
+ const f = new TextEncoder();
1513
+ "encodeInto" in f || (f.encodeInto = function(Q, A) {
1514
+ const I = f.encode(Q);
1515
1515
  return A.set(I), {
1516
1516
  read: Q.length,
1517
1517
  written: I.length
1518
1518
  };
1519
1519
  });
1520
- let k = 0, C;
1521
- function bA(Q, A) {
1522
- return C = __trdWatchExports(Q.exports), s = null, b = null, m = null, O = null, C.__wbindgen_start(), C;
1520
+ let R = 0, C;
1521
+ function TA(Q, A) {
1522
+ return C = __trdWatchExports(Q.exports), Z = null, b = null, T = null, X = null, C.__wbindgen_start(), C;
1523
1523
  }
1524
- async function mA(Q, A) {
1524
+ async function XA(Q, A) {
1525
1525
  if (typeof Response == "function" && Q instanceof Response) {
1526
1526
  if (typeof WebAssembly.instantiateStreaming == "function")
1527
1527
  try {
@@ -1548,33 +1548,33 @@ async function mA(Q, A) {
1548
1548
  return false;
1549
1549
  }
1550
1550
  }
1551
- async function OA(Q) {
1551
+ async function fA(Q) {
1552
1552
  if (C !== void 0) return C;
1553
1553
  Q !== void 0 && (Object.getPrototypeOf(Q) === Object.prototype ? { module_or_path: Q } = Q : console.warn("using deprecated parameters for the initialization function; pass a single object instead")), Q === void 0 && (Q = new URL("ironrdp_web_bg.wasm", import.meta.url));
1554
- const A = UA();
1554
+ const A = aA();
1555
1555
  (typeof Q == "string" || typeof Request == "function" && Q instanceof Request || typeof URL == "function" && Q instanceof URL) && (Q = fetch(Q));
1556
- const { instance: I, module: g } = await mA(await Q, A);
1557
- return bA(I);
1556
+ const { instance: I, module: g } = await XA(await Q, A);
1557
+ return TA(I);
1558
1558
  }
1559
- const XA = "avc1.640033";
1560
- function MA() {
1559
+ const rA = "avc1.640033";
1560
+ function KA() {
1561
1561
  return {
1562
- codec: XA,
1562
+ codec: rA,
1563
1563
  optimizeForLatency: true,
1564
1564
  hardwareAcceleration: "no-preference",
1565
1565
  colorSpace: { primaries: "bt709", transfer: "bt709", matrix: "bt709", fullRange: true }
1566
1566
  };
1567
1567
  }
1568
- async function BI() {
1568
+ async function EI() {
1569
1569
  if (typeof VideoDecoder > "u" || typeof EncodedVideoChunk > "u")
1570
1570
  return false;
1571
1571
  try {
1572
- return (await VideoDecoder.isConfigSupported(MA())).supported === true;
1572
+ return (await VideoDecoder.isConfigSupported(KA())).supported === true;
1573
1573
  } catch {
1574
1574
  return false;
1575
1575
  }
1576
1576
  }
1577
- const _cA = class _cA {
1577
+ const _M = class _M {
1578
1578
  constructor(A = {}) {
1579
1579
  __publicField(this, "stats", {
1580
1580
  frames: 0,
@@ -1595,25 +1595,68 @@ const _cA = class _cA {
1595
1595
  */
1596
1596
  __publicField(this, "reclaimed", false);
1597
1597
  __publicField(this, "surfaces", /* @__PURE__ */ new Map());
1598
+ /** Decoders of surfaces whose streams ended, bringing out the frames given to them before they close. */
1599
+ __publicField(this, "retiring", /* @__PURE__ */ new Set());
1600
+ /** Surfaces waiting for their first key frame; bounded independently of browser decoders. */
1601
+ __publicField(this, "waitingForKey", /* @__PURE__ */ new Map());
1602
+ __publicField(this, "maxDecoders");
1603
+ /** The bytes of H.264 in the decoders: the access units of the pending frames. */
1604
+ __publicField(this, "pendingBytes", 0);
1605
+ /** The bytes the pictures being read back are read into: the RGBA of their frames' regions. */
1606
+ __publicField(this, "readbackBytes", 0);
1607
+ /** Full decoded pictures retained by async copies, independently of their dirty regions' size. */
1608
+ __publicField(this, "readbackPictures", /* @__PURE__ */ new Set());
1609
+ __publicField(this, "readbackPixels", 0);
1610
+ /** How fast decoders open, for all surfaces together (see `SESSION_OPENS`). */
1611
+ __publicField(this, "opens");
1612
+ /** How fast decoders open for each surface (see `SURFACE_OPENS`), kept while a surface's count matters. */
1613
+ __publicField(this, "surfaceOpens", /* @__PURE__ */ new Map());
1598
1614
  __publicField(this, "stallMs");
1599
1615
  __publicField(this, "now");
1600
1616
  __publicField(this, "watchdog", null);
1601
1617
  __publicField(this, "canvas", null);
1602
1618
  __publicField(this, "closed", false);
1603
- this.options = A, this.stallMs = A.stallMs ?? 3e3, this.now = A.now ?? (() => performance.now());
1619
+ if (this.options = A, this.maxDecoders = A.maxDecoders ?? _M.MAX_DECODERS, !Number.isInteger(this.maxDecoders) || this.maxDecoders < 1 || this.maxDecoders > _M.MAX_DECODERS)
1620
+ throw new RangeError("maxDecoders must be an integer from 1 to 32");
1621
+ this.stallMs = A.stallMs ?? 3e3, this.now = A.now ?? (() => performance.now()), this.opens = new UA(_M.SESSION_OPENS, this.now());
1604
1622
  }
1605
1623
  decode(A, I) {
1606
1624
  if (this.failed !== null || this.closed) {
1607
1625
  I(A.id, null, this.failed ?? "the H.264 decoder is closed");
1608
1626
  return;
1609
1627
  }
1610
- this.watchdog ?? (this.watchdog = setInterval(() => this.checkStalls(), Math.min(250, this.stallMs)));
1611
- const g = this.surfaces.get(A.surfaceId) ?? this.open(A.surfaceId);
1612
- if (g.needKey && !A.keyFrame) {
1613
- this.stats.skipped++, g.waitingSince === null && (g.waitingSince = this.now()), I(A.id, null);
1628
+ this.watchdog ?? (this.watchdog = setInterval(() => this.checkStalls(), Math.min(250, this.stallMs))), this.endSurfaces(A.endedSurfaces ?? []);
1629
+ let g = this.surfaces.get(A.surfaceId);
1630
+ if (g === void 0) {
1631
+ if (!A.keyFrame) {
1632
+ !this.waitingForKey.has(A.surfaceId) && this.waitingForKey.size < this.maxDecoders && this.waitingForKey.set(A.surfaceId, this.now()), this.stats.skipped++, I(A.id, null);
1633
+ return;
1634
+ }
1635
+ if (this.waitingForKey.delete(A.surfaceId), this.surfaces.size + this.retiring.size >= this.maxDecoders) {
1636
+ this.fail(`H.264 for more than ${this.maxDecoders} surfaces at once`), I(A.id, null, this.failed ?? void 0);
1637
+ return;
1638
+ }
1639
+ const w = this.countOpen(A.surfaceId);
1640
+ if (w !== null) {
1641
+ this.fail(w), I(A.id, null, this.failed ?? void 0);
1642
+ return;
1643
+ }
1644
+ g = this.open(A.surfaceId);
1645
+ }
1646
+ const B = A.data.byteLength;
1647
+ if (g.pending.size >= _M.MAX_PENDING_FRAMES) {
1648
+ this.fail(`more than ${_M.MAX_PENDING_FRAMES} frames in a decoder`), I(A.id, null, this.failed ?? void 0);
1649
+ return;
1650
+ }
1651
+ if (this.pendingBytes + B > _M.MAX_PENDING_BYTES) {
1652
+ this.fail(
1653
+ `more than ${_M.MAX_PENDING_BYTES / (1024 * 1024)} MiB of H.264 in the decoders`
1654
+ ), I(A.id, null, this.failed ?? void 0);
1614
1655
  return;
1615
1656
  }
1616
- g.needKey = false, g.waitingSince = null, A.keyFrame && this.stats.keyFrames++, g.pending.set(A.id, { frame: A, done: I, since: this.now() }), this.stats.pending++;
1657
+ A.keyFrame && this.stats.keyFrames++;
1658
+ const { id: E, destination: D, regions: i } = A;
1659
+ g.pending.set(E, { frame: { id: E, destination: D, regions: i }, done: I, since: this.now(), bytes: B }), this.stats.pending++, this.pendingBytes += B;
1617
1660
  try {
1618
1661
  g.decoder.decode(
1619
1662
  new EncodedVideoChunk({
@@ -1622,29 +1665,78 @@ const _cA = class _cA {
1622
1665
  data: A.data
1623
1666
  })
1624
1667
  );
1625
- } catch (B) {
1626
- this.fail(`decode: ${IA(B)}`);
1668
+ } catch (w) {
1669
+ this.fail(`decode: ${BA(w)}`);
1627
1670
  }
1628
1671
  }
1629
1672
  close() {
1630
1673
  this.closed = true, this.stopWatchdog();
1631
- for (const A of this.surfaces.values())
1632
- yA(A.decoder);
1633
- this.surfaces.clear(), this.stats.pending = 0;
1674
+ for (const A of [...this.surfaces.values(), ...this.retiring])
1675
+ e(A.decoder);
1676
+ this.surfaces.clear(), this.retiring.clear(), this.waitingForKey.clear(), this.stats.pending = 0, this.pendingBytes = 0, this.clearReadbacks(), this.canvas = null;
1677
+ }
1678
+ /** Releases streams as soon as their surfaces end, including when no later H.264 frame arrives. */
1679
+ endSurfaces(A) {
1680
+ for (const I of A)
1681
+ this.waitingForKey.delete(I), this.retire(I);
1682
+ }
1683
+ /**
1684
+ * Counts a decoder opening for the surface; says why it may not instead, when that is faster than `SURFACE_OPENS`
1685
+ * or `SESSION_OPENS` allow.
1686
+ */
1687
+ countOpen(A) {
1688
+ const I = this.now();
1689
+ let g = this.surfaceOpens.get(A);
1690
+ if (g === void 0) {
1691
+ if (this.surfaceOpens.size >= _M.MAX_DECODERS)
1692
+ for (const [B, E] of this.surfaceOpens)
1693
+ E.rested(I) && this.surfaceOpens.delete(B);
1694
+ g = new UA(_M.SURFACE_OPENS, I), this.surfaceOpens.set(A, g);
1695
+ }
1696
+ if (!g.take(I)) {
1697
+ const { inARow: B, perSecond: E } = _M.SURFACE_OPENS;
1698
+ return `H.264 decoders opened for surface ${A} faster than ${B} in a row and ${E} a second`;
1699
+ }
1700
+ if (!this.opens.take(I)) {
1701
+ const { inARow: B, perSecond: E } = _M.SESSION_OPENS;
1702
+ return `H.264 decoders opened faster than ${B} in a row and ${E} a second`;
1703
+ }
1704
+ return null;
1634
1705
  }
1635
1706
  open(A) {
1636
1707
  const I = {
1637
1708
  decoder: new VideoDecoder({
1638
1709
  output: (g) => this.output(I, g),
1639
1710
  error: (g) => {
1640
- this.reclaimed = g.name === "QuotaExceededError", this.fail(IA(g));
1711
+ this.reclaimed = g.name === "QuotaExceededError", this.fail(BA(g));
1641
1712
  }
1642
1713
  }),
1643
- needKey: true,
1644
- waitingSince: null,
1645
1714
  pending: /* @__PURE__ */ new Map()
1646
1715
  };
1647
- return I.decoder.configure(MA()), this.surfaces.set(A, I), I;
1716
+ return I.decoder.configure(KA()), this.surfaces.set(A, I), I;
1717
+ }
1718
+ /** The server is done with a surface: its decoder closes once the frames given to it are out. */
1719
+ retire(A) {
1720
+ const I = this.surfaces.get(A);
1721
+ if (I === void 0)
1722
+ return;
1723
+ if (this.surfaces.delete(A), I.pending.size === 0) {
1724
+ e(I.decoder);
1725
+ return;
1726
+ }
1727
+ this.retiring.add(I);
1728
+ const g = () => {
1729
+ if (this.retiring.delete(I)) {
1730
+ for (const B of [...I.pending.values()])
1731
+ this.settle(I, B), this.stats.dropped++, B.done(B.frame.id, null);
1732
+ e(I.decoder);
1733
+ }
1734
+ };
1735
+ try {
1736
+ I.decoder.flush().then(g, g);
1737
+ } catch {
1738
+ g();
1739
+ }
1648
1740
  }
1649
1741
  output(A, I) {
1650
1742
  const g = I.timestamp, B = A.pending.get(g);
@@ -1652,69 +1744,97 @@ const _cA = class _cA {
1652
1744
  I.close();
1653
1745
  return;
1654
1746
  }
1655
- for (const [E, D] of A.pending) {
1656
- if (E >= g)
1747
+ const E = I.codedWidth * I.codedHeight;
1748
+ if (!Number.isSafeInteger(E) || E <= 0 || E > _M.MAX_PICTURE_PIXELS) {
1749
+ I.close(), this.fail("decoded H.264 picture exceeds the pixel budget");
1750
+ return;
1751
+ }
1752
+ for (const [w, G] of A.pending) {
1753
+ if (w >= g)
1657
1754
  break;
1658
- A.pending.delete(E), this.stats.pending--, this.stats.dropped++, D.done(E, null);
1755
+ this.settle(A, G), this.stats.dropped++, G.done(w, null);
1756
+ }
1757
+ this.settle(A, B);
1758
+ const D = B.frame.regions.reduce((w, G) => w + (G.right - G.left) * (G.bottom - G.top) * 4, 0);
1759
+ if (this.readbackPictures.size >= _M.MAX_READBACKS) {
1760
+ I.close(), this.fail(`more than ${_M.MAX_READBACKS} pictures being read back`), B.done(g, null, this.failed ?? void 0);
1761
+ return;
1659
1762
  }
1660
- A.pending.delete(g), this.stats.pending--, this.readRegions(I, B.frame).then(
1661
- (E) => {
1662
- if (I.close(), this.failed !== null || this.closed)
1763
+ if (this.readbackBytes + D > _M.MAX_READBACK_BYTES) {
1764
+ I.close(), this.fail(
1765
+ `more than ${_M.MAX_READBACK_BYTES / (1024 * 1024)} MiB of pictures being read back`
1766
+ ), B.done(g, null, this.failed ?? void 0);
1767
+ return;
1768
+ }
1769
+ if (this.readbackPixels + E > _M.MAX_READBACK_PIXELS) {
1770
+ I.close(), this.fail("more than 128 Mi pixels of decoded pictures being read back"), B.done(g, null, this.failed ?? void 0);
1771
+ return;
1772
+ }
1773
+ this.readbackBytes += D, this.readbackPixels += E, this.readbackPictures.add(I);
1774
+ const i = () => {
1775
+ this.readbackPictures.delete(I) && (this.readbackBytes -= D, this.readbackPixels -= E);
1776
+ };
1777
+ this.readRegions(I, B.frame).then(
1778
+ (w) => {
1779
+ if (I.close(), i(), this.failed !== null || this.closed)
1663
1780
  return;
1664
- const D = this.now() - B.since;
1665
- this.stats.frames++, B.frame.regions.length === 0 && this.stats.auxiliary++, this.stats.lastLatencyMs = D, this.stats.maxLatencyMs = Math.max(this.stats.maxLatencyMs, D), B.done(g, E);
1781
+ const G = this.now() - B.since;
1782
+ this.stats.frames++, B.frame.regions.length === 0 && this.stats.auxiliary++, this.stats.lastLatencyMs = G, this.stats.maxLatencyMs = Math.max(this.stats.maxLatencyMs, G), B.done(g, w);
1666
1783
  },
1667
- (E) => {
1668
- I.close(), this.fail(`reading the picture: ${IA(E)}`), B.done(g, null, this.failed ?? void 0);
1784
+ (w) => {
1785
+ I.close(), i(), !(this.failed !== null || this.closed) && (this.fail(`reading the picture: ${BA(w)}`), B.done(g, null, this.failed ?? void 0));
1669
1786
  }
1670
1787
  );
1671
1788
  }
1789
+ /** Takes a frame out of the pending ones. */
1790
+ settle(A, I) {
1791
+ A.pending.delete(I.frame.id), this.stats.pending--, this.pendingBytes -= I.bytes;
1792
+ }
1672
1793
  /** The RGBA of the frame's regions, in turn. */
1673
1794
  async readRegions(A, I) {
1674
- const g = A.visibleRect ?? { x: 0, y: 0, width: A.codedWidth, height: A.codedHeight }, B = I.destination, [E, D] = g.width >= B.right && g.height >= B.bottom ? [0, 0] : [B.left, B.top], i = I.regions.map((G) => ({
1675
- x: G.left - E,
1676
- y: G.top - D,
1677
- width: G.right - G.left,
1678
- height: G.bottom - G.top
1795
+ const g = A.visibleRect ?? { x: 0, y: 0, width: A.codedWidth, height: A.codedHeight }, B = I.destination, [E, D] = g.width >= B.right && g.height >= B.bottom ? [0, 0] : [B.left, B.top], i = I.regions.map((N) => ({
1796
+ x: N.left - E,
1797
+ y: N.top - D,
1798
+ width: N.right - N.left,
1799
+ height: N.bottom - N.top
1679
1800
  }));
1680
- for (const G of i)
1681
- if (G.x < 0 || G.y < 0 || G.x + G.width > g.width || G.y + G.height > g.height)
1801
+ for (const N of i)
1802
+ if (N.x < 0 || N.y < 0 || N.x + N.width > g.width || N.y + N.height > g.height)
1682
1803
  throw new Error(
1683
- `region ${JSON.stringify(G)} is outside the ${g.width}x${g.height} picture`
1804
+ `region ${JSON.stringify(N)} is outside the ${g.width}x${g.height} picture`
1684
1805
  );
1685
- const w = i.reduce((G, H) => G + H.width * H.height * 4, 0), F = new Uint8Array(w);
1806
+ const w = i.reduce((N, L) => N + L.width * L.height * 4, 0), G = new Uint8Array(w);
1686
1807
  if (i.length === 0)
1687
- return F;
1688
- const a = Math.min(...i.map((G) => G.x)), J = Math.min(...i.map((G) => G.y)), Y = {
1689
- x: a,
1690
- y: J,
1691
- width: Math.max(...i.map((G) => G.x + G.width)) - a,
1692
- height: Math.max(...i.map((G) => G.y + G.height)) - J
1693
- };
1808
+ return G;
1809
+ let [a, U, c, O] = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
1810
+ for (const N of i)
1811
+ a = Math.min(a, N.x), U = Math.min(U, N.y), c = Math.max(c, N.x + N.width), O = Math.max(O, N.y + N.height);
1812
+ const S = { x: a, y: U, width: c - a, height: O - U };
1694
1813
  if (i.length === 1)
1695
- return await this.readBox(A, g, Y, F), F;
1696
- if (Y.width * Y.height * 4 > w * _cA.BOX_WASTE) {
1697
- let G = 0;
1698
- for (const H of i) {
1699
- const d = H.width * H.height * 4;
1700
- await this.readBox(A, g, H, F.subarray(G, G + d)), G += d;
1814
+ return await this.readBox(A, g, S, G), G;
1815
+ if (S.width * S.height * 4 > w * _M.BOX_WASTE) {
1816
+ let N = 0;
1817
+ for (const L of i) {
1818
+ const W = L.width * L.height * 4;
1819
+ await this.readBox(A, g, L, G.subarray(N, N + W)), N += W;
1701
1820
  }
1702
- return F;
1821
+ return G;
1703
1822
  }
1704
- const l = new Uint8Array(Y.width * Y.height * 4);
1705
- await this.readBox(A, g, Y, l);
1706
- let v = 0;
1707
- for (const G of i) {
1708
- const H = G.width * 4;
1709
- for (let d = 0; d < G.height; d++) {
1710
- const BA = ((G.y - Y.y + d) * Y.width + (G.x - Y.x)) * 4;
1711
- F.set(l.subarray(BA, BA + H), v), v += H;
1823
+ const CA = new Uint8Array(S.width * S.height * 4);
1824
+ await this.readBox(A, g, S, CA);
1825
+ let EA = 0;
1826
+ for (const N of i) {
1827
+ const L = N.width * 4;
1828
+ for (let W = 0; W < N.height; W++) {
1829
+ const DA = ((N.y - S.y + W) * S.width + (N.x - S.x)) * 4;
1830
+ G.set(CA.subarray(DA, DA + L), EA), EA += L;
1712
1831
  }
1713
1832
  }
1714
- return F;
1833
+ return G;
1715
1834
  }
1716
1835
  async readBox(A, I, g, B) {
1717
- var _a, _b;
1836
+ if (this.failed !== null || this.closed)
1837
+ throw new Error("the H.264 decoder is closed");
1718
1838
  if (this.stats.readback === "copyTo") {
1719
1839
  const D = { x: I.x + g.x, y: I.y + g.y, width: g.width, height: g.height };
1720
1840
  try {
@@ -1729,15 +1849,19 @@ const _cA = class _cA {
1729
1849
  this.stats.readback = "canvas";
1730
1850
  }
1731
1851
  }
1732
- (this.canvas === null || this.canvas.width < g.width || this.canvas.height < g.height) && (this.canvas = new OffscreenCanvas(
1733
- Math.max(g.width, ((_a = this.canvas) == null ? void 0 : _a.width) ?? 0),
1734
- Math.max(g.height, ((_b = this.canvas) == null ? void 0 : _b.height) ?? 0)
1735
- ));
1852
+ if (this.failed !== null || this.closed)
1853
+ throw new Error("the H.264 decoder is closed");
1854
+ (this.canvas === null || this.canvas.width < g.width || this.canvas.height < g.height) && (this.canvas = new OffscreenCanvas(g.width, g.height));
1736
1855
  const E = this.canvas.getContext("2d", { willReadFrequently: true, colorSpace: "srgb" });
1737
1856
  if (E === null)
1738
1857
  throw new Error("no 2D canvas context");
1739
1858
  E.drawImage(A, -g.x, -g.y, I.width, I.height), B.set(E.getImageData(0, 0, g.width, g.height).data);
1740
1859
  }
1860
+ clearReadbacks() {
1861
+ for (const A of this.readbackPictures)
1862
+ A.close();
1863
+ this.readbackPictures.clear(), this.readbackBytes = 0, this.readbackPixels = 0;
1864
+ }
1741
1865
  stopWatchdog() {
1742
1866
  this.watchdog !== null && (clearInterval(this.watchdog), this.watchdog = null);
1743
1867
  }
@@ -1745,17 +1869,17 @@ const _cA = class _cA {
1745
1869
  if (this.failed !== null || this.closed)
1746
1870
  return;
1747
1871
  const A = this.now();
1748
- for (const I of this.surfaces.values()) {
1749
- if (I.waitingSince !== null && A - I.waitingSince > this.stallMs) {
1750
- this.fail(`no key frame for ${Math.round(A - I.waitingSince)} ms`);
1872
+ for (const I of this.waitingForKey.values())
1873
+ if (A - I > this.stallMs) {
1874
+ this.fail(`no key frame for ${Math.round(A - I)} ms`);
1751
1875
  return;
1752
1876
  }
1877
+ for (const I of [...this.surfaces.values(), ...this.retiring])
1753
1878
  for (const g of I.pending.values())
1754
1879
  if (A - g.since > this.stallMs) {
1755
1880
  this.fail(`no picture from the decoder for ${Math.round(A - g.since)} ms`);
1756
1881
  return;
1757
1882
  }
1758
- }
1759
1883
  }
1760
1884
  /** Fails for good: every frame in flight completes with the error, which ends the session. */
1761
1885
  fail(A) {
@@ -1763,25 +1887,91 @@ const _cA = class _cA {
1763
1887
  if (this.failed !== null || this.closed)
1764
1888
  return;
1765
1889
  this.failed = A, this.stopWatchdog();
1766
- const I = [...this.surfaces.values()].flatMap((g) => [...g.pending.values()]);
1767
- for (const g of this.surfaces.values())
1768
- yA(g.decoder);
1769
- this.surfaces.clear(), this.stats.pending = 0, (_b = (_a = this.options).onFailure) == null ? void 0 : _b.call(_a, A);
1770
- for (const { frame: g, done: B } of I)
1771
- B(g.id, null, A);
1890
+ const I = [...this.surfaces.values(), ...this.retiring], g = I.flatMap((B) => [...B.pending.values()]);
1891
+ for (const B of I)
1892
+ e(B.decoder);
1893
+ this.surfaces.clear(), this.retiring.clear(), this.waitingForKey.clear(), this.stats.pending = 0, this.pendingBytes = 0, this.clearReadbacks(), this.canvas = null, (_b = (_a = this.options).onFailure) == null ? void 0 : _b.call(_a, A);
1894
+ for (const { frame: B, done: E } of g)
1895
+ E(B.id, null, A);
1772
1896
  }
1773
1897
  };
1898
+ /**
1899
+ * The most decoders at once. Servers stream H.264 to a surface per monitor, and a session has 16 monitors at most
1900
+ * (MS-RDPBCGR 2.2.1.3.6); after a reset, the decoders of the surfaces it destroyed may still be finishing their
1901
+ * frames while those of the new ones start.
1902
+ */
1903
+ __publicField(_M, "MAX_DECODERS", 32);
1904
+ /**
1905
+ * How fast one surface's decoders may open: 16 in a row, then 4 a second. A decoder opens for a surface's first
1906
+ * frame, and again for its first frame after its stream ended (the surface deleted, created again or destroyed by
1907
+ * a reset), which servers do when they resize its monitor: a few times in a row at most, and not several times a
1908
+ * second for long. Opening a `VideoDecoder` and closing the one before takes the page's thread about 44
1909
+ * microseconds (Chrome, software decoding), so a server that created a surface again before each of its frames
1910
+ * had that done for every frame: 32,768 times for one message of 90 KB on the wire, which froze the page, and
1911
+ * every session in it, for 1.4 s, message after message.
1912
+ */
1913
+ __publicField(_M, "SURFACE_OPENS", { inARow: 16, perSecond: 4 });
1914
+ /**
1915
+ * How fast decoders may open for all surfaces together: 128 in a row, then 32 a second. That is each of 16
1916
+ * monitors (MS-RDPBCGR 2.2.1.3.6) resized eight times in a row, then twice a second, and opening that many takes
1917
+ * the page's thread under 6 ms, then under 1.5 ms a second.
1918
+ */
1919
+ __publicField(_M, "SESSION_OPENS", { inARow: 128, perSecond: 32 });
1920
+ /**
1921
+ * The most frames one decoder may hold. A decoder keeps up with its stream, so frames wait in it about as long as
1922
+ * one takes to decode, and the server stops at its unacknowledged frames: 256 is over two seconds of 60 Hz AVC444
1923
+ * (two access units a frame), and a frame that waits longer than `stallMs` (3 s) fails the decoder anyway.
1924
+ */
1925
+ __publicField(_M, "MAX_PENDING_FRAMES", 256);
1926
+ /**
1927
+ * The most bytes of H.264 the decoders may hold at once: over a second at the highest bitrate any H.264 level
1928
+ * allows (level 6.2, High profile: 1,000 Mbit/s), where servers send a few to tens of Mbit/s.
1929
+ */
1930
+ __publicField(_M, "MAX_PENDING_BYTES", 128 * 1024 * 1024);
1931
+ /**
1932
+ * The most bytes the pictures being read back may be read into at once: the RGBA of their frames' regions. A
1933
+ * picture is read back as it comes out, while its decoder goes on, so readbacks overlap when pictures come out
1934
+ * faster than they are read. This is two of the largest frames ironrdp-egfx reads back (256 MiB, what its
1935
+ * compositor holds), or four whole 8K pictures (7680x4320, 127 MiB each). Regions read back as their bounding box
1936
+ * take the box as well while it is read, at most twice what they hold.
1937
+ */
1938
+ __publicField(_M, "MAX_READBACK_BYTES", 512 * 1024 * 1024);
1939
+ __publicField(_M, "MAX_READBACKS", 64);
1940
+ __publicField(_M, "MAX_PICTURE_PIXELS", 64 * 1024 * 1024);
1941
+ /** Four whole 8K pictures, or 512 MiB at four bytes per coded pixel, regardless of dirty-region size. */
1942
+ __publicField(_M, "MAX_READBACK_PIXELS", 128 * 1024 * 1024);
1774
1943
  /** A bounding box may be this many times what its regions hold before they are read one by one instead. */
1775
- __publicField(_cA, "BOX_WASTE", 2);
1776
- let cA = _cA;
1777
- function yA(Q) {
1944
+ __publicField(_M, "BOX_WASTE", 2);
1945
+ let M = _M;
1946
+ class UA {
1947
+ constructor(A, I) {
1948
+ __publicField(this, "allowance");
1949
+ __publicField(this, "at");
1950
+ this.limit = A, this.allowance = A.inARow, this.at = I;
1951
+ }
1952
+ /** Counts one more time, unless the limit allows none now. */
1953
+ take(A) {
1954
+ return this.catchUp(A), this.allowance < 1 ? false : (this.allowance -= 1, true);
1955
+ }
1956
+ /** Whether all of the allowance is back, as if nothing had been counted. */
1957
+ rested(A) {
1958
+ return this.catchUp(A), this.allowance >= this.limit.inARow;
1959
+ }
1960
+ catchUp(A) {
1961
+ if (A > this.at) {
1962
+ const I = (A - this.at) * this.limit.perSecond / 1e3;
1963
+ this.allowance = Math.min(this.limit.inARow, this.allowance + I), this.at = A;
1964
+ }
1965
+ }
1966
+ }
1967
+ function e(Q) {
1778
1968
  if (Q.state !== "closed")
1779
1969
  try {
1780
1970
  Q.close();
1781
1971
  } catch {
1782
1972
  }
1783
1973
  }
1784
- function IA(Q) {
1974
+ function BA(Q) {
1785
1975
  return Q instanceof Error || Q instanceof DOMException ? `${Q.name}: ${Q.message}` : String(Q);
1786
1976
  }
1787
1977
  const j = {
@@ -1796,53 +1986,53 @@ const j = {
1796
1986
  */
1797
1987
  RANGE: 2
1798
1988
  };
1799
- function fA(Q) {
1800
- return new N("files_available_callback", Q);
1801
- }
1802
- function TA(Q) {
1803
- return new N("file_contents_request_callback", Q);
1804
- }
1805
1989
  function nA(Q) {
1806
- return new N("file_contents_response_callback", Q);
1990
+ return new k("files_available_callback", Q);
1807
1991
  }
1808
- function rA(Q) {
1809
- return new N("lock_callback", Q);
1992
+ function zA(Q) {
1993
+ return new k("file_contents_request_callback", Q);
1810
1994
  }
1811
1995
  function PA(Q) {
1812
- return new N("unlock_callback", Q);
1996
+ return new k("file_contents_response_callback", Q);
1813
1997
  }
1814
1998
  function vA(Q) {
1815
- return new N("locks_expired_callback", Q);
1999
+ return new k("lock_callback", Q);
1816
2000
  }
1817
- function zA(Q) {
1818
- return new N("format_list_response_callback", Q);
2001
+ function eA(Q) {
2002
+ return new k("unlock_callback", Q);
2003
+ }
2004
+ function uA(Q) {
2005
+ return new k("locks_expired_callback", Q);
1819
2006
  }
1820
- const QI = {
2007
+ function _A(Q) {
2008
+ return new k("format_list_response_callback", Q);
2009
+ }
2010
+ const DI = {
1821
2011
  PostScript: "MS Publisher Imagesetter",
1822
2012
  MicrosoftPrintToPdf: "Microsoft Print to PDF"
1823
2013
  };
1824
- function CI(Q) {
1825
- return new N("print_job_stream_callbacks", Q);
2014
+ function iI(Q) {
2015
+ return new k("print_job_stream_callbacks", Q);
1826
2016
  }
1827
- function EI(Q) {
1828
- return new N("printer_name", Q);
2017
+ function wI(Q) {
2018
+ return new k("printer_name", Q);
1829
2019
  }
1830
- function DI(Q) {
1831
- return new N("printer_device_id", Q);
2020
+ function GI(Q) {
2021
+ return new k("printer_device_id", Q);
1832
2022
  }
1833
- function iI(Q) {
1834
- return new N("printer_driver_name", Q);
2023
+ function oI(Q) {
2024
+ return new k("printer_driver_name", Q);
1835
2025
  }
1836
- function eA(Q) {
1837
- return new N("request_file_contents", Q);
2026
+ function $A(Q) {
2027
+ return new k("request_file_contents", Q);
1838
2028
  }
1839
- function uA(Q) {
1840
- return new N("submit_file_contents", Q);
2029
+ function AI(Q) {
2030
+ return new k("submit_file_contents", Q);
1841
2031
  }
1842
- function _A(Q) {
1843
- return new N("initiate_file_copy", Q);
2032
+ function II(Q) {
2033
+ return new k("initiate_file_copy", Q);
1844
2034
  }
1845
- class $A {
2035
+ class gI {
1846
2036
  constructor() {
1847
2037
  __publicField(this, "chunks", []);
1848
2038
  __publicField(this, "_bytesWritten", 0);
@@ -1867,17 +2057,17 @@ class $A {
1867
2057
  this.finalized || (this.finalized = true, this.chunks = []);
1868
2058
  }
1869
2059
  }
1870
- class YA {
2060
+ class cA {
1871
2061
  constructor() {
1872
2062
  __publicField(this, "name", "blob");
1873
2063
  }
1874
2064
  async createWriteHandle(A, I) {
1875
- return new $A();
2065
+ return new gI();
1876
2066
  }
1877
2067
  async dispose() {
1878
2068
  }
1879
2069
  }
1880
- class AI {
2070
+ class BI {
1881
2071
  constructor(A, I, g, B) {
1882
2072
  __publicField(this, "writable");
1883
2073
  __publicField(this, "_bytesWritten", 0);
@@ -1913,7 +2103,7 @@ class AI {
1913
2103
  }
1914
2104
  }
1915
2105
  }
1916
- const _x = class _x {
2106
+ const _l = class _l {
1917
2107
  constructor(A, I, g) {
1918
2108
  __publicField(this, "name", "opfs");
1919
2109
  /** Sequence counter for generating unique temp file names. */
@@ -1928,7 +2118,7 @@ const _x = class _x {
1928
2118
  */
1929
2119
  static async create(A, I) {
1930
2120
  const g = I ?? `s-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`, B = await A.getDirectoryHandle("ironrdp-transfers", { create: true }), E = await B.getDirectoryHandle(g, { create: true });
1931
- return _x.cleanupStale(B, g), new _x(A, E, g);
2121
+ return _l.cleanupStale(B, g), new _l(A, E, g);
1932
2122
  }
1933
2123
  // 24 hours
1934
2124
  /**
@@ -1949,7 +2139,7 @@ const _x = class _x {
1949
2139
  if (!E)
1950
2140
  continue;
1951
2141
  const D = Number(E[1]);
1952
- if (g - D > _x.STALE_SESSION_THRESHOLD_MS)
2142
+ if (g - D > _l.STALE_SESSION_THRESHOLD_MS)
1953
2143
  try {
1954
2144
  await A.removeEntry(B, { recursive: true });
1955
2145
  } catch {
@@ -1975,8 +2165,8 @@ const _x = class _x {
1975
2165
  async createWriteHandle(A, I) {
1976
2166
  if (!this.sessionDir)
1977
2167
  throw new Error("OpfsStorageBackend: backend has been disposed");
1978
- const B = `${this.sequence++}-${II(A)}`, E = await this.sessionDir.getFileHandle(B, { create: true }), D = await E.createWritable();
1979
- return new AI(E, this.sessionDir, B, D);
2168
+ const B = `${this.sequence++}-${QI(A)}`, E = await this.sessionDir.getFileHandle(B, { create: true }), D = await E.createWritable();
2169
+ return new BI(E, this.sessionDir, B, D);
1980
2170
  }
1981
2171
  async dispose() {
1982
2172
  if (!this.sessionDir)
@@ -2006,9 +2196,9 @@ const _x = class _x {
2006
2196
  }
2007
2197
  };
2008
2198
  /** Maximum age (in milliseconds) before a session directory is considered stale. */
2009
- __publicField(_x, "STALE_SESSION_THRESHOLD_MS", 1440 * 60 * 1e3);
2010
- let x = _x;
2011
- function II(Q) {
2199
+ __publicField(_l, "STALE_SESSION_THRESHOLD_MS", 1440 * 60 * 1e3);
2200
+ let l = _l;
2201
+ function QI(Q) {
2012
2202
  let A = Q.replace(/[\u0000-\u001f]/g, "");
2013
2203
  A = A.replace(/[/\\]/g, "_"), A = A.replace(/^\.+/, ""), A.length === 0 && (A = "unnamed");
2014
2204
  const I = new TextEncoder();
@@ -2019,22 +2209,22 @@ function II(Q) {
2019
2209
  }
2020
2210
  return A;
2021
2211
  }
2022
- async function gI(Q = "auto", A) {
2212
+ async function CI(Q = "auto", A) {
2023
2213
  var _a, _b;
2024
2214
  if (Q === "blob")
2025
- return new YA();
2215
+ return new cA();
2026
2216
  if (typeof ((_b = (_a = globalThis.navigator) == null ? void 0 : _a.storage) == null ? void 0 : _b.getDirectory) == "function")
2027
2217
  try {
2028
2218
  const I = await navigator.storage.getDirectory();
2029
- if (await x.probe(I))
2030
- return x.create(I, A);
2219
+ if (await l.probe(I))
2220
+ return l.create(I, A);
2031
2221
  console.debug("OPFS probe failed (createWritable not functional), falling back to blob storage");
2032
2222
  } catch (I) {
2033
2223
  console.debug("OPFS unavailable, falling back to blob storage:", I);
2034
2224
  }
2035
- return new YA();
2225
+ return new cA();
2036
2226
  }
2037
- const _U = class _U {
2227
+ const _K = class _K {
2038
2228
  constructor(A) {
2039
2229
  __publicField(this, "session");
2040
2230
  __publicField(this, "chunkSize");
@@ -2113,7 +2303,7 @@ const _U = class _U {
2113
2303
  * downloads can retry.
2114
2304
  */
2115
2305
  async ensureStorageBackend() {
2116
- return this.storageBackend ? this.storageBackend : (this.storageBackendReady || (this.storageBackendReady = gI(this.storagePreference).then((A) => (this.storageBackend = A, console.debug(`File transfer storage: ${A.name}`), A)).catch((A) => {
2306
+ return this.storageBackend ? this.storageBackend : (this.storageBackendReady || (this.storageBackendReady = CI(this.storagePreference).then((A) => (this.storageBackend = A, console.debug(`File transfer storage: ${A.name}`), A)).catch((A) => {
2117
2307
  throw this.storageBackendReady = void 0, A;
2118
2308
  })), this.storageBackendReady);
2119
2309
  }
@@ -2122,7 +2312,7 @@ const _U = class _U {
2122
2312
  // with invokeExtension() to keep the Session interface protocol-agnostic.
2123
2313
  sendRequestFileContents(A, I, g, B, E, D) {
2124
2314
  this.ensureSession().invokeExtension(
2125
- eA({
2315
+ $A({
2126
2316
  stream_id: A,
2127
2317
  file_index: I,
2128
2318
  flags: g,
@@ -2134,10 +2324,10 @@ const _U = class _U {
2134
2324
  }
2135
2325
  sendSubmitFileContents(A, I, g) {
2136
2326
  var _a;
2137
- (_a = this.session) == null ? void 0 : _a.invokeExtension(uA({ stream_id: A, is_error: I, data: g }));
2327
+ (_a = this.session) == null ? void 0 : _a.invokeExtension(AI({ stream_id: A, is_error: I, data: g }));
2138
2328
  }
2139
2329
  sendInitiateFileCopy(A) {
2140
- this.ensureSession().invokeExtension(_A(A));
2330
+ this.ensureSession().invokeExtension(II(A));
2141
2331
  }
2142
2332
  /**
2143
2333
  * Returns the extension objects to register on the SessionBuilder before connect().
@@ -2145,15 +2335,15 @@ const _U = class _U {
2145
2335
  */
2146
2336
  getBuilderExtensions() {
2147
2337
  return [
2148
- fA(
2338
+ nA(
2149
2339
  (A, I) => this.handleFilesAvailable(A, I)
2150
2340
  ),
2151
- TA((A) => this.handleFileContentsRequest(A)),
2152
- nA((A) => this.handleFileContentsResponse(A)),
2153
- rA((A) => this.handleLock(A)),
2154
- PA((A) => this.handleUnlock(A)),
2155
- vA((A) => this.handleLocksExpired(A)),
2156
- zA((A) => this.handleFormatListResponse(A))
2341
+ zA((A) => this.handleFileContentsRequest(A)),
2342
+ PA((A) => this.handleFileContentsResponse(A)),
2343
+ vA((A) => this.handleLock(A)),
2344
+ eA((A) => this.handleUnlock(A)),
2345
+ uA((A) => this.handleLocksExpired(A)),
2346
+ _A((A) => this.handleFormatListResponse(A))
2157
2347
  ];
2158
2348
  }
2159
2349
  /**
@@ -2288,19 +2478,19 @@ const _U = class _U {
2288
2478
  * ```
2289
2479
  */
2290
2480
  async downloadFilesConcurrent(A, I = {}) {
2291
- const g = I.maxConcurrent ?? 3, B = /* @__PURE__ */ new Map(), E = [], D = A.map((w, F) => async () => {
2481
+ const g = I.maxConcurrent ?? 3, B = /* @__PURE__ */ new Map(), E = [], D = A.map((w, G) => async () => {
2292
2482
  try {
2293
- const { completion: a } = this.downloadFile(w, F), J = await a;
2294
- B.set(F, J);
2483
+ const { completion: a } = this.downloadFile(w, G), U = await a;
2484
+ B.set(G, U);
2295
2485
  } catch (a) {
2296
- E.push({ index: F, error: a });
2486
+ E.push({ index: G, error: a });
2297
2487
  }
2298
2488
  }), i = [];
2299
2489
  for (const w of D) {
2300
- const F = w().finally(() => {
2301
- i.splice(i.indexOf(F), 1);
2490
+ const G = w().finally(() => {
2491
+ i.splice(i.indexOf(G), 1);
2302
2492
  });
2303
- i.push(F), i.length >= g && await Promise.race(i);
2493
+ i.push(G), i.length >= g && await Promise.race(i);
2304
2494
  }
2305
2495
  if (await Promise.all(i), E.length > 0)
2306
2496
  throw new Error(
@@ -2328,7 +2518,7 @@ const _U = class _U {
2328
2518
  */
2329
2519
  uploadFiles(A) {
2330
2520
  this.uploadState !== void 0 && this.supersedeUpload(), this.retainedFiles = void 0;
2331
- const I = _U.normalizeToDroppedFiles(A), g = /* @__PURE__ */ new Map();
2521
+ const I = _K.normalizeToDroppedFiles(A), g = /* @__PURE__ */ new Map();
2332
2522
  for (let w = 0; w < I.length; w++)
2333
2523
  g.set(w, this.generateStreamId());
2334
2524
  const B = I.map((w) => ({
@@ -2337,7 +2527,7 @@ const _U = class _U {
2337
2527
  lastModified: w.lastModified,
2338
2528
  path: w.path,
2339
2529
  isDirectory: w.isDirectory
2340
- })), E = I.filter((w) => w.isDirectory !== true).length, D = I.map((w) => w.file), i = new Promise((w, F) => {
2530
+ })), E = I.filter((w) => w.isDirectory !== true).length, D = I.map((w) => w.file), i = new Promise((w, G) => {
2341
2531
  this.uploadState = {
2342
2532
  files: D,
2343
2533
  droppedFiles: I,
@@ -2349,18 +2539,18 @@ const _U = class _U {
2349
2539
  readerTimeouts: /* @__PURE__ */ new Map(),
2350
2540
  transferIds: g,
2351
2541
  resolve: w,
2352
- reject: F
2542
+ reject: G
2353
2543
  }, this.suppressUploadMonitoring();
2354
2544
  try {
2355
2545
  this.sendInitiateFileCopy(B), this.emit("upload-batch-started", g, I);
2356
2546
  } catch (a) {
2357
2547
  this.uploadState = void 0, this.resumeUploadMonitoring();
2358
- const J = {
2548
+ const U = {
2359
2549
  message: "Failed to initiate file upload",
2360
2550
  direction: "upload",
2361
2551
  cause: a
2362
2552
  };
2363
- this.emit("error", J), F(new Error(J.message, { cause: a }));
2553
+ this.emit("error", U), G(new Error(U.message, { cause: a }));
2364
2554
  return;
2365
2555
  }
2366
2556
  this.armPasteAckWatchdog();
@@ -2404,7 +2594,7 @@ const _U = class _U {
2404
2594
  this.pasteAckTimeout = void 0;
2405
2595
  const A = this.uploadState;
2406
2596
  A !== void 0 && A.isRePaste !== true ? this.failPendingUpload("The remote did not request the files in time, so the paste was not completed") : this.resumeUploadMonitoring();
2407
- }, _U.PASTE_ACK_TIMEOUT_MS);
2597
+ }, _K.PASTE_ACK_TIMEOUT_MS);
2408
2598
  }
2409
2599
  /** Disarm the paste-acknowledgment watchdog, if armed. */
2410
2600
  clearPasteAckWatchdog() {
@@ -2422,7 +2612,7 @@ const _U = class _U {
2422
2612
  this.uploadInactivityTimeout = void 0;
2423
2613
  const A = this.uploadState;
2424
2614
  A !== void 0 && A.isRePaste !== true && this.failPendingUpload("The remote stopped requesting the files, so the paste did not complete");
2425
- }, _U.UPLOAD_INACTIVITY_TIMEOUT_MS);
2615
+ }, _K.UPLOAD_INACTIVITY_TIMEOUT_MS);
2426
2616
  }
2427
2617
  /** Disarm the upload inactivity watchdog, if armed. */
2428
2618
  clearUploadInactivityWatchdog() {
@@ -2610,10 +2800,10 @@ const _U = class _U {
2610
2800
  * entries into `results`.
2611
2801
  */
2612
2802
  async traverseEntry(A, I, g, B) {
2613
- if (!(g.length >= _U.MAX_DIRECTORY_ENTRIES)) {
2614
- if (B > _U.MAX_DIRECTORY_DEPTH) {
2803
+ if (!(g.length >= _K.MAX_DIRECTORY_ENTRIES)) {
2804
+ if (B > _K.MAX_DIRECTORY_DEPTH) {
2615
2805
  console.warn(
2616
- `Skipping "${A.name}": directory depth exceeds ${_U.MAX_DIRECTORY_DEPTH}`
2806
+ `Skipping "${A.name}": directory depth exceeds ${_K.MAX_DIRECTORY_DEPTH}`
2617
2807
  );
2618
2808
  return;
2619
2809
  }
@@ -2638,7 +2828,7 @@ const _U = class _U {
2638
2828
  path: I,
2639
2829
  isDirectory: true
2640
2830
  });
2641
- const D = A.createReader(), i = await _U.readAllDirectoryEntries(D);
2831
+ const D = A.createReader(), i = await _K.readAllDirectoryEntries(D);
2642
2832
  for (const w of i)
2643
2833
  await this.traverseEntry(w, E, g, B + 1);
2644
2834
  }
@@ -2690,8 +2880,8 @@ const _U = class _U {
2690
2880
  this.failPendingUpload("Upload interrupted: the remote clipboard changed");
2691
2881
  const g = A.map((B) => ({
2692
2882
  ...B,
2693
- name: _U.sanitizeFileName(B.name),
2694
- path: B.path !== void 0 ? _U.sanitizePath(B.path) : void 0
2883
+ name: _K.sanitizeFileName(B.name),
2884
+ path: B.path !== void 0 ? _K.sanitizePath(B.path) : void 0
2695
2885
  }));
2696
2886
  this.availableFiles = g, this.clipDataId = I, this.emit("files-available", g);
2697
2887
  }
@@ -2754,60 +2944,60 @@ const _U = class _U {
2754
2944
  const w = new Uint8Array(8);
2755
2945
  new DataView(w.buffer).setBigUint64(0, BigInt(i.size), true), this.sendSubmitFileContents(A.streamId, false, w), i.size === 0 && this.markUploadFileComplete(A.index, i, I.transferIds.get(A.index) ?? -1);
2756
2946
  } else if ((A.flags & j.RANGE) !== 0) {
2757
- const w = i.slice(A.position, A.position + A.size), F = new FileReader();
2758
- I.activeReaders.set(A.streamId, F);
2947
+ const w = i.slice(A.position, A.position + A.size), G = new FileReader();
2948
+ I.activeReaders.set(A.streamId, G);
2759
2949
  const a = setTimeout(() => {
2760
2950
  var _a;
2761
- F.abort(), this.uploadState !== void 0 && (this.uploadState.activeReaders.delete(A.streamId), this.uploadState.readerTimeouts.delete(A.streamId)), this.sendSubmitFileContents(A.streamId, true, new Uint8Array());
2762
- const J = {
2763
- message: `File read timeout after ${_U.FILE_READER_TIMEOUT_MS / 1e3}s`,
2951
+ G.abort(), this.uploadState !== void 0 && (this.uploadState.activeReaders.delete(A.streamId), this.uploadState.readerTimeouts.delete(A.streamId)), this.sendSubmitFileContents(A.streamId, true, new Uint8Array());
2952
+ const U = {
2953
+ message: `File read timeout after ${_K.FILE_READER_TIMEOUT_MS / 1e3}s`,
2764
2954
  transferId: (_a = this.uploadState) == null ? void 0 : _a.transferIds.get(A.index),
2765
2955
  fileIndex: A.index,
2766
2956
  fileName: D.name,
2767
2957
  direction: "upload"
2768
2958
  };
2769
- this.emit("error", J), this.uploadState !== void 0 && (this.uploadState.failedFiles.add(A.index), this.uploadState.completedFiles.add(A.index), this.uploadState.completedFiles.size >= this.uploadState.expectedFileCount && this.finishUploadBatch(this.uploadState));
2770
- }, _U.FILE_READER_TIMEOUT_MS);
2771
- I.readerTimeouts.set(A.streamId, a), F.onload = () => {
2959
+ this.emit("error", U), this.uploadState !== void 0 && (this.uploadState.failedFiles.add(A.index), this.uploadState.completedFiles.add(A.index), this.uploadState.completedFiles.size >= this.uploadState.expectedFileCount && this.finishUploadBatch(this.uploadState));
2960
+ }, _K.FILE_READER_TIMEOUT_MS);
2961
+ I.readerTimeouts.set(A.streamId, a), G.onload = () => {
2772
2962
  if (this.uploadState !== void 0) {
2773
2963
  this.uploadState.activeReaders.delete(A.streamId);
2774
- const Y = this.uploadState.readerTimeouts.get(A.streamId);
2775
- Y !== void 0 && (clearTimeout(Y), this.uploadState.readerTimeouts.delete(A.streamId));
2964
+ const c = this.uploadState.readerTimeouts.get(A.streamId);
2965
+ c !== void 0 && (clearTimeout(c), this.uploadState.readerTimeouts.delete(A.streamId));
2776
2966
  }
2777
- const J = new Uint8Array(F.result);
2778
- if (this.sendSubmitFileContents(A.streamId, false, J), this.uploadState !== void 0) {
2779
- const Y = (this.uploadState.bytesServed.get(A.index) ?? 0) + J.length;
2780
- this.uploadState.bytesServed.set(A.index, Y);
2781
- const l = this.uploadState.transferIds.get(A.index) ?? -1, v = {
2782
- transferId: l,
2967
+ const U = new Uint8Array(G.result);
2968
+ if (this.sendSubmitFileContents(A.streamId, false, U), this.uploadState !== void 0) {
2969
+ const c = (this.uploadState.bytesServed.get(A.index) ?? 0) + U.length;
2970
+ this.uploadState.bytesServed.set(A.index, c);
2971
+ const O = this.uploadState.transferIds.get(A.index) ?? -1, S = {
2972
+ transferId: O,
2783
2973
  fileIndex: A.index,
2784
2974
  fileName: D.name,
2785
- bytesTransferred: Y,
2975
+ bytesTransferred: c,
2786
2976
  totalBytes: i.size,
2787
- percentage: i.size === 0 ? 100 : Math.min(Y / i.size * 100, 100)
2977
+ percentage: i.size === 0 ? 100 : Math.min(c / i.size * 100, 100)
2788
2978
  };
2789
- this.emit("upload-progress", v), Y >= i.size && this.markUploadFileComplete(A.index, i, l);
2979
+ this.emit("upload-progress", S), c >= i.size && this.markUploadFileComplete(A.index, i, O);
2790
2980
  }
2791
- }, F.onerror = () => {
2981
+ }, G.onerror = () => {
2792
2982
  var _a, _b;
2793
2983
  if (this.uploadState !== void 0) {
2794
2984
  this.uploadState.activeReaders.delete(A.streamId);
2795
- const Y = this.uploadState.readerTimeouts.get(A.streamId);
2796
- Y !== void 0 && (clearTimeout(Y), this.uploadState.readerTimeouts.delete(A.streamId));
2985
+ const c = this.uploadState.readerTimeouts.get(A.streamId);
2986
+ c !== void 0 && (clearTimeout(c), this.uploadState.readerTimeouts.delete(A.streamId));
2797
2987
  }
2798
2988
  if (((_a = this.uploadState) == null ? void 0 : _a.failedFiles.has(A.index)) === true)
2799
2989
  return;
2800
2990
  this.sendSubmitFileContents(A.streamId, true, new Uint8Array());
2801
- const J = {
2991
+ const U = {
2802
2992
  message: "Failed to read file chunk",
2803
2993
  transferId: (_b = this.uploadState) == null ? void 0 : _b.transferIds.get(A.index),
2804
2994
  fileIndex: A.index,
2805
2995
  fileName: D.name,
2806
2996
  direction: "upload",
2807
- cause: F.error
2997
+ cause: G.error
2808
2998
  };
2809
- this.emit("error", J), this.uploadState !== void 0 && (this.uploadState.failedFiles.add(A.index), this.uploadState.completedFiles.add(A.index), this.uploadState.completedFiles.size >= this.uploadState.expectedFileCount && this.finishUploadBatch(this.uploadState));
2810
- }, F.readAsArrayBuffer(w);
2999
+ this.emit("error", U), this.uploadState !== void 0 && (this.uploadState.failedFiles.add(A.index), this.uploadState.completedFiles.add(A.index), this.uploadState.completedFiles.size >= this.uploadState.expectedFileCount && this.finishUploadBatch(this.uploadState));
3000
+ }, G.readAsArrayBuffer(w);
2811
3001
  }
2812
3002
  }
2813
3003
  /**
@@ -2879,7 +3069,7 @@ const _U = class _U {
2879
3069
  return;
2880
3070
  }
2881
3071
  const g = new DataView(A.data.buffer, A.data.byteOffset, A.data.byteLength), B = Number(g.getBigUint64(0, true));
2882
- if (B > _U.MAX_FILE_SIZE) {
3072
+ if (B > _K.MAX_FILE_SIZE) {
2883
3073
  this.activeDownloads.delete(A.streamId), this.abortWriteHandle(I);
2884
3074
  const E = {
2885
3075
  message: `File size ${(B / (1024 * 1024 * 1024)).toFixed(2)}GB exceeds maximum download limit of 2GB`,
@@ -2912,7 +3102,7 @@ const _U = class _U {
2912
3102
  initWriteHandleAndRequestFirstChunk(A) {
2913
3103
  A.writeHandleReady = (async () => {
2914
3104
  try {
2915
- const I = (async () => (await this.ensureStorageBackend()).createWriteHandle(A.fileInfo.name, A.expectedSize ?? 0))(), g = _U.WRITE_HANDLE_INIT_TIMEOUT_MS, B = await Promise.race([
3105
+ const I = (async () => (await this.ensureStorageBackend()).createWriteHandle(A.fileInfo.name, A.expectedSize ?? 0))(), g = _K.WRITE_HANDLE_INIT_TIMEOUT_MS, B = await Promise.race([
2916
3106
  I,
2917
3107
  new Promise(
2918
3108
  (E, D) => setTimeout(() => D(new Error(`Storage init timed out after ${g / 1e3}s`)), g)
@@ -3098,9 +3288,9 @@ const _U = class _U {
3098
3288
  }
3099
3289
  };
3100
3290
  /** Maximum file size for downloads (2GB) to prevent browser out-of-memory errors */
3101
- __publicField(_U, "MAX_FILE_SIZE", 2 * 1024 * 1024 * 1024);
3291
+ __publicField(_K, "MAX_FILE_SIZE", 2 * 1024 * 1024 * 1024);
3102
3292
  /** Timeout for FileReader operations (60 seconds) to prevent stalled uploads */
3103
- __publicField(_U, "FILE_READER_TIMEOUT_MS", 60 * 1e3);
3293
+ __publicField(_K, "FILE_READER_TIMEOUT_MS", 60 * 1e3);
3104
3294
  /**
3105
3295
  * How long to keep clipboard monitoring suppressed after advertising an upload
3106
3296
  * while waiting for the remote to pull the files (first FileContentsRequest),
@@ -3110,7 +3300,7 @@ __publicField(_U, "FILE_READER_TIMEOUT_MS", 60 * 1e3);
3110
3300
  * clobbered), the watchdog resumes monitoring and fails the upload so its state
3111
3301
  * cannot wedge later uploads.
3112
3302
  */
3113
- __publicField(_U, "PASTE_ACK_TIMEOUT_MS", 60 * 1e3);
3303
+ __publicField(_K, "PASTE_ACK_TIMEOUT_MS", 60 * 1e3);
3114
3304
  /**
3115
3305
  * Upload inactivity window. After the remote starts pulling, each FileContentsRequest
3116
3306
  * resets this; if pulls then stop for this long -- e.g. the remote grabbed the
@@ -3118,111 +3308,111 @@ __publicField(_U, "PASTE_ACK_TIMEOUT_MS", 60 * 1e3);
3118
3308
  * upload is failed so `uploadState` is released and later uploads aren't wedged. A
3119
3309
  * slow-but-progressing transfer keeps resetting it, so it is never killed.
3120
3310
  */
3121
- __publicField(_U, "UPLOAD_INACTIVITY_TIMEOUT_MS", 60 * 1e3);
3311
+ __publicField(_K, "UPLOAD_INACTIVITY_TIMEOUT_MS", 60 * 1e3);
3122
3312
  /** Timeout for storage backend write handle initialization (30 seconds). */
3123
- __publicField(_U, "WRITE_HANDLE_INIT_TIMEOUT_MS", 30 * 1e3);
3313
+ __publicField(_K, "WRITE_HANDLE_INIT_TIMEOUT_MS", 30 * 1e3);
3124
3314
  /** Maximum recursion depth when traversing dropped directories. */
3125
- __publicField(_U, "MAX_DIRECTORY_DEPTH", 32);
3315
+ __publicField(_K, "MAX_DIRECTORY_DEPTH", 32);
3126
3316
  /** Maximum total entries (files + directories) collected from a single drop. */
3127
- __publicField(_U, "MAX_DIRECTORY_ENTRIES", 1e3);
3128
- let U = _U;
3129
- async function wI(Q, A) {
3130
- await OA(A === void 0 ? void 0 : { module_or_path: A }), JA(Q);
3131
- }
3132
- const GI = {
3133
- DesktopSize: p,
3134
- InputTransaction: e,
3135
- SessionBuilder: c,
3136
- ClipboardData: Z,
3137
- DeviceEvent: K
3317
+ __publicField(_K, "MAX_DIRECTORY_ENTRIES", 1e3);
3318
+ let K = _K;
3319
+ async function NI(Q, A) {
3320
+ await fA(A === void 0 ? void 0 : { module_or_path: A }), hA(Q);
3321
+ }
3322
+ const kI = {
3323
+ DesktopSize: V,
3324
+ InputTransaction: _,
3325
+ SessionBuilder: J,
3326
+ ClipboardData: d,
3327
+ DeviceEvent: h
3138
3328
  };
3139
- function oI(Q) {
3140
- return new N("pcb", Q);
3329
+ function RI(Q) {
3330
+ return new k("pcb", Q);
3141
3331
  }
3142
- function NI(Q, A = "enhanced") {
3332
+ function FI(Q, A = "enhanced") {
3143
3333
  if (Q.trim() === "")
3144
3334
  throw new Error("vmconnect requires a VM ID");
3145
3335
  const I = A === "enhanced" ? `${Q};EnhancedMode=1` : Q;
3146
- return new N("vmconnect", I);
3147
- }
3148
- function kI(Q) {
3149
- return new N("display_control", Q);
3150
- }
3151
- function FI(Q) {
3152
- return new N("graphics_pipeline", Q);
3153
- }
3154
- function RI(Q) {
3155
- return new N("h264_decoder", Q);
3336
+ return new k("vmconnect", I);
3156
3337
  }
3157
3338
  function yI(Q) {
3158
- return new N("audio_playback", Q);
3339
+ return new k("display_control", Q);
3159
3340
  }
3160
3341
  function YI(Q) {
3161
- return new N("drive_redirection", Q);
3342
+ return new k("graphics_pipeline", Q);
3162
3343
  }
3163
3344
  function MI(Q) {
3164
- return new N("audio_input", Q);
3165
- }
3166
- function cI(Q) {
3167
- const A = Q instanceof Uint8Array ? Q : new Uint8Array(Q.buffer, Q.byteOffset, Q.byteLength);
3168
- return new N("audio_input_data", A);
3345
+ return new k("h264_decoder", Q);
3169
3346
  }
3170
3347
  function JI(Q) {
3171
- return new N("kdc_proxy_url", Q);
3348
+ return new k("audio_playback", Q);
3172
3349
  }
3173
3350
  function UI(Q) {
3174
- return new N("outbound_message_size_limit", Q);
3351
+ return new k("drive_redirection", Q);
3352
+ }
3353
+ function cI(Q) {
3354
+ return new k("audio_input", Q);
3175
3355
  }
3176
3356
  function KI(Q) {
3177
- return new N("enable_credssp", Q);
3357
+ const A = Q instanceof Uint8Array ? Q : new Uint8Array(Q.buffer, Q.byteOffset, Q.byteLength);
3358
+ return new k("audio_input_data", A);
3178
3359
  }
3179
3360
  function hI(Q) {
3180
- return new N("enable_server_pointer", Q);
3361
+ return new k("kdc_proxy_url", Q);
3181
3362
  }
3182
3363
  function aI(Q) {
3183
- return new N("legacy_graphics", Q);
3364
+ return new k("outbound_message_size_limit", Q);
3365
+ }
3366
+ function HI(Q) {
3367
+ return new k("enable_credssp", Q);
3368
+ }
3369
+ function SI(Q) {
3370
+ return new k("enable_server_pointer", Q);
3371
+ }
3372
+ function LI(Q) {
3373
+ return new k("legacy_graphics", Q);
3184
3374
  }
3185
- try { await wI(__trdLevel, __trdModule); }
3375
+ try { await NI(__trdLevel, __trdModule); }
3186
3376
  catch (error) { __trdReleaseBrowserRoots(); throw error; }
3187
3377
  return {
3188
- Backend: GI,
3189
- BlobStorageBackend: YA,
3378
+ Backend: kI,
3379
+ BlobStorageBackend: cA,
3190
3380
  FileContentsFlags: j,
3191
- OpfsStorageBackend: x,
3192
- PrinterDriverName: QI,
3193
- RdpFile: QA,
3194
- RdpFileTransferProvider: U,
3195
- WebCodecsH264Decoder: cA,
3196
- audioInput: MI,
3197
- audioInputData: cI,
3198
- audioPlayback: yI,
3199
- detectStorageBackend: gI,
3200
- displayControl: kI,
3201
- driveRedirection: YI,
3202
- enableCredssp: KI,
3203
- enableServerPointer: hI,
3204
- fileContentsRequestCallback: TA,
3205
- fileContentsResponseCallback: nA,
3206
- filesAvailableCallback: fA,
3207
- graphicsPipeline: FI,
3208
- h264Decoder: RI,
3209
- h264Supported: BI,
3210
- init: wI,
3211
- initiateFileCopy: _A,
3212
- kdcProxyUrl: JI,
3213
- legacyGraphics: aI,
3214
- lockCallback: rA,
3215
- locksExpiredCallback: vA,
3216
- outboundMessageSizeLimit: UI,
3217
- preConnectionBlob: oI,
3218
- printJobStreamCallbacks: CI,
3219
- printerDeviceId: DI,
3220
- printerDriverName: iI,
3221
- printerName: EI,
3222
- requestFileContents: eA,
3223
- submitFileContents: uA,
3224
- unlockCallback: PA,
3225
- vmConnect: NI,
3381
+ OpfsStorageBackend: l,
3382
+ PrinterDriverName: DI,
3383
+ RdpFile: iA,
3384
+ RdpFileTransferProvider: K,
3385
+ WebCodecsH264Decoder: M,
3386
+ audioInput: cI,
3387
+ audioInputData: KI,
3388
+ audioPlayback: JI,
3389
+ detectStorageBackend: CI,
3390
+ displayControl: yI,
3391
+ driveRedirection: UI,
3392
+ enableCredssp: HI,
3393
+ enableServerPointer: SI,
3394
+ fileContentsRequestCallback: zA,
3395
+ fileContentsResponseCallback: PA,
3396
+ filesAvailableCallback: nA,
3397
+ graphicsPipeline: YI,
3398
+ h264Decoder: MI,
3399
+ h264Supported: EI,
3400
+ init: NI,
3401
+ initiateFileCopy: II,
3402
+ kdcProxyUrl: hI,
3403
+ legacyGraphics: LI,
3404
+ lockCallback: vA,
3405
+ locksExpiredCallback: uA,
3406
+ outboundMessageSizeLimit: aI,
3407
+ preConnectionBlob: RI,
3408
+ printJobStreamCallbacks: iI,
3409
+ printerDeviceId: GI,
3410
+ printerDriverName: oI,
3411
+ printerName: wI,
3412
+ requestFileContents: $A,
3413
+ submitFileContents: AI,
3414
+ unlockCallback: eA,
3415
+ vmConnect: FI,
3226
3416
  runtime: {
3227
3417
  dispose () { __trdReleaseBrowserRoots(); __trdListeners.clear(); },
3228
3418
  get memory () { return C.memory; },