@master/css-binding-wasm-compiler 0.0.0-stage → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,900 @@
1
+ /* @ts-self-types="./mastercss_binding_wasm_compiler.d.ts" */
2
+
3
+ export class CompilerRenderSession {
4
+ __destroy_into_raw() {
5
+ const ptr = this.__wbg_ptr;
6
+ this.__wbg_ptr = 0;
7
+ CompilerRenderSessionFinalization.unregister(this);
8
+ return ptr;
9
+ }
10
+ free() {
11
+ const ptr = this.__destroy_into_raw();
12
+ wasm.__wbg_compilerrendersession_free(ptr, 0);
13
+ }
14
+ dispose() {
15
+ wasm.compilerrendersession_dispose(this.__wbg_ptr);
16
+ }
17
+ /**
18
+ * @returns {any}
19
+ */
20
+ emittedGlobals() {
21
+ const ret = wasm.compilerrendersession_emittedGlobals(this.__wbg_ptr);
22
+ if (ret[2]) {
23
+ throw takeFromExternrefTable0(ret[1]);
24
+ }
25
+ return takeFromExternrefTable0(ret[0]);
26
+ }
27
+ /**
28
+ * @param {string[]} class_names
29
+ */
30
+ ensureClasses(class_names) {
31
+ const ptr0 = passArrayJsValueToWasm0(class_names, wasm.__wbindgen_malloc);
32
+ const len0 = WASM_VECTOR_LEN;
33
+ const ret = wasm.compilerrendersession_ensureClasses(this.__wbg_ptr, ptr0, len0);
34
+ if (ret[1]) {
35
+ throw takeFromExternrefTable0(ret[0]);
36
+ }
37
+ }
38
+ /**
39
+ * @param {string} native_css
40
+ */
41
+ ensureStylesheetResources(native_css) {
42
+ const ptr0 = passStringToWasm0(native_css, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
43
+ const len0 = WASM_VECTOR_LEN;
44
+ const ret = wasm.compilerrendersession_ensureStylesheetResources(this.__wbg_ptr, ptr0, len0);
45
+ if (ret[1]) {
46
+ throw takeFromExternrefTable0(ret[0]);
47
+ }
48
+ }
49
+ /**
50
+ * @param {string[]} class_names
51
+ * @returns {any}
52
+ */
53
+ nativeDeclarationCandidates(class_names) {
54
+ const ptr0 = passArrayJsValueToWasm0(class_names, wasm.__wbindgen_malloc);
55
+ const len0 = WASM_VECTOR_LEN;
56
+ const ret = wasm.compilerrendersession_nativeDeclarationCandidates(this.__wbg_ptr, ptr0, len0);
57
+ if (ret[2]) {
58
+ throw takeFromExternrefTable0(ret[1]);
59
+ }
60
+ return takeFromExternrefTable0(ret[0]);
61
+ }
62
+ /**
63
+ * @param {string} manifest_json
64
+ * @param {string | null} [emitted_globals_json]
65
+ */
66
+ constructor(manifest_json, emitted_globals_json) {
67
+ const ptr0 = passStringToWasm0(manifest_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
68
+ const len0 = WASM_VECTOR_LEN;
69
+ var ptr1 = isLikeNone(emitted_globals_json) ? 0 : passStringToWasm0(emitted_globals_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
70
+ var len1 = WASM_VECTOR_LEN;
71
+ const ret = wasm.compilerrendersession_new(ptr0, len0, ptr1, len1);
72
+ if (ret[2]) {
73
+ throw takeFromExternrefTable0(ret[1]);
74
+ }
75
+ this.__wbg_ptr = ret[0];
76
+ CompilerRenderSessionFinalization.register(this, this.__wbg_ptr, this);
77
+ return this;
78
+ }
79
+ /**
80
+ * @returns {any}
81
+ */
82
+ snapshot() {
83
+ const ret = wasm.compilerrendersession_snapshot(this.__wbg_ptr);
84
+ if (ret[2]) {
85
+ throw takeFromExternrefTable0(ret[1]);
86
+ }
87
+ return takeFromExternrefTable0(ret[0]);
88
+ }
89
+ }
90
+ if (Symbol.dispose) CompilerRenderSession.prototype[Symbol.dispose] = CompilerRenderSession.prototype.free;
91
+
92
+ /**
93
+ * @param {string} source
94
+ * @returns {any}
95
+ */
96
+ export function analyzeCSSDependencies(source) {
97
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
98
+ const len0 = WASM_VECTOR_LEN;
99
+ const ret = wasm.analyzeCSSDependencies(ptr0, len0);
100
+ if (ret[2]) {
101
+ throw takeFromExternrefTable0(ret[1]);
102
+ }
103
+ return takeFromExternrefTable0(ret[0]);
104
+ }
105
+
106
+ /**
107
+ * @param {string} source
108
+ * @returns {any}
109
+ */
110
+ export function analyzeStandaloneDirectives(source) {
111
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
112
+ const len0 = WASM_VECTOR_LEN;
113
+ const ret = wasm.analyzeStandaloneDirectives(ptr0, len0);
114
+ if (ret[2]) {
115
+ throw takeFromExternrefTable0(ret[1]);
116
+ }
117
+ return takeFromExternrefTable0(ret[0]);
118
+ }
119
+
120
+ /**
121
+ * @returns {any}
122
+ */
123
+ export function bindingInfo() {
124
+ const ret = wasm.bindingInfo();
125
+ if (ret[2]) {
126
+ throw takeFromExternrefTable0(ret[1]);
127
+ }
128
+ return takeFromExternrefTable0(ret[0]);
129
+ }
130
+
131
+ /**
132
+ * @param {any} request
133
+ * @returns {any}
134
+ */
135
+ export function compareProjectSnapshots(request) {
136
+ const ret = wasm.compareProjectSnapshots(request);
137
+ if (ret[2]) {
138
+ throw takeFromExternrefTable0(ret[1]);
139
+ }
140
+ return takeFromExternrefTable0(ret[0]);
141
+ }
142
+
143
+ /**
144
+ * @param {string} source
145
+ * @param {any} options
146
+ * @returns {any}
147
+ */
148
+ export function compileCSSDirectives(source, options) {
149
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
150
+ const len0 = WASM_VECTOR_LEN;
151
+ const ret = wasm.compileCSSDirectives(ptr0, len0, options);
152
+ if (ret[2]) {
153
+ throw takeFromExternrefTable0(ret[1]);
154
+ }
155
+ return takeFromExternrefTable0(ret[0]);
156
+ }
157
+
158
+ /**
159
+ * JSON in and out, like the native binding, so both share the compiler's reuse of
160
+ * identical requests.
161
+ * @param {string} request_json
162
+ * @returns {string}
163
+ */
164
+ export function compileCSSStylesheetGraph(request_json) {
165
+ let deferred3_0;
166
+ let deferred3_1;
167
+ try {
168
+ const ptr0 = passStringToWasm0(request_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
169
+ const len0 = WASM_VECTOR_LEN;
170
+ const ret = wasm.compileCSSStylesheetGraph(ptr0, len0);
171
+ var ptr2 = ret[0];
172
+ var len2 = ret[1];
173
+ if (ret[3]) {
174
+ ptr2 = 0; len2 = 0;
175
+ throw takeFromExternrefTable0(ret[2]);
176
+ }
177
+ deferred3_0 = ptr2;
178
+ deferred3_1 = len2;
179
+ return getStringFromWasm0(ptr2, len2);
180
+ } finally {
181
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
182
+ }
183
+ }
184
+
185
+ /**
186
+ * @param {any} request
187
+ * @returns {any}
188
+ */
189
+ export function compileDefaultPresetManifest(request) {
190
+ const ret = wasm.compileDefaultPresetManifest(request);
191
+ if (ret[2]) {
192
+ throw takeFromExternrefTable0(ret[1]);
193
+ }
194
+ return takeFromExternrefTable0(ret[0]);
195
+ }
196
+
197
+ /**
198
+ * @param {any} input
199
+ * @param {any} options
200
+ * @returns {any}
201
+ */
202
+ export function compileManifestInput(input, options) {
203
+ const ret = wasm.compileManifestInput(input, options);
204
+ if (ret[2]) {
205
+ throw takeFromExternrefTable0(ret[1]);
206
+ }
207
+ return takeFromExternrefTable0(ret[0]);
208
+ }
209
+
210
+ /**
211
+ * @param {string} source
212
+ * @param {any} options
213
+ * @returns {any}
214
+ */
215
+ export function compileNativeCSS(source, options) {
216
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
217
+ const len0 = WASM_VECTOR_LEN;
218
+ const ret = wasm.compileNativeCSS(ptr0, len0, options);
219
+ if (ret[2]) {
220
+ throw takeFromExternrefTable0(ret[1]);
221
+ }
222
+ return takeFromExternrefTable0(ret[0]);
223
+ }
224
+
225
+ /**
226
+ * @param {string[]} candidates
227
+ * @param {any} blocklist
228
+ * @returns {string[]}
229
+ */
230
+ export function filterCSSExtractionCandidates(candidates, blocklist) {
231
+ const ptr0 = passArrayJsValueToWasm0(candidates, wasm.__wbindgen_malloc);
232
+ const len0 = WASM_VECTOR_LEN;
233
+ const ret = wasm.filterCSSExtractionCandidates(ptr0, len0, blocklist);
234
+ if (ret[3]) {
235
+ throw takeFromExternrefTable0(ret[2]);
236
+ }
237
+ var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]);
238
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
239
+ return v2;
240
+ }
241
+
242
+ /**
243
+ * @param {string} source
244
+ * @returns {any}
245
+ */
246
+ export function inspectCSS(source) {
247
+ const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
248
+ const len0 = WASM_VECTOR_LEN;
249
+ const ret = wasm.inspectCSS(ptr0, len0);
250
+ if (ret[2]) {
251
+ throw takeFromExternrefTable0(ret[1]);
252
+ }
253
+ return takeFromExternrefTable0(ret[0]);
254
+ }
255
+
256
+ /**
257
+ * @param {any} request
258
+ * @param {any} options
259
+ * @returns {any}
260
+ */
261
+ export function lowerCSSDirectives(request, options) {
262
+ const ret = wasm.lowerCSSDirectives(request, options);
263
+ if (ret[2]) {
264
+ throw takeFromExternrefTable0(ret[1]);
265
+ }
266
+ return takeFromExternrefTable0(ret[0]);
267
+ }
268
+
269
+ /**
270
+ * @param {any} policies
271
+ * @returns {any}
272
+ */
273
+ export function mergeCSSExtractionPolicies(policies) {
274
+ const ret = wasm.mergeCSSExtractionPolicies(policies);
275
+ if (ret[2]) {
276
+ throw takeFromExternrefTable0(ret[1]);
277
+ }
278
+ return takeFromExternrefTable0(ret[0]);
279
+ }
280
+
281
+ /**
282
+ * @param {any} manifest
283
+ * @returns {any}
284
+ */
285
+ export function normalizeDefaultManifestForJSON(manifest) {
286
+ const ret = wasm.normalizeDefaultManifestForJSON(manifest);
287
+ if (ret[2]) {
288
+ throw takeFromExternrefTable0(ret[1]);
289
+ }
290
+ return takeFromExternrefTable0(ret[0]);
291
+ }
292
+
293
+ /**
294
+ * @param {any} manifest
295
+ * @returns {any}
296
+ */
297
+ export function normalizeManifestForJSON(manifest) {
298
+ const ret = wasm.normalizeManifestForJSON(manifest);
299
+ if (ret[2]) {
300
+ throw takeFromExternrefTable0(ret[1]);
301
+ }
302
+ return takeFromExternrefTable0(ret[0]);
303
+ }
304
+
305
+ /**
306
+ * @param {any} request
307
+ * @returns {any}
308
+ */
309
+ export function prepareCSSStylesheetBundle(request) {
310
+ const ret = wasm.prepareCSSStylesheetBundle(request);
311
+ if (ret[2]) {
312
+ throw takeFromExternrefTable0(ret[1]);
313
+ }
314
+ return takeFromExternrefTable0(ret[0]);
315
+ }
316
+
317
+ /**
318
+ * @param {any} request
319
+ * @returns {any}
320
+ */
321
+ export function renderCSSStylesheetBundle(request) {
322
+ const ret = wasm.renderCSSStylesheetBundle(request);
323
+ if (ret[2]) {
324
+ throw takeFromExternrefTable0(ret[1]);
325
+ }
326
+ return takeFromExternrefTable0(ret[0]);
327
+ }
328
+
329
+ /**
330
+ * @param {any} request
331
+ * @returns {any}
332
+ */
333
+ export function resolveCSSImportGraph(request) {
334
+ const ret = wasm.resolveCSSImportGraph(request);
335
+ if (ret[2]) {
336
+ throw takeFromExternrefTable0(ret[1]);
337
+ }
338
+ return takeFromExternrefTable0(ret[0]);
339
+ }
340
+
341
+ /**
342
+ * @param {any} request
343
+ * @returns {any}
344
+ */
345
+ export function resolveCSSStylesheetGraph(request) {
346
+ const ret = wasm.resolveCSSStylesheetGraph(request);
347
+ if (ret[2]) {
348
+ throw takeFromExternrefTable0(ret[1]);
349
+ }
350
+ return takeFromExternrefTable0(ret[0]);
351
+ }
352
+ function __wbg_get_imports() {
353
+ const import0 = {
354
+ __proto__: null,
355
+ __wbg_Error_67e7344beaa85059: function(arg0, arg1) {
356
+ const ret = Error(getStringFromWasm0(arg0, arg1));
357
+ return ret;
358
+ },
359
+ __wbg_Number_c54e7112a3fa7e3e: function(arg0) {
360
+ const ret = Number(arg0);
361
+ return ret;
362
+ },
363
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
364
+ const ret = String(arg1);
365
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
366
+ const len1 = WASM_VECTOR_LEN;
367
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
368
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
369
+ },
370
+ __wbg___wbindgen_bigint_get_as_i64_b482365c149396c8: function(arg0, arg1) {
371
+ const v = arg1;
372
+ const ret = typeof(v) === 'bigint' ? v : undefined;
373
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
374
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
375
+ },
376
+ __wbg___wbindgen_boolean_get_7a12af2b3f899c5a: function(arg0) {
377
+ const v = arg0;
378
+ const ret = typeof(v) === 'boolean' ? v : undefined;
379
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
380
+ },
381
+ __wbg___wbindgen_debug_string_0e68cf47c9cbd9b0: function(arg0, arg1) {
382
+ const ret = debugString(arg1);
383
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
384
+ const len1 = WASM_VECTOR_LEN;
385
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
386
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
387
+ },
388
+ __wbg___wbindgen_in_50072d4d6e45c193: function(arg0, arg1) {
389
+ const ret = arg0 in arg1;
390
+ return ret;
391
+ },
392
+ __wbg___wbindgen_is_bigint_60fc0336cb14f5d7: function(arg0) {
393
+ const ret = typeof(arg0) === 'bigint';
394
+ return ret;
395
+ },
396
+ __wbg___wbindgen_is_function_fcda5e3902d732fe: function(arg0) {
397
+ const ret = typeof(arg0) === 'function';
398
+ return ret;
399
+ },
400
+ __wbg___wbindgen_is_null_5160b3e381865372: function(arg0) {
401
+ const ret = arg0 === null;
402
+ return ret;
403
+ },
404
+ __wbg___wbindgen_is_object_edb6b15aa3afe12e: function(arg0) {
405
+ const val = arg0;
406
+ const ret = typeof(val) === 'object' && val !== null;
407
+ return ret;
408
+ },
409
+ __wbg___wbindgen_is_string_c4f7cb494a2a21f1: function(arg0) {
410
+ const ret = typeof(arg0) === 'string';
411
+ return ret;
412
+ },
413
+ __wbg___wbindgen_is_undefined_8c687d0b90d5b524: function(arg0) {
414
+ const ret = arg0 === undefined;
415
+ return ret;
416
+ },
417
+ __wbg___wbindgen_jsval_eq_9fdcd3c0a860dd3b: function(arg0, arg1) {
418
+ const ret = arg0 === arg1;
419
+ return ret;
420
+ },
421
+ __wbg___wbindgen_jsval_loose_eq_3c30021c243b64cd: function(arg0, arg1) {
422
+ const ret = arg0 == arg1;
423
+ return ret;
424
+ },
425
+ __wbg___wbindgen_number_get_1dc732b810cb937c: function(arg0, arg1) {
426
+ const obj = arg1;
427
+ const ret = typeof(obj) === 'number' ? obj : undefined;
428
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
429
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
430
+ },
431
+ __wbg___wbindgen_string_get_92ab86bb19cbc12f: function(arg0, arg1) {
432
+ const obj = arg1;
433
+ const ret = typeof(obj) === 'string' ? obj : undefined;
434
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
435
+ var len1 = WASM_VECTOR_LEN;
436
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
437
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
438
+ },
439
+ __wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
440
+ throw new Error(getStringFromWasm0(arg0, arg1));
441
+ },
442
+ __wbg_call_269c5566fbede3eb: function() { return handleError(function (arg0, arg1) {
443
+ const ret = arg0.call(arg1);
444
+ return ret;
445
+ }, arguments); },
446
+ __wbg_done_cffed884d87aa22e: function(arg0) {
447
+ const ret = arg0.done;
448
+ return ret;
449
+ },
450
+ __wbg_entries_972a87586902cf87: function(arg0) {
451
+ const ret = Object.entries(arg0);
452
+ return ret;
453
+ },
454
+ __wbg_getRandomValues_a608c4436c19407a: function() { return handleError(function (arg0, arg1) {
455
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
456
+ }, arguments); },
457
+ __wbg_get_6cf5a4d4d8ad3c5a: function() { return handleError(function (arg0, arg1) {
458
+ const ret = Reflect.get(arg0, arg1);
459
+ return ret;
460
+ }, arguments); },
461
+ __wbg_get_b1f0ab13c737f856: function(arg0, arg1) {
462
+ const ret = arg0[arg1 >>> 0];
463
+ return ret;
464
+ },
465
+ __wbg_get_unchecked_363572bdd397d473: function(arg0, arg1) {
466
+ const ret = arg0[arg1 >>> 0];
467
+ return ret;
468
+ },
469
+ __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
470
+ const ret = arg0[arg1];
471
+ return ret;
472
+ },
473
+ __wbg_instanceof_ArrayBuffer_d4ff01f8247925ae: function(arg0) {
474
+ let result;
475
+ try {
476
+ result = arg0 instanceof ArrayBuffer;
477
+ } catch (_) {
478
+ result = false;
479
+ }
480
+ const ret = result;
481
+ return ret;
482
+ },
483
+ __wbg_instanceof_Map_1ff6a2b54c899f0d: function(arg0) {
484
+ let result;
485
+ try {
486
+ result = arg0 instanceof Map;
487
+ } catch (_) {
488
+ result = false;
489
+ }
490
+ const ret = result;
491
+ return ret;
492
+ },
493
+ __wbg_instanceof_Uint8Array_598adc0fef426aa8: function(arg0) {
494
+ let result;
495
+ try {
496
+ result = arg0 instanceof Uint8Array;
497
+ } catch (_) {
498
+ result = false;
499
+ }
500
+ const ret = result;
501
+ return ret;
502
+ },
503
+ __wbg_isArray_5674713bb7b79043: function(arg0) {
504
+ const ret = Array.isArray(arg0);
505
+ return ret;
506
+ },
507
+ __wbg_isSafeInteger_8f51c743827d1ec5: function(arg0) {
508
+ const ret = Number.isSafeInteger(arg0);
509
+ return ret;
510
+ },
511
+ __wbg_iterator_22ddeb808cf55a6f: function() {
512
+ const ret = Symbol.iterator;
513
+ return ret;
514
+ },
515
+ __wbg_length_31bdaf014f5fbde2: function(arg0) {
516
+ const ret = arg0.length;
517
+ return ret;
518
+ },
519
+ __wbg_length_4e1adc0d42e23620: function(arg0) {
520
+ const ret = arg0.length;
521
+ return ret;
522
+ },
523
+ __wbg_new_1da3429bc3c4541c: function(arg0) {
524
+ const ret = new Uint8Array(arg0);
525
+ return ret;
526
+ },
527
+ __wbg_new_8d36e20aa758e411: function() {
528
+ const ret = new Map();
529
+ return ret;
530
+ },
531
+ __wbg_new_bebc3f4757acf305: function() {
532
+ const ret = new Object();
533
+ return ret;
534
+ },
535
+ __wbg_new_ffa92086ea89f79c: function() {
536
+ const ret = new Array();
537
+ return ret;
538
+ },
539
+ __wbg_next_95053e306b1c3aed: function(arg0) {
540
+ const ret = arg0.next;
541
+ return ret;
542
+ },
543
+ __wbg_next_f31ecb8646d2c605: function() { return handleError(function (arg0) {
544
+ const ret = arg0.next();
545
+ return ret;
546
+ }, arguments); },
547
+ __wbg_prototypesetcall_ae9f5e7459250748: function(arg0, arg1, arg2) {
548
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
549
+ },
550
+ __wbg_set_13d25b81ab403f5e: function(arg0, arg1, arg2) {
551
+ arg0[arg1 >>> 0] = arg2;
552
+ },
553
+ __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
554
+ arg0[arg1] = arg2;
555
+ },
556
+ __wbg_set_bf6dde4923b9b059: function(arg0, arg1, arg2) {
557
+ const ret = arg0.set(arg1, arg2);
558
+ return ret;
559
+ },
560
+ __wbg_value_c227f843d21da141: function(arg0) {
561
+ const ret = arg0.value;
562
+ return ret;
563
+ },
564
+ __wbindgen_generic_0000000000000001: function(arg0) {
565
+ // Cast intrinsic for `F64 -> Externref`.
566
+ const ret = arg0;
567
+ return ret;
568
+ },
569
+ __wbindgen_generic_0000000000000002: function(arg0) {
570
+ // Cast intrinsic for `I64 -> Externref`.
571
+ const ret = arg0;
572
+ return ret;
573
+ },
574
+ __wbindgen_generic_0000000000000003: function(arg0, arg1) {
575
+ // Cast intrinsic for `Ref(String) -> Externref`.
576
+ const ret = getStringFromWasm0(arg0, arg1);
577
+ return ret;
578
+ },
579
+ __wbindgen_generic_0000000000000004: function(arg0) {
580
+ // Cast intrinsic for `U64 -> Externref`.
581
+ const ret = BigInt.asUintN(64, arg0);
582
+ return ret;
583
+ },
584
+ __wbindgen_init_externref_table: function() {
585
+ const table = wasm.__wbindgen_externrefs;
586
+ const offset = table.grow(4);
587
+ table.set(0, undefined);
588
+ table.set(offset + 0, undefined);
589
+ table.set(offset + 1, null);
590
+ table.set(offset + 2, true);
591
+ table.set(offset + 3, false);
592
+ },
593
+ };
594
+ return {
595
+ __proto__: null,
596
+ "./mastercss_binding_wasm_compiler_bg.js": import0,
597
+ };
598
+ }
599
+
600
+ const CompilerRenderSessionFinalization = (typeof FinalizationRegistry === 'undefined')
601
+ ? { register: () => {}, unregister: () => {} }
602
+ : new FinalizationRegistry(ptr => wasm.__wbg_compilerrendersession_free(ptr, 1));
603
+
604
+ function addToExternrefTable0(obj) {
605
+ const idx = wasm.__externref_table_alloc();
606
+ wasm.__wbindgen_externrefs.set(idx, obj);
607
+ return idx;
608
+ }
609
+
610
+ function debugString(val) {
611
+ // primitive types
612
+ const type = typeof val;
613
+ if (type == 'number' || type == 'boolean' || val == null) {
614
+ return `${val}`;
615
+ }
616
+ if (type == 'string') {
617
+ return `"${val}"`;
618
+ }
619
+ if (type == 'symbol') {
620
+ const description = val.description;
621
+ if (description == null) {
622
+ return 'Symbol';
623
+ } else {
624
+ return `Symbol(${description})`;
625
+ }
626
+ }
627
+ if (type == 'function') {
628
+ const name = val.name;
629
+ if (typeof name == 'string' && name.length > 0) {
630
+ return `Function(${name})`;
631
+ } else {
632
+ return 'Function';
633
+ }
634
+ }
635
+ // objects
636
+ if (Array.isArray(val)) {
637
+ const length = val.length;
638
+ let debug = '[';
639
+ if (length > 0) {
640
+ debug += debugString(val[0]);
641
+ }
642
+ for(let i = 1; i < length; i++) {
643
+ debug += ', ' + debugString(val[i]);
644
+ }
645
+ debug += ']';
646
+ return debug;
647
+ }
648
+ // Test for built-in
649
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
650
+ let className;
651
+ if (builtInMatches && builtInMatches.length > 1) {
652
+ className = builtInMatches[1];
653
+ } else {
654
+ // Failed to match the standard '[object ClassName]'
655
+ return toString.call(val);
656
+ }
657
+ if (className == 'Object') {
658
+ // we're a user defined class or Object
659
+ // JSON.stringify avoids problems with cycles, and is generally much
660
+ // easier than looping through ownProperties of `val`.
661
+ try {
662
+ return 'Object(' + JSON.stringify(val) + ')';
663
+ } catch (_) {
664
+ return 'Object';
665
+ }
666
+ }
667
+ // errors
668
+ if (val instanceof Error) {
669
+ return `${val.name}: ${val.message}\n${val.stack}`;
670
+ }
671
+ // TODO we could test for more things here, like `Set`s and `Map`s.
672
+ return className;
673
+ }
674
+
675
+ function getArrayJsValueFromWasm0(ptr, len) {
676
+ ptr = ptr >>> 0;
677
+ const mem = getDataViewMemory0();
678
+ const result = [];
679
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
680
+ result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
681
+ }
682
+ wasm.__externref_drop_slice(ptr, len);
683
+ return result;
684
+ }
685
+
686
+ function getArrayU8FromWasm0(ptr, len) {
687
+ ptr = ptr >>> 0;
688
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
689
+ }
690
+
691
+ let cachedDataViewMemory0 = null;
692
+ function getDataViewMemory0() {
693
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
694
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
695
+ }
696
+ return cachedDataViewMemory0;
697
+ }
698
+
699
+ function getStringFromWasm0(ptr, len) {
700
+ return decodeText(ptr >>> 0, len);
701
+ }
702
+
703
+ let cachedUint8ArrayMemory0 = null;
704
+ function getUint8ArrayMemory0() {
705
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
706
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
707
+ }
708
+ return cachedUint8ArrayMemory0;
709
+ }
710
+
711
+ function handleError(f, args) {
712
+ try {
713
+ return f.apply(this, args);
714
+ } catch (e) {
715
+ const idx = addToExternrefTable0(e);
716
+ wasm.__wbindgen_exn_store(idx);
717
+ }
718
+ }
719
+
720
+ function isLikeNone(x) {
721
+ return x === undefined || x === null;
722
+ }
723
+
724
+ function passArrayJsValueToWasm0(array, malloc) {
725
+ const ptr = malloc(array.length * 4, 4) >>> 0;
726
+ for (let i = 0; i < array.length; i++) {
727
+ const add = addToExternrefTable0(array[i]);
728
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
729
+ }
730
+ WASM_VECTOR_LEN = array.length;
731
+ return ptr;
732
+ }
733
+
734
+ function passStringToWasm0(arg, malloc, realloc) {
735
+ if (realloc === undefined) {
736
+ const buf = cachedTextEncoder.encode(arg);
737
+ const ptr = malloc(buf.length, 1) >>> 0;
738
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
739
+ WASM_VECTOR_LEN = buf.length;
740
+ return ptr;
741
+ }
742
+
743
+ let len = arg.length;
744
+ let ptr = malloc(len, 1) >>> 0;
745
+
746
+ const mem = getUint8ArrayMemory0();
747
+
748
+ let offset = 0;
749
+
750
+ for (; offset < len; offset++) {
751
+ const code = arg.charCodeAt(offset);
752
+ if (code > 0x7F) break;
753
+ mem[ptr + offset] = code;
754
+ }
755
+ if (offset !== len) {
756
+ if (offset !== 0) {
757
+ arg = arg.slice(offset);
758
+ }
759
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
760
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
761
+ const ret = cachedTextEncoder.encodeInto(arg, view);
762
+
763
+ offset += ret.written;
764
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
765
+ }
766
+
767
+ WASM_VECTOR_LEN = offset;
768
+ return ptr;
769
+ }
770
+
771
+ function takeFromExternrefTable0(idx) {
772
+ const value = wasm.__wbindgen_externrefs.get(idx);
773
+ wasm.__externref_table_dealloc(idx);
774
+ return value;
775
+ }
776
+
777
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
778
+ cachedTextDecoder.decode();
779
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
780
+ let numBytesDecoded = 0;
781
+ function decodeText(ptr, len) {
782
+ numBytesDecoded += len;
783
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
784
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
785
+ cachedTextDecoder.decode();
786
+ numBytesDecoded = len;
787
+ }
788
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
789
+ }
790
+
791
+ const cachedTextEncoder = new TextEncoder();
792
+
793
+ if (!('encodeInto' in cachedTextEncoder)) {
794
+ cachedTextEncoder.encodeInto = function (arg, view) {
795
+ const buf = cachedTextEncoder.encode(arg);
796
+ view.set(buf);
797
+ return {
798
+ read: arg.length,
799
+ written: buf.length
800
+ };
801
+ };
802
+ }
803
+
804
+ let WASM_VECTOR_LEN = 0;
805
+
806
+ let wasmModule, wasmInstance, wasm;
807
+ function __wbg_finalize_init(instance, module) {
808
+ wasmInstance = instance;
809
+ wasm = instance.exports;
810
+ wasmModule = module;
811
+ cachedDataViewMemory0 = null;
812
+ cachedUint8ArrayMemory0 = null;
813
+ wasm.__wbindgen_start();
814
+ return wasm;
815
+ }
816
+
817
+ async function __wbg_load(module, imports) {
818
+ if (typeof Response === 'function' && module instanceof Response) {
819
+ if (!module.ok) {
820
+ throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
821
+ }
822
+
823
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
824
+ try {
825
+ return await WebAssembly.instantiateStreaming(module, imports);
826
+ } catch (e) {
827
+ const validResponse = expectedResponseType(module.type);
828
+
829
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
830
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
831
+
832
+ } else { throw e; }
833
+ }
834
+ }
835
+
836
+ const bytes = await module.arrayBuffer();
837
+ return await WebAssembly.instantiate(bytes, imports);
838
+ } else {
839
+ const instance = await WebAssembly.instantiate(module, imports);
840
+
841
+ if (instance instanceof WebAssembly.Instance) {
842
+ return { instance, module };
843
+ } else {
844
+ return instance;
845
+ }
846
+ }
847
+
848
+ function expectedResponseType(type) {
849
+ switch (type) {
850
+ case 'basic': case 'cors': case 'default': return true;
851
+ }
852
+ return false;
853
+ }
854
+ }
855
+
856
+ function initSync(module) {
857
+ if (wasm !== undefined) return wasm;
858
+
859
+
860
+ if (module !== undefined) {
861
+ if (Object.getPrototypeOf(module) === Object.prototype) {
862
+ ({module} = module)
863
+ } else {
864
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
865
+ }
866
+ }
867
+
868
+ const imports = __wbg_get_imports();
869
+ if (!(module instanceof WebAssembly.Module)) {
870
+ module = new WebAssembly.Module(module);
871
+ }
872
+ const instance = new WebAssembly.Instance(module, imports);
873
+ return __wbg_finalize_init(instance, module);
874
+ }
875
+
876
+ async function __wbg_init(module_or_path) {
877
+ if (wasm !== undefined) return wasm;
878
+
879
+
880
+ if (module_or_path !== undefined) {
881
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
882
+ ({module_or_path} = module_or_path)
883
+ } else {
884
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
885
+ }
886
+ }
887
+
888
+
889
+ const imports = __wbg_get_imports();
890
+
891
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
892
+ module_or_path = fetch(module_or_path);
893
+ }
894
+
895
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
896
+
897
+ return __wbg_finalize_init(instance, module);
898
+ }
899
+
900
+ export { initSync, __wbg_init as default };