@janssenproject/cedarling_wasm 0.0.307-nodejs → 0.0.308

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/cedarling_wasm.js CHANGED
@@ -1,281 +1,10 @@
1
-
2
- let imports = {};
3
- imports['__wbindgen_placeholder__'] = module.exports;
4
-
5
- function addToExternrefTable0(obj) {
6
- const idx = wasm.__externref_table_alloc();
7
- wasm.__wbindgen_externrefs.set(idx, obj);
8
- return idx;
9
- }
10
-
11
- function _assertClass(instance, klass) {
12
- if (!(instance instanceof klass)) {
13
- throw new Error(`expected instance of ${klass.name}`);
14
- }
15
- }
16
-
17
- const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
18
- ? { register: () => {}, unregister: () => {} }
19
- : new FinalizationRegistry(state => state.dtor(state.a, state.b));
20
-
21
- function debugString(val) {
22
- // primitive types
23
- const type = typeof val;
24
- if (type == 'number' || type == 'boolean' || val == null) {
25
- return `${val}`;
26
- }
27
- if (type == 'string') {
28
- return `"${val}"`;
29
- }
30
- if (type == 'symbol') {
31
- const description = val.description;
32
- if (description == null) {
33
- return 'Symbol';
34
- } else {
35
- return `Symbol(${description})`;
36
- }
37
- }
38
- if (type == 'function') {
39
- const name = val.name;
40
- if (typeof name == 'string' && name.length > 0) {
41
- return `Function(${name})`;
42
- } else {
43
- return 'Function';
44
- }
45
- }
46
- // objects
47
- if (Array.isArray(val)) {
48
- const length = val.length;
49
- let debug = '[';
50
- if (length > 0) {
51
- debug += debugString(val[0]);
52
- }
53
- for(let i = 1; i < length; i++) {
54
- debug += ', ' + debugString(val[i]);
55
- }
56
- debug += ']';
57
- return debug;
58
- }
59
- // Test for built-in
60
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
61
- let className;
62
- if (builtInMatches && builtInMatches.length > 1) {
63
- className = builtInMatches[1];
64
- } else {
65
- // Failed to match the standard '[object ClassName]'
66
- return toString.call(val);
67
- }
68
- if (className == 'Object') {
69
- // we're a user defined class or Object
70
- // JSON.stringify avoids problems with cycles, and is generally much
71
- // easier than looping through ownProperties of `val`.
72
- try {
73
- return 'Object(' + JSON.stringify(val) + ')';
74
- } catch (_) {
75
- return 'Object';
76
- }
77
- }
78
- // errors
79
- if (val instanceof Error) {
80
- return `${val.name}: ${val.message}\n${val.stack}`;
81
- }
82
- // TODO we could test for more things here, like `Set`s and `Map`s.
83
- return className;
84
- }
85
-
86
- function getArrayJsValueFromWasm0(ptr, len) {
87
- ptr = ptr >>> 0;
88
- const mem = getDataViewMemory0();
89
- const result = [];
90
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
91
- result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
92
- }
93
- wasm.__externref_drop_slice(ptr, len);
94
- return result;
95
- }
96
-
97
- function getArrayU8FromWasm0(ptr, len) {
98
- ptr = ptr >>> 0;
99
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
100
- }
101
-
102
- let cachedDataViewMemory0 = null;
103
- function getDataViewMemory0() {
104
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
105
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
106
- }
107
- return cachedDataViewMemory0;
108
- }
109
-
110
- function getStringFromWasm0(ptr, len) {
111
- ptr = ptr >>> 0;
112
- return decodeText(ptr, len);
113
- }
114
-
115
- let cachedUint8ArrayMemory0 = null;
116
- function getUint8ArrayMemory0() {
117
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
118
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
119
- }
120
- return cachedUint8ArrayMemory0;
121
- }
122
-
123
- function handleError(f, args) {
124
- try {
125
- return f.apply(this, args);
126
- } catch (e) {
127
- const idx = addToExternrefTable0(e);
128
- wasm.__wbindgen_exn_store(idx);
129
- }
130
- }
131
-
132
- function isLikeNone(x) {
133
- return x === undefined || x === null;
134
- }
135
-
136
- function makeMutClosure(arg0, arg1, dtor, f) {
137
- const state = { a: arg0, b: arg1, cnt: 1, dtor };
138
- const real = (...args) => {
139
-
140
- // First up with a closure we increment the internal reference
141
- // count. This ensures that the Rust closure environment won't
142
- // be deallocated while we're invoking it.
143
- state.cnt++;
144
- const a = state.a;
145
- state.a = 0;
146
- try {
147
- return f(a, state.b, ...args);
148
- } finally {
149
- state.a = a;
150
- real._wbg_cb_unref();
151
- }
152
- };
153
- real._wbg_cb_unref = () => {
154
- if (--state.cnt === 0) {
155
- state.dtor(state.a, state.b);
156
- state.a = 0;
157
- CLOSURE_DTORS.unregister(state);
158
- }
159
- };
160
- CLOSURE_DTORS.register(real, state, state);
161
- return real;
162
- }
163
-
164
- function passStringToWasm0(arg, malloc, realloc) {
165
- if (realloc === undefined) {
166
- const buf = cachedTextEncoder.encode(arg);
167
- const ptr = malloc(buf.length, 1) >>> 0;
168
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
169
- WASM_VECTOR_LEN = buf.length;
170
- return ptr;
171
- }
172
-
173
- let len = arg.length;
174
- let ptr = malloc(len, 1) >>> 0;
175
-
176
- const mem = getUint8ArrayMemory0();
177
-
178
- let offset = 0;
179
-
180
- for (; offset < len; offset++) {
181
- const code = arg.charCodeAt(offset);
182
- if (code > 0x7F) break;
183
- mem[ptr + offset] = code;
184
- }
185
- if (offset !== len) {
186
- if (offset !== 0) {
187
- arg = arg.slice(offset);
188
- }
189
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
190
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
191
- const ret = cachedTextEncoder.encodeInto(arg, view);
192
-
193
- offset += ret.written;
194
- ptr = realloc(ptr, len, offset, 1) >>> 0;
195
- }
196
-
197
- WASM_VECTOR_LEN = offset;
198
- return ptr;
199
- }
200
-
201
- function takeFromExternrefTable0(idx) {
202
- const value = wasm.__wbindgen_externrefs.get(idx);
203
- wasm.__externref_table_dealloc(idx);
204
- return value;
205
- }
206
-
207
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
208
- cachedTextDecoder.decode();
209
- function decodeText(ptr, len) {
210
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
211
- }
212
-
213
- const cachedTextEncoder = new TextEncoder();
214
-
215
- if (!('encodeInto' in cachedTextEncoder)) {
216
- cachedTextEncoder.encodeInto = function (arg, view) {
217
- const buf = cachedTextEncoder.encode(arg);
218
- view.set(buf);
219
- return {
220
- read: arg.length,
221
- written: buf.length
222
- };
223
- }
224
- }
225
-
226
- let WASM_VECTOR_LEN = 0;
227
-
228
- function wasm_bindgen__convert__closures_____invoke__h5208add59d64c287(arg0, arg1) {
229
- wasm.wasm_bindgen__convert__closures_____invoke__h5208add59d64c287(arg0, arg1);
230
- }
231
-
232
- function wasm_bindgen__convert__closures_____invoke__h7f8b71809a8d7577(arg0, arg1, arg2) {
233
- wasm.wasm_bindgen__convert__closures_____invoke__h7f8b71809a8d7577(arg0, arg1, arg2);
234
- }
235
-
236
- function wasm_bindgen__convert__closures_____invoke__h3a7d0d99d266e2f8(arg0, arg1, arg2, arg3) {
237
- wasm.wasm_bindgen__convert__closures_____invoke__h3a7d0d99d266e2f8(arg0, arg1, arg2, arg3);
238
- }
239
-
240
- const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
241
-
242
- const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
243
-
244
- const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
245
-
246
- const AuthorizeResultFinalization = (typeof FinalizationRegistry === 'undefined')
247
- ? { register: () => {}, unregister: () => {} }
248
- : new FinalizationRegistry(ptr => wasm.__wbg_authorizeresult_free(ptr >>> 0, 1));
249
-
250
- const AuthorizeResultResponseFinalization = (typeof FinalizationRegistry === 'undefined')
251
- ? { register: () => {}, unregister: () => {} }
252
- : new FinalizationRegistry(ptr => wasm.__wbg_authorizeresultresponse_free(ptr >>> 0, 1));
253
-
254
- const CedarlingFinalization = (typeof FinalizationRegistry === 'undefined')
255
- ? { register: () => {}, unregister: () => {} }
256
- : new FinalizationRegistry(ptr => wasm.__wbg_cedarling_free(ptr >>> 0, 1));
257
-
258
- const DiagnosticsFinalization = (typeof FinalizationRegistry === 'undefined')
259
- ? { register: () => {}, unregister: () => {} }
260
- : new FinalizationRegistry(ptr => wasm.__wbg_diagnostics_free(ptr >>> 0, 1));
261
-
262
- const JsJsonLogicFinalization = (typeof FinalizationRegistry === 'undefined')
263
- ? { register: () => {}, unregister: () => {} }
264
- : new FinalizationRegistry(ptr => wasm.__wbg_jsjsonlogic_free(ptr >>> 0, 1));
265
-
266
- const MultiIssuerAuthorizeResultFinalization = (typeof FinalizationRegistry === 'undefined')
267
- ? { register: () => {}, unregister: () => {} }
268
- : new FinalizationRegistry(ptr => wasm.__wbg_multiissuerauthorizeresult_free(ptr >>> 0, 1));
269
-
270
- const PolicyEvaluationErrorFinalization = (typeof FinalizationRegistry === 'undefined')
271
- ? { register: () => {}, unregister: () => {} }
272
- : new FinalizationRegistry(ptr => wasm.__wbg_policyevaluationerror_free(ptr >>> 0, 1));
1
+ /* @ts-self-types="./cedarling_wasm.d.ts" */
273
2
 
274
3
  /**
275
4
  * A WASM wrapper for the Rust `cedarling::AuthorizeResult` struct.
276
5
  * Represents the result of an authorization request.
277
6
  */
278
- class AuthorizeResult {
7
+ export class AuthorizeResult {
279
8
  static __wrap(ptr) {
280
9
  ptr = ptr >>> 0;
281
10
  const obj = Object.create(AuthorizeResult.prototype);
@@ -293,46 +22,32 @@ class AuthorizeResult {
293
22
  const ptr = this.__destroy_into_raw();
294
23
  wasm.__wbg_authorizeresult_free(ptr, 0);
295
24
  }
296
- /**
297
- * Result of authorization where principal is `Jans::Workload`
298
- * @returns {AuthorizeResultResponse | undefined}
299
- */
300
- get workload() {
301
- const ret = wasm.__wbg_get_authorizeresult_workload(this.__wbg_ptr);
302
- return ret === 0 ? undefined : AuthorizeResultResponse.__wrap(ret);
303
- }
304
- /**
305
- * Result of authorization where principal is `Jans::Workload`
306
- * @param {AuthorizeResultResponse | null} [arg0]
25
+ /**
26
+ * Convert `AuthorizeResult` to json string value
27
+ * @returns {string}
307
28
  */
308
- set workload(arg0) {
309
- let ptr0 = 0;
310
- if (!isLikeNone(arg0)) {
311
- _assertClass(arg0, AuthorizeResultResponse);
312
- ptr0 = arg0.__destroy_into_raw();
29
+ json_string() {
30
+ let deferred1_0;
31
+ let deferred1_1;
32
+ try {
33
+ const ret = wasm.authorizeresult_json_string(this.__wbg_ptr);
34
+ deferred1_0 = ret[0];
35
+ deferred1_1 = ret[1];
36
+ return getStringFromWasm0(ret[0], ret[1]);
37
+ } finally {
38
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
313
39
  }
314
- wasm.__wbg_set_authorizeresult_workload(this.__wbg_ptr, ptr0);
315
40
  }
316
41
  /**
317
- * Result of authorization where principal is `Jans::User`
42
+ * @param {string} principal
318
43
  * @returns {AuthorizeResultResponse | undefined}
319
44
  */
320
- get person() {
321
- const ret = wasm.__wbg_get_authorizeresult_person(this.__wbg_ptr);
45
+ principal(principal) {
46
+ const ptr0 = passStringToWasm0(principal, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
47
+ const len0 = WASM_VECTOR_LEN;
48
+ const ret = wasm.authorizeresult_principal(this.__wbg_ptr, ptr0, len0);
322
49
  return ret === 0 ? undefined : AuthorizeResultResponse.__wrap(ret);
323
50
  }
324
- /**
325
- * Result of authorization where principal is `Jans::User`
326
- * @param {AuthorizeResultResponse | null} [arg0]
327
- */
328
- set person(arg0) {
329
- let ptr0 = 0;
330
- if (!isLikeNone(arg0)) {
331
- _assertClass(arg0, AuthorizeResultResponse);
332
- ptr0 = arg0.__destroy_into_raw();
333
- }
334
- wasm.__wbg_set_authorizeresult_person(this.__wbg_ptr, ptr0);
335
- }
336
51
  /**
337
52
  * Result of authorization
338
53
  * true means `ALLOW`
@@ -346,15 +61,12 @@ class AuthorizeResult {
346
61
  return ret !== 0;
347
62
  }
348
63
  /**
349
- * Result of authorization
350
- * true means `ALLOW`
351
- * false means `Deny`
352
- *
353
- * this field is [`bool`] type to be compatible with [authzen Access Evaluation Decision](https://openid.github.io/authzen/#section-6.2.1).
354
- * @param {boolean} arg0
64
+ * Result of authorization where principal is `Jans::User`
65
+ * @returns {AuthorizeResultResponse | undefined}
355
66
  */
356
- set decision(arg0) {
357
- wasm.__wbg_set_authorizeresult_decision(this.__wbg_ptr, arg0);
67
+ get person() {
68
+ const ret = wasm.__wbg_get_authorizeresult_person(this.__wbg_ptr);
69
+ return ret === 0 ? undefined : AuthorizeResultResponse.__wrap(ret);
358
70
  }
359
71
  /**
360
72
  * Request ID of the authorization request
@@ -372,6 +84,37 @@ class AuthorizeResult {
372
84
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
373
85
  }
374
86
  }
87
+ /**
88
+ * Result of authorization where principal is `Jans::Workload`
89
+ * @returns {AuthorizeResultResponse | undefined}
90
+ */
91
+ get workload() {
92
+ const ret = wasm.__wbg_get_authorizeresult_workload(this.__wbg_ptr);
93
+ return ret === 0 ? undefined : AuthorizeResultResponse.__wrap(ret);
94
+ }
95
+ /**
96
+ * Result of authorization
97
+ * true means `ALLOW`
98
+ * false means `Deny`
99
+ *
100
+ * this field is [`bool`] type to be compatible with [authzen Access Evaluation Decision](https://openid.github.io/authzen/#section-6.2.1).
101
+ * @param {boolean} arg0
102
+ */
103
+ set decision(arg0) {
104
+ wasm.__wbg_set_authorizeresult_decision(this.__wbg_ptr, arg0);
105
+ }
106
+ /**
107
+ * Result of authorization where principal is `Jans::User`
108
+ * @param {AuthorizeResultResponse | null} [arg0]
109
+ */
110
+ set person(arg0) {
111
+ let ptr0 = 0;
112
+ if (!isLikeNone(arg0)) {
113
+ _assertClass(arg0, AuthorizeResultResponse);
114
+ ptr0 = arg0.__destroy_into_raw();
115
+ }
116
+ wasm.__wbg_set_authorizeresult_person(this.__wbg_ptr, ptr0);
117
+ }
375
118
  /**
376
119
  * Request ID of the authorization request
377
120
  * @param {string} arg0
@@ -382,40 +125,25 @@ class AuthorizeResult {
382
125
  wasm.__wbg_set_authorizeresult_request_id(this.__wbg_ptr, ptr0, len0);
383
126
  }
384
127
  /**
385
- * Convert `AuthorizeResult` to json string value
386
- * @returns {string}
128
+ * Result of authorization where principal is `Jans::Workload`
129
+ * @param {AuthorizeResultResponse | null} [arg0]
387
130
  */
388
- json_string() {
389
- let deferred1_0;
390
- let deferred1_1;
391
- try {
392
- const ret = wasm.authorizeresult_json_string(this.__wbg_ptr);
393
- deferred1_0 = ret[0];
394
- deferred1_1 = ret[1];
395
- return getStringFromWasm0(ret[0], ret[1]);
396
- } finally {
397
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
131
+ set workload(arg0) {
132
+ let ptr0 = 0;
133
+ if (!isLikeNone(arg0)) {
134
+ _assertClass(arg0, AuthorizeResultResponse);
135
+ ptr0 = arg0.__destroy_into_raw();
398
136
  }
399
- }
400
- /**
401
- * @param {string} principal
402
- * @returns {AuthorizeResultResponse | undefined}
403
- */
404
- principal(principal) {
405
- const ptr0 = passStringToWasm0(principal, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
406
- const len0 = WASM_VECTOR_LEN;
407
- const ret = wasm.authorizeresult_principal(this.__wbg_ptr, ptr0, len0);
408
- return ret === 0 ? undefined : AuthorizeResultResponse.__wrap(ret);
137
+ wasm.__wbg_set_authorizeresult_workload(this.__wbg_ptr, ptr0);
409
138
  }
410
139
  }
411
140
  if (Symbol.dispose) AuthorizeResult.prototype[Symbol.dispose] = AuthorizeResult.prototype.free;
412
- exports.AuthorizeResult = AuthorizeResult;
413
141
 
414
142
  /**
415
143
  * A WASM wrapper for the Rust `cedar_policy::Response` struct.
416
144
  * Represents the result of an authorization request.
417
145
  */
418
- class AuthorizeResultResponse {
146
+ export class AuthorizeResultResponse {
419
147
  static __wrap(ptr) {
420
148
  ptr = ptr >>> 0;
421
149
  const obj = Object.create(AuthorizeResultResponse.prototype);
@@ -451,12 +179,11 @@ class AuthorizeResultResponse {
451
179
  }
452
180
  }
453
181
  if (Symbol.dispose) AuthorizeResultResponse.prototype[Symbol.dispose] = AuthorizeResultResponse.prototype.free;
454
- exports.AuthorizeResultResponse = AuthorizeResultResponse;
455
182
 
456
183
  /**
457
184
  * The instance of the Cedarling application.
458
185
  */
459
- class Cedarling {
186
+ export class Cedarling {
460
187
  static __wrap(ptr) {
461
188
  ptr = ptr >>> 0;
462
189
  const obj = Object.create(Cedarling.prototype);
@@ -474,26 +201,6 @@ class Cedarling {
474
201
  const ptr = this.__destroy_into_raw();
475
202
  wasm.__wbg_cedarling_free(ptr, 0);
476
203
  }
477
- /**
478
- * Create a new instance of the Cedarling application.
479
- * Assume that config is `Object`
480
- * @param {object} config
481
- * @returns {Promise<Cedarling>}
482
- */
483
- static new(config) {
484
- const ret = wasm.cedarling_new(config);
485
- return ret;
486
- }
487
- /**
488
- * Create a new instance of the Cedarling application.
489
- * Assume that config is `Map`
490
- * @param {Map<any, any>} config
491
- * @returns {Promise<Cedarling>}
492
- */
493
- static new_from_map(config) {
494
- const ret = wasm.cedarling_new_from_map(config);
495
- return ret;
496
- }
497
204
  /**
498
205
  * Authorize request
499
206
  * makes authorization decision based on the [`Request`]
@@ -504,16 +211,6 @@ class Cedarling {
504
211
  const ret = wasm.cedarling_authorize(this.__wbg_ptr, request);
505
212
  return ret;
506
213
  }
507
- /**
508
- * Authorize request for unsigned principals.
509
- * makes authorization decision based on the [`RequestUnsigned`]
510
- * @param {any} request
511
- * @returns {Promise<AuthorizeResult>}
512
- */
513
- authorize_unsigned(request) {
514
- const ret = wasm.cedarling_authorize_unsigned(this.__wbg_ptr, request);
515
- return ret;
516
- }
517
214
  /**
518
215
  * Authorize multi-issuer request.
519
216
  * Makes authorization decision based on multiple JWT tokens from different issuers
@@ -525,16 +222,14 @@ class Cedarling {
525
222
  return ret;
526
223
  }
527
224
  /**
528
- * Get logs and remove them from the storage.
529
- * Returns `Array` of `Map`
530
- * @returns {Array<any>}
225
+ * Authorize request for unsigned principals.
226
+ * makes authorization decision based on the [`RequestUnsigned`]
227
+ * @param {any} request
228
+ * @returns {Promise<AuthorizeResult>}
531
229
  */
532
- pop_logs() {
533
- const ret = wasm.cedarling_pop_logs(this.__wbg_ptr);
534
- if (ret[2]) {
535
- throw takeFromExternrefTable0(ret[1]);
536
- }
537
- return takeFromExternrefTable0(ret[0]);
230
+ authorize_unsigned(request) {
231
+ const ret = wasm.cedarling_authorize_unsigned(this.__wbg_ptr, request);
232
+ return ret;
538
233
  }
539
234
  /**
540
235
  * Get specific log entry.
@@ -560,23 +255,6 @@ class Cedarling {
560
255
  const ret = wasm.cedarling_get_log_ids(this.__wbg_ptr);
561
256
  return ret;
562
257
  }
563
- /**
564
- * Get logs by tag, like `log_kind` or `log level`.
565
- * Tag can be `log_kind`, `log_level`.
566
- * @param {string} tag
567
- * @returns {any[]}
568
- */
569
- get_logs_by_tag(tag) {
570
- const ptr0 = passStringToWasm0(tag, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
571
- const len0 = WASM_VECTOR_LEN;
572
- const ret = wasm.cedarling_get_logs_by_tag(this.__wbg_ptr, ptr0, len0);
573
- if (ret[3]) {
574
- throw takeFromExternrefTable0(ret[2]);
575
- }
576
- var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
577
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
578
- return v2;
579
- }
580
258
  /**
581
259
  * Get logs by request_id.
582
260
  * Return log entries that match the given request_id.
@@ -615,6 +293,55 @@ class Cedarling {
615
293
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
616
294
  return v3;
617
295
  }
296
+ /**
297
+ * Get logs by tag, like `log_kind` or `log level`.
298
+ * Tag can be `log_kind`, `log_level`.
299
+ * @param {string} tag
300
+ * @returns {any[]}
301
+ */
302
+ get_logs_by_tag(tag) {
303
+ const ptr0 = passStringToWasm0(tag, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
304
+ const len0 = WASM_VECTOR_LEN;
305
+ const ret = wasm.cedarling_get_logs_by_tag(this.__wbg_ptr, ptr0, len0);
306
+ if (ret[3]) {
307
+ throw takeFromExternrefTable0(ret[2]);
308
+ }
309
+ var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
310
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
311
+ return v2;
312
+ }
313
+ /**
314
+ * Create a new instance of the Cedarling application.
315
+ * Assume that config is `Object`
316
+ * @param {object} config
317
+ * @returns {Promise<Cedarling>}
318
+ */
319
+ static new(config) {
320
+ const ret = wasm.cedarling_new(config);
321
+ return ret;
322
+ }
323
+ /**
324
+ * Create a new instance of the Cedarling application.
325
+ * Assume that config is `Map`
326
+ * @param {Map<any, any>} config
327
+ * @returns {Promise<Cedarling>}
328
+ */
329
+ static new_from_map(config) {
330
+ const ret = wasm.cedarling_new_from_map(config);
331
+ return ret;
332
+ }
333
+ /**
334
+ * Get logs and remove them from the storage.
335
+ * Returns `Array` of `Map`
336
+ * @returns {Array<any>}
337
+ */
338
+ pop_logs() {
339
+ const ret = wasm.cedarling_pop_logs(this.__wbg_ptr);
340
+ if (ret[2]) {
341
+ throw takeFromExternrefTable0(ret[1]);
342
+ }
343
+ return takeFromExternrefTable0(ret[0]);
344
+ }
618
345
  /**
619
346
  * Closes the connections to the Lock Server and pushes all available logs.
620
347
  * @returns {Promise<void>}
@@ -625,7 +352,6 @@ class Cedarling {
625
352
  }
626
353
  }
627
354
  if (Symbol.dispose) Cedarling.prototype[Symbol.dispose] = Cedarling.prototype.free;
628
- exports.Cedarling = Cedarling;
629
355
 
630
356
  /**
631
357
  * Diagnostics
@@ -633,7 +359,7 @@ exports.Cedarling = Cedarling;
633
359
  *
634
360
  * Provides detailed information about how a policy decision was made, including policies that contributed to the decision and any errors encountered during evaluation.
635
361
  */
636
- class Diagnostics {
362
+ export class Diagnostics {
637
363
  static __wrap(ptr) {
638
364
  ptr = ptr >>> 0;
639
365
  const obj = Object.create(Diagnostics.prototype);
@@ -651,6 +377,17 @@ class Diagnostics {
651
377
  const ptr = this.__destroy_into_raw();
652
378
  wasm.__wbg_diagnostics_free(ptr, 0);
653
379
  }
380
+ /**
381
+ * Errors that occurred during authorization. The errors should be
382
+ * treated as unordered, since policies may be evaluated in any order.
383
+ * @returns {PolicyEvaluationError[]}
384
+ */
385
+ get errors() {
386
+ const ret = wasm.diagnostics_errors(this.__wbg_ptr);
387
+ var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
388
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
389
+ return v1;
390
+ }
654
391
  /**
655
392
  * `PolicyId`s of the policies that contributed to the decision.
656
393
  * If no policies applied to the request, this set will be empty.
@@ -664,37 +401,19 @@ class Diagnostics {
664
401
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
665
402
  return v1;
666
403
  }
667
- /**
668
- * Errors that occurred during authorization. The errors should be
669
- * treated as unordered, since policies may be evaluated in any order.
670
- * @returns {PolicyEvaluationError[]}
671
- */
672
- get errors() {
673
- const ret = wasm.diagnostics_errors(this.__wbg_ptr);
674
- var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
675
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
676
- return v1;
677
- }
678
404
  }
679
405
  if (Symbol.dispose) Diagnostics.prototype[Symbol.dispose] = Diagnostics.prototype.free;
680
- exports.Diagnostics = Diagnostics;
681
406
 
682
- class JsJsonLogic {
407
+ export class JsJsonLogic {
683
408
  __destroy_into_raw() {
684
409
  const ptr = this.__wbg_ptr;
685
410
  this.__wbg_ptr = 0;
686
411
  JsJsonLogicFinalization.unregister(this);
687
412
  return ptr;
688
413
  }
689
- free() {
690
- const ptr = this.__destroy_into_raw();
691
- wasm.__wbg_jsjsonlogic_free(ptr, 0);
692
- }
693
- constructor() {
694
- const ret = wasm.jsjsonlogic_new();
695
- this.__wbg_ptr = ret >>> 0;
696
- JsJsonLogicFinalization.register(this, this.__wbg_ptr, this);
697
- return this;
414
+ free() {
415
+ const ptr = this.__destroy_into_raw();
416
+ wasm.__wbg_jsjsonlogic_free(ptr, 0);
698
417
  }
699
418
  /**
700
419
  * @param {any} logic
@@ -708,15 +427,20 @@ class JsJsonLogic {
708
427
  }
709
428
  return takeFromExternrefTable0(ret[0]);
710
429
  }
430
+ constructor() {
431
+ const ret = wasm.jsjsonlogic_new();
432
+ this.__wbg_ptr = ret >>> 0;
433
+ JsJsonLogicFinalization.register(this, this.__wbg_ptr, this);
434
+ return this;
435
+ }
711
436
  }
712
437
  if (Symbol.dispose) JsJsonLogic.prototype[Symbol.dispose] = JsJsonLogic.prototype.free;
713
- exports.JsJsonLogic = JsJsonLogic;
714
438
 
715
439
  /**
716
440
  * A WASM wrapper for the Rust `cedarling::MultiIssuerAuthorizeResult` struct.
717
441
  * Represents the result of a multi-issuer authorization request.
718
442
  */
719
- class MultiIssuerAuthorizeResult {
443
+ export class MultiIssuerAuthorizeResult {
720
444
  static __wrap(ptr) {
721
445
  ptr = ptr >>> 0;
722
446
  const obj = Object.create(MultiIssuerAuthorizeResult.prototype);
@@ -734,23 +458,6 @@ class MultiIssuerAuthorizeResult {
734
458
  const ptr = this.__destroy_into_raw();
735
459
  wasm.__wbg_multiissuerauthorizeresult_free(ptr, 0);
736
460
  }
737
- /**
738
- * Result of Cedar policy authorization
739
- * @returns {AuthorizeResultResponse}
740
- */
741
- get response() {
742
- const ret = wasm.__wbg_get_multiissuerauthorizeresult_response(this.__wbg_ptr);
743
- return AuthorizeResultResponse.__wrap(ret);
744
- }
745
- /**
746
- * Result of Cedar policy authorization
747
- * @param {AuthorizeResultResponse} arg0
748
- */
749
- set response(arg0) {
750
- _assertClass(arg0, AuthorizeResultResponse);
751
- var ptr0 = arg0.__destroy_into_raw();
752
- wasm.__wbg_set_multiissuerauthorizeresult_response(this.__wbg_ptr, ptr0);
753
- }
754
461
  /**
755
462
  * Result of authorization
756
463
  * true means `ALLOW`
@@ -761,15 +468,6 @@ class MultiIssuerAuthorizeResult {
761
468
  const ret = wasm.__wbg_get_multiissuerauthorizeresult_decision(this.__wbg_ptr);
762
469
  return ret !== 0;
763
470
  }
764
- /**
765
- * Result of authorization
766
- * true means `ALLOW`
767
- * false means `Deny`
768
- * @param {boolean} arg0
769
- */
770
- set decision(arg0) {
771
- wasm.__wbg_set_multiissuerauthorizeresult_decision(this.__wbg_ptr, arg0);
772
- }
773
471
  /**
774
472
  * Request ID of the authorization request
775
473
  * @returns {string}
@@ -787,13 +485,12 @@ class MultiIssuerAuthorizeResult {
787
485
  }
788
486
  }
789
487
  /**
790
- * Request ID of the authorization request
791
- * @param {string} arg0
488
+ * Result of Cedar policy authorization
489
+ * @returns {AuthorizeResultResponse}
792
490
  */
793
- set request_id(arg0) {
794
- const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
795
- const len0 = WASM_VECTOR_LEN;
796
- wasm.__wbg_set_multiissuerauthorizeresult_request_id(this.__wbg_ptr, ptr0, len0);
491
+ get response() {
492
+ const ret = wasm.__wbg_get_multiissuerauthorizeresult_response(this.__wbg_ptr);
493
+ return AuthorizeResultResponse.__wrap(ret);
797
494
  }
798
495
  /**
799
496
  * Convert `MultiIssuerAuthorizeResult` to json string value
@@ -811,9 +508,35 @@ class MultiIssuerAuthorizeResult {
811
508
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
812
509
  }
813
510
  }
511
+ /**
512
+ * Result of authorization
513
+ * true means `ALLOW`
514
+ * false means `Deny`
515
+ * @param {boolean} arg0
516
+ */
517
+ set decision(arg0) {
518
+ wasm.__wbg_set_multiissuerauthorizeresult_decision(this.__wbg_ptr, arg0);
519
+ }
520
+ /**
521
+ * Request ID of the authorization request
522
+ * @param {string} arg0
523
+ */
524
+ set request_id(arg0) {
525
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
526
+ const len0 = WASM_VECTOR_LEN;
527
+ wasm.__wbg_set_multiissuerauthorizeresult_request_id(this.__wbg_ptr, ptr0, len0);
528
+ }
529
+ /**
530
+ * Result of Cedar policy authorization
531
+ * @param {AuthorizeResultResponse} arg0
532
+ */
533
+ set response(arg0) {
534
+ _assertClass(arg0, AuthorizeResultResponse);
535
+ var ptr0 = arg0.__destroy_into_raw();
536
+ wasm.__wbg_set_multiissuerauthorizeresult_response(this.__wbg_ptr, ptr0);
537
+ }
814
538
  }
815
539
  if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = MultiIssuerAuthorizeResult.prototype.free;
816
- exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
817
540
 
818
541
  /**
819
542
  * PolicyEvaluationError
@@ -821,7 +544,7 @@ exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
821
544
  *
822
545
  * Represents an error that occurred when evaluating a Cedar policy.
823
546
  */
824
- class PolicyEvaluationError {
547
+ export class PolicyEvaluationError {
825
548
  static __wrap(ptr) {
826
549
  ptr = ptr >>> 0;
827
550
  const obj = Object.create(PolicyEvaluationError.prototype);
@@ -840,14 +563,14 @@ class PolicyEvaluationError {
840
563
  wasm.__wbg_policyevaluationerror_free(ptr, 0);
841
564
  }
842
565
  /**
843
- * Id of the policy with an error
566
+ * Underlying evaluation error string representation
844
567
  * @returns {string}
845
568
  */
846
- get id() {
569
+ get error() {
847
570
  let deferred1_0;
848
571
  let deferred1_1;
849
572
  try {
850
- const ret = wasm.policyevaluationerror_id(this.__wbg_ptr);
573
+ const ret = wasm.policyevaluationerror_error(this.__wbg_ptr);
851
574
  deferred1_0 = ret[0];
852
575
  deferred1_1 = ret[1];
853
576
  return getStringFromWasm0(ret[0], ret[1]);
@@ -856,14 +579,14 @@ class PolicyEvaluationError {
856
579
  }
857
580
  }
858
581
  /**
859
- * Underlying evaluation error string representation
582
+ * Id of the policy with an error
860
583
  * @returns {string}
861
584
  */
862
- get error() {
585
+ get id() {
863
586
  let deferred1_0;
864
587
  let deferred1_1;
865
588
  try {
866
- const ret = wasm.policyevaluationerror_error(this.__wbg_ptr);
589
+ const ret = wasm.policyevaluationerror_id(this.__wbg_ptr);
867
590
  deferred1_0 = ret[0];
868
591
  deferred1_1 = ret[1];
869
592
  return getStringFromWasm0(ret[0], ret[1]);
@@ -873,7 +596,6 @@ class PolicyEvaluationError {
873
596
  }
874
597
  }
875
598
  if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEvaluationError.prototype.free;
876
- exports.PolicyEvaluationError = PolicyEvaluationError;
877
599
 
878
600
  /**
879
601
  * Create a new instance of the Cedarling application.
@@ -881,675 +603,946 @@ exports.PolicyEvaluationError = PolicyEvaluationError;
881
603
  * @param {any} config
882
604
  * @returns {Promise<Cedarling>}
883
605
  */
884
- function init(config) {
606
+ export function init(config) {
885
607
  const ret = wasm.init(config);
886
608
  return ret;
887
609
  }
888
- exports.init = init;
889
-
890
- exports.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
891
- const ret = Error(getStringFromWasm0(arg0, arg1));
892
- return ret;
893
- };
894
-
895
- exports.__wbg_Number_2d1dcfcf4ec51736 = function(arg0) {
896
- const ret = Number(arg0);
897
- return ret;
898
- };
899
-
900
- exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
901
- const ret = String(arg1);
902
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
903
- const len1 = WASM_VECTOR_LEN;
904
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
905
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
906
- };
907
-
908
- exports.__wbg___wbindgen_bigint_get_as_i64_6e32f5e6aff02e1d = function(arg0, arg1) {
909
- const v = arg1;
910
- const ret = typeof(v) === 'bigint' ? v : undefined;
911
- getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
912
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
913
- };
914
-
915
- exports.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) {
916
- const v = arg0;
917
- const ret = typeof(v) === 'boolean' ? v : undefined;
918
- return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
919
- };
920
-
921
- exports.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
922
- const ret = debugString(arg1);
923
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
924
- const len1 = WASM_VECTOR_LEN;
925
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
926
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
927
- };
928
-
929
- exports.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) {
930
- const ret = arg0 in arg1;
931
- return ret;
932
- };
933
-
934
- exports.__wbg___wbindgen_is_bigint_0e1a2e3f55cfae27 = function(arg0) {
935
- const ret = typeof(arg0) === 'bigint';
936
- return ret;
937
- };
938
-
939
- exports.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) {
940
- const ret = typeof(arg0) === 'function';
941
- return ret;
942
- };
943
-
944
- exports.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) {
945
- const val = arg0;
946
- const ret = typeof(val) === 'object' && val !== null;
947
- return ret;
948
- };
949
-
950
- exports.__wbg___wbindgen_is_string_704ef9c8fc131030 = function(arg0) {
951
- const ret = typeof(arg0) === 'string';
952
- return ret;
953
- };
954
-
955
- exports.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) {
956
- const ret = arg0 === undefined;
957
- return ret;
958
- };
959
-
960
- exports.__wbg___wbindgen_jsval_eq_b6101cc9cef1fe36 = function(arg0, arg1) {
961
- const ret = arg0 === arg1;
962
- return ret;
963
- };
964
-
965
- exports.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) {
966
- const ret = arg0 == arg1;
967
- return ret;
968
- };
969
-
970
- exports.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
971
- const obj = arg1;
972
- const ret = typeof(obj) === 'number' ? obj : undefined;
973
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
974
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
975
- };
976
-
977
- exports.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) {
978
- const obj = arg1;
979
- const ret = typeof(obj) === 'string' ? obj : undefined;
980
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
981
- var len1 = WASM_VECTOR_LEN;
982
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
983
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
984
- };
985
-
986
- exports.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
987
- throw new Error(getStringFromWasm0(arg0, arg1));
988
- };
989
-
990
- exports.__wbg__wbg_cb_unref_87dfb5aaa0cbcea7 = function(arg0) {
991
- arg0._wbg_cb_unref();
992
- };
993
-
994
- exports.__wbg_abort_07646c894ebbf2bd = function(arg0) {
995
- arg0.abort();
996
- };
997
-
998
- exports.__wbg_abort_399ecbcfd6ef3c8e = function(arg0, arg1) {
999
- arg0.abort(arg1);
1000
- };
1001
-
1002
- exports.__wbg_append_c5cbdf46455cc776 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1003
- arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
1004
- }, arguments) };
1005
-
1006
- exports.__wbg_arrayBuffer_c04af4fce566092d = function() { return handleError(function (arg0) {
1007
- const ret = arg0.arrayBuffer();
1008
- return ret;
1009
- }, arguments) };
1010
-
1011
- exports.__wbg_authorizeresult_new = function(arg0) {
1012
- const ret = AuthorizeResult.__wrap(arg0);
1013
- return ret;
1014
- };
1015
-
1016
- exports.__wbg_call_3020136f7a2d6e44 = function() { return handleError(function (arg0, arg1, arg2) {
1017
- const ret = arg0.call(arg1, arg2);
1018
- return ret;
1019
- }, arguments) };
1020
-
1021
- exports.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) {
1022
- const ret = arg0.call(arg1);
1023
- return ret;
1024
- }, arguments) };
1025
-
1026
- exports.__wbg_cedarling_new = function(arg0) {
1027
- const ret = Cedarling.__wrap(arg0);
1028
- return ret;
1029
- };
1030
-
1031
- exports.__wbg_clearTimeout_b716ecb44bea14ed = function(arg0) {
1032
- const ret = clearTimeout(arg0);
1033
- return ret;
1034
- };
1035
610
 
1036
- exports.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
1037
- const ret = arg0.crypto;
1038
- return ret;
1039
- };
1040
-
1041
- exports.__wbg_debug_24d884048190fccc = function(arg0) {
1042
- console.debug(...arg0);
1043
- };
1044
-
1045
- exports.__wbg_done_62ea16af4ce34b24 = function(arg0) {
1046
- const ret = arg0.done;
1047
- return ret;
1048
- };
1049
-
1050
- exports.__wbg_entries_83c79938054e065f = function(arg0) {
1051
- const ret = Object.entries(arg0);
1052
- return ret;
1053
- };
1054
-
1055
- exports.__wbg_entries_9af46b7eaf7dfefa = function(arg0) {
1056
- const ret = arg0.entries();
611
+ /**
612
+ * Create a new instance of the Cedarling application from archive bytes.
613
+ *
614
+ * This function allows loading a policy store from a Cedar Archive (.cjar)
615
+ * that was fetched with custom logic (e.g., with authentication headers).
616
+ *
617
+ * # Arguments
618
+ * * `config` - Bootstrap configuration (Map or Object). Policy store config is ignored.
619
+ * * `archive_bytes` - The .cjar archive bytes (Uint8Array)
620
+ *
621
+ * # Example
622
+ * ```javascript
623
+ * const response = await fetch(url, { headers: { Authorization: 'Bearer ...' } });
624
+ * const bytes = new Uint8Array(await response.arrayBuffer());
625
+ * const cedarling = await init_from_archive_bytes(config, bytes);
626
+ * ```
627
+ * @param {any} config
628
+ * @param {Uint8Array} archive_bytes
629
+ * @returns {Promise<Cedarling>}
630
+ */
631
+ export function init_from_archive_bytes(config, archive_bytes) {
632
+ const ret = wasm.init_from_archive_bytes(config, archive_bytes);
1057
633
  return ret;
1058
- };
1059
-
1060
- exports.__wbg_error_98d791de55bc7c97 = function(arg0) {
1061
- console.error(...arg0);
1062
- };
634
+ }
1063
635
 
1064
- exports.__wbg_fetch_7fb7602a1bf647ec = function(arg0) {
1065
- const ret = fetch(arg0);
1066
- return ret;
1067
- };
636
+ function __wbg_get_imports() {
637
+ const import0 = {
638
+ __proto__: null,
639
+ __wbg_Error_8c4e43fe74559d73: function(arg0, arg1) {
640
+ const ret = Error(getStringFromWasm0(arg0, arg1));
641
+ return ret;
642
+ },
643
+ __wbg_Number_04624de7d0e8332d: function(arg0) {
644
+ const ret = Number(arg0);
645
+ return ret;
646
+ },
647
+ __wbg_String_8f0eb39a4a4c2f66: function(arg0, arg1) {
648
+ const ret = String(arg1);
649
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
650
+ const len1 = WASM_VECTOR_LEN;
651
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
652
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
653
+ },
654
+ __wbg___wbindgen_bigint_get_as_i64_8fcf4ce7f1ca72a2: function(arg0, arg1) {
655
+ const v = arg1;
656
+ const ret = typeof(v) === 'bigint' ? v : undefined;
657
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
658
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
659
+ },
660
+ __wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25: function(arg0) {
661
+ const v = arg0;
662
+ const ret = typeof(v) === 'boolean' ? v : undefined;
663
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
664
+ },
665
+ __wbg___wbindgen_debug_string_0bc8482c6e3508ae: function(arg0, arg1) {
666
+ const ret = debugString(arg1);
667
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
668
+ const len1 = WASM_VECTOR_LEN;
669
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
670
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
671
+ },
672
+ __wbg___wbindgen_in_47fa6863be6f2f25: function(arg0, arg1) {
673
+ const ret = arg0 in arg1;
674
+ return ret;
675
+ },
676
+ __wbg___wbindgen_is_bigint_31b12575b56f32fc: function(arg0) {
677
+ const ret = typeof(arg0) === 'bigint';
678
+ return ret;
679
+ },
680
+ __wbg___wbindgen_is_function_0095a73b8b156f76: function(arg0) {
681
+ const ret = typeof(arg0) === 'function';
682
+ return ret;
683
+ },
684
+ __wbg___wbindgen_is_object_5ae8e5880f2c1fbd: function(arg0) {
685
+ const val = arg0;
686
+ const ret = typeof(val) === 'object' && val !== null;
687
+ return ret;
688
+ },
689
+ __wbg___wbindgen_is_string_cd444516edc5b180: function(arg0) {
690
+ const ret = typeof(arg0) === 'string';
691
+ return ret;
692
+ },
693
+ __wbg___wbindgen_is_undefined_9e4d92534c42d778: function(arg0) {
694
+ const ret = arg0 === undefined;
695
+ return ret;
696
+ },
697
+ __wbg___wbindgen_jsval_eq_11888390b0186270: function(arg0, arg1) {
698
+ const ret = arg0 === arg1;
699
+ return ret;
700
+ },
701
+ __wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811: function(arg0, arg1) {
702
+ const ret = arg0 == arg1;
703
+ return ret;
704
+ },
705
+ __wbg___wbindgen_number_get_8ff4255516ccad3e: function(arg0, arg1) {
706
+ const obj = arg1;
707
+ const ret = typeof(obj) === 'number' ? obj : undefined;
708
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
709
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
710
+ },
711
+ __wbg___wbindgen_string_get_72fb696202c56729: function(arg0, arg1) {
712
+ const obj = arg1;
713
+ const ret = typeof(obj) === 'string' ? obj : undefined;
714
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
715
+ var len1 = WASM_VECTOR_LEN;
716
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
717
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
718
+ },
719
+ __wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
720
+ throw new Error(getStringFromWasm0(arg0, arg1));
721
+ },
722
+ __wbg__wbg_cb_unref_d9b87ff7982e3b21: function(arg0) {
723
+ arg0._wbg_cb_unref();
724
+ },
725
+ __wbg_abort_2f0584e03e8e3950: function(arg0) {
726
+ arg0.abort();
727
+ },
728
+ __wbg_abort_d549b92d3c665de1: function(arg0, arg1) {
729
+ arg0.abort(arg1);
730
+ },
731
+ __wbg_append_a992ccc37aa62dc4: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
732
+ arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
733
+ }, arguments); },
734
+ __wbg_arrayBuffer_bb54076166006c39: function() { return handleError(function (arg0) {
735
+ const ret = arg0.arrayBuffer();
736
+ return ret;
737
+ }, arguments); },
738
+ __wbg_authorizeresult_new: function(arg0) {
739
+ const ret = AuthorizeResult.__wrap(arg0);
740
+ return ret;
741
+ },
742
+ __wbg_call_389efe28435a9388: function() { return handleError(function (arg0, arg1) {
743
+ const ret = arg0.call(arg1);
744
+ return ret;
745
+ }, arguments); },
746
+ __wbg_call_4708e0c13bdc8e95: function() { return handleError(function (arg0, arg1, arg2) {
747
+ const ret = arg0.call(arg1, arg2);
748
+ return ret;
749
+ }, arguments); },
750
+ __wbg_cedarling_new: function(arg0) {
751
+ const ret = Cedarling.__wrap(arg0);
752
+ return ret;
753
+ },
754
+ __wbg_clearTimeout_42d9ccd50822fd3a: function(arg0) {
755
+ const ret = clearTimeout(arg0);
756
+ return ret;
757
+ },
758
+ __wbg_crypto_86f2631e91b51511: function(arg0) {
759
+ const ret = arg0.crypto;
760
+ return ret;
761
+ },
762
+ __wbg_debug_8b4b5465cbd54cd3: function(arg0) {
763
+ console.debug(...arg0);
764
+ },
765
+ __wbg_done_57b39ecd9addfe81: function(arg0) {
766
+ const ret = arg0.done;
767
+ return ret;
768
+ },
769
+ __wbg_entries_200a450561fa274f: function(arg0) {
770
+ const ret = arg0.entries();
771
+ return ret;
772
+ },
773
+ __wbg_entries_58c7934c745daac7: function(arg0) {
774
+ const ret = Object.entries(arg0);
775
+ return ret;
776
+ },
777
+ __wbg_error_62201eec3c0d66f9: function(arg0) {
778
+ console.error(...arg0);
779
+ },
780
+ __wbg_fetch_6bbc32f991730587: function(arg0) {
781
+ const ret = fetch(arg0);
782
+ return ret;
783
+ },
784
+ __wbg_fetch_afb6a4b6cacf876d: function(arg0, arg1) {
785
+ const ret = arg0.fetch(arg1);
786
+ return ret;
787
+ },
788
+ __wbg_fromEntries_7fb5bc874dbe50d5: function() { return handleError(function (arg0) {
789
+ const ret = Object.fromEntries(arg0);
790
+ return ret;
791
+ }, arguments); },
792
+ __wbg_getRandomValues_1c61fac11405ffdc: function() { return handleError(function (arg0, arg1) {
793
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
794
+ }, arguments); },
795
+ __wbg_getRandomValues_b3f15fcbfabb0f8b: function() { return handleError(function (arg0, arg1) {
796
+ arg0.getRandomValues(arg1);
797
+ }, arguments); },
798
+ __wbg_getTime_1e3cd1391c5c3995: function(arg0) {
799
+ const ret = arg0.getTime();
800
+ return ret;
801
+ },
802
+ __wbg_getTimezoneOffset_81776d10a4ec18a8: function(arg0) {
803
+ const ret = arg0.getTimezoneOffset();
804
+ return ret;
805
+ },
806
+ __wbg_get_9b94d73e6221f75c: function(arg0, arg1) {
807
+ const ret = arg0[arg1 >>> 0];
808
+ return ret;
809
+ },
810
+ __wbg_get_b3ed3ad4be2bc8ac: function() { return handleError(function (arg0, arg1) {
811
+ const ret = Reflect.get(arg0, arg1);
812
+ return ret;
813
+ }, arguments); },
814
+ __wbg_get_with_ref_key_1dc361bd10053bfe: function(arg0, arg1) {
815
+ const ret = arg0[arg1];
816
+ return ret;
817
+ },
818
+ __wbg_has_d4e53238966c12b6: function() { return handleError(function (arg0, arg1) {
819
+ const ret = Reflect.has(arg0, arg1);
820
+ return ret;
821
+ }, arguments); },
822
+ __wbg_headers_59a2938db9f80985: function(arg0) {
823
+ const ret = arg0.headers;
824
+ return ret;
825
+ },
826
+ __wbg_info_eb43cb09e10f8150: function(arg0) {
827
+ console.info(...arg0);
828
+ },
829
+ __wbg_instanceof_ArrayBuffer_c367199e2fa2aa04: function(arg0) {
830
+ let result;
831
+ try {
832
+ result = arg0 instanceof ArrayBuffer;
833
+ } catch (_) {
834
+ result = false;
835
+ }
836
+ const ret = result;
837
+ return ret;
838
+ },
839
+ __wbg_instanceof_Array_d9eac779cd191cbc: function(arg0) {
840
+ let result;
841
+ try {
842
+ result = arg0 instanceof Array;
843
+ } catch (_) {
844
+ result = false;
845
+ }
846
+ const ret = result;
847
+ return ret;
848
+ },
849
+ __wbg_instanceof_Map_53af74335dec57f4: function(arg0) {
850
+ let result;
851
+ try {
852
+ result = arg0 instanceof Map;
853
+ } catch (_) {
854
+ result = false;
855
+ }
856
+ const ret = result;
857
+ return ret;
858
+ },
859
+ __wbg_instanceof_Response_ee1d54d79ae41977: function(arg0) {
860
+ let result;
861
+ try {
862
+ result = arg0 instanceof Response;
863
+ } catch (_) {
864
+ result = false;
865
+ }
866
+ const ret = result;
867
+ return ret;
868
+ },
869
+ __wbg_instanceof_Uint8Array_9b9075935c74707c: function(arg0) {
870
+ let result;
871
+ try {
872
+ result = arg0 instanceof Uint8Array;
873
+ } catch (_) {
874
+ result = false;
875
+ }
876
+ const ret = result;
877
+ return ret;
878
+ },
879
+ __wbg_isArray_d314bb98fcf08331: function(arg0) {
880
+ const ret = Array.isArray(arg0);
881
+ return ret;
882
+ },
883
+ __wbg_isSafeInteger_bfbc7332a9768d2a: function(arg0) {
884
+ const ret = Number.isSafeInteger(arg0);
885
+ return ret;
886
+ },
887
+ __wbg_iterator_6ff6560ca1568e55: function() {
888
+ const ret = Symbol.iterator;
889
+ return ret;
890
+ },
891
+ __wbg_keys_b50a709a76add04e: function(arg0) {
892
+ const ret = Object.keys(arg0);
893
+ return ret;
894
+ },
895
+ __wbg_length_32ed9a279acd054c: function(arg0) {
896
+ const ret = arg0.length;
897
+ return ret;
898
+ },
899
+ __wbg_length_35a7bace40f36eac: function(arg0) {
900
+ const ret = arg0.length;
901
+ return ret;
902
+ },
903
+ __wbg_log_aa96eafb763b3303: function(arg0) {
904
+ console.log(...arg0);
905
+ },
906
+ __wbg_msCrypto_d562bbe83e0d4b91: function(arg0) {
907
+ const ret = arg0.msCrypto;
908
+ return ret;
909
+ },
910
+ __wbg_multiissuerauthorizeresult_new: function(arg0) {
911
+ const ret = MultiIssuerAuthorizeResult.__wrap(arg0);
912
+ return ret;
913
+ },
914
+ __wbg_new_0_73afc35eb544e539: function() {
915
+ const ret = new Date();
916
+ return ret;
917
+ },
918
+ __wbg_new_245cd5c49157e602: function(arg0) {
919
+ const ret = new Date(arg0);
920
+ return ret;
921
+ },
922
+ __wbg_new_361308b2356cecd0: function() {
923
+ const ret = new Object();
924
+ return ret;
925
+ },
926
+ __wbg_new_3eb36ae241fe6f44: function() {
927
+ const ret = new Array();
928
+ return ret;
929
+ },
930
+ __wbg_new_64284bd487f9d239: function() { return handleError(function () {
931
+ const ret = new Headers();
932
+ return ret;
933
+ }, arguments); },
934
+ __wbg_new_b5d9e2fb389fef91: function(arg0, arg1) {
935
+ try {
936
+ var state0 = {a: arg0, b: arg1};
937
+ var cb0 = (arg0, arg1) => {
938
+ const a = state0.a;
939
+ state0.a = 0;
940
+ try {
941
+ return wasm_bindgen__convert__closures_____invoke__h0faf1ddcbd616c7a(a, state0.b, arg0, arg1);
942
+ } finally {
943
+ state0.a = a;
944
+ }
945
+ };
946
+ const ret = new Promise(cb0);
947
+ return ret;
948
+ } finally {
949
+ state0.a = state0.b = 0;
950
+ }
951
+ },
952
+ __wbg_new_b949e7f56150a5d1: function() { return handleError(function () {
953
+ const ret = new AbortController();
954
+ return ret;
955
+ }, arguments); },
956
+ __wbg_new_dca287b076112a51: function() {
957
+ const ret = new Map();
958
+ return ret;
959
+ },
960
+ __wbg_new_dd2b680c8bf6ae29: function(arg0) {
961
+ const ret = new Uint8Array(arg0);
962
+ return ret;
963
+ },
964
+ __wbg_new_from_slice_a3d2629dc1826784: function(arg0, arg1) {
965
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
966
+ return ret;
967
+ },
968
+ __wbg_new_no_args_1c7c842f08d00ebb: function(arg0, arg1) {
969
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
970
+ return ret;
971
+ },
972
+ __wbg_new_with_args_7bba34e94b1cfa40: function(arg0, arg1, arg2, arg3) {
973
+ const ret = new Function(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
974
+ return ret;
975
+ },
976
+ __wbg_new_with_length_a2c39cbe88fd8ff1: function(arg0) {
977
+ const ret = new Uint8Array(arg0 >>> 0);
978
+ return ret;
979
+ },
980
+ __wbg_new_with_str_and_init_a61cbc6bdef21614: function() { return handleError(function (arg0, arg1, arg2) {
981
+ const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
982
+ return ret;
983
+ }, arguments); },
984
+ __wbg_next_3482f54c49e8af19: function() { return handleError(function (arg0) {
985
+ const ret = arg0.next();
986
+ return ret;
987
+ }, arguments); },
988
+ __wbg_next_418f80d8f5303233: function(arg0) {
989
+ const ret = arg0.next;
990
+ return ret;
991
+ },
992
+ __wbg_node_e1f24f89a7336c2e: function(arg0) {
993
+ const ret = arg0.node;
994
+ return ret;
995
+ },
996
+ __wbg_policyevaluationerror_new: function(arg0) {
997
+ const ret = PolicyEvaluationError.__wrap(arg0);
998
+ return ret;
999
+ },
1000
+ __wbg_process_3975fd6c72f520aa: function(arg0) {
1001
+ const ret = arg0.process;
1002
+ return ret;
1003
+ },
1004
+ __wbg_prototypesetcall_bdcdcc5842e4d77d: function(arg0, arg1, arg2) {
1005
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1006
+ },
1007
+ __wbg_push_8ffdcb2063340ba5: function(arg0, arg1) {
1008
+ const ret = arg0.push(arg1);
1009
+ return ret;
1010
+ },
1011
+ __wbg_queueMicrotask_0aa0a927f78f5d98: function(arg0) {
1012
+ const ret = arg0.queueMicrotask;
1013
+ return ret;
1014
+ },
1015
+ __wbg_queueMicrotask_5bb536982f78a56f: function(arg0) {
1016
+ queueMicrotask(arg0);
1017
+ },
1018
+ __wbg_randomFillSync_f8c153b79f285817: function() { return handleError(function (arg0, arg1) {
1019
+ arg0.randomFillSync(arg1);
1020
+ }, arguments); },
1021
+ __wbg_require_b74f47fc2d022fd6: function() { return handleError(function () {
1022
+ const ret = module.require;
1023
+ return ret;
1024
+ }, arguments); },
1025
+ __wbg_resolve_002c4b7d9d8f6b64: function(arg0) {
1026
+ const ret = Promise.resolve(arg0);
1027
+ return ret;
1028
+ },
1029
+ __wbg_setTimeout_4ec014681668a581: function(arg0, arg1) {
1030
+ const ret = setTimeout(arg0, arg1);
1031
+ return ret;
1032
+ },
1033
+ __wbg_set_1eb0999cf5d27fc8: function(arg0, arg1, arg2) {
1034
+ const ret = arg0.set(arg1, arg2);
1035
+ return ret;
1036
+ },
1037
+ __wbg_set_3f1d0b984ed272ed: function(arg0, arg1, arg2) {
1038
+ arg0[arg1] = arg2;
1039
+ },
1040
+ __wbg_set_6cb8631f80447a67: function() { return handleError(function (arg0, arg1, arg2) {
1041
+ const ret = Reflect.set(arg0, arg1, arg2);
1042
+ return ret;
1043
+ }, arguments); },
1044
+ __wbg_set_body_9a7e00afe3cfe244: function(arg0, arg1) {
1045
+ arg0.body = arg1;
1046
+ },
1047
+ __wbg_set_cache_315a3ed773a41543: function(arg0, arg1) {
1048
+ arg0.cache = __wbindgen_enum_RequestCache[arg1];
1049
+ },
1050
+ __wbg_set_credentials_c4a58d2e05ef24fb: function(arg0, arg1) {
1051
+ arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
1052
+ },
1053
+ __wbg_set_f43e577aea94465b: function(arg0, arg1, arg2) {
1054
+ arg0[arg1 >>> 0] = arg2;
1055
+ },
1056
+ __wbg_set_headers_cfc5f4b2c1f20549: function(arg0, arg1) {
1057
+ arg0.headers = arg1;
1058
+ },
1059
+ __wbg_set_method_c3e20375f5ae7fac: function(arg0, arg1, arg2) {
1060
+ arg0.method = getStringFromWasm0(arg1, arg2);
1061
+ },
1062
+ __wbg_set_mode_b13642c312648202: function(arg0, arg1) {
1063
+ arg0.mode = __wbindgen_enum_RequestMode[arg1];
1064
+ },
1065
+ __wbg_set_signal_f2d3f8599248896d: function(arg0, arg1) {
1066
+ arg0.signal = arg1;
1067
+ },
1068
+ __wbg_signal_d1285ecab4ebc5ad: function(arg0) {
1069
+ const ret = arg0.signal;
1070
+ return ret;
1071
+ },
1072
+ __wbg_static_accessor_GLOBAL_12837167ad935116: function() {
1073
+ const ret = typeof global === 'undefined' ? null : global;
1074
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1075
+ },
1076
+ __wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f: function() {
1077
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
1078
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1079
+ },
1080
+ __wbg_static_accessor_SELF_a621d3dfbb60d0ce: function() {
1081
+ const ret = typeof self === 'undefined' ? null : self;
1082
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1083
+ },
1084
+ __wbg_static_accessor_WINDOW_f8727f0cf888e0bd: function() {
1085
+ const ret = typeof window === 'undefined' ? null : window;
1086
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1087
+ },
1088
+ __wbg_status_89d7e803db911ee7: function(arg0) {
1089
+ const ret = arg0.status;
1090
+ return ret;
1091
+ },
1092
+ __wbg_stringify_8d1cc6ff383e8bae: function() { return handleError(function (arg0) {
1093
+ const ret = JSON.stringify(arg0);
1094
+ return ret;
1095
+ }, arguments); },
1096
+ __wbg_subarray_a96e1fef17ed23cb: function(arg0, arg1, arg2) {
1097
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1098
+ return ret;
1099
+ },
1100
+ __wbg_text_083b8727c990c8c0: function() { return handleError(function (arg0) {
1101
+ const ret = arg0.text();
1102
+ return ret;
1103
+ }, arguments); },
1104
+ __wbg_then_0d9fe2c7b1857d32: function(arg0, arg1, arg2) {
1105
+ const ret = arg0.then(arg1, arg2);
1106
+ return ret;
1107
+ },
1108
+ __wbg_then_b9e7b3b5f1a9e1b5: function(arg0, arg1) {
1109
+ const ret = arg0.then(arg1);
1110
+ return ret;
1111
+ },
1112
+ __wbg_trace_21a493b80d415f00: function(arg0) {
1113
+ console.trace(...arg0);
1114
+ },
1115
+ __wbg_url_c484c26b1fbf5126: function(arg0, arg1) {
1116
+ const ret = arg1.url;
1117
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1118
+ const len1 = WASM_VECTOR_LEN;
1119
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1120
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1121
+ },
1122
+ __wbg_value_0546255b415e96c1: function(arg0) {
1123
+ const ret = arg0.value;
1124
+ return ret;
1125
+ },
1126
+ __wbg_versions_4e31226f5e8dc909: function(arg0) {
1127
+ const ret = arg0.versions;
1128
+ return ret;
1129
+ },
1130
+ __wbg_warn_f3657073f42e55b4: function(arg0) {
1131
+ console.warn(...arg0);
1132
+ },
1133
+ __wbindgen_cast_0000000000000001: function(arg0, arg1) {
1134
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 553, function: Function { arguments: [], shim_idx: 554, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1135
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h093a13d1206f793f, wasm_bindgen__convert__closures_____invoke__h07e5bc5e1bd52c7a);
1136
+ return ret;
1137
+ },
1138
+ __wbindgen_cast_0000000000000002: function(arg0, arg1) {
1139
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 597, function: Function { arguments: [Externref], shim_idx: 598, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1140
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h203c69ac48ff2433, wasm_bindgen__convert__closures_____invoke__h409efd46af9acece);
1141
+ return ret;
1142
+ },
1143
+ __wbindgen_cast_0000000000000003: function(arg0) {
1144
+ // Cast intrinsic for `F64 -> Externref`.
1145
+ const ret = arg0;
1146
+ return ret;
1147
+ },
1148
+ __wbindgen_cast_0000000000000004: function(arg0) {
1149
+ // Cast intrinsic for `I64 -> Externref`.
1150
+ const ret = arg0;
1151
+ return ret;
1152
+ },
1153
+ __wbindgen_cast_0000000000000005: function(arg0, arg1) {
1154
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1155
+ const ret = getArrayU8FromWasm0(arg0, arg1);
1156
+ return ret;
1157
+ },
1158
+ __wbindgen_cast_0000000000000006: function(arg0, arg1) {
1159
+ // Cast intrinsic for `Ref(String) -> Externref`.
1160
+ const ret = getStringFromWasm0(arg0, arg1);
1161
+ return ret;
1162
+ },
1163
+ __wbindgen_cast_0000000000000007: function(arg0) {
1164
+ // Cast intrinsic for `U64 -> Externref`.
1165
+ const ret = BigInt.asUintN(64, arg0);
1166
+ return ret;
1167
+ },
1168
+ __wbindgen_init_externref_table: function() {
1169
+ const table = wasm.__wbindgen_externrefs;
1170
+ const offset = table.grow(4);
1171
+ table.set(0, undefined);
1172
+ table.set(offset + 0, undefined);
1173
+ table.set(offset + 1, null);
1174
+ table.set(offset + 2, true);
1175
+ table.set(offset + 3, false);
1176
+ },
1177
+ };
1178
+ return {
1179
+ __proto__: null,
1180
+ "./cedarling_wasm_bg.js": import0,
1181
+ };
1182
+ }
1068
1183
 
1069
- exports.__wbg_fetch_90447c28cc0b095e = function(arg0, arg1) {
1070
- const ret = arg0.fetch(arg1);
1071
- return ret;
1072
- };
1184
+ function wasm_bindgen__convert__closures_____invoke__h07e5bc5e1bd52c7a(arg0, arg1) {
1185
+ wasm.wasm_bindgen__convert__closures_____invoke__h07e5bc5e1bd52c7a(arg0, arg1);
1186
+ }
1073
1187
 
1074
- exports.__wbg_fromEntries_743eaaa008e6db37 = function() { return handleError(function (arg0) {
1075
- const ret = Object.fromEntries(arg0);
1076
- return ret;
1077
- }, arguments) };
1188
+ function wasm_bindgen__convert__closures_____invoke__h409efd46af9acece(arg0, arg1, arg2) {
1189
+ wasm.wasm_bindgen__convert__closures_____invoke__h409efd46af9acece(arg0, arg1, arg2);
1190
+ }
1078
1191
 
1079
- exports.__wbg_getRandomValues_1c61fac11405ffdc = function() { return handleError(function (arg0, arg1) {
1080
- globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1081
- }, arguments) };
1192
+ function wasm_bindgen__convert__closures_____invoke__h0faf1ddcbd616c7a(arg0, arg1, arg2, arg3) {
1193
+ wasm.wasm_bindgen__convert__closures_____invoke__h0faf1ddcbd616c7a(arg0, arg1, arg2, arg3);
1194
+ }
1082
1195
 
1083
- exports.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
1084
- arg0.getRandomValues(arg1);
1085
- }, arguments) };
1086
1196
 
1087
- exports.__wbg_getTime_ad1e9878a735af08 = function(arg0) {
1088
- const ret = arg0.getTime();
1089
- return ret;
1090
- };
1197
+ const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
1091
1198
 
1092
- exports.__wbg_getTimezoneOffset_45389e26d6f46823 = function(arg0) {
1093
- const ret = arg0.getTimezoneOffset();
1094
- return ret;
1095
- };
1096
1199
 
1097
- exports.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) {
1098
- const ret = arg0[arg1 >>> 0];
1099
- return ret;
1100
- };
1200
+ const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
1101
1201
 
1102
- exports.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) {
1103
- const ret = Reflect.get(arg0, arg1);
1104
- return ret;
1105
- }, arguments) };
1106
1202
 
1107
- exports.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) {
1108
- const ret = arg0[arg1];
1109
- return ret;
1110
- };
1203
+ const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
1204
+ const AuthorizeResultFinalization = (typeof FinalizationRegistry === 'undefined')
1205
+ ? { register: () => {}, unregister: () => {} }
1206
+ : new FinalizationRegistry(ptr => wasm.__wbg_authorizeresult_free(ptr >>> 0, 1));
1207
+ const AuthorizeResultResponseFinalization = (typeof FinalizationRegistry === 'undefined')
1208
+ ? { register: () => {}, unregister: () => {} }
1209
+ : new FinalizationRegistry(ptr => wasm.__wbg_authorizeresultresponse_free(ptr >>> 0, 1));
1210
+ const CedarlingFinalization = (typeof FinalizationRegistry === 'undefined')
1211
+ ? { register: () => {}, unregister: () => {} }
1212
+ : new FinalizationRegistry(ptr => wasm.__wbg_cedarling_free(ptr >>> 0, 1));
1213
+ const DiagnosticsFinalization = (typeof FinalizationRegistry === 'undefined')
1214
+ ? { register: () => {}, unregister: () => {} }
1215
+ : new FinalizationRegistry(ptr => wasm.__wbg_diagnostics_free(ptr >>> 0, 1));
1216
+ const JsJsonLogicFinalization = (typeof FinalizationRegistry === 'undefined')
1217
+ ? { register: () => {}, unregister: () => {} }
1218
+ : new FinalizationRegistry(ptr => wasm.__wbg_jsjsonlogic_free(ptr >>> 0, 1));
1219
+ const MultiIssuerAuthorizeResultFinalization = (typeof FinalizationRegistry === 'undefined')
1220
+ ? { register: () => {}, unregister: () => {} }
1221
+ : new FinalizationRegistry(ptr => wasm.__wbg_multiissuerauthorizeresult_free(ptr >>> 0, 1));
1222
+ const PolicyEvaluationErrorFinalization = (typeof FinalizationRegistry === 'undefined')
1223
+ ? { register: () => {}, unregister: () => {} }
1224
+ : new FinalizationRegistry(ptr => wasm.__wbg_policyevaluationerror_free(ptr >>> 0, 1));
1111
1225
 
1112
- exports.__wbg_has_0e670569d65d3a45 = function() { return handleError(function (arg0, arg1) {
1113
- const ret = Reflect.has(arg0, arg1);
1114
- return ret;
1115
- }, arguments) };
1226
+ function addToExternrefTable0(obj) {
1227
+ const idx = wasm.__externref_table_alloc();
1228
+ wasm.__wbindgen_externrefs.set(idx, obj);
1229
+ return idx;
1230
+ }
1116
1231
 
1117
- exports.__wbg_headers_654c30e1bcccc552 = function(arg0) {
1118
- const ret = arg0.headers;
1119
- return ret;
1120
- };
1232
+ function _assertClass(instance, klass) {
1233
+ if (!(instance instanceof klass)) {
1234
+ throw new Error(`expected instance of ${klass.name}`);
1235
+ }
1236
+ }
1121
1237
 
1122
- exports.__wbg_info_e951478d580c1573 = function(arg0) {
1123
- console.info(...arg0);
1124
- };
1238
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
1239
+ ? { register: () => {}, unregister: () => {} }
1240
+ : new FinalizationRegistry(state => state.dtor(state.a, state.b));
1125
1241
 
1126
- exports.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) {
1127
- let result;
1128
- try {
1129
- result = arg0 instanceof ArrayBuffer;
1130
- } catch (_) {
1131
- result = false;
1242
+ function debugString(val) {
1243
+ // primitive types
1244
+ const type = typeof val;
1245
+ if (type == 'number' || type == 'boolean' || val == null) {
1246
+ return `${val}`;
1132
1247
  }
1133
- const ret = result;
1134
- return ret;
1135
- };
1136
-
1137
- exports.__wbg_instanceof_Array_bc64f5da83077362 = function(arg0) {
1138
- let result;
1139
- try {
1140
- result = arg0 instanceof Array;
1141
- } catch (_) {
1142
- result = false;
1248
+ if (type == 'string') {
1249
+ return `"${val}"`;
1250
+ }
1251
+ if (type == 'symbol') {
1252
+ const description = val.description;
1253
+ if (description == null) {
1254
+ return 'Symbol';
1255
+ } else {
1256
+ return `Symbol(${description})`;
1257
+ }
1258
+ }
1259
+ if (type == 'function') {
1260
+ const name = val.name;
1261
+ if (typeof name == 'string' && name.length > 0) {
1262
+ return `Function(${name})`;
1263
+ } else {
1264
+ return 'Function';
1265
+ }
1266
+ }
1267
+ // objects
1268
+ if (Array.isArray(val)) {
1269
+ const length = val.length;
1270
+ let debug = '[';
1271
+ if (length > 0) {
1272
+ debug += debugString(val[0]);
1273
+ }
1274
+ for(let i = 1; i < length; i++) {
1275
+ debug += ', ' + debugString(val[i]);
1276
+ }
1277
+ debug += ']';
1278
+ return debug;
1279
+ }
1280
+ // Test for built-in
1281
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
1282
+ let className;
1283
+ if (builtInMatches && builtInMatches.length > 1) {
1284
+ className = builtInMatches[1];
1285
+ } else {
1286
+ // Failed to match the standard '[object ClassName]'
1287
+ return toString.call(val);
1143
1288
  }
1144
- const ret = result;
1145
- return ret;
1146
- };
1147
-
1148
- exports.__wbg_instanceof_Map_084be8da74364158 = function(arg0) {
1149
- let result;
1150
- try {
1151
- result = arg0 instanceof Map;
1152
- } catch (_) {
1153
- result = false;
1289
+ if (className == 'Object') {
1290
+ // we're a user defined class or Object
1291
+ // JSON.stringify avoids problems with cycles, and is generally much
1292
+ // easier than looping through ownProperties of `val`.
1293
+ try {
1294
+ return 'Object(' + JSON.stringify(val) + ')';
1295
+ } catch (_) {
1296
+ return 'Object';
1297
+ }
1154
1298
  }
1155
- const ret = result;
1156
- return ret;
1157
- };
1158
-
1159
- exports.__wbg_instanceof_Response_cd74d1c2ac92cb0b = function(arg0) {
1160
- let result;
1161
- try {
1162
- result = arg0 instanceof Response;
1163
- } catch (_) {
1164
- result = false;
1299
+ // errors
1300
+ if (val instanceof Error) {
1301
+ return `${val.name}: ${val.message}\n${val.stack}`;
1165
1302
  }
1166
- const ret = result;
1167
- return ret;
1168
- };
1303
+ // TODO we could test for more things here, like `Set`s and `Map`s.
1304
+ return className;
1305
+ }
1169
1306
 
1170
- exports.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) {
1171
- let result;
1172
- try {
1173
- result = arg0 instanceof Uint8Array;
1174
- } catch (_) {
1175
- result = false;
1307
+ function getArrayJsValueFromWasm0(ptr, len) {
1308
+ ptr = ptr >>> 0;
1309
+ const mem = getDataViewMemory0();
1310
+ const result = [];
1311
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
1312
+ result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
1176
1313
  }
1177
- const ret = result;
1178
- return ret;
1179
- };
1180
-
1181
- exports.__wbg_isArray_51fd9e6422c0a395 = function(arg0) {
1182
- const ret = Array.isArray(arg0);
1183
- return ret;
1184
- };
1185
-
1186
- exports.__wbg_isSafeInteger_ae7d3f054d55fa16 = function(arg0) {
1187
- const ret = Number.isSafeInteger(arg0);
1188
- return ret;
1189
- };
1190
-
1191
- exports.__wbg_iterator_27b7c8b35ab3e86b = function() {
1192
- const ret = Symbol.iterator;
1193
- return ret;
1194
- };
1195
-
1196
- exports.__wbg_keys_f5c6002ff150fc6c = function(arg0) {
1197
- const ret = Object.keys(arg0);
1198
- return ret;
1199
- };
1200
-
1201
- exports.__wbg_length_22ac23eaec9d8053 = function(arg0) {
1202
- const ret = arg0.length;
1203
- return ret;
1204
- };
1205
-
1206
- exports.__wbg_length_d45040a40c570362 = function(arg0) {
1207
- const ret = arg0.length;
1208
- return ret;
1209
- };
1210
-
1211
- exports.__wbg_log_3f650af133a6de58 = function(arg0) {
1212
- console.log(...arg0);
1213
- };
1214
-
1215
- exports.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
1216
- const ret = arg0.msCrypto;
1217
- return ret;
1218
- };
1219
-
1220
- exports.__wbg_multiissuerauthorizeresult_new = function(arg0) {
1221
- const ret = MultiIssuerAuthorizeResult.__wrap(arg0);
1222
- return ret;
1223
- };
1224
-
1225
- exports.__wbg_new_0_23cedd11d9b40c9d = function() {
1226
- const ret = new Date();
1227
- return ret;
1228
- };
1229
-
1230
- exports.__wbg_new_1ba21ce319a06297 = function() {
1231
- const ret = new Object();
1232
- return ret;
1233
- };
1234
-
1235
- exports.__wbg_new_25f239778d6112b9 = function() {
1236
- const ret = new Array();
1237
- return ret;
1238
- };
1239
-
1240
- exports.__wbg_new_3c79b3bb1b32b7d3 = function() { return handleError(function () {
1241
- const ret = new Headers();
1242
- return ret;
1243
- }, arguments) };
1314
+ wasm.__externref_drop_slice(ptr, len);
1315
+ return result;
1316
+ }
1244
1317
 
1245
- exports.__wbg_new_6421f6084cc5bc5a = function(arg0) {
1246
- const ret = new Uint8Array(arg0);
1247
- return ret;
1248
- };
1318
+ function getArrayU8FromWasm0(ptr, len) {
1319
+ ptr = ptr >>> 0;
1320
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
1321
+ }
1249
1322
 
1250
- exports.__wbg_new_881a222c65f168fc = function() { return handleError(function () {
1251
- const ret = new AbortController();
1252
- return ret;
1253
- }, arguments) };
1323
+ let cachedDataViewMemory0 = null;
1324
+ function getDataViewMemory0() {
1325
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
1326
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
1327
+ }
1328
+ return cachedDataViewMemory0;
1329
+ }
1254
1330
 
1255
- exports.__wbg_new_b2db8aa2650f793a = function(arg0) {
1256
- const ret = new Date(arg0);
1257
- return ret;
1258
- };
1331
+ function getStringFromWasm0(ptr, len) {
1332
+ ptr = ptr >>> 0;
1333
+ return decodeText(ptr, len);
1334
+ }
1259
1335
 
1260
- exports.__wbg_new_b546ae120718850e = function() {
1261
- const ret = new Map();
1262
- return ret;
1263
- };
1336
+ let cachedUint8ArrayMemory0 = null;
1337
+ function getUint8ArrayMemory0() {
1338
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
1339
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
1340
+ }
1341
+ return cachedUint8ArrayMemory0;
1342
+ }
1264
1343
 
1265
- exports.__wbg_new_ff12d2b041fb48f1 = function(arg0, arg1) {
1344
+ function handleError(f, args) {
1266
1345
  try {
1267
- var state0 = {a: arg0, b: arg1};
1268
- var cb0 = (arg0, arg1) => {
1269
- const a = state0.a;
1270
- state0.a = 0;
1271
- try {
1272
- return wasm_bindgen__convert__closures_____invoke__h3a7d0d99d266e2f8(a, state0.b, arg0, arg1);
1273
- } finally {
1274
- state0.a = a;
1275
- }
1276
- };
1277
- const ret = new Promise(cb0);
1278
- return ret;
1279
- } finally {
1280
- state0.a = state0.b = 0;
1346
+ return f.apply(this, args);
1347
+ } catch (e) {
1348
+ const idx = addToExternrefTable0(e);
1349
+ wasm.__wbindgen_exn_store(idx);
1281
1350
  }
1282
- };
1283
-
1284
- exports.__wbg_new_from_slice_f9c22b9153b26992 = function(arg0, arg1) {
1285
- const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
1286
- return ret;
1287
- };
1288
-
1289
- exports.__wbg_new_no_args_cb138f77cf6151ee = function(arg0, arg1) {
1290
- const ret = new Function(getStringFromWasm0(arg0, arg1));
1291
- return ret;
1292
- };
1293
-
1294
- exports.__wbg_new_with_args_df9e7125ffe55248 = function(arg0, arg1, arg2, arg3) {
1295
- const ret = new Function(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3));
1296
- return ret;
1297
- };
1298
-
1299
- exports.__wbg_new_with_length_aa5eaf41d35235e5 = function(arg0) {
1300
- const ret = new Uint8Array(arg0 >>> 0);
1301
- return ret;
1302
- };
1303
-
1304
- exports.__wbg_new_with_str_and_init_c5748f76f5108934 = function() { return handleError(function (arg0, arg1, arg2) {
1305
- const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
1306
- return ret;
1307
- }, arguments) };
1308
-
1309
- exports.__wbg_next_138a17bbf04e926c = function(arg0) {
1310
- const ret = arg0.next;
1311
- return ret;
1312
- };
1313
-
1314
- exports.__wbg_next_3cfe5c0fe2a4cc53 = function() { return handleError(function (arg0) {
1315
- const ret = arg0.next();
1316
- return ret;
1317
- }, arguments) };
1318
-
1319
- exports.__wbg_node_905d3e251edff8a2 = function(arg0) {
1320
- const ret = arg0.node;
1321
- return ret;
1322
- };
1323
-
1324
- exports.__wbg_policyevaluationerror_new = function(arg0) {
1325
- const ret = PolicyEvaluationError.__wrap(arg0);
1326
- return ret;
1327
- };
1328
-
1329
- exports.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
1330
- const ret = arg0.process;
1331
- return ret;
1332
- };
1333
-
1334
- exports.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) {
1335
- Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
1336
- };
1337
-
1338
- exports.__wbg_push_7d9be8f38fc13975 = function(arg0, arg1) {
1339
- const ret = arg0.push(arg1);
1340
- return ret;
1341
- };
1342
-
1343
- exports.__wbg_queueMicrotask_9b549dfce8865860 = function(arg0) {
1344
- const ret = arg0.queueMicrotask;
1345
- return ret;
1346
- };
1347
-
1348
- exports.__wbg_queueMicrotask_fca69f5bfad613a5 = function(arg0) {
1349
- queueMicrotask(arg0);
1350
- };
1351
-
1352
- exports.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
1353
- arg0.randomFillSync(arg1);
1354
- }, arguments) };
1355
-
1356
- exports.__wbg_require_60cc747a6bc5215a = function() { return handleError(function () {
1357
- const ret = module.require;
1358
- return ret;
1359
- }, arguments) };
1360
-
1361
- exports.__wbg_resolve_fd5bfbaa4ce36e1e = function(arg0) {
1362
- const ret = Promise.resolve(arg0);
1363
- return ret;
1364
- };
1365
-
1366
- exports.__wbg_setTimeout_4302406184dcc5be = function(arg0, arg1) {
1367
- const ret = setTimeout(arg0, arg1);
1368
- return ret;
1369
- };
1370
-
1371
- exports.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
1372
- arg0[arg1] = arg2;
1373
- };
1374
-
1375
- exports.__wbg_set_781438a03c0c3c81 = function() { return handleError(function (arg0, arg1, arg2) {
1376
- const ret = Reflect.set(arg0, arg1, arg2);
1377
- return ret;
1378
- }, arguments) };
1379
-
1380
- exports.__wbg_set_7df433eea03a5c14 = function(arg0, arg1, arg2) {
1381
- arg0[arg1 >>> 0] = arg2;
1382
- };
1351
+ }
1383
1352
 
1384
- exports.__wbg_set_body_8e743242d6076a4f = function(arg0, arg1) {
1385
- arg0.body = arg1;
1386
- };
1353
+ function isLikeNone(x) {
1354
+ return x === undefined || x === null;
1355
+ }
1387
1356
 
1388
- exports.__wbg_set_cache_0e437c7c8e838b9b = function(arg0, arg1) {
1389
- arg0.cache = __wbindgen_enum_RequestCache[arg1];
1390
- };
1357
+ function makeMutClosure(arg0, arg1, dtor, f) {
1358
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
1359
+ const real = (...args) => {
1391
1360
 
1392
- exports.__wbg_set_credentials_55ae7c3c106fd5be = function(arg0, arg1) {
1393
- arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
1394
- };
1361
+ // First up with a closure we increment the internal reference
1362
+ // count. This ensures that the Rust closure environment won't
1363
+ // be deallocated while we're invoking it.
1364
+ state.cnt++;
1365
+ const a = state.a;
1366
+ state.a = 0;
1367
+ try {
1368
+ return f(a, state.b, ...args);
1369
+ } finally {
1370
+ state.a = a;
1371
+ real._wbg_cb_unref();
1372
+ }
1373
+ };
1374
+ real._wbg_cb_unref = () => {
1375
+ if (--state.cnt === 0) {
1376
+ state.dtor(state.a, state.b);
1377
+ state.a = 0;
1378
+ CLOSURE_DTORS.unregister(state);
1379
+ }
1380
+ };
1381
+ CLOSURE_DTORS.register(real, state, state);
1382
+ return real;
1383
+ }
1395
1384
 
1396
- exports.__wbg_set_efaaf145b9377369 = function(arg0, arg1, arg2) {
1397
- const ret = arg0.set(arg1, arg2);
1398
- return ret;
1399
- };
1385
+ function passStringToWasm0(arg, malloc, realloc) {
1386
+ if (realloc === undefined) {
1387
+ const buf = cachedTextEncoder.encode(arg);
1388
+ const ptr = malloc(buf.length, 1) >>> 0;
1389
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
1390
+ WASM_VECTOR_LEN = buf.length;
1391
+ return ptr;
1392
+ }
1400
1393
 
1401
- exports.__wbg_set_headers_5671cf088e114d2b = function(arg0, arg1) {
1402
- arg0.headers = arg1;
1403
- };
1394
+ let len = arg.length;
1395
+ let ptr = malloc(len, 1) >>> 0;
1404
1396
 
1405
- exports.__wbg_set_method_76c69e41b3570627 = function(arg0, arg1, arg2) {
1406
- arg0.method = getStringFromWasm0(arg1, arg2);
1407
- };
1397
+ const mem = getUint8ArrayMemory0();
1408
1398
 
1409
- exports.__wbg_set_mode_611016a6818fc690 = function(arg0, arg1) {
1410
- arg0.mode = __wbindgen_enum_RequestMode[arg1];
1411
- };
1399
+ let offset = 0;
1412
1400
 
1413
- exports.__wbg_set_signal_e89be862d0091009 = function(arg0, arg1) {
1414
- arg0.signal = arg1;
1415
- };
1401
+ for (; offset < len; offset++) {
1402
+ const code = arg.charCodeAt(offset);
1403
+ if (code > 0x7F) break;
1404
+ mem[ptr + offset] = code;
1405
+ }
1406
+ if (offset !== len) {
1407
+ if (offset !== 0) {
1408
+ arg = arg.slice(offset);
1409
+ }
1410
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
1411
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
1412
+ const ret = cachedTextEncoder.encodeInto(arg, view);
1416
1413
 
1417
- exports.__wbg_signal_3c14fbdc89694b39 = function(arg0) {
1418
- const ret = arg0.signal;
1419
- return ret;
1420
- };
1414
+ offset += ret.written;
1415
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
1416
+ }
1421
1417
 
1422
- exports.__wbg_static_accessor_GLOBAL_769e6b65d6557335 = function() {
1423
- const ret = typeof global === 'undefined' ? null : global;
1424
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1425
- };
1418
+ WASM_VECTOR_LEN = offset;
1419
+ return ptr;
1420
+ }
1426
1421
 
1427
- exports.__wbg_static_accessor_GLOBAL_THIS_60cf02db4de8e1c1 = function() {
1428
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
1429
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1430
- };
1422
+ function takeFromExternrefTable0(idx) {
1423
+ const value = wasm.__wbindgen_externrefs.get(idx);
1424
+ wasm.__externref_table_dealloc(idx);
1425
+ return value;
1426
+ }
1431
1427
 
1432
- exports.__wbg_static_accessor_SELF_08f5a74c69739274 = function() {
1433
- const ret = typeof self === 'undefined' ? null : self;
1434
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1435
- };
1428
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1429
+ cachedTextDecoder.decode();
1430
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
1431
+ let numBytesDecoded = 0;
1432
+ function decodeText(ptr, len) {
1433
+ numBytesDecoded += len;
1434
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
1435
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
1436
+ cachedTextDecoder.decode();
1437
+ numBytesDecoded = len;
1438
+ }
1439
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
1440
+ }
1436
1441
 
1437
- exports.__wbg_static_accessor_WINDOW_a8924b26aa92d024 = function() {
1438
- const ret = typeof window === 'undefined' ? null : window;
1439
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
1440
- };
1442
+ const cachedTextEncoder = new TextEncoder();
1441
1443
 
1442
- exports.__wbg_status_9bfc680efca4bdfd = function(arg0) {
1443
- const ret = arg0.status;
1444
- return ret;
1445
- };
1444
+ if (!('encodeInto' in cachedTextEncoder)) {
1445
+ cachedTextEncoder.encodeInto = function (arg, view) {
1446
+ const buf = cachedTextEncoder.encode(arg);
1447
+ view.set(buf);
1448
+ return {
1449
+ read: arg.length,
1450
+ written: buf.length
1451
+ };
1452
+ };
1453
+ }
1446
1454
 
1447
- exports.__wbg_stringify_655a6390e1f5eb6b = function() { return handleError(function (arg0) {
1448
- const ret = JSON.stringify(arg0);
1449
- return ret;
1450
- }, arguments) };
1455
+ let WASM_VECTOR_LEN = 0;
1451
1456
 
1452
- exports.__wbg_subarray_845f2f5bce7d061a = function(arg0, arg1, arg2) {
1453
- const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
1454
- return ret;
1455
- };
1457
+ let wasmModule, wasm;
1458
+ function __wbg_finalize_init(instance, module) {
1459
+ wasm = instance.exports;
1460
+ wasmModule = module;
1461
+ cachedDataViewMemory0 = null;
1462
+ cachedUint8ArrayMemory0 = null;
1463
+ wasm.__wbindgen_start();
1464
+ return wasm;
1465
+ }
1456
1466
 
1457
- exports.__wbg_text_51046bb33d257f63 = function() { return handleError(function (arg0) {
1458
- const ret = arg0.text();
1459
- return ret;
1460
- }, arguments) };
1467
+ async function __wbg_load(module, imports) {
1468
+ if (typeof Response === 'function' && module instanceof Response) {
1469
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
1470
+ try {
1471
+ return await WebAssembly.instantiateStreaming(module, imports);
1472
+ } catch (e) {
1473
+ const validResponse = module.ok && expectedResponseType(module.type);
1461
1474
 
1462
- exports.__wbg_then_429f7caf1026411d = function(arg0, arg1, arg2) {
1463
- const ret = arg0.then(arg1, arg2);
1464
- return ret;
1465
- };
1475
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
1476
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
1466
1477
 
1467
- exports.__wbg_then_4f95312d68691235 = function(arg0, arg1) {
1468
- const ret = arg0.then(arg1);
1469
- return ret;
1470
- };
1478
+ } else { throw e; }
1479
+ }
1480
+ }
1471
1481
 
1472
- exports.__wbg_trace_b213249bfc587469 = function(arg0) {
1473
- console.trace(...arg0);
1474
- };
1482
+ const bytes = await module.arrayBuffer();
1483
+ return await WebAssembly.instantiate(bytes, imports);
1484
+ } else {
1485
+ const instance = await WebAssembly.instantiate(module, imports);
1475
1486
 
1476
- exports.__wbg_url_b6d11838a4f95198 = function(arg0, arg1) {
1477
- const ret = arg1.url;
1478
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1479
- const len1 = WASM_VECTOR_LEN;
1480
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
1481
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
1482
- };
1487
+ if (instance instanceof WebAssembly.Instance) {
1488
+ return { instance, module };
1489
+ } else {
1490
+ return instance;
1491
+ }
1492
+ }
1483
1493
 
1484
- exports.__wbg_value_57b7b035e117f7ee = function(arg0) {
1485
- const ret = arg0.value;
1486
- return ret;
1487
- };
1494
+ function expectedResponseType(type) {
1495
+ switch (type) {
1496
+ case 'basic': case 'cors': case 'default': return true;
1497
+ }
1498
+ return false;
1499
+ }
1500
+ }
1488
1501
 
1489
- exports.__wbg_versions_c01dfd4722a88165 = function(arg0) {
1490
- const ret = arg0.versions;
1491
- return ret;
1492
- };
1502
+ function initSync(module) {
1503
+ if (wasm !== undefined) return wasm;
1493
1504
 
1494
- exports.__wbg_warn_14a9fd75d0abe5d7 = function(arg0) {
1495
- console.warn(...arg0);
1496
- };
1497
1505
 
1498
- exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
1499
- // Cast intrinsic for `Ref(String) -> Externref`.
1500
- const ret = getStringFromWasm0(arg0, arg1);
1501
- return ret;
1502
- };
1506
+ if (module !== undefined) {
1507
+ if (Object.getPrototypeOf(module) === Object.prototype) {
1508
+ ({module} = module)
1509
+ } else {
1510
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
1511
+ }
1512
+ }
1503
1513
 
1504
- exports.__wbindgen_cast_2fb66661e8d075cf = function(arg0, arg1) {
1505
- // Cast intrinsic for `Closure(Closure { dtor_idx: 553, function: Function { arguments: [Externref], shim_idx: 554, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1506
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h8554173f80599467, wasm_bindgen__convert__closures_____invoke__h7f8b71809a8d7577);
1507
- return ret;
1508
- };
1514
+ const imports = __wbg_get_imports();
1515
+ if (!(module instanceof WebAssembly.Module)) {
1516
+ module = new WebAssembly.Module(module);
1517
+ }
1518
+ const instance = new WebAssembly.Instance(module, imports);
1519
+ return __wbg_finalize_init(instance, module);
1520
+ }
1509
1521
 
1510
- exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
1511
- // Cast intrinsic for `U64 -> Externref`.
1512
- const ret = BigInt.asUintN(64, arg0);
1513
- return ret;
1514
- };
1522
+ async function __wbg_init(module_or_path) {
1523
+ if (wasm !== undefined) return wasm;
1515
1524
 
1516
- exports.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
1517
- // Cast intrinsic for `I64 -> Externref`.
1518
- const ret = arg0;
1519
- return ret;
1520
- };
1521
1525
 
1522
- exports.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
1523
- // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
1524
- const ret = getArrayU8FromWasm0(arg0, arg1);
1525
- return ret;
1526
- };
1526
+ if (module_or_path !== undefined) {
1527
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
1528
+ ({module_or_path} = module_or_path)
1529
+ } else {
1530
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
1531
+ }
1532
+ }
1527
1533
 
1528
- exports.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
1529
- // Cast intrinsic for `F64 -> Externref`.
1530
- const ret = arg0;
1531
- return ret;
1532
- };
1534
+ if (module_or_path === undefined) {
1535
+ module_or_path = new URL('cedarling_wasm_bg.wasm', import.meta.url);
1536
+ }
1537
+ const imports = __wbg_get_imports();
1533
1538
 
1534
- exports.__wbindgen_cast_f0904d98c773eedb = function(arg0, arg1) {
1535
- // Cast intrinsic for `Closure(Closure { dtor_idx: 508, function: Function { arguments: [], shim_idx: 509, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1536
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h8ab080f6f46e974c, wasm_bindgen__convert__closures_____invoke__h5208add59d64c287);
1537
- return ret;
1538
- };
1539
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
1540
+ module_or_path = fetch(module_or_path);
1541
+ }
1539
1542
 
1540
- exports.__wbindgen_init_externref_table = function() {
1541
- const table = wasm.__wbindgen_externrefs;
1542
- const offset = table.grow(4);
1543
- table.set(0, undefined);
1544
- table.set(offset + 0, undefined);
1545
- table.set(offset + 1, null);
1546
- table.set(offset + 2, true);
1547
- table.set(offset + 3, false);
1548
- };
1543
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
1549
1544
 
1550
- const wasmPath = `${__dirname}/cedarling_wasm_bg.wasm`;
1551
- const wasmBytes = require('fs').readFileSync(wasmPath);
1552
- const wasmModule = new WebAssembly.Module(wasmBytes);
1553
- const wasm = exports.__wasm = new WebAssembly.Instance(wasmModule, imports).exports;
1545
+ return __wbg_finalize_init(instance, module);
1546
+ }
1554
1547
 
1555
- wasm.__wbindgen_start();
1548
+ export { initSync, __wbg_init as default };