@milaboratories/pl-drivers 1.2.26 → 1.2.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,27 +1,27 @@
1
1
  var ze = Object.defineProperty;
2
2
  var xe = (s, e, t) => e in s ? ze(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
- var d = (s, e, t) => xe(s, typeof e != "symbol" ? e + "" : e, t);
4
- import * as w from "node:fs/promises";
3
+ var c = (s, e, t) => xe(s, typeof e != "symbol" ? e + "" : e, t);
4
+ import * as b from "node:fs/promises";
5
5
  import { addRTypeToMetadata as T, valErr as Me, getField as He, isNullResourceId as je, bigintToResourceId as Q, stringifyWithResourceId as B, isNotNullResourceId as Ge } from "@milaboratories/pl-client";
6
- import { ServiceType as v, stackIntercept as y } from "@protobuf-ts/runtime-rpc";
6
+ import { ServiceType as v, stackIntercept as w } from "@protobuf-ts/runtime-rpc";
7
7
  import { MessageType as g, reflectionMergePartial as f, UnknownFieldHandler as u, WireType as h, PbLong as I, typeofJsonValue as ge } from "@protobuf-ts/runtime";
8
8
  import { request as fe } from "undici";
9
- import { notEmpty as O, mapGet as oe, mapEntries as Ve, TaskProcessor as X, CallersCounter as D, asyncPool as Y, assertNever as qe } from "@milaboratories/ts-helpers";
10
- import { Readable as K, Writable as ee, Transform as Ze } from "node:stream";
9
+ import { notEmpty as O, mapGet as oe, mapEntries as Ve, TaskProcessor as X, CallersCounter as D, asyncPool as Y, fileExists as qe, assertNever as Ze } from "@milaboratories/ts-helpers";
10
+ import { Readable as K, Writable as ee, Transform as Je } from "node:stream";
11
11
  import * as E from "node:fs";
12
12
  import * as m from "node:path";
13
- import { text as Je, buffer as me } from "node:stream/consumers";
14
- import { Computable as b, ChangeSource as S, PollingComputableHooks as we } from "@milaboratories/computable";
13
+ import { text as Qe, buffer as me } from "node:stream/consumers";
14
+ import { Computable as y, ChangeSource as S, PollingComputableHooks as we } from "@milaboratories/computable";
15
15
  import { scheduler as te } from "node:timers/promises";
16
- import * as Qe from "node:readline/promises";
17
- import Xe from "denque";
16
+ import * as Xe from "node:readline/promises";
17
+ import Ye from "denque";
18
18
  import * as se from "node:os";
19
- import { randomUUID as k, createHash as Ye } from "node:crypto";
19
+ import { randomUUID as k, createHash as Ke } from "node:crypto";
20
20
  import { rsSchema as ye, treeEntryToResourceInfo as N, isPlTreeEntry as be, makeResourceSnapshot as Te } from "@milaboratories/pl-tree";
21
21
  import { z as L } from "zod";
22
- import * as Ke from "node:zlib";
23
- import * as et from "tar-fs";
24
- class tt extends g {
22
+ import * as et from "node:zlib";
23
+ import * as tt from "tar-fs";
24
+ class rt extends g {
25
25
  constructor() {
26
26
  super("MiLaboratories.Controller.Shared.uploadapi", []);
27
27
  }
@@ -41,8 +41,8 @@ class tt extends g {
41
41
  ), t;
42
42
  }
43
43
  }
44
- new tt();
45
- class rt extends g {
44
+ new rt();
45
+ class nt extends g {
46
46
  constructor() {
47
47
  super("MiLaboratories.Controller.Shared.uploadapi.Init", []);
48
48
  }
@@ -62,8 +62,8 @@ class rt extends g {
62
62
  ), t;
63
63
  }
64
64
  }
65
- new rt();
66
- class nt extends g {
65
+ new nt();
66
+ class ot extends g {
67
67
  constructor() {
68
68
  super("MiLaboratories.Controller.Shared.uploadapi.Init.Request", [
69
69
  {
@@ -81,8 +81,8 @@ class nt extends g {
81
81
  return t.resourceId = 0n, e !== void 0 && f(this, t, e), t;
82
82
  }
83
83
  internalBinaryRead(e, t, n, r) {
84
- let o = r ?? this.create(), c = e.pos + t;
85
- for (; e.pos < c; ) {
84
+ let o = r ?? this.create(), d = e.pos + t;
85
+ for (; e.pos < d; ) {
86
86
  let [i, l] = e.tag();
87
87
  switch (i) {
88
88
  case /* uint64 resource_id */
@@ -117,8 +117,8 @@ class nt extends g {
117
117
  ), t;
118
118
  }
119
119
  }
120
- const ot = new nt();
121
- class st extends g {
120
+ const st = new ot();
121
+ class it extends g {
122
122
  constructor() {
123
123
  super("MiLaboratories.Controller.Shared.uploadapi.Init.Response", [
124
124
  {
@@ -145,8 +145,8 @@ class st extends g {
145
145
  return t.partsCount = 0n, t.uploadedParts = [], e !== void 0 && f(this, t, e), t;
146
146
  }
147
147
  internalBinaryRead(e, t, n, r) {
148
- let o = r ?? this.create(), c = e.pos + t;
149
- for (; e.pos < c; ) {
148
+ let o = r ?? this.create(), d = e.pos + t;
149
+ for (; e.pos < d; ) {
150
150
  let [i, l] = e.tag();
151
151
  switch (i) {
152
152
  case /* uint64 parts_count */
@@ -193,8 +193,8 @@ class st extends g {
193
193
  ), t;
194
194
  }
195
195
  }
196
- const it = new st();
197
- class at extends g {
196
+ const at = new it();
197
+ class lt extends g {
198
198
  constructor() {
199
199
  super("MiLaboratories.Controller.Shared.uploadapi.UpdateProgress", []);
200
200
  }
@@ -214,8 +214,8 @@ class at extends g {
214
214
  ), t;
215
215
  }
216
216
  }
217
- new at();
218
- class lt extends g {
217
+ new lt();
218
+ class dt extends g {
219
219
  constructor() {
220
220
  super("MiLaboratories.Controller.Shared.uploadapi.UpdateProgress.Request", [
221
221
  {
@@ -245,8 +245,8 @@ class lt extends g {
245
245
  ), t;
246
246
  }
247
247
  internalBinaryRead(e, t, n, r) {
248
- let o = r ?? this.create(), c = e.pos + t;
249
- for (; e.pos < c; ) {
248
+ let o = r ?? this.create(), d = e.pos + t;
249
+ for (; e.pos < d; ) {
250
250
  let [i, l] = e.tag();
251
251
  switch (i) {
252
252
  case /* uint64 resource_id */
@@ -285,8 +285,8 @@ class lt extends g {
285
285
  ), t;
286
286
  }
287
287
  }
288
- const ct = new lt();
289
- class dt extends g {
288
+ const ct = new dt();
289
+ class ht extends g {
290
290
  constructor() {
291
291
  super(
292
292
  "MiLaboratories.Controller.Shared.uploadapi.UpdateProgress.Response",
@@ -313,8 +313,8 @@ class dt extends g {
313
313
  ), t;
314
314
  }
315
315
  }
316
- const ht = new dt();
317
- class ut extends g {
316
+ const ut = new ht();
317
+ class pt extends g {
318
318
  constructor() {
319
319
  super("MiLaboratories.Controller.Shared.uploadapi.GetPartURL", []);
320
320
  }
@@ -334,8 +334,8 @@ class ut extends g {
334
334
  ), t;
335
335
  }
336
336
  }
337
- new ut();
338
- class pt extends g {
337
+ new pt();
338
+ class gt extends g {
339
339
  constructor() {
340
340
  super("MiLaboratories.Controller.Shared.uploadapi.GetPartURL.Request", [
341
341
  {
@@ -373,8 +373,8 @@ class pt extends g {
373
373
  ), t;
374
374
  }
375
375
  internalBinaryRead(e, t, n, r) {
376
- let o = r ?? this.create(), c = e.pos + t;
377
- for (; e.pos < c; ) {
376
+ let o = r ?? this.create(), d = e.pos + t;
377
+ for (; e.pos < d; ) {
378
378
  let [i, l] = e.tag();
379
379
  switch (i) {
380
380
  case /* uint64 resource_id */
@@ -417,8 +417,8 @@ class pt extends g {
417
417
  ), t;
418
418
  }
419
419
  }
420
- const gt = new pt();
421
- class ft extends g {
420
+ const ft = new gt();
421
+ class mt extends g {
422
422
  constructor() {
423
423
  super("MiLaboratories.Controller.Shared.uploadapi.GetPartURL.HTTPHeader", [
424
424
  {
@@ -448,8 +448,8 @@ class ft extends g {
448
448
  ), t;
449
449
  }
450
450
  internalBinaryRead(e, t, n, r) {
451
- let o = r ?? this.create(), c = e.pos + t;
452
- for (; e.pos < c; ) {
451
+ let o = r ?? this.create(), d = e.pos + t;
452
+ for (; e.pos < d; ) {
453
453
  let [i, l] = e.tag();
454
454
  switch (i) {
455
455
  case /* string Name = 1 [json_name = "Name"];*/
@@ -488,8 +488,8 @@ class ft extends g {
488
488
  ), t;
489
489
  }
490
490
  }
491
- const F = new ft();
492
- class mt extends g {
491
+ const F = new mt();
492
+ class wt extends g {
493
493
  constructor() {
494
494
  super("MiLaboratories.Controller.Shared.uploadapi.GetPartURL.Response", [
495
495
  {
@@ -540,8 +540,8 @@ class mt extends g {
540
540
  ), t;
541
541
  }
542
542
  internalBinaryRead(e, t, n, r) {
543
- let o = r ?? this.create(), c = e.pos + t;
544
- for (; e.pos < c; ) {
543
+ let o = r ?? this.create(), d = e.pos + t;
544
+ for (; e.pos < d; ) {
545
545
  let [i, l] = e.tag();
546
546
  switch (i) {
547
547
  case /* string upload_url */
@@ -605,8 +605,8 @@ class mt extends g {
605
605
  ), t;
606
606
  }
607
607
  }
608
- const wt = new mt();
609
- class yt extends g {
608
+ const yt = new wt();
609
+ class bt extends g {
610
610
  constructor() {
611
611
  super("MiLaboratories.Controller.Shared.uploadapi.Finalize", []);
612
612
  }
@@ -626,8 +626,8 @@ class yt extends g {
626
626
  ), t;
627
627
  }
628
628
  }
629
- new yt();
630
- class bt extends g {
629
+ new bt();
630
+ class Tt extends g {
631
631
  constructor() {
632
632
  super("MiLaboratories.Controller.Shared.uploadapi.Finalize.Request", [
633
633
  {
@@ -645,8 +645,8 @@ class bt extends g {
645
645
  return t.resourceId = 0n, e !== void 0 && f(this, t, e), t;
646
646
  }
647
647
  internalBinaryRead(e, t, n, r) {
648
- let o = r ?? this.create(), c = e.pos + t;
649
- for (; e.pos < c; ) {
648
+ let o = r ?? this.create(), d = e.pos + t;
649
+ for (; e.pos < d; ) {
650
650
  let [i, l] = e.tag();
651
651
  switch (i) {
652
652
  case /* uint64 resource_id */
@@ -681,8 +681,8 @@ class bt extends g {
681
681
  ), t;
682
682
  }
683
683
  }
684
- const Tt = new bt();
685
- class kt extends g {
684
+ const kt = new Tt();
685
+ class Lt extends g {
686
686
  constructor() {
687
687
  super("MiLaboratories.Controller.Shared.uploadapi.Finalize.Response", []);
688
688
  }
@@ -702,40 +702,40 @@ class kt extends g {
702
702
  ), t;
703
703
  }
704
704
  }
705
- const Lt = new kt(), W = new v(
705
+ const Pt = new Lt(), W = new v(
706
706
  "MiLaboratories.Controller.Shared.Upload",
707
707
  [
708
708
  {
709
709
  name: "Init",
710
710
  options: {},
711
- I: ot,
712
- O: it
711
+ I: st,
712
+ O: at
713
713
  },
714
714
  {
715
715
  name: "GetPartURL",
716
716
  options: {},
717
- I: gt,
718
- O: wt
717
+ I: ft,
718
+ O: yt
719
719
  },
720
720
  {
721
721
  name: "UpdateProgress",
722
722
  options: {},
723
723
  I: ct,
724
- O: ht
724
+ O: ut
725
725
  },
726
726
  {
727
727
  name: "Finalize",
728
728
  options: {},
729
- I: Tt,
730
- O: Lt
729
+ I: kt,
730
+ O: Pt
731
731
  }
732
732
  ]
733
733
  );
734
- class Pt {
734
+ class It {
735
735
  constructor(e) {
736
- d(this, "typeName", W.typeName);
737
- d(this, "methods", W.methods);
738
- d(this, "options", W.options);
736
+ c(this, "typeName", W.typeName);
737
+ c(this, "methods", W.methods);
738
+ c(this, "options", W.options);
739
739
  this._transport = e;
740
740
  }
741
741
  /**
@@ -747,7 +747,7 @@ class Pt {
747
747
  */
748
748
  init(e, t) {
749
749
  const n = this.methods[0], r = this._transport.mergeOptions(t);
750
- return y(
750
+ return w(
751
751
  "unary",
752
752
  this._transport,
753
753
  n,
@@ -765,7 +765,7 @@ class Pt {
765
765
  */
766
766
  getPartURL(e, t) {
767
767
  const n = this.methods[1], r = this._transport.mergeOptions(t);
768
- return y("unary", this._transport, n, r, e);
768
+ return w("unary", this._transport, n, r, e);
769
769
  }
770
770
  /**
771
771
  *
@@ -776,7 +776,7 @@ class Pt {
776
776
  */
777
777
  updateProgress(e, t) {
778
778
  const n = this.methods[2], r = this._transport.mergeOptions(t);
779
- return y("unary", this._transport, n, r, e);
779
+ return w("unary", this._transport, n, r, e);
780
780
  }
781
781
  /**
782
782
  *
@@ -789,21 +789,21 @@ class Pt {
789
789
  */
790
790
  finalize(e, t) {
791
791
  const n = this.methods[3], r = this._transport.mergeOptions(t);
792
- return y("unary", this._transport, n, r, e);
792
+ return w("unary", this._transport, n, r, e);
793
793
  }
794
794
  }
795
795
  class ke extends Error {
796
796
  }
797
797
  class Le extends Error {
798
798
  }
799
- class It extends Error {
799
+ class Nt extends Error {
800
800
  }
801
801
  class Pe extends Error {
802
802
  }
803
- class Nt {
803
+ class Rt {
804
804
  constructor(e, t, n, r) {
805
- d(this, "grpcClient");
806
- this.grpcTransport = e, this.httpClient = t, this.logger = r, this.grpcClient = new Pt(this.grpcTransport);
805
+ c(this, "grpcClient");
806
+ this.grpcTransport = e, this.httpClient = t, this.logger = r, this.grpcClient = new It(this.grpcTransport);
807
807
  }
808
808
  close() {
809
809
  }
@@ -814,7 +814,7 @@ class Nt {
814
814
  );
815
815
  return this.partsToUpload(r.response);
816
816
  }
817
- async partUpload({ id: e, type: t }, n, r, o, c, i) {
817
+ async partUpload({ id: e, type: t }, n, r, o, d, i) {
818
818
  const l = await this.grpcClient.getPartURL(
819
819
  {
820
820
  resourceId: e,
@@ -828,9 +828,9 @@ class Nt {
828
828
  l.chunkStart,
829
829
  l.chunkEnd
830
830
  );
831
- if (p > c)
831
+ if (p > d)
832
832
  throw new ke(
833
- "file was modified, expected mtime: " + c + ", got: " + p + "."
833
+ "file was modified, expected mtime: " + d + ", got: " + p + "."
834
834
  );
835
835
  const P = await fe(
836
836
  l.uploadUrl,
@@ -839,7 +839,7 @@ class Nt {
839
839
  if (this.logger.info(
840
840
  `uploaded chunk ${r} from ${o} of resource: ${e}, response: '${ne.toString()}', status code: ${P.statusCode}`
841
841
  ), P.statusCode != 200)
842
- throw new It(
842
+ throw new Nt(
843
843
  `response is not ok, status code: ${P.statusCode}, body: ${ne}, headers: ${P.headers}, url: ${l.uploadUrl}`
844
844
  );
845
845
  await this.grpcClient.updateProgress(
@@ -859,8 +859,8 @@ class Nt {
859
859
  async readChunk(e, t, n) {
860
860
  let r;
861
861
  try {
862
- r = await w.open(e);
863
- const o = Number(n - t), c = Number(t), i = Buffer.alloc(o), l = await this.readBytesFromPosition(r, i, o, c), a = await w.stat(e);
862
+ r = await b.open(e);
863
+ const o = Number(n - t), d = Number(t), i = Buffer.alloc(o), l = await this.readBytesFromPosition(r, i, o, d), a = await b.stat(e);
864
864
  return {
865
865
  chunk: i.subarray(0, l),
866
866
  mTime: BigInt(Math.floor(a.mtimeMs / 1e3))
@@ -876,15 +876,15 @@ class Nt {
876
876
  async readBytesFromPosition(e, t, n, r) {
877
877
  let o = 0;
878
878
  for (; o < n; ) {
879
- const { bytesRead: c } = await e.read(
879
+ const { bytesRead: d } = await e.read(
880
880
  t,
881
881
  o,
882
882
  n - o,
883
883
  r + o
884
884
  );
885
- if (c === 0)
885
+ if (d === 0)
886
886
  throw new Le("file ended earlier than expected.");
887
- o += c;
887
+ o += d;
888
888
  }
889
889
  return o;
890
890
  }
@@ -906,7 +906,7 @@ class Nt {
906
906
  };
907
907
  }
908
908
  }
909
- class Rt extends g {
909
+ class St extends g {
910
910
  constructor() {
911
911
  super("google.protobuf.Duration", [
912
912
  {
@@ -954,7 +954,7 @@ class Rt extends g {
954
954
  "Unable to parse Duration from JSON string. Invalid format."
955
955
  );
956
956
  n || (n = this.create());
957
- let [, o, c, i] = r, l = I.from(o + c);
957
+ let [, o, d, i] = r, l = I.from(o + d);
958
958
  if (l.toNumber() > 315576e6 || l.toNumber() < -315576e6)
959
959
  throw new Error(
960
960
  "Unable to parse Duration from JSON string. Value out of range."
@@ -970,8 +970,8 @@ class Rt extends g {
970
970
  return t.seconds = 0n, t.nanos = 0, e !== void 0 && f(this, t, e), t;
971
971
  }
972
972
  internalBinaryRead(e, t, n, r) {
973
- let o = r ?? this.create(), c = e.pos + t;
974
- for (; e.pos < c; ) {
973
+ let o = r ?? this.create(), d = e.pos + t;
974
+ for (; e.pos < d; ) {
975
975
  let [i, l] = e.tag();
976
976
  switch (i) {
977
977
  case /* int64 seconds */
@@ -1010,8 +1010,8 @@ class Rt extends g {
1010
1010
  ), t;
1011
1011
  }
1012
1012
  }
1013
- const $ = new Rt();
1014
- class St extends g {
1013
+ const $ = new St();
1014
+ class Ut extends g {
1015
1015
  constructor() {
1016
1016
  super("MiLaboratories.Controller.Shared.ProgressAPI", []);
1017
1017
  }
@@ -1031,8 +1031,8 @@ class St extends g {
1031
1031
  ), t;
1032
1032
  }
1033
1033
  }
1034
- new St();
1035
- class Ut extends g {
1034
+ new Ut();
1035
+ class Bt extends g {
1036
1036
  constructor() {
1037
1037
  super("MiLaboratories.Controller.Shared.ProgressAPI.Report", [
1038
1038
  {
@@ -1079,8 +1079,8 @@ class Ut extends g {
1079
1079
  return t.progress = 0, t.bytesProcessed = 0n, t.bytesTotal = 0n, t.done = !1, t.name = "", e !== void 0 && f(this, t, e), t;
1080
1080
  }
1081
1081
  internalBinaryRead(e, t, n, r) {
1082
- let o = r ?? this.create(), c = e.pos + t;
1083
- for (; e.pos < c; ) {
1082
+ let o = r ?? this.create(), d = e.pos + t;
1083
+ for (; e.pos < d; ) {
1084
1084
  let [i, l] = e.tag();
1085
1085
  switch (i) {
1086
1086
  case /* float progress */
@@ -1131,8 +1131,8 @@ class Ut extends g {
1131
1131
  ), t;
1132
1132
  }
1133
1133
  }
1134
- const R = new Ut();
1135
- class Bt extends g {
1134
+ const R = new Bt();
1135
+ class vt extends g {
1136
1136
  constructor() {
1137
1137
  super("MiLaboratories.Controller.Shared.ProgressAPI.GetStatus", []);
1138
1138
  }
@@ -1152,8 +1152,8 @@ class Bt extends g {
1152
1152
  ), t;
1153
1153
  }
1154
1154
  }
1155
- new Bt();
1156
- class vt extends g {
1155
+ new vt();
1156
+ class Dt extends g {
1157
1157
  constructor() {
1158
1158
  super("MiLaboratories.Controller.Shared.ProgressAPI.GetStatus.Request", [
1159
1159
  {
@@ -1175,8 +1175,8 @@ class vt extends g {
1175
1175
  ), t;
1176
1176
  }
1177
1177
  internalBinaryRead(e, t, n, r) {
1178
- let o = r ?? this.create(), c = e.pos + t;
1179
- for (; e.pos < c; ) {
1178
+ let o = r ?? this.create(), d = e.pos + t;
1179
+ for (; e.pos < d; ) {
1180
1180
  let [i, l] = e.tag();
1181
1181
  switch (i) {
1182
1182
  case /* uint64 resource_id */
@@ -1211,8 +1211,8 @@ class vt extends g {
1211
1211
  ), t;
1212
1212
  }
1213
1213
  }
1214
- const Dt = new vt();
1215
- class $t extends g {
1214
+ const $t = new Dt();
1215
+ class _t extends g {
1216
1216
  constructor() {
1217
1217
  super("MiLaboratories.Controller.Shared.ProgressAPI.GetStatus.Response", [
1218
1218
  { no: 1, name: "report", kind: "message", T: () => R }
@@ -1227,8 +1227,8 @@ class $t extends g {
1227
1227
  ), t;
1228
1228
  }
1229
1229
  internalBinaryRead(e, t, n, r) {
1230
- let o = r ?? this.create(), c = e.pos + t;
1231
- for (; e.pos < c; ) {
1230
+ let o = r ?? this.create(), d = e.pos + t;
1231
+ for (; e.pos < d; ) {
1232
1232
  let [i, l] = e.tag();
1233
1233
  switch (i) {
1234
1234
  case /* MiLaboratories.Controller.Shared.ProgressAPI.Report report */
@@ -1272,8 +1272,8 @@ class $t extends g {
1272
1272
  ), t;
1273
1273
  }
1274
1274
  }
1275
- const _t = new $t();
1276
- class Ct extends g {
1275
+ const Ct = new _t();
1276
+ class Ot extends g {
1277
1277
  constructor() {
1278
1278
  super("MiLaboratories.Controller.Shared.ProgressAPI.RealtimeStatus", []);
1279
1279
  }
@@ -1293,8 +1293,8 @@ class Ct extends g {
1293
1293
  ), t;
1294
1294
  }
1295
1295
  }
1296
- new Ct();
1297
- class Ot extends g {
1296
+ new Ot();
1297
+ class Et extends g {
1298
1298
  constructor() {
1299
1299
  super(
1300
1300
  "MiLaboratories.Controller.Shared.ProgressAPI.RealtimeStatus.Request",
@@ -1320,8 +1320,8 @@ class Ot extends g {
1320
1320
  ), t;
1321
1321
  }
1322
1322
  internalBinaryRead(e, t, n, r) {
1323
- let o = r ?? this.create(), c = e.pos + t;
1324
- for (; e.pos < c; ) {
1323
+ let o = r ?? this.create(), d = e.pos + t;
1324
+ for (; e.pos < d; ) {
1325
1325
  let [i, l] = e.tag();
1326
1326
  switch (i) {
1327
1327
  case /* uint64 resource_id */
@@ -1369,8 +1369,8 @@ class Ot extends g {
1369
1369
  ), t;
1370
1370
  }
1371
1371
  }
1372
- const Et = new Ot();
1373
- class Ft extends g {
1372
+ const Ft = new Et();
1373
+ class Wt extends g {
1374
1374
  constructor() {
1375
1375
  super(
1376
1376
  "MiLaboratories.Controller.Shared.ProgressAPI.RealtimeStatus.Response",
@@ -1386,8 +1386,8 @@ class Ft extends g {
1386
1386
  ), t;
1387
1387
  }
1388
1388
  internalBinaryRead(e, t, n, r) {
1389
- let o = r ?? this.create(), c = e.pos + t;
1390
- for (; e.pos < c; ) {
1389
+ let o = r ?? this.create(), d = e.pos + t;
1390
+ for (; e.pos < d; ) {
1391
1391
  let [i, l] = e.tag();
1392
1392
  switch (i) {
1393
1393
  case /* MiLaboratories.Controller.Shared.ProgressAPI.Report report */
@@ -1431,7 +1431,7 @@ class Ft extends g {
1431
1431
  ), t;
1432
1432
  }
1433
1433
  }
1434
- const Wt = new Ft(), A = new v(
1434
+ const At = new Wt(), A = new v(
1435
1435
  "MiLaboratories.Controller.Shared.Progress",
1436
1436
  [
1437
1437
  {
@@ -1439,23 +1439,23 @@ const Wt = new Ft(), A = new v(
1439
1439
  options: {
1440
1440
  "google.api.http": { get: "/resources/{resource_id}/get-progress" }
1441
1441
  },
1442
- I: Dt,
1443
- O: _t
1442
+ I: $t,
1443
+ O: Ct
1444
1444
  },
1445
1445
  {
1446
1446
  name: "RealtimeStatus",
1447
1447
  serverStreaming: !0,
1448
1448
  options: {},
1449
- I: Et,
1450
- O: Wt
1449
+ I: Ft,
1450
+ O: At
1451
1451
  }
1452
1452
  ]
1453
1453
  );
1454
- class At {
1454
+ class zt {
1455
1455
  constructor(e) {
1456
- d(this, "typeName", A.typeName);
1457
- d(this, "methods", A.methods);
1458
- d(this, "options", A.options);
1456
+ c(this, "typeName", A.typeName);
1457
+ c(this, "methods", A.methods);
1458
+ c(this, "options", A.options);
1459
1459
  this._transport = e;
1460
1460
  }
1461
1461
  /**
@@ -1463,20 +1463,20 @@ class At {
1463
1463
  */
1464
1464
  getStatus(e, t) {
1465
1465
  const n = this.methods[0], r = this._transport.mergeOptions(t);
1466
- return y("unary", this._transport, n, r, e);
1466
+ return w("unary", this._transport, n, r, e);
1467
1467
  }
1468
1468
  /**
1469
1469
  * @generated from protobuf rpc: RealtimeStatus(MiLaboratories.Controller.Shared.ProgressAPI.RealtimeStatus.Request) returns (stream MiLaboratories.Controller.Shared.ProgressAPI.RealtimeStatus.Response);
1470
1470
  */
1471
1471
  realtimeStatus(e, t) {
1472
1472
  const n = this.methods[1], r = this._transport.mergeOptions(t);
1473
- return y("serverStreaming", this._transport, n, r, e);
1473
+ return w("serverStreaming", this._transport, n, r, e);
1474
1474
  }
1475
1475
  }
1476
- class zt {
1476
+ class xt {
1477
1477
  constructor(e, t, n, r) {
1478
- d(this, "grpcClient");
1479
- this.grpcTransport = e, this.client = n, this.logger = r, this.grpcClient = new At(this.grpcTransport);
1478
+ c(this, "grpcClient");
1479
+ this.grpcTransport = e, this.client = n, this.logger = r, this.grpcClient = new zt(this.grpcTransport);
1480
1480
  }
1481
1481
  close() {
1482
1482
  }
@@ -1497,9 +1497,9 @@ class zt {
1497
1497
  // GRPC stream every updateIntervalMs milliseconds.
1498
1498
  async *realtimeStatus({ id: e, type: t }, n = 100, r) {
1499
1499
  r = T(t, r);
1500
- const o = Math.floor(n / 1e3), c = (n - o * 1e3) * 1e6, i = $.create({
1500
+ const o = Math.floor(n / 1e3), d = (n - o * 1e3) * 1e6, i = $.create({
1501
1501
  seconds: BigInt(o),
1502
- nanos: c
1502
+ nanos: d
1503
1503
  });
1504
1504
  try {
1505
1505
  const { responses: l } = this.grpcClient.realtimeStatus(
@@ -1515,7 +1515,7 @@ class zt {
1515
1515
  }
1516
1516
  }
1517
1517
  }
1518
- class xt extends g {
1518
+ class Mt extends g {
1519
1519
  constructor() {
1520
1520
  super("MiLaboratories.Controller.Shared.DownloadAPI", []);
1521
1521
  }
@@ -1535,8 +1535,8 @@ class xt extends g {
1535
1535
  ), t;
1536
1536
  }
1537
1537
  }
1538
- new xt();
1539
- class Mt extends g {
1538
+ new Mt();
1539
+ class Ht extends g {
1540
1540
  constructor() {
1541
1541
  super("MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL", []);
1542
1542
  }
@@ -1556,8 +1556,8 @@ class Mt extends g {
1556
1556
  ), t;
1557
1557
  }
1558
1558
  }
1559
- new Mt();
1560
- class Ht extends g {
1559
+ new Ht();
1560
+ class jt extends g {
1561
1561
  constructor() {
1562
1562
  super(
1563
1563
  "MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Request",
@@ -1582,8 +1582,8 @@ class Ht extends g {
1582
1582
  ), t;
1583
1583
  }
1584
1584
  internalBinaryRead(e, t, n, r) {
1585
- let o = r ?? this.create(), c = e.pos + t;
1586
- for (; e.pos < c; ) {
1585
+ let o = r ?? this.create(), d = e.pos + t;
1586
+ for (; e.pos < d; ) {
1587
1587
  let [i, l] = e.tag();
1588
1588
  switch (i) {
1589
1589
  case /* uint64 resource_id */
@@ -1618,8 +1618,8 @@ class Ht extends g {
1618
1618
  ), t;
1619
1619
  }
1620
1620
  }
1621
- const jt = new Ht();
1622
- class Gt extends g {
1621
+ const Gt = new jt();
1622
+ class Vt extends g {
1623
1623
  constructor() {
1624
1624
  super(
1625
1625
  "MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader",
@@ -1652,8 +1652,8 @@ class Gt extends g {
1652
1652
  ), t;
1653
1653
  }
1654
1654
  internalBinaryRead(e, t, n, r) {
1655
- let o = r ?? this.create(), c = e.pos + t;
1656
- for (; e.pos < c; ) {
1655
+ let o = r ?? this.create(), d = e.pos + t;
1656
+ for (; e.pos < d; ) {
1657
1657
  let [i, l] = e.tag();
1658
1658
  switch (i) {
1659
1659
  case /* string Name = 1 [json_name = "Name"];*/
@@ -1692,8 +1692,8 @@ class Gt extends g {
1692
1692
  ), t;
1693
1693
  }
1694
1694
  }
1695
- const z = new Gt();
1696
- class Vt extends g {
1695
+ const z = new Vt();
1696
+ class qt extends g {
1697
1697
  constructor() {
1698
1698
  super(
1699
1699
  "MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Response",
@@ -1724,8 +1724,8 @@ class Vt extends g {
1724
1724
  ), t;
1725
1725
  }
1726
1726
  internalBinaryRead(e, t, n, r) {
1727
- let o = r ?? this.create(), c = e.pos + t;
1728
- for (; e.pos < c; ) {
1727
+ let o = r ?? this.create(), d = e.pos + t;
1728
+ for (; e.pos < d; ) {
1729
1729
  let [i, l] = e.tag();
1730
1730
  switch (i) {
1731
1731
  case /* string download_url */
@@ -1776,7 +1776,7 @@ class Vt extends g {
1776
1776
  ), t;
1777
1777
  }
1778
1778
  }
1779
- const qt = new Vt(), x = new v(
1779
+ const Zt = new qt(), x = new v(
1780
1780
  "MiLaboratories.Controller.Shared.Download",
1781
1781
  [
1782
1782
  {
@@ -1784,16 +1784,16 @@ const qt = new Vt(), x = new v(
1784
1784
  options: {
1785
1785
  "google.api.http": { get: "/resources/{resource_id}/get-download-url" }
1786
1786
  },
1787
- I: jt,
1788
- O: qt
1787
+ I: Gt,
1788
+ O: Zt
1789
1789
  }
1790
1790
  ]
1791
1791
  );
1792
- class Zt {
1792
+ class Jt {
1793
1793
  constructor(e) {
1794
- d(this, "typeName", x.typeName);
1795
- d(this, "methods", x.methods);
1796
- d(this, "options", x.options);
1794
+ c(this, "typeName", x.typeName);
1795
+ c(this, "methods", x.methods);
1796
+ c(this, "options", x.options);
1797
1797
  this._transport = e;
1798
1798
  }
1799
1799
  /**
@@ -1801,7 +1801,7 @@ class Zt {
1801
1801
  */
1802
1802
  getDownloadURL(e, t) {
1803
1803
  const n = this.methods[0], r = this._transport.mergeOptions(t);
1804
- return y("unary", this._transport, n, r, e);
1804
+ return w("unary", this._transport, n, r, e);
1805
1805
  }
1806
1806
  }
1807
1807
  class re extends Error {
@@ -1811,13 +1811,13 @@ class Ie {
1811
1811
  this.httpClient = e;
1812
1812
  }
1813
1813
  async downloadRemoteFile(e, t, n) {
1814
- const { statusCode: r, body: o, headers: c } = await fe(e, {
1814
+ const { statusCode: r, body: o, headers: d } = await fe(e, {
1815
1815
  dispatcher: this.httpClient,
1816
1816
  headers: t,
1817
1817
  signal: n
1818
1818
  }), i = K.toWeb(o);
1819
1819
  if (r != 200) {
1820
- const l = await Je(i), a = l.substring(0, Math.min(l.length, 1e3));
1820
+ const l = await Qe(i), a = l.substring(0, Math.min(l.length, 1e3));
1821
1821
  throw 400 <= r && r < 500 ? new re(
1822
1822
  `Http error: statusCode: ${r} url: ${e.toString()}, beginning of body: ${a}`
1823
1823
  ) : new Error(
@@ -1826,21 +1826,21 @@ class Ie {
1826
1826
  }
1827
1827
  return {
1828
1828
  content: i,
1829
- size: Number(c["content-length"])
1829
+ size: Number(d["content-length"])
1830
1830
  };
1831
1831
  }
1832
1832
  }
1833
- const Jt = "storage://", ie = /storage:\/\/(?<storageId>.*?)\/(?<localPath>.*)/;
1833
+ const Qt = "storage://", ie = /storage:\/\/(?<storageId>.*?)\/(?<localPath>.*)/;
1834
1834
  class Ne extends Error {
1835
1835
  }
1836
1836
  class Re extends Error {
1837
1837
  }
1838
- class Qt {
1838
+ class Xt {
1839
1839
  constructor(e, t, n, r) {
1840
- d(this, "grpcClient");
1841
- d(this, "downloadHelper");
1842
- d(this, "isLocal", (e) => e.startsWith(Jt));
1843
- this.grpcTransport = e, this.httpClient = t, this.logger = n, this.localStorageIdsToRoot = r, this.grpcClient = new Zt(this.grpcTransport), this.downloadHelper = new Ie(t);
1840
+ c(this, "grpcClient");
1841
+ c(this, "downloadHelper");
1842
+ c(this, "isLocal", (e) => e.startsWith(Qt));
1843
+ this.grpcTransport = e, this.httpClient = t, this.logger = n, this.localStorageIdsToRoot = r, this.grpcClient = new Jt(this.grpcTransport), this.downloadHelper = new Ie(t);
1844
1844
  }
1845
1845
  close() {
1846
1846
  }
@@ -1855,7 +1855,7 @@ class Qt {
1855
1855
  const { downloadUrl: r, headers: o } = await this.getUrl(e, t, n);
1856
1856
  return this.logger.info(`download from url ${r}`), this.isLocal(r) ? await this.readLocalFile(r) : await this.downloadHelper.downloadRemoteFile(
1857
1857
  r,
1858
- Xt(o),
1858
+ Yt(o),
1859
1859
  n
1860
1860
  );
1861
1861
  }
@@ -1868,17 +1868,17 @@ class Qt {
1868
1868
  const [n, r, o] = t;
1869
1869
  if (this.localStorageIdsToRoot[r] == null)
1870
1870
  throw new Ne(`Unknown storage location: ${r}`);
1871
- const c = this.localStorageIdsToRoot[r], i = m.join(c, o), a = (await w.stat(i)).size;
1871
+ const d = this.localStorageIdsToRoot[r], i = m.join(d, o), a = (await b.stat(i)).size;
1872
1872
  return {
1873
1873
  content: K.toWeb(E.createReadStream(i)),
1874
1874
  size: a
1875
1875
  };
1876
1876
  }
1877
1877
  }
1878
- function Xt(s) {
1878
+ function Yt(s) {
1879
1879
  return Object.fromEntries(s.map(({ name: e, value: t }) => [e, t]));
1880
1880
  }
1881
- class Yt extends g {
1881
+ class Kt extends g {
1882
1882
  constructor() {
1883
1883
  super("google.protobuf.Timestamp", [
1884
1884
  {
@@ -1971,8 +1971,8 @@ class Yt extends g {
1971
1971
  return t.seconds = 0n, t.nanos = 0, e !== void 0 && f(this, t, e), t;
1972
1972
  }
1973
1973
  internalBinaryRead(e, t, n, r) {
1974
- let o = r ?? this.create(), c = e.pos + t;
1975
- for (; e.pos < c; ) {
1974
+ let o = r ?? this.create(), d = e.pos + t;
1975
+ for (; e.pos < d; ) {
1976
1976
  let [i, l] = e.tag();
1977
1977
  switch (i) {
1978
1978
  case /* int64 seconds */
@@ -2011,8 +2011,8 @@ class Yt extends g {
2011
2011
  ), t;
2012
2012
  }
2013
2013
  }
2014
- const M = new Yt();
2015
- class Kt extends g {
2014
+ const M = new Kt();
2015
+ class er extends g {
2016
2016
  constructor() {
2017
2017
  super("MiLaboratories.Controller.Shared.LsAPI", []);
2018
2018
  }
@@ -2032,8 +2032,8 @@ class Kt extends g {
2032
2032
  ), t;
2033
2033
  }
2034
2034
  }
2035
- new Kt();
2036
- class er extends g {
2035
+ new er();
2036
+ class tr extends g {
2037
2037
  constructor() {
2038
2038
  super("MiLaboratories.Controller.Shared.LsAPI.ListItem", [
2039
2039
  {
@@ -2087,8 +2087,8 @@ class er extends g {
2087
2087
  return t.name = "", t.size = 0n, t.isDir = !1, t.fullName = "", t.directory = "", t.version = "", e !== void 0 && f(this, t, e), t;
2088
2088
  }
2089
2089
  internalBinaryRead(e, t, n, r) {
2090
- let o = r ?? this.create(), c = e.pos + t;
2091
- for (; e.pos < c; ) {
2090
+ let o = r ?? this.create(), d = e.pos + t;
2091
+ for (; e.pos < d; ) {
2092
2092
  let [i, l] = e.tag();
2093
2093
  switch (i) {
2094
2094
  case /* string name */
@@ -2156,8 +2156,8 @@ class er extends g {
2156
2156
  ), t;
2157
2157
  }
2158
2158
  }
2159
- const H = new er();
2160
- class tr extends g {
2159
+ const H = new tr();
2160
+ class rr extends g {
2161
2161
  constructor() {
2162
2162
  super("MiLaboratories.Controller.Shared.LsAPI.List", []);
2163
2163
  }
@@ -2177,8 +2177,8 @@ class tr extends g {
2177
2177
  ), t;
2178
2178
  }
2179
2179
  }
2180
- new tr();
2181
- class rr extends g {
2180
+ new rr();
2181
+ class nr extends g {
2182
2182
  constructor() {
2183
2183
  super("MiLaboratories.Controller.Shared.LsAPI.List.Request", [
2184
2184
  {
@@ -2203,8 +2203,8 @@ class rr extends g {
2203
2203
  return t.resourceId = 0n, t.location = "", e !== void 0 && f(this, t, e), t;
2204
2204
  }
2205
2205
  internalBinaryRead(e, t, n, r) {
2206
- let o = r ?? this.create(), c = e.pos + t;
2207
- for (; e.pos < c; ) {
2206
+ let o = r ?? this.create(), d = e.pos + t;
2207
+ for (; e.pos < d; ) {
2208
2208
  let [i, l] = e.tag();
2209
2209
  switch (i) {
2210
2210
  case /* uint64 resource_id */
@@ -2243,8 +2243,8 @@ class rr extends g {
2243
2243
  ), t;
2244
2244
  }
2245
2245
  }
2246
- const nr = new rr();
2247
- class or extends g {
2246
+ const or = new nr();
2247
+ class sr extends g {
2248
2248
  constructor() {
2249
2249
  super("MiLaboratories.Controller.Shared.LsAPI.List.Response", [
2250
2250
  {
@@ -2268,8 +2268,8 @@ class or extends g {
2268
2268
  return t.items = [], t.delimiter = "", e !== void 0 && f(this, t, e), t;
2269
2269
  }
2270
2270
  internalBinaryRead(e, t, n, r) {
2271
- let o = r ?? this.create(), c = e.pos + t;
2272
- for (; e.pos < c; ) {
2271
+ let o = r ?? this.create(), d = e.pos + t;
2272
+ for (; e.pos < d; ) {
2273
2273
  let [i, l] = e.tag();
2274
2274
  switch (i) {
2275
2275
  case /* repeated MiLaboratories.Controller.Shared.LsAPI.ListItem items */
@@ -2316,14 +2316,14 @@ class or extends g {
2316
2316
  ), t;
2317
2317
  }
2318
2318
  }
2319
- const sr = new or(), j = new v("MiLaboratories.Controller.Shared.LS", [
2320
- { name: "List", options: {}, I: nr, O: sr }
2319
+ const ir = new sr(), j = new v("MiLaboratories.Controller.Shared.LS", [
2320
+ { name: "List", options: {}, I: or, O: ir }
2321
2321
  ]);
2322
- class ir {
2322
+ class ar {
2323
2323
  constructor(e) {
2324
- d(this, "typeName", j.typeName);
2325
- d(this, "methods", j.methods);
2326
- d(this, "options", j.options);
2324
+ c(this, "typeName", j.typeName);
2325
+ c(this, "methods", j.methods);
2326
+ c(this, "options", j.options);
2327
2327
  this._transport = e;
2328
2328
  }
2329
2329
  /**
@@ -2331,7 +2331,7 @@ class ir {
2331
2331
  */
2332
2332
  list(e, t) {
2333
2333
  const n = this.methods[0], r = this._transport.mergeOptions(t);
2334
- return y(
2334
+ return w(
2335
2335
  "unary",
2336
2336
  this._transport,
2337
2337
  n,
@@ -2340,10 +2340,10 @@ class ir {
2340
2340
  );
2341
2341
  }
2342
2342
  }
2343
- class ar {
2343
+ class lr {
2344
2344
  constructor(e, t) {
2345
- d(this, "grpcClient");
2346
- this.logger = t, this.grpcClient = new ir(e);
2345
+ c(this, "grpcClient");
2346
+ this.logger = t, this.grpcClient = new ar(e);
2347
2347
  }
2348
2348
  close() {
2349
2349
  }
@@ -2357,7 +2357,7 @@ class ar {
2357
2357
  ).response;
2358
2358
  }
2359
2359
  }
2360
- class lr extends g {
2360
+ class dr extends g {
2361
2361
  constructor() {
2362
2362
  super("MiLaboratories.Controller.Shared.StreamingAPI", []);
2363
2363
  }
@@ -2377,7 +2377,7 @@ class lr extends g {
2377
2377
  ), t;
2378
2378
  }
2379
2379
  }
2380
- new lr();
2380
+ new dr();
2381
2381
  class cr extends g {
2382
2382
  constructor() {
2383
2383
  super("MiLaboratories.Controller.Shared.StreamingAPI.StreamBinary", [
@@ -2421,8 +2421,8 @@ class cr extends g {
2421
2421
  return t.resourceId = 0n, t.offset = 0n, e !== void 0 && f(this, t, e), t;
2422
2422
  }
2423
2423
  internalBinaryRead(e, t, n, r) {
2424
- let o = r ?? this.create(), c = e.pos + t;
2425
- for (; e.pos < c; ) {
2424
+ let o = r ?? this.create(), d = e.pos + t;
2425
+ for (; e.pos < d; ) {
2426
2426
  let [i, l] = e.tag();
2427
2427
  switch (i) {
2428
2428
  case /* uint64 resource_id */
@@ -2469,8 +2469,8 @@ class cr extends g {
2469
2469
  ), t;
2470
2470
  }
2471
2471
  }
2472
- const dr = new cr();
2473
- class hr extends g {
2472
+ const hr = new cr();
2473
+ class ur extends g {
2474
2474
  constructor() {
2475
2475
  super("MiLaboratories.Controller.Shared.StreamingAPI.ReadBinary", [
2476
2476
  {
@@ -2504,8 +2504,8 @@ class hr extends g {
2504
2504
  return t.resourceId = 0n, t.offset = 0n, e !== void 0 && f(this, t, e), t;
2505
2505
  }
2506
2506
  internalBinaryRead(e, t, n, r) {
2507
- let o = r ?? this.create(), c = e.pos + t;
2508
- for (; e.pos < c; ) {
2507
+ let o = r ?? this.create(), d = e.pos + t;
2508
+ for (; e.pos < d; ) {
2509
2509
  let [i, l] = e.tag();
2510
2510
  switch (i) {
2511
2511
  case /* uint64 resource_id */
@@ -2548,8 +2548,8 @@ class hr extends g {
2548
2548
  ), t;
2549
2549
  }
2550
2550
  }
2551
- const ur = new hr();
2552
- class pr extends g {
2551
+ const pr = new ur();
2552
+ class gr extends g {
2553
2553
  constructor() {
2554
2554
  super("MiLaboratories.Controller.Shared.StreamingAPI.StreamText", [
2555
2555
  {
@@ -2600,8 +2600,8 @@ class pr extends g {
2600
2600
  return t.resourceId = 0n, t.offset = 0n, e !== void 0 && f(this, t, e), t;
2601
2601
  }
2602
2602
  internalBinaryRead(e, t, n, r) {
2603
- let o = r ?? this.create(), c = e.pos + t;
2604
- for (; e.pos < c; ) {
2603
+ let o = r ?? this.create(), d = e.pos + t;
2604
+ for (; e.pos < d; ) {
2605
2605
  let [i, l] = e.tag();
2606
2606
  switch (i) {
2607
2607
  case /* uint64 resource_id */
@@ -2652,8 +2652,8 @@ class pr extends g {
2652
2652
  ), t;
2653
2653
  }
2654
2654
  }
2655
- const gr = new pr();
2656
- class fr extends g {
2655
+ const fr = new gr();
2656
+ class mr extends g {
2657
2657
  constructor() {
2658
2658
  super("MiLaboratories.Controller.Shared.StreamingAPI.ReadText", [
2659
2659
  {
@@ -2704,8 +2704,8 @@ class fr extends g {
2704
2704
  return t.resourceId = 0n, t.offset = 0n, e !== void 0 && f(this, t, e), t;
2705
2705
  }
2706
2706
  internalBinaryRead(e, t, n, r) {
2707
- let o = r ?? this.create(), c = e.pos + t;
2708
- for (; e.pos < c; ) {
2707
+ let o = r ?? this.create(), d = e.pos + t;
2708
+ for (; e.pos < d; ) {
2709
2709
  let [i, l] = e.tag();
2710
2710
  switch (i) {
2711
2711
  case /* uint64 resource_id */
@@ -2756,8 +2756,8 @@ class fr extends g {
2756
2756
  ), t;
2757
2757
  }
2758
2758
  }
2759
- const mr = new fr();
2760
- class wr extends g {
2759
+ const wr = new mr();
2760
+ class yr extends g {
2761
2761
  constructor() {
2762
2762
  super("MiLaboratories.Controller.Shared.StreamingAPI.LastLines", [
2763
2763
  {
@@ -2808,8 +2808,8 @@ class wr extends g {
2808
2808
  return t.resourceId = 0n, e !== void 0 && f(this, t, e), t;
2809
2809
  }
2810
2810
  internalBinaryRead(e, t, n, r) {
2811
- let o = r ?? this.create(), c = e.pos + t;
2812
- for (; e.pos < c; ) {
2811
+ let o = r ?? this.create(), d = e.pos + t;
2812
+ for (; e.pos < d; ) {
2813
2813
  let [i, l] = e.tag();
2814
2814
  switch (i) {
2815
2815
  case /* uint64 resource_id */
@@ -2860,8 +2860,8 @@ class wr extends g {
2860
2860
  ), t;
2861
2861
  }
2862
2862
  }
2863
- const yr = new wr();
2864
- class br extends g {
2863
+ const br = new yr();
2864
+ class Tr extends g {
2865
2865
  constructor() {
2866
2866
  super("MiLaboratories.Controller.Shared.StreamingAPI.Response", [
2867
2867
  {
@@ -2894,8 +2894,8 @@ class br extends g {
2894
2894
  return t.data = new Uint8Array(0), t.size = 0n, t.newOffset = 0n, e !== void 0 && f(this, t, e), t;
2895
2895
  }
2896
2896
  internalBinaryRead(e, t, n, r) {
2897
- let o = r ?? this.create(), c = e.pos + t;
2898
- for (; e.pos < c; ) {
2897
+ let o = r ?? this.create(), d = e.pos + t;
2898
+ for (; e.pos < d; ) {
2899
2899
  let [i, l] = e.tag();
2900
2900
  switch (i) {
2901
2901
  case /* bytes data */
@@ -2938,48 +2938,48 @@ class br extends g {
2938
2938
  ), t;
2939
2939
  }
2940
2940
  }
2941
- const U = new br(), G = new v(
2941
+ const U = new Tr(), G = new v(
2942
2942
  "MiLaboratories.Controller.Shared.Streaming",
2943
2943
  [
2944
2944
  {
2945
2945
  name: "StreamBinary",
2946
2946
  serverStreaming: !0,
2947
2947
  options: {},
2948
- I: dr,
2948
+ I: hr,
2949
2949
  O: U
2950
2950
  },
2951
2951
  {
2952
2952
  name: "ReadBinary",
2953
2953
  options: {},
2954
- I: ur,
2954
+ I: pr,
2955
2955
  O: U
2956
2956
  },
2957
2957
  {
2958
2958
  name: "StreamText",
2959
2959
  serverStreaming: !0,
2960
2960
  options: {},
2961
- I: gr,
2961
+ I: fr,
2962
2962
  O: U
2963
2963
  },
2964
2964
  {
2965
2965
  name: "ReadText",
2966
2966
  options: {},
2967
- I: mr,
2967
+ I: wr,
2968
2968
  O: U
2969
2969
  },
2970
2970
  {
2971
2971
  name: "LastLines",
2972
2972
  options: {},
2973
- I: yr,
2973
+ I: br,
2974
2974
  O: U
2975
2975
  }
2976
2976
  ]
2977
2977
  );
2978
- class Tr {
2978
+ class kr {
2979
2979
  constructor(e) {
2980
- d(this, "typeName", G.typeName);
2981
- d(this, "methods", G.methods);
2982
- d(this, "options", G.options);
2980
+ c(this, "typeName", G.typeName);
2981
+ c(this, "methods", G.methods);
2982
+ c(this, "options", G.options);
2983
2983
  this._transport = e;
2984
2984
  }
2985
2985
  /**
@@ -2991,7 +2991,7 @@ class Tr {
2991
2991
  */
2992
2992
  streamBinary(e, t) {
2993
2993
  const n = this.methods[0], r = this._transport.mergeOptions(t);
2994
- return y(
2994
+ return w(
2995
2995
  "serverStreaming",
2996
2996
  this._transport,
2997
2997
  n,
@@ -3009,7 +3009,7 @@ class Tr {
3009
3009
  */
3010
3010
  readBinary(e, t) {
3011
3011
  const n = this.methods[1], r = this._transport.mergeOptions(t);
3012
- return y(
3012
+ return w(
3013
3013
  "unary",
3014
3014
  this._transport,
3015
3015
  n,
@@ -3025,7 +3025,7 @@ class Tr {
3025
3025
  */
3026
3026
  streamText(e, t) {
3027
3027
  const n = this.methods[2], r = this._transport.mergeOptions(t);
3028
- return y(
3028
+ return w(
3029
3029
  "serverStreaming",
3030
3030
  this._transport,
3031
3031
  n,
@@ -3043,7 +3043,7 @@ class Tr {
3043
3043
  */
3044
3044
  readText(e, t) {
3045
3045
  const n = this.methods[3], r = this._transport.mergeOptions(t);
3046
- return y(
3046
+ return w(
3047
3047
  "unary",
3048
3048
  this._transport,
3049
3049
  n,
@@ -3065,7 +3065,7 @@ class Tr {
3065
3065
  */
3066
3066
  lastLines(e, t) {
3067
3067
  const n = this.methods[4], r = this._transport.mergeOptions(t);
3068
- return y(
3068
+ return w(
3069
3069
  "unary",
3070
3070
  this._transport,
3071
3071
  n,
@@ -3074,17 +3074,17 @@ class Tr {
3074
3074
  );
3075
3075
  }
3076
3076
  }
3077
- class kr {
3077
+ class Lr {
3078
3078
  constructor(e, t, n) {
3079
- d(this, "grpcClient");
3080
- this.grpcTransport = e, this.httpClient = t, this.logger = n, this.grpcClient = new Tr(this.grpcTransport);
3079
+ c(this, "grpcClient");
3080
+ this.grpcTransport = e, this.httpClient = t, this.logger = n, this.grpcClient = new kr(this.grpcTransport);
3081
3081
  }
3082
3082
  close() {
3083
3083
  }
3084
3084
  /** Reads text back and returns the text,
3085
3085
  * the new offset
3086
3086
  * and the total size of the (currently existing) file. */
3087
- async lastLines({ id: e, type: t }, n, r = 0n, o, c) {
3087
+ async lastLines({ id: e, type: t }, n, r = 0n, o, d) {
3088
3088
  return (await this.grpcClient.lastLines(
3089
3089
  {
3090
3090
  resourceId: e,
@@ -3092,13 +3092,13 @@ class kr {
3092
3092
  offset: r,
3093
3093
  search: o
3094
3094
  },
3095
- T(t, c)
3095
+ T(t, d)
3096
3096
  )).response;
3097
3097
  }
3098
3098
  /** Reads the file forward and returns the text,
3099
3099
  * the new offset
3100
3100
  * and the total size of the (currently existing) file. */
3101
- async readText({ id: e, type: t }, n, r = 0n, o, c) {
3101
+ async readText({ id: e, type: t }, n, r = 0n, o, d) {
3102
3102
  return (await this.grpcClient.readText(
3103
3103
  {
3104
3104
  resourceId: O(e),
@@ -3106,19 +3106,19 @@ class kr {
3106
3106
  offset: r,
3107
3107
  search: o
3108
3108
  },
3109
- T(t, c)
3109
+ T(t, d)
3110
3110
  )).response;
3111
3111
  }
3112
3112
  }
3113
- const Lr = process.env.PL_STORAGE_TO_PATH ? Object.fromEntries(
3113
+ const Pr = process.env.PL_STORAGE_TO_PATH ? Object.fromEntries(
3114
3114
  process.env.PL_STORAGE_TO_PATH.split(";").map((s) => s.split(":"))
3115
3115
  ) : {};
3116
3116
  function In(s, e, t) {
3117
- return t === void 0 && (t = Lr), e.getDriver({
3117
+ return t === void 0 && (t = Pr), e.getDriver({
3118
3118
  name: "DownloadBlob",
3119
- init: (r, o, c) => new Qt(
3119
+ init: (r, o, d) => new Xt(
3120
3120
  o,
3121
- c,
3121
+ d,
3122
3122
  s,
3123
3123
  t
3124
3124
  )
@@ -3127,31 +3127,31 @@ function In(s, e, t) {
3127
3127
  function Nn(s, e) {
3128
3128
  return s.getDriver({
3129
3129
  name: "StreamLogs",
3130
- init: (t, n, r) => new kr(n, r, e)
3130
+ init: (t, n, r) => new Lr(n, r, e)
3131
3131
  });
3132
3132
  }
3133
3133
  function Rn(s, e) {
3134
3134
  return s.getDriver({
3135
3135
  name: "UploadProgress",
3136
- init: (t, n, r) => new zt(n, r, s, e)
3136
+ init: (t, n, r) => new xt(n, r, s, e)
3137
3137
  });
3138
3138
  }
3139
3139
  function Sn(s, e) {
3140
3140
  return s.getDriver({
3141
3141
  name: "UploadBlob",
3142
- init: (t, n, r) => new Nt(n, r, s, e)
3142
+ init: (t, n, r) => new Rt(n, r, s, e)
3143
3143
  });
3144
3144
  }
3145
3145
  function Un(s, e) {
3146
3146
  return s.getDriver({
3147
3147
  name: "LsFiles",
3148
- init: (t, n, r) => new ar(n, e)
3148
+ init: (t, n, r) => new lr(n, e)
3149
3149
  });
3150
3150
  }
3151
3151
  class Bn {
3152
3152
  constructor(e, t) {
3153
- d(this, "updater");
3154
- d(this, "schedule", () => this.updater.schedule());
3153
+ c(this, "updater");
3154
+ c(this, "schedule", () => this.updater.schedule());
3155
3155
  this.onUpdate = e, this.sleepMs = t, this.updater = new Se(async () => {
3156
3156
  for (; ; ) {
3157
3157
  if (await this.onUpdate()) return;
@@ -3162,7 +3162,7 @@ class Bn {
3162
3162
  }
3163
3163
  class Se {
3164
3164
  constructor(e) {
3165
- d(this, "updating");
3165
+ c(this, "updating");
3166
3166
  this.onUpdate = e;
3167
3167
  }
3168
3168
  schedule() {
@@ -3186,18 +3186,18 @@ async function vn(s, e) {
3186
3186
  return await t.getResourceData(r.valueId, !1);
3187
3187
  });
3188
3188
  }
3189
- const Ue = "8C7#F1328%9E089B3D22", Pr = /(?<stage>.*):\s*(?<progress>[\d.]+%)\s.*(?<eta>ETA:.*)/g;
3190
- function Ir(s) {
3191
- const t = s.replace(Ue, "").match(Pr);
3189
+ const Ue = "8C7#F1328%9E089B3D22", Ir = /(?<stage>.*):\s*(?<progress>[\d.]+%)\s.*(?<eta>ETA:.*)/g;
3190
+ function Nr(s) {
3191
+ const t = s.replace(Ue, "").match(Ir);
3192
3192
  if (t == null || t.length != 4)
3193
3193
  return;
3194
- const [n, r, o, c] = t;
3194
+ const [n, r, o, d] = t;
3195
3195
  return {
3196
3196
  stage: r,
3197
3197
  // For example, 'Building pre-clones from tag groups'
3198
3198
  progress: o,
3199
3199
  // 35.3%
3200
- eta: c
3200
+ eta: d
3201
3201
  // ETA: 00:00:07
3202
3202
  };
3203
3203
  }
@@ -3214,13 +3214,13 @@ async function Dn(s, e, t) {
3214
3214
  const r = n.data.toString().split(/\r?\n/)[0];
3215
3215
  if (r == null)
3216
3216
  return { found: !1 };
3217
- const o = Ir(r);
3217
+ const o = Nr(r);
3218
3218
  return o === void 0 ? { found: !1 } : { found: !0, ...o };
3219
3219
  }
3220
3220
  class Be {
3221
3221
  constructor(e) {
3222
- d(this, "cache", /* @__PURE__ */ new Map());
3223
- d(this, "totalSizeBytes", 0);
3222
+ c(this, "cache", /* @__PURE__ */ new Map());
3223
+ c(this, "totalSizeBytes", 0);
3224
3224
  this.softSizeBytes = e;
3225
3225
  }
3226
3226
  existsFile(e) {
@@ -3261,7 +3261,7 @@ class $n {
3261
3261
  }
3262
3262
  getLastLogs(e, t, n) {
3263
3263
  if (n === void 0)
3264
- return b.make((o) => this.getLastLogs(e, t, o));
3264
+ return y.make((o) => this.getLastLogs(e, t, o));
3265
3265
  const r = q(n, e);
3266
3266
  if (r === void 0) {
3267
3267
  n.markUnstable("no stream in stream manager");
@@ -3283,7 +3283,7 @@ class $n {
3283
3283
  }
3284
3284
  getProgressLog(e, t, n) {
3285
3285
  if (n === void 0)
3286
- return b.make(
3286
+ return y.make(
3287
3287
  (o) => this.getProgressLog(e, t, o)
3288
3288
  );
3289
3289
  const r = q(n, e);
@@ -3307,7 +3307,7 @@ class $n {
3307
3307
  }
3308
3308
  getLogHandle(e, t) {
3309
3309
  if (t === void 0)
3310
- return b.make((r) => this.getLogHandle(e, r));
3310
+ return y.make((r) => this.getLogHandle(e, r));
3311
3311
  const n = q(t, e);
3312
3312
  if (n === void 0) {
3313
3313
  t.markUnstable("no stream in stream manager");
@@ -3353,7 +3353,7 @@ function _(s) {
3353
3353
  let e;
3354
3354
  if (C(s))
3355
3355
  e = s.match(De);
3356
- else if (Nr(s))
3356
+ else if (Rr(s))
3357
3357
  e = s.match($e);
3358
3358
  else throw new Error(`Log handle is malformed: ${s}`);
3359
3359
  if (e == null) throw new Error(`Log handle wasn't parsed: ${s}`);
@@ -3371,10 +3371,10 @@ function C(s) {
3371
3371
  return De.test(s);
3372
3372
  }
3373
3373
  const $e = /^log\+ready:\/\/log\/(?<resourceType>.*)\/(?<resourceVersion>.*)\/(?<resourceId>.*)$/;
3374
- function Nr(s) {
3374
+ function Rr(s) {
3375
3375
  return $e.test(s);
3376
3376
  }
3377
- const Rr = ye({
3377
+ const Sr = ye({
3378
3378
  kv: {
3379
3379
  "ctl/file/blobInfo": L.object({
3380
3380
  sizeBytes: L.coerce.number()
@@ -3382,26 +3382,26 @@ const Rr = ye({
3382
3382
  }
3383
3383
  });
3384
3384
  class _n {
3385
- constructor(e, t, n, r, o, c) {
3385
+ constructor(e, t, n, r, o, d) {
3386
3386
  /** Represents a Resource Id to the path of a blob as a map. */
3387
- d(this, "idToDownload", /* @__PURE__ */ new Map());
3387
+ c(this, "idToDownload", /* @__PURE__ */ new Map());
3388
3388
  /** Writes and removes files to a hard drive and holds a counter for every
3389
3389
  * file that should be kept. */
3390
- d(this, "cache");
3390
+ c(this, "cache");
3391
3391
  /** Downloads files and writes them to the local dir. */
3392
- d(this, "downloadQueue");
3393
- d(this, "idToOnDemand", /* @__PURE__ */ new Map());
3394
- d(this, "idToLastLines", /* @__PURE__ */ new Map());
3395
- d(this, "idToProgressLog", /* @__PURE__ */ new Map());
3396
- d(this, "saveDir");
3397
- this.logger = e, this.clientDownload = t, this.clientLogs = n, this.signer = o, this.cache = new Be(c.cacheSoftSizeBytes), this.downloadQueue = new X(
3392
+ c(this, "downloadQueue");
3393
+ c(this, "idToOnDemand", /* @__PURE__ */ new Map());
3394
+ c(this, "idToLastLines", /* @__PURE__ */ new Map());
3395
+ c(this, "idToProgressLog", /* @__PURE__ */ new Map());
3396
+ c(this, "saveDir");
3397
+ this.logger = e, this.clientDownload = t, this.clientLogs = n, this.signer = o, this.cache = new Be(d.cacheSoftSizeBytes), this.downloadQueue = new X(
3398
3398
  this.logger,
3399
- c.nConcurrentDownloads
3399
+ d.nConcurrentDownloads
3400
3400
  ), this.saveDir = m.resolve(r);
3401
3401
  }
3402
3402
  getDownloadedBlob(e, t) {
3403
3403
  if (t === void 0)
3404
- return b.make((c) => this.getDownloadedBlob(e, c));
3404
+ return y.make((d) => this.getDownloadedBlob(e, d));
3405
3405
  const n = N(e, t), r = k();
3406
3406
  t.addOnDestroy(() => this.releaseBlob(n.id, r));
3407
3407
  const o = this.getDownloadedBlobNoCtx(
@@ -3413,27 +3413,27 @@ class _n {
3413
3413
  }
3414
3414
  getOnDemandBlob(e, t) {
3415
3415
  if (t === void 0)
3416
- return b.make((c) => this.getOnDemandBlob(e, c));
3417
- const n = be(e) ? Te(e, Rr, t) : e, r = k();
3416
+ return y.make((d) => this.getOnDemandBlob(e, d));
3417
+ const n = be(e) ? Te(e, Sr, t) : e, r = k();
3418
3418
  return t.addOnDestroy(() => this.releaseOnDemandBlob(n.id, r)), this.getOnDemandBlobNoCtx(t.watcher, n, r);
3419
3419
  }
3420
3420
  getLocalPath(e) {
3421
3421
  return Z(e, this.signer);
3422
3422
  }
3423
3423
  async getContent(e) {
3424
- if (Dr(e)) return await Ur(this.getLocalPath(e));
3425
- if (!_r(e)) throw new Error("Malformed remote handle");
3426
- const t = Cr(e, this.signer), { content: n } = await this.clientDownload.downloadBlob(t);
3424
+ if ($r(e)) return await Br(this.getLocalPath(e));
3425
+ if (!Cr(e)) throw new Error("Malformed remote handle");
3426
+ const t = Or(e, this.signer), { content: n } = await this.clientDownload.downloadBlob(t);
3427
3427
  return await me(n);
3428
3428
  }
3429
3429
  getDownloadedBlobNoCtx(e, t, n) {
3430
3430
  let r = this.idToDownload.get(t.id);
3431
3431
  if (r === void 0) {
3432
- const c = this.setNewDownloadTask(e, t, n);
3432
+ const d = this.setNewDownloadTask(e, t, n);
3433
3433
  this.downloadQueue.push({
3434
- fn: () => this.downloadBlob(c, n),
3434
+ fn: () => this.downloadBlob(d, n),
3435
3435
  recoverableErrorPredicate: (i) => !0
3436
- }), r = c;
3436
+ }), r = d;
3437
3437
  }
3438
3438
  r.attach(e, n);
3439
3439
  const o = r.getBlob();
@@ -3443,11 +3443,11 @@ class _n {
3443
3443
  }
3444
3444
  }
3445
3445
  setNewDownloadTask(e, t, n) {
3446
- const r = this.getFilePath(t.id), o = new vr(
3446
+ const r = this.getFilePath(t.id), o = new Dr(
3447
3447
  this.clientDownload,
3448
3448
  t,
3449
3449
  r,
3450
- $r(r, this.signer)
3450
+ _r(r, this.signer)
3451
3451
  );
3452
3452
  return this.idToDownload.set(t.id, o), o;
3453
3453
  }
@@ -3457,31 +3457,31 @@ class _n {
3457
3457
  }
3458
3458
  getOnDemandBlobNoCtx(e, t, n) {
3459
3459
  let r = this.idToOnDemand.get(t.id);
3460
- return r === void 0 && (r = new Sr(
3460
+ return r === void 0 && (r = new Ur(
3461
3461
  t.kv["ctl/file/blobInfo"].sizeBytes,
3462
- Or(t, this.signer)
3462
+ Er(t, this.signer)
3463
3463
  ), this.idToOnDemand.set(t.id, r)), r.attach(e, n), r.getHandle();
3464
3464
  }
3465
3465
  getLastLogs(e, t, n) {
3466
3466
  if (n == null)
3467
- return b.make((i) => this.getLastLogs(e, t, i));
3467
+ return y.make((i) => this.getLastLogs(e, t, i));
3468
3468
  const r = N(e, n), o = k();
3469
3469
  n.addOnDestroy(() => this.releaseBlob(r.id, o));
3470
- const c = this.getLastLogsNoCtx(
3470
+ const d = this.getLastLogsNoCtx(
3471
3471
  n.watcher,
3472
3472
  r,
3473
3473
  t,
3474
3474
  o
3475
3475
  );
3476
- return c == null && n.markUnstable("either a file was not downloaded or logs was not read"), c;
3476
+ return d == null && n.markUnstable("either a file was not downloaded or logs was not read"), d;
3477
3477
  }
3478
3478
  getLastLogsNoCtx(e, t, n, r) {
3479
3479
  const o = this.getDownloadedBlobNoCtx(e, t, r);
3480
3480
  if (o == null) return;
3481
- const c = Z(o.handle, this.signer);
3481
+ const d = Z(o.handle, this.signer);
3482
3482
  let i = this.idToLastLines.get(t.id);
3483
3483
  if (i == null) {
3484
- const a = new ae(c, n);
3484
+ const a = new ae(d, n);
3485
3485
  this.idToLastLines.set(t.id, a), i = a;
3486
3486
  }
3487
3487
  const l = i.getOrSchedule(e);
@@ -3490,28 +3490,28 @@ class _n {
3490
3490
  }
3491
3491
  getProgressLog(e, t, n) {
3492
3492
  if (n == null)
3493
- return b.make(
3493
+ return y.make(
3494
3494
  (i) => this.getProgressLog(e, t, i)
3495
3495
  );
3496
3496
  const r = N(e, n), o = k();
3497
3497
  n.addOnDestroy(() => this.releaseBlob(r.id, o));
3498
- const c = this.getProgressLogNoCtx(
3498
+ const d = this.getProgressLogNoCtx(
3499
3499
  n.watcher,
3500
3500
  r,
3501
3501
  t,
3502
3502
  o
3503
3503
  );
3504
- return c === void 0 && n.markUnstable(
3504
+ return d === void 0 && n.markUnstable(
3505
3505
  "either a file was not downloaded or a progress log was not read"
3506
- ), c;
3506
+ ), d;
3507
3507
  }
3508
3508
  getProgressLogNoCtx(e, t, n, r) {
3509
3509
  const o = this.getDownloadedBlobNoCtx(e, t, r);
3510
3510
  if (o == null) return;
3511
- const c = Z(o.handle, this.signer);
3511
+ const d = Z(o.handle, this.signer);
3512
3512
  let i = this.idToProgressLog.get(t.id);
3513
3513
  if (i == null) {
3514
- const a = new ae(c, 1, n);
3514
+ const a = new ae(d, 1, n);
3515
3515
  this.idToProgressLog.set(t.id, a), i = a;
3516
3516
  }
3517
3517
  const l = i.getOrSchedule(e);
@@ -3520,7 +3520,7 @@ class _n {
3520
3520
  }
3521
3521
  getLogHandle(e, t) {
3522
3522
  if (t == null)
3523
- return b.make((r) => this.getLogHandle(e, r));
3523
+ return y.make((r) => this.getLogHandle(e, r));
3524
3524
  const n = N(e, t);
3525
3525
  return this.getLogHandleNoCtx(n);
3526
3526
  }
@@ -3564,9 +3564,9 @@ class _n {
3564
3564
  const r = this.cache.removeFile(n.path, t);
3565
3565
  await Promise.all(
3566
3566
  r.map(async (o) => {
3567
- await w.rm(o.path), this.cache.removeCache(o), this.removeTask(
3567
+ await b.rm(o.path), this.cache.removeCache(o), this.removeTask(
3568
3568
  o,
3569
- `the task ${o.path} was removedfrom cache along with ${r.map((c) => c.path)}`
3569
+ `the task ${o.path} was removedfrom cache along with ${r.map((d) => d.path)}`
3570
3570
  );
3571
3571
  })
3572
3572
  );
@@ -3590,10 +3590,10 @@ class _n {
3590
3590
  return m.resolve(m.join(this.saveDir, String(BigInt(e))));
3591
3591
  }
3592
3592
  }
3593
- class Sr {
3593
+ class Ur {
3594
3594
  constructor(e, t) {
3595
- d(this, "change", new S());
3596
- d(this, "counter", new D());
3595
+ c(this, "change", new S());
3596
+ c(this, "counter", new D());
3597
3597
  this.size = e, this.handle = t;
3598
3598
  }
3599
3599
  getHandle() {
@@ -3608,10 +3608,10 @@ class Sr {
3608
3608
  }
3609
3609
  class ae {
3610
3610
  constructor(e, t, n) {
3611
- d(this, "updater");
3612
- d(this, "log");
3613
- d(this, "change", new S());
3614
- d(this, "error");
3611
+ c(this, "updater");
3612
+ c(this, "log");
3613
+ c(this, "change", new S());
3614
+ c(this, "error");
3615
3615
  this.path = e, this.lines = t, this.patternToSearch = n, this.updater = new Se(async () => this.update());
3616
3616
  }
3617
3617
  getOrSchedule(e) {
@@ -3622,7 +3622,7 @@ class ae {
3622
3622
  }
3623
3623
  async update() {
3624
3624
  try {
3625
- const e = await Br(
3625
+ const e = await vr(
3626
3626
  this.path,
3627
3627
  this.lines,
3628
3628
  this.patternToSearch
@@ -3639,33 +3639,33 @@ class ae {
3639
3639
  }
3640
3640
  async function le(s) {
3641
3641
  try {
3642
- return await w.access(s), !0;
3642
+ return await b.access(s), !0;
3643
3643
  } catch {
3644
3644
  return !1;
3645
3645
  }
3646
3646
  }
3647
- async function Ur(s) {
3647
+ async function Br(s) {
3648
3648
  return await me(K.toWeb(E.createReadStream(s)));
3649
3649
  }
3650
- function Br(s, e, t) {
3650
+ function vr(s, e, t) {
3651
3651
  const n = E.createReadStream(s), r = new ee();
3652
- return new Promise((o, c) => {
3653
- const i = Qe.createInterface(n, r), l = new Xe();
3652
+ return new Promise((o, d) => {
3653
+ const i = Xe.createInterface(n, r), l = new Ye();
3654
3654
  i.on("line", function(a) {
3655
3655
  t != null && !a.includes(t) || (l.push(a), l.length > e && l.shift());
3656
- }), i.on("error", c), i.on("close", function() {
3656
+ }), i.on("error", d), i.on("close", function() {
3657
3657
  o(l.toArray().join(se.EOL) + se.EOL);
3658
3658
  });
3659
3659
  });
3660
3660
  }
3661
- let vr = class {
3661
+ let Dr = class {
3662
3662
  constructor(e, t, n, r) {
3663
- d(this, "counter", new D());
3664
- d(this, "change", new S());
3665
- d(this, "signalCtl", new AbortController());
3666
- d(this, "error");
3667
- d(this, "done", !1);
3668
- d(this, "sizeBytes", 0);
3663
+ c(this, "counter", new D());
3664
+ c(this, "change", new S());
3665
+ c(this, "signalCtl", new AbortController());
3666
+ c(this, "error");
3667
+ c(this, "done", !1);
3668
+ c(this, "sizeBytes", 0);
3669
3669
  this.clientDownload = e, this.rInfo = t, this.path = n, this.handle = r;
3670
3670
  }
3671
3671
  attach(e, t) {
@@ -3676,7 +3676,7 @@ let vr = class {
3676
3676
  const { content: e, size: t } = await this.clientDownload.downloadBlob(
3677
3677
  this.rInfo
3678
3678
  );
3679
- if (await le(m.dirname(this.path)) || await w.mkdir(m.dirname(this.path), { recursive: !0 }), await le(this.path))
3679
+ if (await le(m.dirname(this.path)) || await b.mkdir(m.dirname(this.path), { recursive: !0 }), await le(this.path))
3680
3680
  await e.cancel("the file already existed");
3681
3681
  else {
3682
3682
  const n = ee.toWeb(E.createWriteStream(this.path));
@@ -3684,8 +3684,8 @@ let vr = class {
3684
3684
  }
3685
3685
  this.setDone(t);
3686
3686
  } catch (e) {
3687
- if (e instanceof ce || e instanceof re || e instanceof Ne || e instanceof Re || e.code == "ENOENT") {
3688
- this.setError(e), await w.rm(this.path);
3687
+ if (e instanceof de || e instanceof re || e instanceof Ne || e instanceof Re || e.code == "ENOENT") {
3688
+ this.setError(e), await b.rm(this.path);
3689
3689
  return;
3690
3690
  }
3691
3691
  throw e;
@@ -3710,16 +3710,16 @@ let vr = class {
3710
3710
  this.done = !0, this.sizeBytes = e, this.change.markChanged();
3711
3711
  }
3712
3712
  abort(e) {
3713
- this.signalCtl.abort(new ce(e));
3713
+ this.signalCtl.abort(new de(e));
3714
3714
  }
3715
3715
  setError(e) {
3716
3716
  this.error = e, this.change.markChanged();
3717
3717
  }
3718
3718
  };
3719
- class ce extends Error {
3719
+ class de extends Error {
3720
3720
  }
3721
3721
  const _e = /^blob\+local:\/\/download\/(?<path>.*)#(?<signature>.*)$/;
3722
- function Dr(s) {
3722
+ function $r(s) {
3723
3723
  return !!s.match(_e);
3724
3724
  }
3725
3725
  function Z(s, e) {
@@ -3733,39 +3733,39 @@ function Z(s, e) {
3733
3733
  `Signature verification failed for: ${s}`
3734
3734
  ), n;
3735
3735
  }
3736
- function $r(s, e) {
3736
+ function _r(s, e) {
3737
3737
  return `blob+local://download/${s}#${e.sign(s)}`;
3738
3738
  }
3739
3739
  const Ce = /^blob\+remote:\/\/download\/(?<content>(?<resourceType>.*)\/(?<resourceVersion>.*)\/(?<resourceId>.*))#(?<signature>.*)$/;
3740
- function _r(s) {
3740
+ function Cr(s) {
3741
3741
  return !!s.match(Ce);
3742
3742
  }
3743
- function Cr(s, e) {
3743
+ function Or(s, e) {
3744
3744
  const t = s.match(Ce);
3745
3745
  if (t === null)
3746
3746
  throw new Error(
3747
3747
  `Remote handle is malformed: ${s}, matches: ${t}`
3748
3748
  );
3749
- const { content: n, resourceType: r, resourceVersion: o, resourceId: c, signature: i } = t.groups;
3749
+ const { content: n, resourceType: r, resourceVersion: o, resourceId: d, signature: i } = t.groups;
3750
3750
  return e.verify(
3751
3751
  n,
3752
3752
  i,
3753
3753
  `Signature verification failed for ${s}`
3754
3754
  ), {
3755
- id: Q(BigInt(c)),
3755
+ id: Q(BigInt(d)),
3756
3756
  type: { name: r, version: o }
3757
3757
  };
3758
3758
  }
3759
- function Or(s, e) {
3759
+ function Er(s, e) {
3760
3760
  const t = `${s.type.name}/${s.type.version}/${BigInt(s.id)}`;
3761
3761
  return `blob+remote://download/${t}#${e.sign(t)}`;
3762
3762
  }
3763
- const Er = L.object({
3763
+ const Fr = L.object({
3764
3764
  localPath: L.string(),
3765
3765
  pathSignature: L.string(),
3766
3766
  modificationTime: L.string()
3767
- }), Fr = L.union([Er, L.object({})]), Wr = ye({
3768
- data: Fr,
3767
+ }), Wr = L.union([Fr, L.object({})]), Ar = ye({
3768
+ data: Wr,
3769
3769
  fields: {
3770
3770
  blob: !1,
3771
3771
  // for BlobUpload
@@ -3780,15 +3780,15 @@ class On {
3780
3780
  pollingInterval: 1e3,
3781
3781
  stopPollingDelay: 1e3
3782
3782
  }) {
3783
- d(this, "idToProgress", /* @__PURE__ */ new Map());
3783
+ c(this, "idToProgress", /* @__PURE__ */ new Map());
3784
3784
  /** Holds a queue that upload blobs. */
3785
- d(this, "uploadQueue");
3786
- d(this, "hooks");
3787
- d(this, "scheduledOnNextState", []);
3785
+ c(this, "uploadQueue");
3786
+ c(this, "hooks");
3787
+ c(this, "scheduledOnNextState", []);
3788
3788
  /** If true, main loop will continue polling pl state. */
3789
- d(this, "keepRunning", !1);
3789
+ c(this, "keepRunning", !1);
3790
3790
  /** Actual state of main loop. */
3791
- d(this, "currentLoop");
3791
+ c(this, "currentLoop");
3792
3792
  this.logger = e, this.signer = t, this.clientBlob = n, this.clientProgress = r, this.opts = o, this.uploadQueue = new X(this.logger, 1, {
3793
3793
  type: "exponentialWithMaxDelayBackoff",
3794
3794
  initialDelay: 20,
@@ -3800,16 +3800,16 @@ class On {
3800
3800
  () => this.startUpdating(),
3801
3801
  () => this.stopUpdating(),
3802
3802
  { stopDebounce: o.stopPollingDelay },
3803
- (c, i) => this.scheduleOnNextState(c, i)
3803
+ (d, i) => this.scheduleOnNextState(d, i)
3804
3804
  );
3805
3805
  }
3806
3806
  getProgressId(e, t) {
3807
3807
  if (t == null)
3808
- return b.make((c) => this.getProgressId(e, c));
3809
- const n = be(e) ? Te(e, Wr, t) : e, r = k();
3808
+ return y.make((d) => this.getProgressId(e, d));
3809
+ const n = be(e) ? Te(e, Ar, t) : e, r = k();
3810
3810
  t.attacheHooks(this.hooks), t.addOnDestroy(() => this.release(n.id, r));
3811
3811
  const o = this.getProgressIdNoCtx(t.watcher, n, r);
3812
- return de(o) || t.markUnstable(
3812
+ return ce(o) || t.markUnstable(
3813
3813
  `upload/index progress was got, but it's not stable: ${o}`
3814
3814
  ), o;
3815
3815
  }
@@ -3817,7 +3817,7 @@ class On {
3817
3817
  const r = t.fields.blob != null || t.fields.incarnation != null, o = this.idToProgress.get(t.id);
3818
3818
  if (o != null)
3819
3819
  return o.attach(e, n), o.mustGetProgress(r);
3820
- const c = new Ar(
3820
+ const d = new zr(
3821
3821
  this.logger,
3822
3822
  this.clientBlob,
3823
3823
  this.clientProgress,
@@ -3825,10 +3825,10 @@ class On {
3825
3825
  this.signer,
3826
3826
  t
3827
3827
  );
3828
- return this.idToProgress.set(t.id, c), c.attach(e, n), c.progress.isUpload && c.progress.isUploadSignMatch && this.uploadQueue.push({
3829
- fn: () => c.uploadBlobTask(),
3828
+ return this.idToProgress.set(t.id, d), d.attach(e, n), d.progress.isUpload && d.progress.isUploadSignMatch && this.uploadQueue.push({
3829
+ fn: () => d.uploadBlobTask(),
3830
3830
  recoverableErrorPredicate: (i) => !Oe(i)
3831
- }), c.mustGetProgress(r);
3831
+ }), d.mustGetProgress(r);
3832
3832
  }
3833
3833
  /** Decrement counters for the file and remove an uploading if counter == 0. */
3834
3834
  async release(e, t) {
@@ -3871,20 +3871,20 @@ class On {
3871
3871
  this.currentLoop = void 0;
3872
3872
  }
3873
3873
  getAllNotDoneProgresses() {
3874
- return Array.from(this.idToProgress.entries()).filter(([e, t]) => !de(t.progress)).map(([e, t]) => t);
3874
+ return Array.from(this.idToProgress.entries()).filter(([e, t]) => !ce(t.progress)).map(([e, t]) => t);
3875
3875
  }
3876
3876
  }
3877
- class Ar {
3878
- constructor(e, t, n, r, o, c) {
3879
- d(this, "change", new S());
3880
- d(this, "counter", new D());
3881
- d(this, "progress");
3882
- d(this, "uploadOpts");
3883
- d(this, "uploadingTerminallyFailed");
3884
- this.logger = e, this.clientBlob = t, this.clientProgress = n, this.nConcurrentPartsUpload = r, this.res = c;
3885
- const i = c.type.name.startsWith("BlobUpload");
3877
+ class zr {
3878
+ constructor(e, t, n, r, o, d) {
3879
+ c(this, "change", new S());
3880
+ c(this, "counter", new D());
3881
+ c(this, "progress");
3882
+ c(this, "uploadOpts");
3883
+ c(this, "uploadingTerminallyFailed");
3884
+ this.logger = e, this.clientBlob = t, this.clientProgress = n, this.nConcurrentPartsUpload = r, this.res = d;
3885
+ const i = d.type.name.startsWith("BlobUpload");
3886
3886
  let l;
3887
- i && (this.uploadOpts = zr(c), l = Mr(
3887
+ i && (this.uploadOpts = xr(d), l = Hr(
3888
3888
  o,
3889
3889
  this.uploadOpts.localPath,
3890
3890
  this.uploadOpts.pathSignature
@@ -3953,7 +3953,7 @@ class Ar {
3953
3953
  async updateStatus() {
3954
3954
  try {
3955
3955
  const e = await this.clientProgress.getStatus(this.res), t = this.progress.status;
3956
- this.progress.status = xr(e), this.setDone(e.done), (e.done || e.progress != (t == null ? void 0 : t.progress)) && this.change.markChanged();
3956
+ this.progress.status = Mr(e), this.setDone(e.done), (e.done || e.progress != (t == null ? void 0 : t.progress)) && this.change.markChanged();
3957
3957
  } catch (e) {
3958
3958
  if (this.setLastError(e), e.name == "RpcError" && e.code == "DEADLINE_EXCEEDED") {
3959
3959
  this.logger.warn(
@@ -3971,10 +3971,10 @@ class Ar {
3971
3971
  }
3972
3972
  }
3973
3973
  }
3974
- function de(s) {
3974
+ function ce(s) {
3975
3975
  return s.done && s.status !== void 0 && s.status !== null && s.status.progress >= 1;
3976
3976
  }
3977
- function zr(s) {
3977
+ function xr(s) {
3978
3978
  if (s.data == null || !("modificationTime" in s.data))
3979
3979
  throw new Error(
3980
3980
  "no upload options in BlobUpload resource data: " + B(s.data)
@@ -3998,14 +3998,14 @@ function zr(s) {
3998
3998
  pathSignature: e.pathSignature
3999
3999
  };
4000
4000
  }
4001
- function xr(s) {
4001
+ function Mr(s) {
4002
4002
  return {
4003
4003
  progress: s.progress ?? 0,
4004
4004
  bytesProcessed: Number(s.bytesProcessed),
4005
4005
  bytesTotal: Number(s.bytesTotal)
4006
4006
  };
4007
4007
  }
4008
- function Mr(s, e, t) {
4008
+ function Hr(s, e, t) {
4009
4009
  try {
4010
4010
  return s.verify(e, t), !0;
4011
4011
  } catch {
@@ -4025,16 +4025,16 @@ class En {
4025
4025
  stopPollingDelay: 1e3
4026
4026
  }) {
4027
4027
  /** Holds a map of StreamManager Resource Id to all logs of this stream. */
4028
- d(this, "idToLastLines", /* @__PURE__ */ new Map());
4028
+ c(this, "idToLastLines", /* @__PURE__ */ new Map());
4029
4029
  /** Holds a map of StreamManager Resource Id to the last log line of this stream. */
4030
- d(this, "idToProgressLog", /* @__PURE__ */ new Map());
4030
+ c(this, "idToProgressLog", /* @__PURE__ */ new Map());
4031
4031
  /** Holds a map of StreamManager Resource Id to log id smart object. */
4032
- d(this, "hooks");
4033
- d(this, "scheduledOnNextState", []);
4032
+ c(this, "hooks");
4033
+ c(this, "scheduledOnNextState", []);
4034
4034
  /** If true, main loop will continue polling pl state. */
4035
- d(this, "keepRunning", !1);
4035
+ c(this, "keepRunning", !1);
4036
4036
  /** Actual state of main loop. */
4037
- d(this, "currentLoop");
4037
+ c(this, "currentLoop");
4038
4038
  this.clientLogs = e, this.opts = t, this.hooks = new we(
4039
4039
  () => this.startUpdating(),
4040
4040
  () => this.stopUpdating(),
@@ -4044,13 +4044,13 @@ class En {
4044
4044
  }
4045
4045
  getLastLogs(e, t, n) {
4046
4046
  if (n == null)
4047
- return b.make((i) => this.getLastLogs(e, t, i));
4047
+ return y.make((i) => this.getLastLogs(e, t, i));
4048
4048
  const r = N(e, n), o = k();
4049
4049
  n.attacheHooks(this.hooks), n.addOnDestroy(() => this.releaseLastLogs(r.id, o));
4050
- const c = this.getLastLogsNoCtx(n.watcher, r, t, o);
4050
+ const d = this.getLastLogsNoCtx(n.watcher, r, t, o);
4051
4051
  return n.markUnstable(
4052
4052
  "The logs are from stream, so we consider them unstable. Final values will be got from blobs."
4053
- ), c;
4053
+ ), d;
4054
4054
  }
4055
4055
  getLastLogsNoCtx(e, t, n, r) {
4056
4056
  let o = this.idToLastLines.get(t.id);
@@ -4059,18 +4059,18 @@ class En {
4059
4059
  this.idToLastLines.set(t.id, i), o = i;
4060
4060
  }
4061
4061
  o.attach(e, r);
4062
- const c = o.getLog();
4063
- if (c.error != null) throw c.error;
4064
- return c.log;
4062
+ const d = o.getLog();
4063
+ if (d.error != null) throw d.error;
4064
+ return d.log;
4065
4065
  }
4066
4066
  getProgressLog(e, t, n) {
4067
4067
  if (n == null)
4068
- return b.make(
4068
+ return y.make(
4069
4069
  (i) => this.getProgressLog(e, t, i)
4070
4070
  );
4071
4071
  const r = N(e, n), o = k();
4072
4072
  n.attacheHooks(this.hooks), n.addOnDestroy(() => this.releaseProgressLog(r.id, o));
4073
- const c = this.getProgressLogNoCtx(
4073
+ const d = this.getProgressLogNoCtx(
4074
4074
  n.watcher,
4075
4075
  r,
4076
4076
  t,
@@ -4078,7 +4078,7 @@ class En {
4078
4078
  );
4079
4079
  return n.markUnstable(
4080
4080
  "The progress log is from the stream, so we consider it unstable. Final value will be got from blobs."
4081
- ), c;
4081
+ ), d;
4082
4082
  }
4083
4083
  getProgressLogNoCtx(e, t, n, r) {
4084
4084
  let o = this.idToProgressLog.get(t.id);
@@ -4092,13 +4092,13 @@ class En {
4092
4092
  this.idToProgressLog.set(t.id, i), o = i;
4093
4093
  }
4094
4094
  o.attach(e, r);
4095
- const c = o.getLog();
4096
- if (c.error) throw c.error;
4097
- return c.log;
4095
+ const d = o.getLog();
4096
+ if (d.error) throw d.error;
4097
+ return d.log;
4098
4098
  }
4099
4099
  getLogHandle(e, t) {
4100
4100
  if (t == null)
4101
- return b.make((o) => this.getLogHandle(e, o));
4101
+ return y.make((o) => this.getLogHandle(e, o));
4102
4102
  const n = N(e, t), r = this.getLogHandleNoCtx(n);
4103
4103
  return t.markUnstable(), r;
4104
4104
  }
@@ -4193,11 +4193,11 @@ class En {
4193
4193
  }
4194
4194
  class ue {
4195
4195
  constructor(e, t, n, r) {
4196
- d(this, "logs");
4197
- d(this, "error");
4198
- d(this, "done", !1);
4199
- d(this, "change", new S());
4200
- d(this, "counter", new D());
4196
+ c(this, "logs");
4197
+ c(this, "error");
4198
+ c(this, "done", !1);
4199
+ c(this, "change", new S());
4200
+ c(this, "counter", new D());
4201
4201
  this.clientLogs = e, this.rInfo = t, this.lines = n, this.patternToSearch = r;
4202
4202
  }
4203
4203
  getLog() {
@@ -4238,19 +4238,19 @@ class Fn {
4238
4238
  withGunzip: !0,
4239
4239
  nConcurrentDownloads: 50
4240
4240
  }) {
4241
- d(this, "downloadHelper");
4242
- d(this, "urlToDownload", /* @__PURE__ */ new Map());
4243
- d(this, "downloadQueue");
4241
+ c(this, "downloadHelper");
4242
+ c(this, "urlToDownload", /* @__PURE__ */ new Map());
4243
+ c(this, "downloadQueue");
4244
4244
  /** Writes and removes files to a hard drive and holds a counter for every
4245
4245
  * file that should be kept. */
4246
- d(this, "cache");
4246
+ c(this, "cache");
4247
4247
  this.logger = e, this.saveDir = n, this.opts = r, this.downloadQueue = new X(
4248
4248
  this.logger,
4249
4249
  this.opts.nConcurrentDownloads
4250
4250
  ), this.cache = new Be(this.opts.cacheSoftSizeBytes), this.downloadHelper = new Ie(t);
4251
4251
  }
4252
4252
  getPath(e, t) {
4253
- if (t === void 0) return b.make((o) => this.getPath(e, o));
4253
+ if (t === void 0) return y.make((o) => this.getPath(e, o));
4254
4254
  const n = k();
4255
4255
  t.addOnDestroy(() => this.releasePath(e, n));
4256
4256
  const r = this.getPathNoCtx(e, t.watcher, n);
@@ -4262,11 +4262,11 @@ class Fn {
4262
4262
  const r = e.toString(), o = this.urlToDownload.get(r);
4263
4263
  if (o != null)
4264
4264
  return o.attach(t, n), o.getPath();
4265
- const c = this.setNewTask(t, e, n);
4265
+ const d = this.setNewTask(t, e, n);
4266
4266
  return this.downloadQueue.push({
4267
- fn: async () => this.downloadUrl(c, n),
4267
+ fn: async () => this.downloadUrl(d, n),
4268
4268
  recoverableErrorPredicate: (i) => !0
4269
- }), c.getPath();
4269
+ }), d.getPath();
4270
4270
  }
4271
4271
  /** Downloads and extracts a tar archive if it wasn't downloaded yet. */
4272
4272
  async downloadUrl(e, t) {
@@ -4281,10 +4281,10 @@ class Fn {
4281
4281
  if (this.cache.existsFile(r.path)) {
4282
4282
  const o = this.cache.removeFile(r.path, t);
4283
4283
  await Promise.all(
4284
- o.map(async (c) => {
4285
- await J(c.path), this.cache.removeCache(c), this.removeTask(
4286
- c,
4287
- `the task ${JSON.stringify(c)} was removedfrom cache along with ${JSON.stringify(o)}`
4284
+ o.map(async (d) => {
4285
+ await J(d.path), this.cache.removeCache(d), this.removeTask(
4286
+ d,
4287
+ `the task ${JSON.stringify(d)} was removedfrom cache along with ${JSON.stringify(o)}`
4288
4288
  );
4289
4289
  })
4290
4290
  );
@@ -4306,25 +4306,25 @@ class Fn {
4306
4306
  );
4307
4307
  }
4308
4308
  setNewTask(e, t, n) {
4309
- const r = new Hr(this.getFilePath(t), t);
4309
+ const r = new jr(this.getFilePath(t), t);
4310
4310
  return r.attach(e, n), this.urlToDownload.set(t.toString(), r), r;
4311
4311
  }
4312
4312
  removeTask(e, t) {
4313
4313
  e.abort(t), e.change.markChanged(), this.urlToDownload.delete(e.url.toString());
4314
4314
  }
4315
4315
  getFilePath(e) {
4316
- const t = Ye("sha256").update(e.toString()).digest("hex");
4316
+ const t = Ke("sha256").update(e.toString()).digest("hex");
4317
4317
  return m.join(this.saveDir, t);
4318
4318
  }
4319
4319
  }
4320
- class Hr {
4320
+ class jr {
4321
4321
  constructor(e, t) {
4322
- d(this, "counter", new D());
4323
- d(this, "change", new S());
4324
- d(this, "signalCtl", new AbortController());
4325
- d(this, "error");
4326
- d(this, "done", !1);
4327
- d(this, "sizeBytes", 0);
4322
+ c(this, "counter", new D());
4323
+ c(this, "change", new S());
4324
+ c(this, "signalCtl", new AbortController());
4325
+ c(this, "error");
4326
+ c(this, "done", !1);
4327
+ c(this, "sizeBytes", 0);
4328
4328
  this.path = e, this.url = t;
4329
4329
  }
4330
4330
  attach(e, t) {
@@ -4347,7 +4347,7 @@ class Hr {
4347
4347
  }
4348
4348
  }
4349
4349
  async downloadAndUntar(e, t, n) {
4350
- if (await jr(this.path))
4350
+ if (await qe(this.path))
4351
4351
  return await Ee(this.path);
4352
4352
  const r = await e.downloadRemoteFile(
4353
4353
  this.url.toString(),
@@ -4356,11 +4356,11 @@ class Hr {
4356
4356
  );
4357
4357
  let o = r.content;
4358
4358
  if (t) {
4359
- const i = Ze.toWeb(Ke.createGunzip());
4359
+ const i = Je.toWeb(et.createGunzip());
4360
4360
  o = o.pipeThrough(i, { signal: n });
4361
4361
  }
4362
- const c = ee.toWeb(et.extract(this.path));
4363
- return await o.pipeTo(c, { signal: n }), r.size;
4362
+ const d = ee.toWeb(tt.extract(this.path));
4363
+ return await o.pipeTo(d, { signal: n }), r.size;
4364
4364
  }
4365
4365
  getPath() {
4366
4366
  if (this.done) return { path: O(this.path) };
@@ -4378,24 +4378,17 @@ class Hr {
4378
4378
  }
4379
4379
  class pe extends Error {
4380
4380
  }
4381
- async function jr(s) {
4382
- try {
4383
- return await w.access(s), !0;
4384
- } catch {
4385
- return !1;
4386
- }
4387
- }
4388
4381
  async function Ee(s) {
4389
- const e = await w.readdir(s, { withFileTypes: !0 });
4382
+ const e = await b.readdir(s, { withFileTypes: !0 });
4390
4383
  return (await Promise.all(
4391
4384
  e.map(async (n) => {
4392
4385
  const r = m.join(s, n.name);
4393
- return n.isDirectory() ? await Ee(r) : (await w.stat(r)).size;
4386
+ return n.isDirectory() ? await Ee(r) : (await b.stat(r)).size;
4394
4387
  })
4395
4388
  )).reduce((n, r) => n + r, 0);
4396
4389
  }
4397
4390
  async function J(s) {
4398
- await w.rm(s, { recursive: !0, force: !0 });
4391
+ await b.rm(s, { recursive: !0, force: !0 });
4399
4392
  }
4400
4393
  function Gr(s) {
4401
4394
  var t;
@@ -4469,7 +4462,7 @@ function Xr(s) {
4469
4462
  return sn(s);
4470
4463
  if (Kr(s))
4471
4464
  return tn(s);
4472
- qe(s);
4465
+ Ze(s);
4473
4466
  }
4474
4467
  function Yr([s, e]) {
4475
4468
  return {
@@ -4527,11 +4520,11 @@ function an(s) {
4527
4520
  }
4528
4521
  class Wn {
4529
4522
  constructor(e, t, n, r, o) {
4530
- d(this, "storageIdToResourceId");
4523
+ c(this, "storageIdToResourceId");
4531
4524
  this.logger = e, this.clientLs = t, this.client = n, this.signer = r, this.localStorageToPath = o;
4532
4525
  }
4533
4526
  async getLocalFileHandle(e) {
4534
- const t = await w.stat(e, { bigint: !0 });
4527
+ const t = await b.stat(e, { bigint: !0 });
4535
4528
  return Fe(
4536
4529
  e,
4537
4530
  this.signer,
@@ -4560,14 +4553,14 @@ class Wn {
4560
4553
  return this.storageIdToResourceId == null && (this.storageIdToResourceId = await ln(this.client)), this.storageIdToResourceId;
4561
4554
  }
4562
4555
  async getLocalFiles(e, t, n) {
4563
- const r = m.resolve(t), o = m.isAbsolute(n) ? n : m.resolve(m.join(r, n)), c = await w.opendir(o), i = [];
4564
- for await (const a of c) {
4556
+ const r = m.resolve(t), o = m.isAbsolute(n) ? n : m.resolve(m.join(r, n)), d = await b.opendir(o), i = [];
4557
+ for await (const a of d) {
4565
4558
  const p = m.join(o, a.name);
4566
4559
  i.push({
4567
4560
  directory: o,
4568
4561
  fullName: p,
4569
4562
  dirent: a,
4570
- stat: await w.stat(p)
4563
+ stat: await b.stat(p)
4571
4564
  });
4572
4565
  }
4573
4566
  return {
@@ -4579,21 +4572,21 @@ class Wn {
4579
4572
  async function ln(s) {
4580
4573
  return s.withReadTx("GetAvailableStorageIds", async (e) => {
4581
4574
  const t = await e.getResourceByName("LSProvider"), n = await e.getResourceData(t, !0);
4582
- return cn(n);
4575
+ return dn(n);
4583
4576
  });
4584
4577
  }
4585
- function cn(s) {
4578
+ function dn(s) {
4586
4579
  return Object.fromEntries(
4587
4580
  s.fields.filter((e) => e.type == "Dynamic" && Ge(e.value)).map((e) => [e.name.substring(8), e.value])
4588
4581
  );
4589
4582
  }
4590
4583
  export {
4591
- Qt as ClientDownload,
4592
- kr as ClientLogs,
4593
- ar as ClientLs,
4594
- zt as ClientProgress,
4595
- Nt as ClientUpload,
4596
- vr as Download,
4584
+ Xt as ClientDownload,
4585
+ Lr as ClientLogs,
4586
+ lr as ClientLs,
4587
+ xt as ClientProgress,
4588
+ Rt as ClientUpload,
4589
+ Dr as Download,
4597
4590
  _n as DownloadDriver,
4598
4591
  Fn as DownloadUrlDriver,
4599
4592
  $n as LogsDriver,
@@ -4601,15 +4594,15 @@ export {
4601
4594
  Bn as LongUpdater,
4602
4595
  Wn as LsDriver,
4603
4596
  ke as MTimeError,
4604
- It as NetworkError,
4597
+ Nt as NetworkError,
4605
4598
  Pe as NoFileForUploading,
4606
- Rr as OnDemandBlobResourceSnapshot,
4607
- Lr as PL_STORAGE_TO_PATH,
4599
+ Sr as OnDemandBlobResourceSnapshot,
4600
+ Pr as PL_STORAGE_TO_PATH,
4608
4601
  Le as UnexpectedEOF,
4609
4602
  Ne as UnknownStorageError,
4610
4603
  Se as Updater,
4611
4604
  On as UploadDriver,
4612
- Wr as UploadResourceSnapshot,
4605
+ Ar as UploadResourceSnapshot,
4613
4606
  Re as WrongLocalFileUrl,
4614
4607
  In as createDownloadClient,
4615
4608
  Nn as createLogsClient,
@@ -4619,11 +4612,11 @@ export {
4619
4612
  ve as dataToHandle,
4620
4613
  vn as getStream,
4621
4614
  _ as handleToData,
4622
- Xt as headersFromProto,
4623
- zr as importToUploadOpts,
4615
+ Yt as headersFromProto,
4616
+ xr as importToUploadOpts,
4624
4617
  C as isLiveLogHandle,
4625
- Nr as isReadyLogHandle,
4626
- Ir as lineToProgress,
4618
+ Rr as isReadyLogHandle,
4619
+ Nr as lineToProgress,
4627
4620
  Dn as mixcrProgressFromLogs
4628
4621
  };
4629
4622
  //# sourceMappingURL=index.mjs.map