From e47c587e660f9883bd998e0d8c0d303a4abb4ee3 Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Fri, 5 Jul 2024 17:34:24 +0000 Subject: [PATCH] Update Wasm demo to 6397036 --- bootstrap.js | 22 +- bootstrap.js.map | 2 +- build-info.json | 2 +- ...e.wasm => fe37ecf107365f380ff2.module.wasm | Bin 145169 -> 145129 bytes index_js.bootstrap.js | 217 +++++++++--------- index_js.bootstrap.js.map | 2 +- 6 files changed, 113 insertions(+), 132 deletions(-) rename 93fb6ade6c58efa235b9.module.wasm => fe37ecf107365f380ff2.module.wasm (81%) diff --git a/bootstrap.js b/bootstrap.js index cc93d68..cc85c21 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -31,16 +31,13 @@ __webpack_require__.e(/*! import() */ "index_js").then(__webpack_require__.bind( /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ id: moduleId, -/******/ loaded: false, +/******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ -/******/ // Flag the module as loaded -/******/ module.loaded = true; -/******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } @@ -98,21 +95,6 @@ __webpack_require__.e(/*! import() */ "index_js").then(__webpack_require__.bind( /******/ })(); /******/ })(); /******/ -/******/ /* webpack/runtime/harmony module decorator */ -/******/ (() => { -/******/ __webpack_require__.hmd = (module) => { -/******/ module = Object.create(module); -/******/ if (!module.children) module.children = []; -/******/ Object.defineProperty(module, 'exports', { -/******/ enumerable: true, -/******/ set: () => { -/******/ throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id); -/******/ } -/******/ }); -/******/ return module; -/******/ }; -/******/ })(); -/******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) @@ -437,7 +419,7 @@ __webpack_require__.e(/*! import() */ "index_js").then(__webpack_require__.bind( /******/ promises.push(installedWasmModuleData); /******/ else { /******/ var importObject = wasmImportObjects[wasmModuleId](); -/******/ var req = fetch(__webpack_require__.p + "" + {"index_js":{"../pkg/textwrap_wasm_demo_bg.wasm":"93fb6ade6c58efa235b9"}}[chunkId][wasmModuleId] + ".module.wasm"); +/******/ var req = fetch(__webpack_require__.p + "" + {"index_js":{"../pkg/textwrap_wasm_demo_bg.wasm":"fe37ecf107365f380ff2"}}[chunkId][wasmModuleId] + ".module.wasm"); /******/ var promise; /******/ if(importObject && typeof importObject.then === 'function' && typeof WebAssembly.compileStreaming === 'function') { /******/ promise = Promise.all([WebAssembly.compileStreaming(req), importObject]).then(function(items) { diff --git a/bootstrap.js.map b/bootstrap.js.map index d246236..1e9ca6f 100644 --- a/bootstrap.js.map +++ b/bootstrap.js.map @@ -1 +1 @@ -{"version":3,"file":"bootstrap.js","mappings":";;;;;;;;;AAAA;AACA;AACA;AACA,qIAAoB;AACpB;;;;;;;UCJA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;;;;;WC/BA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,EAAE;WACF;;;;;WCRA;WACA;WACA;WACA;WACA;;;;;WCJA;WACA;WACA;WACA;WACA,GAAG;WACH;WACA;WACA,CAAC;;;;;WCPD;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,EAAE;WACF;WACA;;;;;WCVA;;;;;WCAA;WACA;WACA;WACA;WACA,uBAAuB,4BAA4B;WACnD;WACA;WACA;WACA,iBAAiB,oBAAoB;WACrC;WACA,mGAAmG,YAAY;WAC/G;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,mEAAmE,iCAAiC;WACpG;WACA;WACA;WACA;;;;;WCxCA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WCfA;;WAEA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;WACA,iCAAiC;;WAEjC;WACA;WACA;WACA,KAAK;WACL,eAAe;WACf;WACA;WACA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM;WACN;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;WACA;WACA;;;;;WCrFA;WACA;;WAEA,4BAA4B;;WAE5B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA,EAAE;WACF;;WAEA;WACA;WACA;WACA;WACA;;WAEA;WACA;;WAEA;WACA;;WAEA;;WAEA;WACA;;WAEA;WACA;WACA;WACA;WACA;WACA,iDAAiD,YAAY,4DAA4D;WACzH;WACA;WACA;WACA;WACA,KAAK;WACL,KAAK;WACL;WACA,KAAK;WACL,8CAA8C,yBAAyB;WACvE;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,IAAI;WACJ;WACA,EAAE;WACF;;;;;UE1KA;UACA;UACA;UACA","sources":["webpack://textwrap-wasm-demo-app/./bootstrap.js","webpack://textwrap-wasm-demo-app/webpack/bootstrap","webpack://textwrap-wasm-demo-app/webpack/runtime/define property getters","webpack://textwrap-wasm-demo-app/webpack/runtime/ensure chunk","webpack://textwrap-wasm-demo-app/webpack/runtime/get javascript chunk filename","webpack://textwrap-wasm-demo-app/webpack/runtime/global","webpack://textwrap-wasm-demo-app/webpack/runtime/harmony module decorator","webpack://textwrap-wasm-demo-app/webpack/runtime/hasOwnProperty shorthand","webpack://textwrap-wasm-demo-app/webpack/runtime/load script","webpack://textwrap-wasm-demo-app/webpack/runtime/make namespace object","webpack://textwrap-wasm-demo-app/webpack/runtime/publicPath","webpack://textwrap-wasm-demo-app/webpack/runtime/jsonp chunk loading","webpack://textwrap-wasm-demo-app/webpack/runtime/wasm chunk loading","webpack://textwrap-wasm-demo-app/webpack/before-startup","webpack://textwrap-wasm-demo-app/webpack/startup","webpack://textwrap-wasm-demo-app/webpack/after-startup"],"sourcesContent":["// A dependency graph that contains any wasm must all be imported\n// asynchronously. This `bootstrap.js` file does the single async import, so\n// that no one else needs to worry about it again.\nimport(\"./index.js\")\n .catch(e => console.error(\"Error importing `index.js`:\", e));\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// expose the module cache\n__webpack_require__.c = __webpack_module_cache__;\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".bootstrap.js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.hmd = (module) => {\n\tmodule = Object.create(module);\n\tif (!module.children) module.children = [];\n\tObject.defineProperty(module, 'exports', {\n\t\tenumerable: true,\n\t\tset: () => {\n\t\t\tthrow new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);\n\t\t}\n\t});\n\treturn module;\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var inProgress = {};\nvar dataWebpackPrefix = \"textwrap-wasm-demo-app:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t};\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"main\": 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunktextwrap_wasm_demo_app\"] = self[\"webpackChunktextwrap_wasm_demo_app\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// object to store loaded and loading wasm modules\nvar installedWasmModules = {};\n\nfunction promiseResolve() { return Promise.resolve(); }\n\nvar wasmImportedFuncCache0;\nvar wasmImportedFuncCache1;\nvar wasmImportedFuncCache2;\nvar wasmImportedFuncCache3;\nvar wasmImportedFuncCache4;\nvar wasmImportedFuncCache5;\nvar wasmImportedFuncCache6;\nvar wasmImportedFuncCache7;\nvar wasmImportedFuncCache8;\nvar wasmImportedFuncCache9;\nvar wasmImportedFuncCache10;\nvar wasmImportedFuncCache11;\nvar wasmImportedFuncCache12;\nvar wasmImportedFuncCache13;\nvar wasmImportedFuncCache14;\nvar wasmImportedFuncCache15;\nvar wasmImportedFuncCache16;\nvar wasmImportedFuncCache17;\nvar wasmImportedFuncCache18;\nvar wasmImportedFuncCache19;\nvar wasmImportedFuncCache20;\nvar wasmImportedFuncCache21;\nvar wasmImportedFuncCache22;\nvar wasmImportObjects = {\n\t\"../pkg/textwrap_wasm_demo_bg.wasm\": function() {\n\t\treturn {\n\t\t\t\"./textwrap_wasm_demo_bg.js\": {\n\t\t\t\t\"__wbindgen_object_drop_ref\": function(p0i32) {\n\t\t\t\t\tif(wasmImportedFuncCache0 === undefined) wasmImportedFuncCache0 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache0[\"__wbindgen_object_drop_ref\"](p0i32);\n\t\t\t\t},\n\t\t\t\t\"__wbindgen_string_new\": function(p0i32,p1i32) {\n\t\t\t\t\tif(wasmImportedFuncCache1 === undefined) wasmImportedFuncCache1 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache1[\"__wbindgen_string_new\"](p0i32,p1i32);\n\t\t\t\t},\n\t\t\t\t\"__wbindgen_string_get\": function(p0i32,p1i32) {\n\t\t\t\t\tif(wasmImportedFuncCache2 === undefined) wasmImportedFuncCache2 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache2[\"__wbindgen_string_get\"](p0i32,p1i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_actualBoundingBoxAscent_263891fadd43361b\": function(p0i32) {\n\t\t\t\t\tif(wasmImportedFuncCache3 === undefined) wasmImportedFuncCache3 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache3[\"__wbg_actualBoundingBoxAscent_263891fadd43361b\"](p0i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_actualBoundingBoxDescent_4b0b0ac59e164733\": function(p0i32) {\n\t\t\t\t\tif(wasmImportedFuncCache4 === undefined) wasmImportedFuncCache4 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache4[\"__wbg_actualBoundingBoxDescent_4b0b0ac59e164733\"](p0i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_new_abda76e883ba8a5f\": function() {\n\t\t\t\t\tif(wasmImportedFuncCache5 === undefined) wasmImportedFuncCache5 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache5[\"__wbg_new_abda76e883ba8a5f\"]();\n\t\t\t\t},\n\t\t\t\t\"__wbg_stack_658279fe44541cf6\": function(p0i32,p1i32) {\n\t\t\t\t\tif(wasmImportedFuncCache6 === undefined) wasmImportedFuncCache6 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache6[\"__wbg_stack_658279fe44541cf6\"](p0i32,p1i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_error_f851667af71bcfc6\": function(p0i32,p1i32) {\n\t\t\t\t\tif(wasmImportedFuncCache7 === undefined) wasmImportedFuncCache7 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache7[\"__wbg_error_f851667af71bcfc6\"](p0i32,p1i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_setstrokeStyle_899ea3720dae323b\": function(p0i32,p1i32) {\n\t\t\t\t\tif(wasmImportedFuncCache8 === undefined) wasmImportedFuncCache8 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache8[\"__wbg_setstrokeStyle_899ea3720dae323b\"](p0i32,p1i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_setfont_f55835290596888e\": function(p0i32,p1i32,p2i32) {\n\t\t\t\t\tif(wasmImportedFuncCache9 === undefined) wasmImportedFuncCache9 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache9[\"__wbg_setfont_f55835290596888e\"](p0i32,p1i32,p2i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_settextAlign_2ec9d955460e13ca\": function(p0i32,p1i32,p2i32) {\n\t\t\t\t\tif(wasmImportedFuncCache10 === undefined) wasmImportedFuncCache10 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache10[\"__wbg_settextAlign_2ec9d955460e13ca\"](p0i32,p1i32,p2i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_settextBaseline_d33235cd2782235c\": function(p0i32,p1i32,p2i32) {\n\t\t\t\t\tif(wasmImportedFuncCache11 === undefined) wasmImportedFuncCache11 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache11[\"__wbg_settextBaseline_d33235cd2782235c\"](p0i32,p1i32,p2i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_beginPath_4e91b7092d0d33d9\": function(p0i32) {\n\t\t\t\t\tif(wasmImportedFuncCache12 === undefined) wasmImportedFuncCache12 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache12[\"__wbg_beginPath_4e91b7092d0d33d9\"](p0i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_stroke_85dee7d87c4a6ead\": function(p0i32) {\n\t\t\t\t\tif(wasmImportedFuncCache13 === undefined) wasmImportedFuncCache13 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache13[\"__wbg_stroke_85dee7d87c4a6ead\"](p0i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_lineTo_dbe49320dd6e392a\": function(p0i32,p1f64,p2f64) {\n\t\t\t\t\tif(wasmImportedFuncCache14 === undefined) wasmImportedFuncCache14 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache14[\"__wbg_lineTo_dbe49320dd6e392a\"](p0i32,p1f64,p2f64);\n\t\t\t\t},\n\t\t\t\t\"__wbg_moveTo_15a09390bee05586\": function(p0i32,p1f64,p2f64) {\n\t\t\t\t\tif(wasmImportedFuncCache15 === undefined) wasmImportedFuncCache15 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache15[\"__wbg_moveTo_15a09390bee05586\"](p0i32,p1f64,p2f64);\n\t\t\t\t},\n\t\t\t\t\"__wbg_restore_556d7c38c007b3fe\": function(p0i32) {\n\t\t\t\t\tif(wasmImportedFuncCache16 === undefined) wasmImportedFuncCache16 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache16[\"__wbg_restore_556d7c38c007b3fe\"](p0i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_save_a9bb370fb49c5df7\": function(p0i32) {\n\t\t\t\t\tif(wasmImportedFuncCache17 === undefined) wasmImportedFuncCache17 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache17[\"__wbg_save_a9bb370fb49c5df7\"](p0i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_fillText_e5b1cef36b742bcc\": function(p0i32,p1i32,p2i32,p3f64,p4f64) {\n\t\t\t\t\tif(wasmImportedFuncCache18 === undefined) wasmImportedFuncCache18 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache18[\"__wbg_fillText_e5b1cef36b742bcc\"](p0i32,p1i32,p2i32,p3f64,p4f64);\n\t\t\t\t},\n\t\t\t\t\"__wbg_measureText_734acef1b5e2b3fd\": function(p0i32,p1i32,p2i32) {\n\t\t\t\t\tif(wasmImportedFuncCache19 === undefined) wasmImportedFuncCache19 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache19[\"__wbg_measureText_734acef1b5e2b3fd\"](p0i32,p1i32,p2i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_width_87b8dcd7cafaeec1\": function(p0i32) {\n\t\t\t\t\tif(wasmImportedFuncCache20 === undefined) wasmImportedFuncCache20 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache20[\"__wbg_width_87b8dcd7cafaeec1\"](p0i32);\n\t\t\t\t},\n\t\t\t\t\"__wbindgen_debug_string\": function(p0i32,p1i32) {\n\t\t\t\t\tif(wasmImportedFuncCache21 === undefined) wasmImportedFuncCache21 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache21[\"__wbindgen_debug_string\"](p0i32,p1i32);\n\t\t\t\t},\n\t\t\t\t\"__wbindgen_throw\": function(p0i32,p1i32) {\n\t\t\t\t\tif(wasmImportedFuncCache22 === undefined) wasmImportedFuncCache22 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache22[\"__wbindgen_throw\"](p0i32,p1i32);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t},\n};\n\nvar wasmModuleMap = {\n\t\"index_js\": [\n\t\t\"../pkg/textwrap_wasm_demo_bg.wasm\"\n\t]\n};\n\n// object with all WebAssembly.instance exports\n__webpack_require__.w = {};\n\n// Fetch + compile chunk loading for webassembly\n__webpack_require__.f.wasm = function(chunkId, promises) {\n\n\tvar wasmModules = wasmModuleMap[chunkId] || [];\n\n\twasmModules.forEach(function(wasmModuleId, idx) {\n\t\tvar installedWasmModuleData = installedWasmModules[wasmModuleId];\n\n\t\t// a Promise means \"currently loading\" or \"already loaded\".\n\t\tif(installedWasmModuleData)\n\t\t\tpromises.push(installedWasmModuleData);\n\t\telse {\n\t\t\tvar importObject = wasmImportObjects[wasmModuleId]();\n\t\t\tvar req = fetch(__webpack_require__.p + \"\" + {\"index_js\":{\"../pkg/textwrap_wasm_demo_bg.wasm\":\"93fb6ade6c58efa235b9\"}}[chunkId][wasmModuleId] + \".module.wasm\");\n\t\t\tvar promise;\n\t\t\tif(importObject && typeof importObject.then === 'function' && typeof WebAssembly.compileStreaming === 'function') {\n\t\t\t\tpromise = Promise.all([WebAssembly.compileStreaming(req), importObject]).then(function(items) {\n\t\t\t\t\treturn WebAssembly.instantiate(items[0], items[1]);\n\t\t\t\t});\n\t\t\t} else if(typeof WebAssembly.instantiateStreaming === 'function') {\n\t\t\t\tpromise = WebAssembly.instantiateStreaming(req, importObject);\n\t\t\t} else {\n\t\t\t\tvar bytesPromise = req.then(function(x) { return x.arrayBuffer(); });\n\t\t\t\tpromise = bytesPromise.then(function(bytes) {\n\t\t\t\t\treturn WebAssembly.instantiate(bytes, importObject);\n\t\t\t\t});\n\t\t\t}\n\t\t\tpromises.push(installedWasmModules[wasmModuleId] = promise.then(function(res) {\n\t\t\t\treturn __webpack_require__.w[wasmModuleId] = (res.instance || res).exports;\n\t\t\t}));\n\t\t}\n\t});\n};","","// module cache are used so entry inlining is disabled\n// startup\n// Load entry module and return exports\nvar __webpack_exports__ = __webpack_require__(\"./bootstrap.js\");\n",""],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"bootstrap.js","mappings":";;;;;;;;;AAAA;AACA;AACA;AACA,qIAAoB;AACpB;;;;;;;UCJA;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;;;;;WC5BA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,EAAE;WACF;;;;;WCRA;WACA;WACA;WACA;WACA;;;;;WCJA;WACA;WACA;WACA;WACA,GAAG;WACH;WACA;WACA,CAAC;;;;;WCPD;;;;;WCAA;WACA;WACA;WACA;WACA,uBAAuB,4BAA4B;WACnD;WACA;WACA;WACA,iBAAiB,oBAAoB;WACrC;WACA,mGAAmG,YAAY;WAC/G;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,mEAAmE,iCAAiC;WACpG;WACA;WACA;WACA;;;;;WCxCA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;;;;;WCfA;;WAEA;WACA;WACA;WACA;WACA;WACA;;WAEA;WACA;WACA;WACA,iCAAiC;;WAEjC;WACA;WACA;WACA,KAAK;WACL,eAAe;WACf;WACA;WACA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM;WACN;WACA;WACA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;;WAEA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,MAAM,qBAAqB;WAC3B;WACA;WACA;WACA;WACA;WACA;;WAEA;;WAEA;WACA;WACA;;;;;WCrFA;WACA;;WAEA,4BAA4B;;WAE5B;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,KAAK;WACL;WACA;WACA;WACA;WACA;WACA;WACA,EAAE;WACF;;WAEA;WACA;WACA;WACA;WACA;;WAEA;WACA;;WAEA;WACA;;WAEA;;WAEA;WACA;;WAEA;WACA;WACA;WACA;WACA;WACA,iDAAiD,YAAY,4DAA4D;WACzH;WACA;WACA;WACA;WACA,KAAK;WACL,KAAK;WACL;WACA,KAAK;WACL,8CAA8C,yBAAyB;WACvE;WACA;WACA,KAAK;WACL;WACA;WACA;WACA,IAAI;WACJ;WACA,EAAE;WACF;;;;;UE1KA;UACA;UACA;UACA","sources":["webpack://textwrap-wasm-demo-app/./bootstrap.js","webpack://textwrap-wasm-demo-app/webpack/bootstrap","webpack://textwrap-wasm-demo-app/webpack/runtime/define property getters","webpack://textwrap-wasm-demo-app/webpack/runtime/ensure chunk","webpack://textwrap-wasm-demo-app/webpack/runtime/get javascript chunk filename","webpack://textwrap-wasm-demo-app/webpack/runtime/global","webpack://textwrap-wasm-demo-app/webpack/runtime/hasOwnProperty shorthand","webpack://textwrap-wasm-demo-app/webpack/runtime/load script","webpack://textwrap-wasm-demo-app/webpack/runtime/make namespace object","webpack://textwrap-wasm-demo-app/webpack/runtime/publicPath","webpack://textwrap-wasm-demo-app/webpack/runtime/jsonp chunk loading","webpack://textwrap-wasm-demo-app/webpack/runtime/wasm chunk loading","webpack://textwrap-wasm-demo-app/webpack/before-startup","webpack://textwrap-wasm-demo-app/webpack/startup","webpack://textwrap-wasm-demo-app/webpack/after-startup"],"sourcesContent":["// A dependency graph that contains any wasm must all be imported\n// asynchronously. This `bootstrap.js` file does the single async import, so\n// that no one else needs to worry about it again.\nimport(\"./index.js\")\n .catch(e => console.error(\"Error importing `index.js`:\", e));\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n// expose the module cache\n__webpack_require__.c = __webpack_module_cache__;\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \".bootstrap.js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","var inProgress = {};\nvar dataWebpackPrefix = \"textwrap-wasm-demo-app:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t};\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t\"main\": 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunktextwrap_wasm_demo_app\"] = self[\"webpackChunktextwrap_wasm_demo_app\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// object to store loaded and loading wasm modules\nvar installedWasmModules = {};\n\nfunction promiseResolve() { return Promise.resolve(); }\n\nvar wasmImportedFuncCache0;\nvar wasmImportedFuncCache1;\nvar wasmImportedFuncCache2;\nvar wasmImportedFuncCache3;\nvar wasmImportedFuncCache4;\nvar wasmImportedFuncCache5;\nvar wasmImportedFuncCache6;\nvar wasmImportedFuncCache7;\nvar wasmImportedFuncCache8;\nvar wasmImportedFuncCache9;\nvar wasmImportedFuncCache10;\nvar wasmImportedFuncCache11;\nvar wasmImportedFuncCache12;\nvar wasmImportedFuncCache13;\nvar wasmImportedFuncCache14;\nvar wasmImportedFuncCache15;\nvar wasmImportedFuncCache16;\nvar wasmImportedFuncCache17;\nvar wasmImportedFuncCache18;\nvar wasmImportedFuncCache19;\nvar wasmImportedFuncCache20;\nvar wasmImportedFuncCache21;\nvar wasmImportedFuncCache22;\nvar wasmImportObjects = {\n\t\"../pkg/textwrap_wasm_demo_bg.wasm\": function() {\n\t\treturn {\n\t\t\t\"./textwrap_wasm_demo_bg.js\": {\n\t\t\t\t\"__wbindgen_object_drop_ref\": function(p0i32) {\n\t\t\t\t\tif(wasmImportedFuncCache0 === undefined) wasmImportedFuncCache0 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache0[\"__wbindgen_object_drop_ref\"](p0i32);\n\t\t\t\t},\n\t\t\t\t\"__wbindgen_string_new\": function(p0i32,p1i32) {\n\t\t\t\t\tif(wasmImportedFuncCache1 === undefined) wasmImportedFuncCache1 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache1[\"__wbindgen_string_new\"](p0i32,p1i32);\n\t\t\t\t},\n\t\t\t\t\"__wbindgen_string_get\": function(p0i32,p1i32) {\n\t\t\t\t\tif(wasmImportedFuncCache2 === undefined) wasmImportedFuncCache2 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache2[\"__wbindgen_string_get\"](p0i32,p1i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_actualBoundingBoxAscent_263891fadd43361b\": function(p0i32) {\n\t\t\t\t\tif(wasmImportedFuncCache3 === undefined) wasmImportedFuncCache3 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache3[\"__wbg_actualBoundingBoxAscent_263891fadd43361b\"](p0i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_actualBoundingBoxDescent_4b0b0ac59e164733\": function(p0i32) {\n\t\t\t\t\tif(wasmImportedFuncCache4 === undefined) wasmImportedFuncCache4 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache4[\"__wbg_actualBoundingBoxDescent_4b0b0ac59e164733\"](p0i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_new_abda76e883ba8a5f\": function() {\n\t\t\t\t\tif(wasmImportedFuncCache5 === undefined) wasmImportedFuncCache5 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache5[\"__wbg_new_abda76e883ba8a5f\"]();\n\t\t\t\t},\n\t\t\t\t\"__wbg_stack_658279fe44541cf6\": function(p0i32,p1i32) {\n\t\t\t\t\tif(wasmImportedFuncCache6 === undefined) wasmImportedFuncCache6 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache6[\"__wbg_stack_658279fe44541cf6\"](p0i32,p1i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_error_f851667af71bcfc6\": function(p0i32,p1i32) {\n\t\t\t\t\tif(wasmImportedFuncCache7 === undefined) wasmImportedFuncCache7 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache7[\"__wbg_error_f851667af71bcfc6\"](p0i32,p1i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_setstrokeStyle_899ea3720dae323b\": function(p0i32,p1i32) {\n\t\t\t\t\tif(wasmImportedFuncCache8 === undefined) wasmImportedFuncCache8 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache8[\"__wbg_setstrokeStyle_899ea3720dae323b\"](p0i32,p1i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_setfont_f55835290596888e\": function(p0i32,p1i32,p2i32) {\n\t\t\t\t\tif(wasmImportedFuncCache9 === undefined) wasmImportedFuncCache9 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache9[\"__wbg_setfont_f55835290596888e\"](p0i32,p1i32,p2i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_settextAlign_2ec9d955460e13ca\": function(p0i32,p1i32,p2i32) {\n\t\t\t\t\tif(wasmImportedFuncCache10 === undefined) wasmImportedFuncCache10 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache10[\"__wbg_settextAlign_2ec9d955460e13ca\"](p0i32,p1i32,p2i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_settextBaseline_d33235cd2782235c\": function(p0i32,p1i32,p2i32) {\n\t\t\t\t\tif(wasmImportedFuncCache11 === undefined) wasmImportedFuncCache11 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache11[\"__wbg_settextBaseline_d33235cd2782235c\"](p0i32,p1i32,p2i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_beginPath_4e91b7092d0d33d9\": function(p0i32) {\n\t\t\t\t\tif(wasmImportedFuncCache12 === undefined) wasmImportedFuncCache12 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache12[\"__wbg_beginPath_4e91b7092d0d33d9\"](p0i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_stroke_85dee7d87c4a6ead\": function(p0i32) {\n\t\t\t\t\tif(wasmImportedFuncCache13 === undefined) wasmImportedFuncCache13 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache13[\"__wbg_stroke_85dee7d87c4a6ead\"](p0i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_lineTo_dbe49320dd6e392a\": function(p0i32,p1f64,p2f64) {\n\t\t\t\t\tif(wasmImportedFuncCache14 === undefined) wasmImportedFuncCache14 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache14[\"__wbg_lineTo_dbe49320dd6e392a\"](p0i32,p1f64,p2f64);\n\t\t\t\t},\n\t\t\t\t\"__wbg_moveTo_15a09390bee05586\": function(p0i32,p1f64,p2f64) {\n\t\t\t\t\tif(wasmImportedFuncCache15 === undefined) wasmImportedFuncCache15 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache15[\"__wbg_moveTo_15a09390bee05586\"](p0i32,p1f64,p2f64);\n\t\t\t\t},\n\t\t\t\t\"__wbg_restore_556d7c38c007b3fe\": function(p0i32) {\n\t\t\t\t\tif(wasmImportedFuncCache16 === undefined) wasmImportedFuncCache16 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache16[\"__wbg_restore_556d7c38c007b3fe\"](p0i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_save_a9bb370fb49c5df7\": function(p0i32) {\n\t\t\t\t\tif(wasmImportedFuncCache17 === undefined) wasmImportedFuncCache17 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache17[\"__wbg_save_a9bb370fb49c5df7\"](p0i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_fillText_e5b1cef36b742bcc\": function(p0i32,p1i32,p2i32,p3f64,p4f64) {\n\t\t\t\t\tif(wasmImportedFuncCache18 === undefined) wasmImportedFuncCache18 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache18[\"__wbg_fillText_e5b1cef36b742bcc\"](p0i32,p1i32,p2i32,p3f64,p4f64);\n\t\t\t\t},\n\t\t\t\t\"__wbg_measureText_734acef1b5e2b3fd\": function(p0i32,p1i32,p2i32) {\n\t\t\t\t\tif(wasmImportedFuncCache19 === undefined) wasmImportedFuncCache19 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache19[\"__wbg_measureText_734acef1b5e2b3fd\"](p0i32,p1i32,p2i32);\n\t\t\t\t},\n\t\t\t\t\"__wbg_width_87b8dcd7cafaeec1\": function(p0i32) {\n\t\t\t\t\tif(wasmImportedFuncCache20 === undefined) wasmImportedFuncCache20 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache20[\"__wbg_width_87b8dcd7cafaeec1\"](p0i32);\n\t\t\t\t},\n\t\t\t\t\"__wbindgen_debug_string\": function(p0i32,p1i32) {\n\t\t\t\t\tif(wasmImportedFuncCache21 === undefined) wasmImportedFuncCache21 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache21[\"__wbindgen_debug_string\"](p0i32,p1i32);\n\t\t\t\t},\n\t\t\t\t\"__wbindgen_throw\": function(p0i32,p1i32) {\n\t\t\t\t\tif(wasmImportedFuncCache22 === undefined) wasmImportedFuncCache22 = __webpack_require__.c[\"../pkg/textwrap_wasm_demo_bg.js\"].exports;\n\t\t\t\t\treturn wasmImportedFuncCache22[\"__wbindgen_throw\"](p0i32,p1i32);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t},\n};\n\nvar wasmModuleMap = {\n\t\"index_js\": [\n\t\t\"../pkg/textwrap_wasm_demo_bg.wasm\"\n\t]\n};\n\n// object with all WebAssembly.instance exports\n__webpack_require__.w = {};\n\n// Fetch + compile chunk loading for webassembly\n__webpack_require__.f.wasm = function(chunkId, promises) {\n\n\tvar wasmModules = wasmModuleMap[chunkId] || [];\n\n\twasmModules.forEach(function(wasmModuleId, idx) {\n\t\tvar installedWasmModuleData = installedWasmModules[wasmModuleId];\n\n\t\t// a Promise means \"currently loading\" or \"already loaded\".\n\t\tif(installedWasmModuleData)\n\t\t\tpromises.push(installedWasmModuleData);\n\t\telse {\n\t\t\tvar importObject = wasmImportObjects[wasmModuleId]();\n\t\t\tvar req = fetch(__webpack_require__.p + \"\" + {\"index_js\":{\"../pkg/textwrap_wasm_demo_bg.wasm\":\"fe37ecf107365f380ff2\"}}[chunkId][wasmModuleId] + \".module.wasm\");\n\t\t\tvar promise;\n\t\t\tif(importObject && typeof importObject.then === 'function' && typeof WebAssembly.compileStreaming === 'function') {\n\t\t\t\tpromise = Promise.all([WebAssembly.compileStreaming(req), importObject]).then(function(items) {\n\t\t\t\t\treturn WebAssembly.instantiate(items[0], items[1]);\n\t\t\t\t});\n\t\t\t} else if(typeof WebAssembly.instantiateStreaming === 'function') {\n\t\t\t\tpromise = WebAssembly.instantiateStreaming(req, importObject);\n\t\t\t} else {\n\t\t\t\tvar bytesPromise = req.then(function(x) { return x.arrayBuffer(); });\n\t\t\t\tpromise = bytesPromise.then(function(bytes) {\n\t\t\t\t\treturn WebAssembly.instantiate(bytes, importObject);\n\t\t\t\t});\n\t\t\t}\n\t\t\tpromises.push(installedWasmModules[wasmModuleId] = promise.then(function(res) {\n\t\t\t\treturn __webpack_require__.w[wasmModuleId] = (res.instance || res).exports;\n\t\t\t}));\n\t\t}\n\t});\n};","","// module cache are used so entry inlining is disabled\n// startup\n// Load entry module and return exports\nvar __webpack_exports__ = __webpack_require__(\"./bootstrap.js\");\n",""],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/build-info.json b/build-info.json index bfeb029..88ae434 100644 --- a/build-info.json +++ b/build-info.json @@ -1 +1 @@ -{"date": "2024-06-21", "commit": "39914e0fd7e9af79908c5b9a5cfbb303fe6778e8"} +{"date": "2024-07-05", "commit": "63970361d1d653ec8715acb931c3c109750d4a57"} diff --git a/93fb6ade6c58efa235b9.module.wasm b/fe37ecf107365f380ff2.module.wasm similarity index 81% rename from 93fb6ade6c58efa235b9.module.wasm rename to fe37ecf107365f380ff2.module.wasm index ef89fea754e3f362da7acc619809d2df255eb242..c4224a9a7ee29a9820487556e0e974ea537475eb 100644 GIT binary patch delta 12392 zcmbuF3v^x8b*}f?d!KXmd09ucY|DCi?JZe4dRQ-vND8Ij zTw9XOBV**=3&UFbvDTb(&Bs6In)_V&LiB?lMn~UQ@?W{zzQ1&}^6gJcRsOb@TekYK z(%B>^d&Y|ctzxef7PVjXo06>dbXNO1H0}FMxVL61wW{wW{*G38(HeWaQTyUh`}Py% z$GcS356ywSIy3F)_`!rfp?O$Iys{@3O^IjgORrL)UA}B2n-M~-$r9Rp>E-`w9-_qQkcvWGdCHl2j# z;FMFQ&_kzq1A_7jQ3pKF{B`{uHAGRhlWzQzZ-T`eRPCFvmiSJ;@Ni_}z)@Tz*2OfT zhbh>5EeYLhPh(ymp>kpt-+p*tH{yP6K%WsI6c#k0xDM0Ii@CkEIIq1}31R2xrhc)> z?T34I|BSixzh4&ZMb+{yw671WvZHH9`otWS8lIZp;TUGc{UvaOF9JpT&Fh!Gnq#5; z%-Xx*JvG>(0(-&WcvB#o3esi1i03isuEExZTVE_d2r=IXgRyKpXr zjF=}0XTk{{g|ZS2)#50fP)f4mvnme7k_>Do#Fe7$W#6wm9cj^8k~7|!Wv_)Neog1h zd6Vf4JItAj+)d8BuJ)Rx`^=$3c4F&0RAfKB^-`6eD{uRFW>~}*zZaboUnnfjp$zs^ z#1x|MqR!nBSGIU@gU-h}`)BXiUd)+rI?2ha$mXU7Gtp#g9NCRiy%oI7Z5y9UA6`7Q zqdRB(eNblyxwxpacx0fLY%gb+3-c_3!a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IPPT!r)+my{?l#!l0Hg z*r4^y$*fv7^M3<%&6`)hVCFAEb#}|3xDOKtQV$%^XOq;=1Q~V1njy@02ug#Jn92#< zU>bD>rP}f0mHc&U=1Wi}-(#*Ufw>tM;~#%xzD+tvc4D z7dU5-hx?M8`jAqC_uU?;+f`{kN|HVf)s_0x7!|P#dL*>YNLDBom@}l(9kn zoHQ$3>l7qsn)&^Ly0+YjpvCrvz@_aYZL*qWX<)1yeXGrbE>Ls8MKj{i%-k2ll@0+3%QBopT8YCrhX%`}U zBt%{UO}_7?StWd; z&nj}pDkZN^O<3-dvk7yzEJ$hYmVp@-0wOS}(7blWCz;QW;pCERgPc7P0)23bj;K2K zt~2hbQeT3@pe`y^!9w?&PfE9$xKEwE@y(Rwmk3n$6zE7i<-^%G^`p-vft-^#=;A^l z31&Xkr-nCY%km>*eh6Gl_^l=-fIRb~V7YODFLz7~RW2s0<#%Id-?{08XCCJt-pCNR z0+y3Wq@4ye8$@YEl?Z9v`kwgG>p@E`kM Bs4D;f diff --git a/index_js.bootstrap.js b/index_js.bootstrap.js index b4703b3..0c35657 100644 --- a/index_js.bootstrap.js +++ b/index_js.bootstrap.js @@ -1,11 +1,117 @@ "use strict"; (self["webpackChunktextwrap_wasm_demo_app"] = self["webpackChunktextwrap_wasm_demo_app"] || []).push([["index_js"],{ +/***/ "./index.js": +/*!******************!*\ + !*** ./index.js ***! + \******************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.r(__webpack_exports__); +/* harmony import */ var textwrap_wasm_demo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! textwrap-wasm-demo */ "../pkg/textwrap_wasm_demo.js"); + + +fetch("build-info.json").then(response => response.json()).then(buildInfo => { + if (buildInfo.date && buildInfo.commit) { + document.getElementById("build-date").innerText = buildInfo.date; + + let link = document.createElement("a"); + link.href = `https://github.com/mgeisler/textwrap/commit/${buildInfo.commit}`; + link.innerText = buildInfo.commit.slice(0, 7); + document.getElementById("build-commit").replaceWith(link); + } +}) + +function redraw(event) { + let fontSize = document.getElementById("font-size").valueAsNumber; + let fontFamily = document.getElementById("font-family").value; + let canvas = document.getElementById("canvas"); + let ctx = canvas.getContext("2d"); + + ctx.clearRect(0, 0, canvas.width, canvas.height); + ctx.font = `${fontSize}px ${fontFamily}`; + + let text = document.getElementById("text").value; + let lineWidth = document.getElementById("line-width").valueAsNumber; + let breakWords = document.getElementById("break-words").checked; + let wordSeparator = document.getElementById("word-separator").value; + let wordSplitter = document.getElementById("word-splitter").value; + let wrapAlgorithm = document.getElementById("wrap-algorithm").value; + let penalties = new textwrap_wasm_demo__WEBPACK_IMPORTED_MODULE_0__.WasmPenalties(document.getElementById("nline-penalty").valueAsNumber, + document.getElementById("overflow-penalty").valueAsNumber, + document.getElementById("short-line-fraction").valueAsNumber, + document.getElementById("short-last-line-penalty").valueAsNumber, + document.getElementById("hyphen-penalty").valueAsNumber); + let options = new textwrap_wasm_demo__WEBPACK_IMPORTED_MODULE_0__.WasmOptions(lineWidth, breakWords, wordSeparator, wordSplitter, wrapAlgorithm, penalties); + (0,textwrap_wasm_demo__WEBPACK_IMPORTED_MODULE_0__.draw_wrapped_text)(ctx, options, text, penalties); +} + +document.getElementById("wrap-algorithm").addEventListener("input", (event) => { + let disablePenaltiesParams = (event.target.value == "FirstFit"); + let rangeInputIds = ["nline-penalty", + "overflow-penalty", + "short-line-fraction", + "short-last-line-penalty", + "hyphen-penalty"]; + rangeInputIds.forEach((rangeInputId) => { + let rangeInput = document.getElementById(rangeInputId); + let textInput = document.getElementById(`${rangeInputId}-text`); + rangeInput.disabled = disablePenaltiesParams; + textInput.disabled = disablePenaltiesParams; + }); +}); + + +document.querySelectorAll("input[type=range]").forEach((rangeInput) => { + let textInput = document.getElementById(`${rangeInput.id}-text`); + textInput.min = rangeInput.min; + textInput.max = rangeInput.max; + textInput.value = rangeInput.value; + + rangeInput.addEventListener("input", (event) => { + textInput.value = rangeInput.valueAsNumber; + }); + textInput.addEventListener("input", (event) => { + rangeInput.value = textInput.valueAsNumber; + }); +}); + +document.querySelectorAll("textarea, select, input").forEach((elem) => { + elem.addEventListener("input", redraw); +}); + +window.addEventListener("resize", (event) => { + const X_OFFSET = 8; // To accommodate the size of the slider knob. + + let footer = document.getElementById("footer"); + let canvas = document.getElementById("canvas"); + let width = canvas.parentNode.clientWidth; + + canvas.width = width; + canvas.height = footer.offsetTop - canvas.offsetTop; + + let lineWidth = document.getElementById("line-width"); + let lineWidthText = document.getElementById("line-width-text"); + lineWidth.max = width - 2 * X_OFFSET; + lineWidthText.max = width - 2 * X_OFFSET; + lineWidth.style.width = `${width}px`; + + redraw(); +}); + +let lineWidth = document.getElementById("line-width"); +let lineWidthText = document.getElementById("line-width-text"); +lineWidthText.value = lineWidth.valueAsNumber; +window.dispatchEvent(new Event('resize')); + + +/***/ }), + /***/ "../pkg/textwrap_wasm_demo.js": /*!************************************!*\ !*** ../pkg/textwrap_wasm_demo.js ***! \************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { @@ -46,7 +152,7 @@ __webpack_require__.r(__webpack_exports__); /*!***************************************!*\ !*** ../pkg/textwrap_wasm_demo_bg.js ***! \***************************************/ -/***/ ((module, __webpack_exports__, __webpack_require__) => { +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { @@ -78,7 +184,6 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "draw_wrapped_text": () => (/* binding */ draw_wrapped_text) /* harmony export */ }); /* harmony import */ var _textwrap_wasm_demo_bg_wasm__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./textwrap_wasm_demo_bg.wasm */ "../pkg/textwrap_wasm_demo_bg.wasm"); -/* module decorator */ module = __webpack_require__.hmd(module); const heap = new Array(32).fill(undefined); @@ -644,112 +749,6 @@ function __wbindgen_throw(arg0, arg1) { -/***/ }), - -/***/ "./index.js": -/*!******************!*\ - !*** ./index.js ***! - \******************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -__webpack_require__.r(__webpack_exports__); -/* harmony import */ var textwrap_wasm_demo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! textwrap-wasm-demo */ "../pkg/textwrap_wasm_demo.js"); - - -fetch("build-info.json").then(response => response.json()).then(buildInfo => { - if (buildInfo.date && buildInfo.commit) { - document.getElementById("build-date").innerText = buildInfo.date; - - let link = document.createElement("a"); - link.href = `https://github.com/mgeisler/textwrap/commit/${buildInfo.commit}`; - link.innerText = buildInfo.commit.slice(0, 7); - document.getElementById("build-commit").replaceWith(link); - } -}) - -function redraw(event) { - let fontSize = document.getElementById("font-size").valueAsNumber; - let fontFamily = document.getElementById("font-family").value; - let canvas = document.getElementById("canvas"); - let ctx = canvas.getContext("2d"); - - ctx.clearRect(0, 0, canvas.width, canvas.height); - ctx.font = `${fontSize}px ${fontFamily}`; - - let text = document.getElementById("text").value; - let lineWidth = document.getElementById("line-width").valueAsNumber; - let breakWords = document.getElementById("break-words").checked; - let wordSeparator = document.getElementById("word-separator").value; - let wordSplitter = document.getElementById("word-splitter").value; - let wrapAlgorithm = document.getElementById("wrap-algorithm").value; - let penalties = new textwrap_wasm_demo__WEBPACK_IMPORTED_MODULE_0__.WasmPenalties(document.getElementById("nline-penalty").valueAsNumber, - document.getElementById("overflow-penalty").valueAsNumber, - document.getElementById("short-line-fraction").valueAsNumber, - document.getElementById("short-last-line-penalty").valueAsNumber, - document.getElementById("hyphen-penalty").valueAsNumber); - let options = new textwrap_wasm_demo__WEBPACK_IMPORTED_MODULE_0__.WasmOptions(lineWidth, breakWords, wordSeparator, wordSplitter, wrapAlgorithm, penalties); - (0,textwrap_wasm_demo__WEBPACK_IMPORTED_MODULE_0__.draw_wrapped_text)(ctx, options, text, penalties); -} - -document.getElementById("wrap-algorithm").addEventListener("input", (event) => { - let disablePenaltiesParams = (event.target.value == "FirstFit"); - let rangeInputIds = ["nline-penalty", - "overflow-penalty", - "short-line-fraction", - "short-last-line-penalty", - "hyphen-penalty"]; - rangeInputIds.forEach((rangeInputId) => { - let rangeInput = document.getElementById(rangeInputId); - let textInput = document.getElementById(`${rangeInputId}-text`); - rangeInput.disabled = disablePenaltiesParams; - textInput.disabled = disablePenaltiesParams; - }); -}); - - -document.querySelectorAll("input[type=range]").forEach((rangeInput) => { - let textInput = document.getElementById(`${rangeInput.id}-text`); - textInput.min = rangeInput.min; - textInput.max = rangeInput.max; - textInput.value = rangeInput.value; - - rangeInput.addEventListener("input", (event) => { - textInput.value = rangeInput.valueAsNumber; - }); - textInput.addEventListener("input", (event) => { - rangeInput.value = textInput.valueAsNumber; - }); -}); - -document.querySelectorAll("textarea, select, input").forEach((elem) => { - elem.addEventListener("input", redraw); -}); - -window.addEventListener("resize", (event) => { - const X_OFFSET = 8; // To accommodate the size of the slider knob. - - let footer = document.getElementById("footer"); - let canvas = document.getElementById("canvas"); - let width = canvas.parentNode.clientWidth; - - canvas.width = width; - canvas.height = footer.offsetTop - canvas.offsetTop; - - let lineWidth = document.getElementById("line-width"); - let lineWidthText = document.getElementById("line-width-text"); - lineWidth.max = width - 2 * X_OFFSET; - lineWidthText.max = width - 2 * X_OFFSET; - lineWidth.style.width = `${width}px`; - - redraw(); -}); - -let lineWidth = document.getElementById("line-width"); -let lineWidthText = document.getElementById("line-width-text"); -lineWidthText.value = lineWidth.valueAsNumber; -window.dispatchEvent(new Event('resize')); - - /***/ }), /***/ "../pkg/textwrap_wasm_demo_bg.wasm": diff --git a/index_js.bootstrap.js.map b/index_js.bootstrap.js.map index 42cf863..2af167d 100644 --- a/index_js.bootstrap.js.map +++ b/index_js.bootstrap.js.map @@ -1 +1 @@ -{"version":3,"file":"index_js.bootstrap.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAqD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;AAErD;;AAEA;;AAEA,0BAA0B;;AAE1B;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,oDAAoD,8BAA8B;;AAElF;;AAEA;;AAEA;AACA;AACA,4CAA4C,sEAAkB;AAC9D;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,WAAW,cAAc;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,4CAA4C,sEAAkB;AAC9D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,IAAI;AACvB;AACA;AACA,mBAAmB,IAAI;AACvB;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,6BAA6B,YAAY;AACzC;AACA;AACA;AACA;AACA;AACA,+BAA+B,KAAK;AACpC,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,YAAY;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,kBAAkB,SAAS,IAAI,YAAY,IAAI,UAAU;AACzD;AACA;AACA;AACA;;AAEA;AACA;AACA,gDAAgD,WAAW;AAC3D;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,0BAA0B;AAC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B,cAAc,eAAe;AAC7B;AACA;AACA;AACA;AACA;AACA,oBAAoB,wEAAoB;AACxC;AACA;AACA;AACA;AACA;AACO;;AAEP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,QAAQ,iFAA6B;AACrC;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oBAAoB,8FAA0C;AAC9D;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA,QAAQ,8FAA0C;AAClD;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oBAAoB,iGAA6C;AACjE;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA,QAAQ,iGAA6C;AACrD;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oBAAoB,yGAAqD;AACzE;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA,QAAQ,yGAAqD;AAC7D;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oBAAoB,wGAAoD;AACxE;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA,QAAQ,wGAAoD;AAC5D;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oBAAoB,+FAA2C;AAC/D;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA,QAAQ,+FAA2C;AACnD;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB;AACA;AACA,oBAAoB,0EAAsB;AAC1C;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA,4DAA4D,0EAAsB,EAAE,2EAAuB;AAC3G;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA,wCAAwC,0EAAsB,EAAE,2EAAuB;AACvF;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,MAAM;AACN,QAAQ,wEAAoB;AAC5B;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO,6CAA6C;AACpD;AACA,CAAC;;AAEM,gDAAgD;AACvD;AACA;AACA,CAAC;;AAEM;AACP;AACA;AACA;;AAEO;AACP;AACA,wCAAwC,0EAAsB,EAAE,2EAAuB;AACvF;AACA;AACA;AACA;;AAEO;AACP;AACA;;;;;;;;;;;;;;ACjjBmF;;AAEnF;AACA;AACA;;AAEA;AACA,mEAAmE,iBAAiB;AACpF;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,SAAS,KAAK,WAAW;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,6DAAa;AACrC;AACA;AACA;AACA;AACA,sBAAsB,2DAAW;AACjC,IAAI,qEAAiB;AACrB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,aAAa;AAChE;AACA;AACA,KAAK;AACL,CAAC;;;AAGD;AACA,+CAA+C,cAAc;AAC7D;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA,CAAC;;AAED;AACA,yBAAyB;;AAEzB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,+BAA+B,MAAM;;AAErC;AACA,CAAC;;AAED;AACA;AACA;AACA","sources":["webpack://textwrap-wasm-demo-app/../pkg/textwrap_wasm_demo.js","webpack://textwrap-wasm-demo-app/../pkg/textwrap_wasm_demo_bg.js","webpack://textwrap-wasm-demo-app/./index.js"],"sourcesContent":["import * as wasm from \"./textwrap_wasm_demo_bg.wasm\";\nexport * from \"./textwrap_wasm_demo_bg.js\";","import * as wasm from './textwrap_wasm_demo_bg.wasm';\n\nconst heap = new Array(32).fill(undefined);\n\nheap.push(undefined, null, true, false);\n\nfunction getObject(idx) { return heap[idx]; }\n\nlet heap_next = heap.length;\n\nfunction dropObject(idx) {\n if (idx < 36) return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\n\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n\nconst lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;\n\nlet cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n\ncachedTextDecoder.decode();\n\nlet cachedUint8Memory0 = new Uint8Array();\n\nfunction getUint8Memory0() {\n if (cachedUint8Memory0.byteLength === 0) {\n cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8Memory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));\n}\n\nfunction addHeapObject(obj) {\n if (heap_next === heap.length) heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n\n heap[idx] = obj;\n return idx;\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nconst lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;\n\nlet cachedTextEncoder = new lTextEncoder('utf-8');\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length);\n getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len);\n\n const mem = getUint8Memory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3);\n const view = getUint8Memory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n\nlet cachedInt32Memory0 = new Int32Array();\n\nfunction getInt32Memory0() {\n if (cachedInt32Memory0.byteLength === 0) {\n cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);\n }\n return cachedInt32Memory0;\n}\n\nfunction debugString(val) {\n // primitive types\n const type = typeof val;\n if (type == 'number' || type == 'boolean' || val == null) {\n return `${val}`;\n }\n if (type == 'string') {\n return `\"${val}\"`;\n }\n if (type == 'symbol') {\n const description = val.description;\n if (description == null) {\n return 'Symbol';\n } else {\n return `Symbol(${description})`;\n }\n }\n if (type == 'function') {\n const name = val.name;\n if (typeof name == 'string' && name.length > 0) {\n return `Function(${name})`;\n } else {\n return 'Function';\n }\n }\n // objects\n if (Array.isArray(val)) {\n const length = val.length;\n let debug = '[';\n if (length > 0) {\n debug += debugString(val[0]);\n }\n for(let i = 1; i < length; i++) {\n debug += ', ' + debugString(val[i]);\n }\n debug += ']';\n return debug;\n }\n // Test for built-in\n const builtInMatches = /\\[object ([^\\]]+)\\]/.exec(toString.call(val));\n let className;\n if (builtInMatches.length > 1) {\n className = builtInMatches[1];\n } else {\n // Failed to match the standard '[object ClassName]'\n return toString.call(val);\n }\n if (className == 'Object') {\n // we're a user defined class or Object\n // JSON.stringify avoids problems with cycles, and is generally much\n // easier than looping through ownProperties of `val`.\n try {\n return 'Object(' + JSON.stringify(val) + ')';\n } catch (_) {\n return 'Object';\n }\n }\n // errors\n if (val instanceof Error) {\n return `${val.name}: ${val.message}\\n${val.stack}`;\n }\n // TODO we could test for more things here, like `Set`s and `Map`s.\n return className;\n}\n\nfunction _assertClass(instance, klass) {\n if (!(instance instanceof klass)) {\n throw new Error(`expected instance of ${klass.name}`);\n }\n return instance.ptr;\n}\n\nlet stack_pointer = 32;\n\nfunction addBorrowedObject(obj) {\n if (stack_pointer == 1) throw new Error('out of js stack');\n heap[--stack_pointer] = obj;\n return stack_pointer;\n}\n/**\n* @param {CanvasRenderingContext2D} ctx\n* @param {WasmOptions} options\n* @param {string} text\n*/\nexport function draw_wrapped_text(ctx, options, text) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n _assertClass(options, WasmOptions);\n const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n wasm.draw_wrapped_text(retptr, addBorrowedObject(ctx), options.ptr, ptr0, len0);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n if (r1) {\n throw takeObject(r0);\n }\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n heap[stack_pointer++] = undefined;\n }\n}\n\nfunction handleError(f, args) {\n try {\n return f.apply(this, args);\n } catch (e) {\n wasm.__wbindgen_exn_store(addHeapObject(e));\n }\n}\n/**\n*/\nexport class WasmOptions {\n\n static __wrap(ptr) {\n const obj = Object.create(WasmOptions.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_wasmoptions_free(ptr);\n }\n /**\n * @returns {number}\n */\n get width() {\n const ret = wasm.__wbg_get_wasmoptions_width(this.ptr);\n return ret;\n }\n /**\n * @param {number} arg0\n */\n set width(arg0) {\n wasm.__wbg_set_wasmoptions_width(this.ptr, arg0);\n }\n /**\n * @returns {boolean}\n */\n get break_words() {\n const ret = wasm.__wbg_get_wasmoptions_break_words(this.ptr);\n return ret !== 0;\n }\n /**\n * @param {boolean} arg0\n */\n set break_words(arg0) {\n wasm.__wbg_set_wasmoptions_break_words(this.ptr, arg0);\n }\n /**\n * @returns {any}\n */\n get word_separator() {\n const ret = wasm.__wbg_get_wasmoptions_word_separator(this.ptr);\n return takeObject(ret);\n }\n /**\n * @param {any} arg0\n */\n set word_separator(arg0) {\n wasm.__wbg_set_wasmoptions_word_separator(this.ptr, addHeapObject(arg0));\n }\n /**\n * @returns {any}\n */\n get word_splitter() {\n const ret = wasm.__wbg_get_wasmoptions_word_splitter(this.ptr);\n return takeObject(ret);\n }\n /**\n * @param {any} arg0\n */\n set word_splitter(arg0) {\n wasm.__wbg_set_wasmoptions_word_splitter(this.ptr, addHeapObject(arg0));\n }\n /**\n * @returns {any}\n */\n get wrap_algorithm() {\n const ret = wasm.__wbg_get_wasmoptions_wrap_algorithm(this.ptr);\n return takeObject(ret);\n }\n /**\n * @param {any} arg0\n */\n set wrap_algorithm(arg0) {\n wasm.__wbg_set_wasmoptions_wrap_algorithm(this.ptr, addHeapObject(arg0));\n }\n /**\n * @returns {WasmPenalties}\n */\n get penalties() {\n const ret = wasm.__wbg_get_wasmoptions_penalties(this.ptr);\n return WasmPenalties.__wrap(ret);\n }\n /**\n * @param {WasmPenalties} arg0\n */\n set penalties(arg0) {\n _assertClass(arg0, WasmPenalties);\n var ptr0 = arg0.ptr;\n arg0.ptr = 0;\n wasm.__wbg_set_wasmoptions_penalties(this.ptr, ptr0);\n }\n /**\n * @param {number} width\n * @param {boolean} break_words\n * @param {any} word_separator\n * @param {any} word_splitter\n * @param {any} wrap_algorithm\n * @param {WasmPenalties} penalties\n */\n constructor(width, break_words, word_separator, word_splitter, wrap_algorithm, penalties) {\n _assertClass(penalties, WasmPenalties);\n var ptr0 = penalties.ptr;\n penalties.ptr = 0;\n const ret = wasm.wasmoptions_new(width, break_words, addHeapObject(word_separator), addHeapObject(word_splitter), addHeapObject(wrap_algorithm), ptr0);\n return WasmOptions.__wrap(ret);\n }\n}\n/**\n*/\nexport class WasmPenalties {\n\n static __wrap(ptr) {\n const obj = Object.create(WasmPenalties.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_wasmpenalties_free(ptr);\n }\n /**\n * @returns {number}\n */\n get nline_penalty() {\n const ret = wasm.__wbg_get_wasmpenalties_nline_penalty(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set nline_penalty(arg0) {\n wasm.__wbg_set_wasmpenalties_nline_penalty(this.ptr, arg0);\n }\n /**\n * @returns {number}\n */\n get overflow_penalty() {\n const ret = wasm.__wbg_get_wasmpenalties_overflow_penalty(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set overflow_penalty(arg0) {\n wasm.__wbg_set_wasmpenalties_overflow_penalty(this.ptr, arg0);\n }\n /**\n * @returns {number}\n */\n get short_last_line_fraction() {\n const ret = wasm.__wbg_get_wasmpenalties_short_last_line_fraction(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set short_last_line_fraction(arg0) {\n wasm.__wbg_set_wasmpenalties_short_last_line_fraction(this.ptr, arg0);\n }\n /**\n * @returns {number}\n */\n get short_last_line_penalty() {\n const ret = wasm.__wbg_get_wasmpenalties_short_last_line_penalty(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set short_last_line_penalty(arg0) {\n wasm.__wbg_set_wasmpenalties_short_last_line_penalty(this.ptr, arg0);\n }\n /**\n * @returns {number}\n */\n get hyphen_penalty() {\n const ret = wasm.__wbg_get_wasmpenalties_hyphen_penalty(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set hyphen_penalty(arg0) {\n wasm.__wbg_set_wasmpenalties_hyphen_penalty(this.ptr, arg0);\n }\n /**\n * @param {number} nline_penalty\n * @param {number} overflow_penalty\n * @param {number} short_last_line_fraction\n * @param {number} short_last_line_penalty\n * @param {number} hyphen_penalty\n */\n constructor(nline_penalty, overflow_penalty, short_last_line_fraction, short_last_line_penalty, hyphen_penalty) {\n const ret = wasm.wasmpenalties_new(nline_penalty, overflow_penalty, short_last_line_fraction, short_last_line_penalty, hyphen_penalty);\n return WasmPenalties.__wrap(ret);\n }\n}\n\nexport function __wbindgen_object_drop_ref(arg0) {\n takeObject(arg0);\n};\n\nexport function __wbindgen_string_new(arg0, arg1) {\n const ret = getStringFromWasm0(arg0, arg1);\n return addHeapObject(ret);\n};\n\nexport function __wbindgen_string_get(arg0, arg1) {\n const obj = getObject(arg1);\n const ret = typeof(obj) === 'string' ? obj : undefined;\n var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n getInt32Memory0()[arg0 / 4 + 1] = len0;\n getInt32Memory0()[arg0 / 4 + 0] = ptr0;\n};\n\nexport function __wbg_actualBoundingBoxAscent_263891fadd43361b(arg0) {\n const ret = getObject(arg0).actualBoundingBoxAscent;\n return ret;\n};\n\nexport function __wbg_actualBoundingBoxDescent_4b0b0ac59e164733(arg0) {\n const ret = getObject(arg0).actualBoundingBoxDescent;\n return ret;\n};\n\nexport function __wbg_new_abda76e883ba8a5f() {\n const ret = new Error();\n return addHeapObject(ret);\n};\n\nexport function __wbg_stack_658279fe44541cf6(arg0, arg1) {\n const ret = getObject(arg1).stack;\n const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n getInt32Memory0()[arg0 / 4 + 1] = len0;\n getInt32Memory0()[arg0 / 4 + 0] = ptr0;\n};\n\nexport function __wbg_error_f851667af71bcfc6(arg0, arg1) {\n try {\n console.error(getStringFromWasm0(arg0, arg1));\n } finally {\n wasm.__wbindgen_free(arg0, arg1);\n }\n};\n\nexport function __wbg_setstrokeStyle_899ea3720dae323b(arg0, arg1) {\n getObject(arg0).strokeStyle = getObject(arg1);\n};\n\nexport function __wbg_setfont_f55835290596888e(arg0, arg1, arg2) {\n getObject(arg0).font = getStringFromWasm0(arg1, arg2);\n};\n\nexport function __wbg_settextAlign_2ec9d955460e13ca(arg0, arg1, arg2) {\n getObject(arg0).textAlign = getStringFromWasm0(arg1, arg2);\n};\n\nexport function __wbg_settextBaseline_d33235cd2782235c(arg0, arg1, arg2) {\n getObject(arg0).textBaseline = getStringFromWasm0(arg1, arg2);\n};\n\nexport function __wbg_beginPath_4e91b7092d0d33d9(arg0) {\n getObject(arg0).beginPath();\n};\n\nexport function __wbg_stroke_85dee7d87c4a6ead(arg0) {\n getObject(arg0).stroke();\n};\n\nexport function __wbg_lineTo_dbe49320dd6e392a(arg0, arg1, arg2) {\n getObject(arg0).lineTo(arg1, arg2);\n};\n\nexport function __wbg_moveTo_15a09390bee05586(arg0, arg1, arg2) {\n getObject(arg0).moveTo(arg1, arg2);\n};\n\nexport function __wbg_restore_556d7c38c007b3fe(arg0) {\n getObject(arg0).restore();\n};\n\nexport function __wbg_save_a9bb370fb49c5df7(arg0) {\n getObject(arg0).save();\n};\n\nexport function __wbg_fillText_e5b1cef36b742bcc() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {\n getObject(arg0).fillText(getStringFromWasm0(arg1, arg2), arg3, arg4);\n}, arguments) };\n\nexport function __wbg_measureText_734acef1b5e2b3fd() { return handleError(function (arg0, arg1, arg2) {\n const ret = getObject(arg0).measureText(getStringFromWasm0(arg1, arg2));\n return addHeapObject(ret);\n}, arguments) };\n\nexport function __wbg_width_87b8dcd7cafaeec1(arg0) {\n const ret = getObject(arg0).width;\n return ret;\n};\n\nexport function __wbindgen_debug_string(arg0, arg1) {\n const ret = debugString(getObject(arg1));\n const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n getInt32Memory0()[arg0 / 4 + 1] = len0;\n getInt32Memory0()[arg0 / 4 + 0] = ptr0;\n};\n\nexport function __wbindgen_throw(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n};\n\n","import { draw_wrapped_text, WasmOptions, WasmPenalties } from \"textwrap-wasm-demo\";\n\nfetch(\"build-info.json\").then(response => response.json()).then(buildInfo => {\n if (buildInfo.date && buildInfo.commit) {\n document.getElementById(\"build-date\").innerText = buildInfo.date;\n\n let link = document.createElement(\"a\");\n link.href = `https://github.com/mgeisler/textwrap/commit/${buildInfo.commit}`;\n link.innerText = buildInfo.commit.slice(0, 7);\n document.getElementById(\"build-commit\").replaceWith(link);\n }\n})\n\nfunction redraw(event) {\n let fontSize = document.getElementById(\"font-size\").valueAsNumber;\n let fontFamily = document.getElementById(\"font-family\").value;\n let canvas = document.getElementById(\"canvas\");\n let ctx = canvas.getContext(\"2d\");\n\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.font = `${fontSize}px ${fontFamily}`;\n\n let text = document.getElementById(\"text\").value;\n let lineWidth = document.getElementById(\"line-width\").valueAsNumber;\n let breakWords = document.getElementById(\"break-words\").checked;\n let wordSeparator = document.getElementById(\"word-separator\").value;\n let wordSplitter = document.getElementById(\"word-splitter\").value;\n let wrapAlgorithm = document.getElementById(\"wrap-algorithm\").value;\n let penalties = new WasmPenalties(document.getElementById(\"nline-penalty\").valueAsNumber,\n document.getElementById(\"overflow-penalty\").valueAsNumber,\n document.getElementById(\"short-line-fraction\").valueAsNumber,\n document.getElementById(\"short-last-line-penalty\").valueAsNumber,\n document.getElementById(\"hyphen-penalty\").valueAsNumber);\n let options = new WasmOptions(lineWidth, breakWords, wordSeparator, wordSplitter, wrapAlgorithm, penalties);\n draw_wrapped_text(ctx, options, text, penalties);\n}\n\ndocument.getElementById(\"wrap-algorithm\").addEventListener(\"input\", (event) => {\n let disablePenaltiesParams = (event.target.value == \"FirstFit\");\n let rangeInputIds = [\"nline-penalty\",\n \"overflow-penalty\",\n \"short-line-fraction\",\n \"short-last-line-penalty\",\n \"hyphen-penalty\"];\n rangeInputIds.forEach((rangeInputId) => {\n let rangeInput = document.getElementById(rangeInputId);\n let textInput = document.getElementById(`${rangeInputId}-text`);\n rangeInput.disabled = disablePenaltiesParams;\n textInput.disabled = disablePenaltiesParams;\n });\n});\n\n\ndocument.querySelectorAll(\"input[type=range]\").forEach((rangeInput) => {\n let textInput = document.getElementById(`${rangeInput.id}-text`);\n textInput.min = rangeInput.min;\n textInput.max = rangeInput.max;\n textInput.value = rangeInput.value;\n\n rangeInput.addEventListener(\"input\", (event) => {\n textInput.value = rangeInput.valueAsNumber;\n });\n textInput.addEventListener(\"input\", (event) => {\n rangeInput.value = textInput.valueAsNumber;\n });\n});\n\ndocument.querySelectorAll(\"textarea, select, input\").forEach((elem) => {\n elem.addEventListener(\"input\", redraw);\n});\n\nwindow.addEventListener(\"resize\", (event) => {\n const X_OFFSET = 8; // To accommodate the size of the slider knob.\n\n let footer = document.getElementById(\"footer\");\n let canvas = document.getElementById(\"canvas\");\n let width = canvas.parentNode.clientWidth;\n\n canvas.width = width;\n canvas.height = footer.offsetTop - canvas.offsetTop;\n\n let lineWidth = document.getElementById(\"line-width\");\n let lineWidthText = document.getElementById(\"line-width-text\");\n lineWidth.max = width - 2 * X_OFFSET;\n lineWidthText.max = width - 2 * X_OFFSET;\n lineWidth.style.width = `${width}px`;\n\n redraw();\n});\n\nlet lineWidth = document.getElementById(\"line-width\");\nlet lineWidthText = document.getElementById(\"line-width-text\");\nlineWidthText.value = lineWidth.valueAsNumber;\nwindow.dispatchEvent(new Event('resize'));\n"],"names":[],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"index_js.bootstrap.js","mappings":";;;;;;;;;;;AAAmF;;AAEnF;AACA;AACA;;AAEA;AACA,mEAAmE,iBAAiB;AACpF;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,SAAS,KAAK,WAAW;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,6DAAa;AACrC;AACA;AACA;AACA;AACA,sBAAsB,2DAAW;AACjC,IAAI,qEAAiB;AACrB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,aAAa;AAChE;AACA;AACA,KAAK;AACL,CAAC;;;AAGD;AACA,+CAA+C,cAAc;AAC7D;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,CAAC;;AAED;AACA;AACA,CAAC;;AAED;AACA,yBAAyB;;AAEzB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,+BAA+B,MAAM;;AAErC;AACA,CAAC;;AAED;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC7FqD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;AAErD;;AAEA;;AAEA,0BAA0B;;AAE1B;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,oDAAoD,8BAA8B;;AAElF;;AAEA;;AAEA;AACA;AACA,4CAA4C,sEAAkB;AAC9D;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;;AAEA,WAAW,cAAc;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,4CAA4C,sEAAkB;AAC9D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,IAAI;AACvB;AACA;AACA,mBAAmB,IAAI;AACvB;AACA;AACA;AACA;AACA;AACA,UAAU;AACV,6BAA6B,YAAY;AACzC;AACA;AACA;AACA;AACA;AACA,+BAA+B,KAAK;AACpC,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,YAAY;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA,kBAAkB,SAAS,IAAI,YAAY,IAAI,UAAU;AACzD;AACA;AACA;AACA;;AAEA;AACA;AACA,gDAAgD,WAAW;AAC3D;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,0BAA0B;AACpC,UAAU,aAAa;AACvB,UAAU,QAAQ;AAClB;AACO;AACP;AACA,uBAAuB,wFAAoC;AAC3D;AACA,6CAA6C,0EAAsB,EAAE,2EAAuB;AAC5F;AACA,QAAQ,0EAAsB;AAC9B;AACA;AACA;AACA;AACA;AACA,MAAM;AACN,QAAQ,wFAAoC;AAC5C;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN,QAAQ,6EAAyB;AACjC;AACA;AACA;AACA;AACO;;AAEP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,QAAQ,+EAA2B;AACnC;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oBAAoB,oFAAgC;AACpD;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA,QAAQ,oFAAgC;AACxC;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oBAAoB,0FAAsC;AAC1D;AACA;AACA;AACA,cAAc,SAAS;AACvB;AACA;AACA,QAAQ,0FAAsC;AAC9C;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oBAAoB,6FAAyC;AAC7D;AACA;AACA;AACA,cAAc,KAAK;AACnB;AACA;AACA,QAAQ,6FAAyC;AACjD;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oBAAoB,4FAAwC;AAC5D;AACA;AACA;AACA,cAAc,KAAK;AACnB;AACA;AACA,QAAQ,4FAAwC;AAChD;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oBAAoB,6FAAyC;AAC7D;AACA;AACA;AACA,cAAc,KAAK;AACnB;AACA;AACA,QAAQ,6FAAyC;AACjD;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oBAAoB,wFAAoC;AACxD;AACA;AACA;AACA,cAAc,eAAe;AAC7B;AACA;AACA;AACA;AACA;AACA,QAAQ,wFAAoC;AAC5C;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,SAAS;AACvB,cAAc,KAAK;AACnB,cAAc,KAAK;AACnB,cAAc,KAAK;AACnB,cAAc,eAAe;AAC7B;AACA;AACA;AACA;AACA;AACA,oBAAoB,wEAAoB;AACxC;AACA;AACA;AACA;AACA;AACO;;AAEP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,QAAQ,iFAA6B;AACrC;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oBAAoB,8FAA0C;AAC9D;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA,QAAQ,8FAA0C;AAClD;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oBAAoB,iGAA6C;AACjE;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA,QAAQ,iGAA6C;AACrD;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oBAAoB,yGAAqD;AACzE;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA,QAAQ,yGAAqD;AAC7D;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oBAAoB,wGAAoD;AACxE;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA,QAAQ,wGAAoD;AAC5D;AACA;AACA,gBAAgB;AAChB;AACA;AACA,oBAAoB,+FAA2C;AAC/D;AACA;AACA;AACA,cAAc,QAAQ;AACtB;AACA;AACA,QAAQ,+FAA2C;AACnD;AACA;AACA,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB,cAAc,QAAQ;AACtB;AACA;AACA,oBAAoB,0EAAsB;AAC1C;AACA;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA,4DAA4D,0EAAsB,EAAE,2EAAuB;AAC3G;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA;AACA;;AAEO;AACP;AACA,wCAAwC,0EAAsB,EAAE,2EAAuB;AACvF;AACA;AACA;AACA;;AAEO;AACP;AACA;AACA,MAAM;AACN,QAAQ,wEAAoB;AAC5B;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO;AACP;AACA;;AAEO,6CAA6C;AACpD;AACA,CAAC;;AAEM,gDAAgD;AACvD;AACA;AACA,CAAC;;AAEM;AACP;AACA;AACA;;AAEO;AACP;AACA,wCAAwC,0EAAsB,EAAE,2EAAuB;AACvF;AACA;AACA;AACA;;AAEO;AACP;AACA","sources":["webpack://textwrap-wasm-demo-app/./index.js","webpack://textwrap-wasm-demo-app/../pkg/textwrap_wasm_demo.js","webpack://textwrap-wasm-demo-app/../pkg/textwrap_wasm_demo_bg.js"],"sourcesContent":["import { draw_wrapped_text, WasmOptions, WasmPenalties } from \"textwrap-wasm-demo\";\n\nfetch(\"build-info.json\").then(response => response.json()).then(buildInfo => {\n if (buildInfo.date && buildInfo.commit) {\n document.getElementById(\"build-date\").innerText = buildInfo.date;\n\n let link = document.createElement(\"a\");\n link.href = `https://github.com/mgeisler/textwrap/commit/${buildInfo.commit}`;\n link.innerText = buildInfo.commit.slice(0, 7);\n document.getElementById(\"build-commit\").replaceWith(link);\n }\n})\n\nfunction redraw(event) {\n let fontSize = document.getElementById(\"font-size\").valueAsNumber;\n let fontFamily = document.getElementById(\"font-family\").value;\n let canvas = document.getElementById(\"canvas\");\n let ctx = canvas.getContext(\"2d\");\n\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.font = `${fontSize}px ${fontFamily}`;\n\n let text = document.getElementById(\"text\").value;\n let lineWidth = document.getElementById(\"line-width\").valueAsNumber;\n let breakWords = document.getElementById(\"break-words\").checked;\n let wordSeparator = document.getElementById(\"word-separator\").value;\n let wordSplitter = document.getElementById(\"word-splitter\").value;\n let wrapAlgorithm = document.getElementById(\"wrap-algorithm\").value;\n let penalties = new WasmPenalties(document.getElementById(\"nline-penalty\").valueAsNumber,\n document.getElementById(\"overflow-penalty\").valueAsNumber,\n document.getElementById(\"short-line-fraction\").valueAsNumber,\n document.getElementById(\"short-last-line-penalty\").valueAsNumber,\n document.getElementById(\"hyphen-penalty\").valueAsNumber);\n let options = new WasmOptions(lineWidth, breakWords, wordSeparator, wordSplitter, wrapAlgorithm, penalties);\n draw_wrapped_text(ctx, options, text, penalties);\n}\n\ndocument.getElementById(\"wrap-algorithm\").addEventListener(\"input\", (event) => {\n let disablePenaltiesParams = (event.target.value == \"FirstFit\");\n let rangeInputIds = [\"nline-penalty\",\n \"overflow-penalty\",\n \"short-line-fraction\",\n \"short-last-line-penalty\",\n \"hyphen-penalty\"];\n rangeInputIds.forEach((rangeInputId) => {\n let rangeInput = document.getElementById(rangeInputId);\n let textInput = document.getElementById(`${rangeInputId}-text`);\n rangeInput.disabled = disablePenaltiesParams;\n textInput.disabled = disablePenaltiesParams;\n });\n});\n\n\ndocument.querySelectorAll(\"input[type=range]\").forEach((rangeInput) => {\n let textInput = document.getElementById(`${rangeInput.id}-text`);\n textInput.min = rangeInput.min;\n textInput.max = rangeInput.max;\n textInput.value = rangeInput.value;\n\n rangeInput.addEventListener(\"input\", (event) => {\n textInput.value = rangeInput.valueAsNumber;\n });\n textInput.addEventListener(\"input\", (event) => {\n rangeInput.value = textInput.valueAsNumber;\n });\n});\n\ndocument.querySelectorAll(\"textarea, select, input\").forEach((elem) => {\n elem.addEventListener(\"input\", redraw);\n});\n\nwindow.addEventListener(\"resize\", (event) => {\n const X_OFFSET = 8; // To accommodate the size of the slider knob.\n\n let footer = document.getElementById(\"footer\");\n let canvas = document.getElementById(\"canvas\");\n let width = canvas.parentNode.clientWidth;\n\n canvas.width = width;\n canvas.height = footer.offsetTop - canvas.offsetTop;\n\n let lineWidth = document.getElementById(\"line-width\");\n let lineWidthText = document.getElementById(\"line-width-text\");\n lineWidth.max = width - 2 * X_OFFSET;\n lineWidthText.max = width - 2 * X_OFFSET;\n lineWidth.style.width = `${width}px`;\n\n redraw();\n});\n\nlet lineWidth = document.getElementById(\"line-width\");\nlet lineWidthText = document.getElementById(\"line-width-text\");\nlineWidthText.value = lineWidth.valueAsNumber;\nwindow.dispatchEvent(new Event('resize'));\n","import * as wasm from \"./textwrap_wasm_demo_bg.wasm\";\nexport * from \"./textwrap_wasm_demo_bg.js\";","import * as wasm from './textwrap_wasm_demo_bg.wasm';\n\nconst heap = new Array(32).fill(undefined);\n\nheap.push(undefined, null, true, false);\n\nfunction getObject(idx) { return heap[idx]; }\n\nlet heap_next = heap.length;\n\nfunction dropObject(idx) {\n if (idx < 36) return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\n\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n\nconst lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;\n\nlet cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n\ncachedTextDecoder.decode();\n\nlet cachedUint8Memory0 = new Uint8Array();\n\nfunction getUint8Memory0() {\n if (cachedUint8Memory0.byteLength === 0) {\n cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8Memory0;\n}\n\nfunction getStringFromWasm0(ptr, len) {\n return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));\n}\n\nfunction addHeapObject(obj) {\n if (heap_next === heap.length) heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n\n heap[idx] = obj;\n return idx;\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nconst lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;\n\nlet cachedTextEncoder = new lTextEncoder('utf-8');\n\nconst encodeString = (typeof cachedTextEncoder.encodeInto === 'function'\n ? function (arg, view) {\n return cachedTextEncoder.encodeInto(arg, view);\n}\n : function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n});\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length);\n getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len);\n\n const mem = getUint8Memory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3);\n const view = getUint8Memory0().subarray(ptr + offset, ptr + len);\n const ret = encodeString(arg, view);\n\n offset += ret.written;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n\nlet cachedInt32Memory0 = new Int32Array();\n\nfunction getInt32Memory0() {\n if (cachedInt32Memory0.byteLength === 0) {\n cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);\n }\n return cachedInt32Memory0;\n}\n\nfunction debugString(val) {\n // primitive types\n const type = typeof val;\n if (type == 'number' || type == 'boolean' || val == null) {\n return `${val}`;\n }\n if (type == 'string') {\n return `\"${val}\"`;\n }\n if (type == 'symbol') {\n const description = val.description;\n if (description == null) {\n return 'Symbol';\n } else {\n return `Symbol(${description})`;\n }\n }\n if (type == 'function') {\n const name = val.name;\n if (typeof name == 'string' && name.length > 0) {\n return `Function(${name})`;\n } else {\n return 'Function';\n }\n }\n // objects\n if (Array.isArray(val)) {\n const length = val.length;\n let debug = '[';\n if (length > 0) {\n debug += debugString(val[0]);\n }\n for(let i = 1; i < length; i++) {\n debug += ', ' + debugString(val[i]);\n }\n debug += ']';\n return debug;\n }\n // Test for built-in\n const builtInMatches = /\\[object ([^\\]]+)\\]/.exec(toString.call(val));\n let className;\n if (builtInMatches.length > 1) {\n className = builtInMatches[1];\n } else {\n // Failed to match the standard '[object ClassName]'\n return toString.call(val);\n }\n if (className == 'Object') {\n // we're a user defined class or Object\n // JSON.stringify avoids problems with cycles, and is generally much\n // easier than looping through ownProperties of `val`.\n try {\n return 'Object(' + JSON.stringify(val) + ')';\n } catch (_) {\n return 'Object';\n }\n }\n // errors\n if (val instanceof Error) {\n return `${val.name}: ${val.message}\\n${val.stack}`;\n }\n // TODO we could test for more things here, like `Set`s and `Map`s.\n return className;\n}\n\nfunction _assertClass(instance, klass) {\n if (!(instance instanceof klass)) {\n throw new Error(`expected instance of ${klass.name}`);\n }\n return instance.ptr;\n}\n\nlet stack_pointer = 32;\n\nfunction addBorrowedObject(obj) {\n if (stack_pointer == 1) throw new Error('out of js stack');\n heap[--stack_pointer] = obj;\n return stack_pointer;\n}\n/**\n* @param {CanvasRenderingContext2D} ctx\n* @param {WasmOptions} options\n* @param {string} text\n*/\nexport function draw_wrapped_text(ctx, options, text) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n _assertClass(options, WasmOptions);\n const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n wasm.draw_wrapped_text(retptr, addBorrowedObject(ctx), options.ptr, ptr0, len0);\n var r0 = getInt32Memory0()[retptr / 4 + 0];\n var r1 = getInt32Memory0()[retptr / 4 + 1];\n if (r1) {\n throw takeObject(r0);\n }\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n heap[stack_pointer++] = undefined;\n }\n}\n\nfunction handleError(f, args) {\n try {\n return f.apply(this, args);\n } catch (e) {\n wasm.__wbindgen_exn_store(addHeapObject(e));\n }\n}\n/**\n*/\nexport class WasmOptions {\n\n static __wrap(ptr) {\n const obj = Object.create(WasmOptions.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_wasmoptions_free(ptr);\n }\n /**\n * @returns {number}\n */\n get width() {\n const ret = wasm.__wbg_get_wasmoptions_width(this.ptr);\n return ret;\n }\n /**\n * @param {number} arg0\n */\n set width(arg0) {\n wasm.__wbg_set_wasmoptions_width(this.ptr, arg0);\n }\n /**\n * @returns {boolean}\n */\n get break_words() {\n const ret = wasm.__wbg_get_wasmoptions_break_words(this.ptr);\n return ret !== 0;\n }\n /**\n * @param {boolean} arg0\n */\n set break_words(arg0) {\n wasm.__wbg_set_wasmoptions_break_words(this.ptr, arg0);\n }\n /**\n * @returns {any}\n */\n get word_separator() {\n const ret = wasm.__wbg_get_wasmoptions_word_separator(this.ptr);\n return takeObject(ret);\n }\n /**\n * @param {any} arg0\n */\n set word_separator(arg0) {\n wasm.__wbg_set_wasmoptions_word_separator(this.ptr, addHeapObject(arg0));\n }\n /**\n * @returns {any}\n */\n get word_splitter() {\n const ret = wasm.__wbg_get_wasmoptions_word_splitter(this.ptr);\n return takeObject(ret);\n }\n /**\n * @param {any} arg0\n */\n set word_splitter(arg0) {\n wasm.__wbg_set_wasmoptions_word_splitter(this.ptr, addHeapObject(arg0));\n }\n /**\n * @returns {any}\n */\n get wrap_algorithm() {\n const ret = wasm.__wbg_get_wasmoptions_wrap_algorithm(this.ptr);\n return takeObject(ret);\n }\n /**\n * @param {any} arg0\n */\n set wrap_algorithm(arg0) {\n wasm.__wbg_set_wasmoptions_wrap_algorithm(this.ptr, addHeapObject(arg0));\n }\n /**\n * @returns {WasmPenalties}\n */\n get penalties() {\n const ret = wasm.__wbg_get_wasmoptions_penalties(this.ptr);\n return WasmPenalties.__wrap(ret);\n }\n /**\n * @param {WasmPenalties} arg0\n */\n set penalties(arg0) {\n _assertClass(arg0, WasmPenalties);\n var ptr0 = arg0.ptr;\n arg0.ptr = 0;\n wasm.__wbg_set_wasmoptions_penalties(this.ptr, ptr0);\n }\n /**\n * @param {number} width\n * @param {boolean} break_words\n * @param {any} word_separator\n * @param {any} word_splitter\n * @param {any} wrap_algorithm\n * @param {WasmPenalties} penalties\n */\n constructor(width, break_words, word_separator, word_splitter, wrap_algorithm, penalties) {\n _assertClass(penalties, WasmPenalties);\n var ptr0 = penalties.ptr;\n penalties.ptr = 0;\n const ret = wasm.wasmoptions_new(width, break_words, addHeapObject(word_separator), addHeapObject(word_splitter), addHeapObject(wrap_algorithm), ptr0);\n return WasmOptions.__wrap(ret);\n }\n}\n/**\n*/\nexport class WasmPenalties {\n\n static __wrap(ptr) {\n const obj = Object.create(WasmPenalties.prototype);\n obj.ptr = ptr;\n\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.ptr;\n this.ptr = 0;\n\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_wasmpenalties_free(ptr);\n }\n /**\n * @returns {number}\n */\n get nline_penalty() {\n const ret = wasm.__wbg_get_wasmpenalties_nline_penalty(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set nline_penalty(arg0) {\n wasm.__wbg_set_wasmpenalties_nline_penalty(this.ptr, arg0);\n }\n /**\n * @returns {number}\n */\n get overflow_penalty() {\n const ret = wasm.__wbg_get_wasmpenalties_overflow_penalty(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set overflow_penalty(arg0) {\n wasm.__wbg_set_wasmpenalties_overflow_penalty(this.ptr, arg0);\n }\n /**\n * @returns {number}\n */\n get short_last_line_fraction() {\n const ret = wasm.__wbg_get_wasmpenalties_short_last_line_fraction(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set short_last_line_fraction(arg0) {\n wasm.__wbg_set_wasmpenalties_short_last_line_fraction(this.ptr, arg0);\n }\n /**\n * @returns {number}\n */\n get short_last_line_penalty() {\n const ret = wasm.__wbg_get_wasmpenalties_short_last_line_penalty(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set short_last_line_penalty(arg0) {\n wasm.__wbg_set_wasmpenalties_short_last_line_penalty(this.ptr, arg0);\n }\n /**\n * @returns {number}\n */\n get hyphen_penalty() {\n const ret = wasm.__wbg_get_wasmpenalties_hyphen_penalty(this.ptr);\n return ret >>> 0;\n }\n /**\n * @param {number} arg0\n */\n set hyphen_penalty(arg0) {\n wasm.__wbg_set_wasmpenalties_hyphen_penalty(this.ptr, arg0);\n }\n /**\n * @param {number} nline_penalty\n * @param {number} overflow_penalty\n * @param {number} short_last_line_fraction\n * @param {number} short_last_line_penalty\n * @param {number} hyphen_penalty\n */\n constructor(nline_penalty, overflow_penalty, short_last_line_fraction, short_last_line_penalty, hyphen_penalty) {\n const ret = wasm.wasmpenalties_new(nline_penalty, overflow_penalty, short_last_line_fraction, short_last_line_penalty, hyphen_penalty);\n return WasmPenalties.__wrap(ret);\n }\n}\n\nexport function __wbindgen_object_drop_ref(arg0) {\n takeObject(arg0);\n};\n\nexport function __wbindgen_string_new(arg0, arg1) {\n const ret = getStringFromWasm0(arg0, arg1);\n return addHeapObject(ret);\n};\n\nexport function __wbindgen_string_get(arg0, arg1) {\n const obj = getObject(arg1);\n const ret = typeof(obj) === 'string' ? obj : undefined;\n var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n var len0 = WASM_VECTOR_LEN;\n getInt32Memory0()[arg0 / 4 + 1] = len0;\n getInt32Memory0()[arg0 / 4 + 0] = ptr0;\n};\n\nexport function __wbg_actualBoundingBoxAscent_263891fadd43361b(arg0) {\n const ret = getObject(arg0).actualBoundingBoxAscent;\n return ret;\n};\n\nexport function __wbg_actualBoundingBoxDescent_4b0b0ac59e164733(arg0) {\n const ret = getObject(arg0).actualBoundingBoxDescent;\n return ret;\n};\n\nexport function __wbg_new_abda76e883ba8a5f() {\n const ret = new Error();\n return addHeapObject(ret);\n};\n\nexport function __wbg_stack_658279fe44541cf6(arg0, arg1) {\n const ret = getObject(arg1).stack;\n const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n getInt32Memory0()[arg0 / 4 + 1] = len0;\n getInt32Memory0()[arg0 / 4 + 0] = ptr0;\n};\n\nexport function __wbg_error_f851667af71bcfc6(arg0, arg1) {\n try {\n console.error(getStringFromWasm0(arg0, arg1));\n } finally {\n wasm.__wbindgen_free(arg0, arg1);\n }\n};\n\nexport function __wbg_setstrokeStyle_899ea3720dae323b(arg0, arg1) {\n getObject(arg0).strokeStyle = getObject(arg1);\n};\n\nexport function __wbg_setfont_f55835290596888e(arg0, arg1, arg2) {\n getObject(arg0).font = getStringFromWasm0(arg1, arg2);\n};\n\nexport function __wbg_settextAlign_2ec9d955460e13ca(arg0, arg1, arg2) {\n getObject(arg0).textAlign = getStringFromWasm0(arg1, arg2);\n};\n\nexport function __wbg_settextBaseline_d33235cd2782235c(arg0, arg1, arg2) {\n getObject(arg0).textBaseline = getStringFromWasm0(arg1, arg2);\n};\n\nexport function __wbg_beginPath_4e91b7092d0d33d9(arg0) {\n getObject(arg0).beginPath();\n};\n\nexport function __wbg_stroke_85dee7d87c4a6ead(arg0) {\n getObject(arg0).stroke();\n};\n\nexport function __wbg_lineTo_dbe49320dd6e392a(arg0, arg1, arg2) {\n getObject(arg0).lineTo(arg1, arg2);\n};\n\nexport function __wbg_moveTo_15a09390bee05586(arg0, arg1, arg2) {\n getObject(arg0).moveTo(arg1, arg2);\n};\n\nexport function __wbg_restore_556d7c38c007b3fe(arg0) {\n getObject(arg0).restore();\n};\n\nexport function __wbg_save_a9bb370fb49c5df7(arg0) {\n getObject(arg0).save();\n};\n\nexport function __wbg_fillText_e5b1cef36b742bcc() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {\n getObject(arg0).fillText(getStringFromWasm0(arg1, arg2), arg3, arg4);\n}, arguments) };\n\nexport function __wbg_measureText_734acef1b5e2b3fd() { return handleError(function (arg0, arg1, arg2) {\n const ret = getObject(arg0).measureText(getStringFromWasm0(arg1, arg2));\n return addHeapObject(ret);\n}, arguments) };\n\nexport function __wbg_width_87b8dcd7cafaeec1(arg0) {\n const ret = getObject(arg0).width;\n return ret;\n};\n\nexport function __wbindgen_debug_string(arg0, arg1) {\n const ret = debugString(getObject(arg1));\n const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);\n const len0 = WASM_VECTOR_LEN;\n getInt32Memory0()[arg0 / 4 + 1] = len0;\n getInt32Memory0()[arg0 / 4 + 0] = ptr0;\n};\n\nexport function __wbindgen_throw(arg0, arg1) {\n throw new Error(getStringFromWasm0(arg0, arg1));\n};\n\n"],"names":[],"sourceRoot":""} \ No newline at end of file