@pod-os/core 0.20.1-rc.4df0acf.0 → 0.20.1-rc.b417220.0

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.js CHANGED
@@ -1878,8 +1878,8 @@ function createErrorClass(createImpl) {
1878
1878
  var UnsubscriptionError = createErrorClass(function(_super) {
1879
1879
  return function UnsubscriptionErrorImpl(errors) {
1880
1880
  _super(this);
1881
- this.message = errors ? errors.length + " errors occurred during unsubscription:\n" + errors.map(function(err, i) {
1882
- return i + 1 + ") " + err.toString();
1881
+ this.message = errors ? errors.length + " errors occurred during unsubscription:\n" + errors.map(function(err2, i) {
1882
+ return i + 1 + ") " + err2.toString();
1883
1883
  }).join("\n ") : "";
1884
1884
  this.name = "UnsubscriptionError";
1885
1885
  this.errors = errors;
@@ -1945,12 +1945,12 @@ var Subscription = (function() {
1945
1945
  var finalizer = _finalizers_1_1.value;
1946
1946
  try {
1947
1947
  execFinalizer(finalizer);
1948
- } catch (err) {
1948
+ } catch (err2) {
1949
1949
  errors = errors !== null && errors !== void 0 ? errors : [];
1950
- if (err instanceof UnsubscriptionError) {
1951
- errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));
1950
+ if (err2 instanceof UnsubscriptionError) {
1951
+ errors = __spreadArray(__spreadArray([], __read(errors)), __read(err2.errors));
1952
1952
  } else {
1953
- errors.push(err);
1953
+ errors.push(err2);
1954
1954
  }
1955
1955
  }
1956
1956
  }
@@ -2057,13 +2057,13 @@ var timeoutProvider = {
2057
2057
  };
2058
2058
 
2059
2059
  // ../node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js
2060
- function reportUnhandledError(err) {
2060
+ function reportUnhandledError(err2) {
2061
2061
  timeoutProvider.setTimeout(function() {
2062
2062
  var onUnhandledError = config.onUnhandledError;
2063
2063
  if (onUnhandledError) {
2064
- onUnhandledError(err);
2064
+ onUnhandledError(err2);
2065
2065
  } else {
2066
- throw err;
2066
+ throw err2;
2067
2067
  }
2068
2068
  });
2069
2069
  }
@@ -2110,10 +2110,10 @@ function errorContext(cb) {
2110
2110
  cb();
2111
2111
  }
2112
2112
  }
2113
- function captureError(err) {
2113
+ function captureError(err2) {
2114
2114
  if (config.useDeprecatedSynchronousErrorHandling && context) {
2115
2115
  context.errorThrown = true;
2116
- context.error = err;
2116
+ context.error = err2;
2117
2117
  }
2118
2118
  }
2119
2119
 
@@ -2143,12 +2143,12 @@ var Subscriber = (function(_super) {
2143
2143
  this._next(value7);
2144
2144
  }
2145
2145
  };
2146
- Subscriber2.prototype.error = function(err) {
2146
+ Subscriber2.prototype.error = function(err2) {
2147
2147
  if (this.isStopped) {
2148
- handleStoppedNotification(errorNotification(err), this);
2148
+ handleStoppedNotification(errorNotification(err2), this);
2149
2149
  } else {
2150
2150
  this.isStopped = true;
2151
- this._error(err);
2151
+ this._error(err2);
2152
2152
  }
2153
2153
  };
2154
2154
  Subscriber2.prototype.complete = function() {
@@ -2169,9 +2169,9 @@ var Subscriber = (function(_super) {
2169
2169
  Subscriber2.prototype._next = function(value7) {
2170
2170
  this.destination.next(value7);
2171
2171
  };
2172
- Subscriber2.prototype._error = function(err) {
2172
+ Subscriber2.prototype._error = function(err2) {
2173
2173
  try {
2174
- this.destination.error(err);
2174
+ this.destination.error(err2);
2175
2175
  } finally {
2176
2176
  this.unsubscribe();
2177
2177
  }
@@ -2203,16 +2203,16 @@ var ConsumerObserver = (function() {
2203
2203
  }
2204
2204
  }
2205
2205
  };
2206
- ConsumerObserver2.prototype.error = function(err) {
2206
+ ConsumerObserver2.prototype.error = function(err2) {
2207
2207
  var partialObserver = this.partialObserver;
2208
2208
  if (partialObserver.error) {
2209
2209
  try {
2210
- partialObserver.error(err);
2210
+ partialObserver.error(err2);
2211
2211
  } catch (error4) {
2212
2212
  handleUnhandledError(error4);
2213
2213
  }
2214
2214
  } else {
2215
- handleUnhandledError(err);
2215
+ handleUnhandledError(err2);
2216
2216
  }
2217
2217
  };
2218
2218
  ConsumerObserver2.prototype.complete = function() {
@@ -2266,8 +2266,8 @@ function handleUnhandledError(error4) {
2266
2266
  reportUnhandledError(error4);
2267
2267
  }
2268
2268
  }
2269
- function defaultErrorHandler(err) {
2270
- throw err;
2269
+ function defaultErrorHandler(err2) {
2270
+ throw err2;
2271
2271
  }
2272
2272
  function handleStoppedNotification(notification2, subscriber3) {
2273
2273
  var onStoppedNotification = config.onStoppedNotification;
@@ -2332,8 +2332,8 @@ var Observable = (function() {
2332
2332
  Observable2.prototype._trySubscribe = function(sink) {
2333
2333
  try {
2334
2334
  return this._subscribe(sink);
2335
- } catch (err) {
2336
- sink.error(err);
2335
+ } catch (err2) {
2336
+ sink.error(err2);
2337
2337
  }
2338
2338
  };
2339
2339
  Observable2.prototype.forEach = function(next4, promiseCtor) {
@@ -2344,8 +2344,8 @@ var Observable = (function() {
2344
2344
  next: function(value7) {
2345
2345
  try {
2346
2346
  next4(value7);
2347
- } catch (err) {
2348
- reject(err);
2347
+ } catch (err2) {
2348
+ reject(err2);
2349
2349
  subscriber3.unsubscribe();
2350
2350
  }
2351
2351
  },
@@ -2376,8 +2376,8 @@ var Observable = (function() {
2376
2376
  var value7;
2377
2377
  _this.subscribe(function(x) {
2378
2378
  return value7 = x;
2379
- }, function(err) {
2380
- return reject(err);
2379
+ }, function(err2) {
2380
+ return reject(err2);
2381
2381
  }, function() {
2382
2382
  return resolve(value7);
2383
2383
  });
@@ -2409,8 +2409,8 @@ function operate(init) {
2409
2409
  return source8.lift(function(liftedSource) {
2410
2410
  try {
2411
2411
  return init(liftedSource, this);
2412
- } catch (err) {
2413
- this.error(err);
2412
+ } catch (err2) {
2413
+ this.error(err2);
2414
2414
  }
2415
2415
  });
2416
2416
  }
@@ -2431,15 +2431,15 @@ var OperatorSubscriber = (function(_super) {
2431
2431
  _this._next = onNext ? function(value7) {
2432
2432
  try {
2433
2433
  onNext(value7);
2434
- } catch (err) {
2435
- destination2.error(err);
2434
+ } catch (err2) {
2435
+ destination2.error(err2);
2436
2436
  }
2437
2437
  } : _super.prototype._next;
2438
- _this._error = onError ? function(err) {
2438
+ _this._error = onError ? function(err2) {
2439
2439
  try {
2440
- onError(err);
2441
- } catch (err2) {
2442
- destination2.error(err2);
2440
+ onError(err2);
2441
+ } catch (err3) {
2442
+ destination2.error(err3);
2443
2443
  } finally {
2444
2444
  this.unsubscribe();
2445
2445
  }
@@ -2447,8 +2447,8 @@ var OperatorSubscriber = (function(_super) {
2447
2447
  _this._complete = onComplete ? function() {
2448
2448
  try {
2449
2449
  onComplete();
2450
- } catch (err) {
2451
- destination2.error(err);
2450
+ } catch (err2) {
2451
+ destination2.error(err2);
2452
2452
  } finally {
2453
2453
  this.unsubscribe();
2454
2454
  }
@@ -2524,16 +2524,16 @@ var Subject = (function(_super) {
2524
2524
  }
2525
2525
  });
2526
2526
  };
2527
- Subject2.prototype.error = function(err) {
2527
+ Subject2.prototype.error = function(err2) {
2528
2528
  var _this = this;
2529
2529
  errorContext(function() {
2530
2530
  _this._throwIfClosed();
2531
2531
  if (!_this.isStopped) {
2532
2532
  _this.hasError = _this.isStopped = true;
2533
- _this.thrownError = err;
2533
+ _this.thrownError = err2;
2534
2534
  var observers = _this.observers;
2535
2535
  while (observers.length) {
2536
- observers.shift().error(err);
2536
+ observers.shift().error(err2);
2537
2537
  }
2538
2538
  }
2539
2539
  });
@@ -2615,9 +2615,9 @@ var AnonymousSubject = (function(_super) {
2615
2615
  var _a, _b;
2616
2616
  (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value7);
2617
2617
  };
2618
- AnonymousSubject2.prototype.error = function(err) {
2618
+ AnonymousSubject2.prototype.error = function(err2) {
2619
2619
  var _a, _b;
2620
- (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);
2620
+ (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err2);
2621
2621
  };
2622
2622
  AnonymousSubject2.prototype.complete = function() {
2623
2623
  var _a, _b;
@@ -2680,11 +2680,11 @@ function tap(observerOrNext, error4, complete2) {
2680
2680
  isUnsub = false;
2681
2681
  (_a2 = tapObserver.complete) === null || _a2 === void 0 ? void 0 : _a2.call(tapObserver);
2682
2682
  subscriber3.complete();
2683
- }, function(err) {
2683
+ }, function(err2) {
2684
2684
  var _a2;
2685
2685
  isUnsub = false;
2686
- (_a2 = tapObserver.error) === null || _a2 === void 0 ? void 0 : _a2.call(tapObserver, err);
2687
- subscriber3.error(err);
2686
+ (_a2 = tapObserver.error) === null || _a2 === void 0 ? void 0 : _a2.call(tapObserver, err2);
2687
+ subscriber3.error(err2);
2688
2688
  }, function() {
2689
2689
  var _a2, _b;
2690
2690
  if (isUnsub) {
@@ -2731,6 +2731,958 @@ var HttpStatus = class {
2731
2731
  }
2732
2732
  };
2733
2733
 
2734
+ // src/problems/index.ts
2735
+ function httpProblem(title10, response6) {
2736
+ return {
2737
+ type: "http",
2738
+ title: title10,
2739
+ status: response6.status,
2740
+ detail: `The server responded with ${response6.status} ${response6.statusText}`
2741
+ };
2742
+ }
2743
+ function networkProblem(title10, cause) {
2744
+ return {
2745
+ type: "network",
2746
+ title: title10,
2747
+ detail: `The server could not be reached: ${cause.message}`
2748
+ };
2749
+ }
2750
+
2751
+ // ../node_modules/neverthrow/dist/index.es.js
2752
+ var defaultErrorConfig = {
2753
+ withStackTrace: false
2754
+ };
2755
+ var createNeverThrowError = (message4, result6, config2 = defaultErrorConfig) => {
2756
+ const data2 = result6.isOk() ? { type: "Ok", value: result6.value } : { type: "Err", value: result6.error };
2757
+ const maybeStack = config2.withStackTrace ? new Error().stack : void 0;
2758
+ return {
2759
+ data: data2,
2760
+ message: message4,
2761
+ stack: maybeStack
2762
+ };
2763
+ };
2764
+ function __awaiter(thisArg, _arguments, P, generator3) {
2765
+ function adopt(value7) {
2766
+ return value7 instanceof P ? value7 : new P(function(resolve) {
2767
+ resolve(value7);
2768
+ });
2769
+ }
2770
+ return new (P || (P = Promise))(function(resolve, reject) {
2771
+ function fulfilled(value7) {
2772
+ try {
2773
+ step4(generator3.next(value7));
2774
+ } catch (e) {
2775
+ reject(e);
2776
+ }
2777
+ }
2778
+ function rejected(value7) {
2779
+ try {
2780
+ step4(generator3["throw"](value7));
2781
+ } catch (e) {
2782
+ reject(e);
2783
+ }
2784
+ }
2785
+ function step4(result6) {
2786
+ result6.done ? resolve(result6.value) : adopt(result6.value).then(fulfilled, rejected);
2787
+ }
2788
+ step4((generator3 = generator3.apply(thisArg, _arguments || [])).next());
2789
+ });
2790
+ }
2791
+ function __values2(o) {
2792
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
2793
+ if (m) return m.call(o);
2794
+ if (o && typeof o.length === "number") return {
2795
+ next: function() {
2796
+ if (o && i >= o.length) o = void 0;
2797
+ return { value: o && o[i++], done: !o };
2798
+ }
2799
+ };
2800
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
2801
+ }
2802
+ function __await(v2) {
2803
+ return this instanceof __await ? (this.v = v2, this) : new __await(v2);
2804
+ }
2805
+ function __asyncGenerator(thisArg, _arguments, generator3) {
2806
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
2807
+ var g = generator3.apply(thisArg, _arguments || []), i, q = [];
2808
+ return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb2("next"), verb2("throw"), verb2("return", awaitReturn), i[Symbol.asyncIterator] = function() {
2809
+ return this;
2810
+ }, i;
2811
+ function awaitReturn(f) {
2812
+ return function(v2) {
2813
+ return Promise.resolve(v2).then(f, reject);
2814
+ };
2815
+ }
2816
+ function verb2(n2, f) {
2817
+ if (g[n2]) {
2818
+ i[n2] = function(v2) {
2819
+ return new Promise(function(a, b) {
2820
+ q.push([n2, v2, a, b]) > 1 || resume(n2, v2);
2821
+ });
2822
+ };
2823
+ if (f) i[n2] = f(i[n2]);
2824
+ }
2825
+ }
2826
+ function resume(n2, v2) {
2827
+ try {
2828
+ step4(g[n2](v2));
2829
+ } catch (e) {
2830
+ settle(q[0][3], e);
2831
+ }
2832
+ }
2833
+ function step4(r) {
2834
+ r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
2835
+ }
2836
+ function fulfill(value7) {
2837
+ resume("next", value7);
2838
+ }
2839
+ function reject(value7) {
2840
+ resume("throw", value7);
2841
+ }
2842
+ function settle(f, v2) {
2843
+ if (f(v2), q.shift(), q.length) resume(q[0][0], q[0][1]);
2844
+ }
2845
+ }
2846
+ function __asyncDelegator(o) {
2847
+ var i, p;
2848
+ return i = {}, verb2("next"), verb2("throw", function(e) {
2849
+ throw e;
2850
+ }), verb2("return"), i[Symbol.iterator] = function() {
2851
+ return this;
2852
+ }, i;
2853
+ function verb2(n2, f) {
2854
+ i[n2] = o[n2] ? function(v2) {
2855
+ return (p = !p) ? { value: __await(o[n2](v2)), done: false } : f ? f(v2) : v2;
2856
+ } : f;
2857
+ }
2858
+ }
2859
+ function __asyncValues(o) {
2860
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
2861
+ var m = o[Symbol.asyncIterator], i;
2862
+ return m ? m.call(o) : (o = typeof __values2 === "function" ? __values2(o) : o[Symbol.iterator](), i = {}, verb2("next"), verb2("throw"), verb2("return"), i[Symbol.asyncIterator] = function() {
2863
+ return this;
2864
+ }, i);
2865
+ function verb2(n2) {
2866
+ i[n2] = o[n2] && function(v2) {
2867
+ return new Promise(function(resolve, reject) {
2868
+ v2 = o[n2](v2), settle(resolve, reject, v2.done, v2.value);
2869
+ });
2870
+ };
2871
+ }
2872
+ function settle(resolve, reject, d, v2) {
2873
+ Promise.resolve(v2).then(function(v3) {
2874
+ resolve({ value: v3, done: d });
2875
+ }, reject);
2876
+ }
2877
+ }
2878
+ var ResultAsync = class _ResultAsync {
2879
+ constructor(res) {
2880
+ this._promise = res;
2881
+ }
2882
+ static fromSafePromise(promise) {
2883
+ const newPromise = promise.then((value7) => new Ok(value7));
2884
+ return new _ResultAsync(newPromise);
2885
+ }
2886
+ static fromPromise(promise, errorFn) {
2887
+ const newPromise = promise.then((value7) => new Ok(value7)).catch((e) => new Err(errorFn(e)));
2888
+ return new _ResultAsync(newPromise);
2889
+ }
2890
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2891
+ static fromThrowable(fn2, errorFn) {
2892
+ return (...args) => {
2893
+ return new _ResultAsync((() => __awaiter(this, void 0, void 0, function* () {
2894
+ try {
2895
+ return new Ok(yield fn2(...args));
2896
+ } catch (error4) {
2897
+ return new Err(errorFn ? errorFn(error4) : error4);
2898
+ }
2899
+ }))());
2900
+ };
2901
+ }
2902
+ static combine(asyncResultList) {
2903
+ return combineResultAsyncList(asyncResultList);
2904
+ }
2905
+ static combineWithAllErrors(asyncResultList) {
2906
+ return combineResultAsyncListWithAllErrors(asyncResultList);
2907
+ }
2908
+ map(f) {
2909
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
2910
+ if (res.isErr()) {
2911
+ return new Err(res.error);
2912
+ }
2913
+ return new Ok(yield f(res.value));
2914
+ })));
2915
+ }
2916
+ andThrough(f) {
2917
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
2918
+ if (res.isErr()) {
2919
+ return new Err(res.error);
2920
+ }
2921
+ const newRes = yield f(res.value);
2922
+ if (newRes.isErr()) {
2923
+ return new Err(newRes.error);
2924
+ }
2925
+ return new Ok(res.value);
2926
+ })));
2927
+ }
2928
+ andTee(f) {
2929
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
2930
+ if (res.isErr()) {
2931
+ return new Err(res.error);
2932
+ }
2933
+ try {
2934
+ yield f(res.value);
2935
+ } catch (e) {
2936
+ }
2937
+ return new Ok(res.value);
2938
+ })));
2939
+ }
2940
+ orTee(f) {
2941
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
2942
+ if (res.isOk()) {
2943
+ return new Ok(res.value);
2944
+ }
2945
+ try {
2946
+ yield f(res.error);
2947
+ } catch (e) {
2948
+ }
2949
+ return new Err(res.error);
2950
+ })));
2951
+ }
2952
+ mapErr(f) {
2953
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
2954
+ if (res.isOk()) {
2955
+ return new Ok(res.value);
2956
+ }
2957
+ return new Err(yield f(res.error));
2958
+ })));
2959
+ }
2960
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
2961
+ andThen(f) {
2962
+ return new _ResultAsync(this._promise.then((res) => {
2963
+ if (res.isErr()) {
2964
+ return new Err(res.error);
2965
+ }
2966
+ const newValue = f(res.value);
2967
+ return newValue instanceof _ResultAsync ? newValue._promise : newValue;
2968
+ }));
2969
+ }
2970
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
2971
+ orElse(f) {
2972
+ return new _ResultAsync(this._promise.then((res) => __awaiter(this, void 0, void 0, function* () {
2973
+ if (res.isErr()) {
2974
+ return f(res.error);
2975
+ }
2976
+ return new Ok(res.value);
2977
+ })));
2978
+ }
2979
+ match(ok2, _err) {
2980
+ return this._promise.then((res) => res.match(ok2, _err));
2981
+ }
2982
+ unwrapOr(t) {
2983
+ return this._promise.then((res) => res.unwrapOr(t));
2984
+ }
2985
+ /**
2986
+ * @deprecated will be removed in 9.0.0.
2987
+ *
2988
+ * You can use `safeTry` without this method.
2989
+ * @example
2990
+ * ```typescript
2991
+ * safeTry(async function* () {
2992
+ * const okValue = yield* yourResult
2993
+ * })
2994
+ * ```
2995
+ * Emulates Rust's `?` operator in `safeTry`'s body. See also `safeTry`.
2996
+ */
2997
+ safeUnwrap() {
2998
+ return __asyncGenerator(this, arguments, function* safeUnwrap_1() {
2999
+ return yield __await(yield __await(yield* __asyncDelegator(__asyncValues(yield __await(this._promise.then((res) => res.safeUnwrap()))))));
3000
+ });
3001
+ }
3002
+ // Makes ResultAsync implement PromiseLike<Result>
3003
+ then(successCallback, failureCallback) {
3004
+ return this._promise.then(successCallback, failureCallback);
3005
+ }
3006
+ [Symbol.asyncIterator]() {
3007
+ return __asyncGenerator(this, arguments, function* _a() {
3008
+ const result6 = yield __await(this._promise);
3009
+ if (result6.isErr()) {
3010
+ yield yield __await(errAsync(result6.error));
3011
+ }
3012
+ return yield __await(result6.value);
3013
+ });
3014
+ }
3015
+ };
3016
+ function errAsync(err2) {
3017
+ return new ResultAsync(Promise.resolve(new Err(err2)));
3018
+ }
3019
+ var fromPromise = ResultAsync.fromPromise;
3020
+ var fromSafePromise = ResultAsync.fromSafePromise;
3021
+ var fromAsyncThrowable = ResultAsync.fromThrowable;
3022
+ var combineResultList = (resultList) => {
3023
+ let acc = ok([]);
3024
+ for (const result6 of resultList) {
3025
+ if (result6.isErr()) {
3026
+ acc = err(result6.error);
3027
+ break;
3028
+ } else {
3029
+ acc.map((list) => list.push(result6.value));
3030
+ }
3031
+ }
3032
+ return acc;
3033
+ };
3034
+ var combineResultAsyncList = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultList);
3035
+ var combineResultListWithAllErrors = (resultList) => {
3036
+ let acc = ok([]);
3037
+ for (const result6 of resultList) {
3038
+ if (result6.isErr() && acc.isErr()) {
3039
+ acc.error.push(result6.error);
3040
+ } else if (result6.isErr() && acc.isOk()) {
3041
+ acc = err([result6.error]);
3042
+ } else if (result6.isOk() && acc.isOk()) {
3043
+ acc.value.push(result6.value);
3044
+ }
3045
+ }
3046
+ return acc;
3047
+ };
3048
+ var combineResultAsyncListWithAllErrors = (asyncResultList) => ResultAsync.fromSafePromise(Promise.all(asyncResultList)).andThen(combineResultListWithAllErrors);
3049
+ var Result;
3050
+ (function(Result2) {
3051
+ function fromThrowable2(fn2, errorFn) {
3052
+ return (...args) => {
3053
+ try {
3054
+ const result6 = fn2(...args);
3055
+ return ok(result6);
3056
+ } catch (e) {
3057
+ return err(errorFn ? errorFn(e) : e);
3058
+ }
3059
+ };
3060
+ }
3061
+ Result2.fromThrowable = fromThrowable2;
3062
+ function combine(resultList) {
3063
+ return combineResultList(resultList);
3064
+ }
3065
+ Result2.combine = combine;
3066
+ function combineWithAllErrors(resultList) {
3067
+ return combineResultListWithAllErrors(resultList);
3068
+ }
3069
+ Result2.combineWithAllErrors = combineWithAllErrors;
3070
+ })(Result || (Result = {}));
3071
+ function ok(value7) {
3072
+ return new Ok(value7);
3073
+ }
3074
+ function err(err2) {
3075
+ return new Err(err2);
3076
+ }
3077
+ var Ok = class {
3078
+ constructor(value7) {
3079
+ this.value = value7;
3080
+ }
3081
+ isOk() {
3082
+ return true;
3083
+ }
3084
+ isErr() {
3085
+ return !this.isOk();
3086
+ }
3087
+ map(f) {
3088
+ return ok(f(this.value));
3089
+ }
3090
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3091
+ mapErr(_f) {
3092
+ return ok(this.value);
3093
+ }
3094
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
3095
+ andThen(f) {
3096
+ return f(this.value);
3097
+ }
3098
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
3099
+ andThrough(f) {
3100
+ return f(this.value).map((_value2) => this.value);
3101
+ }
3102
+ andTee(f) {
3103
+ try {
3104
+ f(this.value);
3105
+ } catch (e) {
3106
+ }
3107
+ return ok(this.value);
3108
+ }
3109
+ orTee(_f) {
3110
+ return ok(this.value);
3111
+ }
3112
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
3113
+ orElse(_f) {
3114
+ return ok(this.value);
3115
+ }
3116
+ asyncAndThen(f) {
3117
+ return f(this.value);
3118
+ }
3119
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
3120
+ asyncAndThrough(f) {
3121
+ return f(this.value).map(() => this.value);
3122
+ }
3123
+ asyncMap(f) {
3124
+ return ResultAsync.fromSafePromise(f(this.value));
3125
+ }
3126
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3127
+ unwrapOr(_v) {
3128
+ return this.value;
3129
+ }
3130
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3131
+ match(ok2, _err) {
3132
+ return ok2(this.value);
3133
+ }
3134
+ safeUnwrap() {
3135
+ const value7 = this.value;
3136
+ return (function* () {
3137
+ return value7;
3138
+ })();
3139
+ }
3140
+ _unsafeUnwrap(_) {
3141
+ return this.value;
3142
+ }
3143
+ _unsafeUnwrapErr(config2) {
3144
+ throw createNeverThrowError("Called `_unsafeUnwrapErr` on an Ok", this, config2);
3145
+ }
3146
+ // eslint-disable-next-line @typescript-eslint/no-this-alias, require-yield
3147
+ *[Symbol.iterator]() {
3148
+ return this.value;
3149
+ }
3150
+ };
3151
+ var Err = class {
3152
+ constructor(error4) {
3153
+ this.error = error4;
3154
+ }
3155
+ isOk() {
3156
+ return false;
3157
+ }
3158
+ isErr() {
3159
+ return !this.isOk();
3160
+ }
3161
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3162
+ map(_f) {
3163
+ return err(this.error);
3164
+ }
3165
+ mapErr(f) {
3166
+ return err(f(this.error));
3167
+ }
3168
+ andThrough(_f) {
3169
+ return err(this.error);
3170
+ }
3171
+ andTee(_f) {
3172
+ return err(this.error);
3173
+ }
3174
+ orTee(f) {
3175
+ try {
3176
+ f(this.error);
3177
+ } catch (e) {
3178
+ }
3179
+ return err(this.error);
3180
+ }
3181
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
3182
+ andThen(_f) {
3183
+ return err(this.error);
3184
+ }
3185
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
3186
+ orElse(f) {
3187
+ return f(this.error);
3188
+ }
3189
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3190
+ asyncAndThen(_f) {
3191
+ return errAsync(this.error);
3192
+ }
3193
+ asyncAndThrough(_f) {
3194
+ return errAsync(this.error);
3195
+ }
3196
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3197
+ asyncMap(_f) {
3198
+ return errAsync(this.error);
3199
+ }
3200
+ unwrapOr(v2) {
3201
+ return v2;
3202
+ }
3203
+ match(_ok, err2) {
3204
+ return err2(this.error);
3205
+ }
3206
+ safeUnwrap() {
3207
+ const error4 = this.error;
3208
+ return (function* () {
3209
+ yield err(error4);
3210
+ throw new Error("Do not use this generator out of `safeTry`");
3211
+ })();
3212
+ }
3213
+ _unsafeUnwrap(config2) {
3214
+ throw createNeverThrowError("Called `_unsafeUnwrap` on an Err", this, config2);
3215
+ }
3216
+ _unsafeUnwrapErr(_) {
3217
+ return this.error;
3218
+ }
3219
+ *[Symbol.iterator]() {
3220
+ const self = this;
3221
+ yield self;
3222
+ return self;
3223
+ }
3224
+ };
3225
+ var fromThrowable = Result.fromThrowable;
3226
+
3227
+ // ../node_modules/mime/dist/types/standard.js
3228
+ var types = {
3229
+ "application/andrew-inset": ["ez"],
3230
+ "application/appinstaller": ["appinstaller"],
3231
+ "application/applixware": ["aw"],
3232
+ "application/appx": ["appx"],
3233
+ "application/appxbundle": ["appxbundle"],
3234
+ "application/atom+xml": ["atom"],
3235
+ "application/atomcat+xml": ["atomcat"],
3236
+ "application/atomdeleted+xml": ["atomdeleted"],
3237
+ "application/atomsvc+xml": ["atomsvc"],
3238
+ "application/atsc-dwd+xml": ["dwd"],
3239
+ "application/atsc-held+xml": ["held"],
3240
+ "application/atsc-rsat+xml": ["rsat"],
3241
+ "application/automationml-aml+xml": ["aml"],
3242
+ "application/automationml-amlx+zip": ["amlx"],
3243
+ "application/bdoc": ["bdoc"],
3244
+ "application/calendar+xml": ["xcs"],
3245
+ "application/ccxml+xml": ["ccxml"],
3246
+ "application/cdfx+xml": ["cdfx"],
3247
+ "application/cdmi-capability": ["cdmia"],
3248
+ "application/cdmi-container": ["cdmic"],
3249
+ "application/cdmi-domain": ["cdmid"],
3250
+ "application/cdmi-object": ["cdmio"],
3251
+ "application/cdmi-queue": ["cdmiq"],
3252
+ "application/cpl+xml": ["cpl"],
3253
+ "application/cu-seeme": ["cu"],
3254
+ "application/cwl": ["cwl"],
3255
+ "application/dash+xml": ["mpd"],
3256
+ "application/dash-patch+xml": ["mpp"],
3257
+ "application/davmount+xml": ["davmount"],
3258
+ "application/dicom": ["dcm"],
3259
+ "application/docbook+xml": ["dbk"],
3260
+ "application/dssc+der": ["dssc"],
3261
+ "application/dssc+xml": ["xdssc"],
3262
+ "application/ecmascript": ["ecma"],
3263
+ "application/emma+xml": ["emma"],
3264
+ "application/emotionml+xml": ["emotionml"],
3265
+ "application/epub+zip": ["epub"],
3266
+ "application/exi": ["exi"],
3267
+ "application/express": ["exp"],
3268
+ "application/fdf": ["fdf"],
3269
+ "application/fdt+xml": ["fdt"],
3270
+ "application/font-tdpfr": ["pfr"],
3271
+ "application/geo+json": ["geojson"],
3272
+ "application/gml+xml": ["gml"],
3273
+ "application/gpx+xml": ["gpx"],
3274
+ "application/gxf": ["gxf"],
3275
+ "application/gzip": ["gz"],
3276
+ "application/hjson": ["hjson"],
3277
+ "application/hyperstudio": ["stk"],
3278
+ "application/inkml+xml": ["ink", "inkml"],
3279
+ "application/ipfix": ["ipfix"],
3280
+ "application/its+xml": ["its"],
3281
+ "application/java-archive": ["jar", "war", "ear"],
3282
+ "application/java-serialized-object": ["ser"],
3283
+ "application/java-vm": ["class"],
3284
+ "application/javascript": ["*js"],
3285
+ "application/json": ["json", "map"],
3286
+ "application/json5": ["json5"],
3287
+ "application/jsonml+json": ["jsonml"],
3288
+ "application/ld+json": ["jsonld"],
3289
+ "application/lgr+xml": ["lgr"],
3290
+ "application/lost+xml": ["lostxml"],
3291
+ "application/mac-binhex40": ["hqx"],
3292
+ "application/mac-compactpro": ["cpt"],
3293
+ "application/mads+xml": ["mads"],
3294
+ "application/manifest+json": ["webmanifest"],
3295
+ "application/marc": ["mrc"],
3296
+ "application/marcxml+xml": ["mrcx"],
3297
+ "application/mathematica": ["ma", "nb", "mb"],
3298
+ "application/mathml+xml": ["mathml"],
3299
+ "application/mbox": ["mbox"],
3300
+ "application/media-policy-dataset+xml": ["mpf"],
3301
+ "application/mediaservercontrol+xml": ["mscml"],
3302
+ "application/metalink+xml": ["metalink"],
3303
+ "application/metalink4+xml": ["meta4"],
3304
+ "application/mets+xml": ["mets"],
3305
+ "application/mmt-aei+xml": ["maei"],
3306
+ "application/mmt-usd+xml": ["musd"],
3307
+ "application/mods+xml": ["mods"],
3308
+ "application/mp21": ["m21", "mp21"],
3309
+ "application/mp4": ["*mp4", "*mpg4", "mp4s", "m4p"],
3310
+ "application/msix": ["msix"],
3311
+ "application/msixbundle": ["msixbundle"],
3312
+ "application/msword": ["doc", "dot"],
3313
+ "application/mxf": ["mxf"],
3314
+ "application/n-quads": ["nq"],
3315
+ "application/n-triples": ["nt"],
3316
+ "application/node": ["cjs"],
3317
+ "application/octet-stream": [
3318
+ "bin",
3319
+ "dms",
3320
+ "lrf",
3321
+ "mar",
3322
+ "so",
3323
+ "dist",
3324
+ "distz",
3325
+ "pkg",
3326
+ "bpk",
3327
+ "dump",
3328
+ "elc",
3329
+ "deploy",
3330
+ "exe",
3331
+ "dll",
3332
+ "deb",
3333
+ "dmg",
3334
+ "iso",
3335
+ "img",
3336
+ "msi",
3337
+ "msp",
3338
+ "msm",
3339
+ "buffer"
3340
+ ],
3341
+ "application/oda": ["oda"],
3342
+ "application/oebps-package+xml": ["opf"],
3343
+ "application/ogg": ["ogx"],
3344
+ "application/omdoc+xml": ["omdoc"],
3345
+ "application/onenote": [
3346
+ "onetoc",
3347
+ "onetoc2",
3348
+ "onetmp",
3349
+ "onepkg",
3350
+ "one",
3351
+ "onea"
3352
+ ],
3353
+ "application/oxps": ["oxps"],
3354
+ "application/p2p-overlay+xml": ["relo"],
3355
+ "application/patch-ops-error+xml": ["xer"],
3356
+ "application/pdf": ["pdf"],
3357
+ "application/pgp-encrypted": ["pgp"],
3358
+ "application/pgp-keys": ["asc"],
3359
+ "application/pgp-signature": ["sig", "*asc"],
3360
+ "application/pics-rules": ["prf"],
3361
+ "application/pkcs10": ["p10"],
3362
+ "application/pkcs7-mime": ["p7m", "p7c"],
3363
+ "application/pkcs7-signature": ["p7s"],
3364
+ "application/pkcs8": ["p8"],
3365
+ "application/pkix-attr-cert": ["ac"],
3366
+ "application/pkix-cert": ["cer"],
3367
+ "application/pkix-crl": ["crl"],
3368
+ "application/pkix-pkipath": ["pkipath"],
3369
+ "application/pkixcmp": ["pki"],
3370
+ "application/pls+xml": ["pls"],
3371
+ "application/postscript": ["ai", "eps", "ps"],
3372
+ "application/provenance+xml": ["provx"],
3373
+ "application/pskc+xml": ["pskcxml"],
3374
+ "application/raml+yaml": ["raml"],
3375
+ "application/rdf+xml": ["rdf", "owl"],
3376
+ "application/reginfo+xml": ["rif"],
3377
+ "application/relax-ng-compact-syntax": ["rnc"],
3378
+ "application/resource-lists+xml": ["rl"],
3379
+ "application/resource-lists-diff+xml": ["rld"],
3380
+ "application/rls-services+xml": ["rs"],
3381
+ "application/route-apd+xml": ["rapd"],
3382
+ "application/route-s-tsid+xml": ["sls"],
3383
+ "application/route-usd+xml": ["rusd"],
3384
+ "application/rpki-ghostbusters": ["gbr"],
3385
+ "application/rpki-manifest": ["mft"],
3386
+ "application/rpki-roa": ["roa"],
3387
+ "application/rsd+xml": ["rsd"],
3388
+ "application/rss+xml": ["rss"],
3389
+ "application/rtf": ["rtf"],
3390
+ "application/sbml+xml": ["sbml"],
3391
+ "application/scvp-cv-request": ["scq"],
3392
+ "application/scvp-cv-response": ["scs"],
3393
+ "application/scvp-vp-request": ["spq"],
3394
+ "application/scvp-vp-response": ["spp"],
3395
+ "application/sdp": ["sdp"],
3396
+ "application/senml+xml": ["senmlx"],
3397
+ "application/sensml+xml": ["sensmlx"],
3398
+ "application/set-payment-initiation": ["setpay"],
3399
+ "application/set-registration-initiation": ["setreg"],
3400
+ "application/shf+xml": ["shf"],
3401
+ "application/sieve": ["siv", "sieve"],
3402
+ "application/smil+xml": ["smi", "smil"],
3403
+ "application/sparql-query": ["rq"],
3404
+ "application/sparql-results+xml": ["srx"],
3405
+ "application/sql": ["sql"],
3406
+ "application/srgs": ["gram"],
3407
+ "application/srgs+xml": ["grxml"],
3408
+ "application/sru+xml": ["sru"],
3409
+ "application/ssdl+xml": ["ssdl"],
3410
+ "application/ssml+xml": ["ssml"],
3411
+ "application/swid+xml": ["swidtag"],
3412
+ "application/tei+xml": ["tei", "teicorpus"],
3413
+ "application/thraud+xml": ["tfi"],
3414
+ "application/timestamped-data": ["tsd"],
3415
+ "application/toml": ["toml"],
3416
+ "application/trig": ["trig"],
3417
+ "application/ttml+xml": ["ttml"],
3418
+ "application/ubjson": ["ubj"],
3419
+ "application/urc-ressheet+xml": ["rsheet"],
3420
+ "application/urc-targetdesc+xml": ["td"],
3421
+ "application/voicexml+xml": ["vxml"],
3422
+ "application/wasm": ["wasm"],
3423
+ "application/watcherinfo+xml": ["wif"],
3424
+ "application/widget": ["wgt"],
3425
+ "application/winhlp": ["hlp"],
3426
+ "application/wsdl+xml": ["wsdl"],
3427
+ "application/wspolicy+xml": ["wspolicy"],
3428
+ "application/xaml+xml": ["xaml"],
3429
+ "application/xcap-att+xml": ["xav"],
3430
+ "application/xcap-caps+xml": ["xca"],
3431
+ "application/xcap-diff+xml": ["xdf"],
3432
+ "application/xcap-el+xml": ["xel"],
3433
+ "application/xcap-ns+xml": ["xns"],
3434
+ "application/xenc+xml": ["xenc"],
3435
+ "application/xfdf": ["xfdf"],
3436
+ "application/xhtml+xml": ["xhtml", "xht"],
3437
+ "application/xliff+xml": ["xlf"],
3438
+ "application/xml": ["xml", "xsl", "xsd", "rng"],
3439
+ "application/xml-dtd": ["dtd"],
3440
+ "application/xop+xml": ["xop"],
3441
+ "application/xproc+xml": ["xpl"],
3442
+ "application/xslt+xml": ["*xsl", "xslt"],
3443
+ "application/xspf+xml": ["xspf"],
3444
+ "application/xv+xml": ["mxml", "xhvml", "xvml", "xvm"],
3445
+ "application/yang": ["yang"],
3446
+ "application/yin+xml": ["yin"],
3447
+ "application/zip": ["zip"],
3448
+ "application/zip+dotlottie": ["lottie"],
3449
+ "audio/3gpp": ["*3gpp"],
3450
+ "audio/aac": ["adts", "aac"],
3451
+ "audio/adpcm": ["adp"],
3452
+ "audio/amr": ["amr"],
3453
+ "audio/basic": ["au", "snd"],
3454
+ "audio/midi": ["mid", "midi", "kar", "rmi"],
3455
+ "audio/mobile-xmf": ["mxmf"],
3456
+ "audio/mp3": ["*mp3"],
3457
+ "audio/mp4": ["m4a", "mp4a", "m4b"],
3458
+ "audio/mpeg": ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"],
3459
+ "audio/ogg": ["oga", "ogg", "spx", "opus"],
3460
+ "audio/s3m": ["s3m"],
3461
+ "audio/silk": ["sil"],
3462
+ "audio/wav": ["wav"],
3463
+ "audio/wave": ["*wav"],
3464
+ "audio/webm": ["weba"],
3465
+ "audio/xm": ["xm"],
3466
+ "font/collection": ["ttc"],
3467
+ "font/otf": ["otf"],
3468
+ "font/ttf": ["ttf"],
3469
+ "font/woff": ["woff"],
3470
+ "font/woff2": ["woff2"],
3471
+ "image/aces": ["exr"],
3472
+ "image/apng": ["apng"],
3473
+ "image/avci": ["avci"],
3474
+ "image/avcs": ["avcs"],
3475
+ "image/avif": ["avif"],
3476
+ "image/bmp": ["bmp", "dib"],
3477
+ "image/cgm": ["cgm"],
3478
+ "image/dicom-rle": ["drle"],
3479
+ "image/dpx": ["dpx"],
3480
+ "image/emf": ["emf"],
3481
+ "image/fits": ["fits"],
3482
+ "image/g3fax": ["g3"],
3483
+ "image/gif": ["gif"],
3484
+ "image/heic": ["heic"],
3485
+ "image/heic-sequence": ["heics"],
3486
+ "image/heif": ["heif"],
3487
+ "image/heif-sequence": ["heifs"],
3488
+ "image/hej2k": ["hej2"],
3489
+ "image/ief": ["ief"],
3490
+ "image/jaii": ["jaii"],
3491
+ "image/jais": ["jais"],
3492
+ "image/jls": ["jls"],
3493
+ "image/jp2": ["jp2", "jpg2"],
3494
+ "image/jpeg": ["jpg", "jpeg", "jpe"],
3495
+ "image/jph": ["jph"],
3496
+ "image/jphc": ["jhc"],
3497
+ "image/jpm": ["jpm", "jpgm"],
3498
+ "image/jpx": ["jpx", "jpf"],
3499
+ "image/jxl": ["jxl"],
3500
+ "image/jxr": ["jxr"],
3501
+ "image/jxra": ["jxra"],
3502
+ "image/jxrs": ["jxrs"],
3503
+ "image/jxs": ["jxs"],
3504
+ "image/jxsc": ["jxsc"],
3505
+ "image/jxsi": ["jxsi"],
3506
+ "image/jxss": ["jxss"],
3507
+ "image/ktx": ["ktx"],
3508
+ "image/ktx2": ["ktx2"],
3509
+ "image/pjpeg": ["jfif"],
3510
+ "image/png": ["png"],
3511
+ "image/sgi": ["sgi"],
3512
+ "image/svg+xml": ["svg", "svgz"],
3513
+ "image/t38": ["t38"],
3514
+ "image/tiff": ["tif", "tiff"],
3515
+ "image/tiff-fx": ["tfx"],
3516
+ "image/webp": ["webp"],
3517
+ "image/wmf": ["wmf"],
3518
+ "message/disposition-notification": ["disposition-notification"],
3519
+ "message/global": ["u8msg"],
3520
+ "message/global-delivery-status": ["u8dsn"],
3521
+ "message/global-disposition-notification": ["u8mdn"],
3522
+ "message/global-headers": ["u8hdr"],
3523
+ "message/rfc822": ["eml", "mime", "mht", "mhtml"],
3524
+ "model/3mf": ["3mf"],
3525
+ "model/gltf+json": ["gltf"],
3526
+ "model/gltf-binary": ["glb"],
3527
+ "model/iges": ["igs", "iges"],
3528
+ "model/jt": ["jt"],
3529
+ "model/mesh": ["msh", "mesh", "silo"],
3530
+ "model/mtl": ["mtl"],
3531
+ "model/obj": ["obj"],
3532
+ "model/prc": ["prc"],
3533
+ "model/step": ["step", "stp", "stpnc", "p21", "210"],
3534
+ "model/step+xml": ["stpx"],
3535
+ "model/step+zip": ["stpz"],
3536
+ "model/step-xml+zip": ["stpxz"],
3537
+ "model/stl": ["stl"],
3538
+ "model/u3d": ["u3d"],
3539
+ "model/vrml": ["wrl", "vrml"],
3540
+ "model/x3d+binary": ["*x3db", "x3dbz"],
3541
+ "model/x3d+fastinfoset": ["x3db"],
3542
+ "model/x3d+vrml": ["*x3dv", "x3dvz"],
3543
+ "model/x3d+xml": ["x3d", "x3dz"],
3544
+ "model/x3d-vrml": ["x3dv"],
3545
+ "text/cache-manifest": ["appcache", "manifest"],
3546
+ "text/calendar": ["ics", "ifb"],
3547
+ "text/coffeescript": ["coffee", "litcoffee"],
3548
+ "text/css": ["css"],
3549
+ "text/csv": ["csv"],
3550
+ "text/html": ["html", "htm", "shtml"],
3551
+ "text/jade": ["jade"],
3552
+ "text/javascript": ["js", "mjs"],
3553
+ "text/jsx": ["jsx"],
3554
+ "text/less": ["less"],
3555
+ "text/markdown": ["md", "markdown"],
3556
+ "text/mathml": ["mml"],
3557
+ "text/mdx": ["mdx"],
3558
+ "text/n3": ["n3"],
3559
+ "text/plain": ["txt", "text", "conf", "def", "list", "log", "in", "ini"],
3560
+ "text/richtext": ["rtx"],
3561
+ "text/rtf": ["*rtf"],
3562
+ "text/sgml": ["sgml", "sgm"],
3563
+ "text/shex": ["shex"],
3564
+ "text/slim": ["slim", "slm"],
3565
+ "text/spdx": ["spdx"],
3566
+ "text/stylus": ["stylus", "styl"],
3567
+ "text/tab-separated-values": ["tsv"],
3568
+ "text/troff": ["t", "tr", "roff", "man", "me", "ms"],
3569
+ "text/turtle": ["ttl"],
3570
+ "text/uri-list": ["uri", "uris", "urls"],
3571
+ "text/vcard": ["vcard"],
3572
+ "text/vtt": ["vtt"],
3573
+ "text/wgsl": ["wgsl"],
3574
+ "text/xml": ["*xml"],
3575
+ "text/yaml": ["yaml", "yml"],
3576
+ "video/3gpp": ["3gp", "3gpp"],
3577
+ "video/3gpp2": ["3g2"],
3578
+ "video/h261": ["h261"],
3579
+ "video/h263": ["h263"],
3580
+ "video/h264": ["h264"],
3581
+ "video/iso.segment": ["m4s"],
3582
+ "video/jpeg": ["jpgv"],
3583
+ "video/jpm": ["*jpm", "*jpgm"],
3584
+ "video/mj2": ["mj2", "mjp2"],
3585
+ "video/mp2t": ["ts", "m2t", "m2ts", "mts"],
3586
+ "video/mp4": ["mp4", "mp4v", "mpg4"],
3587
+ "video/mpeg": ["mpeg", "mpg", "mpe", "m1v", "m2v"],
3588
+ "video/ogg": ["ogv"],
3589
+ "video/quicktime": ["qt", "mov"],
3590
+ "video/webm": ["webm"]
3591
+ };
3592
+ Object.freeze(types);
3593
+ var standard_default = types;
3594
+
3595
+ // ../node_modules/mime/dist/src/Mime.js
3596
+ var __classPrivateFieldGet = function(receiver2, state2, kind2, f) {
3597
+ if (kind2 === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3598
+ if (typeof state2 === "function" ? receiver2 !== state2 || !f : !state2.has(receiver2)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
3599
+ return kind2 === "m" ? f : kind2 === "a" ? f.call(receiver2) : f ? f.value : state2.get(receiver2);
3600
+ };
3601
+ var _Mime_extensionToType;
3602
+ var _Mime_typeToExtension;
3603
+ var _Mime_typeToExtensions;
3604
+ var Mime = class {
3605
+ constructor(...args) {
3606
+ _Mime_extensionToType.set(this, /* @__PURE__ */ new Map());
3607
+ _Mime_typeToExtension.set(this, /* @__PURE__ */ new Map());
3608
+ _Mime_typeToExtensions.set(this, /* @__PURE__ */ new Map());
3609
+ for (const arg2 of args) {
3610
+ this.define(arg2);
3611
+ }
3612
+ }
3613
+ define(typeMap, force = false) {
3614
+ for (let [type5, extensions] of Object.entries(typeMap)) {
3615
+ type5 = type5.toLowerCase();
3616
+ extensions = extensions.map((ext) => ext.toLowerCase());
3617
+ if (!__classPrivateFieldGet(this, _Mime_typeToExtensions, "f").has(type5)) {
3618
+ __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").set(type5, /* @__PURE__ */ new Set());
3619
+ }
3620
+ const allExtensions = __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type5);
3621
+ let first4 = true;
3622
+ for (let extension3 of extensions) {
3623
+ const starred = extension3.startsWith("*");
3624
+ extension3 = starred ? extension3.slice(1) : extension3;
3625
+ allExtensions?.add(extension3);
3626
+ if (first4) {
3627
+ __classPrivateFieldGet(this, _Mime_typeToExtension, "f").set(type5, extension3);
3628
+ }
3629
+ first4 = false;
3630
+ if (starred)
3631
+ continue;
3632
+ const currentType = __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(extension3);
3633
+ if (currentType && currentType != type5 && !force) {
3634
+ throw new Error(`"${type5} -> ${extension3}" conflicts with "${currentType} -> ${extension3}". Pass \`force=true\` to override this definition.`);
3635
+ }
3636
+ __classPrivateFieldGet(this, _Mime_extensionToType, "f").set(extension3, type5);
3637
+ }
3638
+ }
3639
+ return this;
3640
+ }
3641
+ getType(path3) {
3642
+ if (typeof path3 !== "string")
3643
+ return null;
3644
+ const last3 = path3.replace(/^.*[/\\]/s, "").toLowerCase();
3645
+ const ext = last3.replace(/^.*\./s, "").toLowerCase();
3646
+ const hasPath = last3.length < path3.length;
3647
+ const hasDot = ext.length < last3.length - 1;
3648
+ if (!hasDot && hasPath)
3649
+ return null;
3650
+ return __classPrivateFieldGet(this, _Mime_extensionToType, "f").get(ext) ?? null;
3651
+ }
3652
+ getExtension(type5) {
3653
+ if (typeof type5 !== "string")
3654
+ return null;
3655
+ type5 = type5?.split?.(";")[0];
3656
+ return (type5 && __classPrivateFieldGet(this, _Mime_typeToExtension, "f").get(type5.trim().toLowerCase())) ?? null;
3657
+ }
3658
+ getAllExtensions(type5) {
3659
+ if (typeof type5 !== "string")
3660
+ return null;
3661
+ return __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").get(type5.toLowerCase()) ?? null;
3662
+ }
3663
+ _freeze() {
3664
+ this.define = () => {
3665
+ throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances");
3666
+ };
3667
+ Object.freeze(this);
3668
+ for (const extensions of __classPrivateFieldGet(this, _Mime_typeToExtensions, "f").values()) {
3669
+ Object.freeze(extensions);
3670
+ }
3671
+ return this;
3672
+ }
3673
+ _getTestState() {
3674
+ return {
3675
+ types: __classPrivateFieldGet(this, _Mime_extensionToType, "f"),
3676
+ extensions: __classPrivateFieldGet(this, _Mime_typeToExtension, "f")
3677
+ };
3678
+ }
3679
+ };
3680
+ _Mime_extensionToType = /* @__PURE__ */ new WeakMap(), _Mime_typeToExtension = /* @__PURE__ */ new WeakMap(), _Mime_typeToExtensions = /* @__PURE__ */ new WeakMap();
3681
+ var Mime_default = Mime;
3682
+
3683
+ // ../node_modules/mime/dist/src/index_lite.js
3684
+ var index_lite_default = new Mime_default(standard_default)._freeze();
3685
+
2734
3686
  // src/files/FileFetcher.ts
2735
3687
  var FileFetcher = class {
2736
3688
  constructor(session4) {
@@ -2768,6 +3720,42 @@ var FileFetcher = class {
2768
3720
  body: newContent
2769
3721
  });
2770
3722
  }
3723
+ createNewFile(container2, name9) {
3724
+ const encodedName = encodeURIComponent(name9);
3725
+ const url7 = container2.uri + encodedName;
3726
+ const contentTypeHeader = index_lite_default.getType(encodedName) ?? "text/turtle";
3727
+ return ResultAsync.fromPromise(
3728
+ this.session.authenticatedFetch(url7, {
3729
+ method: "PUT",
3730
+ headers: {
3731
+ "Content-Type": contentTypeHeader,
3732
+ "If-None-Match": "*"
3733
+ }
3734
+ }),
3735
+ (e) => networkProblem("The file could not be created", e)
3736
+ ).andThen(
3737
+ (response6) => response6.ok ? ok({
3738
+ url: url7,
3739
+ name: name9,
3740
+ contentType: contentTypeHeader
3741
+ }) : err(httpProblem("The file could not be created", response6))
3742
+ );
3743
+ }
3744
+ createNewFolder(container2, name9) {
3745
+ const encodedName = encodeURIComponent(name9);
3746
+ const url7 = container2.uri + encodedName + "/";
3747
+ return ResultAsync.fromPromise(
3748
+ this.session.authenticatedFetch(url7, {
3749
+ method: "PUT"
3750
+ }),
3751
+ (e) => networkProblem("The folder could not be created", e)
3752
+ ).andThen(
3753
+ (response6) => response6.ok ? ok({
3754
+ url: url7,
3755
+ name: name9
3756
+ }) : err(httpProblem("The folder could not be created", response6))
3757
+ );
3758
+ }
2771
3759
  };
2772
3760
 
2773
3761
  // src/modules/contacts.ts
@@ -2816,7 +3804,8 @@ function labelFromUri(uri6) {
2816
3804
  if (isTooGeneric(url7.hash)) {
2817
3805
  return (getFilename(url7) || url7.host + url7.pathname) + url7.hash;
2818
3806
  }
2819
- return labelFromFragment(url7.hash) || getFilename(url7) || url7.host;
3807
+ const name9 = labelFromFragment(url7.hash) || getFilename(url7) || url7.host;
3808
+ return name9.endsWith("/") ? name9.slice(0, -1) : name9;
2820
3809
  }
2821
3810
  function labelFromFragment(fragment) {
2822
3811
  return fragment ? fragment.split("#")[1] : null;
@@ -2828,9 +3817,10 @@ function isTooGeneric(fragment) {
2828
3817
  function getFilename(url7) {
2829
3818
  if (url7.pathname.endsWith("/")) {
2830
3819
  const containerName = url7.pathname.split("/").at(-2);
2831
- return containerName ? containerName + "/" : null;
3820
+ return containerName ? decodeURIComponent(containerName) + "/" : null;
2832
3821
  } else {
2833
- return url7.pathname.split("/").pop();
3822
+ const name9 = url7.pathname.split("/").pop();
3823
+ return name9 ? decodeURIComponent(name9) : null;
2834
3824
  }
2835
3825
  }
2836
3826
 
@@ -24809,10 +25799,7 @@ var LdpContainer = class extends Thing {
24809
25799
  );
24810
25800
  return contains3.map((content5) => ({
24811
25801
  uri: content5.object.value,
24812
- name: content5.object.value.replace(
24813
- new RegExp(`${this.uri}([^/]*)/?`),
24814
- "$1"
24815
- )
25802
+ name: labelFromUri(content5.object.value)
24816
25803
  }));
24817
25804
  }
24818
25805
  };
@@ -24958,8 +25945,10 @@ export {
24958
25945
  Thing,
24959
25946
  UriService,
24960
25947
  WebIdProfile,
25948
+ httpProblem,
24961
25949
  labelFromUri,
24962
- listKnownTerms
25950
+ listKnownTerms,
25951
+ networkProblem
24963
25952
  };
24964
25953
  /*! Bundled license information:
24965
25954