@takumi-rs/wasm 0.67.1 → 0.67.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundlers/node.cjs +1 -1
- package/package.json +8 -4
- package/pkg/takumi_wasm.cjs +732 -0
- package/pkg/takumi_wasm_bg.wasm +0 -0
package/bundlers/node.cjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takumi-rs/wasm",
|
|
3
|
-
"version": "0.67.
|
|
3
|
+
"version": "0.67.3",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"image",
|
|
6
6
|
"rendering",
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"webassembly"
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
|
-
"build": "wasm-pack build --no-pack --release --out-dir pkg --target web",
|
|
14
|
-
"build:debug": "wasm-pack build --no-pack --dev --out-dir pkg --target web"
|
|
13
|
+
"build": "wasm-pack build --no-pack --release --out-dir pkg --target web && bun build pkg/takumi_wasm.js --define import.meta.url=undefined --format cjs --outfile pkg/takumi_wasm.cjs",
|
|
14
|
+
"build:debug": "wasm-pack build --no-pack --dev --out-dir pkg --target web && bun build pkg/takumi_wasm.js --define import.meta.url=undefined --format cjs --outfile pkg/takumi_wasm.cjs"
|
|
15
15
|
},
|
|
16
16
|
"author": {
|
|
17
17
|
"email": "me@kane.tw",
|
|
@@ -36,11 +36,15 @@
|
|
|
36
36
|
"require": "./bundlers/node.cjs"
|
|
37
37
|
},
|
|
38
38
|
"types": "./pkg/takumi_wasm.d.ts",
|
|
39
|
+
"import": "./pkg/takumi_wasm.js",
|
|
40
|
+
"require": "./pkg/takumi_wasm.cjs",
|
|
39
41
|
"default": "./pkg/takumi_wasm.js"
|
|
40
42
|
},
|
|
41
43
|
"./no-bundler": {
|
|
42
44
|
"types": "./pkg/takumi_wasm.d.ts",
|
|
43
|
-
"
|
|
45
|
+
"import": "./pkg/takumi_wasm.js",
|
|
46
|
+
"require": "./pkg/takumi_wasm.cjs",
|
|
47
|
+
"default": "./pkg/takumi_wasm.cjs"
|
|
44
48
|
},
|
|
45
49
|
"./node": {
|
|
46
50
|
"types": "./bundlers/node.d.ts",
|
|
@@ -0,0 +1,732 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
6
|
+
var __toCommonJS = (from) => {
|
|
7
|
+
var entry = __moduleCache.get(from), desc;
|
|
8
|
+
if (entry)
|
|
9
|
+
return entry;
|
|
10
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function")
|
|
12
|
+
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
}));
|
|
16
|
+
__moduleCache.set(from, entry);
|
|
17
|
+
return entry;
|
|
18
|
+
};
|
|
19
|
+
var __export = (target, all) => {
|
|
20
|
+
for (var name in all)
|
|
21
|
+
__defProp(target, name, {
|
|
22
|
+
get: all[name],
|
|
23
|
+
enumerable: true,
|
|
24
|
+
configurable: true,
|
|
25
|
+
set: (newValue) => all[name] = () => newValue
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// pkg/takumi_wasm.js
|
|
30
|
+
var exports_takumi_wasm = {};
|
|
31
|
+
__export(exports_takumi_wasm, {
|
|
32
|
+
initSync: () => initSync,
|
|
33
|
+
extractResourceUrls: () => extractResourceUrls,
|
|
34
|
+
default: () => __wbg_init,
|
|
35
|
+
collectNodeFetchTasks: () => collectNodeFetchTasks,
|
|
36
|
+
Renderer: () => Renderer
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(exports_takumi_wasm);
|
|
39
|
+
|
|
40
|
+
class Renderer {
|
|
41
|
+
__destroy_into_raw() {
|
|
42
|
+
const ptr = this.__wbg_ptr;
|
|
43
|
+
this.__wbg_ptr = 0;
|
|
44
|
+
RendererFinalization.unregister(this);
|
|
45
|
+
return ptr;
|
|
46
|
+
}
|
|
47
|
+
free() {
|
|
48
|
+
const ptr = this.__destroy_into_raw();
|
|
49
|
+
wasm.__wbg_renderer_free(ptr, 0);
|
|
50
|
+
}
|
|
51
|
+
clearImageStore() {
|
|
52
|
+
wasm.renderer_clearImageStore(this.__wbg_ptr);
|
|
53
|
+
}
|
|
54
|
+
loadFont(font) {
|
|
55
|
+
try {
|
|
56
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
57
|
+
wasm.renderer_loadFont(retptr, this.__wbg_ptr, addHeapObject(font));
|
|
58
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
59
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
60
|
+
if (r1) {
|
|
61
|
+
throw takeObject(r0);
|
|
62
|
+
}
|
|
63
|
+
} finally {
|
|
64
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
loadFontWithInfo(font) {
|
|
68
|
+
try {
|
|
69
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
70
|
+
wasm.renderer_loadFontWithInfo(retptr, this.__wbg_ptr, addHeapObject(font));
|
|
71
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
72
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
73
|
+
if (r1) {
|
|
74
|
+
throw takeObject(r0);
|
|
75
|
+
}
|
|
76
|
+
} finally {
|
|
77
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
measure(node, options) {
|
|
81
|
+
try {
|
|
82
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
83
|
+
wasm.renderer_measure(retptr, this.__wbg_ptr, addHeapObject(node), isLikeNone(options) ? 0 : addHeapObject(options));
|
|
84
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
85
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
86
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
87
|
+
if (r2) {
|
|
88
|
+
throw takeObject(r1);
|
|
89
|
+
}
|
|
90
|
+
return takeObject(r0);
|
|
91
|
+
} finally {
|
|
92
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
constructor(options) {
|
|
96
|
+
try {
|
|
97
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
98
|
+
wasm.renderer_new(retptr, isLikeNone(options) ? 0 : addHeapObject(options));
|
|
99
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
100
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
101
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
102
|
+
if (r2) {
|
|
103
|
+
throw takeObject(r1);
|
|
104
|
+
}
|
|
105
|
+
this.__wbg_ptr = r0 >>> 0;
|
|
106
|
+
RendererFinalization.register(this, this.__wbg_ptr, this);
|
|
107
|
+
return this;
|
|
108
|
+
} finally {
|
|
109
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
putPersistentImage(data) {
|
|
113
|
+
try {
|
|
114
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
115
|
+
wasm.renderer_putPersistentImage(retptr, this.__wbg_ptr, addHeapObject(data));
|
|
116
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
117
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
118
|
+
if (r1) {
|
|
119
|
+
throw takeObject(r0);
|
|
120
|
+
}
|
|
121
|
+
} finally {
|
|
122
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
render(node, options) {
|
|
126
|
+
try {
|
|
127
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
128
|
+
wasm.renderer_render(retptr, this.__wbg_ptr, addHeapObject(node), isLikeNone(options) ? 0 : addHeapObject(options));
|
|
129
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
130
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
131
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
132
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
133
|
+
if (r3) {
|
|
134
|
+
throw takeObject(r2);
|
|
135
|
+
}
|
|
136
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
137
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
138
|
+
return v1;
|
|
139
|
+
} finally {
|
|
140
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
renderAnimation(frames, options) {
|
|
144
|
+
try {
|
|
145
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
146
|
+
const ptr0 = passArrayJsValueToWasm0(frames, wasm.__wbindgen_export);
|
|
147
|
+
const len0 = WASM_VECTOR_LEN;
|
|
148
|
+
wasm.renderer_renderAnimation(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(options));
|
|
149
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
150
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
151
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
152
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
153
|
+
if (r3) {
|
|
154
|
+
throw takeObject(r2);
|
|
155
|
+
}
|
|
156
|
+
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
157
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
158
|
+
return v2;
|
|
159
|
+
} finally {
|
|
160
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
renderAsDataUrl(node, options) {
|
|
164
|
+
let deferred2_0;
|
|
165
|
+
let deferred2_1;
|
|
166
|
+
try {
|
|
167
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
168
|
+
wasm.renderer_renderAsDataUrl(retptr, this.__wbg_ptr, addHeapObject(node), addHeapObject(options));
|
|
169
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
170
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
171
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
172
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
173
|
+
var ptr1 = r0;
|
|
174
|
+
var len1 = r1;
|
|
175
|
+
if (r3) {
|
|
176
|
+
ptr1 = 0;
|
|
177
|
+
len1 = 0;
|
|
178
|
+
throw takeObject(r2);
|
|
179
|
+
}
|
|
180
|
+
deferred2_0 = ptr1;
|
|
181
|
+
deferred2_1 = len1;
|
|
182
|
+
return getStringFromWasm0(ptr1, len1);
|
|
183
|
+
} finally {
|
|
184
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
185
|
+
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (Symbol.dispose)
|
|
190
|
+
Renderer.prototype[Symbol.dispose] = Renderer.prototype.free;
|
|
191
|
+
function collectNodeFetchTasks(node) {
|
|
192
|
+
try {
|
|
193
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
194
|
+
wasm.collectNodeFetchTasks(retptr, addHeapObject(node));
|
|
195
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
196
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
197
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
198
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
199
|
+
if (r3) {
|
|
200
|
+
throw takeObject(r2);
|
|
201
|
+
}
|
|
202
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
203
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
204
|
+
return v1;
|
|
205
|
+
} finally {
|
|
206
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
function extractResourceUrls(node) {
|
|
210
|
+
try {
|
|
211
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
212
|
+
wasm.collectNodeFetchTasks(retptr, addHeapObject(node));
|
|
213
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
214
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
215
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
216
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
217
|
+
if (r3) {
|
|
218
|
+
throw takeObject(r2);
|
|
219
|
+
}
|
|
220
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
221
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
222
|
+
return v1;
|
|
223
|
+
} finally {
|
|
224
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
function __wbg_get_imports() {
|
|
228
|
+
const import0 = {
|
|
229
|
+
__proto__: null,
|
|
230
|
+
__wbg_Error_8c4e43fe74559d73: function(arg0, arg1) {
|
|
231
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
232
|
+
return addHeapObject(ret);
|
|
233
|
+
},
|
|
234
|
+
__wbg_Number_04624de7d0e8332d: function(arg0) {
|
|
235
|
+
const ret = Number(getObject(arg0));
|
|
236
|
+
return ret;
|
|
237
|
+
},
|
|
238
|
+
__wbg_String_8f0eb39a4a4c2f66: function(arg0, arg1) {
|
|
239
|
+
const ret = String(getObject(arg1));
|
|
240
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
241
|
+
const len1 = WASM_VECTOR_LEN;
|
|
242
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
243
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
244
|
+
},
|
|
245
|
+
__wbg___wbindgen_bigint_get_as_i64_8fcf4ce7f1ca72a2: function(arg0, arg1) {
|
|
246
|
+
const v = getObject(arg1);
|
|
247
|
+
const ret = typeof v === "bigint" ? v : undefined;
|
|
248
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
249
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
250
|
+
},
|
|
251
|
+
__wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25: function(arg0) {
|
|
252
|
+
const v = getObject(arg0);
|
|
253
|
+
const ret = typeof v === "boolean" ? v : undefined;
|
|
254
|
+
return isLikeNone(ret) ? 16777215 : ret ? 1 : 0;
|
|
255
|
+
},
|
|
256
|
+
__wbg___wbindgen_debug_string_0bc8482c6e3508ae: function(arg0, arg1) {
|
|
257
|
+
const ret = debugString(getObject(arg1));
|
|
258
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
259
|
+
const len1 = WASM_VECTOR_LEN;
|
|
260
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
261
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
262
|
+
},
|
|
263
|
+
__wbg___wbindgen_in_47fa6863be6f2f25: function(arg0, arg1) {
|
|
264
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
265
|
+
return ret;
|
|
266
|
+
},
|
|
267
|
+
__wbg___wbindgen_is_bigint_31b12575b56f32fc: function(arg0) {
|
|
268
|
+
const ret = typeof getObject(arg0) === "bigint";
|
|
269
|
+
return ret;
|
|
270
|
+
},
|
|
271
|
+
__wbg___wbindgen_is_function_0095a73b8b156f76: function(arg0) {
|
|
272
|
+
const ret = typeof getObject(arg0) === "function";
|
|
273
|
+
return ret;
|
|
274
|
+
},
|
|
275
|
+
__wbg___wbindgen_is_object_5ae8e5880f2c1fbd: function(arg0) {
|
|
276
|
+
const val = getObject(arg0);
|
|
277
|
+
const ret = typeof val === "object" && val !== null;
|
|
278
|
+
return ret;
|
|
279
|
+
},
|
|
280
|
+
__wbg___wbindgen_is_string_cd444516edc5b180: function(arg0) {
|
|
281
|
+
const ret = typeof getObject(arg0) === "string";
|
|
282
|
+
return ret;
|
|
283
|
+
},
|
|
284
|
+
__wbg___wbindgen_is_undefined_9e4d92534c42d778: function(arg0) {
|
|
285
|
+
const ret = getObject(arg0) === undefined;
|
|
286
|
+
return ret;
|
|
287
|
+
},
|
|
288
|
+
__wbg___wbindgen_jsval_eq_11888390b0186270: function(arg0, arg1) {
|
|
289
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
290
|
+
return ret;
|
|
291
|
+
},
|
|
292
|
+
__wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811: function(arg0, arg1) {
|
|
293
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
294
|
+
return ret;
|
|
295
|
+
},
|
|
296
|
+
__wbg___wbindgen_number_get_8ff4255516ccad3e: function(arg0, arg1) {
|
|
297
|
+
const obj = getObject(arg1);
|
|
298
|
+
const ret = typeof obj === "number" ? obj : undefined;
|
|
299
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
300
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
301
|
+
},
|
|
302
|
+
__wbg___wbindgen_string_get_72fb696202c56729: function(arg0, arg1) {
|
|
303
|
+
const obj = getObject(arg1);
|
|
304
|
+
const ret = typeof obj === "string" ? obj : undefined;
|
|
305
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
306
|
+
var len1 = WASM_VECTOR_LEN;
|
|
307
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
308
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
309
|
+
},
|
|
310
|
+
__wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
|
|
311
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
312
|
+
},
|
|
313
|
+
__wbg_call_389efe28435a9388: function() {
|
|
314
|
+
return handleError(function(arg0, arg1) {
|
|
315
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
316
|
+
return addHeapObject(ret);
|
|
317
|
+
}, arguments);
|
|
318
|
+
},
|
|
319
|
+
__wbg_done_57b39ecd9addfe81: function(arg0) {
|
|
320
|
+
const ret = getObject(arg0).done;
|
|
321
|
+
return ret;
|
|
322
|
+
},
|
|
323
|
+
__wbg_entries_58c7934c745daac7: function(arg0) {
|
|
324
|
+
const ret = Object.entries(getObject(arg0));
|
|
325
|
+
return addHeapObject(ret);
|
|
326
|
+
},
|
|
327
|
+
__wbg_get_9b94d73e6221f75c: function(arg0, arg1) {
|
|
328
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
329
|
+
return addHeapObject(ret);
|
|
330
|
+
},
|
|
331
|
+
__wbg_get_b3ed3ad4be2bc8ac: function() {
|
|
332
|
+
return handleError(function(arg0, arg1) {
|
|
333
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
334
|
+
return addHeapObject(ret);
|
|
335
|
+
}, arguments);
|
|
336
|
+
},
|
|
337
|
+
__wbg_get_with_ref_key_1dc361bd10053bfe: function(arg0, arg1) {
|
|
338
|
+
const ret = getObject(arg0)[getObject(arg1)];
|
|
339
|
+
return addHeapObject(ret);
|
|
340
|
+
},
|
|
341
|
+
__wbg_instanceof_ArrayBuffer_c367199e2fa2aa04: function(arg0) {
|
|
342
|
+
let result;
|
|
343
|
+
try {
|
|
344
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
345
|
+
} catch (_) {
|
|
346
|
+
result = false;
|
|
347
|
+
}
|
|
348
|
+
const ret = result;
|
|
349
|
+
return ret;
|
|
350
|
+
},
|
|
351
|
+
__wbg_instanceof_Map_53af74335dec57f4: function(arg0) {
|
|
352
|
+
let result;
|
|
353
|
+
try {
|
|
354
|
+
result = getObject(arg0) instanceof Map;
|
|
355
|
+
} catch (_) {
|
|
356
|
+
result = false;
|
|
357
|
+
}
|
|
358
|
+
const ret = result;
|
|
359
|
+
return ret;
|
|
360
|
+
},
|
|
361
|
+
__wbg_instanceof_Uint8Array_9b9075935c74707c: function(arg0) {
|
|
362
|
+
let result;
|
|
363
|
+
try {
|
|
364
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
365
|
+
} catch (_) {
|
|
366
|
+
result = false;
|
|
367
|
+
}
|
|
368
|
+
const ret = result;
|
|
369
|
+
return ret;
|
|
370
|
+
},
|
|
371
|
+
__wbg_isArray_d314bb98fcf08331: function(arg0) {
|
|
372
|
+
const ret = Array.isArray(getObject(arg0));
|
|
373
|
+
return ret;
|
|
374
|
+
},
|
|
375
|
+
__wbg_isSafeInteger_bfbc7332a9768d2a: function(arg0) {
|
|
376
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
377
|
+
return ret;
|
|
378
|
+
},
|
|
379
|
+
__wbg_iterator_6ff6560ca1568e55: function() {
|
|
380
|
+
const ret = Symbol.iterator;
|
|
381
|
+
return addHeapObject(ret);
|
|
382
|
+
},
|
|
383
|
+
__wbg_length_32ed9a279acd054c: function(arg0) {
|
|
384
|
+
const ret = getObject(arg0).length;
|
|
385
|
+
return ret;
|
|
386
|
+
},
|
|
387
|
+
__wbg_length_35a7bace40f36eac: function(arg0) {
|
|
388
|
+
const ret = getObject(arg0).length;
|
|
389
|
+
return ret;
|
|
390
|
+
},
|
|
391
|
+
__wbg_new_361308b2356cecd0: function() {
|
|
392
|
+
const ret = new Object;
|
|
393
|
+
return addHeapObject(ret);
|
|
394
|
+
},
|
|
395
|
+
__wbg_new_3eb36ae241fe6f44: function() {
|
|
396
|
+
const ret = new Array;
|
|
397
|
+
return addHeapObject(ret);
|
|
398
|
+
},
|
|
399
|
+
__wbg_new_72b49615380db768: function(arg0, arg1) {
|
|
400
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
401
|
+
return addHeapObject(ret);
|
|
402
|
+
},
|
|
403
|
+
__wbg_new_dd2b680c8bf6ae29: function(arg0) {
|
|
404
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
405
|
+
return addHeapObject(ret);
|
|
406
|
+
},
|
|
407
|
+
__wbg_next_3482f54c49e8af19: function() {
|
|
408
|
+
return handleError(function(arg0) {
|
|
409
|
+
const ret = getObject(arg0).next();
|
|
410
|
+
return addHeapObject(ret);
|
|
411
|
+
}, arguments);
|
|
412
|
+
},
|
|
413
|
+
__wbg_next_418f80d8f5303233: function(arg0) {
|
|
414
|
+
const ret = getObject(arg0).next;
|
|
415
|
+
return addHeapObject(ret);
|
|
416
|
+
},
|
|
417
|
+
__wbg_prototypesetcall_bdcdcc5842e4d77d: function(arg0, arg1, arg2) {
|
|
418
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
419
|
+
},
|
|
420
|
+
__wbg_set_3f1d0b984ed272ed: function(arg0, arg1, arg2) {
|
|
421
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
422
|
+
},
|
|
423
|
+
__wbg_set_f43e577aea94465b: function(arg0, arg1, arg2) {
|
|
424
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
425
|
+
},
|
|
426
|
+
__wbg_value_0546255b415e96c1: function(arg0) {
|
|
427
|
+
const ret = getObject(arg0).value;
|
|
428
|
+
return addHeapObject(ret);
|
|
429
|
+
},
|
|
430
|
+
__wbindgen_cast_0000000000000001: function(arg0) {
|
|
431
|
+
const ret = arg0;
|
|
432
|
+
return addHeapObject(ret);
|
|
433
|
+
},
|
|
434
|
+
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
435
|
+
const ret = arg0;
|
|
436
|
+
return addHeapObject(ret);
|
|
437
|
+
},
|
|
438
|
+
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
439
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
440
|
+
return addHeapObject(ret);
|
|
441
|
+
},
|
|
442
|
+
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
443
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
444
|
+
return addHeapObject(ret);
|
|
445
|
+
},
|
|
446
|
+
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
447
|
+
var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
|
|
448
|
+
wasm.__wbindgen_export4(arg0, arg1 * 4, 4);
|
|
449
|
+
const ret = v0;
|
|
450
|
+
return addHeapObject(ret);
|
|
451
|
+
},
|
|
452
|
+
__wbindgen_object_clone_ref: function(arg0) {
|
|
453
|
+
const ret = getObject(arg0);
|
|
454
|
+
return addHeapObject(ret);
|
|
455
|
+
},
|
|
456
|
+
__wbindgen_object_drop_ref: function(arg0) {
|
|
457
|
+
takeObject(arg0);
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
return {
|
|
461
|
+
__proto__: null,
|
|
462
|
+
"./takumi_wasm_bg.js": import0
|
|
463
|
+
};
|
|
464
|
+
}
|
|
465
|
+
var RendererFinalization = typeof FinalizationRegistry === "undefined" ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry((ptr) => wasm.__wbg_renderer_free(ptr >>> 0, 1));
|
|
466
|
+
function addHeapObject(obj) {
|
|
467
|
+
if (heap_next === heap.length)
|
|
468
|
+
heap.push(heap.length + 1);
|
|
469
|
+
const idx = heap_next;
|
|
470
|
+
heap_next = heap[idx];
|
|
471
|
+
heap[idx] = obj;
|
|
472
|
+
return idx;
|
|
473
|
+
}
|
|
474
|
+
function debugString(val) {
|
|
475
|
+
const type = typeof val;
|
|
476
|
+
if (type == "number" || type == "boolean" || val == null) {
|
|
477
|
+
return `${val}`;
|
|
478
|
+
}
|
|
479
|
+
if (type == "string") {
|
|
480
|
+
return `"${val}"`;
|
|
481
|
+
}
|
|
482
|
+
if (type == "symbol") {
|
|
483
|
+
const description = val.description;
|
|
484
|
+
if (description == null) {
|
|
485
|
+
return "Symbol";
|
|
486
|
+
} else {
|
|
487
|
+
return `Symbol(${description})`;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
if (type == "function") {
|
|
491
|
+
const name = val.name;
|
|
492
|
+
if (typeof name == "string" && name.length > 0) {
|
|
493
|
+
return `Function(${name})`;
|
|
494
|
+
} else {
|
|
495
|
+
return "Function";
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
if (Array.isArray(val)) {
|
|
499
|
+
const length = val.length;
|
|
500
|
+
let debug = "[";
|
|
501
|
+
if (length > 0) {
|
|
502
|
+
debug += debugString(val[0]);
|
|
503
|
+
}
|
|
504
|
+
for (let i = 1;i < length; i++) {
|
|
505
|
+
debug += ", " + debugString(val[i]);
|
|
506
|
+
}
|
|
507
|
+
debug += "]";
|
|
508
|
+
return debug;
|
|
509
|
+
}
|
|
510
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
511
|
+
let className;
|
|
512
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
513
|
+
className = builtInMatches[1];
|
|
514
|
+
} else {
|
|
515
|
+
return toString.call(val);
|
|
516
|
+
}
|
|
517
|
+
if (className == "Object") {
|
|
518
|
+
try {
|
|
519
|
+
return "Object(" + JSON.stringify(val) + ")";
|
|
520
|
+
} catch (_) {
|
|
521
|
+
return "Object";
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
if (val instanceof Error) {
|
|
525
|
+
return `${val.name}: ${val.message}
|
|
526
|
+
${val.stack}`;
|
|
527
|
+
}
|
|
528
|
+
return className;
|
|
529
|
+
}
|
|
530
|
+
function dropObject(idx) {
|
|
531
|
+
if (idx < 132)
|
|
532
|
+
return;
|
|
533
|
+
heap[idx] = heap_next;
|
|
534
|
+
heap_next = idx;
|
|
535
|
+
}
|
|
536
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
537
|
+
ptr = ptr >>> 0;
|
|
538
|
+
const mem = getDataViewMemory0();
|
|
539
|
+
const result = [];
|
|
540
|
+
for (let i = ptr;i < ptr + 4 * len; i += 4) {
|
|
541
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
542
|
+
}
|
|
543
|
+
return result;
|
|
544
|
+
}
|
|
545
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
546
|
+
ptr = ptr >>> 0;
|
|
547
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
548
|
+
}
|
|
549
|
+
var cachedDataViewMemory0 = null;
|
|
550
|
+
function getDataViewMemory0() {
|
|
551
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer) {
|
|
552
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
553
|
+
}
|
|
554
|
+
return cachedDataViewMemory0;
|
|
555
|
+
}
|
|
556
|
+
function getStringFromWasm0(ptr, len) {
|
|
557
|
+
ptr = ptr >>> 0;
|
|
558
|
+
return decodeText(ptr, len);
|
|
559
|
+
}
|
|
560
|
+
var cachedUint8ArrayMemory0 = null;
|
|
561
|
+
function getUint8ArrayMemory0() {
|
|
562
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
563
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
564
|
+
}
|
|
565
|
+
return cachedUint8ArrayMemory0;
|
|
566
|
+
}
|
|
567
|
+
function getObject(idx) {
|
|
568
|
+
return heap[idx];
|
|
569
|
+
}
|
|
570
|
+
function handleError(f, args) {
|
|
571
|
+
try {
|
|
572
|
+
return f.apply(this, args);
|
|
573
|
+
} catch (e) {
|
|
574
|
+
wasm.__wbindgen_export3(addHeapObject(e));
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
var heap = new Array(128).fill(undefined);
|
|
578
|
+
heap.push(undefined, null, true, false);
|
|
579
|
+
var heap_next = heap.length;
|
|
580
|
+
function isLikeNone(x) {
|
|
581
|
+
return x === undefined || x === null;
|
|
582
|
+
}
|
|
583
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
584
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
585
|
+
const mem = getDataViewMemory0();
|
|
586
|
+
for (let i = 0;i < array.length; i++) {
|
|
587
|
+
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
588
|
+
}
|
|
589
|
+
WASM_VECTOR_LEN = array.length;
|
|
590
|
+
return ptr;
|
|
591
|
+
}
|
|
592
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
593
|
+
if (realloc === undefined) {
|
|
594
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
595
|
+
const ptr2 = malloc(buf.length, 1) >>> 0;
|
|
596
|
+
getUint8ArrayMemory0().subarray(ptr2, ptr2 + buf.length).set(buf);
|
|
597
|
+
WASM_VECTOR_LEN = buf.length;
|
|
598
|
+
return ptr2;
|
|
599
|
+
}
|
|
600
|
+
let len = arg.length;
|
|
601
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
602
|
+
const mem = getUint8ArrayMemory0();
|
|
603
|
+
let offset = 0;
|
|
604
|
+
for (;offset < len; offset++) {
|
|
605
|
+
const code = arg.charCodeAt(offset);
|
|
606
|
+
if (code > 127)
|
|
607
|
+
break;
|
|
608
|
+
mem[ptr + offset] = code;
|
|
609
|
+
}
|
|
610
|
+
if (offset !== len) {
|
|
611
|
+
if (offset !== 0) {
|
|
612
|
+
arg = arg.slice(offset);
|
|
613
|
+
}
|
|
614
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
615
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
616
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
617
|
+
offset += ret.written;
|
|
618
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
619
|
+
}
|
|
620
|
+
WASM_VECTOR_LEN = offset;
|
|
621
|
+
return ptr;
|
|
622
|
+
}
|
|
623
|
+
function takeObject(idx) {
|
|
624
|
+
const ret = getObject(idx);
|
|
625
|
+
dropObject(idx);
|
|
626
|
+
return ret;
|
|
627
|
+
}
|
|
628
|
+
var cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
629
|
+
cachedTextDecoder.decode();
|
|
630
|
+
var MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
631
|
+
var numBytesDecoded = 0;
|
|
632
|
+
function decodeText(ptr, len) {
|
|
633
|
+
numBytesDecoded += len;
|
|
634
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
635
|
+
cachedTextDecoder = new TextDecoder("utf-8", { ignoreBOM: true, fatal: true });
|
|
636
|
+
cachedTextDecoder.decode();
|
|
637
|
+
numBytesDecoded = len;
|
|
638
|
+
}
|
|
639
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
640
|
+
}
|
|
641
|
+
var cachedTextEncoder = new TextEncoder;
|
|
642
|
+
if (!("encodeInto" in cachedTextEncoder)) {
|
|
643
|
+
cachedTextEncoder.encodeInto = function(arg, view) {
|
|
644
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
645
|
+
view.set(buf);
|
|
646
|
+
return {
|
|
647
|
+
read: arg.length,
|
|
648
|
+
written: buf.length
|
|
649
|
+
};
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
var WASM_VECTOR_LEN = 0;
|
|
653
|
+
var wasmModule;
|
|
654
|
+
var wasm;
|
|
655
|
+
function __wbg_finalize_init(instance, module2) {
|
|
656
|
+
wasm = instance.exports;
|
|
657
|
+
wasmModule = module2;
|
|
658
|
+
cachedDataViewMemory0 = null;
|
|
659
|
+
cachedUint8ArrayMemory0 = null;
|
|
660
|
+
return wasm;
|
|
661
|
+
}
|
|
662
|
+
async function __wbg_load(module2, imports) {
|
|
663
|
+
if (typeof Response === "function" && module2 instanceof Response) {
|
|
664
|
+
if (typeof WebAssembly.instantiateStreaming === "function") {
|
|
665
|
+
try {
|
|
666
|
+
return await WebAssembly.instantiateStreaming(module2, imports);
|
|
667
|
+
} catch (e) {
|
|
668
|
+
const validResponse = module2.ok && expectedResponseType(module2.type);
|
|
669
|
+
if (validResponse && module2.headers.get("Content-Type") !== "application/wasm") {
|
|
670
|
+
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);
|
|
671
|
+
} else {
|
|
672
|
+
throw e;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
const bytes = await module2.arrayBuffer();
|
|
677
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
678
|
+
} else {
|
|
679
|
+
const instance = await WebAssembly.instantiate(module2, imports);
|
|
680
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
681
|
+
return { instance, module: module2 };
|
|
682
|
+
} else {
|
|
683
|
+
return instance;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
function expectedResponseType(type) {
|
|
687
|
+
switch (type) {
|
|
688
|
+
case "basic":
|
|
689
|
+
case "cors":
|
|
690
|
+
case "default":
|
|
691
|
+
return true;
|
|
692
|
+
}
|
|
693
|
+
return false;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
function initSync(module2) {
|
|
697
|
+
if (wasm !== undefined)
|
|
698
|
+
return wasm;
|
|
699
|
+
if (module2 !== undefined) {
|
|
700
|
+
if (Object.getPrototypeOf(module2) === Object.prototype) {
|
|
701
|
+
({ module: module2 } = module2);
|
|
702
|
+
} else {
|
|
703
|
+
console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
const imports = __wbg_get_imports();
|
|
707
|
+
if (!(module2 instanceof WebAssembly.Module)) {
|
|
708
|
+
module2 = new WebAssembly.Module(module2);
|
|
709
|
+
}
|
|
710
|
+
const instance = new WebAssembly.Instance(module2, imports);
|
|
711
|
+
return __wbg_finalize_init(instance, module2);
|
|
712
|
+
}
|
|
713
|
+
async function __wbg_init(module_or_path) {
|
|
714
|
+
if (wasm !== undefined)
|
|
715
|
+
return wasm;
|
|
716
|
+
if (module_or_path !== undefined) {
|
|
717
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
718
|
+
({ module_or_path } = module_or_path);
|
|
719
|
+
} else {
|
|
720
|
+
console.warn("using deprecated parameters for the initialization function; pass a single object instead");
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
if (module_or_path === undefined) {
|
|
724
|
+
module_or_path = new URL("takumi_wasm_bg.wasm", undefined);
|
|
725
|
+
}
|
|
726
|
+
const imports = __wbg_get_imports();
|
|
727
|
+
if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) {
|
|
728
|
+
module_or_path = fetch(module_or_path);
|
|
729
|
+
}
|
|
730
|
+
const { instance, module: module2 } = await __wbg_load(await module_or_path, imports);
|
|
731
|
+
return __wbg_finalize_init(instance, module2);
|
|
732
|
+
}
|
package/pkg/takumi_wasm_bg.wasm
CHANGED
|
Binary file
|