@stemy/ngx-utils 13.2.4 → 13.3.1

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.
@@ -342,6 +342,7 @@ var StorageMode;
342
342
  })(StorageMode || (StorageMode = {}));
343
343
  const TOASTER_SERVICE = new InjectionToken("toaster-service");
344
344
  const PROMISE_SERVICE = new InjectionToken("promise-service");
345
+ const WASI_IMPLEMENTATION = new InjectionToken("wasi-implementation");
345
346
  // --- Unordered list ---
346
347
  class UnorederedListTemplate extends TemplateRef {
347
348
  }
@@ -1174,6 +1175,51 @@ class Initializer {
1174
1175
  }
1175
1176
  }
1176
1177
 
1178
+ class JSONfn {
1179
+ static parse(text) {
1180
+ return JSON.parse(text, JSONfn.reviver);
1181
+ }
1182
+ static stringify(obj) {
1183
+ return JSON.stringify(obj, JSONfn.replacer);
1184
+ }
1185
+ static reviver(key, value) {
1186
+ const iso8061 = /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:.\d+)?(?:Z|[+-]\d\d:\d\d)$/;
1187
+ if (typeof value !== "string")
1188
+ return value;
1189
+ if (value.length < 8) {
1190
+ return value;
1191
+ }
1192
+ if (value.match(iso8061)) {
1193
+ return new Date(value);
1194
+ }
1195
+ const prefix = value.substring(0, 8);
1196
+ if (prefix === "function") {
1197
+ return new Function(`return ${value}`)();
1198
+ }
1199
+ if (prefix === "_NuFrRa_") {
1200
+ return new Function(`return ${value.slice(8)}`)();
1201
+ }
1202
+ if (prefix === "_PxEgEr_") {
1203
+ return new Function(`return ${value.slice(8)}`)();
1204
+ }
1205
+ return value;
1206
+ }
1207
+ static replacer(key, value) {
1208
+ if (value instanceof Function || typeof value === "function") {
1209
+ const fnBody = value.toString();
1210
+ if (fnBody.length < 8 || fnBody.substring(0, 8) !== "function") {
1211
+ // this is ES6 Arrow Function
1212
+ return "_NuFrRa_" + fnBody;
1213
+ }
1214
+ return fnBody;
1215
+ }
1216
+ if (value instanceof RegExp) {
1217
+ return "_PxEgEr_" + value;
1218
+ }
1219
+ return value;
1220
+ }
1221
+ }
1222
+
1177
1223
  class LoaderUtils {
1178
1224
  static loadScript(src, async = false) {
1179
1225
  this.scriptPromises[src] = this.scriptPromises[src] || new Promise((resolve, reject) => {
@@ -2061,81 +2107,103 @@ class Vector {
2061
2107
  }
2062
2108
  }
2063
2109
 
2064
- const emptyGuards = [];
2065
- class AclService {
2066
- constructor(injector, state, auth) {
2067
- this.injector = injector;
2068
- this.state = state;
2069
- this.auth = auth;
2070
- this.components = [];
2071
- this.auth.userChanged.subscribe(() => {
2072
- this.components.forEach(t => t.dirty = true);
2073
- const info = this.getStateInfo();
2074
- const check = info && info.guard instanceof AuthGuard ? info.guard.checkRoute(info.route) : Promise.resolve(true);
2075
- check.then(result => {
2076
- if (result) {
2077
- if (!info || !info.dirty)
2078
- return;
2079
- info.dirty = false;
2080
- const component = info.component;
2081
- if (!info.component)
2082
- return;
2083
- if (info.first) {
2084
- if (ObjectUtils.isFunction(component.onUserInitialized)) {
2085
- component.onUserInitialized();
2086
- }
2087
- info.first = false;
2088
- return;
2110
+ function workerFunction(JSONfn, logTimes) {
2111
+ let wasmResolve = null;
2112
+ const wasmInstance = new Promise(resolve => {
2113
+ wasmResolve = resolve;
2114
+ });
2115
+ self.onmessage = function (e) {
2116
+ const data = e.data;
2117
+ const { type, payload } = data;
2118
+ switch (type) {
2119
+ case "wasm":
2120
+ const { url, wasi } = payload;
2121
+ fetch(url).then(response => response.arrayBuffer()).then(bytes => {
2122
+ const wasiImpl = JSONfn.parse(wasi);
2123
+ return new wasiImpl().instantiate(bytes);
2124
+ }).then(instance => {
2125
+ wasmResolve(instance);
2126
+ const methods = Object.getOwnPropertyNames(instance).filter(key => typeof instance[key] === "function");
2127
+ self.postMessage({ type: "methods", payload: methods });
2128
+ });
2129
+ break;
2130
+ case "call":
2131
+ wasmInstance.then(instance => {
2132
+ const { name, id, args } = payload;
2133
+ if (logTimes) {
2134
+ console.time(id);
2135
+ console.timeLog(id, `Calling ${name} ...`);
2089
2136
  }
2090
- if (ObjectUtils.isFunction(component.onUserChanged)) {
2091
- component.onUserChanged();
2137
+ const func = instance[name];
2138
+ const result = func(...args);
2139
+ if (logTimes) {
2140
+ console.timeLog(id, `Called ${name}`);
2141
+ console.timeEnd(id);
2092
2142
  }
2093
- return;
2094
- }
2095
- info.guard.getReturnState(info.route).then(returnState => {
2096
- if (!returnState)
2097
- return;
2098
- this.state.navigate(returnState);
2143
+ self.postMessage({ type: "result", payload: { id, result } });
2099
2144
  });
2100
- });
2145
+ break;
2146
+ }
2147
+ };
2148
+ }
2149
+ class WasmWorkerProxy {
2150
+ constructor(wasmPath, wasi, logTimes = false) {
2151
+ this.methods = new Promise(resolve => {
2152
+ this.onMethods = resolve;
2101
2153
  });
2102
- this.state.subscribe(() => {
2103
- const info = this.getStateInfo();
2104
- if (!info?.component)
2105
- return;
2106
- const component = info.component;
2107
- if (ObjectUtils.isFunction(component.onUserInitialized)) {
2108
- component.onUserInitialized();
2154
+ const lt = logTimes ? "true" : "false";
2155
+ const blob = new Blob([`${JSONfn.toString()} (${workerFunction.toString()})(JSONfn, ${lt})`], { type: 'application/javascript' });
2156
+ this.worker = new Worker(URL.createObjectURL(blob));
2157
+ this.worker.postMessage({
2158
+ type: "wasm",
2159
+ payload: { url: wasmPath, wasi: JSONfn.stringify(wasi), logTimes }
2160
+ });
2161
+ this.worker.onmessage = this.onMessage.bind(this);
2162
+ this.promises = new Map();
2163
+ return new Proxy(this, {
2164
+ get: (target, prop, receiver) => {
2165
+ const res = Reflect.get(target, prop, receiver);
2166
+ if (res) {
2167
+ return res;
2168
+ }
2169
+ return (...args) => {
2170
+ return this.call(prop.toString(), args);
2171
+ };
2109
2172
  }
2110
2173
  });
2111
2174
  }
2112
- getStateInfo() {
2113
- const route = this.state.route;
2114
- if (!route)
2115
- return null;
2116
- let info = this.components.find(t => t.route == this.state.route);
2117
- if (!info) {
2118
- const guardType = (route.canActivate || emptyGuards)[0];
2119
- info = {
2120
- route: this.state.route,
2121
- guard: guardType ? this.injector.get(guardType) : null,
2122
- dirty: true,
2123
- first: true
2124
- };
2125
- this.components.push(info);
2175
+ onMessage(e) {
2176
+ const data = e.data;
2177
+ const { type, payload } = data;
2178
+ switch (type) {
2179
+ case "methods":
2180
+ this.onMethods(payload);
2181
+ break;
2182
+ case "result":
2183
+ const { id, result } = payload;
2184
+ const promise = this.promises.get(id);
2185
+ if (promise) {
2186
+ promise.resolve(result);
2187
+ this.promises.delete(id);
2188
+ }
2189
+ break;
2126
2190
  }
2127
- info.component = this.state.component;
2128
- return info;
2129
2191
  }
2130
- }
2131
- AclService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AclService, deps: [{ token: i0.Injector }, { token: StateService }, { token: AUTH_SERVICE }], target: i0.ɵɵFactoryTarget.Injectable });
2132
- AclService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AclService });
2133
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AclService, decorators: [{
2134
- type: Injectable
2135
- }], ctorParameters: function () { return [{ type: i0.Injector }, { type: StateService }, { type: undefined, decorators: [{
2136
- type: Inject,
2137
- args: [AUTH_SERVICE]
2138
- }] }]; } });
2192
+ async call(method, args) {
2193
+ const methods = await this.methods;
2194
+ if (!methods.includes(method)) {
2195
+ throw new Error(`Method ${method} not found`);
2196
+ }
2197
+ return new Promise((resolve, reject) => {
2198
+ const id = Math.random().toString(36).substring(2, 9);
2199
+ this.worker.postMessage({
2200
+ type: "call",
2201
+ payload: { name: method, id, args }
2202
+ });
2203
+ this.promises.set(id, { resolve, reject });
2204
+ });
2205
+ }
2206
+ }
2139
2207
 
2140
2208
  class BaseHttpClient extends HttpClient {
2141
2209
  constructor(handler) {
@@ -2234,6 +2302,7 @@ class BaseHttpService {
2234
2302
  this.requestHeaders = {};
2235
2303
  this.requestParams = {};
2236
2304
  this.cache = {};
2305
+ this.initService();
2237
2306
  }
2238
2307
  get name() {
2239
2308
  return "base";
@@ -2248,6 +2317,8 @@ class BaseHttpService {
2248
2317
  get universal() {
2249
2318
  return this.storage.universal;
2250
2319
  }
2320
+ initService() {
2321
+ }
2251
2322
  url(url) {
2252
2323
  return url;
2253
2324
  }
@@ -2510,6 +2581,164 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
2510
2581
  args: [EXPRESS_REQUEST]
2511
2582
  }] }]; } });
2512
2583
 
2584
+ class LocalHttpService extends BaseHttpService {
2585
+ get name() {
2586
+ return "local-http";
2587
+ }
2588
+ get withCredentials() {
2589
+ return false;
2590
+ }
2591
+ initService() {
2592
+ this.images = {};
2593
+ }
2594
+ url(url) {
2595
+ if (!url)
2596
+ return url;
2597
+ const config = this.configs.config;
2598
+ const baseUrl = config.cdnUrl || config.baseUrl || "";
2599
+ return url.startsWith("data:") || url.startsWith("http") || url.startsWith("//")
2600
+ ? url
2601
+ : `${baseUrl}${url}`;
2602
+ }
2603
+ get(url, options) {
2604
+ this.cache[url] = this.cache[url] || this.getPromise(url, options);
2605
+ return this.cache[url];
2606
+ }
2607
+ getImage(url) {
2608
+ if (this.universal.isServer)
2609
+ return Promise.resolve(null);
2610
+ if (!url)
2611
+ return Promise.resolve(new Image());
2612
+ this.images[url] = this.images[url] || new Promise((resolve, reject) => {
2613
+ const image = new Image();
2614
+ image.crossOrigin = "Anonymous";
2615
+ image.src = this.url(url);
2616
+ image.onload = () => resolve(image);
2617
+ image.onerror = reject;
2618
+ });
2619
+ return this.images[url];
2620
+ }
2621
+ }
2622
+ LocalHttpService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: LocalHttpService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
2623
+ LocalHttpService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: LocalHttpService });
2624
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: LocalHttpService, decorators: [{
2625
+ type: Injectable
2626
+ }] });
2627
+
2628
+ /**
2629
+ * Use this service to load WebAssembly modules
2630
+ */
2631
+ class WasmService {
2632
+ constructor(universal, http, wasi) {
2633
+ this.universal = universal;
2634
+ this.http = http;
2635
+ this.wasi = wasi.constructor;
2636
+ }
2637
+ async getModule(name) {
2638
+ if (!this.universal.isBrowser || !name)
2639
+ return null;
2640
+ this.modules = this.modules || {};
2641
+ this.modules[name] = this.modules[name] || this.http.get(`wasm/${name}.wasm`, {
2642
+ responseType: "arraybuffer"
2643
+ }).then(async (bytes) => {
2644
+ const wasi = new this.wasi();
2645
+ return await wasi.instantiate(bytes);
2646
+ });
2647
+ return this.modules[name];
2648
+ }
2649
+ getWorkerModule(name) {
2650
+ if (!this.universal.isBrowser || !name)
2651
+ return null;
2652
+ this.workerModules = this.workerModules || {};
2653
+ this.workerModules[name] = new WasmWorkerProxy(this.http.url(`wasm/${name}.wasm`), this.wasi);
2654
+ return this.workerModules[name];
2655
+ }
2656
+ }
2657
+ WasmService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: WasmService, deps: [{ token: UniversalService }, { token: LocalHttpService }, { token: WASI_IMPLEMENTATION }], target: i0.ɵɵFactoryTarget.Injectable });
2658
+ WasmService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: WasmService });
2659
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: WasmService, decorators: [{
2660
+ type: Injectable
2661
+ }], ctorParameters: function () { return [{ type: UniversalService }, { type: LocalHttpService }, { type: undefined, decorators: [{
2662
+ type: Inject,
2663
+ args: [WASI_IMPLEMENTATION]
2664
+ }] }]; } });
2665
+
2666
+ const emptyGuards = [];
2667
+ class AclService {
2668
+ constructor(injector, state, auth) {
2669
+ this.injector = injector;
2670
+ this.state = state;
2671
+ this.auth = auth;
2672
+ this.components = [];
2673
+ this.auth.userChanged.subscribe(() => {
2674
+ this.components.forEach(t => t.dirty = true);
2675
+ const info = this.getStateInfo();
2676
+ const check = info && info.guard instanceof AuthGuard ? info.guard.checkRoute(info.route) : Promise.resolve(true);
2677
+ check.then(result => {
2678
+ if (result) {
2679
+ if (!info || !info.dirty)
2680
+ return;
2681
+ info.dirty = false;
2682
+ const component = info.component;
2683
+ if (!info.component)
2684
+ return;
2685
+ if (info.first) {
2686
+ if (ObjectUtils.isFunction(component.onUserInitialized)) {
2687
+ component.onUserInitialized();
2688
+ }
2689
+ info.first = false;
2690
+ return;
2691
+ }
2692
+ if (ObjectUtils.isFunction(component.onUserChanged)) {
2693
+ component.onUserChanged();
2694
+ }
2695
+ return;
2696
+ }
2697
+ info.guard.getReturnState(info.route).then(returnState => {
2698
+ if (!returnState)
2699
+ return;
2700
+ this.state.navigate(returnState);
2701
+ });
2702
+ });
2703
+ });
2704
+ this.state.subscribe(() => {
2705
+ const info = this.getStateInfo();
2706
+ if (!info?.component)
2707
+ return;
2708
+ const component = info.component;
2709
+ if (ObjectUtils.isFunction(component.onUserInitialized)) {
2710
+ component.onUserInitialized();
2711
+ }
2712
+ });
2713
+ }
2714
+ getStateInfo() {
2715
+ const route = this.state.route;
2716
+ if (!route)
2717
+ return null;
2718
+ let info = this.components.find(t => t.route == this.state.route);
2719
+ if (!info) {
2720
+ const guardType = (route.canActivate || emptyGuards)[0];
2721
+ info = {
2722
+ route: this.state.route,
2723
+ guard: guardType ? this.injector.get(guardType) : null,
2724
+ dirty: true,
2725
+ first: true
2726
+ };
2727
+ this.components.push(info);
2728
+ }
2729
+ info.component = this.state.component;
2730
+ return info;
2731
+ }
2732
+ }
2733
+ AclService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AclService, deps: [{ token: i0.Injector }, { token: StateService }, { token: AUTH_SERVICE }], target: i0.ɵɵFactoryTarget.Injectable });
2734
+ AclService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AclService });
2735
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: AclService, decorators: [{
2736
+ type: Injectable
2737
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: StateService }, { type: undefined, decorators: [{
2738
+ type: Inject,
2739
+ args: [AUTH_SERVICE]
2740
+ }] }]; } });
2741
+
2513
2742
  class ApiService extends BaseHttpService {
2514
2743
  get name() {
2515
2744
  return "api";
@@ -5059,6 +5288,7 @@ const providers = [
5059
5288
  GlobalTemplateService,
5060
5289
  IconService,
5061
5290
  LanguageService,
5291
+ LocalHttpService,
5062
5292
  OpenApiService,
5063
5293
  PromiseService,
5064
5294
  StateService,
@@ -5067,6 +5297,7 @@ const providers = [
5067
5297
  ConsoleToasterService,
5068
5298
  TranslatedUrlSerializer,
5069
5299
  UniversalService,
5300
+ WasmService,
5070
5301
  DeviceDetectorService,
5071
5302
  {
5072
5303
  provide: EVENT_MANAGER_PLUGINS,
@@ -5091,6 +5322,163 @@ function loadConfig(config) {
5091
5322
  return config.load;
5092
5323
  }
5093
5324
 
5325
+ class Wasi {
5326
+ constructor() {
5327
+ this.env = {};
5328
+ this.instantiated = false;
5329
+ this.wasi = [
5330
+ "emscripten_notify_memory_growth",
5331
+ "proc_exit",
5332
+ "environ_get",
5333
+ "environ_sizes_get",
5334
+ "fd_close",
5335
+ "fd_write",
5336
+ "fd_read",
5337
+ "fd_seek",
5338
+ ].reduce((res, key) => {
5339
+ if (typeof this[key] === "function") {
5340
+ res[key] = this[key].bind(this);
5341
+ }
5342
+ return res;
5343
+ }, {});
5344
+ }
5345
+ instantiate(bytes) {
5346
+ if (this.instantiated) {
5347
+ throw new Error("WASI already instantiated");
5348
+ }
5349
+ this.instantiated = true;
5350
+ return WebAssembly.instantiate(bytes, {
5351
+ wasi_snapshot_preview1: this.wasi,
5352
+ env: this.wasi
5353
+ }).then(module => {
5354
+ const exports = module.instance.exports;
5355
+ this.wasm = {
5356
+ ...exports,
5357
+ writeArrayToMemory: (array) => {
5358
+ const bytes = array.length * array.BYTES_PER_ELEMENT;
5359
+ const pointer = exports.malloc(bytes);
5360
+ const ctr = array.constructor;
5361
+ const heapArray = new ctr(this.wasm.memory.buffer, pointer, array.length);
5362
+ heapArray.set(array);
5363
+ return pointer;
5364
+ },
5365
+ readArrayFromMemory: (pointer, array) => {
5366
+ const ctr = array.constructor;
5367
+ const heapArray = new ctr(this.wasm.memory.buffer, pointer, array.length);
5368
+ array.set(heapArray);
5369
+ return array;
5370
+ }
5371
+ };
5372
+ this.updateMemoryViews();
5373
+ return this.wasm;
5374
+ });
5375
+ }
5376
+ updateMemoryViews() {
5377
+ const buffer = this.wasm.memory.buffer;
5378
+ this.wasm.HEAP8 = new Int8Array(buffer);
5379
+ this.wasm.HEAP16 = new Int16Array(buffer);
5380
+ this.wasm.HEAP32 = new Int32Array(buffer);
5381
+ this.wasm.HEAPU8 = new Uint8Array(buffer);
5382
+ this.wasm.HEAPU16 = new Uint16Array(buffer);
5383
+ this.wasm.HEAPU32 = new Uint32Array(buffer);
5384
+ this.wasm.HEAPF32 = new Float32Array(buffer);
5385
+ this.wasm.HEAPF64 = new Float64Array(buffer);
5386
+ }
5387
+ getEnvStrings() {
5388
+ if (!this.envStrings) {
5389
+ let x;
5390
+ const env = {};
5391
+ for (x in this.env) {
5392
+ if (this.env[x] === undefined)
5393
+ delete env[x];
5394
+ else
5395
+ env[x] = this.env[x];
5396
+ }
5397
+ const strings = [];
5398
+ for (x in env) {
5399
+ strings.push(x + "=" + env[x]);
5400
+ }
5401
+ this.envStrings = strings;
5402
+ }
5403
+ return this.envStrings;
5404
+ }
5405
+ stringToAscii(str, buffer) {
5406
+ const HEAP8 = this.wasm.HEAP8;
5407
+ for (let i = 0; i < str.length; ++i) {
5408
+ HEAP8[buffer++ >> 0] = str.charCodeAt(i);
5409
+ }
5410
+ HEAP8[buffer >> 0] = 0;
5411
+ }
5412
+ emscripten_notify_memory_growth(memoryIndex) {
5413
+ this.updateMemoryViews();
5414
+ }
5415
+ proc_exit(rval) {
5416
+ console.log("proc_exit", rval);
5417
+ }
5418
+ environ_get(environ, environ_buf) {
5419
+ if (!this.wasm.HEAP8.byteLength) {
5420
+ this.emscripten_notify_memory_growth(0);
5421
+ }
5422
+ const HEAPU32 = this.wasm.HEAPU32;
5423
+ let bufSize = 0;
5424
+ this.getEnvStrings().forEach((str, i) => {
5425
+ const ptr = environ_buf + bufSize;
5426
+ HEAPU32[environ + i * 4 >> 2] = ptr;
5427
+ this.stringToAscii(str, ptr);
5428
+ bufSize += str.length + 1;
5429
+ });
5430
+ return 0;
5431
+ }
5432
+ environ_sizes_get(penviron_count, penviron_buf_size) {
5433
+ if (!this.wasm.HEAP8.byteLength) {
5434
+ this.emscripten_notify_memory_growth(0);
5435
+ }
5436
+ const HEAPU32 = this.wasm.HEAPU32;
5437
+ const strings = this.getEnvStrings();
5438
+ HEAPU32[penviron_count >> 2] = strings.length;
5439
+ let bufSize = 0;
5440
+ strings.forEach(function (string) {
5441
+ bufSize += string.length + 1;
5442
+ });
5443
+ HEAPU32[penviron_buf_size >> 2] = bufSize;
5444
+ // WASI_ESUCCESS
5445
+ return 0;
5446
+ }
5447
+ fd_close(fd) {
5448
+ // WASI_ESUCCESS
5449
+ return 0;
5450
+ }
5451
+ fd_write(fd, iovs, iovs_len, nwritten) {
5452
+ if (fd !== 1) {
5453
+ // WASI_EBADF
5454
+ return 8;
5455
+ }
5456
+ if (iovs_len !== 1) {
5457
+ // WASI_ENOSYS
5458
+ return 52;
5459
+ }
5460
+ this.wasm.HEAPU32[nwritten >> 2] = this.wasm.HEAPU32[iovs + 4 >> 2];
5461
+ // WASI_ESUCCESS
5462
+ return 0;
5463
+ }
5464
+ fd_read(fd, iovs, iovs_len, nread) {
5465
+ // WASI_EINVAL
5466
+ return 28;
5467
+ }
5468
+ fd_seek(fd, offset, whence, newOffset) {
5469
+ // WASI_EINVAL
5470
+ return 28;
5471
+ }
5472
+ }
5473
+ Wasi.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: Wasi, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
5474
+ Wasi.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: Wasi, providedIn: "root" });
5475
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: Wasi, decorators: [{
5476
+ type: Injectable,
5477
+ args: [{
5478
+ providedIn: "root"
5479
+ }]
5480
+ }], ctorParameters: function () { return []; } });
5481
+
5094
5482
  function loadBaseUrl() {
5095
5483
  if (typeof (document) === "undefined" || typeof (location) === "undefined")
5096
5484
  return "/";
@@ -5161,6 +5549,10 @@ class NgxUtilsModule {
5161
5549
  provide: GLOBAL_TEMPLATES,
5162
5550
  useExisting: (!config ? null : config.globalTemplates) || GlobalTemplateService
5163
5551
  },
5552
+ {
5553
+ provide: WASI_IMPLEMENTATION,
5554
+ useExisting: (!config ? null : config.wasiImplementation) || Wasi
5555
+ },
5164
5556
  {
5165
5557
  provide: APP_BASE_URL,
5166
5558
  useFactory: (!config ? null : config.baseUrl) || loadBaseUrl,
@@ -5218,5 +5610,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
5218
5610
  * Generated bundle index. Do not edit.
5219
5611
  */
5220
5612
 
5221
- export { API_SERVICE, APP_BASE_URL, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodBase, AsyncMethodDirective, AuthGuard, BASE_CONFIG, BackgroundDirective, BaseHttpClient, BaseHttpService, CONFIG_SERVICE, CanvasColor, CanvasUtils, ChunkPipe, Circle, ConfigService, ConsoleToasterService, DateUtils, DynamicTableComponent, DynamicTableTemplateDirective, ERROR_HANDLER, EXPRESS_REQUEST, EntriesPipe, ErrorHandlerService, EventsService, ExtraItemPropertiesPipe, FactoryDependencies, FileSystemEntry, FileUtils, FilterPipe, FindPipe, FormatNumberPipe, FormatterService, GLOBAL_TEMPLATES, GenericValue, GetOffsetPipe, GetTypePipe, GlobalTemplateDirective, GlobalTemplatePipe, GlobalTemplateService, GroupByPipe, HttpPromise, ICON_SERVICE, IConfiguration, IconDirective, IconService, Initializer, IsTypePipe, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, ObjectUtils, ObservableUtils, OpenApiService, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PopPipe, PromiseService, ROOT_ELEMENT, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, SCRIPT_PARAMS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, ShiftPipe, SplitPipe, StateService, StaticAuthService, StaticLanguageService, StickyClassDirective, StickyDirective, StorageMode, StorageService, StringUtils, TOASTER_SERVICE, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, UnorederedListTemplate, ValuedPromise, ValuesPipe, Vector };
5613
+ export { API_SERVICE, APP_BASE_URL, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodBase, AsyncMethodDirective, AuthGuard, BASE_CONFIG, BackgroundDirective, BaseHttpClient, BaseHttpService, CONFIG_SERVICE, CanvasColor, CanvasUtils, ChunkPipe, Circle, ConfigService, ConsoleToasterService, DateUtils, DynamicTableComponent, DynamicTableTemplateDirective, ERROR_HANDLER, EXPRESS_REQUEST, EntriesPipe, ErrorHandlerService, EventsService, ExtraItemPropertiesPipe, FactoryDependencies, FileSystemEntry, FileUtils, FilterPipe, FindPipe, FormatNumberPipe, FormatterService, GLOBAL_TEMPLATES, GenericValue, GetOffsetPipe, GetTypePipe, GlobalTemplateDirective, GlobalTemplatePipe, GlobalTemplateService, GroupByPipe, HttpPromise, ICON_SERVICE, IConfiguration, IconDirective, IconService, Initializer, IsTypePipe, JSONfn, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, LocalHttpService, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, ObjectUtils, ObservableUtils, OpenApiService, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PopPipe, PromiseService, ROOT_ELEMENT, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, SCRIPT_PARAMS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, ShiftPipe, SplitPipe, StateService, StaticAuthService, StaticLanguageService, StickyClassDirective, StickyDirective, StorageMode, StorageService, StringUtils, TOASTER_SERVICE, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, UnorederedListTemplate, ValuedPromise, ValuesPipe, Vector, WASI_IMPLEMENTATION, WasmService };
5222
5614
  //# sourceMappingURL=stemy-ngx-utils.mjs.map