thrust-wasm 0.2.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.
@@ -0,0 +1,1022 @@
1
+
2
+ let imports = {};
3
+ imports['__wbindgen_placeholder__'] = module.exports;
4
+
5
+ let cachedUint8ArrayMemory0 = null;
6
+
7
+ function getUint8ArrayMemory0() {
8
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
9
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
10
+ }
11
+ return cachedUint8ArrayMemory0;
12
+ }
13
+
14
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
15
+
16
+ cachedTextDecoder.decode();
17
+
18
+ function decodeText(ptr, len) {
19
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
20
+ }
21
+
22
+ function getStringFromWasm0(ptr, len) {
23
+ ptr = ptr >>> 0;
24
+ return decodeText(ptr, len);
25
+ }
26
+
27
+ let WASM_VECTOR_LEN = 0;
28
+
29
+ const cachedTextEncoder = new TextEncoder();
30
+
31
+ if (!('encodeInto' in cachedTextEncoder)) {
32
+ cachedTextEncoder.encodeInto = function (arg, view) {
33
+ const buf = cachedTextEncoder.encode(arg);
34
+ view.set(buf);
35
+ return {
36
+ read: arg.length,
37
+ written: buf.length
38
+ };
39
+ }
40
+ }
41
+
42
+ function passStringToWasm0(arg, malloc, realloc) {
43
+
44
+ if (realloc === undefined) {
45
+ const buf = cachedTextEncoder.encode(arg);
46
+ const ptr = malloc(buf.length, 1) >>> 0;
47
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
48
+ WASM_VECTOR_LEN = buf.length;
49
+ return ptr;
50
+ }
51
+
52
+ let len = arg.length;
53
+ let ptr = malloc(len, 1) >>> 0;
54
+
55
+ const mem = getUint8ArrayMemory0();
56
+
57
+ let offset = 0;
58
+
59
+ for (; offset < len; offset++) {
60
+ const code = arg.charCodeAt(offset);
61
+ if (code > 0x7F) break;
62
+ mem[ptr + offset] = code;
63
+ }
64
+
65
+ if (offset !== len) {
66
+ if (offset !== 0) {
67
+ arg = arg.slice(offset);
68
+ }
69
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
70
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
71
+ const ret = cachedTextEncoder.encodeInto(arg, view);
72
+
73
+ offset += ret.written;
74
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
75
+ }
76
+
77
+ WASM_VECTOR_LEN = offset;
78
+ return ptr;
79
+ }
80
+
81
+ let cachedDataViewMemory0 = null;
82
+
83
+ function getDataViewMemory0() {
84
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
85
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
86
+ }
87
+ return cachedDataViewMemory0;
88
+ }
89
+
90
+ function isLikeNone(x) {
91
+ return x === undefined || x === null;
92
+ }
93
+
94
+ function debugString(val) {
95
+ // primitive types
96
+ const type = typeof val;
97
+ if (type == 'number' || type == 'boolean' || val == null) {
98
+ return `${val}`;
99
+ }
100
+ if (type == 'string') {
101
+ return `"${val}"`;
102
+ }
103
+ if (type == 'symbol') {
104
+ const description = val.description;
105
+ if (description == null) {
106
+ return 'Symbol';
107
+ } else {
108
+ return `Symbol(${description})`;
109
+ }
110
+ }
111
+ if (type == 'function') {
112
+ const name = val.name;
113
+ if (typeof name == 'string' && name.length > 0) {
114
+ return `Function(${name})`;
115
+ } else {
116
+ return 'Function';
117
+ }
118
+ }
119
+ // objects
120
+ if (Array.isArray(val)) {
121
+ const length = val.length;
122
+ let debug = '[';
123
+ if (length > 0) {
124
+ debug += debugString(val[0]);
125
+ }
126
+ for(let i = 1; i < length; i++) {
127
+ debug += ', ' + debugString(val[i]);
128
+ }
129
+ debug += ']';
130
+ return debug;
131
+ }
132
+ // Test for built-in
133
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
134
+ let className;
135
+ if (builtInMatches && builtInMatches.length > 1) {
136
+ className = builtInMatches[1];
137
+ } else {
138
+ // Failed to match the standard '[object ClassName]'
139
+ return toString.call(val);
140
+ }
141
+ if (className == 'Object') {
142
+ // we're a user defined class or Object
143
+ // JSON.stringify avoids problems with cycles, and is generally much
144
+ // easier than looping through ownProperties of `val`.
145
+ try {
146
+ return 'Object(' + JSON.stringify(val) + ')';
147
+ } catch (_) {
148
+ return 'Object';
149
+ }
150
+ }
151
+ // errors
152
+ if (val instanceof Error) {
153
+ return `${val.name}: ${val.message}\n${val.stack}`;
154
+ }
155
+ // TODO we could test for more things here, like `Set`s and `Map`s.
156
+ return className;
157
+ }
158
+
159
+ function addToExternrefTable0(obj) {
160
+ const idx = wasm.__externref_table_alloc();
161
+ wasm.__wbindgen_externrefs.set(idx, obj);
162
+ return idx;
163
+ }
164
+
165
+ function handleError(f, args) {
166
+ try {
167
+ return f.apply(this, args);
168
+ } catch (e) {
169
+ const idx = addToExternrefTable0(e);
170
+ wasm.__wbindgen_exn_store(idx);
171
+ }
172
+ }
173
+
174
+ function getArrayU8FromWasm0(ptr, len) {
175
+ ptr = ptr >>> 0;
176
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
177
+ }
178
+
179
+ function takeFromExternrefTable0(idx) {
180
+ const value = wasm.__wbindgen_externrefs.get(idx);
181
+ wasm.__externref_table_dealloc(idx);
182
+ return value;
183
+ }
184
+
185
+ function passArray8ToWasm0(arg, malloc) {
186
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
187
+ getUint8ArrayMemory0().set(arg, ptr / 1);
188
+ WASM_VECTOR_LEN = arg.length;
189
+ return ptr;
190
+ }
191
+ /**
192
+ * @param {string} date
193
+ * @returns {string}
194
+ */
195
+ exports.airac_code_from_date = function(date) {
196
+ let deferred3_0;
197
+ let deferred3_1;
198
+ try {
199
+ const ptr0 = passStringToWasm0(date, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
200
+ const len0 = WASM_VECTOR_LEN;
201
+ const ret = wasm.airac_code_from_date(ptr0, len0);
202
+ var ptr2 = ret[0];
203
+ var len2 = ret[1];
204
+ if (ret[3]) {
205
+ ptr2 = 0; len2 = 0;
206
+ throw takeFromExternrefTable0(ret[2]);
207
+ }
208
+ deferred3_0 = ptr2;
209
+ deferred3_1 = len2;
210
+ return getStringFromWasm0(ptr2, len2);
211
+ } finally {
212
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
213
+ }
214
+ };
215
+
216
+ /**
217
+ * @param {string} airac_code
218
+ * @returns {any}
219
+ */
220
+ exports.airac_interval = function(airac_code) {
221
+ const ptr0 = passStringToWasm0(airac_code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
222
+ const len0 = WASM_VECTOR_LEN;
223
+ const ret = wasm.airac_interval(ptr0, len0);
224
+ if (ret[2]) {
225
+ throw takeFromExternrefTable0(ret[1]);
226
+ }
227
+ return takeFromExternrefTable0(ret[0]);
228
+ };
229
+
230
+ /**
231
+ * @param {string} airac_code
232
+ * @returns {string}
233
+ */
234
+ exports.effective_date_from_airac_code = function(airac_code) {
235
+ let deferred3_0;
236
+ let deferred3_1;
237
+ try {
238
+ const ptr0 = passStringToWasm0(airac_code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
239
+ const len0 = WASM_VECTOR_LEN;
240
+ const ret = wasm.effective_date_from_airac_code(ptr0, len0);
241
+ var ptr2 = ret[0];
242
+ var len2 = ret[1];
243
+ if (ret[3]) {
244
+ ptr2 = 0; len2 = 0;
245
+ throw takeFromExternrefTable0(ret[2]);
246
+ }
247
+ deferred3_0 = ptr2;
248
+ deferred3_1 = len2;
249
+ return getStringFromWasm0(ptr2, len2);
250
+ } finally {
251
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
252
+ }
253
+ };
254
+
255
+ exports.run = function() {
256
+ const ret = wasm.run();
257
+ if (ret[1]) {
258
+ throw takeFromExternrefTable0(ret[0]);
259
+ }
260
+ };
261
+
262
+ /**
263
+ * @returns {string}
264
+ */
265
+ exports.wasm_build_profile = function() {
266
+ let deferred1_0;
267
+ let deferred1_1;
268
+ try {
269
+ const ret = wasm.wasm_build_profile();
270
+ deferred1_0 = ret[0];
271
+ deferred1_1 = ret[1];
272
+ return getStringFromWasm0(ret[0], ret[1]);
273
+ } finally {
274
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
275
+ }
276
+ };
277
+
278
+ const EurocontrolResolverFinalization = (typeof FinalizationRegistry === 'undefined')
279
+ ? { register: () => {}, unregister: () => {} }
280
+ : new FinalizationRegistry(ptr => wasm.__wbg_eurocontrolresolver_free(ptr >>> 0, 1));
281
+
282
+ class EurocontrolResolver {
283
+
284
+ static __wrap(ptr) {
285
+ ptr = ptr >>> 0;
286
+ const obj = Object.create(EurocontrolResolver.prototype);
287
+ obj.__wbg_ptr = ptr;
288
+ EurocontrolResolverFinalization.register(obj, obj.__wbg_ptr, obj);
289
+ return obj;
290
+ }
291
+
292
+ __destroy_into_raw() {
293
+ const ptr = this.__wbg_ptr;
294
+ this.__wbg_ptr = 0;
295
+ EurocontrolResolverFinalization.unregister(this);
296
+ return ptr;
297
+ }
298
+
299
+ free() {
300
+ const ptr = this.__destroy_into_raw();
301
+ wasm.__wbg_eurocontrolresolver_free(ptr, 0);
302
+ }
303
+ /**
304
+ * @param {string} code
305
+ * @returns {any}
306
+ */
307
+ resolve_fix(code) {
308
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
309
+ const len0 = WASM_VECTOR_LEN;
310
+ const ret = wasm.eurocontrolresolver_resolve_fix(this.__wbg_ptr, ptr0, len0);
311
+ if (ret[2]) {
312
+ throw takeFromExternrefTable0(ret[1]);
313
+ }
314
+ return takeFromExternrefTable0(ret[0]);
315
+ }
316
+ /**
317
+ * @param {string} name
318
+ * @returns {any}
319
+ */
320
+ resolve_airway(name) {
321
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
322
+ const len0 = WASM_VECTOR_LEN;
323
+ const ret = wasm.eurocontrolresolver_resolve_airway(this.__wbg_ptr, ptr0, len0);
324
+ if (ret[2]) {
325
+ throw takeFromExternrefTable0(ret[1]);
326
+ }
327
+ return takeFromExternrefTable0(ret[0]);
328
+ }
329
+ /**
330
+ * @param {string} code
331
+ * @returns {any}
332
+ */
333
+ resolve_navaid(code) {
334
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
335
+ const len0 = WASM_VECTOR_LEN;
336
+ const ret = wasm.eurocontrolresolver_resolve_navaid(this.__wbg_ptr, ptr0, len0);
337
+ if (ret[2]) {
338
+ throw takeFromExternrefTable0(ret[1]);
339
+ }
340
+ return takeFromExternrefTable0(ret[0]);
341
+ }
342
+ /**
343
+ * @param {any} ddr_folder
344
+ * @returns {EurocontrolResolver}
345
+ */
346
+ static fromDdrFolder(ddr_folder) {
347
+ const ret = wasm.eurocontrolresolver_fromDdrFolder(ddr_folder);
348
+ if (ret[2]) {
349
+ throw takeFromExternrefTable0(ret[1]);
350
+ }
351
+ return EurocontrolResolver.__wrap(ret[0]);
352
+ }
353
+ /**
354
+ * @param {string} code
355
+ * @returns {any}
356
+ */
357
+ resolve_airport(code) {
358
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
359
+ const len0 = WASM_VECTOR_LEN;
360
+ const ret = wasm.eurocontrolresolver_resolve_airport(this.__wbg_ptr, ptr0, len0);
361
+ if (ret[2]) {
362
+ throw takeFromExternrefTable0(ret[1]);
363
+ }
364
+ return takeFromExternrefTable0(ret[0]);
365
+ }
366
+ /**
367
+ * @param {Uint8Array} ddr_archive
368
+ * @returns {EurocontrolResolver}
369
+ */
370
+ static fromDdrArchive(ddr_archive) {
371
+ const ptr0 = passArray8ToWasm0(ddr_archive, wasm.__wbindgen_malloc);
372
+ const len0 = WASM_VECTOR_LEN;
373
+ const ret = wasm.eurocontrolresolver_fromDdrArchive(ptr0, len0);
374
+ if (ret[2]) {
375
+ throw takeFromExternrefTable0(ret[1]);
376
+ }
377
+ return EurocontrolResolver.__wrap(ret[0]);
378
+ }
379
+ /**
380
+ * @param {any} aixm_folder
381
+ */
382
+ constructor(aixm_folder) {
383
+ const ret = wasm.eurocontrolresolver_new(aixm_folder);
384
+ if (ret[2]) {
385
+ throw takeFromExternrefTable0(ret[1]);
386
+ }
387
+ this.__wbg_ptr = ret[0] >>> 0;
388
+ EurocontrolResolverFinalization.register(this, this.__wbg_ptr, this);
389
+ return this;
390
+ }
391
+ /**
392
+ * @returns {any}
393
+ */
394
+ fixes() {
395
+ const ret = wasm.eurocontrolresolver_fixes(this.__wbg_ptr);
396
+ if (ret[2]) {
397
+ throw takeFromExternrefTable0(ret[1]);
398
+ }
399
+ return takeFromExternrefTable0(ret[0]);
400
+ }
401
+ /**
402
+ * @returns {any}
403
+ */
404
+ airways() {
405
+ const ret = wasm.eurocontrolresolver_airways(this.__wbg_ptr);
406
+ if (ret[2]) {
407
+ throw takeFromExternrefTable0(ret[1]);
408
+ }
409
+ return takeFromExternrefTable0(ret[0]);
410
+ }
411
+ /**
412
+ * @returns {any}
413
+ */
414
+ navaids() {
415
+ const ret = wasm.eurocontrolresolver_navaids(this.__wbg_ptr);
416
+ if (ret[2]) {
417
+ throw takeFromExternrefTable0(ret[1]);
418
+ }
419
+ return takeFromExternrefTable0(ret[0]);
420
+ }
421
+ /**
422
+ * @returns {any}
423
+ */
424
+ airports() {
425
+ const ret = wasm.eurocontrolresolver_airports(this.__wbg_ptr);
426
+ if (ret[2]) {
427
+ throw takeFromExternrefTable0(ret[1]);
428
+ }
429
+ return takeFromExternrefTable0(ret[0]);
430
+ }
431
+ }
432
+ if (Symbol.dispose) EurocontrolResolver.prototype[Symbol.dispose] = EurocontrolResolver.prototype.free;
433
+
434
+ exports.EurocontrolResolver = EurocontrolResolver;
435
+
436
+ const FaaArcgisResolverFinalization = (typeof FinalizationRegistry === 'undefined')
437
+ ? { register: () => {}, unregister: () => {} }
438
+ : new FinalizationRegistry(ptr => wasm.__wbg_faaarcgisresolver_free(ptr >>> 0, 1));
439
+
440
+ class FaaArcgisResolver {
441
+
442
+ __destroy_into_raw() {
443
+ const ptr = this.__wbg_ptr;
444
+ this.__wbg_ptr = 0;
445
+ FaaArcgisResolverFinalization.unregister(this);
446
+ return ptr;
447
+ }
448
+
449
+ free() {
450
+ const ptr = this.__destroy_into_raw();
451
+ wasm.__wbg_faaarcgisresolver_free(ptr, 0);
452
+ }
453
+ /**
454
+ * @param {string} code
455
+ * @returns {any}
456
+ */
457
+ resolve_fix(code) {
458
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
459
+ const len0 = WASM_VECTOR_LEN;
460
+ const ret = wasm.faaarcgisresolver_resolve_fix(this.__wbg_ptr, ptr0, len0);
461
+ if (ret[2]) {
462
+ throw takeFromExternrefTable0(ret[1]);
463
+ }
464
+ return takeFromExternrefTable0(ret[0]);
465
+ }
466
+ /**
467
+ * @param {string} name
468
+ * @returns {any}
469
+ */
470
+ resolve_airway(name) {
471
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
472
+ const len0 = WASM_VECTOR_LEN;
473
+ const ret = wasm.faaarcgisresolver_resolve_airway(this.__wbg_ptr, ptr0, len0);
474
+ if (ret[2]) {
475
+ throw takeFromExternrefTable0(ret[1]);
476
+ }
477
+ return takeFromExternrefTable0(ret[0]);
478
+ }
479
+ /**
480
+ * @param {string} code
481
+ * @returns {any}
482
+ */
483
+ resolve_navaid(code) {
484
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
485
+ const len0 = WASM_VECTOR_LEN;
486
+ const ret = wasm.faaarcgisresolver_resolve_navaid(this.__wbg_ptr, ptr0, len0);
487
+ if (ret[2]) {
488
+ throw takeFromExternrefTable0(ret[1]);
489
+ }
490
+ return takeFromExternrefTable0(ret[0]);
491
+ }
492
+ /**
493
+ * @param {string} code
494
+ * @returns {any}
495
+ */
496
+ resolve_airport(code) {
497
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
498
+ const len0 = WASM_VECTOR_LEN;
499
+ const ret = wasm.faaarcgisresolver_resolve_airport(this.__wbg_ptr, ptr0, len0);
500
+ if (ret[2]) {
501
+ throw takeFromExternrefTable0(ret[1]);
502
+ }
503
+ return takeFromExternrefTable0(ret[0]);
504
+ }
505
+ /**
506
+ * @param {string} designator
507
+ * @returns {any}
508
+ */
509
+ resolve_airspace(designator) {
510
+ const ptr0 = passStringToWasm0(designator, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
511
+ const len0 = WASM_VECTOR_LEN;
512
+ const ret = wasm.faaarcgisresolver_resolve_airspace(this.__wbg_ptr, ptr0, len0);
513
+ if (ret[2]) {
514
+ throw takeFromExternrefTable0(ret[1]);
515
+ }
516
+ return takeFromExternrefTable0(ret[0]);
517
+ }
518
+ /**
519
+ * @param {any} feature_collections_json
520
+ */
521
+ constructor(feature_collections_json) {
522
+ const ret = wasm.faaarcgisresolver_new(feature_collections_json);
523
+ if (ret[2]) {
524
+ throw takeFromExternrefTable0(ret[1]);
525
+ }
526
+ this.__wbg_ptr = ret[0] >>> 0;
527
+ FaaArcgisResolverFinalization.register(this, this.__wbg_ptr, this);
528
+ return this;
529
+ }
530
+ /**
531
+ * @returns {any}
532
+ */
533
+ fixes() {
534
+ const ret = wasm.faaarcgisresolver_fixes(this.__wbg_ptr);
535
+ if (ret[2]) {
536
+ throw takeFromExternrefTable0(ret[1]);
537
+ }
538
+ return takeFromExternrefTable0(ret[0]);
539
+ }
540
+ /**
541
+ * @returns {any}
542
+ */
543
+ airways() {
544
+ const ret = wasm.faaarcgisresolver_airways(this.__wbg_ptr);
545
+ if (ret[2]) {
546
+ throw takeFromExternrefTable0(ret[1]);
547
+ }
548
+ return takeFromExternrefTable0(ret[0]);
549
+ }
550
+ /**
551
+ * @returns {any}
552
+ */
553
+ navaids() {
554
+ const ret = wasm.faaarcgisresolver_navaids(this.__wbg_ptr);
555
+ if (ret[2]) {
556
+ throw takeFromExternrefTable0(ret[1]);
557
+ }
558
+ return takeFromExternrefTable0(ret[0]);
559
+ }
560
+ /**
561
+ * @returns {any}
562
+ */
563
+ airports() {
564
+ const ret = wasm.faaarcgisresolver_airports(this.__wbg_ptr);
565
+ if (ret[2]) {
566
+ throw takeFromExternrefTable0(ret[1]);
567
+ }
568
+ return takeFromExternrefTable0(ret[0]);
569
+ }
570
+ /**
571
+ * @returns {any}
572
+ */
573
+ airspaces() {
574
+ const ret = wasm.faaarcgisresolver_airspaces(this.__wbg_ptr);
575
+ if (ret[2]) {
576
+ throw takeFromExternrefTable0(ret[1]);
577
+ }
578
+ return takeFromExternrefTable0(ret[0]);
579
+ }
580
+ }
581
+ if (Symbol.dispose) FaaArcgisResolver.prototype[Symbol.dispose] = FaaArcgisResolver.prototype.free;
582
+
583
+ exports.FaaArcgisResolver = FaaArcgisResolver;
584
+
585
+ const NasrResolverFinalization = (typeof FinalizationRegistry === 'undefined')
586
+ ? { register: () => {}, unregister: () => {} }
587
+ : new FinalizationRegistry(ptr => wasm.__wbg_nasrresolver_free(ptr >>> 0, 1));
588
+
589
+ class NasrResolver {
590
+
591
+ __destroy_into_raw() {
592
+ const ptr = this.__wbg_ptr;
593
+ this.__wbg_ptr = 0;
594
+ NasrResolverFinalization.unregister(this);
595
+ return ptr;
596
+ }
597
+
598
+ free() {
599
+ const ptr = this.__destroy_into_raw();
600
+ wasm.__wbg_nasrresolver_free(ptr, 0);
601
+ }
602
+ /**
603
+ * @param {string} code
604
+ * @returns {any}
605
+ */
606
+ resolve_fix(code) {
607
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
608
+ const len0 = WASM_VECTOR_LEN;
609
+ const ret = wasm.nasrresolver_resolve_fix(this.__wbg_ptr, ptr0, len0);
610
+ if (ret[2]) {
611
+ throw takeFromExternrefTable0(ret[1]);
612
+ }
613
+ return takeFromExternrefTable0(ret[0]);
614
+ }
615
+ /**
616
+ * @param {string} name
617
+ * @returns {any}
618
+ */
619
+ resolve_airway(name) {
620
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
621
+ const len0 = WASM_VECTOR_LEN;
622
+ const ret = wasm.nasrresolver_resolve_airway(this.__wbg_ptr, ptr0, len0);
623
+ if (ret[2]) {
624
+ throw takeFromExternrefTable0(ret[1]);
625
+ }
626
+ return takeFromExternrefTable0(ret[0]);
627
+ }
628
+ /**
629
+ * @param {string} code
630
+ * @returns {any}
631
+ */
632
+ resolve_navaid(code) {
633
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
634
+ const len0 = WASM_VECTOR_LEN;
635
+ const ret = wasm.nasrresolver_resolve_navaid(this.__wbg_ptr, ptr0, len0);
636
+ if (ret[2]) {
637
+ throw takeFromExternrefTable0(ret[1]);
638
+ }
639
+ return takeFromExternrefTable0(ret[0]);
640
+ }
641
+ /**
642
+ * @param {string} code
643
+ * @returns {any}
644
+ */
645
+ resolve_airport(code) {
646
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
647
+ const len0 = WASM_VECTOR_LEN;
648
+ const ret = wasm.nasrresolver_resolve_airport(this.__wbg_ptr, ptr0, len0);
649
+ if (ret[2]) {
650
+ throw takeFromExternrefTable0(ret[1]);
651
+ }
652
+ return takeFromExternrefTable0(ret[0]);
653
+ }
654
+ /**
655
+ * @param {string} designator
656
+ * @returns {any}
657
+ */
658
+ resolve_airspace(designator) {
659
+ const ptr0 = passStringToWasm0(designator, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
660
+ const len0 = WASM_VECTOR_LEN;
661
+ const ret = wasm.nasrresolver_resolve_airspace(this.__wbg_ptr, ptr0, len0);
662
+ if (ret[2]) {
663
+ throw takeFromExternrefTable0(ret[1]);
664
+ }
665
+ return takeFromExternrefTable0(ret[0]);
666
+ }
667
+ /**
668
+ * @param {Uint8Array} zip_bytes
669
+ */
670
+ constructor(zip_bytes) {
671
+ const ptr0 = passArray8ToWasm0(zip_bytes, wasm.__wbindgen_malloc);
672
+ const len0 = WASM_VECTOR_LEN;
673
+ const ret = wasm.nasrresolver_new(ptr0, len0);
674
+ if (ret[2]) {
675
+ throw takeFromExternrefTable0(ret[1]);
676
+ }
677
+ this.__wbg_ptr = ret[0] >>> 0;
678
+ NasrResolverFinalization.register(this, this.__wbg_ptr, this);
679
+ return this;
680
+ }
681
+ /**
682
+ * @returns {any}
683
+ */
684
+ fixes() {
685
+ const ret = wasm.nasrresolver_fixes(this.__wbg_ptr);
686
+ if (ret[2]) {
687
+ throw takeFromExternrefTable0(ret[1]);
688
+ }
689
+ return takeFromExternrefTable0(ret[0]);
690
+ }
691
+ /**
692
+ * @returns {any}
693
+ */
694
+ airways() {
695
+ const ret = wasm.nasrresolver_airways(this.__wbg_ptr);
696
+ if (ret[2]) {
697
+ throw takeFromExternrefTable0(ret[1]);
698
+ }
699
+ return takeFromExternrefTable0(ret[0]);
700
+ }
701
+ /**
702
+ * @returns {any}
703
+ */
704
+ navaids() {
705
+ const ret = wasm.nasrresolver_navaids(this.__wbg_ptr);
706
+ if (ret[2]) {
707
+ throw takeFromExternrefTable0(ret[1]);
708
+ }
709
+ return takeFromExternrefTable0(ret[0]);
710
+ }
711
+ /**
712
+ * @returns {any}
713
+ */
714
+ airports() {
715
+ const ret = wasm.nasrresolver_airports(this.__wbg_ptr);
716
+ if (ret[2]) {
717
+ throw takeFromExternrefTable0(ret[1]);
718
+ }
719
+ return takeFromExternrefTable0(ret[0]);
720
+ }
721
+ /**
722
+ * @returns {any}
723
+ */
724
+ airspaces() {
725
+ const ret = wasm.nasrresolver_airspaces(this.__wbg_ptr);
726
+ if (ret[2]) {
727
+ throw takeFromExternrefTable0(ret[1]);
728
+ }
729
+ return takeFromExternrefTable0(ret[0]);
730
+ }
731
+ }
732
+ if (Symbol.dispose) NasrResolver.prototype[Symbol.dispose] = NasrResolver.prototype.free;
733
+
734
+ exports.NasrResolver = NasrResolver;
735
+
736
+ exports.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
737
+ const ret = Error(getStringFromWasm0(arg0, arg1));
738
+ return ret;
739
+ };
740
+
741
+ exports.__wbg_Number_bb48ca12f395cd08 = function(arg0) {
742
+ const ret = Number(arg0);
743
+ return ret;
744
+ };
745
+
746
+ exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
747
+ const ret = String(arg1);
748
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
749
+ const len1 = WASM_VECTOR_LEN;
750
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
751
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
752
+ };
753
+
754
+ exports.__wbg___wbindgen_bigint_get_as_i64_f3ebc5a755000afd = function(arg0, arg1) {
755
+ const v = arg1;
756
+ const ret = typeof(v) === 'bigint' ? v : undefined;
757
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
758
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
759
+ };
760
+
761
+ exports.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68 = function(arg0) {
762
+ const v = arg0;
763
+ const ret = typeof(v) === 'boolean' ? v : undefined;
764
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
765
+ };
766
+
767
+ exports.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
768
+ const ret = debugString(arg1);
769
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
770
+ const len1 = WASM_VECTOR_LEN;
771
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
772
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
773
+ };
774
+
775
+ exports.__wbg___wbindgen_in_bb933bd9e1b3bc0f = function(arg0, arg1) {
776
+ const ret = arg0 in arg1;
777
+ return ret;
778
+ };
779
+
780
+ exports.__wbg___wbindgen_is_bigint_cb320707dcd35f0b = function(arg0) {
781
+ const ret = typeof(arg0) === 'bigint';
782
+ return ret;
783
+ };
784
+
785
+ exports.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
786
+ const ret = typeof(arg0) === 'function';
787
+ return ret;
788
+ };
789
+
790
+ exports.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
791
+ const val = arg0;
792
+ const ret = typeof(val) === 'object' && val !== null;
793
+ return ret;
794
+ };
795
+
796
+ exports.__wbg___wbindgen_jsval_eq_6b13ab83478b1c50 = function(arg0, arg1) {
797
+ const ret = arg0 === arg1;
798
+ return ret;
799
+ };
800
+
801
+ exports.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147 = function(arg0, arg1) {
802
+ const ret = arg0 == arg1;
803
+ return ret;
804
+ };
805
+
806
+ exports.__wbg___wbindgen_number_get_a20bf9b85341449d = function(arg0, arg1) {
807
+ const obj = arg1;
808
+ const ret = typeof(obj) === 'number' ? obj : undefined;
809
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
810
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
811
+ };
812
+
813
+ exports.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
814
+ const obj = arg1;
815
+ const ret = typeof(obj) === 'string' ? obj : undefined;
816
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
817
+ var len1 = WASM_VECTOR_LEN;
818
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
819
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
820
+ };
821
+
822
+ exports.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
823
+ throw new Error(getStringFromWasm0(arg0, arg1));
824
+ };
825
+
826
+ exports.__wbg_call_e762c39fa8ea36bf = function() { return handleError(function (arg0, arg1) {
827
+ const ret = arg0.call(arg1);
828
+ return ret;
829
+ }, arguments) };
830
+
831
+ exports.__wbg_done_2042aa2670fb1db1 = function(arg0) {
832
+ const ret = arg0.done;
833
+ return ret;
834
+ };
835
+
836
+ exports.__wbg_entries_e171b586f8f6bdbf = function(arg0) {
837
+ const ret = Object.entries(arg0);
838
+ return ret;
839
+ };
840
+
841
+ exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
842
+ let deferred0_0;
843
+ let deferred0_1;
844
+ try {
845
+ deferred0_0 = arg0;
846
+ deferred0_1 = arg1;
847
+ console.error(getStringFromWasm0(arg0, arg1));
848
+ } finally {
849
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
850
+ }
851
+ };
852
+
853
+ exports.__wbg_from_a4ad7cbddd0d7135 = function(arg0) {
854
+ const ret = Array.from(arg0);
855
+ return ret;
856
+ };
857
+
858
+ exports.__wbg_get_7bed016f185add81 = function(arg0, arg1) {
859
+ const ret = arg0[arg1 >>> 0];
860
+ return ret;
861
+ };
862
+
863
+ exports.__wbg_get_efcb449f58ec27c2 = function() { return handleError(function (arg0, arg1) {
864
+ const ret = Reflect.get(arg0, arg1);
865
+ return ret;
866
+ }, arguments) };
867
+
868
+ exports.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
869
+ let result;
870
+ try {
871
+ result = arg0 instanceof ArrayBuffer;
872
+ } catch (_) {
873
+ result = false;
874
+ }
875
+ const ret = result;
876
+ return ret;
877
+ };
878
+
879
+ exports.__wbg_instanceof_Map_8579b5e2ab5437c7 = function(arg0) {
880
+ let result;
881
+ try {
882
+ result = arg0 instanceof Map;
883
+ } catch (_) {
884
+ result = false;
885
+ }
886
+ const ret = result;
887
+ return ret;
888
+ };
889
+
890
+ exports.__wbg_instanceof_Uint8Array_20c8e73002f7af98 = function(arg0) {
891
+ let result;
892
+ try {
893
+ result = arg0 instanceof Uint8Array;
894
+ } catch (_) {
895
+ result = false;
896
+ }
897
+ const ret = result;
898
+ return ret;
899
+ };
900
+
901
+ exports.__wbg_isArray_96e0af9891d0945d = function(arg0) {
902
+ const ret = Array.isArray(arg0);
903
+ return ret;
904
+ };
905
+
906
+ exports.__wbg_isSafeInteger_d216eda7911dde36 = function(arg0) {
907
+ const ret = Number.isSafeInteger(arg0);
908
+ return ret;
909
+ };
910
+
911
+ exports.__wbg_iterator_e5822695327a3c39 = function() {
912
+ const ret = Symbol.iterator;
913
+ return ret;
914
+ };
915
+
916
+ exports.__wbg_length_69bca3cb64fc8748 = function(arg0) {
917
+ const ret = arg0.length;
918
+ return ret;
919
+ };
920
+
921
+ exports.__wbg_length_cdd215e10d9dd507 = function(arg0) {
922
+ const ret = arg0.length;
923
+ return ret;
924
+ };
925
+
926
+ exports.__wbg_new_1acc0b6eea89d040 = function() {
927
+ const ret = new Object();
928
+ return ret;
929
+ };
930
+
931
+ exports.__wbg_new_5a79be3ab53b8aa5 = function(arg0) {
932
+ const ret = new Uint8Array(arg0);
933
+ return ret;
934
+ };
935
+
936
+ exports.__wbg_new_8a6f238a6ece86ea = function() {
937
+ const ret = new Error();
938
+ return ret;
939
+ };
940
+
941
+ exports.__wbg_new_e17d9f43105b08be = function() {
942
+ const ret = new Array();
943
+ return ret;
944
+ };
945
+
946
+ exports.__wbg_next_020810e0ae8ebcb0 = function() { return handleError(function (arg0) {
947
+ const ret = arg0.next();
948
+ return ret;
949
+ }, arguments) };
950
+
951
+ exports.__wbg_next_2c826fe5dfec6b6a = function(arg0) {
952
+ const ret = arg0.next;
953
+ return ret;
954
+ };
955
+
956
+ exports.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
957
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
958
+ };
959
+
960
+ exports.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
961
+ arg0[arg1] = arg2;
962
+ };
963
+
964
+ exports.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {
965
+ arg0[arg1 >>> 0] = arg2;
966
+ };
967
+
968
+ exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
969
+ const ret = arg1.stack;
970
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
971
+ const len1 = WASM_VECTOR_LEN;
972
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
973
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
974
+ };
975
+
976
+ exports.__wbg_value_692627309814bb8c = function(arg0) {
977
+ const ret = arg0.value;
978
+ return ret;
979
+ };
980
+
981
+ exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
982
+ // Cast intrinsic for `Ref(String) -> Externref`.
983
+ const ret = getStringFromWasm0(arg0, arg1);
984
+ return ret;
985
+ };
986
+
987
+ exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
988
+ // Cast intrinsic for `U64 -> Externref`.
989
+ const ret = BigInt.asUintN(64, arg0);
990
+ return ret;
991
+ };
992
+
993
+ exports.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
994
+ // Cast intrinsic for `I64 -> Externref`.
995
+ const ret = arg0;
996
+ return ret;
997
+ };
998
+
999
+ exports.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
1000
+ // Cast intrinsic for `F64 -> Externref`.
1001
+ const ret = arg0;
1002
+ return ret;
1003
+ };
1004
+
1005
+ exports.__wbindgen_init_externref_table = function() {
1006
+ const table = wasm.__wbindgen_externrefs;
1007
+ const offset = table.grow(4);
1008
+ table.set(0, undefined);
1009
+ table.set(offset + 0, undefined);
1010
+ table.set(offset + 1, null);
1011
+ table.set(offset + 2, true);
1012
+ table.set(offset + 3, false);
1013
+ ;
1014
+ };
1015
+
1016
+ const wasmPath = `${__dirname}/thrust_wasm_bg.wasm`;
1017
+ const wasmBytes = require('fs').readFileSync(wasmPath);
1018
+ const wasmModule = new WebAssembly.Module(wasmBytes);
1019
+ const wasm = exports.__wasm = new WebAssembly.Instance(wasmModule, imports).exports;
1020
+
1021
+ wasm.__wbindgen_start();
1022
+