at main 803 lines 26 kB view raw
1 2let imports = {}; 3imports['__wbindgen_placeholder__'] = module.exports; 4 5function addHeapObject(obj) { 6 if (heap_next === heap.length) heap.push(heap.length + 1); 7 const idx = heap_next; 8 heap_next = heap[idx]; 9 10 heap[idx] = obj; 11 return idx; 12} 13 14function _assertClass(instance, klass) { 15 if (!(instance instanceof klass)) { 16 throw new Error(`expected instance of ${klass.name}`); 17 } 18} 19 20function debugString(val) { 21 // primitive types 22 const type = typeof val; 23 if (type == 'number' || type == 'boolean' || val == null) { 24 return `${val}`; 25 } 26 if (type == 'string') { 27 return `"${val}"`; 28 } 29 if (type == 'symbol') { 30 const description = val.description; 31 if (description == null) { 32 return 'Symbol'; 33 } else { 34 return `Symbol(${description})`; 35 } 36 } 37 if (type == 'function') { 38 const name = val.name; 39 if (typeof name == 'string' && name.length > 0) { 40 return `Function(${name})`; 41 } else { 42 return 'Function'; 43 } 44 } 45 // objects 46 if (Array.isArray(val)) { 47 const length = val.length; 48 let debug = '['; 49 if (length > 0) { 50 debug += debugString(val[0]); 51 } 52 for(let i = 1; i < length; i++) { 53 debug += ', ' + debugString(val[i]); 54 } 55 debug += ']'; 56 return debug; 57 } 58 // Test for built-in 59 const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); 60 let className; 61 if (builtInMatches && builtInMatches.length > 1) { 62 className = builtInMatches[1]; 63 } else { 64 // Failed to match the standard '[object ClassName]' 65 return toString.call(val); 66 } 67 if (className == 'Object') { 68 // we're a user defined class or Object 69 // JSON.stringify avoids problems with cycles, and is generally much 70 // easier than looping through ownProperties of `val`. 71 try { 72 return 'Object(' + JSON.stringify(val) + ')'; 73 } catch (_) { 74 return 'Object'; 75 } 76 } 77 // errors 78 if (val instanceof Error) { 79 return `${val.name}: ${val.message}\n${val.stack}`; 80 } 81 // TODO we could test for more things here, like `Set`s and `Map`s. 82 return className; 83} 84 85function dropObject(idx) { 86 if (idx < 132) return; 87 heap[idx] = heap_next; 88 heap_next = idx; 89} 90 91function getArrayU8FromWasm0(ptr, len) { 92 ptr = ptr >>> 0; 93 return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len); 94} 95 96let cachedDataViewMemory0 = null; 97function getDataViewMemory0() { 98 if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { 99 cachedDataViewMemory0 = new DataView(wasm.memory.buffer); 100 } 101 return cachedDataViewMemory0; 102} 103 104function getStringFromWasm0(ptr, len) { 105 ptr = ptr >>> 0; 106 return decodeText(ptr, len); 107} 108 109let cachedUint8ArrayMemory0 = null; 110function getUint8ArrayMemory0() { 111 if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { 112 cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); 113 } 114 return cachedUint8ArrayMemory0; 115} 116 117function getObject(idx) { return heap[idx]; } 118 119function handleError(f, args) { 120 try { 121 return f.apply(this, args); 122 } catch (e) { 123 wasm.__wbindgen_export3(addHeapObject(e)); 124 } 125} 126 127let heap = new Array(128).fill(undefined); 128heap.push(undefined, null, true, false); 129 130let heap_next = heap.length; 131 132function isLikeNone(x) { 133 return x === undefined || x === null; 134} 135 136function passStringToWasm0(arg, malloc, realloc) { 137 if (realloc === undefined) { 138 const buf = cachedTextEncoder.encode(arg); 139 const ptr = malloc(buf.length, 1) >>> 0; 140 getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf); 141 WASM_VECTOR_LEN = buf.length; 142 return ptr; 143 } 144 145 let len = arg.length; 146 let ptr = malloc(len, 1) >>> 0; 147 148 const mem = getUint8ArrayMemory0(); 149 150 let offset = 0; 151 152 for (; offset < len; offset++) { 153 const code = arg.charCodeAt(offset); 154 if (code > 0x7F) break; 155 mem[ptr + offset] = code; 156 } 157 if (offset !== len) { 158 if (offset !== 0) { 159 arg = arg.slice(offset); 160 } 161 ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; 162 const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len); 163 const ret = cachedTextEncoder.encodeInto(arg, view); 164 165 offset += ret.written; 166 ptr = realloc(ptr, len, offset, 1) >>> 0; 167 } 168 169 WASM_VECTOR_LEN = offset; 170 return ptr; 171} 172 173function takeObject(idx) { 174 const ret = getObject(idx); 175 dropObject(idx); 176 return ret; 177} 178 179let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); 180cachedTextDecoder.decode(); 181function decodeText(ptr, len) { 182 return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); 183} 184 185const cachedTextEncoder = new TextEncoder(); 186 187if (!('encodeInto' in cachedTextEncoder)) { 188 cachedTextEncoder.encodeInto = function (arg, view) { 189 const buf = cachedTextEncoder.encode(arg); 190 view.set(buf); 191 return { 192 read: arg.length, 193 written: buf.length 194 }; 195 } 196} 197 198let WASM_VECTOR_LEN = 0; 199 200const JsMathResultFinalization = (typeof FinalizationRegistry === 'undefined') 201 ? { register: () => {}, unregister: () => {} } 202 : new FinalizationRegistry(ptr => wasm.__wbg_jsmathresult_free(ptr >>> 0, 1)); 203 204const JsResolvedContentFinalization = (typeof FinalizationRegistry === 'undefined') 205 ? { register: () => {}, unregister: () => {} } 206 : new FinalizationRegistry(ptr => wasm.__wbg_jsresolvedcontent_free(ptr >>> 0, 1)); 207 208/** 209 * Result from rendering LaTeX math. 210 */ 211class JsMathResult { 212 static __wrap(ptr) { 213 ptr = ptr >>> 0; 214 const obj = Object.create(JsMathResult.prototype); 215 obj.__wbg_ptr = ptr; 216 JsMathResultFinalization.register(obj, obj.__wbg_ptr, obj); 217 return obj; 218 } 219 __destroy_into_raw() { 220 const ptr = this.__wbg_ptr; 221 this.__wbg_ptr = 0; 222 JsMathResultFinalization.unregister(this); 223 return ptr; 224 } 225 free() { 226 const ptr = this.__destroy_into_raw(); 227 wasm.__wbg_jsmathresult_free(ptr, 0); 228 } 229 /** 230 * @returns {boolean} 231 */ 232 get success() { 233 const ret = wasm.__wbg_get_jsmathresult_success(this.__wbg_ptr); 234 return ret !== 0; 235 } 236 /** 237 * @param {boolean} arg0 238 */ 239 set success(arg0) { 240 wasm.__wbg_set_jsmathresult_success(this.__wbg_ptr, arg0); 241 } 242 /** 243 * @returns {string} 244 */ 245 get html() { 246 let deferred1_0; 247 let deferred1_1; 248 try { 249 const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 250 wasm.__wbg_get_jsmathresult_html(retptr, this.__wbg_ptr); 251 var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); 252 var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); 253 deferred1_0 = r0; 254 deferred1_1 = r1; 255 return getStringFromWasm0(r0, r1); 256 } finally { 257 wasm.__wbindgen_add_to_stack_pointer(16); 258 wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1); 259 } 260 } 261 /** 262 * @param {string} arg0 263 */ 264 set html(arg0) { 265 const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2); 266 const len0 = WASM_VECTOR_LEN; 267 wasm.__wbg_set_jsmathresult_html(this.__wbg_ptr, ptr0, len0); 268 } 269 /** 270 * @returns {string | undefined} 271 */ 272 get error() { 273 try { 274 const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 275 wasm.__wbg_get_jsmathresult_error(retptr, this.__wbg_ptr); 276 var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); 277 var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); 278 let v1; 279 if (r0 !== 0) { 280 v1 = getStringFromWasm0(r0, r1).slice(); 281 wasm.__wbindgen_export4(r0, r1 * 1, 1); 282 } 283 return v1; 284 } finally { 285 wasm.__wbindgen_add_to_stack_pointer(16); 286 } 287 } 288 /** 289 * @param {string | null} [arg0] 290 */ 291 set error(arg0) { 292 var ptr0 = isLikeNone(arg0) ? 0 : passStringToWasm0(arg0, wasm.__wbindgen_export, wasm.__wbindgen_export2); 293 var len0 = WASM_VECTOR_LEN; 294 wasm.__wbg_set_jsmathresult_error(this.__wbg_ptr, ptr0, len0); 295 } 296} 297if (Symbol.dispose) JsMathResult.prototype[Symbol.dispose] = JsMathResult.prototype.free; 298exports.JsMathResult = JsMathResult; 299 300/** 301 * Pre-rendered embed content for synchronous rendering. 302 * 303 * Build this by calling `create_resolved_content()` and adding embeds 304 * with `resolved_content_add_embed()`. 305 */ 306class JsResolvedContent { 307 static __wrap(ptr) { 308 ptr = ptr >>> 0; 309 const obj = Object.create(JsResolvedContent.prototype); 310 obj.__wbg_ptr = ptr; 311 JsResolvedContentFinalization.register(obj, obj.__wbg_ptr, obj); 312 return obj; 313 } 314 __destroy_into_raw() { 315 const ptr = this.__wbg_ptr; 316 this.__wbg_ptr = 0; 317 JsResolvedContentFinalization.unregister(this); 318 return ptr; 319 } 320 free() { 321 const ptr = this.__destroy_into_raw(); 322 wasm.__wbg_jsresolvedcontent_free(ptr, 0); 323 } 324 /** 325 * Create an empty resolved content container. 326 */ 327 constructor() { 328 const ret = wasm.create_resolved_content(); 329 this.__wbg_ptr = ret >>> 0; 330 JsResolvedContentFinalization.register(this, this.__wbg_ptr, this); 331 return this; 332 } 333 /** 334 * Add pre-rendered embed HTML for an AT URI. 335 * 336 * # Arguments 337 * * `at_uri` - The AT Protocol URI (e.g., "at://did:plc:.../app.bsky.feed.post/...") 338 * * `html` - The pre-rendered HTML for this embed 339 * @param {string} at_uri 340 * @param {string} html 341 */ 342 addEmbed(at_uri, html) { 343 try { 344 const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 345 const ptr0 = passStringToWasm0(at_uri, wasm.__wbindgen_export, wasm.__wbindgen_export2); 346 const len0 = WASM_VECTOR_LEN; 347 const ptr1 = passStringToWasm0(html, wasm.__wbindgen_export, wasm.__wbindgen_export2); 348 const len1 = WASM_VECTOR_LEN; 349 wasm.jsresolvedcontent_addEmbed(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1); 350 var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); 351 var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); 352 if (r1) { 353 throw takeObject(r0); 354 } 355 } finally { 356 wasm.__wbindgen_add_to_stack_pointer(16); 357 } 358 } 359} 360if (Symbol.dispose) JsResolvedContent.prototype[Symbol.dispose] = JsResolvedContent.prototype.free; 361exports.JsResolvedContent = JsResolvedContent; 362 363/** 364 * Create an empty resolved content container. 365 * 366 * Use this to pre-render embeds before calling render functions. 367 * @returns {JsResolvedContent} 368 */ 369function create_resolved_content() { 370 const ret = wasm.create_resolved_content(); 371 return JsResolvedContent.__wrap(ret); 372} 373exports.create_resolved_content = create_resolved_content; 374 375/** 376 * Initialize panic hook for better error messages in console. 377 */ 378function init() { 379 wasm.init(); 380} 381exports.init = init; 382 383/** 384 * Render faceted text (rich text with mentions, links, etc.) to HTML. 385 * 386 * Accepts facets from several AT Protocol lexicons (app.bsky, pub.leaflet, blog.pckt). 387 * 388 * # Arguments 389 * * `text` - The plain text content 390 * * `facets_json` - Array of facets with `index` (byteStart/byteEnd) and `features` array 391 * @param {string} text 392 * @param {any} facets_json 393 * @returns {string} 394 */ 395function render_faceted_text(text, facets_json) { 396 let deferred3_0; 397 let deferred3_1; 398 try { 399 const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 400 const ptr0 = passStringToWasm0(text, wasm.__wbindgen_export, wasm.__wbindgen_export2); 401 const len0 = WASM_VECTOR_LEN; 402 wasm.render_faceted_text(retptr, ptr0, len0, addHeapObject(facets_json)); 403 var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); 404 var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); 405 var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); 406 var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true); 407 var ptr2 = r0; 408 var len2 = r1; 409 if (r3) { 410 ptr2 = 0; len2 = 0; 411 throw takeObject(r2); 412 } 413 deferred3_0 = ptr2; 414 deferred3_1 = len2; 415 return getStringFromWasm0(ptr2, len2); 416 } finally { 417 wasm.__wbindgen_add_to_stack_pointer(16); 418 wasm.__wbindgen_export4(deferred3_0, deferred3_1, 1); 419 } 420} 421exports.render_faceted_text = render_faceted_text; 422 423/** 424 * Render markdown to HTML. 425 * 426 * # Arguments 427 * * `markdown` - The markdown source text 428 * * `resolved_content` - Optional pre-rendered embed content 429 * @param {string} markdown 430 * @param {JsResolvedContent | null} [resolved_content] 431 * @returns {string} 432 */ 433function render_markdown(markdown, resolved_content) { 434 let deferred4_0; 435 let deferred4_1; 436 try { 437 const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 438 const ptr0 = passStringToWasm0(markdown, wasm.__wbindgen_export, wasm.__wbindgen_export2); 439 const len0 = WASM_VECTOR_LEN; 440 let ptr1 = 0; 441 if (!isLikeNone(resolved_content)) { 442 _assertClass(resolved_content, JsResolvedContent); 443 ptr1 = resolved_content.__destroy_into_raw(); 444 } 445 wasm.render_markdown(retptr, ptr0, len0, ptr1); 446 var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); 447 var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); 448 var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); 449 var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true); 450 var ptr3 = r0; 451 var len3 = r1; 452 if (r3) { 453 ptr3 = 0; len3 = 0; 454 throw takeObject(r2); 455 } 456 deferred4_0 = ptr3; 457 deferred4_1 = len3; 458 return getStringFromWasm0(ptr3, len3); 459 } finally { 460 wasm.__wbindgen_add_to_stack_pointer(16); 461 wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1); 462 } 463} 464exports.render_markdown = render_markdown; 465 466/** 467 * Render LaTeX math to MathML. 468 * 469 * # Arguments 470 * * `latex` - The LaTeX math expression 471 * * `display_mode` - true for display math (block), false for inline math 472 * @param {string} latex 473 * @param {boolean} display_mode 474 * @returns {JsMathResult} 475 */ 476function render_math(latex, display_mode) { 477 const ptr0 = passStringToWasm0(latex, wasm.__wbindgen_export, wasm.__wbindgen_export2); 478 const len0 = WASM_VECTOR_LEN; 479 const ret = wasm.render_math(ptr0, len0, display_mode); 480 return JsMathResult.__wrap(ret); 481} 482exports.render_math = render_math; 483 484/** 485 * Render an AT Protocol record as HTML. 486 * 487 * Takes a record URI and the record data (typically fetched from an appview). 488 * Returns the rendered HTML string. 489 * 490 * # Arguments 491 * * `at_uri` - The AT Protocol URI (e.g., "at://did:plc:.../app.bsky.feed.post/...") 492 * * `record_json` - The record data as JSON 493 * * `fallback_author` - Optional author profile for records that don't include author info 494 * * `resolved_content` - Optional pre-rendered embed content 495 * @param {string} at_uri 496 * @param {any} record_json 497 * @param {any | null} [fallback_author] 498 * @param {JsResolvedContent | null} [resolved_content] 499 * @returns {string} 500 */ 501function render_record(at_uri, record_json, fallback_author, resolved_content) { 502 let deferred4_0; 503 let deferred4_1; 504 try { 505 const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); 506 const ptr0 = passStringToWasm0(at_uri, wasm.__wbindgen_export, wasm.__wbindgen_export2); 507 const len0 = WASM_VECTOR_LEN; 508 let ptr1 = 0; 509 if (!isLikeNone(resolved_content)) { 510 _assertClass(resolved_content, JsResolvedContent); 511 ptr1 = resolved_content.__destroy_into_raw(); 512 } 513 wasm.render_record(retptr, ptr0, len0, addHeapObject(record_json), isLikeNone(fallback_author) ? 0 : addHeapObject(fallback_author), ptr1); 514 var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true); 515 var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true); 516 var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true); 517 var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true); 518 var ptr3 = r0; 519 var len3 = r1; 520 if (r3) { 521 ptr3 = 0; len3 = 0; 522 throw takeObject(r2); 523 } 524 deferred4_0 = ptr3; 525 deferred4_1 = len3; 526 return getStringFromWasm0(ptr3, len3); 527 } finally { 528 wasm.__wbindgen_add_to_stack_pointer(16); 529 wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1); 530 } 531} 532exports.render_record = render_record; 533 534exports.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) { 535 const ret = Error(getStringFromWasm0(arg0, arg1)); 536 return addHeapObject(ret); 537}; 538 539exports.__wbg_Number_2d1dcfcf4ec51736 = function(arg0) { 540 const ret = Number(getObject(arg0)); 541 return ret; 542}; 543 544exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) { 545 const ret = String(getObject(arg1)); 546 const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2); 547 const len1 = WASM_VECTOR_LEN; 548 getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); 549 getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); 550}; 551 552exports.__wbg___wbindgen_bigint_get_as_i64_6e32f5e6aff02e1d = function(arg0, arg1) { 553 const v = getObject(arg1); 554 const ret = typeof(v) === 'bigint' ? v : undefined; 555 getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true); 556 getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true); 557}; 558 559exports.__wbg___wbindgen_boolean_get_dea25b33882b895b = function(arg0) { 560 const v = getObject(arg0); 561 const ret = typeof(v) === 'boolean' ? v : undefined; 562 return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0; 563}; 564 565exports.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) { 566 const ret = debugString(getObject(arg1)); 567 const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2); 568 const len1 = WASM_VECTOR_LEN; 569 getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); 570 getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); 571}; 572 573exports.__wbg___wbindgen_in_0d3e1e8f0c669317 = function(arg0, arg1) { 574 const ret = getObject(arg0) in getObject(arg1); 575 return ret; 576}; 577 578exports.__wbg___wbindgen_is_bigint_0e1a2e3f55cfae27 = function(arg0) { 579 const ret = typeof(getObject(arg0)) === 'bigint'; 580 return ret; 581}; 582 583exports.__wbg___wbindgen_is_function_8d400b8b1af978cd = function(arg0) { 584 const ret = typeof(getObject(arg0)) === 'function'; 585 return ret; 586}; 587 588exports.__wbg___wbindgen_is_object_ce774f3490692386 = function(arg0) { 589 const val = getObject(arg0); 590 const ret = typeof(val) === 'object' && val !== null; 591 return ret; 592}; 593 594exports.__wbg___wbindgen_is_undefined_f6b95eab589e0269 = function(arg0) { 595 const ret = getObject(arg0) === undefined; 596 return ret; 597}; 598 599exports.__wbg___wbindgen_jsval_eq_b6101cc9cef1fe36 = function(arg0, arg1) { 600 const ret = getObject(arg0) === getObject(arg1); 601 return ret; 602}; 603 604exports.__wbg___wbindgen_jsval_loose_eq_766057600fdd1b0d = function(arg0, arg1) { 605 const ret = getObject(arg0) == getObject(arg1); 606 return ret; 607}; 608 609exports.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) { 610 const obj = getObject(arg1); 611 const ret = typeof(obj) === 'number' ? obj : undefined; 612 getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true); 613 getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true); 614}; 615 616exports.__wbg___wbindgen_string_get_a2a31e16edf96e42 = function(arg0, arg1) { 617 const obj = getObject(arg1); 618 const ret = typeof(obj) === 'string' ? obj : undefined; 619 var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2); 620 var len1 = WASM_VECTOR_LEN; 621 getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); 622 getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); 623}; 624 625exports.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) { 626 throw new Error(getStringFromWasm0(arg0, arg1)); 627}; 628 629exports.__wbg_call_abb4ff46ce38be40 = function() { return handleError(function (arg0, arg1) { 630 const ret = getObject(arg0).call(getObject(arg1)); 631 return addHeapObject(ret); 632}, arguments) }; 633 634exports.__wbg_done_62ea16af4ce34b24 = function(arg0) { 635 const ret = getObject(arg0).done; 636 return ret; 637}; 638 639exports.__wbg_entries_83c79938054e065f = function(arg0) { 640 const ret = Object.entries(getObject(arg0)); 641 return addHeapObject(ret); 642}; 643 644exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) { 645 let deferred0_0; 646 let deferred0_1; 647 try { 648 deferred0_0 = arg0; 649 deferred0_1 = arg1; 650 console.error(getStringFromWasm0(arg0, arg1)); 651 } finally { 652 wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1); 653 } 654}; 655 656exports.__wbg_get_6b7bd52aca3f9671 = function(arg0, arg1) { 657 const ret = getObject(arg0)[arg1 >>> 0]; 658 return addHeapObject(ret); 659}; 660 661exports.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) { 662 const ret = Reflect.get(getObject(arg0), getObject(arg1)); 663 return addHeapObject(ret); 664}, arguments) }; 665 666exports.__wbg_get_with_ref_key_1dc361bd10053bfe = function(arg0, arg1) { 667 const ret = getObject(arg0)[getObject(arg1)]; 668 return addHeapObject(ret); 669}; 670 671exports.__wbg_instanceof_ArrayBuffer_f3320d2419cd0355 = function(arg0) { 672 let result; 673 try { 674 result = getObject(arg0) instanceof ArrayBuffer; 675 } catch (_) { 676 result = false; 677 } 678 const ret = result; 679 return ret; 680}; 681 682exports.__wbg_instanceof_Map_084be8da74364158 = function(arg0) { 683 let result; 684 try { 685 result = getObject(arg0) instanceof Map; 686 } catch (_) { 687 result = false; 688 } 689 const ret = result; 690 return ret; 691}; 692 693exports.__wbg_instanceof_Uint8Array_da54ccc9d3e09434 = function(arg0) { 694 let result; 695 try { 696 result = getObject(arg0) instanceof Uint8Array; 697 } catch (_) { 698 result = false; 699 } 700 const ret = result; 701 return ret; 702}; 703 704exports.__wbg_isArray_51fd9e6422c0a395 = function(arg0) { 705 const ret = Array.isArray(getObject(arg0)); 706 return ret; 707}; 708 709exports.__wbg_isSafeInteger_ae7d3f054d55fa16 = function(arg0) { 710 const ret = Number.isSafeInteger(getObject(arg0)); 711 return ret; 712}; 713 714exports.__wbg_iterator_27b7c8b35ab3e86b = function() { 715 const ret = Symbol.iterator; 716 return addHeapObject(ret); 717}; 718 719exports.__wbg_length_22ac23eaec9d8053 = function(arg0) { 720 const ret = getObject(arg0).length; 721 return ret; 722}; 723 724exports.__wbg_length_d45040a40c570362 = function(arg0) { 725 const ret = getObject(arg0).length; 726 return ret; 727}; 728 729exports.__wbg_new_6421f6084cc5bc5a = function(arg0) { 730 const ret = new Uint8Array(getObject(arg0)); 731 return addHeapObject(ret); 732}; 733 734exports.__wbg_new_8a6f238a6ece86ea = function() { 735 const ret = new Error(); 736 return addHeapObject(ret); 737}; 738 739exports.__wbg_next_138a17bbf04e926c = function(arg0) { 740 const ret = getObject(arg0).next; 741 return addHeapObject(ret); 742}; 743 744exports.__wbg_next_3cfe5c0fe2a4cc53 = function() { return handleError(function (arg0) { 745 const ret = getObject(arg0).next(); 746 return addHeapObject(ret); 747}, arguments) }; 748 749exports.__wbg_prototypesetcall_dfe9b766cdc1f1fd = function(arg0, arg1, arg2) { 750 Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2)); 751}; 752 753exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) { 754 const ret = getObject(arg1).stack; 755 const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2); 756 const len1 = WASM_VECTOR_LEN; 757 getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); 758 getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); 759}; 760 761exports.__wbg_value_57b7b035e117f7ee = function(arg0) { 762 const ret = getObject(arg0).value; 763 return addHeapObject(ret); 764}; 765 766exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) { 767 // Cast intrinsic for `Ref(String) -> Externref`. 768 const ret = getStringFromWasm0(arg0, arg1); 769 return addHeapObject(ret); 770}; 771 772exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) { 773 // Cast intrinsic for `U64 -> Externref`. 774 const ret = BigInt.asUintN(64, arg0); 775 return addHeapObject(ret); 776}; 777 778exports.__wbindgen_cast_9ae0607507abb057 = function(arg0) { 779 // Cast intrinsic for `I64 -> Externref`. 780 const ret = arg0; 781 return addHeapObject(ret); 782}; 783 784exports.__wbindgen_object_clone_ref = function(arg0) { 785 const ret = getObject(arg0); 786 return addHeapObject(ret); 787}; 788 789exports.__wbindgen_object_drop_ref = function(arg0) { 790 takeObject(arg0); 791}; 792 793exports.__wbindgen_object_is_undefined = function(arg0) { 794 const ret = getObject(arg0) === undefined; 795 return ret; 796}; 797 798const wasmPath = `${__dirname}/weaver_renderer_bg.wasm`; 799const wasmBytes = require('fs').readFileSync(wasmPath); 800const wasmModule = new WebAssembly.Module(wasmBytes); 801const wasm = exports.__wasm = new WebAssembly.Instance(wasmModule, imports).exports; 802 803wasm.__wbindgen_start();