@janssenproject/cedarling_wasm 0.0.467 → 0.0.469

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,3140 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // .build/src/cjs.js
21
+ var cjs_exports = {};
22
+ __export(cjs_exports, {
23
+ default: () => initWasm,
24
+ init: () => init2,
25
+ initFromArchiveBytes: () => initFromArchiveBytes2,
26
+ initSync: () => initSync2,
27
+ initWasm: () => initWasm
28
+ });
29
+ module.exports = __toCommonJS(cjs_exports);
30
+
31
+ // cedarling-generated-glue:/home/runner/work/jans/jans/jans-cedarling/bindings/cedarling_wasm/pkg/cedarling_wasm.js
32
+ var AuthorizeResult = class _AuthorizeResult {
33
+ static __wrap(ptr) {
34
+ const obj = Object.create(_AuthorizeResult.prototype);
35
+ obj.__wbg_ptr = ptr;
36
+ AuthorizeResultFinalization.register(obj, obj.__wbg_ptr, obj);
37
+ return obj;
38
+ }
39
+ __destroy_into_raw() {
40
+ const ptr = this.__wbg_ptr;
41
+ this.__wbg_ptr = 0;
42
+ AuthorizeResultFinalization.unregister(this);
43
+ return ptr;
44
+ }
45
+ free() {
46
+ const ptr = this.__destroy_into_raw();
47
+ wasm.__wbg_authorizeresult_free(ptr, 0);
48
+ }
49
+ /**
50
+ * Convert `AuthorizeResult` to json string value
51
+ * @returns {string}
52
+ */
53
+ jsonString() {
54
+ let deferred1_0;
55
+ let deferred1_1;
56
+ try {
57
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
58
+ wasm.authorizeresult_jsonString(retptr, this.__wbg_ptr);
59
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
60
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
61
+ deferred1_0 = r0;
62
+ deferred1_1 = r1;
63
+ return getStringFromWasm0(r0, r1);
64
+ } finally {
65
+ wasm.__wbindgen_add_to_stack_pointer(16);
66
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
67
+ }
68
+ }
69
+ /**
70
+ * Result of authorization
71
+ * true means `ALLOW`
72
+ * false means `Deny`
73
+ *
74
+ * this field is [`bool`] type to be compatible with [authzen Access Evaluation Decision](https://openid.github.io/authzen/#section-6.2.1).
75
+ * @returns {boolean}
76
+ */
77
+ get decision() {
78
+ const ret = wasm.__wbg_get_authorizeresult_decision(this.__wbg_ptr);
79
+ return ret !== 0;
80
+ }
81
+ /**
82
+ * Request ID of the authorization request
83
+ * @returns {string}
84
+ */
85
+ get request_id() {
86
+ let deferred1_0;
87
+ let deferred1_1;
88
+ try {
89
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
90
+ wasm.__wbg_get_authorizeresult_request_id(retptr, this.__wbg_ptr);
91
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
92
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
93
+ deferred1_0 = r0;
94
+ deferred1_1 = r1;
95
+ return getStringFromWasm0(r0, r1);
96
+ } finally {
97
+ wasm.__wbindgen_add_to_stack_pointer(16);
98
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
99
+ }
100
+ }
101
+ /**
102
+ * Cedar authorization response for the request.
103
+ * @returns {AuthorizeResultResponse}
104
+ */
105
+ get response() {
106
+ const ret = wasm.__wbg_get_authorizeresult_response(this.__wbg_ptr);
107
+ return AuthorizeResultResponse.__wrap(ret);
108
+ }
109
+ /**
110
+ * Result of authorization
111
+ * true means `ALLOW`
112
+ * false means `Deny`
113
+ *
114
+ * this field is [`bool`] type to be compatible with [authzen Access Evaluation Decision](https://openid.github.io/authzen/#section-6.2.1).
115
+ * @param {boolean} arg0
116
+ */
117
+ set decision(arg0) {
118
+ wasm.__wbg_set_authorizeresult_decision(this.__wbg_ptr, arg0);
119
+ }
120
+ /**
121
+ * Request ID of the authorization request
122
+ * @param {string} arg0
123
+ */
124
+ set request_id(arg0) {
125
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
126
+ const len0 = WASM_VECTOR_LEN;
127
+ wasm.__wbg_set_authorizeresult_request_id(this.__wbg_ptr, ptr0, len0);
128
+ }
129
+ /**
130
+ * Cedar authorization response for the request.
131
+ * @param {AuthorizeResultResponse} arg0
132
+ */
133
+ set response(arg0) {
134
+ _assertClass(arg0, AuthorizeResultResponse);
135
+ var ptr0 = arg0.__destroy_into_raw();
136
+ wasm.__wbg_set_authorizeresult_response(this.__wbg_ptr, ptr0);
137
+ }
138
+ };
139
+ if (Symbol.dispose) AuthorizeResult.prototype[Symbol.dispose] = AuthorizeResult.prototype.free;
140
+ var AuthorizeResultResponse = class _AuthorizeResultResponse {
141
+ static __wrap(ptr) {
142
+ const obj = Object.create(_AuthorizeResultResponse.prototype);
143
+ obj.__wbg_ptr = ptr;
144
+ AuthorizeResultResponseFinalization.register(obj, obj.__wbg_ptr, obj);
145
+ return obj;
146
+ }
147
+ __destroy_into_raw() {
148
+ const ptr = this.__wbg_ptr;
149
+ this.__wbg_ptr = 0;
150
+ AuthorizeResultResponseFinalization.unregister(this);
151
+ return ptr;
152
+ }
153
+ free() {
154
+ const ptr = this.__destroy_into_raw();
155
+ wasm.__wbg_authorizeresultresponse_free(ptr, 0);
156
+ }
157
+ /**
158
+ * Authorization decision
159
+ * @returns {boolean}
160
+ */
161
+ get decision() {
162
+ const ret = wasm.authorizeresultresponse_decision(this.__wbg_ptr);
163
+ return ret !== 0;
164
+ }
165
+ /**
166
+ * Diagnostics providing more information on how this decision was reached
167
+ * @returns {Diagnostics}
168
+ */
169
+ get diagnostics() {
170
+ const ret = wasm.authorizeresultresponse_diagnostics(this.__wbg_ptr);
171
+ return Diagnostics.__wrap(ret);
172
+ }
173
+ };
174
+ if (Symbol.dispose) AuthorizeResultResponse.prototype[Symbol.dispose] = AuthorizeResultResponse.prototype.free;
175
+ var BatchAuthorizeMultiIssuerResponse = class _BatchAuthorizeMultiIssuerResponse {
176
+ static __wrap(ptr) {
177
+ const obj = Object.create(_BatchAuthorizeMultiIssuerResponse.prototype);
178
+ obj.__wbg_ptr = ptr;
179
+ BatchAuthorizeMultiIssuerResponseFinalization.register(obj, obj.__wbg_ptr, obj);
180
+ return obj;
181
+ }
182
+ __destroy_into_raw() {
183
+ const ptr = this.__wbg_ptr;
184
+ this.__wbg_ptr = 0;
185
+ BatchAuthorizeMultiIssuerResponseFinalization.unregister(this);
186
+ return ptr;
187
+ }
188
+ free() {
189
+ const ptr = this.__destroy_into_raw();
190
+ wasm.__wbg_batchauthorizemultiissuerresponse_free(ptr, 0);
191
+ }
192
+ /**
193
+ * Shared correlation id stamped on every per-item decision log entry.
194
+ * @returns {string}
195
+ */
196
+ get batch_id() {
197
+ let deferred1_0;
198
+ let deferred1_1;
199
+ try {
200
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
201
+ wasm.batchauthorizemultiissuerresponse_batch_id(retptr, this.__wbg_ptr);
202
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
203
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
204
+ deferred1_0 = r0;
205
+ deferred1_1 = r1;
206
+ return getStringFromWasm0(r0, r1);
207
+ } finally {
208
+ wasm.__wbindgen_add_to_stack_pointer(16);
209
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
210
+ }
211
+ }
212
+ /**
213
+ * Per-item results in input order — each slot is a
214
+ * [`BatchItemMultiIssuerResult`].
215
+ * @returns {BatchItemMultiIssuerResult[]}
216
+ */
217
+ get results() {
218
+ try {
219
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
220
+ wasm.batchauthorizemultiissuerresponse_results(retptr, this.__wbg_ptr);
221
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
222
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
223
+ var v1 = getArrayJsValueFromWasm0(r0, r1);
224
+ wasm.__wbindgen_export5(r0, r1 * 4, 4);
225
+ return v1;
226
+ } finally {
227
+ wasm.__wbindgen_add_to_stack_pointer(16);
228
+ }
229
+ }
230
+ };
231
+ if (Symbol.dispose) BatchAuthorizeMultiIssuerResponse.prototype[Symbol.dispose] = BatchAuthorizeMultiIssuerResponse.prototype.free;
232
+ var BatchAuthorizeUnsignedResponse = class _BatchAuthorizeUnsignedResponse {
233
+ static __wrap(ptr) {
234
+ const obj = Object.create(_BatchAuthorizeUnsignedResponse.prototype);
235
+ obj.__wbg_ptr = ptr;
236
+ BatchAuthorizeUnsignedResponseFinalization.register(obj, obj.__wbg_ptr, obj);
237
+ return obj;
238
+ }
239
+ __destroy_into_raw() {
240
+ const ptr = this.__wbg_ptr;
241
+ this.__wbg_ptr = 0;
242
+ BatchAuthorizeUnsignedResponseFinalization.unregister(this);
243
+ return ptr;
244
+ }
245
+ free() {
246
+ const ptr = this.__destroy_into_raw();
247
+ wasm.__wbg_batchauthorizeunsignedresponse_free(ptr, 0);
248
+ }
249
+ /**
250
+ * Shared correlation id stamped on every per-item decision log entry.
251
+ * @returns {string}
252
+ */
253
+ get batch_id() {
254
+ let deferred1_0;
255
+ let deferred1_1;
256
+ try {
257
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
258
+ wasm.batchauthorizeunsignedresponse_batch_id(retptr, this.__wbg_ptr);
259
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
260
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
261
+ deferred1_0 = r0;
262
+ deferred1_1 = r1;
263
+ return getStringFromWasm0(r0, r1);
264
+ } finally {
265
+ wasm.__wbindgen_add_to_stack_pointer(16);
266
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
267
+ }
268
+ }
269
+ /**
270
+ * Per-item results in input order — each slot is a
271
+ * [`BatchItemUnsignedResult`].
272
+ * @returns {BatchItemUnsignedResult[]}
273
+ */
274
+ get results() {
275
+ try {
276
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
277
+ wasm.batchauthorizeunsignedresponse_results(retptr, this.__wbg_ptr);
278
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
279
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
280
+ var v1 = getArrayJsValueFromWasm0(r0, r1);
281
+ wasm.__wbindgen_export5(r0, r1 * 4, 4);
282
+ return v1;
283
+ } finally {
284
+ wasm.__wbindgen_add_to_stack_pointer(16);
285
+ }
286
+ }
287
+ };
288
+ if (Symbol.dispose) BatchAuthorizeUnsignedResponse.prototype[Symbol.dispose] = BatchAuthorizeUnsignedResponse.prototype.free;
289
+ var BatchItemError = class _BatchItemError {
290
+ static __wrap(ptr) {
291
+ const obj = Object.create(_BatchItemError.prototype);
292
+ obj.__wbg_ptr = ptr;
293
+ BatchItemErrorFinalization.register(obj, obj.__wbg_ptr, obj);
294
+ return obj;
295
+ }
296
+ __destroy_into_raw() {
297
+ const ptr = this.__wbg_ptr;
298
+ this.__wbg_ptr = 0;
299
+ BatchItemErrorFinalization.unregister(this);
300
+ return ptr;
301
+ }
302
+ free() {
303
+ const ptr = this.__destroy_into_raw();
304
+ wasm.__wbg_batchitemerror_free(ptr, 0);
305
+ }
306
+ /**
307
+ * Stable variant slug — `action_parse`, `resource_build`, `context_build`,
308
+ * `principal_build`, `schema_validation`, `multi_issuer_entity`,
309
+ * `request_validation`.
310
+ * @returns {string}
311
+ */
312
+ get category() {
313
+ let deferred1_0;
314
+ let deferred1_1;
315
+ try {
316
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
317
+ wasm.batchitemerror_category(retptr, this.__wbg_ptr);
318
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
319
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
320
+ deferred1_0 = r0;
321
+ deferred1_1 = r1;
322
+ return getStringFromWasm0(r0, r1);
323
+ } finally {
324
+ wasm.__wbindgen_add_to_stack_pointer(16);
325
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
326
+ }
327
+ }
328
+ /**
329
+ * Position of the failing item in the original `items` vector.
330
+ * @returns {number}
331
+ */
332
+ get item_index() {
333
+ const ret = wasm.batchitemerror_item_index(this.__wbg_ptr);
334
+ return ret >>> 0;
335
+ }
336
+ /**
337
+ * Human-readable diagnostic. Safe to log.
338
+ * @returns {string}
339
+ */
340
+ get message() {
341
+ let deferred1_0;
342
+ let deferred1_1;
343
+ try {
344
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
345
+ wasm.batchitemerror_message(retptr, this.__wbg_ptr);
346
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
347
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
348
+ deferred1_0 = r0;
349
+ deferred1_1 = r1;
350
+ return getStringFromWasm0(r0, r1);
351
+ } finally {
352
+ wasm.__wbindgen_add_to_stack_pointer(16);
353
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
354
+ }
355
+ }
356
+ };
357
+ if (Symbol.dispose) BatchItemError.prototype[Symbol.dispose] = BatchItemError.prototype.free;
358
+ var BatchItemMultiIssuerResult = class _BatchItemMultiIssuerResult {
359
+ static __wrap(ptr) {
360
+ const obj = Object.create(_BatchItemMultiIssuerResult.prototype);
361
+ obj.__wbg_ptr = ptr;
362
+ BatchItemMultiIssuerResultFinalization.register(obj, obj.__wbg_ptr, obj);
363
+ return obj;
364
+ }
365
+ __destroy_into_raw() {
366
+ const ptr = this.__wbg_ptr;
367
+ this.__wbg_ptr = 0;
368
+ BatchItemMultiIssuerResultFinalization.unregister(this);
369
+ return ptr;
370
+ }
371
+ free() {
372
+ const ptr = this.__destroy_into_raw();
373
+ wasm.__wbg_batchitemmultiissuerresult_free(ptr, 0);
374
+ }
375
+ /**
376
+ * The per-item error if `!is_ok()`; `undefined` otherwise.
377
+ * @returns {BatchItemError | undefined}
378
+ */
379
+ get error() {
380
+ const ret = wasm.batchitemmultiissuerresult_error(this.__wbg_ptr);
381
+ return ret === 0 ? void 0 : BatchItemError.__wrap(ret);
382
+ }
383
+ /**
384
+ * `true` when Cedar evaluated this item.
385
+ * @returns {boolean}
386
+ */
387
+ get is_ok() {
388
+ const ret = wasm.batchitemmultiissuerresult_is_ok(this.__wbg_ptr);
389
+ return ret !== 0;
390
+ }
391
+ /**
392
+ * The multi-issuer decision if `is_ok()`; throws otherwise.
393
+ * @returns {MultiIssuerAuthorizeResult}
394
+ */
395
+ unwrap() {
396
+ try {
397
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
398
+ wasm.batchitemmultiissuerresult_unwrap(retptr, this.__wbg_ptr);
399
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
400
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
401
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
402
+ if (r2) {
403
+ throw takeObject(r1);
404
+ }
405
+ return MultiIssuerAuthorizeResult.__wrap(r0);
406
+ } finally {
407
+ wasm.__wbindgen_add_to_stack_pointer(16);
408
+ }
409
+ }
410
+ };
411
+ if (Symbol.dispose) BatchItemMultiIssuerResult.prototype[Symbol.dispose] = BatchItemMultiIssuerResult.prototype.free;
412
+ var BatchItemUnsignedResult = class _BatchItemUnsignedResult {
413
+ static __wrap(ptr) {
414
+ const obj = Object.create(_BatchItemUnsignedResult.prototype);
415
+ obj.__wbg_ptr = ptr;
416
+ BatchItemUnsignedResultFinalization.register(obj, obj.__wbg_ptr, obj);
417
+ return obj;
418
+ }
419
+ __destroy_into_raw() {
420
+ const ptr = this.__wbg_ptr;
421
+ this.__wbg_ptr = 0;
422
+ BatchItemUnsignedResultFinalization.unregister(this);
423
+ return ptr;
424
+ }
425
+ free() {
426
+ const ptr = this.__destroy_into_raw();
427
+ wasm.__wbg_batchitemunsignedresult_free(ptr, 0);
428
+ }
429
+ /**
430
+ * The per-item error if `!is_ok()`; `undefined` otherwise.
431
+ * @returns {BatchItemError | undefined}
432
+ */
433
+ get error() {
434
+ const ret = wasm.batchitemunsignedresult_error(this.__wbg_ptr);
435
+ return ret === 0 ? void 0 : BatchItemError.__wrap(ret);
436
+ }
437
+ /**
438
+ * `true` when Cedar evaluated this item (Allow or Deny); `false` when it
439
+ * failed to build.
440
+ * @returns {boolean}
441
+ */
442
+ get is_ok() {
443
+ const ret = wasm.batchitemunsignedresult_is_ok(this.__wbg_ptr);
444
+ return ret !== 0;
445
+ }
446
+ /**
447
+ * The Cedar decision if `is_ok()`; throws otherwise.
448
+ * @returns {AuthorizeResult}
449
+ */
450
+ unwrap() {
451
+ try {
452
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
453
+ wasm.batchitemunsignedresult_unwrap(retptr, this.__wbg_ptr);
454
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
455
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
456
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
457
+ if (r2) {
458
+ throw takeObject(r1);
459
+ }
460
+ return AuthorizeResult.__wrap(r0);
461
+ } finally {
462
+ wasm.__wbindgen_add_to_stack_pointer(16);
463
+ }
464
+ }
465
+ };
466
+ if (Symbol.dispose) BatchItemUnsignedResult.prototype[Symbol.dispose] = BatchItemUnsignedResult.prototype.free;
467
+ var Cedarling = class _Cedarling {
468
+ static __wrap(ptr) {
469
+ const obj = Object.create(_Cedarling.prototype);
470
+ obj.__wbg_ptr = ptr;
471
+ CedarlingFinalization.register(obj, obj.__wbg_ptr, obj);
472
+ return obj;
473
+ }
474
+ __destroy_into_raw() {
475
+ const ptr = this.__wbg_ptr;
476
+ this.__wbg_ptr = 0;
477
+ CedarlingFinalization.unregister(this);
478
+ return ptr;
479
+ }
480
+ free() {
481
+ const ptr = this.__destroy_into_raw();
482
+ wasm.__wbg_cedarling_free(ptr, 0);
483
+ }
484
+ /**
485
+ * Collect every value of the annotation `key` across the given policies,
486
+ * preserving duplicates. Unknown policy IDs are silently skipped.
487
+ *
488
+ * # Arguments
489
+ *
490
+ * * `policy_ids` - List of policy IDs to search. Typically
491
+ * `result.response.diagnostics.reason` from an authorization result.
492
+ * * `key` - The annotation key to collect values for (e.g. `"redirect"`).
493
+ *
494
+ * # Example
495
+ *
496
+ * ```javascript
497
+ * const redirects = cedarling.annotationValues(
498
+ * result.response.diagnostics.reason,
499
+ * "redirect",
500
+ * );
501
+ * // ["/upgrade"]
502
+ * ```
503
+ * @param {string[]} policy_ids
504
+ * @param {string} key
505
+ * @returns {string[]}
506
+ */
507
+ annotationValues(policy_ids, key) {
508
+ try {
509
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
510
+ const ptr0 = passArrayJsValueToWasm0(policy_ids, wasm.__wbindgen_export);
511
+ const len0 = WASM_VECTOR_LEN;
512
+ const ptr1 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
513
+ const len1 = WASM_VECTOR_LEN;
514
+ wasm.cedarling_annotationValues(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
515
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
516
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
517
+ var v3 = getArrayJsValueFromWasm0(r0, r1);
518
+ wasm.__wbindgen_export5(r0, r1 * 4, 4);
519
+ return v3;
520
+ } finally {
521
+ wasm.__wbindgen_add_to_stack_pointer(16);
522
+ }
523
+ }
524
+ /**
525
+ * Return the annotations of each given policy, grouped by policy ID. It is
526
+ * the loss-free companion to `annotationsMap`. Unknown policy IDs are
527
+ * silently skipped.
528
+ *
529
+ * # Arguments
530
+ *
531
+ * * `policy_ids` - List of policy IDs whose annotations should be returned
532
+ * grouped by policy ID. Typically `result.response.diagnostics.reason` from
533
+ * an authorization result.
534
+ *
535
+ * # Example
536
+ *
537
+ * ```javascript
538
+ * const byPolicy = cedarling.annotationsByPolicy(result.response.diagnostics.reason);
539
+ * // { "5": { redirect: "/upgrade", tier: "premium" } }
540
+ * ```
541
+ * @param {string[]} policy_ids
542
+ * @returns {any}
543
+ */
544
+ annotationsByPolicy(policy_ids) {
545
+ try {
546
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
547
+ const ptr0 = passArrayJsValueToWasm0(policy_ids, wasm.__wbindgen_export);
548
+ const len0 = WASM_VECTOR_LEN;
549
+ wasm.cedarling_annotationsByPolicy(retptr, this.__wbg_ptr, ptr0, len0);
550
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
551
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
552
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
553
+ if (r2) {
554
+ throw takeObject(r1);
555
+ }
556
+ return takeObject(r0);
557
+ } finally {
558
+ wasm.__wbindgen_add_to_stack_pointer(16);
559
+ }
560
+ }
561
+ /**
562
+ * Merge the annotations (`@key("value")`) of the given policies into a single object.
563
+ *
564
+ * Intended for resolving the determining policies of an authorization decision:
565
+ * pass `result.response.diagnostics.reason`.
566
+ *
567
+ * Lossy: if the same annotation key appears on several policies, one value wins
568
+ * arbitrarily. Use `annotationValues` / `annotationsByPolicy` when duplicates
569
+ * matter. Unknown policy IDs are silently skipped.
570
+ *
571
+ * # Arguments
572
+ *
573
+ * * `policy_ids` - List of policy IDs whose annotations should be merged into
574
+ * a single object. Typically `result.response.diagnostics.reason` from an
575
+ * authorization result.
576
+ *
577
+ * # Example
578
+ *
579
+ * ```javascript
580
+ * const annotations = cedarling.annotationsMap(result.response.diagnostics.reason);
581
+ * // { redirect: "/upgrade", tier: "premium" }
582
+ * ```
583
+ * @param {string[]} policy_ids
584
+ * @returns {any}
585
+ */
586
+ annotationsMap(policy_ids) {
587
+ try {
588
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
589
+ const ptr0 = passArrayJsValueToWasm0(policy_ids, wasm.__wbindgen_export);
590
+ const len0 = WASM_VECTOR_LEN;
591
+ wasm.cedarling_annotationsMap(retptr, this.__wbg_ptr, ptr0, len0);
592
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
593
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
594
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
595
+ if (r2) {
596
+ throw takeObject(r1);
597
+ }
598
+ return takeObject(r0);
599
+ } finally {
600
+ wasm.__wbindgen_add_to_stack_pointer(16);
601
+ }
602
+ }
603
+ /**
604
+ * Authorize a batch of multi-issuer requests against one shared token set.
605
+ *
606
+ * Tokens are validated and token/issuer entities are built once, then
607
+ * each item is evaluated in input order. Batch-level failures (validation,
608
+ * JWT verification, status-list refresh) reject the whole call; per-item
609
+ * failures are returned as `BatchItemError` results and exposed by WASM
610
+ * with `is_ok=false` and `error`, while genuine Cedar denials remain
611
+ * `AuthorizeResult` values with `decision=false`.
612
+ *
613
+ * # Arguments
614
+ *
615
+ * * `request` - JSON string representation of [`BatchAuthorizeMultiIssuerRequest`].
616
+ *
617
+ * # Example
618
+ *
619
+ * ```javascript
620
+ * const result = await cedarling.authorizeMultiIssuerBatch(JSON.stringify(batchRequest));
621
+ * ```
622
+ * @param {string} request
623
+ * @returns {Promise<BatchAuthorizeMultiIssuerResponse>}
624
+ */
625
+ authorizeMultiIssuerBatch(request) {
626
+ const ptr0 = passStringToWasm0(request, wasm.__wbindgen_export, wasm.__wbindgen_export2);
627
+ const len0 = WASM_VECTOR_LEN;
628
+ const ret = wasm.cedarling_authorizeMultiIssuerBatch(this.__wbg_ptr, ptr0, len0);
629
+ return takeObject(ret);
630
+ }
631
+ /**
632
+ * Authorize multi-issuer request.
633
+ * Makes authorization decision based on multiple JWT tokens from different issuers.
634
+ *
635
+ * # Arguments
636
+ *
637
+ * * `request` - JSON string representation of [`AuthorizeMultiIssuerRequest`].
638
+ *
639
+ * # Example
640
+ *
641
+ * ```javascript
642
+ * const result = await cedarling.authorizeMultiIssuer(JSON.stringify(request));
643
+ * ```
644
+ * @param {string} request
645
+ * @returns {Promise<MultiIssuerAuthorizeResult>}
646
+ */
647
+ authorizeMultiIssuer(request) {
648
+ const ptr0 = passStringToWasm0(request, wasm.__wbindgen_export, wasm.__wbindgen_export2);
649
+ const len0 = WASM_VECTOR_LEN;
650
+ const ret = wasm.cedarling_authorizeMultiIssuer(this.__wbg_ptr, ptr0, len0);
651
+ return takeObject(ret);
652
+ }
653
+ /**
654
+ * Authorize a batch of unsigned requests against one shared principal.
655
+ *
656
+ * Setup work (principal build + pushed-data snapshot) runs once and each
657
+ * item is evaluated in input order. Results are returned inside a
658
+ * [`BatchAuthorizeUnsignedResponse`] carrying the shared `batch_id`.
659
+ * Batch-level failures (validation, principal parse) reject the whole
660
+ * call; per-item failures are returned as `BatchItemError` results and
661
+ * exposed by WASM with `is_ok=false` and `error`, while genuine Cedar
662
+ * denials remain `AuthorizeResult` values with `decision=false`.
663
+ * # Arguments
664
+ *
665
+ * * `request` - JSON string representation of [`BatchAuthorizeUnsignedRequest`].
666
+ *
667
+ * # Example
668
+ *
669
+ * ```javascript
670
+ * const result = await cedarling.authorizeUnsignedBatch(JSON.stringify(batchRequest));
671
+ * ```
672
+ * @param {string} request
673
+ * @returns {Promise<BatchAuthorizeUnsignedResponse>}
674
+ */
675
+ authorizeUnsignedBatch(request) {
676
+ const ptr0 = passStringToWasm0(request, wasm.__wbindgen_export, wasm.__wbindgen_export2);
677
+ const len0 = WASM_VECTOR_LEN;
678
+ const ret = wasm.cedarling_authorizeUnsignedBatch(this.__wbg_ptr, ptr0, len0);
679
+ return takeObject(ret);
680
+ }
681
+ /**
682
+ * Authorize an unsigned request carrying an optional single principal.
683
+ * Makes an authorization decision based on the [`RequestUnsigned`].
684
+ *
685
+ * When `principal` is omitted / `null` on the JS side the core uses Cedar
686
+ * partial evaluation; residual-dependent requests fail closed with
687
+ * `Decision::Deny` and surface residual policy ids in
688
+ * `response.diagnostics.reason`.
689
+ *
690
+ * # Arguments
691
+ *
692
+ * * `request` - JSON string representation of [`RequestUnsigned`].
693
+ *
694
+ * # Example
695
+ *
696
+ * ```javascript
697
+ * const result = await cedarling.authorizeUnsigned(JSON.stringify(request));
698
+ * ```
699
+ * @param {string} request
700
+ * @returns {Promise<AuthorizeResult>}
701
+ */
702
+ authorizeUnsigned(request) {
703
+ const ptr0 = passStringToWasm0(request, wasm.__wbindgen_export, wasm.__wbindgen_export2);
704
+ const len0 = WASM_VECTOR_LEN;
705
+ const ret = wasm.cedarling_authorizeUnsigned(this.__wbg_ptr, ptr0, len0);
706
+ return takeObject(ret);
707
+ }
708
+ /**
709
+ * Clear all entries from the data store.
710
+ *
711
+ * # Arguments
712
+ *
713
+ * None.
714
+ *
715
+ * # Example
716
+ *
717
+ * ```javascript
718
+ * cedarling.clearDataCtx();
719
+ * console.log("All data entries cleared");
720
+ * ```
721
+ */
722
+ clearDataCtx() {
723
+ try {
724
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
725
+ wasm.cedarling_clearDataCtx(retptr, this.__wbg_ptr);
726
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
727
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
728
+ if (r1) {
729
+ throw takeObject(r0);
730
+ }
731
+ } finally {
732
+ wasm.__wbindgen_add_to_stack_pointer(16);
733
+ }
734
+ }
735
+ /**
736
+ * Get trusted issuer identifiers that failed to load.
737
+ *
738
+ * # Arguments
739
+ *
740
+ * None.
741
+ *
742
+ * # Example
743
+ *
744
+ * ```javascript
745
+ * const ids = cedarling.failedTrustedIssuerIds();
746
+ * ```
747
+ * @returns {Array<any>}
748
+ */
749
+ failedTrustedIssuerIds() {
750
+ const ret = wasm.cedarling_failedTrustedIssuerIds(this.__wbg_ptr);
751
+ return takeObject(ret);
752
+ }
753
+ /**
754
+ * Get a value from the data store by key.
755
+ * Returns null if the key doesn't exist or the entry has expired.
756
+ *
757
+ * # Arguments
758
+ *
759
+ * * `key` - A string key for the data entry to retrieve
760
+ *
761
+ * # Example
762
+ *
763
+ * ```javascript
764
+ * const value = cedarling.getDataCtx("user:123");
765
+ * if (value !== null) {
766
+ * console.log(value.name); // "John"
767
+ * }
768
+ * ```
769
+ * @param {string} key
770
+ * @returns {any}
771
+ */
772
+ getDataCtx(key) {
773
+ try {
774
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
775
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
776
+ const len0 = WASM_VECTOR_LEN;
777
+ wasm.cedarling_getDataCtx(retptr, this.__wbg_ptr, ptr0, len0);
778
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
779
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
780
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
781
+ if (r2) {
782
+ throw takeObject(r1);
783
+ }
784
+ return takeObject(r0);
785
+ } finally {
786
+ wasm.__wbindgen_add_to_stack_pointer(16);
787
+ }
788
+ }
789
+ /**
790
+ * Get a data entry with full metadata by key.
791
+ * Returns undefined if the key doesn't exist or the entry has expired.
792
+ *
793
+ * # Arguments
794
+ *
795
+ * * `key` - A string key for the data entry to retrieve
796
+ *
797
+ * # Example
798
+ *
799
+ * ```javascript
800
+ * const entry = cedarling.getDataEntryCtx("user:123");
801
+ * if (entry !== undefined) {
802
+ * console.log(entry.key); // "user:123"
803
+ * console.log(entry.value()); // { name: "John", age: 30 }
804
+ * console.log(entry.data_type); // "Record"
805
+ * console.log(entry.created_at); // "2024-01-01T12:00:00Z"
806
+ * console.log(entry.access_count); // 5
807
+ * }
808
+ * ```
809
+ * @param {string} key
810
+ * @returns {DataEntry | undefined}
811
+ */
812
+ getDataEntryCtx(key) {
813
+ try {
814
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
815
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
816
+ const len0 = WASM_VECTOR_LEN;
817
+ wasm.cedarling_getDataEntryCtx(retptr, this.__wbg_ptr, ptr0, len0);
818
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
819
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
820
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
821
+ if (r2) {
822
+ throw takeObject(r1);
823
+ }
824
+ return r0 === 0 ? void 0 : DataEntry.__wrap(r0);
825
+ } finally {
826
+ wasm.__wbindgen_add_to_stack_pointer(16);
827
+ }
828
+ }
829
+ /**
830
+ * Returns one retained memory log by ID, or `null` when it is not retained.
831
+ *
832
+ * # Arguments
833
+ *
834
+ * * `id` - The retained log identifier.
835
+ *
836
+ * # Example
837
+ *
838
+ * ```javascript
839
+ * const log = cedarling.getLogById("request-id");
840
+ * ```
841
+ * @param {string} id
842
+ * @returns {any}
843
+ */
844
+ getLogById(id) {
845
+ try {
846
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
847
+ const ptr0 = passStringToWasm0(id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
848
+ const len0 = WASM_VECTOR_LEN;
849
+ wasm.cedarling_getLogById(retptr, this.__wbg_ptr, ptr0, len0);
850
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
851
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
852
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
853
+ if (r2) {
854
+ throw takeObject(r1);
855
+ }
856
+ return takeObject(r0);
857
+ } finally {
858
+ wasm.__wbindgen_add_to_stack_pointer(16);
859
+ }
860
+ }
861
+ /**
862
+ * Returns identifiers for all retained memory logs.
863
+ *
864
+ * # Arguments
865
+ *
866
+ * None.
867
+ *
868
+ * # Example
869
+ *
870
+ * ```javascript
871
+ * const ids = cedarling.getLogIds();
872
+ * ```
873
+ * @returns {Array<any>}
874
+ */
875
+ getLogIds() {
876
+ const ret = wasm.cedarling_getLogIds(this.__wbg_ptr);
877
+ return takeObject(ret);
878
+ }
879
+ /**
880
+ * Returns retained memory logs matching one request ID and indexed value.
881
+ *
882
+ * # Arguments
883
+ *
884
+ * * `requestId` - The request identifier to match.
885
+ * * `tag` - A log kind (`"System"`, `"Decision"`, or `"Metric"`) or a
886
+ * system-log level such as `"DEBUG"`.
887
+ *
888
+ * # Example
889
+ *
890
+ * ```javascript
891
+ * const logs = cedarling.getLogsByRequestIdAndTag("request-id", "System");
892
+ * ```
893
+ * @param {string} request_id
894
+ * @param {string} tag
895
+ * @returns {any[]}
896
+ */
897
+ getLogsByRequestIdAndTag(request_id, tag) {
898
+ try {
899
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
900
+ const ptr0 = passStringToWasm0(request_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
901
+ const len0 = WASM_VECTOR_LEN;
902
+ const ptr1 = passStringToWasm0(tag, wasm.__wbindgen_export, wasm.__wbindgen_export2);
903
+ const len1 = WASM_VECTOR_LEN;
904
+ wasm.cedarling_getLogsByRequestIdAndTag(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
905
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
906
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
907
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
908
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
909
+ if (r3) {
910
+ throw takeObject(r2);
911
+ }
912
+ var v3 = getArrayJsValueFromWasm0(r0, r1);
913
+ wasm.__wbindgen_export5(r0, r1 * 4, 4);
914
+ return v3;
915
+ } finally {
916
+ wasm.__wbindgen_add_to_stack_pointer(16);
917
+ }
918
+ }
919
+ /**
920
+ * Returns retained memory logs for one request ID.
921
+ *
922
+ * # Arguments
923
+ *
924
+ * * `requestId` - The request identifier to match.
925
+ *
926
+ * # Example
927
+ *
928
+ * ```javascript
929
+ * const logs = cedarling.getLogsByRequestId("request-id");
930
+ * ```
931
+ * @param {string} request_id
932
+ * @returns {any[]}
933
+ */
934
+ getLogsByRequestId(request_id) {
935
+ try {
936
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
937
+ const ptr0 = passStringToWasm0(request_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
938
+ const len0 = WASM_VECTOR_LEN;
939
+ wasm.cedarling_getLogsByRequestId(retptr, this.__wbg_ptr, ptr0, len0);
940
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
941
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
942
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
943
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
944
+ if (r3) {
945
+ throw takeObject(r2);
946
+ }
947
+ var v2 = getArrayJsValueFromWasm0(r0, r1);
948
+ wasm.__wbindgen_export5(r0, r1 * 4, 4);
949
+ return v2;
950
+ } finally {
951
+ wasm.__wbindgen_add_to_stack_pointer(16);
952
+ }
953
+ }
954
+ /**
955
+ * Returns retained memory logs matching an indexed value.
956
+ *
957
+ * # Arguments
958
+ *
959
+ * * `tag` - A log kind (`"System"`, `"Decision"`, or `"Metric"`) or a
960
+ * system-log level such as `"DEBUG"`.
961
+ *
962
+ * # Example
963
+ *
964
+ * ```javascript
965
+ * const logs = cedarling.getLogsByTag("System");
966
+ * ```
967
+ * @param {string} tag
968
+ * @returns {any[]}
969
+ */
970
+ getLogsByTag(tag) {
971
+ try {
972
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
973
+ const ptr0 = passStringToWasm0(tag, wasm.__wbindgen_export, wasm.__wbindgen_export2);
974
+ const len0 = WASM_VECTOR_LEN;
975
+ wasm.cedarling_getLogsByTag(retptr, this.__wbg_ptr, ptr0, len0);
976
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
977
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
978
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
979
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
980
+ if (r3) {
981
+ throw takeObject(r2);
982
+ }
983
+ var v2 = getArrayJsValueFromWasm0(r0, r1);
984
+ wasm.__wbindgen_export5(r0, r1 * 4, 4);
985
+ return v2;
986
+ } finally {
987
+ wasm.__wbindgen_add_to_stack_pointer(16);
988
+ }
989
+ }
990
+ /**
991
+ * Get statistics about the data store.
992
+ *
993
+ * # Arguments
994
+ *
995
+ * None.
996
+ *
997
+ * # Example
998
+ *
999
+ * ```javascript
1000
+ * const stats = cedarling.getStatsCtx();
1001
+ * console.log(`Entries: ${stats.entry_count}/${stats.max_entries || 'unlimited'}`);
1002
+ * console.log(`Capacity: ${stats.capacity_usage_percent.toFixed(2)}%`);
1003
+ * console.log(`Total size: ${stats.total_size_bytes} bytes`);
1004
+ * ```
1005
+ * @returns {DataStoreStats}
1006
+ */
1007
+ getStatsCtx() {
1008
+ try {
1009
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1010
+ wasm.cedarling_getStatsCtx(retptr, this.__wbg_ptr);
1011
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1012
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1013
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1014
+ if (r2) {
1015
+ throw takeObject(r1);
1016
+ }
1017
+ return DataStoreStats.__wrap(r0);
1018
+ } finally {
1019
+ wasm.__wbindgen_add_to_stack_pointer(16);
1020
+ }
1021
+ }
1022
+ /**
1023
+ * Check whether a trusted issuer was loaded by `iss` claim.
1024
+ *
1025
+ * # Arguments
1026
+ *
1027
+ * * `iss_claim` - Issuer `iss` claim value to check.
1028
+ *
1029
+ * # Example
1030
+ *
1031
+ * ```javascript
1032
+ * const ok = cedarling.isTrustedIssuerLoadedByIss("https://issuer.example.org");
1033
+ * ```
1034
+ * @param {string} iss_claim
1035
+ * @returns {boolean}
1036
+ */
1037
+ isTrustedIssuerLoadedByIss(iss_claim) {
1038
+ const ptr0 = passStringToWasm0(iss_claim, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1039
+ const len0 = WASM_VECTOR_LEN;
1040
+ const ret = wasm.cedarling_isTrustedIssuerLoadedByIss(this.__wbg_ptr, ptr0, len0);
1041
+ return ret !== 0;
1042
+ }
1043
+ /**
1044
+ * Check whether a trusted issuer was loaded by issuer identifier.
1045
+ *
1046
+ * # Arguments
1047
+ *
1048
+ * * `issuer_id` - Trusted issuer identifier to check.
1049
+ *
1050
+ * # Example
1051
+ *
1052
+ * ```javascript
1053
+ * const ok = cedarling.isTrustedIssuerLoadedByName("issuer_id");
1054
+ * ```
1055
+ * @param {string} issuer_id
1056
+ * @returns {boolean}
1057
+ */
1058
+ isTrustedIssuerLoadedByName(issuer_id) {
1059
+ const ptr0 = passStringToWasm0(issuer_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1060
+ const len0 = WASM_VECTOR_LEN;
1061
+ const ret = wasm.cedarling_isTrustedIssuerLoadedByName(this.__wbg_ptr, ptr0, len0);
1062
+ return ret !== 0;
1063
+ }
1064
+ /**
1065
+ * List all entries with their metadata.
1066
+ * Returns an array of DataEntry objects.
1067
+ *
1068
+ * # Arguments
1069
+ *
1070
+ * None.
1071
+ *
1072
+ * # Example
1073
+ *
1074
+ * ```javascript
1075
+ * const entries = cedarling.listDataCtx();
1076
+ * entries.forEach(entry => {
1077
+ * console.log(`${entry.key}: ${entry.data_type} (accessed ${entry.access_count} times)`);
1078
+ * });
1079
+ * ```
1080
+ * @returns {Array<any>}
1081
+ */
1082
+ listDataCtx() {
1083
+ try {
1084
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1085
+ wasm.cedarling_listDataCtx(retptr, this.__wbg_ptr);
1086
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1087
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1088
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1089
+ if (r2) {
1090
+ throw takeObject(r1);
1091
+ }
1092
+ return takeObject(r0);
1093
+ } finally {
1094
+ wasm.__wbindgen_add_to_stack_pointer(16);
1095
+ }
1096
+ }
1097
+ /**
1098
+ * Get trusted issuer identifiers loaded successfully.
1099
+ *
1100
+ * # Arguments
1101
+ *
1102
+ * None.
1103
+ *
1104
+ * # Example
1105
+ *
1106
+ * ```javascript
1107
+ * const ids = cedarling.loadedTrustedIssuerIds();
1108
+ * ```
1109
+ * @returns {Array<any>}
1110
+ */
1111
+ loadedTrustedIssuerIds() {
1112
+ const ret = wasm.cedarling_loadedTrustedIssuerIds(this.__wbg_ptr);
1113
+ return takeObject(ret);
1114
+ }
1115
+ /**
1116
+ * Get the number of trusted issuers loaded successfully.
1117
+ *
1118
+ * # Arguments
1119
+ *
1120
+ * None.
1121
+ *
1122
+ * # Example
1123
+ *
1124
+ * ```javascript
1125
+ * const loadedCount = cedarling.loadedTrustedIssuersCount();
1126
+ * ```
1127
+ * @returns {number}
1128
+ */
1129
+ loadedTrustedIssuersCount() {
1130
+ const ret = wasm.cedarling_loadedTrustedIssuersCount(this.__wbg_ptr);
1131
+ return ret >>> 0;
1132
+ }
1133
+ /**
1134
+ * Creates a new Cedarling application from a JavaScript `Map`.
1135
+ *
1136
+ * # Arguments
1137
+ *
1138
+ * * `config` - A `Map` of Cedarling bootstrap-property names and values.
1139
+ *
1140
+ * # Example
1141
+ *
1142
+ * ```javascript
1143
+ * await initWasm();
1144
+ * const cedarling = await Cedarling.newFromMap(new Map([
1145
+ * ["CEDARLING_APPLICATION_NAME", "task-api"],
1146
+ * ["CEDARLING_POLICY_STORE_URI", "https://example.com/policy-store.cjar"],
1147
+ * ["CEDARLING_LOG_TYPE", "memory"],
1148
+ * ["CEDARLING_LOG_TTL", 120],
1149
+ * ]));
1150
+ * ```
1151
+ * @param {Map<any, any>} config
1152
+ * @returns {Promise<Cedarling>}
1153
+ */
1154
+ static newFromMap(config) {
1155
+ const ret = wasm.cedarling_newFromMap(addHeapObject(config));
1156
+ return takeObject(ret);
1157
+ }
1158
+ /**
1159
+ * Creates a Cedarling application from bootstrap properties.
1160
+ *
1161
+ * # Arguments
1162
+ *
1163
+ * * `config` - A plain object of Cedarling bootstrap-property names and values.
1164
+ *
1165
+ * # Example
1166
+ *
1167
+ * ```javascript
1168
+ * await initWasm();
1169
+ * const cedarling = await Cedarling.new({
1170
+ * CEDARLING_APPLICATION_NAME: "task-api",
1171
+ * CEDARLING_POLICY_STORE_URI: "https://example.com/policy-store.cjar",
1172
+ * CEDARLING_LOG_TYPE: "memory",
1173
+ * CEDARLING_LOG_TTL: 120,
1174
+ * });
1175
+ * ```
1176
+ * @param {object} config
1177
+ * @returns {Promise<Cedarling>}
1178
+ */
1179
+ static new(config) {
1180
+ const ret = wasm.cedarling_new(addHeapObject(config));
1181
+ return takeObject(ret);
1182
+ }
1183
+ /**
1184
+ * Returns all retained memory logs and removes them from storage.
1185
+ * Other log configurations return an empty array.
1186
+ *
1187
+ * # Arguments
1188
+ *
1189
+ * None.
1190
+ *
1191
+ * # Example
1192
+ *
1193
+ * ```javascript
1194
+ * const logs = cedarling.popLogs();
1195
+ * ```
1196
+ * @returns {Array<any>}
1197
+ */
1198
+ popLogs() {
1199
+ try {
1200
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1201
+ wasm.cedarling_popLogs(retptr, this.__wbg_ptr);
1202
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1203
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1204
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1205
+ if (r2) {
1206
+ throw takeObject(r1);
1207
+ }
1208
+ return takeObject(r0);
1209
+ } finally {
1210
+ wasm.__wbindgen_add_to_stack_pointer(16);
1211
+ }
1212
+ }
1213
+ /**
1214
+ * Push a value into the data store with an optional TTL.
1215
+ * If the key already exists, the value will be replaced.
1216
+ * If TTL is not provided, the default TTL from configuration is used.
1217
+ *
1218
+ * # Arguments
1219
+ *
1220
+ * * `key` - A string key for the data entry (must not be empty)
1221
+ * * `value` - The value to store (any JSON-serializable JavaScript value: object, array, string, number, boolean)
1222
+ * * `ttl_secs` - Optional TTL in seconds (undefined/null uses default from config)
1223
+ *
1224
+ * # Example
1225
+ *
1226
+ * ```javascript
1227
+ * cedarling.pushDataCtx("user:123", { name: "John", age: 30 }, 3600);
1228
+ * cedarling.pushDataCtx("config", { setting: "value" }); // Uses default TTL
1229
+ * ```
1230
+ * @param {string} key
1231
+ * @param {any} value
1232
+ * @param {bigint | null} [ttl_secs]
1233
+ */
1234
+ pushDataCtx(key, value, ttl_secs) {
1235
+ try {
1236
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1237
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1238
+ const len0 = WASM_VECTOR_LEN;
1239
+ wasm.cedarling_pushDataCtx(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(value), !isLikeNone(ttl_secs), isLikeNone(ttl_secs) ? BigInt(0) : ttl_secs);
1240
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1241
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1242
+ if (r1) {
1243
+ throw takeObject(r0);
1244
+ }
1245
+ } finally {
1246
+ wasm.__wbindgen_add_to_stack_pointer(16);
1247
+ }
1248
+ }
1249
+ /**
1250
+ * Remove a value from the data store by key.
1251
+ * Returns true if the key existed and was removed, false otherwise.
1252
+ *
1253
+ * # Arguments
1254
+ *
1255
+ * * `key` - A string key for the data entry to remove
1256
+ *
1257
+ * # Example
1258
+ *
1259
+ * ```javascript
1260
+ * const removed = cedarling.removeDataCtx("user:123");
1261
+ * if (removed) {
1262
+ * console.log("Entry was successfully removed");
1263
+ * }
1264
+ * ```
1265
+ * @param {string} key
1266
+ * @returns {boolean}
1267
+ */
1268
+ removeDataCtx(key) {
1269
+ try {
1270
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1271
+ const ptr0 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1272
+ const len0 = WASM_VECTOR_LEN;
1273
+ wasm.cedarling_removeDataCtx(retptr, this.__wbg_ptr, ptr0, len0);
1274
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1275
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1276
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1277
+ if (r2) {
1278
+ throw takeObject(r1);
1279
+ }
1280
+ return r0 !== 0;
1281
+ } finally {
1282
+ wasm.__wbindgen_add_to_stack_pointer(16);
1283
+ }
1284
+ }
1285
+ /**
1286
+ * Closes Lock Server connections and pushes all available logs.
1287
+ *
1288
+ * # Arguments
1289
+ *
1290
+ * None.
1291
+ *
1292
+ * # Example
1293
+ *
1294
+ * ```javascript
1295
+ * await cedarling.shutDown();
1296
+ * ```
1297
+ * @returns {Promise<void>}
1298
+ */
1299
+ shutDown() {
1300
+ const ret = wasm.cedarling_shutDown(this.__wbg_ptr);
1301
+ return takeObject(ret);
1302
+ }
1303
+ /**
1304
+ * Get the total number of trusted issuer entries discovered.
1305
+ *
1306
+ * # Arguments
1307
+ *
1308
+ * None.
1309
+ *
1310
+ * # Example
1311
+ *
1312
+ * ```javascript
1313
+ * const total = cedarling.totalIssuers();
1314
+ * ```
1315
+ * @returns {number}
1316
+ */
1317
+ totalIssuers() {
1318
+ const ret = wasm.cedarling_totalIssuers(this.__wbg_ptr);
1319
+ return ret >>> 0;
1320
+ }
1321
+ };
1322
+ if (Symbol.dispose) Cedarling.prototype[Symbol.dispose] = Cedarling.prototype.free;
1323
+ var DataEntry = class _DataEntry {
1324
+ static __wrap(ptr) {
1325
+ const obj = Object.create(_DataEntry.prototype);
1326
+ obj.__wbg_ptr = ptr;
1327
+ DataEntryFinalization.register(obj, obj.__wbg_ptr, obj);
1328
+ return obj;
1329
+ }
1330
+ __destroy_into_raw() {
1331
+ const ptr = this.__wbg_ptr;
1332
+ this.__wbg_ptr = 0;
1333
+ DataEntryFinalization.unregister(this);
1334
+ return ptr;
1335
+ }
1336
+ free() {
1337
+ const ptr = this.__destroy_into_raw();
1338
+ wasm.__wbg_dataentry_free(ptr, 0);
1339
+ }
1340
+ /**
1341
+ * Convert `DataEntry` to json string value
1342
+ * @returns {string}
1343
+ */
1344
+ jsonString() {
1345
+ let deferred1_0;
1346
+ let deferred1_1;
1347
+ try {
1348
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1349
+ wasm.dataentry_jsonString(retptr, this.__wbg_ptr);
1350
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1351
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1352
+ deferred1_0 = r0;
1353
+ deferred1_1 = r1;
1354
+ return getStringFromWasm0(r0, r1);
1355
+ } finally {
1356
+ wasm.__wbindgen_add_to_stack_pointer(16);
1357
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
1358
+ }
1359
+ }
1360
+ /**
1361
+ * Get the value stored in this entry as a JavaScript object
1362
+ * @returns {any}
1363
+ */
1364
+ value() {
1365
+ try {
1366
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1367
+ wasm.dataentry_value(retptr, this.__wbg_ptr);
1368
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1369
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1370
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
1371
+ if (r2) {
1372
+ throw takeObject(r1);
1373
+ }
1374
+ return takeObject(r0);
1375
+ } finally {
1376
+ wasm.__wbindgen_add_to_stack_pointer(16);
1377
+ }
1378
+ }
1379
+ /**
1380
+ * Number of times this entry has been accessed
1381
+ * @returns {bigint}
1382
+ */
1383
+ get access_count() {
1384
+ const ret = wasm.__wbg_get_dataentry_access_count(this.__wbg_ptr);
1385
+ return BigInt.asUintN(64, ret);
1386
+ }
1387
+ /**
1388
+ * Timestamp when this entry was created (RFC 3339 format)
1389
+ * @returns {string}
1390
+ */
1391
+ get created_at() {
1392
+ let deferred1_0;
1393
+ let deferred1_1;
1394
+ try {
1395
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1396
+ wasm.__wbg_get_dataentry_created_at(retptr, this.__wbg_ptr);
1397
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1398
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1399
+ deferred1_0 = r0;
1400
+ deferred1_1 = r1;
1401
+ return getStringFromWasm0(r0, r1);
1402
+ } finally {
1403
+ wasm.__wbindgen_add_to_stack_pointer(16);
1404
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
1405
+ }
1406
+ }
1407
+ /**
1408
+ * The inferred Cedar type of the value
1409
+ * @returns {string}
1410
+ */
1411
+ get data_type() {
1412
+ let deferred1_0;
1413
+ let deferred1_1;
1414
+ try {
1415
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1416
+ wasm.__wbg_get_dataentry_data_type(retptr, this.__wbg_ptr);
1417
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1418
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1419
+ deferred1_0 = r0;
1420
+ deferred1_1 = r1;
1421
+ return getStringFromWasm0(r0, r1);
1422
+ } finally {
1423
+ wasm.__wbindgen_add_to_stack_pointer(16);
1424
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
1425
+ }
1426
+ }
1427
+ /**
1428
+ * Timestamp when this entry expires (RFC 3339 format). The getter returns undefined if no TTL.
1429
+ * @returns {string | undefined}
1430
+ */
1431
+ get expires_at() {
1432
+ try {
1433
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1434
+ wasm.__wbg_get_dataentry_expires_at(retptr, this.__wbg_ptr);
1435
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1436
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1437
+ let v1;
1438
+ if (r0 !== 0) {
1439
+ v1 = getStringFromWasm0(r0, r1);
1440
+ wasm.__wbindgen_export5(r0, r1 * 1, 1);
1441
+ }
1442
+ return v1;
1443
+ } finally {
1444
+ wasm.__wbindgen_add_to_stack_pointer(16);
1445
+ }
1446
+ }
1447
+ /**
1448
+ * The key for this entry
1449
+ * @returns {string}
1450
+ */
1451
+ get key() {
1452
+ let deferred1_0;
1453
+ let deferred1_1;
1454
+ try {
1455
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1456
+ wasm.__wbg_get_dataentry_key(retptr, this.__wbg_ptr);
1457
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1458
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1459
+ deferred1_0 = r0;
1460
+ deferred1_1 = r1;
1461
+ return getStringFromWasm0(r0, r1);
1462
+ } finally {
1463
+ wasm.__wbindgen_add_to_stack_pointer(16);
1464
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
1465
+ }
1466
+ }
1467
+ /**
1468
+ * Number of times this entry has been accessed
1469
+ * @param {bigint} arg0
1470
+ */
1471
+ set access_count(arg0) {
1472
+ wasm.__wbg_set_dataentry_access_count(this.__wbg_ptr, arg0);
1473
+ }
1474
+ /**
1475
+ * Timestamp when this entry was created (RFC 3339 format)
1476
+ * @param {string} arg0
1477
+ */
1478
+ set created_at(arg0) {
1479
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1480
+ const len0 = WASM_VECTOR_LEN;
1481
+ wasm.__wbg_set_dataentry_created_at(this.__wbg_ptr, ptr0, len0);
1482
+ }
1483
+ /**
1484
+ * The inferred Cedar type of the value
1485
+ * @param {string} arg0
1486
+ */
1487
+ set data_type(arg0) {
1488
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1489
+ const len0 = WASM_VECTOR_LEN;
1490
+ wasm.__wbg_set_dataentry_data_type(this.__wbg_ptr, ptr0, len0);
1491
+ }
1492
+ /**
1493
+ * Timestamp when this entry expires (RFC 3339 format). The getter returns undefined if no TTL.
1494
+ * @param {string | null} [arg0]
1495
+ */
1496
+ set expires_at(arg0) {
1497
+ var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1498
+ var len0 = WASM_VECTOR_LEN;
1499
+ wasm.__wbg_set_dataentry_expires_at(this.__wbg_ptr, ptr0, len0);
1500
+ }
1501
+ /**
1502
+ * The key for this entry
1503
+ * @param {string} arg0
1504
+ */
1505
+ set key(arg0) {
1506
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1507
+ const len0 = WASM_VECTOR_LEN;
1508
+ wasm.__wbg_set_dataentry_key(this.__wbg_ptr, ptr0, len0);
1509
+ }
1510
+ };
1511
+ if (Symbol.dispose) DataEntry.prototype[Symbol.dispose] = DataEntry.prototype.free;
1512
+ var DataStoreStats = class _DataStoreStats {
1513
+ static __wrap(ptr) {
1514
+ const obj = Object.create(_DataStoreStats.prototype);
1515
+ obj.__wbg_ptr = ptr;
1516
+ DataStoreStatsFinalization.register(obj, obj.__wbg_ptr, obj);
1517
+ return obj;
1518
+ }
1519
+ __destroy_into_raw() {
1520
+ const ptr = this.__wbg_ptr;
1521
+ this.__wbg_ptr = 0;
1522
+ DataStoreStatsFinalization.unregister(this);
1523
+ return ptr;
1524
+ }
1525
+ free() {
1526
+ const ptr = this.__destroy_into_raw();
1527
+ wasm.__wbg_datastorestats_free(ptr, 0);
1528
+ }
1529
+ /**
1530
+ * Convert `DataStoreStats` to json string value
1531
+ * @returns {string}
1532
+ */
1533
+ jsonString() {
1534
+ let deferred1_0;
1535
+ let deferred1_1;
1536
+ try {
1537
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1538
+ wasm.datastorestats_jsonString(retptr, this.__wbg_ptr);
1539
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1540
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1541
+ deferred1_0 = r0;
1542
+ deferred1_1 = r1;
1543
+ return getStringFromWasm0(r0, r1);
1544
+ } finally {
1545
+ wasm.__wbindgen_add_to_stack_pointer(16);
1546
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
1547
+ }
1548
+ }
1549
+ /**
1550
+ * Average size per entry in bytes (0 if no entries)
1551
+ * @returns {number}
1552
+ */
1553
+ get avg_entry_size_bytes() {
1554
+ const ret = wasm.__wbg_get_datastorestats_avg_entry_size_bytes(this.__wbg_ptr);
1555
+ return ret >>> 0;
1556
+ }
1557
+ /**
1558
+ * Percentage of capacity used (0.0-100.0, based on entry count)
1559
+ * @returns {number}
1560
+ */
1561
+ get capacity_usage_percent() {
1562
+ const ret = wasm.__wbg_get_datastorestats_capacity_usage_percent(this.__wbg_ptr);
1563
+ return ret;
1564
+ }
1565
+ /**
1566
+ * Number of entries currently stored
1567
+ * @returns {number}
1568
+ */
1569
+ get entry_count() {
1570
+ const ret = wasm.__wbg_get_datastorestats_entry_count(this.__wbg_ptr);
1571
+ return ret >>> 0;
1572
+ }
1573
+ /**
1574
+ * Maximum number of entries allowed (0 = unlimited)
1575
+ * @returns {number}
1576
+ */
1577
+ get max_entries() {
1578
+ const ret = wasm.__wbg_get_datastorestats_max_entries(this.__wbg_ptr);
1579
+ return ret >>> 0;
1580
+ }
1581
+ /**
1582
+ * Maximum size per entry in bytes (0 = unlimited)
1583
+ * @returns {number}
1584
+ */
1585
+ get max_entry_size() {
1586
+ const ret = wasm.__wbg_get_datastorestats_max_entry_size(this.__wbg_ptr);
1587
+ return ret >>> 0;
1588
+ }
1589
+ /**
1590
+ * Memory usage threshold percentage (from config)
1591
+ * @returns {number}
1592
+ */
1593
+ get memory_alert_threshold() {
1594
+ const ret = wasm.__wbg_get_datastorestats_memory_alert_threshold(this.__wbg_ptr);
1595
+ return ret;
1596
+ }
1597
+ /**
1598
+ * Whether memory usage exceeds the alert threshold
1599
+ * @returns {boolean}
1600
+ */
1601
+ get memory_alert_triggered() {
1602
+ const ret = wasm.__wbg_get_datastorestats_memory_alert_triggered(this.__wbg_ptr);
1603
+ return ret !== 0;
1604
+ }
1605
+ /**
1606
+ * Whether metrics tracking is enabled
1607
+ * @returns {boolean}
1608
+ */
1609
+ get metrics_enabled() {
1610
+ const ret = wasm.__wbg_get_datastorestats_metrics_enabled(this.__wbg_ptr);
1611
+ return ret !== 0;
1612
+ }
1613
+ /**
1614
+ * Total size of all entries in bytes (approximate, based on JSON serialization)
1615
+ * @returns {number}
1616
+ */
1617
+ get total_size_bytes() {
1618
+ const ret = wasm.__wbg_get_datastorestats_total_size_bytes(this.__wbg_ptr);
1619
+ return ret >>> 0;
1620
+ }
1621
+ /**
1622
+ * Average size per entry in bytes (0 if no entries)
1623
+ * @param {number} arg0
1624
+ */
1625
+ set avg_entry_size_bytes(arg0) {
1626
+ wasm.__wbg_set_datastorestats_avg_entry_size_bytes(this.__wbg_ptr, arg0);
1627
+ }
1628
+ /**
1629
+ * Percentage of capacity used (0.0-100.0, based on entry count)
1630
+ * @param {number} arg0
1631
+ */
1632
+ set capacity_usage_percent(arg0) {
1633
+ wasm.__wbg_set_datastorestats_capacity_usage_percent(this.__wbg_ptr, arg0);
1634
+ }
1635
+ /**
1636
+ * Number of entries currently stored
1637
+ * @param {number} arg0
1638
+ */
1639
+ set entry_count(arg0) {
1640
+ wasm.__wbg_set_datastorestats_entry_count(this.__wbg_ptr, arg0);
1641
+ }
1642
+ /**
1643
+ * Maximum number of entries allowed (0 = unlimited)
1644
+ * @param {number} arg0
1645
+ */
1646
+ set max_entries(arg0) {
1647
+ wasm.__wbg_set_datastorestats_max_entries(this.__wbg_ptr, arg0);
1648
+ }
1649
+ /**
1650
+ * Maximum size per entry in bytes (0 = unlimited)
1651
+ * @param {number} arg0
1652
+ */
1653
+ set max_entry_size(arg0) {
1654
+ wasm.__wbg_set_datastorestats_max_entry_size(this.__wbg_ptr, arg0);
1655
+ }
1656
+ /**
1657
+ * Memory usage threshold percentage (from config)
1658
+ * @param {number} arg0
1659
+ */
1660
+ set memory_alert_threshold(arg0) {
1661
+ wasm.__wbg_set_datastorestats_memory_alert_threshold(this.__wbg_ptr, arg0);
1662
+ }
1663
+ /**
1664
+ * Whether memory usage exceeds the alert threshold
1665
+ * @param {boolean} arg0
1666
+ */
1667
+ set memory_alert_triggered(arg0) {
1668
+ wasm.__wbg_set_datastorestats_memory_alert_triggered(this.__wbg_ptr, arg0);
1669
+ }
1670
+ /**
1671
+ * Whether metrics tracking is enabled
1672
+ * @param {boolean} arg0
1673
+ */
1674
+ set metrics_enabled(arg0) {
1675
+ wasm.__wbg_set_datastorestats_metrics_enabled(this.__wbg_ptr, arg0);
1676
+ }
1677
+ /**
1678
+ * Total size of all entries in bytes (approximate, based on JSON serialization)
1679
+ * @param {number} arg0
1680
+ */
1681
+ set total_size_bytes(arg0) {
1682
+ wasm.__wbg_set_datastorestats_total_size_bytes(this.__wbg_ptr, arg0);
1683
+ }
1684
+ };
1685
+ if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.prototype.free;
1686
+ var Diagnostics = class _Diagnostics {
1687
+ static __wrap(ptr) {
1688
+ const obj = Object.create(_Diagnostics.prototype);
1689
+ obj.__wbg_ptr = ptr;
1690
+ DiagnosticsFinalization.register(obj, obj.__wbg_ptr, obj);
1691
+ return obj;
1692
+ }
1693
+ __destroy_into_raw() {
1694
+ const ptr = this.__wbg_ptr;
1695
+ this.__wbg_ptr = 0;
1696
+ DiagnosticsFinalization.unregister(this);
1697
+ return ptr;
1698
+ }
1699
+ free() {
1700
+ const ptr = this.__destroy_into_raw();
1701
+ wasm.__wbg_diagnostics_free(ptr, 0);
1702
+ }
1703
+ /**
1704
+ * Errors that occurred during authorization. The errors should be
1705
+ * treated as unordered, since policies may be evaluated in any order.
1706
+ * @returns {PolicyEvaluationError[]}
1707
+ */
1708
+ get errors() {
1709
+ try {
1710
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1711
+ wasm.diagnostics_errors(retptr, this.__wbg_ptr);
1712
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1713
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1714
+ var v1 = getArrayJsValueFromWasm0(r0, r1);
1715
+ wasm.__wbindgen_export5(r0, r1 * 4, 4);
1716
+ return v1;
1717
+ } finally {
1718
+ wasm.__wbindgen_add_to_stack_pointer(16);
1719
+ }
1720
+ }
1721
+ /**
1722
+ * `PolicyId`s of the policies that contributed to the decision.
1723
+ * If no policies applied to the request, this set will be empty.
1724
+ *
1725
+ * The ids should be treated as unordered,
1726
+ * @returns {string[]}
1727
+ */
1728
+ get reason() {
1729
+ try {
1730
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1731
+ wasm.diagnostics_reason(retptr, this.__wbg_ptr);
1732
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1733
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1734
+ var v1 = getArrayJsValueFromWasm0(r0, r1);
1735
+ wasm.__wbindgen_export5(r0, r1 * 4, 4);
1736
+ return v1;
1737
+ } finally {
1738
+ wasm.__wbindgen_add_to_stack_pointer(16);
1739
+ }
1740
+ }
1741
+ };
1742
+ if (Symbol.dispose) Diagnostics.prototype[Symbol.dispose] = Diagnostics.prototype.free;
1743
+ var IntoUnderlyingByteSource = class {
1744
+ __destroy_into_raw() {
1745
+ const ptr = this.__wbg_ptr;
1746
+ this.__wbg_ptr = 0;
1747
+ IntoUnderlyingByteSourceFinalization.unregister(this);
1748
+ return ptr;
1749
+ }
1750
+ free() {
1751
+ const ptr = this.__destroy_into_raw();
1752
+ wasm.__wbg_intounderlyingbytesource_free(ptr, 0);
1753
+ }
1754
+ /**
1755
+ * @returns {number}
1756
+ */
1757
+ get autoAllocateChunkSize() {
1758
+ const ret = wasm.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr);
1759
+ return ret >>> 0;
1760
+ }
1761
+ cancel() {
1762
+ const ptr = this.__destroy_into_raw();
1763
+ wasm.intounderlyingbytesource_cancel(ptr);
1764
+ }
1765
+ /**
1766
+ * @param {ReadableByteStreamController} controller
1767
+ * @returns {Promise<any>}
1768
+ */
1769
+ pull(controller) {
1770
+ const ret = wasm.intounderlyingbytesource_pull(this.__wbg_ptr, addHeapObject(controller));
1771
+ return takeObject(ret);
1772
+ }
1773
+ /**
1774
+ * @param {ReadableByteStreamController} controller
1775
+ */
1776
+ start(controller) {
1777
+ wasm.intounderlyingbytesource_start(this.__wbg_ptr, addHeapObject(controller));
1778
+ }
1779
+ /**
1780
+ * @returns {ReadableStreamType}
1781
+ */
1782
+ get type() {
1783
+ const ret = wasm.intounderlyingbytesource_type(this.__wbg_ptr);
1784
+ return __wbindgen_enum_ReadableStreamType[ret];
1785
+ }
1786
+ };
1787
+ if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
1788
+ var IntoUnderlyingSink = class {
1789
+ __destroy_into_raw() {
1790
+ const ptr = this.__wbg_ptr;
1791
+ this.__wbg_ptr = 0;
1792
+ IntoUnderlyingSinkFinalization.unregister(this);
1793
+ return ptr;
1794
+ }
1795
+ free() {
1796
+ const ptr = this.__destroy_into_raw();
1797
+ wasm.__wbg_intounderlyingsink_free(ptr, 0);
1798
+ }
1799
+ /**
1800
+ * @param {any} reason
1801
+ * @returns {Promise<any>}
1802
+ */
1803
+ abort(reason) {
1804
+ const ptr = this.__destroy_into_raw();
1805
+ const ret = wasm.intounderlyingsink_abort(ptr, addHeapObject(reason));
1806
+ return takeObject(ret);
1807
+ }
1808
+ /**
1809
+ * @returns {Promise<any>}
1810
+ */
1811
+ close() {
1812
+ const ptr = this.__destroy_into_raw();
1813
+ const ret = wasm.intounderlyingsink_close(ptr);
1814
+ return takeObject(ret);
1815
+ }
1816
+ /**
1817
+ * @param {any} chunk
1818
+ * @returns {Promise<any>}
1819
+ */
1820
+ write(chunk) {
1821
+ const ret = wasm.intounderlyingsink_write(this.__wbg_ptr, addHeapObject(chunk));
1822
+ return takeObject(ret);
1823
+ }
1824
+ };
1825
+ if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
1826
+ var IntoUnderlyingSource = class {
1827
+ __destroy_into_raw() {
1828
+ const ptr = this.__wbg_ptr;
1829
+ this.__wbg_ptr = 0;
1830
+ IntoUnderlyingSourceFinalization.unregister(this);
1831
+ return ptr;
1832
+ }
1833
+ free() {
1834
+ const ptr = this.__destroy_into_raw();
1835
+ wasm.__wbg_intounderlyingsource_free(ptr, 0);
1836
+ }
1837
+ cancel() {
1838
+ const ptr = this.__destroy_into_raw();
1839
+ wasm.intounderlyingsource_cancel(ptr);
1840
+ }
1841
+ /**
1842
+ * @param {ReadableStreamDefaultController} controller
1843
+ * @returns {Promise<any>}
1844
+ */
1845
+ pull(controller) {
1846
+ const ret = wasm.intounderlyingsource_pull(this.__wbg_ptr, addHeapObject(controller));
1847
+ return takeObject(ret);
1848
+ }
1849
+ };
1850
+ if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
1851
+ var MultiIssuerAuthorizeResult = class _MultiIssuerAuthorizeResult {
1852
+ static __wrap(ptr) {
1853
+ const obj = Object.create(_MultiIssuerAuthorizeResult.prototype);
1854
+ obj.__wbg_ptr = ptr;
1855
+ MultiIssuerAuthorizeResultFinalization.register(obj, obj.__wbg_ptr, obj);
1856
+ return obj;
1857
+ }
1858
+ __destroy_into_raw() {
1859
+ const ptr = this.__wbg_ptr;
1860
+ this.__wbg_ptr = 0;
1861
+ MultiIssuerAuthorizeResultFinalization.unregister(this);
1862
+ return ptr;
1863
+ }
1864
+ free() {
1865
+ const ptr = this.__destroy_into_raw();
1866
+ wasm.__wbg_multiissuerauthorizeresult_free(ptr, 0);
1867
+ }
1868
+ /**
1869
+ * Result of authorization
1870
+ * true means `ALLOW`
1871
+ * false means `Deny`
1872
+ * @returns {boolean}
1873
+ */
1874
+ get decision() {
1875
+ const ret = wasm.__wbg_get_multiissuerauthorizeresult_decision(this.__wbg_ptr);
1876
+ return ret !== 0;
1877
+ }
1878
+ /**
1879
+ * Request ID of the authorization request
1880
+ * @returns {string}
1881
+ */
1882
+ get request_id() {
1883
+ let deferred1_0;
1884
+ let deferred1_1;
1885
+ try {
1886
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1887
+ wasm.__wbg_get_multiissuerauthorizeresult_request_id(retptr, this.__wbg_ptr);
1888
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1889
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1890
+ deferred1_0 = r0;
1891
+ deferred1_1 = r1;
1892
+ return getStringFromWasm0(r0, r1);
1893
+ } finally {
1894
+ wasm.__wbindgen_add_to_stack_pointer(16);
1895
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
1896
+ }
1897
+ }
1898
+ /**
1899
+ * Result of Cedar policy authorization
1900
+ * @returns {AuthorizeResultResponse}
1901
+ */
1902
+ get response() {
1903
+ const ret = wasm.__wbg_get_multiissuerauthorizeresult_response(this.__wbg_ptr);
1904
+ return AuthorizeResultResponse.__wrap(ret);
1905
+ }
1906
+ /**
1907
+ * Convert `MultiIssuerAuthorizeResult` to json string value
1908
+ * @returns {string}
1909
+ */
1910
+ jsonString() {
1911
+ let deferred1_0;
1912
+ let deferred1_1;
1913
+ try {
1914
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1915
+ wasm.multiissuerauthorizeresult_jsonString(retptr, this.__wbg_ptr);
1916
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1917
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1918
+ deferred1_0 = r0;
1919
+ deferred1_1 = r1;
1920
+ return getStringFromWasm0(r0, r1);
1921
+ } finally {
1922
+ wasm.__wbindgen_add_to_stack_pointer(16);
1923
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
1924
+ }
1925
+ }
1926
+ /**
1927
+ * Result of authorization
1928
+ * true means `ALLOW`
1929
+ * false means `Deny`
1930
+ * @param {boolean} arg0
1931
+ */
1932
+ set decision(arg0) {
1933
+ wasm.__wbg_set_multiissuerauthorizeresult_decision(this.__wbg_ptr, arg0);
1934
+ }
1935
+ /**
1936
+ * Request ID of the authorization request
1937
+ * @param {string} arg0
1938
+ */
1939
+ set request_id(arg0) {
1940
+ const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2);
1941
+ const len0 = WASM_VECTOR_LEN;
1942
+ wasm.__wbg_set_multiissuerauthorizeresult_request_id(this.__wbg_ptr, ptr0, len0);
1943
+ }
1944
+ /**
1945
+ * Result of Cedar policy authorization
1946
+ * @param {AuthorizeResultResponse} arg0
1947
+ */
1948
+ set response(arg0) {
1949
+ _assertClass(arg0, AuthorizeResultResponse);
1950
+ var ptr0 = arg0.__destroy_into_raw();
1951
+ wasm.__wbg_set_multiissuerauthorizeresult_response(this.__wbg_ptr, ptr0);
1952
+ }
1953
+ };
1954
+ if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = MultiIssuerAuthorizeResult.prototype.free;
1955
+ var PolicyEvaluationError = class _PolicyEvaluationError {
1956
+ static __wrap(ptr) {
1957
+ const obj = Object.create(_PolicyEvaluationError.prototype);
1958
+ obj.__wbg_ptr = ptr;
1959
+ PolicyEvaluationErrorFinalization.register(obj, obj.__wbg_ptr, obj);
1960
+ return obj;
1961
+ }
1962
+ __destroy_into_raw() {
1963
+ const ptr = this.__wbg_ptr;
1964
+ this.__wbg_ptr = 0;
1965
+ PolicyEvaluationErrorFinalization.unregister(this);
1966
+ return ptr;
1967
+ }
1968
+ free() {
1969
+ const ptr = this.__destroy_into_raw();
1970
+ wasm.__wbg_policyevaluationerror_free(ptr, 0);
1971
+ }
1972
+ /**
1973
+ * Underlying evaluation error string representation
1974
+ * @returns {string}
1975
+ */
1976
+ get error() {
1977
+ let deferred1_0;
1978
+ let deferred1_1;
1979
+ try {
1980
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1981
+ wasm.policyevaluationerror_error(retptr, this.__wbg_ptr);
1982
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1983
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1984
+ deferred1_0 = r0;
1985
+ deferred1_1 = r1;
1986
+ return getStringFromWasm0(r0, r1);
1987
+ } finally {
1988
+ wasm.__wbindgen_add_to_stack_pointer(16);
1989
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
1990
+ }
1991
+ }
1992
+ /**
1993
+ * Id of the policy with an error
1994
+ * @returns {string}
1995
+ */
1996
+ get id() {
1997
+ let deferred1_0;
1998
+ let deferred1_1;
1999
+ try {
2000
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2001
+ wasm.policyevaluationerror_id(retptr, this.__wbg_ptr);
2002
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2003
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2004
+ deferred1_0 = r0;
2005
+ deferred1_1 = r1;
2006
+ return getStringFromWasm0(r0, r1);
2007
+ } finally {
2008
+ wasm.__wbindgen_add_to_stack_pointer(16);
2009
+ wasm.__wbindgen_export5(deferred1_0, deferred1_1, 1);
2010
+ }
2011
+ }
2012
+ };
2013
+ if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEvaluationError.prototype.free;
2014
+ function init(config) {
2015
+ const ret = wasm.init(addHeapObject(config));
2016
+ return takeObject(ret);
2017
+ }
2018
+ function initFromArchiveBytes(config, archive_bytes) {
2019
+ const ret = wasm.initFromArchiveBytes(addHeapObject(config), addHeapObject(archive_bytes));
2020
+ return takeObject(ret);
2021
+ }
2022
+ function __wbg_get_imports() {
2023
+ const import0 = {
2024
+ __proto__: null,
2025
+ __wbg_Error_67e7344beaa85059: function(arg0, arg1) {
2026
+ const ret = Error(getStringFromWasm0(arg0, arg1));
2027
+ return addHeapObject(ret);
2028
+ },
2029
+ __wbg_Number_c54e7112a3fa7e3e: function(arg0) {
2030
+ const ret = Number(getObject(arg0));
2031
+ return ret;
2032
+ },
2033
+ __wbg___wbindgen_bigint_get_as_i64_b482365c149396c8: function(arg0, arg1) {
2034
+ const v = getObject(arg1);
2035
+ const ret = typeof v === "bigint" ? v : void 0;
2036
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
2037
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
2038
+ },
2039
+ __wbg___wbindgen_boolean_get_7a12af2b3f899c5a: function(arg0) {
2040
+ const v = getObject(arg0);
2041
+ const ret = typeof v === "boolean" ? v : void 0;
2042
+ return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
2043
+ },
2044
+ __wbg___wbindgen_debug_string_0e68cf47c9cbd9b0: function(arg0, arg1) {
2045
+ const ret = debugString(getObject(arg1));
2046
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2047
+ const len1 = WASM_VECTOR_LEN;
2048
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2049
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2050
+ },
2051
+ __wbg___wbindgen_in_50072d4d6e45c193: function(arg0, arg1) {
2052
+ const ret = getObject(arg0) in getObject(arg1);
2053
+ return ret;
2054
+ },
2055
+ __wbg___wbindgen_is_bigint_60fc0336cb14f5d7: function(arg0) {
2056
+ const ret = typeof getObject(arg0) === "bigint";
2057
+ return ret;
2058
+ },
2059
+ __wbg___wbindgen_is_function_fcda5e3902d732fe: function(arg0) {
2060
+ const ret = typeof getObject(arg0) === "function";
2061
+ return ret;
2062
+ },
2063
+ __wbg___wbindgen_is_object_edb6b15aa3afe12e: function(arg0) {
2064
+ const val = getObject(arg0);
2065
+ const ret = typeof val === "object" && val !== null;
2066
+ return ret;
2067
+ },
2068
+ __wbg___wbindgen_is_string_c4f7cb494a2a21f1: function(arg0) {
2069
+ const ret = typeof getObject(arg0) === "string";
2070
+ return ret;
2071
+ },
2072
+ __wbg___wbindgen_is_undefined_8c687d0b90d5b524: function(arg0) {
2073
+ const ret = getObject(arg0) === void 0;
2074
+ return ret;
2075
+ },
2076
+ __wbg___wbindgen_jsval_eq_9fdcd3c0a860dd3b: function(arg0, arg1) {
2077
+ const ret = getObject(arg0) === getObject(arg1);
2078
+ return ret;
2079
+ },
2080
+ __wbg___wbindgen_jsval_loose_eq_3c30021c243b64cd: function(arg0, arg1) {
2081
+ const ret = getObject(arg0) == getObject(arg1);
2082
+ return ret;
2083
+ },
2084
+ __wbg___wbindgen_number_get_1dc732b810cb937c: function(arg0, arg1) {
2085
+ const obj = getObject(arg1);
2086
+ const ret = typeof obj === "number" ? obj : void 0;
2087
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
2088
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
2089
+ },
2090
+ __wbg___wbindgen_string_get_92ab86bb19cbc12f: function(arg0, arg1) {
2091
+ const obj = getObject(arg1);
2092
+ const ret = typeof obj === "string" ? obj : void 0;
2093
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2094
+ var len1 = WASM_VECTOR_LEN;
2095
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2096
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2097
+ },
2098
+ __wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
2099
+ throw new Error(getStringFromWasm0(arg0, arg1));
2100
+ },
2101
+ __wbg__wbg_cb_unref_997e73d32238e655: function(arg0) {
2102
+ getObject(arg0)._wbg_cb_unref();
2103
+ },
2104
+ __wbg_abort_03f8c5804715cb9a: function(arg0, arg1) {
2105
+ getObject(arg0).abort(getObject(arg1));
2106
+ },
2107
+ __wbg_abort_76dea11221098ae5: function(arg0) {
2108
+ getObject(arg0).abort();
2109
+ },
2110
+ __wbg_append_8e87c13f0f08f8cd: function() {
2111
+ return handleError(function(arg0, arg1, arg2, arg3, arg4) {
2112
+ getObject(arg0).append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
2113
+ }, arguments);
2114
+ },
2115
+ __wbg_arrayBuffer_06f3da76f071d37f: function() {
2116
+ return handleError(function(arg0) {
2117
+ const ret = getObject(arg0).arrayBuffer();
2118
+ return addHeapObject(ret);
2119
+ }, arguments);
2120
+ },
2121
+ __wbg_authorizeresult_new: function(arg0) {
2122
+ const ret = AuthorizeResult.__wrap(arg0);
2123
+ return addHeapObject(ret);
2124
+ },
2125
+ __wbg_batchauthorizemultiissuerresponse_new: function(arg0) {
2126
+ const ret = BatchAuthorizeMultiIssuerResponse.__wrap(arg0);
2127
+ return addHeapObject(ret);
2128
+ },
2129
+ __wbg_batchauthorizeunsignedresponse_new: function(arg0) {
2130
+ const ret = BatchAuthorizeUnsignedResponse.__wrap(arg0);
2131
+ return addHeapObject(ret);
2132
+ },
2133
+ __wbg_batchitemmultiissuerresult_new: function(arg0) {
2134
+ const ret = BatchItemMultiIssuerResult.__wrap(arg0);
2135
+ return addHeapObject(ret);
2136
+ },
2137
+ __wbg_batchitemunsignedresult_new: function(arg0) {
2138
+ const ret = BatchItemUnsignedResult.__wrap(arg0);
2139
+ return addHeapObject(ret);
2140
+ },
2141
+ __wbg_body_9ee03724e9ad0639: function(arg0) {
2142
+ const ret = getObject(arg0).body;
2143
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2144
+ },
2145
+ __wbg_buffer_4a989bded7035f57: function(arg0) {
2146
+ const ret = getObject(arg0).buffer;
2147
+ return addHeapObject(ret);
2148
+ },
2149
+ __wbg_byobRequest_f161fc37241dd3d4: function(arg0) {
2150
+ const ret = getObject(arg0).byobRequest;
2151
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2152
+ },
2153
+ __wbg_byteLength_0ddb1795e2c7e689: function(arg0) {
2154
+ const ret = getObject(arg0).byteLength;
2155
+ return ret;
2156
+ },
2157
+ __wbg_byteOffset_46eb015f52b6ad7d: function(arg0) {
2158
+ const ret = getObject(arg0).byteOffset;
2159
+ return ret;
2160
+ },
2161
+ __wbg_call_269c5566fbede3eb: function() {
2162
+ return handleError(function(arg0, arg1) {
2163
+ const ret = getObject(arg0).call(getObject(arg1));
2164
+ return addHeapObject(ret);
2165
+ }, arguments);
2166
+ },
2167
+ __wbg_call_6bcf8d3e20937e46: function() {
2168
+ return handleError(function(arg0, arg1, arg2) {
2169
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
2170
+ return addHeapObject(ret);
2171
+ }, arguments);
2172
+ },
2173
+ __wbg_cancel_c076350a7e8954be: function(arg0) {
2174
+ const ret = getObject(arg0).cancel();
2175
+ return addHeapObject(ret);
2176
+ },
2177
+ __wbg_catch_e2134ef6dcdb69ed: function(arg0, arg1) {
2178
+ const ret = getObject(arg0).catch(getObject(arg1));
2179
+ return addHeapObject(ret);
2180
+ },
2181
+ __wbg_cedarling_new: function(arg0) {
2182
+ const ret = Cedarling.__wrap(arg0);
2183
+ return addHeapObject(ret);
2184
+ },
2185
+ __wbg_clearTimeout_1daad5c6ee4fcd3b: function(arg0) {
2186
+ const ret = clearTimeout(takeObject(arg0));
2187
+ return addHeapObject(ret);
2188
+ },
2189
+ __wbg_clearTimeout_3629d6209dfcc46e: function(arg0) {
2190
+ const ret = clearTimeout(takeObject(arg0));
2191
+ return addHeapObject(ret);
2192
+ },
2193
+ __wbg_clearTimeout_fa0abacb8606b0a7: function(arg0) {
2194
+ const ret = clearTimeout(takeObject(arg0));
2195
+ return addHeapObject(ret);
2196
+ },
2197
+ __wbg_close_22882088c136df25: function() {
2198
+ return handleError(function(arg0) {
2199
+ getObject(arg0).close();
2200
+ }, arguments);
2201
+ },
2202
+ __wbg_close_8b609460dd26e367: function() {
2203
+ return handleError(function(arg0) {
2204
+ getObject(arg0).close();
2205
+ }, arguments);
2206
+ },
2207
+ __wbg_crypto_38df2bab126b63dc: function(arg0) {
2208
+ const ret = getObject(arg0).crypto;
2209
+ return addHeapObject(ret);
2210
+ },
2211
+ __wbg_dataentry_new: function(arg0) {
2212
+ const ret = DataEntry.__wrap(arg0);
2213
+ return addHeapObject(ret);
2214
+ },
2215
+ __wbg_debug_05a311ddbfef3a8f: function(arg0) {
2216
+ console.debug(...getObject(arg0));
2217
+ },
2218
+ __wbg_done_cffed884d87aa22e: function(arg0) {
2219
+ const ret = getObject(arg0).done;
2220
+ return ret;
2221
+ },
2222
+ __wbg_enqueue_6cb545d22db14f33: function() {
2223
+ return handleError(function(arg0, arg1) {
2224
+ getObject(arg0).enqueue(getObject(arg1));
2225
+ }, arguments);
2226
+ },
2227
+ __wbg_entries_20b9608d57d8ddd6: function(arg0) {
2228
+ const ret = getObject(arg0).entries();
2229
+ return addHeapObject(ret);
2230
+ },
2231
+ __wbg_entries_972a87586902cf87: function(arg0) {
2232
+ const ret = Object.entries(getObject(arg0));
2233
+ return addHeapObject(ret);
2234
+ },
2235
+ __wbg_entries_f9de04c09a57314e: function(arg0) {
2236
+ const ret = getObject(arg0).entries();
2237
+ return addHeapObject(ret);
2238
+ },
2239
+ __wbg_error_b73a4f5824169740: function(arg0) {
2240
+ console.error(...getObject(arg0));
2241
+ },
2242
+ __wbg_fetch_37b5c90ecd638071: function(arg0, arg1) {
2243
+ const ret = fetch(getObject(arg0), getObject(arg1));
2244
+ return addHeapObject(ret);
2245
+ },
2246
+ __wbg_fetch_7a37768ab67c5bd8: function(arg0) {
2247
+ const ret = fetch(getObject(arg0));
2248
+ return addHeapObject(ret);
2249
+ },
2250
+ __wbg_fetch_920242d59bac2026: function(arg0, arg1) {
2251
+ const ret = getObject(arg0).fetch(getObject(arg1));
2252
+ return addHeapObject(ret);
2253
+ },
2254
+ __wbg_fetch_db3df7e2da5d3a3b: function(arg0, arg1, arg2) {
2255
+ const ret = getObject(arg0).fetch(getObject(arg1), getObject(arg2));
2256
+ return addHeapObject(ret);
2257
+ },
2258
+ __wbg_fromEntries_7b28aba4b67dea2a: function() {
2259
+ return handleError(function(arg0) {
2260
+ const ret = Object.fromEntries(getObject(arg0));
2261
+ return addHeapObject(ret);
2262
+ }, arguments);
2263
+ },
2264
+ __wbg_getRandomValues_436a51d0629d84e1: function() {
2265
+ return handleError(function(arg0, arg1) {
2266
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
2267
+ }, arguments);
2268
+ },
2269
+ __wbg_getRandomValues_c44a50d8cfdaebeb: function() {
2270
+ return handleError(function(arg0, arg1) {
2271
+ getObject(arg0).getRandomValues(getObject(arg1));
2272
+ }, arguments);
2273
+ },
2274
+ __wbg_getReader_bf34f92ee19c42b4: function() {
2275
+ return handleError(function(arg0) {
2276
+ const ret = getObject(arg0).getReader();
2277
+ return addHeapObject(ret);
2278
+ }, arguments);
2279
+ },
2280
+ __wbg_getTime_65922ba0b59d55a7: function(arg0) {
2281
+ const ret = getObject(arg0).getTime();
2282
+ return ret;
2283
+ },
2284
+ __wbg_getTimezoneOffset_6e4850ad528ac37d: function(arg0) {
2285
+ const ret = getObject(arg0).getTimezoneOffset();
2286
+ return ret;
2287
+ },
2288
+ __wbg_get_6cf5a4d4d8ad3c5a: function() {
2289
+ return handleError(function(arg0, arg1) {
2290
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
2291
+ return addHeapObject(ret);
2292
+ }, arguments);
2293
+ },
2294
+ __wbg_get_989d0a1309644f2b: function() {
2295
+ return handleError(function(arg0, arg1) {
2296
+ const ret = Reflect.get(getObject(arg0), getObject(arg1));
2297
+ return addHeapObject(ret);
2298
+ }, arguments);
2299
+ },
2300
+ __wbg_get_b1f0ab13c737f856: function(arg0, arg1) {
2301
+ const ret = getObject(arg0)[arg1 >>> 0];
2302
+ return addHeapObject(ret);
2303
+ },
2304
+ __wbg_get_done_a668aa62d81fad70: function(arg0) {
2305
+ const ret = getObject(arg0).done;
2306
+ return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
2307
+ },
2308
+ __wbg_get_unchecked_363572bdd397d473: function(arg0, arg1) {
2309
+ const ret = getObject(arg0)[arg1 >>> 0];
2310
+ return addHeapObject(ret);
2311
+ },
2312
+ __wbg_get_value_6c62a77c168d825a: function(arg0) {
2313
+ const ret = getObject(arg0).value;
2314
+ return addHeapObject(ret);
2315
+ },
2316
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
2317
+ const ret = getObject(arg0)[getObject(arg1)];
2318
+ return addHeapObject(ret);
2319
+ },
2320
+ __wbg_has_464f8b9416279d65: function() {
2321
+ return handleError(function(arg0, arg1) {
2322
+ const ret = Reflect.has(getObject(arg0), getObject(arg1));
2323
+ return ret;
2324
+ }, arguments);
2325
+ },
2326
+ __wbg_headers_2594464ff62969f3: function(arg0) {
2327
+ const ret = getObject(arg0).headers;
2328
+ return addHeapObject(ret);
2329
+ },
2330
+ __wbg_info_e117f690cadd7085: function(arg0) {
2331
+ console.info(...getObject(arg0));
2332
+ },
2333
+ __wbg_instanceof_ArrayBuffer_d4ff01f8247925ae: function(arg0) {
2334
+ let result;
2335
+ try {
2336
+ result = getObject(arg0) instanceof ArrayBuffer;
2337
+ } catch (_) {
2338
+ result = false;
2339
+ }
2340
+ const ret = result;
2341
+ return ret;
2342
+ },
2343
+ __wbg_instanceof_Array_fb99baf356838802: function(arg0) {
2344
+ let result;
2345
+ try {
2346
+ result = getObject(arg0) instanceof Array;
2347
+ } catch (_) {
2348
+ result = false;
2349
+ }
2350
+ const ret = result;
2351
+ return ret;
2352
+ },
2353
+ __wbg_instanceof_Map_1ff6a2b54c899f0d: function(arg0) {
2354
+ let result;
2355
+ try {
2356
+ result = getObject(arg0) instanceof Map;
2357
+ } catch (_) {
2358
+ result = false;
2359
+ }
2360
+ const ret = result;
2361
+ return ret;
2362
+ },
2363
+ __wbg_instanceof_Response_6366a785e400039b: function(arg0) {
2364
+ let result;
2365
+ try {
2366
+ result = getObject(arg0) instanceof Response;
2367
+ } catch (_) {
2368
+ result = false;
2369
+ }
2370
+ const ret = result;
2371
+ return ret;
2372
+ },
2373
+ __wbg_instanceof_Uint8Array_598adc0fef426aa8: function(arg0) {
2374
+ let result;
2375
+ try {
2376
+ result = getObject(arg0) instanceof Uint8Array;
2377
+ } catch (_) {
2378
+ result = false;
2379
+ }
2380
+ const ret = result;
2381
+ return ret;
2382
+ },
2383
+ __wbg_isArray_5674713bb7b79043: function(arg0) {
2384
+ const ret = Array.isArray(getObject(arg0));
2385
+ return ret;
2386
+ },
2387
+ __wbg_isSafeInteger_8f51c743827d1ec5: function(arg0) {
2388
+ const ret = Number.isSafeInteger(getObject(arg0));
2389
+ return ret;
2390
+ },
2391
+ __wbg_iterator_22ddeb808cf55a6f: function() {
2392
+ const ret = Symbol.iterator;
2393
+ return addHeapObject(ret);
2394
+ },
2395
+ __wbg_keys_6efc298980178da1: function(arg0) {
2396
+ const ret = Object.keys(getObject(arg0));
2397
+ return addHeapObject(ret);
2398
+ },
2399
+ __wbg_length_31bdaf014f5fbde2: function(arg0) {
2400
+ const ret = getObject(arg0).length;
2401
+ return ret;
2402
+ },
2403
+ __wbg_length_4e1adc0d42e23620: function(arg0) {
2404
+ const ret = getObject(arg0).length;
2405
+ return ret;
2406
+ },
2407
+ __wbg_log_16ab6e7183963f7e: function(arg0) {
2408
+ console.log(...getObject(arg0));
2409
+ },
2410
+ __wbg_msCrypto_bd5a034af96bcba6: function(arg0) {
2411
+ const ret = getObject(arg0).msCrypto;
2412
+ return addHeapObject(ret);
2413
+ },
2414
+ __wbg_multiissuerauthorizeresult_new: function(arg0) {
2415
+ const ret = MultiIssuerAuthorizeResult.__wrap(arg0);
2416
+ return addHeapObject(ret);
2417
+ },
2418
+ __wbg_new_0_35540e542ba689d2: function() {
2419
+ const ret = /* @__PURE__ */ new Date();
2420
+ return addHeapObject(ret);
2421
+ },
2422
+ __wbg_new_0afe64b4dc16ab74: function() {
2423
+ return handleError(function() {
2424
+ const ret = new Headers();
2425
+ return addHeapObject(ret);
2426
+ }, arguments);
2427
+ },
2428
+ __wbg_new_180f1022bb6ee517: function(arg0) {
2429
+ const ret = new Date(getObject(arg0));
2430
+ return addHeapObject(ret);
2431
+ },
2432
+ __wbg_new_1da3429bc3c4541c: function(arg0) {
2433
+ const ret = new Uint8Array(getObject(arg0));
2434
+ return addHeapObject(ret);
2435
+ },
2436
+ __wbg_new_8d36e20aa758e411: function() {
2437
+ const ret = /* @__PURE__ */ new Map();
2438
+ return addHeapObject(ret);
2439
+ },
2440
+ __wbg_new_a32a1ab6c6655abe: function(arg0, arg1) {
2441
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
2442
+ return addHeapObject(ret);
2443
+ },
2444
+ __wbg_new_baa0a0207935dd43: function() {
2445
+ return handleError(function() {
2446
+ const ret = new AbortController();
2447
+ return addHeapObject(ret);
2448
+ }, arguments);
2449
+ },
2450
+ __wbg_new_bebc3f4757acf305: function() {
2451
+ const ret = new Object();
2452
+ return addHeapObject(ret);
2453
+ },
2454
+ __wbg_new_ffa92086ea89f79c: function() {
2455
+ const ret = new Array();
2456
+ return addHeapObject(ret);
2457
+ },
2458
+ __wbg_new_from_slice_4ee02165f9de919e: function(arg0, arg1) {
2459
+ const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
2460
+ return addHeapObject(ret);
2461
+ },
2462
+ __wbg_new_typed_6f8b0d724fe26c07: function(arg0, arg1) {
2463
+ try {
2464
+ var state0 = { a: arg0, b: arg1 };
2465
+ var cb0 = (arg02, arg12) => {
2466
+ const a = state0.a;
2467
+ state0.a = 0;
2468
+ try {
2469
+ return __wasm_bindgen_func_elem_8955(a, state0.b, arg02, arg12);
2470
+ } finally {
2471
+ state0.a = a;
2472
+ }
2473
+ };
2474
+ const ret = new Promise(cb0);
2475
+ return addHeapObject(ret);
2476
+ } finally {
2477
+ state0.a = 0;
2478
+ }
2479
+ },
2480
+ __wbg_new_with_byte_offset_and_length_492c969e8b5da8a4: function(arg0, arg1, arg2) {
2481
+ const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
2482
+ return addHeapObject(ret);
2483
+ },
2484
+ __wbg_new_with_length_5ffeddb9d9fbb96f: function(arg0) {
2485
+ const ret = new Uint8Array(arg0 >>> 0);
2486
+ return addHeapObject(ret);
2487
+ },
2488
+ __wbg_new_with_str_and_init_2f31a77deda127fd: function() {
2489
+ return handleError(function(arg0, arg1, arg2) {
2490
+ const ret = new Request(getStringFromWasm0(arg0, arg1), getObject(arg2));
2491
+ return addHeapObject(ret);
2492
+ }, arguments);
2493
+ },
2494
+ __wbg_next_95053e306b1c3aed: function(arg0) {
2495
+ const ret = getObject(arg0).next;
2496
+ return addHeapObject(ret);
2497
+ },
2498
+ __wbg_next_f31ecb8646d2c605: function() {
2499
+ return handleError(function(arg0) {
2500
+ const ret = getObject(arg0).next();
2501
+ return addHeapObject(ret);
2502
+ }, arguments);
2503
+ },
2504
+ __wbg_node_84ea875411254db1: function(arg0) {
2505
+ const ret = getObject(arg0).node;
2506
+ return addHeapObject(ret);
2507
+ },
2508
+ __wbg_policyevaluationerror_new: function(arg0) {
2509
+ const ret = PolicyEvaluationError.__wrap(arg0);
2510
+ return addHeapObject(ret);
2511
+ },
2512
+ __wbg_process_44c7a14e11e9f69e: function(arg0) {
2513
+ const ret = getObject(arg0).process;
2514
+ return addHeapObject(ret);
2515
+ },
2516
+ __wbg_prototypesetcall_ae9f5e7459250748: function(arg0, arg1, arg2) {
2517
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
2518
+ },
2519
+ __wbg_push_bfdf956ba476f65b: function(arg0, arg1) {
2520
+ const ret = getObject(arg0).push(getObject(arg1));
2521
+ return ret;
2522
+ },
2523
+ __wbg_queueMicrotask_85c90f6987555d65: function(arg0) {
2524
+ const ret = getObject(arg0).queueMicrotask;
2525
+ return addHeapObject(ret);
2526
+ },
2527
+ __wbg_queueMicrotask_f6a1fa10b81d1fc0: function(arg0) {
2528
+ queueMicrotask(getObject(arg0));
2529
+ },
2530
+ __wbg_randomFillSync_6c25eac9869eb53c: function() {
2531
+ return handleError(function(arg0, arg1) {
2532
+ getObject(arg0).randomFillSync(takeObject(arg1));
2533
+ }, arguments);
2534
+ },
2535
+ __wbg_read_31091533ffadf971: function(arg0) {
2536
+ const ret = getObject(arg0).read();
2537
+ return addHeapObject(ret);
2538
+ },
2539
+ __wbg_releaseLock_1538945f5f183d9f: function(arg0) {
2540
+ getObject(arg0).releaseLock();
2541
+ },
2542
+ __wbg_require_b4edbdcf3e2a1ef0: function() {
2543
+ return handleError(function() {
2544
+ const ret = module.require;
2545
+ return addHeapObject(ret);
2546
+ }, arguments);
2547
+ },
2548
+ __wbg_resolve_35ec7e0c6af4c82c: function(arg0) {
2549
+ const ret = Promise.resolve(getObject(arg0));
2550
+ return addHeapObject(ret);
2551
+ },
2552
+ __wbg_respond_83a71686e927ca32: function() {
2553
+ return handleError(function(arg0, arg1) {
2554
+ getObject(arg0).respond(arg1 >>> 0);
2555
+ }, arguments);
2556
+ },
2557
+ __wbg_setTimeout_56bcdccbad22fd44: function() {
2558
+ return handleError(function(arg0, arg1) {
2559
+ const ret = setTimeout(getObject(arg0), arg1);
2560
+ return addHeapObject(ret);
2561
+ }, arguments);
2562
+ },
2563
+ __wbg_setTimeout_9c23a5767d86152f: function(arg0, arg1) {
2564
+ const ret = setTimeout(getObject(arg0), arg1);
2565
+ return addHeapObject(ret);
2566
+ },
2567
+ __wbg_setTimeout_b4a9096784635514: function(arg0, arg1) {
2568
+ const ret = setTimeout(getObject(arg0), arg1);
2569
+ return addHeapObject(ret);
2570
+ },
2571
+ __wbg_set_13d25b81ab403f5e: function(arg0, arg1, arg2) {
2572
+ getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
2573
+ },
2574
+ __wbg_set_5f2ad37e5e02dc7b: function(arg0, arg1, arg2) {
2575
+ getObject(arg0).set(getArrayU8FromWasm0(arg1, arg2));
2576
+ },
2577
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
2578
+ getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
2579
+ },
2580
+ __wbg_set_7923e5ea63b41e6b: function() {
2581
+ return handleError(function(arg0, arg1, arg2, arg3, arg4) {
2582
+ getObject(arg0).set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
2583
+ }, arguments);
2584
+ },
2585
+ __wbg_set_a377297433dfea63: function() {
2586
+ return handleError(function(arg0, arg1, arg2) {
2587
+ const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
2588
+ return ret;
2589
+ }, arguments);
2590
+ },
2591
+ __wbg_set_bf6dde4923b9b059: function(arg0, arg1, arg2) {
2592
+ const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
2593
+ return addHeapObject(ret);
2594
+ },
2595
+ __wbg_set_body_f39cee72c74a5b02: function(arg0, arg1) {
2596
+ getObject(arg0).body = getObject(arg1);
2597
+ },
2598
+ __wbg_set_cache_6e8c35a5ed76edb1: function(arg0, arg1) {
2599
+ getObject(arg0).cache = __wbindgen_enum_RequestCache[arg1];
2600
+ },
2601
+ __wbg_set_credentials_bf1d3e014213a571: function(arg0, arg1) {
2602
+ getObject(arg0).credentials = __wbindgen_enum_RequestCredentials[arg1];
2603
+ },
2604
+ __wbg_set_headers_31d373f68f28bf76: function(arg0, arg1) {
2605
+ getObject(arg0).headers = getObject(arg1);
2606
+ },
2607
+ __wbg_set_integrity_d3d0eab9ab838204: function(arg0, arg1, arg2) {
2608
+ getObject(arg0).integrity = getStringFromWasm0(arg1, arg2);
2609
+ },
2610
+ __wbg_set_method_82e6c3c083da0734: function(arg0, arg1, arg2) {
2611
+ getObject(arg0).method = getStringFromWasm0(arg1, arg2);
2612
+ },
2613
+ __wbg_set_mode_f7e56ed768d0ade0: function(arg0, arg1) {
2614
+ getObject(arg0).mode = __wbindgen_enum_RequestMode[arg1];
2615
+ },
2616
+ __wbg_set_redirect_96061705212f7800: function(arg0, arg1) {
2617
+ getObject(arg0).redirect = __wbindgen_enum_RequestRedirect[arg1];
2618
+ },
2619
+ __wbg_set_referrer_13cf56bbccbb2ceb: function(arg0, arg1, arg2) {
2620
+ getObject(arg0).referrer = getStringFromWasm0(arg1, arg2);
2621
+ },
2622
+ __wbg_set_referrer_policy_dac1caa6e937479a: function(arg0, arg1) {
2623
+ getObject(arg0).referrerPolicy = __wbindgen_enum_ReferrerPolicy[arg1];
2624
+ },
2625
+ __wbg_set_signal_f4b32f40f19786f4: function(arg0, arg1) {
2626
+ getObject(arg0).signal = getObject(arg1);
2627
+ },
2628
+ __wbg_signal_45367c6c2255877a: function(arg0) {
2629
+ const ret = getObject(arg0).signal;
2630
+ return addHeapObject(ret);
2631
+ },
2632
+ __wbg_static_accessor_GLOBAL_8eb4cd83130a11a0: function() {
2633
+ const ret = typeof global === "undefined" ? null : global;
2634
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2635
+ },
2636
+ __wbg_static_accessor_GLOBAL_THIS_1e7044f654e934db: function() {
2637
+ const ret = typeof globalThis === "undefined" ? null : globalThis;
2638
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2639
+ },
2640
+ __wbg_static_accessor_SELF_d8b50611246a6d92: function() {
2641
+ const ret = typeof self === "undefined" ? null : self;
2642
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2643
+ },
2644
+ __wbg_static_accessor_WINDOW_fd0bc376bf0f8b42: function() {
2645
+ const ret = typeof window === "undefined" ? null : window;
2646
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2647
+ },
2648
+ __wbg_status_88ccc72fe7bea621: function(arg0) {
2649
+ const ret = getObject(arg0).status;
2650
+ return ret;
2651
+ },
2652
+ __wbg_subarray_1daff70dde20c145: function(arg0, arg1, arg2) {
2653
+ const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
2654
+ return addHeapObject(ret);
2655
+ },
2656
+ __wbg_then_7a850dae4493f353: function(arg0, arg1, arg2) {
2657
+ const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
2658
+ return addHeapObject(ret);
2659
+ },
2660
+ __wbg_then_b830475380919203: function(arg0, arg1) {
2661
+ const ret = getObject(arg0).then(getObject(arg1));
2662
+ return addHeapObject(ret);
2663
+ },
2664
+ __wbg_toString_794a30e85c994f2a: function(arg0) {
2665
+ const ret = getObject(arg0).toString();
2666
+ return addHeapObject(ret);
2667
+ },
2668
+ __wbg_trace_584ab86b20e4c341: function(arg0) {
2669
+ console.trace(...getObject(arg0));
2670
+ },
2671
+ __wbg_url_f1948b0d7f881e02: function(arg0, arg1) {
2672
+ const ret = getObject(arg1).url;
2673
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
2674
+ const len1 = WASM_VECTOR_LEN;
2675
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
2676
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
2677
+ },
2678
+ __wbg_value_c227f843d21da141: function(arg0) {
2679
+ const ret = getObject(arg0).value;
2680
+ return addHeapObject(ret);
2681
+ },
2682
+ __wbg_versions_276b2795b1c6a219: function(arg0) {
2683
+ const ret = getObject(arg0).versions;
2684
+ return addHeapObject(ret);
2685
+ },
2686
+ __wbg_view_d8c7b26e4d4650f1: function(arg0) {
2687
+ const ret = getObject(arg0).view;
2688
+ return isLikeNone(ret) ? 0 : addHeapObject(ret);
2689
+ },
2690
+ __wbg_warn_0bd6e4ae163b14e2: function(arg0) {
2691
+ console.warn(...getObject(arg0));
2692
+ },
2693
+ __wbindgen_generic_0000000000000001: function(arg0, arg1) {
2694
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8900);
2695
+ return addHeapObject(ret);
2696
+ },
2697
+ __wbindgen_generic_0000000000000002: function(arg0, arg1) {
2698
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_12460);
2699
+ return addHeapObject(ret);
2700
+ },
2701
+ __wbindgen_generic_0000000000000003: function(arg0, arg1) {
2702
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8734);
2703
+ return addHeapObject(ret);
2704
+ },
2705
+ __wbindgen_generic_0000000000000004: function(arg0) {
2706
+ const ret = arg0;
2707
+ return addHeapObject(ret);
2708
+ },
2709
+ __wbindgen_generic_0000000000000005: function(arg0) {
2710
+ const ret = arg0;
2711
+ return addHeapObject(ret);
2712
+ },
2713
+ __wbindgen_generic_0000000000000006: function(arg0, arg1) {
2714
+ const ret = getArrayU8FromWasm0(arg0, arg1);
2715
+ return addHeapObject(ret);
2716
+ },
2717
+ __wbindgen_generic_0000000000000007: function(arg0, arg1) {
2718
+ const ret = getStringFromWasm0(arg0, arg1);
2719
+ return addHeapObject(ret);
2720
+ },
2721
+ __wbindgen_generic_0000000000000008: function(arg0) {
2722
+ const ret = BigInt.asUintN(64, arg0);
2723
+ return addHeapObject(ret);
2724
+ },
2725
+ __wbindgen_object_clone_ref: function(arg0) {
2726
+ const ret = getObject(arg0);
2727
+ return addHeapObject(ret);
2728
+ },
2729
+ __wbindgen_object_drop_ref: function(arg0) {
2730
+ takeObject(arg0);
2731
+ }
2732
+ };
2733
+ return {
2734
+ __proto__: null,
2735
+ "./cedarling_wasm_bg.js": import0
2736
+ };
2737
+ }
2738
+ function __wasm_bindgen_func_elem_8734(arg0, arg1) {
2739
+ wasm.__wasm_bindgen_func_elem_8734(arg0, arg1);
2740
+ }
2741
+ function __wasm_bindgen_func_elem_12460(arg0, arg1, arg2) {
2742
+ wasm.__wasm_bindgen_func_elem_12460(arg0, arg1, addHeapObject(arg2));
2743
+ }
2744
+ function __wasm_bindgen_func_elem_8955(arg0, arg1, arg2, arg3) {
2745
+ wasm.__wasm_bindgen_func_elem_8955(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
2746
+ }
2747
+ function __wasm_bindgen_func_elem_8900(arg0, arg1, arg2) {
2748
+ try {
2749
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
2750
+ wasm.__wasm_bindgen_func_elem_8900(retptr, arg0, arg1, addHeapObject(arg2));
2751
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
2752
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
2753
+ if (r1) {
2754
+ throw takeObject(r0);
2755
+ }
2756
+ } finally {
2757
+ wasm.__wbindgen_add_to_stack_pointer(16);
2758
+ }
2759
+ }
2760
+ var __wbindgen_enum_ReadableStreamType = ["bytes"];
2761
+ var __wbindgen_enum_ReferrerPolicy = ["", "no-referrer", "no-referrer-when-downgrade", "origin", "origin-when-cross-origin", "unsafe-url", "same-origin", "strict-origin", "strict-origin-when-cross-origin"];
2762
+ var __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
2763
+ var __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
2764
+ var __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
2765
+ var __wbindgen_enum_RequestRedirect = ["follow", "error", "manual"];
2766
+ var AuthorizeResultFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
2767
+ }, unregister: () => {
2768
+ } } : new FinalizationRegistry((ptr) => wasm.__wbg_authorizeresult_free(ptr, 1));
2769
+ var AuthorizeResultResponseFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
2770
+ }, unregister: () => {
2771
+ } } : new FinalizationRegistry((ptr) => wasm.__wbg_authorizeresultresponse_free(ptr, 1));
2772
+ var BatchAuthorizeMultiIssuerResponseFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
2773
+ }, unregister: () => {
2774
+ } } : new FinalizationRegistry((ptr) => wasm.__wbg_batchauthorizemultiissuerresponse_free(ptr, 1));
2775
+ var BatchAuthorizeUnsignedResponseFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
2776
+ }, unregister: () => {
2777
+ } } : new FinalizationRegistry((ptr) => wasm.__wbg_batchauthorizeunsignedresponse_free(ptr, 1));
2778
+ var BatchItemErrorFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
2779
+ }, unregister: () => {
2780
+ } } : new FinalizationRegistry((ptr) => wasm.__wbg_batchitemerror_free(ptr, 1));
2781
+ var BatchItemMultiIssuerResultFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
2782
+ }, unregister: () => {
2783
+ } } : new FinalizationRegistry((ptr) => wasm.__wbg_batchitemmultiissuerresult_free(ptr, 1));
2784
+ var BatchItemUnsignedResultFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
2785
+ }, unregister: () => {
2786
+ } } : new FinalizationRegistry((ptr) => wasm.__wbg_batchitemunsignedresult_free(ptr, 1));
2787
+ var CedarlingFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
2788
+ }, unregister: () => {
2789
+ } } : new FinalizationRegistry((ptr) => wasm.__wbg_cedarling_free(ptr, 1));
2790
+ var DataEntryFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
2791
+ }, unregister: () => {
2792
+ } } : new FinalizationRegistry((ptr) => wasm.__wbg_dataentry_free(ptr, 1));
2793
+ var DataStoreStatsFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
2794
+ }, unregister: () => {
2795
+ } } : new FinalizationRegistry((ptr) => wasm.__wbg_datastorestats_free(ptr, 1));
2796
+ var DiagnosticsFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
2797
+ }, unregister: () => {
2798
+ } } : new FinalizationRegistry((ptr) => wasm.__wbg_diagnostics_free(ptr, 1));
2799
+ var IntoUnderlyingByteSourceFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
2800
+ }, unregister: () => {
2801
+ } } : new FinalizationRegistry((ptr) => wasm.__wbg_intounderlyingbytesource_free(ptr, 1));
2802
+ var IntoUnderlyingSinkFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
2803
+ }, unregister: () => {
2804
+ } } : new FinalizationRegistry((ptr) => wasm.__wbg_intounderlyingsink_free(ptr, 1));
2805
+ var IntoUnderlyingSourceFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
2806
+ }, unregister: () => {
2807
+ } } : new FinalizationRegistry((ptr) => wasm.__wbg_intounderlyingsource_free(ptr, 1));
2808
+ var MultiIssuerAuthorizeResultFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
2809
+ }, unregister: () => {
2810
+ } } : new FinalizationRegistry((ptr) => wasm.__wbg_multiissuerauthorizeresult_free(ptr, 1));
2811
+ var PolicyEvaluationErrorFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {
2812
+ }, unregister: () => {
2813
+ } } : new FinalizationRegistry((ptr) => wasm.__wbg_policyevaluationerror_free(ptr, 1));
2814
+ function addHeapObject(obj) {
2815
+ if (heap_next === heap.length) heap.push(heap.length + 1);
2816
+ const idx = heap_next;
2817
+ heap_next = heap[idx];
2818
+ heap[idx] = obj;
2819
+ return idx;
2820
+ }
2821
+ function _assertClass(instance, klass) {
2822
+ if (!(instance instanceof klass)) {
2823
+ throw new Error(`expected instance of ${klass.name}`);
2824
+ }
2825
+ }
2826
+ var CLOSURE_DTORS = typeof FinalizationRegistry === "undefined" ? { register: () => {
2827
+ }, unregister: () => {
2828
+ } } : new FinalizationRegistry((state) => wasm.__wbindgen_export4(state.a, state.b));
2829
+ function debugString(val) {
2830
+ const type = typeof val;
2831
+ if (type == "number" || type == "boolean" || val == null) {
2832
+ return `${val}`;
2833
+ }
2834
+ if (type == "string") {
2835
+ return `"${val}"`;
2836
+ }
2837
+ if (type == "symbol") {
2838
+ const description = val.description;
2839
+ if (description == null) {
2840
+ return "Symbol";
2841
+ } else {
2842
+ return `Symbol(${description})`;
2843
+ }
2844
+ }
2845
+ if (type == "function") {
2846
+ const name = val.name;
2847
+ if (typeof name == "string" && name.length > 0) {
2848
+ return `Function(${name})`;
2849
+ } else {
2850
+ return "Function";
2851
+ }
2852
+ }
2853
+ if (Array.isArray(val)) {
2854
+ const length = val.length;
2855
+ let debug = "[";
2856
+ if (length > 0) {
2857
+ debug += debugString(val[0]);
2858
+ }
2859
+ for (let i = 1; i < length; i++) {
2860
+ debug += ", " + debugString(val[i]);
2861
+ }
2862
+ debug += "]";
2863
+ return debug;
2864
+ }
2865
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
2866
+ let className;
2867
+ if (builtInMatches && builtInMatches.length > 1) {
2868
+ className = builtInMatches[1];
2869
+ } else {
2870
+ return toString.call(val);
2871
+ }
2872
+ if (className == "Object") {
2873
+ try {
2874
+ return "Object(" + JSON.stringify(val) + ")";
2875
+ } catch (_) {
2876
+ return "Object";
2877
+ }
2878
+ }
2879
+ if (val instanceof Error) {
2880
+ return `${val.name}: ${val.message}
2881
+ ${val.stack}`;
2882
+ }
2883
+ return className;
2884
+ }
2885
+ function dropObject(idx) {
2886
+ if (idx < 1028) return;
2887
+ heap[idx] = heap_next;
2888
+ heap_next = idx;
2889
+ }
2890
+ function getArrayJsValueFromWasm0(ptr, len) {
2891
+ ptr = ptr >>> 0;
2892
+ const mem = getDataViewMemory0();
2893
+ const result = [];
2894
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
2895
+ result.push(takeObject(mem.getUint32(i, true)));
2896
+ }
2897
+ return result;
2898
+ }
2899
+ function getArrayU8FromWasm0(ptr, len) {
2900
+ ptr = ptr >>> 0;
2901
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
2902
+ }
2903
+ var cachedDataViewMemory0 = null;
2904
+ function getDataViewMemory0() {
2905
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
2906
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
2907
+ }
2908
+ return cachedDataViewMemory0;
2909
+ }
2910
+ function getStringFromWasm0(ptr, len) {
2911
+ return decodeText(ptr >>> 0, len);
2912
+ }
2913
+ var cachedUint8ArrayMemory0 = null;
2914
+ function getUint8ArrayMemory0() {
2915
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
2916
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
2917
+ }
2918
+ return cachedUint8ArrayMemory0;
2919
+ }
2920
+ function getObject(idx) {
2921
+ return heap[idx];
2922
+ }
2923
+ function handleError(f, args) {
2924
+ try {
2925
+ return f.apply(this, args);
2926
+ } catch (e) {
2927
+ wasm.__wbindgen_export3(addHeapObject(e));
2928
+ }
2929
+ }
2930
+ var heap = new Array(1024).fill(void 0);
2931
+ heap.push(void 0, null, true, false);
2932
+ var heap_next = heap.length;
2933
+ function isLikeNone(x) {
2934
+ return x === void 0 || x === null;
2935
+ }
2936
+ function makeMutClosure(arg0, arg1, f) {
2937
+ const state = { a: arg0, b: arg1, cnt: 1 };
2938
+ const real = (...args) => {
2939
+ state.cnt++;
2940
+ const a = state.a;
2941
+ state.a = 0;
2942
+ try {
2943
+ return f(a, state.b, ...args);
2944
+ } finally {
2945
+ state.a = a;
2946
+ real._wbg_cb_unref();
2947
+ }
2948
+ };
2949
+ real._wbg_cb_unref = () => {
2950
+ if (--state.cnt === 0) {
2951
+ wasm.__wbindgen_export4(state.a, state.b);
2952
+ state.a = 0;
2953
+ CLOSURE_DTORS.unregister(state);
2954
+ }
2955
+ };
2956
+ CLOSURE_DTORS.register(real, state, state);
2957
+ return real;
2958
+ }
2959
+ function passArrayJsValueToWasm0(array, malloc) {
2960
+ const ptr = malloc(array.length * 4, 4) >>> 0;
2961
+ const mem = getDataViewMemory0();
2962
+ for (let i = 0; i < array.length; i++) {
2963
+ mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
2964
+ }
2965
+ WASM_VECTOR_LEN = array.length;
2966
+ return ptr;
2967
+ }
2968
+ function passStringToWasm0(arg, malloc, realloc) {
2969
+ if (realloc === void 0) {
2970
+ const buf = cachedTextEncoder.encode(arg);
2971
+ const ptr2 = malloc(buf.length, 1) >>> 0;
2972
+ getUint8ArrayMemory0().subarray(ptr2, ptr2 + buf.length).set(buf);
2973
+ WASM_VECTOR_LEN = buf.length;
2974
+ return ptr2;
2975
+ }
2976
+ let len = arg.length;
2977
+ let ptr = malloc(len, 1) >>> 0;
2978
+ const mem = getUint8ArrayMemory0();
2979
+ let offset = 0;
2980
+ for (; offset < len; offset++) {
2981
+ const code = arg.charCodeAt(offset);
2982
+ if (code > 127) break;
2983
+ mem[ptr + offset] = code;
2984
+ }
2985
+ if (offset !== len) {
2986
+ if (offset !== 0) {
2987
+ arg = arg.slice(offset);
2988
+ }
2989
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
2990
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
2991
+ const ret = cachedTextEncoder.encodeInto(arg, view);
2992
+ offset += ret.written;
2993
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
2994
+ }
2995
+ WASM_VECTOR_LEN = offset;
2996
+ return ptr;
2997
+ }
2998
+ function takeObject(idx) {
2999
+ const ret = getObject(idx);
3000
+ dropObject(idx);
3001
+ return ret;
3002
+ }
3003
+ var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
3004
+ cachedTextDecoder.decode();
3005
+ var MAX_SAFARI_DECODE_BYTES = 2146435072;
3006
+ var numBytesDecoded = 0;
3007
+ function decodeText(ptr, len) {
3008
+ numBytesDecoded += len;
3009
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
3010
+ cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
3011
+ cachedTextDecoder.decode();
3012
+ numBytesDecoded = len;
3013
+ }
3014
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
3015
+ }
3016
+ var cachedTextEncoder = new TextEncoder();
3017
+ if (!("encodeInto" in cachedTextEncoder)) {
3018
+ cachedTextEncoder.encodeInto = function(arg, view) {
3019
+ const buf = cachedTextEncoder.encode(arg);
3020
+ view.set(buf);
3021
+ return {
3022
+ read: arg.length,
3023
+ written: buf.length
3024
+ };
3025
+ };
3026
+ }
3027
+ var WASM_VECTOR_LEN = 0;
3028
+ var wasmModule;
3029
+ var wasmInstance;
3030
+ var wasm;
3031
+ function __wbg_finalize_init(instance, module2) {
3032
+ wasmInstance = instance;
3033
+ wasm = instance.exports;
3034
+ wasmModule = module2;
3035
+ cachedDataViewMemory0 = null;
3036
+ cachedUint8ArrayMemory0 = null;
3037
+ return wasm;
3038
+ }
3039
+ function initSync(module2) {
3040
+ if (wasm !== void 0) return wasm;
3041
+ if (module2 !== void 0) {
3042
+ if (Object.getPrototypeOf(module2) === Object.prototype) {
3043
+ ({ module: module2 } = module2);
3044
+ } else {
3045
+ console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
3046
+ }
3047
+ }
3048
+ const imports = __wbg_get_imports();
3049
+ if (!(module2 instanceof WebAssembly.Module)) {
3050
+ try {
3051
+ WebAssembly.Module.exports(module2);
3052
+ } catch {
3053
+ module2 = new WebAssembly.Module(module2);
3054
+ }
3055
+ }
3056
+ const instance = new WebAssembly.Instance(module2, imports);
3057
+ return __wbg_finalize_init(instance, module2);
3058
+ }
3059
+
3060
+ // cedarling:wasm-file
3061
+ var import_promises = require("node:fs/promises");
3062
+ var import_node_url = require("node:url");
3063
+ var wasmUrl = new URL("../wasm/cedarling_wasm_bg.wasm", (0, import_node_url.pathToFileURL)(__filename));
3064
+ var wasm_file_default = () => (0, import_promises.readFile)(wasmUrl);
3065
+
3066
+ // .build/src/runtime.js
3067
+ function createRuntime(loadModule, initializeInput2) {
3068
+ let initialized;
3069
+ function initialize(operation) {
3070
+ if (initialized === void 0) {
3071
+ const attempt = operation().catch((error) => {
3072
+ if (initialized === attempt)
3073
+ initialized = void 0;
3074
+ throw error;
3075
+ });
3076
+ initialized = attempt;
3077
+ }
3078
+ return initialized;
3079
+ }
3080
+ function initWasm2(input) {
3081
+ const moduleOrPath = input !== void 0 && typeof input === "object" && input !== null && "module_or_path" in input ? input.module_or_path : input;
3082
+ return initialize(() => {
3083
+ if (moduleOrPath === void 0) {
3084
+ return loadModule().then((module2) => initSync({ module: module2 }));
3085
+ }
3086
+ if (initializeInput2 === void 0) {
3087
+ throw new TypeError("Cedarling edge initialization accepts no input");
3088
+ }
3089
+ return initializeInput2(moduleOrPath);
3090
+ });
3091
+ }
3092
+ function initSync3(input) {
3093
+ const output = initSync(input);
3094
+ initialized = Promise.resolve(output);
3095
+ return output;
3096
+ }
3097
+ return Object.freeze({
3098
+ initWasm: initWasm2,
3099
+ initSync: initSync3,
3100
+ async init(config) {
3101
+ await initWasm2();
3102
+ return init(config);
3103
+ },
3104
+ async initFromArchiveBytes(config, archiveBytes) {
3105
+ await initWasm2();
3106
+ return initFromArchiveBytes(config, archiveBytes);
3107
+ }
3108
+ });
3109
+ }
3110
+
3111
+ // .build/src/cjs.js
3112
+ async function initializeInput(input) {
3113
+ const value = await input;
3114
+ if (value instanceof WebAssembly.Module || value instanceof ArrayBuffer || ArrayBuffer.isView(value)) {
3115
+ return initSync(value);
3116
+ }
3117
+ const response = value instanceof Response ? value : await fetch(value);
3118
+ if (!response.ok) {
3119
+ throw new Error(`Cedarling WASM asset could not be loaded: ${response.status}`);
3120
+ }
3121
+ return initSync(await response.arrayBuffer());
3122
+ }
3123
+ var cedarling = createRuntime(async () => {
3124
+ const bytes = await wasm_file_default();
3125
+ const copy = new Uint8Array(bytes.byteLength);
3126
+ copy.set(bytes);
3127
+ return WebAssembly.compile(copy);
3128
+ }, initializeInput);
3129
+ var init2 = cedarling.init;
3130
+ var initSync2 = cedarling.initSync;
3131
+ var initWasm = cedarling.initWasm;
3132
+ var initFromArchiveBytes2 = cedarling.initFromArchiveBytes;
3133
+ // Annotate the CommonJS export names for ESM import in node:
3134
+ 0 && (module.exports = {
3135
+ init,
3136
+ initFromArchiveBytes,
3137
+ initSync,
3138
+ initWasm
3139
+ });
3140
+ //# sourceMappingURL=index.cjs.map