diff --git a/dist/cgal_browser.wasm b/dist/cgal_browser.wasm index 82cef883..82e54d2e 100644 Binary files a/dist/cgal_browser.wasm and b/dist/cgal_browser.wasm differ diff --git a/dist/jsxcad-algorithm-cgal.js b/dist/jsxcad-algorithm-cgal.js index 62e99ba0..a64e9d72 100644 --- a/dist/jsxcad-algorithm-cgal.js +++ b/dist/jsxcad-algorithm-cgal.js @@ -1,7 +1,6 @@ import { emit, log, onBoot, isNode } from './jsxcad-sys.js'; import { identityMatrix } from './jsxcad-math-mat4.js'; import { equals } from './jsxcad-math-vec3.js'; -import { getPathEdges } from './jsxcad-geometry.js'; // Copyright Joyent, Inc. and other Node contributors. // @@ -262,10209 +261,28 @@ else if (typeof _exports_$1 === 'object') _exports_$1["Module"] = Module$1; var CgalBrowser = _module_$1.exports; -var Module = (function () { - var _scriptDir = - typeof document !== 'undefined' && document.currentScript - ? document.currentScript.src - : undefined; - if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; - return function (Module) { - Module = Module || {}; - - var Module = typeof Module !== 'undefined' ? Module : {}; - var readyPromiseResolve, readyPromiseReject; - Module['ready'] = new Promise(function (resolve, reject) { - readyPromiseResolve = resolve; - readyPromiseReject = reject; - }); - if (!Object.getOwnPropertyDescriptor(Module['ready'], '_main')) { - Object.defineProperty(Module['ready'], '_main', { - configurable: true, - get: function () { - abort( - 'You are getting _main on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - Object.defineProperty(Module['ready'], '_main', { - configurable: true, - set: function () { - abort( - 'You are setting _main on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - } - if ( - !Object.getOwnPropertyDescriptor( - Module['ready'], - '_emscripten_stack_get_end' - ) - ) { - Object.defineProperty(Module['ready'], '_emscripten_stack_get_end', { - configurable: true, - get: function () { - abort( - 'You are getting _emscripten_stack_get_end on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - Object.defineProperty(Module['ready'], '_emscripten_stack_get_end', { - configurable: true, - set: function () { - abort( - 'You are setting _emscripten_stack_get_end on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - } - if ( - !Object.getOwnPropertyDescriptor( - Module['ready'], - '_emscripten_stack_get_free' - ) - ) { - Object.defineProperty(Module['ready'], '_emscripten_stack_get_free', { - configurable: true, - get: function () { - abort( - 'You are getting _emscripten_stack_get_free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - Object.defineProperty(Module['ready'], '_emscripten_stack_get_free', { - configurable: true, - set: function () { - abort( - 'You are setting _emscripten_stack_get_free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - } - if ( - !Object.getOwnPropertyDescriptor( - Module['ready'], - '_emscripten_stack_init' - ) - ) { - Object.defineProperty(Module['ready'], '_emscripten_stack_init', { - configurable: true, - get: function () { - abort( - 'You are getting _emscripten_stack_init on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - Object.defineProperty(Module['ready'], '_emscripten_stack_init', { - configurable: true, - set: function () { - abort( - 'You are setting _emscripten_stack_init on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - } - if (!Object.getOwnPropertyDescriptor(Module['ready'], '_stackSave')) { - Object.defineProperty(Module['ready'], '_stackSave', { - configurable: true, - get: function () { - abort( - 'You are getting _stackSave on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - Object.defineProperty(Module['ready'], '_stackSave', { - configurable: true, - set: function () { - abort( - 'You are setting _stackSave on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - } - if (!Object.getOwnPropertyDescriptor(Module['ready'], '_stackRestore')) { - Object.defineProperty(Module['ready'], '_stackRestore', { - configurable: true, - get: function () { - abort( - 'You are getting _stackRestore on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - Object.defineProperty(Module['ready'], '_stackRestore', { - configurable: true, - set: function () { - abort( - 'You are setting _stackRestore on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - } - if (!Object.getOwnPropertyDescriptor(Module['ready'], '_stackAlloc')) { - Object.defineProperty(Module['ready'], '_stackAlloc', { - configurable: true, - get: function () { - abort( - 'You are getting _stackAlloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - Object.defineProperty(Module['ready'], '_stackAlloc', { - configurable: true, - set: function () { - abort( - 'You are setting _stackAlloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - } - if ( - !Object.getOwnPropertyDescriptor(Module['ready'], '___wasm_call_ctors') - ) { - Object.defineProperty(Module['ready'], '___wasm_call_ctors', { - configurable: true, - get: function () { - abort( - 'You are getting ___wasm_call_ctors on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - Object.defineProperty(Module['ready'], '___wasm_call_ctors', { - configurable: true, - set: function () { - abort( - 'You are setting ___wasm_call_ctors on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - } - if (!Object.getOwnPropertyDescriptor(Module['ready'], '_fflush')) { - Object.defineProperty(Module['ready'], '_fflush', { - configurable: true, - get: function () { - abort( - 'You are getting _fflush on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - Object.defineProperty(Module['ready'], '_fflush', { - configurable: true, - set: function () { - abort( - 'You are setting _fflush on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - } - if ( - !Object.getOwnPropertyDescriptor(Module['ready'], '___errno_location') - ) { - Object.defineProperty(Module['ready'], '___errno_location', { - configurable: true, - get: function () { - abort( - 'You are getting ___errno_location on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - Object.defineProperty(Module['ready'], '___errno_location', { - configurable: true, - set: function () { - abort( - 'You are setting ___errno_location on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - } - if (!Object.getOwnPropertyDescriptor(Module['ready'], '_malloc')) { - Object.defineProperty(Module['ready'], '_malloc', { - configurable: true, - get: function () { - abort( - 'You are getting _malloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - Object.defineProperty(Module['ready'], '_malloc', { - configurable: true, - set: function () { - abort( - 'You are setting _malloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - } - if (!Object.getOwnPropertyDescriptor(Module['ready'], '_free')) { - Object.defineProperty(Module['ready'], '_free', { - configurable: true, - get: function () { - abort( - 'You are getting _free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - Object.defineProperty(Module['ready'], '_free', { - configurable: true, - set: function () { - abort( - 'You are setting _free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - } - if ( - !Object.getOwnPropertyDescriptor( - Module['ready'], - '___cxa_is_pointer_type' - ) - ) { - Object.defineProperty(Module['ready'], '___cxa_is_pointer_type', { - configurable: true, - get: function () { - abort( - 'You are getting ___cxa_is_pointer_type on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - Object.defineProperty(Module['ready'], '___cxa_is_pointer_type', { - configurable: true, - set: function () { - abort( - 'You are setting ___cxa_is_pointer_type on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - } - if (!Object.getOwnPropertyDescriptor(Module['ready'], '___cxa_can_catch')) { - Object.defineProperty(Module['ready'], '___cxa_can_catch', { - configurable: true, - get: function () { - abort( - 'You are getting ___cxa_can_catch on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - Object.defineProperty(Module['ready'], '___cxa_can_catch', { - configurable: true, - set: function () { - abort( - 'You are setting ___cxa_can_catch on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - } - if (!Object.getOwnPropertyDescriptor(Module['ready'], '_setThrew')) { - Object.defineProperty(Module['ready'], '_setThrew', { - configurable: true, - get: function () { - abort( - 'You are getting _setThrew on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - Object.defineProperty(Module['ready'], '_setThrew', { - configurable: true, - set: function () { - abort( - 'You are setting _setThrew on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - } - if (!Object.getOwnPropertyDescriptor(Module['ready'], '_memset')) { - Object.defineProperty(Module['ready'], '_memset', { - configurable: true, - get: function () { - abort( - 'You are getting _memset on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - Object.defineProperty(Module['ready'], '_memset', { - configurable: true, - set: function () { - abort( - 'You are setting _memset on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - } - if (!Object.getOwnPropertyDescriptor(Module['ready'], '___getTypeName')) { - Object.defineProperty(Module['ready'], '___getTypeName', { - configurable: true, - get: function () { - abort( - 'You are getting ___getTypeName on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - Object.defineProperty(Module['ready'], '___getTypeName', { - configurable: true, - set: function () { - abort( - 'You are setting ___getTypeName on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - } - if ( - !Object.getOwnPropertyDescriptor( - Module['ready'], - '___embind_register_native_and_builtin_types' - ) - ) { - Object.defineProperty( - Module['ready'], - '___embind_register_native_and_builtin_types', - { - configurable: true, - get: function () { - abort( - 'You are getting ___embind_register_native_and_builtin_types on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - } - ); - Object.defineProperty( - Module['ready'], - '___embind_register_native_and_builtin_types', - { - configurable: true, - set: function () { - abort( - 'You are setting ___embind_register_native_and_builtin_types on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - } - ); - } - if ( - !Object.getOwnPropertyDescriptor(Module['ready'], 'onRuntimeInitialized') - ) { - Object.defineProperty(Module['ready'], 'onRuntimeInitialized', { - configurable: true, - get: function () { - abort( - 'You are getting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - Object.defineProperty(Module['ready'], 'onRuntimeInitialized', { - configurable: true, - set: function () { - abort( - 'You are setting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js' - ); - }, - }); - } - var moduleOverrides = {}; - var key; - for (key in Module) { - if (Module.hasOwnProperty(key)) { - moduleOverrides[key] = Module[key]; - } - } - var thisProgram = './this.program'; - var quit_ = function (status, toThrow) { - throw toThrow; - }; - var ENVIRONMENT_IS_WEB = false; - var ENVIRONMENT_IS_WORKER = false; - var ENVIRONMENT_IS_NODE = false; - var ENVIRONMENT_IS_SHELL = false; - ENVIRONMENT_IS_WEB = typeof window === 'object'; - ENVIRONMENT_IS_WORKER = typeof importScripts === 'function'; - ENVIRONMENT_IS_NODE = - typeof process === 'object' && - typeof process.versions === 'object' && - typeof process.versions.node === 'string'; - ENVIRONMENT_IS_SHELL = - !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; - if (Module['ENVIRONMENT']) { - throw new Error( - 'Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)' - ); - } - var scriptDirectory = ''; - function locateFile(path) { - if (Module['locateFile']) { - return Module['locateFile'](path, scriptDirectory); - } - return scriptDirectory + path; - } - var read_, readAsync, readBinary; - var nodeFS; - var nodePath; - if (ENVIRONMENT_IS_NODE) { - if (ENVIRONMENT_IS_WORKER) { - scriptDirectory = _require_path_.dirname(scriptDirectory) + '/'; - } else { - scriptDirectory = __dirname + '/'; - } - read_ = function shell_read(filename, binary) { - if (!nodeFS) nodeFS = _require_crypto_; - if (!nodePath) nodePath = _require_path_; - filename = nodePath['normalize'](filename); - return nodeFS['readFileSync'](filename, binary ? null : 'utf8'); - }; - readBinary = function readBinary(filename) { - var ret = read_(filename, true); - if (!ret.buffer) { - ret = new Uint8Array(ret); - } - assert(ret.buffer); - return ret; - }; - if (process['argv'].length > 1) { - thisProgram = process['argv'][1].replace(/\\/g, '/'); - } - process['argv'].slice(2); - process['on']('uncaughtException', function (ex) { - if (!(ex instanceof ExitStatus)) { - throw ex; - } - }); - process['on']('unhandledRejection', abort); - quit_ = function (status) { - process['exit'](status); - }; - Module['inspect'] = function () { - return '[Emscripten Module object]'; - }; - } else if (ENVIRONMENT_IS_SHELL) { - if (typeof read != 'undefined') { - read_ = function shell_read(f) { - return read(f); - }; - } - readBinary = function readBinary(f) { - var data; - if (typeof readbuffer === 'function') { - return new Uint8Array(readbuffer(f)); - } - data = read(f, 'binary'); - assert(typeof data === 'object'); - return data; - }; - if (typeof scriptArgs != 'undefined') { - scriptArgs; - } - if (typeof quit === 'function') { - quit_ = function (status) { - quit(status); - }; - } - if (typeof print !== 'undefined') { - if (typeof console === 'undefined') console = {}; - console.log = print; - console.warn = console.error = - typeof printErr !== 'undefined' ? printErr : print; - } - } else if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { - if (ENVIRONMENT_IS_WORKER) { - scriptDirectory = self.location.href; - } else if (typeof document !== 'undefined' && document.currentScript) { - scriptDirectory = document.currentScript.src; - } - if (_scriptDir) { - scriptDirectory = _scriptDir; - } - if (scriptDirectory.indexOf('blob:') !== 0) { - scriptDirectory = scriptDirectory.substr( - 0, - scriptDirectory.lastIndexOf('/') + 1 - ); - } else { - scriptDirectory = ''; - } - { - read_ = function (url) { - var xhr = new XMLHttpRequest(); - xhr.open('GET', url, false); - xhr.send(null); - return xhr.responseText; - }; - if (ENVIRONMENT_IS_WORKER) { - readBinary = function (url) { - var xhr = new XMLHttpRequest(); - xhr.open('GET', url, false); - xhr.responseType = 'arraybuffer'; - xhr.send(null); - return new Uint8Array(xhr.response); - }; - } - readAsync = function (url, onload, onerror) { - var xhr = new XMLHttpRequest(); - xhr.open('GET', url, true); - xhr.responseType = 'arraybuffer'; - xhr.onload = function () { - if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) { - onload(xhr.response); - return; - } - onerror(); - }; - xhr.onerror = onerror; - xhr.send(null); - }; - } - } else { - throw new Error('environment detection error'); - } - var out = Module['print'] || console.log.bind(console); - var err = Module['printErr'] || console.warn.bind(console); - for (key in moduleOverrides) { - if (moduleOverrides.hasOwnProperty(key)) { - Module[key] = moduleOverrides[key]; - } - } - moduleOverrides = null; - if (Module['arguments']) ; - if (!Object.getOwnPropertyDescriptor(Module, 'arguments')) { - Object.defineProperty(Module, 'arguments', { - configurable: true, - get: function () { - abort( - 'Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)' - ); - }, - }); - } - if (Module['thisProgram']) thisProgram = Module['thisProgram']; - if (!Object.getOwnPropertyDescriptor(Module, 'thisProgram')) { - Object.defineProperty(Module, 'thisProgram', { - configurable: true, - get: function () { - abort( - 'Module.thisProgram has been replaced with plain thisProgram (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)' - ); - }, - }); - } - if (Module['quit']) quit_ = Module['quit']; - if (!Object.getOwnPropertyDescriptor(Module, 'quit')) { - Object.defineProperty(Module, 'quit', { - configurable: true, - get: function () { - abort( - 'Module.quit has been replaced with plain quit_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)' - ); - }, - }); - } - assert( - typeof Module['memoryInitializerPrefixURL'] === 'undefined', - 'Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead' - ); - assert( - typeof Module['pthreadMainPrefixURL'] === 'undefined', - 'Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead' - ); - assert( - typeof Module['cdInitializerPrefixURL'] === 'undefined', - 'Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead' - ); - assert( - typeof Module['filePackagePrefixURL'] === 'undefined', - 'Module.filePackagePrefixURL option was removed, use Module.locateFile instead' - ); - assert( - typeof Module['read'] === 'undefined', - 'Module.read option was removed (modify read_ in JS)' - ); - assert( - typeof Module['readAsync'] === 'undefined', - 'Module.readAsync option was removed (modify readAsync in JS)' - ); - assert( - typeof Module['readBinary'] === 'undefined', - 'Module.readBinary option was removed (modify readBinary in JS)' - ); - assert( - typeof Module['setWindowTitle'] === 'undefined', - 'Module.setWindowTitle option was removed (modify setWindowTitle in JS)' - ); - assert( - typeof Module['TOTAL_MEMORY'] === 'undefined', - 'Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY' - ); - if (!Object.getOwnPropertyDescriptor(Module, 'read')) { - Object.defineProperty(Module, 'read', { - configurable: true, - get: function () { - abort( - 'Module.read has been replaced with plain read_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)' - ); - }, - }); - } - if (!Object.getOwnPropertyDescriptor(Module, 'readAsync')) { - Object.defineProperty(Module, 'readAsync', { - configurable: true, - get: function () { - abort( - 'Module.readAsync has been replaced with plain readAsync (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)' - ); - }, - }); - } - if (!Object.getOwnPropertyDescriptor(Module, 'readBinary')) { - Object.defineProperty(Module, 'readBinary', { - configurable: true, - get: function () { - abort( - 'Module.readBinary has been replaced with plain readBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)' - ); - }, - }); - } - if (!Object.getOwnPropertyDescriptor(Module, 'setWindowTitle')) { - Object.defineProperty(Module, 'setWindowTitle', { - configurable: true, - get: function () { - abort( - 'Module.setWindowTitle has been replaced with plain setWindowTitle (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)' - ); - }, - }); - } - var STACK_ALIGN = 16; - function alignMemory(size, factor) { - if (!factor) factor = STACK_ALIGN; - return Math.ceil(size / factor) * factor; - } - function warnOnce(text) { - if (!warnOnce.shown) warnOnce.shown = {}; - if (!warnOnce.shown[text]) { - warnOnce.shown[text] = 1; - err(text); - } - } - var tempRet0 = 0; - var setTempRet0 = function (value) { - tempRet0 = value; - }; - var getTempRet0 = function () { - return tempRet0; - }; - var wasmBinary; - if (Module['wasmBinary']) wasmBinary = Module['wasmBinary']; - if (!Object.getOwnPropertyDescriptor(Module, 'wasmBinary')) { - Object.defineProperty(Module, 'wasmBinary', { - configurable: true, - get: function () { - abort( - 'Module.wasmBinary has been replaced with plain wasmBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)' - ); - }, - }); - } - var noExitRuntime = Module['noExitRuntime'] || true; - if (!Object.getOwnPropertyDescriptor(Module, 'noExitRuntime')) { - Object.defineProperty(Module, 'noExitRuntime', { - configurable: true, - get: function () { - abort( - 'Module.noExitRuntime has been replaced with plain noExitRuntime (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)' - ); - }, - }); - } - if (typeof WebAssembly !== 'object') { - abort('no native wasm support detected'); - } - var wasmMemory; - var ABORT = false; - function assert(condition, text) { - if (!condition) { - abort('Assertion failed: ' + text); - } - } - var UTF8Decoder = - typeof TextDecoder !== 'undefined' ? new TextDecoder('utf8') : undefined; - function UTF8ArrayToString(heap, idx, maxBytesToRead) { - var endIdx = idx + maxBytesToRead; - var endPtr = idx; - while (heap[endPtr] && !(endPtr >= endIdx)) ++endPtr; - if (endPtr - idx > 16 && heap.subarray && UTF8Decoder) { - return UTF8Decoder.decode(heap.subarray(idx, endPtr)); - } else { - var str = ''; - while (idx < endPtr) { - var u0 = heap[idx++]; - if (!(u0 & 128)) { - str += String.fromCharCode(u0); - continue; - } - var u1 = heap[idx++] & 63; - if ((u0 & 224) == 192) { - str += String.fromCharCode(((u0 & 31) << 6) | u1); - continue; - } - var u2 = heap[idx++] & 63; - if ((u0 & 240) == 224) { - u0 = ((u0 & 15) << 12) | (u1 << 6) | u2; - } else { - if ((u0 & 248) != 240) - warnOnce( - 'Invalid UTF-8 leading byte 0x' + - u0.toString(16) + - ' encountered when deserializing a UTF-8 string in wasm memory to a JS string!' - ); - u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (heap[idx++] & 63); - } - if (u0 < 65536) { - str += String.fromCharCode(u0); - } else { - var ch = u0 - 65536; - str += String.fromCharCode(55296 | (ch >> 10), 56320 | (ch & 1023)); - } - } - } - return str; - } - function UTF8ToString(ptr, maxBytesToRead) { - return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : ''; - } - function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { - if (!(maxBytesToWrite > 0)) return 0; - var startIdx = outIdx; - var endIdx = outIdx + maxBytesToWrite - 1; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) { - var u1 = str.charCodeAt(++i); - u = (65536 + ((u & 1023) << 10)) | (u1 & 1023); - } - if (u <= 127) { - if (outIdx >= endIdx) break; - heap[outIdx++] = u; - } else if (u <= 2047) { - if (outIdx + 1 >= endIdx) break; - heap[outIdx++] = 192 | (u >> 6); - heap[outIdx++] = 128 | (u & 63); - } else if (u <= 65535) { - if (outIdx + 2 >= endIdx) break; - heap[outIdx++] = 224 | (u >> 12); - heap[outIdx++] = 128 | ((u >> 6) & 63); - heap[outIdx++] = 128 | (u & 63); - } else { - if (outIdx + 3 >= endIdx) break; - if (u >= 2097152) - warnOnce( - 'Invalid Unicode code point 0x' + - u.toString(16) + - ' encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x1FFFFF).' - ); - heap[outIdx++] = 240 | (u >> 18); - heap[outIdx++] = 128 | ((u >> 12) & 63); - heap[outIdx++] = 128 | ((u >> 6) & 63); - heap[outIdx++] = 128 | (u & 63); - } - } - heap[outIdx] = 0; - return outIdx - startIdx; - } - function stringToUTF8(str, outPtr, maxBytesToWrite) { - assert( - typeof maxBytesToWrite == 'number', - 'stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!' - ); - return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); - } - function lengthBytesUTF8(str) { - var len = 0; - for (var i = 0; i < str.length; ++i) { - var u = str.charCodeAt(i); - if (u >= 55296 && u <= 57343) - u = (65536 + ((u & 1023) << 10)) | (str.charCodeAt(++i) & 1023); - if (u <= 127) ++len; - else if (u <= 2047) len += 2; - else if (u <= 65535) len += 3; - else len += 4; - } - return len; - } - var UTF16Decoder = - typeof TextDecoder !== 'undefined' - ? new TextDecoder('utf-16le') - : undefined; - function UTF16ToString(ptr, maxBytesToRead) { - assert( - ptr % 2 == 0, - 'Pointer passed to UTF16ToString must be aligned to two bytes!' - ); - var endPtr = ptr; - var idx = endPtr >> 1; - var maxIdx = idx + maxBytesToRead / 2; - while (!(idx >= maxIdx) && HEAPU16[idx]) ++idx; - endPtr = idx << 1; - if (endPtr - ptr > 32 && UTF16Decoder) { - return UTF16Decoder.decode(HEAPU8.subarray(ptr, endPtr)); - } else { - var str = ''; - for (var i = 0; !(i >= maxBytesToRead / 2); ++i) { - var codeUnit = HEAP16[(ptr + i * 2) >> 1]; - if (codeUnit == 0) break; - str += String.fromCharCode(codeUnit); - } - return str; - } - } - function stringToUTF16(str, outPtr, maxBytesToWrite) { - assert( - outPtr % 2 == 0, - 'Pointer passed to stringToUTF16 must be aligned to two bytes!' - ); - assert( - typeof maxBytesToWrite == 'number', - 'stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!' - ); - if (maxBytesToWrite === undefined) { - maxBytesToWrite = 2147483647; - } - if (maxBytesToWrite < 2) return 0; - maxBytesToWrite -= 2; - var startPtr = outPtr; - var numCharsToWrite = - maxBytesToWrite < str.length * 2 ? maxBytesToWrite / 2 : str.length; - for (var i = 0; i < numCharsToWrite; ++i) { - var codeUnit = str.charCodeAt(i); - HEAP16[outPtr >> 1] = codeUnit; - outPtr += 2; - } - HEAP16[outPtr >> 1] = 0; - return outPtr - startPtr; - } - function lengthBytesUTF16(str) { - return str.length * 2; - } - function UTF32ToString(ptr, maxBytesToRead) { - assert( - ptr % 4 == 0, - 'Pointer passed to UTF32ToString must be aligned to four bytes!' - ); - var i = 0; - var str = ''; - while (!(i >= maxBytesToRead / 4)) { - var utf32 = HEAP32[(ptr + i * 4) >> 2]; - if (utf32 == 0) break; - ++i; - if (utf32 >= 65536) { - var ch = utf32 - 65536; - str += String.fromCharCode(55296 | (ch >> 10), 56320 | (ch & 1023)); - } else { - str += String.fromCharCode(utf32); - } - } - return str; - } - function stringToUTF32(str, outPtr, maxBytesToWrite) { - assert( - outPtr % 4 == 0, - 'Pointer passed to stringToUTF32 must be aligned to four bytes!' - ); - assert( - typeof maxBytesToWrite == 'number', - 'stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!' - ); - if (maxBytesToWrite === undefined) { - maxBytesToWrite = 2147483647; - } - if (maxBytesToWrite < 4) return 0; - var startPtr = outPtr; - var endPtr = startPtr + maxBytesToWrite - 4; - for (var i = 0; i < str.length; ++i) { - var codeUnit = str.charCodeAt(i); - if (codeUnit >= 55296 && codeUnit <= 57343) { - var trailSurrogate = str.charCodeAt(++i); - codeUnit = - (65536 + ((codeUnit & 1023) << 10)) | (trailSurrogate & 1023); - } - HEAP32[outPtr >> 2] = codeUnit; - outPtr += 4; - if (outPtr + 4 > endPtr) break; - } - HEAP32[outPtr >> 2] = 0; - return outPtr - startPtr; - } - function lengthBytesUTF32(str) { - var len = 0; - for (var i = 0; i < str.length; ++i) { - var codeUnit = str.charCodeAt(i); - if (codeUnit >= 55296 && codeUnit <= 57343) ++i; - len += 4; - } - return len; - } - function writeArrayToMemory(array, buffer) { - assert( - array.length >= 0, - 'writeArrayToMemory array must have a length (should be an array or typed array)' - ); - HEAP8.set(array, buffer); - } - function writeAsciiToMemory(str, buffer, dontAddNull) { - for (var i = 0; i < str.length; ++i) { - assert((str.charCodeAt(i) === str.charCodeAt(i)) & 255); - HEAP8[buffer++ >> 0] = str.charCodeAt(i); - } - if (!dontAddNull) HEAP8[buffer >> 0] = 0; - } - function alignUp(x, multiple) { - if (x % multiple > 0) { - x += multiple - (x % multiple); - } - return x; - } - var buffer, - HEAP8, - HEAPU8, - HEAP16, - HEAPU16, - HEAP32, - HEAPU32, - HEAPF32, - HEAPF64; - function updateGlobalBufferAndViews(buf) { - buffer = buf; - Module['HEAP8'] = HEAP8 = new Int8Array(buf); - Module['HEAP16'] = HEAP16 = new Int16Array(buf); - Module['HEAP32'] = HEAP32 = new Int32Array(buf); - Module['HEAPU8'] = HEAPU8 = new Uint8Array(buf); - Module['HEAPU16'] = HEAPU16 = new Uint16Array(buf); - Module['HEAPU32'] = HEAPU32 = new Uint32Array(buf); - Module['HEAPF32'] = HEAPF32 = new Float32Array(buf); - Module['HEAPF64'] = HEAPF64 = new Float64Array(buf); - } - var TOTAL_STACK = 5242880; - if (Module['TOTAL_STACK']) - assert( - TOTAL_STACK === Module['TOTAL_STACK'], - 'the stack size can no longer be determined at runtime' - ); - var INITIAL_MEMORY = Module['INITIAL_MEMORY'] || 16777216; - if (!Object.getOwnPropertyDescriptor(Module, 'INITIAL_MEMORY')) { - Object.defineProperty(Module, 'INITIAL_MEMORY', { - configurable: true, - get: function () { - abort( - 'Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)' - ); - }, - }); - } - assert( - INITIAL_MEMORY >= TOTAL_STACK, - 'INITIAL_MEMORY should be larger than TOTAL_STACK, was ' + - INITIAL_MEMORY + - '! (TOTAL_STACK=' + - TOTAL_STACK + - ')' - ); - assert( - typeof Int32Array !== 'undefined' && - typeof Float64Array !== 'undefined' && - Int32Array.prototype.subarray !== undefined && - Int32Array.prototype.set !== undefined, - 'JS engine does not provide full typed array support' - ); - assert( - !Module['wasmMemory'], - 'Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally' - ); - assert( - INITIAL_MEMORY == 16777216, - 'Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically' - ); - var wasmTable; - function writeStackCookie() { - var max = _emscripten_stack_get_end(); - assert((max & 3) == 0); - HEAPU32[(max >> 2) + 1] = 34821223; - HEAPU32[(max >> 2) + 2] = 2310721022; - HEAP32[0] = 1668509029; - } - function checkStackCookie() { - if (ABORT) return; - var max = _emscripten_stack_get_end(); - var cookie1 = HEAPU32[(max >> 2) + 1]; - var cookie2 = HEAPU32[(max >> 2) + 2]; - if (cookie1 != 34821223 || cookie2 != 2310721022) { - abort( - 'Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x' + - cookie2.toString(16) + - ' ' + - cookie1.toString(16) - ); - } - if (HEAP32[0] !== 1668509029) - abort( - 'Runtime error: The application has corrupted its heap memory area (address zero)!' - ); - } - (function () { - var h16 = new Int16Array(1); - var h8 = new Int8Array(h16.buffer); - h16[0] = 25459; - if (h8[0] !== 115 || h8[1] !== 99) - throw 'Runtime error: expected the system to be little-endian! (Run with -s SUPPORT_BIG_ENDIAN=1 to bypass)'; - })(); - var __ATPRERUN__ = []; - var __ATINIT__ = []; - var __ATPOSTRUN__ = []; - var runtimeInitialized = false; - var runtimeExited = false; - function preRun() { - if (Module['preRun']) { - if (typeof Module['preRun'] == 'function') - Module['preRun'] = [Module['preRun']]; - while (Module['preRun'].length) { - addOnPreRun(Module['preRun'].shift()); - } - } - callRuntimeCallbacks(__ATPRERUN__); - } - function initRuntime() { - checkStackCookie(); - assert(!runtimeInitialized); - runtimeInitialized = true; - if (!Module['noFSInit'] && !FS.init.initialized) FS.init(); - FS.ignorePermissions = false; - callRuntimeCallbacks(__ATINIT__); - } - function exitRuntime() { - checkStackCookie(); - runtimeExited = true; - } - function postRun() { - checkStackCookie(); - if (Module['postRun']) { - if (typeof Module['postRun'] == 'function') - Module['postRun'] = [Module['postRun']]; - while (Module['postRun'].length) { - addOnPostRun(Module['postRun'].shift()); - } - } - callRuntimeCallbacks(__ATPOSTRUN__); - } - function addOnPreRun(cb) { - __ATPRERUN__.unshift(cb); - } - function addOnInit(cb) { - __ATINIT__.unshift(cb); - } - function addOnPostRun(cb) { - __ATPOSTRUN__.unshift(cb); - } - assert( - Math.imul, - 'This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill' - ); - assert( - Math.fround, - 'This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill' - ); - assert( - Math.clz32, - 'This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill' - ); - assert( - Math.trunc, - 'This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill' - ); - var runDependencies = 0; - var runDependencyWatcher = null; - var dependenciesFulfilled = null; - var runDependencyTracking = {}; - function getUniqueRunDependency(id) { - var orig = id; - while (1) { - if (!runDependencyTracking[id]) return id; - id = orig + Math.random(); - } - } - function addRunDependency(id) { - runDependencies++; - if (Module['monitorRunDependencies']) { - Module['monitorRunDependencies'](runDependencies); - } - if (id) { - assert(!runDependencyTracking[id]); - runDependencyTracking[id] = 1; - if ( - runDependencyWatcher === null && - typeof setInterval !== 'undefined' - ) { - runDependencyWatcher = setInterval(function () { - if (ABORT) { - clearInterval(runDependencyWatcher); - runDependencyWatcher = null; - return; - } - var shown = false; - for (var dep in runDependencyTracking) { - if (!shown) { - shown = true; - err('still waiting on run dependencies:'); - } - err('dependency: ' + dep); - } - if (shown) { - err('(end of list)'); - } - }, 1e4); - } - } else { - err('warning: run dependency added without ID'); - } - } - function removeRunDependency(id) { - runDependencies--; - if (Module['monitorRunDependencies']) { - Module['monitorRunDependencies'](runDependencies); - } - if (id) { - assert(runDependencyTracking[id]); - delete runDependencyTracking[id]; - } else { - err('warning: run dependency removed without ID'); - } - if (runDependencies == 0) { - if (runDependencyWatcher !== null) { - clearInterval(runDependencyWatcher); - runDependencyWatcher = null; - } - if (dependenciesFulfilled) { - var callback = dependenciesFulfilled; - dependenciesFulfilled = null; - callback(); - } - } - } - Module['preloadedImages'] = {}; - Module['preloadedAudios'] = {}; - function abort(what) { - if (Module['onAbort']) { - Module['onAbort'](what); - } - what += ''; - err(what); - ABORT = true; - var output = 'abort(' + what + ') at ' + stackTrace(); - what = output; - var e = new WebAssembly.RuntimeError(what); - readyPromiseReject(e); - throw e; - } - var dataURIPrefix = 'data:application/octet-stream;base64,'; - function isDataURI(filename) { - return filename.startsWith(dataURIPrefix); - } - function isFileURI(filename) { - return filename.startsWith('file://'); - } - function createExportWrapper(name, fixedasm) { - return function () { - var displayName = name; - var asm = fixedasm; - if (!fixedasm) { - asm = Module['asm']; - } - assert( - runtimeInitialized, - 'native function `' + - displayName + - '` called before runtime initialization' - ); - assert( - !runtimeExited, - 'native function `' + - displayName + - '` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)' - ); - if (!asm[name]) { - assert( - asm[name], - 'exported native function `' + displayName + '` not found' - ); - } - return asm[name].apply(null, arguments); - }; - } - var wasmBinaryFile; - wasmBinaryFile = 'cgal_node.wasm'; - if (!isDataURI(wasmBinaryFile)) { - wasmBinaryFile = locateFile(wasmBinaryFile); - } - function getBinary(file) { - try { - if (file == wasmBinaryFile && wasmBinary) { - return new Uint8Array(wasmBinary); - } - if (readBinary) { - return readBinary(file); - } else { - throw 'both async and sync fetching of the wasm failed'; - } - } catch (err) { - abort(err); - } - } - function getBinaryPromise() { - if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER)) { - if (typeof fetch === 'function' && !isFileURI(wasmBinaryFile)) { - return fetch(wasmBinaryFile, { credentials: 'same-origin' }) - .then(function (response) { - if (!response['ok']) { - throw ( - "failed to load wasm binary file at '" + wasmBinaryFile + "'" - ); - } - return response['arrayBuffer'](); - }) - .catch(function () { - return getBinary(wasmBinaryFile); - }); - } else { - if (readAsync) { - return new Promise(function (resolve, reject) { - readAsync( - wasmBinaryFile, - function (response) { - resolve(new Uint8Array(response)); - }, - reject - ); - }); - } - } - } - return Promise.resolve().then(function () { - return getBinary(wasmBinaryFile); - }); - } - function createWasm() { - var info = { env: asmLibraryArg, wasi_snapshot_preview1: asmLibraryArg }; - function receiveInstance(instance, module) { - var exports = instance.exports; - Module['asm'] = exports; - wasmMemory = Module['asm']['memory']; - assert(wasmMemory, 'memory not found in wasm exports'); - updateGlobalBufferAndViews(wasmMemory.buffer); - wasmTable = Module['asm']['__indirect_function_table']; - assert(wasmTable, 'table not found in wasm exports'); - addOnInit(Module['asm']['__wasm_call_ctors']); - removeRunDependency('wasm-instantiate'); - } - addRunDependency('wasm-instantiate'); - var trueModule = Module; - function receiveInstantiationResult(result) { - assert( - Module === trueModule, - 'the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?' - ); - trueModule = null; - receiveInstance(result['instance']); - } - function instantiateArrayBuffer(receiver) { - return getBinaryPromise() - .then(function (binary) { - var result = WebAssembly.instantiate(binary, info); - return result; - }) - .then(receiver, function (reason) { - err('failed to asynchronously prepare wasm: ' + reason); - if (isFileURI(wasmBinaryFile)) { - err( - 'warning: Loading from a file URI (' + - wasmBinaryFile + - ') is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing' - ); - } - abort(reason); - }); - } - function instantiateAsync() { - if ( - !wasmBinary && - typeof WebAssembly.instantiateStreaming === 'function' && - !isDataURI(wasmBinaryFile) && - !isFileURI(wasmBinaryFile) && - typeof fetch === 'function' - ) { - return fetch(wasmBinaryFile, { credentials: 'same-origin' }).then( - function (response) { - var result = WebAssembly.instantiateStreaming(response, info); - return result.then(receiveInstantiationResult, function (reason) { - err('wasm streaming compile failed: ' + reason); - err('falling back to ArrayBuffer instantiation'); - return instantiateArrayBuffer(receiveInstantiationResult); - }); - } - ); - } else { - return instantiateArrayBuffer(receiveInstantiationResult); - } - } - if (Module['instantiateWasm']) { - try { - var exports = Module['instantiateWasm'](info, receiveInstance); - return exports; - } catch (e) { - err('Module.instantiateWasm callback failed with error: ' + e); - return false; - } - } - instantiateAsync().catch(readyPromiseReject); - return {}; - } - var tempDouble; - var tempI64; - function callRuntimeCallbacks(callbacks) { - while (callbacks.length > 0) { - var callback = callbacks.shift(); - if (typeof callback == 'function') { - callback(Module); - continue; - } - var func = callback.func; - if (typeof func === 'number') { - if (callback.arg === undefined) { - wasmTable.get(func)(); - } else { - wasmTable.get(func)(callback.arg); - } - } else { - func(callback.arg === undefined ? null : callback.arg); - } - } - } - function demangle(func) { - warnOnce( - 'warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling' - ); - return func; - } - function demangleAll(text) { - var regex = /\b_Z[\w\d_]+/g; - return text.replace(regex, function (x) { - var y = demangle(x); - return x === y ? x : y + ' [' + x + ']'; - }); - } - function jsStackTrace() { - var error = new Error(); - if (!error.stack) { - try { - throw new Error(); - } catch (e) { - error = e; - } - if (!error.stack) { - return '(no stack trace available)'; - } - } - return error.stack.toString(); - } - var runtimeKeepaliveCounter = 0; - function keepRuntimeAlive() { - return noExitRuntime || runtimeKeepaliveCounter > 0; - } - function stackTrace() { - var js = jsStackTrace(); - if (Module['extraStackTrace']) js += '\n' + Module['extraStackTrace'](); - return demangleAll(js); - } - function ___assert_fail(condition, filename, line, func) { - abort( - 'Assertion failed: ' + - UTF8ToString(condition) + - ', at: ' + - [ - filename ? UTF8ToString(filename) : 'unknown filename', - line, - func ? UTF8ToString(func) : 'unknown function', - ] - ); - } - var ExceptionInfoAttrs = { - DESTRUCTOR_OFFSET: 0, - REFCOUNT_OFFSET: 4, - TYPE_OFFSET: 8, - CAUGHT_OFFSET: 12, - RETHROWN_OFFSET: 13, - SIZE: 16, - }; - function ___cxa_allocate_exception(size) { - return _malloc(size + ExceptionInfoAttrs.SIZE) + ExceptionInfoAttrs.SIZE; - } - function _atexit(func, arg) {} - function ___cxa_atexit(a0, a1) { - return _atexit(); - } - function ExceptionInfo(excPtr) { - this.excPtr = excPtr; - this.ptr = excPtr - ExceptionInfoAttrs.SIZE; - this.set_type = function (type) { - HEAP32[(this.ptr + ExceptionInfoAttrs.TYPE_OFFSET) >> 2] = type; - }; - this.get_type = function () { - return HEAP32[(this.ptr + ExceptionInfoAttrs.TYPE_OFFSET) >> 2]; - }; - this.set_destructor = function (destructor) { - HEAP32[(this.ptr + ExceptionInfoAttrs.DESTRUCTOR_OFFSET) >> 2] = - destructor; - }; - this.get_destructor = function () { - return HEAP32[(this.ptr + ExceptionInfoAttrs.DESTRUCTOR_OFFSET) >> 2]; - }; - this.set_refcount = function (refcount) { - HEAP32[(this.ptr + ExceptionInfoAttrs.REFCOUNT_OFFSET) >> 2] = refcount; - }; - this.set_caught = function (caught) { - caught = caught ? 1 : 0; - HEAP8[(this.ptr + ExceptionInfoAttrs.CAUGHT_OFFSET) >> 0] = caught; - }; - this.get_caught = function () { - return HEAP8[(this.ptr + ExceptionInfoAttrs.CAUGHT_OFFSET) >> 0] != 0; - }; - this.set_rethrown = function (rethrown) { - rethrown = rethrown ? 1 : 0; - HEAP8[(this.ptr + ExceptionInfoAttrs.RETHROWN_OFFSET) >> 0] = rethrown; - }; - this.get_rethrown = function () { - return HEAP8[(this.ptr + ExceptionInfoAttrs.RETHROWN_OFFSET) >> 0] != 0; - }; - this.init = function (type, destructor) { - this.set_type(type); - this.set_destructor(destructor); - this.set_refcount(0); - this.set_caught(false); - this.set_rethrown(false); - }; - this.add_ref = function () { - var value = - HEAP32[(this.ptr + ExceptionInfoAttrs.REFCOUNT_OFFSET) >> 2]; - HEAP32[(this.ptr + ExceptionInfoAttrs.REFCOUNT_OFFSET) >> 2] = - value + 1; - }; - this.release_ref = function () { - var prev = HEAP32[(this.ptr + ExceptionInfoAttrs.REFCOUNT_OFFSET) >> 2]; - HEAP32[(this.ptr + ExceptionInfoAttrs.REFCOUNT_OFFSET) >> 2] = prev - 1; - assert(prev > 0); - return prev === 1; - }; - } - function CatchInfo(ptr) { - this.free = function () { - _free(this.ptr); - this.ptr = 0; - }; - this.set_base_ptr = function (basePtr) { - HEAP32[this.ptr >> 2] = basePtr; - }; - this.get_base_ptr = function () { - return HEAP32[this.ptr >> 2]; - }; - this.set_adjusted_ptr = function (adjustedPtr) { - var ptrSize = 4; - HEAP32[(this.ptr + ptrSize) >> 2] = adjustedPtr; - }; - this.get_adjusted_ptr = function () { - var ptrSize = 4; - return HEAP32[(this.ptr + ptrSize) >> 2]; - }; - this.get_exception_ptr = function () { - var isPointer = ___cxa_is_pointer_type( - this.get_exception_info().get_type() - ); - if (isPointer) { - return HEAP32[this.get_base_ptr() >> 2]; - } - var adjusted = this.get_adjusted_ptr(); - if (adjusted !== 0) return adjusted; - return this.get_base_ptr(); - }; - this.get_exception_info = function () { - return new ExceptionInfo(this.get_base_ptr()); - }; - if (ptr === undefined) { - this.ptr = _malloc(8); - this.set_adjusted_ptr(0); - } else { - this.ptr = ptr; - } - } - var exceptionCaught = []; - function exception_addRef(info) { - info.add_ref(); - } - var uncaughtExceptionCount = 0; - function ___cxa_begin_catch(ptr) { - var catchInfo = new CatchInfo(ptr); - var info = catchInfo.get_exception_info(); - if (!info.get_caught()) { - info.set_caught(true); - uncaughtExceptionCount--; - } - info.set_rethrown(false); - exceptionCaught.push(catchInfo); - exception_addRef(info); - return catchInfo.get_exception_ptr(); - } - var exceptionLast = 0; - function ___cxa_free_exception(ptr) { - try { - return _free(new ExceptionInfo(ptr).ptr); - } catch (e) { - err('exception during cxa_free_exception: ' + e); - } - } - function exception_decRef(info) { - if (info.release_ref() && !info.get_rethrown()) { - var destructor = info.get_destructor(); - if (destructor) { - wasmTable.get(destructor)(info.excPtr); - } - ___cxa_free_exception(info.excPtr); - } - } - function ___cxa_end_catch() { - _setThrew(0); - assert(exceptionCaught.length > 0); - var catchInfo = exceptionCaught.pop(); - exception_decRef(catchInfo.get_exception_info()); - catchInfo.free(); - exceptionLast = 0; - } - function ___resumeException(catchInfoPtr) { - var catchInfo = new CatchInfo(catchInfoPtr); - var ptr = catchInfo.get_base_ptr(); - if (!exceptionLast) { - exceptionLast = ptr; - } - catchInfo.free(); - throw ptr; - } - function ___cxa_find_matching_catch_2() { - var thrown = exceptionLast; - if (!thrown) { - setTempRet0(0); - return 0 | 0; - } - var info = new ExceptionInfo(thrown); - var thrownType = info.get_type(); - var catchInfo = new CatchInfo(); - catchInfo.set_base_ptr(thrown); - if (!thrownType) { - setTempRet0(0); - return catchInfo.ptr | 0; - } - var typeArray = Array.prototype.slice.call(arguments); - var stackTop = stackSave(); - var exceptionThrowBuf = stackAlloc(4); - HEAP32[exceptionThrowBuf >> 2] = thrown; - for (var i = 0; i < typeArray.length; i++) { - var caughtType = typeArray[i]; - if (caughtType === 0 || caughtType === thrownType) { - break; - } - if (___cxa_can_catch(caughtType, thrownType, exceptionThrowBuf)) { - var adjusted = HEAP32[exceptionThrowBuf >> 2]; - if (thrown !== adjusted) { - catchInfo.set_adjusted_ptr(adjusted); - } - setTempRet0(caughtType); - return catchInfo.ptr | 0; - } - } - stackRestore(stackTop); - setTempRet0(thrownType); - return catchInfo.ptr | 0; - } - function ___cxa_find_matching_catch_3() { - var thrown = exceptionLast; - if (!thrown) { - setTempRet0(0); - return 0 | 0; - } - var info = new ExceptionInfo(thrown); - var thrownType = info.get_type(); - var catchInfo = new CatchInfo(); - catchInfo.set_base_ptr(thrown); - if (!thrownType) { - setTempRet0(0); - return catchInfo.ptr | 0; - } - var typeArray = Array.prototype.slice.call(arguments); - var stackTop = stackSave(); - var exceptionThrowBuf = stackAlloc(4); - HEAP32[exceptionThrowBuf >> 2] = thrown; - for (var i = 0; i < typeArray.length; i++) { - var caughtType = typeArray[i]; - if (caughtType === 0 || caughtType === thrownType) { - break; - } - if (___cxa_can_catch(caughtType, thrownType, exceptionThrowBuf)) { - var adjusted = HEAP32[exceptionThrowBuf >> 2]; - if (thrown !== adjusted) { - catchInfo.set_adjusted_ptr(adjusted); - } - setTempRet0(caughtType); - return catchInfo.ptr | 0; - } - } - stackRestore(stackTop); - setTempRet0(thrownType); - return catchInfo.ptr | 0; - } - function ___cxa_rethrow() { - var catchInfo = exceptionCaught.pop(); - if (!catchInfo) { - abort('no exception to throw'); - } - var info = catchInfo.get_exception_info(); - var ptr = catchInfo.get_base_ptr(); - if (!info.get_rethrown()) { - exceptionCaught.push(catchInfo); - info.set_rethrown(true); - info.set_caught(false); - uncaughtExceptionCount++; - } else { - catchInfo.free(); - } - exceptionLast = ptr; - throw ptr; - } - function ___cxa_thread_atexit(a0, a1) { - return _atexit(); - } - function ___cxa_throw(ptr, type, destructor) { - var info = new ExceptionInfo(ptr); - info.init(type, destructor); - exceptionLast = ptr; - uncaughtExceptionCount++; - throw ptr; - } - function ___cxa_uncaught_exceptions() { - return uncaughtExceptionCount; - } - var PATH = { - splitPath: function (filename) { - var splitPathRe = - /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; - return splitPathRe.exec(filename).slice(1); - }, - normalizeArray: function (parts, allowAboveRoot) { - var up = 0; - for (var i = parts.length - 1; i >= 0; i--) { - var last = parts[i]; - if (last === '.') { - parts.splice(i, 1); - } else if (last === '..') { - parts.splice(i, 1); - up++; - } else if (up) { - parts.splice(i, 1); - up--; - } - } - if (allowAboveRoot) { - for (; up; up--) { - parts.unshift('..'); - } - } - return parts; - }, - normalize: function (path) { - var isAbsolute = path.charAt(0) === '/', - trailingSlash = path.substr(-1) === '/'; - path = PATH.normalizeArray( - path.split('/').filter(function (p) { - return !!p; - }), - !isAbsolute - ).join('/'); - if (!path && !isAbsolute) { - path = '.'; - } - if (path && trailingSlash) { - path += '/'; - } - return (isAbsolute ? '/' : '') + path; - }, - dirname: function (path) { - var result = PATH.splitPath(path), - root = result[0], - dir = result[1]; - if (!root && !dir) { - return '.'; - } - if (dir) { - dir = dir.substr(0, dir.length - 1); - } - return root + dir; - }, - basename: function (path) { - if (path === '/') return '/'; - path = PATH.normalize(path); - path = path.replace(/\/$/, ''); - var lastSlash = path.lastIndexOf('/'); - if (lastSlash === -1) return path; - return path.substr(lastSlash + 1); - }, - extname: function (path) { - return PATH.splitPath(path)[3]; - }, - join: function () { - var paths = Array.prototype.slice.call(arguments, 0); - return PATH.normalize(paths.join('/')); - }, - join2: function (l, r) { - return PATH.normalize(l + '/' + r); - }, - }; - function getRandomDevice() { - if ( - typeof crypto === 'object' && - typeof crypto['getRandomValues'] === 'function' - ) { - var randomBuffer = new Uint8Array(1); - return function () { - crypto.getRandomValues(randomBuffer); - return randomBuffer[0]; - }; - } else if (ENVIRONMENT_IS_NODE) { - try { - var crypto_module = _require_crypto_; - return function () { - return crypto_module['randomBytes'](1)[0]; - }; - } catch (e) {} - } - return function () { - abort( - 'no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };' - ); - }; - } - var PATH_FS = { - resolve: function () { - var resolvedPath = '', - resolvedAbsolute = false; - for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { - var path = i >= 0 ? arguments[i] : FS.cwd(); - if (typeof path !== 'string') { - throw new TypeError('Arguments to path.resolve must be strings'); - } else if (!path) { - return ''; - } - resolvedPath = path + '/' + resolvedPath; - resolvedAbsolute = path.charAt(0) === '/'; - } - resolvedPath = PATH.normalizeArray( - resolvedPath.split('/').filter(function (p) { - return !!p; - }), - !resolvedAbsolute - ).join('/'); - return (resolvedAbsolute ? '/' : '') + resolvedPath || '.'; - }, - relative: function (from, to) { - from = PATH_FS.resolve(from).substr(1); - to = PATH_FS.resolve(to).substr(1); - function trim(arr) { - var start = 0; - for (; start < arr.length; start++) { - if (arr[start] !== '') break; - } - var end = arr.length - 1; - for (; end >= 0; end--) { - if (arr[end] !== '') break; - } - if (start > end) return []; - return arr.slice(start, end - start + 1); - } - var fromParts = trim(from.split('/')); - var toParts = trim(to.split('/')); - var length = Math.min(fromParts.length, toParts.length); - var samePartsLength = length; - for (var i = 0; i < length; i++) { - if (fromParts[i] !== toParts[i]) { - samePartsLength = i; - break; - } - } - var outputParts = []; - for (var i = samePartsLength; i < fromParts.length; i++) { - outputParts.push('..'); - } - outputParts = outputParts.concat(toParts.slice(samePartsLength)); - return outputParts.join('/'); - }, - }; - var TTY = { - ttys: [], - init: function () {}, - shutdown: function () {}, - register: function (dev, ops) { - TTY.ttys[dev] = { input: [], output: [], ops: ops }; - FS.registerDevice(dev, TTY.stream_ops); - }, - stream_ops: { - open: function (stream) { - var tty = TTY.ttys[stream.node.rdev]; - if (!tty) { - throw new FS.ErrnoError(43); - } - stream.tty = tty; - stream.seekable = false; - }, - close: function (stream) { - stream.tty.ops.flush(stream.tty); - }, - flush: function (stream) { - stream.tty.ops.flush(stream.tty); - }, - read: function (stream, buffer, offset, length, pos) { - if (!stream.tty || !stream.tty.ops.get_char) { - throw new FS.ErrnoError(60); - } - var bytesRead = 0; - for (var i = 0; i < length; i++) { - var result; - try { - result = stream.tty.ops.get_char(stream.tty); - } catch (e) { - throw new FS.ErrnoError(29); - } - if (result === undefined && bytesRead === 0) { - throw new FS.ErrnoError(6); - } - if (result === null || result === undefined) break; - bytesRead++; - buffer[offset + i] = result; - } - if (bytesRead) { - stream.node.timestamp = Date.now(); - } - return bytesRead; - }, - write: function (stream, buffer, offset, length, pos) { - if (!stream.tty || !stream.tty.ops.put_char) { - throw new FS.ErrnoError(60); - } - try { - for (var i = 0; i < length; i++) { - stream.tty.ops.put_char(stream.tty, buffer[offset + i]); - } - } catch (e) { - throw new FS.ErrnoError(29); - } - if (length) { - stream.node.timestamp = Date.now(); - } - return i; - }, - }, - default_tty_ops: { - get_char: function (tty) { - if (!tty.input.length) { - var result = null; - if (ENVIRONMENT_IS_NODE) { - var BUFSIZE = 256; - var buf = Buffer.alloc - ? Buffer.alloc(BUFSIZE) - : new Buffer(BUFSIZE); - var bytesRead = 0; - try { - bytesRead = nodeFS.readSync( - process.stdin.fd, - buf, - 0, - BUFSIZE, - null - ); - } catch (e) { - if (e.toString().includes('EOF')) bytesRead = 0; - else throw e; - } - if (bytesRead > 0) { - result = buf.slice(0, bytesRead).toString('utf-8'); - } else { - result = null; - } - } else if ( - typeof window != 'undefined' && - typeof window.prompt == 'function' - ) { - result = window.prompt('Input: '); - if (result !== null) { - result += '\n'; - } - } else if (typeof readline == 'function') { - result = readline(); - if (result !== null) { - result += '\n'; - } - } - if (!result) { - return null; - } - tty.input = intArrayFromString(result, true); - } - return tty.input.shift(); - }, - put_char: function (tty, val) { - if (val === null || val === 10) { - out(UTF8ArrayToString(tty.output, 0)); - tty.output = []; - } else { - if (val != 0) tty.output.push(val); - } - }, - flush: function (tty) { - if (tty.output && tty.output.length > 0) { - out(UTF8ArrayToString(tty.output, 0)); - tty.output = []; - } - }, - }, - default_tty1_ops: { - put_char: function (tty, val) { - if (val === null || val === 10) { - err(UTF8ArrayToString(tty.output, 0)); - tty.output = []; - } else { - if (val != 0) tty.output.push(val); - } - }, - flush: function (tty) { - if (tty.output && tty.output.length > 0) { - err(UTF8ArrayToString(tty.output, 0)); - tty.output = []; - } - }, - }, - }; - function mmapAlloc(size) { - var alignedSize = alignMemory(size, 65536); - var ptr = _malloc(alignedSize); - while (size < alignedSize) HEAP8[ptr + size++] = 0; - return ptr; - } - var MEMFS = { - ops_table: null, - mount: function (mount) { - return MEMFS.createNode(null, '/', 16384 | 511, 0); - }, - createNode: function (parent, name, mode, dev) { - if (FS.isBlkdev(mode) || FS.isFIFO(mode)) { - throw new FS.ErrnoError(63); - } - if (!MEMFS.ops_table) { - MEMFS.ops_table = { - dir: { - node: { - getattr: MEMFS.node_ops.getattr, - setattr: MEMFS.node_ops.setattr, - lookup: MEMFS.node_ops.lookup, - mknod: MEMFS.node_ops.mknod, - rename: MEMFS.node_ops.rename, - unlink: MEMFS.node_ops.unlink, - rmdir: MEMFS.node_ops.rmdir, - readdir: MEMFS.node_ops.readdir, - symlink: MEMFS.node_ops.symlink, - }, - stream: { llseek: MEMFS.stream_ops.llseek }, - }, - file: { - node: { - getattr: MEMFS.node_ops.getattr, - setattr: MEMFS.node_ops.setattr, - }, - stream: { - llseek: MEMFS.stream_ops.llseek, - read: MEMFS.stream_ops.read, - write: MEMFS.stream_ops.write, - allocate: MEMFS.stream_ops.allocate, - mmap: MEMFS.stream_ops.mmap, - msync: MEMFS.stream_ops.msync, - }, - }, - link: { - node: { - getattr: MEMFS.node_ops.getattr, - setattr: MEMFS.node_ops.setattr, - readlink: MEMFS.node_ops.readlink, - }, - stream: {}, - }, - chrdev: { - node: { - getattr: MEMFS.node_ops.getattr, - setattr: MEMFS.node_ops.setattr, - }, - stream: FS.chrdev_stream_ops, - }, - }; - } - var node = FS.createNode(parent, name, mode, dev); - if (FS.isDir(node.mode)) { - node.node_ops = MEMFS.ops_table.dir.node; - node.stream_ops = MEMFS.ops_table.dir.stream; - node.contents = {}; - } else if (FS.isFile(node.mode)) { - node.node_ops = MEMFS.ops_table.file.node; - node.stream_ops = MEMFS.ops_table.file.stream; - node.usedBytes = 0; - node.contents = null; - } else if (FS.isLink(node.mode)) { - node.node_ops = MEMFS.ops_table.link.node; - node.stream_ops = MEMFS.ops_table.link.stream; - } else if (FS.isChrdev(node.mode)) { - node.node_ops = MEMFS.ops_table.chrdev.node; - node.stream_ops = MEMFS.ops_table.chrdev.stream; - } - node.timestamp = Date.now(); - if (parent) { - parent.contents[name] = node; - parent.timestamp = node.timestamp; - } - return node; - }, - getFileDataAsTypedArray: function (node) { - if (!node.contents) return new Uint8Array(0); - if (node.contents.subarray) - return node.contents.subarray(0, node.usedBytes); - return new Uint8Array(node.contents); - }, - expandFileStorage: function (node, newCapacity) { - var prevCapacity = node.contents ? node.contents.length : 0; - if (prevCapacity >= newCapacity) return; - var CAPACITY_DOUBLING_MAX = 1024 * 1024; - newCapacity = Math.max( - newCapacity, - (prevCapacity * - (prevCapacity < CAPACITY_DOUBLING_MAX ? 2 : 1.125)) >>> - 0 - ); - if (prevCapacity != 0) newCapacity = Math.max(newCapacity, 256); - var oldContents = node.contents; - node.contents = new Uint8Array(newCapacity); - if (node.usedBytes > 0) - node.contents.set(oldContents.subarray(0, node.usedBytes), 0); - }, - resizeFileStorage: function (node, newSize) { - if (node.usedBytes == newSize) return; - if (newSize == 0) { - node.contents = null; - node.usedBytes = 0; - } else { - var oldContents = node.contents; - node.contents = new Uint8Array(newSize); - if (oldContents) { - node.contents.set( - oldContents.subarray(0, Math.min(newSize, node.usedBytes)) - ); - } - node.usedBytes = newSize; - } - }, - node_ops: { - getattr: function (node) { - var attr = {}; - attr.dev = FS.isChrdev(node.mode) ? node.id : 1; - attr.ino = node.id; - attr.mode = node.mode; - attr.nlink = 1; - attr.uid = 0; - attr.gid = 0; - attr.rdev = node.rdev; - if (FS.isDir(node.mode)) { - attr.size = 4096; - } else if (FS.isFile(node.mode)) { - attr.size = node.usedBytes; - } else if (FS.isLink(node.mode)) { - attr.size = node.link.length; - } else { - attr.size = 0; - } - attr.atime = new Date(node.timestamp); - attr.mtime = new Date(node.timestamp); - attr.ctime = new Date(node.timestamp); - attr.blksize = 4096; - attr.blocks = Math.ceil(attr.size / attr.blksize); - return attr; - }, - setattr: function (node, attr) { - if (attr.mode !== undefined) { - node.mode = attr.mode; - } - if (attr.timestamp !== undefined) { - node.timestamp = attr.timestamp; - } - if (attr.size !== undefined) { - MEMFS.resizeFileStorage(node, attr.size); - } - }, - lookup: function (parent, name) { - throw FS.genericErrors[44]; - }, - mknod: function (parent, name, mode, dev) { - return MEMFS.createNode(parent, name, mode, dev); - }, - rename: function (old_node, new_dir, new_name) { - if (FS.isDir(old_node.mode)) { - var new_node; - try { - new_node = FS.lookupNode(new_dir, new_name); - } catch (e) {} - if (new_node) { - for (var i in new_node.contents) { - throw new FS.ErrnoError(55); - } - } - } - delete old_node.parent.contents[old_node.name]; - old_node.parent.timestamp = Date.now(); - old_node.name = new_name; - new_dir.contents[new_name] = old_node; - new_dir.timestamp = old_node.parent.timestamp; - old_node.parent = new_dir; - }, - unlink: function (parent, name) { - delete parent.contents[name]; - parent.timestamp = Date.now(); - }, - rmdir: function (parent, name) { - var node = FS.lookupNode(parent, name); - for (var i in node.contents) { - throw new FS.ErrnoError(55); - } - delete parent.contents[name]; - parent.timestamp = Date.now(); - }, - readdir: function (node) { - var entries = ['.', '..']; - for (var key in node.contents) { - if (!node.contents.hasOwnProperty(key)) { - continue; - } - entries.push(key); - } - return entries; - }, - symlink: function (parent, newname, oldpath) { - var node = MEMFS.createNode(parent, newname, 511 | 40960, 0); - node.link = oldpath; - return node; - }, - readlink: function (node) { - if (!FS.isLink(node.mode)) { - throw new FS.ErrnoError(28); - } - return node.link; - }, - }, - stream_ops: { - read: function (stream, buffer, offset, length, position) { - var contents = stream.node.contents; - if (position >= stream.node.usedBytes) return 0; - var size = Math.min(stream.node.usedBytes - position, length); - assert(size >= 0); - if (size > 8 && contents.subarray) { - buffer.set(contents.subarray(position, position + size), offset); - } else { - for (var i = 0; i < size; i++) - buffer[offset + i] = contents[position + i]; - } - return size; - }, - write: function (stream, buffer, offset, length, position, canOwn) { - assert(!(buffer instanceof ArrayBuffer)); - if (buffer.buffer === HEAP8.buffer) { - canOwn = false; - } - if (!length) return 0; - var node = stream.node; - node.timestamp = Date.now(); - if (buffer.subarray && (!node.contents || node.contents.subarray)) { - if (canOwn) { - assert( - position === 0, - 'canOwn must imply no weird position inside the file' - ); - node.contents = buffer.subarray(offset, offset + length); - node.usedBytes = length; - return length; - } else if (node.usedBytes === 0 && position === 0) { - node.contents = buffer.slice(offset, offset + length); - node.usedBytes = length; - return length; - } else if (position + length <= node.usedBytes) { - node.contents.set( - buffer.subarray(offset, offset + length), - position - ); - return length; - } - } - MEMFS.expandFileStorage(node, position + length); - if (node.contents.subarray && buffer.subarray) { - node.contents.set( - buffer.subarray(offset, offset + length), - position - ); - } else { - for (var i = 0; i < length; i++) { - node.contents[position + i] = buffer[offset + i]; - } - } - node.usedBytes = Math.max(node.usedBytes, position + length); - return length; - }, - llseek: function (stream, offset, whence) { - var position = offset; - if (whence === 1) { - position += stream.position; - } else if (whence === 2) { - if (FS.isFile(stream.node.mode)) { - position += stream.node.usedBytes; - } - } - if (position < 0) { - throw new FS.ErrnoError(28); - } - return position; - }, - allocate: function (stream, offset, length) { - MEMFS.expandFileStorage(stream.node, offset + length); - stream.node.usedBytes = Math.max( - stream.node.usedBytes, - offset + length - ); - }, - mmap: function (stream, address, length, position, prot, flags) { - if (address !== 0) { - throw new FS.ErrnoError(28); - } - if (!FS.isFile(stream.node.mode)) { - throw new FS.ErrnoError(43); - } - var ptr; - var allocated; - var contents = stream.node.contents; - if (!(flags & 2) && contents.buffer === buffer) { - allocated = false; - ptr = contents.byteOffset; - } else { - if (position > 0 || position + length < contents.length) { - if (contents.subarray) { - contents = contents.subarray(position, position + length); - } else { - contents = Array.prototype.slice.call( - contents, - position, - position + length - ); - } - } - allocated = true; - ptr = mmapAlloc(length); - if (!ptr) { - throw new FS.ErrnoError(48); - } - HEAP8.set(contents, ptr); - } - return { ptr: ptr, allocated: allocated }; - }, - msync: function (stream, buffer, offset, length, mmapFlags) { - if (!FS.isFile(stream.node.mode)) { - throw new FS.ErrnoError(43); - } - if (mmapFlags & 2) { - return 0; - } - MEMFS.stream_ops.write( - stream, - buffer, - 0, - length, - offset, - false - ); - return 0; - }, - }, - }; - var ERRNO_MESSAGES = { - 0: 'Success', - 1: 'Arg list too long', - 2: 'Permission denied', - 3: 'Address already in use', - 4: 'Address not available', - 5: 'Address family not supported by protocol family', - 6: 'No more processes', - 7: 'Socket already connected', - 8: 'Bad file number', - 9: 'Trying to read unreadable message', - 10: 'Mount device busy', - 11: 'Operation canceled', - 12: 'No children', - 13: 'Connection aborted', - 14: 'Connection refused', - 15: 'Connection reset by peer', - 16: 'File locking deadlock error', - 17: 'Destination address required', - 18: 'Math arg out of domain of func', - 19: 'Quota exceeded', - 20: 'File exists', - 21: 'Bad address', - 22: 'File too large', - 23: 'Host is unreachable', - 24: 'Identifier removed', - 25: 'Illegal byte sequence', - 26: 'Connection already in progress', - 27: 'Interrupted system call', - 28: 'Invalid argument', - 29: 'I/O error', - 30: 'Socket is already connected', - 31: 'Is a directory', - 32: 'Too many symbolic links', - 33: 'Too many open files', - 34: 'Too many links', - 35: 'Message too long', - 36: 'Multihop attempted', - 37: 'File or path name too long', - 38: 'Network interface is not configured', - 39: 'Connection reset by network', - 40: 'Network is unreachable', - 41: 'Too many open files in system', - 42: 'No buffer space available', - 43: 'No such device', - 44: 'No such file or directory', - 45: 'Exec format error', - 46: 'No record locks available', - 47: 'The link has been severed', - 48: 'Not enough core', - 49: 'No message of desired type', - 50: 'Protocol not available', - 51: 'No space left on device', - 52: 'Function not implemented', - 53: 'Socket is not connected', - 54: 'Not a directory', - 55: 'Directory not empty', - 56: 'State not recoverable', - 57: 'Socket operation on non-socket', - 59: 'Not a typewriter', - 60: 'No such device or address', - 61: 'Value too large for defined data type', - 62: 'Previous owner died', - 63: 'Not super-user', - 64: 'Broken pipe', - 65: 'Protocol error', - 66: 'Unknown protocol', - 67: 'Protocol wrong type for socket', - 68: 'Math result not representable', - 69: 'Read only file system', - 70: 'Illegal seek', - 71: 'No such process', - 72: 'Stale file handle', - 73: 'Connection timed out', - 74: 'Text file busy', - 75: 'Cross-device link', - 100: 'Device not a stream', - 101: 'Bad font file fmt', - 102: 'Invalid slot', - 103: 'Invalid request code', - 104: 'No anode', - 105: 'Block device required', - 106: 'Channel number out of range', - 107: 'Level 3 halted', - 108: 'Level 3 reset', - 109: 'Link number out of range', - 110: 'Protocol driver not attached', - 111: 'No CSI structure available', - 112: 'Level 2 halted', - 113: 'Invalid exchange', - 114: 'Invalid request descriptor', - 115: 'Exchange full', - 116: 'No data (for no delay io)', - 117: 'Timer expired', - 118: 'Out of streams resources', - 119: 'Machine is not on the network', - 120: 'Package not installed', - 121: 'The object is remote', - 122: 'Advertise error', - 123: 'Srmount error', - 124: 'Communication error on send', - 125: 'Cross mount point (not really error)', - 126: 'Given log. name not unique', - 127: 'f.d. invalid for this operation', - 128: 'Remote address changed', - 129: 'Can access a needed shared lib', - 130: 'Accessing a corrupted shared lib', - 131: '.lib section in a.out corrupted', - 132: 'Attempting to link in too many libs', - 133: 'Attempting to exec a shared library', - 135: 'Streams pipe error', - 136: 'Too many users', - 137: 'Socket type not supported', - 138: 'Not supported', - 139: 'Protocol family not supported', - 140: "Can't send after socket shutdown", - 141: 'Too many references', - 142: 'Host is down', - 148: 'No medium (in tape drive)', - 156: 'Level 2 not synchronized', - }; - var ERRNO_CODES = { - EPERM: 63, - ENOENT: 44, - ESRCH: 71, - EINTR: 27, - EIO: 29, - ENXIO: 60, - E2BIG: 1, - ENOEXEC: 45, - EBADF: 8, - ECHILD: 12, - EAGAIN: 6, - EWOULDBLOCK: 6, - ENOMEM: 48, - EACCES: 2, - EFAULT: 21, - ENOTBLK: 105, - EBUSY: 10, - EEXIST: 20, - EXDEV: 75, - ENODEV: 43, - ENOTDIR: 54, - EISDIR: 31, - EINVAL: 28, - ENFILE: 41, - EMFILE: 33, - ENOTTY: 59, - ETXTBSY: 74, - EFBIG: 22, - ENOSPC: 51, - ESPIPE: 70, - EROFS: 69, - EMLINK: 34, - EPIPE: 64, - EDOM: 18, - ERANGE: 68, - ENOMSG: 49, - EIDRM: 24, - ECHRNG: 106, - EL2NSYNC: 156, - EL3HLT: 107, - EL3RST: 108, - ELNRNG: 109, - EUNATCH: 110, - ENOCSI: 111, - EL2HLT: 112, - EDEADLK: 16, - ENOLCK: 46, - EBADE: 113, - EBADR: 114, - EXFULL: 115, - ENOANO: 104, - EBADRQC: 103, - EBADSLT: 102, - EDEADLOCK: 16, - EBFONT: 101, - ENOSTR: 100, - ENODATA: 116, - ETIME: 117, - ENOSR: 118, - ENONET: 119, - ENOPKG: 120, - EREMOTE: 121, - ENOLINK: 47, - EADV: 122, - ESRMNT: 123, - ECOMM: 124, - EPROTO: 65, - EMULTIHOP: 36, - EDOTDOT: 125, - EBADMSG: 9, - ENOTUNIQ: 126, - EBADFD: 127, - EREMCHG: 128, - ELIBACC: 129, - ELIBBAD: 130, - ELIBSCN: 131, - ELIBMAX: 132, - ELIBEXEC: 133, - ENOSYS: 52, - ENOTEMPTY: 55, - ENAMETOOLONG: 37, - ELOOP: 32, - EOPNOTSUPP: 138, - EPFNOSUPPORT: 139, - ECONNRESET: 15, - ENOBUFS: 42, - EAFNOSUPPORT: 5, - EPROTOTYPE: 67, - ENOTSOCK: 57, - ENOPROTOOPT: 50, - ESHUTDOWN: 140, - ECONNREFUSED: 14, - EADDRINUSE: 3, - ECONNABORTED: 13, - ENETUNREACH: 40, - ENETDOWN: 38, - ETIMEDOUT: 73, - EHOSTDOWN: 142, - EHOSTUNREACH: 23, - EINPROGRESS: 26, - EALREADY: 7, - EDESTADDRREQ: 17, - EMSGSIZE: 35, - EPROTONOSUPPORT: 66, - ESOCKTNOSUPPORT: 137, - EADDRNOTAVAIL: 4, - ENETRESET: 39, - EISCONN: 30, - ENOTCONN: 53, - ETOOMANYREFS: 141, - EUSERS: 136, - EDQUOT: 19, - ESTALE: 72, - ENOTSUP: 138, - ENOMEDIUM: 148, - EILSEQ: 25, - EOVERFLOW: 61, - ECANCELED: 11, - ENOTRECOVERABLE: 56, - EOWNERDEAD: 62, - ESTRPIPE: 135, - }; - var FS = { - root: null, - mounts: [], - devices: {}, - streams: [], - nextInode: 1, - nameTable: null, - currentPath: '/', - initialized: false, - ignorePermissions: true, - trackingDelegate: {}, - tracking: { openFlags: { READ: 1, WRITE: 2 } }, - ErrnoError: null, - genericErrors: {}, - filesystems: null, - syncFSRequests: 0, - lookupPath: function (path, opts) { - path = PATH_FS.resolve(FS.cwd(), path); - opts = opts || {}; - if (!path) return { path: '', node: null }; - var defaults = { follow_mount: true, recurse_count: 0 }; - for (var key in defaults) { - if (opts[key] === undefined) { - opts[key] = defaults[key]; - } - } - if (opts.recurse_count > 8) { - throw new FS.ErrnoError(32); - } - var parts = PATH.normalizeArray( - path.split('/').filter(function (p) { - return !!p; - }), - false - ); - var current = FS.root; - var current_path = '/'; - for (var i = 0; i < parts.length; i++) { - var islast = i === parts.length - 1; - if (islast && opts.parent) { - break; - } - current = FS.lookupNode(current, parts[i]); - current_path = PATH.join2(current_path, parts[i]); - if (FS.isMountpoint(current)) { - if (!islast || (islast && opts.follow_mount)) { - current = current.mounted.root; - } - } - if (!islast || opts.follow) { - var count = 0; - while (FS.isLink(current.mode)) { - var link = FS.readlink(current_path); - current_path = PATH_FS.resolve(PATH.dirname(current_path), link); - var lookup = FS.lookupPath(current_path, { - recurse_count: opts.recurse_count, - }); - current = lookup.node; - if (count++ > 40) { - throw new FS.ErrnoError(32); - } - } - } - } - return { path: current_path, node: current }; - }, - getPath: function (node) { - var path; - while (true) { - if (FS.isRoot(node)) { - var mount = node.mount.mountpoint; - if (!path) return mount; - return mount[mount.length - 1] !== '/' - ? mount + '/' + path - : mount + path; - } - path = path ? node.name + '/' + path : node.name; - node = node.parent; - } - }, - hashName: function (parentid, name) { - var hash = 0; - for (var i = 0; i < name.length; i++) { - hash = ((hash << 5) - hash + name.charCodeAt(i)) | 0; - } - return ((parentid + hash) >>> 0) % FS.nameTable.length; - }, - hashAddNode: function (node) { - var hash = FS.hashName(node.parent.id, node.name); - node.name_next = FS.nameTable[hash]; - FS.nameTable[hash] = node; - }, - hashRemoveNode: function (node) { - var hash = FS.hashName(node.parent.id, node.name); - if (FS.nameTable[hash] === node) { - FS.nameTable[hash] = node.name_next; - } else { - var current = FS.nameTable[hash]; - while (current) { - if (current.name_next === node) { - current.name_next = node.name_next; - break; - } - current = current.name_next; - } - } - }, - lookupNode: function (parent, name) { - var errCode = FS.mayLookup(parent); - if (errCode) { - throw new FS.ErrnoError(errCode, parent); - } - var hash = FS.hashName(parent.id, name); - for (var node = FS.nameTable[hash]; node; node = node.name_next) { - var nodeName = node.name; - if (node.parent.id === parent.id && nodeName === name) { - return node; - } - } - return FS.lookup(parent, name); - }, - createNode: function (parent, name, mode, rdev) { - assert(typeof parent === 'object'); - var node = new FS.FSNode(parent, name, mode, rdev); - FS.hashAddNode(node); - return node; - }, - destroyNode: function (node) { - FS.hashRemoveNode(node); - }, - isRoot: function (node) { - return node === node.parent; - }, - isMountpoint: function (node) { - return !!node.mounted; - }, - isFile: function (mode) { - return (mode & 61440) === 32768; - }, - isDir: function (mode) { - return (mode & 61440) === 16384; - }, - isLink: function (mode) { - return (mode & 61440) === 40960; - }, - isChrdev: function (mode) { - return (mode & 61440) === 8192; - }, - isBlkdev: function (mode) { - return (mode & 61440) === 24576; - }, - isFIFO: function (mode) { - return (mode & 61440) === 4096; - }, - isSocket: function (mode) { - return (mode & 49152) === 49152; - }, - flagModes: { r: 0, 'r+': 2, w: 577, 'w+': 578, a: 1089, 'a+': 1090 }, - modeStringToFlags: function (str) { - var flags = FS.flagModes[str]; - if (typeof flags === 'undefined') { - throw new Error('Unknown file open mode: ' + str); - } - return flags; - }, - flagsToPermissionString: function (flag) { - var perms = ['r', 'w', 'rw'][flag & 3]; - if (flag & 512) { - perms += 'w'; - } - return perms; - }, - nodePermissions: function (node, perms) { - if (FS.ignorePermissions) { - return 0; - } - if (perms.includes('r') && !(node.mode & 292)) { - return 2; - } else if (perms.includes('w') && !(node.mode & 146)) { - return 2; - } else if (perms.includes('x') && !(node.mode & 73)) { - return 2; - } - return 0; - }, - mayLookup: function (dir) { - var errCode = FS.nodePermissions(dir, 'x'); - if (errCode) return errCode; - if (!dir.node_ops.lookup) return 2; - return 0; - }, - mayCreate: function (dir, name) { - try { - var node = FS.lookupNode(dir, name); - return 20; - } catch (e) {} - return FS.nodePermissions(dir, 'wx'); - }, - mayDelete: function (dir, name, isdir) { - var node; - try { - node = FS.lookupNode(dir, name); - } catch (e) { - return e.errno; - } - var errCode = FS.nodePermissions(dir, 'wx'); - if (errCode) { - return errCode; - } - if (isdir) { - if (!FS.isDir(node.mode)) { - return 54; - } - if (FS.isRoot(node) || FS.getPath(node) === FS.cwd()) { - return 10; - } - } else { - if (FS.isDir(node.mode)) { - return 31; - } - } - return 0; - }, - mayOpen: function (node, flags) { - if (!node) { - return 44; - } - if (FS.isLink(node.mode)) { - return 32; - } else if (FS.isDir(node.mode)) { - if (FS.flagsToPermissionString(flags) !== 'r' || flags & 512) { - return 31; - } - } - return FS.nodePermissions(node, FS.flagsToPermissionString(flags)); - }, - MAX_OPEN_FDS: 4096, - nextfd: function (fd_start, fd_end) { - fd_start = fd_start || 0; - fd_end = fd_end || FS.MAX_OPEN_FDS; - for (var fd = fd_start; fd <= fd_end; fd++) { - if (!FS.streams[fd]) { - return fd; - } - } - throw new FS.ErrnoError(33); - }, - getStream: function (fd) { - return FS.streams[fd]; - }, - createStream: function (stream, fd_start, fd_end) { - if (!FS.FSStream) { - FS.FSStream = function () {}; - FS.FSStream.prototype = { - object: { - get: function () { - return this.node; - }, - set: function (val) { - this.node = val; - }, - }, - isRead: { - get: function () { - return (this.flags & 2097155) !== 1; - }, - }, - isWrite: { - get: function () { - return (this.flags & 2097155) !== 0; - }, - }, - isAppend: { - get: function () { - return this.flags & 1024; - }, - }, - }; - } - var newStream = new FS.FSStream(); - for (var p in stream) { - newStream[p] = stream[p]; - } - stream = newStream; - var fd = FS.nextfd(fd_start, fd_end); - stream.fd = fd; - FS.streams[fd] = stream; - return stream; - }, - closeStream: function (fd) { - FS.streams[fd] = null; - }, - chrdev_stream_ops: { - open: function (stream) { - var device = FS.getDevice(stream.node.rdev); - stream.stream_ops = device.stream_ops; - if (stream.stream_ops.open) { - stream.stream_ops.open(stream); - } - }, - llseek: function () { - throw new FS.ErrnoError(70); - }, - }, - major: function (dev) { - return dev >> 8; - }, - minor: function (dev) { - return dev & 255; - }, - makedev: function (ma, mi) { - return (ma << 8) | mi; - }, - registerDevice: function (dev, ops) { - FS.devices[dev] = { stream_ops: ops }; - }, - getDevice: function (dev) { - return FS.devices[dev]; - }, - getMounts: function (mount) { - var mounts = []; - var check = [mount]; - while (check.length) { - var m = check.pop(); - mounts.push(m); - check.push.apply(check, m.mounts); - } - return mounts; - }, - syncfs: function (populate, callback) { - if (typeof populate === 'function') { - callback = populate; - populate = false; - } - FS.syncFSRequests++; - if (FS.syncFSRequests > 1) { - err( - 'warning: ' + - FS.syncFSRequests + - ' FS.syncfs operations in flight at once, probably just doing extra work' - ); - } - var mounts = FS.getMounts(FS.root.mount); - var completed = 0; - function doCallback(errCode) { - assert(FS.syncFSRequests > 0); - FS.syncFSRequests--; - return callback(errCode); - } - function done(errCode) { - if (errCode) { - if (!done.errored) { - done.errored = true; - return doCallback(errCode); - } - return; - } - if (++completed >= mounts.length) { - doCallback(null); - } - } - mounts.forEach(function (mount) { - if (!mount.type.syncfs) { - return done(null); - } - mount.type.syncfs(mount, populate, done); - }); - }, - mount: function (type, opts, mountpoint) { - if (typeof type === 'string') { - throw type; - } - var root = mountpoint === '/'; - var pseudo = !mountpoint; - var node; - if (root && FS.root) { - throw new FS.ErrnoError(10); - } else if (!root && !pseudo) { - var lookup = FS.lookupPath(mountpoint, { follow_mount: false }); - mountpoint = lookup.path; - node = lookup.node; - if (FS.isMountpoint(node)) { - throw new FS.ErrnoError(10); - } - if (!FS.isDir(node.mode)) { - throw new FS.ErrnoError(54); - } - } - var mount = { - type: type, - opts: opts, - mountpoint: mountpoint, - mounts: [], - }; - var mountRoot = type.mount(mount); - mountRoot.mount = mount; - mount.root = mountRoot; - if (root) { - FS.root = mountRoot; - } else if (node) { - node.mounted = mount; - if (node.mount) { - node.mount.mounts.push(mount); - } - } - return mountRoot; - }, - unmount: function (mountpoint) { - var lookup = FS.lookupPath(mountpoint, { follow_mount: false }); - if (!FS.isMountpoint(lookup.node)) { - throw new FS.ErrnoError(28); - } - var node = lookup.node; - var mount = node.mounted; - var mounts = FS.getMounts(mount); - Object.keys(FS.nameTable).forEach(function (hash) { - var current = FS.nameTable[hash]; - while (current) { - var next = current.name_next; - if (mounts.includes(current.mount)) { - FS.destroyNode(current); - } - current = next; - } - }); - node.mounted = null; - var idx = node.mount.mounts.indexOf(mount); - assert(idx !== -1); - node.mount.mounts.splice(idx, 1); - }, - lookup: function (parent, name) { - return parent.node_ops.lookup(parent, name); - }, - mknod: function (path, mode, dev) { - var lookup = FS.lookupPath(path, { parent: true }); - var parent = lookup.node; - var name = PATH.basename(path); - if (!name || name === '.' || name === '..') { - throw new FS.ErrnoError(28); - } - var errCode = FS.mayCreate(parent, name); - if (errCode) { - throw new FS.ErrnoError(errCode); - } - if (!parent.node_ops.mknod) { - throw new FS.ErrnoError(63); - } - return parent.node_ops.mknod(parent, name, mode, dev); - }, - create: function (path, mode) { - mode = mode !== undefined ? mode : 438; - mode &= 4095; - mode |= 32768; - return FS.mknod(path, mode, 0); - }, - mkdir: function (path, mode) { - mode = mode !== undefined ? mode : 511; - mode &= 511 | 512; - mode |= 16384; - return FS.mknod(path, mode, 0); - }, - mkdirTree: function (path, mode) { - var dirs = path.split('/'); - var d = ''; - for (var i = 0; i < dirs.length; ++i) { - if (!dirs[i]) continue; - d += '/' + dirs[i]; - try { - FS.mkdir(d, mode); - } catch (e) { - if (e.errno != 20) throw e; - } - } - }, - mkdev: function (path, mode, dev) { - if (typeof dev === 'undefined') { - dev = mode; - mode = 438; - } - mode |= 8192; - return FS.mknod(path, mode, dev); - }, - symlink: function (oldpath, newpath) { - if (!PATH_FS.resolve(oldpath)) { - throw new FS.ErrnoError(44); - } - var lookup = FS.lookupPath(newpath, { parent: true }); - var parent = lookup.node; - if (!parent) { - throw new FS.ErrnoError(44); - } - var newname = PATH.basename(newpath); - var errCode = FS.mayCreate(parent, newname); - if (errCode) { - throw new FS.ErrnoError(errCode); - } - if (!parent.node_ops.symlink) { - throw new FS.ErrnoError(63); - } - return parent.node_ops.symlink(parent, newname, oldpath); - }, - rename: function (old_path, new_path) { - var old_dirname = PATH.dirname(old_path); - var new_dirname = PATH.dirname(new_path); - var old_name = PATH.basename(old_path); - var new_name = PATH.basename(new_path); - var lookup, old_dir, new_dir; - lookup = FS.lookupPath(old_path, { parent: true }); - old_dir = lookup.node; - lookup = FS.lookupPath(new_path, { parent: true }); - new_dir = lookup.node; - if (!old_dir || !new_dir) throw new FS.ErrnoError(44); - if (old_dir.mount !== new_dir.mount) { - throw new FS.ErrnoError(75); - } - var old_node = FS.lookupNode(old_dir, old_name); - var relative = PATH_FS.relative(old_path, new_dirname); - if (relative.charAt(0) !== '.') { - throw new FS.ErrnoError(28); - } - relative = PATH_FS.relative(new_path, old_dirname); - if (relative.charAt(0) !== '.') { - throw new FS.ErrnoError(55); - } - var new_node; - try { - new_node = FS.lookupNode(new_dir, new_name); - } catch (e) {} - if (old_node === new_node) { - return; - } - var isdir = FS.isDir(old_node.mode); - var errCode = FS.mayDelete(old_dir, old_name, isdir); - if (errCode) { - throw new FS.ErrnoError(errCode); - } - errCode = new_node - ? FS.mayDelete(new_dir, new_name, isdir) - : FS.mayCreate(new_dir, new_name); - if (errCode) { - throw new FS.ErrnoError(errCode); - } - if (!old_dir.node_ops.rename) { - throw new FS.ErrnoError(63); - } - if ( - FS.isMountpoint(old_node) || - (new_node && FS.isMountpoint(new_node)) - ) { - throw new FS.ErrnoError(10); - } - if (new_dir !== old_dir) { - errCode = FS.nodePermissions(old_dir, 'w'); - if (errCode) { - throw new FS.ErrnoError(errCode); - } - } - try { - if (FS.trackingDelegate['willMovePath']) ; - } catch (e) { - err( - "FS.trackingDelegate['willMovePath']('" + - old_path + - "', '" + - new_path + - "') threw an exception: " + - e.message - ); - } - FS.hashRemoveNode(old_node); - try { - old_dir.node_ops.rename(old_node, new_dir, new_name); - } catch (e) { - throw e; - } finally { - FS.hashAddNode(old_node); - } - try { - if (FS.trackingDelegate['onMovePath']) - ; - } catch (e) { - err( - "FS.trackingDelegate['onMovePath']('" + - old_path + - "', '" + - new_path + - "') threw an exception: " + - e.message - ); - } - }, - rmdir: function (path) { - var lookup = FS.lookupPath(path, { parent: true }); - var parent = lookup.node; - var name = PATH.basename(path); - var node = FS.lookupNode(parent, name); - var errCode = FS.mayDelete(parent, name, true); - if (errCode) { - throw new FS.ErrnoError(errCode); - } - if (!parent.node_ops.rmdir) { - throw new FS.ErrnoError(63); - } - if (FS.isMountpoint(node)) { - throw new FS.ErrnoError(10); - } - try { - if (FS.trackingDelegate['willDeletePath']) ; - } catch (e) { - err( - "FS.trackingDelegate['willDeletePath']('" + - path + - "') threw an exception: " + - e.message - ); - } - parent.node_ops.rmdir(parent, name); - FS.destroyNode(node); - try { - if (FS.trackingDelegate['onDeletePath']) - ; - } catch (e) { - err( - "FS.trackingDelegate['onDeletePath']('" + - path + - "') threw an exception: " + - e.message - ); - } - }, - readdir: function (path) { - var lookup = FS.lookupPath(path, { follow: true }); - var node = lookup.node; - if (!node.node_ops.readdir) { - throw new FS.ErrnoError(54); - } - return node.node_ops.readdir(node); - }, - unlink: function (path) { - var lookup = FS.lookupPath(path, { parent: true }); - var parent = lookup.node; - var name = PATH.basename(path); - var node = FS.lookupNode(parent, name); - var errCode = FS.mayDelete(parent, name, false); - if (errCode) { - throw new FS.ErrnoError(errCode); - } - if (!parent.node_ops.unlink) { - throw new FS.ErrnoError(63); - } - if (FS.isMountpoint(node)) { - throw new FS.ErrnoError(10); - } - try { - if (FS.trackingDelegate['willDeletePath']) ; - } catch (e) { - err( - "FS.trackingDelegate['willDeletePath']('" + - path + - "') threw an exception: " + - e.message - ); - } - parent.node_ops.unlink(parent, name); - FS.destroyNode(node); - try { - if (FS.trackingDelegate['onDeletePath']) - ; - } catch (e) { - err( - "FS.trackingDelegate['onDeletePath']('" + - path + - "') threw an exception: " + - e.message - ); - } - }, - readlink: function (path) { - var lookup = FS.lookupPath(path); - var link = lookup.node; - if (!link) { - throw new FS.ErrnoError(44); - } - if (!link.node_ops.readlink) { - throw new FS.ErrnoError(28); - } - return PATH_FS.resolve( - FS.getPath(link.parent), - link.node_ops.readlink(link) - ); - }, - stat: function (path, dontFollow) { - var lookup = FS.lookupPath(path, { follow: !dontFollow }); - var node = lookup.node; - if (!node) { - throw new FS.ErrnoError(44); - } - if (!node.node_ops.getattr) { - throw new FS.ErrnoError(63); - } - return node.node_ops.getattr(node); - }, - lstat: function (path) { - return FS.stat(path, true); - }, - chmod: function (path, mode, dontFollow) { - var node; - if (typeof path === 'string') { - var lookup = FS.lookupPath(path, { follow: !dontFollow }); - node = lookup.node; - } else { - node = path; - } - if (!node.node_ops.setattr) { - throw new FS.ErrnoError(63); - } - node.node_ops.setattr(node, { - mode: (mode & 4095) | (node.mode & ~4095), - timestamp: Date.now(), - }); - }, - lchmod: function (path, mode) { - FS.chmod(path, mode, true); - }, - fchmod: function (fd, mode) { - var stream = FS.getStream(fd); - if (!stream) { - throw new FS.ErrnoError(8); - } - FS.chmod(stream.node, mode); - }, - chown: function (path, uid, gid, dontFollow) { - var node; - if (typeof path === 'string') { - var lookup = FS.lookupPath(path, { follow: !dontFollow }); - node = lookup.node; - } else { - node = path; - } - if (!node.node_ops.setattr) { - throw new FS.ErrnoError(63); - } - node.node_ops.setattr(node, { timestamp: Date.now() }); - }, - lchown: function (path, uid, gid) { - FS.chown(path, uid, gid, true); - }, - fchown: function (fd, uid, gid) { - var stream = FS.getStream(fd); - if (!stream) { - throw new FS.ErrnoError(8); - } - FS.chown(stream.node, uid, gid); - }, - truncate: function (path, len) { - if (len < 0) { - throw new FS.ErrnoError(28); - } - var node; - if (typeof path === 'string') { - var lookup = FS.lookupPath(path, { follow: true }); - node = lookup.node; - } else { - node = path; - } - if (!node.node_ops.setattr) { - throw new FS.ErrnoError(63); - } - if (FS.isDir(node.mode)) { - throw new FS.ErrnoError(31); - } - if (!FS.isFile(node.mode)) { - throw new FS.ErrnoError(28); - } - var errCode = FS.nodePermissions(node, 'w'); - if (errCode) { - throw new FS.ErrnoError(errCode); - } - node.node_ops.setattr(node, { size: len, timestamp: Date.now() }); - }, - ftruncate: function (fd, len) { - var stream = FS.getStream(fd); - if (!stream) { - throw new FS.ErrnoError(8); - } - if ((stream.flags & 2097155) === 0) { - throw new FS.ErrnoError(28); - } - FS.truncate(stream.node, len); - }, - utime: function (path, atime, mtime) { - var lookup = FS.lookupPath(path, { follow: true }); - var node = lookup.node; - node.node_ops.setattr(node, { timestamp: Math.max(atime, mtime) }); - }, - open: function (path, flags, mode, fd_start, fd_end) { - if (path === '') { - throw new FS.ErrnoError(44); - } - flags = typeof flags === 'string' ? FS.modeStringToFlags(flags) : flags; - mode = typeof mode === 'undefined' ? 438 : mode; - if (flags & 64) { - mode = (mode & 4095) | 32768; - } else { - mode = 0; - } - var node; - if (typeof path === 'object') { - node = path; - } else { - path = PATH.normalize(path); - try { - var lookup = FS.lookupPath(path, { follow: !(flags & 131072) }); - node = lookup.node; - } catch (e) {} - } - var created = false; - if (flags & 64) { - if (node) { - if (flags & 128) { - throw new FS.ErrnoError(20); - } - } else { - node = FS.mknod(path, mode, 0); - created = true; - } - } - if (!node) { - throw new FS.ErrnoError(44); - } - if (FS.isChrdev(node.mode)) { - flags &= ~512; - } - if (flags & 65536 && !FS.isDir(node.mode)) { - throw new FS.ErrnoError(54); - } - if (!created) { - var errCode = FS.mayOpen(node, flags); - if (errCode) { - throw new FS.ErrnoError(errCode); - } - } - if (flags & 512) { - FS.truncate(node, 0); - } - flags &= ~(128 | 512 | 131072); - var stream = FS.createStream( - { - node: node, - path: FS.getPath(node), - flags: flags, - seekable: true, - position: 0, - stream_ops: node.stream_ops, - ungotten: [], - error: false, - }, - fd_start, - fd_end - ); - if (stream.stream_ops.open) { - stream.stream_ops.open(stream); - } - if (Module['logReadFiles'] && !(flags & 1)) { - if (!FS.readFiles) FS.readFiles = {}; - if (!(path in FS.readFiles)) { - FS.readFiles[path] = 1; - err('FS.trackingDelegate error on read file: ' + path); - } - } - try { - var trackingFlags; if (FS.trackingDelegate['onOpenFile']) ; - } catch (e) { - err( - "FS.trackingDelegate['onOpenFile']('" + - path + - "', flags) threw an exception: " + - e.message - ); - } - return stream; - }, - close: function (stream) { - if (FS.isClosed(stream)) { - throw new FS.ErrnoError(8); - } - if (stream.getdents) stream.getdents = null; - try { - if (stream.stream_ops.close) { - stream.stream_ops.close(stream); - } - } catch (e) { - throw e; - } finally { - FS.closeStream(stream.fd); - } - stream.fd = null; - }, - isClosed: function (stream) { - return stream.fd === null; - }, - llseek: function (stream, offset, whence) { - if (FS.isClosed(stream)) { - throw new FS.ErrnoError(8); - } - if (!stream.seekable || !stream.stream_ops.llseek) { - throw new FS.ErrnoError(70); - } - if (whence != 0 && whence != 1 && whence != 2) { - throw new FS.ErrnoError(28); - } - stream.position = stream.stream_ops.llseek(stream, offset, whence); - stream.ungotten = []; - return stream.position; - }, - read: function (stream, buffer, offset, length, position) { - if (length < 0 || position < 0) { - throw new FS.ErrnoError(28); - } - if (FS.isClosed(stream)) { - throw new FS.ErrnoError(8); - } - if ((stream.flags & 2097155) === 1) { - throw new FS.ErrnoError(8); - } - if (FS.isDir(stream.node.mode)) { - throw new FS.ErrnoError(31); - } - if (!stream.stream_ops.read) { - throw new FS.ErrnoError(28); - } - var seeking = typeof position !== 'undefined'; - if (!seeking) { - position = stream.position; - } else if (!stream.seekable) { - throw new FS.ErrnoError(70); - } - var bytesRead = stream.stream_ops.read( - stream, - buffer, - offset, - length, - position - ); - if (!seeking) stream.position += bytesRead; - return bytesRead; - }, - write: function (stream, buffer, offset, length, position, canOwn) { - if (length < 0 || position < 0) { - throw new FS.ErrnoError(28); - } - if (FS.isClosed(stream)) { - throw new FS.ErrnoError(8); - } - if ((stream.flags & 2097155) === 0) { - throw new FS.ErrnoError(8); - } - if (FS.isDir(stream.node.mode)) { - throw new FS.ErrnoError(31); - } - if (!stream.stream_ops.write) { - throw new FS.ErrnoError(28); - } - if (stream.seekable && stream.flags & 1024) { - FS.llseek(stream, 0, 2); - } - var seeking = typeof position !== 'undefined'; - if (!seeking) { - position = stream.position; - } else if (!stream.seekable) { - throw new FS.ErrnoError(70); - } - var bytesWritten = stream.stream_ops.write( - stream, - buffer, - offset, - length, - position, - canOwn - ); - if (!seeking) stream.position += bytesWritten; - try { - if (stream.path && FS.trackingDelegate['onWriteToFile']) - FS.trackingDelegate['onWriteToFile'](stream.path); - } catch (e) { - err( - "FS.trackingDelegate['onWriteToFile']('" + - stream.path + - "') threw an exception: " + - e.message - ); - } - return bytesWritten; - }, - allocate: function (stream, offset, length) { - if (FS.isClosed(stream)) { - throw new FS.ErrnoError(8); - } - if (offset < 0 || length <= 0) { - throw new FS.ErrnoError(28); - } - if ((stream.flags & 2097155) === 0) { - throw new FS.ErrnoError(8); - } - if (!FS.isFile(stream.node.mode) && !FS.isDir(stream.node.mode)) { - throw new FS.ErrnoError(43); - } - if (!stream.stream_ops.allocate) { - throw new FS.ErrnoError(138); - } - stream.stream_ops.allocate(stream, offset, length); - }, - mmap: function (stream, address, length, position, prot, flags) { - if ( - (prot & 2) !== 0 && - (flags & 2) === 0 && - (stream.flags & 2097155) !== 2 - ) { - throw new FS.ErrnoError(2); - } - if ((stream.flags & 2097155) === 1) { - throw new FS.ErrnoError(2); - } - if (!stream.stream_ops.mmap) { - throw new FS.ErrnoError(43); - } - return stream.stream_ops.mmap( - stream, - address, - length, - position, - prot, - flags - ); - }, - msync: function (stream, buffer, offset, length, mmapFlags) { - if (!stream || !stream.stream_ops.msync) { - return 0; - } - return stream.stream_ops.msync( - stream, - buffer, - offset, - length, - mmapFlags - ); - }, - munmap: function (stream) { - return 0; - }, - ioctl: function (stream, cmd, arg) { - if (!stream.stream_ops.ioctl) { - throw new FS.ErrnoError(59); - } - return stream.stream_ops.ioctl(stream, cmd, arg); - }, - readFile: function (path, opts) { - opts = opts || {}; - opts.flags = opts.flags || 0; - opts.encoding = opts.encoding || 'binary'; - if (opts.encoding !== 'utf8' && opts.encoding !== 'binary') { - throw new Error('Invalid encoding type "' + opts.encoding + '"'); - } - var ret; - var stream = FS.open(path, opts.flags); - var stat = FS.stat(path); - var length = stat.size; - var buf = new Uint8Array(length); - FS.read(stream, buf, 0, length, 0); - if (opts.encoding === 'utf8') { - ret = UTF8ArrayToString(buf, 0); - } else if (opts.encoding === 'binary') { - ret = buf; - } - FS.close(stream); - return ret; - }, - writeFile: function (path, data, opts) { - opts = opts || {}; - opts.flags = opts.flags || 577; - var stream = FS.open(path, opts.flags, opts.mode); - if (typeof data === 'string') { - var buf = new Uint8Array(lengthBytesUTF8(data) + 1); - var actualNumBytes = stringToUTF8Array(data, buf, 0, buf.length); - FS.write(stream, buf, 0, actualNumBytes, undefined, opts.canOwn); - } else if (ArrayBuffer.isView(data)) { - FS.write(stream, data, 0, data.byteLength, undefined, opts.canOwn); - } else { - throw new Error('Unsupported data type'); - } - FS.close(stream); - }, - cwd: function () { - return FS.currentPath; - }, - chdir: function (path) { - var lookup = FS.lookupPath(path, { follow: true }); - if (lookup.node === null) { - throw new FS.ErrnoError(44); - } - if (!FS.isDir(lookup.node.mode)) { - throw new FS.ErrnoError(54); - } - var errCode = FS.nodePermissions(lookup.node, 'x'); - if (errCode) { - throw new FS.ErrnoError(errCode); - } - FS.currentPath = lookup.path; - }, - createDefaultDirectories: function () { - FS.mkdir('/tmp'); - FS.mkdir('/home'); - FS.mkdir('/home/web_user'); - }, - createDefaultDevices: function () { - FS.mkdir('/dev'); - FS.registerDevice(FS.makedev(1, 3), { - read: function () { - return 0; - }, - write: function (stream, buffer, offset, length, pos) { - return length; - }, - }); - FS.mkdev('/dev/null', FS.makedev(1, 3)); - TTY.register(FS.makedev(5, 0), TTY.default_tty_ops); - TTY.register(FS.makedev(6, 0), TTY.default_tty1_ops); - FS.mkdev('/dev/tty', FS.makedev(5, 0)); - FS.mkdev('/dev/tty1', FS.makedev(6, 0)); - var random_device = getRandomDevice(); - FS.createDevice('/dev', 'random', random_device); - FS.createDevice('/dev', 'urandom', random_device); - FS.mkdir('/dev/shm'); - FS.mkdir('/dev/shm/tmp'); - }, - createSpecialDirectories: function () { - FS.mkdir('/proc'); - var proc_self = FS.mkdir('/proc/self'); - FS.mkdir('/proc/self/fd'); - FS.mount( - { - mount: function () { - var node = FS.createNode(proc_self, 'fd', 16384 | 511, 73); - node.node_ops = { - lookup: function (parent, name) { - var fd = +name; - var stream = FS.getStream(fd); - if (!stream) throw new FS.ErrnoError(8); - var ret = { - parent: null, - mount: { mountpoint: 'fake' }, - node_ops: { - readlink: function () { - return stream.path; - }, - }, - }; - ret.parent = ret; - return ret; - }, - }; - return node; - }, - }, - {}, - '/proc/self/fd' - ); - }, - createStandardStreams: function () { - if (Module['stdin']) { - FS.createDevice('/dev', 'stdin', Module['stdin']); - } else { - FS.symlink('/dev/tty', '/dev/stdin'); - } - if (Module['stdout']) { - FS.createDevice('/dev', 'stdout', null, Module['stdout']); - } else { - FS.symlink('/dev/tty', '/dev/stdout'); - } - if (Module['stderr']) { - FS.createDevice('/dev', 'stderr', null, Module['stderr']); - } else { - FS.symlink('/dev/tty1', '/dev/stderr'); - } - var stdin = FS.open('/dev/stdin', 0); - var stdout = FS.open('/dev/stdout', 1); - var stderr = FS.open('/dev/stderr', 1); - assert(stdin.fd === 0, 'invalid handle for stdin (' + stdin.fd + ')'); - assert( - stdout.fd === 1, - 'invalid handle for stdout (' + stdout.fd + ')' - ); - assert( - stderr.fd === 2, - 'invalid handle for stderr (' + stderr.fd + ')' - ); - }, - ensureErrnoError: function () { - if (FS.ErrnoError) return; - FS.ErrnoError = function ErrnoError(errno, node) { - this.node = node; - this.setErrno = function (errno) { - this.errno = errno; - for (var key in ERRNO_CODES) { - if (ERRNO_CODES[key] === errno) { - this.code = key; - break; - } - } - }; - this.setErrno(errno); - this.message = ERRNO_MESSAGES[errno]; - if (this.stack) { - Object.defineProperty(this, 'stack', { - value: new Error().stack, - writable: true, - }); - this.stack = demangleAll(this.stack); - } - }; - FS.ErrnoError.prototype = new Error(); - FS.ErrnoError.prototype.constructor = FS.ErrnoError; - [44].forEach(function (code) { - FS.genericErrors[code] = new FS.ErrnoError(code); - FS.genericErrors[code].stack = ''; - }); - }, - staticInit: function () { - FS.ensureErrnoError(); - FS.nameTable = new Array(4096); - FS.mount(MEMFS, {}, '/'); - FS.createDefaultDirectories(); - FS.createDefaultDevices(); - FS.createSpecialDirectories(); - FS.filesystems = { MEMFS: MEMFS }; - }, - init: function (input, output, error) { - assert( - !FS.init.initialized, - 'FS.init was previously called. If you want to initialize later with custom parameters, remove any earlier calls (note that one is automatically added to the generated code)' - ); - FS.init.initialized = true; - FS.ensureErrnoError(); - Module['stdin'] = input || Module['stdin']; - Module['stdout'] = output || Module['stdout']; - Module['stderr'] = error || Module['stderr']; - FS.createStandardStreams(); - }, - quit: function () { - FS.init.initialized = false; - var fflush = Module['_fflush']; - if (fflush) fflush(0); - for (var i = 0; i < FS.streams.length; i++) { - var stream = FS.streams[i]; - if (!stream) { - continue; - } - FS.close(stream); - } - }, - getMode: function (canRead, canWrite) { - var mode = 0; - if (canRead) mode |= 292 | 73; - if (canWrite) mode |= 146; - return mode; - }, - findObject: function (path, dontResolveLastLink) { - var ret = FS.analyzePath(path, dontResolveLastLink); - if (ret.exists) { - return ret.object; - } else { - return null; - } - }, - analyzePath: function (path, dontResolveLastLink) { - try { - var lookup = FS.lookupPath(path, { follow: !dontResolveLastLink }); - path = lookup.path; - } catch (e) {} - var ret = { - isRoot: false, - exists: false, - error: 0, - name: null, - path: null, - object: null, - parentExists: false, - parentPath: null, - parentObject: null, - }; - try { - var lookup = FS.lookupPath(path, { parent: true }); - ret.parentExists = true; - ret.parentPath = lookup.path; - ret.parentObject = lookup.node; - ret.name = PATH.basename(path); - lookup = FS.lookupPath(path, { follow: !dontResolveLastLink }); - ret.exists = true; - ret.path = lookup.path; - ret.object = lookup.node; - ret.name = lookup.node.name; - ret.isRoot = lookup.path === '/'; - } catch (e) { - ret.error = e.errno; - } - return ret; - }, - createPath: function (parent, path, canRead, canWrite) { - parent = typeof parent === 'string' ? parent : FS.getPath(parent); - var parts = path.split('/').reverse(); - while (parts.length) { - var part = parts.pop(); - if (!part) continue; - var current = PATH.join2(parent, part); - try { - FS.mkdir(current); - } catch (e) {} - parent = current; - } - return current; - }, - createFile: function (parent, name, properties, canRead, canWrite) { - var path = PATH.join2( - typeof parent === 'string' ? parent : FS.getPath(parent), - name - ); - var mode = FS.getMode(canRead, canWrite); - return FS.create(path, mode); - }, - createDataFile: function (parent, name, data, canRead, canWrite, canOwn) { - var path = name - ? PATH.join2( - typeof parent === 'string' ? parent : FS.getPath(parent), - name - ) - : parent; - var mode = FS.getMode(canRead, canWrite); - var node = FS.create(path, mode); - if (data) { - if (typeof data === 'string') { - var arr = new Array(data.length); - for (var i = 0, len = data.length; i < len; ++i) - arr[i] = data.charCodeAt(i); - data = arr; - } - FS.chmod(node, mode | 146); - var stream = FS.open(node, 577); - FS.write(stream, data, 0, data.length, 0, canOwn); - FS.close(stream); - FS.chmod(node, mode); - } - return node; - }, - createDevice: function (parent, name, input, output) { - var path = PATH.join2( - typeof parent === 'string' ? parent : FS.getPath(parent), - name - ); - var mode = FS.getMode(!!input, !!output); - if (!FS.createDevice.major) FS.createDevice.major = 64; - var dev = FS.makedev(FS.createDevice.major++, 0); - FS.registerDevice(dev, { - open: function (stream) { - stream.seekable = false; - }, - close: function (stream) { - if (output && output.buffer && output.buffer.length) { - output(10); - } - }, - read: function (stream, buffer, offset, length, pos) { - var bytesRead = 0; - for (var i = 0; i < length; i++) { - var result; - try { - result = input(); - } catch (e) { - throw new FS.ErrnoError(29); - } - if (result === undefined && bytesRead === 0) { - throw new FS.ErrnoError(6); - } - if (result === null || result === undefined) break; - bytesRead++; - buffer[offset + i] = result; - } - if (bytesRead) { - stream.node.timestamp = Date.now(); - } - return bytesRead; - }, - write: function (stream, buffer, offset, length, pos) { - for (var i = 0; i < length; i++) { - try { - output(buffer[offset + i]); - } catch (e) { - throw new FS.ErrnoError(29); - } - } - if (length) { - stream.node.timestamp = Date.now(); - } - return i; - }, - }); - return FS.mkdev(path, mode, dev); - }, - forceLoadFile: function (obj) { - if (obj.isDevice || obj.isFolder || obj.link || obj.contents) - return true; - if (typeof XMLHttpRequest !== 'undefined') { - throw new Error( - 'Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.' - ); - } else if (read_) { - try { - obj.contents = intArrayFromString(read_(obj.url), true); - obj.usedBytes = obj.contents.length; - } catch (e) { - throw new FS.ErrnoError(29); - } - } else { - throw new Error('Cannot load without read() or XMLHttpRequest.'); - } - }, - createLazyFile: function (parent, name, url, canRead, canWrite) { - function LazyUint8Array() { - this.lengthKnown = false; - this.chunks = []; - } - LazyUint8Array.prototype.get = function LazyUint8Array_get(idx) { - if (idx > this.length - 1 || idx < 0) { - return undefined; - } - var chunkOffset = idx % this.chunkSize; - var chunkNum = (idx / this.chunkSize) | 0; - return this.getter(chunkNum)[chunkOffset]; - }; - LazyUint8Array.prototype.setDataGetter = - function LazyUint8Array_setDataGetter(getter) { - this.getter = getter; - }; - LazyUint8Array.prototype.cacheLength = - function LazyUint8Array_cacheLength() { - var xhr = new XMLHttpRequest(); - xhr.open('HEAD', url, false); - xhr.send(null); - if ( - !((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304) - ) - throw new Error( - "Couldn't load " + url + '. Status: ' + xhr.status - ); - var datalength = Number(xhr.getResponseHeader('Content-length')); - var header; - var hasByteServing = - (header = xhr.getResponseHeader('Accept-Ranges')) && - header === 'bytes'; - var usesGzip = - (header = xhr.getResponseHeader('Content-Encoding')) && - header === 'gzip'; - var chunkSize = 1024 * 1024; - if (!hasByteServing) chunkSize = datalength; - var doXHR = function (from, to) { - if (from > to) - throw new Error( - 'invalid range (' + - from + - ', ' + - to + - ') or no bytes requested!' - ); - if (to > datalength - 1) - throw new Error( - 'only ' + datalength + ' bytes available! programmer error!' - ); - var xhr = new XMLHttpRequest(); - xhr.open('GET', url, false); - if (datalength !== chunkSize) - xhr.setRequestHeader('Range', 'bytes=' + from + '-' + to); - if (typeof Uint8Array != 'undefined') - xhr.responseType = 'arraybuffer'; - if (xhr.overrideMimeType) { - xhr.overrideMimeType('text/plain; charset=x-user-defined'); - } - xhr.send(null); - if ( - !((xhr.status >= 200 && xhr.status < 300) || xhr.status === 304) - ) - throw new Error( - "Couldn't load " + url + '. Status: ' + xhr.status - ); - if (xhr.response !== undefined) { - return new Uint8Array(xhr.response || []); - } else { - return intArrayFromString(xhr.responseText || '', true); - } - }; - var lazyArray = this; - lazyArray.setDataGetter(function (chunkNum) { - var start = chunkNum * chunkSize; - var end = (chunkNum + 1) * chunkSize - 1; - end = Math.min(end, datalength - 1); - if (typeof lazyArray.chunks[chunkNum] === 'undefined') { - lazyArray.chunks[chunkNum] = doXHR(start, end); - } - if (typeof lazyArray.chunks[chunkNum] === 'undefined') - throw new Error('doXHR failed!'); - return lazyArray.chunks[chunkNum]; - }); - if (usesGzip || !datalength) { - chunkSize = datalength = 1; - datalength = this.getter(0).length; - chunkSize = datalength; - out( - 'LazyFiles on gzip forces download of the whole file when length is accessed' - ); - } - this._length = datalength; - this._chunkSize = chunkSize; - this.lengthKnown = true; - }; - if (typeof XMLHttpRequest !== 'undefined') { - if (!ENVIRONMENT_IS_WORKER) - throw 'Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc'; - var lazyArray = new LazyUint8Array(); - Object.defineProperties(lazyArray, { - length: { - get: function () { - if (!this.lengthKnown) { - this.cacheLength(); - } - return this._length; - }, - }, - chunkSize: { - get: function () { - if (!this.lengthKnown) { - this.cacheLength(); - } - return this._chunkSize; - }, - }, - }); - var properties = { isDevice: false, contents: lazyArray }; - } else { - var properties = { isDevice: false, url: url }; - } - var node = FS.createFile(parent, name, properties, canRead, canWrite); - if (properties.contents) { - node.contents = properties.contents; - } else if (properties.url) { - node.contents = null; - node.url = properties.url; - } - Object.defineProperties(node, { - usedBytes: { - get: function () { - return this.contents.length; - }, - }, - }); - var stream_ops = {}; - var keys = Object.keys(node.stream_ops); - keys.forEach(function (key) { - var fn = node.stream_ops[key]; - stream_ops[key] = function forceLoadLazyFile() { - FS.forceLoadFile(node); - return fn.apply(null, arguments); - }; - }); - stream_ops.read = function stream_ops_read( - stream, - buffer, - offset, - length, - position - ) { - FS.forceLoadFile(node); - var contents = stream.node.contents; - if (position >= contents.length) return 0; - var size = Math.min(contents.length - position, length); - assert(size >= 0); - if (contents.slice) { - for (var i = 0; i < size; i++) { - buffer[offset + i] = contents[position + i]; - } - } else { - for (var i = 0; i < size; i++) { - buffer[offset + i] = contents.get(position + i); - } - } - return size; - }; - node.stream_ops = stream_ops; - return node; - }, - createPreloadedFile: function ( - parent, - name, - url, - canRead, - canWrite, - onload, - onerror, - dontCreateFile, - canOwn, - preFinish - ) { - Browser.init(); - var fullname = name - ? PATH_FS.resolve(PATH.join2(parent, name)) - : parent; - var dep = getUniqueRunDependency('cp ' + fullname); - function processData(byteArray) { - function finish(byteArray) { - if (preFinish) preFinish(); - if (!dontCreateFile) { - FS.createDataFile( - parent, - name, - byteArray, - canRead, - canWrite, - canOwn - ); - } - if (onload) onload(); - removeRunDependency(dep); - } - var handled = false; - Module['preloadPlugins'].forEach(function (plugin) { - if (handled) return; - if (plugin['canHandle'](fullname)) { - plugin['handle'](byteArray, fullname, finish, function () { - if (onerror) onerror(); - removeRunDependency(dep); - }); - handled = true; - } - }); - if (!handled) finish(byteArray); - } - addRunDependency(dep); - if (typeof url == 'string') { - Browser.asyncLoad( - url, - function (byteArray) { - processData(byteArray); - }, - onerror - ); - } else { - processData(url); - } - }, - indexedDB: function () { - return ( - window.indexedDB || - window.mozIndexedDB || - window.webkitIndexedDB || - window.msIndexedDB - ); - }, - DB_NAME: function () { - return 'EM_FS_' + window.location.pathname; - }, - DB_VERSION: 20, - DB_STORE_NAME: 'FILE_DATA', - saveFilesToDB: function (paths, onload, onerror) { - onload = onload || function () {}; - onerror = onerror || function () {}; - var indexedDB = FS.indexedDB(); - try { - var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION); - } catch (e) { - return onerror(e); - } - openRequest.onupgradeneeded = function openRequest_onupgradeneeded() { - out('creating db'); - var db = openRequest.result; - db.createObjectStore(FS.DB_STORE_NAME); - }; - openRequest.onsuccess = function openRequest_onsuccess() { - var db = openRequest.result; - var transaction = db.transaction([FS.DB_STORE_NAME], 'readwrite'); - var files = transaction.objectStore(FS.DB_STORE_NAME); - var ok = 0, - fail = 0, - total = paths.length; - function finish() { - if (fail == 0) onload(); - else onerror(); - } - paths.forEach(function (path) { - var putRequest = files.put( - FS.analyzePath(path).object.contents, - path - ); - putRequest.onsuccess = function putRequest_onsuccess() { - ok++; - if (ok + fail == total) finish(); - }; - putRequest.onerror = function putRequest_onerror() { - fail++; - if (ok + fail == total) finish(); - }; - }); - transaction.onerror = onerror; - }; - openRequest.onerror = onerror; - }, - loadFilesFromDB: function (paths, onload, onerror) { - onload = onload || function () {}; - onerror = onerror || function () {}; - var indexedDB = FS.indexedDB(); - try { - var openRequest = indexedDB.open(FS.DB_NAME(), FS.DB_VERSION); - } catch (e) { - return onerror(e); - } - openRequest.onupgradeneeded = onerror; - openRequest.onsuccess = function openRequest_onsuccess() { - var db = openRequest.result; - try { - var transaction = db.transaction([FS.DB_STORE_NAME], 'readonly'); - } catch (e) { - onerror(e); - return; - } - var files = transaction.objectStore(FS.DB_STORE_NAME); - var ok = 0, - fail = 0, - total = paths.length; - function finish() { - if (fail == 0) onload(); - else onerror(); - } - paths.forEach(function (path) { - var getRequest = files.get(path); - getRequest.onsuccess = function getRequest_onsuccess() { - if (FS.analyzePath(path).exists) { - FS.unlink(path); - } - FS.createDataFile( - PATH.dirname(path), - PATH.basename(path), - getRequest.result, - true, - true, - true - ); - ok++; - if (ok + fail == total) finish(); - }; - getRequest.onerror = function getRequest_onerror() { - fail++; - if (ok + fail == total) finish(); - }; - }); - transaction.onerror = onerror; - }; - openRequest.onerror = onerror; - }, - absolutePath: function () { - abort('FS.absolutePath has been removed; use PATH_FS.resolve instead'); - }, - createFolder: function () { - abort('FS.createFolder has been removed; use FS.mkdir instead'); - }, - createLink: function () { - abort('FS.createLink has been removed; use FS.symlink instead'); - }, - joinPath: function () { - abort('FS.joinPath has been removed; use PATH.join instead'); - }, - mmapAlloc: function () { - abort( - 'FS.mmapAlloc has been replaced by the top level function mmapAlloc' - ); - }, - standardizePath: function () { - abort( - 'FS.standardizePath has been removed; use PATH.normalize instead' - ); - }, - }; - var SYSCALLS = { - mappings: {}, - DEFAULT_POLLMASK: 5, - umask: 511, - calculateAt: function (dirfd, path, allowEmpty) { - if (path[0] === '/') { - return path; - } - var dir; - if (dirfd === -100) { - dir = FS.cwd(); - } else { - var dirstream = FS.getStream(dirfd); - if (!dirstream) throw new FS.ErrnoError(8); - dir = dirstream.path; - } - if (path.length == 0) { - if (!allowEmpty) { - throw new FS.ErrnoError(44); - } - return dir; - } - return PATH.join2(dir, path); - }, - doStat: function (func, path, buf) { - try { - var stat = func(path); - } catch (e) { - if ( - e && - e.node && - PATH.normalize(path) !== PATH.normalize(FS.getPath(e.node)) - ) { - return -54; - } - throw e; - } - HEAP32[buf >> 2] = stat.dev; - HEAP32[(buf + 4) >> 2] = 0; - HEAP32[(buf + 8) >> 2] = stat.ino; - HEAP32[(buf + 12) >> 2] = stat.mode; - HEAP32[(buf + 16) >> 2] = stat.nlink; - HEAP32[(buf + 20) >> 2] = stat.uid; - HEAP32[(buf + 24) >> 2] = stat.gid; - HEAP32[(buf + 28) >> 2] = stat.rdev; - HEAP32[(buf + 32) >> 2] = 0; - (tempI64 = [ - stat.size >>> 0, - ((tempDouble = stat.size), - +Math.abs(tempDouble) >= 1 - ? tempDouble > 0 - ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | - 0) >>> - 0 - : ~~+Math.ceil( - (tempDouble - +(~~tempDouble >>> 0)) / 4294967296 - ) >>> 0 - : 0), - ]), - (HEAP32[(buf + 40) >> 2] = tempI64[0]), - (HEAP32[(buf + 44) >> 2] = tempI64[1]); - HEAP32[(buf + 48) >> 2] = 4096; - HEAP32[(buf + 52) >> 2] = stat.blocks; - HEAP32[(buf + 56) >> 2] = (stat.atime.getTime() / 1e3) | 0; - HEAP32[(buf + 60) >> 2] = 0; - HEAP32[(buf + 64) >> 2] = (stat.mtime.getTime() / 1e3) | 0; - HEAP32[(buf + 68) >> 2] = 0; - HEAP32[(buf + 72) >> 2] = (stat.ctime.getTime() / 1e3) | 0; - HEAP32[(buf + 76) >> 2] = 0; - (tempI64 = [ - stat.ino >>> 0, - ((tempDouble = stat.ino), - +Math.abs(tempDouble) >= 1 - ? tempDouble > 0 - ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | - 0) >>> - 0 - : ~~+Math.ceil( - (tempDouble - +(~~tempDouble >>> 0)) / 4294967296 - ) >>> 0 - : 0), - ]), - (HEAP32[(buf + 80) >> 2] = tempI64[0]), - (HEAP32[(buf + 84) >> 2] = tempI64[1]); - return 0; - }, - doMsync: function (addr, stream, len, flags, offset) { - var buffer = HEAPU8.slice(addr, addr + len); - FS.msync(stream, buffer, offset, len, flags); - }, - doMkdir: function (path, mode) { - path = PATH.normalize(path); - if (path[path.length - 1] === '/') - path = path.substr(0, path.length - 1); - FS.mkdir(path, mode, 0); - return 0; - }, - doMknod: function (path, mode, dev) { - switch (mode & 61440) { - case 32768: - case 8192: - case 24576: - case 4096: - case 49152: - break; - default: - return -28; - } - FS.mknod(path, mode, dev); - return 0; - }, - doReadlink: function (path, buf, bufsize) { - if (bufsize <= 0) return -28; - var ret = FS.readlink(path); - var len = Math.min(bufsize, lengthBytesUTF8(ret)); - var endChar = HEAP8[buf + len]; - stringToUTF8(ret, buf, bufsize + 1); - HEAP8[buf + len] = endChar; - return len; - }, - doAccess: function (path, amode) { - if (amode & ~7) { - return -28; - } - var node; - var lookup = FS.lookupPath(path, { follow: true }); - node = lookup.node; - if (!node) { - return -44; - } - var perms = ''; - if (amode & 4) perms += 'r'; - if (amode & 2) perms += 'w'; - if (amode & 1) perms += 'x'; - if (perms && FS.nodePermissions(node, perms)) { - return -2; - } - return 0; - }, - doDup: function (path, flags, suggestFD) { - var suggest = FS.getStream(suggestFD); - if (suggest) FS.close(suggest); - return FS.open(path, flags, 0, suggestFD, suggestFD).fd; - }, - doReadv: function (stream, iov, iovcnt, offset) { - var ret = 0; - for (var i = 0; i < iovcnt; i++) { - var ptr = HEAP32[(iov + i * 8) >> 2]; - var len = HEAP32[(iov + (i * 8 + 4)) >> 2]; - var curr = FS.read(stream, HEAP8, ptr, len, offset); - if (curr < 0) return -1; - ret += curr; - if (curr < len) break; - } - return ret; - }, - doWritev: function (stream, iov, iovcnt, offset) { - var ret = 0; - for (var i = 0; i < iovcnt; i++) { - var ptr = HEAP32[(iov + i * 8) >> 2]; - var len = HEAP32[(iov + (i * 8 + 4)) >> 2]; - var curr = FS.write(stream, HEAP8, ptr, len, offset); - if (curr < 0) return -1; - ret += curr; - } - return ret; - }, - varargs: undefined, - get: function () { - assert(SYSCALLS.varargs != undefined); - SYSCALLS.varargs += 4; - var ret = HEAP32[(SYSCALLS.varargs - 4) >> 2]; - return ret; - }, - getStr: function (ptr) { - var ret = UTF8ToString(ptr); - return ret; - }, - getStreamFromFD: function (fd) { - var stream = FS.getStream(fd); - if (!stream) throw new FS.ErrnoError(8); - return stream; - }, - get64: function (low, high) { - if (low >= 0) assert(high === 0); - else assert(high === -1); - return low; - }, - }; - function ___sys_getrusage(who, usage) { - try { - _memset(usage, 0, 136); - HEAP32[usage >> 2] = 1; - HEAP32[(usage + 4) >> 2] = 2; - HEAP32[(usage + 8) >> 2] = 3; - HEAP32[(usage + 12) >> 2] = 4; - return 0; - } catch (e) { - if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) - abort(e); - return -e.errno; - } - } - function __embind_register_bigint( - primitiveType, - name, - size, - minRange, - maxRange - ) {} - function getShiftFromSize(size) { - switch (size) { - case 1: - return 0; - case 2: - return 1; - case 4: - return 2; - case 8: - return 3; - default: - throw new TypeError('Unknown type size: ' + size); - } - } - function embind_init_charCodes() { - var codes = new Array(256); - for (var i = 0; i < 256; ++i) { - codes[i] = String.fromCharCode(i); - } - embind_charCodes = codes; - } - var embind_charCodes = undefined; - function readLatin1String(ptr) { - var ret = ''; - var c = ptr; - while (HEAPU8[c]) { - ret += embind_charCodes[HEAPU8[c++]]; - } - return ret; - } - var awaitingDependencies = {}; - var registeredTypes = {}; - var typeDependencies = {}; - var char_0 = 48; - var char_9 = 57; - function makeLegalFunctionName(name) { - if (undefined === name) { - return '_unknown'; - } - name = name.replace(/[^a-zA-Z0-9_]/g, '$'); - var f = name.charCodeAt(0); - if (f >= char_0 && f <= char_9) { - return '_' + name; - } else { - return name; - } - } - function createNamedFunction(name, body) { - name = makeLegalFunctionName(name); - return new Function( - 'body', - 'return function ' + - name + - '() {\n' + - ' "use strict";' + - ' return body.apply(this, arguments);\n' + - '};\n' - )(body); - } - function extendError(baseErrorType, errorName) { - var errorClass = createNamedFunction(errorName, function (message) { - this.name = errorName; - this.message = message; - var stack = new Error(message).stack; - if (stack !== undefined) { - this.stack = - this.toString() + '\n' + stack.replace(/^Error(:[^\n]*)?\n/, ''); - } - }); - errorClass.prototype = Object.create(baseErrorType.prototype); - errorClass.prototype.constructor = errorClass; - errorClass.prototype.toString = function () { - if (this.message === undefined) { - return this.name; - } else { - return this.name + ': ' + this.message; - } - }; - return errorClass; - } - var BindingError = undefined; - function throwBindingError(message) { - throw new BindingError(message); - } - var InternalError = undefined; - function throwInternalError(message) { - throw new InternalError(message); - } - function whenDependentTypesAreResolved( - myTypes, - dependentTypes, - getTypeConverters - ) { - myTypes.forEach(function (type) { - typeDependencies[type] = dependentTypes; - }); - function onComplete(typeConverters) { - var myTypeConverters = getTypeConverters(typeConverters); - if (myTypeConverters.length !== myTypes.length) { - throwInternalError('Mismatched type converter count'); - } - for (var i = 0; i < myTypes.length; ++i) { - registerType(myTypes[i], myTypeConverters[i]); - } - } - var typeConverters = new Array(dependentTypes.length); - var unregisteredTypes = []; - var registered = 0; - dependentTypes.forEach(function (dt, i) { - if (registeredTypes.hasOwnProperty(dt)) { - typeConverters[i] = registeredTypes[dt]; - } else { - unregisteredTypes.push(dt); - if (!awaitingDependencies.hasOwnProperty(dt)) { - awaitingDependencies[dt] = []; - } - awaitingDependencies[dt].push(function () { - typeConverters[i] = registeredTypes[dt]; - ++registered; - if (registered === unregisteredTypes.length) { - onComplete(typeConverters); - } - }); - } - }); - if (0 === unregisteredTypes.length) { - onComplete(typeConverters); - } - } - function registerType(rawType, registeredInstance, options) { - options = options || {}; - if (!('argPackAdvance' in registeredInstance)) { - throw new TypeError( - 'registerType registeredInstance requires argPackAdvance' - ); - } - var name = registeredInstance.name; - if (!rawType) { - throwBindingError( - 'type "' + name + '" must have a positive integer typeid pointer' - ); - } - if (registeredTypes.hasOwnProperty(rawType)) { - if (options.ignoreDuplicateRegistrations) { - return; - } else { - throwBindingError("Cannot register type '" + name + "' twice"); - } - } - registeredTypes[rawType] = registeredInstance; - delete typeDependencies[rawType]; - if (awaitingDependencies.hasOwnProperty(rawType)) { - var callbacks = awaitingDependencies[rawType]; - delete awaitingDependencies[rawType]; - callbacks.forEach(function (cb) { - cb(); - }); - } - } - function __embind_register_bool( - rawType, - name, - size, - trueValue, - falseValue - ) { - var shift = getShiftFromSize(size); - name = readLatin1String(name); - registerType(rawType, { - name: name, - fromWireType: function (wt) { - return !!wt; - }, - toWireType: function (destructors, o) { - return o ? trueValue : falseValue; - }, - argPackAdvance: 8, - readValueFromPointer: function (pointer) { - var heap; - if (size === 1) { - heap = HEAP8; - } else if (size === 2) { - heap = HEAP16; - } else if (size === 4) { - heap = HEAP32; - } else { - throw new TypeError('Unknown boolean type size: ' + name); - } - return this['fromWireType'](heap[pointer >> shift]); - }, - destructorFunction: null, - }); - } - function ClassHandle_isAliasOf(other) { - if (!(this instanceof ClassHandle)) { - return false; - } - if (!(other instanceof ClassHandle)) { - return false; - } - var leftClass = this.$$.ptrType.registeredClass; - var left = this.$$.ptr; - var rightClass = other.$$.ptrType.registeredClass; - var right = other.$$.ptr; - while (leftClass.baseClass) { - left = leftClass.upcast(left); - leftClass = leftClass.baseClass; - } - while (rightClass.baseClass) { - right = rightClass.upcast(right); - rightClass = rightClass.baseClass; - } - return leftClass === rightClass && left === right; - } - function shallowCopyInternalPointer(o) { - return { - count: o.count, - deleteScheduled: o.deleteScheduled, - preservePointerOnDelete: o.preservePointerOnDelete, - ptr: o.ptr, - ptrType: o.ptrType, - smartPtr: o.smartPtr, - smartPtrType: o.smartPtrType, - }; - } - function throwInstanceAlreadyDeleted(obj) { - function getInstanceTypeName(handle) { - return handle.$$.ptrType.registeredClass.name; - } - throwBindingError(getInstanceTypeName(obj) + ' instance already deleted'); - } - var finalizationGroup = false; - function detachFinalizer(handle) {} - function runDestructor($$) { - if ($$.smartPtr) { - $$.smartPtrType.rawDestructor($$.smartPtr); - } else { - $$.ptrType.registeredClass.rawDestructor($$.ptr); - } - } - function releaseClassHandle($$) { - $$.count.value -= 1; - var toDelete = 0 === $$.count.value; - if (toDelete) { - runDestructor($$); - } - } - function attachFinalizer(handle) { - if ('undefined' === typeof FinalizationGroup) { - attachFinalizer = function (handle) { - return handle; - }; - return handle; - } - finalizationGroup = new FinalizationGroup(function (iter) { - for (var result = iter.next(); !result.done; result = iter.next()) { - var $$ = result.value; - if (!$$.ptr) { - console.warn('object already deleted: ' + $$.ptr); - } else { - releaseClassHandle($$); - } - } - }); - attachFinalizer = function (handle) { - finalizationGroup.register(handle, handle.$$, handle.$$); - return handle; - }; - detachFinalizer = function (handle) { - finalizationGroup.unregister(handle.$$); - }; - return attachFinalizer(handle); - } - function ClassHandle_clone() { - if (!this.$$.ptr) { - throwInstanceAlreadyDeleted(this); - } - if (this.$$.preservePointerOnDelete) { - this.$$.count.value += 1; - return this; - } else { - var clone = attachFinalizer( - Object.create(Object.getPrototypeOf(this), { - $$: { value: shallowCopyInternalPointer(this.$$) }, - }) - ); - clone.$$.count.value += 1; - clone.$$.deleteScheduled = false; - return clone; - } - } - function ClassHandle_delete() { - if (!this.$$.ptr) { - throwInstanceAlreadyDeleted(this); - } - if (this.$$.deleteScheduled && !this.$$.preservePointerOnDelete) { - throwBindingError('Object already scheduled for deletion'); - } - detachFinalizer(this); - releaseClassHandle(this.$$); - if (!this.$$.preservePointerOnDelete) { - this.$$.smartPtr = undefined; - this.$$.ptr = undefined; - } - } - function ClassHandle_isDeleted() { - return !this.$$.ptr; - } - var delayFunction = undefined; - var deletionQueue = []; - function flushPendingDeletes() { - while (deletionQueue.length) { - var obj = deletionQueue.pop(); - obj.$$.deleteScheduled = false; - obj['delete'](); - } - } - function ClassHandle_deleteLater() { - if (!this.$$.ptr) { - throwInstanceAlreadyDeleted(this); - } - if (this.$$.deleteScheduled && !this.$$.preservePointerOnDelete) { - throwBindingError('Object already scheduled for deletion'); - } - deletionQueue.push(this); - if (deletionQueue.length === 1 && delayFunction) { - delayFunction(flushPendingDeletes); - } - this.$$.deleteScheduled = true; - return this; - } - function init_ClassHandle() { - ClassHandle.prototype['isAliasOf'] = ClassHandle_isAliasOf; - ClassHandle.prototype['clone'] = ClassHandle_clone; - ClassHandle.prototype['delete'] = ClassHandle_delete; - ClassHandle.prototype['isDeleted'] = ClassHandle_isDeleted; - ClassHandle.prototype['deleteLater'] = ClassHandle_deleteLater; - } - function ClassHandle() {} - var registeredPointers = {}; - function ensureOverloadTable(proto, methodName, humanName) { - if (undefined === proto[methodName].overloadTable) { - var prevFunc = proto[methodName]; - proto[methodName] = function () { - if ( - !proto[methodName].overloadTable.hasOwnProperty(arguments.length) - ) { - throwBindingError( - "Function '" + - humanName + - "' called with an invalid number of arguments (" + - arguments.length + - ') - expects one of (' + - proto[methodName].overloadTable + - ')!' - ); - } - return proto[methodName].overloadTable[arguments.length].apply( - this, - arguments - ); - }; - proto[methodName].overloadTable = []; - proto[methodName].overloadTable[prevFunc.argCount] = prevFunc; - } - } - function exposePublicSymbol(name, value, numArguments) { - if (Module.hasOwnProperty(name)) { - if ( - undefined === numArguments || - (undefined !== Module[name].overloadTable && - undefined !== Module[name].overloadTable[numArguments]) - ) { - throwBindingError("Cannot register public name '" + name + "' twice"); - } - ensureOverloadTable(Module, name, name); - if (Module.hasOwnProperty(numArguments)) { - throwBindingError( - 'Cannot register multiple overloads of a function with the same number of arguments (' + - numArguments + - ')!' - ); - } - Module[name].overloadTable[numArguments] = value; - } else { - Module[name] = value; - if (undefined !== numArguments) { - Module[name].numArguments = numArguments; - } - } - } - function RegisteredClass( - name, - constructor, - instancePrototype, - rawDestructor, - baseClass, - getActualType, - upcast, - downcast - ) { - this.name = name; - this.constructor = constructor; - this.instancePrototype = instancePrototype; - this.rawDestructor = rawDestructor; - this.baseClass = baseClass; - this.getActualType = getActualType; - this.upcast = upcast; - this.downcast = downcast; - this.pureVirtualFunctions = []; - } - function upcastPointer(ptr, ptrClass, desiredClass) { - while (ptrClass !== desiredClass) { - if (!ptrClass.upcast) { - throwBindingError( - 'Expected null or instance of ' + - desiredClass.name + - ', got an instance of ' + - ptrClass.name - ); - } - ptr = ptrClass.upcast(ptr); - ptrClass = ptrClass.baseClass; - } - return ptr; - } - function constNoSmartPtrRawPointerToWireType(destructors, handle) { - if (handle === null) { - if (this.isReference) { - throwBindingError('null is not a valid ' + this.name); - } - return 0; - } - if (!handle.$$) { - throwBindingError( - 'Cannot pass "' + _embind_repr(handle) + '" as a ' + this.name - ); - } - if (!handle.$$.ptr) { - throwBindingError( - 'Cannot pass deleted object as a pointer of type ' + this.name - ); - } - var handleClass = handle.$$.ptrType.registeredClass; - var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass); - return ptr; - } - function genericPointerToWireType(destructors, handle) { - var ptr; - if (handle === null) { - if (this.isReference) { - throwBindingError('null is not a valid ' + this.name); - } - if (this.isSmartPointer) { - ptr = this.rawConstructor(); - if (destructors !== null) { - destructors.push(this.rawDestructor, ptr); - } - return ptr; - } else { - return 0; - } - } - if (!handle.$$) { - throwBindingError( - 'Cannot pass "' + _embind_repr(handle) + '" as a ' + this.name - ); - } - if (!handle.$$.ptr) { - throwBindingError( - 'Cannot pass deleted object as a pointer of type ' + this.name - ); - } - if (!this.isConst && handle.$$.ptrType.isConst) { - throwBindingError( - 'Cannot convert argument of type ' + - (handle.$$.smartPtrType - ? handle.$$.smartPtrType.name - : handle.$$.ptrType.name) + - ' to parameter type ' + - this.name - ); - } - var handleClass = handle.$$.ptrType.registeredClass; - ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass); - if (this.isSmartPointer) { - if (undefined === handle.$$.smartPtr) { - throwBindingError('Passing raw pointer to smart pointer is illegal'); - } - switch (this.sharingPolicy) { - case 0: - if (handle.$$.smartPtrType === this) { - ptr = handle.$$.smartPtr; - } else { - throwBindingError( - 'Cannot convert argument of type ' + - (handle.$$.smartPtrType - ? handle.$$.smartPtrType.name - : handle.$$.ptrType.name) + - ' to parameter type ' + - this.name - ); - } - break; - case 1: - ptr = handle.$$.smartPtr; - break; - case 2: - if (handle.$$.smartPtrType === this) { - ptr = handle.$$.smartPtr; - } else { - var clonedHandle = handle['clone'](); - ptr = this.rawShare( - ptr, - __emval_register(function () { - clonedHandle['delete'](); - }) - ); - if (destructors !== null) { - destructors.push(this.rawDestructor, ptr); - } - } - break; - default: - throwBindingError('Unsupporting sharing policy'); - } - } - return ptr; - } - function nonConstNoSmartPtrRawPointerToWireType(destructors, handle) { - if (handle === null) { - if (this.isReference) { - throwBindingError('null is not a valid ' + this.name); - } - return 0; - } - if (!handle.$$) { - throwBindingError( - 'Cannot pass "' + _embind_repr(handle) + '" as a ' + this.name - ); - } - if (!handle.$$.ptr) { - throwBindingError( - 'Cannot pass deleted object as a pointer of type ' + this.name - ); - } - if (handle.$$.ptrType.isConst) { - throwBindingError( - 'Cannot convert argument of type ' + - handle.$$.ptrType.name + - ' to parameter type ' + - this.name - ); - } - var handleClass = handle.$$.ptrType.registeredClass; - var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass); - return ptr; - } - function simpleReadValueFromPointer(pointer) { - return this['fromWireType'](HEAPU32[pointer >> 2]); - } - function RegisteredPointer_getPointee(ptr) { - if (this.rawGetPointee) { - ptr = this.rawGetPointee(ptr); - } - return ptr; - } - function RegisteredPointer_destructor(ptr) { - if (this.rawDestructor) { - this.rawDestructor(ptr); - } - } - function RegisteredPointer_deleteObject(handle) { - if (handle !== null) { - handle['delete'](); - } - } - function downcastPointer(ptr, ptrClass, desiredClass) { - if (ptrClass === desiredClass) { - return ptr; - } - if (undefined === desiredClass.baseClass) { - return null; - } - var rv = downcastPointer(ptr, ptrClass, desiredClass.baseClass); - if (rv === null) { - return null; - } - return desiredClass.downcast(rv); - } - function getInheritedInstanceCount() { - return Object.keys(registeredInstances).length; - } - function getLiveInheritedInstances() { - var rv = []; - for (var k in registeredInstances) { - if (registeredInstances.hasOwnProperty(k)) { - rv.push(registeredInstances[k]); - } - } - return rv; - } - function setDelayFunction(fn) { - delayFunction = fn; - if (deletionQueue.length && delayFunction) { - delayFunction(flushPendingDeletes); - } - } - function init_embind() { - Module['getInheritedInstanceCount'] = getInheritedInstanceCount; - Module['getLiveInheritedInstances'] = getLiveInheritedInstances; - Module['flushPendingDeletes'] = flushPendingDeletes; - Module['setDelayFunction'] = setDelayFunction; - } - var registeredInstances = {}; - function getBasestPointer(class_, ptr) { - if (ptr === undefined) { - throwBindingError('ptr should not be undefined'); - } - while (class_.baseClass) { - ptr = class_.upcast(ptr); - class_ = class_.baseClass; - } - return ptr; - } - function getInheritedInstance(class_, ptr) { - ptr = getBasestPointer(class_, ptr); - return registeredInstances[ptr]; - } - function makeClassHandle(prototype, record) { - if (!record.ptrType || !record.ptr) { - throwInternalError('makeClassHandle requires ptr and ptrType'); - } - var hasSmartPtrType = !!record.smartPtrType; - var hasSmartPtr = !!record.smartPtr; - if (hasSmartPtrType !== hasSmartPtr) { - throwInternalError('Both smartPtrType and smartPtr must be specified'); - } - record.count = { value: 1 }; - return attachFinalizer( - Object.create(prototype, { $$: { value: record } }) - ); - } - function RegisteredPointer_fromWireType(ptr) { - var rawPointer = this.getPointee(ptr); - if (!rawPointer) { - this.destructor(ptr); - return null; - } - var registeredInstance = getInheritedInstance( - this.registeredClass, - rawPointer - ); - if (undefined !== registeredInstance) { - if (0 === registeredInstance.$$.count.value) { - registeredInstance.$$.ptr = rawPointer; - registeredInstance.$$.smartPtr = ptr; - return registeredInstance['clone'](); - } else { - var rv = registeredInstance['clone'](); - this.destructor(ptr); - return rv; - } - } - function makeDefaultHandle() { - if (this.isSmartPointer) { - return makeClassHandle(this.registeredClass.instancePrototype, { - ptrType: this.pointeeType, - ptr: rawPointer, - smartPtrType: this, - smartPtr: ptr, - }); - } else { - return makeClassHandle(this.registeredClass.instancePrototype, { - ptrType: this, - ptr: ptr, - }); - } - } - var actualType = this.registeredClass.getActualType(rawPointer); - var registeredPointerRecord = registeredPointers[actualType]; - if (!registeredPointerRecord) { - return makeDefaultHandle.call(this); - } - var toType; - if (this.isConst) { - toType = registeredPointerRecord.constPointerType; - } else { - toType = registeredPointerRecord.pointerType; - } - var dp = downcastPointer( - rawPointer, - this.registeredClass, - toType.registeredClass - ); - if (dp === null) { - return makeDefaultHandle.call(this); - } - if (this.isSmartPointer) { - return makeClassHandle(toType.registeredClass.instancePrototype, { - ptrType: toType, - ptr: dp, - smartPtrType: this, - smartPtr: ptr, - }); - } else { - return makeClassHandle(toType.registeredClass.instancePrototype, { - ptrType: toType, - ptr: dp, - }); - } - } - function init_RegisteredPointer() { - RegisteredPointer.prototype.getPointee = RegisteredPointer_getPointee; - RegisteredPointer.prototype.destructor = RegisteredPointer_destructor; - RegisteredPointer.prototype['argPackAdvance'] = 8; - RegisteredPointer.prototype['readValueFromPointer'] = - simpleReadValueFromPointer; - RegisteredPointer.prototype['deleteObject'] = - RegisteredPointer_deleteObject; - RegisteredPointer.prototype['fromWireType'] = - RegisteredPointer_fromWireType; - } - function RegisteredPointer( - name, - registeredClass, - isReference, - isConst, - isSmartPointer, - pointeeType, - sharingPolicy, - rawGetPointee, - rawConstructor, - rawShare, - rawDestructor - ) { - this.name = name; - this.registeredClass = registeredClass; - this.isReference = isReference; - this.isConst = isConst; - this.isSmartPointer = isSmartPointer; - this.pointeeType = pointeeType; - this.sharingPolicy = sharingPolicy; - this.rawGetPointee = rawGetPointee; - this.rawConstructor = rawConstructor; - this.rawShare = rawShare; - this.rawDestructor = rawDestructor; - if (!isSmartPointer && registeredClass.baseClass === undefined) { - if (isConst) { - this['toWireType'] = constNoSmartPtrRawPointerToWireType; - this.destructorFunction = null; - } else { - this['toWireType'] = nonConstNoSmartPtrRawPointerToWireType; - this.destructorFunction = null; - } - } else { - this['toWireType'] = genericPointerToWireType; - } - } - function replacePublicSymbol(name, value, numArguments) { - if (!Module.hasOwnProperty(name)) { - throwInternalError('Replacing nonexistant public symbol'); - } - if ( - undefined !== Module[name].overloadTable && - undefined !== numArguments - ) { - Module[name].overloadTable[numArguments] = value; - } else { - Module[name] = value; - Module[name].argCount = numArguments; - } - } - function dynCallLegacy(sig, ptr, args) { - assert( - 'dynCall_' + sig in Module, - "bad function pointer type - no table for sig '" + sig + "'" - ); - if (args && args.length) { - assert(args.length === sig.substring(1).replace(/j/g, '--').length); - } else { - assert(sig.length == 1); - } - var f = Module['dynCall_' + sig]; - return args && args.length - ? f.apply(null, [ptr].concat(args)) - : f.call(null, ptr); - } - function dynCall(sig, ptr, args) { - if (sig.includes('j')) { - return dynCallLegacy(sig, ptr, args); - } - assert(wasmTable.get(ptr), 'missing table entry in dynCall: ' + ptr); - return wasmTable.get(ptr).apply(null, args); - } - function getDynCaller(sig, ptr) { - assert( - sig.includes('j'), - 'getDynCaller should only be called with i64 sigs' - ); - var argCache = []; - return function () { - argCache.length = arguments.length; - for (var i = 0; i < arguments.length; i++) { - argCache[i] = arguments[i]; - } - return dynCall(sig, ptr, argCache); - }; - } - function embind__requireFunction(signature, rawFunction) { - signature = readLatin1String(signature); - function makeDynCaller() { - if (signature.includes('j')) { - return getDynCaller(signature, rawFunction); - } - return wasmTable.get(rawFunction); - } - var fp = makeDynCaller(); - if (typeof fp !== 'function') { - throwBindingError( - 'unknown function pointer with signature ' + - signature + - ': ' + - rawFunction - ); - } - return fp; - } - var UnboundTypeError = undefined; - function getTypeName(type) { - var ptr = ___getTypeName(type); - var rv = readLatin1String(ptr); - _free(ptr); - return rv; - } - function throwUnboundTypeError(message, types) { - var unboundTypes = []; - var seen = {}; - function visit(type) { - if (seen[type]) { - return; - } - if (registeredTypes[type]) { - return; - } - if (typeDependencies[type]) { - typeDependencies[type].forEach(visit); - return; - } - unboundTypes.push(type); - seen[type] = true; - } - types.forEach(visit); - throw new UnboundTypeError( - message + ': ' + unboundTypes.map(getTypeName).join([', ']) - ); - } - function __embind_register_class( - rawType, - rawPointerType, - rawConstPointerType, - baseClassRawType, - getActualTypeSignature, - getActualType, - upcastSignature, - upcast, - downcastSignature, - downcast, - name, - destructorSignature, - rawDestructor - ) { - name = readLatin1String(name); - getActualType = embind__requireFunction( - getActualTypeSignature, - getActualType - ); - if (upcast) { - upcast = embind__requireFunction(upcastSignature, upcast); - } - if (downcast) { - downcast = embind__requireFunction(downcastSignature, downcast); - } - rawDestructor = embind__requireFunction( - destructorSignature, - rawDestructor - ); - var legalFunctionName = makeLegalFunctionName(name); - exposePublicSymbol(legalFunctionName, function () { - throwUnboundTypeError( - 'Cannot construct ' + name + ' due to unbound types', - [baseClassRawType] - ); - }); - whenDependentTypesAreResolved( - [rawType, rawPointerType, rawConstPointerType], - baseClassRawType ? [baseClassRawType] : [], - function (base) { - base = base[0]; - var baseClass; - var basePrototype; - if (baseClassRawType) { - baseClass = base.registeredClass; - basePrototype = baseClass.instancePrototype; - } else { - basePrototype = ClassHandle.prototype; - } - var constructor = createNamedFunction(legalFunctionName, function () { - if (Object.getPrototypeOf(this) !== instancePrototype) { - throw new BindingError("Use 'new' to construct " + name); - } - if (undefined === registeredClass.constructor_body) { - throw new BindingError(name + ' has no accessible constructor'); - } - var body = registeredClass.constructor_body[arguments.length]; - if (undefined === body) { - throw new BindingError( - 'Tried to invoke ctor of ' + - name + - ' with invalid number of parameters (' + - arguments.length + - ') - expected (' + - Object.keys(registeredClass.constructor_body).toString() + - ') parameters instead!' - ); - } - return body.apply(this, arguments); - }); - var instancePrototype = Object.create(basePrototype, { - constructor: { value: constructor }, - }); - constructor.prototype = instancePrototype; - var registeredClass = new RegisteredClass( - name, - constructor, - instancePrototype, - rawDestructor, - baseClass, - getActualType, - upcast, - downcast - ); - var referenceConverter = new RegisteredPointer( - name, - registeredClass, - true, - false, - false - ); - var pointerConverter = new RegisteredPointer( - name + '*', - registeredClass, - false, - false, - false - ); - var constPointerConverter = new RegisteredPointer( - name + ' const*', - registeredClass, - false, - true, - false - ); - registeredPointers[rawType] = { - pointerType: pointerConverter, - constPointerType: constPointerConverter, - }; - replacePublicSymbol(legalFunctionName, constructor); - return [referenceConverter, pointerConverter, constPointerConverter]; - } - ); - } - function heap32VectorToArray(count, firstElement) { - var array = []; - for (var i = 0; i < count; i++) { - array.push(HEAP32[(firstElement >> 2) + i]); - } - return array; - } - function runDestructors(destructors) { - while (destructors.length) { - var ptr = destructors.pop(); - var del = destructors.pop(); - del(ptr); - } - } - function __embind_register_class_constructor( - rawClassType, - argCount, - rawArgTypesAddr, - invokerSignature, - invoker, - rawConstructor - ) { - assert(argCount > 0); - var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr); - invoker = embind__requireFunction(invokerSignature, invoker); - var args = [rawConstructor]; - var destructors = []; - whenDependentTypesAreResolved([], [rawClassType], function (classType) { - classType = classType[0]; - var humanName = 'constructor ' + classType.name; - if (undefined === classType.registeredClass.constructor_body) { - classType.registeredClass.constructor_body = []; - } - if ( - undefined !== classType.registeredClass.constructor_body[argCount - 1] - ) { - throw new BindingError( - 'Cannot register multiple constructors with identical number of parameters (' + - (argCount - 1) + - ") for class '" + - classType.name + - "'! Overload resolution is currently only performed using the parameter count, not actual type info!" - ); - } - classType.registeredClass.constructor_body[argCount - 1] = - function unboundTypeHandler() { - throwUnboundTypeError( - 'Cannot construct ' + classType.name + ' due to unbound types', - rawArgTypes - ); - }; - whenDependentTypesAreResolved([], rawArgTypes, function (argTypes) { - classType.registeredClass.constructor_body[argCount - 1] = - function constructor_body() { - if (arguments.length !== argCount - 1) { - throwBindingError( - humanName + - ' called with ' + - arguments.length + - ' arguments, expected ' + - (argCount - 1) - ); - } - destructors.length = 0; - args.length = argCount; - for (var i = 1; i < argCount; ++i) { - args[i] = argTypes[i]['toWireType']( - destructors, - arguments[i - 1] - ); - } - var ptr = invoker.apply(null, args); - runDestructors(destructors); - return argTypes[0]['fromWireType'](ptr); - }; - return []; - }); - return []; - }); - } - function new_(constructor, argumentList) { - if (!(constructor instanceof Function)) { - throw new TypeError( - 'new_ called with constructor type ' + - typeof constructor + - ' which is not a function' - ); - } - var dummy = createNamedFunction( - constructor.name || 'unknownFunctionName', - function () {} - ); - dummy.prototype = constructor.prototype; - var obj = new dummy(); - var r = constructor.apply(obj, argumentList); - return r instanceof Object ? r : obj; - } - function craftInvokerFunction( - humanName, - argTypes, - classType, - cppInvokerFunc, - cppTargetFunc - ) { - var argCount = argTypes.length; - if (argCount < 2) { - throwBindingError( - "argTypes array size mismatch! Must at least get return value and 'this' types!" - ); - } - var isClassMethodFunc = argTypes[1] !== null && classType !== null; - var needsDestructorStack = false; - for (var i = 1; i < argTypes.length; ++i) { - if ( - argTypes[i] !== null && - argTypes[i].destructorFunction === undefined - ) { - needsDestructorStack = true; - break; - } - } - var returns = argTypes[0].name !== 'void'; - var argsList = ''; - var argsListWired = ''; - for (var i = 0; i < argCount - 2; ++i) { - argsList += (i !== 0 ? ', ' : '') + 'arg' + i; - argsListWired += (i !== 0 ? ', ' : '') + 'arg' + i + 'Wired'; - } - var invokerFnBody = - 'return function ' + - makeLegalFunctionName(humanName) + - '(' + - argsList + - ') {\n' + - 'if (arguments.length !== ' + - (argCount - 2) + - ') {\n' + - "throwBindingError('function " + - humanName + - " called with ' + arguments.length + ' arguments, expected " + - (argCount - 2) + - " args!');\n" + - '}\n'; - if (needsDestructorStack) { - invokerFnBody += 'var destructors = [];\n'; - } - var dtorStack = needsDestructorStack ? 'destructors' : 'null'; - var args1 = [ - 'throwBindingError', - 'invoker', - 'fn', - 'runDestructors', - 'retType', - 'classParam', - ]; - var args2 = [ - throwBindingError, - cppInvokerFunc, - cppTargetFunc, - runDestructors, - argTypes[0], - argTypes[1], - ]; - if (isClassMethodFunc) { - invokerFnBody += - 'var thisWired = classParam.toWireType(' + dtorStack + ', this);\n'; - } - for (var i = 0; i < argCount - 2; ++i) { - invokerFnBody += - 'var arg' + - i + - 'Wired = argType' + - i + - '.toWireType(' + - dtorStack + - ', arg' + - i + - '); // ' + - argTypes[i + 2].name + - '\n'; - args1.push('argType' + i); - args2.push(argTypes[i + 2]); - } - if (isClassMethodFunc) { - argsListWired = - 'thisWired' + (argsListWired.length > 0 ? ', ' : '') + argsListWired; - } - invokerFnBody += - (returns ? 'var rv = ' : '') + - 'invoker(fn' + - (argsListWired.length > 0 ? ', ' : '') + - argsListWired + - ');\n'; - if (needsDestructorStack) { - invokerFnBody += 'runDestructors(destructors);\n'; - } else { - for (var i = isClassMethodFunc ? 1 : 2; i < argTypes.length; ++i) { - var paramName = i === 1 ? 'thisWired' : 'arg' + (i - 2) + 'Wired'; - if (argTypes[i].destructorFunction !== null) { - invokerFnBody += - paramName + - '_dtor(' + - paramName + - '); // ' + - argTypes[i].name + - '\n'; - args1.push(paramName + '_dtor'); - args2.push(argTypes[i].destructorFunction); - } - } - } - if (returns) { - invokerFnBody += - 'var ret = retType.fromWireType(rv);\n' + 'return ret;\n'; - } - invokerFnBody += '}\n'; - args1.push(invokerFnBody); - var invokerFunction = new_(Function, args1).apply(null, args2); - return invokerFunction; - } - function __embind_register_class_function( - rawClassType, - methodName, - argCount, - rawArgTypesAddr, - invokerSignature, - rawInvoker, - context, - isPureVirtual - ) { - var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr); - methodName = readLatin1String(methodName); - rawInvoker = embind__requireFunction(invokerSignature, rawInvoker); - whenDependentTypesAreResolved([], [rawClassType], function (classType) { - classType = classType[0]; - var humanName = classType.name + '.' + methodName; - if (methodName.startsWith('@@')) { - methodName = Symbol[methodName.substring(2)]; - } - if (isPureVirtual) { - classType.registeredClass.pureVirtualFunctions.push(methodName); - } - function unboundTypesHandler() { - throwUnboundTypeError( - 'Cannot call ' + humanName + ' due to unbound types', - rawArgTypes - ); - } - var proto = classType.registeredClass.instancePrototype; - var method = proto[methodName]; - if ( - undefined === method || - (undefined === method.overloadTable && - method.className !== classType.name && - method.argCount === argCount - 2) - ) { - unboundTypesHandler.argCount = argCount - 2; - unboundTypesHandler.className = classType.name; - proto[methodName] = unboundTypesHandler; - } else { - ensureOverloadTable(proto, methodName, humanName); - proto[methodName].overloadTable[argCount - 2] = unboundTypesHandler; - } - whenDependentTypesAreResolved([], rawArgTypes, function (argTypes) { - var memberFunction = craftInvokerFunction( - humanName, - argTypes, - classType, - rawInvoker, - context - ); - if (undefined === proto[methodName].overloadTable) { - memberFunction.argCount = argCount - 2; - proto[methodName] = memberFunction; - } else { - proto[methodName].overloadTable[argCount - 2] = memberFunction; - } - return []; - }); - return []; - }); - } - var emval_free_list = []; - var emval_handle_array = [ - {}, - { value: undefined }, - { value: null }, - { value: true }, - { value: false }, - ]; - function __emval_decref(handle) { - if (handle > 4 && 0 === --emval_handle_array[handle].refcount) { - emval_handle_array[handle] = undefined; - emval_free_list.push(handle); - } - } - function count_emval_handles() { - var count = 0; - for (var i = 5; i < emval_handle_array.length; ++i) { - if (emval_handle_array[i] !== undefined) { - ++count; - } - } - return count; - } - function get_first_emval() { - for (var i = 5; i < emval_handle_array.length; ++i) { - if (emval_handle_array[i] !== undefined) { - return emval_handle_array[i]; - } - } - return null; - } - function init_emval() { - Module['count_emval_handles'] = count_emval_handles; - Module['get_first_emval'] = get_first_emval; - } - function __emval_register(value) { - switch (value) { - case undefined: { - return 1; - } - case null: { - return 2; - } - case true: { - return 3; - } - case false: { - return 4; - } - default: { - var handle = emval_free_list.length - ? emval_free_list.pop() - : emval_handle_array.length; - emval_handle_array[handle] = { refcount: 1, value: value }; - return handle; - } - } - } - function __embind_register_emval(rawType, name) { - name = readLatin1String(name); - registerType(rawType, { - name: name, - fromWireType: function (handle) { - var rv = emval_handle_array[handle].value; - __emval_decref(handle); - return rv; - }, - toWireType: function (destructors, value) { - return __emval_register(value); - }, - argPackAdvance: 8, - readValueFromPointer: simpleReadValueFromPointer, - destructorFunction: null, - }); - } - function _embind_repr(v) { - if (v === null) { - return 'null'; - } - var t = typeof v; - if (t === 'object' || t === 'array' || t === 'function') { - return v.toString(); - } else { - return '' + v; - } - } - function floatReadValueFromPointer(name, shift) { - switch (shift) { - case 2: - return function (pointer) { - return this['fromWireType'](HEAPF32[pointer >> 2]); - }; - case 3: - return function (pointer) { - return this['fromWireType'](HEAPF64[pointer >> 3]); - }; - default: - throw new TypeError('Unknown float type: ' + name); - } - } - function __embind_register_float(rawType, name, size) { - var shift = getShiftFromSize(size); - name = readLatin1String(name); - registerType(rawType, { - name: name, - fromWireType: function (value) { - return value; - }, - toWireType: function (destructors, value) { - if (typeof value !== 'number' && typeof value !== 'boolean') { - throw new TypeError( - 'Cannot convert "' + _embind_repr(value) + '" to ' + this.name - ); - } - return value; - }, - argPackAdvance: 8, - readValueFromPointer: floatReadValueFromPointer(name, shift), - destructorFunction: null, - }); - } - function __embind_register_function( - name, - argCount, - rawArgTypesAddr, - signature, - rawInvoker, - fn - ) { - var argTypes = heap32VectorToArray(argCount, rawArgTypesAddr); - name = readLatin1String(name); - rawInvoker = embind__requireFunction(signature, rawInvoker); - exposePublicSymbol( - name, - function () { - throwUnboundTypeError( - 'Cannot call ' + name + ' due to unbound types', - argTypes - ); - }, - argCount - 1 - ); - whenDependentTypesAreResolved([], argTypes, function (argTypes) { - var invokerArgsArray = [argTypes[0], null].concat(argTypes.slice(1)); - replacePublicSymbol( - name, - craftInvokerFunction(name, invokerArgsArray, null, rawInvoker, fn), - argCount - 1 - ); - return []; - }); - } - function integerReadValueFromPointer(name, shift, signed) { - switch (shift) { - case 0: - return signed - ? function readS8FromPointer(pointer) { - return HEAP8[pointer]; - } - : function readU8FromPointer(pointer) { - return HEAPU8[pointer]; - }; - case 1: - return signed - ? function readS16FromPointer(pointer) { - return HEAP16[pointer >> 1]; - } - : function readU16FromPointer(pointer) { - return HEAPU16[pointer >> 1]; - }; - case 2: - return signed - ? function readS32FromPointer(pointer) { - return HEAP32[pointer >> 2]; - } - : function readU32FromPointer(pointer) { - return HEAPU32[pointer >> 2]; - }; - default: - throw new TypeError('Unknown integer type: ' + name); - } - } - function __embind_register_integer( - primitiveType, - name, - size, - minRange, - maxRange - ) { - name = readLatin1String(name); - if (maxRange === -1) { - maxRange = 4294967295; - } - var shift = getShiftFromSize(size); - var fromWireType = function (value) { - return value; - }; - if (minRange === 0) { - var bitshift = 32 - 8 * size; - fromWireType = function (value) { - return (value << bitshift) >>> bitshift; - }; - } - var isUnsignedType = name.includes('unsigned'); - registerType(primitiveType, { - name: name, - fromWireType: fromWireType, - toWireType: function (destructors, value) { - if (typeof value !== 'number' && typeof value !== 'boolean') { - throw new TypeError( - 'Cannot convert "' + _embind_repr(value) + '" to ' + this.name - ); - } - if (value < minRange || value > maxRange) { - throw new TypeError( - 'Passing a number "' + - _embind_repr(value) + - '" from JS side to C/C++ side to an argument of type "' + - name + - '", which is outside the valid range [' + - minRange + - ', ' + - maxRange + - ']!' - ); - } - return isUnsignedType ? value >>> 0 : value | 0; - }, - argPackAdvance: 8, - readValueFromPointer: integerReadValueFromPointer( - name, - shift, - minRange !== 0 - ), - destructorFunction: null, - }); - } - function __embind_register_memory_view(rawType, dataTypeIndex, name) { - var typeMapping = [ - Int8Array, - Uint8Array, - Int16Array, - Uint16Array, - Int32Array, - Uint32Array, - Float32Array, - Float64Array, - ]; - var TA = typeMapping[dataTypeIndex]; - function decodeMemoryView(handle) { - handle = handle >> 2; - var heap = HEAPU32; - var size = heap[handle]; - var data = heap[handle + 1]; - return new TA(buffer, data, size); - } - name = readLatin1String(name); - registerType( - rawType, - { - name: name, - fromWireType: decodeMemoryView, - argPackAdvance: 8, - readValueFromPointer: decodeMemoryView, - }, - { ignoreDuplicateRegistrations: true } - ); - } - function __embind_register_std_string(rawType, name) { - name = readLatin1String(name); - var stdStringIsUTF8 = name === 'std::string'; - registerType(rawType, { - name: name, - fromWireType: function (value) { - var length = HEAPU32[value >> 2]; - var str; - if (stdStringIsUTF8) { - var decodeStartPtr = value + 4; - for (var i = 0; i <= length; ++i) { - var currentBytePtr = value + 4 + i; - if (i == length || HEAPU8[currentBytePtr] == 0) { - var maxRead = currentBytePtr - decodeStartPtr; - var stringSegment = UTF8ToString(decodeStartPtr, maxRead); - if (str === undefined) { - str = stringSegment; - } else { - str += String.fromCharCode(0); - str += stringSegment; - } - decodeStartPtr = currentBytePtr + 1; - } - } - } else { - var a = new Array(length); - for (var i = 0; i < length; ++i) { - a[i] = String.fromCharCode(HEAPU8[value + 4 + i]); - } - str = a.join(''); - } - _free(value); - return str; - }, - toWireType: function (destructors, value) { - if (value instanceof ArrayBuffer) { - value = new Uint8Array(value); - } - var getLength; - var valueIsOfTypeString = typeof value === 'string'; - if ( - !( - valueIsOfTypeString || - value instanceof Uint8Array || - value instanceof Uint8ClampedArray || - value instanceof Int8Array - ) - ) { - throwBindingError('Cannot pass non-string to std::string'); - } - if (stdStringIsUTF8 && valueIsOfTypeString) { - getLength = function () { - return lengthBytesUTF8(value); - }; - } else { - getLength = function () { - return value.length; - }; - } - var length = getLength(); - var ptr = _malloc(4 + length + 1); - HEAPU32[ptr >> 2] = length; - if (stdStringIsUTF8 && valueIsOfTypeString) { - stringToUTF8(value, ptr + 4, length + 1); - } else { - if (valueIsOfTypeString) { - for (var i = 0; i < length; ++i) { - var charCode = value.charCodeAt(i); - if (charCode > 255) { - _free(ptr); - throwBindingError( - 'String has UTF-16 code units that do not fit in 8 bits' - ); - } - HEAPU8[ptr + 4 + i] = charCode; - } - } else { - for (var i = 0; i < length; ++i) { - HEAPU8[ptr + 4 + i] = value[i]; - } - } - } - if (destructors !== null) { - destructors.push(_free, ptr); - } - return ptr; - }, - argPackAdvance: 8, - readValueFromPointer: simpleReadValueFromPointer, - destructorFunction: function (ptr) { - _free(ptr); - }, - }); - } - function __embind_register_std_wstring(rawType, charSize, name) { - name = readLatin1String(name); - var decodeString, encodeString, getHeap, lengthBytesUTF, shift; - if (charSize === 2) { - decodeString = UTF16ToString; - encodeString = stringToUTF16; - lengthBytesUTF = lengthBytesUTF16; - getHeap = function () { - return HEAPU16; - }; - shift = 1; - } else if (charSize === 4) { - decodeString = UTF32ToString; - encodeString = stringToUTF32; - lengthBytesUTF = lengthBytesUTF32; - getHeap = function () { - return HEAPU32; - }; - shift = 2; - } - registerType(rawType, { - name: name, - fromWireType: function (value) { - var length = HEAPU32[value >> 2]; - var HEAP = getHeap(); - var str; - var decodeStartPtr = value + 4; - for (var i = 0; i <= length; ++i) { - var currentBytePtr = value + 4 + i * charSize; - if (i == length || HEAP[currentBytePtr >> shift] == 0) { - var maxReadBytes = currentBytePtr - decodeStartPtr; - var stringSegment = decodeString(decodeStartPtr, maxReadBytes); - if (str === undefined) { - str = stringSegment; - } else { - str += String.fromCharCode(0); - str += stringSegment; - } - decodeStartPtr = currentBytePtr + charSize; - } - } - _free(value); - return str; - }, - toWireType: function (destructors, value) { - if (!(typeof value === 'string')) { - throwBindingError( - 'Cannot pass non-string to C++ string type ' + name - ); - } - var length = lengthBytesUTF(value); - var ptr = _malloc(4 + length + charSize); - HEAPU32[ptr >> 2] = length >> shift; - encodeString(value, ptr + 4, length + charSize); - if (destructors !== null) { - destructors.push(_free, ptr); - } - return ptr; - }, - argPackAdvance: 8, - readValueFromPointer: simpleReadValueFromPointer, - destructorFunction: function (ptr) { - _free(ptr); - }, - }); - } - function __embind_register_void(rawType, name) { - name = readLatin1String(name); - registerType(rawType, { - isVoid: true, - name: name, - argPackAdvance: 0, - fromWireType: function () { - return undefined; - }, - toWireType: function (destructors, o) { - return undefined; - }, - }); - } - function requireHandle(handle) { - if (!handle) { - throwBindingError('Cannot use deleted val. handle = ' + handle); - } - return emval_handle_array[handle].value; - } - function requireRegisteredType(rawType, humanName) { - var impl = registeredTypes[rawType]; - if (undefined === impl) { - throwBindingError( - humanName + ' has unknown type ' + getTypeName(rawType) - ); - } - return impl; - } - function __emval_as(handle, returnType, destructorsRef) { - handle = requireHandle(handle); - returnType = requireRegisteredType(returnType, 'emval::as'); - var destructors = []; - var rd = __emval_register(destructors); - HEAP32[destructorsRef >> 2] = rd; - return returnType['toWireType'](destructors, handle); - } - function __emval_lookupTypes(argCount, argTypes) { - var a = new Array(argCount); - for (var i = 0; i < argCount; ++i) { - a[i] = requireRegisteredType( - HEAP32[(argTypes >> 2) + i], - 'parameter ' + i - ); - } - return a; - } - function __emval_call(handle, argCount, argTypes, argv) { - handle = requireHandle(handle); - var types = __emval_lookupTypes(argCount, argTypes); - var args = new Array(argCount); - for (var i = 0; i < argCount; ++i) { - var type = types[i]; - args[i] = type['readValueFromPointer'](argv); - argv += type['argPackAdvance']; - } - var rv = handle.apply(undefined, args); - return __emval_register(rv); - } - function __emval_incref(handle) { - if (handle > 4) { - emval_handle_array[handle].refcount += 1; - } - } - function __emval_run_destructors(handle) { - var destructors = emval_handle_array[handle].value; - runDestructors(destructors); - __emval_decref(handle); - } - function _abort() { - abort(); - } - function _emscripten_memcpy_big(dest, src, num) { - HEAPU8.copyWithin(dest, src, src + num); - } - function emscripten_realloc_buffer(size) { - try { - wasmMemory.grow((size - buffer.byteLength + 65535) >>> 16); - updateGlobalBufferAndViews(wasmMemory.buffer); - return 1; - } catch (e) { - console.error( - 'emscripten_realloc_buffer: Attempted to grow heap from ' + - buffer.byteLength + - ' bytes to ' + - size + - ' bytes, but got error: ' + - e - ); - } - } - function _emscripten_resize_heap(requestedSize) { - var oldSize = HEAPU8.length; - requestedSize = requestedSize >>> 0; - assert(requestedSize > oldSize); - var maxHeapSize = 2147483648; - if (requestedSize > maxHeapSize) { - err( - 'Cannot enlarge memory, asked to go up to ' + - requestedSize + - ' bytes, but the limit is ' + - maxHeapSize + - ' bytes!' - ); - return false; - } - for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { - var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); - overGrownHeapSize = Math.min( - overGrownHeapSize, - requestedSize + 100663296 - ); - var newSize = Math.min( - maxHeapSize, - alignUp(Math.max(requestedSize, overGrownHeapSize), 65536) - ); - var replacement = emscripten_realloc_buffer(newSize); - if (replacement) { - return true; - } - } - err( - 'Failed to grow the heap from ' + - oldSize + - ' bytes to ' + - newSize + - ' bytes, not enough memory!' - ); - return false; - } - var ENV = {}; - function getExecutableName() { - return thisProgram || './this.program'; - } - function getEnvStrings() { - if (!getEnvStrings.strings) { - var lang = - ( - (typeof navigator === 'object' && - navigator.languages && - navigator.languages[0]) || - 'C' - ).replace('-', '_') + '.UTF-8'; - var env = { - USER: 'web_user', - LOGNAME: 'web_user', - PATH: '/', - PWD: '/', - HOME: '/home/web_user', - LANG: lang, - _: getExecutableName(), - }; - for (var x in ENV) { - if (ENV[x] === undefined) delete env[x]; - else env[x] = ENV[x]; - } - var strings = []; - for (var x in env) { - strings.push(x + '=' + env[x]); - } - getEnvStrings.strings = strings; - } - return getEnvStrings.strings; - } - function _environ_get(__environ, environ_buf) { - try { - var bufSize = 0; - getEnvStrings().forEach(function (string, i) { - var ptr = environ_buf + bufSize; - HEAP32[(__environ + i * 4) >> 2] = ptr; - writeAsciiToMemory(string, ptr); - bufSize += string.length + 1; - }); - return 0; - } catch (e) { - if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) - abort(e); - return e.errno; - } - } - function _environ_sizes_get(penviron_count, penviron_buf_size) { - try { - var strings = getEnvStrings(); - HEAP32[penviron_count >> 2] = strings.length; - var bufSize = 0; - strings.forEach(function (string) { - bufSize += string.length + 1; - }); - HEAP32[penviron_buf_size >> 2] = bufSize; - return 0; - } catch (e) { - if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) - abort(e); - return e.errno; - } - } - function _exit(status) { - exit(status); - } - function _fd_close(fd) { - try { - var stream = SYSCALLS.getStreamFromFD(fd); - FS.close(stream); - return 0; - } catch (e) { - if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) - abort(e); - return e.errno; - } - } - function _fd_read(fd, iov, iovcnt, pnum) { - try { - var stream = SYSCALLS.getStreamFromFD(fd); - var num = SYSCALLS.doReadv(stream, iov, iovcnt); - HEAP32[pnum >> 2] = num; - return 0; - } catch (e) { - if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) - abort(e); - return e.errno; - } - } - function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { - try { - var stream = SYSCALLS.getStreamFromFD(fd); - var HIGH_OFFSET = 4294967296; - var offset = offset_high * HIGH_OFFSET + (offset_low >>> 0); - var DOUBLE_LIMIT = 9007199254740992; - if (offset <= -DOUBLE_LIMIT || offset >= DOUBLE_LIMIT) { - return -61; - } - FS.llseek(stream, offset, whence); - (tempI64 = [ - stream.position >>> 0, - ((tempDouble = stream.position), - +Math.abs(tempDouble) >= 1 - ? tempDouble > 0 - ? (Math.min(+Math.floor(tempDouble / 4294967296), 4294967295) | - 0) >>> - 0 - : ~~+Math.ceil( - (tempDouble - +(~~tempDouble >>> 0)) / 4294967296 - ) >>> 0 - : 0), - ]), - (HEAP32[newOffset >> 2] = tempI64[0]), - (HEAP32[(newOffset + 4) >> 2] = tempI64[1]); - if (stream.getdents && offset === 0 && whence === 0) - stream.getdents = null; - return 0; - } catch (e) { - if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) - abort(e); - return e.errno; - } - } - function _fd_write(fd, iov, iovcnt, pnum) { - try { - var stream = SYSCALLS.getStreamFromFD(fd); - var num = SYSCALLS.doWritev(stream, iov, iovcnt); - HEAP32[pnum >> 2] = num; - return 0; - } catch (e) { - if (typeof FS === 'undefined' || !(e instanceof FS.ErrnoError)) - abort(e); - return e.errno; - } - } - function _getTempRet0() { - return getTempRet0(); - } - function _llvm_eh_typeid_for(type) { - return type; - } - function setErrNo(value) { - HEAP32[___errno_location() >> 2] = value; - return value; - } - function _raise(sig) { - err('Calling stub instead of raise()'); - setErrNo(ERRNO_CODES.ENOSYS); - warnOnce('raise() returning an error as we do not support it'); - return -1; - } - function _setTempRet0(val) { - setTempRet0(val); - } - function __isLeapYear(year) { - return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); - } - function __arraySum(array, index) { - var sum = 0; - for (var i = 0; i <= index; sum += array[i++]) {} - return sum; - } - var __MONTH_DAYS_LEAP = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - var __MONTH_DAYS_REGULAR = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; - function __addDays(date, days) { - var newDate = new Date(date.getTime()); - while (days > 0) { - var leap = __isLeapYear(newDate.getFullYear()); - var currentMonth = newDate.getMonth(); - var daysInCurrentMonth = ( - leap ? __MONTH_DAYS_LEAP : __MONTH_DAYS_REGULAR - )[currentMonth]; - if (days > daysInCurrentMonth - newDate.getDate()) { - days -= daysInCurrentMonth - newDate.getDate() + 1; - newDate.setDate(1); - if (currentMonth < 11) { - newDate.setMonth(currentMonth + 1); - } else { - newDate.setMonth(0); - newDate.setFullYear(newDate.getFullYear() + 1); - } - } else { - newDate.setDate(newDate.getDate() + days); - return newDate; - } - } - return newDate; - } - function _strftime(s, maxsize, format, tm) { - var tm_zone = HEAP32[(tm + 40) >> 2]; - var date = { - tm_sec: HEAP32[tm >> 2], - tm_min: HEAP32[(tm + 4) >> 2], - tm_hour: HEAP32[(tm + 8) >> 2], - tm_mday: HEAP32[(tm + 12) >> 2], - tm_mon: HEAP32[(tm + 16) >> 2], - tm_year: HEAP32[(tm + 20) >> 2], - tm_wday: HEAP32[(tm + 24) >> 2], - tm_yday: HEAP32[(tm + 28) >> 2], - tm_isdst: HEAP32[(tm + 32) >> 2], - tm_gmtoff: HEAP32[(tm + 36) >> 2], - tm_zone: tm_zone ? UTF8ToString(tm_zone) : '', - }; - var pattern = UTF8ToString(format); - var EXPANSION_RULES_1 = { - '%c': '%a %b %d %H:%M:%S %Y', - '%D': '%m/%d/%y', - '%F': '%Y-%m-%d', - '%h': '%b', - '%r': '%I:%M:%S %p', - '%R': '%H:%M', - '%T': '%H:%M:%S', - '%x': '%m/%d/%y', - '%X': '%H:%M:%S', - '%Ec': '%c', - '%EC': '%C', - '%Ex': '%m/%d/%y', - '%EX': '%H:%M:%S', - '%Ey': '%y', - '%EY': '%Y', - '%Od': '%d', - '%Oe': '%e', - '%OH': '%H', - '%OI': '%I', - '%Om': '%m', - '%OM': '%M', - '%OS': '%S', - '%Ou': '%u', - '%OU': '%U', - '%OV': '%V', - '%Ow': '%w', - '%OW': '%W', - '%Oy': '%y', - }; - for (var rule in EXPANSION_RULES_1) { - pattern = pattern.replace( - new RegExp(rule, 'g'), - EXPANSION_RULES_1[rule] - ); - } - var WEEKDAYS = [ - 'Sunday', - 'Monday', - 'Tuesday', - 'Wednesday', - 'Thursday', - 'Friday', - 'Saturday', - ]; - var MONTHS = [ - 'January', - 'February', - 'March', - 'April', - 'May', - 'June', - 'July', - 'August', - 'September', - 'October', - 'November', - 'December', - ]; - function leadingSomething(value, digits, character) { - var str = typeof value === 'number' ? value.toString() : value || ''; - while (str.length < digits) { - str = character[0] + str; - } - return str; - } - function leadingNulls(value, digits) { - return leadingSomething(value, digits, '0'); - } - function compareByDay(date1, date2) { - function sgn(value) { - return value < 0 ? -1 : value > 0 ? 1 : 0; - } - var compare; - if ((compare = sgn(date1.getFullYear() - date2.getFullYear())) === 0) { - if ((compare = sgn(date1.getMonth() - date2.getMonth())) === 0) { - compare = sgn(date1.getDate() - date2.getDate()); - } - } - return compare; - } - function getFirstWeekStartDate(janFourth) { - switch (janFourth.getDay()) { - case 0: - return new Date(janFourth.getFullYear() - 1, 11, 29); - case 1: - return janFourth; - case 2: - return new Date(janFourth.getFullYear(), 0, 3); - case 3: - return new Date(janFourth.getFullYear(), 0, 2); - case 4: - return new Date(janFourth.getFullYear(), 0, 1); - case 5: - return new Date(janFourth.getFullYear() - 1, 11, 31); - case 6: - return new Date(janFourth.getFullYear() - 1, 11, 30); - } - } - function getWeekBasedYear(date) { - var thisDate = __addDays( - new Date(date.tm_year + 1900, 0, 1), - date.tm_yday - ); - var janFourthThisYear = new Date(thisDate.getFullYear(), 0, 4); - var janFourthNextYear = new Date(thisDate.getFullYear() + 1, 0, 4); - var firstWeekStartThisYear = getFirstWeekStartDate(janFourthThisYear); - var firstWeekStartNextYear = getFirstWeekStartDate(janFourthNextYear); - if (compareByDay(firstWeekStartThisYear, thisDate) <= 0) { - if (compareByDay(firstWeekStartNextYear, thisDate) <= 0) { - return thisDate.getFullYear() + 1; - } else { - return thisDate.getFullYear(); - } - } else { - return thisDate.getFullYear() - 1; - } - } - var EXPANSION_RULES_2 = { - '%a': function (date) { - return WEEKDAYS[date.tm_wday].substring(0, 3); - }, - '%A': function (date) { - return WEEKDAYS[date.tm_wday]; - }, - '%b': function (date) { - return MONTHS[date.tm_mon].substring(0, 3); - }, - '%B': function (date) { - return MONTHS[date.tm_mon]; - }, - '%C': function (date) { - var year = date.tm_year + 1900; - return leadingNulls((year / 100) | 0, 2); - }, - '%d': function (date) { - return leadingNulls(date.tm_mday, 2); - }, - '%e': function (date) { - return leadingSomething(date.tm_mday, 2, ' '); - }, - '%g': function (date) { - return getWeekBasedYear(date).toString().substring(2); - }, - '%G': function (date) { - return getWeekBasedYear(date); - }, - '%H': function (date) { - return leadingNulls(date.tm_hour, 2); - }, - '%I': function (date) { - var twelveHour = date.tm_hour; - if (twelveHour == 0) twelveHour = 12; - else if (twelveHour > 12) twelveHour -= 12; - return leadingNulls(twelveHour, 2); - }, - '%j': function (date) { - return leadingNulls( - date.tm_mday + - __arraySum( - __isLeapYear(date.tm_year + 1900) - ? __MONTH_DAYS_LEAP - : __MONTH_DAYS_REGULAR, - date.tm_mon - 1 - ), - 3 - ); - }, - '%m': function (date) { - return leadingNulls(date.tm_mon + 1, 2); - }, - '%M': function (date) { - return leadingNulls(date.tm_min, 2); - }, - '%n': function () { - return '\n'; - }, - '%p': function (date) { - if (date.tm_hour >= 0 && date.tm_hour < 12) { - return 'AM'; - } else { - return 'PM'; - } - }, - '%S': function (date) { - return leadingNulls(date.tm_sec, 2); - }, - '%t': function () { - return '\t'; - }, - '%u': function (date) { - return date.tm_wday || 7; - }, - '%U': function (date) { - var janFirst = new Date(date.tm_year + 1900, 0, 1); - var firstSunday = - janFirst.getDay() === 0 - ? janFirst - : __addDays(janFirst, 7 - janFirst.getDay()); - var endDate = new Date( - date.tm_year + 1900, - date.tm_mon, - date.tm_mday - ); - if (compareByDay(firstSunday, endDate) < 0) { - var februaryFirstUntilEndMonth = - __arraySum( - __isLeapYear(endDate.getFullYear()) - ? __MONTH_DAYS_LEAP - : __MONTH_DAYS_REGULAR, - endDate.getMonth() - 1 - ) - 31; - var firstSundayUntilEndJanuary = 31 - firstSunday.getDate(); - var days = - firstSundayUntilEndJanuary + - februaryFirstUntilEndMonth + - endDate.getDate(); - return leadingNulls(Math.ceil(days / 7), 2); - } - return compareByDay(firstSunday, janFirst) === 0 ? '01' : '00'; - }, - '%V': function (date) { - var janFourthThisYear = new Date(date.tm_year + 1900, 0, 4); - var janFourthNextYear = new Date(date.tm_year + 1901, 0, 4); - var firstWeekStartThisYear = getFirstWeekStartDate(janFourthThisYear); - var firstWeekStartNextYear = getFirstWeekStartDate(janFourthNextYear); - var endDate = __addDays( - new Date(date.tm_year + 1900, 0, 1), - date.tm_yday - ); - if (compareByDay(endDate, firstWeekStartThisYear) < 0) { - return '53'; - } - if (compareByDay(firstWeekStartNextYear, endDate) <= 0) { - return '01'; - } - var daysDifference; - if (firstWeekStartThisYear.getFullYear() < date.tm_year + 1900) { - daysDifference = - date.tm_yday + 32 - firstWeekStartThisYear.getDate(); - } else { - daysDifference = - date.tm_yday + 1 - firstWeekStartThisYear.getDate(); - } - return leadingNulls(Math.ceil(daysDifference / 7), 2); - }, - '%w': function (date) { - return date.tm_wday; - }, - '%W': function (date) { - var janFirst = new Date(date.tm_year, 0, 1); - var firstMonday = - janFirst.getDay() === 1 - ? janFirst - : __addDays( - janFirst, - janFirst.getDay() === 0 ? 1 : 7 - janFirst.getDay() + 1 - ); - var endDate = new Date( - date.tm_year + 1900, - date.tm_mon, - date.tm_mday - ); - if (compareByDay(firstMonday, endDate) < 0) { - var februaryFirstUntilEndMonth = - __arraySum( - __isLeapYear(endDate.getFullYear()) - ? __MONTH_DAYS_LEAP - : __MONTH_DAYS_REGULAR, - endDate.getMonth() - 1 - ) - 31; - var firstMondayUntilEndJanuary = 31 - firstMonday.getDate(); - var days = - firstMondayUntilEndJanuary + - februaryFirstUntilEndMonth + - endDate.getDate(); - return leadingNulls(Math.ceil(days / 7), 2); - } - return compareByDay(firstMonday, janFirst) === 0 ? '01' : '00'; - }, - '%y': function (date) { - return (date.tm_year + 1900).toString().substring(2); - }, - '%Y': function (date) { - return date.tm_year + 1900; - }, - '%z': function (date) { - var off = date.tm_gmtoff; - var ahead = off >= 0; - off = Math.abs(off) / 60; - off = (off / 60) * 100 + (off % 60); - return (ahead ? '+' : '-') + String('0000' + off).slice(-4); - }, - '%Z': function (date) { - return date.tm_zone; - }, - '%%': function () { - return '%'; - }, - }; - for (var rule in EXPANSION_RULES_2) { - if (pattern.includes(rule)) { - pattern = pattern.replace( - new RegExp(rule, 'g'), - EXPANSION_RULES_2[rule](date) - ); - } - } - var bytes = intArrayFromString(pattern, false); - if (bytes.length > maxsize) { - return 0; - } - writeArrayToMemory(bytes, s); - return bytes.length - 1; - } - function _strftime_l(s, maxsize, format, tm) { - return _strftime(s, maxsize, format, tm); - } - function _time(ptr) { - var ret = (Date.now() / 1e3) | 0; - if (ptr) { - HEAP32[ptr >> 2] = ret; - } - return ret; - } - var FSNode = function (parent, name, mode, rdev) { - if (!parent) { - parent = this; - } - this.parent = parent; - this.mount = parent.mount; - this.mounted = null; - this.id = FS.nextInode++; - this.name = name; - this.mode = mode; - this.node_ops = {}; - this.stream_ops = {}; - this.rdev = rdev; - }; - var readMode = 292 | 73; - var writeMode = 146; - Object.defineProperties(FSNode.prototype, { - read: { - get: function () { - return (this.mode & readMode) === readMode; - }, - set: function (val) { - val ? (this.mode |= readMode) : (this.mode &= ~readMode); - }, - }, - write: { - get: function () { - return (this.mode & writeMode) === writeMode; - }, - set: function (val) { - val ? (this.mode |= writeMode) : (this.mode &= ~writeMode); - }, - }, - isFolder: { - get: function () { - return FS.isDir(this.mode); - }, - }, - isDevice: { - get: function () { - return FS.isChrdev(this.mode); - }, - }, - }); - FS.FSNode = FSNode; - FS.staticInit(); - embind_init_charCodes(); - BindingError = Module['BindingError'] = extendError(Error, 'BindingError'); - InternalError = Module['InternalError'] = extendError( - Error, - 'InternalError' - ); - init_ClassHandle(); - init_RegisteredPointer(); - init_embind(); - UnboundTypeError = Module['UnboundTypeError'] = extendError( - Error, - 'UnboundTypeError' - ); - init_emval(); - function intArrayFromString(stringy, dontAddNull, length) { - var len = length > 0 ? length : lengthBytesUTF8(stringy) + 1; - var u8array = new Array(len); - var numBytesWritten = stringToUTF8Array( - stringy, - u8array, - 0, - u8array.length - ); - if (dontAddNull) u8array.length = numBytesWritten; - return u8array; - } - var asmLibraryArg = { - __assert_fail: ___assert_fail, - __cxa_allocate_exception: ___cxa_allocate_exception, - __cxa_atexit: ___cxa_atexit, - __cxa_begin_catch: ___cxa_begin_catch, - __cxa_end_catch: ___cxa_end_catch, - __cxa_find_matching_catch_2: ___cxa_find_matching_catch_2, - __cxa_find_matching_catch_3: ___cxa_find_matching_catch_3, - __cxa_free_exception: ___cxa_free_exception, - __cxa_rethrow: ___cxa_rethrow, - __cxa_thread_atexit: ___cxa_thread_atexit, - __cxa_throw: ___cxa_throw, - __cxa_uncaught_exceptions: ___cxa_uncaught_exceptions, - __resumeException: ___resumeException, - __sys_getrusage: ___sys_getrusage, - _embind_register_bigint: __embind_register_bigint, - _embind_register_bool: __embind_register_bool, - _embind_register_class: __embind_register_class, - _embind_register_class_constructor: __embind_register_class_constructor, - _embind_register_class_function: __embind_register_class_function, - _embind_register_emval: __embind_register_emval, - _embind_register_float: __embind_register_float, - _embind_register_function: __embind_register_function, - _embind_register_integer: __embind_register_integer, - _embind_register_memory_view: __embind_register_memory_view, - _embind_register_std_string: __embind_register_std_string, - _embind_register_std_wstring: __embind_register_std_wstring, - _embind_register_void: __embind_register_void, - _emval_as: __emval_as, - _emval_call: __emval_call, - _emval_decref: __emval_decref, - _emval_incref: __emval_incref, - _emval_run_destructors: __emval_run_destructors, - abort: _abort, - emscripten_memcpy_big: _emscripten_memcpy_big, - emscripten_resize_heap: _emscripten_resize_heap, - environ_get: _environ_get, - environ_sizes_get: _environ_sizes_get, - exit: _exit, - fd_close: _fd_close, - fd_read: _fd_read, - fd_seek: _fd_seek, - fd_write: _fd_write, - getTempRet0: _getTempRet0, - invoke_ddiii: invoke_ddiii, - invoke_dii: invoke_dii, - invoke_diii: invoke_diii, - invoke_diiiiiiii: invoke_diiiiiiii, - invoke_fiii: invoke_fiii, - invoke_i: invoke_i, - invoke_id: invoke_id, - invoke_idddddi: invoke_idddddi, - invoke_ii: invoke_ii, - invoke_iid: invoke_iid, - invoke_iiddd: invoke_iiddd, - invoke_iidi: invoke_iidi, - invoke_iii: invoke_iii, - invoke_iiii: invoke_iiii, - invoke_iiiidd: invoke_iiiidd, - invoke_iiiii: invoke_iiiii, - invoke_iiiiid: invoke_iiiiid, - invoke_iiiiii: invoke_iiiiii, - invoke_iiiiiii: invoke_iiiiiii, - invoke_iiiiiiii: invoke_iiiiiiii, - invoke_iiiiiiiii: invoke_iiiiiiiii, - invoke_iiiiiiiiii: invoke_iiiiiiiiii, - invoke_iiiiiiiiiii: invoke_iiiiiiiiiii, - invoke_iiiiiiiiiiii: invoke_iiiiiiiiiiii, - invoke_iiiiiiiiiiiii: invoke_iiiiiiiiiiiii, - invoke_iiiiiiiiiiiiii: invoke_iiiiiiiiiiiiii, - invoke_iiiiiiiiiiiiiii: invoke_iiiiiiiiiiiiiii, - invoke_iiiiiiiiiiiiiiii: invoke_iiiiiiiiiiiiiiii, - invoke_jiiii: invoke_jiiii, - invoke_v: invoke_v, - invoke_vddddiiii: invoke_vddddiiii, - invoke_vddddiiiii: invoke_vddddiiiii, - invoke_vdddiiiiii: invoke_vdddiiiiii, - invoke_vdiii: invoke_vdiii, - invoke_vi: invoke_vi, - invoke_vid: invoke_vid, - invoke_vidd: invoke_vidd, - invoke_viddd: invoke_viddd, - invoke_vidiii: invoke_vidiii, - invoke_vii: invoke_vii, - invoke_viii: invoke_viii, - invoke_viiii: invoke_viiii, - invoke_viiiiddiiii: invoke_viiiiddiiii, - invoke_viiiii: invoke_viiiii, - invoke_viiiiii: invoke_viiiiii, - invoke_viiiiiid: invoke_viiiiiid, - invoke_viiiiiii: invoke_viiiiiii, - invoke_viiiiiiiddd: invoke_viiiiiiiddd, - invoke_viiiiiiii: invoke_viiiiiiii, - invoke_viiiiiiiii: invoke_viiiiiiiii, - invoke_viiiiiiiiii: invoke_viiiiiiiiii, - invoke_viiiiiiiiiiii: invoke_viiiiiiiiiiii, - invoke_viiiiiiiiiiiii: invoke_viiiiiiiiiiiii, - invoke_viiiiiiiiiiiiiii: invoke_viiiiiiiiiiiiiii, - invoke_viiiiiiiiiiiiiiii: invoke_viiiiiiiiiiiiiiii, - invoke_viiiiiiiiiiiiiiiii: invoke_viiiiiiiiiiiiiiiii, - invoke_viiiiiiiiiiiiiiiiii: invoke_viiiiiiiiiiiiiiiiii, - llvm_eh_typeid_for: _llvm_eh_typeid_for, - raise: _raise, - setTempRet0: _setTempRet0, - strftime_l: _strftime_l, - time: _time, - }; - createWasm(); - (Module['___wasm_call_ctors'] = - createExportWrapper('__wasm_call_ctors')); - var _memset = (Module['_memset'] = createExportWrapper('memset')); - var _malloc = (Module['_malloc'] = createExportWrapper('malloc')); - var _free = (Module['_free'] = createExportWrapper('free')); - var ___getTypeName = (Module['___getTypeName'] = - createExportWrapper('__getTypeName')); - (Module[ - '___embind_register_native_and_builtin_types' - ] = createExportWrapper('__embind_register_native_and_builtin_types')); - (Module['_fflush'] = createExportWrapper('fflush')); - var ___errno_location = (Module['___errno_location'] = - createExportWrapper('__errno_location')); - var stackSave = (Module['stackSave'] = createExportWrapper('stackSave')); - var stackRestore = (Module['stackRestore'] = - createExportWrapper('stackRestore')); - var stackAlloc = (Module['stackAlloc'] = createExportWrapper('stackAlloc')); - var _emscripten_stack_init = (Module['_emscripten_stack_init'] = - function () { - return (_emscripten_stack_init = Module['_emscripten_stack_init'] = - Module['asm']['emscripten_stack_init']).apply(null, arguments); - }); - (Module['_emscripten_stack_get_free'] = - function () { - return (Module[ - '_emscripten_stack_get_free' - ] = - Module['asm']['emscripten_stack_get_free']).apply(null, arguments); - }); - var _emscripten_stack_get_end = (Module['_emscripten_stack_get_end'] = - function () { - return (_emscripten_stack_get_end = Module[ - '_emscripten_stack_get_end' - ] = - Module['asm']['emscripten_stack_get_end']).apply(null, arguments); - }); - var _setThrew = (Module['_setThrew'] = createExportWrapper('setThrew')); - var ___cxa_can_catch = (Module['___cxa_can_catch'] = - createExportWrapper('__cxa_can_catch')); - var ___cxa_is_pointer_type = (Module['___cxa_is_pointer_type'] = - createExportWrapper('__cxa_is_pointer_type')); - (Module['dynCall_viijii'] = - createExportWrapper('dynCall_viijii')); - (Module['dynCall_jiji'] = - createExportWrapper('dynCall_jiji')); - var dynCall_jiiii = (Module['dynCall_jiiii'] = - createExportWrapper('dynCall_jiiii')); - (Module['dynCall_iiiiij'] = - createExportWrapper('dynCall_iiiiij')); - (Module['dynCall_iiiiijj'] = - createExportWrapper('dynCall_iiiiijj')); - (Module['dynCall_iiiiiijj'] = - createExportWrapper('dynCall_iiiiiijj')); - function invoke_vii(index, a1, a2) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_iii(index, a1, a2) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1, a2); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_vi(index, a1) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_ii(index, a1) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_viiii(index, a1, a2, a3, a4) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2, a3, a4); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_i(index) { - var sp = stackSave(); - try { - return wasmTable.get(index)(); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_iiii(index, a1, a2, a3) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1, a2, a3); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_viii(index, a1, a2, a3) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2, a3); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_viiiiiii(index, a1, a2, a3, a4, a5, a6, a7) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2, a3, a4, a5, a6, a7); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_vid(index, a1, a2) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_iid(index, a1, a2) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1, a2); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_v(index) { - var sp = stackSave(); - try { - wasmTable.get(index)(); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_viiiii(index, a1, a2, a3, a4, a5) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2, a3, a4, a5); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_viiiiiiii(index, a1, a2, a3, a4, a5, a6, a7, a8) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2, a3, a4, a5, a6, a7, a8); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_iiiii(index, a1, a2, a3, a4) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1, a2, a3, a4); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_dii(index, a1, a2) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1, a2); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_iiddd(index, a1, a2, a3, a4) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1, a2, a3, a4); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_iiiiiiii(index, a1, a2, a3, a4, a5, a6, a7) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1, a2, a3, a4, a5, a6, a7); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_viiiiii(index, a1, a2, a3, a4, a5, a6) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2, a3, a4, a5, a6); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_iiiidd(index, a1, a2, a3, a4, a5) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1, a2, a3, a4, a5); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_vidd(index, a1, a2, a3) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2, a3); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_diiiiiiii(index, a1, a2, a3, a4, a5, a6, a7, a8) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1, a2, a3, a4, a5, a6, a7, a8); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_iiiiiiiii(index, a1, a2, a3, a4, a5, a6, a7, a8) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1, a2, a3, a4, a5, a6, a7, a8); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_iiiiiiiiiiiiiii( - index, - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12, - a13, - a14 - ) { - var sp = stackSave(); - try { - return wasmTable.get(index)( - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12, - a13, - a14 - ); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_vdiii(index, a1, a2, a3, a4) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2, a3, a4); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_diii(index, a1, a2, a3) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1, a2, a3); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_iidi(index, a1, a2, a3) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1, a2, a3); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_viiiiiiiii(index, a1, a2, a3, a4, a5, a6, a7, a8, a9) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2, a3, a4, a5, a6, a7, a8, a9); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_iiiiii(index, a1, a2, a3, a4, a5) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1, a2, a3, a4, a5); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_iiiiiii(index, a1, a2, a3, a4, a5, a6) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1, a2, a3, a4, a5, a6); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_ddiii(index, a1, a2, a3, a4) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1, a2, a3, a4); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_id(index, a1) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_viiiiiiiiii( - index, - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10 - ) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_viiiiiiiiiiiiiiiii( - index, - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12, - a13, - a14, - a15, - a16, - a17 - ) { - var sp = stackSave(); - try { - wasmTable.get(index)( - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12, - a13, - a14, - a15, - a16, - a17 - ); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_iiiiiiiiiiiii( - index, - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12 - ) { - var sp = stackSave(); - try { - return wasmTable.get(index)( - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12 - ); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_iiiiiiiiii(index, a1, a2, a3, a4, a5, a6, a7, a8, a9) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1, a2, a3, a4, a5, a6, a7, a8, a9); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_viiiiiid(index, a1, a2, a3, a4, a5, a6, a7) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2, a3, a4, a5, a6, a7); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_viiiiiiiiiiiii( - index, - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12, - a13 - ) { - var sp = stackSave(); - try { - wasmTable.get(index)( - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12, - a13 - ); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_viiiiiiiiiiiiiiii( - index, - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12, - a13, - a14, - a15, - a16 - ) { - var sp = stackSave(); - try { - wasmTable.get(index)( - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12, - a13, - a14, - a15, - a16 - ); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_iiiiiiiiiiiiiiii( - index, - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12, - a13, - a14, - a15 - ) { - var sp = stackSave(); - try { - return wasmTable.get(index)( - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12, - a13, - a14, - a15 - ); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_viiiiddiiii( - index, - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10 - ) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_viddd(index, a1, a2, a3, a4) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2, a3, a4); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_viiiiiiiddd( - index, - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10 - ) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_iiiiiiiiiiiiii( - index, - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12, - a13 - ) { - var sp = stackSave(); - try { - return wasmTable.get(index)( - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12, - a13 - ); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_viiiiiiiiiiiiiii( - index, - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12, - a13, - a14, - a15 - ) { - var sp = stackSave(); - try { - wasmTable.get(index)( - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12, - a13, - a14, - a15 - ); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_iiiiiiiiiiii( - index, - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11 - ) { - var sp = stackSave(); - try { - return wasmTable.get(index)( - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11 - ); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_viiiiiiiiiiiiiiiiii( - index, - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12, - a13, - a14, - a15, - a16, - a17, - a18 - ) { - var sp = stackSave(); - try { - wasmTable.get(index)( - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12, - a13, - a14, - a15, - a16, - a17, - a18 - ); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_viiiiiiiiiiii( - index, - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10, - a11, - a12 - ) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_iiiiiiiiiii( - index, - a1, - a2, - a3, - a4, - a5, - a6, - a7, - a8, - a9, - a10 - ) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_vddddiiiii(index, a1, a2, a3, a4, a5, a6, a7, a8, a9) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2, a3, a4, a5, a6, a7, a8, a9); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_idddddi(index, a1, a2, a3, a4, a5, a6) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1, a2, a3, a4, a5, a6); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_vidiii(index, a1, a2, a3, a4, a5) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2, a3, a4, a5); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_vdddiiiiii(index, a1, a2, a3, a4, a5, a6, a7, a8, a9) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2, a3, a4, a5, a6, a7, a8, a9); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_vddddiiii(index, a1, a2, a3, a4, a5, a6, a7, a8) { - var sp = stackSave(); - try { - wasmTable.get(index)(a1, a2, a3, a4, a5, a6, a7, a8); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_fiii(index, a1, a2, a3) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1, a2, a3); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_iiiiid(index, a1, a2, a3, a4, a5) { - var sp = stackSave(); - try { - return wasmTable.get(index)(a1, a2, a3, a4, a5); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - function invoke_jiiii(index, a1, a2, a3, a4) { - var sp = stackSave(); - try { - return dynCall_jiiii(index, a1, a2, a3, a4); - } catch (e) { - stackRestore(sp); - if (e !== e + 0 && e !== 'longjmp') throw e; - _setThrew(1, 0); - } - } - if (!Object.getOwnPropertyDescriptor(Module, 'intArrayFromString')) - Module['intArrayFromString'] = function () { - abort( - "'intArrayFromString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'intArrayToString')) - Module['intArrayToString'] = function () { - abort( - "'intArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'ccall')) - Module['ccall'] = function () { - abort( - "'ccall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'cwrap')) - Module['cwrap'] = function () { - abort( - "'cwrap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'setValue')) - Module['setValue'] = function () { - abort( - "'setValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getValue')) - Module['getValue'] = function () { - abort( - "'getValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'allocate')) - Module['allocate'] = function () { - abort( - "'allocate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'UTF8ArrayToString')) - Module['UTF8ArrayToString'] = function () { - abort( - "'UTF8ArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'UTF8ToString')) - Module['UTF8ToString'] = function () { - abort( - "'UTF8ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'stringToUTF8Array')) - Module['stringToUTF8Array'] = function () { - abort( - "'stringToUTF8Array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'stringToUTF8')) - Module['stringToUTF8'] = function () { - abort( - "'stringToUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'lengthBytesUTF8')) - Module['lengthBytesUTF8'] = function () { - abort( - "'lengthBytesUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'stackTrace')) - Module['stackTrace'] = function () { - abort( - "'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'addOnPreRun')) - Module['addOnPreRun'] = function () { - abort( - "'addOnPreRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'addOnInit')) - Module['addOnInit'] = function () { - abort( - "'addOnInit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'addOnPreMain')) - Module['addOnPreMain'] = function () { - abort( - "'addOnPreMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'addOnExit')) - Module['addOnExit'] = function () { - abort( - "'addOnExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'addOnPostRun')) - Module['addOnPostRun'] = function () { - abort( - "'addOnPostRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'writeStringToMemory')) - Module['writeStringToMemory'] = function () { - abort( - "'writeStringToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'writeArrayToMemory')) - Module['writeArrayToMemory'] = function () { - abort( - "'writeArrayToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'writeAsciiToMemory')) - Module['writeAsciiToMemory'] = function () { - abort( - "'writeAsciiToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'addRunDependency')) - Module['addRunDependency'] = function () { - abort( - "'addRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'removeRunDependency')) - Module['removeRunDependency'] = function () { - abort( - "'removeRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'FS_createFolder')) - Module['FS_createFolder'] = function () { - abort( - "'FS_createFolder' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'FS_createPath')) - Module['FS_createPath'] = function () { - abort( - "'FS_createPath' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'FS_createDataFile')) - Module['FS_createDataFile'] = function () { - abort( - "'FS_createDataFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'FS_createPreloadedFile')) - Module['FS_createPreloadedFile'] = function () { - abort( - "'FS_createPreloadedFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'FS_createLazyFile')) - Module['FS_createLazyFile'] = function () { - abort( - "'FS_createLazyFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'FS_createLink')) - Module['FS_createLink'] = function () { - abort( - "'FS_createLink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'FS_createDevice')) - Module['FS_createDevice'] = function () { - abort( - "'FS_createDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'FS_unlink')) - Module['FS_unlink'] = function () { - abort( - "'FS_unlink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getLEB')) - Module['getLEB'] = function () { - abort( - "'getLEB' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getFunctionTables')) - Module['getFunctionTables'] = function () { - abort( - "'getFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'alignFunctionTables')) - Module['alignFunctionTables'] = function () { - abort( - "'alignFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'registerFunctions')) - Module['registerFunctions'] = function () { - abort( - "'registerFunctions' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'addFunction')) - Module['addFunction'] = function () { - abort( - "'addFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'removeFunction')) - Module['removeFunction'] = function () { - abort( - "'removeFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getFuncWrapper')) - Module['getFuncWrapper'] = function () { - abort( - "'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'prettyPrint')) - Module['prettyPrint'] = function () { - abort( - "'prettyPrint' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'dynCall')) - Module['dynCall'] = function () { - abort( - "'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getCompilerSetting')) - Module['getCompilerSetting'] = function () { - abort( - "'getCompilerSetting' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'print')) - Module['print'] = function () { - abort( - "'print' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'printErr')) - Module['printErr'] = function () { - abort( - "'printErr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getTempRet0')) - Module['getTempRet0'] = function () { - abort( - "'getTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'setTempRet0')) - Module['setTempRet0'] = function () { - abort( - "'setTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'callMain')) - Module['callMain'] = function () { - abort( - "'callMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'abort')) - Module['abort'] = function () { - abort( - "'abort' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'stringToNewUTF8')) - Module['stringToNewUTF8'] = function () { - abort( - "'stringToNewUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'setFileTime')) - Module['setFileTime'] = function () { - abort( - "'setFileTime' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'emscripten_realloc_buffer')) - Module['emscripten_realloc_buffer'] = function () { - abort( - "'emscripten_realloc_buffer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'ENV')) - Module['ENV'] = function () { - abort( - "'ENV' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'ERRNO_CODES')) - Module['ERRNO_CODES'] = function () { - abort( - "'ERRNO_CODES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'ERRNO_MESSAGES')) - Module['ERRNO_MESSAGES'] = function () { - abort( - "'ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'setErrNo')) - Module['setErrNo'] = function () { - abort( - "'setErrNo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'inetPton4')) - Module['inetPton4'] = function () { - abort( - "'inetPton4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'inetNtop4')) - Module['inetNtop4'] = function () { - abort( - "'inetNtop4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'inetPton6')) - Module['inetPton6'] = function () { - abort( - "'inetPton6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'inetNtop6')) - Module['inetNtop6'] = function () { - abort( - "'inetNtop6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'readSockaddr')) - Module['readSockaddr'] = function () { - abort( - "'readSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'writeSockaddr')) - Module['writeSockaddr'] = function () { - abort( - "'writeSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'DNS')) - Module['DNS'] = function () { - abort( - "'DNS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getHostByName')) - Module['getHostByName'] = function () { - abort( - "'getHostByName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'GAI_ERRNO_MESSAGES')) - Module['GAI_ERRNO_MESSAGES'] = function () { - abort( - "'GAI_ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'Protocols')) - Module['Protocols'] = function () { - abort( - "'Protocols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'Sockets')) - Module['Sockets'] = function () { - abort( - "'Sockets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getRandomDevice')) - Module['getRandomDevice'] = function () { - abort( - "'getRandomDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'traverseStack')) - Module['traverseStack'] = function () { - abort( - "'traverseStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'UNWIND_CACHE')) - Module['UNWIND_CACHE'] = function () { - abort( - "'UNWIND_CACHE' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'withBuiltinMalloc')) - Module['withBuiltinMalloc'] = function () { - abort( - "'withBuiltinMalloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'readAsmConstArgsArray')) - Module['readAsmConstArgsArray'] = function () { - abort( - "'readAsmConstArgsArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'readAsmConstArgs')) - Module['readAsmConstArgs'] = function () { - abort( - "'readAsmConstArgs' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'mainThreadEM_ASM')) - Module['mainThreadEM_ASM'] = function () { - abort( - "'mainThreadEM_ASM' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'jstoi_q')) - Module['jstoi_q'] = function () { - abort( - "'jstoi_q' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'jstoi_s')) - Module['jstoi_s'] = function () { - abort( - "'jstoi_s' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getExecutableName')) - Module['getExecutableName'] = function () { - abort( - "'getExecutableName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'listenOnce')) - Module['listenOnce'] = function () { - abort( - "'listenOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'autoResumeAudioContext')) - Module['autoResumeAudioContext'] = function () { - abort( - "'autoResumeAudioContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'dynCallLegacy')) - Module['dynCallLegacy'] = function () { - abort( - "'dynCallLegacy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getDynCaller')) - Module['getDynCaller'] = function () { - abort( - "'getDynCaller' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'dynCall')) - Module['dynCall'] = function () { - abort( - "'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'callRuntimeCallbacks')) - Module['callRuntimeCallbacks'] = function () { - abort( - "'callRuntimeCallbacks' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'runtimeKeepaliveCounter')) - Module['runtimeKeepaliveCounter'] = function () { - abort( - "'runtimeKeepaliveCounter' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'keepRuntimeAlive')) - Module['keepRuntimeAlive'] = function () { - abort( - "'keepRuntimeAlive' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'runtimeKeepalivePush')) - Module['runtimeKeepalivePush'] = function () { - abort( - "'runtimeKeepalivePush' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'runtimeKeepalivePop')) - Module['runtimeKeepalivePop'] = function () { - abort( - "'runtimeKeepalivePop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'callUserCallback')) - Module['callUserCallback'] = function () { - abort( - "'callUserCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'maybeExit')) - Module['maybeExit'] = function () { - abort( - "'maybeExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'asmjsMangle')) - Module['asmjsMangle'] = function () { - abort( - "'asmjsMangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'reallyNegative')) - Module['reallyNegative'] = function () { - abort( - "'reallyNegative' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'unSign')) - Module['unSign'] = function () { - abort( - "'unSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'reSign')) - Module['reSign'] = function () { - abort( - "'reSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'formatString')) - Module['formatString'] = function () { - abort( - "'formatString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'PATH')) - Module['PATH'] = function () { - abort( - "'PATH' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'PATH_FS')) - Module['PATH_FS'] = function () { - abort( - "'PATH_FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'SYSCALLS')) - Module['SYSCALLS'] = function () { - abort( - "'SYSCALLS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'syscallMmap2')) - Module['syscallMmap2'] = function () { - abort( - "'syscallMmap2' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'syscallMunmap')) - Module['syscallMunmap'] = function () { - abort( - "'syscallMunmap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getSocketFromFD')) - Module['getSocketFromFD'] = function () { - abort( - "'getSocketFromFD' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getSocketAddress')) - Module['getSocketAddress'] = function () { - abort( - "'getSocketAddress' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'JSEvents')) - Module['JSEvents'] = function () { - abort( - "'JSEvents' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'registerKeyEventCallback')) - Module['registerKeyEventCallback'] = function () { - abort( - "'registerKeyEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'specialHTMLTargets')) - Module['specialHTMLTargets'] = function () { - abort( - "'specialHTMLTargets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'maybeCStringToJsString')) - Module['maybeCStringToJsString'] = function () { - abort( - "'maybeCStringToJsString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'findEventTarget')) - Module['findEventTarget'] = function () { - abort( - "'findEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'findCanvasEventTarget')) - Module['findCanvasEventTarget'] = function () { - abort( - "'findCanvasEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getBoundingClientRect')) - Module['getBoundingClientRect'] = function () { - abort( - "'getBoundingClientRect' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'fillMouseEventData')) - Module['fillMouseEventData'] = function () { - abort( - "'fillMouseEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'registerMouseEventCallback')) - Module['registerMouseEventCallback'] = function () { - abort( - "'registerMouseEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'registerWheelEventCallback')) - Module['registerWheelEventCallback'] = function () { - abort( - "'registerWheelEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'registerUiEventCallback')) - Module['registerUiEventCallback'] = function () { - abort( - "'registerUiEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'registerFocusEventCallback')) - Module['registerFocusEventCallback'] = function () { - abort( - "'registerFocusEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor(Module, 'fillDeviceOrientationEventData') - ) - Module['fillDeviceOrientationEventData'] = function () { - abort( - "'fillDeviceOrientationEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor( - Module, - 'registerDeviceOrientationEventCallback' - ) - ) - Module['registerDeviceOrientationEventCallback'] = function () { - abort( - "'registerDeviceOrientationEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'fillDeviceMotionEventData')) - Module['fillDeviceMotionEventData'] = function () { - abort( - "'fillDeviceMotionEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor( - Module, - 'registerDeviceMotionEventCallback' - ) - ) - Module['registerDeviceMotionEventCallback'] = function () { - abort( - "'registerDeviceMotionEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'screenOrientation')) - Module['screenOrientation'] = function () { - abort( - "'screenOrientation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor(Module, 'fillOrientationChangeEventData') - ) - Module['fillOrientationChangeEventData'] = function () { - abort( - "'fillOrientationChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor( - Module, - 'registerOrientationChangeEventCallback' - ) - ) - Module['registerOrientationChangeEventCallback'] = function () { - abort( - "'registerOrientationChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor(Module, 'fillFullscreenChangeEventData') - ) - Module['fillFullscreenChangeEventData'] = function () { - abort( - "'fillFullscreenChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor( - Module, - 'registerFullscreenChangeEventCallback' - ) - ) - Module['registerFullscreenChangeEventCallback'] = function () { - abort( - "'registerFullscreenChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'registerRestoreOldStyle')) - Module['registerRestoreOldStyle'] = function () { - abort( - "'registerRestoreOldStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor( - Module, - 'hideEverythingExceptGivenElement' - ) - ) - Module['hideEverythingExceptGivenElement'] = function () { - abort( - "'hideEverythingExceptGivenElement' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'restoreHiddenElements')) - Module['restoreHiddenElements'] = function () { - abort( - "'restoreHiddenElements' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'setLetterbox')) - Module['setLetterbox'] = function () { - abort( - "'setLetterbox' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'currentFullscreenStrategy')) - Module['currentFullscreenStrategy'] = function () { - abort( - "'currentFullscreenStrategy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'restoreOldWindowedStyle')) - Module['restoreOldWindowedStyle'] = function () { - abort( - "'restoreOldWindowedStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor( - Module, - 'softFullscreenResizeWebGLRenderTarget' - ) - ) - Module['softFullscreenResizeWebGLRenderTarget'] = function () { - abort( - "'softFullscreenResizeWebGLRenderTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'doRequestFullscreen')) - Module['doRequestFullscreen'] = function () { - abort( - "'doRequestFullscreen' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor(Module, 'fillPointerlockChangeEventData') - ) - Module['fillPointerlockChangeEventData'] = function () { - abort( - "'fillPointerlockChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor( - Module, - 'registerPointerlockChangeEventCallback' - ) - ) - Module['registerPointerlockChangeEventCallback'] = function () { - abort( - "'registerPointerlockChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor( - Module, - 'registerPointerlockErrorEventCallback' - ) - ) - Module['registerPointerlockErrorEventCallback'] = function () { - abort( - "'registerPointerlockErrorEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'requestPointerLock')) - Module['requestPointerLock'] = function () { - abort( - "'requestPointerLock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor(Module, 'fillVisibilityChangeEventData') - ) - Module['fillVisibilityChangeEventData'] = function () { - abort( - "'fillVisibilityChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor( - Module, - 'registerVisibilityChangeEventCallback' - ) - ) - Module['registerVisibilityChangeEventCallback'] = function () { - abort( - "'registerVisibilityChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'registerTouchEventCallback')) - Module['registerTouchEventCallback'] = function () { - abort( - "'registerTouchEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'fillGamepadEventData')) - Module['fillGamepadEventData'] = function () { - abort( - "'fillGamepadEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor(Module, 'registerGamepadEventCallback') - ) - Module['registerGamepadEventCallback'] = function () { - abort( - "'registerGamepadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor( - Module, - 'registerBeforeUnloadEventCallback' - ) - ) - Module['registerBeforeUnloadEventCallback'] = function () { - abort( - "'registerBeforeUnloadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'fillBatteryEventData')) - Module['fillBatteryEventData'] = function () { - abort( - "'fillBatteryEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'battery')) - Module['battery'] = function () { - abort( - "'battery' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor(Module, 'registerBatteryEventCallback') - ) - Module['registerBatteryEventCallback'] = function () { - abort( - "'registerBatteryEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'setCanvasElementSize')) - Module['setCanvasElementSize'] = function () { - abort( - "'setCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getCanvasElementSize')) - Module['getCanvasElementSize'] = function () { - abort( - "'getCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'polyfillSetImmediate')) - Module['polyfillSetImmediate'] = function () { - abort( - "'polyfillSetImmediate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'demangle')) - Module['demangle'] = function () { - abort( - "'demangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'demangleAll')) - Module['demangleAll'] = function () { - abort( - "'demangleAll' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'jsStackTrace')) - Module['jsStackTrace'] = function () { - abort( - "'jsStackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'stackTrace')) - Module['stackTrace'] = function () { - abort( - "'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getEnvStrings')) - Module['getEnvStrings'] = function () { - abort( - "'getEnvStrings' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'checkWasiClock')) - Module['checkWasiClock'] = function () { - abort( - "'checkWasiClock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'writeI53ToI64')) - Module['writeI53ToI64'] = function () { - abort( - "'writeI53ToI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'writeI53ToI64Clamped')) - Module['writeI53ToI64Clamped'] = function () { - abort( - "'writeI53ToI64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'writeI53ToI64Signaling')) - Module['writeI53ToI64Signaling'] = function () { - abort( - "'writeI53ToI64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'writeI53ToU64Clamped')) - Module['writeI53ToU64Clamped'] = function () { - abort( - "'writeI53ToU64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'writeI53ToU64Signaling')) - Module['writeI53ToU64Signaling'] = function () { - abort( - "'writeI53ToU64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'readI53FromI64')) - Module['readI53FromI64'] = function () { - abort( - "'readI53FromI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'readI53FromU64')) - Module['readI53FromU64'] = function () { - abort( - "'readI53FromU64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'convertI32PairToI53')) - Module['convertI32PairToI53'] = function () { - abort( - "'convertI32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'convertU32PairToI53')) - Module['convertU32PairToI53'] = function () { - abort( - "'convertU32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'uncaughtExceptionCount')) - Module['uncaughtExceptionCount'] = function () { - abort( - "'uncaughtExceptionCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'exceptionLast')) - Module['exceptionLast'] = function () { - abort( - "'exceptionLast' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'exceptionCaught')) - Module['exceptionCaught'] = function () { - abort( - "'exceptionCaught' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'ExceptionInfoAttrs')) - Module['ExceptionInfoAttrs'] = function () { - abort( - "'ExceptionInfoAttrs' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'ExceptionInfo')) - Module['ExceptionInfo'] = function () { - abort( - "'ExceptionInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'CatchInfo')) - Module['CatchInfo'] = function () { - abort( - "'CatchInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'exception_addRef')) - Module['exception_addRef'] = function () { - abort( - "'exception_addRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'exception_decRef')) - Module['exception_decRef'] = function () { - abort( - "'exception_decRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'Browser')) - Module['Browser'] = function () { - abort( - "'Browser' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'funcWrappers')) - Module['funcWrappers'] = function () { - abort( - "'funcWrappers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getFuncWrapper')) - Module['getFuncWrapper'] = function () { - abort( - "'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'setMainLoop')) - Module['setMainLoop'] = function () { - abort( - "'setMainLoop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'FS')) - Module['FS'] = function () { - abort( - "'FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'mmapAlloc')) - Module['mmapAlloc'] = function () { - abort( - "'mmapAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'MEMFS')) - Module['MEMFS'] = function () { - abort( - "'MEMFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'TTY')) - Module['TTY'] = function () { - abort( - "'TTY' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'PIPEFS')) - Module['PIPEFS'] = function () { - abort( - "'PIPEFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'SOCKFS')) - Module['SOCKFS'] = function () { - abort( - "'SOCKFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, '_setNetworkCallback')) - Module['_setNetworkCallback'] = function () { - abort( - "'_setNetworkCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'tempFixedLengthArray')) - Module['tempFixedLengthArray'] = function () { - abort( - "'tempFixedLengthArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'miniTempWebGLFloatBuffers')) - Module['miniTempWebGLFloatBuffers'] = function () { - abort( - "'miniTempWebGLFloatBuffers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'heapObjectForWebGLType')) - Module['heapObjectForWebGLType'] = function () { - abort( - "'heapObjectForWebGLType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'heapAccessShiftForWebGLHeap')) - Module['heapAccessShiftForWebGLHeap'] = function () { - abort( - "'heapAccessShiftForWebGLHeap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'GL')) - Module['GL'] = function () { - abort( - "'GL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'emscriptenWebGLGet')) - Module['emscriptenWebGLGet'] = function () { - abort( - "'emscriptenWebGLGet' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor(Module, 'computeUnpackAlignedImageSize') - ) - Module['computeUnpackAlignedImageSize'] = function () { - abort( - "'computeUnpackAlignedImageSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor(Module, 'emscriptenWebGLGetTexPixelData') - ) - Module['emscriptenWebGLGetTexPixelData'] = function () { - abort( - "'emscriptenWebGLGetTexPixelData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'emscriptenWebGLGetUniform')) - Module['emscriptenWebGLGetUniform'] = function () { - abort( - "'emscriptenWebGLGetUniform' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'webglGetUniformLocation')) - Module['webglGetUniformLocation'] = function () { - abort( - "'webglGetUniformLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor( - Module, - 'webglPrepareUniformLocationsBeforeFirstUse' - ) - ) - Module['webglPrepareUniformLocationsBeforeFirstUse'] = function () { - abort( - "'webglPrepareUniformLocationsBeforeFirstUse' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'webglGetLeftBracePos')) - Module['webglGetLeftBracePos'] = function () { - abort( - "'webglGetLeftBracePos' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor(Module, 'emscriptenWebGLGetVertexAttrib') - ) - Module['emscriptenWebGLGetVertexAttrib'] = function () { - abort( - "'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'writeGLArray')) - Module['writeGLArray'] = function () { - abort( - "'writeGLArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'AL')) - Module['AL'] = function () { - abort( - "'AL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'SDL_unicode')) - Module['SDL_unicode'] = function () { - abort( - "'SDL_unicode' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'SDL_ttfContext')) - Module['SDL_ttfContext'] = function () { - abort( - "'SDL_ttfContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'SDL_audio')) - Module['SDL_audio'] = function () { - abort( - "'SDL_audio' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'SDL')) - Module['SDL'] = function () { - abort( - "'SDL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'SDL_gfx')) - Module['SDL_gfx'] = function () { - abort( - "'SDL_gfx' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'GLUT')) - Module['GLUT'] = function () { - abort( - "'GLUT' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'EGL')) - Module['EGL'] = function () { - abort( - "'EGL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'GLFW_Window')) - Module['GLFW_Window'] = function () { - abort( - "'GLFW_Window' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'GLFW')) - Module['GLFW'] = function () { - abort( - "'GLFW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'GLEW')) - Module['GLEW'] = function () { - abort( - "'GLEW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'IDBStore')) - Module['IDBStore'] = function () { - abort( - "'IDBStore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'runAndAbortIfError')) - Module['runAndAbortIfError'] = function () { - abort( - "'runAndAbortIfError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'emval_handle_array')) - Module['emval_handle_array'] = function () { - abort( - "'emval_handle_array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'emval_free_list')) - Module['emval_free_list'] = function () { - abort( - "'emval_free_list' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'emval_symbols')) - Module['emval_symbols'] = function () { - abort( - "'emval_symbols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'init_emval')) - Module['init_emval'] = function () { - abort( - "'init_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'count_emval_handles')) - Module['count_emval_handles'] = function () { - abort( - "'count_emval_handles' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'get_first_emval')) - Module['get_first_emval'] = function () { - abort( - "'get_first_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getStringOrSymbol')) - Module['getStringOrSymbol'] = function () { - abort( - "'getStringOrSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'requireHandle')) - Module['requireHandle'] = function () { - abort( - "'requireHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'emval_newers')) - Module['emval_newers'] = function () { - abort( - "'emval_newers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'craftEmvalAllocator')) - Module['craftEmvalAllocator'] = function () { - abort( - "'craftEmvalAllocator' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'emval_get_global')) - Module['emval_get_global'] = function () { - abort( - "'emval_get_global' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'emval_methodCallers')) - Module['emval_methodCallers'] = function () { - abort( - "'emval_methodCallers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'InternalError')) - Module['InternalError'] = function () { - abort( - "'InternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'BindingError')) - Module['BindingError'] = function () { - abort( - "'BindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'UnboundTypeError')) - Module['UnboundTypeError'] = function () { - abort( - "'UnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'PureVirtualError')) - Module['PureVirtualError'] = function () { - abort( - "'PureVirtualError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'init_embind')) - Module['init_embind'] = function () { - abort( - "'init_embind' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'throwInternalError')) - Module['throwInternalError'] = function () { - abort( - "'throwInternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'throwBindingError')) - Module['throwBindingError'] = function () { - abort( - "'throwBindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'throwUnboundTypeError')) - Module['throwUnboundTypeError'] = function () { - abort( - "'throwUnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'ensureOverloadTable')) - Module['ensureOverloadTable'] = function () { - abort( - "'ensureOverloadTable' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'exposePublicSymbol')) - Module['exposePublicSymbol'] = function () { - abort( - "'exposePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'replacePublicSymbol')) - Module['replacePublicSymbol'] = function () { - abort( - "'replacePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'extendError')) - Module['extendError'] = function () { - abort( - "'extendError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'createNamedFunction')) - Module['createNamedFunction'] = function () { - abort( - "'createNamedFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'registeredInstances')) - Module['registeredInstances'] = function () { - abort( - "'registeredInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getBasestPointer')) - Module['getBasestPointer'] = function () { - abort( - "'getBasestPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'registerInheritedInstance')) - Module['registerInheritedInstance'] = function () { - abort( - "'registerInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'unregisterInheritedInstance')) - Module['unregisterInheritedInstance'] = function () { - abort( - "'unregisterInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getInheritedInstance')) - Module['getInheritedInstance'] = function () { - abort( - "'getInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getInheritedInstanceCount')) - Module['getInheritedInstanceCount'] = function () { - abort( - "'getInheritedInstanceCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getLiveInheritedInstances')) - Module['getLiveInheritedInstances'] = function () { - abort( - "'getLiveInheritedInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'registeredTypes')) - Module['registeredTypes'] = function () { - abort( - "'registeredTypes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'awaitingDependencies')) - Module['awaitingDependencies'] = function () { - abort( - "'awaitingDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'typeDependencies')) - Module['typeDependencies'] = function () { - abort( - "'typeDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'registeredPointers')) - Module['registeredPointers'] = function () { - abort( - "'registeredPointers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'registerType')) - Module['registerType'] = function () { - abort( - "'registerType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor(Module, 'whenDependentTypesAreResolved') - ) - Module['whenDependentTypesAreResolved'] = function () { - abort( - "'whenDependentTypesAreResolved' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'embind_charCodes')) - Module['embind_charCodes'] = function () { - abort( - "'embind_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'embind_init_charCodes')) - Module['embind_init_charCodes'] = function () { - abort( - "'embind_init_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'readLatin1String')) - Module['readLatin1String'] = function () { - abort( - "'readLatin1String' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getTypeName')) - Module['getTypeName'] = function () { - abort( - "'getTypeName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'heap32VectorToArray')) - Module['heap32VectorToArray'] = function () { - abort( - "'heap32VectorToArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'requireRegisteredType')) - Module['requireRegisteredType'] = function () { - abort( - "'requireRegisteredType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'getShiftFromSize')) - Module['getShiftFromSize'] = function () { - abort( - "'getShiftFromSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'integerReadValueFromPointer')) - Module['integerReadValueFromPointer'] = function () { - abort( - "'integerReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'enumReadValueFromPointer')) - Module['enumReadValueFromPointer'] = function () { - abort( - "'enumReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'floatReadValueFromPointer')) - Module['floatReadValueFromPointer'] = function () { - abort( - "'floatReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'simpleReadValueFromPointer')) - Module['simpleReadValueFromPointer'] = function () { - abort( - "'simpleReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'runDestructors')) - Module['runDestructors'] = function () { - abort( - "'runDestructors' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'new_')) - Module['new_'] = function () { - abort( - "'new_' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'craftInvokerFunction')) - Module['craftInvokerFunction'] = function () { - abort( - "'craftInvokerFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'embind__requireFunction')) - Module['embind__requireFunction'] = function () { - abort( - "'embind__requireFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'tupleRegistrations')) - Module['tupleRegistrations'] = function () { - abort( - "'tupleRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'structRegistrations')) - Module['structRegistrations'] = function () { - abort( - "'structRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'genericPointerToWireType')) - Module['genericPointerToWireType'] = function () { - abort( - "'genericPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor( - Module, - 'constNoSmartPtrRawPointerToWireType' - ) - ) - Module['constNoSmartPtrRawPointerToWireType'] = function () { - abort( - "'constNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor( - Module, - 'nonConstNoSmartPtrRawPointerToWireType' - ) - ) - Module['nonConstNoSmartPtrRawPointerToWireType'] = function () { - abort( - "'nonConstNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'init_RegisteredPointer')) - Module['init_RegisteredPointer'] = function () { - abort( - "'init_RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'RegisteredPointer')) - Module['RegisteredPointer'] = function () { - abort( - "'RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor(Module, 'RegisteredPointer_getPointee') - ) - Module['RegisteredPointer_getPointee'] = function () { - abort( - "'RegisteredPointer_getPointee' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor(Module, 'RegisteredPointer_destructor') - ) - Module['RegisteredPointer_destructor'] = function () { - abort( - "'RegisteredPointer_destructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor(Module, 'RegisteredPointer_deleteObject') - ) - Module['RegisteredPointer_deleteObject'] = function () { - abort( - "'RegisteredPointer_deleteObject' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if ( - !Object.getOwnPropertyDescriptor(Module, 'RegisteredPointer_fromWireType') - ) - Module['RegisteredPointer_fromWireType'] = function () { - abort( - "'RegisteredPointer_fromWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'runDestructor')) - Module['runDestructor'] = function () { - abort( - "'runDestructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'releaseClassHandle')) - Module['releaseClassHandle'] = function () { - abort( - "'releaseClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'finalizationGroup')) - Module['finalizationGroup'] = function () { - abort( - "'finalizationGroup' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'detachFinalizer_deps')) - Module['detachFinalizer_deps'] = function () { - abort( - "'detachFinalizer_deps' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'detachFinalizer')) - Module['detachFinalizer'] = function () { - abort( - "'detachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'attachFinalizer')) - Module['attachFinalizer'] = function () { - abort( - "'attachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'makeClassHandle')) - Module['makeClassHandle'] = function () { - abort( - "'makeClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'init_ClassHandle')) - Module['init_ClassHandle'] = function () { - abort( - "'init_ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'ClassHandle')) - Module['ClassHandle'] = function () { - abort( - "'ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'ClassHandle_isAliasOf')) - Module['ClassHandle_isAliasOf'] = function () { - abort( - "'ClassHandle_isAliasOf' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'throwInstanceAlreadyDeleted')) - Module['throwInstanceAlreadyDeleted'] = function () { - abort( - "'throwInstanceAlreadyDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'ClassHandle_clone')) - Module['ClassHandle_clone'] = function () { - abort( - "'ClassHandle_clone' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'ClassHandle_delete')) - Module['ClassHandle_delete'] = function () { - abort( - "'ClassHandle_delete' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'deletionQueue')) - Module['deletionQueue'] = function () { - abort( - "'deletionQueue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'ClassHandle_isDeleted')) - Module['ClassHandle_isDeleted'] = function () { - abort( - "'ClassHandle_isDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'ClassHandle_deleteLater')) - Module['ClassHandle_deleteLater'] = function () { - abort( - "'ClassHandle_deleteLater' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'flushPendingDeletes')) - Module['flushPendingDeletes'] = function () { - abort( - "'flushPendingDeletes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'delayFunction')) - Module['delayFunction'] = function () { - abort( - "'delayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'setDelayFunction')) - Module['setDelayFunction'] = function () { - abort( - "'setDelayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'RegisteredClass')) - Module['RegisteredClass'] = function () { - abort( - "'RegisteredClass' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'shallowCopyInternalPointer')) - Module['shallowCopyInternalPointer'] = function () { - abort( - "'shallowCopyInternalPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'downcastPointer')) - Module['downcastPointer'] = function () { - abort( - "'downcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'upcastPointer')) - Module['upcastPointer'] = function () { - abort( - "'upcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'validateThis')) - Module['validateThis'] = function () { - abort( - "'validateThis' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'char_0')) - Module['char_0'] = function () { - abort( - "'char_0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'char_9')) - Module['char_9'] = function () { - abort( - "'char_9' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'makeLegalFunctionName')) - Module['makeLegalFunctionName'] = function () { - abort( - "'makeLegalFunctionName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'warnOnce')) - Module['warnOnce'] = function () { - abort( - "'warnOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'stackSave')) - Module['stackSave'] = function () { - abort( - "'stackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'stackRestore')) - Module['stackRestore'] = function () { - abort( - "'stackRestore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'stackAlloc')) - Module['stackAlloc'] = function () { - abort( - "'stackAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'AsciiToString')) - Module['AsciiToString'] = function () { - abort( - "'AsciiToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'stringToAscii')) - Module['stringToAscii'] = function () { - abort( - "'stringToAscii' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'UTF16ToString')) - Module['UTF16ToString'] = function () { - abort( - "'UTF16ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'stringToUTF16')) - Module['stringToUTF16'] = function () { - abort( - "'stringToUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'lengthBytesUTF16')) - Module['lengthBytesUTF16'] = function () { - abort( - "'lengthBytesUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'UTF32ToString')) - Module['UTF32ToString'] = function () { - abort( - "'UTF32ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'stringToUTF32')) - Module['stringToUTF32'] = function () { - abort( - "'stringToUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'lengthBytesUTF32')) - Module['lengthBytesUTF32'] = function () { - abort( - "'lengthBytesUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'allocateUTF8')) - Module['allocateUTF8'] = function () { - abort( - "'allocateUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - if (!Object.getOwnPropertyDescriptor(Module, 'allocateUTF8OnStack')) - Module['allocateUTF8OnStack'] = function () { - abort( - "'allocateUTF8OnStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }; - Module['writeStackCookie'] = writeStackCookie; - Module['checkStackCookie'] = checkStackCookie; - if (!Object.getOwnPropertyDescriptor(Module, 'ALLOC_NORMAL')) - Object.defineProperty(Module, 'ALLOC_NORMAL', { - configurable: true, - get: function () { - abort( - "'ALLOC_NORMAL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }, - }); - if (!Object.getOwnPropertyDescriptor(Module, 'ALLOC_STACK')) - Object.defineProperty(Module, 'ALLOC_STACK', { - configurable: true, - get: function () { - abort( - "'ALLOC_STACK' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)" - ); - }, - }); - var calledRun; - function ExitStatus(status) { - this.name = 'ExitStatus'; - this.message = 'Program terminated with exit(' + status + ')'; - this.status = status; - } - dependenciesFulfilled = function runCaller() { - if (!calledRun) run(); - if (!calledRun) dependenciesFulfilled = runCaller; - }; - function stackCheckInit() { - _emscripten_stack_init(); - writeStackCookie(); - } - function run(args) { - if (runDependencies > 0) { - return; - } - stackCheckInit(); - preRun(); - if (runDependencies > 0) { - return; - } - function doRun() { - if (calledRun) return; - calledRun = true; - Module['calledRun'] = true; - if (ABORT) return; - initRuntime(); - readyPromiseResolve(Module); - if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized'](); - assert( - !Module['_main'], - 'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]' - ); - postRun(); - } - if (Module['setStatus']) { - Module['setStatus']('Running...'); - setTimeout(function () { - setTimeout(function () { - Module['setStatus'](''); - }, 1); - doRun(); - }, 1); - } else { - doRun(); - } - checkStackCookie(); - } - Module['run'] = run; - function checkUnflushedContent() { - var oldOut = out; - var oldErr = err; - var has = false; - out = err = function (x) { - has = true; - }; - try { - var flush = Module['_fflush']; - if (flush) flush(0); - ['stdout', 'stderr'].forEach(function (name) { - var info = FS.analyzePath('/dev/' + name); - if (!info) return; - var stream = info.object; - var rdev = stream.rdev; - var tty = TTY.ttys[rdev]; - if (tty && tty.output && tty.output.length) { - has = true; - } - }); - } catch (e) {} - out = oldOut; - err = oldErr; - if (has) { - warnOnce( - 'stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc.' - ); - } - } - function exit(status, implicit) { - checkUnflushedContent(); - if (implicit && keepRuntimeAlive() && status === 0) { - return; - } - if (keepRuntimeAlive()) { - if (!implicit) { - var msg = - 'program exited (with status: ' + - status + - '), but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)'; - readyPromiseReject(msg); - err(msg); - } - } else { - exitRuntime(); - if (Module['onExit']) Module['onExit'](status); - ABORT = true; - } - quit_(status, new ExitStatus(status)); - } - if (Module['preInit']) { - if (typeof Module['preInit'] == 'function') - Module['preInit'] = [Module['preInit']]; - while (Module['preInit'].length > 0) { - Module['preInit'].pop()(); - } - } - run(); +var Module = (function() { + var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; + if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; + return ( +function(Module) { + Module = Module || {}; - return Module.ready; - }; +var Module=typeof Module!=="undefined"?Module:{};var readyPromiseResolve,readyPromiseReject;Module["ready"]=new Promise(function(resolve,reject){readyPromiseResolve=resolve;readyPromiseReject=reject;});if(!Object.getOwnPropertyDescriptor(Module["ready"],"_main")){Object.defineProperty(Module["ready"],"_main",{configurable:true,get:function(){abort("You are getting _main on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});Object.defineProperty(Module["ready"],"_main",{configurable:true,set:function(){abort("You are setting _main on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}if(!Object.getOwnPropertyDescriptor(Module["ready"],"_emscripten_stack_get_end")){Object.defineProperty(Module["ready"],"_emscripten_stack_get_end",{configurable:true,get:function(){abort("You are getting _emscripten_stack_get_end on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});Object.defineProperty(Module["ready"],"_emscripten_stack_get_end",{configurable:true,set:function(){abort("You are setting _emscripten_stack_get_end on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}if(!Object.getOwnPropertyDescriptor(Module["ready"],"_emscripten_stack_get_free")){Object.defineProperty(Module["ready"],"_emscripten_stack_get_free",{configurable:true,get:function(){abort("You are getting _emscripten_stack_get_free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});Object.defineProperty(Module["ready"],"_emscripten_stack_get_free",{configurable:true,set:function(){abort("You are setting _emscripten_stack_get_free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}if(!Object.getOwnPropertyDescriptor(Module["ready"],"_emscripten_stack_init")){Object.defineProperty(Module["ready"],"_emscripten_stack_init",{configurable:true,get:function(){abort("You are getting _emscripten_stack_init on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});Object.defineProperty(Module["ready"],"_emscripten_stack_init",{configurable:true,set:function(){abort("You are setting _emscripten_stack_init on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}if(!Object.getOwnPropertyDescriptor(Module["ready"],"_stackSave")){Object.defineProperty(Module["ready"],"_stackSave",{configurable:true,get:function(){abort("You are getting _stackSave on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});Object.defineProperty(Module["ready"],"_stackSave",{configurable:true,set:function(){abort("You are setting _stackSave on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}if(!Object.getOwnPropertyDescriptor(Module["ready"],"_stackRestore")){Object.defineProperty(Module["ready"],"_stackRestore",{configurable:true,get:function(){abort("You are getting _stackRestore on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});Object.defineProperty(Module["ready"],"_stackRestore",{configurable:true,set:function(){abort("You are setting _stackRestore on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}if(!Object.getOwnPropertyDescriptor(Module["ready"],"_stackAlloc")){Object.defineProperty(Module["ready"],"_stackAlloc",{configurable:true,get:function(){abort("You are getting _stackAlloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});Object.defineProperty(Module["ready"],"_stackAlloc",{configurable:true,set:function(){abort("You are setting _stackAlloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}if(!Object.getOwnPropertyDescriptor(Module["ready"],"___wasm_call_ctors")){Object.defineProperty(Module["ready"],"___wasm_call_ctors",{configurable:true,get:function(){abort("You are getting ___wasm_call_ctors on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});Object.defineProperty(Module["ready"],"___wasm_call_ctors",{configurable:true,set:function(){abort("You are setting ___wasm_call_ctors on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}if(!Object.getOwnPropertyDescriptor(Module["ready"],"_fflush")){Object.defineProperty(Module["ready"],"_fflush",{configurable:true,get:function(){abort("You are getting _fflush on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});Object.defineProperty(Module["ready"],"_fflush",{configurable:true,set:function(){abort("You are setting _fflush on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}if(!Object.getOwnPropertyDescriptor(Module["ready"],"___errno_location")){Object.defineProperty(Module["ready"],"___errno_location",{configurable:true,get:function(){abort("You are getting ___errno_location on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});Object.defineProperty(Module["ready"],"___errno_location",{configurable:true,set:function(){abort("You are setting ___errno_location on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}if(!Object.getOwnPropertyDescriptor(Module["ready"],"_malloc")){Object.defineProperty(Module["ready"],"_malloc",{configurable:true,get:function(){abort("You are getting _malloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});Object.defineProperty(Module["ready"],"_malloc",{configurable:true,set:function(){abort("You are setting _malloc on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}if(!Object.getOwnPropertyDescriptor(Module["ready"],"_free")){Object.defineProperty(Module["ready"],"_free",{configurable:true,get:function(){abort("You are getting _free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});Object.defineProperty(Module["ready"],"_free",{configurable:true,set:function(){abort("You are setting _free on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}if(!Object.getOwnPropertyDescriptor(Module["ready"],"___cxa_is_pointer_type")){Object.defineProperty(Module["ready"],"___cxa_is_pointer_type",{configurable:true,get:function(){abort("You are getting ___cxa_is_pointer_type on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});Object.defineProperty(Module["ready"],"___cxa_is_pointer_type",{configurable:true,set:function(){abort("You are setting ___cxa_is_pointer_type on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}if(!Object.getOwnPropertyDescriptor(Module["ready"],"___cxa_can_catch")){Object.defineProperty(Module["ready"],"___cxa_can_catch",{configurable:true,get:function(){abort("You are getting ___cxa_can_catch on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});Object.defineProperty(Module["ready"],"___cxa_can_catch",{configurable:true,set:function(){abort("You are setting ___cxa_can_catch on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}if(!Object.getOwnPropertyDescriptor(Module["ready"],"_setThrew")){Object.defineProperty(Module["ready"],"_setThrew",{configurable:true,get:function(){abort("You are getting _setThrew on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});Object.defineProperty(Module["ready"],"_setThrew",{configurable:true,set:function(){abort("You are setting _setThrew on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}if(!Object.getOwnPropertyDescriptor(Module["ready"],"_memset")){Object.defineProperty(Module["ready"],"_memset",{configurable:true,get:function(){abort("You are getting _memset on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});Object.defineProperty(Module["ready"],"_memset",{configurable:true,set:function(){abort("You are setting _memset on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}if(!Object.getOwnPropertyDescriptor(Module["ready"],"___getTypeName")){Object.defineProperty(Module["ready"],"___getTypeName",{configurable:true,get:function(){abort("You are getting ___getTypeName on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});Object.defineProperty(Module["ready"],"___getTypeName",{configurable:true,set:function(){abort("You are setting ___getTypeName on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}if(!Object.getOwnPropertyDescriptor(Module["ready"],"___embind_register_native_and_builtin_types")){Object.defineProperty(Module["ready"],"___embind_register_native_and_builtin_types",{configurable:true,get:function(){abort("You are getting ___embind_register_native_and_builtin_types on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});Object.defineProperty(Module["ready"],"___embind_register_native_and_builtin_types",{configurable:true,set:function(){abort("You are setting ___embind_register_native_and_builtin_types on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}if(!Object.getOwnPropertyDescriptor(Module["ready"],"onRuntimeInitialized")){Object.defineProperty(Module["ready"],"onRuntimeInitialized",{configurable:true,get:function(){abort("You are getting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});Object.defineProperty(Module["ready"],"onRuntimeInitialized",{configurable:true,set:function(){abort("You are setting onRuntimeInitialized on the Promise object, instead of the instance. Use .then() to get called back with the instance, see the MODULARIZE docs in src/settings.js");}});}var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key];}}var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(Module["ENVIRONMENT"]){throw new Error("Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -s ENVIRONMENT=web or -s ENVIRONMENT=node)")}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=_require_path_.dirname(scriptDirectory)+"/";}else {scriptDirectory=__dirname+"/";}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=_require_crypto_;if(!nodePath)nodePath=_require_path_;filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret);}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/");}process["argv"].slice(2);process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status);};Module["inspect"]=function(){return "[Emscripten Module object]"};}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)};}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){scriptArgs;}if(typeof quit==="function"){quit_=function(status){quit(status);};}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print;}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href;}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src;}if(_scriptDir){scriptDirectory=_scriptDir;}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1);}else {scriptDirectory="";}{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)};}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror();};xhr.onerror=onerror;xhr.send(null);};}}else {throw new Error("environment detection error")}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key];}}moduleOverrides=null;if(Module["arguments"]);if(!Object.getOwnPropertyDescriptor(Module,"arguments")){Object.defineProperty(Module,"arguments",{configurable:true,get:function(){abort("Module.arguments has been replaced with plain arguments_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");}});}if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(!Object.getOwnPropertyDescriptor(Module,"thisProgram")){Object.defineProperty(Module,"thisProgram",{configurable:true,get:function(){abort("Module.thisProgram has been replaced with plain thisProgram (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");}});}if(Module["quit"])quit_=Module["quit"];if(!Object.getOwnPropertyDescriptor(Module,"quit")){Object.defineProperty(Module,"quit",{configurable:true,get:function(){abort("Module.quit has been replaced with plain quit_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");}});}assert(typeof Module["memoryInitializerPrefixURL"]==="undefined","Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["pthreadMainPrefixURL"]==="undefined","Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["cdInitializerPrefixURL"]==="undefined","Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["filePackagePrefixURL"]==="undefined","Module.filePackagePrefixURL option was removed, use Module.locateFile instead");assert(typeof Module["read"]==="undefined","Module.read option was removed (modify read_ in JS)");assert(typeof Module["readAsync"]==="undefined","Module.readAsync option was removed (modify readAsync in JS)");assert(typeof Module["readBinary"]==="undefined","Module.readBinary option was removed (modify readBinary in JS)");assert(typeof Module["setWindowTitle"]==="undefined","Module.setWindowTitle option was removed (modify setWindowTitle in JS)");assert(typeof Module["TOTAL_MEMORY"]==="undefined","Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY");if(!Object.getOwnPropertyDescriptor(Module,"read")){Object.defineProperty(Module,"read",{configurable:true,get:function(){abort("Module.read has been replaced with plain read_ (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");}});}if(!Object.getOwnPropertyDescriptor(Module,"readAsync")){Object.defineProperty(Module,"readAsync",{configurable:true,get:function(){abort("Module.readAsync has been replaced with plain readAsync (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");}});}if(!Object.getOwnPropertyDescriptor(Module,"readBinary")){Object.defineProperty(Module,"readBinary",{configurable:true,get:function(){abort("Module.readBinary has been replaced with plain readBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");}});}if(!Object.getOwnPropertyDescriptor(Module,"setWindowTitle")){Object.defineProperty(Module,"setWindowTitle",{configurable:true,get:function(){abort("Module.setWindowTitle has been replaced with plain setWindowTitle (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");}});}var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text);}}var tempRet0=0;var setTempRet0=function(value){tempRet0=value;};var getTempRet0=function(){return tempRet0};var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];if(!Object.getOwnPropertyDescriptor(Module,"wasmBinary")){Object.defineProperty(Module,"wasmBinary",{configurable:true,get:function(){abort("Module.wasmBinary has been replaced with plain wasmBinary (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");}});}var noExitRuntime=Module["noExitRuntime"]||true;if(!Object.getOwnPropertyDescriptor(Module,"noExitRuntime")){Object.defineProperty(Module,"noExitRuntime",{configurable:true,get:function(){abort("Module.noExitRuntime has been replaced with plain noExitRuntime (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");}});}if(typeof WebAssembly!=="object"){abort("no native wasm support detected");}var wasmMemory;var ABORT=false;function assert(condition,text){if(!condition){abort("Assertion failed: "+text);}}var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(heap[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&heap.subarray&&UTF8Decoder){return UTF8Decoder.decode(heap.subarray(idx,endPtr))}else {var str="";while(idx>10,56320|ch&1023);}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023;}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u;}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63;}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63;}else {if(outIdx+3>=endIdx)break;if(u>=2097152)warnOnce("Invalid Unicode code point 0x"+u.toString(16)+" encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x1FFFFF).");heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63;}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){assert(typeof maxBytesToWrite=="number","stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4;}return len}var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function UTF16ToString(ptr,maxBytesToRead){assert(ptr%2==0,"Pointer passed to UTF16ToString must be aligned to two bytes!");var endPtr=ptr;var idx=endPtr>>1;var maxIdx=idx+maxBytesToRead/2;while(!(idx>=maxIdx)&&HEAPU16[idx])++idx;endPtr=idx<<1;if(endPtr-ptr>32&&UTF16Decoder){return UTF16Decoder.decode(HEAPU8.subarray(ptr,endPtr))}else {var str="";for(var i=0;!(i>=maxBytesToRead/2);++i){var codeUnit=HEAP16[ptr+i*2>>1];if(codeUnit==0)break;str+=String.fromCharCode(codeUnit);}return str}}function stringToUTF16(str,outPtr,maxBytesToWrite){assert(outPtr%2==0,"Pointer passed to stringToUTF16 must be aligned to two bytes!");assert(typeof maxBytesToWrite=="number","stringToUTF16(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647;}if(maxBytesToWrite<2)return 0;maxBytesToWrite-=2;var startPtr=outPtr;var numCharsToWrite=maxBytesToWrite>1]=codeUnit;outPtr+=2;}HEAP16[outPtr>>1]=0;return outPtr-startPtr}function lengthBytesUTF16(str){return str.length*2}function UTF32ToString(ptr,maxBytesToRead){assert(ptr%4==0,"Pointer passed to UTF32ToString must be aligned to four bytes!");var i=0;var str="";while(!(i>=maxBytesToRead/4)){var utf32=HEAP32[ptr+i*4>>2];if(utf32==0)break;++i;if(utf32>=65536){var ch=utf32-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023);}else {str+=String.fromCharCode(utf32);}}return str}function stringToUTF32(str,outPtr,maxBytesToWrite){assert(outPtr%4==0,"Pointer passed to stringToUTF32 must be aligned to four bytes!");assert(typeof maxBytesToWrite=="number","stringToUTF32(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!");if(maxBytesToWrite===undefined){maxBytesToWrite=2147483647;}if(maxBytesToWrite<4)return 0;var startPtr=outPtr;var endPtr=startPtr+maxBytesToWrite-4;for(var i=0;i=55296&&codeUnit<=57343){var trailSurrogate=str.charCodeAt(++i);codeUnit=65536+((codeUnit&1023)<<10)|trailSurrogate&1023;}HEAP32[outPtr>>2]=codeUnit;outPtr+=4;if(outPtr+4>endPtr)break}HEAP32[outPtr>>2]=0;return outPtr-startPtr}function lengthBytesUTF32(str){var len=0;for(var i=0;i=55296&&codeUnit<=57343)++i;len+=4;}return len}function writeArrayToMemory(array,buffer){assert(array.length>=0,"writeArrayToMemory array must have a length (should be an array or typed array)");HEAP8.set(array,buffer);}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i);}if(!dontAddNull)HEAP8[buffer>>0]=0;}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple;}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf);}var TOTAL_STACK=5242880;if(Module["TOTAL_STACK"])assert(TOTAL_STACK===Module["TOTAL_STACK"],"the stack size can no longer be determined at runtime");var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(!Object.getOwnPropertyDescriptor(Module,"INITIAL_MEMORY")){Object.defineProperty(Module,"INITIAL_MEMORY",{configurable:true,get:function(){abort("Module.INITIAL_MEMORY has been replaced with plain INITIAL_MEMORY (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)");}});}assert(INITIAL_MEMORY>=TOTAL_STACK,"INITIAL_MEMORY should be larger than TOTAL_STACK, was "+INITIAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");assert(typeof Int32Array!=="undefined"&&typeof Float64Array!=="undefined"&&Int32Array.prototype.subarray!==undefined&&Int32Array.prototype.set!==undefined,"JS engine does not provide full typed array support");assert(!Module["wasmMemory"],"Use of `wasmMemory` detected. Use -s IMPORTED_MEMORY to define wasmMemory externally");assert(INITIAL_MEMORY==16777216,"Detected runtime INITIAL_MEMORY setting. Use -s IMPORTED_MEMORY to define wasmMemory dynamically");var wasmTable;function writeStackCookie(){var max=_emscripten_stack_get_end();assert((max&3)==0);HEAPU32[(max>>2)+1]=34821223;HEAPU32[(max>>2)+2]=2310721022;HEAP32[0]=1668509029;}function checkStackCookie(){if(ABORT)return;var max=_emscripten_stack_get_end();var cookie1=HEAPU32[(max>>2)+1];var cookie2=HEAPU32[(max>>2)+2];if(cookie1!=34821223||cookie2!=2310721022){abort("Stack overflow! Stack cookie has been overwritten, expected hex dwords 0x89BACDFE and 0x2135467, but received 0x"+cookie2.toString(16)+" "+cookie1.toString(16));}if(HEAP32[0]!==1668509029)abort("Runtime error: The application has corrupted its heap memory area (address zero)!");}(function(){var h16=new Int16Array(1);var h8=new Int8Array(h16.buffer);h16[0]=25459;if(h8[0]!==115||h8[1]!==99)throw "Runtime error: expected the system to be little-endian! (Run with -s SUPPORT_BIG_ENDIAN=1 to bypass)"})();var __ATPRERUN__=[];var __ATINIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift());}}callRuntimeCallbacks(__ATPRERUN__);}function initRuntime(){checkStackCookie();assert(!runtimeInitialized);runtimeInitialized=true;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();FS.ignorePermissions=false;callRuntimeCallbacks(__ATINIT__);}function exitRuntime(){checkStackCookie();runtimeExited=true;}function postRun(){checkStackCookie();if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift());}}callRuntimeCallbacks(__ATPOSTRUN__);}function addOnPreRun(cb){__ATPRERUN__.unshift(cb);}function addOnInit(cb){__ATINIT__.unshift(cb);}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb);}assert(Math.imul,"This browser does not support Math.imul(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.fround,"This browser does not support Math.fround(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.clz32,"This browser does not support Math.clz32(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");assert(Math.trunc,"This browser does not support Math.trunc(), build with LEGACY_VM_SUPPORT or POLYFILL_OLD_MATH_FUNCTIONS to add in a polyfill");var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;var runDependencyTracking={};function getUniqueRunDependency(id){var orig=id;while(1){if(!runDependencyTracking[id])return id;id=orig+Math.random();}}function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies);}if(id){assert(!runDependencyTracking[id]);runDependencyTracking[id]=1;if(runDependencyWatcher===null&&typeof setInterval!=="undefined"){runDependencyWatcher=setInterval(function(){if(ABORT){clearInterval(runDependencyWatcher);runDependencyWatcher=null;return}var shown=false;for(var dep in runDependencyTracking){if(!shown){shown=true;err("still waiting on run dependencies:");}err("dependency: "+dep);}if(shown){err("(end of list)");}},1e4);}}else {err("warning: run dependency added without ID");}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies);}if(id){assert(runDependencyTracking[id]);delete runDependencyTracking[id];}else {err("warning: run dependency removed without ID");}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null;}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback();}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what);}what+="";err(what);ABORT=true;var output="abort("+what+") at "+stackTrace();what=output;var e=new WebAssembly.RuntimeError(what);readyPromiseReject(e);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}function createExportWrapper(name,fixedasm){return function(){var displayName=name;var asm=fixedasm;if(!fixedasm){asm=Module["asm"];}assert(runtimeInitialized,"native function `"+displayName+"` called before runtime initialization");assert(!runtimeExited,"native function `"+displayName+"` called after runtime exit (use NO_EXIT_RUNTIME to keep it alive after main() exits)");if(!asm[name]){assert(asm[name],"exported native function `"+displayName+"` not found");}return asm[name].apply(null,arguments)}}var wasmBinaryFile;wasmBinaryFile="cgal_node.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile);}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else {throw "both async and sync fetching of the wasm failed"}}catch(err){abort(err);}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw "failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else {if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response));},reject);})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"env":asmLibraryArg,"wasi_snapshot_preview1":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmMemory=Module["asm"]["memory"];assert(wasmMemory,"memory not found in wasm exports");updateGlobalBufferAndViews(wasmMemory.buffer);wasmTable=Module["asm"]["__indirect_function_table"];assert(wasmTable,"table not found in wasm exports");addOnInit(Module["asm"]["__wasm_call_ctors"]);removeRunDependency("wasm-instantiate");}addRunDependency("wasm-instantiate");var trueModule=Module;function receiveInstantiationResult(result){assert(Module===trueModule,"the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?");trueModule=null;receiveInstance(result["instance"]);}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);if(isFileURI(wasmBinaryFile)){err("warning: Loading from a file URI ("+wasmBinaryFile+") is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing");}abort(reason);})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else {return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync().catch(readyPromiseReject);return {}}var tempDouble;var tempI64;function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)();}else {wasmTable.get(func)(callback.arg);}}else {func(callback.arg===undefined?null:callback.arg);}}}function demangle(func){warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){var regex=/\b_Z[\w\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+" ["+x+"]"})}function jsStackTrace(){var error=new Error;if(!error.stack){try{throw new Error}catch(e){error=e;}if(!error.stack){return "(no stack trace available)"}}return error.stack.toString()}var runtimeKeepaliveCounter=0;function keepRuntimeAlive(){return noExitRuntime||runtimeKeepaliveCounter>0}function stackTrace(){var js=jsStackTrace();if(Module["extraStackTrace"])js+="\n"+Module["extraStackTrace"]();return demangleAll(js)}function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"]);}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){}function ___cxa_atexit(a0,a1){return _atexit()}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type;};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor;};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount;};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught;};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown;};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false);};this.add_ref=function(){var value=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=value+1;};this.release_ref=function(){var prev=HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2];HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=prev-1;assert(prev>0);return prev===1};}function CatchInfo(ptr){this.free=function(){_free(this.ptr);this.ptr=0;};this.set_base_ptr=function(basePtr){HEAP32[this.ptr>>2]=basePtr;};this.get_base_ptr=function(){return HEAP32[this.ptr>>2]};this.set_adjusted_ptr=function(adjustedPtr){var ptrSize=4;HEAP32[this.ptr+ptrSize>>2]=adjustedPtr;};this.get_adjusted_ptr=function(){var ptrSize=4;return HEAP32[this.ptr+ptrSize>>2]};this.get_exception_ptr=function(){var isPointer=___cxa_is_pointer_type(this.get_exception_info().get_type());if(isPointer){return HEAP32[this.get_base_ptr()>>2]}var adjusted=this.get_adjusted_ptr();if(adjusted!==0)return adjusted;return this.get_base_ptr()};this.get_exception_info=function(){return new ExceptionInfo(this.get_base_ptr())};if(ptr===undefined){this.ptr=_malloc(8);this.set_adjusted_ptr(0);}else {this.ptr=ptr;}}var exceptionCaught=[];function exception_addRef(info){info.add_ref();}var uncaughtExceptionCount=0;function ___cxa_begin_catch(ptr){var catchInfo=new CatchInfo(ptr);var info=catchInfo.get_exception_info();if(!info.get_caught()){info.set_caught(true);uncaughtExceptionCount--;}info.set_rethrown(false);exceptionCaught.push(catchInfo);exception_addRef(info);return catchInfo.get_exception_ptr()}var exceptionLast=0;function ___cxa_free_exception(ptr){try{return _free(new ExceptionInfo(ptr).ptr)}catch(e){err("exception during cxa_free_exception: "+e);}}function exception_decRef(info){if(info.release_ref()&&!info.get_rethrown()){var destructor=info.get_destructor();if(destructor){wasmTable.get(destructor)(info.excPtr);}___cxa_free_exception(info.excPtr);}}function ___cxa_end_catch(){_setThrew(0);assert(exceptionCaught.length>0);var catchInfo=exceptionCaught.pop();exception_decRef(catchInfo.get_exception_info());catchInfo.free();exceptionLast=0;}function ___resumeException(catchInfoPtr){var catchInfo=new CatchInfo(catchInfoPtr);var ptr=catchInfo.get_base_ptr();if(!exceptionLast){exceptionLast=ptr;}catchInfo.free();throw ptr}function ___cxa_find_matching_catch_2(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted);}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_find_matching_catch_3(){var thrown=exceptionLast;if(!thrown){setTempRet0(0);return 0|0}var info=new ExceptionInfo(thrown);var thrownType=info.get_type();var catchInfo=new CatchInfo;catchInfo.set_base_ptr(thrown);if(!thrownType){setTempRet0(0);return catchInfo.ptr|0}var typeArray=Array.prototype.slice.call(arguments);var stackTop=stackSave();var exceptionThrowBuf=stackAlloc(4);HEAP32[exceptionThrowBuf>>2]=thrown;for(var i=0;i>2];if(thrown!==adjusted){catchInfo.set_adjusted_ptr(adjusted);}setTempRet0(caughtType);return catchInfo.ptr|0}}stackRestore(stackTop);setTempRet0(thrownType);return catchInfo.ptr|0}function ___cxa_rethrow(){var catchInfo=exceptionCaught.pop();if(!catchInfo){abort("no exception to throw");}var info=catchInfo.get_exception_info();var ptr=catchInfo.get_base_ptr();if(!info.get_rethrown()){exceptionCaught.push(catchInfo);info.set_rethrown(true);info.set_caught(false);uncaughtExceptionCount++;}else {catchInfo.free();}exceptionLast=ptr;throw ptr}function ___cxa_thread_atexit(a0,a1){return _atexit()}function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function ___cxa_uncaught_exceptions(){return uncaughtExceptionCount}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1);}else if(last===".."){parts.splice(i,1);up++;}else if(up){parts.splice(i,1);up--;}}if(allowAboveRoot){for(;up;up--){parts.unshift("..");}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return !!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path=".";}if(path&&trailingSlash){path+="/";}return (isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return "."}if(dir){dir=dir.substr(0,dir.length-1);}return root+dir},basename:function(path){if(path==="/")return "/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=_require_crypto_;return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("no cryptographic support found for randomDevice. consider polyfilling it if you want to use something insecure like Math.random(), e.g. put this in a --pre-js: var crypto = { getRandomValues: function(array) { for (var i = 0; i < array.length; i++) array[i] = (Math.random()*256)|0 } };");}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return ""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/";}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return !!p}),!resolvedAbsolute).join("/");return (resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return [];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8");}else {result=null;}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n";}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n";}}if(!result){return null}tty.input=intArrayFromString(result,true);}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[];}else {if(val!=0)tty.output.push(val);}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[];}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[];}else {if(val!=0)tty.output.push(val);}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[];}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,65536);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0);},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0;}else {var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)));}node.usedBytes=newSize;}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096;}else if(FS.isFile(node.mode)){attr.size=node.usedBytes;}else if(FS.isLink(node.mode)){attr.size=node.link.length;}else {attr.size=0;}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode;}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp;}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size);}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name);}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir;},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now();},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now();},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key);}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);assert(size>=0);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset);}else {for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return !!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return {path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent;}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node;},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next;}else {var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next;}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){assert(typeof parent==="object");var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node);},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return !!node.mounted},isFile:function(mode){return (mode&61440)===32768},isDir:function(mode){return (mode&61440)===16384},isLink:function(mode){return (mode&61440)===40960},isChrdev:function(mode){return (mode&61440)===8192},isBlkdev:function(mode){return (mode&61440)===24576},isFIFO:function(mode){return (mode&61440)===4096},isSocket:function(mode){return (mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w";}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name);}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else {if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val;}},isRead:{get:function(){return (this.flags&2097155)!==1}},isWrite:{get:function(){return (this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}};}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p];}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null;},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream);}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops};},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts);}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false;}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){assert(FS.syncFSRequests>0);FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null);}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done);});},mount:function(type,opts,mountpoint){if(typeof type==="string"){throw type}var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot;}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount);}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current);}current=next;}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);assert(idx!==-1);node.mount.mounts.splice(idx,1);},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter;};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined");}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else {return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end);}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed");}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true;};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw "Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength();}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength();}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray};}else {var properties={isDevice:false,url:url};}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents;}else if(properties.url){node.contents=null;node.url=properties.url;}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)};});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);assert(size>=0);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags);},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return -28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return -28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return -28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return -44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return -2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return -1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return -1;ret+=curr;}return ret},varargs:undefined,get:function(){assert(SYSCALLS.varargs!=undefined);SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){if(low>=0)assert(high===0);else assert(high===-1);return low}};function ___sys_getrusage(who,usage){try{_memset(usage,0,136);HEAP32[usage>>2]=1;HEAP32[usage+4>>2]=2;HEAP32[usage+8>>2]=3;HEAP32[usage+12>>2]=4;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return -e.errno}}function __embind_register_bigint(primitiveType,name,size,minRange,maxRange){}function getShiftFromSize(size){switch(size){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+size)}}function embind_init_charCodes(){var codes=new Array(256);for(var i=0;i<256;++i){codes[i]=String.fromCharCode(i);}embind_charCodes=codes;}var embind_charCodes=undefined;function readLatin1String(ptr){var ret="";var c=ptr;while(HEAPU8[c]){ret+=embind_charCodes[HEAPU8[c++]];}return ret}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var char_0=48;var char_9=57;function makeLegalFunctionName(name){if(undefined===name){return "_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return "_"+name}else {return name}}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n")(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,function(message){this.name=errorName;this.message=message;var stack=new Error(message).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"");}});errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=function(){if(this.message===undefined){return this.name}else {return this.name+": "+this.message}};return errorClass}var BindingError=undefined;function throwBindingError(message){throw new BindingError(message)}var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach(function(type){typeDependencies[type]=dependentTypes;});function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count");}for(var i=0;i>shift])},destructorFunction:null});}function ClassHandle_isAliasOf(other){if(!(this instanceof ClassHandle)){return false}if(!(other instanceof ClassHandle)){return false}var leftClass=this.$$.ptrType.registeredClass;var left=this.$$.ptr;var rightClass=other.$$.ptrType.registeredClass;var right=other.$$.ptr;while(leftClass.baseClass){left=leftClass.upcast(left);leftClass=leftClass.baseClass;}while(rightClass.baseClass){right=rightClass.upcast(right);rightClass=rightClass.baseClass;}return leftClass===rightClass&&left===right}function shallowCopyInternalPointer(o){return {count:o.count,deleteScheduled:o.deleteScheduled,preservePointerOnDelete:o.preservePointerOnDelete,ptr:o.ptr,ptrType:o.ptrType,smartPtr:o.smartPtr,smartPtrType:o.smartPtrType}}function throwInstanceAlreadyDeleted(obj){function getInstanceTypeName(handle){return handle.$$.ptrType.registeredClass.name}throwBindingError(getInstanceTypeName(obj)+" instance already deleted");}var finalizationGroup=false;function detachFinalizer(handle){}function runDestructor($$){if($$.smartPtr){$$.smartPtrType.rawDestructor($$.smartPtr);}else {$$.ptrType.registeredClass.rawDestructor($$.ptr);}}function releaseClassHandle($$){$$.count.value-=1;var toDelete=0===$$.count.value;if(toDelete){runDestructor($$);}}function attachFinalizer(handle){if("undefined"===typeof FinalizationGroup){attachFinalizer=function(handle){return handle};return handle}finalizationGroup=new FinalizationGroup(function(iter){for(var result=iter.next();!result.done;result=iter.next()){var $$=result.value;if(!$$.ptr){console.warn("object already deleted: "+$$.ptr);}else {releaseClassHandle($$);}}});attachFinalizer=function(handle){finalizationGroup.register(handle,handle.$$,handle.$$);return handle};detachFinalizer=function(handle){finalizationGroup.unregister(handle.$$);};return attachFinalizer(handle)}function ClassHandle_clone(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this);}if(this.$$.preservePointerOnDelete){this.$$.count.value+=1;return this}else {var clone=attachFinalizer(Object.create(Object.getPrototypeOf(this),{$$:{value:shallowCopyInternalPointer(this.$$)}}));clone.$$.count.value+=1;clone.$$.deleteScheduled=false;return clone}}function ClassHandle_delete(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this);}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion");}detachFinalizer(this);releaseClassHandle(this.$$);if(!this.$$.preservePointerOnDelete){this.$$.smartPtr=undefined;this.$$.ptr=undefined;}}function ClassHandle_isDeleted(){return !this.$$.ptr}var delayFunction=undefined;var deletionQueue=[];function flushPendingDeletes(){while(deletionQueue.length){var obj=deletionQueue.pop();obj.$$.deleteScheduled=false;obj["delete"]();}}function ClassHandle_deleteLater(){if(!this.$$.ptr){throwInstanceAlreadyDeleted(this);}if(this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete){throwBindingError("Object already scheduled for deletion");}deletionQueue.push(this);if(deletionQueue.length===1&&delayFunction){delayFunction(flushPendingDeletes);}this.$$.deleteScheduled=true;return this}function init_ClassHandle(){ClassHandle.prototype["isAliasOf"]=ClassHandle_isAliasOf;ClassHandle.prototype["clone"]=ClassHandle_clone;ClassHandle.prototype["delete"]=ClassHandle_delete;ClassHandle.prototype["isDeleted"]=ClassHandle_isDeleted;ClassHandle.prototype["deleteLater"]=ClassHandle_deleteLater;}function ClassHandle(){}var registeredPointers={};function ensureOverloadTable(proto,methodName,humanName){if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=function(){if(!proto[methodName].overloadTable.hasOwnProperty(arguments.length)){throwBindingError("Function '"+humanName+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+proto[methodName].overloadTable+")!");}return proto[methodName].overloadTable[arguments.length].apply(this,arguments)};proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc;}}function exposePublicSymbol(name,value,numArguments){if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError("Cannot register public name '"+name+"' twice");}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError("Cannot register multiple overloads of a function with the same number of arguments ("+numArguments+")!");}Module[name].overloadTable[numArguments]=value;}else {Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments;}}}function RegisteredClass(name,constructor,instancePrototype,rawDestructor,baseClass,getActualType,upcast,downcast){this.name=name;this.constructor=constructor;this.instancePrototype=instancePrototype;this.rawDestructor=rawDestructor;this.baseClass=baseClass;this.getActualType=getActualType;this.upcast=upcast;this.downcast=downcast;this.pureVirtualFunctions=[];}function upcastPointer(ptr,ptrClass,desiredClass){while(ptrClass!==desiredClass){if(!ptrClass.upcast){throwBindingError("Expected null or instance of "+desiredClass.name+", got an instance of "+ptrClass.name);}ptr=ptrClass.upcast(ptr);ptrClass=ptrClass.baseClass;}return ptr}function constNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name);}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name);}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name);}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function genericPointerToWireType(destructors,handle){var ptr;if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name);}if(this.isSmartPointer){ptr=this.rawConstructor();if(destructors!==null){destructors.push(this.rawDestructor,ptr);}return ptr}else {return 0}}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name);}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name);}if(!this.isConst&&handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name);}var handleClass=handle.$$.ptrType.registeredClass;ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);if(this.isSmartPointer){if(undefined===handle.$$.smartPtr){throwBindingError("Passing raw pointer to smart pointer is illegal");}switch(this.sharingPolicy){case 0:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr;}else {throwBindingError("Cannot convert argument of type "+(handle.$$.smartPtrType?handle.$$.smartPtrType.name:handle.$$.ptrType.name)+" to parameter type "+this.name);}break;case 1:ptr=handle.$$.smartPtr;break;case 2:if(handle.$$.smartPtrType===this){ptr=handle.$$.smartPtr;}else {var clonedHandle=handle["clone"]();ptr=this.rawShare(ptr,__emval_register(function(){clonedHandle["delete"]();}));if(destructors!==null){destructors.push(this.rawDestructor,ptr);}}break;default:throwBindingError("Unsupporting sharing policy");}}return ptr}function nonConstNoSmartPtrRawPointerToWireType(destructors,handle){if(handle===null){if(this.isReference){throwBindingError("null is not a valid "+this.name);}return 0}if(!handle.$$){throwBindingError('Cannot pass "'+_embind_repr(handle)+'" as a '+this.name);}if(!handle.$$.ptr){throwBindingError("Cannot pass deleted object as a pointer of type "+this.name);}if(handle.$$.ptrType.isConst){throwBindingError("Cannot convert argument of type "+handle.$$.ptrType.name+" to parameter type "+this.name);}var handleClass=handle.$$.ptrType.registeredClass;var ptr=upcastPointer(handle.$$.ptr,handleClass,this.registeredClass);return ptr}function simpleReadValueFromPointer(pointer){return this["fromWireType"](HEAPU32[pointer>>2])}function RegisteredPointer_getPointee(ptr){if(this.rawGetPointee){ptr=this.rawGetPointee(ptr);}return ptr}function RegisteredPointer_destructor(ptr){if(this.rawDestructor){this.rawDestructor(ptr);}}function RegisteredPointer_deleteObject(handle){if(handle!==null){handle["delete"]();}}function downcastPointer(ptr,ptrClass,desiredClass){if(ptrClass===desiredClass){return ptr}if(undefined===desiredClass.baseClass){return null}var rv=downcastPointer(ptr,ptrClass,desiredClass.baseClass);if(rv===null){return null}return desiredClass.downcast(rv)}function getInheritedInstanceCount(){return Object.keys(registeredInstances).length}function getLiveInheritedInstances(){var rv=[];for(var k in registeredInstances){if(registeredInstances.hasOwnProperty(k)){rv.push(registeredInstances[k]);}}return rv}function setDelayFunction(fn){delayFunction=fn;if(deletionQueue.length&&delayFunction){delayFunction(flushPendingDeletes);}}function init_embind(){Module["getInheritedInstanceCount"]=getInheritedInstanceCount;Module["getLiveInheritedInstances"]=getLiveInheritedInstances;Module["flushPendingDeletes"]=flushPendingDeletes;Module["setDelayFunction"]=setDelayFunction;}var registeredInstances={};function getBasestPointer(class_,ptr){if(ptr===undefined){throwBindingError("ptr should not be undefined");}while(class_.baseClass){ptr=class_.upcast(ptr);class_=class_.baseClass;}return ptr}function getInheritedInstance(class_,ptr){ptr=getBasestPointer(class_,ptr);return registeredInstances[ptr]}function makeClassHandle(prototype,record){if(!record.ptrType||!record.ptr){throwInternalError("makeClassHandle requires ptr and ptrType");}var hasSmartPtrType=!!record.smartPtrType;var hasSmartPtr=!!record.smartPtr;if(hasSmartPtrType!==hasSmartPtr){throwInternalError("Both smartPtrType and smartPtr must be specified");}record.count={value:1};return attachFinalizer(Object.create(prototype,{$$:{value:record}}))}function RegisteredPointer_fromWireType(ptr){var rawPointer=this.getPointee(ptr);if(!rawPointer){this.destructor(ptr);return null}var registeredInstance=getInheritedInstance(this.registeredClass,rawPointer);if(undefined!==registeredInstance){if(0===registeredInstance.$$.count.value){registeredInstance.$$.ptr=rawPointer;registeredInstance.$$.smartPtr=ptr;return registeredInstance["clone"]()}else {var rv=registeredInstance["clone"]();this.destructor(ptr);return rv}}function makeDefaultHandle(){if(this.isSmartPointer){return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:rawPointer,smartPtrType:this,smartPtr:ptr})}else {return makeClassHandle(this.registeredClass.instancePrototype,{ptrType:this,ptr:ptr})}}var actualType=this.registeredClass.getActualType(rawPointer);var registeredPointerRecord=registeredPointers[actualType];if(!registeredPointerRecord){return makeDefaultHandle.call(this)}var toType;if(this.isConst){toType=registeredPointerRecord.constPointerType;}else {toType=registeredPointerRecord.pointerType;}var dp=downcastPointer(rawPointer,this.registeredClass,toType.registeredClass);if(dp===null){return makeDefaultHandle.call(this)}if(this.isSmartPointer){return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp,smartPtrType:this,smartPtr:ptr})}else {return makeClassHandle(toType.registeredClass.instancePrototype,{ptrType:toType,ptr:dp})}}function init_RegisteredPointer(){RegisteredPointer.prototype.getPointee=RegisteredPointer_getPointee;RegisteredPointer.prototype.destructor=RegisteredPointer_destructor;RegisteredPointer.prototype["argPackAdvance"]=8;RegisteredPointer.prototype["readValueFromPointer"]=simpleReadValueFromPointer;RegisteredPointer.prototype["deleteObject"]=RegisteredPointer_deleteObject;RegisteredPointer.prototype["fromWireType"]=RegisteredPointer_fromWireType;}function RegisteredPointer(name,registeredClass,isReference,isConst,isSmartPointer,pointeeType,sharingPolicy,rawGetPointee,rawConstructor,rawShare,rawDestructor){this.name=name;this.registeredClass=registeredClass;this.isReference=isReference;this.isConst=isConst;this.isSmartPointer=isSmartPointer;this.pointeeType=pointeeType;this.sharingPolicy=sharingPolicy;this.rawGetPointee=rawGetPointee;this.rawConstructor=rawConstructor;this.rawShare=rawShare;this.rawDestructor=rawDestructor;if(!isSmartPointer&®isteredClass.baseClass===undefined){if(isConst){this["toWireType"]=constNoSmartPtrRawPointerToWireType;this.destructorFunction=null;}else {this["toWireType"]=nonConstNoSmartPtrRawPointerToWireType;this.destructorFunction=null;}}else {this["toWireType"]=genericPointerToWireType;}}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol");}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value;}else {Module[name]=value;Module[name].argCount=numArguments;}}function dynCallLegacy(sig,ptr,args){assert("dynCall_"+sig in Module,"bad function pointer type - no table for sig '"+sig+"'");if(args&&args.length){assert(args.length===sig.substring(1).replace(/j/g,"--").length);}else {assert(sig.length==1);}var f=Module["dynCall_"+sig];return args&&args.length?f.apply(null,[ptr].concat(args)):f.call(null,ptr)}function dynCall(sig,ptr,args){if(sig.includes("j")){return dynCallLegacy(sig,ptr,args)}assert(wasmTable.get(ptr),"missing table entry in dynCall: "+ptr);return wasmTable.get(ptr).apply(null,args)}function getDynCaller(sig,ptr){assert(sig.includes("j"),"getDynCaller should only be called with i64 sigs");var argCache=[];return function(){argCache.length=arguments.length;for(var i=0;i>2)+i]);}return array}function runDestructors(destructors){while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr);}}function __embind_register_class_constructor(rawClassType,argCount,rawArgTypesAddr,invokerSignature,invoker,rawConstructor){assert(argCount>0);var rawArgTypes=heap32VectorToArray(argCount,rawArgTypesAddr);invoker=embind__requireFunction(invokerSignature,invoker);var args=[rawConstructor];var destructors=[];whenDependentTypesAreResolved([],[rawClassType],function(classType){classType=classType[0];var humanName="constructor "+classType.name;if(undefined===classType.registeredClass.constructor_body){classType.registeredClass.constructor_body=[];}if(undefined!==classType.registeredClass.constructor_body[argCount-1]){throw new BindingError("Cannot register multiple constructors with identical number of parameters ("+(argCount-1)+") for class '"+classType.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!")}classType.registeredClass.constructor_body[argCount-1]=function unboundTypeHandler(){throwUnboundTypeError("Cannot construct "+classType.name+" due to unbound types",rawArgTypes);};whenDependentTypesAreResolved([],rawArgTypes,function(argTypes){classType.registeredClass.constructor_body[argCount-1]=function constructor_body(){if(arguments.length!==argCount-1){throwBindingError(humanName+" called with "+arguments.length+" arguments, expected "+(argCount-1));}destructors.length=0;args.length=argCount;for(var i=1;i0?", ":"")+argsListWired;}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n";}else {for(var i=isClassMethodFunc?1:2;i4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle);}}function count_emval_handles(){var count=0;for(var i=5;i>2])};case 3:return function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])};default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":function(value){return value},"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}return value},"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null});}function __embind_register_function(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn){var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=readLatin1String(name);rawInvoker=embind__requireFunction(signature,rawInvoker);exposePublicSymbol(name,function(){throwUnboundTypeError("Cannot call "+name+" due to unbound types",argTypes);},argCount-1);whenDependentTypesAreResolved([],argTypes,function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn),argCount-1);return []});}function integerReadValueFromPointer(name,shift,signed){switch(shift){case 0:return signed?function readS8FromPointer(pointer){return HEAP8[pointer]}:function readU8FromPointer(pointer){return HEAPU8[pointer]};case 1:return signed?function readS16FromPointer(pointer){return HEAP16[pointer>>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295;}var shift=getShiftFromSize(size);var fromWireType=function(value){return value};if(minRange===0){var bitshift=32-8*size;fromWireType=function(value){return value<>>bitshift};}var isUnsignedType=name.includes("unsigned");registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}if(valuemaxRange){throw new TypeError('Passing a number "'+_embind_repr(value)+'" from JS side to C/C++ side to an argument of type "'+name+'", which is outside the valid range ['+minRange+", "+maxRange+"]!")}return isUnsignedType?value>>>0:value|0},"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null});}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(buffer,data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true});}function __embind_register_std_string(rawType,name){name=readLatin1String(name);var stdStringIsUTF8=name==="std::string";registerType(rawType,{name:name,"fromWireType":function(value){var length=HEAPU32[value>>2];var str;if(stdStringIsUTF8){var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i;if(i==length||HEAPU8[currentBytePtr]==0){var maxRead=currentBytePtr-decodeStartPtr;var stringSegment=UTF8ToString(decodeStartPtr,maxRead);if(str===undefined){str=stringSegment;}else {str+=String.fromCharCode(0);str+=stringSegment;}decodeStartPtr=currentBytePtr+1;}}}else {var a=new Array(length);for(var i=0;i>2]=length;if(stdStringIsUTF8&&valueIsOfTypeString){stringToUTF8(value,ptr+4,length+1);}else {if(valueIsOfTypeString){for(var i=0;i255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits");}HEAPU8[ptr+4+i]=charCode;}}else {for(var i=0;i>2];var HEAP=getHeap();var str;var decodeStartPtr=value+4;for(var i=0;i<=length;++i){var currentBytePtr=value+4+i*charSize;if(i==length||HEAP[currentBytePtr>>shift]==0){var maxReadBytes=currentBytePtr-decodeStartPtr;var stringSegment=decodeString(decodeStartPtr,maxReadBytes);if(str===undefined){str=stringSegment;}else {str+=String.fromCharCode(0);str+=stringSegment;}decodeStartPtr=currentBytePtr+charSize;}}_free(value);return str},"toWireType":function(destructors,value){if(!(typeof value==="string")){throwBindingError("Cannot pass non-string to C++ string type "+name);}var length=lengthBytesUTF(value);var ptr=_malloc(4+length+charSize);HEAPU32[ptr>>2]=length>>shift;encodeString(value,ptr+4,length+charSize);if(destructors!==null){destructors.push(_free,ptr);}return ptr},"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:function(ptr){_free(ptr);}});}function __embind_register_void(rawType,name){name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,"argPackAdvance":0,"fromWireType":function(){return undefined},"toWireType":function(destructors,o){return undefined}});}function requireHandle(handle){if(!handle){throwBindingError("Cannot use deleted val. handle = "+handle);}return emval_handle_array[handle].value}function requireRegisteredType(rawType,humanName){var impl=registeredTypes[rawType];if(undefined===impl){throwBindingError(humanName+" has unknown type "+getTypeName(rawType));}return impl}function __emval_as(handle,returnType,destructorsRef){handle=requireHandle(handle);returnType=requireRegisteredType(returnType,"emval::as");var destructors=[];var rd=__emval_register(destructors);HEAP32[destructorsRef>>2]=rd;return returnType["toWireType"](destructors,handle)}function __emval_lookupTypes(argCount,argTypes){var a=new Array(argCount);for(var i=0;i>2)+i],"parameter "+i);}return a}function __emval_call(handle,argCount,argTypes,argv){handle=requireHandle(handle);var types=__emval_lookupTypes(argCount,argTypes);var args=new Array(argCount);for(var i=0;i4){emval_handle_array[handle].refcount+=1;}}function __emval_run_destructors(handle){var destructors=emval_handle_array[handle].value;runDestructors(destructors);__emval_decref(handle);}function _abort(){abort();}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num);}function emscripten_realloc_buffer(size){try{wasmMemory.grow(size-buffer.byteLength+65535>>>16);updateGlobalBufferAndViews(wasmMemory.buffer);return 1}catch(e){console.error("emscripten_realloc_buffer: Attempted to grow heap from "+buffer.byteLength+" bytes to "+size+" bytes, but got error: "+e);}}function _emscripten_resize_heap(requestedSize){var oldSize=HEAPU8.length;requestedSize=requestedSize>>>0;assert(requestedSize>oldSize);var maxHeapSize=2147483648;if(requestedSize>maxHeapSize){err("Cannot enlarge memory, asked to go up to "+requestedSize+" bytes, but the limit is "+maxHeapSize+" bytes!");return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignUp(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=emscripten_realloc_buffer(newSize);if(replacement){return true}}err("Failed to grow the heap from "+oldSize+" bytes to "+newSize+" bytes, not enough memory!");return false}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){if(ENV[x]===undefined)delete env[x];else env[x]=ENV[x];}var strings=[];for(var x in env){strings.push(x+"="+env[x]);}getEnvStrings.strings=strings;}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1;});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1;});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _exit(status){exit(status);}function _fd_close(fd){try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return -61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _getTempRet0(){return getTempRet0()}function _llvm_eh_typeid_for(type){return type}function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _raise(sig){err("Calling stub instead of raise()");setErrNo(ERRNO_CODES.ENOSYS);warnOnce("raise() returning an error as we do not support it");return -1}function _setTempRet0(val){setTempRet0(val);}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1);}else {newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1);}}else {newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule]);}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate());}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else {return thisDate.getFullYear()}}else {return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return "\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return "AM"}else {return "PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return "\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return "53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return "01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return (ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return "%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date));}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}function _time(ptr){var ret=Date.now()/1e3|0;if(ptr){HEAP32[ptr>>2]=ret;}return ret}var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this;}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev;};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return (this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode;}},write:{get:function(){return (this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode;}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");InternalError=Module["InternalError"]=extendError(Error,"InternalError");init_ClassHandle();init_RegisteredPointer();init_embind();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");init_emval();function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"__assert_fail":___assert_fail,"__cxa_allocate_exception":___cxa_allocate_exception,"__cxa_atexit":___cxa_atexit,"__cxa_begin_catch":___cxa_begin_catch,"__cxa_end_catch":___cxa_end_catch,"__cxa_find_matching_catch_2":___cxa_find_matching_catch_2,"__cxa_find_matching_catch_3":___cxa_find_matching_catch_3,"__cxa_free_exception":___cxa_free_exception,"__cxa_rethrow":___cxa_rethrow,"__cxa_thread_atexit":___cxa_thread_atexit,"__cxa_throw":___cxa_throw,"__cxa_uncaught_exceptions":___cxa_uncaught_exceptions,"__resumeException":___resumeException,"__sys_getrusage":___sys_getrusage,"_embind_register_bigint":__embind_register_bigint,"_embind_register_bool":__embind_register_bool,"_embind_register_class":__embind_register_class,"_embind_register_class_constructor":__embind_register_class_constructor,"_embind_register_class_function":__embind_register_class_function,"_embind_register_emval":__embind_register_emval,"_embind_register_float":__embind_register_float,"_embind_register_function":__embind_register_function,"_embind_register_integer":__embind_register_integer,"_embind_register_memory_view":__embind_register_memory_view,"_embind_register_std_string":__embind_register_std_string,"_embind_register_std_wstring":__embind_register_std_wstring,"_embind_register_void":__embind_register_void,"_emval_as":__emval_as,"_emval_call":__emval_call,"_emval_decref":__emval_decref,"_emval_incref":__emval_incref,"_emval_run_destructors":__emval_run_destructors,"abort":_abort,"emscripten_memcpy_big":_emscripten_memcpy_big,"emscripten_resize_heap":_emscripten_resize_heap,"environ_get":_environ_get,"environ_sizes_get":_environ_sizes_get,"exit":_exit,"fd_close":_fd_close,"fd_read":_fd_read,"fd_seek":_fd_seek,"fd_write":_fd_write,"getTempRet0":_getTempRet0,"invoke_ddiii":invoke_ddiii,"invoke_dii":invoke_dii,"invoke_diii":invoke_diii,"invoke_diiiiiiii":invoke_diiiiiiii,"invoke_fiii":invoke_fiii,"invoke_i":invoke_i,"invoke_id":invoke_id,"invoke_idddddi":invoke_idddddi,"invoke_ii":invoke_ii,"invoke_iid":invoke_iid,"invoke_iiddd":invoke_iiddd,"invoke_iidi":invoke_iidi,"invoke_iii":invoke_iii,"invoke_iiii":invoke_iiii,"invoke_iiiidd":invoke_iiiidd,"invoke_iiiii":invoke_iiiii,"invoke_iiiiid":invoke_iiiiid,"invoke_iiiiii":invoke_iiiiii,"invoke_iiiiiii":invoke_iiiiiii,"invoke_iiiiiiii":invoke_iiiiiiii,"invoke_iiiiiiiii":invoke_iiiiiiiii,"invoke_iiiiiiiiii":invoke_iiiiiiiiii,"invoke_iiiiiiiiiii":invoke_iiiiiiiiiii,"invoke_iiiiiiiiiiii":invoke_iiiiiiiiiiii,"invoke_iiiiiiiiiiiii":invoke_iiiiiiiiiiiii,"invoke_iiiiiiiiiiiiii":invoke_iiiiiiiiiiiiii,"invoke_iiiiiiiiiiiiiii":invoke_iiiiiiiiiiiiiii,"invoke_iiiiiiiiiiiiiiii":invoke_iiiiiiiiiiiiiiii,"invoke_jiiii":invoke_jiiii,"invoke_v":invoke_v,"invoke_vddddiiii":invoke_vddddiiii,"invoke_vddddiiiii":invoke_vddddiiiii,"invoke_vdddiiiiii":invoke_vdddiiiiii,"invoke_vdiii":invoke_vdiii,"invoke_vi":invoke_vi,"invoke_vid":invoke_vid,"invoke_vidd":invoke_vidd,"invoke_viddd":invoke_viddd,"invoke_vidiii":invoke_vidiii,"invoke_vii":invoke_vii,"invoke_viii":invoke_viii,"invoke_viiii":invoke_viiii,"invoke_viiiiddiiii":invoke_viiiiddiiii,"invoke_viiiii":invoke_viiiii,"invoke_viiiiii":invoke_viiiiii,"invoke_viiiiiid":invoke_viiiiiid,"invoke_viiiiiii":invoke_viiiiiii,"invoke_viiiiiiii":invoke_viiiiiiii,"invoke_viiiiiiiii":invoke_viiiiiiiii,"invoke_viiiiiiiiii":invoke_viiiiiiiiii,"invoke_viiiiiiiiiiii":invoke_viiiiiiiiiiii,"invoke_viiiiiiiiiiiii":invoke_viiiiiiiiiiiii,"invoke_viiiiiiiiiiiiiii":invoke_viiiiiiiiiiiiiii,"invoke_viiiiiiiiiiiiiiii":invoke_viiiiiiiiiiiiiiii,"invoke_viiiiiiiiiiiiiiiii":invoke_viiiiiiiiiiiiiiiii,"invoke_viiiiiiiiiiiiiiiiii":invoke_viiiiiiiiiiiiiiiiii,"llvm_eh_typeid_for":_llvm_eh_typeid_for,"raise":_raise,"setTempRet0":_setTempRet0,"strftime_l":_strftime_l,"time":_time};createWasm();Module["___wasm_call_ctors"]=createExportWrapper("__wasm_call_ctors");var _memset=Module["_memset"]=createExportWrapper("memset");var _malloc=Module["_malloc"]=createExportWrapper("malloc");var _free=Module["_free"]=createExportWrapper("free");var ___getTypeName=Module["___getTypeName"]=createExportWrapper("__getTypeName");Module["___embind_register_native_and_builtin_types"]=createExportWrapper("__embind_register_native_and_builtin_types");Module["_fflush"]=createExportWrapper("fflush");var ___errno_location=Module["___errno_location"]=createExportWrapper("__errno_location");var stackSave=Module["stackSave"]=createExportWrapper("stackSave");var stackRestore=Module["stackRestore"]=createExportWrapper("stackRestore");var stackAlloc=Module["stackAlloc"]=createExportWrapper("stackAlloc");var _emscripten_stack_init=Module["_emscripten_stack_init"]=function(){return (_emscripten_stack_init=Module["_emscripten_stack_init"]=Module["asm"]["emscripten_stack_init"]).apply(null,arguments)};Module["_emscripten_stack_get_free"]=function(){return (Module["_emscripten_stack_get_free"]=Module["asm"]["emscripten_stack_get_free"]).apply(null,arguments)};var _emscripten_stack_get_end=Module["_emscripten_stack_get_end"]=function(){return (_emscripten_stack_get_end=Module["_emscripten_stack_get_end"]=Module["asm"]["emscripten_stack_get_end"]).apply(null,arguments)};var _setThrew=Module["_setThrew"]=createExportWrapper("setThrew");var ___cxa_can_catch=Module["___cxa_can_catch"]=createExportWrapper("__cxa_can_catch");var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=createExportWrapper("__cxa_is_pointer_type");Module["dynCall_viijii"]=createExportWrapper("dynCall_viijii");Module["dynCall_jiji"]=createExportWrapper("dynCall_jiji");var dynCall_jiiii=Module["dynCall_jiiii"]=createExportWrapper("dynCall_jiiii");Module["dynCall_iiiiij"]=createExportWrapper("dynCall_iiiiij");Module["dynCall_iiiiijj"]=createExportWrapper("dynCall_iiiiijj");Module["dynCall_iiiiiijj"]=createExportWrapper("dynCall_iiiiiijj");function invoke_vii(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_iii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_vi(index,a1){var sp=stackSave();try{wasmTable.get(index)(a1);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_ii(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_viiii(index,a1,a2,a3,a4){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_i(index){var sp=stackSave();try{return wasmTable.get(index)()}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_iiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_viii(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_vid(index,a1,a2){var sp=stackSave();try{wasmTable.get(index)(a1,a2);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_iid(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_v(index){var sp=stackSave();try{wasmTable.get(index)();}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_viiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_iiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_dii(index,a1,a2){var sp=stackSave();try{return wasmTable.get(index)(a1,a2)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_iiddd(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_iiiidd(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_vidd(index,a1,a2,a3){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_diiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_diii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_iiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_vdiii(index,a1,a2,a3,a4){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_iidi(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_iiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_ddiii(index,a1,a2,a3,a4){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_id(index,a1){var sp=stackSave();try{return wasmTable.get(index)(a1)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_viiiiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_iiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_iiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_viiiiiid(index,a1,a2,a3,a4,a5,a6,a7){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_viiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_viiiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_iiiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_viiiiddiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_viddd(index,a1,a2,a3,a4){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_iiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_viiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_iiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_viiiiiiiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_viiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_iiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_vddddiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_idddddi(index,a1,a2,a3,a4,a5,a6){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5,a6)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_vidiii(index,a1,a2,a3,a4,a5){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_vdddiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8,a9);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_vddddiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){var sp=stackSave();try{wasmTable.get(index)(a1,a2,a3,a4,a5,a6,a7,a8);}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_fiii(index,a1,a2,a3){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_iiiiid(index,a1,a2,a3,a4,a5){var sp=stackSave();try{return wasmTable.get(index)(a1,a2,a3,a4,a5)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}function invoke_jiiii(index,a1,a2,a3,a4){var sp=stackSave();try{return dynCall_jiiii(index,a1,a2,a3,a4)}catch(e){stackRestore(sp);if(e!==e+0&&e!=="longjmp")throw e;_setThrew(1,0);}}if(!Object.getOwnPropertyDescriptor(Module,"intArrayFromString"))Module["intArrayFromString"]=function(){abort("'intArrayFromString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"intArrayToString"))Module["intArrayToString"]=function(){abort("'intArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ccall"))Module["ccall"]=function(){abort("'ccall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"cwrap"))Module["cwrap"]=function(){abort("'cwrap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"setValue"))Module["setValue"]=function(){abort("'setValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getValue"))Module["getValue"]=function(){abort("'getValue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"allocate"))Module["allocate"]=function(){abort("'allocate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ArrayToString"))Module["UTF8ArrayToString"]=function(){abort("'UTF8ArrayToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"UTF8ToString"))Module["UTF8ToString"]=function(){abort("'UTF8ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8Array"))Module["stringToUTF8Array"]=function(){abort("'stringToUTF8Array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF8"))Module["stringToUTF8"]=function(){abort("'stringToUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF8"))Module["lengthBytesUTF8"]=function(){abort("'lengthBytesUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreRun"))Module["addOnPreRun"]=function(){abort("'addOnPreRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addOnInit"))Module["addOnInit"]=function(){abort("'addOnInit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addOnPreMain"))Module["addOnPreMain"]=function(){abort("'addOnPreMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addOnExit"))Module["addOnExit"]=function(){abort("'addOnExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addOnPostRun"))Module["addOnPostRun"]=function(){abort("'addOnPostRun' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeStringToMemory"))Module["writeStringToMemory"]=function(){abort("'writeStringToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeArrayToMemory"))Module["writeArrayToMemory"]=function(){abort("'writeArrayToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeAsciiToMemory"))Module["writeAsciiToMemory"]=function(){abort("'writeAsciiToMemory' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addRunDependency"))Module["addRunDependency"]=function(){abort("'addRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"removeRunDependency"))Module["removeRunDependency"]=function(){abort("'removeRunDependency' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createFolder"))Module["FS_createFolder"]=function(){abort("'FS_createFolder' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPath"))Module["FS_createPath"]=function(){abort("'FS_createPath' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDataFile"))Module["FS_createDataFile"]=function(){abort("'FS_createDataFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createPreloadedFile"))Module["FS_createPreloadedFile"]=function(){abort("'FS_createPreloadedFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLazyFile"))Module["FS_createLazyFile"]=function(){abort("'FS_createLazyFile' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createLink"))Module["FS_createLink"]=function(){abort("'FS_createLink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"FS_createDevice"))Module["FS_createDevice"]=function(){abort("'FS_createDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"FS_unlink"))Module["FS_unlink"]=function(){abort("'FS_unlink' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ). Alternatively, forcing filesystem support (-s FORCE_FILESYSTEM=1) can export this for you");};if(!Object.getOwnPropertyDescriptor(Module,"getLEB"))Module["getLEB"]=function(){abort("'getLEB' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getFunctionTables"))Module["getFunctionTables"]=function(){abort("'getFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"alignFunctionTables"))Module["alignFunctionTables"]=function(){abort("'alignFunctionTables' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerFunctions"))Module["registerFunctions"]=function(){abort("'registerFunctions' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"addFunction"))Module["addFunction"]=function(){abort("'addFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"removeFunction"))Module["removeFunction"]=function(){abort("'removeFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getFuncWrapper"))Module["getFuncWrapper"]=function(){abort("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"prettyPrint"))Module["prettyPrint"]=function(){abort("'prettyPrint' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"dynCall"))Module["dynCall"]=function(){abort("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getCompilerSetting"))Module["getCompilerSetting"]=function(){abort("'getCompilerSetting' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"print"))Module["print"]=function(){abort("'print' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"printErr"))Module["printErr"]=function(){abort("'printErr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getTempRet0"))Module["getTempRet0"]=function(){abort("'getTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"setTempRet0"))Module["setTempRet0"]=function(){abort("'setTempRet0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"callMain"))Module["callMain"]=function(){abort("'callMain' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"abort"))Module["abort"]=function(){abort("'abort' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stringToNewUTF8"))Module["stringToNewUTF8"]=function(){abort("'stringToNewUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"setFileTime"))Module["setFileTime"]=function(){abort("'setFileTime' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emscripten_realloc_buffer"))Module["emscripten_realloc_buffer"]=function(){abort("'emscripten_realloc_buffer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ENV"))Module["ENV"]=function(){abort("'ENV' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_CODES"))Module["ERRNO_CODES"]=function(){abort("'ERRNO_CODES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ERRNO_MESSAGES"))Module["ERRNO_MESSAGES"]=function(){abort("'ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"setErrNo"))Module["setErrNo"]=function(){abort("'setErrNo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"inetPton4"))Module["inetPton4"]=function(){abort("'inetPton4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"inetNtop4"))Module["inetNtop4"]=function(){abort("'inetNtop4' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"inetPton6"))Module["inetPton6"]=function(){abort("'inetPton6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"inetNtop6"))Module["inetNtop6"]=function(){abort("'inetNtop6' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"readSockaddr"))Module["readSockaddr"]=function(){abort("'readSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeSockaddr"))Module["writeSockaddr"]=function(){abort("'writeSockaddr' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"DNS"))Module["DNS"]=function(){abort("'DNS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getHostByName"))Module["getHostByName"]=function(){abort("'getHostByName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"GAI_ERRNO_MESSAGES"))Module["GAI_ERRNO_MESSAGES"]=function(){abort("'GAI_ERRNO_MESSAGES' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"Protocols"))Module["Protocols"]=function(){abort("'Protocols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"Sockets"))Module["Sockets"]=function(){abort("'Sockets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getRandomDevice"))Module["getRandomDevice"]=function(){abort("'getRandomDevice' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"traverseStack"))Module["traverseStack"]=function(){abort("'traverseStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"UNWIND_CACHE"))Module["UNWIND_CACHE"]=function(){abort("'UNWIND_CACHE' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"withBuiltinMalloc"))Module["withBuiltinMalloc"]=function(){abort("'withBuiltinMalloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"readAsmConstArgsArray"))Module["readAsmConstArgsArray"]=function(){abort("'readAsmConstArgsArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"readAsmConstArgs"))Module["readAsmConstArgs"]=function(){abort("'readAsmConstArgs' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"mainThreadEM_ASM"))Module["mainThreadEM_ASM"]=function(){abort("'mainThreadEM_ASM' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_q"))Module["jstoi_q"]=function(){abort("'jstoi_q' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"jstoi_s"))Module["jstoi_s"]=function(){abort("'jstoi_s' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getExecutableName"))Module["getExecutableName"]=function(){abort("'getExecutableName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"listenOnce"))Module["listenOnce"]=function(){abort("'listenOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"autoResumeAudioContext"))Module["autoResumeAudioContext"]=function(){abort("'autoResumeAudioContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"dynCallLegacy"))Module["dynCallLegacy"]=function(){abort("'dynCallLegacy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getDynCaller"))Module["getDynCaller"]=function(){abort("'getDynCaller' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"dynCall"))Module["dynCall"]=function(){abort("'dynCall' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"callRuntimeCallbacks"))Module["callRuntimeCallbacks"]=function(){abort("'callRuntimeCallbacks' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"runtimeKeepaliveCounter"))Module["runtimeKeepaliveCounter"]=function(){abort("'runtimeKeepaliveCounter' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"keepRuntimeAlive"))Module["keepRuntimeAlive"]=function(){abort("'keepRuntimeAlive' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"runtimeKeepalivePush"))Module["runtimeKeepalivePush"]=function(){abort("'runtimeKeepalivePush' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"runtimeKeepalivePop"))Module["runtimeKeepalivePop"]=function(){abort("'runtimeKeepalivePop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"callUserCallback"))Module["callUserCallback"]=function(){abort("'callUserCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"maybeExit"))Module["maybeExit"]=function(){abort("'maybeExit' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"asmjsMangle"))Module["asmjsMangle"]=function(){abort("'asmjsMangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"reallyNegative"))Module["reallyNegative"]=function(){abort("'reallyNegative' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"unSign"))Module["unSign"]=function(){abort("'unSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"reSign"))Module["reSign"]=function(){abort("'reSign' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"formatString"))Module["formatString"]=function(){abort("'formatString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"PATH"))Module["PATH"]=function(){abort("'PATH' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"PATH_FS"))Module["PATH_FS"]=function(){abort("'PATH_FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"SYSCALLS"))Module["SYSCALLS"]=function(){abort("'SYSCALLS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"syscallMmap2"))Module["syscallMmap2"]=function(){abort("'syscallMmap2' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"syscallMunmap"))Module["syscallMunmap"]=function(){abort("'syscallMunmap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getSocketFromFD"))Module["getSocketFromFD"]=function(){abort("'getSocketFromFD' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getSocketAddress"))Module["getSocketAddress"]=function(){abort("'getSocketAddress' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"JSEvents"))Module["JSEvents"]=function(){abort("'JSEvents' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerKeyEventCallback"))Module["registerKeyEventCallback"]=function(){abort("'registerKeyEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"specialHTMLTargets"))Module["specialHTMLTargets"]=function(){abort("'specialHTMLTargets' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"maybeCStringToJsString"))Module["maybeCStringToJsString"]=function(){abort("'maybeCStringToJsString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"findEventTarget"))Module["findEventTarget"]=function(){abort("'findEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"findCanvasEventTarget"))Module["findCanvasEventTarget"]=function(){abort("'findCanvasEventTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getBoundingClientRect"))Module["getBoundingClientRect"]=function(){abort("'getBoundingClientRect' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"fillMouseEventData"))Module["fillMouseEventData"]=function(){abort("'fillMouseEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerMouseEventCallback"))Module["registerMouseEventCallback"]=function(){abort("'registerMouseEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerWheelEventCallback"))Module["registerWheelEventCallback"]=function(){abort("'registerWheelEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerUiEventCallback"))Module["registerUiEventCallback"]=function(){abort("'registerUiEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerFocusEventCallback"))Module["registerFocusEventCallback"]=function(){abort("'registerFocusEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"fillDeviceOrientationEventData"))Module["fillDeviceOrientationEventData"]=function(){abort("'fillDeviceOrientationEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerDeviceOrientationEventCallback"))Module["registerDeviceOrientationEventCallback"]=function(){abort("'registerDeviceOrientationEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"fillDeviceMotionEventData"))Module["fillDeviceMotionEventData"]=function(){abort("'fillDeviceMotionEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerDeviceMotionEventCallback"))Module["registerDeviceMotionEventCallback"]=function(){abort("'registerDeviceMotionEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"screenOrientation"))Module["screenOrientation"]=function(){abort("'screenOrientation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"fillOrientationChangeEventData"))Module["fillOrientationChangeEventData"]=function(){abort("'fillOrientationChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerOrientationChangeEventCallback"))Module["registerOrientationChangeEventCallback"]=function(){abort("'registerOrientationChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"fillFullscreenChangeEventData"))Module["fillFullscreenChangeEventData"]=function(){abort("'fillFullscreenChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerFullscreenChangeEventCallback"))Module["registerFullscreenChangeEventCallback"]=function(){abort("'registerFullscreenChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerRestoreOldStyle"))Module["registerRestoreOldStyle"]=function(){abort("'registerRestoreOldStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"hideEverythingExceptGivenElement"))Module["hideEverythingExceptGivenElement"]=function(){abort("'hideEverythingExceptGivenElement' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"restoreHiddenElements"))Module["restoreHiddenElements"]=function(){abort("'restoreHiddenElements' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"setLetterbox"))Module["setLetterbox"]=function(){abort("'setLetterbox' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"currentFullscreenStrategy"))Module["currentFullscreenStrategy"]=function(){abort("'currentFullscreenStrategy' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"restoreOldWindowedStyle"))Module["restoreOldWindowedStyle"]=function(){abort("'restoreOldWindowedStyle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"softFullscreenResizeWebGLRenderTarget"))Module["softFullscreenResizeWebGLRenderTarget"]=function(){abort("'softFullscreenResizeWebGLRenderTarget' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"doRequestFullscreen"))Module["doRequestFullscreen"]=function(){abort("'doRequestFullscreen' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"fillPointerlockChangeEventData"))Module["fillPointerlockChangeEventData"]=function(){abort("'fillPointerlockChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerPointerlockChangeEventCallback"))Module["registerPointerlockChangeEventCallback"]=function(){abort("'registerPointerlockChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerPointerlockErrorEventCallback"))Module["registerPointerlockErrorEventCallback"]=function(){abort("'registerPointerlockErrorEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"requestPointerLock"))Module["requestPointerLock"]=function(){abort("'requestPointerLock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"fillVisibilityChangeEventData"))Module["fillVisibilityChangeEventData"]=function(){abort("'fillVisibilityChangeEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerVisibilityChangeEventCallback"))Module["registerVisibilityChangeEventCallback"]=function(){abort("'registerVisibilityChangeEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerTouchEventCallback"))Module["registerTouchEventCallback"]=function(){abort("'registerTouchEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"fillGamepadEventData"))Module["fillGamepadEventData"]=function(){abort("'fillGamepadEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerGamepadEventCallback"))Module["registerGamepadEventCallback"]=function(){abort("'registerGamepadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerBeforeUnloadEventCallback"))Module["registerBeforeUnloadEventCallback"]=function(){abort("'registerBeforeUnloadEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"fillBatteryEventData"))Module["fillBatteryEventData"]=function(){abort("'fillBatteryEventData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"battery"))Module["battery"]=function(){abort("'battery' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerBatteryEventCallback"))Module["registerBatteryEventCallback"]=function(){abort("'registerBatteryEventCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"setCanvasElementSize"))Module["setCanvasElementSize"]=function(){abort("'setCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getCanvasElementSize"))Module["getCanvasElementSize"]=function(){abort("'getCanvasElementSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"polyfillSetImmediate"))Module["polyfillSetImmediate"]=function(){abort("'polyfillSetImmediate' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"demangle"))Module["demangle"]=function(){abort("'demangle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"demangleAll"))Module["demangleAll"]=function(){abort("'demangleAll' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"jsStackTrace"))Module["jsStackTrace"]=function(){abort("'jsStackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stackTrace"))Module["stackTrace"]=function(){abort("'stackTrace' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getEnvStrings"))Module["getEnvStrings"]=function(){abort("'getEnvStrings' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"checkWasiClock"))Module["checkWasiClock"]=function(){abort("'checkWasiClock' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64"))Module["writeI53ToI64"]=function(){abort("'writeI53ToI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Clamped"))Module["writeI53ToI64Clamped"]=function(){abort("'writeI53ToI64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToI64Signaling"))Module["writeI53ToI64Signaling"]=function(){abort("'writeI53ToI64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Clamped"))Module["writeI53ToU64Clamped"]=function(){abort("'writeI53ToU64Clamped' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeI53ToU64Signaling"))Module["writeI53ToU64Signaling"]=function(){abort("'writeI53ToU64Signaling' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromI64"))Module["readI53FromI64"]=function(){abort("'readI53FromI64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"readI53FromU64"))Module["readI53FromU64"]=function(){abort("'readI53FromU64' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"convertI32PairToI53"))Module["convertI32PairToI53"]=function(){abort("'convertI32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"convertU32PairToI53"))Module["convertU32PairToI53"]=function(){abort("'convertU32PairToI53' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"uncaughtExceptionCount"))Module["uncaughtExceptionCount"]=function(){abort("'uncaughtExceptionCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"exceptionLast"))Module["exceptionLast"]=function(){abort("'exceptionLast' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"exceptionCaught"))Module["exceptionCaught"]=function(){abort("'exceptionCaught' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ExceptionInfoAttrs"))Module["ExceptionInfoAttrs"]=function(){abort("'ExceptionInfoAttrs' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ExceptionInfo"))Module["ExceptionInfo"]=function(){abort("'ExceptionInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"CatchInfo"))Module["CatchInfo"]=function(){abort("'CatchInfo' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"exception_addRef"))Module["exception_addRef"]=function(){abort("'exception_addRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"exception_decRef"))Module["exception_decRef"]=function(){abort("'exception_decRef' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"Browser"))Module["Browser"]=function(){abort("'Browser' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"funcWrappers"))Module["funcWrappers"]=function(){abort("'funcWrappers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getFuncWrapper"))Module["getFuncWrapper"]=function(){abort("'getFuncWrapper' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"setMainLoop"))Module["setMainLoop"]=function(){abort("'setMainLoop' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"FS"))Module["FS"]=function(){abort("'FS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"mmapAlloc"))Module["mmapAlloc"]=function(){abort("'mmapAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"MEMFS"))Module["MEMFS"]=function(){abort("'MEMFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"TTY"))Module["TTY"]=function(){abort("'TTY' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"PIPEFS"))Module["PIPEFS"]=function(){abort("'PIPEFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"SOCKFS"))Module["SOCKFS"]=function(){abort("'SOCKFS' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"_setNetworkCallback"))Module["_setNetworkCallback"]=function(){abort("'_setNetworkCallback' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"tempFixedLengthArray"))Module["tempFixedLengthArray"]=function(){abort("'tempFixedLengthArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"miniTempWebGLFloatBuffers"))Module["miniTempWebGLFloatBuffers"]=function(){abort("'miniTempWebGLFloatBuffers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"heapObjectForWebGLType"))Module["heapObjectForWebGLType"]=function(){abort("'heapObjectForWebGLType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"heapAccessShiftForWebGLHeap"))Module["heapAccessShiftForWebGLHeap"]=function(){abort("'heapAccessShiftForWebGLHeap' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"GL"))Module["GL"]=function(){abort("'GL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGet"))Module["emscriptenWebGLGet"]=function(){abort("'emscriptenWebGLGet' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"computeUnpackAlignedImageSize"))Module["computeUnpackAlignedImageSize"]=function(){abort("'computeUnpackAlignedImageSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetTexPixelData"))Module["emscriptenWebGLGetTexPixelData"]=function(){abort("'emscriptenWebGLGetTexPixelData' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetUniform"))Module["emscriptenWebGLGetUniform"]=function(){abort("'emscriptenWebGLGetUniform' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"webglGetUniformLocation"))Module["webglGetUniformLocation"]=function(){abort("'webglGetUniformLocation' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"webglPrepareUniformLocationsBeforeFirstUse"))Module["webglPrepareUniformLocationsBeforeFirstUse"]=function(){abort("'webglPrepareUniformLocationsBeforeFirstUse' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"webglGetLeftBracePos"))Module["webglGetLeftBracePos"]=function(){abort("'webglGetLeftBracePos' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emscriptenWebGLGetVertexAttrib"))Module["emscriptenWebGLGetVertexAttrib"]=function(){abort("'emscriptenWebGLGetVertexAttrib' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"writeGLArray"))Module["writeGLArray"]=function(){abort("'writeGLArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"AL"))Module["AL"]=function(){abort("'AL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"SDL_unicode"))Module["SDL_unicode"]=function(){abort("'SDL_unicode' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"SDL_ttfContext"))Module["SDL_ttfContext"]=function(){abort("'SDL_ttfContext' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"SDL_audio"))Module["SDL_audio"]=function(){abort("'SDL_audio' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"SDL"))Module["SDL"]=function(){abort("'SDL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"SDL_gfx"))Module["SDL_gfx"]=function(){abort("'SDL_gfx' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"GLUT"))Module["GLUT"]=function(){abort("'GLUT' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"EGL"))Module["EGL"]=function(){abort("'EGL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"GLFW_Window"))Module["GLFW_Window"]=function(){abort("'GLFW_Window' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"GLFW"))Module["GLFW"]=function(){abort("'GLFW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"GLEW"))Module["GLEW"]=function(){abort("'GLEW' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"IDBStore"))Module["IDBStore"]=function(){abort("'IDBStore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"runAndAbortIfError"))Module["runAndAbortIfError"]=function(){abort("'runAndAbortIfError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emval_handle_array"))Module["emval_handle_array"]=function(){abort("'emval_handle_array' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emval_free_list"))Module["emval_free_list"]=function(){abort("'emval_free_list' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emval_symbols"))Module["emval_symbols"]=function(){abort("'emval_symbols' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"init_emval"))Module["init_emval"]=function(){abort("'init_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"count_emval_handles"))Module["count_emval_handles"]=function(){abort("'count_emval_handles' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"get_first_emval"))Module["get_first_emval"]=function(){abort("'get_first_emval' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getStringOrSymbol"))Module["getStringOrSymbol"]=function(){abort("'getStringOrSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"requireHandle"))Module["requireHandle"]=function(){abort("'requireHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emval_newers"))Module["emval_newers"]=function(){abort("'emval_newers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"craftEmvalAllocator"))Module["craftEmvalAllocator"]=function(){abort("'craftEmvalAllocator' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emval_get_global"))Module["emval_get_global"]=function(){abort("'emval_get_global' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"emval_methodCallers"))Module["emval_methodCallers"]=function(){abort("'emval_methodCallers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"InternalError"))Module["InternalError"]=function(){abort("'InternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"BindingError"))Module["BindingError"]=function(){abort("'BindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"UnboundTypeError"))Module["UnboundTypeError"]=function(){abort("'UnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"PureVirtualError"))Module["PureVirtualError"]=function(){abort("'PureVirtualError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"init_embind"))Module["init_embind"]=function(){abort("'init_embind' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"throwInternalError"))Module["throwInternalError"]=function(){abort("'throwInternalError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"throwBindingError"))Module["throwBindingError"]=function(){abort("'throwBindingError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"throwUnboundTypeError"))Module["throwUnboundTypeError"]=function(){abort("'throwUnboundTypeError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ensureOverloadTable"))Module["ensureOverloadTable"]=function(){abort("'ensureOverloadTable' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"exposePublicSymbol"))Module["exposePublicSymbol"]=function(){abort("'exposePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"replacePublicSymbol"))Module["replacePublicSymbol"]=function(){abort("'replacePublicSymbol' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"extendError"))Module["extendError"]=function(){abort("'extendError' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"createNamedFunction"))Module["createNamedFunction"]=function(){abort("'createNamedFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registeredInstances"))Module["registeredInstances"]=function(){abort("'registeredInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getBasestPointer"))Module["getBasestPointer"]=function(){abort("'getBasestPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerInheritedInstance"))Module["registerInheritedInstance"]=function(){abort("'registerInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"unregisterInheritedInstance"))Module["unregisterInheritedInstance"]=function(){abort("'unregisterInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getInheritedInstance"))Module["getInheritedInstance"]=function(){abort("'getInheritedInstance' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getInheritedInstanceCount"))Module["getInheritedInstanceCount"]=function(){abort("'getInheritedInstanceCount' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getLiveInheritedInstances"))Module["getLiveInheritedInstances"]=function(){abort("'getLiveInheritedInstances' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registeredTypes"))Module["registeredTypes"]=function(){abort("'registeredTypes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"awaitingDependencies"))Module["awaitingDependencies"]=function(){abort("'awaitingDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"typeDependencies"))Module["typeDependencies"]=function(){abort("'typeDependencies' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registeredPointers"))Module["registeredPointers"]=function(){abort("'registeredPointers' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"registerType"))Module["registerType"]=function(){abort("'registerType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"whenDependentTypesAreResolved"))Module["whenDependentTypesAreResolved"]=function(){abort("'whenDependentTypesAreResolved' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"embind_charCodes"))Module["embind_charCodes"]=function(){abort("'embind_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"embind_init_charCodes"))Module["embind_init_charCodes"]=function(){abort("'embind_init_charCodes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"readLatin1String"))Module["readLatin1String"]=function(){abort("'readLatin1String' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getTypeName"))Module["getTypeName"]=function(){abort("'getTypeName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"heap32VectorToArray"))Module["heap32VectorToArray"]=function(){abort("'heap32VectorToArray' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"requireRegisteredType"))Module["requireRegisteredType"]=function(){abort("'requireRegisteredType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"getShiftFromSize"))Module["getShiftFromSize"]=function(){abort("'getShiftFromSize' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"integerReadValueFromPointer"))Module["integerReadValueFromPointer"]=function(){abort("'integerReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"enumReadValueFromPointer"))Module["enumReadValueFromPointer"]=function(){abort("'enumReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"floatReadValueFromPointer"))Module["floatReadValueFromPointer"]=function(){abort("'floatReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"simpleReadValueFromPointer"))Module["simpleReadValueFromPointer"]=function(){abort("'simpleReadValueFromPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"runDestructors"))Module["runDestructors"]=function(){abort("'runDestructors' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"new_"))Module["new_"]=function(){abort("'new_' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"craftInvokerFunction"))Module["craftInvokerFunction"]=function(){abort("'craftInvokerFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"embind__requireFunction"))Module["embind__requireFunction"]=function(){abort("'embind__requireFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"tupleRegistrations"))Module["tupleRegistrations"]=function(){abort("'tupleRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"structRegistrations"))Module["structRegistrations"]=function(){abort("'structRegistrations' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"genericPointerToWireType"))Module["genericPointerToWireType"]=function(){abort("'genericPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"constNoSmartPtrRawPointerToWireType"))Module["constNoSmartPtrRawPointerToWireType"]=function(){abort("'constNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"nonConstNoSmartPtrRawPointerToWireType"))Module["nonConstNoSmartPtrRawPointerToWireType"]=function(){abort("'nonConstNoSmartPtrRawPointerToWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"init_RegisteredPointer"))Module["init_RegisteredPointer"]=function(){abort("'init_RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"RegisteredPointer"))Module["RegisteredPointer"]=function(){abort("'RegisteredPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"RegisteredPointer_getPointee"))Module["RegisteredPointer_getPointee"]=function(){abort("'RegisteredPointer_getPointee' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"RegisteredPointer_destructor"))Module["RegisteredPointer_destructor"]=function(){abort("'RegisteredPointer_destructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"RegisteredPointer_deleteObject"))Module["RegisteredPointer_deleteObject"]=function(){abort("'RegisteredPointer_deleteObject' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"RegisteredPointer_fromWireType"))Module["RegisteredPointer_fromWireType"]=function(){abort("'RegisteredPointer_fromWireType' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"runDestructor"))Module["runDestructor"]=function(){abort("'runDestructor' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"releaseClassHandle"))Module["releaseClassHandle"]=function(){abort("'releaseClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"finalizationGroup"))Module["finalizationGroup"]=function(){abort("'finalizationGroup' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"detachFinalizer_deps"))Module["detachFinalizer_deps"]=function(){abort("'detachFinalizer_deps' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"detachFinalizer"))Module["detachFinalizer"]=function(){abort("'detachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"attachFinalizer"))Module["attachFinalizer"]=function(){abort("'attachFinalizer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"makeClassHandle"))Module["makeClassHandle"]=function(){abort("'makeClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"init_ClassHandle"))Module["init_ClassHandle"]=function(){abort("'init_ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ClassHandle"))Module["ClassHandle"]=function(){abort("'ClassHandle' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ClassHandle_isAliasOf"))Module["ClassHandle_isAliasOf"]=function(){abort("'ClassHandle_isAliasOf' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"throwInstanceAlreadyDeleted"))Module["throwInstanceAlreadyDeleted"]=function(){abort("'throwInstanceAlreadyDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ClassHandle_clone"))Module["ClassHandle_clone"]=function(){abort("'ClassHandle_clone' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ClassHandle_delete"))Module["ClassHandle_delete"]=function(){abort("'ClassHandle_delete' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"deletionQueue"))Module["deletionQueue"]=function(){abort("'deletionQueue' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ClassHandle_isDeleted"))Module["ClassHandle_isDeleted"]=function(){abort("'ClassHandle_isDeleted' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"ClassHandle_deleteLater"))Module["ClassHandle_deleteLater"]=function(){abort("'ClassHandle_deleteLater' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"flushPendingDeletes"))Module["flushPendingDeletes"]=function(){abort("'flushPendingDeletes' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"delayFunction"))Module["delayFunction"]=function(){abort("'delayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"setDelayFunction"))Module["setDelayFunction"]=function(){abort("'setDelayFunction' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"RegisteredClass"))Module["RegisteredClass"]=function(){abort("'RegisteredClass' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"shallowCopyInternalPointer"))Module["shallowCopyInternalPointer"]=function(){abort("'shallowCopyInternalPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"downcastPointer"))Module["downcastPointer"]=function(){abort("'downcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"upcastPointer"))Module["upcastPointer"]=function(){abort("'upcastPointer' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"validateThis"))Module["validateThis"]=function(){abort("'validateThis' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"char_0"))Module["char_0"]=function(){abort("'char_0' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"char_9"))Module["char_9"]=function(){abort("'char_9' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"makeLegalFunctionName"))Module["makeLegalFunctionName"]=function(){abort("'makeLegalFunctionName' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"warnOnce"))Module["warnOnce"]=function(){abort("'warnOnce' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stackSave"))Module["stackSave"]=function(){abort("'stackSave' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stackRestore"))Module["stackRestore"]=function(){abort("'stackRestore' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stackAlloc"))Module["stackAlloc"]=function(){abort("'stackAlloc' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"AsciiToString"))Module["AsciiToString"]=function(){abort("'AsciiToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stringToAscii"))Module["stringToAscii"]=function(){abort("'stringToAscii' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"UTF16ToString"))Module["UTF16ToString"]=function(){abort("'UTF16ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF16"))Module["stringToUTF16"]=function(){abort("'stringToUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF16"))Module["lengthBytesUTF16"]=function(){abort("'lengthBytesUTF16' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"UTF32ToString"))Module["UTF32ToString"]=function(){abort("'UTF32ToString' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"stringToUTF32"))Module["stringToUTF32"]=function(){abort("'stringToUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"lengthBytesUTF32"))Module["lengthBytesUTF32"]=function(){abort("'lengthBytesUTF32' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8"))Module["allocateUTF8"]=function(){abort("'allocateUTF8' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};if(!Object.getOwnPropertyDescriptor(Module,"allocateUTF8OnStack"))Module["allocateUTF8OnStack"]=function(){abort("'allocateUTF8OnStack' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");};Module["writeStackCookie"]=writeStackCookie;Module["checkStackCookie"]=checkStackCookie;if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_NORMAL"))Object.defineProperty(Module,"ALLOC_NORMAL",{configurable:true,get:function(){abort("'ALLOC_NORMAL' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");}});if(!Object.getOwnPropertyDescriptor(Module,"ALLOC_STACK"))Object.defineProperty(Module,"ALLOC_STACK",{configurable:true,get:function(){abort("'ALLOC_STACK' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)");}});var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status;}dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller;};function stackCheckInit(){_emscripten_stack_init();writeStackCookie();}function run(args){if(runDependencies>0){return}stackCheckInit();preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();readyPromiseResolve(Module);if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();assert(!Module["_main"],'compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]');postRun();}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("");},1);doRun();},1);}else {doRun();}checkStackCookie();}Module["run"]=run;function checkUnflushedContent(){var oldOut=out;var oldErr=err;var has=false;out=err=function(x){has=true;};try{var flush=Module["_fflush"];if(flush)flush(0);["stdout","stderr"].forEach(function(name){var info=FS.analyzePath("/dev/"+name);if(!info)return;var stream=info.object;var rdev=stream.rdev;var tty=TTY.ttys[rdev];if(tty&&tty.output&&tty.output.length){has=true;}});}catch(e){}out=oldOut;err=oldErr;if(has){warnOnce("stdio streams had content in them that was not flushed. you should set EXIT_RUNTIME to 1 (see the FAQ), or make sure to emit a newline when you printf etc.");}}function exit(status,implicit){checkUnflushedContent();if(implicit&&keepRuntimeAlive()&&status===0){return}if(keepRuntimeAlive()){if(!implicit){var msg="program exited (with status: "+status+"), but EXIT_RUNTIME is not set, so halting execution but not exiting the runtime or preventing further async execution (build with EXIT_RUNTIME=1, if you want a true shutdown)";readyPromiseReject(msg);err(msg);}}else {exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true;}quit_(status,new ExitStatus(status));}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()();}}run(); + + + return Module.ready +} +); })(); let _exports_ = {}; const _module_ = {exports: _exports_}; if (typeof _exports_ === 'object' && typeof _module_ === 'object') _module_.exports = Module; else if (typeof define === 'function' && define['amd']) - define([], function () { - return Module; - }); -else if (typeof _exports_ === 'object') _exports_['Module'] = Module; + define([], function() { return Module; }); +else if (typeof _exports_ === 'object') + _exports_["Module"] = Module; var CgalNode = _module_.exports; function pad (hash, len) { @@ -10720,6 +538,24 @@ const fromTranslateToTransform = (x = 0, y = 0, z = 0) => const fromScaleToTransform = (x = 0, y = 0, z = 0) => toJsTransformFromCgalTransform(getCgal().Transformation__scale(x, y, z)); +const getPathEdges = (path) => { + const edges = []; + let last = null; + for (const point of path) { + if (point === null) { + continue; + } + if (last !== null) { + edges.push([last, point]); + } + last = point; + } + if (path[0] !== null) { + edges.push([last, path[0]]); + } + return edges; +}; + const X$2 = 0; const Y$2 = 1; const Z$2 = 2; @@ -11510,6 +1346,22 @@ const intersectionOfSurfaceMeshes = (a, aTransform, b, bTransform) => toCgalTransformFromJsTransform(bTransform) ); +const loftBetweenCongruentSurfaceMeshes = ( + closed = false, + ...entries +) => { + return getCgal().LoftBetweenCongruentSurfaceMeshes(closed, (fill) => { + if (entries.length > 0) { + const [mesh, transform] = entries.shift(); + fill.set_mesh(mesh); + fill.set_transform(toCgalTransformFromJsTransform(transform)); + return true; + } else { + return false; + } + }); +}; + const offsetOfPolygonWithHoles = ( initial = 1, step = -1, @@ -11711,11 +1563,31 @@ const sectionOfSurfaceMesh = ( return sections; }; -const remeshSurfaceMesh = ( +const splitSurfaceMesh = ( mesh, - { length = 1, angle = 10, relaxationSteps = 1, iterations = 1 } -) => - getCgal().RemeshSurfaceMesh(mesh, length, angle, relaxationSteps, iterations); + keepVolumes = true, + keepCavitiesInVolumes = true, + keepCavitiesAsVolumes = false +) => { + const meshes = []; + getCgal().SplitSurfaceMesh( + mesh, + keepVolumes, + keepCavitiesInVolumes, + keepCavitiesAsVolumes, + (mesh) => meshes.push(mesh) + ); + return meshes; +}; + +const remeshSurfaceMesh = (mesh, ...lengths) => + getCgal().RemeshSurfaceMesh(mesh, () => { + if (lengths.length > 0) { + return lengths.shift(); + } else { + return -1; + } + }); const serializeSurfaceMesh = (mesh) => getCgal().SerializeSurfaceMesh(mesh); @@ -11765,4 +1637,4 @@ const unionOfSurfaceMeshes = (a, aTransform, b, bTransform) => toCgalTransformFromJsTransform(bTransform) ); -export { BOOLEAN_ADD, BOOLEAN_CLIP, BOOLEAN_CUT, arrangePaths, arrangePathsIntoTriangles, arrangePolygonsWithHoles, bendSurfaceMesh, booleansOfPolygonsWithHoles, composeTransforms, deserializeSurfaceMesh, differenceOfSurfaceMeshes, doesSelfIntersectOfSurfaceMesh, extrudeSurfaceMesh, extrudeToPlaneOfSurfaceMesh, fitPlaneToPoints, fromApproximateToCgalTransform, fromExactToCgalTransform, fromFunctionToSurfaceMesh, fromGraphToSurfaceMesh, fromIdentityToCgalTransform, fromPointsToAlphaShape2AsPolygonSegments, fromPointsToAlphaShapeAsSurfaceMesh, fromPointsToConvexHullAsSurfaceMesh, fromPointsToSurfaceMesh, fromPolygonsToSurfaceMesh, fromRotateXToTransform, fromRotateYToTransform, fromRotateZToTransform, fromScaleToTransform, fromSurfaceMeshEmitBoundingBox, fromSurfaceMeshToGraph, fromSurfaceMeshToLazyGraph, fromSurfaceMeshToPolygons, fromSurfaceMeshToPolygonsWithHoles, fromSurfaceMeshToTriangles, fromTranslateToTransform, growSurfaceMesh, initCgal, insetOfPolygonWithHoles, intersectionOfSurfaceMeshes, minkowskiDifferenceOfSurfaceMeshes, minkowskiShellOfSurfaceMeshes, minkowskiSumOfSurfaceMeshes, offsetOfPolygonWithHoles, outlineSurfaceMesh, projectToPlaneOfSurfaceMesh, pushSurfaceMesh, remeshSurfaceMesh, reverseFaceOrientationsOfSurfaceMesh, sectionOfSurfaceMesh, serializeSurfaceMesh, subdivideSurfaceMesh, toCgalTransformFromJsTransform, transformSurfaceMesh, twistSurfaceMesh, unionOfSurfaceMeshes }; +export { BOOLEAN_ADD, BOOLEAN_CLIP, BOOLEAN_CUT, arrangePaths, arrangePathsIntoTriangles, arrangePolygonsWithHoles, bendSurfaceMesh, booleansOfPolygonsWithHoles, composeTransforms, deserializeSurfaceMesh, differenceOfSurfaceMeshes, doesSelfIntersectOfSurfaceMesh, extrudeSurfaceMesh, extrudeToPlaneOfSurfaceMesh, fitPlaneToPoints, fromApproximateToCgalTransform, fromExactToCgalTransform, fromFunctionToSurfaceMesh, fromGraphToSurfaceMesh, fromIdentityToCgalTransform, fromPointsToAlphaShape2AsPolygonSegments, fromPointsToAlphaShapeAsSurfaceMesh, fromPointsToConvexHullAsSurfaceMesh, fromPointsToSurfaceMesh, fromPolygonsToSurfaceMesh, fromRotateXToTransform, fromRotateYToTransform, fromRotateZToTransform, fromScaleToTransform, fromSurfaceMeshEmitBoundingBox, fromSurfaceMeshToGraph, fromSurfaceMeshToLazyGraph, fromSurfaceMeshToPolygons, fromSurfaceMeshToPolygonsWithHoles, fromSurfaceMeshToTriangles, fromTranslateToTransform, growSurfaceMesh, initCgal, insetOfPolygonWithHoles, intersectionOfSurfaceMeshes, loftBetweenCongruentSurfaceMeshes, minkowskiDifferenceOfSurfaceMeshes, minkowskiShellOfSurfaceMeshes, minkowskiSumOfSurfaceMeshes, offsetOfPolygonWithHoles, outlineSurfaceMesh, projectToPlaneOfSurfaceMesh, pushSurfaceMesh, remeshSurfaceMesh, reverseFaceOrientationsOfSurfaceMesh, sectionOfSurfaceMesh, serializeSurfaceMesh, splitSurfaceMesh, subdivideSurfaceMesh, toCgalTransformFromJsTransform, transformSurfaceMesh, twistSurfaceMesh, unionOfSurfaceMeshes }; diff --git a/dist/jsxcad-algorithm-color.js b/dist/jsxcad-algorithm-color.js index fef865ba..c7ecef24 100644 --- a/dist/jsxcad-algorithm-color.js +++ b/dist/jsxcad-algorithm-color.js @@ -1,3 +1,7 @@ +var r$1={grad:.9,turn:360,rad:360/(2*Math.PI)},t$1=function(r){return "string"==typeof r?r.length>0:"number"==typeof r},n$1=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*r)/n+0},e$1=function(r,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),r>n?n:r>t?r:t},u$1=function(r){return (r=isFinite(r)?r%360:0)>0?r:r+360},a$1=function(r){return {r:e$1(r.r,0,255),g:e$1(r.g,0,255),b:e$1(r.b,0,255),a:e$1(r.a)}},o$1=function(r){return {r:n$1(r.r),g:n$1(r.g),b:n$1(r.b),a:n$1(r.a,3)}},i$1=/^#([0-9a-f]{3,8})$/i,s=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},h$1=function(r){var t=r.r,n=r.g,e=r.b,u=r.a,a=Math.max(t,n,e),o=a-Math.min(t,n,e),i=o?a===t?(n-e)/o:a===n?2+(e-t)/o:4+(t-n)/o:0;return {h:60*(i<0?i+6:i),s:a?o/a*100:0,v:a/255*100,a:u}},b=function(r){var t=r.h,n=r.s,e=r.v,u=r.a;t=t/360*6,n/=100,e/=100;var a=Math.floor(t),o=e*(1-n),i=e*(1-(t-a)*n),s=e*(1-(1-t+a)*n),h=a%6;return {r:255*[e,i,o,o,s,e][h],g:255*[s,e,e,i,o,o][h],b:255*[o,o,s,e,e,i][h],a:u}},g=function(r){return {h:u$1(r.h),s:e$1(r.s,0,100),l:e$1(r.l,0,100),a:e$1(r.a)}},d=function(r){return {h:n$1(r.h),s:n$1(r.s),l:n$1(r.l),a:n$1(r.a,3)}},f=function(r){return b((n=(t=r).s,{h:t.h,s:(n*=((e=t.l)<50?e:100-e)/100)>0?2*n/(e+n)*100:0,v:e+n,a:t.a}));var t,n,e;},c=function(r){return {h:(t=h$1(r)).h,s:(u=(200-(n=t.s))*(e=t.v)/100)>0&&u<200?n*e/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,e,u;},l$1=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,p$1=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,v=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,m=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y={string:[[function(r){var t=i$1.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:4===r.length?n$1(parseInt(r[3]+r[3],16)/255,2):1}:6===r.length||8===r.length?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:8===r.length?n$1(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=v.exec(r)||m.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:a$1({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(t){var n=l$1.exec(t)||p$1.exec(t);if(!n)return null;var e,u,a=g({h:(e=n[1],u=n[2],void 0===u&&(u="deg"),Number(e)*(r$1[u]||1)),s:Number(n[3]),l:Number(n[4]),a:void 0===n[5]?1:Number(n[5])/(n[6]?100:1)});return f(a)},"hsl"]],object:[[function(r){var n=r.r,e=r.g,u=r.b,o=r.a,i=void 0===o?1:o;return t$1(n)&&t$1(e)&&t$1(u)?a$1({r:Number(n),g:Number(e),b:Number(u),a:Number(i)}):null},"rgb"],[function(r){var n=r.h,e=r.s,u=r.l,a=r.a,o=void 0===a?1:a;if(!t$1(n)||!t$1(e)||!t$1(u))return null;var i=g({h:Number(n),s:Number(e),l:Number(u),a:Number(o)});return f(i)},"hsl"],[function(r){var n=r.h,a=r.s,o=r.v,i=r.a,s=void 0===i?1:i;if(!t$1(n)||!t$1(a)||!t$1(o))return null;var h=function(r){return {h:u$1(r.h),s:e$1(r.s,0,100),v:e$1(r.v,0,100),a:e$1(r.a)}}({h:Number(n),s:Number(a),v:Number(o),a:Number(s)});return b(h)},"hsv"]]},N=function(r,t){for(var n=0;n=.5},r.prototype.toHex=function(){return r=o$1(this.rgba),t=r.r,e=r.g,u=r.b,i=(a=r.a)<1?s(n$1(255*a)):"","#"+s(t)+s(e)+s(u)+i;var r,t,e,u,a,i;},r.prototype.toRgb=function(){return o$1(this.rgba)},r.prototype.toRgbString=function(){return r=o$1(this.rgba),t=r.r,n=r.g,e=r.b,(u=r.a)<1?"rgba("+t+", "+n+", "+e+", "+u+")":"rgb("+t+", "+n+", "+e+")";var r,t,n,e,u;},r.prototype.toHsl=function(){return d(c(this.rgba))},r.prototype.toHslString=function(){return r=d(c(this.rgba)),t=r.h,n=r.s,e=r.l,(u=r.a)<1?"hsla("+t+", "+n+"%, "+e+"%, "+u+")":"hsl("+t+", "+n+"%, "+e+"%)";var r,t,n,e,u;},r.prototype.toHsv=function(){return r=h$1(this.rgba),{h:n$1(r.h),s:n$1(r.s),v:n$1(r.v),a:n$1(r.a,3)};var r;},r.prototype.invert=function(){return w({r:255-(r=this.rgba).r,g:255-r.g,b:255-r.b,a:r.a});var r;},r.prototype.saturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,r))},r.prototype.desaturate=function(r){return void 0===r&&(r=.1),w(M(this.rgba,-r))},r.prototype.grayscale=function(){return w(M(this.rgba,-1))},r.prototype.lighten=function(r){return void 0===r&&(r=.1),w(H(this.rgba,r))},r.prototype.darken=function(r){return void 0===r&&(r=.1),w(H(this.rgba,-r))},r.prototype.rotate=function(r){return void 0===r&&(r=15),this.hue(this.hue()+r)},r.prototype.alpha=function(r){return "number"==typeof r?w({r:(t=this.rgba).r,g:t.g,b:t.b,a:r}):n$1(this.rgba.a,3);var t;},r.prototype.hue=function(r){var t=c(this.rgba);return "number"==typeof r?w({h:r,s:t.s,l:t.l,a:t.a}):n$1(t.h)},r}(),w=function(r){return r instanceof j?r:new j(r)},S=[],k=function(r){r.forEach(function(r){S.indexOf(r)<0&&(r(j,y),S.push(r));});}; + +var a=function(a,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),a>n?n:a>t?a:t},t=function(a){var t=a/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},n=function(a){return 255*(a>.0031308?1.055*Math.pow(a,1/2.4)-.055:12.92*a)},r=96.422,o=100,u=82.521,e=function(t){var r,o,u={x:.9555766*(r=t).x+-.0230393*r.y+.0631636*r.z,y:-.0282895*r.x+1.0099416*r.y+.0210077*r.z,z:.0122982*r.x+-.020483*r.y+1.3299098*r.z};return o={r:n(.032404542*u.x-.015371385*u.y-.004985314*u.z),g:n(-.00969266*u.x+.018760108*u.y+41556e-8*u.z),b:n(556434e-9*u.x-.002040259*u.y+.010572252*u.z),a:t.a},{r:a(o.r,0,255),g:a(o.g,0,255),b:a(o.b,0,255),a:a(o.a)}},h=function(n){var e=t(n.r),h=t(n.g),i=t(n.b);return function(t){return {x:a(t.x,0,r),y:a(t.y,0,o),z:a(t.z,0,u),a:a(t.a)}}(function(a){return {x:1.0478112*a.x+.0228866*a.y+-.050127*a.z,y:.0295424*a.x+.9904844*a.y+-.0170491*a.z,z:-.0092345*a.x+.0150436*a.y+.7521316*a.z,a:a.a}}({x:100*(.4124564*e+.3575761*h+.1804375*i),y:100*(.2126729*e+.7151522*h+.072175*i),z:100*(.0193339*e+.119192*h+.9503041*i),a:n.a}))},i=216/24389,l=24389/27,x=function(a){var t=h(a),n=t.x/r,e=t.y/o,x=t.z/u;return n=n>i?Math.cbrt(n):(l*n+16)/116,{l:116*(e=e>i?Math.cbrt(e):(l*e+16)/116)-16,a:500*(n-e),b:200*(e-(x=x>i?Math.cbrt(x):(l*x+16)/116)),alpha:t.a}},p=function(t,n,h){var p,y=x(t),b=x(n);return function(a){var t=(a.l+16)/116,n=a.a/500+t,h=t-a.b/200;return e({x:(Math.pow(n,3)>i?Math.pow(n,3):(116*n-16)/l)*r,y:(a.l>8?Math.pow((a.l+16)/116,3):a.l/l)*o,z:(Math.pow(h,3)>i?Math.pow(h,3):(116*h-16)/l)*u,a:a.alpha})}({l:a((p={l:y.l*(1-h)+b.l*h,a:y.a*(1-h)+b.a*h,b:y.b*(1-h)+b.b*h,alpha:y.alpha*(1-h)+b.alpha*h}).l,0,400),a:p.a,b:p.b,alpha:a(p.alpha)})};function mixPlugin(a){a.prototype.mix=function(t,n){void 0===n&&(n=.5);var r=t instanceof a?t:new a(t),o=p(this.toRgb(),r.toRgb(),n);return new a(o)};} + const standardColorDefinitions = { 'color/black': { rgb: '#000000' }, 'color/blue': { rgb: '#0000ff' }, @@ -1684,6 +1688,8 @@ const standardColorDefinitions = { 'color/pink sherbet': { rgb: '#f780a1' }, }; +k([mixPlugin]); + // FIX: Apply normalizations here. const toTagFromName = (name) => { return `color/${name}`; @@ -1699,21 +1705,33 @@ const toRgbColorFromTags = ( customDefinitions = {}, otherwise = '#000000' ) => { + const collected = []; for (const tag of tags) { if (tag.startsWith('color/')) { for (const definitions of [standardColorDefinitions, customDefinitions]) { const definition = definitions[tag]; if (definition && definition.rgb) { - return definition.rgb; + collected.push(definition.rgb); } } if (tag.startsWith('color/#')) { // Assume tags that start with # are rgb colors. - return tag.substring(6); + collected.push(tag.substring(6)); } } } - return otherwise; + if (collected.length === 0) { + return otherwise; + } else if (collected.length === 1) { + return collected[0]; + } else { + let color = w('#ffffff'); + let nth = 0; + for (const rgb of collected) { + color = color.mix(rgb, 1 / ++nth); + } + return color.toHex(); + } }; const toRgbFromTags = ( diff --git a/dist/jsxcad-algorithm-material.js b/dist/jsxcad-algorithm-material.js index ee79fd7a..574f003d 100644 --- a/dist/jsxcad-algorithm-material.js +++ b/dist/jsxcad-algorithm-material.js @@ -17,6 +17,7 @@ const standardMaterialDefinitions = { threejsMaterial: { opacity: 0.5, transparent: true, + depthWrite: false, }, }, 'material/glass': { @@ -24,6 +25,7 @@ const standardMaterialDefinitions = { opacity: 0.5, transparent: true, metalness: 0.0, + depthWrite: false, }, }, 'material/color': { @@ -160,6 +162,7 @@ const standardMaterialDefinitions = { clearCoat: 1, clearCoatRoughness: 0, map: 'https://jsxcad.js.org/texture/wet-glass.png', + depthWrite: false, }, }, }; diff --git a/dist/jsxcad-api-v1-item.js b/dist/jsxcad-api-v1-item.js index e728d1ac..675b94df 100644 --- a/dist/jsxcad-api-v1-item.js +++ b/dist/jsxcad-api-v1-item.js @@ -1,4 +1,4 @@ -import { taggedItem, taggedAssembly, visit, rewrite, update, getItems, getLeafs } from './jsxcad-geometry.js'; +import { taggedItem, assemble, visit, rewrite, update, getItems, getLeafs } from './jsxcad-geometry.js'; import Shape from './jsxcad-api-v1-shape.js'; import { emit } from './jsxcad-sys.js'; @@ -7,7 +7,7 @@ const Item = (id = '', ...shapes) => Shape.fromGeometry( taggedItem( { tags: [`item/${id}`] }, - taggedAssembly({}, ...shapes.map((shape) => shape.toGeometry())) + assemble(...shapes.map((shape) => shape.toGeometry())) ) ); diff --git a/dist/jsxcad-api-v1-math.js b/dist/jsxcad-api-v1-math.js index 66ff6e02..d11bb0e4 100644 --- a/dist/jsxcad-api-v1-math.js +++ b/dist/jsxcad-api-v1-math.js @@ -97,856 +97,27 @@ function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } -var shuffle_seed = createCommonjsModule(function (module, exports) { -// This is free and unencumbered software released into the public domain +var constants = createCommonjsModule(function (module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); -function shuffleSeed(seed) { - var newSeed = new Uint32Array(1); - newSeed[0] = seed[0] * 1664525 + 1013904223; - return newSeed; -} -exports.default = shuffleSeed; -}); - -unwrapExports(shuffle_seed); - -var _2d = createCommonjsModule(function (module, exports) { -// This is free and unencumbered software released into the public domain -Object.defineProperty(exports, "__esModule", { value: true }); -exports.makeNoise2D = void 0; - -var NORM_2D = 1.0 / 47.0; -var SQUISH_2D = (Math.sqrt(2 + 1) - 1) / 2; -var STRETCH_2D = (1 / Math.sqrt(2 + 1) - 1) / 2; -function contribution2D(multiplier, xsb, ysb) { - return { - dx: -xsb - multiplier * SQUISH_2D, - dy: -ysb - multiplier * SQUISH_2D, - xsb: xsb, - ysb: ysb, - }; -} -function makeNoise2D(clientSeed) { - var contributions = []; - for (var i = 0; i < p2D.length; i += 4) { - var baseSet = base2D[p2D[i]]; - var previous = null; - var current = null; - for (var k = 0; k < baseSet.length; k += 3) { - current = contribution2D(baseSet[k], baseSet[k + 1], baseSet[k + 2]); - if (previous === null) - contributions[i / 4] = current; - else - previous.next = current; - previous = current; - } - current.next = contribution2D(p2D[i + 1], p2D[i + 2], p2D[i + 3]); - } - var lookup = []; - for (var i = 0; i < lookupPairs2D.length; i += 2) { - lookup[lookupPairs2D[i]] = contributions[lookupPairs2D[i + 1]]; - } - var perm = new Uint8Array(256); - var perm2D = new Uint8Array(256); - var source = new Uint8Array(256); - for (var i = 0; i < 256; i++) - source[i] = i; - var seed = new Uint32Array(1); - seed[0] = clientSeed; - seed = shuffle_seed.default(shuffle_seed.default(shuffle_seed.default(seed))); - for (var i = 255; i >= 0; i--) { - seed = shuffle_seed.default(seed); - var r = new Uint32Array(1); - r[0] = (seed[0] + 31) % (i + 1); - if (r[0] < 0) - r[0] += i + 1; - perm[i] = source[r[0]]; - perm2D[i] = perm[i] & 0x0e; - source[r[0]] = source[i]; - } - return function (x, y) { - var stretchOffset = (x + y) * STRETCH_2D; - var xs = x + stretchOffset; - var ys = y + stretchOffset; - var xsb = Math.floor(xs); - var ysb = Math.floor(ys); - var squishOffset = (xsb + ysb) * SQUISH_2D; - var dx0 = x - (xsb + squishOffset); - var dy0 = y - (ysb + squishOffset); - var xins = xs - xsb; - var yins = ys - ysb; - var inSum = xins + yins; - var hash = (xins - yins + 1) | - (inSum << 1) | - ((inSum + yins) << 2) | - ((inSum + xins) << 4); - var value = 0; - for (var c = lookup[hash]; c !== undefined; c = c.next) { - var dx = dx0 + c.dx; - var dy = dy0 + c.dy; - var attn = 2 - dx * dx - dy * dy; - if (attn > 0) { - var px = xsb + c.xsb; - var py = ysb + c.ysb; - var indexPartA = perm[px & 0xff]; - var index = perm2D[(indexPartA + py) & 0xff]; - var valuePart = gradients2D[index] * dx + gradients2D[index + 1] * dy; - value += attn * attn * attn * attn * valuePart; - } - } - return value * NORM_2D; - }; -} -exports.makeNoise2D = makeNoise2D; -var base2D = [ - [1, 1, 0, 1, 0, 1, 0, 0, 0], - [1, 1, 0, 1, 0, 1, 2, 1, 1], -]; -var gradients2D = [ - 5, - 2, - 2, - 5, - -5, - 2, - -2, - 5, - 5, - -2, - 2, - -5, - -5, - -2, - -2, - -5, -]; -var lookupPairs2D = [ - 0, - 1, - 1, - 0, - 4, - 1, - 17, - 0, - 20, - 2, - 21, - 2, - 22, - 5, - 23, - 5, - 26, - 4, - 39, - 3, - 42, - 4, - 43, - 3, -]; -var p2D = [ - 0, - 0, - 1, - -1, - 0, - 0, - -1, - 1, - 0, - 2, - 1, - 1, - 1, - 2, - 2, - 0, - 1, - 2, - 0, - 2, - 1, - 0, - 0, - 0, -]; -}); - -unwrapExports(_2d); -_2d.makeNoise2D; - -var _3d = createCommonjsModule(function (module, exports) { -// This is free and unencumbered software released into the public domain -Object.defineProperty(exports, "__esModule", { value: true }); -exports.makeNoise3D = void 0; - -var NORM_3D = 1.0 / 103.0; -var SQUISH_3D = (Math.sqrt(3 + 1) - 1) / 3; -var STRETCH_3D = (1 / Math.sqrt(3 + 1) - 1) / 3; -function contribution3D(multiplier, xsb, ysb, zsb) { - return { - dx: -xsb - multiplier * SQUISH_3D, - dy: -ysb - multiplier * SQUISH_3D, - dz: -zsb - multiplier * SQUISH_3D, - xsb: xsb, - ysb: ysb, - zsb: zsb, - }; -} -function makeNoise3D(clientSeed) { - var contributions = []; - for (var i = 0; i < p3D.length; i += 9) { - var baseSet = base3D[p3D[i]]; - var previous = null; - var current = null; - for (var k = 0; k < baseSet.length; k += 4) { - current = contribution3D(baseSet[k], baseSet[k + 1], baseSet[k + 2], baseSet[k + 3]); - if (previous === null) - contributions[i / 9] = current; - else - previous.next = current; - previous = current; - } - current.next = contribution3D(p3D[i + 1], p3D[i + 2], p3D[i + 3], p3D[i + 4]); - current.next.next = contribution3D(p3D[i + 5], p3D[i + 6], p3D[i + 7], p3D[i + 8]); - } - var lookup = []; - for (var i = 0; i < lookupPairs3D.length; i += 2) { - lookup[lookupPairs3D[i]] = contributions[lookupPairs3D[i + 1]]; - } - var perm = new Uint8Array(256); - var perm3D = new Uint8Array(256); - var source = new Uint8Array(256); - for (var i = 0; i < 256; i++) - source[i] = i; - var seed = new Uint32Array(1); - seed[0] = clientSeed; - seed = shuffle_seed.default(shuffle_seed.default(shuffle_seed.default(seed))); - for (var i = 255; i >= 0; i--) { - seed = shuffle_seed.default(seed); - var r = new Uint32Array(1); - r[0] = (seed[0] + 31) % (i + 1); - if (r[0] < 0) - r[0] += i + 1; - perm[i] = source[r[0]]; - perm3D[i] = (perm[i] % 24) * 3; - source[r[0]] = source[i]; - } - return function (x, y, z) { - var stretchOffset = (x + y + z) * STRETCH_3D; - var xs = x + stretchOffset; - var ys = y + stretchOffset; - var zs = z + stretchOffset; - var xsb = Math.floor(xs); - var ysb = Math.floor(ys); - var zsb = Math.floor(zs); - var squishOffset = (xsb + ysb + zsb) * SQUISH_3D; - var dx0 = x - (xsb + squishOffset); - var dy0 = y - (ysb + squishOffset); - var dz0 = z - (zsb + squishOffset); - var xins = xs - xsb; - var yins = ys - ysb; - var zins = zs - zsb; - var inSum = xins + yins + zins; - var hash = (yins - zins + 1) | - ((xins - yins + 1) << 1) | - ((xins - zins + 1) << 2) | - (inSum << 3) | - ((inSum + zins) << 5) | - ((inSum + yins) << 7) | - ((inSum + xins) << 9); - var value = 0; - for (var c = lookup[hash]; c !== undefined; c = c.next) { - var dx = dx0 + c.dx; - var dy = dy0 + c.dy; - var dz = dz0 + c.dz; - var attn = 2 - dx * dx - dy * dy - dz * dz; - if (attn > 0) { - var px = xsb + c.xsb; - var py = ysb + c.ysb; - var pz = zsb + c.zsb; - var indexPartA = perm[px & 0xff]; - var indexPartB = perm[(indexPartA + py) & 0xff]; - var index = perm3D[(indexPartB + pz) & 0xff]; - var valuePart = gradients3D[index] * dx + - gradients3D[index + 1] * dy + - gradients3D[index + 2] * dz; - value += attn * attn * attn * attn * valuePart; - } - } - return value * NORM_3D; - }; -} -exports.makeNoise3D = makeNoise3D; -var base3D = [ - [0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1], - [2, 1, 1, 0, 2, 1, 0, 1, 2, 0, 1, 1, 3, 1, 1, 1], - [1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 2, 1, 1, 0, 2, 1, 0, 1, 2, 0, 1, 1], -]; -var gradients3D = [ - -11, - 4, - 4, - -4, - 11, - 4, - -4, - 4, - 11, - 11, - 4, - 4, - 4, - 11, - 4, - 4, - 4, - 11, - -11, - -4, - 4, - -4, - -11, - 4, - -4, - -4, - 11, - 11, - -4, - 4, - 4, - -11, - 4, - 4, - -4, - 11, - -11, - 4, - -4, - -4, - 11, - -4, - -4, - 4, - -11, - 11, - 4, - -4, - 4, - 11, - -4, - 4, - 4, - -11, - -11, - -4, - -4, - -4, - -11, - -4, - -4, - -4, - -11, - 11, - -4, - -4, - 4, - -11, - -4, - 4, - -4, - -11, -]; -var lookupPairs3D = [ - 0, - 2, - 1, - 1, - 2, - 2, - 5, - 1, - 6, - 0, - 7, - 0, - 32, - 2, - 34, - 2, - 129, - 1, - 133, - 1, - 160, - 5, - 161, - 5, - 518, - 0, - 519, - 0, - 546, - 4, - 550, - 4, - 645, - 3, - 647, - 3, - 672, - 5, - 673, - 5, - 674, - 4, - 677, - 3, - 678, - 4, - 679, - 3, - 680, - 13, - 681, - 13, - 682, - 12, - 685, - 14, - 686, - 12, - 687, - 14, - 712, - 20, - 714, - 18, - 809, - 21, - 813, - 23, - 840, - 20, - 841, - 21, - 1198, - 19, - 1199, - 22, - 1226, - 18, - 1230, - 19, - 1325, - 23, - 1327, - 22, - 1352, - 15, - 1353, - 17, - 1354, - 15, - 1357, - 17, - 1358, - 16, - 1359, - 16, - 1360, - 11, - 1361, - 10, - 1362, - 11, - 1365, - 10, - 1366, - 9, - 1367, - 9, - 1392, - 11, - 1394, - 11, - 1489, - 10, - 1493, - 10, - 1520, - 8, - 1521, - 8, - 1878, - 9, - 1879, - 9, - 1906, - 7, - 1910, - 7, - 2005, - 6, - 2007, - 6, - 2032, - 8, - 2033, - 8, - 2034, - 7, - 2037, - 6, - 2038, - 7, - 2039, - 6, -]; -var p3D = [ - 0, - 0, - 1, - -1, - 0, - 0, - 1, - 0, - -1, - 0, - 0, - -1, - 1, - 0, - 0, - 0, - 1, - -1, - 0, - 0, - -1, - 0, - 1, - 0, - 0, - -1, - 1, - 0, - 2, - 1, - 1, - 0, - 1, - 1, - 1, - -1, - 0, - 2, - 1, - 0, - 1, - 1, - 1, - -1, - 1, - 0, - 2, - 0, - 1, - 1, - 1, - -1, - 1, - 1, - 1, - 3, - 2, - 1, - 0, - 3, - 1, - 2, - 0, - 1, - 3, - 2, - 0, - 1, - 3, - 1, - 0, - 2, - 1, - 3, - 0, - 2, - 1, - 3, - 0, - 1, - 2, - 1, - 1, - 1, - 0, - 0, - 2, - 2, - 0, - 0, - 1, - 1, - 0, - 1, - 0, - 2, - 0, - 2, - 0, - 1, - 1, - 0, - 0, - 1, - 2, - 0, - 0, - 2, - 2, - 0, - 0, - 0, - 0, - 1, - 1, - -1, - 1, - 2, - 0, - 0, - 0, - 0, - 1, - -1, - 1, - 1, - 2, - 0, - 0, - 0, - 0, - 1, - 1, - 1, - -1, - 2, - 3, - 1, - 1, - 1, - 2, - 0, - 0, - 2, - 2, - 3, - 1, - 1, - 1, - 2, - 2, - 0, - 0, - 2, - 3, - 1, - 1, - 1, - 2, - 0, - 2, - 0, - 2, - 1, - 1, - -1, - 1, - 2, - 0, - 0, - 2, - 2, - 1, - 1, - -1, - 1, - 2, - 2, - 0, - 0, - 2, - 1, - -1, - 1, - 1, - 2, - 0, - 0, - 2, - 2, - 1, - -1, - 1, - 1, - 2, - 0, - 2, - 0, - 2, - 1, - 1, - 1, - -1, - 2, - 2, - 0, - 0, - 2, - 1, - 1, - 1, - -1, - 2, - 0, - 2, - 0, -]; -}); - -unwrapExports(_3d); -_3d.makeNoise3D; - -var _4d = createCommonjsModule(function (module, exports) { -// This is free and unencumbered software released into the public domain -Object.defineProperty(exports, "__esModule", { value: true }); -exports.makeNoise4D = void 0; - -var NORM_4D = 1.0 / 30.0; -var SQUISH_4D = (Math.sqrt(4 + 1) - 1) / 4; -var STRETCH_4D = (1 / Math.sqrt(4 + 1) - 1) / 4; -function contribution4D(multiplier, xsb, ysb, zsb, wsb) { - return { - dx: -xsb - multiplier * SQUISH_4D, - dy: -ysb - multiplier * SQUISH_4D, - dz: -zsb - multiplier * SQUISH_4D, - dw: -wsb - multiplier * SQUISH_4D, - xsb: xsb, - ysb: ysb, - zsb: zsb, - wsb: wsb, - }; -} -function makeNoise4D(clientSeed) { - var contributions = []; - for (var i = 0; i < p4D.length; i += 16) { - var baseSet = base4D[p4D[i]]; - var previous = null; - var current = null; - for (var k = 0; k < baseSet.length; k += 5) { - current = contribution4D(baseSet[k], baseSet[k + 1], baseSet[k + 2], baseSet[k + 3], baseSet[k + 4]); - if (previous === null) - contributions[i / 16] = current; - else - previous.next = current; - previous = current; - } - current.next = contribution4D(p4D[i + 1], p4D[i + 2], p4D[i + 3], p4D[i + 4], p4D[i + 5]); - current.next.next = contribution4D(p4D[i + 6], p4D[i + 7], p4D[i + 8], p4D[i + 9], p4D[i + 10]); - current.next.next.next = contribution4D(p4D[i + 11], p4D[i + 12], p4D[i + 13], p4D[i + 14], p4D[i + 15]); - } - var lookup = []; - for (var i = 0; i < lookupPairs4D.length; i += 2) { - lookup[lookupPairs4D[i]] = contributions[lookupPairs4D[i + 1]]; - } - var perm = new Uint8Array(256); - var perm4D = new Uint8Array(256); - var source = new Uint8Array(256); - for (var i = 0; i < 256; i++) - source[i] = i; - var seed = new Uint32Array(1); - seed[0] = clientSeed; - seed = shuffle_seed.default(shuffle_seed.default(shuffle_seed.default(seed))); - for (var i = 255; i >= 0; i--) { - seed = shuffle_seed.default(seed); - var r = new Uint32Array(1); - r[0] = (seed[0] + 31) % (i + 1); - if (r[0] < 0) - r[0] += i + 1; - perm[i] = source[r[0]]; - perm4D[i] = perm[i] & 0xfc; - source[r[0]] = source[i]; - } - return function (x, y, z, w) { - var stretchOffset = (x + y + z + w) * STRETCH_4D; - var xs = x + stretchOffset; - var ys = y + stretchOffset; - var zs = z + stretchOffset; - var ws = w + stretchOffset; - var xsb = Math.floor(xs); - var ysb = Math.floor(ys); - var zsb = Math.floor(zs); - var wsb = Math.floor(ws); - var squishOffset = (xsb + ysb + zsb + wsb) * SQUISH_4D; - var dx0 = x - (xsb + squishOffset); - var dy0 = y - (ysb + squishOffset); - var dz0 = z - (zsb + squishOffset); - var dw0 = w - (wsb + squishOffset); - var xins = xs - xsb; - var yins = ys - ysb; - var zins = zs - zsb; - var wins = ws - wsb; - var inSum = xins + yins + zins + wins; - var hash = (zins - wins + 1) | - ((yins - zins + 1) << 1) | - ((yins - wins + 1) << 2) | - ((xins - yins + 1) << 3) | - ((xins - zins + 1) << 4) | - ((xins - wins + 1) << 5) | - (inSum << 6) | - ((inSum + wins) << 8) | - ((inSum + zins) << 11) | - ((inSum + yins) << 14) | - ((inSum + xins) << 17); - var value = 0; - for (var c = lookup[hash]; c !== undefined; c = c.next) { - var dx = dx0 + c.dx; - var dy = dy0 + c.dy; - var dz = dz0 + c.dz; - var dw = dw0 + c.dw; - var attn = 2 - dx * dx - dy * dy - dz * dz - dw * dw; - if (attn > 0) { - var px = xsb + c.xsb; - var py = ysb + c.ysb; - var pz = zsb + c.zsb; - var pw = wsb + c.wsb; - var indexPartA = perm[px & 0xff]; - var indexPartB = perm[(indexPartA + py) & 0xff]; - var indexPartC = perm[(indexPartB + pz) & 0xff]; - var index = perm4D[(indexPartC + pw) & 0xff]; - var valuePart = gradients4D[index] * dx + - gradients4D[index + 1] * dy + - gradients4D[index + 2] * dz + - gradients4D[index + 3] * dw; - value += attn * attn * attn * attn * valuePart; - } - } - return value * NORM_4D; - }; -} -exports.makeNoise4D = makeNoise4D; -var base4D = [ +exports.NORM_2D = 1.0 / 47.0; +exports.NORM_3D = 1.0 / 103.0; +exports.NORM_4D = 1.0 / 30.0; +exports.SQUISH_2D = (Math.sqrt(2 + 1) - 1) / 2; +exports.SQUISH_3D = (Math.sqrt(3 + 1) - 1) / 3; +exports.SQUISH_4D = (Math.sqrt(4 + 1) - 1) / 4; +exports.STRETCH_2D = (1 / Math.sqrt(2 + 1) - 1) / 2; +exports.STRETCH_3D = (1 / Math.sqrt(3 + 1) - 1) / 3; +exports.STRETCH_4D = (1 / Math.sqrt(4 + 1) - 1) / 4; +exports.base2D = [ + [1, 1, 0, 1, 0, 1, 0, 0, 0], + [1, 1, 0, 1, 0, 1, 2, 1, 1] +]; +exports.base3D = [ + [0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1], + [2, 1, 1, 0, 2, 1, 0, 1, 2, 0, 1, 1, 3, 1, 1, 1], + [1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 2, 1, 1, 0, 2, 1, 0, 1, 2, 0, 1, 1] +]; +exports.base4D = [ [0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1], [3, 1, 1, 1, 0, 3, 1, 1, 0, 1, 3, 1, 0, 1, 1, 3, 0, 1, 1, 1, 4, 1, 1, 1, 1], [ @@ -999,7 +170,7 @@ var base4D = [ 0, 0, 1, - 1, + 1 ], [ 3, @@ -1051,10 +222,102 @@ var base4D = [ 0, 0, 1, - 1, - ], + 1 + ] +]; +exports.gradients2D = [ + 5, + 2, + 2, + 5, + -5, + 2, + -2, + 5, + 5, + -2, + 2, + -5, + -5, + -2, + -2, + -5 +]; +exports.gradients3D = [ + -11, + 4, + 4, + -4, + 11, + 4, + -4, + 4, + 11, + 11, + 4, + 4, + 4, + 11, + 4, + 4, + 4, + 11, + -11, + -4, + 4, + -4, + -11, + 4, + -4, + -4, + 11, + 11, + -4, + 4, + 4, + -11, + 4, + 4, + -4, + 11, + -11, + 4, + -4, + -4, + 11, + -4, + -4, + 4, + -11, + 11, + 4, + -4, + 4, + 11, + -4, + 4, + 4, + -11, + -11, + -4, + -4, + -4, + -11, + -4, + -4, + -4, + -11, + 11, + -4, + -4, + 4, + -11, + -4, + 4, + -4, + -11 ]; -var gradients4D = [ +exports.gradients4D = [ 3, 1, 1, @@ -1310,9 +573,181 @@ var gradients4D = [ -1, -1, -1, - -3, + -3 +]; +exports.lookupPairs2D = [ + 0, + 1, + 1, + 0, + 4, + 1, + 17, + 0, + 20, + 2, + 21, + 2, + 22, + 5, + 23, + 5, + 26, + 4, + 39, + 3, + 42, + 4, + 43, + 3 +]; +exports.lookupPairs3D = [ + 0, + 2, + 1, + 1, + 2, + 2, + 5, + 1, + 6, + 0, + 7, + 0, + 32, + 2, + 34, + 2, + 129, + 1, + 133, + 1, + 160, + 5, + 161, + 5, + 518, + 0, + 519, + 0, + 546, + 4, + 550, + 4, + 645, + 3, + 647, + 3, + 672, + 5, + 673, + 5, + 674, + 4, + 677, + 3, + 678, + 4, + 679, + 3, + 680, + 13, + 681, + 13, + 682, + 12, + 685, + 14, + 686, + 12, + 687, + 14, + 712, + 20, + 714, + 18, + 809, + 21, + 813, + 23, + 840, + 20, + 841, + 21, + 1198, + 19, + 1199, + 22, + 1226, + 18, + 1230, + 19, + 1325, + 23, + 1327, + 22, + 1352, + 15, + 1353, + 17, + 1354, + 15, + 1357, + 17, + 1358, + 16, + 1359, + 16, + 1360, + 11, + 1361, + 10, + 1362, + 11, + 1365, + 10, + 1366, + 9, + 1367, + 9, + 1392, + 11, + 1394, + 11, + 1489, + 10, + 1493, + 10, + 1520, + 8, + 1521, + 8, + 1878, + 9, + 1879, + 9, + 1906, + 7, + 1910, + 7, + 2005, + 6, + 2007, + 6, + 2032, + 8, + 2033, + 8, + 2034, + 7, + 2037, + 6, + 2038, + 7, + 2039, + 6 ]; -var lookupPairs4D = [ +exports.lookupPairs4D = [ 0, 3, 1, @@ -2432,9 +1867,253 @@ var lookupPairs4D = [ 599294, 11, 599295, - 10, + 10 +]; +exports.p2D = [ + 0, + 0, + 1, + -1, + 0, + 0, + -1, + 1, + 0, + 2, + 1, + 1, + 1, + 2, + 2, + 0, + 1, + 2, + 0, + 2, + 1, + 0, + 0, + 0 +]; +exports.p3D = [ + 0, + 0, + 1, + -1, + 0, + 0, + 1, + 0, + -1, + 0, + 0, + -1, + 1, + 0, + 0, + 0, + 1, + -1, + 0, + 0, + -1, + 0, + 1, + 0, + 0, + -1, + 1, + 0, + 2, + 1, + 1, + 0, + 1, + 1, + 1, + -1, + 0, + 2, + 1, + 0, + 1, + 1, + 1, + -1, + 1, + 0, + 2, + 0, + 1, + 1, + 1, + -1, + 1, + 1, + 1, + 3, + 2, + 1, + 0, + 3, + 1, + 2, + 0, + 1, + 3, + 2, + 0, + 1, + 3, + 1, + 0, + 2, + 1, + 3, + 0, + 2, + 1, + 3, + 0, + 1, + 2, + 1, + 1, + 1, + 0, + 0, + 2, + 2, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 2, + 0, + 2, + 0, + 1, + 1, + 0, + 0, + 1, + 2, + 0, + 0, + 2, + 2, + 0, + 0, + 0, + 0, + 1, + 1, + -1, + 1, + 2, + 0, + 0, + 0, + 0, + 1, + -1, + 1, + 1, + 2, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + -1, + 2, + 3, + 1, + 1, + 1, + 2, + 0, + 0, + 2, + 2, + 3, + 1, + 1, + 1, + 2, + 2, + 0, + 0, + 2, + 3, + 1, + 1, + 1, + 2, + 0, + 2, + 0, + 2, + 1, + 1, + -1, + 1, + 2, + 0, + 0, + 2, + 2, + 1, + 1, + -1, + 1, + 2, + 2, + 0, + 0, + 2, + 1, + -1, + 1, + 1, + 2, + 0, + 0, + 2, + 2, + 1, + -1, + 1, + 1, + 2, + 0, + 2, + 0, + 2, + 1, + 1, + 1, + -1, + 2, + 2, + 0, + 0, + 2, + 1, + 1, + 1, + -1, + 2, + 0, + 2, + 0 ]; -var p4D = [ +exports.p4D = [ 0, 0, 1, @@ -3714,29 +3393,332 @@ var p4D = [ -1, 1, 1, - 1, + 1 ]; }); -unwrapExports(_4d); -_4d.makeNoise4D; +unwrapExports(constants); +constants.NORM_2D; +constants.NORM_3D; +constants.NORM_4D; +constants.SQUISH_2D; +constants.SQUISH_3D; +constants.SQUISH_4D; +constants.STRETCH_2D; +constants.STRETCH_3D; +constants.STRETCH_4D; +constants.base2D; +constants.base3D; +constants.base4D; +constants.gradients2D; +constants.gradients3D; +constants.gradients4D; +constants.lookupPairs2D; +constants.lookupPairs3D; +constants.lookupPairs4D; +constants.p2D; +constants.p3D; +constants.p4D; -var mod = createCommonjsModule(function (module, exports) { -// This is free and unencumbered software released into the public domain +var lib = createCommonjsModule(function (module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); -exports.makeNoise4D = exports.makeNoise3D = exports.makeNoise2D = void 0; - -Object.defineProperty(exports, "makeNoise2D", { enumerable: true, get: function () { return _2d.makeNoise2D; } }); -Object.defineProperty(exports, "makeNoise3D", { enumerable: true, get: function () { return _3d.makeNoise3D; } }); - -Object.defineProperty(exports, "makeNoise4D", { enumerable: true, get: function () { return _4d.makeNoise4D; } }); +function contribution2D(multiplier, xsb, ysb) { + return { + dx: -xsb - multiplier * constants.SQUISH_2D, + dy: -ysb - multiplier * constants.SQUISH_2D, + xsb: xsb, + ysb: ysb + }; +} +function contribution3D(multiplier, xsb, ysb, zsb) { + return { + dx: -xsb - multiplier * constants.SQUISH_3D, + dy: -ysb - multiplier * constants.SQUISH_3D, + dz: -zsb - multiplier * constants.SQUISH_3D, + xsb: xsb, + ysb: ysb, + zsb: zsb + }; +} +function contribution4D(multiplier, xsb, ysb, zsb, wsb) { + return { + dx: -xsb - multiplier * constants.SQUISH_4D, + dy: -ysb - multiplier * constants.SQUISH_4D, + dz: -zsb - multiplier * constants.SQUISH_4D, + dw: -wsb - multiplier * constants.SQUISH_4D, + xsb: xsb, + ysb: ysb, + zsb: zsb, + wsb: wsb + }; +} +function makeNoise2D(clientSeed) { + var contributions = []; + for (var i = 0; i < constants.p2D.length; i += 4) { + var baseSet = constants.base2D[constants.p2D[i]]; + var previous = null; + var current = null; + for (var k = 0; k < baseSet.length; k += 3) { + current = contribution2D(baseSet[k], baseSet[k + 1], baseSet[k + 2]); + if (previous === null) + contributions[i / 4] = current; + else + previous.next = current; + previous = current; + } + current.next = contribution2D(constants.p2D[i + 1], constants.p2D[i + 2], constants.p2D[i + 3]); + } + var lookup = []; + for (var i = 0; i < constants.lookupPairs2D.length; i += 2) { + lookup[constants.lookupPairs2D[i]] = contributions[constants.lookupPairs2D[i + 1]]; + } + var perm = new Uint8Array(256); + var perm2D = new Uint8Array(256); + var source = new Uint8Array(256); + for (var i = 0; i < 256; i++) + source[i] = i; + var seed = new Uint32Array(1); + seed[0] = clientSeed; + seed = shuffleSeed(shuffleSeed(shuffleSeed(seed))); + for (var i = 255; i >= 0; i--) { + seed = shuffleSeed(seed); + var r = new Uint32Array(1); + r[0] = (seed[0] + 31) % (i + 1); + if (r[0] < 0) + r[0] += i + 1; + perm[i] = source[r[0]]; + perm2D[i] = perm[i] & 0x0e; + source[r[0]] = source[i]; + } + return function (x, y) { + var stretchOffset = (x + y) * constants.STRETCH_2D; + var xs = x + stretchOffset; + var ys = y + stretchOffset; + var xsb = Math.floor(xs); + var ysb = Math.floor(ys); + var squishOffset = (xsb + ysb) * constants.SQUISH_2D; + var dx0 = x - (xsb + squishOffset); + var dy0 = y - (ysb + squishOffset); + var xins = xs - xsb; + var yins = ys - ysb; + var inSum = xins + yins; + var hash = (xins - yins + 1) | + (inSum << 1) | + ((inSum + yins) << 2) | + ((inSum + xins) << 4); + var value = 0; + for (var c = lookup[hash]; c !== undefined; c = c.next) { + var dx = dx0 + c.dx; + var dy = dy0 + c.dy; + var attn = 2 - dx * dx - dy * dy; + if (attn > 0) { + var px = xsb + c.xsb; + var py = ysb + c.ysb; + var indexPartA = perm[px & 0xff]; + var index = perm2D[(indexPartA + py) & 0xff]; + var valuePart = constants.gradients2D[index] * dx + constants.gradients2D[index + 1] * dy; + value += attn * attn * attn * attn * valuePart; + } + } + return value * constants.NORM_2D; + }; +} +exports.makeNoise2D = makeNoise2D; +function makeNoise3D(clientSeed) { + var contributions = []; + for (var i = 0; i < constants.p3D.length; i += 9) { + var baseSet = constants.base3D[constants.p3D[i]]; + var previous = null; + var current = null; + for (var k = 0; k < baseSet.length; k += 4) { + current = contribution3D(baseSet[k], baseSet[k + 1], baseSet[k + 2], baseSet[k + 3]); + if (previous === null) + contributions[i / 9] = current; + else + previous.next = current; + previous = current; + } + current.next = contribution3D(constants.p3D[i + 1], constants.p3D[i + 2], constants.p3D[i + 3], constants.p3D[i + 4]); + current.next.next = contribution3D(constants.p3D[i + 5], constants.p3D[i + 6], constants.p3D[i + 7], constants.p3D[i + 8]); + } + var lookup = []; + for (var i = 0; i < constants.lookupPairs3D.length; i += 2) { + lookup[constants.lookupPairs3D[i]] = contributions[constants.lookupPairs3D[i + 1]]; + } + var perm = new Uint8Array(256); + var perm3D = new Uint8Array(256); + var source = new Uint8Array(256); + for (var i = 0; i < 256; i++) + source[i] = i; + var seed = new Uint32Array(1); + seed[0] = clientSeed; + seed = shuffleSeed(shuffleSeed(shuffleSeed(seed))); + for (var i = 255; i >= 0; i--) { + seed = shuffleSeed(seed); + var r = new Uint32Array(1); + r[0] = (seed[0] + 31) % (i + 1); + if (r[0] < 0) + r[0] += i + 1; + perm[i] = source[r[0]]; + perm3D[i] = (perm[i] % 24) * 3; + source[r[0]] = source[i]; + } + return function (x, y, z) { + var stretchOffset = (x + y + z) * constants.STRETCH_3D; + var xs = x + stretchOffset; + var ys = y + stretchOffset; + var zs = z + stretchOffset; + var xsb = Math.floor(xs); + var ysb = Math.floor(ys); + var zsb = Math.floor(zs); + var squishOffset = (xsb + ysb + zsb) * constants.SQUISH_3D; + var dx0 = x - (xsb + squishOffset); + var dy0 = y - (ysb + squishOffset); + var dz0 = z - (zsb + squishOffset); + var xins = xs - xsb; + var yins = ys - ysb; + var zins = zs - zsb; + var inSum = xins + yins + zins; + var hash = (yins - zins + 1) | + ((xins - yins + 1) << 1) | + ((xins - zins + 1) << 2) | + (inSum << 3) | + ((inSum + zins) << 5) | + ((inSum + yins) << 7) | + ((inSum + xins) << 9); + var value = 0; + for (var c = lookup[hash]; c !== undefined; c = c.next) { + var dx = dx0 + c.dx; + var dy = dy0 + c.dy; + var dz = dz0 + c.dz; + var attn = 2 - dx * dx - dy * dy - dz * dz; + if (attn > 0) { + var px = xsb + c.xsb; + var py = ysb + c.ysb; + var pz = zsb + c.zsb; + var indexPartA = perm[px & 0xff]; + var indexPartB = perm[(indexPartA + py) & 0xff]; + var index = perm3D[(indexPartB + pz) & 0xff]; + var valuePart = constants.gradients3D[index] * dx + + constants.gradients3D[index + 1] * dy + + constants.gradients3D[index + 2] * dz; + value += attn * attn * attn * attn * valuePart; + } + } + return value * constants.NORM_3D; + }; +} +exports.makeNoise3D = makeNoise3D; +function makeNoise4D(clientSeed) { + var contributions = []; + for (var i = 0; i < constants.p4D.length; i += 16) { + var baseSet = constants.base4D[constants.p4D[i]]; + var previous = null; + var current = null; + for (var k = 0; k < baseSet.length; k += 5) { + current = contribution4D(baseSet[k], baseSet[k + 1], baseSet[k + 2], baseSet[k + 3], baseSet[k + 4]); + if (previous === null) + contributions[i / 16] = current; + else + previous.next = current; + previous = current; + } + current.next = contribution4D(constants.p4D[i + 1], constants.p4D[i + 2], constants.p4D[i + 3], constants.p4D[i + 4], constants.p4D[i + 5]); + current.next.next = contribution4D(constants.p4D[i + 6], constants.p4D[i + 7], constants.p4D[i + 8], constants.p4D[i + 9], constants.p4D[i + 10]); + current.next.next.next = contribution4D(constants.p4D[i + 11], constants.p4D[i + 12], constants.p4D[i + 13], constants.p4D[i + 14], constants.p4D[i + 15]); + } + var lookup = []; + for (var i = 0; i < constants.lookupPairs4D.length; i += 2) { + lookup[constants.lookupPairs4D[i]] = contributions[constants.lookupPairs4D[i + 1]]; + } + var perm = new Uint8Array(256); + var perm4D = new Uint8Array(256); + var source = new Uint8Array(256); + for (var i = 0; i < 256; i++) + source[i] = i; + var seed = new Uint32Array(1); + seed[0] = clientSeed; + seed = shuffleSeed(shuffleSeed(shuffleSeed(seed))); + for (var i = 255; i >= 0; i--) { + seed = shuffleSeed(seed); + var r = new Uint32Array(1); + r[0] = (seed[0] + 31) % (i + 1); + if (r[0] < 0) + r[0] += i + 1; + perm[i] = source[r[0]]; + perm4D[i] = perm[i] & 0xfc; + source[r[0]] = source[i]; + } + return function (x, y, z, w) { + var stretchOffset = (x + y + z + w) * constants.STRETCH_4D; + var xs = x + stretchOffset; + var ys = y + stretchOffset; + var zs = z + stretchOffset; + var ws = w + stretchOffset; + var xsb = Math.floor(xs); + var ysb = Math.floor(ys); + var zsb = Math.floor(zs); + var wsb = Math.floor(ws); + var squishOffset = (xsb + ysb + zsb + wsb) * constants.SQUISH_4D; + var dx0 = x - (xsb + squishOffset); + var dy0 = y - (ysb + squishOffset); + var dz0 = z - (zsb + squishOffset); + var dw0 = w - (wsb + squishOffset); + var xins = xs - xsb; + var yins = ys - ysb; + var zins = zs - zsb; + var wins = ws - wsb; + var inSum = xins + yins + zins + wins; + var hash = (zins - wins + 1) | + ((yins - zins + 1) << 1) | + ((yins - wins + 1) << 2) | + ((xins - yins + 1) << 3) | + ((xins - zins + 1) << 4) | + ((xins - wins + 1) << 5) | + (inSum << 6) | + ((inSum + wins) << 8) | + ((inSum + zins) << 11) | + ((inSum + yins) << 14) | + ((inSum + xins) << 17); + var value = 0; + for (var c = lookup[hash]; c !== undefined; c = c.next) { + var dx = dx0 + c.dx; + var dy = dy0 + c.dy; + var dz = dz0 + c.dz; + var dw = dw0 + c.dw; + var attn = 2 - dx * dx - dy * dy - dz * dz - dw * dw; + if (attn > 0) { + var px = xsb + c.xsb; + var py = ysb + c.ysb; + var pz = zsb + c.zsb; + var pw = wsb + c.wsb; + var indexPartA = perm[px & 0xff]; + var indexPartB = perm[(indexPartA + py) & 0xff]; + var indexPartC = perm[(indexPartB + pz) & 0xff]; + var index = perm4D[(indexPartC + pw) & 0xff]; + var valuePart = constants.gradients4D[index] * dx + + constants.gradients4D[index + 1] * dy + + constants.gradients4D[index + 2] * dz + + constants.gradients4D[index + 3] * dw; + value += attn * attn * attn * attn * valuePart; + } + } + return value * constants.NORM_4D; + }; +} +exports.makeNoise4D = makeNoise4D; +function shuffleSeed(seed) { + var newSeed = new Uint32Array(1); + newSeed[0] = seed[0] * 1664525 + 1013904223; + return newSeed; +} }); -var OpenSimplexNoise = unwrapExports(mod); -mod.makeNoise4D; -mod.makeNoise3D; -mod.makeNoise2D; +var OpenSimplexNoise = unwrapExports(lib); +lib.makeNoise2D; +lib.makeNoise3D; +lib.makeNoise4D; const Noise = (seed = 0) => { const generator = OpenSimplexNoise.makeNoise3D(seed); diff --git a/dist/jsxcad-api-v1-shape.js b/dist/jsxcad-api-v1-shape.js index 429057ab..ff8bcdb4 100644 --- a/dist/jsxcad-api-v1-shape.js +++ b/dist/jsxcad-api-v1-shape.js @@ -1,13 +1,13 @@ -import { closePath, concatenatePath, taggedAssembly, eachPoint, flip, toConcreteGeometry, toDisplayGeometry, toTransformedGeometry, toPoints, transform, rewriteTags, taggedPaths, taggedGraph, openPath, taggedPoints, fromPolygonsToGraph, registerReifier, union, taggedLayers, bend as bend$1, intersection, allTags, difference, getLeafs, empty, grow as grow$1, inset as inset$1, rewrite, minkowskiDifference as minkowskiDifference$1, minkowskiShell as minkowskiShell$1, minkowskiSum as minkowskiSum$1, isVoid, offset as offset$1, taggedItem, taggedDisjointAssembly, toDisjointGeometry, push as push$1, getPeg, taggedPlan, remesh as remesh$1, smooth as smooth$1, measureBoundingBox, taggedSketch, test as test$1, twist as twist$1, toPolygonsWithHoles, arrangePolygonsWithHoles, fromPolygonsWithHolesToTriangles, fromTrianglesToGraph, taggedGroup, read, write, realize } from './jsxcad-geometry.js'; +import { normalize, subtract, dot, cross, negate, scale as scale$1, add as add$1, distance } from './jsxcad-math-vec3.js'; +import { closePath, concatenatePath, assemble as assemble$1, eachPoint, flip, toConcreteGeometry, toDisplayGeometry, toTransformedGeometry, toPoints, transform, rewriteTags, taggedPaths, taggedGraph, openPath, taggedPoints, fromPolygonsToGraph, registerReifier, read, write, realize, rewrite, loft as loft$1, minkowskiDifference as minkowskiDifference$1, minkowskiShell as minkowskiShell$1, minkowskiSum as minkowskiSum$1, isVoid, taggedGroup, offset as offset$1, getLeafs, taggedItem, toDisjointGeometry, push as push$1, getPeg, taggedPlan, remesh as remesh$1, smooth as smooth$1, measureBoundingBox, taggedSketch, split as split$1, allTags, test as test$1, twist as twist$1, toPolygonsWithHoles, arrangePolygonsWithHoles, fromPolygonsWithHolesToTriangles, fromTrianglesToGraph, union, bend as bend$1, intersection, difference, empty, inset as inset$1, grow as grow$1 } from './jsxcad-geometry.js'; import { identityMatrix, fromTranslation, fromRotation, fromScaling } from './jsxcad-math-mat4.js'; -import { add as add$1, negate, normalize, subtract, dot, cross, scale as scale$1, distance } from './jsxcad-math-vec3.js'; -import { toTagsFromName } from './jsxcad-algorithm-color.js'; -import { toTagsFromName as toTagsFromName$1 } from './jsxcad-algorithm-material.js'; +import { emit, addPending, writeFile, log as log$1 } from './jsxcad-sys.js'; +import { toTagsFromName } from './jsxcad-algorithm-material.js'; import { pack as pack$1 } from './jsxcad-algorithm-pack.js'; import { fromPoints, toXYPlaneTransforms } from './jsxcad-math-plane.js'; -import { emit, addPending, writeFile, log as log$1 } from './jsxcad-sys.js'; import { fromRotateXToTransform, fromRotateYToTransform, fromRotateZToTransform } from './jsxcad-algorithm-cgal.js'; -import { toTagsFromName as toTagsFromName$2 } from './jsxcad-algorithm-tool.js'; +import { toTagsFromName as toTagsFromName$1 } from './jsxcad-algorithm-tool.js'; +import { toTagsFromName as toTagsFromName$2 } from './jsxcad-algorithm-color.js'; class Shape { close() { @@ -34,7 +34,7 @@ class Shape { return Shape.fromOpenPath(concatenatePath(...paths)); } - constructor(geometry = taggedAssembly({}), context) { + constructor(geometry = assemble$1(), context) { if (geometry.geometry) { throw Error('die: { geometry: ... } is not valid geometry.'); } @@ -107,6 +107,8 @@ class Shape { const isSingleOpenPath = ({ paths }) => paths !== undefined && paths.length === 1 && paths[0][0] === null; +Shape.method = {}; + const registerShapeMethod = (name, op) => { /* // FIX: See if we can switch these to dispatching via define? @@ -114,9 +116,12 @@ const registerShapeMethod = (name, op) => { throw Error(`Method ${name} is already in use.`); } */ + // Make the operation constructor available e.g., Shape.grow(1)(s) + Shape[name] = op; + // Make the operation application available e.g., s.grow(1) const { [name]: method } = { [name]: function (...args) { - return op(this, ...args); + return op(...args)(this); }, }; Shape.prototype[name] = method; @@ -148,310 +153,186 @@ Shape.reifier = (name, op) => registerReifier(name, op); const fromGeometry = Shape.fromGeometry; const toGeometry = (shape) => shape.toGeometry(); -const add = (shape, ...shapes) => - Shape.fromGeometry( - union(shape.toGeometry(), ...shapes.map((shape) => shape.toGeometry())) - ); +const orient$1 = + ({ + center = [0, 0, 0], + facing = [0, 0, 1], + at = [0, 0, 0], + from = [0, 0, 0], + }) => + (shape) => { + const normalizedFacing = normalize(facing); + const normalizedAt = normalize(subtract(at, from)); + + const angle = + (Math.acos(dot(normalizedFacing, normalizedAt)) * 180) / Math.PI; + const axis = normalize(cross(normalizedFacing, normalizedAt)); + + return shape + .move(...negate(center)) + .rotate(angle, axis) + .move(...from); + }; -const addMethod = function (...shapes) { - return add(this, ...shapes); -}; -Shape.prototype.add = addMethod; +Shape.registerMethod('orient', orient$1); -const and = (...shapes) => - Shape.fromGeometry( - taggedLayers({}, ...shapes.map((shape) => shape.toGeometry())) - ); +const prepareShape = (shape, name, options = {}) => { + let index = 0; + const entries = []; + entries.push({ + data: new TextEncoder('utf8').encode(JSON.stringify(shape)), + filename: `${name}_${index++}.jsxcad`, + type: 'application/x-jsxcad', + }); + return entries; +}; -const andMethod = function (...shapes) { - return and(this, ...shapes); +const downloadShapeMethod = function (...args) { + const entries = prepareShape(this, ...args); + emit({ download: { entries } }); + return this; }; -Shape.prototype.and = andMethod; +Shape.prototype.downloadShape = downloadShapeMethod; -const addToMethod = function (shape) { - return add(shape, this); +const writeShape = (shape, name, options = {}) => { + for (const { data, filename } of prepareShape(shape, name, {})) { + addPending(writeFile({ doSerialize: false }, `output/${filename}`, data)); + } + return shape; }; -Shape.prototype.addTo = addToMethod; -const X$1 = 0; -const Y$1 = 1; -const Z$1 = 2; +const writeShapeMethod = function (...args) { + return writeShape(this, ...args); +}; +Shape.prototype.writeShape = writeShapeMethod; -const align = (shape, spec = 'xyz', origin = [0, 0, 0]) => - shape.size(({ max, min, center }, shape) => { - const offset = [0, 0, 0]; - - let index = 0; - while (index < spec.length) { - switch (spec[index++]) { - case 'x': { - switch (spec[index]) { - case '>': - offset[X$1] = -min[X$1]; - index += 1; - break; - case '<': - offset[X$1] = -max[X$1]; - index += 1; - break; - default: - offset[X$1] = -center[X$1]; - } - break; - } - case 'y': { - switch (spec[index]) { - case '>': - offset[Y$1] = -min[Y$1]; - index += 1; - break; - case '<': - offset[Y$1] = -max[Y$1]; - index += 1; - break; - default: - offset[Y$1] = -center[Y$1]; - } - break; - } - case 'z': { - switch (spec[index]) { - case '>': - offset[Z$1] = -min[Z$1]; - index += 1; - break; - case '<': - offset[Z$1] = -max[Z$1]; - index += 1; - break; - default: - offset[Z$1] = -center[Z$1]; - } - break; - } - } - } - const moved = shape.move(...add$1(offset, origin)); - return moved; - }); +const fromUndefined = () => Shape.fromGeometry(); -const alignMethod = function (spec, origin) { - return align(this, spec, origin); +const loadGeometry = async ( + path, + { otherwise = fromUndefined } = {} +) => { + const data = await read(path); + if (data === undefined) { + return otherwise(); + } else { + return Shape.fromGeometry(data); + } }; -Shape.prototype.align = alignMethod; -/** - * - * # As - * - * Produces a version of a shape with user defined tags. - * - * ::: illustration - * ``` - * Circle(10).as('A') - * ``` - * ::: - * - **/ +const saveGeometry = async (path, shape) => + Shape.fromGeometry(await write(shape.toGeometry(), path)); -const as = (shape, tags) => - Shape.fromGeometry( - rewriteTags( - tags.map((tag) => `user/${tag}`), - [], - shape.toGeometry() - ) - ); +function pad (hash, len) { + while (hash.length < len) { + hash = '0' + hash; + } + return hash; +} -const notAs = (shape, tags) => - Shape.fromGeometry( - rewriteTags( - [], - tags.map((tag) => `user/${tag}`), - shape.toGeometry() - ) - ); +function fold (hash, text) { + var i; + var chr; + var len; + if (text.length === 0) { + return hash; + } + for (i = 0, len = text.length; i < len; i++) { + chr = text.charCodeAt(i); + hash = ((hash << 5) - hash) + chr; + hash |= 0; + } + return hash < 0 ? hash * -2 : hash; +} -const asMethod = function (...tags) { - return as(this, tags); -}; -const notAsMethod = function (...tags) { - return notAs(this, tags); -}; +function foldObject (hash, o, seen) { + return Object.keys(o).sort().reduce(foldKey, hash); + function foldKey (hash, key) { + return foldValue(hash, o[key], key, seen); + } +} -Shape.prototype.as = asMethod; -Shape.prototype.notAs = notAsMethod; +function foldValue (input, value, key, seen) { + var hash = fold(fold(fold(input, key), toString(value)), typeof value); + if (value === null) { + return fold(hash, 'null'); + } + if (value === undefined) { + return fold(hash, 'undefined'); + } + if (typeof value === 'object' || typeof value === 'function') { + if (seen.indexOf(value) !== -1) { + return fold(hash, '[Circular]' + key); + } + seen.push(value); -const bend = (shape, degreesPerMm = 1) => - Shape.fromGeometry(bend$1(shape.toGeometry(), degreesPerMm)); + var objHash = foldObject(hash, value, seen); -Shape.registerMethod('bend', bend); + if (!('valueOf' in value) || typeof value.valueOf !== 'function') { + return objHash; + } -const clip = (shape, ...shapes) => - Shape.fromGeometry( - intersection( - shape.toGeometry(), - ...shapes.map((shape) => shape.toGeometry()) - ) - ); + try { + return fold(objHash, String(value.valueOf())) + } catch (err) { + return fold(objHash, '[valueOf exception]' + (err.stack || err.message)) + } + } + return fold(hash, value.toString()); +} -const clipMethod = function (...shapes) { - return clip(this, ...shapes); -}; -Shape.prototype.clip = clipMethod; +function toString (o) { + return Object.prototype.toString.call(o); +} -const clipFromMethod = function (shape) { - return clip(shape, this); -}; -Shape.prototype.clipFrom = clipFromMethod; +function sum (o) { + return pad(foldValue(0, o, '', []).toString(16), 8); +} + +var hashSum = sum; /** * - * # Color + * # Log * - * Produces a version of a shape the given color. - * FIX: Support color in convert/threejs/toSvg. + * Writes a string to the console. * - * ::: illustration - * ``` - * Circle(10).color('blue') * ``` - * ::: - * ::: illustration - * ``` - * Triangle(10).color('chartreuse') + * log("Hello, World") * ``` - * ::: * **/ -const fromName = (shape, name) => - Shape.fromGeometry(rewriteTags(toTagsFromName(name), [], shape.toGeometry())); - -const color = (...args) => fromName(...args); - -const colorMethod = function (...args) { - return color(this, ...args); -}; -Shape.prototype.color = colorMethod; - -const colors = (shape, op = (colors, shape) => colors) => - op( - [...allTags(shape.toGeometry())] - .filter((tag) => tag.startsWith('color/')) - .map((tag) => tag.substring(6)), - shape - ); - -const colorsMethod = function (op) { - return colors(this, op); +const toText = (value) => { + if (typeof value === 'object') { + return JSON.stringify(value); + } else { + return String(value); + } }; -Shape.prototype.colors = colorsMethod; - -const cut = (shape, ...shapes) => - Shape.fromGeometry( - difference(shape.toGeometry(), ...shapes.map((shape) => shape.toGeometry())) - ); -const cutMethod = function (...shapes) { - return cut(this, ...shapes); +const log = (value, level) => { + const text = toText(value); + const log = { text, level }; + const hash = hashSum(log); + emit({ log, hash }); + return log$1({ op: 'text', text, level }); }; -Shape.prototype.cut = cutMethod; - -// a.cut(b) === b.cutFrom(a) -const cutFromMethod = function (shape) { - return cut(shape, this); +const logOp = (shape, op) => { + const text = String(op(shape)); + const level = 'serious'; + const log = { text, level }; + const hash = hashSum(log); + emit({ log, hash }); + return log$1({ op: 'text', text }); }; -Shape.prototype.cutFrom = cutFromMethod; -const doMethod = function (op, ...args) { - op(this, ...args); +const logMethod = function (op = (shape) => JSON.stringify(shape)) { + logOp(Shape.fromGeometry(realize(this.toGeometry())), op); return this; }; - -Shape.prototype.do = doMethod; - -const each = (shape, op = (leafs, shape) => leafs) => - op( - getLeafs(shape.toDisjointGeometry()).map((leaf) => - Shape.fromGeometry(leaf) - ), - shape - ); - -const eachMethod = function (op) { - return each(this, op); -}; - -Shape.prototype.each = eachMethod; - -const fuse = (shape) => { - const geometry = shape.toGeometry(); - return fromGeometry(union(empty({ tags: geometry.tags }), geometry)); -}; - -const fuseMethod = function (...shapes) { - return fuse(this); -}; -Shape.prototype.fuse = fuseMethod; - -const grow = (shape, amount) => - Shape.fromGeometry(grow$1(shape.toGeometry(), amount)); - -Shape.registerMethod('grow', grow); - -const inset = (shape, initial = 1, step, limit) => - Shape.fromGeometry(inset$1(shape.toGeometry(), initial, step, limit)); - -const insetMethod = function (initial, step, limit) { - return inset(this, initial, step, limit); -}; - -Shape.prototype.inset = insetMethod; - -// CHECK: Using 'with' for may be confusing, but andInset looks odd. -const withInsetMethod = function (initial, step, limit) { - return this.group(inset(this, initial, step, limit)); -}; - -Shape.prototype.withInset = withInsetMethod; - -/** - * - * # Keep in assembly - * - * Generates an assembly from components in an assembly with a tag. - * - * ::: illustration - * ``` - * assemble(Circle(10).as('A'), - * Square(10).as('B')) - * ``` - * ::: - * ::: illustration - * ``` - * assemble(Circle(10).as('A'), - * Square(10).as('B')) - * .keep('A') - * ``` - * ::: - * ::: illustration - * ``` - * assemble(Circle(10).as('A'), - * Square(10).as('B')) - * .keep('B') - * ``` - * ::: - * ::: illustration - * ``` - * assemble(Circle(10).as('A'), - * Square(10).as('B')) - * .keep('A', 'B') - * ``` - * ::: - * - **/ +Shape.prototype.log = logMethod; const selectToKeep = (matchTags, geometryTags) => { if (geometryTags === undefined) { @@ -510,103 +391,102 @@ const keepOrDrop = (shape, tags, select) => { return Shape.fromGeometry(rewritten); }; -const keep = (shape, tags) => { - if (tags === undefined) { - // Dropping no tags is an unconditional keep. - return keepOrDrop(shape, [], selectToDrop); - } else { - return keepOrDrop(shape, tags, selectToKeep); - } -}; +const keep = + (...tags) => + (shape) => { + if (tags === undefined) { + // Dropping no tags is an unconditional keep. + return keepOrDrop(shape, [], selectToDrop); + } else { + return keepOrDrop(shape, tags, selectToKeep); + } + }; -const drop = (shape, tags) => { - if (tags === undefined) { - // Keeping no tags is an unconditional drop. - return keepOrDrop(shape, [], selectToKeep); - } else { - return keepOrDrop(shape, tags, selectToDrop); - } -}; +const drop = + (...tags) => + (shape) => { + if (tags === undefined) { + // Keeping no tags is an unconditional drop. + return keepOrDrop(shape, [], selectToKeep); + } else { + return keepOrDrop(shape, tags, selectToDrop); + } + }; -const keepMethod = function (...tags) { - return keep(this, tags); -}; -Shape.prototype.keep = keepMethod; +Shape.registerMethod('keep', keep); +Shape.registerMethod('drop', drop); + +const loft = + (...ops) => + (shape) => + Shape.fromGeometry( + loft$1( + /* closed= */ false, + ...ops.map((op) => op(shape).toGeometry()) + ) + ); -const dropMethod = function (...tags) { - return drop(this, tags); -}; -Shape.prototype.drop = dropMethod; +Shape.registerMethod('loft', loft); -/** - * - * # Material - * - * Produces a version of a shape with a given material. - * - * Materials supported include 'paper', 'metal', 'glass', etc. - * - * ::: illustration - * ``` - * Cylinder(5, 10).material('copper') - * ``` - * ::: - * - **/ +const loop = + (...ops) => + (shape) => + Shape.fromGeometry( + loft$1( + /* closed= */ true, + ...ops.map((op) => op(shape).toGeometry()) + ) + ); -const material = (shape, name) => - Shape.fromGeometry(rewriteTags(toTagsFromName$1(name), [], shape.toGeometry())); +Shape.registerMethod('loop', loop); -const materialMethod = function (name) { - return material(this, name); -}; -Shape.prototype.material = materialMethod; +const material = (name) => (shape) => + Shape.fromGeometry(rewriteTags(toTagsFromName(name), [], shape.toGeometry())); + +Shape.registerMethod('material', material); -const minkowskiDifference = (shape, offset) => +const minkowskiDifference = (offset) => (shape) => Shape.fromGeometry( minkowskiDifference$1(shape.toGeometry(), offset.toGeometry()) ); Shape.registerMethod('minkowskiDifference', minkowskiDifference); -const minkowskiShell = (shape, offset) => +const minkowskiShell = (offset) => (shape) => Shape.fromGeometry( minkowskiShell$1(shape.toGeometry(), offset.toGeometry()) ); Shape.registerMethod('minkowskiShell', minkowskiShell); -const minkowskiSum = (shape, offset) => +const minkowskiSum = (offset) => (shape) => Shape.fromGeometry( minkowskiSum$1(shape.toGeometry(), offset.toGeometry()) ); Shape.registerMethod('minkowskiSum', minkowskiSum); -const move = (shape, x = 0, y = 0, z = 0) => { - if (!isFinite(x)) { - x = 0; - } - if (!isFinite(y)) { - y = 0; - } - if (!isFinite(z)) { - z = 0; - } - return shape.transform(fromTranslation([x, y, z])); -}; +const move = + (x = 0, y = 0, z = 0) => + (shape) => { + if (!isFinite(x)) { + x = 0; + } + if (!isFinite(y)) { + y = 0; + } + if (!isFinite(z)) { + z = 0; + } + return shape.transform(fromTranslation([x, y, z])); + }; -const moveMethod = function (...params) { - return move(this, ...params); -}; -Shape.prototype.move = moveMethod; -Shape.prototype.xyz = moveMethod; -Shape.prototype.xy = moveMethod; +Shape.registerMethod('move', move); -const noVoid = (shape, tags, select) => { +const noVoid = (tags, select) => (shape) => { const op = (geometry, descend) => { if (isVoid(geometry)) { - return taggedLayers({}); + return taggedGroup({}); } else { return descend(); } @@ -616,160 +496,84 @@ const noVoid = (shape, tags, select) => { return Shape.fromGeometry(rewritten); }; -const noVoidMethod = function (...tags) { - return noVoid(this); -}; +Shape.registerMethod('noVoid', noVoid); -Shape.prototype.noVoid = noVoidMethod; - -const offset = (shape, initial = 1, step, limit) => - Shape.fromGeometry(offset$1(shape.toGeometry(), initial, step, limit)); - -const offsetMethod = function (initial, step, limit) { - return offset(this, initial, step, limit); -}; - -Shape.prototype.offset = offsetMethod; - -const assemble = (...shapes) => { - shapes = shapes.filter((shape) => shape !== undefined); - switch (shapes.length) { - case 0: { - return Shape.fromGeometry(taggedAssembly({})); - } - case 1: { - return shapes[0]; - } - default: { - return fromGeometry(taggedAssembly({}, ...shapes.map(toGeometry))); - } - } -}; - -const opMethod = function (op, ...args) { - return op(this, ...args); -}; -const withOpMethod = function (op, ...args) { - return assemble(this, op(this, ...args)); -}; - -Shape.prototype.op = opMethod; -Shape.prototype.withOp = withOpMethod; - -/** - * - * # Orient - * - * Orients a shape so that it moves from 'center' to 'from' and faces toward 'at', rather than 'facing'. - * - * ::: illustration { "view": { "position": [40, 40, 40] } } - * ``` - * Square(10) - * ``` - * ::: - * ::: illustration { "view": { "position": [40, 40, 40] } } - * ``` - * Square(10).orient({ from: [3, 3, 3], at: [1, 1, 1] }); - * ``` - * ::: - **/ +const offset = + (initial = 1, step, limit) => + (shape) => + Shape.fromGeometry( + offset$1(shape.toGeometry(), initial, step, limit) + ); -const orient$1 = ( - shape, - { center = [0, 0, 0], facing = [0, 0, 1], at = [0, 0, 0], from = [0, 0, 0] } -) => { - const normalizedFacing = normalize(facing); - const normalizedAt = normalize(subtract(at, from)); +Shape.registerMethod('offset', offset); - const angle = - (Math.acos(dot(normalizedFacing, normalizedAt)) * 180) / Math.PI; - const axis = normalize(cross(normalizedFacing, normalizedAt)); +const op = (fn) => (shape) => fn(shape); - return shape - .move(...negate(center)) - .rotate(angle, axis) - .move(...from); -}; +const withOp = (fn) => (shape) => shape.with(fn(shape)); -const orientMethod = function (...args) { - return orient$1(this, ...args); -}; -Shape.prototype.orient = orientMethod; +Shape.registerMethod('op', op); +Shape.registerMethod('withOp', withOp); -const pack = ( - shape, - { +const pack = + ({ size, pageMargin = 5, itemMargin = 1, perLayout = Infinity, packSize = [], - } = {} -) => { - if (perLayout === 0) { - // Packing was disabled -- do nothing. - return shape; - } + } = {}) => + (shape) => { + if (perLayout === 0) { + // Packing was disabled -- do nothing. + return shape; + } - let todo = []; - for (const leaf of getLeafs(shape.toKeptGeometry())) { - todo.push(leaf); - } - const packedLayers = []; - while (todo.length > 0) { - const input = []; - while (todo.length > 0 && input.length < perLayout) { - input.push(todo.shift()); + let todo = []; + for (const leaf of getLeafs(shape.toKeptGeometry())) { + todo.push(leaf); } - const [packed, unpacked, minPoint, maxPoint] = pack$1( - { size, pageMargin, itemMargin }, - ...input - ); - packSize[0] = minPoint; - packSize[1] = maxPoint; - if (packed.length === 0) { - break; - } else { - packedLayers.push( - taggedItem( - {}, - taggedDisjointAssembly({}, ...packed.map(toDisjointGeometry)) - ) + const packedLayers = []; + while (todo.length > 0) { + const input = []; + while (todo.length > 0 && input.length < perLayout) { + input.push(todo.shift()); + } + const [packed, unpacked, minPoint, maxPoint] = pack$1( + { size, pageMargin, itemMargin }, + ...input ); + packSize[0] = minPoint; + packSize[1] = maxPoint; + if (packed.length === 0) { + break; + } else { + packedLayers.push( + taggedItem({}, taggedGroup({}, ...packed.map(toDisjointGeometry))) + ); + } + todo.unshift(...unpacked); } - todo.unshift(...unpacked); - } - let packedShape = Shape.fromGeometry(taggedLayers({}, ...packedLayers)); - if (size === undefined) { - packedShape = packedShape.align('xy'); - } - return packedShape; -}; - -const packMethod = function (...args) { - return pack(this, ...args); -}; -Shape.prototype.pack = packMethod; - -const push = ( - shape, - force = 0.1, - minimumDistance = 1, - maximumDistance = 10 -) => - Shape.fromGeometry( - push$1(shape.toGeometry(), { - force, - minimumDistance, - maximumDistance, - }) - ); + let packedShape = Shape.fromGeometry(taggedGroup({}, ...packedLayers)); + if (size === undefined) { + packedShape = packedShape.align('xy'); + } + return packedShape; + }; -const pushMethod = function (force = 0.1, minimumDistance, maximumDistance) { - return push(this, force, minimumDistance, maximumDistance); -}; +Shape.registerMethod('pack', pack); + +const push = + (force = 0.1, minimumDistance = 1, maximumDistance = 10) => + (shape) => + Shape.fromGeometry( + push$1(shape.toGeometry(), { + force, + minimumDistance, + maximumDistance, + }) + ); -Shape.prototype.push = pushMethod; +Shape.registerMethod('push', push); const normalizeCoords = ([ x = 0, @@ -819,22 +623,16 @@ const orient = (origin, forward, right, shapeToPeg) => { return shapeToPeg.transform(from).move(...origin); }; -const peg = (shape, shapeToPeg) => { +const peg = (shapeToPeg) => (shape) => { const { origin, right, forward } = getPegCoords(shape); return orient(origin, right, forward, shapeToPeg); }; -const pegMethod = function (shapeToPeg) { - return peg(this, shapeToPeg); -}; - -Shape.prototype.peg = pegMethod; +Shape.registerMethod('peg', peg); -const putMethod = function (pegShape) { - return peg(pegShape, this); -}; +const put = (pegShape) => (shape) => peg(shape)(pegShape); -Shape.prototype.put = putMethod; +Shape.registerMethod('put', put); const shapeMethod = (build) => { return function (...args) { @@ -864,249 +662,247 @@ const updatePlanMethod = function (...updates) { Shape.prototype.updatePlan = updatePlanMethod; -const angle = (shape, start = 0, end = 0) => - shape.updatePlan({ angle: { start: start, end: end } }); -const base = (shape, base) => shape.updatePlan({ base }); -const at = (shape, x = 0, y = 0, z = 0) => - shape.updatePlan({ - at: [x, y, z], - }); -const corner1 = (shape, x = 0, y = x, z = 0) => - shape.updatePlan({ - corner1: [x, y, z], - }); -const corner2 = (shape, x = 0, y = x, z = 0) => - shape.updatePlan({ - corner2: [x, y, z], - }); -const diameter = (shape, x = 1, y = x, z = 0) => - shape.updatePlan( - { corner1: [x / 2, y / 2, z / 2] }, - { corner2: [x / -2, y / -2, z / -2] } - ); -const radius = (shape, x = 1, y = x, z = 0) => - shape.updatePlan( - { - corner1: [x, y, z], - }, - { - corner2: [-x, -y, -z], - } - ); -const apothem = (shape, x = 1, y = x, z = 0) => - shape.updatePlan( - { +const hasAngle = + (start = 0, end = 0) => + (shape) => + shape.updatePlan({ angle: { start: start, end: end } }); +const hasBase = (base) => (shape) => shape.updatePlan({ base }); +const hasAt = + (x = 0, y = 0, z = 0) => + (shape) => + shape.updatePlan({ + at: [x, y, z], + }); +const hasCorner1 = + (x = 0, y = x, z = 0) => + (shape) => + shape.updatePlan({ corner1: [x, y, z], - }, - { - corner2: [-x, -y, -z], - }, - { apothem: [x, y, z] } - ); -const from = (shape, x = 0, y = 0, z = 0) => - shape.updatePlan({ from: [x, y, z] }); -const sides = (shape, sides = 1) => shape.updatePlan({ sides }); -const to = (shape, x = 0, y = 0, z = 0) => - shape.updatePlan({ to: [x, y, z], top: undefined }); -const top = (shape, top) => shape.updatePlan({ top }); -const zag = (shape, zag) => shape.updatePlan({ zag }); - -Shape.registerMethod('apothem', apothem); -Shape.registerMethod('angle', angle); -Shape.registerMethod('at', at); -Shape.registerMethod('base', base); -Shape.registerMethod('corner1', corner1); -Shape.registerMethod('c1', corner1); -Shape.registerMethod('corner2', corner2); -Shape.registerMethod('c2', corner2); -Shape.registerMethod('diameter', diameter); -Shape.registerMethod('from', from); -Shape.registerMethod('radius', radius); -Shape.registerMethod('sides', sides); -Shape.registerMethod('to', to); -Shape.registerMethod('top', top); -Shape.registerMethod('zag', zag); + }); +const hasC1 = hasCorner1; +const hasCorner2 = + (x = 0, y = x, z = 0) => + (shape) => + shape.updatePlan({ + corner2: [x, y, z], + }); +const hasC2 = hasCorner2; +const hasDiameter = + (x = 1, y = x, z = 0) => + (shape) => + shape.updatePlan( + { corner1: [x / 2, y / 2, z / 2] }, + { corner2: [x / -2, y / -2, z / -2] } + ); +const hasRadius = + (x = 1, y = x, z = 0) => + (shape) => + shape.updatePlan( + { + corner1: [x, y, z], + }, + { + corner2: [-x, -y, -z], + } + ); +const hasApothem = + (x = 1, y = x, z = 0) => + (shape) => + shape.updatePlan( + { + corner1: [x, y, z], + }, + { + corner2: [-x, -y, -z], + }, + { apothem: [x, y, z] } + ); +const hasFrom = + (x = 0, y = 0, z = 0) => + (shape) => + shape.updatePlan({ from: [x, y, z] }); +const hasSides = + (sides = 1) => + (shape) => + shape.updatePlan({ sides }); +const hasTo = + (x = 0, y = 0, z = 0) => + (shape) => + shape.updatePlan({ to: [x, y, z], top: undefined }); +const hasTop = (top) => (shape) => shape.updatePlan({ top }); +const hasZag = (zag) => (shape) => shape.updatePlan({ zag }); // Let's consider migrating to a 'has' prefix for planning. -Shape.registerMethod('hasApothem', apothem); -Shape.registerMethod('hasAngle', angle); -Shape.registerMethod('hasAt', at); -Shape.registerMethod('hasBase', base); -Shape.registerMethod('hasCorner1', corner1); -Shape.registerMethod('hasC1', corner1); -Shape.registerMethod('hasCorner2', corner2); -Shape.registerMethod('hasC2', corner2); -Shape.registerMethod('hasDiameter', diameter); -Shape.registerMethod('hasFrom', from); -Shape.registerMethod('hasRadius', radius); -Shape.registerMethod('hasSides', sides); -Shape.registerMethod('hasTo', to); -Shape.registerMethod('hasTop', top); -Shape.registerMethod('hasZag', zag); - -const remesh = (shape, options = {}) => - Shape.fromGeometry(remesh$1(shape.toGeometry(), options)); - -const remeshMethod = function (options) { - return remesh(this, options); -}; - -Shape.prototype.remesh = remeshMethod; - -/** - * - * # Rotate - * - * ``` - * rotate(shape, axis, angle) - * shape.rotate(axis, angle) - * ``` - * - * Rotates the shape around the provided axis. - * - * ::: illustration { "view": { "position": [40, 40, 40] } } - * ``` - * Square(10) - * ``` - * ::: - * ::: illustration { "view": { "position": [40, 40, 40] } } - * ``` - * Square(10).rotate([1, 1, 1], 90) - * ``` - * ::: - **/ - -const rotate = (shape, angle = 0, axis = [0, 0, 1]) => - shape.transform(fromRotation(angle * 0.017453292519943295, axis)); +Shape.registerMethod('hasApothem', hasApothem); +Shape.registerMethod('hasAngle', hasAngle); +Shape.registerMethod('hasAt', hasAt); +Shape.registerMethod('hasBase', hasBase); +Shape.registerMethod('hasCorner1', hasCorner1); +Shape.registerMethod('hasC1', hasCorner1); +Shape.registerMethod('hasCorner2', hasCorner2); +Shape.registerMethod('hasC2', hasCorner2); +Shape.registerMethod('hasDiameter', hasDiameter); +Shape.registerMethod('hasFrom', hasFrom); +Shape.registerMethod('hasRadius', hasRadius); +Shape.registerMethod('hasSides', hasSides); +Shape.registerMethod('hasTo', hasTo); +Shape.registerMethod('hasTop', hasTop); +Shape.registerMethod('hasZag', hasZag); + +const remesh = + (...lengths) => + (shape) => + Shape.fromGeometry(remesh$1(shape.toGeometry(), { lengths })); + +Shape.registerMethod('remesh', remesh); + +const rotate = + (angle = 0, axis = [0, 0, 1]) => + (shape) => + shape.transform(fromRotation(angle * 0.017453292519943295, axis)); Shape.registerMethod('rotate', rotate); -const rotateX = (shape, ...angles) => - Shape.Group( - ...angles.map((angle) => shape.transform(fromRotateXToTransform(angle))) - ); +const rotateX = + (...angles) => + (shape) => + Shape.Group( + ...angles.map((angle) => shape.transform(fromRotateXToTransform(angle))) + ); // rx is in terms of turns -- 1/2 is a half turn. -const rx = (shape, ...angles) => - Shape.Group( - ...angles.map((angle) => - shape.transform(fromRotateXToTransform(angle * 360)) - ) - ); +const rx = + (...angles) => + (shape) => + Shape.Group( + ...angles.map((angle) => + shape.transform(fromRotateXToTransform(angle * 360)) + ) + ); Shape.registerMethod('rotateX', rotateX); Shape.registerMethod('rx', rx); -const rotateY = (shape, ...angles) => - Shape.Group( - ...angles.map((angle) => shape.transform(fromRotateYToTransform(angle))) - ); +const rotateY = + (...angles) => + (shape) => + Shape.Group( + ...angles.map((angle) => shape.transform(fromRotateYToTransform(angle))) + ); // ry is in terms of turns -- 1/2 is a half turn. -const ry = (shape, ...angles) => - Shape.Group( - ...angles.map((angle) => - shape.transform(fromRotateYToTransform(angle * 360)) - ) - ); +const ry = + (...angles) => + (shape) => + Shape.Group( + ...angles.map((angle) => + shape.transform(fromRotateYToTransform(angle * 360)) + ) + ); Shape.registerMethod('rotateY', rotateY); Shape.registerMethod('ry', ry); -const rotateZ = (shape, ...angles) => - Shape.Group( - ...angles.map((angle) => shape.transform(fromRotateZToTransform(angle))) - ); +const rotateZ = + (...angles) => + (shape) => + Shape.Group( + ...angles.map((angle) => shape.transform(fromRotateZToTransform(angle))) + ); -const rz = (shape, ...angles) => - Shape.Group( - ...angles.map((angle) => - shape.transform(fromRotateZToTransform(angle * 360)) - ) - ); +const rz = + (...angles) => + (shape) => + Shape.Group( + ...angles.map((angle) => + shape.transform(fromRotateZToTransform(angle * 360)) + ) + ); Shape.registerMethod('rotateZ', rotateZ); Shape.registerMethod('rz', rz); -const scale = (shape, x = 1, y = x, z = y) => - shape.transform(fromScaling([x, y, z])); +const scale = + (x = 1, y = x, z = y) => + (shape) => + shape.transform(fromScaling([x, y, z])); -const scaleMethod = function (x, y, z) { - return scale(this, x, y, z); -}; -Shape.prototype.scale = scaleMethod; +Shape.registerMethod('scale', scale); -const smooth = (shape, options = {}) => - Shape.fromGeometry(smooth$1(shape.toGeometry(), options)); +const smooth = + (options = {}) => + (shape) => + Shape.fromGeometry(smooth$1(shape.toGeometry(), options)); -const smoothMethod = function (options) { - return smooth(this, options); -}; - -Shape.prototype.smooth = smoothMethod; +Shape.registerMethod('smooth', smooth); -const X = 0; -const Y = 1; -const Z = 2; +const X$1 = 0; +const Y$1 = 1; +const Z$1 = 2; -const size = (shape, op = (size, shape) => size) => { - const geometry = shape.toConcreteGeometry(); - const [min, max] = measureBoundingBox(geometry); - const length = max[X] - min[X]; - const width = max[Y] - min[Y]; - const height = max[Z] - min[Z]; - const center = scale$1(0.5, add$1(min, max)); - const radius = distance(center, max); - return op( - { - length, - width, - height, - max, - min, - center, - radius, - }, - Shape.fromGeometry(geometry) - ); -}; +const size = + (op = (size, shape) => size) => + (shape) => { + const geometry = shape.toConcreteGeometry(); + const [min, max] = measureBoundingBox(geometry); + const length = max[X$1] - min[X$1]; + const width = max[Y$1] - min[Y$1]; + const height = max[Z$1] - min[Z$1]; + const center = scale$1(0.5, add$1(min, max)); + const radius = distance(center, max); + return op( + { + length, + width, + height, + max, + min, + center, + radius, + }, + Shape.fromGeometry(geometry) + ); + }; -const sizeMethod = function (op) { - return size(this, op); -}; -Shape.prototype.size = sizeMethod; +Shape.registerMethod('size', size); -const sketch = (shape) => +const sketch = () => (shape) => Shape.fromGeometry(taggedSketch({}, shape.toGeometry())); -Shape.prototype.sketch = function () { - return sketch(this); -}; - -Shape.prototype.plan = function () { - return sketch(this); -}; - -Shape.prototype.withPlan = function () { - return assemble(this, sketch(this)); -}; +Shape.registerMethod('sketch', sketch); + +const split = + ({ + keepVolumes = true, + keepCavitiesInVolumes = true, + keepCavitiesAsVolumes = false, + } = {}) => + (shape) => + Shape.fromGeometry( + split$1( + shape.toGeometry(), + keepVolumes, + keepCavitiesInVolumes, + keepCavitiesAsVolumes + ) + ); -const tags = (shape, op = (tags, shape) => tags) => - op( - [...allTags(shape.toGeometry())] - .filter((tag) => tag.startsWith('user/')) - .map((tag) => tag.substring(5)), - shape - ); +Shape.registerMethod('split', split); -const method = function (op) { - return tags(this, op); -}; +const tags = + (op = (tags, shape) => tags) => + (shape) => + op( + [...allTags(shape.toGeometry())] + .filter((tag) => tag.startsWith('user/')) + .map((tag) => tag.substring(5)), + shape + ); -Shape.prototype.tags = method; +Shape.registerMethod('tags', tags); -const test = (shape, md) => { +const test = (md) => (shape) => { if (md) { shape.md(md); } @@ -1114,292 +910,314 @@ const test = (shape, md) => { return shape; }; -const testMethod = function (md) { - return test(this, md); -}; - -Shape.prototype.test = testMethod; +Shape.registerMethod('test', test); -const tool = (shape, name) => - Shape.fromGeometry(rewriteTags(toTagsFromName$2(name), [], shape.toGeometry())); +const tool = (name) => (shape) => + Shape.fromGeometry(rewriteTags(toTagsFromName$1(name), [], shape.toGeometry())); -const toolMethod = function (name) { - return tool(this, name); -}; -Shape.prototype.tool = toolMethod; +Shape.registerMethod('tool', tool); -const twist = (shape, degreesPerMm = 1) => - Shape.fromGeometry(twist$1(shape.toGeometry(), degreesPerMm)); +const twist = + (degreesPerMm = 1) => + (shape) => + Shape.fromGeometry(twist$1(shape.toGeometry(), degreesPerMm)); Shape.registerMethod('twist', twist); -const voidFn = (shape) => +const voidFn = () => (shape) => Shape.fromGeometry( rewriteTags(['compose/non-positive'], [], shape.toGeometry()) ); -const voidMethod = function () { - return voidFn(this); -}; -Shape.prototype.void = voidMethod; - -const weld = (...shapes) => { - const unwelded = []; - for (const shape of shapes) { - // We lose the tags at this point. - const result = toPolygonsWithHoles(shape.toGeometry()); - for (const { polygonsWithHoles } of result) { - unwelded.push(...polygonsWithHoles); +Shape.registerMethod('void', voidFn); + +const weld = + (...rest) => + (first) => { + const unwelded = []; + for (const shape of [first, ...rest]) { + // We lose the tags at this point. + const result = toPolygonsWithHoles(shape.toGeometry()); + for (const { polygonsWithHoles } of result) { + unwelded.push(...polygonsWithHoles); + } } - } - const welds = []; - const arrangements = arrangePolygonsWithHoles(unwelded); - console.log(`QQ/arrangements: ${JSON.stringify(arrangements)}`); - for (const { polygonsWithHoles } of arrangements) { - // Keep the planar grouping. - const triangles = fromPolygonsWithHolesToTriangles(polygonsWithHoles); - const graph = fromTrianglesToGraph(triangles); - welds.push(taggedGraph({}, graph)); - } - // A group of planar welds. - return Shape.fromGeometry(taggedGroup({}, ...welds)); -}; + const welds = []; + const arrangements = arrangePolygonsWithHoles(unwelded); + console.log(`QQ/arrangements: ${JSON.stringify(arrangements)}`); + for (const { polygonsWithHoles } of arrangements) { + // Keep the planar grouping. + const triangles = fromPolygonsWithHolesToTriangles(polygonsWithHoles); + const graph = fromTrianglesToGraph(triangles); + welds.push(taggedGraph({}, graph)); + } + // A group of planar welds. + return Shape.fromGeometry(taggedGroup({}, ...welds)); + }; + +Shape.registerMethod('weld', weld); -const weldMethod = function (...shapes) { - return weld(this, ...shapes); +const assemble = (...shapes) => { + shapes = shapes.filter((shape) => shape !== undefined); + switch (shapes.length) { + case 0: { + return Shape.fromGeometry(assemble$1()); + } + case 1: { + return shapes[0]; + } + default: { + return fromGeometry(assemble$1(...shapes.map(toGeometry))); + } + } }; -Shape.prototype.weld = weldMethod; +const withFn = + (...shapes) => + (shape) => + assemble(shape, ...shapes); -/** - * - * # With - * - * Assembles the current shape with those provided. - * - * The below example is equivalent to - * ``` - * assemble(Circle(20), Square(40).moveX(10)) - * ``` - * - * ::: illustration { "view": { "position": [80, 80, 80] } } - * ``` - * Circle(20).with(Square(40).moveX(10)) - * ``` - * ::: - * - **/ +Shape.registerMethod('with', withFn); -const withMethod = function (...shapes) { - return assemble(this, ...shapes); -}; -Shape.prototype.with = withMethod; +const x = + (...x) => + (shape) => + Shape.Group(...x.map((x) => move(x)(shape))); -const prepareShape = (shape, name, options = {}) => { - let index = 0; - const entries = []; - entries.push({ - data: new TextEncoder('utf8').encode(JSON.stringify(shape)), - filename: `${name}_${index++}.jsxcad`, - type: 'application/x-jsxcad', - }); - return entries; -}; +Shape.registerMethod('x', x); -const downloadShapeMethod = function (...args) { - const entries = prepareShape(this, ...args); - emit({ download: { entries } }); - return this; -}; -Shape.prototype.downloadShape = downloadShapeMethod; +const y = + (...y) => + (shape) => + Shape.Group(...y.map((y) => move(0, y)(shape))); -const writeShape = (shape, name, options = {}) => { - for (const { data, filename } of prepareShape(shape, name, {})) { - addPending(writeFile({ doSerialize: false }, `output/${filename}`, data)); - } - return shape; -}; +Shape.registerMethod('y', y); -const writeShapeMethod = function (...args) { - return writeShape(this, ...args); -}; -Shape.prototype.writeShape = writeShapeMethod; +const z = + (...z) => + (shape) => + Shape.Group(...z.map((z) => move(0, 0, z)(shape))); -/** - * - * # MoveX - * - * Move along the X axis. - * - */ +Shape.registerMethod('z', z); -const moveX = (shape, ...x) => - Shape.Group(...x.map((x) => move(shape, x))); +const add = + (shape, ...shapes) => + (shape) => + Shape.fromGeometry( + union(shape.toGeometry(), ...shapes.map((shape) => shape.toGeometry())) + ); -const moveXMethod = function (...x) { - return moveX(this, ...x); -}; -Shape.prototype.x = moveXMethod; +Shape.registerMethod('add', add); + +const and = + (...shapes) => + (shape) => + Shape.fromGeometry( + taggedGroup( + {}, + shape.toGeometry(), + ...shapes.map((shape) => shape.toGeometry()) + ) + ); -/** - * - * # MoveY - * - * Move along the Y axis. - * - */ +Shape.registerMethod('and', and); -const moveY = (shape, ...y) => - Shape.Group(...y.map((y) => move(shape, 0, y))); +const addTo = (other) => (shape) => add(other, shape); +Shape.registerMethod('addTo', addTo); -const moveYMethod = function (...y) { - return moveY(this, ...y); -}; -Shape.prototype.y = moveYMethod; +const X = 0; +const Y = 1; +const Z = 2; -/** - * - * # MoveZ - * - * Move along the Z axis. - * - */ +const align = + (spec = 'xyz', origin = [0, 0, 0]) => + (shape) => + shape.size(({ max, min, center }, shape) => { + const offset = [0, 0, 0]; + + let index = 0; + while (index < spec.length) { + switch (spec[index++]) { + case 'x': { + switch (spec[index]) { + case '>': + offset[X] = -min[X]; + index += 1; + break; + case '<': + offset[X] = -max[X]; + index += 1; + break; + default: + offset[X] = -center[X]; + } + break; + } + case 'y': { + switch (spec[index]) { + case '>': + offset[Y] = -min[Y]; + index += 1; + break; + case '<': + offset[Y] = -max[Y]; + index += 1; + break; + default: + offset[Y] = -center[Y]; + } + break; + } + case 'z': { + switch (spec[index]) { + case '>': + offset[Z] = -min[Z]; + index += 1; + break; + case '<': + offset[Z] = -max[Z]; + index += 1; + break; + default: + offset[Z] = -center[Z]; + } + break; + } + } + } + const moved = shape.move(...add$1(offset, origin)); + return moved; + }); + +Shape.registerMethod('align', align); + +const as = + (...tags) => + (shape) => + Shape.fromGeometry( + rewriteTags( + tags.map((tag) => `user/${tag}`), + [], + shape.toGeometry() + ) + ); -const moveZ = (shape, ...z) => - Shape.Group(...z.map((z) => move(shape, 0, 0, z))); +const notAs = + (...tags) => + (shape) => + Shape.fromGeometry( + rewriteTags( + [], + tags.map((tag) => `user/${tag}`), + shape.toGeometry() + ) + ); -const moveZMethod = function (...z) { - return moveZ(this, ...z); -}; -Shape.prototype.z = moveZMethod; +Shape.registerMethod('as', as); +Shape.registerMethod('notAs', notAs); -const fromUndefined = () => Shape.fromGeometry(); +const bend = + (degreesPerMm = 1) => + (shape) => + Shape.fromGeometry(bend$1(shape.toGeometry(), degreesPerMm)); -const loadGeometry = async ( - path, - { otherwise = fromUndefined } = {} -) => { - const data = await read(path); - if (data === undefined) { - return otherwise(); - } else { - return Shape.fromGeometry(data); - } -}; +Shape.registerMethod('bend', bend); -const saveGeometry = async (path, shape) => - Shape.fromGeometry(await write(shape.toGeometry(), path)); +const clip = + (...shapes) => + (shape) => + Shape.fromGeometry( + intersection( + shape.toGeometry(), + ...shapes.map((shape) => shape.toGeometry()) + ) + ); -function pad (hash, len) { - while (hash.length < len) { - hash = '0' + hash; - } - return hash; -} +Shape.registerMethod('clip', clip); -function fold (hash, text) { - var i; - var chr; - var len; - if (text.length === 0) { - return hash; - } - for (i = 0, len = text.length; i < len; i++) { - chr = text.charCodeAt(i); - hash = ((hash << 5) - hash) + chr; - hash |= 0; - } - return hash < 0 ? hash * -2 : hash; -} +const clipFrom = (other) => (shape) => clip(other, shape); +Shape.registerMethod('clipFrom', clipFrom); -function foldObject (hash, o, seen) { - return Object.keys(o).sort().reduce(foldKey, hash); - function foldKey (hash, key) { - return foldValue(hash, o[key], key, seen); - } -} +const fromName = (shape, name) => + Shape.fromGeometry(rewriteTags(toTagsFromName$2(name), [], shape.toGeometry())); -function foldValue (input, value, key, seen) { - var hash = fold(fold(fold(input, key), toString(value)), typeof value); - if (value === null) { - return fold(hash, 'null'); - } - if (value === undefined) { - return fold(hash, 'undefined'); - } - if (typeof value === 'object' || typeof value === 'function') { - if (seen.indexOf(value) !== -1) { - return fold(hash, '[Circular]' + key); - } - seen.push(value); +// Tint adds another color to the mix. +const tint = + (...args) => + (shape) => + fromName(shape, ...args); + +// FIX: Have color remove all other color tags. +const color = + (...args) => + (shape) => + fromName(shape, ...args); + +Shape.registerMethod('color', color); +Shape.registerMethod('tint', tint); + +const colors = + (op = (colors, shape) => colors) => + (shape) => + op( + [...allTags(shape.toGeometry())] + .filter((tag) => tag.startsWith('color/')) + .map((tag) => tag.substring(6)), + shape + ); - var objHash = foldObject(hash, value, seen); +Shape.registerMethod('colors', colors); - if (!('valueOf' in value) || typeof value.valueOf !== 'function') { - return objHash; - } +const cut = + (...shapes) => + (shape) => + Shape.fromGeometry( + difference( + shape.toGeometry(), + ...shapes.map((shape) => shape.toGeometry()) + ) + ); - try { - return fold(objHash, String(value.valueOf())) - } catch (err) { - return fold(objHash, '[valueOf exception]' + (err.stack || err.message)) - } - } - return fold(hash, value.toString()); -} +Shape.registerMethod('cut', cut); -function toString (o) { - return Object.prototype.toString.call(o); -} +// a.cut(b) === b.cutFrom(a) -function sum (o) { - return pad(foldValue(0, o, '', []).toString(16), 8); -} +const cutFrom = (other) => (shape) => cut(other, shape); +Shape.registerMethod('cutFrom', cutFrom); + +const each = + (op = (leafs, shape) => leafs) => + (shape) => + op( + getLeafs(shape.toDisjointGeometry()).map((leaf) => + Shape.fromGeometry(leaf) + ), + shape + ); +Shape.registerMethod('each', each); -var hashSum = sum; +const fuse = () => (shape) => { + const geometry = shape.toGeometry(); + return fromGeometry(union(empty({ tags: geometry.tags }), geometry)); +}; +Shape.registerMethod('fuse', fuse); -/** - * - * # Log - * - * Writes a string to the console. - * - * ``` - * log("Hello, World") - * ``` - * - **/ +const inset = + (initial = 1, step, limit) => + (shape) => + Shape.fromGeometry(inset$1(shape.toGeometry(), initial, step, limit)); -const toText = (value) => { - if (typeof value === 'object') { - return JSON.stringify(value); - } else { - return String(value); - } -}; +// CHECK: Using 'with' for may be confusing, but andInset looks odd. +const withInset = (initial, step, limit) => (shape) => + shape.and(shape.inset(initial, step, limit)); -const log = (value, level) => { - const text = toText(value); - const log = { text, level }; - const hash = hashSum(log); - emit({ log, hash }); - return log$1({ op: 'text', text, level }); -}; +Shape.registerMethod('inset', inset); +Shape.registerMethod('withInset', withInset); -const logOp = (shape, op) => { - const text = String(op(shape)); - const level = 'serious'; - const log = { text, level }; - const hash = hashSum(log); - emit({ log, hash }); - return log$1({ op: 'text', text }); -}; +const grow = (amount) => (shape) => + Shape.fromGeometry(grow$1(shape.toGeometry(), amount)); -const logMethod = function (op = (shape) => JSON.stringify(shape)) { - logOp(Shape.fromGeometry(realize(this.toGeometry())), op); - return this; -}; -Shape.prototype.log = logMethod; +Shape.registerMethod('grow', grow); export default Shape; -export { Shape, getPegCoords, loadGeometry, log, orient, saveGeometry, shapeMethod, weld }; +export { Shape, add, addTo, align, and, as, bend, clip, clipFrom, color, colors, cut, cutFrom, drop, each, fuse, getPegCoords, grow, hasAngle, hasApothem, hasAt, hasBase, hasC1, hasC2, hasCorner1, hasDiameter, hasFrom, hasRadius, hasSides, hasTo, hasTop, hasZag, inset, keep, loadGeometry, loft, log, loop, material, minkowskiDifference, minkowskiShell, minkowskiSum, move, noVoid, notAs, offset, op, orient, pack, peg, push, remesh, rotate, rotateX, rotateY, rotateZ, rx, ry, rz, saveGeometry, scale, shapeMethod, size, sketch, smooth, split, tags, test, tint, tool, twist, voidFn, weld, withFn, withInset, withOp, x, y, z }; diff --git a/dist/jsxcad-api-v1-shapes.js b/dist/jsxcad-api-v1-shapes.js index b334fafc..2d40f877 100644 --- a/dist/jsxcad-api-v1-shapes.js +++ b/dist/jsxcad-api-v1-shapes.js @@ -1,10 +1,9 @@ -import { taggedPlan, taggedDisjointAssembly, registerReifier, taggedGroup, taggedPaths, translatePaths, getLeafs, taggedLayers, taggedLayout, measureBoundingBox, getLayouts, visit, isNotVoid, concatenatePath, rotateZPath, taggedAssembly, convexHullToGraph, fromFunctionToGraph, scalePath, translatePath, flipPath, deduplicatePath, taggedPoints, fromPathsToGraph } from './jsxcad-geometry.js'; +import { taggedPlan, taggedGroup, registerReifier, taggedPaths, translatePaths, getLeafs, taggedLayout, measureBoundingBox, getLayouts, visit, isNotVoid, concatenatePath, rotateZPath, assemble, convexHullToGraph, fromFunctionToGraph, taggedPoints, fromPathsToGraph, translatePath } from './jsxcad-geometry.js'; import Shape$1, { Shape, shapeMethod, weld } from './jsxcad-api-v1-shape.js'; import { scale, subtract, add, negate } from './jsxcad-math-vec3.js'; import { identityMatrix } from './jsxcad-math-mat4.js'; import { zag, numbers } from './jsxcad-api-v1-math.js'; import { fromPoints as fromPoints$2 } from './jsxcad-math-poly3.js'; -import { fromAngleRadians } from './jsxcad-math-vec2.js'; import { toPolygon } from './jsxcad-math-plane.js'; const eachEntry = (geometry, op, otherwise) => { @@ -68,8 +67,7 @@ const getScale = (geometry) => { const Plan = (type) => Shape.fromGeometry(taggedPlan({}, { type })); -const Empty = (...shapes) => - Shape.fromGeometry(taggedDisjointAssembly({})); +const Empty = (...shapes) => Shape.fromGeometry(taggedGroup({})); Shape.prototype.Empty = shapeMethod(Empty); @@ -111,7 +109,7 @@ registerReifier('Box', (geometry) => { }); const Box = (x, y = x, z = 0) => - Shape.fromGeometry(taggedPlan({}, { type: 'Box' })).diameter(x, y, z); + Shape.fromGeometry(taggedPlan({}, { type: 'Box' })).hasDiameter(x, y, z); Shape.prototype.Box = shapeMethod(Box); @@ -1642,7 +1640,7 @@ const Page = ( } } if (!pack && size) { - const layer = taggedLayers({}, ...layers); + const layer = taggedGroup({}, ...layers); const [width, height] = size; const packSize = [ [-width / 2, -height / 2, 0], @@ -1666,7 +1664,7 @@ const Page = ( buildLayoutGeometry({ layer, packSize, pageWidth, pageLength, margin }) ); } else if (!pack && !size) { - const layer = taggedLayers({}, ...layers); + const layer = taggedGroup({}, ...layers); const packSize = measureBoundingBox(layer); const pageWidth = Math.max( @@ -1692,7 +1690,7 @@ const Page = ( } else if (pack && size) { // Content fits to page size. const packSize = []; - const content = Shape$1.fromGeometry(taggedLayers({}, ...layers)).pack({ + const content = Shape$1.fromGeometry(taggedGroup({}, ...layers)).pack({ size, pageMargin, itemMargin, @@ -1717,14 +1715,14 @@ const Page = ( }) ); } - return Shape$1.fromGeometry(taggedLayers({}, ...plans)); + return Shape$1.fromGeometry(taggedGroup({}, ...plans)); } else { return Empty(); } } else if (pack && !size) { const packSize = []; // Page fits to content size. - const content = Shape$1.fromGeometry(taggedLayers({}, ...layers)).pack({ + const content = Shape$1.fromGeometry(taggedGroup({}, ...layers)).pack({ pageMargin, itemMargin, perLayout: itemsPerPage, @@ -1750,7 +1748,7 @@ const Page = ( Shape$1.fromGeometry(layoutGeometry); plans.push(layoutGeometry); } - return Shape$1.fromGeometry(taggedLayers({}, ...plans)); + return Shape$1.fromGeometry(taggedGroup({}, ...plans)); } else { return Empty(); } @@ -1860,7 +1858,7 @@ registerReifier('Arc', (geometry) => { }); const Arc = (x = 1, y = x, z = 0) => - Shape.fromGeometry(taggedPlan({}, { type: 'Arc' })).diameter(x, y, z); + Shape.fromGeometry(taggedPlan({}, { type: 'Arc' })).hasDiameter(x, y, z); Shape.prototype.Arc = shapeMethod(Arc); @@ -1868,10 +1866,7 @@ const isDefined = (value) => value !== undefined; const Assembly = (...shapes) => Shape.fromGeometry( - taggedAssembly( - {}, - ...shapes.filter(isDefined).map((shape) => shape.toGeometry()) - ) + assemble(...shapes.filter(isDefined).map((shape) => shape.toGeometry())) ); Shape.prototype.Assembly = shapeMethod(Assembly); @@ -1926,7 +1921,7 @@ const Z$1 = 2; registerReifier('Cone', (geometry) => { const [x, y, z] = getCorner2(geometry); return Hull( - Arc(x, y).sides(getSides(geometry, 32)).z(z), + Arc(x, y).hasSides(getSides(geometry, 32)).z(z), Point(0, 0, getCorner1(geometry)[Z$1]) ) .orient({ @@ -1941,12 +1936,12 @@ registerReifier('Cone', (geometry) => { const Cone = (diameter = 1, top = 1, base = -top) => Shape.fromGeometry(taggedPlan({}, { type: 'Cone' })) - .corner1(0, 0, top) - .corner2(diameter, diameter, base); + .hasCorner1(0, 0, top) + .hasCorner2(diameter, diameter, base); Shape.prototype.Cone = shapeMethod(Cone); -const Hexagon = (x, y, z) => Arc(x, y, z).sides(6); +const Hexagon = (x, y, z) => Arc(x, y, z).hasSides(6); Shape.prototype.Hexagon = shapeMethod(Hexagon); @@ -2029,7 +2024,11 @@ registerReifier('Icosahedron', (geometry) => { }); const Icosahedron = (x = 1, y = x, z = x) => - Shape.fromGeometry(taggedPlan({}, { type: 'Icosahedron' })).diameter(x, y, z); + Shape.fromGeometry(taggedPlan({}, { type: 'Icosahedron' })).hasDiameter( + x, + y, + z + ); Shape.prototype.Icosahedron = shapeMethod(Icosahedron); @@ -2082,50 +2081,14 @@ const loopHullMethod = function (...shapes) { Shape.prototype.loopHull = loopHullMethod; Shape.prototype.LoopedHull = shapeMethod(LoopedHull); -const Octagon = (x, y, z) => Arc(x, y, z).sides(8); +const Octagon = (x, y, z) => Arc(x, y, z).hasSides(8); Shape.prototype.Octagon = shapeMethod(Octagon); -const buildRegularPolygon = (sides = 32) => { - let points = []; - for (let i = 0; i < sides; i++) { - let radians = (2 * Math.PI * i) / sides; - let [x, y] = fromAngleRadians(radians); - points.push([x, y, 0]); - } - return points; -}; - -const buildWalls = (polygons, floor, roof) => { - for ( - let start = floor.length - 1, end = 0; - end < floor.length; - start = end++ - ) { - // Remember that we are walking CCW. - polygons.push({ - points: deduplicatePath([ - floor[start], - floor[end], - roof[end], - roof[start], - ]), - }); - } -}; - // Approximates a UV sphere. -const buildRingSphere = (resolution = 20) => { - /** @type {Polygon[]} */ - const polygons = []; - let lastPath; - - const latitudinalResolution = 2 + resolution; - const longitudinalResolution = 2 * latitudinalResolution; +const extrudeSphere = (shape, height = 1, { sides = 20 } = {}) => { + const lofts = []; - // Trace out latitudinal rings. - const ring = buildRegularPolygon(longitudinalResolution); - let path; const getEffectiveSlice = (slice) => { if (slice === 0) { return 0.5; @@ -2135,31 +2098,26 @@ const buildRingSphere = (resolution = 20) => { return slice; } }; + + const latitudinalResolution = sides; + for (let slice = 0; slice <= latitudinalResolution; slice++) { const angle = (Math.PI * 1.0 * getEffectiveSlice(slice)) / latitudinalResolution; - const height = Math.cos(angle); + const z = Math.cos(angle); const radius = Math.sin(angle); - const points = ring; - const scaledPath = scalePath([radius, radius, radius], points); - const translatedPath = translatePath([0, 0, height], scaledPath); - path = translatedPath; - if (lastPath !== undefined) { - buildWalls(polygons, path, lastPath); - } else { - polygons.push({ points: path }); - } - lastPath = path; - } - if (path) { - polygons.push({ points: flipPath(path) }); + lofts.push((s) => s.scale(radius, radius, 1).z(z * height)); } - return polygons; + return shape.loft(...lofts.reverse()); }; +Shape.registerMethod('extrudeSphere', extrudeSphere); +Shape.registerMethod('sx', extrudeSphere); + registerReifier('Orb', (geometry) => { const [scale, middle] = getScale(geometry); - return Shape.fromPolygons(buildRingSphere(getSides(geometry, 16))) + const sides = getSides(geometry, 16); + return extrudeSphere(Arc(2).hasSides(sides * 2), 1, { sides: 2 + sides }) .scale(...scale) .move(...middle) .orient({ @@ -2173,7 +2131,7 @@ registerReifier('Orb', (geometry) => { }); const Orb = (x = 1, y = x, z = x) => - Shape.fromGeometry(taggedPlan({}, { type: 'Orb' })).diameter(x, y, z); + Shape.fromGeometry(taggedPlan({}, { type: 'Orb' })).hasDiameter(x, y, z); Shape.prototype.Orb = shapeMethod(Orb); @@ -2203,7 +2161,7 @@ const Peg = ( Shape.prototype.Peg = shapeMethod(Peg); -const Pentagon = (x, y, z) => Arc(x, y, z).sides(5); +const Pentagon = (x, y, z) => Arc(x, y, z).hasSides(5); Shape.prototype.Pentagon = shapeMethod(Pentagon); @@ -2237,15 +2195,15 @@ Polyhedron.ofPointPaths = ofPointPaths; Shape.prototype.Polyhedron = shapeMethod(Polyhedron); -const Septagon = (x, y, z) => Arc(x, y, z).sides(7); +const Septagon = (x, y, z) => Arc(x, y, z).hasSides(7); Shape.prototype.Septagon = shapeMethod(Septagon); -const Tetragon = (x, y, z) => Arc(x, y, z).sides(4); +const Tetragon = (x, y, z) => Arc(x, y, z).hasSides(4); Shape.prototype.Tetragon = shapeMethod(Tetragon); -const Triangle = (x, y, z) => Arc(x, y, z).sides(3); +const Triangle = (x, y, z) => Arc(x, y, z).hasSides(3); Shape.prototype.Triangle = shapeMethod(Triangle); diff --git a/dist/jsxcad-api-v1.js b/dist/jsxcad-api-v1.js index f51bbe2a..a3da41e4 100644 --- a/dist/jsxcad-api-v1.js +++ b/dist/jsxcad-api-v1.js @@ -1,7 +1,7 @@ -import { getModule, generateUniqueId, addPending, write, emit, getControlValue, addSource, addOnEmitHandler, read, elapsed, info, pushModule, popModule } from './jsxcad-sys.js'; +import { getModule, generateUniqueId, addPending, write, emit, getControlValue, addSource, hash, addOnEmitHandler, read, elapsed, info, pushModule, popModule } from './jsxcad-sys.js'; export { elapsed, emit, info, read, write } from './jsxcad-sys.js'; -import Shape, { Shape as Shape$1, loadGeometry, log, saveGeometry } from './jsxcad-api-v1-shape.js'; -export { Shape, loadGeometry, log, saveGeometry } from './jsxcad-api-v1-shape.js'; +import Shape, { Shape as Shape$1, add, and, addTo, align, as, bend, clip, clipFrom, color, colors, cut, cutFrom, drop, fuse, grow, inset, keep, loadGeometry, loft, log, loop, material, minkowskiDifference, minkowskiShell, minkowskiSum, move, noVoid, notAs, offset, op, pack, push, peg, remesh, rotate, rx, ry, rz, rotateX, rotateY, rotateZ, saveGeometry, scale, smooth, size, sketch, split, tags, test, tint, tool, twist, voidFn, weld, withFn, withInset, withOp, x, y, z } from './jsxcad-api-v1-shape.js'; +export { Shape, add, addTo, align, and, as, bend, clip, clipFrom, color, colors, cut, cutFrom, drop, fuse, grow, inset, keep, loadGeometry, loft, log, loop, material, minkowskiDifference, minkowskiShell, minkowskiSum, move, noVoid, notAs, offset, op, pack, peg, push, remesh, rotate, rotateX, rotateY, rotateZ, rx, ry, rz, saveGeometry, scale, size, sketch, smooth, split, tags, test, tint, tool, twist, voidFn, weld, withFn, withInset, withOp, x, y, z } from './jsxcad-api-v1-shape.js'; import { ensurePages, Peg, Arc, Assembly, Box, ChainedHull, Cone, Empty, Group, Hershey, Hexagon, Hull, Icosahedron, Implicit, Line, LoopedHull, Octagon, Orb, Page, Path, Pentagon, Plan, Plane, Point, Points, Polygon, Polyhedron, Septagon, Spiral, Tetragon, Triangle, Wave, Weld, ofPlan } from './jsxcad-api-v1-shapes.js'; export { Arc, Assembly, Box, ChainedHull, Cone, Empty, Group, Hershey, Hexagon, Hull, Icosahedron, Implicit, Line, LoopedHull, Octagon, Orb, Page, Path, Peg, Pentagon, Plan, Plane, Point, Points, Polygon, Polyhedron, Septagon, Spiral, Tetragon, Triangle, Wave, Weld, ofPlan } from './jsxcad-api-v1-shapes.js'; import './jsxcad-api-v1-extrude.js'; @@ -28,9 +28,12 @@ import { toSvg } from './jsxcad-convert-svg.js'; // FIX: Avoid the extra read-write cycle. const view = ( shape, - { size, triangles = true, outline = true, wireframe = false }, - op = (x) => x, { + size, + skin = true, + outline = true, + wireframe = false, + prepareView = (x) => x, inline, width = 1024, height = 512, @@ -43,9 +46,9 @@ const view = ( width = size; height = size / 2; } - const viewShape = op(shape); + const viewShape = prepareView(shape); for (const entry of ensurePages( - viewShape.toDisplayGeometry({ triangles, outline, wireframe }) + viewShape.toDisplayGeometry({ skin, outline, wireframe }) )) { const path = `view/${getModule()}/${generateUniqueId()}`; addPending(write(path, entry)); @@ -55,19 +58,25 @@ const view = ( return shape; }; -Shape.prototype.view = function ( - { size = 512, triangles = true, outline = true, wireframe = false } = {}, - op, - { - path, - width = 1024, - height = 512, - position = [100, -100, 100], - withAxes, - withGrid, - } = {} -) { - return view(this, { size, triangles, outline, wireframe }, op, { +Shape.prototype.view = function ({ + size = 512, + skin = true, + outline = true, + wireframe = false, + prepareView, + path, + width = 1024, + height = 512, + position = [100, -100, 100], + withAxes, + withGrid, +} = {}) { + return view(this, { + size, + skin, + outline, + wireframe, + prepareView, path, width, height, @@ -77,19 +86,25 @@ Shape.prototype.view = function ( }); }; -Shape.prototype.topView = function ( - { size = 512, triangles = true, outline = true, wireframe = false } = {}, - op, - { - path, - width = 1024, - height = 512, - position = [0, 0, 100], - withAxes, - withGrid, - } = {} -) { - return view(this, { size, triangles, outline, wireframe }, op, { +Shape.prototype.topView = function ({ + size = 512, + skin = true, + outline = true, + wireframe = false, + prepareView, + path, + width = 1024, + height = 512, + position = [0, 0, 100], + withAxes, + withGrid, +} = {}) { + return view(this, { + size, + skin, + outline, + wireframe, + prepareView, path, width, height, @@ -99,19 +114,25 @@ Shape.prototype.topView = function ( }); }; -Shape.prototype.gridView = function ( - { size = 512, triangles = true, outline = true, wireframe = false } = {}, - op, - { - path, - width = 1024, - height = 512, - position = [0, 0, 100], - withAxes, - withGrid = true, - } = {} -) { - return view(this, { size, triangles, outline, wireframe }, op, { +Shape.prototype.gridView = function ({ + size = 512, + skin = true, + outline = true, + wireframe = false, + prepareView, + path, + width = 1024, + height = 512, + position = [0, 0, 100], + withAxes, + withGrid = true, +} = {}) { + return view(this, { + size, + skin, + outline, + wireframe, + prepareView, path, width, height, @@ -121,19 +142,25 @@ Shape.prototype.gridView = function ( }); }; -Shape.prototype.frontView = function ( - { size = 512, triangles = true, outline = true, wireframe = false } = {}, - op, - { - path, - width = 1024, - height = 512, - position = [0, -100, 0], - withAxes, - withGrid, - } = {} -) { - return view(this, { size, triangles, outline, wireframe }, op, { +Shape.prototype.frontView = function ({ + size = 512, + skin = true, + outline = true, + wireframe = false, + prepareView, + path, + width = 1024, + height = 512, + position = [0, -100, 0], + withAxes, + withGrid, +} = {}) { + return view(this, { + size, + skin, + outline, + wireframe, + prepareView, path, width, height, @@ -143,19 +170,25 @@ Shape.prototype.frontView = function ( }); }; -Shape.prototype.sideView = function ( - { size = 512, triangles = true, outline = true, wireframe = false } = {}, - op, - { - path, - width = 1024, - height = 512, - position = [100, 0, 0], - withAxes, - withGrid, - } = {} -) { - return view(this, { size, triangles, outline, wireframe }, op, { +Shape.prototype.sideView = function ({ + size = 512, + skin = true, + outline = true, + wireframe = false, + prepareView, + path, + width = 1024, + height = 512, + position = [100, 0, 0], + withAxes, + withGrid, +} = {}) { + return view(this, { + size, + skin, + outline, + wireframe, + prepareView, path, width, height, @@ -382,7 +415,10 @@ const recordNote = (note, index) => { } }; -const beginRecordingNotes = () => { +const beginRecordingNotes = (path, id, sourceLocation) => { + const setContext = { recording: { path, id } }; + emit({ hash: hash(setContext), setContext }); + if (handler === undefined) { handler = addOnEmitHandler(recordNote); } @@ -390,15 +426,19 @@ const beginRecordingNotes = () => { notes = []; }; -const saveRecordedNotes = (path) => { +const saveRecordedNotes = (path, id) => { let notesToSave = notes; notes = undefined; recording = false; - addPending(write(path, notesToSave)); + addPending(write(`data/note/${path}/${id}`, notesToSave)); }; -const replayRecordedNotes = async (path) => { - const notes = await read(path); +const replayRecordedNotes = async (path, id) => { + const setContext = { recording: { path, id } }; + emit({ hash: hash(setContext), setContext }); + + const notes = await read(`data/note/${path}/${id}`); + if (notes === undefined) { return; } @@ -419,15 +459,15 @@ const replayRecordedNotes = async (path) => { * the api uses. */ -const x = Peg('x', [0, 0, 0], [0, 0, 1], [0, -1, 0]); -const y = Peg('y', [0, 0, 0], [0, 0, 1], [1, 0, 0]); -const z = Peg('z', [0, 0, 0], [0, 1, 0], [-1, 0, 0]); +const yz = Peg('x', [0, 0, 0], [0, 0, 1], [0, -1, 0]); +const xz = Peg('y', [0, 0, 0], [0, 0, 1], [1, 0, 0]); +const xy = Peg('z', [0, 0, 0], [0, 1, 0], [-1, 0, 0]); var api = /*#__PURE__*/Object.freeze({ __proto__: null, - x: x, - y: y, - z: z, + yz: yz, + xz: xz, + xy: xy, define: define, defGrblConstantLaser: defGrblConstantLaser, defGrblDynamicLaser: defGrblDynamicLaser, @@ -450,9 +490,66 @@ var api = /*#__PURE__*/Object.freeze({ replayRecordedNotes: replayRecordedNotes, saveRecordedNotes: saveRecordedNotes, Shape: Shape$1, + add: add, + and: and, + addTo: addTo, + align: align, + as: as, + bend: bend, + clip: clip, + clipFrom: clipFrom, + color: color, + colors: colors, + cut: cut, + cutFrom: cutFrom, + drop: drop, + fuse: fuse, + grow: grow, + inset: inset, + keep: keep, loadGeometry: loadGeometry, + loft: loft, log: log, + loop: loop, + material: material, + minkowskiDifference: minkowskiDifference, + minkowskiShell: minkowskiShell, + minkowskiSum: minkowskiSum, + move: move, + noVoid: noVoid, + notAs: notAs, + offset: offset, + op: op, + pack: pack, + push: push, + peg: peg, + remesh: remesh, + rotate: rotate, + rx: rx, + ry: ry, + rz: rz, + rotateX: rotateX, + rotateY: rotateY, + rotateZ: rotateZ, saveGeometry: saveGeometry, + scale: scale, + smooth: smooth, + size: size, + sketch: sketch, + split: split, + tags: tags, + test: test, + tint: tint, + tool: tool, + twist: twist, + voidFn: voidFn, + weld: weld, + withFn: withFn, + withInset: withInset, + withOp: withOp, + x: x, + y: y, + z: z, Arc: Arc, Assembly: Assembly, Box: Box, @@ -587,4 +684,4 @@ registerDynamicModule(module('svg'), './jsxcad-api-v1-svg.js'); registerDynamicModule(module('threejs'), './jsxcad-api-v1-threejs.js'); registerDynamicModule(module('units'), './jsxcad-api-v1-units.js'); -export { beginRecordingNotes, card, control, defGrblConstantLaser, defGrblDynamicLaser, defGrblPlotter, defGrblSpindle, defRgbColor, defThreejsMaterial, defTool, define, emitSourceLocation, importModule, md, replayRecordedNotes, saveRecordedNotes, source, x, y, z }; +export { beginRecordingNotes, card, control, defGrblConstantLaser, defGrblDynamicLaser, defGrblPlotter, defGrblSpindle, defRgbColor, defThreejsMaterial, defTool, define, emitSourceLocation, importModule, md, replayRecordedNotes, saveRecordedNotes, source, xy, xz, yz }; diff --git a/dist/jsxcad-cache.js b/dist/jsxcad-cache.js index 121e6e7b..4bedbfc5 100644 --- a/dist/jsxcad-cache.js +++ b/dist/jsxcad-cache.js @@ -1,6 +1,69 @@ var HAS_WEAKSET_SUPPORT = typeof WeakSet === 'function'; var keys = Object.keys; /** + * @function addToCache + * + * add object to cache if an object + * + * @param value the value to potentially add to cache + * @param cache the cache to add to + */ +function addToCache(value, cache) { + if (value && typeof value === 'object') { + cache.add(value); + } +} +/** + * @function hasPair + * + * @description + * does the `pairToMatch` exist in the list of `pairs` provided based on the + * `isEqual` check + * + * @param pairs the pairs to compare against + * @param pairToMatch the pair to match + * @param isEqual the equality comparator used + * @param meta the meta provided + * @returns does the pair exist in the pairs provided + */ +function hasPair(pairs, pairToMatch, isEqual, meta) { + var length = pairs.length; + var pair; + for (var index = 0; index < length; index++) { + pair = pairs[index]; + if (isEqual(pair[0], pairToMatch[0], meta) && + isEqual(pair[1], pairToMatch[1], meta)) { + return true; + } + } + return false; +} +/** + * @function hasValue + * + * @description + * does the `valueToMatch` exist in the list of `values` provided based on the + * `isEqual` check + * + * @param values the values to compare against + * @param valueToMatch the value to match + * @param isEqual the equality comparator used + * @param meta the meta provided + * @returns does the value exist in the values provided + */ +function hasValue(values, valueToMatch, isEqual, meta) { + var length = values.length; + for (var index = 0; index < length; index++) { + if (isEqual(values[index], valueToMatch, meta)) { + return true; + } + } + return false; +} +/** + * @function sameValueZeroEqual + * + * @description * are the values passed strictly equal or both NaN * * @param a the value to compare against @@ -11,6 +74,9 @@ function sameValueZeroEqual(a, b) { return a === b || (a !== a && b !== b); } /** + * @function isPlainObject + * + * @description * is the value a plain object * * @param value the value to test @@ -20,6 +86,9 @@ function isPlainObject(value) { return value.constructor === Object || value.constructor == null; } /** + * @function isPromiseLike + * + * @description * is the value promise-like (meaning it is thenable) * * @param value the value to test @@ -29,6 +98,9 @@ function isPromiseLike(value) { return !!value && typeof value.then === 'function'; } /** + * @function isReactElement + * + * @description * is the value passed a react element * * @param value the value to test @@ -38,23 +110,29 @@ function isReactElement(value) { return !!(value && value.$$typeof); } /** + * @function getNewCacheFallback + * + * @description * in cases where WeakSet is not supported, creates a new custom * object that mimics the necessary API aspects for cache purposes * * @returns the new cache object */ function getNewCacheFallback() { - var values = []; - return { + return Object.create({ + _values: [], add: function (value) { - values.push(value); + this._values.push(value); }, has: function (value) { - return values.indexOf(value) !== -1; + return this._values.indexOf(value) !== -1; }, - }; + }); } /** + * @function getNewCache + * + * @description * get a new cache object to prevent circular references * * @returns the new cache object @@ -68,6 +146,9 @@ var getNewCache = (function (canUseWeakMap) { return getNewCacheFallback; })(HAS_WEAKSET_SUPPORT); /** + * @function createCircularEqualCreator + * + * @description * create a custom isEqual handler specific to circular objects * * @param [isEqual] the isEqual comparator to use instead of isDeepEqual @@ -78,26 +159,55 @@ function createCircularEqualCreator(isEqual) { var _comparator = isEqual || comparator; return function circularEqual(a, b, cache) { if (cache === void 0) { cache = getNewCache(); } - var isCacheableA = !!a && typeof a === 'object'; - var isCacheableB = !!b && typeof b === 'object'; - if (isCacheableA || isCacheableB) { - var hasA = isCacheableA && cache.has(a); - var hasB = isCacheableB && cache.has(b); - if (hasA || hasB) { - return hasA && hasB; - } - if (isCacheableA) { - cache.add(a); - } - if (isCacheableB) { - cache.add(b); - } + var hasA = cache.has(a); + var hasB = cache.has(b); + if (hasA || hasB) { + return hasA && hasB; } + addToCache(a, cache); + addToCache(b, cache); return _comparator(a, b, cache); }; }; } /** + * @function toPairs + * + * @description + * convert the map passed into pairs (meaning an array of [key, value] tuples) + * + * @param map the map to convert to [key, value] pairs (entries) + * @returns the [key, value] pairs + */ +function toPairs(map) { + var pairs = new Array(map.size); + var index = 0; + map.forEach(function (value, key) { + pairs[index++] = [key, value]; + }); + return pairs; +} +/** + * @function toValues + * + * @description + * convert the set passed into values + * + * @param set the set to convert to values + * @returns the values + */ +function toValues(set) { + var values = new Array(set.size); + var index = 0; + set.forEach(function (value) { + values[index++] = value; + }); + return values; +} +/** + * @function areArraysEqual + * + * @description * are the arrays equal in value * * @param a the array to test @@ -107,11 +217,11 @@ function createCircularEqualCreator(isEqual) { * @returns are the arrays equal */ function areArraysEqual(a, b, isEqual, meta) { - var index = a.length; - if (b.length !== index) { + var length = a.length; + if (b.length !== length) { return false; } - while (index-- > 0) { + for (var index = 0; index < length; index++) { if (!isEqual(a[index], b[index], meta)) { return false; } @@ -119,6 +229,9 @@ function areArraysEqual(a, b, isEqual, meta) { return true; } /** + * @function areMapsEqual + * + * @description * are the maps equal in value * * @param a the map to test @@ -128,24 +241,26 @@ function areArraysEqual(a, b, isEqual, meta) { * @returns are the maps equal */ function areMapsEqual(a, b, isEqual, meta) { - var isValueEqual = a.size === b.size; - if (isValueEqual && a.size) { - a.forEach(function (aValue, aKey) { - if (isValueEqual) { - isValueEqual = false; - b.forEach(function (bValue, bKey) { - if (!isValueEqual && isEqual(aKey, bKey, meta)) { - isValueEqual = isEqual(aValue, bValue, meta); - } - }); - } - }); + if (a.size !== b.size) { + return false; } - return isValueEqual; + var pairsA = toPairs(a); + var pairsB = toPairs(b); + var length = pairsA.length; + for (var index = 0; index < length; index++) { + if (!hasPair(pairsB, pairsA[index], isEqual, meta) || + !hasPair(pairsA, pairsB[index], isEqual, meta)) { + return false; + } + } + return true; } var OWNER = '_owner'; var hasOwnProperty = Function.prototype.bind.call(Function.prototype.call, Object.prototype.hasOwnProperty); /** + * @function areObjectsEqual + * + * @description * are the objects equal in value * * @param a the object to test @@ -156,30 +271,31 @@ var hasOwnProperty = Function.prototype.bind.call(Function.prototype.call, Objec */ function areObjectsEqual(a, b, isEqual, meta) { var keysA = keys(a); - var index = keysA.length; - if (keys(b).length !== index) { + var length = keysA.length; + if (keys(b).length !== length) { return false; } - if (index) { - var key = void 0; - while (index-- > 0) { - key = keysA[index]; - if (key === OWNER) { - var reactElementA = isReactElement(a); - var reactElementB = isReactElement(b); - if ((reactElementA || reactElementB) && - reactElementA !== reactElementB) { - return false; - } - } - if (!hasOwnProperty(b, key) || !isEqual(a[key], b[key], meta)) { + var key; + for (var index = 0; index < length; index++) { + key = keysA[index]; + if (!hasOwnProperty(b, key)) { + return false; + } + if (key === OWNER && isReactElement(a)) { + if (!isReactElement(b)) { return false; } } + else if (!isEqual(a[key], b[key], meta)) { + return false; + } } return true; } /** + * @function areRegExpsEqual + * + * @description * are the regExps equal in value * * @param a the regExp to test @@ -196,6 +312,9 @@ function areRegExpsEqual(a, b) { a.lastIndex === b.lastIndex); } /** + * @function areSetsEqual + * + * @description * are the sets equal in value * * @param a the set to test @@ -205,24 +324,25 @@ function areRegExpsEqual(a, b) { * @returns are the sets equal */ function areSetsEqual(a, b, isEqual, meta) { - var isValueEqual = a.size === b.size; - if (isValueEqual && a.size) { - a.forEach(function (aValue) { - if (isValueEqual) { - isValueEqual = false; - b.forEach(function (bValue) { - if (!isValueEqual) { - isValueEqual = isEqual(aValue, bValue, meta); - } - }); - } - }); + if (a.size !== b.size) { + return false; } - return isValueEqual; + var valuesA = toValues(a); + var valuesB = toValues(b); + var length = valuesA.length; + for (var index = 0; index < length; index++) { + if (!hasValue(valuesB, valuesA[index], isEqual, meta) || + !hasValue(valuesA, valuesB[index], isEqual, meta)) { + return false; + } + } + return true; } +var isArray = Array.isArray; var HAS_MAP_SUPPORT = typeof Map === 'function'; var HAS_SET_SUPPORT = typeof Set === 'function'; +var OBJECT_TYPEOF = 'object'; function createComparator(createIsEqual) { var isEqual = /* eslint-disable no-use-before-define */ @@ -231,6 +351,9 @@ function createComparator(createIsEqual) { : comparator; /* eslint-enable */ /** + * @function comparator + * + * @description * compare the value of the two objects and return true if they are equivalent in values * * @param a the value to test against @@ -239,52 +362,53 @@ function createComparator(createIsEqual) { * @returns are a and b equivalent in value */ function comparator(a, b, meta) { - if (a === b) { + if (sameValueZeroEqual(a, b)) { return true; } - if (a && b && typeof a === 'object' && typeof b === 'object') { + if (a && b && typeof a === OBJECT_TYPEOF && typeof b === OBJECT_TYPEOF) { if (isPlainObject(a) && isPlainObject(b)) { return areObjectsEqual(a, b, isEqual, meta); } - var aShape = Array.isArray(a); - var bShape = Array.isArray(b); - if (aShape || bShape) { - return aShape === bShape && areArraysEqual(a, b, isEqual, meta); + var arrayA = isArray(a); + var arrayB = isArray(b); + if (arrayA || arrayB) { + return arrayA === arrayB && areArraysEqual(a, b, isEqual, meta); } - aShape = a instanceof Date; - bShape = b instanceof Date; - if (aShape || bShape) { - return (aShape === bShape && sameValueZeroEqual(a.getTime(), b.getTime())); + var aDate = a instanceof Date; + var bDate = b instanceof Date; + if (aDate || bDate) { + return aDate === bDate && sameValueZeroEqual(a.getTime(), b.getTime()); } - aShape = a instanceof RegExp; - bShape = b instanceof RegExp; - if (aShape || bShape) { - return aShape === bShape && areRegExpsEqual(a, b); + var aRegExp = a instanceof RegExp; + var bRegExp = b instanceof RegExp; + if (aRegExp || bRegExp) { + return aRegExp === bRegExp && areRegExpsEqual(a, b); } if (isPromiseLike(a) || isPromiseLike(b)) { return a === b; } if (HAS_MAP_SUPPORT) { - aShape = a instanceof Map; - bShape = b instanceof Map; - if (aShape || bShape) { - return aShape === bShape && areMapsEqual(a, b, isEqual, meta); + var aMap = a instanceof Map; + var bMap = b instanceof Map; + if (aMap || bMap) { + return aMap === bMap && areMapsEqual(a, b, isEqual, meta); } } if (HAS_SET_SUPPORT) { - aShape = a instanceof Set; - bShape = b instanceof Set; - if (aShape || bShape) { - return aShape === bShape && areSetsEqual(a, b, isEqual, meta); + var aSet = a instanceof Set; + var bSet = b instanceof Set; + if (aSet || bSet) { + return aSet === bSet && areSetsEqual(a, b, isEqual, meta); } } return areObjectsEqual(a, b, isEqual, meta); } - return a !== a && b !== b; + return false; } return comparator; } +// comparator var deepEqual = createComparator(); createComparator(function () { return sameValueZeroEqual; }); createComparator(createCircularEqualCreator()); diff --git a/dist/jsxcad-compiler.js b/dist/jsxcad-compiler.js index 5e254bfc..79cf518e 100644 --- a/dist/jsxcad-compiler.js +++ b/dist/jsxcad-compiler.js @@ -1072,7 +1072,7 @@ function createCommonjsModule(fn, module) { } var object_hash = createCommonjsModule(function (module, exports) { -!function(e){module.exports=e();}(function(){return function o(i,u,a){function s(n,e){if(!u[n]){if(!i[n]){var t="function"==typeof commonjsRequire&&commonjsRequire;if(!e&&t)return t(n,!0);if(f)return f(n,!0);throw new Error("Cannot find module '"+n+"'")}var r=u[n]={exports:{}};i[n][0].call(r.exports,function(e){var t=i[n][1][e];return s(t||e)},r,r.exports,o,i,u,a);}return u[n].exports}for(var f="function"==typeof commonjsRequire&&commonjsRequire,e=0;e>16),s((65280&n)>>8),s(255&n);return 2==o?s(255&(n=c(e.charAt(t))<<2|c(e.charAt(t+1))>>4)):1==o&&(s((n=c(e.charAt(t))<<10|c(e.charAt(t+1))<<4|c(e.charAt(t+2))>>2)>>8&255),s(255&n)),i},e.fromByteArray=function(e){var t,n,r,o,i=e.length%3,u="";function a(e){return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,r=e.length-i;t>18&63)+a(o>>12&63)+a(o>>6&63)+a(63&o);switch(i){case 1:u+=a((n=e[e.length-1])>>2),u+=a(n<<4&63),u+="==";break;case 2:u+=a((n=(e[e.length-2]<<8)+e[e.length-1])>>10),u+=a(n>>4&63),u+=a(n<<2&63),u+="=";}return u};}(void 0===f?this.base64js={}:f);}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib");},{buffer:3,lYpoI2:10}],3:[function(O,e,H){(function(e,t,g,n,r,o,i,u,a){var s=O("base64-js"),f=O("ieee754");function g(e,t,n){if(!(this instanceof g))return new g(e,t,n);var r,o,i,u,a,s=typeof e;if("base64"===t&&"string"==s)for(e=(r=e).trim?r.trim():r.replace(/^\s+|\s+$/g,"");e.length%4!=0;)e+="=";if("number"==s)o=x(e);else if("string"==s)o=g.byteLength(e,t);else {if("object"!=s)throw new Error("First argument needs to be a number, array or string.");o=x(e.length);}if(g._useTypedArrays?i=g._augment(new Uint8Array(o)):((i=this).length=o,i._isBuffer=!0),g._useTypedArrays&&"number"==typeof e.byteLength)i._set(e);else if(S(a=e)||g.isBuffer(a)||a&&"object"==typeof a&&"number"==typeof a.length)for(u=0;u>8,r=t%256,o.push(r),o.push(n);return o}(t),e,n,r)}function c(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o>>0)):(t+1>>0),o}function h(e,t,n,r){if(r||(D("boolean"==typeof n,"missing or invalid endian"),D(null!=t,"missing offset"),D(t+1>>8*(r?u:1-u);}function _(e,t,n,r,o){o||(D(null!=t,"missing value"),D("boolean"==typeof r,"missing or invalid endian"),D(null!=n,"missing offset"),D(n+3>>8*(r?u:3-u)&255;}function E(e,t,n,r,o){o||(D(null!=t,"missing value"),D("boolean"==typeof r,"missing or invalid endian"),D(null!=n,"missing offset"),D(n+1this.length&&(r=this.length),e.length-t=this.length))return this[e]},g.prototype.readUInt16LE=function(e,t){return l(this,e,!0,t)},g.prototype.readUInt16BE=function(e,t){return l(this,e,!1,t)},g.prototype.readUInt32LE=function(e,t){return d(this,e,!0,t)},g.prototype.readUInt32BE=function(e,t){return d(this,e,!1,t)},g.prototype.readInt8=function(e,t){if(t||(D(null!=e,"missing offset"),D(e=this.length))return 128&this[e]?-1*(255-this[e]+1):this[e]},g.prototype.readInt16LE=function(e,t){return h(this,e,!0,t)},g.prototype.readInt16BE=function(e,t){return h(this,e,!1,t)},g.prototype.readInt32LE=function(e,t){return p(this,e,!0,t)},g.prototype.readInt32BE=function(e,t){return p(this,e,!1,t)},g.prototype.readFloatLE=function(e,t){return b(this,e,!0,t)},g.prototype.readFloatBE=function(e,t){return b(this,e,!1,t)},g.prototype.readDoubleLE=function(e,t){return m(this,e,!0,t)},g.prototype.readDoubleBE=function(e,t){return m(this,e,!1,t)},g.prototype.writeUInt8=function(e,t,n){n||(D(null!=e,"missing value"),D(null!=t,"missing offset"),D(t=this.length||(this[t]=e);},g.prototype.writeUInt16LE=function(e,t,n){v(this,e,t,!0,n);},g.prototype.writeUInt16BE=function(e,t,n){v(this,e,t,!1,n);},g.prototype.writeUInt32LE=function(e,t,n){_(this,e,t,!0,n);},g.prototype.writeUInt32BE=function(e,t,n){_(this,e,t,!1,n);},g.prototype.writeInt8=function(e,t,n){n||(D(null!=e,"missing value"),D(null!=t,"missing offset"),D(t=this.length||(0<=e?this.writeUInt8(e,t,n):this.writeUInt8(255+e+1,t,n));},g.prototype.writeInt16LE=function(e,t,n){E(this,e,t,!0,n);},g.prototype.writeInt16BE=function(e,t,n){E(this,e,t,!1,n);},g.prototype.writeInt32LE=function(e,t,n){I(this,e,t,!0,n);},g.prototype.writeInt32BE=function(e,t,n){I(this,e,t,!1,n);},g.prototype.writeFloatLE=function(e,t,n){A(this,e,t,!0,n);},g.prototype.writeFloatBE=function(e,t,n){A(this,e,t,!1,n);},g.prototype.writeDoubleLE=function(e,t,n){B(this,e,t,!0,n);},g.prototype.writeDoubleBE=function(e,t,n){B(this,e,t,!1,n);},g.prototype.fill=function(e,t,n){if(e=e||0,t=t||0,n=n||this.length,"string"==typeof e&&(e=e.charCodeAt(0)),D("number"==typeof e&&!isNaN(e),"value is not a number"),D(t<=n,"end < start"),n!==t&&0!==this.length){D(0<=t&&t"},g.prototype.toArrayBuffer=function(){if("undefined"==typeof Uint8Array)throw new Error("Buffer.toArrayBuffer not supported in this browser");if(g._useTypedArrays)return new g(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;t=t.length||o>=e.length);o++)t[o+n]=e[o];return o}function M(e){try{return decodeURIComponent(e)}catch(e){return String.fromCharCode(65533)}}function N(e,t){D("number"==typeof e,"cannot write a non-number as a number"),D(0<=e,"specified a negative value for writing an unsigned value"),D(e<=t,"value is larger than maximum value for type"),D(Math.floor(e)===e,"value has a fractional component");}function Y(e,t,n){D("number"==typeof e,"cannot write a non-number as a number"),D(e<=t,"value larger than maximum allowed value"),D(n<=e,"value smaller than minimum allowed value"),D(Math.floor(e)===e,"value has a fractional component");}function F(e,t,n){D("number"==typeof e,"cannot write a non-number as a number"),D(e<=t,"value larger than maximum allowed value"),D(n<=e,"value smaller than minimum allowed value");}function D(e,t){if(!e)throw new Error(t||"Failed assertion")}g._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=L.get,e.set=L.set,e.write=L.write,e.toString=L.toString,e.toLocaleString=L.toString,e.toJSON=L.toJSON,e.copy=L.copy,e.slice=L.slice,e.readUInt8=L.readUInt8,e.readUInt16LE=L.readUInt16LE,e.readUInt16BE=L.readUInt16BE,e.readUInt32LE=L.readUInt32LE,e.readUInt32BE=L.readUInt32BE,e.readInt8=L.readInt8,e.readInt16LE=L.readInt16LE,e.readInt16BE=L.readInt16BE,e.readInt32LE=L.readInt32LE,e.readInt32BE=L.readInt32BE,e.readFloatLE=L.readFloatLE,e.readFloatBE=L.readFloatBE,e.readDoubleLE=L.readDoubleLE,e.readDoubleBE=L.readDoubleBE,e.writeUInt8=L.writeUInt8,e.writeUInt16LE=L.writeUInt16LE,e.writeUInt16BE=L.writeUInt16BE,e.writeUInt32LE=L.writeUInt32LE,e.writeUInt32BE=L.writeUInt32BE,e.writeInt8=L.writeInt8,e.writeInt16LE=L.writeInt16LE,e.writeInt16BE=L.writeInt16BE,e.writeInt32LE=L.writeInt32LE,e.writeInt32BE=L.writeInt32BE,e.writeFloatLE=L.writeFloatLE,e.writeFloatBE=L.writeFloatBE,e.writeDoubleLE=L.writeDoubleLE,e.writeDoubleBE=L.writeDoubleBE,e.fill=L.fill,e.inspect=L.inspect,e.toArrayBuffer=L.toArrayBuffer,e};}).call(this,O("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},O("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer");},{"base64-js":2,buffer:3,ieee754:11,lYpoI2:10}],4:[function(l,d,e){(function(e,t,u,n,r,o,i,a,s){var u=l("buffer").Buffer,f=4,c=new u(f);c.fill(0);d.exports={hash:function(e,t,n,r){return u.isBuffer(e)||(e=new u(e)),function(e,t,n){for(var r=new u(t),o=n?r.writeInt32BE:r.writeInt32LE,i=0;ih?t=e(t):t.length>5]|=128<>>9<<4)]=t;for(var n=1732584193,r=-271733879,o=-1732584194,i=271733878,u=0;u>>32-a,n);var u,a;}function d(e,t,n,r,o,i,u){return l(t&n|~t&r,e,t,o,i,u)}function h(e,t,n,r,o,i,u){return l(t&r|n&~r,e,t,o,i,u)}function p(e,t,n,r,o,i,u){return l(t^n^r,e,t,o,i,u)}function g(e,t,n,r,o,i,u){return l(n^(t|~r),e,t,o,i,u)}function y(e,t){var n=(65535&e)+(65535&t);return (e>>16)+(t>>16)+(n>>16)<<16|65535&n}b.exports=function(e){return f.hash(e,c,16)};}).call(this,w("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},w("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify");},{"./helpers":4,buffer:3,lYpoI2:10}],7:[function(e,l,t){(function(e,t,n,r,o,i,u,a,s){var c;c=function(e){for(var t,n=new Array(e),r=0;r>>((3&r)<<3)&255;return n},l.exports=c;}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify");},{buffer:3,lYpoI2:10}],8:[function(l,d,e){(function(e,t,n,r,o,i,u,a,s){var f=l("./helpers");function c(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var n,r,o,i,u,a=Array(80),s=1732584193,f=-271733879,c=-1732584194,l=271733878,d=-1009589776,h=0;h>16)+(t>>16)+(n>>16)<<16|65535&n}function E(e,t){return e<>>32-t}d.exports=function(e){return f.hash(e,c,20,!0)};}).call(this,l("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},l("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify");},{"./helpers":4,buffer:3,lYpoI2:10}],9:[function(l,d,e){(function(e,t,n,r,o,i,u,a,s){function B(e,t){var n=(65535&e)+(65535&t);return (e>>16)+(t>>16)+(n>>16)<<16|65535&n}function L(e,t){return e>>>t|e<<32-t}function f(e,t){var n,r,o,i,u,a,s,f,c,l,d=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),h=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),p=new Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var g,y,w,b,m,v,_,E,I=0;I>>10),p[A-7]),(_=p[A-15],L(_,7)^L(_,18)^_>>>3)),p[A-16]),c=B(B(B(B(f,L(v=u,6)^L(v,11)^L(v,25)),(m=u)&a^~m&s),d[A]),p[A]),l=B(L(b=n,2)^L(b,13)^L(b,22),(g=n)&(y=r)^g&(w=o)^y&w),f=s,s=a,a=u,u=B(i,c),i=o,o=r,r=n,n=B(c,l);h[0]=B(n,h[0]),h[1]=B(r,h[1]),h[2]=B(o,h[2]),h[3]=B(i,h[3]),h[4]=B(u,h[4]),h[5]=B(a,h[5]),h[6]=B(s,h[6]),h[7]=B(f,h[7]);}return h}var c=l("./helpers");d.exports=function(e){return c.hash(e,f,32,!0)};}).call(this,l("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},l("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify");},{"./helpers":4,buffer:3,lYpoI2:10}],10:[function(e,c,t){(function(e,t,n,r,o,i,u,a,s){function f(){}(e=c.exports={}).nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var n=[];return window.addEventListener("message",function(e){var t=e.source;t!==window&&null!==t||"process-tick"!==e.data||(e.stopPropagation(),0>1,c=-7,l=n?o-1:0,d=n?-1:1,h=e[t+l];for(l+=d,i=h&(1<<-c)-1,h>>=-c,c+=a;0>=-c,c+=r;0>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,u=c):(u=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-u))<1&&(u--,s*=2),2<=(t+=1<=u+l?d/s:d*Math.pow(2,1-l))*s&&(u++,s/=2),c<=u+l?(a=0,u=c):1<=u+l?(a=(t*s-1)*Math.pow(2,o),u+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,o),u=0));8<=o;e[n+h]=255&a,h+=p,a/=256,o-=8);for(u=u<>16),s((65280&r)>>8),s(255&r);return 2==o?s(255&(r=c(e.charAt(t))<<2|c(e.charAt(t+1))>>4)):1==o&&(s((r=c(e.charAt(t))<<10|c(e.charAt(t+1))<<4|c(e.charAt(t+2))>>2)>>8&255),s(255&r)),i},e.fromByteArray=function(e){var t,n,r,o,i=e.length%3,u="";function a(e){return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,r=e.length-i;t>18&63)+a(o>>12&63)+a(o>>6&63)+a(63&o);switch(i){case 1:u+=a((n=e[e.length-1])>>2),u+=a(n<<4&63),u+="==";break;case 2:u+=a((n=(e[e.length-2]<<8)+e[e.length-1])>>10),u+=a(n>>4&63),u+=a(n<<2&63),u+="=";}return u};}(void 0===f?this.base64js={}:f);}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib");},{buffer:3,lYpoI2:10}],3:[function(O,e,H){(function(e,t,h,n,r,o,i,u,a){var s=O("base64-js"),f=O("ieee754");function h(e,t,n){if(!(this instanceof h))return new h(e,t,n);var r,o,i,u,a,s=typeof e;if("base64"===t&&"string"==s)for(e=(r=e).trim?r.trim():r.replace(/^\s+|\s+$/g,"");e.length%4!=0;)e+="=";if("number"==s)o=x(e);else if("string"==s)o=h.byteLength(e,t);else {if("object"!=s)throw new Error("First argument needs to be a number, array or string.");o=x(e.length);}if(h._useTypedArrays?i=h._augment(new Uint8Array(o)):((i=this).length=o,i._isBuffer=!0),h._useTypedArrays&&"number"==typeof e.byteLength)i._set(e);else if(S(a=e)||h.isBuffer(a)||a&&"object"==typeof a&&"number"==typeof a.length)for(u=0;u>8,r=t%256,o.push(r),o.push(n);return o}(t),e,n,r)}function c(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o>>0)):(t+1>>0),o}function y(e,t,n,r){if(r||(D("boolean"==typeof n,"missing or invalid endian"),D(null!=t,"missing offset"),D(t+1>>8*(r?u:1-u);}function _(e,t,n,r,o){o||(D(null!=t,"missing value"),D("boolean"==typeof r,"missing or invalid endian"),D(null!=n,"missing offset"),D(n+3>>8*(r?u:3-u)&255;}function E(e,t,n,r,o){o||(D(null!=t,"missing value"),D("boolean"==typeof r,"missing or invalid endian"),D(null!=n,"missing offset"),D(n+1this.length&&(r=this.length),e.length-t=this.length))return this[e]},h.prototype.readUInt16LE=function(e,t){return l(this,e,!0,t)},h.prototype.readUInt16BE=function(e,t){return l(this,e,!1,t)},h.prototype.readUInt32LE=function(e,t){return d(this,e,!0,t)},h.prototype.readUInt32BE=function(e,t){return d(this,e,!1,t)},h.prototype.readInt8=function(e,t){if(t||(D(null!=e,"missing offset"),D(e=this.length))return 128&this[e]?-1*(255-this[e]+1):this[e]},h.prototype.readInt16LE=function(e,t){return y(this,e,!0,t)},h.prototype.readInt16BE=function(e,t){return y(this,e,!1,t)},h.prototype.readInt32LE=function(e,t){return w(this,e,!0,t)},h.prototype.readInt32BE=function(e,t){return w(this,e,!1,t)},h.prototype.readFloatLE=function(e,t){return b(this,e,!0,t)},h.prototype.readFloatBE=function(e,t){return b(this,e,!1,t)},h.prototype.readDoubleLE=function(e,t){return m(this,e,!0,t)},h.prototype.readDoubleBE=function(e,t){return m(this,e,!1,t)},h.prototype.writeUInt8=function(e,t,n){n||(D(null!=e,"missing value"),D(null!=t,"missing offset"),D(t=this.length||(this[t]=e);},h.prototype.writeUInt16LE=function(e,t,n){v(this,e,t,!0,n);},h.prototype.writeUInt16BE=function(e,t,n){v(this,e,t,!1,n);},h.prototype.writeUInt32LE=function(e,t,n){_(this,e,t,!0,n);},h.prototype.writeUInt32BE=function(e,t,n){_(this,e,t,!1,n);},h.prototype.writeInt8=function(e,t,n){n||(D(null!=e,"missing value"),D(null!=t,"missing offset"),D(t=this.length||(0<=e?this.writeUInt8(e,t,n):this.writeUInt8(255+e+1,t,n));},h.prototype.writeInt16LE=function(e,t,n){E(this,e,t,!0,n);},h.prototype.writeInt16BE=function(e,t,n){E(this,e,t,!1,n);},h.prototype.writeInt32LE=function(e,t,n){I(this,e,t,!0,n);},h.prototype.writeInt32BE=function(e,t,n){I(this,e,t,!1,n);},h.prototype.writeFloatLE=function(e,t,n){A(this,e,t,!0,n);},h.prototype.writeFloatBE=function(e,t,n){A(this,e,t,!1,n);},h.prototype.writeDoubleLE=function(e,t,n){B(this,e,t,!0,n);},h.prototype.writeDoubleBE=function(e,t,n){B(this,e,t,!1,n);},h.prototype.fill=function(e,t,n){if(e=e||0,t=t||0,n=n||this.length,"string"==typeof e&&(e=e.charCodeAt(0)),D("number"==typeof e&&!isNaN(e),"value is not a number"),D(t<=n,"end < start"),n!==t&&0!==this.length){D(0<=t&&t"},h.prototype.toArrayBuffer=function(){if("undefined"==typeof Uint8Array)throw new Error("Buffer.toArrayBuffer not supported in this browser");if(h._useTypedArrays)return new h(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;t=t.length||o>=e.length);o++)t[o+n]=e[o];return o}function M(e){try{return decodeURIComponent(e)}catch(e){return String.fromCharCode(65533)}}function N(e,t){D("number"==typeof e,"cannot write a non-number as a number"),D(0<=e,"specified a negative value for writing an unsigned value"),D(e<=t,"value is larger than maximum value for type"),D(Math.floor(e)===e,"value has a fractional component");}function Y(e,t,n){D("number"==typeof e,"cannot write a non-number as a number"),D(e<=t,"value larger than maximum allowed value"),D(n<=e,"value smaller than minimum allowed value"),D(Math.floor(e)===e,"value has a fractional component");}function F(e,t,n){D("number"==typeof e,"cannot write a non-number as a number"),D(e<=t,"value larger than maximum allowed value"),D(n<=e,"value smaller than minimum allowed value");}function D(e,t){if(!e)throw new Error(t||"Failed assertion")}h._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=L.get,e.set=L.set,e.write=L.write,e.toString=L.toString,e.toLocaleString=L.toString,e.toJSON=L.toJSON,e.copy=L.copy,e.slice=L.slice,e.readUInt8=L.readUInt8,e.readUInt16LE=L.readUInt16LE,e.readUInt16BE=L.readUInt16BE,e.readUInt32LE=L.readUInt32LE,e.readUInt32BE=L.readUInt32BE,e.readInt8=L.readInt8,e.readInt16LE=L.readInt16LE,e.readInt16BE=L.readInt16BE,e.readInt32LE=L.readInt32LE,e.readInt32BE=L.readInt32BE,e.readFloatLE=L.readFloatLE,e.readFloatBE=L.readFloatBE,e.readDoubleLE=L.readDoubleLE,e.readDoubleBE=L.readDoubleBE,e.writeUInt8=L.writeUInt8,e.writeUInt16LE=L.writeUInt16LE,e.writeUInt16BE=L.writeUInt16BE,e.writeUInt32LE=L.writeUInt32LE,e.writeUInt32BE=L.writeUInt32BE,e.writeInt8=L.writeInt8,e.writeInt16LE=L.writeInt16LE,e.writeInt16BE=L.writeInt16BE,e.writeInt32LE=L.writeInt32LE,e.writeInt32BE=L.writeInt32BE,e.writeFloatLE=L.writeFloatLE,e.writeFloatBE=L.writeFloatBE,e.writeDoubleLE=L.writeDoubleLE,e.writeDoubleBE=L.writeDoubleBE,e.fill=L.fill,e.inspect=L.inspect,e.toArrayBuffer=L.toArrayBuffer,e};}).call(this,O("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},O("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer");},{"base64-js":2,buffer:3,ieee754:11,lYpoI2:10}],4:[function(l,d,e){(function(e,t,u,n,r,o,i,a,s){u=l("buffer").Buffer;var f=4,c=new u(f);c.fill(0);d.exports={hash:function(e,t,n,r){return u.isBuffer(e)||(e=new u(e)),function(e,t,n){for(var r=new u(t),o=n?r.writeInt32BE:r.writeInt32LE,i=0;ih?t=e(t):t.length>5]|=128<>>9<<4)]=t;for(var n=1732584193,r=-271733879,o=-1732584194,i=271733878,u=0;u>>32-a,n);var u,a;}function d(e,t,n,r,o,i,u){return l(t&n|~t&r,e,t,o,i,u)}function h(e,t,n,r,o,i,u){return l(t&r|n&~r,e,t,o,i,u)}function p(e,t,n,r,o,i,u){return l(t^n^r,e,t,o,i,u)}function g(e,t,n,r,o,i,u){return l(n^(t|~r),e,t,o,i,u)}function y(e,t){var n=(65535&e)+(65535&t);return (e>>16)+(t>>16)+(n>>16)<<16|65535&n}b.exports=function(e){return f.hash(e,c,16)};}).call(this,w("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},w("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify");},{"./helpers":4,buffer:3,lYpoI2:10}],7:[function(e,l,t){(function(e,t,n,r,o,i,u,a,s){var f;f=function(e){for(var t,n=new Array(e),r=0;r>>((3&r)<<3)&255;return n},l.exports=f;}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify");},{buffer:3,lYpoI2:10}],8:[function(l,d,e){(function(e,t,n,r,o,i,u,a,s){var f=l("./helpers");function c(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var n,r=Array(80),o=1732584193,i=-271733879,u=-1732584194,a=271733878,s=-1009589776,f=0;f>16)+(t>>16)+(n>>16)<<16|65535&n}function m(e,t){return e<>>32-t}d.exports=function(e){return f.hash(e,c,20,!0)};}).call(this,l("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},l("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify");},{"./helpers":4,buffer:3,lYpoI2:10}],9:[function(l,d,e){(function(e,t,n,r,o,i,u,a,s){function B(e,t){var n=(65535&e)+(65535&t);return (e>>16)+(t>>16)+(n>>16)<<16|65535&n}function L(e,t){return e>>>t|e<<32-t}function U(e,t){return e>>>t}function f(e,t){var n,r,o,i,u,a,s,f,c,l,d,h,p,g,y,w,b,m,v=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),_=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),E=new Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var I=0;I>1,c=-7,l=n?o-1:0,d=n?-1:1,h=e[t+l];for(l+=d,i=h&(1<<-c)-1,h>>=-c,c+=a;0>=-c,c+=r;0>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,u=c):(u=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-u))<1&&(u--,s*=2),2<=(t+=1<=u+l?d/s:d*Math.pow(2,1-l))*s&&(u++,s/=2),c<=u+l?(a=0,u=c):1<=u+l?(a=(t*s-1)*Math.pow(2,o),u+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,o),u=0));8<=o;e[n+h]=255&a,h+=p,a/=256,o-=8);for(u=u< 0 it is a line, if elem < 0 it is gap, if elem == 0.0 it is a + * @param {array} elements - if elem > 0 it is a line, if elem < 0 it is gap, if elem == 0.0 it is a */ addLineType(name, description, elements) { @@ -3072,7 +2925,7 @@ class Drawing this.layers[name] = new Layer_1(name, colorNumber, lineTypeName); return this; } - + setActiveLayer(name) { this.activeLayer = this.layers[name]; @@ -3090,7 +2943,7 @@ class Drawing this.activeLayer.addShape(new Point_1(x, y)); return this; } - + drawRect(x1, y1, x2, y2) { this.activeLayer.addShape(new Line_1(x1, y1, x2, y1)); @@ -3104,8 +2957,8 @@ class Drawing * @param {number} x1 - Center x * @param {number} y1 - Center y * @param {number} r - radius - * @param {number} startAngle - degree - * @param {number} endAngle - degree + * @param {number} startAngle - degree + * @param {number} endAngle - degree */ drawArc(x1, y1, r, startAngle, endAngle) { @@ -3175,34 +3028,6 @@ class Drawing return this; } - /** - * Draw a spline. - * @param {[Array]} controlPoints - Array of control points like [ [x1, y1], [x2, y2]... ] - * @param {number} degree - Degree of spline: 2 for quadratic, 3 for cubic. Default is 3 - * @param {[number]} knots - Knot vector array. If null, will use a uniform knot vector. Default is null - * @param {[number]} weights - Control point weights. If provided, must be one weight for each control point. Default is null - * @param {[Array]} fitPoints - Array of fit points like [ [x1, y1], [x2, y2]... ] - */ - drawSpline(controlPoints, degree = 3, knots = null, weights = null, fitPoints = []) { - this.activeLayer.addShape(new Spline_1(controlPoints, degree, knots, weights, fitPoints)); - return this; - } - - /** - * Draw an ellipse. - * @param {number} x1 - Center x - * @param {number} y1 - Center y - * @param {number} majorAxisX - Endpoint x of major axis, relative to center - * @param {number} majorAxisY - Endpoint y of major axis, relative to center - * @param {number} axisRatio - Ratio of minor axis to major axis - * @param {number} startAngle - Start angle - * @param {number} endAngle - End angle - */ - drawEllipse(x1, y1, majorAxisX, majorAxisY, axisRatio, startAngle = 0, endAngle = 2 * Math.PI) { - this.activeLayer.addShape(new Ellipse_1(x1, y1, majorAxisX, majorAxisY, axisRatio, startAngle, endAngle)); - return this; - } - /** * @param {number} x1 - x * @param {number} y1 - y @@ -3338,7 +3163,7 @@ class Drawing //AutoCAD Color Index (ACI) //http://sub-atomic.com/~moses/acadcolors.html -Drawing.ACI = +Drawing.ACI = { LAYER : 0, RED : 1, @@ -3350,14 +3175,14 @@ Drawing.ACI = WHITE : 7 }; -Drawing.LINE_TYPES = +Drawing.LINE_TYPES = [ {name: 'CONTINUOUS', description: '______', elements: []}, {name: 'DASHED', description: '_ _ _ ', elements: [5.0, -5.0]}, {name: 'DOTTED', description: '. . . ', elements: [0.0, -5.0]} ]; -Drawing.LAYERS = +Drawing.LAYERS = [ {name: '0', colorNumber: Drawing.ACI.WHITE, lineTypeName: 'CONTINUOUS'} ]; diff --git a/dist/jsxcad-convert-threejs.js b/dist/jsxcad-convert-threejs.js index 434f3c4c..7e1ef86e 100644 --- a/dist/jsxcad-convert-threejs.js +++ b/dist/jsxcad-convert-threejs.js @@ -1,105 +1,7 @@ import { toDisjointGeometry } from './jsxcad-geometry.js'; -// import { toPlane } from './jsxcad-math-poly3.js'; - -// const pointsToThreejsPoints = (points) => points; - -/* -const trianglesToThreejsTriangles = (triangles) => { - const normals = []; - const positions = []; - for (const triangle of triangles) { - const plane = toPlane(triangle); - if (plane === undefined) { - continue; - } - const [px, py, pz] = plane; - for (const [x = 0, y = 0, z = 0] of triangle) { - normals.push(px, py, pz); - positions.push(x, y, z); - } - } - return { normals, positions }; -}; -*/ - const toThreejsGeometry = (geometry, supertags) => { return geometry; - /* - const tags = [...(supertags || []), ...(geometry.tags || [])]; - // if (tags.includes('compose/non-positive')) { - // return; - // } - if (geometry.isThreejsGeometry) { - return geometry; - } - switch (geometry.type) { - case 'layout': - case 'assembly': - case 'disjointAssembly': - case 'layers': - return { - type: 'assembly', - content: geometry.content.map((content) => - toThreejsGeometry(content, tags) - ), - tags, - isThreejsGeometry: true, - }; - case 'sketch': - return { - type: 'sketch', - content: geometry.content.map((content) => - toThreejsGeometry(content, tags) - ), - tags, - isThreejsGeometry: true, - }; - case 'item': - return { - type: 'item', - content: geometry.content.map((content) => - toThreejsGeometry(content, tags) - ), - tags, - isThreejsGeometry: true, - }; - case 'paths': - return { - type: 'paths', - threejsPaths: geometry.paths, - tags, - isThreejsGeometry: true, - }; - case 'plan': - return { - type: 'plan', - threejsPlan: geometry.plan, - threejsMarks: geometry.marks, - content: geometry.content.map((content) => - toThreejsGeometry(content, tags) - ), - tags, - isThreejsGeometry: true, - }; - case 'points': - return { - type: 'points', - threejsPoints: pointsToThreejsPoints(geometry.points), - tags, - isThreejsGeometry: true, - }; - case 'triangles': - return { - type: 'triangles', - threejsTriangles: trianglesToThreejsTriangles(geometry.triangles), - tags, - isThreejsGeometry: true, - }; - default: - throw Error(`Unexpected geometry: ${geometry.type}`); - } -*/ }; const toThreejsPage = async ( diff --git a/dist/jsxcad-geometry.js b/dist/jsxcad-geometry.js index 94a4d8ef..4eb15235 100644 --- a/dist/jsxcad-geometry.js +++ b/dist/jsxcad-geometry.js @@ -1,11 +1,11 @@ import { identityMatrix, fromTranslation, fromZRotation, fromScaling, fromXRotation, fromYRotation } from './jsxcad-math-mat4.js'; -import { composeTransforms, fromSurfaceMeshToGraph, fromPointsToAlphaShapeAsSurfaceMesh, fromSurfaceMeshToLazyGraph, deserializeSurfaceMesh, fromGraphToSurfaceMesh, bendSurfaceMesh, fromPointsToConvexHullAsSurfaceMesh, arrangePathsIntoTriangles, fromPolygonsToSurfaceMesh, fromSurfaceMeshEmitBoundingBox, differenceOfSurfaceMeshes, extrudeSurfaceMesh, extrudeToPlaneOfSurfaceMesh, fromFunctionToSurfaceMesh, fromPointsToSurfaceMesh, arrangePaths, growSurfaceMesh, intersectionOfSurfaceMeshes, fromSurfaceMeshToPolygonsWithHoles, insetOfPolygonWithHoles, minkowskiDifferenceOfSurfaceMeshes, minkowskiShellOfSurfaceMeshes, minkowskiSumOfSurfaceMeshes, offsetOfPolygonWithHoles, outlineSurfaceMesh, projectToPlaneOfSurfaceMesh, serializeSurfaceMesh, pushSurfaceMesh, remeshSurfaceMesh, reverseFaceOrientationsOfSurfaceMesh, sectionOfSurfaceMesh, subdivideSurfaceMesh, fromSurfaceMeshToTriangles, doesSelfIntersectOfSurfaceMesh, twistSurfaceMesh, unionOfSurfaceMeshes } from './jsxcad-algorithm-cgal.js'; +import { composeTransforms, fromSurfaceMeshToGraph, fromPointsToAlphaShapeAsSurfaceMesh, fromSurfaceMeshToLazyGraph, arrangePathsIntoTriangles, fromPolygonsToSurfaceMesh, deserializeSurfaceMesh, fromGraphToSurfaceMesh, fromSurfaceMeshEmitBoundingBox, differenceOfSurfaceMeshes, bendSurfaceMesh, fromPointsToConvexHullAsSurfaceMesh, extrudeSurfaceMesh, extrudeToPlaneOfSurfaceMesh, fromFunctionToSurfaceMesh, fromPointsToSurfaceMesh, arrangePaths, growSurfaceMesh, intersectionOfSurfaceMeshes, fromSurfaceMeshToPolygonsWithHoles, insetOfPolygonWithHoles, loftBetweenCongruentSurfaceMeshes, minkowskiDifferenceOfSurfaceMeshes, minkowskiShellOfSurfaceMeshes, minkowskiSumOfSurfaceMeshes, offsetOfPolygonWithHoles, outlineSurfaceMesh, projectToPlaneOfSurfaceMesh, serializeSurfaceMesh, pushSurfaceMesh, remeshSurfaceMesh, reverseFaceOrientationsOfSurfaceMesh, sectionOfSurfaceMesh, subdivideSurfaceMesh, splitSurfaceMesh, fromSurfaceMeshToTriangles, doesSelfIntersectOfSurfaceMesh, twistSurfaceMesh, unionOfSurfaceMeshes } from './jsxcad-algorithm-cgal.js'; export { arrangePolygonsWithHoles } from './jsxcad-algorithm-cgal.js'; -import { transform as transform$5, canonicalize as canonicalize$5, equals, min, max, scale as scale$3, subtract } from './jsxcad-math-vec3.js'; -import { transform as transform$6, canonicalize as canonicalize$6 } from './jsxcad-math-poly3.js'; -import { canonicalize as canonicalize$7 } from './jsxcad-math-plane.js'; +import { equals, min, max, transform as transform$5, canonicalize as canonicalize$5, scale as scale$3, subtract } from './jsxcad-math-vec3.js'; import { cache, cacheRewriteTags, cacheSection } from './jsxcad-cache.js'; import { info, read as read$1, write as write$1 } from './jsxcad-sys.js'; +import { transform as transform$6, canonicalize as canonicalize$6 } from './jsxcad-math-poly3.js'; +import { canonicalize as canonicalize$7 } from './jsxcad-math-plane.js'; const update = (geometry, updates, changes) => { if (updates === undefined) { @@ -110,12 +110,10 @@ const transform$4 = (matrix, geometry) => { const op = (geometry, descend, walk) => { switch (geometry.type) { // Branch - case 'assembly': case 'layout': - case 'layers': + case 'group': case 'item': case 'sketch': - case 'disjointAssembly': return descend(); // Leaf case 'plan': @@ -241,6 +239,37 @@ const fromSurfaceMesh = (surfaceMesh) => { const alphaShape = (points, componentLimit) => fromSurfaceMesh(fromPointsToAlphaShapeAsSurfaceMesh(points, componentLimit)); +// import { fromPolygons } from './fromPolygons.js'; +// import { toTriangles } from './toTriangles.js'; + +// Convert an outline graph to a possibly closed surface. +// export const fill = (graph) => fromPolygons(toTriangles(graph)); + +const fill$1 = (geometry) => ({ + ...geometry, + graph: { ...geometry.graph, isOutline: true }, +}); + +const deduplicate = (path) => { + const unique = []; + let last = path[path.length - 1]; + for (const point of path) { + if (last === null || point === null || !equals(point, last)) { + unique.push(point); + } + last = point; + } + return unique; +}; + +const flip$3 = (path) => { + if (path[0] === null) { + return [null, ...path.slice(1).reverse()]; + } else { + return path.slice().reverse(); + } +}; + const fromSurfaceMeshLazy = (surfaceMesh, forceNewGraph = false) => { if (!surfaceMesh) { throw Error('null surfaceMesh'); @@ -254,7 +283,29 @@ const fromSurfaceMeshLazy = (surfaceMesh, forceNewGraph = false) => { return graph; }; -const taggedGraph = ({ tags }, graph) => { +const X$3 = 0; +const Y$3 = 1; + +/** + * Measure the area of a path as though it were a polygon. + * A negative area indicates a clockwise path, and a positive area indicates a counter-clock-wise path. + * See: http://mathworld.wolfram.com/PolygonArea.html + * @returns {Number} The area the path would have if it were a polygon. + */ +const measureArea = (path) => { + let last = path.length - 1; + let current = path[0] === null ? 1 : 0; + let twiceArea = 0; + for (; current < path.length; last = current++) { + twiceArea += + path[last][X$3] * path[current][Y$3] - path[last][Y$3] * path[current][X$3]; + } + return twiceArea / 2; +}; + +const isClockwise = (path) => measureArea(path) < 0; + +const taggedGraph = ({ tags, matrix }, graph) => { if (graph.length > 0) { throw Error('Graph should not be an array'); } @@ -265,7 +316,74 @@ const taggedGraph = ({ tags }, graph) => { type: 'graph', tags, graph, + matrix, + }; +}; + +const clean = (path) => deduplicate(path); + +const orientCounterClockwise = (path) => + isClockwise(path) ? flip$3(path) : path; + +// This imposes a planar arrangement. +const fromPaths = ({ tags }, paths, plane = [0, 0, 1, 0]) => { + if (plane[0] === 0 && plane[1] === 0 && plane[2] === 0 && plane[3] === 0) { + throw Error(`Zero plane`); + } + const orientedPolygons = []; + for (const { points } of arrangePathsIntoTriangles(plane, undefined, paths)) { + const exterior = orientCounterClockwise(points); + const cleaned = clean(exterior); + if (cleaned.length < 3) { + continue; + } + const orientedPolygon = { points: cleaned, plane }; + orientedPolygons.push(orientedPolygon); + } + return taggedGraph( + { tags }, + fromSurfaceMeshLazy(fromPolygonsToSurfaceMesh(orientedPolygons)) + ); +}; + +const eachItem = (geometry, op) => { + const walk = (geometry, descend) => { + switch (geometry.type) { + case 'sketch': { + // Sketches aren't real. + return; + } + default: { + op(geometry); + return descend(); + } + } }; + visit(geometry, walk); +}; + +const getFaceablePaths = (geometry) => { + const pathsets = []; + eachItem(geometry, (item) => { + if (item.type !== 'paths') { + return; + } + if (item.tags && item.tags.includes('paths/Wire')) { + return; + } + pathsets.push(item); + }); + return pathsets; +}; + +const getGraphs = (geometry) => { + const graphs = []; + eachItem(geometry, (item) => { + if (item.type === 'graph') { + graphs.push(item); + } + }); + return graphs; }; const toSurfaceMesh = (graph) => { @@ -283,17 +401,95 @@ const toSurfaceMesh = (graph) => { return surfaceMesh; }; -const bend$1 = (geometry, degreesPerMm = 1) => - taggedGraph( - { tags: geometry.tags }, - fromSurfaceMeshLazy( - bendSurfaceMesh( - toSurfaceMesh(geometry.graph), +const measureBoundingBox$3 = (geometry) => { + if ( + geometry.cache === undefined || + geometry.cache.boundingBox === undefined + ) { + if (geometry.cache === undefined) { + geometry.cache = {}; + } + const { graph } = geometry; + if (graph.isLazy) { + fromSurfaceMeshEmitBoundingBox( + toSurfaceMesh(graph), geometry.matrix, - degreesPerMm - ) + (xMin, yMin, zMin, xMax, yMax, zMax) => { + geometry.cache.boundingBox = [ + [xMin, yMin, zMin], + [xMax, yMax, zMax], + ]; + } + ); + } else { + let minPoint = [Infinity, Infinity, Infinity]; + let maxPoint = [-Infinity, -Infinity, -Infinity]; + if (graph.points) { + for (const point of graph.points) { + if (point !== undefined) { + minPoint = min(minPoint, point); + maxPoint = max(maxPoint, point); + } + } + } + geometry.cache.boundingBox = [minPoint, maxPoint]; + } + } + return geometry.cache.boundingBox; +}; + +const iota$1 = 1e-5; +const X$2 = 0; +const Y$2 = 1; +const Z$2 = 2; + +// Requires a conservative gap. +const doesNotOverlap$1 = (a, b) => { + if (a.graph.isEmpty || b.graph.isEmpty) { + return true; + } + const [minA, maxA] = measureBoundingBox$3(a); + const [minB, maxB] = measureBoundingBox$3(b); + if (maxA[X$2] <= minB[X$2] - iota$1 * 10) { + return true; + } + if (maxA[Y$2] <= minB[Y$2] - iota$1 * 10) { + return true; + } + if (maxA[Z$2] <= minB[Z$2] - iota$1 * 10) { + return true; + } + if (maxB[X$2] <= minA[X$2] - iota$1 * 10) { + return true; + } + if (maxB[Y$2] <= minA[Y$2] - iota$1 * 10) { + return true; + } + if (maxB[Z$2] <= minA[Z$2] - iota$1 * 10) { + return true; + } + return false; +}; + +const difference$1 = (a, b) => { + if (a.graph.isEmpty || b.graph.isEmpty) { + return a; + } + if (doesNotOverlap$1(a, b)) { + return a; + } + info('difference begin'); + const result = fromSurfaceMeshLazy( + differenceOfSurfaceMeshes( + toSurfaceMesh(a.graph), + a.matrix, + toSurfaceMesh(b.graph), + b.matrix ) ); + info('difference end'); + return taggedGraph({ tags: a.tags }, result); +}; const registry = new Map(); @@ -327,10 +523,8 @@ const reify = (geometry) => { case 'displayGeometry': // CHECK: Should this taint the results if there is a plan? return geometry; - case 'assembly': case 'item': - case 'disjointAssembly': - case 'layers': + case 'group': case 'layout': case 'sketch': case 'transform': @@ -414,12 +608,10 @@ const toTransformedGeometry = (geometry) => { } switch (geometry.type) { // Branch - case 'assembly': case 'layout': - case 'layers': + case 'group': case 'item': case 'sketch': - case 'disjointAssembly': case 'plan': return descend(); // Leaf @@ -454,47 +646,148 @@ const toTransformedGeometry = (geometry) => { return geometry[transformedGeometry]; }; -const op = - ({ graph }) => - (geometry, ...args) => { - const walk = (geometry, descend) => { - switch (geometry.type) { - case 'graph': { - return graph(geometry, ...args); - } - case 'triangles': - case 'paths': - case 'points': - // Not implemented yet. - return geometry; - case 'plan': - reify(geometry); - // fall through - case 'assembly': - case 'item': - case 'disjointAssembly': - case 'layers': { - return descend(); - } - case 'sketch': { - // Sketches aren't real for op. - return geometry; - } - default: - throw Error(`Unexpected geometry: ${JSON.stringify(geometry)}`); - } - }; - - return rewrite(toTransformedGeometry(geometry), walk); - }; - -const bend = op({ graph: bend$1 }); - -const close = (path) => (isClosed(path) ? path : path.slice(1)); +const toConcreteGeometry = (geometry) => + toTransformedGeometry(reify(geometry)); -const concatenate = (...paths) => { - const result = [null, ...[].concat(...paths.map(close))]; - return result; +const differenceImpl = (geometry, ...geometries) => { + geometries = geometries.map(toConcreteGeometry); + const op = (geometry, descend) => { + const { tags } = geometry; + switch (geometry.type) { + case 'graph': { + let differenced = geometry; + for (const geometry of geometries) { + for (const graph of getGraphs(geometry)) { + differenced = difference$1(differenced, graph); + } + for (const pathsGeometry of getFaceablePaths(geometry)) { + differenced = difference$1( + differenced, + fill$1( + fromPaths( + { tags: pathsGeometry.tags }, + pathsGeometry.map((path) => ({ points: path })) + ) + ) + ); + } + } + if (differenced.hash) { + throw Error(`hash`); + } + return differenced; + } + case 'paths': + // This will have problems with open paths, but we want to phase this out anyhow. + return difference( + fill$1( + fromPaths( + { tags }, + geometry.paths.map((path) => ({ points: path })) + ) + ), + ...geometries + ); + case 'points': { + // Not implemented yet. + return geometry; + } + case 'layout': + case 'plan': + case 'item': + case 'group': { + return descend(); + } + case 'sketch': { + // Sketches aren't real for intersection. + return geometry; + } + default: + throw Error(`Unexpected geometry: ${JSON.stringify(geometry)}`); + } + }; + + return rewrite(toConcreteGeometry(geometry), op); +}; + +const difference = cache(differenceImpl); + +const taggedGroup = ({ tags }, ...content) => { + if (content.some((value) => !value)) { + throw Error(`Undefined Group content`); + } + if (content.some((value) => value.length)) { + throw Error(`Group content is an array`); + } + if (content.length === 1) { + return content[0]; + } + return { type: 'group', tags, content }; +}; + +const disjoint = (geometries) => { + geometries = [...geometries]; + for (let sup = geometries.length - 1; sup >= 0; sup--) { + for (let sub = geometries.length - 1; sub > sup; sub--) { + geometries[sup] = difference(geometries[sup], geometries[sub]); + } + } + return taggedGroup({}, ...geometries); +}; + +const assemble = (...geometries) => disjoint(geometries); + +const bend$1 = (geometry, degreesPerMm = 1) => + taggedGraph( + { tags: geometry.tags }, + fromSurfaceMeshLazy( + bendSurfaceMesh( + toSurfaceMesh(geometry.graph), + geometry.matrix, + degreesPerMm + ) + ) + ); + +const op = + ({ graph }) => + (geometry, ...args) => { + const walk = (geometry, descend) => { + switch (geometry.type) { + case 'graph': { + return graph(geometry, ...args); + } + case 'triangles': + case 'paths': + case 'points': + // Not implemented yet. + return geometry; + case 'plan': + reify(geometry); + // fall through + case 'item': + case 'group': { + return descend(); + } + case 'sketch': { + // Sketches aren't real for op. + return geometry; + } + default: + throw Error(`Unexpected geometry: ${JSON.stringify(geometry)}`); + } + }; + + return rewrite(toTransformedGeometry(geometry), walk); + }; + +const bend = op({ graph: bend$1 }); + +const close = (path) => (isClosed(path) ? path : path.slice(1)); + +const concatenate = (...paths) => { + const result = [null, ...[].concat(...paths.map(close))]; + return result; }; const canonicalizePoint = (point, index) => { @@ -547,395 +840,75 @@ const realizeGraph = (geometry) => { }; } else { return geometry; - } -}; - -const realize = (geometry) => { - const op = (geometry, descend) => { - switch (geometry.type) { - case 'graph': - return realizeGraph(geometry); - case 'displayGeometry': - case 'triangles': - case 'points': - case 'paths': - // No lazy representation to realize. - return geometry; - case 'plan': - case 'assembly': - case 'item': - case 'disjointAssembly': - case 'layers': - case 'layout': - case 'sketch': - case 'transform': - return descend(); - default: - throw Error(`Unexpected geometry: ${JSON.stringify(geometry)}`); - } - }; - - return rewrite(geometry, op); -}; - -const canonicalize = (geometry) => { - const op = (geometry, descend) => { - switch (geometry.type) { - case 'points': - return descend({ points: canonicalize$2(geometry.points) }); - case 'paths': - return descend({ paths: canonicalize$3(geometry.paths) }); - case 'triangles': - return descend({ triangles: canonicalize$1(geometry.triangles) }); - case 'plan': - return descend({ - marks: canonicalize$2(geometry.marks), - planes: geometry.planes.map(canonicalize$7), - }); - case 'graph': { - const realizedGeometry = realize(geometry); - return descend({ - graph: { - ...realizedGeometry.graph, - points: canonicalize$2(realizedGeometry.graph.points), - }, - }); - } - case 'item': - case 'assembly': - case 'disjointAssembly': - case 'layers': - case 'layout': - case 'sketch': - return descend(); - default: - throw Error(`Unexpected geometry type ${geometry.type}`); - } - }; - return rewrite(toTransformedGeometry(geometry), op); -}; - -const convexHull = ({ tags }, points) => - taggedGraph( - { tags }, - fromSurfaceMeshLazy(fromPointsToConvexHullAsSurfaceMesh(points)) - ); - -const deduplicate = (path) => { - const unique = []; - let last = path[path.length - 1]; - for (const point of path) { - if (last === null || point === null || !equals(point, last)) { - unique.push(point); - } - last = point; - } - return unique; -}; - -// import { fromPolygons } from './fromPolygons.js'; -// import { toTriangles } from './toTriangles.js'; - -// Convert an outline graph to a possibly closed surface. -// export const fill = (graph) => fromPolygons(toTriangles(graph)); - -const fill$1 = (geometry) => ({ - ...geometry, - graph: { ...geometry.graph, isOutline: true }, -}); - -const flip$3 = (path) => { - if (path[0] === null) { - return [null, ...path.slice(1).reverse()]; - } else { - return path.slice().reverse(); - } -}; - -const X$3 = 0; -const Y$3 = 1; - -/** - * Measure the area of a path as though it were a polygon. - * A negative area indicates a clockwise path, and a positive area indicates a counter-clock-wise path. - * See: http://mathworld.wolfram.com/PolygonArea.html - * @returns {Number} The area the path would have if it were a polygon. - */ -const measureArea = (path) => { - let last = path.length - 1; - let current = path[0] === null ? 1 : 0; - let twiceArea = 0; - for (; current < path.length; last = current++) { - twiceArea += - path[last][X$3] * path[current][Y$3] - path[last][Y$3] * path[current][X$3]; - } - return twiceArea / 2; -}; - -const isClockwise = (path) => measureArea(path) < 0; - -const clean = (path) => deduplicate(path); - -const orientCounterClockwise = (path) => - isClockwise(path) ? flip$3(path) : path; - -// This imposes a planar arrangement. -const fromPaths = ({ tags }, paths, plane = [0, 0, 1, 0]) => { - if (plane[0] === 0 && plane[1] === 0 && plane[2] === 0 && plane[3] === 0) { - throw Error(`Zero plane`); - } - const orientedPolygons = []; - for (const { points } of arrangePathsIntoTriangles(plane, undefined, paths)) { - const exterior = orientCounterClockwise(points); - const cleaned = clean(exterior); - if (cleaned.length < 3) { - continue; - } - const orientedPolygon = { points: cleaned, plane }; - orientedPolygons.push(orientedPolygon); - } - return taggedGraph( - { tags }, - fromSurfaceMeshLazy(fromPolygonsToSurfaceMesh(orientedPolygons)) - ); -}; - -const eachItem = (geometry, op) => { - const walk = (geometry, descend) => { - switch (geometry.type) { - case 'sketch': { - // Sketches aren't real. - return; - } - default: { - op(geometry); - return descend(); - } - } - }; - visit(geometry, walk); -}; - -const getFaceablePaths = (geometry) => { - const pathsets = []; - eachItem(geometry, (item) => { - if (item.type !== 'paths') { - return; - } - if (item.tags && item.tags.includes('paths/Wire')) { - return; - } - pathsets.push(item); - }); - return pathsets; -}; - -const getGraphs = (geometry) => { - const graphs = []; - eachItem(geometry, (item) => { - if (item.type === 'graph') { - graphs.push(item); - } - }); - return graphs; -}; - -const measureBoundingBox$3 = (geometry) => { - if ( - geometry.cache === undefined || - geometry.cache.boundingBox === undefined - ) { - if (geometry.cache === undefined) { - geometry.cache = {}; - } - const { graph } = geometry; - if (graph.isLazy) { - fromSurfaceMeshEmitBoundingBox( - toSurfaceMesh(graph), - geometry.matrix, - (xMin, yMin, zMin, xMax, yMax, zMax) => { - geometry.cache.boundingBox = [ - [xMin, yMin, zMin], - [xMax, yMax, zMax], - ]; - } - ); - } else { - let minPoint = [Infinity, Infinity, Infinity]; - let maxPoint = [-Infinity, -Infinity, -Infinity]; - if (graph.points) { - for (const point of graph.points) { - if (point !== undefined) { - minPoint = min(minPoint, point); - maxPoint = max(maxPoint, point); - } - } - } - geometry.cache.boundingBox = [minPoint, maxPoint]; - } - } - return geometry.cache.boundingBox; -}; - -const iota$1 = 1e-5; -const X$2 = 0; -const Y$2 = 1; -const Z$2 = 2; - -// Requires a conservative gap. -const doesNotOverlap$1 = (a, b) => { - if (a.graph.isEmpty || b.graph.isEmpty) { - return true; - } - const [minA, maxA] = measureBoundingBox$3(a); - const [minB, maxB] = measureBoundingBox$3(b); - if (maxA[X$2] <= minB[X$2] - iota$1 * 10) { - return true; - } - if (maxA[Y$2] <= minB[Y$2] - iota$1 * 10) { - return true; - } - if (maxA[Z$2] <= minB[Z$2] - iota$1 * 10) { - return true; - } - if (maxB[X$2] <= minA[X$2] - iota$1 * 10) { - return true; - } - if (maxB[Y$2] <= minA[Y$2] - iota$1 * 10) { - return true; - } - if (maxB[Z$2] <= minA[Z$2] - iota$1 * 10) { - return true; - } - return false; -}; - -const difference$1 = (a, b) => { - if (a.graph.isEmpty || b.graph.isEmpty) { - return a; - } - if (a.graph.isClosed && b.graph.isClosed && doesNotOverlap$1(a, b)) { - return a; - } - info('difference begin'); - const result = fromSurfaceMeshLazy( - differenceOfSurfaceMeshes( - toSurfaceMesh(a.graph), - a.matrix, - toSurfaceMesh(b.graph), - b.matrix - ) - ); - info('difference end'); - return taggedGraph({ tags: a.tags }, result); + } }; -const toConcreteGeometry = (geometry) => - toTransformedGeometry(reify(geometry)); - -const differenceImpl = (geometry, ...geometries) => { - geometries = geometries.map(toConcreteGeometry); +const realize = (geometry) => { const op = (geometry, descend) => { - const { tags } = geometry; switch (geometry.type) { - case 'graph': { - let differenced = geometry; - for (const geometry of geometries) { - for (const graph of getGraphs(geometry)) { - differenced = difference$1(differenced, graph); - } - for (const pathsGeometry of getFaceablePaths(geometry)) { - differenced = difference$1( - differenced, - fill$1( - fromPaths( - { tags: pathsGeometry.tags }, - pathsGeometry.map((path) => ({ points: path })) - ) - ) - ); - } - } - if (differenced.hash) { - throw Error(`hash`); - } - return differenced; - } + case 'graph': + return realizeGraph(geometry); + case 'displayGeometry': + case 'triangles': + case 'points': case 'paths': - // This will have problems with open paths, but we want to phase this out anyhow. - return difference( - fill$1( - fromPaths( - { tags }, - geometry.paths.map((path) => ({ points: path })) - ) - ), - ...geometries - ); - case 'points': { - // Not implemented yet. + // No lazy representation to realize. return geometry; - } - case 'layout': case 'plan': - case 'assembly': case 'item': - case 'disjointAssembly': - case 'layers': { + case 'group': + case 'layout': + case 'sketch': + case 'transform': return descend(); - } - case 'sketch': { - // Sketches aren't real for intersection. - return geometry; - } default: throw Error(`Unexpected geometry: ${JSON.stringify(geometry)}`); } }; - return rewrite(toConcreteGeometry(geometry), op); + return rewrite(geometry, op); }; -const difference = cache(differenceImpl); - -const taggedDisjointAssembly = ({ tags }, ...content) => { - if (content.some((value) => !value)) { - throw Error(`Undefined DisjointAssembly content`); - } - if (content.some((value) => value.length)) { - throw Error(`DisjointAssembly content is an array`); - } - if (content.some((value) => value.geometry)) { - throw Error(`Likely Shape instance in DisjointAssembly content`); - } - if (tags !== undefined && tags.length === undefined) { - throw Error(`Bad tags`); - } - if (typeof tags === 'function') { - throw Error(`Tags is a function`); - } - const disjointAssembly = { type: 'disjointAssembly', tags, content }; - visit(disjointAssembly, (geometry, descend) => { - if (geometry.type === 'transform') { - throw Error( - `DisjointAssembly contains transform: ${JSON.stringify(geometry)}` - ); +const canonicalize = (geometry) => { + const op = (geometry, descend) => { + switch (geometry.type) { + case 'points': + return descend({ points: canonicalize$2(geometry.points) }); + case 'paths': + return descend({ paths: canonicalize$3(geometry.paths) }); + case 'triangles': + return descend({ triangles: canonicalize$1(geometry.triangles) }); + case 'plan': + return descend({ + marks: canonicalize$2(geometry.marks), + planes: geometry.planes.map(canonicalize$7), + }); + case 'graph': { + const realizedGeometry = realize(geometry); + return descend({ + graph: { + ...realizedGeometry.graph, + points: canonicalize$2(realizedGeometry.graph.points), + }, + }); + } + case 'item': + case 'group': + case 'layout': + case 'sketch': + return descend(); + default: + throw Error(`Unexpected geometry type ${geometry.type}`); } - return descend(); - }); - return disjointAssembly; + }; + return rewrite(toTransformedGeometry(geometry), op); }; -// FIX: This is wrong. -const disjoint = (geometries) => { - geometries = [...geometries]; - for (let sup = geometries.length - 1; sup >= 0; sup--) { - for (let sub = geometries.length - 1; sub > sup; sub--) { - geometries[sup] = difference(geometries[sup], geometries[sub]); - } - } - return taggedDisjointAssembly({}, ...geometries); -}; +const convexHull = ({ tags }, points) => + taggedGraph( + { tags }, + fromSurfaceMeshLazy(fromPointsToConvexHullAsSurfaceMesh(points)) + ); // FIX: Let's avoid a complete realization of the graph. const eachPoint$3 = (geometry, op) => { @@ -968,9 +941,7 @@ const eachPoint = (emit, geometry) => { case 'plan': reify(geometry); // fallthrough - case 'assembly': - case 'disjointAssembly': - case 'layers': + case 'group': case 'item': case 'layout': return descend(); @@ -1044,9 +1015,7 @@ const measureBoundingBox = (geometry) => { } switch (geometry.type) { case 'plan': - case 'assembly': - case 'layers': - case 'disjointAssembly': + case 'group': case 'item': case 'sketch': case 'displayGeometry': @@ -1146,9 +1115,7 @@ const rewriteTagsImpl = ( }; const op = (geometry, descend) => { switch (geometry.type) { - case 'assembly': - case 'disjointAssembly': - case 'layers': + case 'group': return descend(); default: const composedTags = composeTags(geometry.tags); @@ -1226,99 +1193,6 @@ const getNonVoidPaths = (geometry) => { return pathsets; }; -const taggedGroup = ({ tags }, ...content) => { - if (content.some((value) => !value)) { - throw Error(`Undefined Group content`); - } - if (content.some((value) => value.length)) { - throw Error(`Group content is an array`); - } - if (content.length === 1) { - return content[0]; - } - // FIX: Deprecate layers. - return { type: 'layers', tags, content }; -}; - -/* -import { visit } from './visit.js'; - -const linkDisjointAssembly = Symbol('linkDisjointAssembly'); - -export const clearDisjointGeometry = (geometry) => { - delete geometry[linkDisjointAssembly]; - return geometry; -}; - -const hasVoidGeometry = (geometry) => { - if (isVoid(geometry)) { - return true; - } - if (geometry.content) { - for (const content of geometry.content) { - if (hasVoidGeometry(content)) { - return true; - } - } - } -}; - -export const toDisjointGeometry = (geometry, mode = DISJUNCTION_TOTAL) => { - const op = (geometry, descend, walk, state) => { - if (geometry[linkDisjointAssembly]) { - return geometry[linkDisjointAssembly]; - } else if (geometry.type === 'disjointAssembly') { - // Everything below this point is disjoint. - return geometry; - } else if (geometry.type === 'displayGeometry') { - // We pretend that everything below this point is disjoint. - return geometry; - } else if (geometry.type === 'plan') { - return walk(reify(geometry).content[0], op); - } else if (geometry.type === 'transform') { - return walk(toTransformedGeometry(geometry), op); - } else if (geometry.type === 'assembly') { - if (mode === DISJUNCTION_VISIBLE && !hasVoidGeometry(geometry)) { - // This leads to some potential invariant violations. - // With toVisiblyDisjoint geometry we may get assembly within - // disjointAssembly. - // This is acceptable for displayGeometry, but otherwise problematic. - // For this reason we wrap the output as DisplayGeometry. - // FIX: This is leaking backward via parent linkDisjointAssembly. - return taggedDisplayGeometry( - {}, - toTransformedGeometry(reify(geometry)) - ); - } - const assembly = geometry.content.map((entry) => rewrite(entry, op)); - const disjointAssembly = []; - for (let i = assembly.length - 1; i >= 0; i--) { - disjointAssembly.unshift(difference(assembly[i], ...disjointAssembly)); - } - const disjointed = taggedDisjointAssembly({}, ...disjointAssembly); - geometry[linkDisjointAssembly] = disjointed; - return disjointed; - } else { - return descend(); - } - }; - // FIX: Interleave toTransformedGeometry into this rewrite. - if (geometry.type === 'disjointAssembly') { - return geometry; - } else { - const disjointed = rewrite(geometry, op); - if (disjointed.type === 'disjointAssembly') { - geometry[linkDisjointAssembly] = disjointed; - return disjointed; - } else { - const wrapper = taggedDisjointAssembly({}, disjointed); - geometry[linkDisjointAssembly] = wrapper; - return wrapper; - } - } -}; -*/ - // FIX: Remove toDisjointGeometry and replace with a more meaningful operation. const toDisjointGeometry = (geometry) => toConcreteGeometry(geometry); @@ -1369,10 +1243,8 @@ const extrude = (geometry, height, depth) => { return extrude(fill(geometry), height, depth); case 'plan': return extrude(reify(geometry).content[0], height, depth); - case 'assembly': case 'item': - case 'disjointAssembly': - case 'layers': { + case 'group': { return descend(); } case 'sketch': { @@ -1435,10 +1307,8 @@ const extrudeToPlane = (geometry, highPlane, lowPlane, direction) => { // Not implemented yet. return geometry; case 'plan': - case 'assembly': case 'item': - case 'disjointAssembly': - case 'layers': { + case 'group': { return descend(); } case 'sketch': { @@ -1475,9 +1345,7 @@ const flip = (geometry) => { return { ...geometry, points: flip$1(geometry.points) }; case 'paths': return { ...geometry, paths: flip$2(geometry.paths) }; - case 'assembly': - case 'disjointAssembly': - case 'layers': + case 'group': case 'layout': case 'plan': case 'item': @@ -1586,23 +1454,6 @@ const getItems = (geometry) => { return items; }; -// This gets each layer independently. - -const getLayers = (geometry) => { - const layers = []; - const op = (geometry, descend, walk) => { - switch (geometry.type) { - case 'layers': - geometry.content.forEach((layer) => layers.unshift(walk(layer))); - return taggedDisjointAssembly({}); - default: - return descend(); - } - }; - rewrite(geometry, op); - return layers; -}; - const getLayouts = (geometry) => { const layouts = []; eachItem(geometry, (item) => { @@ -1619,9 +1470,7 @@ const getLeafs = (geometry) => { const leafs = []; const op = (geometry, descend) => { switch (geometry.type) { - case 'assembly': - case 'disjointAssembly': - case 'layers': + case 'group': case 'layout': return descend(); default: @@ -1792,10 +1641,8 @@ const grow = (geometry, amount) => { return geometry; case 'plan': return grow(reify(geometry).content[0], amount); - case 'assembly': case 'item': - case 'disjointAssembly': - case 'layers': { + case 'group': { return descend(); } case 'sketch': { @@ -1829,9 +1676,6 @@ let nanoid = (size = 21) => { const hash = (geometry) => { if (geometry.hash === undefined) { geometry.hash = nanoid(); - console.log(`QQ/hash/new: ${geometry.hash}`); - } else { - console.log(`QQ/hash/old: ${geometry.hash}`); } return geometry.hash; }; @@ -1840,7 +1684,7 @@ const intersection$1 = (a, b) => { if (a.graph.isEmpty || b.graph.isEmpty) { return fromEmpty(); } - if (a.graph.isClosed && b.graph.isClosed && doesNotOverlap$1(a, b)) { + if (doesNotOverlap$1(a, b)) { return fromEmpty(); } info('intersection begin'); @@ -1885,7 +1729,7 @@ const toPaths = (geometry) => { return paths; }; -const intersectionImpl = (geometry, ...geometries) => { +const intersection = (geometry, ...geometries) => { geometries = geometries.map(toConcreteGeometry); const op = (geometry, descend) => { const { tags } = geometry; @@ -1924,7 +1768,7 @@ const intersectionImpl = (geometry, ...geometries) => { intersection( fromPaths({ tags }, geometry.paths), ...geometries - ).graph + ) ) ); } @@ -1934,10 +1778,8 @@ const intersectionImpl = (geometry, ...geometries) => { } case 'layout': case 'plan': - case 'assembly': case 'item': - case 'disjointAssembly': - case 'layers': { + case 'group': { return descend(); } case 'sketch': { @@ -1952,7 +1794,7 @@ const intersectionImpl = (geometry, ...geometries) => { return rewrite(toConcreteGeometry(geometry), op); }; -const intersection = cache(intersectionImpl); +// export const intersection = cache(intersectionImpl); const fromPolygonsWithHoles = ({ tags }, polygonsWithHoles) => fromTriangles({ tags }, fromPolygonsWithHolesToTriangles(polygonsWithHoles)); @@ -2000,10 +1842,8 @@ const inset = (geometry, initial = 1, step, limit) => { ); case 'plan': return inset(reify(geometry).content[0], initial, step, limit); - case 'assembly': case 'item': - case 'disjointAssembly': - case 'layers': { + case 'group': { return descend(); } case 'sketch': { @@ -2021,6 +1861,57 @@ const inset = (geometry, initial = 1, step, limit) => { const keep = (tags, geometry) => rewriteTags(['compose/non-positive'], [], geometry, tags, 'has not'); +const loft$1 = (closed, ...geometries) => + taggedGraph( + { tags: geometries[0].tags }, + fromSurfaceMeshLazy( + loftBetweenCongruentSurfaceMeshes( + closed, + ...geometries.map((geometry) => [ + toSurfaceMesh(geometry.graph), + geometry.matrix, + ]) + ) + ) + ); + +const loft = (closed, geometry, ...geometries) => { + geometries = geometries.map(reify); + const op = (geometry, descend) => { + switch (geometry.type) { + case 'graph': { + const lofts = [geometry]; + // This is a bit fragile -- let's consider expressing this in terms of transforms. + for (const otherGeometry of geometries) { + for (const otherGraphGeometry of getNonVoidGraphs(otherGeometry)) { + lofts.push(otherGraphGeometry); + } + } + return loft$1(closed, ...lofts); + } + case 'triangles': + case 'paths': + case 'points': + // Not implemented yet. + return geometry; + case 'plan': + return loft(closed, reify(geometry).content[0], ...geometries); + case 'item': + case 'group': { + return descend(); + } + case 'sketch': { + // Sketches aren't real. + return geometry; + } + default: + throw Error(`Unexpected geometry: ${JSON.stringify(geometry)}`); + } + }; + + return rewrite(geometry, op); +}; + const minkowskiDifference$1 = (a, b) => { if (a.graph.isEmpty || b.graph.isEmpty) { return a; @@ -2062,10 +1953,8 @@ const minkowskiDifference = (geometry, offset) => { return geometry; case 'plan': return minkowskiDifference(reify(geometry).content[0], offset); - case 'assembly': case 'item': - case 'disjointAssembly': - case 'layers': { + case 'group': { return descend(); } case 'sketch': { @@ -2118,10 +2007,8 @@ const minkowskiShell = (geometry, offset) => { return geometry; case 'plan': return minkowskiShell(reify(geometry).content[0], offset); - case 'assembly': case 'item': - case 'disjointAssembly': - case 'layers': { + case 'group': { return descend(); } case 'sketch': { @@ -2174,10 +2061,8 @@ const minkowskiSum = (geometry, offset) => { return geometry; case 'plan': return minkowskiSum(reify(geometry).content[0], offset); - case 'assembly': case 'item': - case 'disjointAssembly': - case 'layers': { + case 'group': { return descend(); } case 'sketch': { @@ -2235,10 +2120,8 @@ const offset = (geometry, initial = 1, step, limit) => { ); case 'plan': return offset(reify(geometry).content[0], initial, step, limit); - case 'assembly': case 'item': - case 'disjointAssembly': - case 'layers': { + case 'group': { return descend(); } case 'sketch': { @@ -2353,10 +2236,8 @@ const projectToPlane = (geometry, plane, direction) => { direction ); case 'plan': - case 'assembly': case 'item': - case 'disjointAssembly': - case 'layers': { + case 'group': { return descend(); } case 'sketch': { @@ -2391,10 +2272,8 @@ const prepareForSerialization = (geometry) => { case 'points': case 'paths': return; - case 'assembly': case 'item': - case 'disjointAssembly': - case 'layers': + case 'group': case 'layout': case 'sketch': case 'transform': @@ -2449,10 +2328,8 @@ const push = ( minimumDistance, maximumDistance, }); - case 'assembly': case 'item': - case 'disjointAssembly': - case 'layers': { + case 'group': { return descend(); } case 'sketch': { @@ -2469,11 +2346,11 @@ const push = ( const read = async (path) => read$1(path); -const remesh$1 = (geometry, options = {}) => +const remesh$1 = (geometry, { lengths = [1] } = {}) => taggedGraph( - { tags: geometry.tags }, + { tags: geometry.tags, matrix: geometry.matrix }, fromSurfaceMeshLazy( - remeshSurfaceMesh(toSurfaceMesh(geometry.graph), options) + remeshSurfaceMesh(toSurfaceMesh(geometry.graph), ...lengths) ) ); @@ -2490,10 +2367,8 @@ const remesh = (geometry, options) => { return geometry; case 'plan': return remesh(reify(geometry).content[0], options); - case 'assembly': case 'item': - case 'disjointAssembly': - case 'layers': { + case 'group': { return descend(); } case 'sketch': { @@ -2592,10 +2467,8 @@ const smooth = (geometry, options) => { return geometry; case 'plan': return smooth(reify(geometry).content[0], options); - case 'assembly': case 'item': - case 'disjointAssembly': - case 'layers': { + case 'group': { return descend(); } case 'sketch': { @@ -2610,6 +2483,70 @@ const smooth = (geometry, options) => { return rewrite(toTransformedGeometry(geometry), op); }; +const split$1 = ( + geometry, + keepVolumes = true, + keepCavitiesInVolumes = true, + keepCavitiesAsVolumes = false +) => + taggedGroup( + {}, + ...splitSurfaceMesh( + toSurfaceMesh(geometry.graph), + keepVolumes, + keepCavitiesInVolumes, + keepCavitiesAsVolumes + ).map((mesh) => + taggedGraph( + { tags: geometry.tags, matrix: geometry.matrix }, + fromSurfaceMeshLazy(mesh) + ) + ) + ); + +const split = ( + geometry, + keepVolumes = true, + keepCavitiesInVolumes = true, + keepCavitiesAsVolumes = false +) => { + const op = (geometry, descend) => { + switch (geometry.type) { + case 'graph': + return split$1( + geometry, + keepVolumes, + keepCavitiesInVolumes, + keepCavitiesAsVolumes + ); + case 'triangles': + case 'paths': + case 'points': + // Not implemented yet. + return geometry; + case 'plan': + return split( + reify(geometry).content[0], + keepVolumes, + keepCavitiesInVolumes, + keepCavitiesAsVolumes + ); + case 'item': + case 'group': { + return descend(); + } + case 'sketch': { + // Sketches aren't real. + return geometry; + } + default: + throw Error(`Unexpected geometry: ${JSON.stringify(geometry)}`); + } + }; + + return rewrite(geometry, op); +}; + const taggedTriangles = ({ tags }, triangles) => { return { type: 'triangles', tags, triangles }; }; @@ -2677,11 +2614,9 @@ const soup = ( return descend(); case 'layout': case 'plan': - case 'assembly': case 'item': - case 'disjointAssembly': case 'sketch': - case 'layers': { + case 'group': { return descend(); } default: @@ -2692,26 +2627,6 @@ const soup = ( return rewrite(toTransformedGeometry(geometry), op); }; -// FIX: Remove tags from branches. -const taggedAssembly = ({ tags }, ...content) => { - if (content.some((value) => !value)) { - throw Error(`Undefined Assembly content`); - } - if (content.some((value) => value.length)) { - throw Error(`Assembly content is an array`); - } - if (content.some((value) => value.geometry)) { - throw Error(`Likely Shape instance in Assembly content`); - } - if (tags !== undefined && tags.length === undefined) { - throw Error(`Bad tags`); - } - if (typeof tags === 'function') { - throw Error(`Tags is a function`); - } - return disjoint(content); -}; - const taggedItem = ({ tags }, ...content) => { if (tags !== undefined && tags.length === undefined) { throw Error(`Bad tags: ${tags}`); @@ -2735,16 +2650,6 @@ const taggedDisplayGeometry = ({ tags }, ...content) => { return { type: 'displayGeometry', tags, content }; }; -const taggedLayers = ({ tags }, ...content) => { - if (content.some((value) => !value)) { - throw Error(`Undefined Layers content`); - } - if (content.some((value) => value.length)) { - throw Error(`Layers content is an array`); - } - return { type: 'layers', tags, content }; -}; - const taggedLayout = ( { tags, size, margin, title, marks = [] }, ...content @@ -2788,15 +2693,6 @@ const taggedSketch = ({ tags }, ...content) => { return { type: 'sketch', tags, content }; }; -const taggedTransform = (options = {}, matrix, untransformed) => { - return { - type: 'transform', - matrix, - content: [untransformed], - tags: untransformed.tags, - }; -}; - const test$1 = (graph) => { if (doesSelfIntersectOfSurfaceMesh(toSurfaceMesh(graph))) { throw Error('Self-intersection detected'); @@ -2819,10 +2715,8 @@ const test = (geometry) => { return test(reify(geometry).content[0]); case 'transform': case 'layout': - case 'assembly': case 'item': - case 'disjointAssembly': - case 'layers': + case 'group': case 'sketch': return descend(); default: @@ -2836,13 +2730,19 @@ const test = (geometry) => { const toDisplayGeometry = ( geometry, - { triangles = true, outline = true, wireframe = false } = {} + { triangles, outline = true, skin, wireframe = false } = {} ) => { if (!geometry) { throw Error('die'); } + if (skin === undefined) { + skin = triangles; + } + if (skin === undefined) { + skin = true; + } return soup(toVisiblyDisjointGeometry(geometry), { - doTriangles: triangles, + doTriangles: skin, doOutline: outline, doWireframe: wireframe, }); @@ -2928,11 +2828,9 @@ const toPolygonsWithHoles = (geometry) => { break; case 'layout': case 'plan': - case 'assembly': case 'item': - case 'disjointAssembly': case 'sketch': - case 'layers': { + case 'group': { return descend(); } default: @@ -2970,10 +2868,8 @@ const twist = (geometry, degreesPerMm, axis) => { return geometry; case 'plan': return twist(reify(geometry).content[0], degreesPerMm); - case 'assembly': case 'item': - case 'disjointAssembly': - case 'layers': { + case 'group': { return descend(); } case 'sketch': { @@ -3048,7 +2944,7 @@ const unionImpl = (geometry, ...geometries) => { union( fromPaths({ tags: geometry.tags }, geometry.paths), ...geometries - ).graph + ) ) ); } @@ -3062,10 +2958,8 @@ const unionImpl = (geometry, ...geometries) => { } case 'layout': case 'plan': - case 'assembly': case 'item': - case 'disjointAssembly': - case 'layers': { + case 'group': { return descend(); } case 'sketch': { @@ -3102,4 +2996,4 @@ const translate = (vector, geometry) => const scale = (vector, geometry) => transform$4(fromScaling(vector), geometry); -export { allTags, alphaShape, bend, canonicalize, canonicalize$4 as canonicalizePath, canonicalize$3 as canonicalizePaths, close as closePath, concatenate as concatenatePath, convexHull as convexHullToGraph, deduplicate as deduplicatePath, difference, disjoint, doesNotOverlap, drop, eachItem, eachPoint, empty, extrude, extrudeToPlane, fill, flip, flip$3 as flipPath, fresh, fromFunction as fromFunctionToGraph, fromPaths as fromPathsToGraph, fromPoints as fromPointsToGraph, fromPolygons as fromPolygonsToGraph, fromPolygonsWithHolesToTriangles, fromSurfaceToPaths, fromTriangles as fromTrianglesToGraph, getAnyNonVoidSurfaces, getAnySurfaces, getFaceablePaths, getGraphs, getItems, getLayers, getLayouts, getLeafs, getNonVoidFaceablePaths, getNonVoidGraphs, getNonVoidItems, getNonVoidPaths, getNonVoidPlans, getNonVoidPoints, getEdges as getPathEdges, getPaths, getPeg, getPlans, getPoints, getTags, grow, hash, inset, intersection, isClockwise as isClockwisePath, isClosed as isClosedPath, isNotVoid, isVoid, keep, measureBoundingBox, minkowskiDifference, minkowskiShell, minkowskiSum, offset, open as openPath, outline, prepareForSerialization, projectToPlane, push, read, realize, realizeGraph, registerReifier, reify, remesh, rerealizeGraph, reverseFaceOrientations as reverseFaceOrientationsOfGraph, rewrite, rewriteTags, rotateX, rotateY, rotateZ, rotateZ$1 as rotateZPath, scale, scale$2 as scalePath, scale$1 as scalePaths, section, smooth, soup, taggedAssembly, taggedDisjointAssembly, taggedDisplayGeometry, taggedGraph, taggedGroup, taggedItem, taggedLayers, taggedLayout, taggedPaths, taggedPlan, taggedPoints, taggedSketch, taggedTransform, taggedTriangles, test, toConcreteGeometry, toDisjointGeometry, toDisplayGeometry, toKeptGeometry, toPoints, toPolygonsWithHoles, toTransformedGeometry, toTriangles as toTrianglesFromGraph, toVisiblyDisjointGeometry, transform$4 as transform, transform$2 as transformPaths, translate, translate$2 as translatePath, translate$1 as translatePaths, twist, union, update, visit, write }; +export { allTags, alphaShape, assemble, bend, canonicalize, canonicalize$4 as canonicalizePath, canonicalize$3 as canonicalizePaths, close as closePath, concatenate as concatenatePath, convexHull as convexHullToGraph, deduplicate as deduplicatePath, difference, disjoint, doesNotOverlap, drop, eachItem, eachPoint, empty, extrude, extrudeToPlane, fill, flip, flip$3 as flipPath, fresh, fromFunction as fromFunctionToGraph, fromPaths as fromPathsToGraph, fromPoints as fromPointsToGraph, fromPolygons as fromPolygonsToGraph, fromPolygonsWithHolesToTriangles, fromSurfaceToPaths, fromTriangles as fromTrianglesToGraph, getAnyNonVoidSurfaces, getAnySurfaces, getFaceablePaths, getGraphs, getItems, getLayouts, getLeafs, getNonVoidFaceablePaths, getNonVoidGraphs, getNonVoidItems, getNonVoidPaths, getNonVoidPlans, getNonVoidPoints, getEdges as getPathEdges, getPaths, getPeg, getPlans, getPoints, getTags, grow, hash, inset, intersection, isClockwise as isClockwisePath, isClosed as isClosedPath, isNotVoid, isVoid, keep, loft, measureBoundingBox, minkowskiDifference, minkowskiShell, minkowskiSum, offset, open as openPath, outline, prepareForSerialization, projectToPlane, push, read, realize, realizeGraph, registerReifier, reify, remesh, rerealizeGraph, reverseFaceOrientations as reverseFaceOrientationsOfGraph, rewrite, rewriteTags, rotateX, rotateY, rotateZ, rotateZ$1 as rotateZPath, scale, scale$2 as scalePath, scale$1 as scalePaths, section, smooth, soup, split, taggedDisplayGeometry, taggedGraph, taggedGroup, taggedItem, taggedLayout, taggedPaths, taggedPlan, taggedPoints, taggedSketch, taggedTriangles, test, toConcreteGeometry, toDisjointGeometry, toDisplayGeometry, toKeptGeometry, toPoints, toPolygonsWithHoles, toTransformedGeometry, toTriangles as toTrianglesFromGraph, toVisiblyDisjointGeometry, transform$4 as transform, transform$2 as transformPaths, translate, translate$2 as translatePath, translate$1 as translatePaths, twist, union, update, visit, write }; diff --git a/dist/jsxcad-sys.js b/dist/jsxcad-sys.js index 5cb06194..194b3685 100644 --- a/dist/jsxcad-sys.js +++ b/dist/jsxcad-sys.js @@ -332,6 +332,12 @@ const askServices = async (question) => { } }; +const tellServices = (question) => { + for (const { tell } of [...idleServices, ...activeServices]) { + tell(question); + } +}; + const conversation = ({ agent, say }) => { let id = 0; const openQuestions = new Map(); @@ -344,7 +350,7 @@ const conversation = ({ agent, say }) => { return promise; }; const hear = async (message) => { - const { id, question, answer, error } = message; + const { id, question, answer, error, statement } = message; // Check hasOwnProperty to detect undefined values. if (message.hasOwnProperty('answer')) { const { resolve, reject } = openQuestions.get(id); @@ -357,6 +363,8 @@ const conversation = ({ agent, say }) => { } else if (message.hasOwnProperty('question')) { const answer = await agent({ ask, question }); say({ id, answer }); + } else if (message.hasOwnProperty('statement')) { + await agent({ ask, statement }); } else { throw Error( `Expected { answer } or { question } but received ${JSON.stringify( @@ -407,13 +415,13 @@ const webService = async ({ const worker = new Worker(webWorker, { type: workerType }); const say = (message) => worker.postMessage(message); const { ask, hear } = conversation({ agent, say }); + const tell = (statement) => say({ statement }); const terminate = async () => worker.terminate(); worker.onmessage = ({ data }) => hear(data); worker.onerror = (error) => { console.log(`QQ/webWorker/error: ${error}`); - console.log(error); }; - const service = { ask, terminate }; + const service = { ask, tell, terminate }; service.release = async () => releaseService({ webWorker, type: workerType }, service); return service; @@ -621,10 +629,270 @@ function commonjsRequire () { throw new Error('Dynamic requires are not currently supported by rollup-plugin-commonjs'); } +function unwrapExports (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + function createCommonjsModule(fn, module) { return module = { exports: {} }, fn(module, module.exports), module.exports; } +var cjsCompat = createCommonjsModule(function (module, exports) { + +Object.defineProperty(exports, '__esModule', { + value: true +}); + +function promisifyRequest(request) { + return new Promise(function (resolve, reject) { + // @ts-ignore - file size hacks + request.oncomplete = request.onsuccess = function () { + return resolve(request.result); + }; // @ts-ignore - file size hacks + + + request.onabort = request.onerror = function () { + return reject(request.error); + }; + }); +} + +function createStore(dbName, storeName) { + var request = indexedDB.open(dbName); + + request.onupgradeneeded = function () { + return request.result.createObjectStore(storeName); + }; + + var dbp = promisifyRequest(request); + return function (txMode, callback) { + return dbp.then(function (db) { + return callback(db.transaction(storeName, txMode).objectStore(storeName)); + }); + }; +} + +var defaultGetStoreFunc; + +function defaultGetStore() { + if (!defaultGetStoreFunc) { + defaultGetStoreFunc = createStore('keyval-store', 'keyval'); + } + + return defaultGetStoreFunc; +} +/** + * Get a value by its key. + * + * @param key + * @param customStore Method to get a custom store. Use with caution (see the docs). + */ + + +function get(key) { + var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore(); + return customStore('readonly', function (store) { + return promisifyRequest(store.get(key)); + }); +} +/** + * Set a value with a key. + * + * @param key + * @param value + * @param customStore Method to get a custom store. Use with caution (see the docs). + */ + + +function set(key, value) { + var customStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultGetStore(); + return customStore('readwrite', function (store) { + store.put(value, key); + return promisifyRequest(store.transaction); + }); +} +/** + * Set multiple values at once. This is faster than calling set() multiple times. + * It's also atomic – if one of the pairs can't be added, none will be added. + * + * @param entries Array of entries, where each entry is an array of `[key, value]`. + * @param customStore Method to get a custom store. Use with caution (see the docs). + */ + + +function setMany(entries) { + var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore(); + return customStore('readwrite', function (store) { + entries.forEach(function (entry) { + return store.put(entry[1], entry[0]); + }); + return promisifyRequest(store.transaction); + }); +} +/** + * Get multiple values by their keys + * + * @param keys + * @param customStore Method to get a custom store. Use with caution (see the docs). + */ + + +function getMany(keys) { + var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore(); + return customStore('readonly', function (store) { + return Promise.all(keys.map(function (key) { + return promisifyRequest(store.get(key)); + })); + }); +} +/** + * Update a value. This lets you see the old value and update it as an atomic operation. + * + * @param key + * @param updater A callback that takes the old value and returns a new value. + * @param customStore Method to get a custom store. Use with caution (see the docs). + */ + + +function update(key, updater) { + var customStore = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : defaultGetStore(); + return customStore('readwrite', function (store) { + return (// Need to create the promise manually. + // If I try to chain promises, the transaction closes in browsers + // that use a promise polyfill (IE10/11). + new Promise(function (resolve, reject) { + store.get(key).onsuccess = function () { + try { + store.put(updater(this.result), key); + resolve(promisifyRequest(store.transaction)); + } catch (err) { + reject(err); + } + }; + }) + ); + }); +} +/** + * Delete a particular key from the store. + * + * @param key + * @param customStore Method to get a custom store. Use with caution (see the docs). + */ + + +function del(key) { + var customStore = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultGetStore(); + return customStore('readwrite', function (store) { + store.delete(key); + return promisifyRequest(store.transaction); + }); +} +/** + * Clear all values in the store. + * + * @param customStore Method to get a custom store. Use with caution (see the docs). + */ + + +function clear() { + var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore(); + return customStore('readwrite', function (store) { + store.clear(); + return promisifyRequest(store.transaction); + }); +} + +function eachCursor(customStore, callback) { + return customStore('readonly', function (store) { + // This would be store.getAllKeys(), but it isn't supported by Edge or Safari. + // And openKeyCursor isn't supported by Safari. + store.openCursor().onsuccess = function () { + if (!this.result) return; + callback(this.result); + this.result.continue(); + }; + + return promisifyRequest(store.transaction); + }); +} +/** + * Get all keys in the store. + * + * @param customStore Method to get a custom store. Use with caution (see the docs). + */ + + +function keys() { + var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore(); + var items = []; + return eachCursor(customStore, function (cursor) { + return items.push(cursor.key); + }).then(function () { + return items; + }); +} +/** + * Get all values in the store. + * + * @param customStore Method to get a custom store. Use with caution (see the docs). + */ + + +function values() { + var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore(); + var items = []; + return eachCursor(customStore, function (cursor) { + return items.push(cursor.value); + }).then(function () { + return items; + }); +} +/** + * Get all entries in the store. Each entry is an array of `[key, value]`. + * + * @param customStore Method to get a custom store. Use with caution (see the docs). + */ + + +function entries() { + var customStore = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultGetStore(); + var items = []; + return eachCursor(customStore, function (cursor) { + return items.push([cursor.key, cursor.value]); + }).then(function () { + return items; + }); +} + +exports.clear = clear; +exports.createStore = createStore; +exports.del = del; +exports.entries = entries; +exports.get = get; +exports.getMany = getMany; +exports.keys = keys; +exports.promisifyRequest = promisifyRequest; +exports.set = set; +exports.setMany = setMany; +exports.update = update; +exports.values = values; +}); + +unwrapExports(cjsCompat); +cjsCompat.clear; +cjsCompat.createStore; +cjsCompat.del; +cjsCompat.entries; +cjsCompat.get; +cjsCompat.getMany; +cjsCompat.keys; +cjsCompat.promisifyRequest; +cjsCompat.set; +cjsCompat.setMany; +cjsCompat.update; +cjsCompat.values; + var localforage = createCommonjsModule(function (module, exports) { /*! localForage -- Offline Storage, Improved @@ -3425,20 +3693,23 @@ module.exports = localforage_js; }); }); -let dbInstance; +let localForageDbInstance; -const db = () => { - if (dbInstance === undefined) { - dbInstance = localforage.createInstance({ +const localForageDb = () => { + if (localForageDbInstance === undefined) { + localForageDbInstance = localforage.createInstance({ name: 'jsxcad', driver: localforage.INDEXEDDB, storeName: 'jsxcad', description: 'jsxcad local filesystem', }); } - return dbInstance; + return localForageDbInstance; }; +const db = localForageDb; +// export const db = idbKeyvalDb; + function pad (hash, len) { while (hash.length < len) { hash = '0' + hash; @@ -3932,6 +4203,8 @@ const getDefinitions = () => { return definitions; }; +const hash = (item) => hashSum(item); + const { promises: promises$1 } = fs; const getFileLister = async () => { @@ -4059,4 +4332,4 @@ let nanoid = (size = 21) => { const generateUniqueId = () => nanoid(); -export { addOnEmitHandler, addPending, addSource, ask, askService, askServices, boot, clearEmitted, conversation, createService, deleteFile, elapsed, emit, generateUniqueId, getControlValue, getDefinitions, getEmitted, getFilesystem, getModule, getPendingErrorHandler, getSources, info, isBrowser, isNode, isWebWorker, listFiles, listFilesystems, log, onBoot, popModule, pushModule, qualifyPath, read, readFile, readOrWatch, removeOnEmitHandler, resolvePending, setControlValue, setHandleAskUser, setPendingErrorHandler, setupFilesystem, terminateActiveServices, touch, unwatchFile, unwatchFileCreation, unwatchFileDeletion, unwatchFiles, unwatchLog, watchFile, watchFileCreation, watchFileDeletion, watchLog, write, writeFile }; +export { addOnEmitHandler, addPending, addSource, ask, askService, askServices, boot, clearEmitted, conversation, createService, deleteFile, elapsed, emit, generateUniqueId, getControlValue, getDefinitions, getEmitted, getFilesystem, getModule, getPendingErrorHandler, getSources, hash, info, isBrowser, isNode, isWebWorker, listFiles, listFilesystems, log, onBoot, popModule, pushModule, qualifyPath, read, readFile, readOrWatch, removeOnEmitHandler, resolvePending, setControlValue, setHandleAskUser, setPendingErrorHandler, setupFilesystem, tellServices, terminateActiveServices, touch, unwatchFile, unwatchFileCreation, unwatchFileDeletion, unwatchFiles, unwatchLog, watchFile, watchFileCreation, watchFileDeletion, watchLog, write, writeFile }; diff --git a/dist/jsxcad-ui-notebook.js b/dist/jsxcad-ui-notebook.js index 11e012d3..12a8dd98 100644 --- a/dist/jsxcad-ui-notebook.js +++ b/dist/jsxcad-ui-notebook.js @@ -471,7 +471,7 @@ var Tokenizer_1 = class Tokenizer { }; } - const text = cap[0].replace(/^ {1,4}/gm, ''); + const text = cap[0].replace(/^ {4}/gm, ''); return { type: 'code', raw: cap[0], @@ -504,11 +504,11 @@ var Tokenizer_1 = class Tokenizer { let text = cap[2].trim(); // remove trailing #s - if (/#$/.test(text)) { + if (text.endsWith('#')) { const trimmed = rtrim(text, '#'); if (this.options.pedantic) { text = trimmed.trim(); - } else if (!trimmed || / $/.test(trimmed)) { + } else if (!trimmed || trimmed.endsWith(' ')) { // CommonMark requires space before trailing #s text = trimmed.trim(); } @@ -621,11 +621,8 @@ var Tokenizer_1 = class Tokenizer { // Backpedal if it does not belong in this list. if (i !== l - 1) { bnext = this.rules.block.listItemStart.exec(itemMatch[i + 1]); - if ( - !this.options.pedantic - ? bnext[1].length > bcurr[0].length || bnext[1].length > 3 - : bnext[1].length > bcurr[1].length - ) { + + if (bnext[1].length > bcurr[0].length || bnext[1].length > 3) { // nested list itemMatch.splice(i, 2, itemMatch[i] + '\n' + itemMatch[i + 1]); i--; @@ -854,9 +851,9 @@ var Tokenizer_1 = class Tokenizer { const cap = this.rules.inline.link.exec(src); if (cap) { const trimmedUrl = cap[2].trim(); - if (!this.options.pedantic && /^$/.test(trimmedUrl))) { + if (!trimmedUrl.endsWith('>')) { return; } @@ -891,8 +888,8 @@ var Tokenizer_1 = class Tokenizer { } href = href.trim(); - if (/^$/.test(trimmedUrl))) { + if (href.startsWith('<')) { + if (this.options.pedantic && !trimmedUrl.endsWith('>')) { // pedantic allows starting angle bracket without ending angle bracket href = href.slice(1); } else { @@ -975,7 +972,7 @@ var Tokenizer_1 = class Tokenizer { if (cap) { let text = cap[2].replace(/\n/g, ' '); const hasNonSpaceChars = /[^ ]/.test(text); - const hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text); + const hasSpaceCharsOnBothEnds = text.startsWith(' ') && text.endsWith(' '); if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) { text = text.substring(1, text.length - 1); } @@ -1102,8 +1099,8 @@ const { * Block-Level Grammar */ const block$1 = { - newline: /^(?: *(?:\n|$))+/, - code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, + newline: /^\n+/, + code: /^( {4}[^\n]+\n*)+/, fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/, hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/, heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, @@ -1125,7 +1122,7 @@ const block$1 = { lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/, // regex template, placeholders will be replaced according to different paragraph // interruption rules of commonmark and the original markdown spec: - _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/, + _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/, text: /^[^\n]+/ }; @@ -1557,9 +1554,7 @@ var Lexer_1 = class Lexer { * Lexing */ blockTokens(src, tokens = [], top = true) { - if (this.options.pedantic) { - src = src.replace(/^ +$/gm, ''); - } + src = src.replace(/^ +$/gm, ''); let token, i, l, lastToken; while (src) { @@ -1929,8 +1924,6 @@ var Renderer_1 = class Renderer { } } - code = code.replace(/\n$/, '') + '\n'; - if (!lang) { return '
'
         + (escaped ? code : escape$1(code, true))
diff --git a/dist/jsxcad-ui-threejs.js b/dist/jsxcad-ui-threejs.js
index af49ee7f..775d14da 100644
--- a/dist/jsxcad-ui-threejs.js
+++ b/dist/jsxcad-ui-threejs.js
@@ -53442,9 +53442,7 @@ const buildMeshes = async ({
   const { tags = [] } = geometry;
   switch (geometry.type) {
     case 'displayGeometry':
-    case 'assembly':
-    case 'disjointAssembly':
-    case 'layers':
+    case 'group':
     case 'layout':
     case 'item':
     case 'plan':
@@ -53598,6 +53596,7 @@ const buildMeshes = async ({
       const material = await buildMeshMaterial(definitions, tags);
       if (tags.includes('compose/non-positive')) {
         material.transparent = true;
+        material.depthWrite = false;
         material.opacity *= 0.5;
       }
       dataset.mesh = new Mesh(bufferGeometry, material);
diff --git a/dist/jsxcad-ui-v1-webworker.js b/dist/jsxcad-ui-v1-webworker.js
index 11b2003e..aa857c55 100644
--- a/dist/jsxcad-ui-v1-webworker.js
+++ b/dist/jsxcad-ui-v1-webworker.js
@@ -108,7 +108,8 @@ sys.setPendingErrorHandler(reportError);
 
 const agent = async ({
   ask,
-  question
+  question,
+  statement
 }) => {
   await sys.log({
     op: 'evaluate',
@@ -120,11 +121,11 @@ const agent = async ({
   });
   let onEmitHandler;
 
-  if (question.touchFile) {
+  if ((statement || question).touchFile) {
     const {
       path,
       workspace
-    } = question.touchFile;
+    } = (statement || question).touchFile;
     await sys.touch(path, {
       workspace
     });
diff --git a/dist/jsxcad-ui-v1.js b/dist/jsxcad-ui-v1.js
index 37006285..ad2607bf 100644
--- a/dist/jsxcad-ui-v1.js
+++ b/dist/jsxcad-ui-v1.js
@@ -1,4 +1,4 @@
-import { read as read$2, log as log$2, watchFileCreation, watchFileDeletion, unwatchFileCreation, unwatchFileDeletion, setupFilesystem, listFiles, deleteFile, terminateActiveServices, clearEmitted, write as write$2, resolvePending, boot, listFilesystems, askService, ask, touch as touch$1, askServices, readOrWatch } from './jsxcad-sys.js';
+import { read as read$2, log as log$2, watchFileCreation, watchFileDeletion, unwatchFileCreation, unwatchFileDeletion, setupFilesystem, listFiles, deleteFile, terminateActiveServices, clearEmitted, write as write$2, resolvePending, boot, listFilesystems, askService, ask, touch as touch$1, tellServices, readOrWatch } from './jsxcad-sys.js';
 import { toDomElement, getNotebookControlData } from './jsxcad-ui-notebook.js';
 import { fromPointsToAlphaShape2AsPolygonSegments } from './jsxcad-algorithm-cgal.js';
 import { toEcmascript } from './jsxcad-compiler.js';
@@ -121,7 +121,7 @@ exports.Children={map:P,forEach:function(a,b,c){P(a,function(){b.apply(this,argu
 exports.cloneElement=function(a,b,c){if(null===a||void 0===a)throw Error(z(267,a));var e=objectAssign({},a.props),d=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=G.current);void 0!==b.key&&(d=""+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)H.call(b,f)&&!I.hasOwnProperty(f)&&(e[f]=void 0===b[f]&&void 0!==g?g[f]:b[f]);}var f=arguments.length-2;if(1===f)e.children=c;else if(1()
+ *
+ * useEffect(() => {
+ *   if (!element) return
+ *
+ *   const calendar = new FullCalendar.Calendar(element)
+ *
+ *   return () => {
+ *     calendar.destroy()
+ *   }
+ * }, [element])
+ *
+ * return 
+ * ``` + * + * @category refs + */ + +function useCallbackRef() { + return react_16(null); +} + /** * Returns a function that triggers a component update. the hook equivalent to * `this.forceUpdate()` in a class component. In most cases using a state value directly @@ -6462,86 +6449,8 @@ function useEventCallback(fn) { }, [ref]); } -/** - * Attaches an event handler outside directly to specified DOM element - * bypassing the react synthetic event system. - * - * @param element The target to listen for events on - * @param event The DOM event name - * @param handler An event handler - * @param capture Whether or not to listen during the capture event phase - */ -function useEventListener(eventTarget, event, listener, capture) { - if (capture === void 0) { - capture = false; - } - - var handler = useEventCallback(listener); - react_10(function () { - var target = typeof eventTarget === 'function' ? eventTarget() : eventTarget; - target.addEventListener(event, handler, capture); - return function () { - return target.removeEventListener(event, handler, capture); - }; - }, [eventTarget]); -} - -/** - * Attaches an event handler outside directly to the `document`, - * bypassing the react synthetic event system. - * - * ```ts - * useGlobalListener('keydown', (event) => { - * console.log(event.key) - * }) - * ``` - * - * @param event The DOM event name - * @param handler An event handler - * @param capture Whether or not to listen during the capture event phase - */ -function useGlobalListener(event, handler, capture) { - if (capture === void 0) { - capture = false; - } - - var documentTarget = react_9(function () { - return document; - }, []); - return useEventListener(documentTarget, event, handler, capture); -} - var DropdownContext = /*#__PURE__*/react.createContext(null); -/** - * A convenience hook around `useState` designed to be paired with - * the component [callback ref](https://reactjs.org/docs/refs-and-the-dom.html#callback-refs) api. - * Callback refs are useful over `useRef()` when you need to respond to the ref being set - * instead of lazily accessing it in an effect. - * - * ```ts - * const [element, attachRef] = useCallbackRef() - * - * useEffect(() => { - * if (!element) return - * - * const calendar = new FullCalendar.Calendar(element) - * - * return () => { - * calendar.destroy() - * } - * }, [element]) - * - * return
- * ``` - * - * @category refs - */ - -function useCallbackRef() { - return react_16(null); -} - /** * Track whether a component is current mounted. Generally less preferable than * properlly canceling effects so they don't run after a component is unmounted, @@ -6620,50 +6529,21 @@ function getBasePlacement(placement) { return placement.split('-')[0]; } -function getBoundingClientRect(element) { - var rect = element.getBoundingClientRect(); - return { - width: rect.width, - height: rect.height, - top: rect.top, - right: rect.right, - bottom: rect.bottom, - left: rect.left, - x: rect.left, - y: rect.top - }; -} - +// Returns the layout rect of an element relative to its offsetParent. Layout // means it doesn't take into account transforms. - function getLayoutRect(element) { - var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed. - // Fixes https://github.com/popperjs/popper-core/issues/1223 - - var width = element.offsetWidth; - var height = element.offsetHeight; - - if (Math.abs(clientRect.width - width) <= 1) { - width = clientRect.width; - } - - if (Math.abs(clientRect.height - height) <= 1) { - height = clientRect.height; - } - return { x: element.offsetLeft, y: element.offsetTop, - width: width, - height: height + width: element.offsetWidth, + height: element.offsetHeight }; } -function getWindow(node) { - if (node == null) { - return window; - } +/*:: import type { Window } from '../types'; */ +/*:: declare function getWindow(node: Node | Window): Window; */ +function getWindow(node) { if (node.toString() !== '[object Window]') { var ownerDocument = node.ownerDocument; return ownerDocument ? ownerDocument.defaultView || window : window; @@ -6672,22 +6552,26 @@ function getWindow(node) { return node; } +/*:: declare function isElement(node: mixed): boolean %checks(node instanceof + Element); */ + function isElement(node) { var OwnElement = getWindow(node).Element; return node instanceof OwnElement || node instanceof Element; } +/*:: declare function isHTMLElement(node: mixed): boolean %checks(node instanceof + HTMLElement); */ + function isHTMLElement(node) { var OwnElement = getWindow(node).HTMLElement; return node instanceof OwnElement || node instanceof HTMLElement; } +/*:: declare function isShadowRoot(node: mixed): boolean %checks(node instanceof + ShadowRoot); */ -function isShadowRoot(node) { - // IE 11 has no ShadowRoot - if (typeof ShadowRoot === 'undefined') { - return false; - } +function isShadowRoot(node) { var OwnElement = getWindow(node).ShadowRoot; return node instanceof OwnElement || node instanceof ShadowRoot; } @@ -6742,8 +6626,9 @@ function getParentNode(element) { // $FlowFixMe[incompatible-return] // $FlowFixMe[prop-missing] element.assignedSlot || // step into the shadow DOM of the parent of a slotted node - element.parentNode || ( // DOM Element detected - isShadowRoot(element) ? element.host : null) || // ShadowRoot detected + element.parentNode || // DOM Element detected + // $FlowFixMe[incompatible-return]: need a better way to handle this... + element.host || // ShadowRoot detected // $FlowFixMe[incompatible-call]: HTMLElement is a Node getDocumentElement(element) // fallback @@ -6756,32 +6641,29 @@ function getTrueOffsetParent(element) { return null; } - return element.offsetParent; -} // `.offsetParent` reports `null` for fixed elements, while absolute elements -// return the containing block - - -function getContainingBlock(element) { - var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1; - var isIE = navigator.userAgent.indexOf('Trident') !== -1; + var offsetParent = element.offsetParent; - if (isIE && isHTMLElement(element)) { - // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport - var elementCss = getComputedStyle$1(element); + if (offsetParent) { + var html = getDocumentElement(offsetParent); - if (elementCss.position === 'fixed') { - return null; + if (getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && getComputedStyle$1(html).position !== 'static') { + return html; } } + return offsetParent; +} // `.offsetParent` reports `null` for fixed elements, while absolute elements +// return the containing block + + +function getContainingBlock(element) { var currentNode = getParentNode(element); while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) { var css = getComputedStyle$1(currentNode); // This is non-exhaustive but covers the most common CSS properties that // create a containing block. - // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block - if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') { + if (css.transform !== 'none' || css.perspective !== 'none' || css.willChange && css.willChange !== 'auto') { return currentNode; } else { currentNode = currentNode.parentNode; @@ -6801,7 +6683,7 @@ function getOffsetParent(element) { offsetParent = getTrueOffsetParent(offsetParent); } - if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static')) { + if (offsetParent && getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static') { return window; } @@ -6812,12 +6694,8 @@ function getMainAxisFromPlacement(placement) { return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y'; } -var max$4 = Math.max; -var min$3 = Math.min; -var round = Math.round; - function within$1(min, value, max) { - return max$4(min, min$3(value, max)); + return Math.max(min, Math.min(value, max)); } function getFreshSideObject() { @@ -6830,7 +6708,7 @@ function getFreshSideObject() { } function mergePaddingObject(paddingObject) { - return Object.assign({}, getFreshSideObject(), paddingObject); + return Object.assign(Object.assign({}, getFreshSideObject()), paddingObject); } function expandToHashMap(value, keys) { @@ -6840,19 +6718,11 @@ function expandToHashMap(value, keys) { }, {}); } -var toPaddingObject = function toPaddingObject(padding, state) { - padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, { - placement: state.placement - })) : padding; - return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); -}; - function arrow(_ref) { var _state$modifiersData$; var state = _ref.state, - name = _ref.name, - options = _ref.options; + name = _ref.name; var arrowElement = state.elements.arrow; var popperOffsets = state.modifiersData.popperOffsets; var basePlacement = getBasePlacement(state.placement); @@ -6864,7 +6734,7 @@ function arrow(_ref) { return; } - var paddingObject = toPaddingObject(options.padding, state); + var paddingObject = state.modifiersData[name + "#persistent"].padding; var arrowRect = getLayoutRect(arrowElement); var minProp = axis === 'y' ? top$1 : left$1; var maxProp = axis === 'y' ? bottom$1 : right$1; @@ -6886,9 +6756,12 @@ function arrow(_ref) { function effect$1(_ref2) { var state = _ref2.state, - options = _ref2.options; + options = _ref2.options, + name = _ref2.name; var _options$element = options.element, - arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element; + arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element, + _options$padding = options.padding, + padding = _options$padding === void 0 ? 0 : _options$padding; if (arrowElement == null) { return; @@ -6918,6 +6791,9 @@ function effect$1(_ref2) { } state.elements.arrow = arrowElement; + state.modifiersData[name + "#persistent"] = { + padding: mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)) + }; } // eslint-disable-next-line import/no-unused-modules @@ -6946,8 +6822,8 @@ function roundOffsetsByDPR(_ref) { var win = window; var dpr = win.devicePixelRatio || 1; return { - x: round(round(x * dpr) / dpr) || 0, - y: round(round(y * dpr) / dpr) || 0 + x: Math.round(x * dpr) / dpr || 0, + y: Math.round(y * dpr) / dpr || 0 }; } @@ -6963,7 +6839,7 @@ function mapToStyles(_ref2) { adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets; - var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets, + var _ref3 = roundOffsets ? roundOffsetsByDPR(offsets) : offsets, _ref3$x = _ref3.x, x = _ref3$x === void 0 ? 0 : _ref3$x, _ref3$y = _ref3.y, @@ -6977,32 +6853,23 @@ function mapToStyles(_ref2) { if (adaptive) { var offsetParent = getOffsetParent(popper); - var heightProp = 'clientHeight'; - var widthProp = 'clientWidth'; if (offsetParent === getWindow(popper)) { offsetParent = getDocumentElement(popper); - - if (getComputedStyle$1(offsetParent).position !== 'static') { - heightProp = 'scrollHeight'; - widthProp = 'scrollWidth'; - } } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it + /*:: offsetParent = (offsetParent: Element); */ - offsetParent = offsetParent; if (placement === top$1) { - sideY = bottom$1; // $FlowFixMe[prop-missing] - - y -= offsetParent[heightProp] - popperRect.height; + sideY = bottom$1; + y -= offsetParent.clientHeight - popperRect.height; y *= gpuAcceleration ? 1 : -1; } if (placement === left$1) { - sideX = right$1; // $FlowFixMe[prop-missing] - - x -= offsetParent[widthProp] - popperRect.width; + sideX = right$1; + x -= offsetParent.clientWidth - popperRect.width; x *= gpuAcceleration ? 1 : -1; } } @@ -7014,10 +6881,10 @@ function mapToStyles(_ref2) { if (gpuAcceleration) { var _Object$assign; - return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) < 2 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); + return Object.assign(Object.assign({}, commonStyles), {}, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) < 2 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); } - return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); + return Object.assign(Object.assign({}, commonStyles), {}, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); } function computeStyles(_ref4) { @@ -7048,7 +6915,7 @@ function computeStyles(_ref4) { }; if (state.modifiersData.popperOffsets != null) { - state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { + state.styles.popper = Object.assign(Object.assign({}, state.styles.popper), mapToStyles(Object.assign(Object.assign({}, commonStyles), {}, { offsets: state.modifiersData.popperOffsets, position: state.options.strategy, adaptive: adaptive, @@ -7057,7 +6924,7 @@ function computeStyles(_ref4) { } if (state.modifiersData.arrow != null) { - state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { + state.styles.arrow = Object.assign(Object.assign({}, state.styles.arrow), mapToStyles(Object.assign(Object.assign({}, commonStyles), {}, { offsets: state.modifiersData.arrow, position: 'absolute', adaptive: false, @@ -7065,7 +6932,7 @@ function computeStyles(_ref4) { }))); } - state.attributes.popper = Object.assign({}, state.attributes.popper, { + state.attributes.popper = Object.assign(Object.assign({}, state.attributes.popper), {}, { 'data-popper-placement': state.placement }); } // eslint-disable-next-line import/no-unused-modules @@ -7149,6 +7016,20 @@ function getOppositeVariationPlacement(placement) { }); } +function getBoundingClientRect(element) { + var rect = element.getBoundingClientRect(); + return { + width: rect.width, + height: rect.height, + top: rect.top, + right: rect.right, + bottom: rect.bottom, + left: rect.left, + x: rect.left, + y: rect.top + }; +} + function getWindowScroll(node) { var win = getWindow(node); var scrollLeft = win.pageXOffset; @@ -7211,18 +7092,16 @@ function getViewportRect(element) { // of the `` and `` rect bounds if horizontally scrollable function getDocumentRect(element) { - var _element$ownerDocumen; - var html = getDocumentElement(element); var winScroll = getWindowScroll(element); - var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; - var width = max$4(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); - var height = max$4(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); + var body = element.ownerDocument.body; + var width = Math.max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); + var height = Math.max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); var x = -winScroll.scrollLeft + getWindowScrollBarX(element); var y = -winScroll.scrollTop; if (getComputedStyle$1(body || html).direction === 'rtl') { - x += max$4(html.clientWidth, body ? body.clientWidth : 0) - width; + x += Math.max(html.clientWidth, body ? body.clientWidth : 0) - width; } return { @@ -7264,14 +7143,12 @@ reference element's position. */ function listScrollParents(element, list) { - var _element$ownerDocumen; - if (list === void 0) { list = []; } var scrollParent = getScrollParent(element); - var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); + var isBody = getNodeName(scrollParent) === 'body'; var win = getWindow(scrollParent); var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; var updatedList = list.concat(target); @@ -7280,7 +7157,7 @@ function listScrollParents(element, list) { } function rectToClientRect(rect) { - return Object.assign({}, rect, { + return Object.assign(Object.assign({}, rect), {}, { left: rect.x, top: rect.y, right: rect.x + rect.width, @@ -7331,10 +7208,10 @@ function getClippingRect(element, boundary, rootBoundary) { var firstClippingParent = clippingParents[0]; var clippingRect = clippingParents.reduce(function (accRect, clippingParent) { var rect = getClientRectFromMixedType(element, clippingParent); - accRect.top = max$4(rect.top, accRect.top); - accRect.right = min$3(rect.right, accRect.right); - accRect.bottom = min$3(rect.bottom, accRect.bottom); - accRect.left = max$4(rect.left, accRect.left); + accRect.top = Math.max(rect.top, accRect.top); + accRect.right = Math.min(rect.right, accRect.right); + accRect.bottom = Math.min(rect.bottom, accRect.bottom); + accRect.left = Math.max(rect.left, accRect.left); return accRect; }, getClientRectFromMixedType(element, firstClippingParent)); clippingRect.width = clippingRect.right - clippingRect.left; @@ -7444,7 +7321,7 @@ function detectOverflow(state, options) { strategy: 'absolute', placement: placement }); - var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets)); + var popperClientRect = rectToClientRect(Object.assign(Object.assign({}, popperRect), popperOffsets)); var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect // 0 or negative = within the clipping rect @@ -7468,6 +7345,9 @@ function detectOverflow(state, options) { return overflowOffsets; } +/*:: type OverflowsMap = { [ComputedPlacement]: number }; */ + +/*;; type OverflowsMap = { [key in ComputedPlacement]: number }; */ function computeAutoPlacement(state, options) { if (options === void 0) { options = {}; @@ -7696,7 +7576,7 @@ function hide(_ref) { isReferenceHidden: isReferenceHidden, hasPopperEscaped: hasPopperEscaped }; - state.attributes.popper = Object.assign({}, state.attributes.popper, { + state.attributes.popper = Object.assign(Object.assign({}, state.attributes.popper), {}, { 'data-popper-reference-hidden': isReferenceHidden, 'data-popper-escaped': hasPopperEscaped }); @@ -7715,7 +7595,7 @@ function distanceAndSkiddingToXY(placement, rects, offset) { var basePlacement = getBasePlacement(placement); var invertDistance = [left$1, top$1].indexOf(basePlacement) >= 0 ? -1 : 1; - var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, { + var _ref = typeof offset === 'function' ? offset(Object.assign(Object.assign({}, rects), {}, { placement: placement })) : offset, skidding = _ref[0], @@ -7821,7 +7701,7 @@ function preventOverflow(_ref) { var popperOffsets = state.modifiersData.popperOffsets; var referenceRect = state.rects.reference; var popperRect = state.rects.popper; - var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, { + var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign(Object.assign({}, state.rects), {}, { placement: state.placement })) : tetherOffset; var data = { @@ -7833,7 +7713,7 @@ function preventOverflow(_ref) { return; } - if (checkMainAxis || checkAltAxis) { + if (checkMainAxis) { var mainSide = mainAxis === 'y' ? top$1 : left$1; var altSide = mainAxis === 'y' ? bottom$1 : right$1; var len = mainAxis === 'y' ? 'height' : 'width'; @@ -7866,29 +7746,26 @@ function preventOverflow(_ref) { var offsetModifierValue = state.modifiersData.offset ? state.modifiersData.offset[state.placement][mainAxis] : 0; var tetherMin = popperOffsets[mainAxis] + minOffset - offsetModifierValue - clientOffset; var tetherMax = popperOffsets[mainAxis] + maxOffset - offsetModifierValue; + var preventedOffset = within$1(tether ? Math.min(min, tetherMin) : min, offset, tether ? Math.max(max, tetherMax) : max); + popperOffsets[mainAxis] = preventedOffset; + data[mainAxis] = preventedOffset - offset; + } - if (checkMainAxis) { - var preventedOffset = within$1(tether ? min$3(min, tetherMin) : min, offset, tether ? max$4(max, tetherMax) : max); - popperOffsets[mainAxis] = preventedOffset; - data[mainAxis] = preventedOffset - offset; - } - - if (checkAltAxis) { - var _mainSide = mainAxis === 'x' ? top$1 : left$1; + if (checkAltAxis) { + var _mainSide = mainAxis === 'x' ? top$1 : left$1; - var _altSide = mainAxis === 'x' ? bottom$1 : right$1; + var _altSide = mainAxis === 'x' ? bottom$1 : right$1; - var _offset = popperOffsets[altAxis]; + var _offset = popperOffsets[altAxis]; - var _min = _offset + overflow[_mainSide]; + var _min = _offset + overflow[_mainSide]; - var _max = _offset - overflow[_altSide]; + var _max = _offset - overflow[_altSide]; - var _preventedOffset = within$1(tether ? min$3(_min, tetherMin) : _min, _offset, tether ? max$4(_max, tetherMax) : _max); + var _preventedOffset = within$1(_min, _offset, _max); - popperOffsets[altAxis] = _preventedOffset; - data[altAxis] = _preventedOffset - _offset; - } + popperOffsets[altAxis] = _preventedOffset; + data[altAxis] = _preventedOffset - _offset; } state.modifiersData[name] = data; @@ -8119,9 +7996,9 @@ function uniqueBy(arr, fn) { function mergeByName(modifiers) { var merged = modifiers.reduce(function (merged, current) { var existing = merged[current.name]; - merged[current.name] = existing ? Object.assign({}, existing, current, { - options: Object.assign({}, existing.options, current.options), - data: Object.assign({}, existing.data, current.data) + merged[current.name] = existing ? Object.assign(Object.assign(Object.assign({}, existing), current), {}, { + options: Object.assign(Object.assign({}, existing.options), current.options), + data: Object.assign(Object.assign({}, existing.data), current.data) }) : current; return merged; }, {}); // IE11 does not support Object.values @@ -8167,7 +8044,7 @@ function popperGenerator(generatorOptions) { var state = { placement: 'bottom', orderedModifiers: [], - options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), + options: Object.assign(Object.assign({}, DEFAULT_OPTIONS), defaultOptions), modifiersData: {}, elements: { reference: reference, @@ -8182,7 +8059,7 @@ function popperGenerator(generatorOptions) { state: state, setOptions: function setOptions(options) { cleanupModifierEffects(); - state.options = Object.assign({}, defaultOptions, state.options, options); + state.options = Object.assign(Object.assign(Object.assign({}, defaultOptions), state.options), options); state.scrollParents = { reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [], popper: listScrollParents(popper) @@ -8552,28 +8429,64 @@ function usePopper(referenceElement, popperElement, _temp) { } /* eslint-disable no-bitwise, no-cond-assign */ - -/** - * Checks if an element contains another given element. - * - * @param context the context element - * @param node the element to check - */ +// HTML DOM and SVG DOM may have different support levels, +// so we need to check on context instead of a document root element. function contains$3(context, node) { - // HTML DOM and SVG DOM may have different support levels, - // so we need to check on context instead of a document root element. if (context.contains) return context.contains(node); if (context.compareDocumentPosition) return context === node || !!(context.compareDocumentPosition(node) & 16); } +var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement); + +/* eslint-disable no-return-assign */ +var optionsSupported = false; +var onceSupported = false; + +try { + var options = { + get passive() { + return optionsSupported = true; + }, + + get once() { + // eslint-disable-next-line no-multi-assign + return onceSupported = optionsSupported = true; + } + + }; + + if (canUseDOM) { + window.addEventListener('test', options, options); + window.removeEventListener('test', options, true); + } +} catch (e) { + /* */ +} + /** - * A `removeEventListener` ponyfill - * - * @param node the element - * @param eventName the event name - * @param handle the handler - * @param options event options + * An `addEventListener` ponyfill, supports the `once` option */ +function addEventListener(node, eventName, handler, options) { + if (options && typeof options !== 'boolean' && !onceSupported) { + var once = options.once, + capture = options.capture; + var wrappedHandler = handler; + + if (!onceSupported && once) { + wrappedHandler = handler.__once || function onceHandler(event) { + this.removeEventListener(eventName, onceHandler, capture); + handler.call(this, event); + }; + + handler.__once = wrappedHandler; + } + + node.addEventListener(eventName, wrappedHandler, optionsSupported ? options : capture); + } + + node.addEventListener(eventName, handler, options); +} + function removeEventListener(node, eventName, handler, options) { var capture = options && typeof options !== 'boolean' ? options.capture : options; node.removeEventListener(eventName, handler, capture); @@ -8642,11 +8555,6 @@ var warning = function() {}; var warning_1 = warning; -/** - * Returns the owner document of a given element. - * - * @param node the element - */ function ownerDocument$1(node) { return node && node.ownerDocument || document; } @@ -8691,7 +8599,7 @@ var scheduler_development = createCommonjsModule(function (module, exports) { (function() { var enableSchedulerDebugging = false; -var enableProfiling = false; +var enableProfiling = true; var requestHostCallback; var requestHostTimeout; @@ -8961,13 +8869,172 @@ function compare(a, b) { } // TODO: Use symbols? +var NoPriority = 0; var ImmediatePriority = 1; var UserBlockingPriority = 2; var NormalPriority = 3; var LowPriority = 4; var IdlePriority = 5; +var runIdCounter = 0; +var mainThreadIdCounter = 0; +var profilingStateSize = 4; +var sharedProfilingBuffer = // $FlowFixMe Flow doesn't know about SharedArrayBuffer +typeof SharedArrayBuffer === 'function' ? new SharedArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : // $FlowFixMe Flow doesn't know about ArrayBuffer +typeof ArrayBuffer === 'function' ? new ArrayBuffer(profilingStateSize * Int32Array.BYTES_PER_ELEMENT) : null // Don't crash the init path on IE9 +; +var profilingState = sharedProfilingBuffer !== null ? new Int32Array(sharedProfilingBuffer) : []; // We can't read this but it helps save bytes for null checks + +var PRIORITY = 0; +var CURRENT_TASK_ID = 1; +var CURRENT_RUN_ID = 2; +var QUEUE_SIZE = 3; + +{ + profilingState[PRIORITY] = NoPriority; // This is maintained with a counter, because the size of the priority queue + // array might include canceled tasks. + + profilingState[QUEUE_SIZE] = 0; + profilingState[CURRENT_TASK_ID] = 0; +} // Bytes per element is 4 + + +var INITIAL_EVENT_LOG_SIZE = 131072; +var MAX_EVENT_LOG_SIZE = 524288; // Equivalent to 2 megabytes + +var eventLogSize = 0; +var eventLogBuffer = null; +var eventLog = null; +var eventLogIndex = 0; +var TaskStartEvent = 1; +var TaskCompleteEvent = 2; +var TaskErrorEvent = 3; +var TaskCancelEvent = 4; +var TaskRunEvent = 5; +var TaskYieldEvent = 6; +var SchedulerSuspendEvent = 7; +var SchedulerResumeEvent = 8; + +function logEvent(entries) { + if (eventLog !== null) { + var offset = eventLogIndex; + eventLogIndex += entries.length; + + if (eventLogIndex + 1 > eventLogSize) { + eventLogSize *= 2; + + if (eventLogSize > MAX_EVENT_LOG_SIZE) { + // Using console['error'] to evade Babel and ESLint + console['error']("Scheduler Profiling: Event log exceeded maximum size. Don't " + 'forget to call `stopLoggingProfilingEvents()`.'); + stopLoggingProfilingEvents(); + return; + } + + var newEventLog = new Int32Array(eventLogSize * 4); + newEventLog.set(eventLog); + eventLogBuffer = newEventLog.buffer; + eventLog = newEventLog; + } + + eventLog.set(entries, offset); + } +} + +function startLoggingProfilingEvents() { + eventLogSize = INITIAL_EVENT_LOG_SIZE; + eventLogBuffer = new ArrayBuffer(eventLogSize * 4); + eventLog = new Int32Array(eventLogBuffer); + eventLogIndex = 0; +} +function stopLoggingProfilingEvents() { + var buffer = eventLogBuffer; + eventLogSize = 0; + eventLogBuffer = null; + eventLog = null; + eventLogIndex = 0; + return buffer; +} +function markTaskStart(task, ms) { + { + profilingState[QUEUE_SIZE]++; + + if (eventLog !== null) { + // performance.now returns a float, representing milliseconds. When the + // event is logged, it's coerced to an int. Convert to microseconds to + // maintain extra degrees of precision. + logEvent([TaskStartEvent, ms * 1000, task.id, task.priorityLevel]); + } + } +} +function markTaskCompleted(task, ms) { + { + profilingState[PRIORITY] = NoPriority; + profilingState[CURRENT_TASK_ID] = 0; + profilingState[QUEUE_SIZE]--; + + if (eventLog !== null) { + logEvent([TaskCompleteEvent, ms * 1000, task.id]); + } + } +} +function markTaskCanceled(task, ms) { + { + profilingState[QUEUE_SIZE]--; + + if (eventLog !== null) { + logEvent([TaskCancelEvent, ms * 1000, task.id]); + } + } +} function markTaskErrored(task, ms) { + { + profilingState[PRIORITY] = NoPriority; + profilingState[CURRENT_TASK_ID] = 0; + profilingState[QUEUE_SIZE]--; + + if (eventLog !== null) { + logEvent([TaskErrorEvent, ms * 1000, task.id]); + } + } +} +function markTaskRun(task, ms) { + { + runIdCounter++; + profilingState[PRIORITY] = task.priorityLevel; + profilingState[CURRENT_TASK_ID] = task.id; + profilingState[CURRENT_RUN_ID] = runIdCounter; + + if (eventLog !== null) { + logEvent([TaskRunEvent, ms * 1000, task.id, runIdCounter]); + } + } +} +function markTaskYield(task, ms) { + { + profilingState[PRIORITY] = NoPriority; + profilingState[CURRENT_TASK_ID] = 0; + profilingState[CURRENT_RUN_ID] = 0; + + if (eventLog !== null) { + logEvent([TaskYieldEvent, ms * 1000, task.id, runIdCounter]); + } + } +} +function markSchedulerSuspended(ms) { + { + mainThreadIdCounter++; + + if (eventLog !== null) { + logEvent([SchedulerSuspendEvent, ms * 1000, mainThreadIdCounter]); + } + } +} +function markSchedulerUnsuspended(ms) { + { + if (eventLog !== null) { + logEvent([SchedulerResumeEvent, ms * 1000, mainThreadIdCounter]); + } + } } /* eslint-disable no-var */ @@ -9008,6 +9075,11 @@ function advanceTimers(currentTime) { pop(timerQueue); timer.sortIndex = timer.expirationTime; push(taskQueue, timer); + + { + markTaskStart(timer, currentTime); + timer.isQueued = true; + } } else { // Remaining timers are pending. return; @@ -9036,6 +9108,9 @@ function handleTimeout(currentTime) { } function flushWork(hasTimeRemaining, initialTime) { + { + markSchedulerUnsuspended(initialTime); + } // We'll need a host callback the next time work is scheduled. isHostCallbackScheduled = false; @@ -9050,14 +9125,29 @@ function flushWork(hasTimeRemaining, initialTime) { var previousPriorityLevel = currentPriorityLevel; try { - var currentTime; if (enableProfiling) ; else { - // No catch in prod code path. - return workLoop(hasTimeRemaining, initialTime); + if (enableProfiling) { + try { + return workLoop(hasTimeRemaining, initialTime); + } catch (error) { + if (currentTask !== null) { + var currentTime = exports.unstable_now(); + markTaskErrored(currentTask, currentTime); + currentTask.isQueued = false; + } + + throw error; + } } } finally { currentTask = null; currentPriorityLevel = previousPriorityLevel; isPerformingWork = false; + + { + var _currentTime = exports.unstable_now(); + + markSchedulerSuspended(_currentTime); + } } } @@ -9078,13 +9168,18 @@ function workLoop(hasTimeRemaining, initialTime) { currentTask.callback = null; currentPriorityLevel = currentTask.priorityLevel; var didUserCallbackTimeout = currentTask.expirationTime <= currentTime; - + markTaskRun(currentTask, currentTime); var continuationCallback = callback(didUserCallbackTimeout); currentTime = exports.unstable_now(); if (typeof continuationCallback === 'function') { currentTask.callback = continuationCallback; + markTaskYield(currentTask, currentTime); } else { + { + markTaskCompleted(currentTask, currentTime); + currentTask.isQueued = false; + } if (currentTask === peek(taskQueue)) { pop(taskQueue); @@ -9229,6 +9324,10 @@ function unstable_scheduleCallback(priorityLevel, callback, options) { sortIndex: -1 }; + { + newTask.isQueued = false; + } + if (startTime > currentTime) { // This is a delayed task. newTask.sortIndex = startTime; @@ -9249,6 +9348,11 @@ function unstable_scheduleCallback(priorityLevel, callback, options) { } else { newTask.sortIndex = expirationTime; push(taskQueue, newTask); + + { + markTaskStart(newTask, currentTime); + newTask.isQueued = true; + } // Schedule a host callback, if needed. If we're already performing work, // wait until the next time we yield. @@ -9277,6 +9381,13 @@ function unstable_getFirstCallbackNode() { } function unstable_cancelCallback(task) { + { + if (task.isQueued) { + var currentTime = exports.unstable_now(); + markTaskCanceled(task, currentTime); + task.isQueued = false; + } + } // Null out the callback to indicate the task has been canceled. (Can't // remove from the queue because you can't remove arbitrary nodes from an // array based heap, only the first one.) @@ -9289,7 +9400,11 @@ function unstable_getCurrentPriorityLevel() { } var unstable_requestPaint = requestPaint; -var unstable_Profiling = null; +var unstable_Profiling = { + startLoggingProfilingEvents: startLoggingProfilingEvents, + stopLoggingProfilingEvents: stopLoggingProfilingEvents, + sharedProfilingBuffer: sharedProfilingBuffer +} ; exports.unstable_IdlePriority = IdlePriority; exports.unstable_ImmediatePriority = ImmediatePriority; @@ -9375,7 +9490,7 @@ da("onCompositionStart","compositionstart focusout keydown keypress keyup moused function wc(a){var b=a[wf];if(b)return b;for(var c=a.parentNode;c;){if(b=c[ff]||c[wf]){c=b.alternate;if(null!==b.child||null!==c&&null!==c.child)for(a=sf(a);null!==a;){if(c=a[wf])return c;a=sf(a);}return b}a=c;c=a.parentNode;}return null}var Lf=null,Mf=null;scheduler.unstable_runWithPriority;scheduler.unstable_scheduleCallback;scheduler.unstable_cancelCallback;scheduler.unstable_shouldYield;scheduler.unstable_requestPaint;var Sf=scheduler.unstable_now;scheduler.unstable_getCurrentPriorityLevel;scheduler.unstable_ImmediatePriority;scheduler.unstable_UserBlockingPriority;scheduler.unstable_NormalPriority;scheduler.unstable_LowPriority;scheduler.unstable_IdlePriority;Sf(); ra.ReactCurrentBatchConfig;(new react.Component).refs; ra.ReactCurrentDispatcher;ra.ReactCurrentBatchConfig;ra.ReactCurrentOwner;ra.ReactCurrentDispatcher;ra.ReactCurrentOwner;function pk(){return null} -var wk={findFiberByHostInstance:wc,bundleType:0,version:"17.0.2",rendererPackageName:"react-dom"}; +var wk={findFiberByHostInstance:wc,bundleType:0,version:"17.0.1",rendererPackageName:"react-dom"}; var xk={bundleType:wk.bundleType,version:wk.version,rendererPackageName:wk.rendererPackageName,rendererConfig:wk.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:ra.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){a=cc(a);return null===a?null:a.stateNode},findFiberByHostInstance:wk.findFiberByHostInstance|| pk,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var yk=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yk.isDisabled&&yk.supportsFiber)try{Lf=yk.inject(xk),Mf=yk;}catch(a){}} @@ -21067,7 +21182,7 @@ function flushSyncCallbackQueueImpl() { } // TODO: this is special because it gets imported during build. -var ReactVersion = '17.0.2'; +var ReactVersion = '17.0.1'; var NoMode = 0; var StrictMode = 1; // TODO: Remove BlockingMode and ConcurrentMode by reading from the root @@ -36129,7 +36244,6 @@ function mergeOptionsWithPopperConfig(_ref) { placement = _ref.placement, flip = _ref.flip, offset = _ref.offset, - fixed = _ref.fixed, containerPadding = _ref.containerPadding, arrowElement = _ref.arrowElement, _ref$popperConfig = _ref.popperConfig, @@ -36138,7 +36252,6 @@ function mergeOptionsWithPopperConfig(_ref) { return _extends({}, popperConfig, { placement: placement, enabled: enabled, - strategy: fixed ? 'fixed' : popperConfig.strategy, modifiers: toModifierArray(_extends({}, modifiers, { eventListeners: { enabled: enableEvents @@ -36195,13 +36308,11 @@ function useDropdownMenu(options) { flip = _options.flip, offset = _options.offset, rootCloseEvent = _options.rootCloseEvent, - _options$fixed = _options.fixed, - fixed = _options$fixed === void 0 ? false : _options$fixed, _options$popperConfig = _options.popperConfig, popperConfig = _options$popperConfig === void 0 ? {} : _options$popperConfig, _options$usePopper = _options.usePopper, shouldUsePopper = _options$usePopper === void 0 ? !!context : _options$usePopper; - var show = (context == null ? void 0 : context.show) == null ? !!options.show : context.show; + var show = (context == null ? void 0 : context.show) == null ? options.show : context.show; var alignEnd = (context == null ? void 0 : context.alignEnd) == null ? options.alignEnd : context.alignEnd; if (show && !hasShownRef.current) { @@ -36220,41 +36331,54 @@ function useDropdownMenu(options) { var placement = alignEnd ? 'bottom-end' : 'bottom-start'; if (drop === 'up') placement = alignEnd ? 'top-end' : 'top-start';else if (drop === 'right') placement = alignEnd ? 'right-end' : 'right-start';else if (drop === 'left') placement = alignEnd ? 'left-end' : 'left-start'; - var popper = usePopper(toggleElement, menuElement, mergeOptionsWithPopperConfig({ + + var _usePopper = usePopper(toggleElement, menuElement, mergeOptionsWithPopperConfig({ placement: placement, enabled: !!(shouldUsePopper && show), enableEvents: show, offset: offset, flip: flip, - fixed: fixed, arrowElement: arrowElement, popperConfig: popperConfig - })); + })), + styles = _usePopper.styles, + attributes = _usePopper.attributes, + popper = _objectWithoutPropertiesLoose(_usePopper, ["styles", "attributes"]); - var menuProps = _extends({ + var menu; + var menuProps = { ref: setMenu || noop$8, 'aria-labelledby': toggleElement == null ? void 0 : toggleElement.id - }, popper.attributes.popper, { - style: popper.styles.popper - }); - - var metadata = { + }; + var childArgs = { show: show, alignEnd: alignEnd, hasShown: hasShownRef.current, - toggle: context == null ? void 0 : context.toggle, - popper: shouldUsePopper ? popper : null, - arrowProps: shouldUsePopper ? _extends({ - ref: attachArrowRef - }, popper.attributes.arrow, { - style: popper.styles.arrow - }) : {} + close: handleClose }; + + if (!shouldUsePopper) { + menu = _extends({}, childArgs, { + props: menuProps + }); + } else { + menu = _extends({}, popper, childArgs, { + props: _extends({}, menuProps, attributes.popper, { + style: styles.popper + }), + arrowProps: _extends({ + ref: attachArrowRef + }, attributes.arrow, { + style: styles.arrow + }) + }); + } + useRootClose(menuElement, handleClose, { clickTrigger: rootCloseEvent, - disabled: !show + disabled: !(menu && show) }); - return [menuProps, metadata]; + return menu; } var propTypes$5 = { /** @@ -36327,11 +36451,8 @@ function DropdownMenu$1(_ref2) { var children = _ref2.children, options = _objectWithoutPropertiesLoose(_ref2, ["children"]); - var _useDropdownMenu = useDropdownMenu(options), - props = _useDropdownMenu[0], - meta = _useDropdownMenu[1]; - - return /*#__PURE__*/react.createElement(react.Fragment, null, meta.hasShown ? children(props, meta) : null); + var args = useDropdownMenu(options); + return /*#__PURE__*/react.createElement(react.Fragment, null, args.hasShown ? children(args) : null); } DropdownMenu$1.displayName = 'ReactOverlaysDropdownMenu'; @@ -36355,12 +36476,8 @@ function useDropdownToggle() { toggle = _ref$toggle === void 0 ? noop$7 : _ref$toggle, setToggle = _ref.setToggle; - var handleClick = react_9(function (e) { - toggle(!show, e); - }, [show, toggle]); return [{ ref: setToggle || noop$7, - onClick: handleClick, 'aria-haspopup': true, 'aria-expanded': !!show }, { @@ -36398,9 +36515,15 @@ function DropdownToggle$1(_ref2) { var _useDropdownToggle = useDropdownToggle(), props = _useDropdownToggle[0], - meta = _useDropdownToggle[1]; + _useDropdownToggle$ = _useDropdownToggle[1], + show = _useDropdownToggle$.show, + toggle = _useDropdownToggle$.toggle; - return /*#__PURE__*/react.createElement(react.Fragment, null, children(props, meta)); + return /*#__PURE__*/react.createElement(react.Fragment, null, children({ + show: show, + toggle: toggle, + props: props + })); } DropdownToggle$1.displayName = 'ReactOverlaysDropdownToggle'; @@ -36418,7 +36541,7 @@ var propTypes$3 = { * }, * }) => React.Element} */ - children: propTypes$6.node, + children: propTypes$6.func.isRequired, /** * Determines the direction and location of the Menu in relation to it's Toggle. @@ -36475,22 +36598,9 @@ var propTypes$3 = { onToggle: propTypes$6.func }; -function useRefWithUpdate() { - var forceUpdate = useForceUpdate(); - var ref = react_15(null); - var attachRef = react_9(function (element) { - ref.current = element; // ensure that a menu set triggers an update for consumers - - forceUpdate(); - }, [forceUpdate]); - return [ref, attachRef]; -} /** * @displayName Dropdown - * @public */ - - function Dropdown$1(_ref) { var drop = _ref.drop, alignEnd = _ref.alignEnd, @@ -36501,31 +36611,32 @@ function Dropdown$1(_ref) { itemSelector = _ref$itemSelector === void 0 ? '* > *' : _ref$itemSelector, focusFirstItemOnShow = _ref.focusFirstItemOnShow, children = _ref.children; + var forceUpdate = useForceUpdate(); var _useUncontrolledProp = useUncontrolledProp(rawShow, defaultShow, rawOnToggle), show = _useUncontrolledProp[0], - onToggle = _useUncontrolledProp[1]; // We use normal refs instead of useCallbackRef in order to populate the + onToggle = _useUncontrolledProp[1]; + + var _useCallbackRef = useCallbackRef(), + toggleElement = _useCallbackRef[0], + setToggle = _useCallbackRef[1]; // We use normal refs instead of useCallbackRef in order to populate the // the value as quickly as possible, otherwise the effect to focus the element // may run before the state value is set - var _useRefWithUpdate = useRefWithUpdate(), - menuRef = _useRefWithUpdate[0], - setMenu = _useRefWithUpdate[1]; - + var menuRef = react_15(null); var menuElement = menuRef.current; + var setMenu = react_9(function (ref) { + menuRef.current = ref; // ensure that a menu set triggers an update for consumers - var _useRefWithUpdate2 = useRefWithUpdate(), - toggleRef = _useRefWithUpdate2[0], - setToggle = _useRefWithUpdate2[1]; - - var toggleElement = toggleRef.current; + forceUpdate(); + }, [forceUpdate]); var lastShow = usePrevious(show); var lastSourceEvent = react_15(null); var focusInDropdown = react_15(false); - var toggle = react_9(function (nextShow, event) { - onToggle(nextShow, event); - }, [onToggle]); + var toggle = react_9(function (event) { + onToggle(!show, event); + }, [onToggle, show]); var context = react_12(function () { return { toggle: toggle, @@ -36581,22 +36692,14 @@ function Dropdown$1(_ref) { return items[index]; }; - useGlobalListener('keydown', function (event) { - var _menuRef$current, _toggleRef$current; - + var handleKeyDown = function handleKeyDown(event) { var key = event.key; - var target = event.target; - var fromMenu = (_menuRef$current = menuRef.current) == null ? void 0 : _menuRef$current.contains(target); - var fromToggle = (_toggleRef$current = toggleRef.current) == null ? void 0 : _toggleRef$current.contains(target); // Second only to https://github.com/twbs/bootstrap/blob/8cfbf6933b8a0146ac3fbc369f19e520bd1ebdac/js/src/dropdown.js#L400 + var target = event.target; // Second only to https://github.com/twbs/bootstrap/blob/8cfbf6933b8a0146ac3fbc369f19e520bd1ebdac/js/src/dropdown.js#L400 // in inscrutability var isInput = /input|textarea/i.test(target.tagName); - if (isInput && (key === ' ' || key !== 'Escape' && fromMenu)) { - return; - } - - if (!fromMenu && !fromToggle) { + if (isInput && (key === ' ' || key !== 'Escape' && menuRef.current && menuRef.current.contains(target))) { return; } @@ -36615,7 +36718,7 @@ function Dropdown$1(_ref) { event.preventDefault(); if (!show) { - onToggle(true, event); + toggle(event); } else { var _next = getNextFocusedChild(target, 1); @@ -36624,30 +36727,20 @@ function Dropdown$1(_ref) { return; - case 'Tab': - // on keydown the target is the element being tabbed FROM, we need that - // to know if this event is relevant to this dropdown (e.g. in this menu). - // On `keyup` the target is the element being tagged TO which we use to check - // if focus has left the menu - addEventListener(document, 'keyup', function (e) { - if (e.key === 'Tab' && !e.target || !menuRef.current.contains(e.target)) { - onToggle(false, event); - } - }, { - once: true - }); - break; - case 'Escape': - event.preventDefault(); - event.stopPropagation(); + case 'Tab': onToggle(false, event); break; } - }); + }; + return /*#__PURE__*/react.createElement(DropdownContext.Provider, { value: context - }, children); + }, children({ + props: { + onKeyDown: handleKeyDown + } + })); } Dropdown$1.displayName = 'ReactOverlaysDropdown'; @@ -36655,7 +36748,7 @@ Dropdown$1.propTypes = propTypes$3; Dropdown$1.Menu = DropdownMenu$1; Dropdown$1.Toggle = DropdownToggle$1; -var SelectableContext = /*#__PURE__*/react.createContext(null); +var SelectableContext = react.createContext(null); var makeEventKey = function makeEventKey(eventKey, href) { if (href === void 0) { href = null; @@ -36665,15 +36758,14 @@ var makeEventKey = function makeEventKey(eventKey, href) { return href || null; }; -var NavContext = /*#__PURE__*/react.createContext(null); +var NavContext = react.createContext(null); NavContext.displayName = 'NavContext'; -var _excluded$w = ["bsPrefix", "className", "children", "eventKey", "disabled", "href", "onClick", "onSelect", "active", "as"]; var defaultProps$e = { as: SafeAnchor, disabled: false }; -var DropdownItem = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var DropdownItem = react.forwardRef(function (_ref, ref) { var bsPrefix = _ref.bsPrefix, className = _ref.className, children = _ref.children, @@ -36684,14 +36776,15 @@ var DropdownItem = /*#__PURE__*/react.forwardRef(function (_ref, ref) { onSelect = _ref.onSelect, propActive = _ref.active, Component = _ref.as, - props = _objectWithoutPropertiesLoose(_ref, _excluded$w); + props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "className", "children", "eventKey", "disabled", "href", "onClick", "onSelect", "active", "as"]); var prefix = useBootstrapPrefix(bsPrefix, 'dropdown-item'); var onSelectCtx = react_13(SelectableContext); var navContext = react_13(NavContext); var _ref2 = navContext || {}, - activeKey = _ref2.activeKey; + activeKey = _ref2.activeKey; // TODO: Restrict eventKey to string in v5? + var key = makeEventKey(eventKey, href); var active = propActive == null && key != null ? makeEventKey(activeKey) === key : propActive; @@ -36756,57 +36849,9 @@ function useMergedRefs(refA, refB) { }, [refA, refB]); } -var context$1 = /*#__PURE__*/react.createContext(null); +var context$1 = react.createContext(null); context$1.displayName = 'NavbarContext'; -/** - * Copyright (c) 2013-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -/** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ - -var invariant = function(condition, format, a, b, c, d, e, f) { - { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); - } - } - - if (!condition) { - var error; - if (format === undefined) { - error = new Error( - 'Minified exception occurred; use the non-minified dev environment ' + - 'for the full error message and additional helpful warnings.' - ); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error( - format.replace(/%s/g, function() { return args[argIndex++]; }) - ); - error.name = 'Invariant Violation'; - } - - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } -}; - -var browser = invariant; - function useWrappedRefWithWarning(ref, componentName) { var warningRef = react_9(function (refValue) { @@ -36816,12 +36861,6 @@ function useWrappedRefWithWarning(ref, componentName) { return useMergedRefs(warningRef, ref); } -/** - * Checks if a given element has a CSS class. - * - * @param element the element - * @param className the CSS class name - */ function hasClass(element, className) { if (element.classList) return !!className && element.classList.contains(className); return (" " + (element.className.baseVal || element.className) + " ").indexOf(" " + className + " ") !== -1; @@ -36844,7 +36883,6 @@ function getMargins(element) { function usePopperMarginModifiers() { var overlayRef = react_15(null); var margins = react_15(null); - var arrowMargins = react_15(null); var popoverClass = useBootstrapPrefix(undefined, 'popover'); var dropdownMenuClass = useBootstrapPrefix(undefined, 'dropdown-menu'); var callback = react_9(function (overlay) { @@ -36885,32 +36923,7 @@ function usePopperMarginModifiers() { } } }; - }, [margins]); - var arrow = react_12(function () { - return { - name: 'arrow', - options: { - padding: function padding() { - // The options here are used for Popper 2.8.4 and up. - // For earlier version, padding is handled in popoverArrowMargins below. - if (!arrowMargins.current) { - return 0; - } - - var _arrowMargins$current = arrowMargins.current, - top = _arrowMargins$current.top, - right = _arrowMargins$current.right; - var padding = top || right; - return { - top: padding, - left: padding, - right: padding, - bottom: padding - }; - } - } - }; - }, [arrowMargins]); // Converts popover arrow margin to arrow modifier padding + }, [margins]); // Converts popover arrow margin to arrow modifier padding var popoverArrowMargins = react_12(function () { return { @@ -36921,30 +36934,21 @@ function usePopperMarginModifiers() { effect: function effect(_ref2) { var state = _ref2.state; - if (!overlayRef.current || !state.elements.arrow || !hasClass(overlayRef.current, popoverClass)) { + if (!overlayRef.current || !state.elements.arrow || !hasClass(overlayRef.current, popoverClass) || !state.modifiersData['arrow#persistent']) { return undefined; } - if (state.modifiersData['arrow#persistent']) { - // @popperjs/core <= 2.8.3 uses arrow#persistent to pass padding to arrow modifier. - var _getMargins = getMargins(state.elements.arrow), - top = _getMargins.top, - right = _getMargins.right; - - var padding = top || right; - state.modifiersData['arrow#persistent'].padding = { - top: padding, - left: padding, - right: padding, - bottom: padding - }; - } else { - // @popperjs/core >= 2.8.4 gets the padding from the arrow modifier options, - // so we'll get the margins here, and let the arrow modifier above pass - // it to popper. - arrowMargins.current = getMargins(state.elements.arrow); - } + var _getMargins = getMargins(state.elements.arrow), + top = _getMargins.top, + right = _getMargins.right; + var padding = top || right; + state.modifiersData['arrow#persistent'].padding = { + top: padding, + left: padding, + right: padding, + bottom: padding + }; state.elements.arrow.style.margin = '0'; return function () { if (state.elements.arrow) state.elements.arrow.style.margin = ''; @@ -36952,10 +36956,9 @@ function usePopperMarginModifiers() { } }; }, [popoverClass]); - return [callback, [offset, arrow, popoverArrowMargins]]; + return [callback, [offset, popoverArrowMargins]]; } -var _excluded$v = ["bsPrefix", "className", "align", "alignRight", "rootCloseEvent", "flip", "show", "renderOnMount", "as", "popperConfig"]; var alignDirection = propTypes$6.oneOf(['left', 'right']); propTypes$6.oneOfType([alignDirection, propTypes$6.shape({ sm: alignDirection @@ -36970,8 +36973,9 @@ var defaultProps$d = { align: 'left', alignRight: false, flip: true -}; -var DropdownMenu = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +}; // TODO: remove this hack + +var DropdownMenu = react.forwardRef(function (_ref, ref) { var bsPrefix = _ref.bsPrefix, className = _ref.className, align = _ref.align, @@ -36983,7 +36987,7 @@ var DropdownMenu = /*#__PURE__*/react.forwardRef(function (_ref, ref) { _ref$as = _ref.as, Component = _ref$as === void 0 ? 'div' : _ref$as, popperConfig = _ref.popperConfig, - props = _objectWithoutPropertiesLoose(_ref, _excluded$v); + props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "className", "align", "alignRight", "rootCloseEvent", "flip", "show", "renderOnMount", "as", "popperConfig"]); var isNavbar = react_13(context$1); var prefix = useBootstrapPrefix(bsPrefix, 'dropdown-menu'); @@ -37013,7 +37017,7 @@ var DropdownMenu = /*#__PURE__*/react.forwardRef(function (_ref, ref) { } } - var _useDropdownMenu = useDropdownMenu({ + var _ref2 = useDropdownMenu({ flip: flip, rootCloseEvent: rootCloseEvent, show: showProps, @@ -37023,38 +37027,30 @@ var DropdownMenu = /*#__PURE__*/react.forwardRef(function (_ref, ref) { modifiers: marginModifiers.concat((popperConfig == null ? void 0 : popperConfig.modifiers) || []) }) }), - menuProps = _useDropdownMenu[0], - _useDropdownMenu$ = _useDropdownMenu[1], - hasShown = _useDropdownMenu$.hasShown, - popper = _useDropdownMenu$.popper, - show = _useDropdownMenu$.show, - alignEnd = _useDropdownMenu$.alignEnd, - toggle = _useDropdownMenu$.toggle; + hasShown = _ref2.hasShown, + placement = _ref2.placement, + show = _ref2.show, + alignEnd = _ref2.alignEnd, + close = _ref2.close, + menuProps = _ref2.props; menuProps.ref = useMergedRefs(popperRef, useMergedRefs(useWrappedRefWithWarning(ref, 'DropdownMenu'), menuProps.ref)); if (!hasShown && !renderOnMount) return null; // For custom components provide additional, non-DOM, props; if (typeof Component !== 'string') { menuProps.show = show; - - menuProps.close = function () { - return toggle == null ? void 0 : toggle(false); - }; - + menuProps.close = close; menuProps.alignRight = alignEnd; } - var style = props.style; - - if (popper != null && popper.placement) { + if (placement) { // we don't need the default popper style, // menus are display: none when not shown. - style = _extends({}, props.style, menuProps.style); - props['x-placement'] = popper.placement; + props.style = _extends({}, props.style, {}, menuProps.style); + props['x-placement'] = placement; } return /*#__PURE__*/react.createElement(Component, _extends({}, props, menuProps, { - style: style, className: classnames.apply(void 0, [className, prefix, show && 'show', alignEnd && prefix + "-right"].concat(alignClasses)) })); }); @@ -37088,15 +37084,14 @@ module.exports = exports['default']; unwrapExports(isRequiredForA11y_1); -var _excluded$u = ["bsPrefix", "split", "className", "childBsPrefix", "as"]; -var DropdownToggle = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var DropdownToggle = react.forwardRef(function (_ref, ref) { var bsPrefix = _ref.bsPrefix, split = _ref.split, className = _ref.className, childBsPrefix = _ref.childBsPrefix, _ref$as = _ref.as, Component = _ref$as === void 0 ? Button : _ref$as, - props = _objectWithoutPropertiesLoose(_ref, _excluded$u); + props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "split", "className", "childBsPrefix", "as"]); var prefix = useBootstrapPrefix(bsPrefix, 'dropdown-toggle'); @@ -37105,12 +37100,14 @@ var DropdownToggle = /*#__PURE__*/react.forwardRef(function (_ref, ref) { } var _useDropdownToggle = useDropdownToggle(), - toggleProps = _useDropdownToggle[0]; + toggleProps = _useDropdownToggle[0], + toggle = _useDropdownToggle[1].toggle; toggleProps.ref = useMergedRefs(toggleProps.ref, useWrappedRefWithWarning(ref, 'DropdownToggle')); // This intentionally forwards size and variant (if set) to the // underlying component, to allow it to render size and style variants. return /*#__PURE__*/react.createElement(Component, _extends({ + onClick: toggle, className: classnames(className, prefix, split && prefix + "-split") }, toggleProps, props)); }); @@ -37123,8 +37120,6 @@ function camelize(string) { }); } -var _excluded$t = ["className", "bsPrefix", "as"]; - var pascalCase = function pascalCase(str) { return str[0].toUpperCase() + camelize(str).slice(1); }; @@ -37137,12 +37132,12 @@ function createWithBsPrefix(prefix, _temp) { Component = _ref.Component, defaultProps = _ref.defaultProps; - var BsComponent = /*#__PURE__*/react.forwardRef(function (_ref2, ref) { + var BsComponent = react.forwardRef(function (_ref2, ref) { var className = _ref2.className, bsPrefix = _ref2.bsPrefix, _ref2$as = _ref2.as, Tag = _ref2$as === void 0 ? Component || 'div' : _ref2$as, - props = _objectWithoutPropertiesLoose(_ref2, _excluded$t); + props = _objectWithoutPropertiesLoose(_ref2, ["className", "bsPrefix", "as"]); var resolvedPrefix = useBootstrapPrefix(bsPrefix, prefix); return /*#__PURE__*/react.createElement(Tag, _extends({ @@ -37155,7 +37150,6 @@ function createWithBsPrefix(prefix, _temp) { return BsComponent; } -var _excluded$s = ["bsPrefix", "drop", "show", "className", "alignRight", "onSelect", "onToggle", "focusFirstItemOnShow", "as", "navbar"]; var DropdownHeader = createWithBsPrefix('dropdown-header', { defaultProps: { role: 'heading' @@ -37172,7 +37166,7 @@ var DropdownItemText = createWithBsPrefix('dropdown-item-text', { var defaultProps$c = { navbar: false }; -var Dropdown = /*#__PURE__*/react.forwardRef(function (pProps, ref) { +var Dropdown = react.forwardRef(function (pProps, ref) { var _useUncontrolled = useUncontrolled(pProps, { show: 'onToggle' }), @@ -37187,7 +37181,7 @@ var Dropdown = /*#__PURE__*/react.forwardRef(function (pProps, ref) { _useUncontrolled$as = _useUncontrolled.as, Component = _useUncontrolled$as === void 0 ? 'div' : _useUncontrolled$as; _useUncontrolled.navbar; - var props = _objectWithoutPropertiesLoose(_useUncontrolled, _excluded$s); + var props = _objectWithoutPropertiesLoose(_useUncontrolled, ["bsPrefix", "drop", "show", "className", "alignRight", "onSelect", "onToggle", "focusFirstItemOnShow", "as", "navbar"]); var onSelectCtx = react_13(SelectableContext); var prefix = useBootstrapPrefix(bsPrefix, 'dropdown'); @@ -37196,7 +37190,7 @@ var Dropdown = /*#__PURE__*/react.forwardRef(function (pProps, ref) { source = event.type; } - if (event.currentTarget === document && (source !== 'keydown' || event.key === 'Escape')) source = 'rootClose'; + if (event.currentTarget === document) source = 'rootClose'; if (onToggle) { onToggle(nextShow, event, { @@ -37218,10 +37212,13 @@ var Dropdown = /*#__PURE__*/react.forwardRef(function (pProps, ref) { onToggle: handleToggle, focusFirstItemOnShow: focusFirstItemOnShow, itemSelector: "." + prefix + "-item:not(.disabled):not(:disabled)" - }, /*#__PURE__*/react.createElement(Component, _extends({}, props, { - ref: ref, - className: classnames(className, show && 'show', (!drop || drop === 'down') && prefix, drop === 'up' && 'dropup', drop === 'right' && 'dropright', drop === 'left' && 'dropleft') - })))); + }, function (_ref) { + var dropdownProps = _ref.props; + return /*#__PURE__*/react.createElement(Component, _extends({}, props, dropdownProps, { + ref: ref, + className: classnames(className, show && 'show', (!drop || drop === 'down') && prefix, drop === 'up' && 'dropup', drop === 'right' && 'dropright', drop === 'left' && 'dropleft') + })); + })); }); Dropdown.displayName = 'Dropdown'; Dropdown.defaultProps = defaultProps$c; @@ -37325,7 +37322,6 @@ module.exports = exports['default']; unwrapExports(all_1); -var _excluded$r = ["as", "className", "type", "tooltip"]; var propTypes$2 = { /** * Specify whether the feedback is for valid or invalid fields @@ -37338,7 +37334,7 @@ var propTypes$2 = { tooltip: propTypes$6.bool, as: propTypes$6.elementType }; -var Feedback = /*#__PURE__*/react.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595 +var Feedback = react.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595 function (_ref, ref) { var _ref$as = _ref.as, Component = _ref$as === void 0 ? 'div' : _ref$as, @@ -37347,7 +37343,7 @@ function (_ref, ref) { type = _ref$type === void 0 ? 'valid' : _ref$type, _ref$tooltip = _ref.tooltip, tooltip = _ref$tooltip === void 0 ? false : _ref$tooltip, - props = _objectWithoutPropertiesLoose(_ref, _excluded$r); + props = _objectWithoutPropertiesLoose(_ref, ["as", "className", "type", "tooltip"]); return /*#__PURE__*/react.createElement(Component, _extends({}, props, { ref: ref, @@ -37357,12 +37353,11 @@ function (_ref, ref) { Feedback.displayName = 'Feedback'; Feedback.propTypes = propTypes$2; -var FormContext = /*#__PURE__*/react.createContext({ +var FormContext = react.createContext({ controlId: undefined }); -var _excluded$q = ["id", "bsPrefix", "bsCustomPrefix", "className", "type", "isValid", "isInvalid", "isStatic", "as"]; -var FormCheckInput = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var FormCheckInput = react.forwardRef(function (_ref, ref) { var id = _ref.id, bsPrefix = _ref.bsPrefix, bsCustomPrefix = _ref.bsCustomPrefix, @@ -37376,7 +37371,7 @@ var FormCheckInput = /*#__PURE__*/react.forwardRef(function (_ref, ref) { isStatic = _ref.isStatic, _ref$as = _ref.as, Component = _ref$as === void 0 ? 'input' : _ref$as, - props = _objectWithoutPropertiesLoose(_ref, _excluded$q); + props = _objectWithoutPropertiesLoose(_ref, ["id", "bsPrefix", "bsCustomPrefix", "className", "type", "isValid", "isInvalid", "isStatic", "as"]); var _useContext = react_13(FormContext), controlId = _useContext.controlId, @@ -37396,13 +37391,12 @@ var FormCheckInput = /*#__PURE__*/react.forwardRef(function (_ref, ref) { }); FormCheckInput.displayName = 'FormCheckInput'; -var _excluded$p = ["bsPrefix", "bsCustomPrefix", "className", "htmlFor"]; -var FormCheckLabel = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var FormCheckLabel = react.forwardRef(function (_ref, ref) { var bsPrefix = _ref.bsPrefix, bsCustomPrefix = _ref.bsCustomPrefix, className = _ref.className, htmlFor = _ref.htmlFor, - props = _objectWithoutPropertiesLoose(_ref, _excluded$p); + props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "bsCustomPrefix", "className", "htmlFor"]); var _useContext = react_13(FormContext), controlId = _useContext.controlId, @@ -37421,8 +37415,7 @@ var FormCheckLabel = /*#__PURE__*/react.forwardRef(function (_ref, ref) { }); FormCheckLabel.displayName = 'FormCheckLabel'; -var _excluded$o = ["id", "bsPrefix", "bsCustomPrefix", "inline", "disabled", "isValid", "isInvalid", "feedbackTooltip", "feedback", "className", "style", "title", "type", "label", "children", "custom", "as"]; -var FormCheck = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var FormCheck = react.forwardRef(function (_ref, ref) { var id = _ref.id, bsPrefix = _ref.bsPrefix, bsCustomPrefix = _ref.bsCustomPrefix, @@ -37448,7 +37441,7 @@ var FormCheck = /*#__PURE__*/react.forwardRef(function (_ref, ref) { propCustom = _ref.custom, _ref$as = _ref.as, as = _ref$as === void 0 ? 'input' : _ref$as, - props = _objectWithoutPropertiesLoose(_ref, _excluded$o); + props = _objectWithoutPropertiesLoose(_ref, ["id", "bsPrefix", "bsCustomPrefix", "inline", "disabled", "isValid", "isInvalid", "feedbackTooltip", "feedback", "className", "style", "title", "type", "label", "children", "custom", "as"]); var custom = type === 'switch' ? true : propCustom; @@ -37493,8 +37486,7 @@ FormCheck.displayName = 'FormCheck'; FormCheck.Input = FormCheckInput; FormCheck.Label = FormCheckLabel; -var _excluded$n = ["id", "bsPrefix", "bsCustomPrefix", "className", "isValid", "isInvalid", "lang", "as"]; -var FormFileInput = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var FormFileInput = react.forwardRef(function (_ref, ref) { var id = _ref.id, bsPrefix = _ref.bsPrefix, bsCustomPrefix = _ref.bsCustomPrefix, @@ -37504,7 +37496,7 @@ var FormFileInput = /*#__PURE__*/react.forwardRef(function (_ref, ref) { lang = _ref.lang, _ref$as = _ref.as, Component = _ref$as === void 0 ? 'input' : _ref$as, - props = _objectWithoutPropertiesLoose(_ref, _excluded$n); + props = _objectWithoutPropertiesLoose(_ref, ["id", "bsPrefix", "bsCustomPrefix", "className", "isValid", "isInvalid", "lang", "as"]); var _useContext = react_13(FormContext), controlId = _useContext.controlId, @@ -37527,13 +37519,12 @@ var FormFileInput = /*#__PURE__*/react.forwardRef(function (_ref, ref) { }); FormFileInput.displayName = 'FormFileInput'; -var _excluded$m = ["bsPrefix", "bsCustomPrefix", "className", "htmlFor"]; -var FormFileLabel = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var FormFileLabel = react.forwardRef(function (_ref, ref) { var bsPrefix = _ref.bsPrefix, bsCustomPrefix = _ref.bsCustomPrefix, className = _ref.className, htmlFor = _ref.htmlFor, - props = _objectWithoutPropertiesLoose(_ref, _excluded$m); + props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "bsCustomPrefix", "className", "htmlFor"]); var _useContext = react_13(FormContext), controlId = _useContext.controlId, @@ -37553,8 +37544,7 @@ var FormFileLabel = /*#__PURE__*/react.forwardRef(function (_ref, ref) { }); FormFileLabel.displayName = 'FormFileLabel'; -var _excluded$l = ["id", "bsPrefix", "bsCustomPrefix", "disabled", "isValid", "isInvalid", "feedbackTooltip", "feedback", "className", "style", "label", "children", "custom", "lang", "data-browse", "as", "inputAs"]; -var FormFile = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var FormFile = react.forwardRef(function (_ref, ref) { var id = _ref.id, bsPrefix = _ref.bsPrefix, bsCustomPrefix = _ref.bsCustomPrefix, @@ -37578,7 +37568,7 @@ var FormFile = /*#__PURE__*/react.forwardRef(function (_ref, ref) { Component = _ref$as === void 0 ? 'div' : _ref$as, _ref$inputAs = _ref.inputAs, inputAs = _ref$inputAs === void 0 ? 'input' : _ref$inputAs, - props = _objectWithoutPropertiesLoose(_ref, _excluded$l); + props = _objectWithoutPropertiesLoose(_ref, ["id", "bsPrefix", "bsCustomPrefix", "disabled", "isValid", "isInvalid", "feedbackTooltip", "feedback", "className", "style", "label", "children", "custom", "lang", "data-browse", "as", "inputAs"]); var _ref2 = custom ? [bsCustomPrefix, 'custom'] : [bsPrefix, 'form-file'], prefix = _ref2[0], @@ -37621,8 +37611,7 @@ FormFile.displayName = 'FormFile'; FormFile.Input = FormFileInput; FormFile.Label = FormFileLabel; -var _excluded$k = ["bsPrefix", "bsCustomPrefix", "type", "size", "htmlSize", "id", "className", "isValid", "isInvalid", "plaintext", "readOnly", "custom", "as"]; -var FormControl = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var FormControl = react.forwardRef(function (_ref, ref) { var bsPrefix = _ref.bsPrefix, bsCustomPrefix = _ref.bsCustomPrefix, type = _ref.type, @@ -37639,7 +37628,7 @@ var FormControl = /*#__PURE__*/react.forwardRef(function (_ref, ref) { custom = _ref.custom, _ref$as = _ref.as, Component = _ref$as === void 0 ? 'input' : _ref$as, - props = _objectWithoutPropertiesLoose(_ref, _excluded$k); + props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "bsCustomPrefix", "type", "size", "htmlSize", "id", "className", "isValid", "isInvalid", "plaintext", "readOnly", "custom", "as"]); var _useContext = react_13(FormContext), controlId = _useContext.controlId; @@ -37688,15 +37677,14 @@ var FormControl$1 = Object.assign(FormControl, { Feedback: Feedback }); -var _excluded$j = ["bsPrefix", "className", "children", "controlId", "as"]; -var FormGroup = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var FormGroup = react.forwardRef(function (_ref, ref) { var bsPrefix = _ref.bsPrefix, className = _ref.className, children = _ref.children, controlId = _ref.controlId, _ref$as = _ref.as, Component = _ref$as === void 0 ? 'div' : _ref$as, - props = _objectWithoutPropertiesLoose(_ref, _excluded$j); + props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "className", "children", "controlId", "as"]); bsPrefix = useBootstrapPrefix(bsPrefix, 'form-group'); var context = react_12(function () { @@ -37713,12 +37701,11 @@ var FormGroup = /*#__PURE__*/react.forwardRef(function (_ref, ref) { }); FormGroup.displayName = 'FormGroup'; -var _excluded$i = ["as", "bsPrefix", "column", "srOnly", "className", "htmlFor"]; var defaultProps$b = { column: false, srOnly: false }; -var FormLabel = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var FormLabel = react.forwardRef(function (_ref, ref) { var _ref$as = _ref.as, Component = _ref$as === void 0 ? 'label' : _ref$as, bsPrefix = _ref.bsPrefix, @@ -37726,7 +37713,7 @@ var FormLabel = /*#__PURE__*/react.forwardRef(function (_ref, ref) { srOnly = _ref.srOnly, className = _ref.className, htmlFor = _ref.htmlFor, - props = _objectWithoutPropertiesLoose(_ref, _excluded$i); + props = _objectWithoutPropertiesLoose(_ref, ["as", "bsPrefix", "column", "srOnly", "className", "htmlFor"]); var _useContext = react_13(FormContext), controlId = _useContext.controlId; @@ -37738,7 +37725,6 @@ var FormLabel = /*#__PURE__*/react.forwardRef(function (_ref, ref) { warning_1(controlId == null || !htmlFor, '`controlId` is ignored on `` when `htmlFor` is specified.') ; htmlFor = htmlFor || controlId; if (column) return /*#__PURE__*/react.createElement(Col, _extends({ - ref: ref, as: "label", className: classes, htmlFor: htmlFor @@ -37756,15 +37742,14 @@ var FormLabel = /*#__PURE__*/react.forwardRef(function (_ref, ref) { FormLabel.displayName = 'FormLabel'; FormLabel.defaultProps = defaultProps$b; -var _excluded$h = ["bsPrefix", "className", "as", "muted"]; -var FormText = /*#__PURE__*/react.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595 +var FormText = react.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595 function (_ref, ref) { var bsPrefix = _ref.bsPrefix, className = _ref.className, _ref$as = _ref.as, Component = _ref$as === void 0 ? 'small' : _ref$as, muted = _ref.muted, - props = _objectWithoutPropertiesLoose(_ref, _excluded$h); + props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "className", "as", "muted"]); bsPrefix = useBootstrapPrefix(bsPrefix, 'form-text'); return /*#__PURE__*/react.createElement(Component, _extends({}, props, { @@ -37774,7 +37759,7 @@ function (_ref, ref) { }); FormText.displayName = 'FormText'; -var Switch = /*#__PURE__*/react.forwardRef(function (props, ref) { +var Switch = react.forwardRef(function (props, ref) { return /*#__PURE__*/react.createElement(FormCheck, _extends({}, props, { ref: ref, type: "switch" @@ -37784,19 +37769,18 @@ Switch.displayName = 'Switch'; Switch.Input = FormCheck.Input; Switch.Label = FormCheck.Label; -var _excluded$g = ["bsPrefix", "inline", "className", "validated", "as"]; var FormRow = createWithBsPrefix('form-row'); var defaultProps$a = { inline: false }; -var FormImpl = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var FormImpl = react.forwardRef(function (_ref, ref) { var bsPrefix = _ref.bsPrefix, inline = _ref.inline, className = _ref.className, validated = _ref.validated, _ref$as = _ref.as, Component = _ref$as === void 0 ? 'form' : _ref$as, - props = _objectWithoutPropertiesLoose(_ref, _excluded$g); + props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "inline", "className", "validated", "as"]); bsPrefix = useBootstrapPrefix(bsPrefix, 'form'); return /*#__PURE__*/react.createElement(Component, _extends({}, props, { @@ -66209,25 +66193,6 @@ Token.stringify = function stringify(o, language) { return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + attributes + '>' + env.content + ''; }; -/** - * @param {RegExp} pattern - * @param {number} pos - * @param {string} text - * @param {boolean} lookbehind - * @returns {RegExpExecArray | null} - */ -function matchPattern(pattern, pos, text, lookbehind) { - pattern.lastIndex = pos; - var match = pattern.exec(text); - if (match && lookbehind && match[1]) { - // change the match to remove the text matched by the Prism lookbehind group - var lookbehindLength = match[1].length; - match.index += lookbehindLength; - match[0] = match[0].slice(lookbehindLength); - } - return match; -} - /** * @param {string} text * @param {LinkedList} tokenList @@ -66260,6 +66225,7 @@ function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) { inside = patternObj.inside, lookbehind = !!patternObj.lookbehind, greedy = !!patternObj.greedy, + lookbehindLength = 0, alias = patternObj.alias; if (greedy && !patternObj.pattern.global) { @@ -66293,15 +66259,15 @@ function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) { } var removeCount = 1; // this is the to parameter of removeBetween - var match; - if (greedy) { - match = matchPattern(pattern, pos, text, lookbehind); + if (greedy && currentNode != tokenList.tail.prev) { + pattern.lastIndex = pos; + var match = pattern.exec(text); if (!match) { break; } - var from = match.index; + var from = match.index + (lookbehind && match[1] ? match[1].length : 0); var to = match.index + match[0].length; var p = pos; @@ -66335,16 +66301,24 @@ function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) { str = text.slice(pos, p); match.index -= pos; } else { - match = matchPattern(pattern, 0, str, lookbehind); - if (!match) { - continue; - } + pattern.lastIndex = 0; + + var match = pattern.exec(str); } - var from = match.index, - matchStr = match[0], + if (!match) { + continue; + } + + if (lookbehind) { + lookbehindLength = match[1] ? match[1].length : 0; + } + + var from = match.index + lookbehindLength, + matchStr = match[0].slice(lookbehindLength), + to = from + matchStr.length, before = str.slice(0, from), - after = str.slice(from + matchStr.length); + after = str.slice(to); var reach = pos + str.length; if (rematch && reach > rematch.reach) { @@ -69703,9 +69677,11 @@ const aceEditorCompleter = { setCompleters }; +const JavascriptMode = ace_1$1.acequire('ace/mode/javascript').Mode; const LineWidgets = ace_1$1.acequire('ace/line_widgets').LineWidgets; const Range = ace_1$1.acequire('ace/range').Range; const aceEditorLineWidgets = { + JavascriptMode, LineWidgets, Range }; @@ -69716,8 +69692,7 @@ Prism.languages.clike = { 'comment': [ { pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, - lookbehind: true, - greedy: true + lookbehind: true }, { pattern: /(^|[^\\:])\/\/.*/, @@ -69739,7 +69714,7 @@ Prism.languages.clike = { 'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/, 'boolean': /\b(?:true|false)\b/, 'function': /\w+(?=\()/, - 'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i, + 'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i, 'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/, 'punctuation': /[{}[\];(),.:]/ }; @@ -69748,7 +69723,7 @@ Prism.languages.javascript = Prism.languages.extend('clike', { 'class-name': [ Prism.languages.clike['class-name'], { - pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:prototype|constructor))/, + pattern: /(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/, lookbehind: true } ], @@ -69762,9 +69737,9 @@ Prism.languages.javascript = Prism.languages.extend('clike', { lookbehind: true }, ], - // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444) - 'function': /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/, 'number': /\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/, + // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444) + 'function': /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/, 'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/ }); @@ -69788,26 +69763,26 @@ Prism.languages.insertBefore('javascript', 'keyword', { }, // This must be declared before keyword because we use "function" inside the look-forward 'function-variable': { - pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/, + pattern: /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/, alias: 'function' }, 'parameter': [ { - pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/, + pattern: /(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/, lookbehind: true, inside: Prism.languages.javascript }, { - pattern: /(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i, + pattern: /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i, inside: Prism.languages.javascript }, { - pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/, + pattern: /(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/, lookbehind: true, inside: Prism.languages.javascript }, { - pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/, + pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/, lookbehind: true, inside: Prism.languages.javascript } @@ -69903,7 +69878,7 @@ class JsEditorUi extends react.PureComponent { return { ask: propTypes$6.func, data: propTypes$6.string, - domElementByHash: propTypes$6.object, + advice: propTypes$6.object, file: propTypes$6.string, id: propTypes$6.string, onRun: propTypes$6.func, @@ -69964,8 +69939,26 @@ class JsEditorUi extends react.PureComponent { session } = editor; const { - domElementByHash + advice } = this.props; + + if (!advice.domElementByHash) { + advice.domElementByHash = new Map(); + } + + if (!advice.domUsedElements) { + advice.domUsedElements = new Set(); + } + + if (!advice.widgets) { + advice.widgets = new Map(); + } + + const { + domElementByHash, + domUsedElements, + widgets + } = advice; editor.on('linkClick', ({ token }) => { @@ -69975,11 +69968,15 @@ class JsEditorUi extends react.PureComponent { const [url = ''] = extractUrls(value); this.props.onClickLink(url); }); - editor.session.notebookElements = {}; + editor.session.notebookElements = {}; // const { JavascriptMode, LineWidgets, Range } = aceEditorLineWidgets; + const { - LineWidgets, - Range + JavascriptMode, + LineWidgets } = aceEditorLineWidgets; + const mode = new JavascriptMode(); + delete mode.foldingRules; + session.setMode(mode); if (!session.widgetManager) { session.widgetManager = new LineWidgets(session); @@ -69992,26 +69989,51 @@ class JsEditorUi extends react.PureComponent { const onClickView = (event, note) => { openView = note.nthView; - }; // const domElementByHash = new Map(); - - - const hashNotes = notes => notes.map(note => note.hash || '').join('/'); + }; - const widgets = []; - let usedHashes = new Set(); let lastUpdate; - let marker; - let sourceLocation; const doUpdate = async () => { - lastUpdate = new Date(); + if (advice) { + if (advice.definitions) { + for (const definition of advice.definitions.keys()) { + const { + initSourceLocation + } = advice.definitions.get(definition); + console.log(JSON.stringify({ + definition, + initSourceLocation + })); + /* + if (initSourceLocation) { + const { start, end } = initSourceLocation; + session.addFold( + definition, + new Range( + start.line - 1, + start.column, + end.line - 1, + end.column + ) + ); + } + */ + } - for (const widget of widgets) { - widgetManager.removeLineWidget(widget); + for (const definition of advice.widgets.keys()) { + // if (!advice.definitions.has(definition)) { + // Remove widgets for definitions that don't exist. + // FIX: Or which now have a different position. + const widget = advice.widgets.get(definition); + widgetManager.removeLineWidget(widget); + advice.widgets.delete(definition); // } + } + } } - let context = {}; - const notesByLine = []; + lastUpdate = new Date(); // let context = {}; + + const notesByDefinition = new Map(); const definitions = []; let nthView = 0; @@ -70020,67 +70042,65 @@ class JsEditorUi extends react.PureComponent { continue; } - if (note.setContext) { - context = Object.assign(context, note.setContext); - } - - note = Object.assign({}, note, { - context - }); + console.log(JSON.stringify({ ...note, + data: undefined + })); if (note.define) { definitions.push(note); } + if (note.info) { + // Filter out info. + continue; + } + if (note.view) { note.nthView = nthView; note.openView = nthView === openView; nthView++; } - if (note.context && note.context.sourceLocation && !note.info) { - const line = note.context.sourceLocation.line || 0; + if (note.context && note.context.recording) { + const definition = note.context.recording.id; - if (!notesByLine[line]) { - notesByLine[line] = [...definitions]; + if (!notesByDefinition.has(definition)) { + notesByDefinition.set(definition, [...definitions]); } - notesByLine[line].push(note); + notesByDefinition.get(definition).push(note); if (note.hash) { if (!domElementByHash.has(note.hash)) { console.log(`QQ/dom/cache/miss: ${note.hash}`); - const el = await toDomElement([note, ...definitions], { + const element = await toDomElement([note, ...definitions], { onClickView }); - domElementByHash.set(note.hash, el); + domElementByHash.set(note.hash, element); } + + note.domElement = domElementByHash.get(note.hash); } } + } // Construct the LineWidgets - if (note.context && note.context.sourceLocation) { - sourceLocation = note.context.sourceLocation; - } - } - for (const line of Object.keys(notesByLine)) { - const notes = notesByLine[line]; - const hash = hashNotes(notes); - usedHashes.add(hash); + for (const definition of notesByDefinition.keys()) { + const { + initSourceLocation + } = advice.definitions.get(definition); + const notes = notesByDefinition.get(definition); const el = document.createElement('div'); for (const note of notes) { - if (note.hash) { - const dom = domElementByHash.get(note.hash); - - if (dom) { - el.appendChild(dom); - } + if (note.domElement) { + el.appendChild(note.domElement); + domUsedElements.add(note.domElement); } } const widget = { - row: parseInt(line) - 1, + row: initSourceLocation.end.line - 1, coverLine: false, fixedWidth: true, el @@ -70105,32 +70125,20 @@ class JsEditorUi extends react.PureComponent { el.style.height = `${elHeight}px`; if (el.offsetHeight % lineHeight !== 0) { - console.log(`QQ/Height not aligned: line: ${line} offsetHeight: ${el.offsetHeight} lineHeight: ${lineHeight}`); + console.log(`QQ/Height not aligned: definition: ${definition} offsetHeight: ${el.offsetHeight} lineHeight: ${lineHeight}`); } - widgets.push(widget); + widgets.set(definition, widget); widgetManager.addLineWidget(widget); // Make it visible now that it is in the right place. el.style.visibility = ''; if (widget.pixelHeight !== lineHeight * widget.rowCount) { - console.log(`QQ/widget: line ${line} pixelHeight ${widget.pixelHeight} vs ${lineHeight * widget.rowCount} rowCount ${widget.rowCount} lineHeight ${lineHeight}`); + console.log(`QQ/widget: definition ${definition} pixelHeight ${widget.pixelHeight} vs ${lineHeight * widget.rowCount} rowCount ${widget.rowCount} lineHeight ${lineHeight}`); } } editor.resize(); - - if (marker) { - session.removeMarker(marker); - } - - if (sourceLocation) { - const { - line, - column - } = sourceLocation; - marker = session.addMarker(new Range(0, 0, line - 1, column), 'progress-marker', 'text'); - } }; let updateScheduled = false; @@ -70155,13 +70163,18 @@ class JsEditorUi extends react.PureComponent { const finished = () => { for (const hash of domElementByHash.keys()) { - if (!usedHashes.has(hash)) { + const element = domElementByHash.get(hash); + + if (!domUsedElements.has(element)) { domElementByHash.delete(hash); + + if (element.parentNode) { + element.parentNode.removeChild(element); + } } } - usedHashes.clear(); - sourceLocation = undefined; + domUsedElements.clear(); }; notebookData.onUpdate = update; @@ -95277,47 +95290,12 @@ function createFind(findIndexFunc) { var _createFind = createFind; -/** Used to match a single whitespace character. */ -var reWhitespace = /\s/; - -/** - * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace - * character of `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the index of the last non-whitespace character. - */ -function trimmedEndIndex(string) { - var index = string.length; - - while (index-- && reWhitespace.test(string.charAt(index))) {} - return index; -} - -var _trimmedEndIndex = trimmedEndIndex; - -/** Used to match leading whitespace. */ -var reTrimStart = /^\s+/; - -/** - * The base implementation of `_.trim`. - * - * @private - * @param {string} string The string to trim. - * @returns {string} Returns the trimmed string. - */ -function baseTrim(string) { - return string - ? string.slice(0, _trimmedEndIndex(string) + 1).replace(reTrimStart, '') - : string; -} - -var _baseTrim = baseTrim; - /** Used as references for various `Number` constants. */ var NAN = 0 / 0; +/** Used to match leading and trailing whitespace. */ +var reTrim = /^\s+|\s+$/g; + /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; @@ -95367,7 +95345,7 @@ function toNumber(value) { if (typeof value != 'string') { return value === 0 ? value : +value; } - value = _baseTrim(value); + value = value.replace(reTrim, ''); var isBinary = reIsBinary.test(value); return (isBinary || reIsOctal.test(value)) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) @@ -100694,7 +100672,7 @@ var Channel = { }, hsl2rgb: function (_a, channel) { var h = _a.h, s = _a.s, l = _a.l; - if (!s) + if (s === 100) return l * 2.55; // Achromatic h /= 360; s /= 100; @@ -100737,11 +100715,6 @@ var lang = createCommonjsModule(function (module, exports) { /* LANG */ Object.defineProperty(exports, "__esModule", { value: true }); var Lang = { - clamp: function (number, lower, upper) { - if (lower > upper) - return Math.min(lower, Math.max(upper, number)); - return Math.min(upper, Math.max(lower, number)); - }, round: function (number) { return Math.round(number * 10000000000) / 10000000000; } @@ -100756,6 +100729,10 @@ var unit = createCommonjsModule(function (module, exports) { /* UNIT */ Object.defineProperty(exports, "__esModule", { value: true }); var Unit = { + frac2hex: function (frac) { + var hex = Math.round(frac * 255).toString(16); + return hex.length > 1 ? hex : "0" + hex; + }, dec2hex: function (dec) { var hex = Math.round(dec).toString(16); return hex.length > 1 ? hex : "0" + hex; @@ -100785,13 +100762,29 @@ exports.default = Utils; unwrapExports(utils); +var types = createCommonjsModule(function (module, exports) { +/* ENUMS */ +Object.defineProperty(exports, "__esModule", { value: true }); +var TYPE; +(function (TYPE) { + TYPE[TYPE["ALL"] = 0] = "ALL"; + TYPE[TYPE["RGB"] = 1] = "RGB"; + TYPE[TYPE["HSL"] = 2] = "HSL"; +})(TYPE || (TYPE = {})); +exports.TYPE = TYPE; +}); + +unwrapExports(types); +types.TYPE; + var type = createCommonjsModule(function (module, exports) { /* IMPORT */ Object.defineProperty(exports, "__esModule", { value: true }); + /* TYPE */ var Type = /** @class */ (function () { function Type() { - this.type = 0 /* ALL */; + this.type = types.TYPE.ALL; } Type.prototype.get = function () { return this.type; @@ -100802,7 +100795,7 @@ var Type = /** @class */ (function () { this.type = type; }; Type.prototype.reset = function () { - this.type = 0 /* ALL */; + this.type = types.TYPE.ALL; }; Type.prototype.is = function (type) { return this.type === type; @@ -100820,6 +100813,7 @@ var channels = createCommonjsModule(function (module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); + /* CHANNELS */ var Channels = /** @class */ (function () { /* CONSTRUCTOR */ @@ -100834,43 +100828,37 @@ var Channels = /** @class */ (function () { this.color = color; this.changed = false; this.data = data; //TSC - this.type.type = 0 /* ALL */; + this.type.type = types.TYPE.ALL; return this; }; /* HELPERS */ Channels.prototype._ensureHSL = function () { - var data = this.data; - var h = data.h, s = data.s, l = data.l; - if (h === undefined) - data.h = utils.default.channel.rgb2hsl(data, 'h'); - if (s === undefined) - data.s = utils.default.channel.rgb2hsl(data, 's'); - if (l === undefined) - data.l = utils.default.channel.rgb2hsl(data, 'l'); + if (this.data.h === undefined) + this.data.h = utils.default.channel.rgb2hsl(this.data, 'h'); + if (this.data.s === undefined) + this.data.s = utils.default.channel.rgb2hsl(this.data, 's'); + if (this.data.l === undefined) + this.data.l = utils.default.channel.rgb2hsl(this.data, 'l'); }; Channels.prototype._ensureRGB = function () { - var data = this.data; - var r = data.r, g = data.g, b = data.b; - if (r === undefined) - data.r = utils.default.channel.hsl2rgb(data, 'r'); - if (g === undefined) - data.g = utils.default.channel.hsl2rgb(data, 'g'); - if (b === undefined) - data.b = utils.default.channel.hsl2rgb(data, 'b'); + if (this.data.r === undefined) + this.data.r = utils.default.channel.hsl2rgb(this.data, 'r'); + if (this.data.g === undefined) + this.data.g = utils.default.channel.hsl2rgb(this.data, 'g'); + if (this.data.b === undefined) + this.data.b = utils.default.channel.hsl2rgb(this.data, 'b'); }; Object.defineProperty(Channels.prototype, "r", { /* GETTERS */ get: function () { - var data = this.data; - var r = data.r; - if (!this.type.is(2 /* HSL */) && r !== undefined) - return r; + if (!this.type.is(types.TYPE.HSL) && this.data.r !== undefined) + return this.data.r; this._ensureHSL(); - return utils.default.channel.hsl2rgb(data, 'r'); + return utils.default.channel.hsl2rgb(this.data, 'r'); }, /* SETTERS */ set: function (r) { - this.type.set(1 /* RGB */); + this.type.set(types.TYPE.RGB); this.changed = true; this.data.r = r; }, @@ -100879,15 +100867,13 @@ var Channels = /** @class */ (function () { }); Object.defineProperty(Channels.prototype, "g", { get: function () { - var data = this.data; - var g = data.g; - if (!this.type.is(2 /* HSL */) && g !== undefined) - return g; + if (!this.type.is(types.TYPE.HSL) && this.data.g !== undefined) + return this.data.g; this._ensureHSL(); - return utils.default.channel.hsl2rgb(data, 'g'); + return utils.default.channel.hsl2rgb(this.data, 'g'); }, set: function (g) { - this.type.set(1 /* RGB */); + this.type.set(types.TYPE.RGB); this.changed = true; this.data.g = g; }, @@ -100896,15 +100882,13 @@ var Channels = /** @class */ (function () { }); Object.defineProperty(Channels.prototype, "b", { get: function () { - var data = this.data; - var b = data.b; - if (!this.type.is(2 /* HSL */) && b !== undefined) - return b; + if (!this.type.is(types.TYPE.HSL) && this.data.b !== undefined) + return this.data.b; this._ensureHSL(); - return utils.default.channel.hsl2rgb(data, 'b'); + return utils.default.channel.hsl2rgb(this.data, 'b'); }, set: function (b) { - this.type.set(1 /* RGB */); + this.type.set(types.TYPE.RGB); this.changed = true; this.data.b = b; }, @@ -100913,15 +100897,13 @@ var Channels = /** @class */ (function () { }); Object.defineProperty(Channels.prototype, "h", { get: function () { - var data = this.data; - var h = data.h; - if (!this.type.is(1 /* RGB */) && h !== undefined) - return h; + if (!this.type.is(types.TYPE.RGB) && this.data.h !== undefined) + return this.data.h; this._ensureRGB(); - return utils.default.channel.rgb2hsl(data, 'h'); + return utils.default.channel.rgb2hsl(this.data, 'h'); }, set: function (h) { - this.type.set(2 /* HSL */); + this.type.set(types.TYPE.HSL); this.changed = true; this.data.h = h; }, @@ -100930,15 +100912,13 @@ var Channels = /** @class */ (function () { }); Object.defineProperty(Channels.prototype, "s", { get: function () { - var data = this.data; - var s = data.s; - if (!this.type.is(1 /* RGB */) && s !== undefined) - return s; + if (!this.type.is(types.TYPE.RGB) && this.data.s !== undefined) + return this.data.s; this._ensureRGB(); - return utils.default.channel.rgb2hsl(data, 's'); + return utils.default.channel.rgb2hsl(this.data, 's'); }, set: function (s) { - this.type.set(2 /* HSL */); + this.type.set(types.TYPE.HSL); this.changed = true; this.data.s = s; }, @@ -100947,15 +100927,13 @@ var Channels = /** @class */ (function () { }); Object.defineProperty(Channels.prototype, "l", { get: function () { - var data = this.data; - var l = data.l; - if (!this.type.is(1 /* RGB */) && l !== undefined) - return l; + if (!this.type.is(types.TYPE.RGB) && this.data.l !== undefined) + return this.data.l; this._ensureRGB(); - return utils.default.channel.rgb2hsl(data, 'l'); + return utils.default.channel.rgb2hsl(this.data, 'l'); }, set: function (l) { - this.type.set(2 /* HSL */); + this.type.set(types.TYPE.HSL); this.changed = true; this.data.l = l; }, @@ -101012,6 +100990,7 @@ var hex = createCommonjsModule(function (module, exports) { Object.defineProperty(exports, "__esModule", { value: true }); + /* HEX */ var Hex = { /* VARIABLES */ @@ -101032,12 +101011,11 @@ var Hex = { }, color); }, stringify: function (channels) { - var r = channels.r, g = channels.g, b = channels.b, a = channels.a; - if (a < 1) { // #RRGGBBAA - return "#" + consts.DEC2HEX[Math.round(r)] + consts.DEC2HEX[Math.round(g)] + consts.DEC2HEX[Math.round(b)] + consts.DEC2HEX[Math.round(a * 255)]; + if (channels.a < 1) { // #RRGGBBAA + return "#" + consts.DEC2HEX[Math.round(channels.r)] + consts.DEC2HEX[Math.round(channels.g)] + consts.DEC2HEX[Math.round(channels.b)] + utils.default.unit.frac2hex(channels.a); } else { // #RRGGBB - return "#" + consts.DEC2HEX[Math.round(r)] + consts.DEC2HEX[Math.round(g)] + consts.DEC2HEX[Math.round(b)]; + return "#" + consts.DEC2HEX[Math.round(channels.r)] + consts.DEC2HEX[Math.round(channels.g)] + consts.DEC2HEX[Math.round(channels.b)]; } } }; @@ -101251,12 +101229,11 @@ var RGB = { }, color); }, stringify: function (channels) { - var r = channels.r, g = channels.g, b = channels.b, a = channels.a; - if (a < 1) { // RGBA - return "rgba(" + utils.default.lang.round(r) + ", " + utils.default.lang.round(g) + ", " + utils.default.lang.round(b) + ", " + utils.default.lang.round(a) + ")"; + if (channels.a < 1) { // RGBA + return "rgba(" + utils.default.lang.round(channels.r) + ", " + utils.default.lang.round(channels.g) + ", " + utils.default.lang.round(channels.b) + ", " + utils.default.lang.round(channels.a) + ")"; } else { // RGB - return "rgb(" + utils.default.lang.round(r) + ", " + utils.default.lang.round(g) + ", " + utils.default.lang.round(b) + ")"; + return "rgb(" + utils.default.lang.round(channels.r) + ", " + utils.default.lang.round(channels.g) + ", " + utils.default.lang.round(channels.b) + ")"; } } }; @@ -101306,12 +101283,11 @@ var HSL = { }, color); }, stringify: function (channels) { - var h = channels.h, s = channels.s, l = channels.l, a = channels.a; - if (a < 1) { // HSLA - return "hsla(" + utils.default.lang.round(h) + ", " + utils.default.lang.round(s) + "%, " + utils.default.lang.round(l) + "%, " + a + ")"; + if (channels.a < 1) { // HSLA + return "hsla(" + utils.default.lang.round(channels.h) + ", " + utils.default.lang.round(channels.s) + "%, " + utils.default.lang.round(channels.l) + "%, " + channels.a + ")"; } else { // HSL - return "hsl(" + utils.default.lang.round(h) + ", " + utils.default.lang.round(s) + "%, " + utils.default.lang.round(l) + "%)"; + return "hsl(" + utils.default.lang.round(channels.h) + ", " + utils.default.lang.round(channels.s) + "%, " + utils.default.lang.round(channels.l) + "%)"; } } }; @@ -101328,6 +101304,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); + /* COLOR */ var Color = { /* VARIABLES */ @@ -101352,7 +101329,7 @@ var Color = { // SASS returns a keyword if possible, but we avoid doing that as it's slower and doesn't really add any value if (!channels.changed && channels.color) return channels.color; - if (channels.type.is(2 /* HSL */) || channels.data.r === undefined) { + if (channels.type.is(types.TYPE.HSL) || channels.data.r === undefined) { return hsl.default.stringify(channels); } else if (channels.a < 1 || !Number.isInteger(channels.r) || !Number.isInteger(channels.g) || !Number.isInteger(channels.b)) { @@ -101437,62 +101414,6 @@ exports.default = hsla; unwrapExports(hsla_1); -var to_keyword = createCommonjsModule(function (module, exports) { -/* IMPORT */ -Object.defineProperty(exports, "__esModule", { value: true }); - -/* TO KEYWORD */ -function toKeyword(color$1) { - return color.default.format.keyword.stringify(color.default.parse(color$1)); -} -/* EXPORT */ -exports.default = toKeyword; -}); - -unwrapExports(to_keyword); - -var to_hex = createCommonjsModule(function (module, exports) { -/* IMPORT */ -Object.defineProperty(exports, "__esModule", { value: true }); - -/* TO HEX */ -function toHex(color$1) { - return color.default.format.hex.stringify(color.default.parse(color$1)); -} -/* EXPORT */ -exports.default = toHex; -}); - -unwrapExports(to_hex); - -var to_rgba = createCommonjsModule(function (module, exports) { -/* IMPORT */ -Object.defineProperty(exports, "__esModule", { value: true }); - -/* TO RGBA */ -function toRgba(color$1) { - return color.default.format.rgba.stringify(color.default.parse(color$1)); -} -/* EXPORT */ -exports.default = toRgba; -}); - -unwrapExports(to_rgba); - -var to_hsla = createCommonjsModule(function (module, exports) { -/* IMPORT */ -Object.defineProperty(exports, "__esModule", { value: true }); - -/* TO HSLA */ -function toHsla(color$1) { - return color.default.format.hsla.stringify(color.default.parse(color$1)); -} -/* EXPORT */ -exports.default = toHsla; -}); - -unwrapExports(to_hsla); - var channel_1 = createCommonjsModule(function (module, exports) { /* IMPORT */ Object.defineProperty(exports, "__esModule", { value: true }); @@ -101623,22 +101544,6 @@ exports.default = luminance; unwrapExports(luminance_1); -var contrast_1 = createCommonjsModule(function (module, exports) { -/* IMPORT */ -Object.defineProperty(exports, "__esModule", { value: true }); - - -/* CONTRAST */ -function contrast(color1, color2) { - var luminance1 = luminance_1.default(color1), luminance2 = luminance_1.default(color2), max = Math.max(luminance1, luminance2), min = Math.min(luminance1, luminance2), ratio = (max + Number.EPSILON) / (min + Number.EPSILON); - return utils.default.lang.round(utils.default.lang.clamp(ratio, 1, 10)); -} -/* EXPORT */ -exports.default = contrast; -}); - -unwrapExports(contrast_1); - var is_light = createCommonjsModule(function (module, exports) { /* IMPORT */ Object.defineProperty(exports, "__esModule", { value: true }); @@ -101910,14 +101815,6 @@ exports.hsl = hsla_1.default; var hsla_2 = hsla_1; exports.hsla = hsla_2.default; -exports.toKeyword = to_keyword.default; - -exports.toHex = to_hex.default; - -exports.toRgba = to_rgba.default; - -exports.toHsla = to_hsla.default; - exports.channel = channel_1.default; exports.red = red_1.default; @@ -101936,8 +101833,6 @@ exports.alpha = alpha_1.default; var alpha_2 = alpha_1; // Alias exports.opacity = alpha_2.default; -exports.contrast = contrast_1.default; - exports.luminance = luminance_1.default; exports.isDark = is_dark.default; @@ -101983,10 +101878,6 @@ methods.rgb; methods.rgba; methods.hsl; methods.hsla; -methods.toKeyword; -methods.toHex; -methods.toRgba; -methods.toHsla; methods.channel; methods.red; methods.green; @@ -101996,7 +101887,6 @@ methods.saturation; methods.lightness; methods.alpha; methods.opacity; -methods.contrast; methods.luminance; methods.isDark; methods.isLight; @@ -104357,7 +104247,7 @@ module.exports = function(module) { /*! exports provided: name, version, description, main, keywords, scripts, repository, author, license, standard, dependencies, devDependencies, files, yarn-upgrade-all, sideEffects, husky, default */ /***/ (function(module) { -module.exports = JSON.parse("{\"name\":\"mermaid\",\"version\":\"8.10.2\",\"description\":\"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.\",\"main\":\"dist/mermaid.core.js\",\"keywords\":[\"diagram\",\"markdown\",\"flowchart\",\"sequence diagram\",\"gantt\",\"class diagram\",\"git graph\"],\"scripts\":{\"build:development\":\"webpack --progress --colors\",\"build:production\":\"yarn build:development -p --config webpack.config.prod.babel.js\",\"build\":\"yarn build:development && yarn build:production\",\"postbuild\":\"documentation build src/mermaidAPI.js src/config.js src/defaultConfig.js --shallow -f md --markdown-toc false > docs/Setup.md\",\"build:watch\":\"yarn build --watch\",\"minify\":\"minify ./dist/mermaid.js > ./dist/mermaid.min.js\",\"release\":\"yarn build\",\"lint\":\"eslint src\",\"e2e:depr\":\"yarn lint && jest e2e --config e2e/jest.config.js\",\"cypress\":\"percy exec -- cypress run\",\"e2e\":\"start-server-and-test dev http://localhost:9000/ cypress\",\"e2e-upd\":\"yarn lint && jest e2e -u --config e2e/jest.config.js\",\"dev\":\"webpack-dev-server --config webpack.config.e2e.js\",\"test\":\"yarn lint && jest src/.*\",\"test:watch\":\"jest --watch src\",\"prepublishOnly\":\"yarn build && yarn test\",\"prepare\":\"yarn build\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/knsv/mermaid\"},\"author\":\"Knut Sveidqvist\",\"license\":\"MIT\",\"standard\":{\"ignore\":[\"**/parser/*.js\",\"dist/**/*.js\",\"cypress/**/*.js\"],\"globals\":[\"page\"]},\"dependencies\":{\"@braintree/sanitize-url\":\"^3.1.0\",\"d3\":\"^5.7.0\",\"dagre\":\"^0.8.4\",\"dagre-d3\":\"^0.6.4\",\"entity-decode\":\"^2.0.2\",\"graphlib\":\"^2.1.7\",\"he\":\"^1.2.0\",\"khroma\":\"^1.1.0\",\"minify\":\"^4.1.1\",\"moment-mini\":\"^2.22.1\",\"stylis\":\"^3.5.2\"},\"devDependencies\":{\"@babel/core\":\"^7.2.2\",\"@babel/preset-env\":\"^7.8.4\",\"@babel/register\":\"^7.0.0\",\"@percy/cypress\":\"*\",\"babel-core\":\"7.0.0-bridge.0\",\"babel-eslint\":\"^10.1.0\",\"babel-jest\":\"^24.9.0\",\"babel-loader\":\"^8.0.4\",\"coveralls\":\"^3.0.2\",\"css-loader\":\"^2.0.1\",\"css-to-string-loader\":\"^0.1.3\",\"cypress\":\"4.0.1\",\"documentation\":\"^12.0.1\",\"eslint\":\"^6.3.0\",\"eslint-config-prettier\":\"^6.3.0\",\"eslint-plugin-prettier\":\"^3.1.0\",\"husky\":\"^1.2.1\",\"identity-obj-proxy\":\"^3.0.0\",\"jest\":\"^24.9.0\",\"jison\":\"^0.4.18\",\"moment\":\"^2.23.0\",\"node-sass\":\"^5.0.0\",\"prettier\":\"^1.18.2\",\"puppeteer\":\"^1.17.0\",\"sass-loader\":\"^7.1.0\",\"start-server-and-test\":\"^1.10.6\",\"terser-webpack-plugin\":\"^2.2.2\",\"webpack\":\"^4.41.2\",\"webpack-bundle-analyzer\":\"^3.7.0\",\"webpack-cli\":\"^3.1.2\",\"webpack-dev-server\":\"^3.4.1\",\"webpack-node-externals\":\"^1.7.2\",\"yarn-upgrade-all\":\"^0.5.0\"},\"files\":[\"dist\"],\"yarn-upgrade-all\":{\"ignore\":[\"babel-core\"]},\"sideEffects\":[\"**/*.css\",\"**/*.scss\"],\"husky\":{\"hooks\":{\"pre-push\":\"yarn test\"}}}"); +module.exports = JSON.parse("{\"name\":\"mermaid\",\"version\":\"8.8.4\",\"description\":\"Markdownish syntax for generating flowcharts, sequence diagrams, class diagrams, gantt charts and git graphs.\",\"main\":\"dist/mermaid.core.js\",\"keywords\":[\"diagram\",\"markdown\",\"flowchart\",\"sequence diagram\",\"gantt\",\"class diagram\",\"git graph\"],\"scripts\":{\"build:development\":\"webpack --progress --colors\",\"build:production\":\"yarn build:development -p --config webpack.config.prod.babel.js\",\"build\":\"yarn build:development && yarn build:production\",\"postbuild\":\"documentation build src/mermaidAPI.js src/config.js --shallow -f md --markdown-toc false > docs/Setup.md\",\"build:watch\":\"yarn build --watch\",\"minify\":\"minify ./dist/mermaid.js > ./dist/mermaid.min.js\",\"release\":\"yarn build\",\"lint\":\"eslint src\",\"e2e:depr\":\"yarn lint && jest e2e --config e2e/jest.config.js\",\"cypress\":\"percy exec -- cypress run\",\"e2e\":\"start-server-and-test dev http://localhost:9000/ cypress\",\"e2e-upd\":\"yarn lint && jest e2e -u --config e2e/jest.config.js\",\"dev\":\"webpack-dev-server --config webpack.config.e2e.js\",\"test\":\"yarn lint && jest src/.*\",\"test:watch\":\"jest --watch src\",\"prepublishOnly\":\"yarn build && yarn test\",\"prepare\":\"yarn build\"},\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/knsv/mermaid\"},\"author\":\"Knut Sveidqvist\",\"license\":\"MIT\",\"standard\":{\"ignore\":[\"**/parser/*.js\",\"dist/**/*.js\",\"cypress/**/*.js\"],\"globals\":[\"page\"]},\"dependencies\":{\"@braintree/sanitize-url\":\"^3.1.0\",\"d3\":\"^5.7.0\",\"dagre\":\"^0.8.4\",\"dagre-d3\":\"^0.6.4\",\"entity-decode\":\"^2.0.2\",\"graphlib\":\"^2.1.7\",\"he\":\"^1.2.0\",\"khroma\":\"^1.1.0\",\"minify\":\"^4.1.1\",\"moment-mini\":\"^2.22.1\",\"stylis\":\"^3.5.2\"},\"devDependencies\":{\"@babel/core\":\"^7.2.2\",\"@babel/preset-env\":\"^7.8.4\",\"@babel/register\":\"^7.0.0\",\"@percy/cypress\":\"*\",\"babel-core\":\"7.0.0-bridge.0\",\"babel-eslint\":\"^10.1.0\",\"babel-jest\":\"^24.9.0\",\"babel-loader\":\"^8.0.4\",\"coveralls\":\"^3.0.2\",\"css-loader\":\"^2.0.1\",\"css-to-string-loader\":\"^0.1.3\",\"cypress\":\"4.0.1\",\"documentation\":\"^12.0.1\",\"eslint\":\"^6.3.0\",\"eslint-config-prettier\":\"^6.3.0\",\"eslint-plugin-prettier\":\"^3.1.0\",\"husky\":\"^1.2.1\",\"identity-obj-proxy\":\"^3.0.0\",\"jest\":\"^24.9.0\",\"jison\":\"^0.4.18\",\"moment\":\"^2.23.0\",\"node-sass\":\"^4.12.0\",\"prettier\":\"^1.18.2\",\"puppeteer\":\"^1.17.0\",\"sass-loader\":\"^7.1.0\",\"start-server-and-test\":\"^1.10.6\",\"terser-webpack-plugin\":\"^2.2.2\",\"webpack\":\"^4.41.2\",\"webpack-bundle-analyzer\":\"^3.7.0\",\"webpack-cli\":\"^3.1.2\",\"webpack-dev-server\":\"^3.4.1\",\"webpack-node-externals\":\"^1.7.2\",\"yarn-upgrade-all\":\"^0.5.0\"},\"files\":[\"dist\"],\"yarn-upgrade-all\":{\"ignore\":[\"babel-core\"]},\"sideEffects\":[\"**/*.css\",\"**/*.scss\"],\"husky\":{\"hooks\":{\"pre-push\":\"yarn test\"}}}"); /***/ }), @@ -104365,13 +104255,13 @@ module.exports = JSON.parse("{\"name\":\"mermaid\",\"version\":\"8.10.2\",\"desc /*!***********************!*\ !*** ./src/config.js ***! \***********************/ -/*! exports provided: defaultConfig, updateCurrentConfig, setSiteConfig, saveConfigFromInitilize, updateSiteConfig, getSiteConfig, setConfig, getConfig, sanitize, addDirective, reset */ +/*! exports provided: defaultConfig, updateCurrentConfig, setSiteConfig, setSiteConfigDelta, updateSiteConfig, getSiteConfig, setConfig, getConfig, sanitize, addDirective, reset */ /***/ (function(module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaultConfig", function() { return defaultConfig; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateCurrentConfig", function() { return updateCurrentConfig; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setSiteConfig", function() { return setSiteConfig; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "saveConfigFromInitilize", function() { return saveConfigFromInitilize; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setSiteConfigDelta", function() { return setSiteConfigDelta; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "updateSiteConfig", function() { return updateSiteConfig; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getSiteConfig", function() { return getSiteConfig; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConfig", function() { return setConfig; }); @@ -104383,8 +104273,6 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./logger */ "./src/logger.js"); /* harmony import */ var _themes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./themes */ "./src/themes/index.js"); /* harmony import */ var _defaultConfig__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./defaultConfig */ "./src/defaultConfig.js"); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - @@ -104392,7 +104280,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi var defaultConfig = Object.freeze(_defaultConfig__WEBPACK_IMPORTED_MODULE_3__["default"]); var siteConfig = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["assignWithDepth"])({}, defaultConfig); -var configFromInitialize; +var siteConfigDelta; var directives = []; var currentConfig = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["assignWithDepth"])({}, defaultConfig); var updateCurrentConfig = function updateCurrentConfig(siteCfg, _directives) { @@ -104412,10 +104300,15 @@ var updateCurrentConfig = function updateCurrentConfig(siteCfg, _directives) { cfg = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["assignWithDepth"])(cfg, sumOfDirectives); if (sumOfDirectives.theme) { - var tmpConfigFromInitialize = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["assignWithDepth"])({}, configFromInitialize); - var themeVariables = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["assignWithDepth"])(tmpConfigFromInitialize.themeVariables || {}, sumOfDirectives.themeVariables); + var themeVariables = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["assignWithDepth"])(siteConfigDelta.themeVariables || {}, sumOfDirectives.themeVariables); cfg.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_2__["default"][cfg.theme].getThemeVariables(themeVariables); - } + } // if (cfg.theme && theme[cfg.theme]) { + // let tVars = assignWithDepth({}, cfg.themeVariables); + // tVars = assignWithDepth(tVars, themeVariables); + // const variables = theme[cfg.theme].getThemeVariables(tVars); + // cfg.themeVariables = variables; + // } + currentConfig = cfg; return cfg; @@ -104446,8 +104339,8 @@ var setSiteConfig = function setSiteConfig(conf) { currentConfig = updateCurrentConfig(siteConfig, directives); return siteConfig; }; -var saveConfigFromInitilize = function saveConfigFromInitilize(conf) { - configFromInitialize = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["assignWithDepth"])({}, conf); +var setSiteConfigDelta = function setSiteConfigDelta(conf) { + siteConfigDelta = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["assignWithDepth"])({}, conf); }; var updateSiteConfig = function updateSiteConfig(conf) { siteConfig = Object(_utils__WEBPACK_IMPORTED_MODULE_0__["assignWithDepth"])(siteConfig, conf); @@ -104513,33 +104406,13 @@ var getConfig = function getConfig() { */ var sanitize = function sanitize(options) { - // Checking that options are not in the list of excluded options Object.keys(siteConfig.secure).forEach(function (key) { if (typeof options[siteConfig.secure[key]] !== 'undefined') { // DO NOT attempt to print options[siteConfig.secure[key]] within `${}` as a malicious script // can exploit the logger's attempt to stringify the value and execute arbitrary code - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].debug("Denied attempt to modify a secure key ".concat(siteConfig.secure[key]), options[siteConfig.secure[key]]); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug("Denied attempt to modify a secure key ".concat(siteConfig.secure[key]), options[siteConfig.secure[key]]); delete options[siteConfig.secure[key]]; } - }); // Check that there no attempts of prototype pollution - - Object.keys(options).forEach(function (key) { - if (key.indexOf('__') === 0) { - delete options[key]; - } - }); // Check that there no attempts of xss, there should be no tags at all in the directive - // blocking data urls as base64 urls can contain svgs with inline script tags - - Object.keys(options).forEach(function (key) { - if (typeof options[key] === 'string') { - if (options[key].indexOf('<') > -1 || options[key].indexOf('>') > -1 || options[key].indexOf('url(data:') > -1) { - delete options[key]; - } - } - - if (_typeof(options[key]) === 'object') { - sanitize(options[key]); - } }); }; var addDirective = function addDirective(directive) { @@ -104599,16 +104472,15 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _createLabel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./createLabel */ "./src/dagre-wrapper/createLabel.js"); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! d3 */ "d3"); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../config */ "./src/config.js"); -/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../diagrams/common/common */ "./src/diagrams/common/common.js"); - + // eslint-disable-line var rect = function rect(parent, node) { - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].trace('Creating subgraph rect for ', node.id, node); // Add outer g element + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].trace('Creating subgraph rect for ', node.id, node); // Add outer g element var shapeSvg = parent.insert('g').attr('class', 'cluster' + (node.class ? ' ' + node.class : '')).attr('id', node.id); // add the rect @@ -104619,7 +104491,7 @@ var rect = function rect(parent, node) { var bbox = text.getBBox(); - if (Object(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_5__["evaluate"])(Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels)) { + if (Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels) { var div = text.children[0]; var dv = Object(d3__WEBPACK_IMPORTED_MODULE_3__["select"])(text); bbox = div.getBoundingClientRect(); @@ -104629,17 +104501,9 @@ var rect = function rect(parent, node) { var padding = 0 * node.padding; var halfPadding = padding / 2; - var width = node.width <= bbox.width + padding ? bbox.width + padding : node.width; + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].trace('Data ', node, JSON.stringify(node)); // center the rect around its coordinate - if (node.width <= bbox.width + padding) { - node.diff = (bbox.width - node.width) / 2; - } else { - node.diff = -node.padding / 2; - } - - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].trace('Data ', node, JSON.stringify(node)); // center the rect around its coordinate - - rect.attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('x', node.x - width / 2).attr('y', node.y - node.height / 2 - halfPadding).attr('width', width).attr('height', node.height + padding); // Center the label + rect.attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('x', node.x - node.width / 2 - halfPadding).attr('y', node.y - node.height / 2 - halfPadding).attr('width', node.width + padding).attr('height', node.height + padding); // Center the label label.attr('transform', 'translate(' + (node.x - bbox.width / 2) + ', ' + (node.y - node.height / 2 + node.padding / 3) + ')'); var rectBox = rect.node().getBBox(); @@ -104689,7 +104553,7 @@ var roundedWithTitle = function roundedWithTitle(parent, node) { var bbox = text.getBBox(); - if (Object(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_5__["evaluate"])(Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels)) { + if (Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels) { var div = text.children[0]; var dv = Object(d3__WEBPACK_IMPORTED_MODULE_3__["select"])(text); bbox = div.getBoundingClientRect(); @@ -104699,21 +104563,14 @@ var roundedWithTitle = function roundedWithTitle(parent, node) { bbox = text.getBBox(); var padding = 0 * node.padding; - var halfPadding = padding / 2; - var width = node.width <= bbox.width + node.padding ? bbox.width + node.padding : node.width; - - if (node.width <= bbox.width + node.padding) { - node.diff = (bbox.width + node.padding - node.width) / 2; - } else { - node.diff = -node.padding / 2; - } // center the rect around its coordinate - + var halfPadding = padding / 2; // center the rect around its coordinate - rect.attr('class', 'outer').attr('x', node.x - width / 2 - halfPadding).attr('y', node.y - node.height / 2 - halfPadding).attr('width', width + padding).attr('height', node.height + padding); - innerRect.attr('class', 'inner').attr('x', node.x - width / 2 - halfPadding).attr('y', node.y - node.height / 2 - halfPadding + bbox.height - 1).attr('width', width + padding).attr('height', node.height + padding - bbox.height - 3); // Center the label + rect.attr('class', 'outer').attr('x', node.x - node.width / 2 - halfPadding).attr('y', node.y - node.height / 2 - halfPadding).attr('width', node.width + padding).attr('height', node.height + padding); + innerRect.attr('class', 'inner').attr('x', node.x - node.width / 2 - halfPadding).attr('y', node.y - node.height / 2 - halfPadding + bbox.height - 1).attr('width', node.width + padding).attr('height', node.height + padding - bbox.height - 3); // Center the label - label.attr('transform', 'translate(' + (node.x - bbox.width / 2) + ', ' + (node.y - node.height / 2 - node.padding / 3 + (Object(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_5__["evaluate"])(Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels) ? 5 : 3)) + ')'); + label.attr('transform', 'translate(' + (node.x - bbox.width / 2) + ', ' + (node.y - node.height / 2 - node.padding / 3 + (Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels ? 5 : 3)) + ')'); var rectBox = rect.node().getBBox(); + node.width = rectBox.width; node.height = rectBox.height; node.intersect = function (point) { @@ -104751,7 +104608,7 @@ var shapes = { }; var clusterElems = {}; var insertCluster = function insertCluster(elem, node) { - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].trace('Inserting cluster'); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].trace('Inserting cluster'); var shape = node.shape || 'rect'; clusterElems[node.id] = shapes[shape](elem, node); }; @@ -104766,7 +104623,7 @@ var clear = function clear() { clusterElems = {}; }; var positionCluster = function positionCluster(node) { - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].info('Position cluster (' + node.id + ', ' + node.x + ', ' + node.y + ')'); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].info('Position cluster'); var el = clusterElems[node.id]; el.attr('transform', 'translate(' + node.x + ', ' + node.y + ')'); }; @@ -104782,15 +104639,11 @@ var positionCluster = function positionCluster(node) { __webpack_require__.r(__webpack_exports__); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../logger */ "./src/logger.js"); -/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../diagrams/common/common */ "./src/diagrams/common/common.js"); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config */ "./src/config.js"); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../config */ "./src/config.js"); // eslint-disable-line - - // let vertexNode; -// if (evaluate(getConfig().flowchart.htmlLabels)) { +// let vertexNode; +// if (getConfig().flowchart.htmlLabels) { // // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that? // const node = { // label: vertexText.replace(/fa[lrsb]?:fa-[\w-]+/g, s => ``) @@ -104848,7 +104701,7 @@ function addHtmlLabel(node) { var div = fo.append('xhtml:div'); var label = node.label; var labelClass = node.isNode ? 'nodeLabel' : 'edgeLabel'; - div.html('' + label + ''); + div.html('' + label + ''); applyStyle(div, node.labelStyle); div.style('display', 'inline-block'); // Fix for firefox @@ -104859,12 +104712,11 @@ function addHtmlLabel(node) { var createLabel = function createLabel(_vertexText, style, isTitle, isNode) { var vertexText = _vertexText || ''; - if (_typeof(vertexText) === 'object') vertexText = vertexText[0]; - if (Object(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_2__["evaluate"])(Object(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"])().flowchart.htmlLabels)) { + if (Object(_config__WEBPACK_IMPORTED_MODULE_2__["getConfig"])().flowchart.htmlLabels) { // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that? vertexText = vertexText.replace(/\\n|\n/g, '
'); - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].info('vertexText' + vertexText); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].info('vertexText' + vertexText); var node = { isNode: isNode, label: vertexText.replace(/fa[lrsb]?:fa-[\w-]+/g, function (s) { @@ -104929,14 +104781,12 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! d3 */ "d3"); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../config */ "./src/config.js"); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils */ "./src/utils.js"); -/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../diagrams/common/common */ "./src/diagrams/common/common.js"); // eslint-disable-line - // import { line, curveBasis, curveLinear, select } from 'd3'; - + // import { calcLabelPosition } from '../utils'; var edgeLabels = {}; var terminalLabels = {}; @@ -104955,7 +104805,7 @@ var insertEdgeLabel = function insertEdgeLabel(elem, edge) { var bbox = labelElement.getBBox(); - if (Object(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_5__["evaluate"])(Object(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"])().flowchart.htmlLabels)) { + if (Object(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"])().flowchart.htmlLabels) { var div = labelElement.children[0]; var dv = Object(d3__WEBPACK_IMPORTED_MODULE_2__["select"])(labelElement); bbox = div.getBoundingClientRect(); @@ -105055,7 +104905,7 @@ var insertEdgeLabel = function insertEdgeLabel(elem, edge) { } }; var positionEdgeLabel = function positionEdgeLabel(edge, paths) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('Moving label abc78 ', edge.id, edge.label, edgeLabels[edge.id]); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('Moving label', edge.id, edge.label, edgeLabels[edge.id]); var path = paths.updatedPath ? paths.updatedPath : paths.originalPath; if (edge.label) { @@ -105066,7 +104916,7 @@ var positionEdgeLabel = function positionEdgeLabel(edge, paths) { if (path) { // // debugger; var pos = _utils__WEBPACK_IMPORTED_MODULE_4__["default"].calcLabelPosition(path); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('Moving label from (', x, ',', y, ') to (', pos.x, ',', pos.y, ') abc78'); // x = pos.x; + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('Moving label from (', x, ',', y, ') to (', pos.x, ',', pos.y, ')'); // x = pos.x; // y = pos.y; } @@ -105076,66 +104926,66 @@ var positionEdgeLabel = function positionEdgeLabel(edge, paths) { if (edge.startLabelLeft) { var _el = terminalLabels[edge.id].startLeft; - var _x2 = edge.x; - var _y2 = edge.y; + var _x = edge.x; + var _y = edge.y; if (path) { // debugger; var _pos = _utils__WEBPACK_IMPORTED_MODULE_4__["default"].calcTerminalLabelPosition(0, 'start_left', path); - _x2 = _pos.x; - _y2 = _pos.y; + _x = _pos.x; + _y = _pos.y; } - _el.attr('transform', 'translate(' + _x2 + ', ' + _y2 + ')'); + _el.attr('transform', 'translate(' + _x + ', ' + _y + ')'); } if (edge.startLabelRight) { var _el2 = terminalLabels[edge.id].startRight; - var _x3 = edge.x; - var _y3 = edge.y; + var _x2 = edge.x; + var _y2 = edge.y; if (path) { // debugger; var _pos2 = _utils__WEBPACK_IMPORTED_MODULE_4__["default"].calcTerminalLabelPosition(0, 'start_right', path); - _x3 = _pos2.x; - _y3 = _pos2.y; + _x2 = _pos2.x; + _y2 = _pos2.y; } - _el2.attr('transform', 'translate(' + _x3 + ', ' + _y3 + ')'); + _el2.attr('transform', 'translate(' + _x2 + ', ' + _y2 + ')'); } if (edge.endLabelLeft) { var _el3 = terminalLabels[edge.id].endLeft; - var _x4 = edge.x; - var _y4 = edge.y; + var _x3 = edge.x; + var _y3 = edge.y; if (path) { // debugger; var _pos3 = _utils__WEBPACK_IMPORTED_MODULE_4__["default"].calcTerminalLabelPosition(0, 'end_left', path); - _x4 = _pos3.x; - _y4 = _pos3.y; + _x3 = _pos3.x; + _y3 = _pos3.y; } - _el3.attr('transform', 'translate(' + _x4 + ', ' + _y4 + ')'); + _el3.attr('transform', 'translate(' + _x3 + ', ' + _y3 + ')'); } if (edge.endLabelRight) { var _el4 = terminalLabels[edge.id].endRight; - var _x5 = edge.x; - var _y5 = edge.y; + var _x4 = edge.x; + var _y4 = edge.y; if (path) { // debugger; var _pos4 = _utils__WEBPACK_IMPORTED_MODULE_4__["default"].calcTerminalLabelPosition(0, 'end_right', path); - _x5 = _pos4.x; - _y5 = _pos4.y; + _x4 = _pos4.x; + _y4 = _pos4.y; } - _el4.attr('transform', 'translate(' + _x5 + ', ' + _y5 + ')'); + _el4.attr('transform', 'translate(' + _x4 + ', ' + _y4 + ')'); } }; // const getRelationType = function(type) { // switch (type) { @@ -105151,7 +105001,7 @@ var positionEdgeLabel = function positionEdgeLabel(edge, paths) { // }; var outsideNode = function outsideNode(node, point) { - // log.warn('Checking bounds ', node, point); + // logger.warn('Checking bounds ', node, point); var x = node.x; var y = node.y; var dx = Math.abs(point.x - x); @@ -105167,28 +105017,24 @@ var outsideNode = function outsideNode(node, point) { }; var intersection = function intersection(node, outsidePoint, insidePoint) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn("intersection calc abc89:\n outsidePoint: ".concat(JSON.stringify(outsidePoint), "\n insidePoint : ").concat(JSON.stringify(insidePoint), "\n node : x:").concat(node.x, " y:").concat(node.y, " w:").concat(node.width, " h:").concat(node.height)); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('intersection calc o:', outsidePoint, ' i:', insidePoint, node); var x = node.x; var y = node.y; - var dx = Math.abs(x - insidePoint.x); // const dy = Math.abs(y - insidePoint.y); - + var dx = Math.abs(x - insidePoint.x); var w = node.width / 2; var r = insidePoint.x < outsidePoint.x ? w - dx : w + dx; - var h = node.height / 2; // const edges = { - // x1: x - w, - // x2: x + w, - // y1: y - h, - // y2: y + h - // }; - // if ( - // outsidePoint.x === edges.x1 || - // outsidePoint.x === edges.x2 || - // outsidePoint.y === edges.y1 || - // outsidePoint.y === edges.y2 - // ) { - // log.warn('abc89 calc equals on edge', outsidePoint, edges); - // return outsidePoint; - // } + var h = node.height / 2; + var edges = { + x1: x - w, + x2: x + w, + y1: y - h, + y2: y + h + }; + + if (outsidePoint.x === edges.x1 || outsidePoint.x === edges.x2 || outsidePoint.y === edges.y1 || outsidePoint.y === edges.y2) { + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('calc equals on edge'); + return outsidePoint; + } var Q = Math.abs(outsidePoint.y - insidePoint.y); var R = Math.abs(outsidePoint.x - insidePoint.x); // log.warn(); @@ -105200,27 +105046,16 @@ var intersection = function intersection(node, outsidePoint, insidePoint) { var q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y; r = R * q / Q; var res = { - x: insidePoint.x < outsidePoint.x ? insidePoint.x + r : insidePoint.x - R + r, - y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q - q : insidePoint.y - Q + q + x: insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x - r, + y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q - q : insidePoint.y - q }; - - if (r === 0) { - res.x = outsidePoint.x; - res.y = outsidePoint.y; - } - - if (R === 0) { - res.x = outsidePoint.x; - } - - if (Q === 0) { - res.y = outsidePoint.y; - } - - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn("abc89 topp/bott calc, Q ".concat(Q, ", q ").concat(q, ", R ").concat(R, ", r ").concat(r), res); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn("topp/bott calc, Q ".concat(Q, ", q ").concat(q, ", R ").concat(R, ", r ").concat(r), res); return res; } else { // Intersection onn sides of rect + // q = (Q * r) / R; + // q = 2; + // r = (R * q) / Q; if (insidePoint.x < outsidePoint.x) { r = outsidePoint.x - w - x; } else { @@ -105228,181 +105063,99 @@ var intersection = function intersection(node, outsidePoint, insidePoint) { r = x - w - outsidePoint.x; } - var _q = Q * r / R; // OK let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x + dx - w; - // OK let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : outsidePoint.x + r; - - - var _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x - R + r; // let _x = insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : outsidePoint.x + r; - + var _q = _q = Q * r / R; - var _y = insidePoint.y < outsidePoint.y ? insidePoint.y + _q : insidePoint.y - _q; - - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn("sides calc abc89, Q ".concat(Q, ", q ").concat(_q, ", R ").concat(R, ", r ").concat(r), { - _x: _x, - _y: _y + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn("sides calc, Q ".concat(Q, ", q ").concat(_q, ", R ").concat(R, ", r ").concat(r), { + x: insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x + dx - w, + y: insidePoint.y < outsidePoint.y ? insidePoint.y + _q : insidePoint.y - _q }); - - if (r === 0) { - _x = outsidePoint.x; - _y = outsidePoint.y; - } - - if (R === 0) { - _x = outsidePoint.x; - } - - if (Q === 0) { - _y = outsidePoint.y; - } - return { - x: _x, - y: _y + x: insidePoint.x < outsidePoint.x ? insidePoint.x + R - r : insidePoint.x + dx - w, + y: insidePoint.y < outsidePoint.y ? insidePoint.y + _q : insidePoint.y - _q }; } -}; -/** - * This function will page a path and node where the last point(s) in the path is inside the node - * and return an update path ending by the border of the node. - * @param {*} points - * @param {*} boundryNode - * @returns - */ - -var cutPathAtIntersect = function cutPathAtIntersect(_points, boundryNode) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('abc88 cutPathAtIntersect', _points, boundryNode); - var points = []; - var lastPointOutside = _points[0]; - var isInside = false; - - _points.forEach(function (point) { - // const node = clusterDb[edge.toCluster].node; - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('abc88 checking point', point, boundryNode); // check if point is inside the boundry rect - - if (!outsideNode(boundryNode, point) && !isInside) { - // First point inside the rect found - // Calc the intersection coord between the point anf the last opint ouside the rect - var inter = intersection(boundryNode, lastPointOutside, point); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('abc88 inside', point, lastPointOutside, inter); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('abc88 intersection', inter); // // Check case where the intersection is the same as the last point - - var pointPresent = false; - points.forEach(function (p) { - pointPresent = pointPresent || p.x === inter.x && p.y === inter.y; - }); // // if (!pointPresent) { - - if (!points.find(function (e) { - return e.x === inter.x && e.y === inter.y; - })) { - points.push(inter); - } else { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('abc88 no intersect', inter, points); - } // points.push(inter); - - - isInside = true; - } else { - // Outside - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('abc88 outside', point, lastPointOutside); - lastPointOutside = point; // points.push(point); - - if (!isInside) points.push(point); - } - }); - - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('abc88 returning points', points); - return points; }; //(edgePaths, e, edge, clusterDb, diagramtype, graph) - var insertEdge = function insertEdge(elem, e, edge, clusterDb, diagramType, graph) { var points = edge.points; var pointsHasChanged = false; var tail = graph.node(e.v); var head = graph.node(e.w); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('abc88 InsertEdge: ', edge); if (head.intersect && tail.intersect) { points = points.slice(1, edge.points.length - 1); points.unshift(tail.intersect(points[0])); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('Last point', points[points.length - 1], head, head.intersect(points[points.length - 1])); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('Last point', points[points.length - 1], head, head.intersect(points[points.length - 1])); points.push(head.intersect(points[points.length - 1])); } if (edge.toCluster) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('to cluster abc88', clusterDb[edge.toCluster]); - points = cutPathAtIntersect(edge.points, clusterDb[edge.toCluster].node); // log.trace('edge', edge); - // points = []; - // let lastPointOutside; // = edge.points[0]; - // let isInside = false; - // edge.points.forEach(point => { - // const node = clusterDb[edge.toCluster].node; - // log.warn('checking from', edge.fromCluster, point, node); - // if (!outsideNode(node, point) && !isInside) { - // log.trace('inside', edge.toCluster, point, lastPointOutside); - // // First point inside the rect - // const inter = intersection(node, lastPointOutside, point); - // let pointPresent = false; - // points.forEach(p => { - // pointPresent = pointPresent || (p.x === inter.x && p.y === inter.y); - // }); - // // if (!pointPresent) { - // if (!points.find(e => e.x === inter.x && e.y === inter.y)) { - // points.push(inter); - // } else { - // log.warn('no intersect', inter, points); - // } - // isInside = true; - // } else { - // // outtside - // lastPointOutside = point; - // if (!isInside) points.push(point); - // } - // }); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].trace('edge', edge); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].trace('to cluster', clusterDb[edge.toCluster]); + points = []; + var lastPointOutside; + var isInside = false; + edge.points.forEach(function (point) { + var node = clusterDb[edge.toCluster].node; + + if (!outsideNode(node, point) && !isInside) { + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].trace('inside', edge.toCluster, point, lastPointOutside); // First point inside the rect + + var inter = intersection(node, lastPointOutside, point); + var pointPresent = false; + points.forEach(function (p) { + pointPresent = pointPresent || p.x === inter.x && p.y === inter.y; + }); // if (!pointPresent) { + + if (!points.find(function (e) { + return e.x === inter.x && e.y === inter.y; + })) { + points.push(inter); + } else { + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('no intersect', inter, points); + } + + isInside = true; + } else { + if (!isInside) points.push(point); + } + lastPointOutside = point; + }); pointsHasChanged = true; } if (edge.fromCluster) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('from cluster abc88', clusterDb[edge.fromCluster]); - points = cutPathAtIntersect(points.reverse(), clusterDb[edge.fromCluster].node).reverse(); // log.warn('edge', edge); - // log.warn('from cluster', clusterDb[edge.fromCluster], points); - // const updatedPoints = []; - // let lastPointOutside = edge.points[edge.points.length - 1]; - // let isInside = false; - // for (let i = points.length - 1; i >= 0; i--) { - // const point = points[i]; - // const node = clusterDb[edge.fromCluster].node; - // log.warn('checking to', edge.fromCluster, point, node); - // if (!outsideNode(node, point) && !isInside) { - // log.warn('inside', edge.fromCluster, point, node); - // // First point inside the rect - // const inter = intersection(node, lastPointOutside, point); - // log.warn('intersect', intersection(node, lastPointOutside, point)); - // let pointPresent = false; - // points.forEach(p => { - // pointPresent = pointPresent || (p.x === inter.x && p.y === inter.y); - // }); - // // if (!pointPresent) { - // if (!points.find(e => e.x === inter.x && e.y === inter.y)) { - // updatedPoints.unshift(inter); - // log.warn('Adding point -updated = ', updatedPoints); - // } else { - // log.warn('no intersect', inter, points); - // } - // // points.push(insterection); - // isInside = true; - // } else { - // // at the outside - // // if (!isInside) updatedPoints.unshift(point); - // updatedPoints.unshift(point); - // log.warn('Outside point', point, updatedPoints); - // } - // lastPointOutside = point; - // } - // points = updatedPoints; - // points = edge.points; + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].trace('edge', edge); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('from cluster', clusterDb[edge.fromCluster]); + var updatedPoints = []; + + var _lastPointOutside; + + var _isInside = false; + + for (var i = points.length - 1; i >= 0; i--) { + var point = points[i]; + var node = clusterDb[edge.fromCluster].node; + + if (!outsideNode(node, point) && !_isInside) { + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('inside', edge.fromCluster, point, node); // First point inside the rect + + var insterection = intersection(node, _lastPointOutside, point); // logger.trace('intersect', intersection(node, lastPointOutside, point)); + + updatedPoints.unshift(insterection); // points.push(insterection); + + _isInside = true; + } else { + // at the outside + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].trace('Outside point', point); + if (!_isInside) updatedPoints.unshift(point); + } + + _lastPointOutside = point; + } + points = updatedPoints; pointsHasChanged = true; } // The data for our line @@ -105411,22 +105164,11 @@ var insertEdge = function insertEdge(elem, e, edge, clusterDb, diagramType, grap return !Number.isNaN(p.y); }); // This is the accessor function we talked about above - var curve; // Currently only flowcharts get the curve from the settings, perhaps this should - // be expanded to a common setting? Restricting it for now in order not to cause side-effects that - // have not been thought through - - if (diagramType === 'graph' || diagramType === 'flowchart') { - curve = edge.curve || d3__WEBPACK_IMPORTED_MODULE_2__["curveBasis"]; - } else { - curve = d3__WEBPACK_IMPORTED_MODULE_2__["curveBasis"]; - } // curve = curveLinear; - - var lineFunction = Object(d3__WEBPACK_IMPORTED_MODULE_2__["line"])().x(function (d) { return d.x; }).y(function (d) { return d.y; - }).curve(curve); // Contruct stroke classes based on properties + }).curve(d3__WEBPACK_IMPORTED_MODULE_2__["curveBasis"]); // Contruct stroke classes based on properties var strokeClasses; @@ -105476,8 +105218,8 @@ var insertEdge = function insertEdge(elem, e, edge, clusterDb, diagramType, grap url = url.replace(/\)/g, '\\)'); } - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('arrowTypeStart', edge.arrowTypeStart); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('arrowTypeEnd', edge.arrowTypeEnd); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('arrowTypeStart', edge.arrowTypeStart); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('arrowTypeEnd', edge.arrowTypeEnd); switch (edge.arrowTypeStart) { case 'arrow_cross': @@ -105589,21 +105331,21 @@ __webpack_require__.r(__webpack_exports__); var recursiveRender = function recursiveRender(_elem, graph, diagramtype, parentCluster) { - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info('Graph in recursive render: XXX', graphlib__WEBPACK_IMPORTED_MODULE_1___default.a.json.write(graph), parentCluster); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info('Graph in recursive render: XXX', graphlib__WEBPACK_IMPORTED_MODULE_1___default.a.json.write(graph), parentCluster); var dir = graph.graph().rankdir; - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].trace('Dir in recursive render - dir:', dir); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].warn('Dir in recursive render - dir:', dir); var elem = _elem.insert('g').attr('class', 'root'); // eslint-disable-line if (!graph.nodes()) { - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info('No nodes found for', graph); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info('No nodes found for', graph); } else { - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info('Recursive render XXX', graph.nodes()); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info('Recursive render XXX', graph.nodes()); } if (graph.edges().length > 0) { - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].trace('Recursive edges', graph.edge(graph.edges()[0])); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info('Recursive edges', graph.edge(graph.edges()[0])); } var clusters = elem.insert('g').attr('class', 'clusters'); // eslint-disable-line @@ -105619,39 +105361,36 @@ var recursiveRender = function recursiveRender(_elem, graph, diagramtype, parent if (typeof parentCluster !== 'undefined') { var data = JSON.parse(JSON.stringify(parentCluster.clusterData)); // data.clusterPositioning = true; - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info('Setting data for cluster XXX (', v, ') ', data, parentCluster); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info('Setting data for cluster XXX (', v, ') ', data, parentCluster); graph.setNode(parentCluster.id, data); if (!graph.parent(v)) { - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].trace('Setting parent', v, parentCluster.id); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].warn('Setting parent', v, parentCluster.id); graph.setParent(v, parentCluster.id, data); } } - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info('(Insert) Node XXX' + v + ': ' + JSON.stringify(graph.node(v))); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info('(Insert) Node XXX' + v + ': ' + JSON.stringify(graph.node(v))); if (node && node.clusterNode) { // const children = graph.children(v); - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info('Cluster identified', v, node.width, graph.node(v)); - var o = recursiveRender(nodes, node.graph, diagramtype, graph.node(v)); - var newEl = o.elem; + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info('Cluster identified', v, node, graph.node(v)); + var newEl = recursiveRender(nodes, node.graph, diagramtype, graph.node(v)); Object(_shapes_util__WEBPACK_IMPORTED_MODULE_3__["updateNodeBounds"])(node, newEl); - node.diff = o.diff || 0; - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info('Node bounds (abc123)', v, node, node.width, node.x, node.y); Object(_nodes__WEBPACK_IMPORTED_MODULE_5__["setNodeElem"])(newEl, node); - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].warn('Recursive render complete ', newEl, node); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].warn('Recursive render complete', newEl, node); } else { if (graph.children(v).length > 0) { // This is a cluster but not to be rendered recusively // Render as before - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info('Cluster - the non recursive path XXX', v, node.id, node, graph); - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info(Object(_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_4__["findNonClusterChild"])(node.id, graph)); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info('Cluster - the non recursive path XXX', v, node.id, node, graph); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info(Object(_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_4__["findNonClusterChild"])(node.id, graph)); _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_4__["clusterDb"][node.id] = { id: Object(_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_4__["findNonClusterChild"])(node.id, graph), node: node }; // insertCluster(clusters, graph.node(v)); } else { - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info('Node - the non recursive path', v, node.id, node); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info('Node - the non recursive path', v, node.id, node); Object(_nodes__WEBPACK_IMPORTED_MODULE_5__["insertNode"])(nodes, graph.node(v), dir); } } @@ -105662,27 +105401,26 @@ var recursiveRender = function recursiveRender(_elem, graph, diagramtype, parent graph.edges().forEach(function (e) { var edge = graph.edge(e.v, e.w, e.name); - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e)); - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info('Edge ' + e.v + ' -> ' + e.w + ': ', e, ' ', JSON.stringify(graph.edge(e))); // Check if link is either from or to a cluster + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e)); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info('Edge ' + e.v + ' -> ' + e.w + ': ', e, ' ', JSON.stringify(graph.edge(e))); // Check if link is either from or to a cluster - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info('Fix', _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_4__["clusterDb"], 'ids:', e.v, e.w, 'Translateing: ', _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_4__["clusterDb"][e.v], _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_4__["clusterDb"][e.w]); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info('Fix', _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_4__["clusterDb"], 'ids:', e.v, e.w, 'Translateing: ', _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_4__["clusterDb"][e.v], _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_4__["clusterDb"][e.w]); Object(_edges__WEBPACK_IMPORTED_MODULE_7__["insertEdgeLabel"])(edgeLabels, edge); }); graph.edges().forEach(function (e) { - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e)); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e)); }); - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info('#############################################'); - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info('### Layout ###'); - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info('#############################################'); - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info(graph); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info('#############################################'); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info('### Layout ###'); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info('#############################################'); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info(graph); dagre__WEBPACK_IMPORTED_MODULE_0___default.a.layout(graph); - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info('Graph after layout:', graphlib__WEBPACK_IMPORTED_MODULE_1___default.a.json.write(graph)); // Move the nodes to the correct place + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info('Graph after layout:', graphlib__WEBPACK_IMPORTED_MODULE_1___default.a.json.write(graph)); // Move the nodes to the correct place - var diff = 0; Object(_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_4__["sortNodesByHierarchy"])(graph).forEach(function (v) { var node = graph.node(v); - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info('Position ' + v + ': ' + JSON.stringify(graph.node(v))); - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info('Position ' + v + ': (' + node.x, ',' + node.y, ') width: ', node.width, ' height: ', node.height); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info('Position ' + v + ': ' + JSON.stringify(graph.node(v))); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info('Position ' + v + ': (' + node.x, ',' + node.y, ') width: ', node.width, ' height: ', node.height); if (node && node.clusterNode) { // clusterDb[node.id].node = node; @@ -105702,22 +105440,11 @@ var recursiveRender = function recursiveRender(_elem, graph, diagramtype, parent graph.edges().forEach(function (e) { var edge = graph.edge(e); - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(edge), edge); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].info('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(edge), edge); var paths = Object(_edges__WEBPACK_IMPORTED_MODULE_7__["insertEdge"])(edgePaths, e, edge, _mermaid_graphlib__WEBPACK_IMPORTED_MODULE_4__["clusterDb"], diagramtype, graph); Object(_edges__WEBPACK_IMPORTED_MODULE_7__["positionEdgeLabel"])(edge, paths); }); - graph.nodes().forEach(function (v) { - var n = graph.node(v); - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].info(v, n.type, n.diff); - - if (n.type === 'group') { - diff = n.diff; - } - }); - return { - elem: elem, - diff: diff - }; + return elem; }; var render = function render(elem, graph, markers, diagramtype, id) { @@ -105726,9 +105453,9 @@ var render = function render(elem, graph, markers, diagramtype, id) { Object(_edges__WEBPACK_IMPORTED_MODULE_7__["clear"])(); Object(_clusters__WEBPACK_IMPORTED_MODULE_6__["clear"])(); Object(_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_4__["clear"])(); - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].warn('Graph at first:', graphlib__WEBPACK_IMPORTED_MODULE_1___default.a.json.write(graph)); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].warn('Graph at first:', graphlib__WEBPACK_IMPORTED_MODULE_1___default.a.json.write(graph)); Object(_mermaid_graphlib__WEBPACK_IMPORTED_MODULE_4__["adjustClustersAndEdges"])(graph); - _logger__WEBPACK_IMPORTED_MODULE_8__["log"].warn('Graph after:', graphlib__WEBPACK_IMPORTED_MODULE_1___default.a.json.write(graph)); // log.warn('Graph ever after:', graphlib.json.write(graph.node('A').graph)); + _logger__WEBPACK_IMPORTED_MODULE_8__["logger"].warn('Graph after:', graphlib__WEBPACK_IMPORTED_MODULE_1___default.a.json.write(graph)); // log.warn('Graph ever after:', graphlib.json.write(graph.node('A').graph)); recursiveRender(elem, graph, diagramtype); }; // const shapeDefinitions = {}; @@ -106059,7 +105786,7 @@ var insertMarkers = function insertMarkers(elem, markerArray, type, id) { }; var extension = function extension(elem, type, id) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].trace('Making markers for ', id); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].trace('Making markers for ', id); elem.append('defs').append('marker').attr('id', type + '-extensionStart').attr('class', 'marker extension ' + type).attr('refX', 0).attr('refY', 7).attr('markerWidth', 190).attr('markerHeight', 240).attr('orient', 'auto').append('path').attr('d', 'M 1,7 L18,13 V 1 Z'); elem.append('defs').append('marker').attr('id', type + '-extensionEnd').attr('class', 'marker extension ' + type).attr('refX', 19).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 1,1 V 13 L18,7 Z'); // this is actual shape for arrowhead }; @@ -106149,24 +105876,24 @@ var clear = function clear() { var isDecendant = function isDecendant(id, ancenstorId) { // if (id === ancenstorId) return true; - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].trace('In isDecendant', ancenstorId, ' ', id, ' = ', decendants[ancenstorId].indexOf(id) >= 0); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('In isDecendant', ancenstorId, ' ', id, ' = ', decendants[ancenstorId].indexOf(id) >= 0); if (decendants[ancenstorId].indexOf(id) >= 0) return true; return false; }; var edgeInCluster = function edgeInCluster(edge, clusterId) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('Decendants of ', clusterId, ' is ', decendants[clusterId]); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('Edge is ', edge); // Edges to/from the cluster is not in the cluster, they are in the parent + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('Decendants of ', clusterId, ' is ', decendants[clusterId]); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('Edge is ', edge); // Edges to/from the cluster is not in the cluster, they are in the parent if (edge.v === clusterId) return false; if (edge.w === clusterId) return false; if (!decendants[clusterId]) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Tilt, ', clusterId, ',not in decendants'); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Tilt, ', clusterId, ',not in decendants'); return false; } - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('Here '); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('Here '); if (decendants[clusterId].indexOf(edge.v) >= 0) return true; if (isDecendant(edge.v, clusterId)) return true; if (isDecendant(edge.w, clusterId)) return true; @@ -106175,59 +105902,59 @@ var edgeInCluster = function edgeInCluster(edge, clusterId) { }; var copy = function copy(clusterId, graph, newGraph, rootId) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('Copying children of ', clusterId, 'root', rootId, 'data', graph.node(clusterId), rootId); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Copying children of ', clusterId, 'root', rootId, 'data', graph.node(clusterId), rootId); var nodes = graph.children(clusterId) || []; // Include cluster node if it is not the root if (clusterId !== rootId) { nodes.push(clusterId); } - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('Copying (nodes) clusterId', clusterId, 'nodes', nodes); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Copying (nodes) clusterId', clusterId, 'nodes', nodes); nodes.forEach(function (node) { if (graph.children(node).length > 0) { copy(node, graph, newGraph, rootId); } else { var data = graph.node(node); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('cp ', node, ' to ', rootId, ' with parent ', clusterId); //,node, data, ' parent is ', clusterId); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('cp ', node, ' to ', rootId, ' with parent ', clusterId); //,node, data, ' parent is ', clusterId); newGraph.setNode(node, data); if (rootId !== graph.parent(node)) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('Setting parent', node, graph.parent(node)); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Setting parent', node, graph.parent(node)); newGraph.setParent(node, graph.parent(node)); } if (clusterId !== rootId && node !== clusterId) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Setting parent', node, clusterId); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Setting parent', node, clusterId); newGraph.setParent(node, clusterId); } else { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('In copy ', clusterId, 'root', rootId, 'data', graph.node(clusterId), rootId); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Not Setting parent for node=', node, 'cluster!==rootId', clusterId !== rootId, 'node!==clusterId', node !== clusterId); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('In copy ', clusterId, 'root', rootId, 'data', graph.node(clusterId), rootId); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Not Setting parent for node=', node, 'cluster!==rootId', clusterId !== rootId, 'node!==clusterId', node !== clusterId); } var edges = graph.edges(node); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Copying Edges', edges); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Copying Edges', edges); edges.forEach(function (edge) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('Edge', edge); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('Edge', edge); var data = graph.edge(edge.v, edge.w, edge.name); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('Edge data', data, rootId); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('Edge data', data, rootId); try { // Do not copy edges in and out of the root cluster, they belong to the parent graph if (edgeInCluster(edge, rootId)) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('Copying as ', edge.v, edge.w, data, edge.name); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('Copying as ', edge.v, edge.w, data, edge.name); newGraph.setEdge(edge.v, edge.w, data, edge.name); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('newGraph edges ', newGraph.edges(), newGraph.edge(newGraph.edges()[0])); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('newGraph edges ', newGraph.edges(), newGraph.edge(newGraph.edges()[0])); } else { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('Skipping copy of edge ', edge.v, '-->', edge.w, ' rootId: ', rootId, ' clusterId:', clusterId); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('Skipping copy of edge ', edge.v, '-->', edge.w, ' rootId: ', rootId, ' clusterId:', clusterId); } } catch (e) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].error(e); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].error(e); } }); } - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Removing node', node); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Removing node', node); graph.removeNode(node); }); }; @@ -106252,16 +105979,16 @@ var extractDecendants = function extractDecendants(id, graph) { var validate = function validate(graph) { var edges = graph.edges(); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].trace('Edges: ', edges); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].trace('Edges: ', edges); for (var i = 0; i < edges.length; i++) { if (graph.children(edges[i].v).length > 0) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].trace('The node ', edges[i].v, ' is part of and edge even though it has children'); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].trace('The node ', edges[i].v, ' is part of and edge even though it has children'); return false; } if (graph.children(edges[i].w).length > 0) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].trace('The node ', edges[i].w, ' is part of and edge even though it has children'); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].trace('The node ', edges[i].w, ' is part of and edge even though it has children'); return false; } } @@ -106276,14 +106003,14 @@ var validate = function validate(graph) { var findNonClusterChild = function findNonClusterChild(id, graph) { // const node = graph.node(id); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].trace('Searching', id); // const children = graph.children(id).reverse(); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].trace('Searching', id); // const children = graph.children(id).reverse(); var children = graph.children(id); //.reverse(); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].trace('Searching children of id ', id, children); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].trace('Searching children of id ', id, children); if (children.length < 1) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].trace('This is a valid node', id); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].trace('This is a valid node', id); return id; } @@ -106291,7 +106018,7 @@ var findNonClusterChild = function findNonClusterChild(id, graph) { var _id = findNonClusterChild(children[i], graph); if (_id) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].trace('Found replacement for', id, ' => ', _id); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].trace('Found replacement for', id, ' => ', _id); return _id; } } @@ -106317,10 +106044,10 @@ var getAnchorId = function getAnchorId(id) { var adjustClustersAndEdges = function adjustClustersAndEdges(graph, depth) { if (!graph || depth > 10) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Opting out, no graph '); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Opting out, no graph '); return; } else { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Opting in, graph '); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Opting in, graph '); } // Go through the nodes and for each cluster found, save a replacment node, this can be used when // faking a link to a cluster @@ -106329,7 +106056,7 @@ var adjustClustersAndEdges = function adjustClustersAndEdges(graph, depth) { var children = graph.children(id); if (children.length > 0) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('Cluster identified', id, ' Replacement id in edges: ', findNonClusterChild(id, graph)); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Cluster identified', id, ' Replacement id in edges: ', findNonClusterChild(id, graph)); decendants[id] = extractDecendants(id, graph); clusterDb[id] = { id: findNonClusterChild(id, graph), @@ -106343,7 +106070,7 @@ var adjustClustersAndEdges = function adjustClustersAndEdges(graph, depth) { var edges = graph.edges(); if (children.length > 0) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Cluster identified', id, decendants); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Cluster identified', id, decendants); edges.forEach(function (edge) { // log.debug('Edge, decendants: ', edge, decendants[id]); // Check if any edge leaves the cluster (not the actual cluster, thats a link from the box) @@ -106354,41 +106081,41 @@ var adjustClustersAndEdges = function adjustClustersAndEdges(graph, depth) { var d2 = isDecendant(edge.w, id); // d1 xor d2 - if either d1 is true and d2 is false or the other way around if (d1 ^ d2) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('Edge: ', edge, ' leaves cluster ', id); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('Decendants of XXX ', id, ': ', decendants[id]); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Edge: ', edge, ' leaves cluster ', id); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Decendants of XXX ', id, ': ', decendants[id]); clusterDb[id].externalConnections = true; } } }); } else { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Not a cluster ', id, decendants); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Not a cluster ', id, decendants); } }); // For clusters with incoming and/or outgoing edges translate those edges to a real node // in the cluster inorder to fake the edge graph.edges().forEach(function (e) { var edge = graph.edge(e); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e)); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(graph.edge(e))); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(e)); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(graph.edge(e))); var v = e.v; var w = e.w; // Check if link is either from or to a cluster - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('Fix XXX', clusterDb, 'ids:', e.v, e.w, 'Translateing: ', clusterDb[e.v], ' --- ', clusterDb[e.w]); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Fix XXX', clusterDb, 'ids:', e.v, e.w, 'Translateing: ', clusterDb[e.v], ' --- ', clusterDb[e.w]); if (clusterDb[e.v] || clusterDb[e.w]) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('Fixing and trixing - removing XXX', e.v, e.w, e.name); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Fixing and trixing - removing XXX', e.v, e.w, e.name); v = getAnchorId(e.v); w = getAnchorId(e.w); graph.removeEdge(e.v, e.w, e.name); if (v !== e.v) edge.fromCluster = e.v; if (w !== e.w) edge.toCluster = e.w; - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('Fix Replacing with XXX', v, w, e.name); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Fix Replacing with XXX', v, w, e.name); graph.setEdge(v, w, edge, e.name); } }); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('Adjusted Graph', graphlib__WEBPACK_IMPORTED_MODULE_1___default.a.json.write(graph)); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Adjusted Graph', graphlib__WEBPACK_IMPORTED_MODULE_1___default.a.json.write(graph)); extractor(graph, 0); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].trace(clusterDb); // Remove references to extracted cluster + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].trace(clusterDb); // Remove references to extracted cluster // graph.edges().forEach(edge => { // if (isDecendant(edge.v, clusterId) || isDecendant(edge.w, clusterId)) { // graph.removeEdge(edge); @@ -106396,10 +106123,10 @@ var adjustClustersAndEdges = function adjustClustersAndEdges(graph, depth) { // }); }; var extractor = function extractor(graph, depth) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('extractor - ', depth, graphlib__WEBPACK_IMPORTED_MODULE_1___default.a.json.write(graph), graph.children('D')); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('extractor - ', depth, graphlib__WEBPACK_IMPORTED_MODULE_1___default.a.json.write(graph), graph.children('D')); if (depth > 10) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].error('Bailing out'); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].error('Bailing out'); return; } // For clusters without incoming and/or outgoing edges, create a new cluster-node // containing the nodes and edges in the custer in a new graph @@ -106416,40 +106143,31 @@ var extractor = function extractor(graph, depth) { } if (!hasChildren) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Done, no node has children', graph.nodes()); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Done, no node has children', graph.nodes()); return; } // const clusters = Object.keys(clusterDb); // clusters.forEach(clusterId => { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Nodes = ', nodes, depth); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Nodes = ', nodes, depth); for (var _i = 0; _i < nodes.length; _i++) { var _node = nodes[_i]; - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Extracting node', _node, clusterDb, clusterDb[_node] && !clusterDb[_node].externalConnections, !graph.parent(_node), graph.node(_node), graph.children('D'), ' Depth ', depth); // Note that the node might have been removed after the Object.keys call so better check + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Extracting node', _node, clusterDb, clusterDb[_node] && !clusterDb[_node].externalConnections, !graph.parent(_node), graph.node(_node), graph.children('D'), ' Depth ', depth); // Note that the node might have been removed after the Object.keys call so better check // that it still is in the game if (!clusterDb[_node]) { // Skip if the node is not a cluster - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Not a cluster', _node, depth); // break; + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Not a cluster', _node, depth); // break; } else if (!clusterDb[_node].externalConnections && // !graph.parent(node) && graph.children(_node) && graph.children(_node).length > 0) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('Cluster without external connections, without a parent and with children', _node, depth); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Cluster without external connections, without a parent and with children', _node, depth); var graphSettings = graph.graph(); - var dir = graphSettings.rankdir === 'TB' ? 'LR' : 'TB'; - - if (clusterDb[_node]) { - if (clusterDb[_node].clusterData && clusterDb[_node].clusterData.dir) { - dir = clusterDb[_node].clusterData.dir; - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('Fixing dir', clusterDb[_node].clusterData.dir, dir); - } - } - var clusterGraph = new graphlib__WEBPACK_IMPORTED_MODULE_1___default.a.Graph({ multigraph: true, compound: true }).setGraph({ - rankdir: dir, + rankdir: graphSettings.rankdir === 'TB' ? 'LR' : 'TB', // Todo: set proper spacing nodesep: 50, ranksep: 50, @@ -106458,7 +106176,7 @@ var extractor = function extractor(graph, depth) { }).setDefaultEdgeLabel(function () { return {}; }); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('Old graph before copy', graphlib__WEBPACK_IMPORTED_MODULE_1___default.a.json.write(graph)); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Old graph before copy', graphlib__WEBPACK_IMPORTED_MODULE_1___default.a.json.write(graph)); copy(_node, graph, clusterGraph, _node); graph.setNode(_node, { clusterNode: true, @@ -106467,21 +106185,21 @@ var extractor = function extractor(graph, depth) { labelText: clusterDb[_node].labelText, graph: clusterGraph }); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('New graph after copy node: (', _node, ')', graphlib__WEBPACK_IMPORTED_MODULE_1___default.a.json.write(clusterGraph)); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Old graph after copy', graphlib__WEBPACK_IMPORTED_MODULE_1___default.a.json.write(graph)); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('New graph after copy node: (', _node, ')', graphlib__WEBPACK_IMPORTED_MODULE_1___default.a.json.write(clusterGraph)); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Old graph after copy', graphlib__WEBPACK_IMPORTED_MODULE_1___default.a.json.write(graph)); } else { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('Cluster ** ', _node, ' **not meeting the criteria !externalConnections:', !clusterDb[_node].externalConnections, ' no parent: ', !graph.parent(_node), ' children ', graph.children(_node) && graph.children(_node).length > 0, graph.children('D'), depth); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug(clusterDb); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('Cluster ** ', _node, ' **not meeting the criteria !externalConnections:', !clusterDb[_node].externalConnections, ' no parent: ', !graph.parent(_node), ' children ', graph.children(_node) && graph.children(_node).length > 0, graph.children('D'), depth); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug(clusterDb); } } nodes = graph.nodes(); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn('New list of nodes', nodes); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn('New list of nodes', nodes); for (var _i2 = 0; _i2 < nodes.length; _i2++) { var _node2 = nodes[_i2]; var data = graph.node(_node2); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].warn(' Now next level', _node2, data); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].warn(' Now next level', _node2, data); if (data.clusterNode) { extractor(data.graph, depth + 1); @@ -106525,9 +106243,6 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _createLabel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./createLabel */ "./src/dagre-wrapper/createLabel.js"); /* harmony import */ var _shapes_note__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./shapes/note */ "./src/dagre-wrapper/shapes/note.js"); /* harmony import */ var _diagrams_class_svgDraw__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../diagrams/class/svgDraw */ "./src/diagrams/class/svgDraw.js"); -/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../diagrams/common/common */ "./src/diagrams/common/common.js"); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - // eslint-disable-line @@ -106538,7 +106253,6 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi - var question = function question(parent, node) { var _labelHelper = Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["labelHelper"])(parent, node, undefined, true), shapeSvg = _labelHelper.shapeSvg, @@ -106560,50 +106274,18 @@ var question = function question(parent, node) { x: 0, y: -s / 2 }]; - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].info('Question main (Circle)'); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].info('Question main (Circle)'); var questionElem = Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["insertPolygonShape"])(shapeSvg, s, s, points); - questionElem.attr('style', node.style); Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["updateNodeBounds"])(node, questionElem); node.intersect = function (point) { - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].warn('Intersect called'); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].warn('Intersect called'); return _intersect_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].polygon(node, points, point); }; return shapeSvg; }; -var choice = function choice(parent, node) { - var shapeSvg = parent.insert('g').attr('class', 'node default').attr('id', node.domId || node.id); - var s = 28; - var points = [{ - x: 0, - y: s / 2 - }, { - x: s / 2, - y: 0 - }, { - x: 0, - y: -s / 2 - }, { - x: -s / 2, - y: 0 - }]; - var choice = shapeSvg.insert('polygon', ':first-child').attr('points', points.map(function (d) { - return d.x + ',' + d.y; - }).join(' ')); // center the circle around its coordinate - - choice.attr('class', 'state-start').attr('r', 7).attr('width', 28).attr('height', 28); - node.width = 28; - node.height = 28; - - node.intersect = function (point) { - return _intersect_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].circle(node, 14, point); - }; - - return shapeSvg; -}; - var hexagon = function hexagon(parent, node) { var _labelHelper2 = Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["labelHelper"])(parent, node, undefined, true), shapeSvg = _labelHelper2.shapeSvg, @@ -106633,11 +106315,10 @@ var hexagon = function hexagon(parent, node) { y: -h / 2 }]; var hex = Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["insertPolygonShape"])(shapeSvg, w, h, points); - hex.attr('style', node.style); Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["updateNodeBounds"])(node, hex); node.intersect = function (point) { - return _intersect_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].polygon(node, points, point); + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].polygon(node, point); }; return shapeSvg; @@ -106667,12 +106348,10 @@ var rect_left_inv_arrow = function rect_left_inv_arrow(parent, node) { y: -h / 2 }]; var el = Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["insertPolygonShape"])(shapeSvg, w, h, points); - el.attr('style', node.style); - node.width = w + h; - node.height = h; + Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["updateNodeBounds"])(node, el); node.intersect = function (point) { - return _intersect_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].polygon(node, points, point); + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].polygon(node, point); }; return shapeSvg; @@ -106699,11 +106378,10 @@ var lean_right = function lean_right(parent, node) { y: -h }]; var el = Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["insertPolygonShape"])(shapeSvg, w, h, points); - el.attr('style', node.style); Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["updateNodeBounds"])(node, el); node.intersect = function (point) { - return _intersect_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].polygon(node, points, point); + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].polygon(node, point); }; return shapeSvg; @@ -106730,11 +106408,10 @@ var lean_left = function lean_left(parent, node) { y: -h }]; var el = Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["insertPolygonShape"])(shapeSvg, w, h, points); - el.attr('style', node.style); Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["updateNodeBounds"])(node, el); node.intersect = function (point) { - return _intersect_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].polygon(node, points, point); + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].polygon(node, point); }; return shapeSvg; @@ -106761,11 +106438,10 @@ var trapezoid = function trapezoid(parent, node) { y: -h }]; var el = Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["insertPolygonShape"])(shapeSvg, w, h, points); - el.attr('style', node.style); Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["updateNodeBounds"])(node, el); node.intersect = function (point) { - return _intersect_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].polygon(node, points, point); + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].polygon(node, point); }; return shapeSvg; @@ -106792,11 +106468,10 @@ var inv_trapezoid = function inv_trapezoid(parent, node) { y: -h }]; var el = Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["insertPolygonShape"])(shapeSvg, w, h, points); - el.attr('style', node.style); Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["updateNodeBounds"])(node, el); node.intersect = function (point) { - return _intersect_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].polygon(node, points, point); + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].polygon(node, point); }; return shapeSvg; @@ -106826,11 +106501,10 @@ var rect_right_inv_arrow = function rect_right_inv_arrow(parent, node) { y: -h }]; var el = Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["insertPolygonShape"])(shapeSvg, w, h, points); - el.attr('style', node.style); Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["updateNodeBounds"])(node, el); node.intersect = function (point) { - return _intersect_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].polygon(node, points, point); + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].polygon(node, point); }; return shapeSvg; @@ -106846,7 +106520,7 @@ var cylinder = function cylinder(parent, node) { var ry = rx / (2.5 + w / 50); var h = bbox.height + ry + node.padding; var shape = 'M 0,' + ry + ' a ' + rx + ',' + ry + ' 0,0,0 ' + w + ' 0 a ' + rx + ',' + ry + ' 0,0,0 ' + -w + ' 0 l 0,' + h + ' a ' + rx + ',' + ry + ' 0,0,0 ' + w + ' 0 l 0,' + -h; - var el = shapeSvg.attr('label-offset-y', ry).insert('path', ':first-child').attr('style', node.style).attr('d', shape).attr('transform', 'translate(' + -w / 2 + ',' + -(h / 2 + ry) + ')'); + var el = shapeSvg.attr('label-offset-y', ry).insert('path', ':first-child').attr('d', shape).attr('transform', 'translate(' + -w / 2 + ',' + -(h / 2 + ry) + ')'); Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["updateNodeBounds"])(node, el); node.intersect = function (point) { @@ -106875,7 +106549,7 @@ var rect = function rect(parent, node) { bbox = _labelHelper10.bbox, halfPadding = _labelHelper10.halfPadding; - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].trace('Classes = ', node.classes); // add the rect + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].trace('Classes = ', node.classes); // add the rect var rect = shapeSvg.insert('rect', ':first-child'); rect.attr('class', 'basic label-container').attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('x', -bbox.width / 2 - halfPadding).attr('y', -bbox.height / 2 - halfPadding).attr('width', bbox.width + node.padding).attr('height', bbox.height + node.padding); @@ -106905,21 +106579,12 @@ var rectWithTitle = function rectWithTitle(parent, node) { var innerLine = shapeSvg.insert('line'); var label = shapeSvg.insert('g').attr('class', 'label'); - var text2 = node.labelText.flat ? node.labelText.flat() : node.labelText; // const text2 = typeof text2prim === 'object' ? text2prim[0] : text2prim; - - var title = ''; - - if (_typeof(text2) === 'object') { - title = text2[0]; - } else { - title = text2; - } - - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].info('Label text abc79', title, text2, _typeof(text2) === 'object'); - var text = label.node().appendChild(Object(_createLabel__WEBPACK_IMPORTED_MODULE_5__["default"])(title, node.labelStyle, true, true)); + var text2 = node.labelText.flat(); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].info('Label text', text2[0]); + var text = label.node().appendChild(Object(_createLabel__WEBPACK_IMPORTED_MODULE_5__["default"])(text2[0], node.labelStyle, true, true)); var bbox; - if (Object(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_8__["evaluate"])(Object(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"])().flowchart.htmlLabels)) { + if (Object(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"])().flowchart.htmlLabels) { var div = text.children[0]; var dv = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])(text); bbox = div.getBoundingClientRect(); @@ -106927,12 +106592,12 @@ var rectWithTitle = function rectWithTitle(parent, node) { dv.attr('height', bbox.height); } - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].info('Text 2', text2); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].info('Text 2', text2); var textRows = text2.slice(1, text2.length); var titleBox = text.getBBox(); - var descr = label.node().appendChild(Object(_createLabel__WEBPACK_IMPORTED_MODULE_5__["default"])(textRows.join ? textRows.join('
') : textRows, node.labelStyle, true, true)); + var descr = label.node().appendChild(Object(_createLabel__WEBPACK_IMPORTED_MODULE_5__["default"])(textRows.join('
'), node.labelStyle, true, true)); - if (Object(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_8__["evaluate"])(Object(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"])().flowchart.htmlLabels)) { + if (Object(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"])().flowchart.htmlLabels) { var _div = descr.children[0]; var _dv = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])(descr); @@ -106943,7 +106608,7 @@ var rectWithTitle = function rectWithTitle(parent, node) { _dv.attr('height', bbox.height); } // bbox = label.getBBox(); - // log.info(descr); + // logger.info(descr); var halfPadding = node.padding / 2; @@ -106975,7 +106640,7 @@ var stadium = function stadium(parent, node) { var h = bbox.height + node.padding; var w = bbox.width + h / 4 + node.padding; // add the rect - var rect = shapeSvg.insert('rect', ':first-child').attr('style', node.style).attr('rx', h / 2).attr('ry', h / 2).attr('x', -w / 2).attr('y', -h / 2).attr('width', w).attr('height', h); + var rect = shapeSvg.insert('rect', ':first-child').attr('rx', h / 2).attr('ry', h / 2).attr('x', -w / 2).attr('y', -h / 2).attr('width', w).attr('height', h); Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["updateNodeBounds"])(node, rect); node.intersect = function (point) { @@ -106993,12 +106658,12 @@ var circle = function circle(parent, node) { var circle = shapeSvg.insert('circle', ':first-child'); // center the circle around its coordinate - circle.attr('style', node.style).attr('rx', node.rx).attr('ry', node.ry).attr('r', bbox.width / 2 + halfPadding).attr('width', bbox.width + node.padding).attr('height', bbox.height + node.padding); - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].info('Circle main'); + circle.attr('rx', node.rx).attr('ry', node.ry).attr('r', bbox.width / 2 + halfPadding).attr('width', bbox.width + node.padding).attr('height', bbox.height + node.padding); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].info('Circle main'); Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["updateNodeBounds"])(node, circle); node.intersect = function (point) { - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].info('Circle intersect', node, bbox.width / 2 + halfPadding, point); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].info('Circle intersect', node, bbox.width / 2 + halfPadding, point); return _intersect_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].circle(node, bbox.width / 2 + halfPadding, point); }; @@ -107044,11 +106709,10 @@ var subroutine = function subroutine(parent, node) { y: 0 }]; var el = Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["insertPolygonShape"])(shapeSvg, w, h, points); - el.attr('style', node.style); Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["updateNodeBounds"])(node, el); node.intersect = function (point) { - return _intersect_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].polygon(node, points, point); + return _intersect_index_js__WEBPACK_IMPORTED_MODULE_4__["default"].polygon(node, point); }; return shapeSvg; @@ -107078,7 +106742,7 @@ var forkJoin = function forkJoin(parent, node, dir) { height = 70; } - var shape = shapeSvg.append('rect').attr('x', -1 * width / 2).attr('y', -1 * height / 2).attr('width', width).attr('height', height).attr('class', 'fork-join'); + var shape = shapeSvg.append('rect').style('stroke', 'black').style('fill', 'black').attr('x', -1 * width / 2).attr('y', -1 * height / 2).attr('width', width).attr('height', height).attr('class', 'fork-join'); Object(_shapes_util__WEBPACK_IMPORTED_MODULE_2__["updateNodeBounds"])(node, shape); node.height = node.height + node.padding / 2; node.width = node.width + node.padding / 2; @@ -107133,7 +106797,7 @@ var class_box = function class_box(parent, node) { var interfaceLabel = labelContainer.node().appendChild(Object(_createLabel__WEBPACK_IMPORTED_MODULE_5__["default"])(interfaceLabelText, node.labelStyle, true, true)); var interfaceBBox = interfaceLabel.getBBox(); - if (Object(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_8__["evaluate"])(Object(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"])().flowchart.htmlLabels)) { + if (Object(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"])().flowchart.htmlLabels) { var div = interfaceLabel.children[0]; var dv = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])(interfaceLabel); interfaceBBox = div.getBoundingClientRect(); @@ -107156,7 +106820,7 @@ var class_box = function class_box(parent, node) { Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])(classTitleLabel).attr('class', 'classTitle'); var classTitleBBox = classTitleLabel.getBBox(); - if (Object(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_8__["evaluate"])(Object(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"])().flowchart.htmlLabels)) { + if (Object(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"])().flowchart.htmlLabels) { var _div2 = classTitleLabel.children[0]; var _dv2 = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])(classTitleLabel); @@ -107180,7 +106844,7 @@ var class_box = function class_box(parent, node) { var lbl = labelContainer.node().appendChild(Object(_createLabel__WEBPACK_IMPORTED_MODULE_5__["default"])(parsedText, node.labelStyle, true, true)); var bbox = lbl.getBBox(); - if (Object(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_8__["evaluate"])(Object(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"])().flowchart.htmlLabels)) { + if (Object(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"])().flowchart.htmlLabels) { var _div3 = lbl.children[0]; var _dv3 = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])(lbl); @@ -107206,7 +106870,7 @@ var class_box = function class_box(parent, node) { var lbl = labelContainer.node().appendChild(Object(_createLabel__WEBPACK_IMPORTED_MODULE_5__["default"])(parsedText, node.labelStyle, true, true)); var bbox = lbl.getBBox(); - if (Object(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_8__["evaluate"])(Object(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"])().flowchart.htmlLabels)) { + if (Object(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"])().flowchart.htmlLabels) { var _div4 = lbl.children[0]; var _dv4 = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])(lbl); @@ -107253,7 +106917,7 @@ var class_box = function class_box(parent, node) { verticalPos += classTitleBBox.height + rowPadding; }); // // let bbox; - // if (evaluate(getConfig().flowchart.htmlLabels)) { + // if (getConfig().flowchart.htmlLabels) { // const div = interfaceLabel.children[0]; // const dv = select(interfaceLabel); // bbox = div.getBoundingClientRect(); @@ -107261,13 +106925,13 @@ var class_box = function class_box(parent, node) { // dv.attr('height', bbox.height); // } // bbox = labelContainer.getBBox(); - // log.info('Text 2', text2); + // logger.info('Text 2', text2); // const textRows = text2.slice(1, text2.length); // let titleBox = text.getBBox(); // const descr = label // .node() // .appendChild(createLabel(textRows.join('
'), node.labelStyle, true, true)); - // if (evaluate(getConfig().flowchart.htmlLabels)) { + // if (getConfig().flowchart.htmlLabels) { // const div = descr.children[0]; // const dv = select(descr); // bbox = div.getBoundingClientRect(); @@ -107275,7 +106939,7 @@ var class_box = function class_box(parent, node) { // dv.attr('height', bbox.height); // } // // bbox = label.getBBox(); - // // log.info(descr); + // // logger.info(descr); // select(descr).attr( // 'transform', // 'translate( ' + @@ -107323,7 +106987,6 @@ var shapes = { question: question, rect: rect, rectWithTitle: rectWithTitle, - choice: choice, circle: circle, stadium: stadium, hexagon: hexagon, @@ -107377,17 +107040,14 @@ var clear = function clear() { }; var positionNode = function positionNode(node) { var el = nodeElems[node.id]; - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].trace('Transforming node', node.diff, node, 'translate(' + (node.x - node.width / 2 - 5) + ', ' + node.width / 2 + ')'); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].trace('Transforming node', node, 'translate(' + (node.x - node.width / 2 - 5) + ', ' + (node.y - node.height / 2 - 5) + ')'); var padding = 8; - var diff = node.diff || 0; if (node.clusterNode) { - el.attr('transform', 'translate(' + (node.x + diff - node.width / 2) + ', ' + (node.y - node.height / 2 - padding) + ')'); + el.attr('transform', 'translate(' + (node.x - node.width / 2 - padding) + ', ' + (node.y - node.height / 2 - padding) + ')'); } else { el.attr('transform', 'translate(' + node.x + ', ' + node.y + ')'); } - - return diff; }; /***/ }), @@ -107413,7 +107073,7 @@ var note = function note(parent, node) { bbox = _labelHelper.bbox, halfPadding = _labelHelper.halfPadding; - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].info('Classes = ', node.classes); // add the rect + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].info('Classes = ', node.classes); // add the rect var rect = shapeSvg.insert('rect', ':first-child'); rect.attr('rx', node.rx).attr('ry', node.ry).attr('x', -bbox.width / 2 - halfPadding).attr('y', -bbox.height / 2 - halfPadding).attr('width', bbox.width + node.padding).attr('height', bbox.height + node.padding); @@ -107443,8 +107103,6 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _createLabel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../createLabel */ "./src/dagre-wrapper/createLabel.js"); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../config */ "./src/config.js"); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! d3 */ "d3"); -/* harmony import */ var _diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../diagrams/common/common */ "./src/diagrams/common/common.js"); - @@ -107465,7 +107123,7 @@ var labelHelper = function labelHelper(parent, node, _classes, isNode) { var bbox = text.getBBox(); - if (Object(_diagrams_common_common__WEBPACK_IMPORTED_MODULE_3__["evaluate"])(Object(_config__WEBPACK_IMPORTED_MODULE_1__["getConfig"])().flowchart.htmlLabels)) { + if (Object(_config__WEBPACK_IMPORTED_MODULE_1__["getConfig"])().flowchart.htmlLabels) { var div = text.children[0]; var dv = Object(d3__WEBPACK_IMPORTED_MODULE_2__["select"])(text); bbox = div.getBoundingClientRect(); @@ -107509,9 +107167,7 @@ __webpack_require__.r(__webpack_exports__); * **Configuration methods in Mermaid version 8.6.0 have been updated, to learn more[[click here](8.6.0_docs.md)].** * * ## **What follows are config instructions for older versions** - * * These are the default options which can be overridden with the initialization call like so: - * * **Example 1:** *
  * mermaid.initialize({
@@ -107543,15 +107199,15 @@ __webpack_require__.r(__webpack_exports__);
  */
 
 var config = {
-  /**
-   * theme , the CSS style sheet
+  /** theme , the CSS style sheet
    *
-   * | Parameter | Description | Type | Required | Values |
-   * | --- | --- | --- | --- | --- |
-   * | theme | Built in Themes | string | Optional | 'default', 'forest', 'dark', 'neutral', 'null'|
+   * theme , the CSS style sheet
    *
-   * **Notes:** To disable any pre-defined mermaid theme, use "null".
+   *| Parameter | Description |Type | Required | Values|
+   *| --- | --- | --- | --- | --- |
+   *| Theme |Built in Themes| String | Optional | Values include, default, forest, dark, neutral, null|
    *
+   ***Notes:**To disable any pre-defined mermaid theme, use "null".
    * 
    *  "theme": "forest",
    *  "themeCSS": ".node rect { fill: red; }"
@@ -107565,64 +107221,59 @@ var config = {
   maxTextSize: 50000,
 
   /**
-   * | Parameter | Description | Type | Required | Values |
-   * | --- | --- | --- | --- | --- |
-   * | fontFamily | specifies the font to be used in the rendered diagrams| string | Required | Any Posiable CSS FontFamily |
+   *| Parameter | Description |Type | Required | Values|
+   *| --- | --- | --- | --- | --- |
+   *|fontFamily | specifies the font to be used in the rendered diagrams| String | Required | Trebuchet MS, Verdana, Arial, Sans-Serif |
    *
-   * **Notes:**
-   * Default value: '"trebuchet ms", verdana, arial, sans-serif;'.
+   ***notes: Default value is \\"trebuchet ms\\".
    */
   fontFamily: '"trebuchet ms", verdana, arial, sans-serif;',
 
   /**
-   * | Parameter | Description | Type | Required | Values |
-   * | --- | --- | --- | --- | --- |
-   * | logLevel |This option decides the amount of logging to be used.| string \| number | Required | 1, 2, 3, 4, 5 |
-   *
+   *| Parameter | Description |Type | Required | Values|
+   *| --- | --- | --- | --- | --- |
+   *| logLevel |This option decides the amount of logging to be used.| String | Required | 1, 2, 3, 4, 5 |
    *
-   * **Notes:**
    *
-   * - debug: 1
-   * - info: 2
-   * - warn: 3
-   * - error: 4
-   * - fatal: 5 (default)
+   ***Notes:**
+   *-   debug: 1.
+   *-   info: 2.
+   *-   warn: 3.
+   *-   error: 4.
+   *-   fatal: 5(default).
    */
   logLevel: 5,
 
   /**
-   * | Parameter | Description | Type | Required | Values |
-   * | --- | --- | --- | --- | --- |
-   * | securitylevel | Level of trust for parsed diagram|string | Required | 'strict', 'loose', 'antiscript' |
+   *| Parameter | Description |Type | Required | Values|
+   *| --- | --- | --- | --- | --- |
+   *| securitylevel | Level of trust for parsed diagram|String | Required | Strict, Loose, antiscript |
    *
-   * **Notes**:
-   *
-   * - **strict**: (**default**) tags in text are encoded, click functionality is disabeled
-   * - **loose**: tags in text are allowed, click functionality is enabled
-   * - **antiscript**: html tags in text are allowed, (only script element is removed), click functionality is enabled
+   ***Notes:
+   *-   **strict**: (**default**) tags in text are encoded, click functionality is disabeled
+   *-   **loose**: tags in text are allowed, click functionality is enabled
+   *-   **antiscript**: html tags in text are allowed, (only script element is removed), click functionality is enabled
    */
   securityLevel: 'strict',
 
   /**
-   * | Parameter | Description | Type | Required | Values |
-   * | --- | --- | --- | --- | --- |
-   * | startOnLoad | Dictates whether mermaind starts on Page load | boolean | Required | true, false |
+   *| Parameter | Description |Type | Required | Values|
+   *| --- | --- | --- | --- | --- |
+   *| startOnLoad| Dictates whether mermaind starts on Page load | Boolean | Required | True, False |
    *
-   * **Notes:** Default value: true
+   ***Notes:**
+   ***Default value: true**
    */
   startOnLoad: true,
 
   /**
-   * | Parameter | Description |Type | Required |Values|
-   * | --- | --- | --- | --- | --- |
-   * | arrowMarkerAbsolute | Controls whether or arrow markers in html code are absolute paths or anchors | boolean | Required | true, false |
-   *
+   *| Parameter | Description |Type | Required |Values|
+   *| --- | --- | --- | --- | --- |
+   *| arrowMarkerAbsolute | Controls whether or arrow markers in html code are absolute paths or anchors | Boolean | Required |  True, False |
    *
-   * **Notes**:
    *
-   * This matters if you are using base tag settings.
-   *
-   * Default value: false
+   *## Notes**: This matters if you are using base tag settings.
+   ***Default value: false**.
    */
   arrowMarkerAbsolute: false,
 
@@ -107631,9 +107282,6 @@ var config = {
    * call to mermaidAPI.initialize. Calls to mermaidAPI.reinitialize cannot make changes to
    * the `secure` keys in the current currentConfig. This prevents malicious graph directives from
    * overriding a site's default security.
-    * **Notes**:
-   *
-   * Default value: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize']
    */
   secure: ['secure', 'securityLevel', 'startOnLoad', 'maxTextSize'],
 
@@ -107641,11 +107289,8 @@ var config = {
    * This option controls if the generated ids of nodes in the SVG are generated randomly or based on a seed.
    * If set to false, the IDs are generated based on the current date and thus are not deterministic. This is the default behaviour.
    *
-   * **Notes**:
-   *
-   * This matters if your files are checked into sourcecontrol e.g. git and should not change unless content is changed.
-   *
-   * Default value: false
+   *## Notes**: This matters if your files are checked into sourcecontrol e.g. git and should not change unless content is changed.
+   ***Default value: false**
    */
   deterministicIds: false,
 
@@ -107660,95 +107305,69 @@ var config = {
    */
   flowchart: {
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | diagramPadding | Amount of padding around the diagram as a whole | Integer | Required | Any Positive Value |
-     *
-     * **Notes:**
-     *
-     * The amount of padding around the diagram as a whole so that embedded diagrams have margins, expressed in pixels
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| diagramPadding | amount of padding around the diagram as a whole | Integer | Required | Any Positive Value |
      *
-     * Default value: 8
+     ***Notes:**The amount of padding around the diagram as a whole so that embedded diagrams have margins, expressed in pixels
+     ***Default value: 8**.
      */
     diagramPadding: 8,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | htmlLabels | Flag for setting whether or not a html tag should be used for rendering labels on the edges. | boolean| Required | true, false |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| htmlLabels | Flag for setting whether or not a html tag should be used for rendering labels on the edges. | Boolean| Required | True, False|
      *
-     * **Notes:** Default value: true.
+     ***Notes: Default value: true**.
      */
     htmlLabels: true,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | nodeSpacing | Defines the spacing between nodes on the same level | Integer | Required | Any positive Number |
-     *
-     * **Notes:**
-     *
-     * Pertains to horizontal spacing for TB (top to bottom) or BT (bottom to top) graphs, and the vertical spacing for LR as well as RL graphs.**
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| nodeSpacing | Defines the spacing between nodes on the same level | Integer| Required | Any positive Numbers |
      *
-     * Default value: 50
+     ***Notes:
+     *Pertains to horizontal spacing for TB (top to bottom) or BT (bottom to top) graphs, and the vertical spacing for LR as well as RL graphs.**
+     ***Default value 50**.
      */
     nodeSpacing: 50,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | rankSpacing | Defines the spacing between nodes on different levels | Integer | Required | Any Positive Number |
-     *
-     * **Notes**:
-     *
-     * pertains to vertical spacing for TB (top to bottom) or BT (bottom to top), and the horizontal spacing for LR as well as RL graphs.
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| rankSpacing | Defines the spacing between nodes on different levels | Integer | Required| Any Positive Numbers |
      *
-     * Default value 50
+     ***Notes: pertains to vertical spacing for TB (top to bottom) or BT (bottom to top), and the horizontal spacing for LR as well as RL graphs.
+     ***Default value 50**.
      */
     rankSpacing: 50,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | curve | Defines how mermaid renders curves for flowcharts. | string | Required | 'basis', 'linear', 'cardinal'|
-     *
-     * **Notes:**
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| curve | Defines how mermaid renders curves for flowcharts. | String | Required | Basis, Linear, Cardinal|
      *
-     * Default Vaue: 'basis'
+     ***Notes:
+     *Default Vaue: Linear**
      */
-    curve: 'basis',
+    curve: 'linear',
     // Only used in new experimental rendering
     // represents the padding between the labels and the shape
     padding: 15,
 
     /**
-     * | Parameter | Description | Type | Required | Values|
-     * | --- | --- | --- | --- | --- |
-     * | useMaxWidth | See notes | boolean | 4 | true, false |
-     *
-     * **Notes:**
-     *
-     * When this flag is set the height and width is set to 100% and is then scaling with the
-     * available space if not the absolute space required is used.
-     *
-     * Default value: true
-     */
-    useMaxWidth: true,
-
-    /**
-     * | Parameter | Description | Type | Required | Values|
-     * | --- | --- | --- | --- | --- |
-     * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper |
-     *
-     * **Notes:**
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| useMaxWidth | See notes | Boolean | 4 | True, False |
      *
-     * Decides which rendering engine that is to be used for the rendering. Legal values are:
-     * * dagre-d3
-     * * dagre-wrapper - wrapper for dagre implemented in mermaid
+     ***Notes:**when this flag is set the height and width is set to 100% and is then scaling with the
+     *available space if not the absolute space required is used.
      *
-     * Default value: 'dagre-d3'
+     ***Default value true**.
      */
-    defaultRenderer: 'dagre-d3'
+    useMaxWidth: true
   },
 
   /**
@@ -107756,176 +107375,174 @@ var config = {
    */
   sequence: {
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | activationWidth | Width of the activation rect | Integer | Required | Any Positive Value |
-     *
-     *
-     * **Notes:** Default value :10
+     * widt of the activation rect
+     * **Default value 10**.
      */
     activationWidth: 10,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | diagramMarginX | Margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| diagramMarginX | margin to the right and left of the sequence diagram | Integer | Required | Any Positive Values |
      *
-     * **Notes:** Default value: 50
+     ***Notes:**
+     ***Default value 50**.
      */
     diagramMarginX: 50,
 
     /**
-     *| Parameter | Description | Type | Required | Values |
+     *| Parameter | Description |Type | Required | Values|
      *| --- | --- | --- | --- | --- |
-     *| diagramMarginY | Margin to the over and under the sequence diagram | Integer | Required | Any Positive Value |
+     *| diagramMarginY | Margin to the over and under the sequence diagram | Integer | Required | Any Positive Values|
      *
-     * **Notes:** Default value: 10
+     ***Notes:**
+     ***Default value 10**.
      */
     diagramMarginY: 10,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | actorMargin | Margin between actors | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| actorMargin | Margin between actors. | Integer | Required | Any Positive Value |
      *
-     * **Notes:**
-     * Default value: 50
+     ***Notes:**
+     ***Default value 50**.
      */
     actorMargin: 50,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | width | Width of actor boxes | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| width | Width of actor boxes | Integer | Required | Any Positive Value |
      *
-     * **Notes:**
-     * Default value: 150
+     ***Notes:**
+     ***Default value 150**.
      */
     width: 150,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | height | Height of actor boxes | Integer | Required | Any Positive Value|
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| height | Height of actor boxes | Integer | Required | Any Positive Value|
      *
-     * **Notes:**
-     * Default value: 65
+     ***Notes:**
+     ***Default value 65**..
      */
     height: 65,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value |
      *
-     * **Notes:**
-     * Default value: 10
+     ***Notes:**
+     *
+     ***Default value 10**.
      */
     boxMargin: 10,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | boxTextMargin | Margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| boxTextMargin| margin around the text in loop/alt/opt boxes | Integer | Required| Any Positive Value|
      *
-     * **Notes:**
-     * Default value: 5
+     ***Notes:**
+     *
+     ***Default value 5**.
      */
     boxTextMargin: 5,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | noteMargin | margin around notes | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| noteMargin | margin around notes. | Integer | Required | Any Positive Value |
+     *
+     ***Notes:**
      *
-     * **Notes:**
-     * Default value: 10
+     ***Default value 10**.
      */
     noteMargin: 10,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | messageMargin | Space between messages | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| messageMargin | Space between messages. | Integer | Required | Any Positive Value |
+     *
+     ***Notes:**
      *
-     * **Notes:**
-     * Default value: 35
+     *Space between messages.
+     ***Default value 35**.
      */
     messageMargin: 35,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | messageAlign | Multiline message alignment | string | Required | 'left', 'center', 'right' |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| messageAlign | Multiline message alignment | Integer | Required | left, center, right |
      *
-     * **Notes:**
-     * Default value: 'center'
+     ***Notes:**center **default**
      */
     messageAlign: 'center',
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | mirrorActors | Mirror actors under diagram | boolean | Required | true, false |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| mirrorActors | mirror actors under diagram. | Boolean| Required | True, False |
      *
-     * **Notes:**
-     * Default value: true
+     ***Notes:**
+     *
+     ***Default value true**.
      */
     mirrorActors: true,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | bottomMarginAdj | Prolongs the edge of the diagram downwards | Integer | Required | Any Positive Value |
-     *
-     * **Notes:**
-     *
-     * Depending on css styling this might need adjustment.
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| bottomMarginAdj | Prolongs the edge of the diagram downwards. | Integer | Required | Any Positive Value |
      *
-     * Default value: 1
+     ***Notes:**Depending on css styling this might need adjustment.
+     ***Default value 1**.
      */
     bottomMarginAdj: 1,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | useMaxWidth | See Notes | boolean | Required | true, false |
-     *
-     * **Notes:**
-     * When this flag is set to true, the height and width is set to 100% and is then scaling with the
-     * available space. If set to false, the absolute space required is used.
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| useMaxWidth | See Notes | Boolean | Required | True, False |
      *
-     * Default value: true
+     ***Notes:**
+     *when this flag is set to true, the height and width is set to 100% and is then scaling with the
+     *available space. If set to false, the absolute space required is used.
+     ***Default value: True**.
      */
     useMaxWidth: true,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | rightAngles | display curve arrows as right angles | boolean | Required | true, false |
-     *
-     * **Notes:**
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| rightAngles | display curve arrows as right angles| Boolean | Required | True, False |
      *
-     * This will display arrows that start and begin at the same node as right angles, rather than a curve
+     ***Notes:**
      *
-     * Default value: false
+     *This will display arrows that start and begin at the same node as right angles, rather than a curve
+     ***Default value false**.
      */
     rightAngles: false,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | showSequenceNumbers | This will show the node numbers | boolean | Required | true, false |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| showSequenceNumbers | This will show the node numbers | Boolean | Required | True, False |
      *
-     * **Notes:**
-     * Default value: false
+     ***Notes:**
+     ***Default value false**.
      */
     showSequenceNumbers: false,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | actorFontSize| This sets the font size of the actor's description | Integer | Require | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| actorFontSize| This sets the font size of the actor's description | Integer | Require | Any Positive Value |
      *
      ***Notes:**
      ***Default value 14**..
@@ -107933,118 +107550,104 @@ var config = {
     actorFontSize: 14,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | actorFontFamily |This sets the font family of the actor's description | string | Required | Any Posiable CSS FontFamily |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| actorFontFamily |This sets the font family of the actor's description | 3 | 4 | Open-Sans, Sans-Serif |
      *
-     * **Notes:**
-     * Default value: "'Open-Sans", "sans-serif"'
+     ***Notes:**
+     ***Default value "Open-Sans", "sans-serif"**.
      */
     actorFontFamily: '"Open-Sans", "sans-serif"',
 
     /**
      * This sets the font weight of the actor's description
-     *
-     * **Notes:**
-     * Default value: 400.
+     * **Default value 400.
      */
     actorFontWeight: 400,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | noteFontSize | This sets the font size of actor-attached notes | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| noteFontSize |This sets the font size of actor-attached notes. | Integer | Required | Any Positive Value |
      *
-     * **Notes:**
-     * Default value: 14
+     ***Notes:**
+     ***Default value 14**..
      */
     noteFontSize: 14,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | noteFontFamily| This sets the font family of actor-attached notes. | string | Required | Any Posiable CSS FontFamily |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| noteFontFamily| This sets the font family of actor-attached notes. | String | Required |  trebuchet ms, verdana, arial, sans-serif |
      *
-     * **Notes:**
-     * Default value: ''"trebuchet ms", verdana, arial, sans-serif'
+     ***Notes:**
+     ***Default value: trebuchet ms **.
      */
     noteFontFamily: '"trebuchet ms", verdana, arial, sans-serif',
 
     /**
      * This sets the font weight of the note's description
-     *
-     * **Notes:**
-     * Default value: 400
+     * **Default value 400.
      */
     noteFontWeight: 400,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | noteAlign | This sets the text alignment of actor-attached notes | string | required | 'left', 'center', 'right'|
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| noteAlign | This sets the text alignment of actor-attached notes. | string | required | left, center, right|
      *
-     * **Notes:**
-     * Default value: 'center'
+     ***Notes:**
+     ***Default value center**.
      */
     noteAlign: 'center',
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | messageFontSize | This sets the font size of actor messages | Integer | Required | Any Positive Number |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| messageFontSize | This sets the font size of actor messages. | Integer | Required | Any Positive Number |
      *
-     * **Notes:**
-     * Default value: 16
+     ***Notes:**
+     ***Default value 16**.
      */
     messageFontSize: 16,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | messageFontFamily | This sets the font family of actor messages | string | Required | Any Posiable CSS FontFamily |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| messageFontFamily | This sets the font family of actor messages. | String| Required | trebuchet ms", verdana, arial, sans-serif |
      *
-     * **Notes:**
-     * Default value: '"trebuchet ms", verdana, arial, sans-serif'
+     ***Notes:**
+     ***Default value: "trebuchet ms**.
      */
     messageFontFamily: '"trebuchet ms", verdana, arial, sans-serif',
 
     /**
      * This sets the font weight of the message's description
-     *
-     * **Notes:**
-     * Default value: 400.
+     * **Default value 400.
      */
     messageFontWeight: 400,
 
     /**
      * This sets the auto-wrap state for the diagram
-     *
-     * **Notes:**
-     * Default value: false.
+     * **Default value false.
      */
     wrap: false,
 
     /**
      * This sets the auto-wrap padding for the diagram (sides only)
-     *
-     * **Notes:**
-     * Default value: 0.
+     * **Default value 10.
      */
     wrapPadding: 10,
 
     /**
      * This sets the width of the loop-box (loop, alt, opt, par)
-     *
-     * **Notes:**
-     * Default value: 50.
+     * **Default value 50.
      */
     labelBoxWidth: 50,
 
     /**
      * This sets the height of the loop-box (loop, alt, opt, par)
-     *
-     * **Notes:**
-     * Default value: 20.
+     * **Default value 20.
      */
     labelBoxHeight: 20,
     messageFont: function messageFont() {
@@ -108071,149 +107674,125 @@ var config = {
   },
 
   /**
-   * The object containing configurations specific for gantt diagrams
+   * The object containing configurations specific for gantt diagrams*
    */
   gantt: {
     /**
-     * ### titleTopMargin
+     *### titleTopMargin
      *
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | titleTopMargin | Margin top for the text over the gantt diagram | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| titleTopMargin | Margin top for the text over the gantt diagram | Integer | Required | Any Positive Value |
      *
-     * **Notes:**
-     * Default value: 25
+     ***Notes:**
+     ***Default value 25**.
      */
     titleTopMargin: 25,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | barHeight | The height of the bars in the graph | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| barHeight | The height of the bars in the graph | Integer | Required | Any Positive Value |
      *
-     * **Notes:**
-     * Default value: 20
+     ***Notes:**
+     ***Default value 20**.
      */
     barHeight: 20,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | barGap | The margin between the different activities in the gantt diagram | Integer | Optional | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| barGap | The margin between the different activities in the gantt diagram. | Integer | Optional |Any Positive Value |
      *
-     * **Notes:**
-     * Default value: 4
+     ***Notes:**
+     ***Default value 4**.
      */
     barGap: 4,
 
     /**
-     * | Parameter | Description | Type | Required | Values|
-     * | --- | --- | --- | --- | --- |
-     * | topPadding | Margin between title and gantt diagram and between axis and gantt diagram. | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| topPadding | Margin between title and gantt diagram and between axis and gantt diagram. | Integer | Required | Any Positive Value |
      *
-     * **Notes:**
-     * Default value: 50
+     ***Notes:**
+     ***Default value 50**.
      */
     topPadding: 50,
 
     /**
-     * | Parameter | Description | Type | Required | Values|
-     * | --- | --- | --- | --- | --- |
-     * | rightPadding | The space allocated for the section name to the right of the activities | Integer | Required | Any Positive Value |
-     *
-     * **Notes:**
-     * Default value: 75
-     */
-    rightPadding: 75,
-
-    /**
-     * | Parameter | Description | Type | Required | Values|
-     * | --- | --- | --- | --- | --- |
-     * | leftPadding | The space allocated for the section name to the left of the activities | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| leftPadding | The space allocated for the section name to the left of the activities. | Integer| Required | Any Positive Value |
      *
-     * **Notes:**
-     * Default value: 75
+     ***Notes:**
+     ***Default value 75**.
      */
     leftPadding: 75,
 
     /**
-     * | Parameter | Description | Type | Required | Values|
-     * | --- | --- | --- | --- | --- |
-     * | gridLineStartPadding | Vertical starting position of the grid lines | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| gridLineStartPadding | Vertical starting position of the grid lines. | Integer | Required | Any Positive Value |
      *
-     * **Notes:**
-     * Default value: 35
+     ***Notes:**
+     ***Default value 35**.
      */
     gridLineStartPadding: 35,
 
     /**
-     * | Parameter | Description | Type | Required | Values|
-     * | --- | --- | --- | --- | --- |
-     * | fontSize | Font size | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| fontSize | Font size| Integer | Required | Any Positive Value |
      *
-     * **Notes:**
-     * Default value: 11
+     ***Notes:**
+     ***Default value 11**.
      */
     fontSize: 11,
 
     /**
-     * | Parameter | Description | Type | Required | Values|
-     * | --- | --- | --- | --- | --- |
-     * | sectionFontSize | Font size for secions| Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| fontFamily | font Family | string | required |"Open-Sans", "sans-serif" |
+     *
+     ***Notes:**
      *
-     * **Notes:**
-     * Default value: 11
+     ***Default value '"Open-Sans", "sans-serif"'**.
      */
-    sectionFontSize: 11,
+    fontFamily: '"Open-Sans", "sans-serif"',
 
     /**
-     * | Parameter | Description | Type | Required | Values|
-     * | --- | --- | --- | --- | --- |
-     * | numberSectionStyles | The number of alternating section styles | Integer | 4 | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| numberSectionStyles | The number of alternating section styles | Integer | 4 | Any Positive Value |
      *
-     * **Notes:**
-     * Default value: 4
+     ***Notes:**
+     ***Default value 4**.
      */
     numberSectionStyles: 4,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | axisFormat | Datetime format of the axis | 3 | Required | Date in yy-mm-dd |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| axisFormat | Datetime format of the axis. | 3 | Required | Date in yy-mm-dd |
      *
-     * **Notes:**
+     ***Notes:**
      *
      * This might need adjustment to match your locale and preferences
-     *
-     * Default value: '%Y-%m-%d'.
+     ***Default value '%Y-%m-%d'**.
      */
     axisFormat: '%Y-%m-%d',
 
-    /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | useMaxWidth | See notes | boolean | 4 | true, false |
-     *
-     * **Notes:**
-     *
-     * When this flag is set the height and width is set to 100% and is then scaling with the
-     * available space if not the absolute space required is used.
-     *
-     * Default value: true
-     */
-    useMaxWidth: true,
-
     /**
      *| Parameter | Description |Type | Required | Values|
      *| --- | --- | --- | --- | --- |
-     *| topAxis | See notes | Boolean | 4 | True, False |
+     *| useMaxWidth | See notes | Boolean | 4 | True, False |
      *
-     ***Notes:** when this flag is set date labels will be added to the
-    top of the chart
+     ***Notes:**when this flag is set the height and width is set to 100% and is then scaling with the
+     *available space if not the absolute space required is used.
      *
-     ***Default value false**.
+     ***Default value true**.
      */
-    topAxis: false,
+    useMaxWidth: true,
     useWidth: undefined
   },
 
@@ -108222,205 +107801,165 @@ var config = {
    */
   journey: {
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | diagramMarginX | Margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| diagramMarginX | margin to the right and left of the sequence diagram | Integer | Required | Any Positive Value |
      *
-     * **Notes:**
-     * Default value: 50
+     ***Notes:**
+     ***Default value 50**.
      */
     diagramMarginX: 50,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | diagramMarginY | Margin to the over and under the sequence diagram. | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| diagramMarginY | margin to the over and under the sequence diagram. | Integer | Required | Any Positive Value|
      *
-     * **Notes:**
-     * Default value: 10
+     ***Notes:**
+     ***Default value 10**..
      */
     diagramMarginY: 10,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | actorMargin | Margin between actors | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| actorMargin | Margin between actors. | Integer | Required | Any Positive Value|
      *
-     * **Notes:**
-     * Default value: 50
+     ***Notes:**
+     ***Default value 50**.
      */
-    leftMargin: 150,
+    actorMargin: 50,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | width | Width of actor boxes | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| width | Width of actor boxes | Integer | Required | Any Positive Value |
      *
-     * **Notes:**
-     * Default value: 150
+     ***Notes:**
+     ***Default value 150**.
      */
     width: 150,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | height | Height of actor boxes | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| height | Height of actor boxes | Integer | Required | Any Positive Value |
      *
-     * **Notes:**
-     * Default value: 65
+     ***Notes:**
+     ***Default value 65**.
      */
-    height: 50,
+    height: 65,
 
     /**
      *| Parameter | Description |Type | Required | Values|
      *| --- | --- | --- | --- | --- |
      *| boxMargin | Margin around loop boxes | Integer | Required | Any Positive Value |
      *
-     * **Notes:**
-     * Default value: 10
+     ***Notes:**
+     ***Default value 10**.
      */
     boxMargin: 10,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | boxTextMargin | Margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| boxTextMargin | margin around the text in loop/alt/opt boxes | Integer | Required | Any Positive Value |
      *
-     * **Notes:**
-     * Default value: 5
+     ***Notes:**
      */
     boxTextMargin: 5,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | noteMargin | Margin around notes | Integer | Required | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| noteMargin | margin around notes. | Integer | Required | Any Positive Value |
      *
-     * **Notes:**
-     * Default value: 10
+     ***Notes:**
+     ***Default value 10**.
      */
     noteMargin: 10,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | messageMargin |Space between messages. | Integer | Required | Any Positive Value |
-     *
-     * **Notes:**
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| messageMargin |Space between messages. | Integer | Required | Any Positive Value |
      *
-     * Space between messages.
+     ***Notes:**
      *
-     * Default value: 35
+     *Space between messages.
+     ***Default value 35**.
      */
     messageMargin: 35,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | messageAlign | Multiline message alignment | 3 | 4 | 'left', 'center', 'right' |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| messageAlign |Multiline message alignment | 3 | 4 | left, center, right |
      *
-     * **Notes:**
-     * Default value: 'center'
+     ***Notes:**default:center**
      */
     messageAlign: 'center',
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | bottomMarginAdj | Prolongs the edge of the diagram downwards | Integer | 4 | Any Positive Value |
-     *
-     * **Notes:**
-     *
-     * Depending on css styling this might need adjustment.
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| bottomMarginAdj | Prolongs the edge of the diagram downwards. | Integer | 4 | Any Positive Value |
      *
-     * Default value: 1
+     ***Notes:**Depending on css styling this might need adjustment.
+     ***Default value 1**.
      */
     bottomMarginAdj: 1,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | useMaxWidth | See notes | boolean | 4 | true, false |
-     *
-     * **Notes:**
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| useMaxWidth | See notes | Boolean | 4 | True, False |
      *
-     * When this flag is set the height and width is set to 100% and is then scaling with the
-     * available space if not the absolute space required is used.
+     ***Notes:**when this flag is set the height and width is set to 100% and is then scaling with the
+     *available space if not the absolute space required is used.
      *
-     * Default value: true
+     ***Default value true**.
      */
     useMaxWidth: true,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | rightAngles | Curved Arrows become Right Angles | 3 | 4 | true, false |
-     *
-     * **Notes:**
-     *
-     * This will display arrows that start and begin at the same node as right angles, rather than a curves
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| rightAngles | Curved Arrows become Right Angles,  | 3 | 4 | True, False |
      *
-     * Default value: false
+     ***Notes:**This will display arrows that start and begin at the same node as right angles, rather than a curves
+     ***Default value false**.
      */
-    rightAngles: false,
-    taskFontSize: 14,
-    taskFontFamily: '"Open-Sans", "sans-serif"',
-    taskMargin: 50,
-    // width of activation box
-    activationWidth: 10,
-    // text placement as: tspan | fo | old only text as before
-    textPlacement: 'fo',
-    actorColours: ['#8FBC8F', '#7CFC00', '#00FFFF', '#20B2AA', '#B0E0E6', '#FFFFE0'],
-    sectionFills: ['#191970', '#8B008B', '#4B0082', '#2F4F4F', '#800000', '#8B4513', '#00008B'],
-    sectionColours: ['#fff']
+    rightAngles: false
   },
   class: {
     arrowMarkerAbsolute: false,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | useMaxWidth | See notes | boolean | 4 | true, false |
-     *
-     * **Notes:**
-     *
-     * When this flag is set the height and width is set to 100% and is then scaling with the
-     * available space if not the absolute space required is used.
-     *
-     * Default value: true
-     */
-    useMaxWidth: true,
-
-    /**
-     * | Parameter | Description | Type | Required | Values|
-     * | --- | --- | --- | --- | --- |
-     * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper |
-     *
-     * **Notes:**
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| useMaxWidth | See notes | Boolean | 4 | True, False |
      *
-     * Decides which rendering engine that is to be used for the rendering. Legal values are:
-     * * dagre-d3
-     * * dagre-wrapper - wrapper for dagre implemented in mermaid
+     ***Notes:**when this flag is set the height and width is set to 100% and is then scaling with the
+     *available space if not the absolute space required is used.
      *
-     * Default value: 'dagre-d3'
+     ***Default value true**.
      */
-    defaultRenderer: 'dagre-d3'
+    useMaxWidth: true
   },
   git: {
     arrowMarkerAbsolute: false,
     useWidth: undefined,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | useMaxWidth | See notes | boolean | 4 | true, false |
-     *
-     * **Notes:**
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| useMaxWidth | See notes | Boolean | 4 | True, False |
      *
-     * When this flag is set the height and width is set to 100% and is then scaling with the
-     * available space if not the absolute space required is used.
+     ***Notes:**when this flag is set the height and width is set to 100% and is then scaling with the
+     *available space if not the absolute space required is used.
      *
-     * Default value: true
+     ***Default value true**.
      */
     useMaxWidth: true
   },
@@ -108445,33 +107984,16 @@ var config = {
     radius: 5,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | useMaxWidth | See notes | boolean | 4 | true, false |
-     *
-     * **Notes:**
-     *
-     * When this flag is set the height and width is set to 100% and is then scaling with the
-     * available space if not the absolute space required is used.
-     *
-     * Default value: true
-     */
-    useMaxWidth: true,
-
-    /**
-     * | Parameter | Description | Type | Required | Values|
-     * | --- | --- | --- | --- | --- |
-     * | defaultRenderer | See notes | boolean | 4 | dagre-d3, dagre-wrapper |
-     *
-     * **Notes:**
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| useMaxWidth | See notes | Boolean | 4 | True, False |
      *
-     * Decides which rendering engine that is to be used for the rendering. Legal values are:
-     * * dagre-d3
-     * * dagre-wrapper - wrapper for dagre implemented in mermaid
+     ***Notes:**when this flag is set the height and width is set to 100% and is then scaling with the
+     *available space if not the absolute space required is used.
      *
-     * Default value: 'dagre-d3'
+     ***Default value true**.
      */
-    defaultRenderer: 'dagre-d3'
+    useMaxWidth: true
   },
 
   /**
@@ -108479,112 +108001,95 @@ var config = {
    */
   er: {
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | diagramPadding | Amount of padding around the diagram as a whole | Integer | Required | Any Positive Value |
-     *
-     * **Notes:**
-     *
-     * The amount of padding around the diagram as a whole so that embedded diagrams have margins, expressed in pixels
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| diagramPadding | amount of padding around the diagram as a whole | Integer | Required | Any Positive Value |
      *
-     * Default value: 20
+     ***Notes:**The amount of padding around the diagram as a whole so that embedded diagrams have margins, expressed in pixels
+     ***Default value: 20**.
      */
     diagramPadding: 20,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | layoutDirection | Directional bias for layout of entities. | string | Required | "TB", "BT", "LR", "RL" |
-     *
-     * **Notes:**
-     *
-     * 'TB' for Top-Bottom, 'BT'for Bottom-Top, 'LR' for Left-Right, or 'RL' for Right to Left.
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| layoutDirection | Directional bias for layout of entities. | String | Required | "TB", "BT","LR","RL" |
      *
+     ***Notes:**
+     *'TB' for Top-Bottom, 'BT'for Bottom-Top, 'LR' for Left-Right, or 'RL' for Right to Left.
      * T = top, B = bottom, L = left, and R = right.
-     *
-     * Default value: 'TB'
+     ***Default value: TB **.
      */
     layoutDirection: 'TB',
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | minEntityWidth | The mimimum width of an entity box | Integer | Required | Any Positive Value  |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| minEntityWidth | The mimimum width of an entity box, | Integer | Required| Any Positive Value  |
      *
-     * **Notes:**
-     * Expressed in pixels.
-     * Default value: 100
+     ***Notes:**expressed in pixels
+     ***Default value: 100**.
      */
     minEntityWidth: 100,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | minEntityHeight| The minimum height of an entity box | Integer | 4 | Any Positive Value |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| minEntityHeight| The minimum height of an entity box, | Integer | 4 | Any Positive Value |
      *
-     * **Notes:**
-     * Expressed in pixels
-     * Default value: 75
+     ***Notes:**expressed in pixels
+     ***Default value: 75 **
      */
     minEntityHeight: 75,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | entityPadding | Minimum internal padding betweentext in box and box borders | Integer | 4 | Any Positive Value |
-     *
-     * **Notes:**
-     *
-     * The minimum internal padding betweentext in an entity box and the enclosing box borders, expressed in pixels.
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| entityPadding|minimum internal padding betweentext in box and  box borders| Integer | 4 | Any Positive Value |
      *
-     * Default value: 15
+     ***Notes:**The minimum internal padding betweentext in an entity box and the enclosing box borders, expressed in pixels.
+     ***Default value: 15 **
      */
     entityPadding: 15,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | stroke | Stroke color of box edges and lines | string | 4 | Any recognized color |
-     *
-     * **Notes:**
-     * Default value: 'gray'
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| stroke | Stroke color of box edges and lines | String | 4 | Any recognized color |
+     ***Default value: gray **
      */
     stroke: 'gray',
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | fill | Fill color of entity boxes | string | 4 | Any recognized color |
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| fill | Fill color of entity boxes | String | 4 | Any recognized color |
      *
-     * **Notes:**
-     * Default value: 'honeydew'
+     ***Notes:**
+     ***Default value:'honeydew'**
      */
     fill: 'honeydew',
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | fontSize | Font Size in pixels | Integer |  | Any Positive Value |
-     *
-     * **Notes:**
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| fontSize| Font Size in pixels| Integer |  | Any Positive Value |
      *
-     * Font size (expressed as an integer representing a number of pixels)
-     * Default value: 12
+     ***Notes:**Font size (expressed as an integer representing a number of pixels)
+     ***Default value: 12 **
      */
     fontSize: 12,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | useMaxWidth | See Notes | boolean | Required | true, false |
-     *
-     * **Notes:**
-     *
-     * When this flag is set to true, the diagram width is locked to 100% and
-     * scaled based on available space. If set to false, the diagram reserves its
-     * absolute width.
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| useMaxWidth | See Notes | Boolean | Required | true, false |
      *
-     * Default value: true
+     ***Notes:**
+     *When this flag is set to true, the diagram width is locked to 100% and
+     *scaled based on available space. If set to false, the diagram reserves its
+     *absolute width.
+     ***Default value: true**.
      */
     useMaxWidth: true
   },
@@ -108596,50 +108101,17 @@ var config = {
     useWidth: undefined,
 
     /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | useMaxWidth | See Notes | boolean | Required | true, false |
-     *
-     * **Notes:**
-     *
-     * When this flag is set to true, the diagram width is locked to 100% and
-     * scaled based on available space. If set to false, the diagram reserves its
-     * absolute width.
+     *| Parameter | Description |Type | Required | Values|
+     *| --- | --- | --- | --- | --- |
+     *| useMaxWidth | See Notes | Boolean | Required | true, false |
      *
-     * Default value: true
+     ***Notes:**
+     *When this flag is set to true, the diagram width is locked to 100% and
+     *scaled based on available space. If set to false, the diagram reserves its
+     *absolute width.
+     ***Default value: true**.
      */
     useMaxWidth: true
-  },
-
-  /**
-   * The object containing configurations specific for req diagrams
-   */
-  requirement: {
-    useWidth: undefined,
-
-    /**
-     * | Parameter | Description | Type | Required | Values |
-     * | --- | --- | --- | --- | --- |
-     * | useMaxWidth | See Notes | boolean | Required | true, false |
-     *
-     * **Notes:**
-     *
-     * When this flag is set to true, the diagram width is locked to 100% and
-     * scaled based on available space. If set to false, the diagram reserves its
-     * absolute width.
-     *
-     * Default value: true
-     */
-    useMaxWidth: true,
-    rect_fill: '#f9f9f9',
-    text_color: '#333',
-    rect_border_size: '0.5px',
-    rect_border_color: '#bbb',
-    rect_min_width: 200,
-    rect_min_height: 200,
-    fontSize: 14,
-    rect_padding: 10,
-    line_height: 20
   }
 };
 config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
@@ -108679,14 +108151,6 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js");
 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils */ "./src/utils.js");
 /* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js");
-function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
-
-function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
-
-function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
-
-function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
-
 
 
 
@@ -108770,7 +108234,7 @@ var getRelations = function getRelations() {
   return relations;
 };
 var addRelation = function addRelation(relation) {
-  _logger__WEBPACK_IMPORTED_MODULE_1__["log"].debug('Adding relation: ' + JSON.stringify(relation));
+  _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('Adding relation: ' + JSON.stringify(relation));
   addClass(relation.id1);
   addClass(relation.id2);
   relation.id1 = splitClassNameAndType(relation.id1).className;
@@ -108848,29 +108312,14 @@ var setCssClass = function setCssClass(ids, className) {
     }
   });
 };
-/**
- * Called by parser when a tooltip is found, e.g. a clickable element.
- * @param ids Comma separated list of ids
- * @param tooltip Tooltip to add
- */
-
-var setTooltip = function setTooltip(ids, tooltip) {
-  var config = _config__WEBPACK_IMPORTED_MODULE_2__["getConfig"]();
-  ids.split(',').forEach(function (id) {
-    if (typeof tooltip !== 'undefined') {
-      classes[id].tooltip = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(tooltip, config);
-    }
-  });
-};
 /**
  * Called by parser when a link is found. Adds the URL to the vertex data.
  * @param ids Comma separated list of ids
  * @param linkStr URL to create a link for
- * @param target Target of the link, _blank by default as originally defined in the svgDraw.js file
+ * @param tooltip Tooltip for the clickable element
  */
 
-
-var setLink = function setLink(ids, linkStr, target) {
+var setLink = function setLink(ids, linkStr, tooltip) {
   var config = _config__WEBPACK_IMPORTED_MODULE_2__["getConfig"]();
   ids.split(',').forEach(function (_id) {
     var id = _id;
@@ -108879,10 +108328,8 @@ var setLink = function setLink(ids, linkStr, target) {
     if (typeof classes[id] !== 'undefined') {
       classes[id].link = _utils__WEBPACK_IMPORTED_MODULE_4__["default"].formatUrl(linkStr, config);
 
-      if (typeof target === 'string') {
-        classes[id].linkTarget = target;
-      } else {
-        classes[id].linkTarget = '_blank';
+      if (tooltip) {
+        classes[id].tooltip = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(tooltip, config);
       }
     }
   });
@@ -108892,18 +108339,18 @@ var setLink = function setLink(ids, linkStr, target) {
  * Called by parser when a click definition is found. Registers an event handler.
  * @param ids Comma separated list of ids
  * @param functionName Function to be called on click
- * @param functionArgs Function args the function should be called with
+ * @param tooltip Tooltip for the clickable element
  */
 
-var setClickEvent = function setClickEvent(ids, functionName, functionArgs) {
+var setClickEvent = function setClickEvent(ids, functionName, tooltip) {
   ids.split(',').forEach(function (id) {
-    setClickFunc(id, functionName, functionArgs);
+    setClickFunc(id, functionName, tooltip);
     classes[id].haveCallback = true;
   });
   setCssClass(ids, 'clickable');
 };
 
-var setClickFunc = function setClickFunc(domId, functionName, functionArgs) {
+var setClickFunc = function setClickFunc(domId, functionName, tooltip) {
   var config = _config__WEBPACK_IMPORTED_MODULE_2__["getConfig"]();
   var id = domId;
   var elemId = lookUpDomId(id);
@@ -108917,30 +108364,8 @@ var setClickFunc = function setClickFunc(domId, functionName, functionArgs) {
   }
 
   if (typeof classes[id] !== 'undefined') {
-    var argList = [];
-
-    if (typeof functionArgs === 'string') {
-      /* Splits functionArgs by ',', ignoring all ',' in double quoted strings */
-      argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
-
-      for (var i = 0; i < argList.length; i++) {
-        var item = argList[i].trim();
-        /* Removes all double quotes at the start and end of an argument */
-
-        /* This preserves all starting and ending whitespace inside */
-
-        if (item.charAt(0) === '"' && item.charAt(item.length - 1) === '"') {
-          item = item.substr(1, item.length - 2);
-        }
-
-        argList[i] = item;
-      }
-    }
-    /* if no arguments passed into callback, default to passing in id */
-
-
-    if (argList.length === 0) {
-      argList.push(elemId);
+    if (tooltip) {
+      classes[id].tooltip = _common_common__WEBPACK_IMPORTED_MODULE_3__["default"].sanitizeText(tooltip, config);
     }
 
     funs.push(function () {
@@ -108948,7 +108373,7 @@ var setClickFunc = function setClickFunc(domId, functionName, functionArgs) {
 
       if (elem !== null) {
         elem.addEventListener('click', function () {
-          _utils__WEBPACK_IMPORTED_MODULE_4__["default"].runFunc.apply(_utils__WEBPACK_IMPORTED_MODULE_4__["default"], [functionName].concat(_toConsumableArray(argList)));
+          _utils__WEBPACK_IMPORTED_MODULE_4__["default"].runFunc(functionName, elemId);
         }, false);
       }
     });
@@ -109021,7 +108446,6 @@ funs.push(setupToolTips);
   setClickEvent: setClickEvent,
   setCssClass: setCssClass,
   setLink: setLink,
-  setTooltip: setTooltip,
   lookUpDomId: lookUpDomId
 });
 
@@ -109082,8 +108506,8 @@ var conf = {
 var addClasses = function addClasses(classes, g) {
   // const svg = select(`[id="${svgId}"]`);
   var keys = Object.keys(classes);
-  _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('keys:', keys);
-  _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info(classes); // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition
+  _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('keys:', keys);
+  _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info(classes); // Iterate through each item in the vertex object (containing all the vertices found) in the graph definition
 
   keys.forEach(function (id) {
     var vertex = classes[id];
@@ -109108,7 +108532,7 @@ var addClasses = function addClasses(classes, g) {
 
     var vertexText = vertex.text !== undefined ? vertex.text : vertex.id; // We create a SVG label, either by delegating to addHtmlLabel or manually
     // let vertexNode;
-    // if (evaluate(getConfig().flowchart.htmlLabels)) {
+    // if (getConfig().flowchart.htmlLabels) {
     //   const node = {
     //     label: vertexText.replace(
     //       /fa[lrsb]?:fa-[\w-]+/g,
@@ -109162,7 +108586,7 @@ var addClasses = function addClasses(classes, g) {
       type: vertex.type,
       padding: Object(_config__WEBPACK_IMPORTED_MODULE_7__["getConfig"])().flowchart.padding
     });
-    _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('setNode', {
+    _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('setNode', {
       labelStyle: styles.labelStyle,
       shape: _shape,
       labelText: vertexText,
@@ -109204,7 +108628,7 @@ var addRelations = function addRelations(relations, g) {
       edgeData.arrowhead = 'normal';
     }
 
-    _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info(edgeData, edge); //Set edge extra labels
+    _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info(edgeData, edge); //Set edge extra labels
     //edgeData.startLabelLeft = edge.relationTitle1;
 
     edgeData.startLabelRight = edge.relationTitle1 === 'none' ? '' : edge.relationTitle1;
@@ -109294,7 +108718,7 @@ var drawOld = function drawOld(text, id) {
   idCache = {};
   _parser_classDiagram__WEBPACK_IMPORTED_MODULE_5__["parser"].yy.clear();
   _parser_classDiagram__WEBPACK_IMPORTED_MODULE_5__["parser"].parse(text);
-  _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('Rendering diagram ' + text); // Fetch the default direction, use TD if none was found
+  _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Rendering diagram ' + text); // Fetch the default direction, use TD if none was found
 
   var diagram = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])("[id='".concat(id, "']")); // insertMarkers(diagram);
   // Layout graph, Create a new directed graph
@@ -109311,8 +108735,8 @@ var drawOld = function drawOld(text, id) {
     return {};
   });
   var classes = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getClasses();
-  _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('classes:');
-  _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info(classes);
+  _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('classes:');
+  _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info(classes);
   var keys = Object.keys(classes);
 
   for (var i = 0; i < keys.length; i++) {
@@ -109323,13 +108747,13 @@ var drawOld = function drawOld(text, id) {
     // our nodes.
 
     g.setNode(node.id, node);
-    _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('Org height: ' + node.height);
+    _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Org height: ' + node.height);
   }
 
   var relations = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getRelations();
-  _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('relations:', relations);
+  _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('relations:', relations);
   relations.forEach(function (relation) {
-    _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('tjoho' + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation));
+    _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('tjoho' + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation));
     g.setEdge(getGraphId(relation.id1), getGraphId(relation.id2), {
       relation: relation
     }, relation.title || 'DEFAULT');
@@ -109337,13 +108761,13 @@ var drawOld = function drawOld(text, id) {
   dagre__WEBPACK_IMPORTED_MODULE_1___default.a.layout(g);
   g.nodes().forEach(function (v) {
     if (typeof v !== 'undefined' && typeof g.node(v) !== 'undefined') {
-      _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Node ' + v + ': ' + JSON.stringify(g.node(v)));
+      _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Node ' + v + ': ' + JSON.stringify(g.node(v)));
       Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + Object(_classDb__WEBPACK_IMPORTED_MODULE_4__["lookUpDomId"])(v)).attr('transform', 'translate(' + (g.node(v).x - g.node(v).width / 2) + ',' + (g.node(v).y - g.node(v).height / 2) + ' )');
     }
   });
   g.edges().forEach(function (e) {
     if (typeof e !== 'undefined' && typeof g.edge(e) !== 'undefined') {
-      _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(g.edge(e)));
+      _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(g.edge(e)));
       _svgDraw__WEBPACK_IMPORTED_MODULE_6__["default"].drawEdge(diagram, g.edge(e), g.edge(e).relation, conf);
     }
   });
@@ -109353,24 +108777,24 @@ var drawOld = function drawOld(text, id) {
   Object(_utils__WEBPACK_IMPORTED_MODULE_9__["configureSvgSize"])(diagram, height, width, conf.useMaxWidth); // Ensure the viewBox includes the whole svgBounds area with extra space for padding
 
   var vBox = "".concat(svgBounds.x - padding, " ").concat(svgBounds.y - padding, " ").concat(width, " ").concat(height);
-  _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug("viewBox ".concat(vBox));
+  _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug("viewBox ".concat(vBox));
   diagram.attr('viewBox', vBox);
 };
 var draw = function draw(text, id) {
-  _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('Drawing class');
+  _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Drawing class');
   _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].clear(); // const parser = classDb.parser;
   // parser.yy = classDb;
   // Parse the graph definition
   // try {
 
   _parser_classDiagram__WEBPACK_IMPORTED_MODULE_5__["parser"].parse(text); // } catch (err) {
-  // log.debug('Parsing failed');
+  // logger.debug('Parsing failed');
   // }
   // Fetch the default direction, use TD if none was found
 
   var dir = 'TD';
   var conf = Object(_config__WEBPACK_IMPORTED_MODULE_7__["getConfig"])().flowchart;
-  _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('config:', conf);
+  _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('config:', conf);
   var nodeSpacing = conf.nodeSpacing || 50;
   var rankSpacing = conf.rankSpacing || 50; // Create the input mermaid.graph
 
@@ -109387,17 +108811,17 @@ var draw = function draw(text, id) {
     return {};
   }); // let subG;
   // const subGraphs = flowDb.getSubGraphs();
-  // log.info('Subgraphs - ', subGraphs);
+  // logger.info('Subgraphs - ', subGraphs);
   // for (let i = subGraphs.length - 1; i >= 0; i--) {
   //   subG = subGraphs[i];
-  //   log.info('Subgraph - ', subG);
+  //   logger.info('Subgraph - ', subG);
   //   flowDb.addVertex(subG.id, subG.title, 'group', undefined, subG.classes);
   // }
   // Fetch the verices/nodes and edges/links from the parsed graph definition
 
   var classes = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getClasses();
   var relations = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getRelations();
-  _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info(relations); // let i = 0;
+  _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info(relations); // let i = 0;
   // for (i = subGraphs.length - 1; i >= 0; i--) {
   //   subG = subGraphs[i];
   //   selectAll('cluster').append('text');
@@ -109423,7 +108847,7 @@ var draw = function draw(text, id) {
   var svgBounds = svg.node().getBBox();
   var width = svgBounds.width + padding * 2;
   var height = svgBounds.height + padding * 2;
-  _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug("new ViewBox 0 0 ".concat(width, " ").concat(height), "translate(".concat(padding - g._label.marginx, ", ").concat(padding - g._label.marginy, ")"));
+  _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug("new ViewBox 0 0 ".concat(width, " ").concat(height), "translate(".concat(padding - g._label.marginx, ", ").concat(padding - g._label.marginy, ")"));
   Object(_utils__WEBPACK_IMPORTED_MODULE_9__["configureSvgSize"])(svg, height, width, conf.useMaxWidth);
   svg.attr('viewBox', "0 0 ".concat(width, " ").concat(height));
   svg.select('g').attr('transform', "translate(".concat(padding - g._label.marginx, ", ").concat(padding - svgBounds.y, ")")); // Index nodes
@@ -109590,7 +109014,7 @@ var draw = function draw(text, id) {
   idCache = {};
   _parser_classDiagram__WEBPACK_IMPORTED_MODULE_5__["parser"].yy.clear();
   _parser_classDiagram__WEBPACK_IMPORTED_MODULE_5__["parser"].parse(text);
-  _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('Rendering diagram ' + text); // Fetch the default direction, use TD if none was found
+  _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Rendering diagram ' + text); // Fetch the default direction, use TD if none was found
 
   var diagram = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])("[id='".concat(id, "']"));
   diagram.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink');
@@ -109618,12 +109042,12 @@ var draw = function draw(text, id) {
     // our nodes.
 
     g.setNode(node.id, node);
-    _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('Org height: ' + node.height);
+    _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Org height: ' + node.height);
   }
 
   var relations = _classDb__WEBPACK_IMPORTED_MODULE_4__["default"].getRelations();
   relations.forEach(function (relation) {
-    _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('tjoho' + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation));
+    _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('tjoho' + getGraphId(relation.id1) + getGraphId(relation.id2) + JSON.stringify(relation));
     g.setEdge(getGraphId(relation.id1), getGraphId(relation.id2), {
       relation: relation
     }, relation.title || 'DEFAULT');
@@ -109631,13 +109055,13 @@ var draw = function draw(text, id) {
   dagre__WEBPACK_IMPORTED_MODULE_1___default.a.layout(g);
   g.nodes().forEach(function (v) {
     if (typeof v !== 'undefined' && typeof g.node(v) !== 'undefined') {
-      _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Node ' + v + ': ' + JSON.stringify(g.node(v)));
+      _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Node ' + v + ': ' + JSON.stringify(g.node(v)));
       Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + Object(_classDb__WEBPACK_IMPORTED_MODULE_4__["lookUpDomId"])(v)).attr('transform', 'translate(' + (g.node(v).x - g.node(v).width / 2) + ',' + (g.node(v).y - g.node(v).height / 2) + ' )');
     }
   });
   g.edges().forEach(function (e) {
     if (typeof e !== 'undefined' && typeof g.edge(e) !== 'undefined') {
-      _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(g.edge(e)));
+      _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(g.edge(e)));
       _svgDraw__WEBPACK_IMPORTED_MODULE_6__["default"].drawEdge(diagram, g.edge(e), g.edge(e).relation, conf);
     }
   });
@@ -109647,7 +109071,7 @@ var draw = function draw(text, id) {
   Object(_utils__WEBPACK_IMPORTED_MODULE_7__["configureSvgSize"])(diagram, height, width, conf.useMaxWidth); // Ensure the viewBox includes the whole svgBounds area with extra space for padding
 
   var vBox = "".concat(svgBounds.x - padding, " ").concat(svgBounds.y - padding, " ").concat(width, " ").concat(height);
-  _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug("viewBox ".concat(vBox));
+  _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug("viewBox ".concat(vBox));
   diagram.attr('viewBox', vBox);
 };
 /* harmony default export */ __webpack_exports__["default"] = ({
@@ -109738,12 +109162,12 @@ var draw = function draw(text, id) {
   }
 */
 var parser = (function(){
-var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,7],$V1=[1,6],$V2=[1,14],$V3=[1,25],$V4=[1,28],$V5=[1,26],$V6=[1,27],$V7=[1,29],$V8=[1,30],$V9=[1,31],$Va=[1,32],$Vb=[1,35],$Vc=[1,36],$Vd=[1,37],$Ve=[1,38],$Vf=[10,19],$Vg=[1,50],$Vh=[1,51],$Vi=[1,52],$Vj=[1,53],$Vk=[1,54],$Vl=[1,55],$Vm=[10,19,26,33,34,42,45,46,47,48,49,50,55,57],$Vn=[10,19,24,26,33,34,38,42,45,46,47,48,49,50,55,57,72,73,74,75],$Vo=[10,13,17,19],$Vp=[42,72,73,74,75],$Vq=[42,49,50,72,73,74,75],$Vr=[42,45,46,47,48,72,73,74,75],$Vs=[10,19,26],$Vt=[1,87];
+var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,7],$V1=[1,6],$V2=[1,14],$V3=[1,25],$V4=[1,28],$V5=[1,26],$V6=[1,27],$V7=[1,29],$V8=[1,30],$V9=[1,31],$Va=[1,33],$Vb=[1,34],$Vc=[1,35],$Vd=[10,19],$Ve=[1,47],$Vf=[1,48],$Vg=[1,49],$Vh=[1,50],$Vi=[1,51],$Vj=[1,52],$Vk=[10,19,25,32,33,41,44,45,46,47,48,49],$Vl=[10,19,23,25,32,33,37,41,44,45,46,47,48,49,66,67,68],$Vm=[10,13,17,19],$Vn=[41,66,67,68],$Vo=[41,48,49,66,67,68],$Vp=[41,44,45,46,47,66,67,68],$Vq=[10,19,25],$Vr=[1,81];
 var parser = {trace: function trace () { },
 yy: {},
-symbols_: {"error":2,"start":3,"mermaidDoc":4,"directive":5,"graphConfig":6,"openDirective":7,"typeDirective":8,"closeDirective":9,"NEWLINE":10,":":11,"argDirective":12,"open_directive":13,"type_directive":14,"arg_directive":15,"close_directive":16,"CLASS_DIAGRAM":17,"statements":18,"EOF":19,"statement":20,"className":21,"alphaNumToken":22,"classLiteralName":23,"GENERICTYPE":24,"relationStatement":25,"LABEL":26,"classStatement":27,"methodStatement":28,"annotationStatement":29,"clickStatement":30,"cssClassStatement":31,"CLASS":32,"STYLE_SEPARATOR":33,"STRUCT_START":34,"members":35,"STRUCT_STOP":36,"ANNOTATION_START":37,"ANNOTATION_END":38,"MEMBER":39,"SEPARATOR":40,"relation":41,"STR":42,"relationType":43,"lineType":44,"AGGREGATION":45,"EXTENSION":46,"COMPOSITION":47,"DEPENDENCY":48,"LINE":49,"DOTTED_LINE":50,"CALLBACK":51,"LINK":52,"LINK_TARGET":53,"CLICK":54,"CALLBACK_NAME":55,"CALLBACK_ARGS":56,"HREF":57,"CSSCLASS":58,"commentToken":59,"textToken":60,"graphCodeTokens":61,"textNoTagsToken":62,"TAGSTART":63,"TAGEND":64,"==":65,"--":66,"PCT":67,"DEFAULT":68,"SPACE":69,"MINUS":70,"keywords":71,"UNICODE_TEXT":72,"NUM":73,"ALPHA":74,"BQUOTE_STR":75,"$accept":0,"$end":1},
-terminals_: {2:"error",10:"NEWLINE",11:":",13:"open_directive",14:"type_directive",15:"arg_directive",16:"close_directive",17:"CLASS_DIAGRAM",19:"EOF",24:"GENERICTYPE",26:"LABEL",32:"CLASS",33:"STYLE_SEPARATOR",34:"STRUCT_START",36:"STRUCT_STOP",37:"ANNOTATION_START",38:"ANNOTATION_END",39:"MEMBER",40:"SEPARATOR",42:"STR",45:"AGGREGATION",46:"EXTENSION",47:"COMPOSITION",48:"DEPENDENCY",49:"LINE",50:"DOTTED_LINE",51:"CALLBACK",52:"LINK",53:"LINK_TARGET",54:"CLICK",55:"CALLBACK_NAME",56:"CALLBACK_ARGS",57:"HREF",58:"CSSCLASS",61:"graphCodeTokens",63:"TAGSTART",64:"TAGEND",65:"==",66:"--",67:"PCT",68:"DEFAULT",69:"SPACE",70:"MINUS",71:"keywords",72:"UNICODE_TEXT",73:"NUM",74:"ALPHA",75:"BQUOTE_STR"},
-productions_: [0,[3,1],[3,2],[4,1],[5,4],[5,6],[7,1],[8,1],[12,1],[9,1],[6,4],[18,1],[18,2],[18,3],[21,1],[21,1],[21,2],[21,2],[21,2],[20,1],[20,2],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[27,2],[27,4],[27,5],[27,7],[29,4],[35,1],[35,2],[28,1],[28,2],[28,1],[28,1],[25,3],[25,4],[25,4],[25,5],[41,3],[41,2],[41,2],[41,1],[43,1],[43,1],[43,1],[43,1],[44,1],[44,1],[30,3],[30,4],[30,3],[30,4],[30,4],[30,5],[30,3],[30,4],[30,4],[30,5],[30,3],[30,4],[30,4],[30,5],[31,3],[59,1],[59,1],[60,1],[60,1],[60,1],[60,1],[60,1],[60,1],[60,1],[62,1],[62,1],[62,1],[62,1],[22,1],[22,1],[22,1],[23,1]],
+symbols_: {"error":2,"start":3,"mermaidDoc":4,"directive":5,"graphConfig":6,"openDirective":7,"typeDirective":8,"closeDirective":9,"NEWLINE":10,":":11,"argDirective":12,"open_directive":13,"type_directive":14,"arg_directive":15,"close_directive":16,"CLASS_DIAGRAM":17,"statements":18,"EOF":19,"statement":20,"className":21,"alphaNumToken":22,"GENERICTYPE":23,"relationStatement":24,"LABEL":25,"classStatement":26,"methodStatement":27,"annotationStatement":28,"clickStatement":29,"cssClassStatement":30,"CLASS":31,"STYLE_SEPARATOR":32,"STRUCT_START":33,"members":34,"STRUCT_STOP":35,"ANNOTATION_START":36,"ANNOTATION_END":37,"MEMBER":38,"SEPARATOR":39,"relation":40,"STR":41,"relationType":42,"lineType":43,"AGGREGATION":44,"EXTENSION":45,"COMPOSITION":46,"DEPENDENCY":47,"LINE":48,"DOTTED_LINE":49,"CALLBACK":50,"LINK":51,"CSSCLASS":52,"commentToken":53,"textToken":54,"graphCodeTokens":55,"textNoTagsToken":56,"TAGSTART":57,"TAGEND":58,"==":59,"--":60,"PCT":61,"DEFAULT":62,"SPACE":63,"MINUS":64,"keywords":65,"UNICODE_TEXT":66,"NUM":67,"ALPHA":68,"$accept":0,"$end":1},
+terminals_: {2:"error",10:"NEWLINE",11:":",13:"open_directive",14:"type_directive",15:"arg_directive",16:"close_directive",17:"CLASS_DIAGRAM",19:"EOF",23:"GENERICTYPE",25:"LABEL",31:"CLASS",32:"STYLE_SEPARATOR",33:"STRUCT_START",35:"STRUCT_STOP",36:"ANNOTATION_START",37:"ANNOTATION_END",38:"MEMBER",39:"SEPARATOR",41:"STR",44:"AGGREGATION",45:"EXTENSION",46:"COMPOSITION",47:"DEPENDENCY",48:"LINE",49:"DOTTED_LINE",50:"CALLBACK",51:"LINK",52:"CSSCLASS",55:"graphCodeTokens",57:"TAGSTART",58:"TAGEND",59:"==",60:"--",61:"PCT",62:"DEFAULT",63:"SPACE",64:"MINUS",65:"keywords",66:"UNICODE_TEXT",67:"NUM",68:"ALPHA"},
+productions_: [0,[3,1],[3,2],[4,1],[5,4],[5,6],[7,1],[8,1],[12,1],[9,1],[6,4],[18,1],[18,2],[18,3],[21,1],[21,2],[21,3],[21,2],[20,1],[20,2],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[26,2],[26,4],[26,5],[26,7],[28,4],[34,1],[34,2],[27,1],[27,2],[27,1],[27,1],[24,3],[24,4],[24,4],[24,5],[40,3],[40,2],[40,2],[40,1],[42,1],[42,1],[42,1],[42,1],[43,1],[43,1],[29,3],[29,4],[29,3],[29,4],[30,3],[53,1],[53,1],[54,1],[54,1],[54,1],[54,1],[54,1],[54,1],[54,1],[56,1],[56,1],[56,1],[56,1],[22,1],[22,1],[22,1]],
 performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
 /* this == yyval */
 
@@ -109761,130 +109185,118 @@ break;
 case 9:
  yy.parseDirective('}%%', 'close_directive', 'class'); 
 break;
-case 14: case 15:
+case 14:
  this.$=$$[$0]; 
 break;
-case 16:
+case 15:
  this.$=$$[$0-1]+$$[$0]; 
 break;
-case 17: case 18:
+case 16:
+ this.$=$$[$0-2]+'~'+$$[$0-1]+$$[$0]; 
+break;
+case 17:
  this.$=$$[$0-1]+'~'+$$[$0]; 
 break;
-case 19:
+case 18:
  yy.addRelation($$[$0]); 
 break;
-case 20:
+case 19:
  $$[$0-1].title =  yy.cleanupLabel($$[$0]); yy.addRelation($$[$0-1]);        
 break;
-case 27:
+case 26:
 yy.addClass($$[$0]);
 break;
-case 28:
+case 27:
 yy.addClass($$[$0-2]);yy.setCssClass($$[$0-2], $$[$0]);
 break;
-case 29:
+case 28:
 /*console.log($$[$0-3],JSON.stringify($$[$0-1]));*/yy.addClass($$[$0-3]);yy.addMembers($$[$0-3],$$[$0-1]);
 break;
-case 30:
+case 29:
 yy.addClass($$[$0-5]);yy.setCssClass($$[$0-5], $$[$0-3]);yy.addMembers($$[$0-5],$$[$0-1]);
 break;
-case 31:
+case 30:
  yy.addAnnotation($$[$0],$$[$0-2]); 
 break;
-case 32:
+case 31:
  this.$ = [$$[$0]]; 
 break;
-case 33:
+case 32:
  $$[$0].push($$[$0-1]);this.$=$$[$0];
 break;
-case 34:
+case 33:
 /*console.log('Rel found',$$[$0]);*/
 break;
-case 35:
+case 34:
 yy.addMember($$[$0-1],yy.cleanupLabel($$[$0]));
 break;
-case 36:
+case 35:
 /*console.warn('Member',$$[$0]);*/
 break;
-case 37:
+case 36:
 /*console.log('sep found',$$[$0]);*/
 break;
-case 38:
+case 37:
  this.$ = {'id1':$$[$0-2],'id2':$$[$0], relation:$$[$0-1], relationTitle1:'none', relationTitle2:'none'}; 
 break;
-case 39:
+case 38:
  this.$ = {id1:$$[$0-3], id2:$$[$0], relation:$$[$0-1], relationTitle1:$$[$0-2], relationTitle2:'none'};
 break;
-case 40:
+case 39:
  this.$ = {id1:$$[$0-3], id2:$$[$0], relation:$$[$0-2], relationTitle1:'none', relationTitle2:$$[$0-1]}; 
 break;
-case 41:
+case 40:
  this.$ = {id1:$$[$0-4], id2:$$[$0], relation:$$[$0-2], relationTitle1:$$[$0-3], relationTitle2:$$[$0-1]}; 
 break;
-case 42:
+case 41:
  this.$={type1:$$[$0-2],type2:$$[$0],lineType:$$[$0-1]}; 
 break;
-case 43:
+case 42:
  this.$={type1:'none',type2:$$[$0],lineType:$$[$0-1]}; 
 break;
-case 44:
+case 43:
  this.$={type1:$$[$0-1],type2:'none',lineType:$$[$0]}; 
 break;
-case 45:
+case 44:
  this.$={type1:'none',type2:'none',lineType:$$[$0]}; 
 break;
-case 46:
+case 45:
  this.$=yy.relationType.AGGREGATION;
 break;
-case 47:
+case 46:
  this.$=yy.relationType.EXTENSION;
 break;
-case 48:
+case 47:
  this.$=yy.relationType.COMPOSITION;
 break;
-case 49:
+case 48:
  this.$=yy.relationType.DEPENDENCY;
 break;
-case 50:
+case 49:
 this.$=yy.lineType.LINE;
 break;
-case 51:
+case 50:
 this.$=yy.lineType.DOTTED_LINE;
 break;
-case 52: case 58:
-this.$ = $$[$0-2];yy.setClickEvent($$[$0-1], $$[$0]);
-break;
-case 53: case 59:
-this.$ = $$[$0-3];yy.setClickEvent($$[$0-2], $$[$0-1]);yy.setTooltip($$[$0-2], $$[$0]);
-break;
-case 54: case 62:
-this.$ = $$[$0-2];yy.setLink($$[$0-1], $$[$0]);
-break;
-case 55:
-this.$ = $$[$0-3];yy.setLink($$[$0-2], $$[$0-1],$$[$0]);
-break;
-case 56: case 64:
-this.$ = $$[$0-3];yy.setLink($$[$0-2], $$[$0-1]);yy.setTooltip($$[$0-2], $$[$0]);
-break;
-case 57: case 65:
-this.$ = $$[$0-4];yy.setLink($$[$0-3], $$[$0-2], $$[$0]);yy.setTooltip($$[$0-3], $$[$0-1]);
+case 51:
+this.$ = $$[$0-2];yy.setClickEvent($$[$0-1], $$[$0], undefined);
 break;
-case 60:
+case 52:
 this.$ = $$[$0-3];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]);
 break;
-case 61:
-this.$ = $$[$0-4];yy.setClickEvent($$[$0-3], $$[$0-2], $$[$0-1]);yy.setTooltip($$[$0-3], $$[$0]);
+case 53:
+this.$ = $$[$0-2];yy.setLink($$[$0-1], $$[$0], undefined);
 break;
-case 63:
+case 54:
 this.$ = $$[$0-3];yy.setLink($$[$0-2], $$[$0-1], $$[$0]);
 break;
-case 66:
+case 55:
 yy.setCssClass($$[$0-1], $$[$0]);
 break;
 }
 },
-table: [{3:1,4:2,5:3,6:4,7:5,13:$V0,17:$V1},{1:[3]},{1:[2,1]},{3:8,4:2,5:3,6:4,7:5,13:$V0,17:$V1},{1:[2,3]},{8:9,14:[1,10]},{10:[1,11]},{14:[2,6]},{1:[2,2]},{9:12,11:[1,13],16:$V2},o([11,16],[2,7]),{5:23,7:5,13:$V0,18:15,20:16,21:24,22:33,23:34,25:17,27:18,28:19,29:20,30:21,31:22,32:$V3,37:$V4,39:$V5,40:$V6,51:$V7,52:$V8,54:$V9,58:$Va,72:$Vb,73:$Vc,74:$Vd,75:$Ve},{10:[1,39]},{12:40,15:[1,41]},{10:[2,9]},{19:[1,42]},{10:[1,43],19:[2,11]},o($Vf,[2,19],{26:[1,44]}),o($Vf,[2,21]),o($Vf,[2,22]),o($Vf,[2,23]),o($Vf,[2,24]),o($Vf,[2,25]),o($Vf,[2,26]),o($Vf,[2,34],{41:45,43:48,44:49,26:[1,47],42:[1,46],45:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl}),{21:56,22:33,23:34,72:$Vb,73:$Vc,74:$Vd,75:$Ve},o($Vf,[2,36]),o($Vf,[2,37]),{22:57,72:$Vb,73:$Vc,74:$Vd},{21:58,22:33,23:34,72:$Vb,73:$Vc,74:$Vd,75:$Ve},{21:59,22:33,23:34,72:$Vb,73:$Vc,74:$Vd,75:$Ve},{21:60,22:33,23:34,72:$Vb,73:$Vc,74:$Vd,75:$Ve},{42:[1,61]},o($Vm,[2,14],{22:33,23:34,21:62,24:[1,63],72:$Vb,73:$Vc,74:$Vd,75:$Ve}),o($Vm,[2,15],{24:[1,64]}),o($Vn,[2,80]),o($Vn,[2,81]),o($Vn,[2,82]),o([10,19,24,26,33,34,42,45,46,47,48,49,50,55,57],[2,83]),o($Vo,[2,4]),{9:65,16:$V2},{16:[2,8]},{1:[2,10]},{5:23,7:5,13:$V0,18:66,19:[2,12],20:16,21:24,22:33,23:34,25:17,27:18,28:19,29:20,30:21,31:22,32:$V3,37:$V4,39:$V5,40:$V6,51:$V7,52:$V8,54:$V9,58:$Va,72:$Vb,73:$Vc,74:$Vd,75:$Ve},o($Vf,[2,20]),{21:67,22:33,23:34,42:[1,68],72:$Vb,73:$Vc,74:$Vd,75:$Ve},{41:69,43:48,44:49,45:$Vg,46:$Vh,47:$Vi,48:$Vj,49:$Vk,50:$Vl},o($Vf,[2,35]),{44:70,49:$Vk,50:$Vl},o($Vp,[2,45],{43:71,45:$Vg,46:$Vh,47:$Vi,48:$Vj}),o($Vq,[2,46]),o($Vq,[2,47]),o($Vq,[2,48]),o($Vq,[2,49]),o($Vr,[2,50]),o($Vr,[2,51]),o($Vf,[2,27],{33:[1,72],34:[1,73]}),{38:[1,74]},{42:[1,75]},{42:[1,76]},{55:[1,77],57:[1,78]},{22:79,72:$Vb,73:$Vc,74:$Vd},o($Vm,[2,16]),o($Vm,[2,17]),o($Vm,[2,18]),{10:[1,80]},{19:[2,13]},o($Vs,[2,38]),{21:81,22:33,23:34,72:$Vb,73:$Vc,74:$Vd,75:$Ve},{21:82,22:33,23:34,42:[1,83],72:$Vb,73:$Vc,74:$Vd,75:$Ve},o($Vp,[2,44],{43:84,45:$Vg,46:$Vh,47:$Vi,48:$Vj}),o($Vp,[2,43]),{22:85,72:$Vb,73:$Vc,74:$Vd},{35:86,39:$Vt},{21:88,22:33,23:34,72:$Vb,73:$Vc,74:$Vd,75:$Ve},o($Vf,[2,52],{42:[1,89]}),o($Vf,[2,54],{42:[1,91],53:[1,90]}),o($Vf,[2,58],{42:[1,92],56:[1,93]}),o($Vf,[2,62],{42:[1,95],53:[1,94]}),o($Vf,[2,66]),o($Vo,[2,5]),o($Vs,[2,40]),o($Vs,[2,39]),{21:96,22:33,23:34,72:$Vb,73:$Vc,74:$Vd,75:$Ve},o($Vp,[2,42]),o($Vf,[2,28],{34:[1,97]}),{36:[1,98]},{35:99,36:[2,32],39:$Vt},o($Vf,[2,31]),o($Vf,[2,53]),o($Vf,[2,55]),o($Vf,[2,56],{53:[1,100]}),o($Vf,[2,59]),o($Vf,[2,60],{42:[1,101]}),o($Vf,[2,63]),o($Vf,[2,64],{53:[1,102]}),o($Vs,[2,41]),{35:103,39:$Vt},o($Vf,[2,29]),{36:[2,33]},o($Vf,[2,57]),o($Vf,[2,61]),o($Vf,[2,65]),{36:[1,104]},o($Vf,[2,30])],
-defaultActions: {2:[2,1],4:[2,3],7:[2,6],8:[2,2],14:[2,9],41:[2,8],42:[2,10],66:[2,13],99:[2,33]},
+table: [{3:1,4:2,5:3,6:4,7:5,13:$V0,17:$V1},{1:[3]},{1:[2,1]},{3:8,4:2,5:3,6:4,7:5,13:$V0,17:$V1},{1:[2,3]},{8:9,14:[1,10]},{10:[1,11]},{14:[2,6]},{1:[2,2]},{9:12,11:[1,13],16:$V2},o([11,16],[2,7]),{5:23,7:5,13:$V0,18:15,20:16,21:24,22:32,24:17,26:18,27:19,28:20,29:21,30:22,31:$V3,36:$V4,38:$V5,39:$V6,50:$V7,51:$V8,52:$V9,66:$Va,67:$Vb,68:$Vc},{10:[1,36]},{12:37,15:[1,38]},{10:[2,9]},{19:[1,39]},{10:[1,40],19:[2,11]},o($Vd,[2,18],{25:[1,41]}),o($Vd,[2,20]),o($Vd,[2,21]),o($Vd,[2,22]),o($Vd,[2,23]),o($Vd,[2,24]),o($Vd,[2,25]),o($Vd,[2,33],{40:42,42:45,43:46,25:[1,44],41:[1,43],44:$Ve,45:$Vf,46:$Vg,47:$Vh,48:$Vi,49:$Vj}),{21:53,22:32,66:$Va,67:$Vb,68:$Vc},o($Vd,[2,35]),o($Vd,[2,36]),{22:54,66:$Va,67:$Vb,68:$Vc},{21:55,22:32,66:$Va,67:$Vb,68:$Vc},{21:56,22:32,66:$Va,67:$Vb,68:$Vc},{41:[1,57]},o($Vk,[2,14],{22:32,21:58,23:[1,59],66:$Va,67:$Vb,68:$Vc}),o($Vl,[2,69]),o($Vl,[2,70]),o($Vl,[2,71]),o($Vm,[2,4]),{9:60,16:$V2},{16:[2,8]},{1:[2,10]},{5:23,7:5,13:$V0,18:61,19:[2,12],20:16,21:24,22:32,24:17,26:18,27:19,28:20,29:21,30:22,31:$V3,36:$V4,38:$V5,39:$V6,50:$V7,51:$V8,52:$V9,66:$Va,67:$Vb,68:$Vc},o($Vd,[2,19]),{21:62,22:32,41:[1,63],66:$Va,67:$Vb,68:$Vc},{40:64,42:45,43:46,44:$Ve,45:$Vf,46:$Vg,47:$Vh,48:$Vi,49:$Vj},o($Vd,[2,34]),{43:65,48:$Vi,49:$Vj},o($Vn,[2,44],{42:66,44:$Ve,45:$Vf,46:$Vg,47:$Vh}),o($Vo,[2,45]),o($Vo,[2,46]),o($Vo,[2,47]),o($Vo,[2,48]),o($Vp,[2,49]),o($Vp,[2,50]),o($Vd,[2,26],{32:[1,67],33:[1,68]}),{37:[1,69]},{41:[1,70]},{41:[1,71]},{22:72,66:$Va,67:$Vb,68:$Vc},o($Vk,[2,15]),o($Vk,[2,17],{22:32,21:73,66:$Va,67:$Vb,68:$Vc}),{10:[1,74]},{19:[2,13]},o($Vq,[2,37]),{21:75,22:32,66:$Va,67:$Vb,68:$Vc},{21:76,22:32,41:[1,77],66:$Va,67:$Vb,68:$Vc},o($Vn,[2,43],{42:78,44:$Ve,45:$Vf,46:$Vg,47:$Vh}),o($Vn,[2,42]),{22:79,66:$Va,67:$Vb,68:$Vc},{34:80,38:$Vr},{21:82,22:32,66:$Va,67:$Vb,68:$Vc},o($Vd,[2,51],{41:[1,83]}),o($Vd,[2,53],{41:[1,84]}),o($Vd,[2,55]),o($Vk,[2,16]),o($Vm,[2,5]),o($Vq,[2,39]),o($Vq,[2,38]),{21:85,22:32,66:$Va,67:$Vb,68:$Vc},o($Vn,[2,41]),o($Vd,[2,27],{33:[1,86]}),{35:[1,87]},{34:88,35:[2,31],38:$Vr},o($Vd,[2,30]),o($Vd,[2,52]),o($Vd,[2,54]),o($Vq,[2,40]),{34:89,38:$Vr},o($Vd,[2,28]),{35:[2,32]},{35:[1,90]},o($Vd,[2,29])],
+defaultActions: {2:[2,1],4:[2,3],7:[2,6],8:[2,2],14:[2,9],38:[2,8],39:[2,10],61:[2,13],88:[2,32]},
 parseError: function parseError (str, hash) {
     if (hash.recoverable) {
         this.trace(str);
@@ -110365,80 +109777,55 @@ case 8:/* skip whitespace */
 break;
 case 9:return 17;
 case 10:return 17;
-case 11: this.begin("struct"); /*console.log('Starting struct');*/ return 34;
+case 11: this.begin("struct"); /*console.log('Starting struct');*/ return 33;
 case 12:return "EOF_IN_STRUCT";
 case 13:return "OPEN_IN_STRUCT";
-case 14: /*console.log('Ending struct');*/this.popState(); return 36;
+case 14: /*console.log('Ending struct');*/this.popState(); return 35;
 case 15:/* nothing */
 break;
 case 16: /*console.log('lex-member: ' + yy_.yytext);*/  return "MEMBER";
-case 17:return 32;
-case 18:return 58;
-case 19:return 51;
-case 20:return 52;
-case 21:return 54;
+case 17:return 31;
+case 18:return 52;
+case 19:return 50;
+case 20:return 51;
+case 21:return 36;
 case 22:return 37;
-case 23:return 38;
-case 24:this.begin("generic");
-break;
-case 25:this.popState();
-break;
-case 26:return "GENERICTYPE";
-case 27:this.begin("string");
-break;
-case 28:this.popState();
+case 23:this.begin("generic");
 break;
-case 29:return "STR";
-case 30:this.begin("bqstring");
+case 24:this.popState();
 break;
-case 31:this.popState();
+case 25:return "GENERICTYPE";
+case 26:this.begin("string");
 break;
-case 32:return "BQUOTE_STR";
-case 33:this.begin("href");
+case 27:this.popState();
 break;
-case 34:this.popState();
-break;
-case 35:return 57;
-case 36:this.begin("callback_name");
-break;
-case 37:this.popState();
-break;
-case 38:this.popState(); this.begin("callback_args");
-break;
-case 39:return 55;
-case 40:this.popState();
-break;
-case 41:return 56;
-case 42:return 53;
-case 43:return 53;
-case 44:return 53;
-case 45:return 53;
-case 46:return 46;
-case 47:return 46;
-case 48:return 48;
-case 49:return 48;
-case 50:return 47;
-case 51:return 45;
-case 52:return 49;
-case 53:return 50;
-case 54:return 26;
-case 55:return 33;
-case 56:return 70;
-case 57:return 'DOT';
-case 58:return 'PLUS';
-case 59:return 67;
-case 60:return 'EQUALS';
-case 61:return 'EQUALS';
-case 62:return 74;
-case 63:return 'PUNCTUATION';
-case 64:return 73;
-case 65:return 72;
-case 66:return 69;
-case 67:return 19;
+case 28:return "STR";
+case 29:return 45;
+case 30:return 45;
+case 31:return 47;
+case 32:return 47;
+case 33:return 46;
+case 34:return 44;
+case 35:return 48;
+case 36:return 49;
+case 37:return 25;
+case 38:return 32;
+case 39:return 64;
+case 40:return 'DOT';
+case 41:return 'PLUS';
+case 42:return 61;
+case 43:return 'EQUALS';
+case 44:return 'EQUALS';
+case 45:return 68;
+case 46:return 'PUNCTUATION';
+case 47:return 67;
+case 48:return 66;
+case 49:return 63;
+case 50:return 19;
 }
 },
-rules: [/^(?:%%\{)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:[{])/,/^(?:$)/,/^(?:[{])/,/^(?:[}])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:class\b)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:click\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:[~])/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:[`])/,/^(?:[`])/,/^(?:[^`]+)/,/^(?:href[\s]+["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:$)/],
-conditions: {"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"callback_args":{"rules":[40,41],"inclusive":false},"callback_name":{"rules":[37,38,39],"inclusive":false},"href":{"rules":[34,35],"inclusive":false},"struct":{"rules":[12,13,14,15,16],"inclusive":false},"generic":{"rules":[25,26],"inclusive":false},"bqstring":{"rules":[31,32],"inclusive":false},"string":{"rules":[28,29],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,11,17,18,19,20,21,22,23,24,27,30,33,36,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67],"inclusive":true}}
+rules: [/^(?:%%\{)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:%%(?!\{)*[^\n]*(\r?\n?)+)/,/^(?:%%[^\n]*(\r?\n)*)/,/^(?:(\r?\n)+)/,/^(?:\s+)/,/^(?:classDiagram-v2\b)/,/^(?:classDiagram\b)/,/^(?:[{])/,/^(?:$)/,/^(?:[{])/,/^(?:[}])/,/^(?:[\n])/,/^(?:[^{}\n]*)/,/^(?:class\b)/,/^(?:cssClass\b)/,/^(?:callback\b)/,/^(?:link\b)/,/^(?:<<)/,/^(?:>>)/,/^(?:[~])/,/^(?:[~])/,/^(?:[^~]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:\s*<\|)/,/^(?:\s*\|>)/,/^(?:\s*>)/,/^(?:\s*<)/,/^(?:\s*\*)/,/^(?:\s*o\b)/,/^(?:--)/,/^(?:\.\.)/,/^(?::{1}[^:\n;]+)/,/^(?::{3})/,/^(?:-)/,/^(?:\.)/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:\w+)/,/^(?:[!"#$%&'*+,-.`?\\/])/,/^(?:[0-9]+)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\s)/,/^(?:$)/],
+conditions: {"string":{"rules":[27,28],"inclusive":false},"generic":{"rules":[24,25],"inclusive":false},"struct":{"rules":[12,13,14,15,16],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,11,17,18,19,20,21,22,23,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50],"inclusive":true}}
 });
 return lexer;
 })();
@@ -110566,8 +109953,8 @@ var drawEdge = function drawEdge(elem, path, relation, conf) {
   if (l % 2 !== 0 && l > 1) {
     var cardinality_1_point = _utils__WEBPACK_IMPORTED_MODULE_2__["default"].calcCardinalityPosition(relation.relation.type1 !== 'none', path.points, path.points[0]);
     var cardinality_2_point = _utils__WEBPACK_IMPORTED_MODULE_2__["default"].calcCardinalityPosition(relation.relation.type2 !== 'none', path.points, path.points[l - 1]);
-    _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('cardinality_1_point ' + JSON.stringify(cardinality_1_point));
-    _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('cardinality_2_point ' + JSON.stringify(cardinality_2_point));
+    _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('cardinality_1_point ' + JSON.stringify(cardinality_1_point));
+    _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('cardinality_2_point ' + JSON.stringify(cardinality_2_point));
     p1_card_x = cardinality_1_point.x;
     p1_card_y = cardinality_1_point.y;
     p2_card_x = cardinality_2_point.x;
@@ -110582,7 +109969,7 @@ var drawEdge = function drawEdge(elem, path, relation, conf) {
     g.insert('rect', ':first-child').attr('class', 'box').attr('x', bounds.x - conf.padding / 2).attr('y', bounds.y - conf.padding / 2).attr('width', bounds.width + conf.padding).attr('height', bounds.height + conf.padding);
   }
 
-  _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('Rendering relation ' + JSON.stringify(relation));
+  _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Rendering relation ' + JSON.stringify(relation));
 
   if (typeof relation.relationTitle1 !== 'undefined' && relation.relationTitle1 !== 'none') {
     var _g = elem.append('g').attr('class', 'cardinality');
@@ -110599,7 +109986,7 @@ var drawEdge = function drawEdge(elem, path, relation, conf) {
   edgeCount++;
 };
 var drawClass = function drawClass(elem, classDef, conf) {
-  _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('Rendering class ' + classDef);
+  _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('Rendering class ' + classDef);
   var id = classDef.id;
   var classInfo = {
     id: id,
@@ -110613,7 +110000,7 @@ var drawClass = function drawClass(elem, classDef, conf) {
   var title;
 
   if (classDef.link) {
-    title = g.append('svg:a').attr('xlink:href', classDef.link).attr('target', classDef.linkTarget).append('text').attr('y', conf.textHeight + conf.padding).attr('x', 0);
+    title = g.append('svg:a').attr('xlink:href', classDef.link).attr('target', '_blank').append('text').attr('y', conf.textHeight + conf.padding).attr('x', 0);
   } else {
     title = g.append('text').attr('y', conf.textHeight + conf.padding).attr('x', 0);
   } // add annotations
@@ -110832,7 +110219,7 @@ var parseClassifier = function parseClassifier(classifier) {
 /*!***************************************!*\
   !*** ./src/diagrams/common/common.js ***!
   \***************************************/
-/*! exports provided: getRows, removeScript, sanitizeText, lineBreakRegex, hasBreaks, splitBreaks, evaluate, default */
+/*! exports provided: getRows, removeScript, sanitizeText, lineBreakRegex, hasBreaks, splitBreaks, default */
 /***/ (function(module, __webpack_exports__, __webpack_require__) {
 __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRows", function() { return getRows; });
@@ -110841,7 +110228,6 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lineBreakRegex", function() { return lineBreakRegex; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "hasBreaks", function() { return hasBreaks; });
 /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "splitBreaks", function() { return splitBreaks; });
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "evaluate", function() { return evaluate; });
 var getRows = function getRows(s) {
   if (!s) return 1;
   var str = breakToPlaceholder(s);
@@ -110913,30 +110299,13 @@ var placeholderToBreak = function placeholderToBreak(s) {
   return s.replace(/#br#/g, '
'); }; -var getUrl = function getUrl(useAbsolute) { - var url = ''; - - if (useAbsolute) { - url = window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search; - url = url.replace(/\(/g, '\\('); - url = url.replace(/\)/g, '\\)'); - } - - return url; -}; - -var evaluate = function evaluate(val) { - return val === 'false' || val === false ? false : true; -}; /* harmony default export */ __webpack_exports__["default"] = ({ getRows: getRows, sanitizeText: sanitizeText, hasBreaks: hasBreaks, splitBreaks: splitBreaks, lineBreakRegex: lineBreakRegex, - removeScript: removeScript, - getUrl: getUrl, - evaluate: evaluate + removeScript: removeScript }); /***/ }), @@ -110980,7 +110349,7 @@ var addEntity = function addEntity(name) { entities[name] = { attributes: [] }; - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('Added new entity :', name); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('Added new entity :', name); } return entities[name]; @@ -110998,7 +110367,7 @@ var addAttributes = function addAttributes(entityName, attribs) { for (i = attribs.length - 1; i >= 0; i--) { entity.attributes.push(attribs[i]); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Added attribute ', attribs[i].attributeName); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Added attribute ', attribs[i].attributeName); } }; /** @@ -111018,7 +110387,7 @@ var addRelationship = function addRelationship(entA, rolA, entB, rSpec) { relSpec: rSpec }; relationships.push(rel); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Added new relationship :', rel); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Added new relationship :', rel); }; var getRelationships = function getRelationships() { @@ -111398,7 +110767,7 @@ var drawRelationshipFromLayout = function drawRelationshipFromLayout(svg, rel, g var draw = function draw(text, id) { - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].info('Drawing ER diagram'); + _logger__WEBPACK_IMPORTED_MODULE_6__["logger"].info('Drawing ER diagram'); _erDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear(); var parser = _parser_erDiagram__WEBPACK_IMPORTED_MODULE_3___default.a.parser; parser.yy = _erDb__WEBPACK_IMPORTED_MODULE_2__["default"]; // Parse the text to populate erDb @@ -111406,7 +110775,7 @@ var draw = function draw(text, id) { try { parser.parse(text); } catch (err) { - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].debug('Parsing failed'); + _logger__WEBPACK_IMPORTED_MODULE_6__["logger"].debug('Parsing failed'); } // Get a reference to the svg node that contains the text @@ -112646,14 +112015,6 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } -function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } - -function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } - -function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } - -function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } - @@ -112705,7 +112066,7 @@ var lookUpDomId = function lookUpDomId(id) { * @param classes */ -var addVertex = function addVertex(_id, text, type, style, classes, dir) { +var addVertex = function addVertex(_id, text, type, style, classes) { var txt; var id = _id; @@ -112763,10 +112124,6 @@ var addVertex = function addVertex(_id, text, type, style, classes, dir) { }); } } - - if (typeof dir !== 'undefined') { - vertices[id].dir = dir; - } }; /** * Function called by parser when a link/edge definition has been found @@ -112780,7 +112137,7 @@ var addSingleLink = function addSingleLink(_start, _end, type, linktext) { var start = _start; var end = _end; // if (start[0].match(/\d/)) start = MERMAID_DOM_ID_PREFIX + start; // if (end[0].match(/\d/)) end = MERMAID_DOM_ID_PREFIX + end; - // log.info('Got edge...', start, end); + // logger.info('Got edge...', start, end); var edge = { start: start, @@ -112925,7 +112282,7 @@ var setTooltip = function setTooltip(ids, tooltip) { }); }; -var setClickFun = function setClickFun(id, functionName, functionArgs) { +var setClickFun = function setClickFun(id, functionName) { var domId = lookUpDomId(id); // if (_id[0].match(/\d/)) id = MERMAID_DOM_ID_PREFIX + id; if (_config__WEBPACK_IMPORTED_MODULE_2__["getConfig"]().securityLevel !== 'loose') { @@ -112936,32 +112293,6 @@ var setClickFun = function setClickFun(id, functionName, functionArgs) { return; } - var argList = []; - - if (typeof functionArgs === 'string') { - /* Splits functionArgs by ',', ignoring all ',' in double quoted strings */ - argList = functionArgs.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/); - - for (var i = 0; i < argList.length; i++) { - var item = argList[i].trim(); - /* Removes all double quotes at the start and end of an argument */ - - /* This preserves all starting and ending whitespace inside */ - - if (item.charAt(0) === '"' && item.charAt(item.length - 1) === '"') { - item = item.substr(1, item.length - 2); - } - - argList[i] = item; - } - } - /* if no arguments passed into callback, default to passing in id */ - - - if (argList.length === 0) { - argList.push(id); - } - if (typeof vertices[id] !== 'undefined') { vertices[id].haveCallback = true; funs.push(function () { @@ -112969,7 +112300,7 @@ var setClickFun = function setClickFun(id, functionName, functionArgs) { if (elem !== null) { elem.addEventListener('click', function () { - _utils__WEBPACK_IMPORTED_MODULE_1__["default"].runFunc.apply(_utils__WEBPACK_IMPORTED_MODULE_1__["default"], [functionName].concat(_toConsumableArray(argList))); + _utils__WEBPACK_IMPORTED_MODULE_1__["default"].runFunc(functionName, id); }, false); } }); @@ -112979,16 +112310,18 @@ var setClickFun = function setClickFun(id, functionName, functionArgs) { * Called by parser when a link is found. Adds the URL to the vertex data. * @param ids Comma separated list of ids * @param linkStr URL to create a link for + * @param tooltip Tooltip for the clickable element */ -var setLink = function setLink(ids, linkStr, target) { +var setLink = function setLink(ids, linkStr, tooltip, target) { ids.split(',').forEach(function (id) { if (typeof vertices[id] !== 'undefined') { vertices[id].link = _utils__WEBPACK_IMPORTED_MODULE_1__["default"].formatUrl(linkStr, config); vertices[id].linkTarget = target; } }); + setTooltip(ids, tooltip); setClass(ids, 'clickable'); }; var getTooltip = function getTooltip(id) { @@ -113001,10 +112334,11 @@ var getTooltip = function getTooltip(id) { * @param tooltip Tooltip for the clickable element */ -var setClickEvent = function setClickEvent(ids, functionName, functionArgs) { +var setClickEvent = function setClickEvent(ids, functionName, tooltip) { ids.split(',').forEach(function (id) { - setClickFun(id, functionName, functionArgs); + setClickFun(id, functionName); }); + setTooltip(ids, tooltip); setClass(ids, 'clickable'); }; var bindFunctions = function bindFunctions(element) { @@ -113102,7 +112436,6 @@ var defaultStyle = function defaultStyle() { */ var addSubGraph = function addSubGraph(_id, list, _title) { - // console.log('addSubGraph', _id, list, _title); var id = _id.trim(); var title = _title; @@ -113118,16 +112451,9 @@ var addSubGraph = function addSubGraph(_id, list, _title) { string: {} }; var objs = []; - var dir; // = unbdefined; direction.trim(); - - var nodeList = a.filter(function (item) { + return a.filter(function (item) { var type = _typeof(item); - if (item.stmt && item.stmt === 'dir') { - dir = item.value; - return false; - } - if (item.trim() === '') { return false; } @@ -113138,22 +112464,13 @@ var addSubGraph = function addSubGraph(_id, list, _title) { return objs.indexOf(item) >= 0 ? false : objs.push(item); } }); - return { - nodeList: nodeList, - dir: dir - }; } var nodeList = []; - - var _uniq = uniq(nodeList.concat.apply(nodeList, list)), - nl = _uniq.nodeList, - dir = _uniq.dir; - - nodeList = nl; + nodeList = uniq(nodeList.concat.apply(nodeList, list)); if (version === 'gen-1') { - _logger__WEBPACK_IMPORTED_MODULE_5__["log"].warn('LOOKING UP'); + _logger__WEBPACK_IMPORTED_MODULE_5__["logger"].warn('LOOKING UP'); for (var i = 0; i < nodeList.length; i++) { nodeList[i] = lookUpDomId(nodeList[i]); @@ -113169,10 +112486,9 @@ var addSubGraph = function addSubGraph(_id, list, _title) { id: id, nodes: nodeList, title: title.trim(), - classes: [], - dir: dir + classes: [] }; - _logger__WEBPACK_IMPORTED_MODULE_5__["log"].info('Adding', subGraph.id, subGraph.nodes, subGraph.dir); + _logger__WEBPACK_IMPORTED_MODULE_5__["logger"].info('Adding', subGraph.id, subGraph.nodes); /** * Deletes an id from all subgraphs */ @@ -113463,7 +112779,6 @@ var makeUniq = function makeUniq(sg, allSubgraphs) { addClass: addClass, setDirection: setDirection, setClass: setClass, - setTooltip: setTooltip, getTooltip: getTooltip, setClickEvent: setClickEvent, setLink: setLink, @@ -113561,7 +112876,7 @@ var addVertices = function addVertices(vert, g, svgId) { var vertexNode; - if (Object(_common_common__WEBPACK_IMPORTED_MODULE_8__["evaluate"])(Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels)) { + if (Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels) { // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that? var node = { label: vertexText.replace(/fa[lrsb]?:fa-[\w-]+/g, function (s) { @@ -113676,11 +112991,10 @@ var addVertices = function addVertices(vert, g, svgId) { domId: _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(vertex.id), haveCallback: vertex.haveCallback, width: vertex.type === 'group' ? 500 : undefined, - dir: vertex.dir, type: vertex.type, padding: Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.padding }); - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info('setNode', { + _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].info('setNode', { labelStyle: styles.labelStyle, shape: _shape, labelText: vertexText, @@ -113692,7 +113006,6 @@ var addVertices = function addVertices(vert, g, svgId) { domId: _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(vertex.id), width: vertex.type === 'group' ? 500 : undefined, type: vertex.type, - dir: vertex.dir, padding: Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.padding }); }); @@ -113704,9 +113017,7 @@ var addVertices = function addVertices(vert, g, svgId) { */ var addEdges = function addEdges(edges, g) { - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info('abc78 edges = ', edges); var cnt = 0; - var linkIdCnt = {}; var defaultStyle; var defaultLabelStyle; @@ -113719,18 +113030,7 @@ var addEdges = function addEdges(edges, g) { edges.forEach(function (edge) { cnt++; // Identify Link - var linkIdBase = 'L-' + edge.start + '-' + edge.end; // count the links from+to the same node to give unique id - - if (typeof linkIdCnt[linkIdBase] === 'undefined') { - linkIdCnt[linkIdBase] = 0; - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info('abc78 new entry', linkIdBase, linkIdCnt[linkIdBase]); - } else { - linkIdCnt[linkIdBase]++; - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info('abc78 new entry', linkIdBase, linkIdCnt[linkIdBase]); - } - - var linkId = linkIdBase + '-' + linkIdCnt[linkIdBase]; - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info('abc78 new link id to be used is', linkIdBase, linkId, linkIdCnt[linkIdBase]); + var linkId = 'L-' + edge.start + '-' + edge.end; var linkNameStart = 'LS-' + edge.start; var linkNameEnd = 'LE-' + edge.end; var edgeData = { @@ -113830,7 +113130,7 @@ var addEdges = function addEdges(edges, g) { } else { edgeData.arrowheadStyle = 'fill: #333'; edgeData.labelpos = 'c'; - } // if (evaluate(getConfig().flowchart.htmlLabels) && false) { + } // if (getConfig().flowchart.htmlLabels && false) { // // eslint-disable-line // edgeData.labelType = 'html'; // edgeData.label = `${edge.text}`; @@ -113858,7 +113158,7 @@ var addEdges = function addEdges(edges, g) { */ var getClasses = function getClasses(text) { - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info('Extracting classes'); + _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].info('Extracting classes'); _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear(); var parser = _parser_flow__WEBPACK_IMPORTED_MODULE_3___default.a.parser; parser.yy = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"]; @@ -113879,7 +113179,7 @@ var getClasses = function getClasses(text) { */ var draw = function draw(text, id) { - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info('Drawing flowchart'); + _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].info('Drawing flowchart'); _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear(); _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].setGen('gen-2'); var parser = _parser_flow__WEBPACK_IMPORTED_MODULE_3___default.a.parser; @@ -113887,7 +113187,7 @@ var draw = function draw(text, id) { // try { parser.parse(text); // } catch (err) { - // log.debug('Parsing failed'); + // logger.debug('Parsing failed'); // } // Fetch the default direction, use TD if none was found @@ -113915,18 +113215,18 @@ var draw = function draw(text, id) { }); var subG; var subGraphs = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getSubGraphs(); - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info('Subgraphs - ', subGraphs); + _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].info('Subgraphs - ', subGraphs); for (var _i = subGraphs.length - 1; _i >= 0; _i--) { subG = subGraphs[_i]; - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info('Subgraph - ', subG); - _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].addVertex(subG.id, subG.title, 'group', undefined, subG.classes, subG.dir); + _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].info('Subgraph - ', subG); + _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].addVertex(subG.id, subG.title, 'group', undefined, subG.classes); } // Fetch the verices/nodes and edges/links from the parsed graph definition var vert = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getVertices(); var edges = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getEdges(); - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info(edges); + _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].info(edges); var i = 0; for (i = subGraphs.length - 1; i >= 0; i--) { @@ -113935,7 +113235,7 @@ var draw = function draw(text, id) { Object(d3__WEBPACK_IMPORTED_MODULE_1__["selectAll"])('cluster').append('text'); for (var j = 0; j < subG.nodes.length; j++) { - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info('Setting up subgraphs', subG.nodes[j], subG.id); + _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].info('Setting up subgraphs', subG.nodes[j], subG.id); g.setParent(subG.nodes[j], subG.id); } } @@ -113954,7 +113254,7 @@ var draw = function draw(text, id) { var svgBounds = svg.node().getBBox(); var width = svgBounds.width + padding * 2; var height = svgBounds.height + padding * 2; - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].debug("new ViewBox 0 0 ".concat(width, " ").concat(height), "translate(".concat(padding - g._label.marginx, ", ").concat(padding - g._label.marginy, ")")); + _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].debug("new ViewBox 0 0 ".concat(width, " ").concat(height), "translate(".concat(padding - g._label.marginx, ", ").concat(padding - g._label.marginy, ")")); Object(_utils__WEBPACK_IMPORTED_MODULE_9__["configureSvgSize"])(svg, height, width, conf.useMaxWidth); svg.attr('viewBox', "0 0 ".concat(width, " ").concat(height)); svg.select('g').attr('transform', "translate(".concat(padding - g._label.marginx, ", ").concat(padding - svgBounds.y, ")")); // Index nodes @@ -114103,7 +113403,7 @@ var addVertices = function addVertices(vert, g, svgId) { var vertexNode; - if (Object(_common_common__WEBPACK_IMPORTED_MODULE_8__["evaluate"])(Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels)) { + if (Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels) { // TODO: addHtmlLabel accepts a labelStyle. Do we possibly have that? var node = { label: vertexText.replace(/fa[lrsb]?:fa-[\w-]+/g, function (s) { @@ -114203,7 +113503,7 @@ var addVertices = function addVertices(vert, g, svgId) { } // Add the node - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].warn('Adding node', vertex.id, vertex.domId); + _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].warn('Adding node', vertex.id, vertex.domId); g.setNode(_flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(vertex.id), { labelType: 'svg', labelStyle: styles.labelStyle, @@ -114299,7 +113599,7 @@ var addEdges = function addEdges(edges, g) { edgeData.arrowheadStyle = 'fill: #333'; edgeData.labelpos = 'c'; - if (Object(_common_common__WEBPACK_IMPORTED_MODULE_8__["evaluate"])(Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels)) { + if (Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().flowchart.htmlLabels) { edgeData.labelType = 'html'; edgeData.label = "").concat(edge.text.replace(/fa[lrsb]?:fa-[\w-]+/g, function (s) { return ""); @@ -114329,7 +113629,7 @@ var addEdges = function addEdges(edges, g) { */ var getClasses = function getClasses(text) { - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info('Extracting classes'); + _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].info('Extracting classes'); _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear(); try { @@ -114349,7 +113649,7 @@ var getClasses = function getClasses(text) { */ var draw = function draw(text, id) { - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].info('Drawing flowchart'); + _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].info('Drawing flowchart'); _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear(); _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].setGen('gen-1'); var parser = _parser_flow__WEBPACK_IMPORTED_MODULE_3___default.a.parser; @@ -114357,7 +113657,7 @@ var draw = function draw(text, id) { // try { parser.parse(text); // } catch (err) { - // log.debug('Parsing failed'); + // logger.debug('Parsing failed'); // } // Fetch the default direction, use TD if none was found @@ -114393,7 +113693,7 @@ var draw = function draw(text, id) { var vert = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getVertices(); - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].warn('Get vertices', vert); + _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].warn('Get vertices', vert); var edges = _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].getEdges(); var i = 0; @@ -114402,7 +113702,7 @@ var draw = function draw(text, id) { Object(d3__WEBPACK_IMPORTED_MODULE_1__["selectAll"])('cluster').append('text'); for (var j = 0; j < subG.nodes.length; j++) { - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].warn('Setting subgraph', subG.nodes[j], _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.nodes[j]), _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.id)); + _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].warn('Setting subgraph', subG.nodes[j], _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.nodes[j]), _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.id)); g.setParent(_flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.nodes[j]), _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].lookUpDomId(subG.id)); } } @@ -114430,7 +113730,7 @@ var draw = function draw(text, id) { var svg = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])("[id=\"".concat(id, "\"]")); svg.attr('xmlns:xlink', 'http://www.w3.org/1999/xlink'); - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].warn(g); // Run the renderer. This is what draws the final graph. + _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].warn(g); // Run the renderer. This is what draws the final graph. var element = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('#' + id + ' g'); render(element, g); @@ -114444,7 +113744,7 @@ var draw = function draw(text, id) { Object(_utils__WEBPACK_IMPORTED_MODULE_9__["configureSvgSize"])(svg, height, width, conf.useMaxWidth); // Ensure the viewBox includes the whole svgBounds area with extra space for padding var vBox = "".concat(svgBounds.x - padding, " ").concat(svgBounds.y - padding, " ").concat(width, " ").concat(height); - _logger__WEBPACK_IMPORTED_MODULE_7__["log"].debug("viewBox ".concat(vBox)); + _logger__WEBPACK_IMPORTED_MODULE_7__["logger"].debug("viewBox ".concat(vBox)); svg.attr('viewBox', vBox); // Index nodes _flowDb__WEBPACK_IMPORTED_MODULE_2__["default"].indexNodes('subGraph' + i); // reposition labels @@ -114470,7 +113770,7 @@ var draw = function draw(text, id) { } // Add label rects for non html labels - if (!Object(_common_common__WEBPACK_IMPORTED_MODULE_8__["evaluate"])(conf.htmlLabels) || true) { + if (!conf.htmlLabels || true) { // eslint-disable-line var labels = document.querySelectorAll('[id="' + id + '"] .edgeLabel .label'); @@ -114619,12 +113919,12 @@ var draw = function draw(text, id) { } */ var parser = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,9],$V1=[1,7],$V2=[1,6],$V3=[1,8],$V4=[1,20,21,22,23,38,47,76,77,78,79,80,81,95,96,99,100,101,103,104,110,111,112,113,114,115,116,117,118,119],$V5=[2,10],$V6=[1,20],$V7=[1,21],$V8=[1,22],$V9=[1,23],$Va=[1,30],$Vb=[1,59],$Vc=[1,33],$Vd=[1,34],$Ve=[1,35],$Vf=[1,36],$Vg=[1,37],$Vh=[1,53],$Vi=[1,48],$Vj=[1,50],$Vk=[1,45],$Vl=[1,49],$Vm=[1,52],$Vn=[1,56],$Vo=[1,57],$Vp=[1,38],$Vq=[1,39],$Vr=[1,40],$Vs=[1,41],$Vt=[1,58],$Vu=[1,47],$Vv=[1,51],$Vw=[1,54],$Vx=[1,55],$Vy=[1,46],$Vz=[1,62],$VA=[1,67],$VB=[1,20,21,22,23,38,42,47,76,77,78,79,80,81,95,96,99,100,101,103,104,110,111,112,113,114,115,116,117,118,119],$VC=[1,71],$VD=[1,70],$VE=[1,72],$VF=[20,21,23,70,71],$VG=[1,93],$VH=[1,98],$VI=[1,95],$VJ=[1,100],$VK=[1,103],$VL=[1,101],$VM=[1,102],$VN=[1,96],$VO=[1,108],$VP=[1,107],$VQ=[1,97],$VR=[1,99],$VS=[1,104],$VT=[1,105],$VU=[1,106],$VV=[1,109],$VW=[20,21,22,23,70,71],$VX=[20,21,22,23,48,70,71],$VY=[20,21,22,23,40,47,48,50,52,54,56,58,60,62,63,65,70,71,81,95,96,99,100,101,103,104,114,115,116,117,118,119],$VZ=[20,21,23],$V_=[20,21,23,47,70,71,81,95,96,99,100,101,103,104,114,115,116,117,118,119],$V$=[1,12,20,21,22,23,24,38,42,47,76,77,78,79,80,81,95,96,99,100,101,103,104,110,111,112,113,114,115,116,117,118,119],$V01=[47,81,95,96,99,100,101,103,104,114,115,116,117,118,119],$V11=[1,141],$V21=[1,149],$V31=[1,150],$V41=[1,151],$V51=[1,152],$V61=[1,136],$V71=[1,137],$V81=[1,133],$V91=[1,144],$Va1=[1,145],$Vb1=[1,146],$Vc1=[1,147],$Vd1=[1,148],$Ve1=[1,153],$Vf1=[1,154],$Vg1=[1,139],$Vh1=[1,142],$Vi1=[1,138],$Vj1=[1,135],$Vk1=[20,21,22,23,38,42,47,76,77,78,79,80,81,95,96,99,100,101,103,104,110,111,112,113,114,115,116,117,118,119],$Vl1=[1,157],$Vm1=[20,21,22,23,26,47,81,95,96,99,100,101,103,104,114,115,116,117,118,119],$Vn1=[20,21,22,23,24,26,38,40,41,42,47,51,53,55,57,59,61,62,64,66,70,71,72,76,77,78,79,80,81,82,85,95,96,99,100,101,103,104,105,106,114,115,116,117,118,119],$Vo1=[12,21,22,24],$Vp1=[22,96],$Vq1=[1,238],$Vr1=[1,242],$Vs1=[1,239],$Vt1=[1,236],$Vu1=[1,233],$Vv1=[1,234],$Vw1=[1,235],$Vx1=[1,237],$Vy1=[1,240],$Vz1=[1,241],$VA1=[1,243],$VB1=[1,260],$VC1=[20,21,23,96],$VD1=[20,21,22,23,76,92,95,96,99,100,101,102,103,104,105]; +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,9],$V1=[1,7],$V2=[1,6],$V3=[1,8],$V4=[1,20,21,22,23,38,46,75,76,77,78,79,80,91,92,95,96,97,99,100,106,107,108,109,110,111],$V5=[2,10],$V6=[1,20],$V7=[1,21],$V8=[1,22],$V9=[1,23],$Va=[1,30],$Vb=[1,54],$Vc=[1,32],$Vd=[1,33],$Ve=[1,34],$Vf=[1,35],$Vg=[1,36],$Vh=[1,48],$Vi=[1,43],$Vj=[1,45],$Vk=[1,40],$Vl=[1,44],$Vm=[1,47],$Vn=[1,51],$Vo=[1,52],$Vp=[1,53],$Vq=[1,42],$Vr=[1,46],$Vs=[1,49],$Vt=[1,50],$Vu=[1,41],$Vv=[1,57],$Vw=[1,62],$Vx=[1,20,21,22,23,38,42,46,75,76,77,78,79,80,91,92,95,96,97,99,100,106,107,108,109,110,111],$Vy=[1,66],$Vz=[1,65],$VA=[1,67],$VB=[20,21,23,69,70],$VC=[20,21,22,23,69,70],$VD=[20,21,22,23,47,69,70],$VE=[20,21,22,23,40,46,47,49,51,53,55,57,59,61,62,64,69,70,80,91,92,95,96,97,99,100,106,107,108,109,110,111],$VF=[20,21,23],$VG=[20,21,23,46,69,70,80,91,92,95,96,97,99,100,106,107,108,109,110,111],$VH=[1,12,20,21,22,23,24,38,42,46,75,76,77,78,79,80,91,92,95,96,97,99,100,106,107,108,109,110,111],$VI=[46,80,91,92,95,96,97,99,100,106,107,108,109,110,111],$VJ=[1,115],$VK=[1,136],$VL=[1,137],$VM=[1,138],$VN=[1,139],$VO=[1,119],$VP=[1,110],$VQ=[1,111],$VR=[1,107],$VS=[1,131],$VT=[1,132],$VU=[1,133],$VV=[1,134],$VW=[1,135],$VX=[1,140],$VY=[1,141],$VZ=[1,113],$V_=[1,121],$V$=[1,124],$V01=[1,122],$V11=[1,123],$V21=[1,116],$V31=[1,129],$V41=[1,128],$V51=[1,112],$V61=[1,109],$V71=[1,118],$V81=[1,120],$V91=[1,125],$Va1=[1,126],$Vb1=[1,127],$Vc1=[1,130],$Vd1=[20,21,22,23,38,42,46,75,76,77,78,79,80,91,92,95,96,97,99,100,106,107,108,109,110,111],$Ve1=[1,144],$Vf1=[1,148],$Vg1=[1,150],$Vh1=[1,151],$Vi1=[12,21,22,24],$Vj1=[20,21,22,23,24,26,38,40,41,42,46,50,52,54,56,58,60,61,63,65,69,70,71,75,76,77,78,79,80,81,84,91,92,95,96,97,99,100,101,102,106,107,108,109,110,111],$Vk1=[20,21,22,23,26,46,80,91,92,95,96,97,99,100,106,107,108,109,110,111],$Vl1=[22,92],$Vm1=[1,220],$Vn1=[1,224],$Vo1=[1,221],$Vp1=[1,218],$Vq1=[1,215],$Vr1=[1,216],$Vs1=[1,217],$Vt1=[1,219],$Vu1=[1,222],$Vv1=[1,223],$Vw1=[1,225],$Vx1=[1,241],$Vy1=[20,21,23,92],$Vz1=[20,21,22,23,75,88,91,92,95,96,97,98,99,100,101]; var parser = {trace: function trace () { }, yy: {}, -symbols_: {"error":2,"start":3,"mermaidDoc":4,"directive":5,"openDirective":6,"typeDirective":7,"closeDirective":8,"separator":9,":":10,"argDirective":11,"open_directive":12,"type_directive":13,"arg_directive":14,"close_directive":15,"graphConfig":16,"document":17,"line":18,"statement":19,"SEMI":20,"NEWLINE":21,"SPACE":22,"EOF":23,"GRAPH":24,"NODIR":25,"DIR":26,"FirstStmtSeperator":27,"ending":28,"endToken":29,"spaceList":30,"spaceListNewline":31,"verticeStatement":32,"styleStatement":33,"linkStyleStatement":34,"classDefStatement":35,"classStatement":36,"clickStatement":37,"subgraph":38,"text":39,"SQS":40,"SQE":41,"end":42,"direction":43,"link":44,"node":45,"vertex":46,"AMP":47,"STYLE_SEPARATOR":48,"idString":49,"PS":50,"PE":51,"(-":52,"-)":53,"STADIUMSTART":54,"STADIUMEND":55,"SUBROUTINESTART":56,"SUBROUTINEEND":57,"CYLINDERSTART":58,"CYLINDEREND":59,"DIAMOND_START":60,"DIAMOND_STOP":61,"TAGEND":62,"TRAPSTART":63,"TRAPEND":64,"INVTRAPSTART":65,"INVTRAPEND":66,"linkStatement":67,"arrowText":68,"TESTSTR":69,"START_LINK":70,"LINK":71,"PIPE":72,"textToken":73,"STR":74,"keywords":75,"STYLE":76,"LINKSTYLE":77,"CLASSDEF":78,"CLASS":79,"CLICK":80,"DOWN":81,"UP":82,"textNoTags":83,"textNoTagsToken":84,"DEFAULT":85,"stylesOpt":86,"alphaNum":87,"CALLBACKNAME":88,"CALLBACKARGS":89,"HREF":90,"LINK_TARGET":91,"HEX":92,"numList":93,"INTERPOLATE":94,"NUM":95,"COMMA":96,"style":97,"styleComponent":98,"ALPHA":99,"COLON":100,"MINUS":101,"UNIT":102,"BRKT":103,"DOT":104,"PCT":105,"TAGSTART":106,"alphaNumToken":107,"idStringToken":108,"alphaNumStatement":109,"direction_tb":110,"direction_bt":111,"direction_rl":112,"direction_lr":113,"PUNCTUATION":114,"UNICODE_TEXT":115,"PLUS":116,"EQUALS":117,"MULT":118,"UNDERSCORE":119,"graphCodeTokens":120,"ARROW_CROSS":121,"ARROW_POINT":122,"ARROW_CIRCLE":123,"ARROW_OPEN":124,"QUOTE":125,"$accept":0,"$end":1}, -terminals_: {2:"error",10:":",12:"open_directive",13:"type_directive",14:"arg_directive",15:"close_directive",20:"SEMI",21:"NEWLINE",22:"SPACE",23:"EOF",24:"GRAPH",25:"NODIR",26:"DIR",38:"subgraph",40:"SQS",41:"SQE",42:"end",47:"AMP",48:"STYLE_SEPARATOR",50:"PS",51:"PE",52:"(-",53:"-)",54:"STADIUMSTART",55:"STADIUMEND",56:"SUBROUTINESTART",57:"SUBROUTINEEND",58:"CYLINDERSTART",59:"CYLINDEREND",60:"DIAMOND_START",61:"DIAMOND_STOP",62:"TAGEND",63:"TRAPSTART",64:"TRAPEND",65:"INVTRAPSTART",66:"INVTRAPEND",69:"TESTSTR",70:"START_LINK",71:"LINK",72:"PIPE",74:"STR",76:"STYLE",77:"LINKSTYLE",78:"CLASSDEF",79:"CLASS",80:"CLICK",81:"DOWN",82:"UP",85:"DEFAULT",88:"CALLBACKNAME",89:"CALLBACKARGS",90:"HREF",91:"LINK_TARGET",92:"HEX",94:"INTERPOLATE",95:"NUM",96:"COMMA",99:"ALPHA",100:"COLON",101:"MINUS",102:"UNIT",103:"BRKT",104:"DOT",105:"PCT",106:"TAGSTART",110:"direction_tb",111:"direction_bt",112:"direction_rl",113:"direction_lr",114:"PUNCTUATION",115:"UNICODE_TEXT",116:"PLUS",117:"EQUALS",118:"MULT",119:"UNDERSCORE",121:"ARROW_CROSS",122:"ARROW_POINT",123:"ARROW_CIRCLE",124:"ARROW_OPEN",125:"QUOTE"}, -productions_: [0,[3,1],[3,2],[5,4],[5,6],[6,1],[7,1],[11,1],[8,1],[4,2],[17,0],[17,2],[18,1],[18,1],[18,1],[18,1],[18,1],[16,2],[16,2],[16,2],[16,3],[28,2],[28,1],[29,1],[29,1],[29,1],[27,1],[27,1],[27,2],[31,2],[31,2],[31,1],[31,1],[30,2],[30,1],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,9],[19,6],[19,4],[19,1],[9,1],[9,1],[9,1],[32,3],[32,4],[32,2],[32,1],[45,1],[45,5],[45,3],[46,4],[46,6],[46,4],[46,4],[46,4],[46,4],[46,4],[46,4],[46,6],[46,4],[46,4],[46,4],[46,4],[46,4],[46,1],[44,2],[44,3],[44,3],[44,1],[44,3],[67,1],[68,3],[39,1],[39,2],[39,1],[75,1],[75,1],[75,1],[75,1],[75,1],[75,1],[75,1],[75,1],[75,1],[75,1],[75,1],[83,1],[83,2],[35,5],[35,5],[36,5],[37,2],[37,4],[37,3],[37,5],[37,2],[37,4],[37,4],[37,6],[37,2],[37,4],[37,2],[37,4],[37,4],[37,6],[33,5],[33,5],[34,5],[34,5],[34,9],[34,9],[34,7],[34,7],[93,1],[93,3],[86,1],[86,3],[97,1],[97,2],[98,1],[98,1],[98,1],[98,1],[98,1],[98,1],[98,1],[98,1],[98,1],[98,1],[98,1],[73,1],[73,1],[73,1],[73,1],[73,1],[73,1],[84,1],[84,1],[84,1],[84,1],[49,1],[49,2],[87,1],[87,2],[109,1],[109,1],[109,1],[109,1],[43,1],[43,1],[43,1],[43,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[107,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[108,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1],[120,1]], +symbols_: {"error":2,"start":3,"mermaidDoc":4,"directive":5,"openDirective":6,"typeDirective":7,"closeDirective":8,"separator":9,":":10,"argDirective":11,"open_directive":12,"type_directive":13,"arg_directive":14,"close_directive":15,"graphConfig":16,"document":17,"line":18,"statement":19,"SEMI":20,"NEWLINE":21,"SPACE":22,"EOF":23,"GRAPH":24,"NODIR":25,"DIR":26,"FirstStmtSeperator":27,"ending":28,"endToken":29,"spaceList":30,"spaceListNewline":31,"verticeStatement":32,"styleStatement":33,"linkStyleStatement":34,"classDefStatement":35,"classStatement":36,"clickStatement":37,"subgraph":38,"text":39,"SQS":40,"SQE":41,"end":42,"link":43,"node":44,"vertex":45,"AMP":46,"STYLE_SEPARATOR":47,"idString":48,"PS":49,"PE":50,"(-":51,"-)":52,"STADIUMSTART":53,"STADIUMEND":54,"SUBROUTINESTART":55,"SUBROUTINEEND":56,"CYLINDERSTART":57,"CYLINDEREND":58,"DIAMOND_START":59,"DIAMOND_STOP":60,"TAGEND":61,"TRAPSTART":62,"TRAPEND":63,"INVTRAPSTART":64,"INVTRAPEND":65,"linkStatement":66,"arrowText":67,"TESTSTR":68,"START_LINK":69,"LINK":70,"PIPE":71,"textToken":72,"STR":73,"keywords":74,"STYLE":75,"LINKSTYLE":76,"CLASSDEF":77,"CLASS":78,"CLICK":79,"DOWN":80,"UP":81,"textNoTags":82,"textNoTagsToken":83,"DEFAULT":84,"stylesOpt":85,"alphaNum":86,"LINK_TARGET":87,"HEX":88,"numList":89,"INTERPOLATE":90,"NUM":91,"COMMA":92,"style":93,"styleComponent":94,"ALPHA":95,"COLON":96,"MINUS":97,"UNIT":98,"BRKT":99,"DOT":100,"PCT":101,"TAGSTART":102,"alphaNumToken":103,"idStringToken":104,"alphaNumStatement":105,"PUNCTUATION":106,"UNICODE_TEXT":107,"PLUS":108,"EQUALS":109,"MULT":110,"UNDERSCORE":111,"graphCodeTokens":112,"ARROW_CROSS":113,"ARROW_POINT":114,"ARROW_CIRCLE":115,"ARROW_OPEN":116,"QUOTE":117,"$accept":0,"$end":1}, +terminals_: {2:"error",10:":",12:"open_directive",13:"type_directive",14:"arg_directive",15:"close_directive",20:"SEMI",21:"NEWLINE",22:"SPACE",23:"EOF",24:"GRAPH",25:"NODIR",26:"DIR",38:"subgraph",40:"SQS",41:"SQE",42:"end",46:"AMP",47:"STYLE_SEPARATOR",49:"PS",50:"PE",51:"(-",52:"-)",53:"STADIUMSTART",54:"STADIUMEND",55:"SUBROUTINESTART",56:"SUBROUTINEEND",57:"CYLINDERSTART",58:"CYLINDEREND",59:"DIAMOND_START",60:"DIAMOND_STOP",61:"TAGEND",62:"TRAPSTART",63:"TRAPEND",64:"INVTRAPSTART",65:"INVTRAPEND",68:"TESTSTR",69:"START_LINK",70:"LINK",71:"PIPE",73:"STR",75:"STYLE",76:"LINKSTYLE",77:"CLASSDEF",78:"CLASS",79:"CLICK",80:"DOWN",81:"UP",84:"DEFAULT",87:"LINK_TARGET",88:"HEX",90:"INTERPOLATE",91:"NUM",92:"COMMA",95:"ALPHA",96:"COLON",97:"MINUS",98:"UNIT",99:"BRKT",100:"DOT",101:"PCT",102:"TAGSTART",106:"PUNCTUATION",107:"UNICODE_TEXT",108:"PLUS",109:"EQUALS",110:"MULT",111:"UNDERSCORE",113:"ARROW_CROSS",114:"ARROW_POINT",115:"ARROW_CIRCLE",116:"ARROW_OPEN",117:"QUOTE"}, +productions_: [0,[3,1],[3,2],[5,4],[5,6],[6,1],[7,1],[11,1],[8,1],[4,2],[17,0],[17,2],[18,1],[18,1],[18,1],[18,1],[18,1],[16,2],[16,2],[16,2],[16,3],[28,2],[28,1],[29,1],[29,1],[29,1],[27,1],[27,1],[27,2],[31,2],[31,2],[31,1],[31,1],[30,2],[30,1],[19,2],[19,2],[19,2],[19,2],[19,2],[19,2],[19,9],[19,6],[19,4],[9,1],[9,1],[9,1],[32,3],[32,4],[32,2],[32,1],[44,1],[44,5],[44,3],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,4],[45,6],[45,4],[45,4],[45,4],[45,4],[45,4],[45,1],[43,2],[43,3],[43,3],[43,1],[43,3],[66,1],[67,3],[39,1],[39,2],[39,1],[74,1],[74,1],[74,1],[74,1],[74,1],[74,1],[74,1],[74,1],[74,1],[74,1],[74,1],[82,1],[82,2],[35,5],[35,5],[36,5],[37,5],[37,7],[37,5],[37,7],[37,7],[37,9],[33,5],[33,5],[34,5],[34,5],[34,9],[34,9],[34,7],[34,7],[89,1],[89,3],[85,1],[85,3],[93,1],[93,2],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[72,1],[72,1],[72,1],[72,1],[72,1],[72,1],[83,1],[83,1],[83,1],[83,1],[48,1],[48,2],[86,1],[86,2],[105,1],[105,1],[105,1],[105,1],[103,1],[103,1],[103,1],[103,1],[103,1],[103,1],[103,1],[103,1],[103,1],[103,1],[103,1],[103,1],[103,1],[104,1],[104,1],[104,1],[104,1],[104,1],[104,1],[104,1],[104,1],[104,1],[104,1],[104,1],[104,1],[104,1],[104,1],[104,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1],[112,1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ @@ -114652,7 +113952,7 @@ case 11: } this.$=$$[$0-1]; break; -case 12: case 77: case 79: case 91: case 147: case 149: case 150: +case 12: case 76: case 78: case 90: case 138: case 140: case 141: this.$=$$[$0]; break; case 19: @@ -114676,181 +113976,163 @@ break; case 43: this.$=yy.addSubGraph(undefined,$$[$0-1],undefined); break; -case 48: +case 47: /* console.warn('vs',$$[$0-2].stmt,$$[$0]); */ yy.addLink($$[$0-2].stmt,$$[$0],$$[$0-1]); this.$ = { stmt: $$[$0], nodes: $$[$0].concat($$[$0-2].nodes) }; break; -case 49: +case 48: /* console.warn('vs',$$[$0-3].stmt,$$[$0-1]); */ yy.addLink($$[$0-3].stmt,$$[$0-1],$$[$0-2]); this.$ = { stmt: $$[$0-1], nodes: $$[$0-1].concat($$[$0-3].nodes) }; break; -case 50: +case 49: /*console.warn('noda', $$[$0-1]);*/ this.$ = {stmt: $$[$0-1], nodes:$$[$0-1] }; break; -case 51: +case 50: /*console.warn('noda', $$[$0]);*/ this.$ = {stmt: $$[$0], nodes:$$[$0] }; break; -case 52: +case 51: /* console.warn('nod', $$[$0]); */ this.$ = [$$[$0]]; break; -case 53: +case 52: this.$ = $$[$0-4].concat($$[$0]); /* console.warn('pip', $$[$0-4][0], $$[$0], this.$); */ break; -case 54: +case 53: this.$ = [$$[$0-2]];yy.setClass($$[$0-2],$$[$0]); break; -case 55: +case 54: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'square'); break; -case 56: +case 55: this.$ = $$[$0-5];yy.addVertex($$[$0-5],$$[$0-2],'circle'); break; -case 57: +case 56: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'ellipse'); break; -case 58: +case 57: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'stadium'); break; -case 59: +case 58: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'subroutine'); break; -case 60: +case 59: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'cylinder'); break; -case 61: +case 60: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'round'); break; -case 62: +case 61: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'diamond'); break; -case 63: +case 62: this.$ = $$[$0-5];yy.addVertex($$[$0-5],$$[$0-2],'hexagon'); break; -case 64: +case 63: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'odd'); break; -case 65: +case 64: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'trapezoid'); break; -case 66: +case 65: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'inv_trapezoid'); break; -case 67: +case 66: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'lean_right'); break; -case 68: +case 67: this.$ = $$[$0-3];yy.addVertex($$[$0-3],$$[$0-1],'lean_left'); break; -case 69: +case 68: /*console.warn('h: ', $$[$0]);*/this.$ = $$[$0];yy.addVertex($$[$0]); break; -case 70: +case 69: $$[$0-1].text = $$[$0];this.$ = $$[$0-1]; break; -case 71: case 72: +case 70: case 71: $$[$0-2].text = $$[$0-1];this.$ = $$[$0-2]; break; -case 73: +case 72: this.$ = $$[$0]; break; -case 74: +case 73: var inf = yy.destructLink($$[$0], $$[$0-2]); this.$ = {"type":inf.type,"stroke":inf.stroke,"length":inf.length,"text":$$[$0-1]}; break; -case 75: +case 74: var inf = yy.destructLink($$[$0]);this.$ = {"type":inf.type,"stroke":inf.stroke,"length":inf.length}; break; -case 76: +case 75: this.$ = $$[$0-1]; break; -case 78: case 92: case 148: +case 77: case 91: case 139: this.$=$$[$0-1]+''+$$[$0]; break; -case 93: case 94: +case 92: case 93: this.$ = $$[$0-4];yy.addClass($$[$0-2],$$[$0]); break; -case 95: +case 94: this.$ = $$[$0-4];yy.setClass($$[$0-2], $$[$0]); break; -case 96: case 104: -this.$ = $$[$0-1];yy.setClickEvent($$[$0-1], $$[$0]); +case 95: +this.$ = $$[$0-4];yy.setClickEvent($$[$0-2], $$[$0], undefined); +break; +case 96: +this.$ = $$[$0-6];yy.setClickEvent($$[$0-4], $$[$0-2], $$[$0]) ; break; -case 97: case 105: -this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-3], $$[$0]); +case 97: +this.$ = $$[$0-4];yy.setLink($$[$0-2], $$[$0], undefined, undefined); break; case 98: -this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]); +this.$ = $$[$0-6];yy.setLink($$[$0-4], $$[$0-2], $$[$0], undefined ); break; case 99: -this.$ = $$[$0-4];yy.setClickEvent($$[$0-4], $$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-4], $$[$0]); +this.$ = $$[$0-6];yy.setLink($$[$0-4], $$[$0-2], undefined, $$[$0] ); break; -case 100: case 106: -this.$ = $$[$0-1];yy.setLink($$[$0-1], $$[$0]); +case 100: +this.$ = $$[$0-8];yy.setLink($$[$0-6], $$[$0-4], $$[$0-2], $$[$0] ); break; -case 101: case 107: -this.$ = $$[$0-3];yy.setLink($$[$0-3], $$[$0-2]);yy.setTooltip($$[$0-3], $$[$0]); -break; -case 102: case 108: -this.$ = $$[$0-3];yy.setLink($$[$0-3], $$[$0-2], $$[$0]); -break; -case 103: case 109: -this.$ = $$[$0-5];yy.setLink($$[$0-5], $$[$0-4], $$[$0]);yy.setTooltip($$[$0-5], $$[$0-2]); -break; -case 110: +case 101: this.$ = $$[$0-4];yy.addVertex($$[$0-2],undefined,undefined,$$[$0]); break; -case 111: case 113: +case 102: case 104: this.$ = $$[$0-4];yy.updateLink($$[$0-2],$$[$0]); break; -case 112: +case 103: this.$ = $$[$0-4];yy.updateLink([$$[$0-2]],$$[$0]); break; -case 114: +case 105: this.$ = $$[$0-8];yy.updateLinkInterpolate([$$[$0-6]],$$[$0-2]);yy.updateLink([$$[$0-6]],$$[$0]); break; -case 115: +case 106: this.$ = $$[$0-8];yy.updateLinkInterpolate($$[$0-6],$$[$0-2]);yy.updateLink($$[$0-6],$$[$0]); break; -case 116: +case 107: this.$ = $$[$0-6];yy.updateLinkInterpolate([$$[$0-4]],$$[$0]); break; -case 117: +case 108: this.$ = $$[$0-6];yy.updateLinkInterpolate($$[$0-4],$$[$0]); break; -case 118: case 120: +case 109: case 111: this.$ = [$$[$0]]; break; -case 119: case 121: +case 110: case 112: $$[$0-2].push($$[$0]);this.$ = $$[$0-2]; break; -case 123: +case 114: this.$ = $$[$0-1] + $$[$0]; break; -case 145: +case 136: this.$=$$[$0]; break; -case 146: +case 137: this.$=$$[$0-1]+''+$$[$0]; break; -case 151: +case 142: this.$='v'; break; -case 152: +case 143: this.$='-'; break; -case 153: - this.$={stmt:'dir', value:'TB'}; -break; -case 154: - this.$={stmt:'dir', value:'BT'}; -break; -case 155: - this.$={stmt:'dir', value:'RL'}; -break; -case 156: - this.$={stmt:'dir', value:'LR'}; -break; } }, -table: [{3:1,4:2,5:3,6:5,12:$V0,16:4,21:$V1,22:$V2,24:$V3},{1:[3]},{1:[2,1]},{3:10,4:2,5:3,6:5,12:$V0,16:4,21:$V1,22:$V2,24:$V3},o($V4,$V5,{17:11}),{7:12,13:[1,13]},{16:14,21:$V1,22:$V2,24:$V3},{16:15,21:$V1,22:$V2,24:$V3},{25:[1,16],26:[1,17]},{13:[2,5]},{1:[2,2]},{1:[2,9],18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,43:31,45:32,46:42,47:$Vb,49:43,76:$Vc,77:$Vd,78:$Ve,79:$Vf,80:$Vg,81:$Vh,95:$Vi,96:$Vj,99:$Vk,100:$Vl,101:$Vm,103:$Vn,104:$Vo,108:44,110:$Vp,111:$Vq,112:$Vr,113:$Vs,114:$Vt,115:$Vu,116:$Vv,117:$Vw,118:$Vx,119:$Vy},{8:60,10:[1,61],15:$Vz},o([10,15],[2,6]),o($V4,[2,17]),o($V4,[2,18]),o($V4,[2,19]),{20:[1,64],21:[1,65],22:$VA,27:63,30:66},o($VB,[2,11]),o($VB,[2,12]),o($VB,[2,13]),o($VB,[2,14]),o($VB,[2,15]),o($VB,[2,16]),{9:68,20:$VC,21:$VD,23:$VE,44:69,67:73,70:[1,74],71:[1,75]},{9:76,20:$VC,21:$VD,23:$VE},{9:77,20:$VC,21:$VD,23:$VE},{9:78,20:$VC,21:$VD,23:$VE},{9:79,20:$VC,21:$VD,23:$VE},{9:80,20:$VC,21:$VD,23:$VE},{9:82,20:$VC,21:$VD,22:[1,81],23:$VE},o($VB,[2,44]),o($VF,[2,51],{30:83,22:$VA}),{22:[1,84]},{22:[1,85]},{22:[1,86]},{22:[1,87]},{26:$VG,47:$VH,74:[1,91],81:$VI,87:90,88:[1,88],90:[1,89],95:$VJ,96:$VK,99:$VL,100:$VM,101:$VN,103:$VO,104:$VP,107:94,109:92,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},o($VB,[2,153]),o($VB,[2,154]),o($VB,[2,155]),o($VB,[2,156]),o($VW,[2,52],{48:[1,110]}),o($VX,[2,69],{108:121,40:[1,111],47:$Vb,50:[1,112],52:[1,113],54:[1,114],56:[1,115],58:[1,116],60:[1,117],62:[1,118],63:[1,119],65:[1,120],81:$Vh,95:$Vi,96:$Vj,99:$Vk,100:$Vl,101:$Vm,103:$Vn,104:$Vo,114:$Vt,115:$Vu,116:$Vv,117:$Vw,118:$Vx,119:$Vy}),o($VY,[2,145]),o($VY,[2,170]),o($VY,[2,171]),o($VY,[2,172]),o($VY,[2,173]),o($VY,[2,174]),o($VY,[2,175]),o($VY,[2,176]),o($VY,[2,177]),o($VY,[2,178]),o($VY,[2,179]),o($VY,[2,180]),o($VY,[2,181]),o($VY,[2,182]),o($VY,[2,183]),o($VY,[2,184]),{9:122,20:$VC,21:$VD,23:$VE},{11:123,14:[1,124]},o($VZ,[2,8]),o($V4,[2,20]),o($V4,[2,26]),o($V4,[2,27]),{21:[1,125]},o($V_,[2,34],{30:126,22:$VA}),o($VB,[2,35]),{45:127,46:42,47:$Vb,49:43,81:$Vh,95:$Vi,96:$Vj,99:$Vk,100:$Vl,101:$Vm,103:$Vn,104:$Vo,108:44,114:$Vt,115:$Vu,116:$Vv,117:$Vw,118:$Vx,119:$Vy},o($V$,[2,45]),o($V$,[2,46]),o($V$,[2,47]),o($V01,[2,73],{68:128,69:[1,129],72:[1,130]}),{22:$V11,24:$V21,26:$V31,38:$V41,39:131,42:$V51,47:$VH,62:$V61,70:$V71,73:132,74:$V81,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},o([47,69,72,81,95,96,99,100,101,103,104,114,115,116,117,118,119],[2,75]),o($VB,[2,36]),o($VB,[2,37]),o($VB,[2,38]),o($VB,[2,39]),o($VB,[2,40]),{22:$V11,24:$V21,26:$V31,38:$V41,39:155,42:$V51,47:$VH,62:$V61,70:$V71,73:132,74:$V81,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},o($Vk1,$V5,{17:156}),o($VF,[2,50],{47:$Vl1}),{26:$VG,47:$VH,81:$VI,87:158,92:[1,159],95:$VJ,96:$VK,99:$VL,100:$VM,101:$VN,103:$VO,104:$VP,107:94,109:92,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{85:[1,160],93:161,95:[1,162]},{26:$VG,47:$VH,81:$VI,85:[1,163],87:164,95:$VJ,96:$VK,99:$VL,100:$VM,101:$VN,103:$VO,104:$VP,107:94,109:92,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{26:$VG,47:$VH,81:$VI,87:165,95:$VJ,96:$VK,99:$VL,100:$VM,101:$VN,103:$VO,104:$VP,107:94,109:92,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},o($VZ,[2,96],{22:[1,166],89:[1,167]}),o($VZ,[2,100],{22:[1,168]}),o($VZ,[2,104],{107:94,109:170,22:[1,169],26:$VG,47:$VH,81:$VI,95:$VJ,96:$VK,99:$VL,100:$VM,101:$VN,103:$VO,104:$VP,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV}),o($VZ,[2,106],{22:[1,171]}),o($Vm1,[2,147]),o($Vm1,[2,149]),o($Vm1,[2,150]),o($Vm1,[2,151]),o($Vm1,[2,152]),o($Vn1,[2,157]),o($Vn1,[2,158]),o($Vn1,[2,159]),o($Vn1,[2,160]),o($Vn1,[2,161]),o($Vn1,[2,162]),o($Vn1,[2,163]),o($Vn1,[2,164]),o($Vn1,[2,165]),o($Vn1,[2,166]),o($Vn1,[2,167]),o($Vn1,[2,168]),o($Vn1,[2,169]),{47:$Vb,49:172,81:$Vh,95:$Vi,96:$Vj,99:$Vk,100:$Vl,101:$Vm,103:$Vn,104:$Vo,108:44,114:$Vt,115:$Vu,116:$Vv,117:$Vw,118:$Vx,119:$Vy},{22:$V11,24:$V21,26:$V31,38:$V41,39:173,42:$V51,47:$VH,62:$V61,70:$V71,73:132,74:$V81,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,39:175,42:$V51,47:$VH,50:[1,174],62:$V61,70:$V71,73:132,74:$V81,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,39:176,42:$V51,47:$VH,62:$V61,70:$V71,73:132,74:$V81,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,39:177,42:$V51,47:$VH,62:$V61,70:$V71,73:132,74:$V81,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,39:178,42:$V51,47:$VH,62:$V61,70:$V71,73:132,74:$V81,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,39:179,42:$V51,47:$VH,62:$V61,70:$V71,73:132,74:$V81,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,39:180,42:$V51,47:$VH,60:[1,181],62:$V61,70:$V71,73:132,74:$V81,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,39:182,42:$V51,47:$VH,62:$V61,70:$V71,73:132,74:$V81,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,39:183,42:$V51,47:$VH,62:$V61,70:$V71,73:132,74:$V81,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,39:184,42:$V51,47:$VH,62:$V61,70:$V71,73:132,74:$V81,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},o($VY,[2,146]),o($Vo1,[2,3]),{8:185,15:$Vz},{15:[2,7]},o($V4,[2,28]),o($V_,[2,33]),o($VF,[2,48],{30:186,22:$VA}),o($V01,[2,70],{22:[1,187]}),{22:[1,188]},{22:$V11,24:$V21,26:$V31,38:$V41,39:189,42:$V51,47:$VH,62:$V61,70:$V71,73:132,74:$V81,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,42:$V51,47:$VH,62:$V61,70:$V71,71:[1,190],73:191,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},o($Vn1,[2,77]),o($Vn1,[2,79]),o($Vn1,[2,135]),o($Vn1,[2,136]),o($Vn1,[2,137]),o($Vn1,[2,138]),o($Vn1,[2,139]),o($Vn1,[2,140]),o($Vn1,[2,141]),o($Vn1,[2,142]),o($Vn1,[2,143]),o($Vn1,[2,144]),o($Vn1,[2,80]),o($Vn1,[2,81]),o($Vn1,[2,82]),o($Vn1,[2,83]),o($Vn1,[2,84]),o($Vn1,[2,85]),o($Vn1,[2,86]),o($Vn1,[2,87]),o($Vn1,[2,88]),o($Vn1,[2,89]),o($Vn1,[2,90]),{9:193,20:$VC,21:$VD,22:$V11,23:$VE,24:$V21,26:$V31,38:$V41,40:[1,192],42:$V51,47:$VH,62:$V61,70:$V71,73:191,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,194],43:31,45:32,46:42,47:$Vb,49:43,76:$Vc,77:$Vd,78:$Ve,79:$Vf,80:$Vg,81:$Vh,95:$Vi,96:$Vj,99:$Vk,100:$Vl,101:$Vm,103:$Vn,104:$Vo,108:44,110:$Vp,111:$Vq,112:$Vr,113:$Vs,114:$Vt,115:$Vu,116:$Vv,117:$Vw,118:$Vx,119:$Vy},{22:$VA,30:195},{22:[1,196],26:$VG,47:$VH,81:$VI,95:$VJ,96:$VK,99:$VL,100:$VM,101:$VN,103:$VO,104:$VP,107:94,109:170,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:[1,197]},{22:[1,198]},{22:[1,199],96:[1,200]},o($Vp1,[2,118]),{22:[1,201]},{22:[1,202],26:$VG,47:$VH,81:$VI,95:$VJ,96:$VK,99:$VL,100:$VM,101:$VN,103:$VO,104:$VP,107:94,109:170,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:[1,203],26:$VG,47:$VH,81:$VI,95:$VJ,96:$VK,99:$VL,100:$VM,101:$VN,103:$VO,104:$VP,107:94,109:170,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{74:[1,204]},o($VZ,[2,98],{22:[1,205]}),{74:[1,206],91:[1,207]},{74:[1,208]},o($Vm1,[2,148]),{74:[1,209],91:[1,210]},o($VW,[2,54],{108:121,47:$Vb,81:$Vh,95:$Vi,96:$Vj,99:$Vk,100:$Vl,101:$Vm,103:$Vn,104:$Vo,114:$Vt,115:$Vu,116:$Vv,117:$Vw,118:$Vx,119:$Vy}),{22:$V11,24:$V21,26:$V31,38:$V41,41:[1,211],42:$V51,47:$VH,62:$V61,70:$V71,73:191,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,39:212,42:$V51,47:$VH,62:$V61,70:$V71,73:132,74:$V81,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,42:$V51,47:$VH,51:[1,213],62:$V61,70:$V71,73:191,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,42:$V51,47:$VH,53:[1,214],62:$V61,70:$V71,73:191,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,42:$V51,47:$VH,55:[1,215],62:$V61,70:$V71,73:191,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,42:$V51,47:$VH,57:[1,216],62:$V61,70:$V71,73:191,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,42:$V51,47:$VH,59:[1,217],62:$V61,70:$V71,73:191,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,42:$V51,47:$VH,61:[1,218],62:$V61,70:$V71,73:191,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,39:219,42:$V51,47:$VH,62:$V61,70:$V71,73:132,74:$V81,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,41:[1,220],42:$V51,47:$VH,62:$V61,70:$V71,73:191,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,42:$V51,47:$VH,62:$V61,64:[1,221],66:[1,222],70:$V71,73:191,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{22:$V11,24:$V21,26:$V31,38:$V41,42:$V51,47:$VH,62:$V61,64:[1,224],66:[1,223],70:$V71,73:191,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{9:225,20:$VC,21:$VD,23:$VE},o($VF,[2,49],{47:$Vl1}),o($V01,[2,72]),o($V01,[2,71]),{22:$V11,24:$V21,26:$V31,38:$V41,42:$V51,47:$VH,62:$V61,70:$V71,72:[1,226],73:191,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},o($V01,[2,74]),o($Vn1,[2,78]),{22:$V11,24:$V21,26:$V31,38:$V41,39:227,42:$V51,47:$VH,62:$V61,70:$V71,73:132,74:$V81,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},o($Vk1,$V5,{17:228}),o($VB,[2,43]),{46:229,47:$Vb,49:43,81:$Vh,95:$Vi,96:$Vj,99:$Vk,100:$Vl,101:$Vm,103:$Vn,104:$Vo,108:44,114:$Vt,115:$Vu,116:$Vv,117:$Vw,118:$Vx,119:$Vy},{22:$Vq1,76:$Vr1,86:230,92:$Vs1,95:$Vt1,97:231,98:232,99:$Vu1,100:$Vv1,101:$Vw1,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1},{22:$Vq1,76:$Vr1,86:244,92:$Vs1,95:$Vt1,97:231,98:232,99:$Vu1,100:$Vv1,101:$Vw1,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1},{22:$Vq1,76:$Vr1,86:245,92:$Vs1,94:[1,246],95:$Vt1,97:231,98:232,99:$Vu1,100:$Vv1,101:$Vw1,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1},{22:$Vq1,76:$Vr1,86:247,92:$Vs1,94:[1,248],95:$Vt1,97:231,98:232,99:$Vu1,100:$Vv1,101:$Vw1,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1},{95:[1,249]},{22:$Vq1,76:$Vr1,86:250,92:$Vs1,95:$Vt1,97:231,98:232,99:$Vu1,100:$Vv1,101:$Vw1,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1},{22:$Vq1,76:$Vr1,86:251,92:$Vs1,95:$Vt1,97:231,98:232,99:$Vu1,100:$Vv1,101:$Vw1,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1},{26:$VG,47:$VH,81:$VI,87:252,95:$VJ,96:$VK,99:$VL,100:$VM,101:$VN,103:$VO,104:$VP,107:94,109:92,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},o($VZ,[2,97]),{74:[1,253]},o($VZ,[2,101],{22:[1,254]}),o($VZ,[2,102]),o($VZ,[2,105]),o($VZ,[2,107],{22:[1,255]}),o($VZ,[2,108]),o($VX,[2,55]),{22:$V11,24:$V21,26:$V31,38:$V41,42:$V51,47:$VH,51:[1,256],62:$V61,70:$V71,73:191,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},o($VX,[2,61]),o($VX,[2,57]),o($VX,[2,58]),o($VX,[2,59]),o($VX,[2,60]),o($VX,[2,62]),{22:$V11,24:$V21,26:$V31,38:$V41,42:$V51,47:$VH,61:[1,257],62:$V61,70:$V71,73:191,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},o($VX,[2,64]),o($VX,[2,65]),o($VX,[2,67]),o($VX,[2,66]),o($VX,[2,68]),o($Vo1,[2,4]),o([22,47,81,95,96,99,100,101,103,104,114,115,116,117,118,119],[2,76]),{22:$V11,24:$V21,26:$V31,38:$V41,41:[1,258],42:$V51,47:$VH,62:$V61,70:$V71,73:191,75:143,76:$V91,77:$Va1,78:$Vb1,79:$Vc1,80:$Vd1,81:$Ve1,82:$Vf1,84:134,85:$Vg1,95:$VJ,96:$VK,99:$VL,100:$VM,101:$Vh1,103:$VO,104:$VP,105:$Vi1,106:$Vj1,107:140,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,259],43:31,45:32,46:42,47:$Vb,49:43,76:$Vc,77:$Vd,78:$Ve,79:$Vf,80:$Vg,81:$Vh,95:$Vi,96:$Vj,99:$Vk,100:$Vl,101:$Vm,103:$Vn,104:$Vo,108:44,110:$Vp,111:$Vq,112:$Vr,113:$Vs,114:$Vt,115:$Vu,116:$Vv,117:$Vw,118:$Vx,119:$Vy},o($VW,[2,53]),o($VZ,[2,110],{96:$VB1}),o($VC1,[2,120],{98:261,22:$Vq1,76:$Vr1,92:$Vs1,95:$Vt1,99:$Vu1,100:$Vv1,101:$Vw1,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1}),o($VD1,[2,122]),o($VD1,[2,124]),o($VD1,[2,125]),o($VD1,[2,126]),o($VD1,[2,127]),o($VD1,[2,128]),o($VD1,[2,129]),o($VD1,[2,130]),o($VD1,[2,131]),o($VD1,[2,132]),o($VD1,[2,133]),o($VD1,[2,134]),o($VZ,[2,111],{96:$VB1}),o($VZ,[2,112],{96:$VB1}),{22:[1,262]},o($VZ,[2,113],{96:$VB1}),{22:[1,263]},o($Vp1,[2,119]),o($VZ,[2,93],{96:$VB1}),o($VZ,[2,94],{96:$VB1}),o($VZ,[2,95],{107:94,109:170,26:$VG,47:$VH,81:$VI,95:$VJ,96:$VK,99:$VL,100:$VM,101:$VN,103:$VO,104:$VP,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV}),o($VZ,[2,99]),{91:[1,264]},{91:[1,265]},{51:[1,266]},{61:[1,267]},{9:268,20:$VC,21:$VD,23:$VE},o($VB,[2,42]),{22:$Vq1,76:$Vr1,92:$Vs1,95:$Vt1,97:269,98:232,99:$Vu1,100:$Vv1,101:$Vw1,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1},o($VD1,[2,123]),{26:$VG,47:$VH,81:$VI,87:270,95:$VJ,96:$VK,99:$VL,100:$VM,101:$VN,103:$VO,104:$VP,107:94,109:92,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},{26:$VG,47:$VH,81:$VI,87:271,95:$VJ,96:$VK,99:$VL,100:$VM,101:$VN,103:$VO,104:$VP,107:94,109:92,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV},o($VZ,[2,103]),o($VZ,[2,109]),o($VX,[2,56]),o($VX,[2,63]),o($Vk1,$V5,{17:272}),o($VC1,[2,121],{98:261,22:$Vq1,76:$Vr1,92:$Vs1,95:$Vt1,99:$Vu1,100:$Vv1,101:$Vw1,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1}),o($VZ,[2,116],{107:94,109:170,22:[1,273],26:$VG,47:$VH,81:$VI,95:$VJ,96:$VK,99:$VL,100:$VM,101:$VN,103:$VO,104:$VP,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV}),o($VZ,[2,117],{107:94,109:170,22:[1,274],26:$VG,47:$VH,81:$VI,95:$VJ,96:$VK,99:$VL,100:$VM,101:$VN,103:$VO,104:$VP,114:$VQ,115:$VR,116:$VS,117:$VT,118:$VU,119:$VV}),{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,275],43:31,45:32,46:42,47:$Vb,49:43,76:$Vc,77:$Vd,78:$Ve,79:$Vf,80:$Vg,81:$Vh,95:$Vi,96:$Vj,99:$Vk,100:$Vl,101:$Vm,103:$Vn,104:$Vo,108:44,110:$Vp,111:$Vq,112:$Vr,113:$Vs,114:$Vt,115:$Vu,116:$Vv,117:$Vw,118:$Vx,119:$Vy},{22:$Vq1,76:$Vr1,86:276,92:$Vs1,95:$Vt1,97:231,98:232,99:$Vu1,100:$Vv1,101:$Vw1,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1},{22:$Vq1,76:$Vr1,86:277,92:$Vs1,95:$Vt1,97:231,98:232,99:$Vu1,100:$Vv1,101:$Vw1,102:$Vx1,103:$Vy1,104:$Vz1,105:$VA1},o($VB,[2,41]),o($VZ,[2,114],{96:$VB1}),o($VZ,[2,115],{96:$VB1})], -defaultActions: {2:[2,1],9:[2,5],10:[2,2],124:[2,7]}, +table: [{3:1,4:2,5:3,6:5,12:$V0,16:4,21:$V1,22:$V2,24:$V3},{1:[3]},{1:[2,1]},{3:10,4:2,5:3,6:5,12:$V0,16:4,21:$V1,22:$V2,24:$V3},o($V4,$V5,{17:11}),{7:12,13:[1,13]},{16:14,21:$V1,22:$V2,24:$V3},{16:15,21:$V1,22:$V2,24:$V3},{25:[1,16],26:[1,17]},{13:[2,5]},{1:[2,2]},{1:[2,9],18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,44:31,45:37,46:$Vb,48:38,75:$Vc,76:$Vd,77:$Ve,78:$Vf,79:$Vg,80:$Vh,91:$Vi,92:$Vj,95:$Vk,96:$Vl,97:$Vm,99:$Vn,100:$Vo,104:39,106:$Vp,107:$Vq,108:$Vr,109:$Vs,110:$Vt,111:$Vu},{8:55,10:[1,56],15:$Vv},o([10,15],[2,6]),o($V4,[2,17]),o($V4,[2,18]),o($V4,[2,19]),{20:[1,59],21:[1,60],22:$Vw,27:58,30:61},o($Vx,[2,11]),o($Vx,[2,12]),o($Vx,[2,13]),o($Vx,[2,14]),o($Vx,[2,15]),o($Vx,[2,16]),{9:63,20:$Vy,21:$Vz,23:$VA,43:64,66:68,69:[1,69],70:[1,70]},{9:71,20:$Vy,21:$Vz,23:$VA},{9:72,20:$Vy,21:$Vz,23:$VA},{9:73,20:$Vy,21:$Vz,23:$VA},{9:74,20:$Vy,21:$Vz,23:$VA},{9:75,20:$Vy,21:$Vz,23:$VA},{9:77,20:$Vy,21:$Vz,22:[1,76],23:$VA},o($VB,[2,50],{30:78,22:$Vw}),{22:[1,79]},{22:[1,80]},{22:[1,81]},{22:[1,82]},{22:[1,83]},o($VC,[2,51],{47:[1,84]}),o($VD,[2,68],{104:95,40:[1,85],46:$Vb,49:[1,86],51:[1,87],53:[1,88],55:[1,89],57:[1,90],59:[1,91],61:[1,92],62:[1,93],64:[1,94],80:$Vh,91:$Vi,92:$Vj,95:$Vk,96:$Vl,97:$Vm,99:$Vn,100:$Vo,106:$Vp,107:$Vq,108:$Vr,109:$Vs,110:$Vt,111:$Vu}),o($VE,[2,136]),o($VE,[2,157]),o($VE,[2,158]),o($VE,[2,159]),o($VE,[2,160]),o($VE,[2,161]),o($VE,[2,162]),o($VE,[2,163]),o($VE,[2,164]),o($VE,[2,165]),o($VE,[2,166]),o($VE,[2,167]),o($VE,[2,168]),o($VE,[2,169]),o($VE,[2,170]),o($VE,[2,171]),{9:96,20:$Vy,21:$Vz,23:$VA},{11:97,14:[1,98]},o($VF,[2,8]),o($V4,[2,20]),o($V4,[2,26]),o($V4,[2,27]),{21:[1,99]},o($VG,[2,34],{30:100,22:$Vw}),o($Vx,[2,35]),{44:101,45:37,46:$Vb,48:38,80:$Vh,91:$Vi,92:$Vj,95:$Vk,96:$Vl,97:$Vm,99:$Vn,100:$Vo,104:39,106:$Vp,107:$Vq,108:$Vr,109:$Vs,110:$Vt,111:$Vu},o($VH,[2,44]),o($VH,[2,45]),o($VH,[2,46]),o($VI,[2,72],{67:102,68:[1,103],71:[1,104]}),{22:$VJ,24:$VK,26:$VL,38:$VM,39:105,42:$VN,46:$VO,61:$VP,69:$VQ,72:106,73:$VR,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},o([46,68,71,80,91,92,95,96,97,99,100,106,107,108,109,110,111],[2,74]),o($Vx,[2,36]),o($Vx,[2,37]),o($Vx,[2,38]),o($Vx,[2,39]),o($Vx,[2,40]),{22:$VJ,24:$VK,26:$VL,38:$VM,39:142,42:$VN,46:$VO,61:$VP,69:$VQ,72:106,73:$VR,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},o($Vd1,$V5,{17:143}),o($VB,[2,49],{46:$Ve1}),{26:$Vf1,46:$VO,80:$Vg1,86:145,88:[1,146],91:$V_,92:$V$,95:$V01,96:$V11,97:$Vh1,99:$V31,100:$V41,103:149,105:147,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{84:[1,152],89:153,91:[1,154]},{26:$Vf1,46:$VO,80:$Vg1,84:[1,155],86:156,91:$V_,92:$V$,95:$V01,96:$V11,97:$Vh1,99:$V31,100:$V41,103:149,105:147,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{26:$Vf1,46:$VO,80:$Vg1,86:157,91:$V_,92:$V$,95:$V01,96:$V11,97:$Vh1,99:$V31,100:$V41,103:149,105:147,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{26:$Vf1,46:$VO,80:$Vg1,86:158,91:$V_,92:$V$,95:$V01,96:$V11,97:$Vh1,99:$V31,100:$V41,103:149,105:147,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{46:$Vb,48:159,80:$Vh,91:$Vi,92:$Vj,95:$Vk,96:$Vl,97:$Vm,99:$Vn,100:$Vo,104:39,106:$Vp,107:$Vq,108:$Vr,109:$Vs,110:$Vt,111:$Vu},{22:$VJ,24:$VK,26:$VL,38:$VM,39:160,42:$VN,46:$VO,61:$VP,69:$VQ,72:106,73:$VR,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,39:162,42:$VN,46:$VO,49:[1,161],61:$VP,69:$VQ,72:106,73:$VR,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,39:163,42:$VN,46:$VO,61:$VP,69:$VQ,72:106,73:$VR,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,39:164,42:$VN,46:$VO,61:$VP,69:$VQ,72:106,73:$VR,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,39:165,42:$VN,46:$VO,61:$VP,69:$VQ,72:106,73:$VR,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,39:166,42:$VN,46:$VO,61:$VP,69:$VQ,72:106,73:$VR,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,39:167,42:$VN,46:$VO,59:[1,168],61:$VP,69:$VQ,72:106,73:$VR,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,39:169,42:$VN,46:$VO,61:$VP,69:$VQ,72:106,73:$VR,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,39:170,42:$VN,46:$VO,61:$VP,69:$VQ,72:106,73:$VR,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,39:171,42:$VN,46:$VO,61:$VP,69:$VQ,72:106,73:$VR,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},o($VE,[2,137]),o($Vi1,[2,3]),{8:172,15:$Vv},{15:[2,7]},o($V4,[2,28]),o($VG,[2,33]),o($VB,[2,47],{30:173,22:$Vw}),o($VI,[2,69],{22:[1,174]}),{22:[1,175]},{22:$VJ,24:$VK,26:$VL,38:$VM,39:176,42:$VN,46:$VO,61:$VP,69:$VQ,72:106,73:$VR,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,42:$VN,46:$VO,61:$VP,69:$VQ,70:[1,177],72:178,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},o($Vj1,[2,76]),o($Vj1,[2,78]),o($Vj1,[2,126]),o($Vj1,[2,127]),o($Vj1,[2,128]),o($Vj1,[2,129]),o($Vj1,[2,130]),o($Vj1,[2,131]),o($Vj1,[2,132]),o($Vj1,[2,133]),o($Vj1,[2,134]),o($Vj1,[2,135]),o($Vj1,[2,144]),o($Vj1,[2,145]),o($Vj1,[2,146]),o($Vj1,[2,147]),o($Vj1,[2,148]),o($Vj1,[2,149]),o($Vj1,[2,150]),o($Vj1,[2,151]),o($Vj1,[2,152]),o($Vj1,[2,153]),o($Vj1,[2,154]),o($Vj1,[2,155]),o($Vj1,[2,156]),o($Vj1,[2,79]),o($Vj1,[2,80]),o($Vj1,[2,81]),o($Vj1,[2,82]),o($Vj1,[2,83]),o($Vj1,[2,84]),o($Vj1,[2,85]),o($Vj1,[2,86]),o($Vj1,[2,87]),o($Vj1,[2,88]),o($Vj1,[2,89]),{9:180,20:$Vy,21:$Vz,22:$VJ,23:$VA,24:$VK,26:$VL,38:$VM,40:[1,179],42:$VN,46:$VO,61:$VP,69:$VQ,72:178,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,181],44:31,45:37,46:$Vb,48:38,75:$Vc,76:$Vd,77:$Ve,78:$Vf,79:$Vg,80:$Vh,91:$Vi,92:$Vj,95:$Vk,96:$Vl,97:$Vm,99:$Vn,100:$Vo,104:39,106:$Vp,107:$Vq,108:$Vr,109:$Vs,110:$Vt,111:$Vu},{22:$Vw,30:182},{22:[1,183],26:$Vf1,46:$VO,80:$Vg1,91:$V_,92:$V$,95:$V01,96:$V11,97:$Vh1,99:$V31,100:$V41,103:149,105:184,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:[1,185]},o($Vk1,[2,138]),o($Vk1,[2,140]),o($Vk1,[2,141]),o($Vk1,[2,142]),o($Vk1,[2,143]),{22:[1,186]},{22:[1,187],92:[1,188]},o($Vl1,[2,109]),{22:[1,189]},{22:[1,190],26:$Vf1,46:$VO,80:$Vg1,91:$V_,92:$V$,95:$V01,96:$V11,97:$Vh1,99:$V31,100:$V41,103:149,105:184,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:[1,191],26:$Vf1,46:$VO,80:$Vg1,91:$V_,92:$V$,95:$V01,96:$V11,97:$Vh1,99:$V31,100:$V41,103:149,105:184,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:[1,192],26:$Vf1,46:$VO,80:$Vg1,91:$V_,92:$V$,95:$V01,96:$V11,97:$Vh1,99:$V31,100:$V41,103:149,105:184,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},o($VC,[2,53],{104:95,46:$Vb,80:$Vh,91:$Vi,92:$Vj,95:$Vk,96:$Vl,97:$Vm,99:$Vn,100:$Vo,106:$Vp,107:$Vq,108:$Vr,109:$Vs,110:$Vt,111:$Vu}),{22:$VJ,24:$VK,26:$VL,38:$VM,41:[1,193],42:$VN,46:$VO,61:$VP,69:$VQ,72:178,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,39:194,42:$VN,46:$VO,61:$VP,69:$VQ,72:106,73:$VR,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,42:$VN,46:$VO,50:[1,195],61:$VP,69:$VQ,72:178,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,42:$VN,46:$VO,52:[1,196],61:$VP,69:$VQ,72:178,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,42:$VN,46:$VO,54:[1,197],61:$VP,69:$VQ,72:178,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,42:$VN,46:$VO,56:[1,198],61:$VP,69:$VQ,72:178,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,42:$VN,46:$VO,58:[1,199],61:$VP,69:$VQ,72:178,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,42:$VN,46:$VO,60:[1,200],61:$VP,69:$VQ,72:178,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,39:201,42:$VN,46:$VO,61:$VP,69:$VQ,72:106,73:$VR,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,41:[1,202],42:$VN,46:$VO,61:$VP,69:$VQ,72:178,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,42:$VN,46:$VO,61:$VP,63:[1,203],65:[1,204],69:$VQ,72:178,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{22:$VJ,24:$VK,26:$VL,38:$VM,42:$VN,46:$VO,61:$VP,63:[1,206],65:[1,205],69:$VQ,72:178,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{9:207,20:$Vy,21:$Vz,23:$VA},o($VB,[2,48],{46:$Ve1}),o($VI,[2,71]),o($VI,[2,70]),{22:$VJ,24:$VK,26:$VL,38:$VM,42:$VN,46:$VO,61:$VP,69:$VQ,71:[1,208],72:178,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},o($VI,[2,73]),o($Vj1,[2,77]),{22:$VJ,24:$VK,26:$VL,38:$VM,39:209,42:$VN,46:$VO,61:$VP,69:$VQ,72:106,73:$VR,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},o($Vd1,$V5,{17:210}),o($Vx,[2,43]),{45:211,46:$Vb,48:38,80:$Vh,91:$Vi,92:$Vj,95:$Vk,96:$Vl,97:$Vm,99:$Vn,100:$Vo,104:39,106:$Vp,107:$Vq,108:$Vr,109:$Vs,110:$Vt,111:$Vu},{22:$Vm1,75:$Vn1,85:212,88:$Vo1,91:$Vp1,93:213,94:214,95:$Vq1,96:$Vr1,97:$Vs1,98:$Vt1,99:$Vu1,100:$Vv1,101:$Vw1},o($Vk1,[2,139]),{22:$Vm1,75:$Vn1,85:226,88:$Vo1,91:$Vp1,93:213,94:214,95:$Vq1,96:$Vr1,97:$Vs1,98:$Vt1,99:$Vu1,100:$Vv1,101:$Vw1},{22:$Vm1,75:$Vn1,85:227,88:$Vo1,90:[1,228],91:$Vp1,93:213,94:214,95:$Vq1,96:$Vr1,97:$Vs1,98:$Vt1,99:$Vu1,100:$Vv1,101:$Vw1},{22:$Vm1,75:$Vn1,85:229,88:$Vo1,90:[1,230],91:$Vp1,93:213,94:214,95:$Vq1,96:$Vr1,97:$Vs1,98:$Vt1,99:$Vu1,100:$Vv1,101:$Vw1},{91:[1,231]},{22:$Vm1,75:$Vn1,85:232,88:$Vo1,91:$Vp1,93:213,94:214,95:$Vq1,96:$Vr1,97:$Vs1,98:$Vt1,99:$Vu1,100:$Vv1,101:$Vw1},{22:$Vm1,75:$Vn1,85:233,88:$Vo1,91:$Vp1,93:213,94:214,95:$Vq1,96:$Vr1,97:$Vs1,98:$Vt1,99:$Vu1,100:$Vv1,101:$Vw1},{26:$Vf1,46:$VO,80:$Vg1,86:234,91:$V_,92:$V$,95:$V01,96:$V11,97:$Vh1,99:$V31,100:$V41,103:149,105:147,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{26:$Vf1,46:$VO,73:[1,236],80:$Vg1,86:235,91:$V_,92:$V$,95:$V01,96:$V11,97:$Vh1,99:$V31,100:$V41,103:149,105:147,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},o($VD,[2,54]),{22:$VJ,24:$VK,26:$VL,38:$VM,42:$VN,46:$VO,50:[1,237],61:$VP,69:$VQ,72:178,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},o($VD,[2,60]),o($VD,[2,56]),o($VD,[2,57]),o($VD,[2,58]),o($VD,[2,59]),o($VD,[2,61]),{22:$VJ,24:$VK,26:$VL,38:$VM,42:$VN,46:$VO,60:[1,238],61:$VP,69:$VQ,72:178,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},o($VD,[2,63]),o($VD,[2,64]),o($VD,[2,66]),o($VD,[2,65]),o($VD,[2,67]),o($Vi1,[2,4]),o([22,46,80,91,92,95,96,97,99,100,106,107,108,109,110,111],[2,75]),{22:$VJ,24:$VK,26:$VL,38:$VM,41:[1,239],42:$VN,46:$VO,61:$VP,69:$VQ,72:178,74:117,75:$VS,76:$VT,77:$VU,78:$VV,79:$VW,80:$VX,81:$VY,83:108,84:$VZ,91:$V_,92:$V$,95:$V01,96:$V11,97:$V21,99:$V31,100:$V41,101:$V51,102:$V61,103:114,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,240],44:31,45:37,46:$Vb,48:38,75:$Vc,76:$Vd,77:$Ve,78:$Vf,79:$Vg,80:$Vh,91:$Vi,92:$Vj,95:$Vk,96:$Vl,97:$Vm,99:$Vn,100:$Vo,104:39,106:$Vp,107:$Vq,108:$Vr,109:$Vs,110:$Vt,111:$Vu},o($VC,[2,52]),o($VF,[2,101],{92:$Vx1}),o($Vy1,[2,111],{94:242,22:$Vm1,75:$Vn1,88:$Vo1,91:$Vp1,95:$Vq1,96:$Vr1,97:$Vs1,98:$Vt1,99:$Vu1,100:$Vv1,101:$Vw1}),o($Vz1,[2,113]),o($Vz1,[2,115]),o($Vz1,[2,116]),o($Vz1,[2,117]),o($Vz1,[2,118]),o($Vz1,[2,119]),o($Vz1,[2,120]),o($Vz1,[2,121]),o($Vz1,[2,122]),o($Vz1,[2,123]),o($Vz1,[2,124]),o($Vz1,[2,125]),o($VF,[2,102],{92:$Vx1}),o($VF,[2,103],{92:$Vx1}),{22:[1,243]},o($VF,[2,104],{92:$Vx1}),{22:[1,244]},o($Vl1,[2,110]),o($VF,[2,92],{92:$Vx1}),o($VF,[2,93],{92:$Vx1}),o($VF,[2,94],{103:149,105:184,26:$Vf1,46:$VO,80:$Vg1,91:$V_,92:$V$,95:$V01,96:$V11,97:$Vh1,99:$V31,100:$V41,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1}),o($VF,[2,95],{103:149,105:184,22:[1,245],26:$Vf1,46:$VO,80:$Vg1,91:$V_,92:$V$,95:$V01,96:$V11,97:$Vh1,99:$V31,100:$V41,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1}),o($VF,[2,97],{22:[1,246]}),{50:[1,247]},{60:[1,248]},{9:249,20:$Vy,21:$Vz,23:$VA},o($Vx,[2,42]),{22:$Vm1,75:$Vn1,88:$Vo1,91:$Vp1,93:250,94:214,95:$Vq1,96:$Vr1,97:$Vs1,98:$Vt1,99:$Vu1,100:$Vv1,101:$Vw1},o($Vz1,[2,114]),{26:$Vf1,46:$VO,80:$Vg1,86:251,91:$V_,92:$V$,95:$V01,96:$V11,97:$Vh1,99:$V31,100:$V41,103:149,105:147,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{26:$Vf1,46:$VO,80:$Vg1,86:252,91:$V_,92:$V$,95:$V01,96:$V11,97:$Vh1,99:$V31,100:$V41,103:149,105:147,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1},{73:[1,253]},{73:[1,254],87:[1,255]},o($VD,[2,55]),o($VD,[2,62]),o($Vd1,$V5,{17:256}),o($Vy1,[2,112],{94:242,22:$Vm1,75:$Vn1,88:$Vo1,91:$Vp1,95:$Vq1,96:$Vr1,97:$Vs1,98:$Vt1,99:$Vu1,100:$Vv1,101:$Vw1}),o($VF,[2,107],{103:149,105:184,22:[1,257],26:$Vf1,46:$VO,80:$Vg1,91:$V_,92:$V$,95:$V01,96:$V11,97:$Vh1,99:$V31,100:$V41,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1}),o($VF,[2,108],{103:149,105:184,22:[1,258],26:$Vf1,46:$VO,80:$Vg1,91:$V_,92:$V$,95:$V01,96:$V11,97:$Vh1,99:$V31,100:$V41,106:$V71,107:$V81,108:$V91,109:$Va1,110:$Vb1,111:$Vc1}),o($VF,[2,96]),o($VF,[2,98],{22:[1,259]}),o($VF,[2,99]),{18:18,19:19,20:$V6,21:$V7,22:$V8,23:$V9,32:24,33:25,34:26,35:27,36:28,37:29,38:$Va,42:[1,260],44:31,45:37,46:$Vb,48:38,75:$Vc,76:$Vd,77:$Ve,78:$Vf,79:$Vg,80:$Vh,91:$Vi,92:$Vj,95:$Vk,96:$Vl,97:$Vm,99:$Vn,100:$Vo,104:39,106:$Vp,107:$Vq,108:$Vr,109:$Vs,110:$Vt,111:$Vu},{22:$Vm1,75:$Vn1,85:261,88:$Vo1,91:$Vp1,93:213,94:214,95:$Vq1,96:$Vr1,97:$Vs1,98:$Vt1,99:$Vu1,100:$Vv1,101:$Vw1},{22:$Vm1,75:$Vn1,85:262,88:$Vo1,91:$Vp1,93:213,94:214,95:$Vq1,96:$Vr1,97:$Vs1,98:$Vt1,99:$Vu1,100:$Vv1,101:$Vw1},{87:[1,263]},o($Vx,[2,41]),o($VF,[2,105],{92:$Vx1}),o($VF,[2,106],{92:$Vx1}),o($VF,[2,100])], +defaultActions: {2:[2,1],9:[2,5],10:[2,2],98:[2,7]}, parseError: function parseError (str, hash) { if (hash.recoverable) { this.trace(str); @@ -115331,111 +114613,88 @@ break; case 8:this.popState(); break; case 9:return "STR"; -case 10:return 76; -case 11:return 85; -case 12:return 77; -case 13:return 94; -case 14:return 78; -case 15:return 79; -case 16:this.begin("href"); -break; -case 17:this.popState(); -break; -case 18:return 90; -case 19:this.begin("callbackname"); -break; -case 20:this.popState(); -break; -case 21:this.popState(); this.begin("callbackargs"); -break; -case 22:return 88; -case 23:this.popState(); -break; -case 24:return 89; -case 25:this.begin("click"); -break; -case 26:this.popState(); -break; -case 27:return 80; -case 28:if(yy.lex.firstGraph()){this.begin("dir");} return 24; -case 29:if(yy.lex.firstGraph()){this.begin("dir");} return 24; -case 30:return 38; -case 31:return 42; -case 32:return 91; -case 33:return 91; -case 34:return 91; -case 35:return 91; -case 36: this.popState(); return 25; -case 37: this.popState(); return 26; -case 38: this.popState(); return 26; -case 39: this.popState(); return 26; -case 40: this.popState(); return 26; -case 41: this.popState(); return 26; -case 42: this.popState(); return 26; -case 43: this.popState(); return 26; -case 44: this.popState(); return 26; -case 45: this.popState(); return 26; -case 46: this.popState(); return 26; -case 47:return 110; -case 48:return 111; -case 49:return 112; -case 50:return 113; -case 51: return 95; -case 52:return 103; -case 53:return 48; -case 54:return 100; -case 55:return 47; -case 56:return 20; -case 57:return 96; -case 58:return 118; -case 59:return 71; -case 60:return 71; -case 61:return 71; -case 62:return 70; -case 63:return 70; -case 64:return 70; -case 65:return 52; -case 66:return 53; -case 67:return 54; -case 68:return 55; -case 69:return 56; -case 70:return 57; -case 71:return 58; -case 72:return 59; -case 73:return 101; -case 74:return 104; -case 75:return 119; -case 76:return 116; -case 77:return 105; -case 78:return 117; -case 79:return 117; -case 80:return 106; -case 81:return 62; -case 82:return 82; -case 83:return 'SEP'; -case 84:return 81; -case 85:return 99; -case 86:return 64; -case 87:return 63; -case 88:return 66; -case 89:return 65; -case 90:return 114; -case 91:return 115; -case 92:return 72; -case 93:return 50; -case 94:return 51; -case 95:return 40; -case 96:return 41; -case 97:return 60 -case 98:return 61 -case 99:return 125; -case 100:return 21; -case 101:return 22; -case 102:return 23; +case 10:return 75; +case 11:return 84; +case 12:return 76; +case 13:return 90; +case 14:return 77; +case 15:return 78; +case 16:return 79; +case 17:if(yy.lex.firstGraph()){this.begin("dir");} return 24; +case 18:if(yy.lex.firstGraph()){this.begin("dir");} return 24; +case 19:return 38; +case 20:return 42; +case 21:return 87; +case 22:return 87; +case 23:return 87; +case 24:return 87; +case 25: this.popState(); return 25; +case 26: this.popState(); return 26; +case 27: this.popState(); return 26; +case 28: this.popState(); return 26; +case 29: this.popState(); return 26; +case 30: this.popState(); return 26; +case 31: this.popState(); return 26; +case 32: this.popState(); return 26; +case 33: this.popState(); return 26; +case 34: this.popState(); return 26; +case 35: this.popState(); return 26; +case 36: return 91; +case 37:return 99; +case 38:return 47; +case 39:return 96; +case 40:return 46; +case 41:return 20; +case 42:return 92; +case 43:return 110; +case 44:return 70; +case 45:return 70; +case 46:return 70; +case 47:return 69; +case 48:return 69; +case 49:return 69; +case 50:return 51; +case 51:return 52; +case 52:return 53; +case 53:return 54; +case 54:return 55; +case 55:return 56; +case 56:return 57; +case 57:return 58; +case 58:return 97; +case 59:return 100; +case 60:return 111; +case 61:return 108; +case 62:return 101; +case 63:return 109; +case 64:return 109; +case 65:return 102; +case 66:return 61; +case 67:return 81; +case 68:return 'SEP'; +case 69:return 80; +case 70:return 95; +case 71:return 63; +case 72:return 62; +case 73:return 65; +case 74:return 64; +case 75:return 106; +case 76:return 107; +case 77:return 71; +case 78:return 49; +case 79:return 50; +case 80:return 40; +case 81:return 41; +case 82:return 59 +case 83:return 60 +case 84:return 117; +case 85:return 21; +case 86:return 22; +case 87:return 23; } }, -rules: [/^(?:%%\{)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[^\}]%%[^\n]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s]+["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\[)/,/^(?:\]\))/,/^(?:\[\[)/,/^(?:\]\])/,/^(?:\[\()/,/^(?:\)\])/,/^(?:-)/,/^(?:\.)/,/^(?:[\_])/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:[A-Za-z]+)/,/^(?:\\\])/,/^(?:\[\/)/,/^(?:\/\])/,/^(?:\[\\)/,/^(?:[!"#$%&'*+,-.`?\\_/])/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/], -conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"callbackargs":{"rules":[23,24],"inclusive":false},"callbackname":{"rules":[20,21,22],"inclusive":false},"href":{"rules":[17,18],"inclusive":false},"click":{"rules":[26,27],"inclusive":false},"vertex":{"rules":[],"inclusive":false},"dir":{"rules":[36,37,38,39,40,41,42,43,44,45,46],"inclusive":false},"string":{"rules":[8,9],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,10,11,12,13,14,15,16,19,25,28,29,30,31,32,33,34,35,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102],"inclusive":true}} +rules: [/^(?:%%\{)/,/^(?:((?:(?!\}%%)[^:.])*))/,/^(?::)/,/^(?:\}%%)/,/^(?:((?:(?!\}%%).|\n)*))/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[^\}]%%[^\n]*)/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:click\b)/,/^(?:graph\b)/,/^(?:flowchart\b)/,/^(?:subgraph\b)/,/^(?:end\b\s*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\[)/,/^(?:\]\))/,/^(?:\[\[)/,/^(?:\]\])/,/^(?:\[\()/,/^(?:\)\])/,/^(?:-)/,/^(?:\.)/,/^(?:[\_])/,/^(?:\+)/,/^(?:%)/,/^(?:=)/,/^(?:=)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:[A-Za-z]+)/,/^(?:\\\])/,/^(?:\[\/)/,/^(?:\/\])/,/^(?:\[\\)/,/^(?:[!"#$%&'*+,-.`?\\_/])/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\()/,/^(?:\))/,/^(?:\[)/,/^(?:\])/,/^(?:\{)/,/^(?:\})/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/], +conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"vertex":{"rules":[],"inclusive":false},"dir":{"rules":[25,26,27,28,29,30,31,32,33,34,35],"inclusive":false},"string":{"rules":[8,9],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87],"inclusive":true}} }); return lexer; })(); @@ -115476,7 +114735,7 @@ if ( __webpack_require__.c[__webpack_require__.s] === module) { /***/ (function(module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); var getStyles = function getStyles(options) { - return ".label {\n font-family: ".concat(options.fontFamily, ";\n color: ").concat(options.nodeTextColor || options.textColor, ";\n }\n .cluster-label text {\n fill: ").concat(options.titleColor, ";\n }\n .cluster-label span {\n color: ").concat(options.titleColor, ";\n }\n\n .label text,span {\n fill: ").concat(options.nodeTextColor || options.textColor, ";\n color: ").concat(options.nodeTextColor || options.textColor, ";\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ").concat(options.arrowheadColor, ";\n }\n\n .edgePath .path {\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ").concat(options.lineColor, ";\n fill: none;\n }\n\n .edgeLabel {\n background-color: ").concat(options.edgeLabelBackground, ";\n rect {\n opacity: 0.5;\n background-color: ").concat(options.edgeLabelBackground, ";\n fill: ").concat(options.edgeLabelBackground, ";\n }\n text-align: center;\n }\n\n .cluster rect {\n fill: ").concat(options.clusterBkg, ";\n stroke: ").concat(options.clusterBorder, ";\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ").concat(options.titleColor, ";\n }\n\n .cluster span {\n color: ").concat(options.titleColor, ";\n }\n // .cluster div {\n // color: ").concat(options.titleColor, ";\n // }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ").concat(options.fontFamily, ";\n font-size: 12px;\n background: ").concat(options.tertiaryColor, ";\n border: 1px solid ").concat(options.border2, ";\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n"); + return ".label {\n font-family: ".concat(options.fontFamily, ";\n color: ").concat(options.nodeTextColor || options.textColor, ";\n }\n\n .label text {\n fill: ").concat(options.nodeTextColor || options.textColor, ";\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n stroke-width: 1px;\n }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ").concat(options.arrowheadColor, ";\n }\n\n .edgePath .path {\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1.5px;\n }\n\n .flowchart-link {\n stroke: ").concat(options.lineColor, ";\n fill: none;\n }\n\n .edgeLabel {\n background-color: ").concat(options.edgeLabelBackground, ";\n rect {\n opacity: 0.5;\n background-color: ").concat(options.edgeLabelBackground, ";\n fill: ").concat(options.edgeLabelBackground, ";\n }\n text-align: center;\n }\n\n .cluster rect {\n fill: ").concat(options.clusterBkg, ";\n stroke: ").concat(options.clusterBorder, ";\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ").concat(options.titleColor, ";\n }\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ").concat(options.fontFamily, ";\n font-size: 12px;\n background: ").concat(options.tertiaryColor, ";\n border: 1px solid ").concat(options.border2, ";\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n"); }; /* harmony default export */ __webpack_exports__["default"] = (getStyles); @@ -115487,7 +114746,7 @@ var getStyles = function getStyles(options) { /*!***************************************!*\ !*** ./src/diagrams/gantt/ganttDb.js ***! \***************************************/ -/*! exports provided: parseDirective, clear, setAxisFormat, getAxisFormat, setTodayMarker, getTodayMarker, setDateFormat, enableInclusiveEndDates, endDatesAreInclusive, enableTopAxis, topAxisEnabled, getDateFormat, setExcludes, getExcludes, setTitle, getTitle, addSection, getSections, getTasks, addTask, findTaskById, addTaskOrg, setLink, setClass, setClickEvent, bindFunctions, default */ +/*! exports provided: parseDirective, clear, setAxisFormat, getAxisFormat, setTodayMarker, getTodayMarker, setDateFormat, enableInclusiveEndDates, endDatesAreInclusive, getDateFormat, setExcludes, getExcludes, setTitle, getTitle, addSection, getSections, getTasks, addTask, findTaskById, addTaskOrg, setLink, setClass, setClickEvent, bindFunctions, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseDirective", function() { return parseDirective; }); @@ -115499,8 +114758,6 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setDateFormat", function() { return setDateFormat; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableInclusiveEndDates", function() { return enableInclusiveEndDates; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "endDatesAreInclusive", function() { return endDatesAreInclusive; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "enableTopAxis", function() { return enableTopAxis; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "topAxisEnabled", function() { return topAxisEnabled; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDateFormat", function() { return getDateFormat; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setExcludes", function() { return setExcludes; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getExcludes", function() { return getExcludes; }); @@ -115547,8 +114804,7 @@ var tasks = []; var currentSection = ''; var tags = ['active', 'done', 'crit', 'milestone']; var funs = []; -var inclusiveEndDates = false; -var topAxis = false; // The serial order of the task in the script +var inclusiveEndDates = false; // The serial order of the task in the script var lastOrder = 0; var parseDirective = function parseDirective(statement, context, type) { @@ -115569,7 +114825,6 @@ var clear = function clear() { todayMarker = ''; excludes = []; inclusiveEndDates = false; - topAxis = false; lastOrder = 0; }; var setAxisFormat = function setAxisFormat(txt) { @@ -115593,12 +114848,6 @@ var enableInclusiveEndDates = function enableInclusiveEndDates() { var endDatesAreInclusive = function endDatesAreInclusive() { return inclusiveEndDates; }; -var enableTopAxis = function enableTopAxis() { - topAxis = true; -}; -var topAxisEnabled = function topAxisEnabled() { - return topAxis; -}; var getDateFormat = function getDateFormat() { return dateFormat; }; @@ -115716,8 +114965,8 @@ var getStartDate = function getStartDate(prevTime, dateFormat, str) { if (mDate.isValid()) { return mDate.toDate(); } else { - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].debug('Invalid date:' + str); - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].debug('With date format:' + dateFormat.trim()); + _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Invalid date:' + str); + _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('With date format:' + dateFormat.trim()); } // Default date - now @@ -116145,8 +115394,6 @@ var bindFunctions = function bindFunctions(element) { getDateFormat: getDateFormat, enableInclusiveEndDates: enableInclusiveEndDates, endDatesAreInclusive: endDatesAreInclusive, - enableTopAxis: enableTopAxis, - topAxisEnabled: topAxisEnabled, setAxisFormat: setAxisFormat, getAxisFormat: getAxisFormat, setTodayMarker: setTodayMarker, @@ -116200,23 +115447,32 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _parser_gantt__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parser/gantt */ "./src/diagrams/gantt/parser/gantt.jison"); /* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); /* harmony import */ var _ganttDb__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ganttDb */ "./src/diagrams/gantt/ganttDb.js"); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../config */ "./src/config.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); - +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); _parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy = _ganttDb__WEBPACK_IMPORTED_MODULE_3__["default"]; -var setConf = function setConf() {// const keys = Object.keys(cnf); - // keys.forEach(function(key) { - // conf[key] = cnf[key]; - // }); +var conf = { + titleTopMargin: 25, + barHeight: 20, + barGap: 4, + topPadding: 50, + rightPadding: 75, + leftPadding: 75, + gridLineStartPadding: 35, + fontSize: 11, + fontFamily: '"Open-Sans", "sans-serif"' +}; +var setConf = function setConf(cnf) { + var keys = Object.keys(cnf); + keys.forEach(function (key) { + conf[key] = cnf[key]; + }); }; var w; var draw = function draw(text, id) { - var conf = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().gantt; _parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.clear(); _parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].parse(text); var elem = document.getElementById(id); @@ -116270,7 +115526,7 @@ var draw = function draw(text, id) { taskArray.sort(taskCompare); makeGant(taskArray, w, h); - Object(_utils__WEBPACK_IMPORTED_MODULE_5__["configureSvgSize"])(svg, h, w, conf.useMaxWidth); + Object(_utils__WEBPACK_IMPORTED_MODULE_4__["configureSvgSize"])(svg, h, w, conf.useMaxWidth); svg.append('text').text(_parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.getTitle()).attr('x', w / 2).attr('y', conf.titleTopMargin).attr('class', 'titleText'); function makeGant(tasks, pageWidth, pageHeight) { @@ -116323,8 +115579,6 @@ var draw = function draw(text, id) { return timeScale(d.renderEndTime || d.endTime) - timeScale(d.startTime); }).attr('height', theBarHeight).attr('transform-origin', function (d, i) { - // Ignore the incoming i value and use our order instead - i = d.order; return (timeScale(d.startTime) + theSidePad + 0.5 * (timeScale(d.endTime) - timeScale(d.startTime))).toString() + 'px ' + (i * theGap + theTopPad + 0.5 * theBarHeight).toString() + 'px'; }).attr('class', function (d) { var res = 'task'; @@ -116469,13 +115723,8 @@ var draw = function draw(text, id) { } function makeGrid(theSidePad, theTopPad, w, h) { - var bottomXAxis = Object(d3__WEBPACK_IMPORTED_MODULE_0__["axisBottom"])(timeScale).tickSize(-h + theTopPad + conf.gridLineStartPadding).tickFormat(Object(d3__WEBPACK_IMPORTED_MODULE_0__["timeFormat"])(_parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.getAxisFormat() || conf.axisFormat || '%Y-%m-%d')); - svg.append('g').attr('class', 'grid').attr('transform', 'translate(' + theSidePad + ', ' + (h - 50) + ')').call(bottomXAxis).selectAll('text').style('text-anchor', 'middle').attr('fill', '#000').attr('stroke', 'none').attr('font-size', 10).attr('dy', '1em'); - - if (_ganttDb__WEBPACK_IMPORTED_MODULE_3__["default"].topAxisEnabled() || conf.topAxis) { - var topXAxis = Object(d3__WEBPACK_IMPORTED_MODULE_0__["axisTop"])(timeScale).tickSize(-h + theTopPad + conf.gridLineStartPadding).tickFormat(Object(d3__WEBPACK_IMPORTED_MODULE_0__["timeFormat"])(_parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.getAxisFormat() || conf.axisFormat || '%Y-%m-%d')); - svg.append('g').attr('class', 'grid').attr('transform', 'translate(' + theSidePad + ', ' + theTopPad + ')').call(topXAxis).selectAll('text').style('text-anchor', 'middle').attr('fill', '#000').attr('stroke', 'none').attr('font-size', 10); // .attr('dy', '1em'); - } + var xAxis = Object(d3__WEBPACK_IMPORTED_MODULE_0__["axisBottom"])(timeScale).tickSize(-h + theTopPad + conf.gridLineStartPadding).tickFormat(Object(d3__WEBPACK_IMPORTED_MODULE_0__["timeFormat"])(_parser_gantt__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.getAxisFormat() || conf.axisFormat || '%Y-%m-%d')); + svg.append('g').attr('class', 'grid').attr('transform', 'translate(' + theSidePad + ', ' + (h - 50) + ')').call(xAxis).selectAll('text').style('text-anchor', 'middle').attr('fill', '#000').attr('stroke', 'none').attr('font-size', 10).attr('dy', '1em'); } function vertLabels(theGap, theTopPad) { @@ -116512,7 +115761,7 @@ var draw = function draw(text, id) { } else { return d[1] * theGap / 2 + theTopPad; } - }).attr('font-size', conf.sectionFontSize).attr('font-size', conf.sectionFontSize).attr('class', function (d) { + }).attr('class', function (d) { for (var _i5 = 0; _i5 < categories.length; _i5++) { if (d[0] === categories[_i5]) { return 'sectionTitle sectionTitle' + _i5 % conf.numberSectionStyles; @@ -116663,12 +115912,12 @@ var draw = function draw(text, id) { } */ var parser = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,3],$V1=[1,5],$V2=[7,9,11,12,13,14,15,16,17,18,19,21,28,33],$V3=[1,15],$V4=[1,16],$V5=[1,17],$V6=[1,18],$V7=[1,19],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,24],$Vc=[1,26],$Vd=[1,29],$Ve=[5,7,9,11,12,13,14,15,16,17,18,19,21,28,33]; +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,3],$V1=[1,5],$V2=[7,9,11,12,13,14,15,16,17,18,20,27,32],$V3=[1,15],$V4=[1,16],$V5=[1,17],$V6=[1,18],$V7=[1,19],$V8=[1,20],$V9=[1,21],$Va=[1,23],$Vb=[1,25],$Vc=[1,28],$Vd=[5,7,9,11,12,13,14,15,16,17,18,20,27,32]; var parser = {trace: function trace () { }, yy: {}, -symbols_: {"error":2,"start":3,"directive":4,"gantt":5,"document":6,"EOF":7,"line":8,"SPACE":9,"statement":10,"NL":11,"dateFormat":12,"inclusiveEndDates":13,"topAxis":14,"axisFormat":15,"excludes":16,"todayMarker":17,"title":18,"section":19,"clickStatement":20,"taskTxt":21,"taskData":22,"openDirective":23,"typeDirective":24,"closeDirective":25,":":26,"argDirective":27,"click":28,"callbackname":29,"callbackargs":30,"href":31,"clickStatementDebug":32,"open_directive":33,"type_directive":34,"arg_directive":35,"close_directive":36,"$accept":0,"$end":1}, -terminals_: {2:"error",5:"gantt",7:"EOF",9:"SPACE",11:"NL",12:"dateFormat",13:"inclusiveEndDates",14:"topAxis",15:"axisFormat",16:"excludes",17:"todayMarker",18:"title",19:"section",21:"taskTxt",22:"taskData",26:":",28:"click",29:"callbackname",30:"callbackargs",31:"href",33:"open_directive",34:"type_directive",35:"arg_directive",36:"close_directive"}, -productions_: [0,[3,2],[3,3],[6,0],[6,2],[8,2],[8,1],[8,1],[8,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,1],[4,4],[4,6],[20,2],[20,3],[20,3],[20,4],[20,3],[20,4],[20,2],[32,2],[32,3],[32,3],[32,4],[32,3],[32,4],[32,2],[23,1],[24,1],[27,1],[25,1]], +symbols_: {"error":2,"start":3,"directive":4,"gantt":5,"document":6,"EOF":7,"line":8,"SPACE":9,"statement":10,"NL":11,"dateFormat":12,"inclusiveEndDates":13,"axisFormat":14,"excludes":15,"todayMarker":16,"title":17,"section":18,"clickStatement":19,"taskTxt":20,"taskData":21,"openDirective":22,"typeDirective":23,"closeDirective":24,":":25,"argDirective":26,"click":27,"callbackname":28,"callbackargs":29,"href":30,"clickStatementDebug":31,"open_directive":32,"type_directive":33,"arg_directive":34,"close_directive":35,"$accept":0,"$end":1}, +terminals_: {2:"error",5:"gantt",7:"EOF",9:"SPACE",11:"NL",12:"dateFormat",13:"inclusiveEndDates",14:"axisFormat",15:"excludes",16:"todayMarker",17:"title",18:"section",20:"taskTxt",21:"taskData",25:":",27:"click",28:"callbackname",29:"callbackargs",30:"href",32:"open_directive",33:"type_directive",34:"arg_directive",35:"close_directive"}, +productions_: [0,[3,2],[3,3],[6,0],[6,2],[8,2],[8,1],[8,1],[8,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,1],[4,4],[4,6],[19,2],[19,3],[19,3],[19,4],[19,3],[19,4],[19,2],[31,2],[31,3],[31,3],[31,4],[31,3],[31,4],[31,2],[22,1],[23,1],[26,1],[24,1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ @@ -116695,72 +115944,69 @@ case 10: yy.enableInclusiveEndDates();this.$=$$[$0].substr(18); break; case 11: -yy.TopAxis();this.$=$$[$0].substr(8); -break; -case 12: yy.setAxisFormat($$[$0].substr(11));this.$=$$[$0].substr(11); break; -case 13: +case 12: yy.setExcludes($$[$0].substr(9));this.$=$$[$0].substr(9); break; -case 14: +case 13: yy.setTodayMarker($$[$0].substr(12));this.$=$$[$0].substr(12); break; -case 15: +case 14: yy.setTitle($$[$0].substr(6));this.$=$$[$0].substr(6); break; -case 16: +case 15: yy.addSection($$[$0].substr(8));this.$=$$[$0].substr(8); break; -case 18: +case 17: yy.addTask($$[$0-1],$$[$0]);this.$='task'; break; -case 22: +case 21: this.$ = $$[$0-1];yy.setClickEvent($$[$0-1], $$[$0], null); break; -case 23: +case 22: this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], $$[$0]); break; -case 24: +case 23: this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0-1], null);yy.setLink($$[$0-2],$$[$0]); break; -case 25: +case 24: this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-2], $$[$0-1]);yy.setLink($$[$0-3],$$[$0]); break; -case 26: +case 25: this.$ = $$[$0-2];yy.setClickEvent($$[$0-2], $$[$0], null);yy.setLink($$[$0-2],$$[$0-1]); break; -case 27: +case 26: this.$ = $$[$0-3];yy.setClickEvent($$[$0-3], $$[$0-1], $$[$0]);yy.setLink($$[$0-3],$$[$0-2]); break; -case 28: +case 27: this.$ = $$[$0-1];yy.setLink($$[$0-1], $$[$0]); break; -case 29: case 35: +case 28: case 34: this.$=$$[$0-1] + ' ' + $$[$0]; break; -case 30: case 31: case 33: +case 29: case 30: case 32: this.$=$$[$0-2] + ' ' + $$[$0-1] + ' ' + $$[$0]; break; -case 32: case 34: +case 31: case 33: this.$=$$[$0-3] + ' ' + $$[$0-2] + ' ' + $$[$0-1] + ' ' + $$[$0]; break; -case 36: +case 35: yy.parseDirective('%%{', 'open_directive'); break; -case 37: +case 36: yy.parseDirective($$[$0], 'type_directive'); break; -case 38: +case 37: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); break; -case 39: +case 38: yy.parseDirective('}%%', 'close_directive', 'gantt'); break; } }, -table: [{3:1,4:2,5:$V0,23:4,33:$V1},{1:[3]},{3:6,4:2,5:$V0,23:4,33:$V1},o($V2,[2,3],{6:7}),{24:8,34:[1,9]},{34:[2,36]},{1:[2,1]},{4:25,7:[1,10],8:11,9:[1,12],10:13,11:[1,14],12:$V3,13:$V4,14:$V5,15:$V6,16:$V7,17:$V8,18:$V9,19:$Va,20:23,21:$Vb,23:4,28:$Vc,33:$V1},{25:27,26:[1,28],36:$Vd},o([26,36],[2,37]),o($V2,[2,8],{1:[2,2]}),o($V2,[2,4]),{4:25,10:30,12:$V3,13:$V4,14:$V5,15:$V6,16:$V7,17:$V8,18:$V9,19:$Va,20:23,21:$Vb,23:4,28:$Vc,33:$V1},o($V2,[2,6]),o($V2,[2,7]),o($V2,[2,9]),o($V2,[2,10]),o($V2,[2,11]),o($V2,[2,12]),o($V2,[2,13]),o($V2,[2,14]),o($V2,[2,15]),o($V2,[2,16]),o($V2,[2,17]),{22:[1,31]},o($V2,[2,19]),{29:[1,32],31:[1,33]},{11:[1,34]},{27:35,35:[1,36]},{11:[2,39]},o($V2,[2,5]),o($V2,[2,18]),o($V2,[2,22],{30:[1,37],31:[1,38]}),o($V2,[2,28],{29:[1,39]}),o($Ve,[2,20]),{25:40,36:$Vd},{36:[2,38]},o($V2,[2,23],{31:[1,41]}),o($V2,[2,24]),o($V2,[2,26],{30:[1,42]}),{11:[1,43]},o($V2,[2,25]),o($V2,[2,27]),o($Ve,[2,21])], -defaultActions: {5:[2,36],6:[2,1],29:[2,39],36:[2,38]}, +table: [{3:1,4:2,5:$V0,22:4,32:$V1},{1:[3]},{3:6,4:2,5:$V0,22:4,32:$V1},o($V2,[2,3],{6:7}),{23:8,33:[1,9]},{33:[2,35]},{1:[2,1]},{4:24,7:[1,10],8:11,9:[1,12],10:13,11:[1,14],12:$V3,13:$V4,14:$V5,15:$V6,16:$V7,17:$V8,18:$V9,19:22,20:$Va,22:4,27:$Vb,32:$V1},{24:26,25:[1,27],35:$Vc},o([25,35],[2,36]),o($V2,[2,8],{1:[2,2]}),o($V2,[2,4]),{4:24,10:29,12:$V3,13:$V4,14:$V5,15:$V6,16:$V7,17:$V8,18:$V9,19:22,20:$Va,22:4,27:$Vb,32:$V1},o($V2,[2,6]),o($V2,[2,7]),o($V2,[2,9]),o($V2,[2,10]),o($V2,[2,11]),o($V2,[2,12]),o($V2,[2,13]),o($V2,[2,14]),o($V2,[2,15]),o($V2,[2,16]),{21:[1,30]},o($V2,[2,18]),{28:[1,31],30:[1,32]},{11:[1,33]},{26:34,34:[1,35]},{11:[2,38]},o($V2,[2,5]),o($V2,[2,17]),o($V2,[2,21],{29:[1,36],30:[1,37]}),o($V2,[2,27],{28:[1,38]}),o($Vd,[2,19]),{24:39,35:$Vc},{35:[2,37]},o($V2,[2,22],{30:[1,40]}),o($V2,[2,23]),o($V2,[2,25],{29:[1,41]}),{11:[1,42]},o($V2,[2,24]),o($V2,[2,26]),o($Vd,[2,20])], +defaultActions: {5:[2,35],6:[2,1],28:[2,38],35:[2,37]}, parseError: function parseError (str, hash) { if (hash.recoverable) { this.trace(str); @@ -117227,11 +116473,11 @@ stateStackSize:function stateStackSize() { options: {"case-insensitive":true}, performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { switch($avoiding_name_collisions) { -case 0: this.begin('open_directive'); return 33; -case 1: this.begin('type_directive'); return 34; -case 2: this.popState(); this.begin('arg_directive'); return 26; -case 3: this.popState(); this.popState(); return 36; -case 4:return 35; +case 0: this.begin('open_directive'); return 32; +case 1: this.begin('type_directive'); return 33; +case 2: this.popState(); this.begin('arg_directive'); return 25; +case 3: this.popState(); this.popState(); return 35; +case 4:return 34; case 5:/* skip comments */ break; case 6:/* skip comments */ @@ -117249,41 +116495,40 @@ case 12:this.begin("href"); break; case 13:this.popState(); break; -case 14:return 31; +case 14:return 30; case 15:this.begin("callbackname"); break; case 16:this.popState(); break; case 17:this.popState(); this.begin("callbackargs"); break; -case 18:return 29; +case 18:return 28; case 19:this.popState(); break; -case 20:return 30; +case 20:return 29; case 21:this.begin("click"); break; case 22:this.popState(); break; -case 23:return 28; +case 23:return 27; case 24:return 5; case 25:return 12; case 26:return 13; case 27:return 14; case 28:return 15; case 29:return 16; -case 30:return 17; -case 31:return 'date'; +case 30:return 'date'; +case 31:return 17; case 32:return 18; -case 33:return 19; +case 33:return 20; case 34:return 21; -case 35:return 22; -case 36:return 26; -case 37:return 7; -case 38:return 'INVALID'; +case 35:return 25; +case 36:return 7; +case 37:return 'INVALID'; } }, -rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i], -conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"callbackargs":{"rules":[19,20],"inclusive":false},"callbackname":{"rules":[16,17,18],"inclusive":false},"href":{"rules":[13,14],"inclusive":false},"click":{"rules":[22,23],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,11,12,15,21,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"inclusive":true}} +rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i], +conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"callbackargs":{"rules":[19,20],"inclusive":false},"callbackname":{"rules":[16,17,18],"inclusive":false},"href":{"rules":[13,14],"inclusive":false},"click":{"rules":[22,23],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,11,12,15,21,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"inclusive":true}} }); return lexer; })(); @@ -117324,7 +116569,7 @@ if ( __webpack_require__.c[__webpack_require__.s] === module) { /***/ (function(module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); var getStyles = function getStyles(options) { - return "\n .mermaid-main-font {\n font-family: \"trebuchet ms\", verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n\n .section {\n stroke: none;\n opacity: 0.2;\n }\n\n .section0 {\n fill: ".concat(options.sectionBkgColor, ";\n }\n\n .section2 {\n fill: ").concat(options.sectionBkgColor2, ";\n }\n\n .section1,\n .section3 {\n fill: ").concat(options.altSectionBkgColor, ";\n opacity: 0.2;\n }\n\n .sectionTitle0 {\n fill: ").concat(options.titleColor, ";\n }\n\n .sectionTitle1 {\n fill: ").concat(options.titleColor, ";\n }\n\n .sectionTitle2 {\n fill: ").concat(options.titleColor, ";\n }\n\n .sectionTitle3 {\n fill: ").concat(options.titleColor, ";\n }\n\n .sectionTitle {\n text-anchor: start;\n // font-size: ").concat(options.ganttFontSize, ";\n // text-height: 14px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n\n }\n\n\n /* Grid and axis */\n\n .grid .tick {\n stroke: ").concat(options.gridColor, ";\n opacity: 0.8;\n shape-rendering: crispEdges;\n text {\n font-family: ").concat(options.fontFamily, ";\n fill: ").concat(options.textColor, ";\n }\n }\n\n .grid path {\n stroke-width: 0;\n }\n\n\n /* Today line */\n\n .today {\n fill: none;\n stroke: ").concat(options.todayLineColor, ";\n stroke-width: 2px;\n }\n\n\n /* Task styling */\n\n /* Default task */\n\n .task {\n stroke-width: 2;\n }\n\n .taskText {\n text-anchor: middle;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n\n // .taskText:not([font-size]) {\n // font-size: ").concat(options.ganttFontSize, ";\n // }\n\n .taskTextOutsideRight {\n fill: ").concat(options.taskTextDarkColor, ";\n text-anchor: start;\n // font-size: ").concat(options.ganttFontSize, ";\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n\n }\n\n .taskTextOutsideLeft {\n fill: ").concat(options.taskTextDarkColor, ";\n text-anchor: end;\n // font-size: ").concat(options.ganttFontSize, ";\n }\n\n /* Special case clickable */\n .task.clickable {\n cursor: pointer;\n }\n .taskText.clickable {\n cursor: pointer;\n fill: ").concat(options.taskTextClickableColor, " !important;\n font-weight: bold;\n }\n\n .taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: ").concat(options.taskTextClickableColor, " !important;\n font-weight: bold;\n }\n\n .taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: ").concat(options.taskTextClickableColor, " !important;\n font-weight: bold;\n }\n\n /* Specific task settings for the sections*/\n\n .taskText0,\n .taskText1,\n .taskText2,\n .taskText3 {\n fill: ").concat(options.taskTextColor, ";\n }\n\n .task0,\n .task1,\n .task2,\n .task3 {\n fill: ").concat(options.taskBkgColor, ";\n stroke: ").concat(options.taskBorderColor, ";\n }\n\n .taskTextOutside0,\n .taskTextOutside2\n {\n fill: ").concat(options.taskTextOutsideColor, ";\n }\n\n .taskTextOutside1,\n .taskTextOutside3 {\n fill: ").concat(options.taskTextOutsideColor, ";\n }\n\n\n /* Active task */\n\n .active0,\n .active1,\n .active2,\n .active3 {\n fill: ").concat(options.activeTaskBkgColor, ";\n stroke: ").concat(options.activeTaskBorderColor, ";\n }\n\n .activeText0,\n .activeText1,\n .activeText2,\n .activeText3 {\n fill: ").concat(options.taskTextDarkColor, " !important;\n }\n\n\n /* Completed task */\n\n .done0,\n .done1,\n .done2,\n .done3 {\n stroke: ").concat(options.doneTaskBorderColor, ";\n fill: ").concat(options.doneTaskBkgColor, ";\n stroke-width: 2;\n }\n\n .doneText0,\n .doneText1,\n .doneText2,\n .doneText3 {\n fill: ").concat(options.taskTextDarkColor, " !important;\n }\n\n\n /* Tasks on the critical line */\n\n .crit0,\n .crit1,\n .crit2,\n .crit3 {\n stroke: ").concat(options.critBorderColor, ";\n fill: ").concat(options.critBkgColor, ";\n stroke-width: 2;\n }\n\n .activeCrit0,\n .activeCrit1,\n .activeCrit2,\n .activeCrit3 {\n stroke: ").concat(options.critBorderColor, ";\n fill: ").concat(options.activeTaskBkgColor, ";\n stroke-width: 2;\n }\n\n .doneCrit0,\n .doneCrit1,\n .doneCrit2,\n .doneCrit3 {\n stroke: ").concat(options.critBorderColor, ";\n fill: ").concat(options.doneTaskBkgColor, ";\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges;\n }\n\n .milestone {\n transform: rotate(45deg) scale(0.8,0.8);\n }\n\n .milestoneText {\n font-style: italic;\n }\n .doneCritText0,\n .doneCritText1,\n .doneCritText2,\n .doneCritText3 {\n fill: ").concat(options.taskTextDarkColor, " !important;\n }\n\n .activeCritText0,\n .activeCritText1,\n .activeCritText2,\n .activeCritText3 {\n fill: ").concat(options.taskTextDarkColor, " !important;\n }\n\n .titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ").concat(options.textColor, " ;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n"); + return "\n .mermaid-main-font {\n font-family: \"trebuchet ms\", verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n\n .section {\n stroke: none;\n opacity: 0.2;\n }\n\n .section0 {\n fill: ".concat(options.sectionBkgColor, ";\n }\n\n .section2 {\n fill: ").concat(options.sectionBkgColor2, ";\n }\n\n .section1,\n .section3 {\n fill: ").concat(options.altSectionBkgColor, ";\n opacity: 0.2;\n }\n\n .sectionTitle0 {\n fill: ").concat(options.titleColor, ";\n }\n\n .sectionTitle1 {\n fill: ").concat(options.titleColor, ";\n }\n\n .sectionTitle2 {\n fill: ").concat(options.titleColor, ";\n }\n\n .sectionTitle3 {\n fill: ").concat(options.titleColor, ";\n }\n\n .sectionTitle {\n text-anchor: start;\n font-size: 11px;\n text-height: 14px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n\n }\n\n\n /* Grid and axis */\n\n .grid .tick {\n stroke: ").concat(options.gridColor, ";\n opacity: 0.8;\n shape-rendering: crispEdges;\n text {\n font-family: ").concat(options.fontFamily, ";\n fill: ").concat(options.textColor, ";\n }\n }\n\n .grid path {\n stroke-width: 0;\n }\n\n\n /* Today line */\n\n .today {\n fill: none;\n stroke: ").concat(options.todayLineColor, ";\n stroke-width: 2px;\n }\n\n\n /* Task styling */\n\n /* Default task */\n\n .task {\n stroke-width: 2;\n }\n\n .taskText {\n text-anchor: middle;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n\n .taskText:not([font-size]) {\n font-size: 11px;\n }\n\n .taskTextOutsideRight {\n fill: ").concat(options.taskTextDarkColor, ";\n text-anchor: start;\n font-size: 11px;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n\n }\n\n .taskTextOutsideLeft {\n fill: ").concat(options.taskTextDarkColor, ";\n text-anchor: end;\n font-size: 11px;\n }\n\n /* Special case clickable */\n .task.clickable {\n cursor: pointer;\n }\n .taskText.clickable {\n cursor: pointer;\n fill: ").concat(options.taskTextClickableColor, " !important;\n font-weight: bold;\n }\n\n .taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: ").concat(options.taskTextClickableColor, " !important;\n font-weight: bold;\n }\n\n .taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: ").concat(options.taskTextClickableColor, " !important;\n font-weight: bold;\n }\n\n /* Specific task settings for the sections*/\n\n .taskText0,\n .taskText1,\n .taskText2,\n .taskText3 {\n fill: ").concat(options.taskTextColor, ";\n }\n\n .task0,\n .task1,\n .task2,\n .task3 {\n fill: ").concat(options.taskBkgColor, ";\n stroke: ").concat(options.taskBorderColor, ";\n }\n\n .taskTextOutside0,\n .taskTextOutside2\n {\n fill: ").concat(options.taskTextOutsideColor, ";\n }\n\n .taskTextOutside1,\n .taskTextOutside3 {\n fill: ").concat(options.taskTextOutsideColor, ";\n }\n\n\n /* Active task */\n\n .active0,\n .active1,\n .active2,\n .active3 {\n fill: ").concat(options.activeTaskBkgColor, ";\n stroke: ").concat(options.activeTaskBorderColor, ";\n }\n\n .activeText0,\n .activeText1,\n .activeText2,\n .activeText3 {\n fill: ").concat(options.taskTextDarkColor, " !important;\n }\n\n\n /* Completed task */\n\n .done0,\n .done1,\n .done2,\n .done3 {\n stroke: ").concat(options.doneTaskBorderColor, ";\n fill: ").concat(options.doneTaskBkgColor, ";\n stroke-width: 2;\n }\n\n .doneText0,\n .doneText1,\n .doneText2,\n .doneText3 {\n fill: ").concat(options.taskTextDarkColor, " !important;\n }\n\n\n /* Tasks on the critical line */\n\n .crit0,\n .crit1,\n .crit2,\n .crit3 {\n stroke: ").concat(options.critBorderColor, ";\n fill: ").concat(options.critBkgColor, ";\n stroke-width: 2;\n }\n\n .activeCrit0,\n .activeCrit1,\n .activeCrit2,\n .activeCrit3 {\n stroke: ").concat(options.critBorderColor, ";\n fill: ").concat(options.activeTaskBkgColor, ";\n stroke-width: 2;\n }\n\n .doneCrit0,\n .doneCrit1,\n .doneCrit2,\n .doneCrit3 {\n stroke: ").concat(options.critBorderColor, ";\n fill: ").concat(options.doneTaskBkgColor, ";\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges;\n }\n\n .milestone {\n transform: rotate(45deg) scale(0.8,0.8);\n }\n\n .milestoneText {\n font-style: italic;\n }\n .doneCritText0,\n .doneCritText1,\n .doneCritText2,\n .doneCritText3 {\n fill: ").concat(options.taskTextDarkColor, " !important;\n }\n\n .activeCritText0,\n .activeCritText1,\n .activeCritText2,\n .activeCritText3 {\n fill: ").concat(options.taskTextDarkColor, " !important;\n }\n\n .titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ").concat(options.textColor, " ;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n"); }; /* harmony default export */ __webpack_exports__["default"] = (getStyles); @@ -117375,21 +116620,21 @@ function getId() { } function isfastforwardable(currentCommit, otherCommit) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Entering isfastforwardable:', currentCommit.id, otherCommit.id); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Entering isfastforwardable:', currentCommit.id, otherCommit.id); while (currentCommit.seq <= otherCommit.seq && currentCommit !== otherCommit) { // only if other branch has more commits if (otherCommit.parent == null) break; if (Array.isArray(otherCommit.parent)) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('In merge commit:', otherCommit.parent); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('In merge commit:', otherCommit.parent); return isfastforwardable(currentCommit, commits[otherCommit.parent[0]]) || isfastforwardable(currentCommit, commits[otherCommit.parent[1]]); } else { otherCommit = commits[otherCommit.parent]; } } - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug(currentCommit.id, otherCommit.id); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug(currentCommit.id, otherCommit.id); return currentCommit.id === otherCommit.id; } @@ -117419,14 +116664,14 @@ var setDirection = function setDirection(dir) { }; var options = {}; var setOptions = function setOptions(rawOptString) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('options str', rawOptString); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('options str', rawOptString); rawOptString = rawOptString && rawOptString.trim(); rawOptString = rawOptString || '{}'; try { options = JSON.parse(rawOptString); } catch (e) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].error('error while parsing gitGraph options', e.message); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].error('error while parsing gitGraph options', e.message); } }; var getOptions = function getOptions() { @@ -117442,18 +116687,18 @@ var commit = function commit(msg) { head = commit; commits[commit.id] = commit; branches[curBranch] = commit.id; - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('in pushCommit ' + commit.id); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('in pushCommit ' + commit.id); }; var branch = function branch(name) { branches[name] = head != null ? head.id : null; - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('in createBranch'); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('in createBranch'); }; var merge = function merge(otherBranch) { var currentCommit = commits[branches[curBranch]]; var otherCommit = commits[branches[otherBranch]]; if (isReachableFrom(currentCommit, otherCommit)) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Already merged'); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Already merged'); return; } @@ -117473,21 +116718,21 @@ var merge = function merge(otherBranch) { branches[curBranch] = _commit.id; } - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug(branches); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('in mergeBranch'); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug(branches); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('in mergeBranch'); }; var checkout = function checkout(branch) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('in checkout'); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('in checkout'); curBranch = branch; var id = branches[curBranch]; head = commits[id]; }; var reset = function reset(commitRef) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('in reset', commitRef); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('in reset', commitRef); var ref = commitRef.split(':')[0]; var parentCount = parseInt(commitRef.split(':')[1]); var commit = ref === 'HEAD' ? head : commits[branches[ref]]; - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug(commit, parentCount); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug(commit, parentCount); while (parentCount > 0) { commit = commits[commit.parent]; @@ -117495,7 +116740,7 @@ var reset = function reset(commitRef) { if (!commit) { var err = 'Critical error - unique parent commit not found during reset'; - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].error(err); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].error(err); throw err; } } @@ -117533,7 +116778,7 @@ function prettyPrintCommitHistory(commitArr) { if (branches[_branch] === commit.id) label.push(_branch); } - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug(label.join(' ')); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug(label.join(' ')); if (Array.isArray(commit.parent)) { var newCommit = commits[commit.parent[0]]; @@ -117553,7 +116798,7 @@ function prettyPrintCommitHistory(commitArr) { } var prettyPrint = function prettyPrint() { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug(commits); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug(commits); var node = getCommitsArray()[0]; prettyPrintCommitHistory([node]); }; @@ -117589,7 +116834,7 @@ var getCommitsArray = function getCommitsArray() { return commits[key]; }); commitArr.forEach(function (o) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug(o.id); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug(o.id); }); commitArr.sort(function (a, b) { return b.seq - a.seq; @@ -117703,7 +116948,7 @@ function getElementCoords(element, coords) { } function svgDrawLineForCommits(svg, fromId, toId, direction, color) { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('svgDrawLineForCommits: ', fromId, toId); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('svgDrawLineForCommits: ', fromId, toId); var fromBbox = getElementCoords(svg.select('#node-' + fromId + ' circle')); var toBbox = getElementCoords(svg.select('#node-' + toId + ' circle')); @@ -117806,7 +117051,7 @@ function renderCommitHistory(svg, commitid, branches, direction) { if (typeof commitid === 'string') { do { commit = allCommitsDict[commitid]; - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('in renderCommitHistory', commit.id, commit.seq); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('in renderCommitHistory', commit.id, commit.seq); if (svg.select('#node-' + commitid).size() > 0) { return; @@ -117835,7 +117080,7 @@ function renderCommitHistory(svg, commitid, branches, direction) { } if (branch) { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('found branch ', branch.name); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('found branch ', branch.name); svg.select('#node-' + commit.id + ' p').append('xhtml:span').attr('class', 'branch-label').text(branch.name + ', '); } @@ -117850,7 +117095,7 @@ function renderCommitHistory(svg, commitid, branches, direction) { } if (Array.isArray(commitid)) { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('found merge commmit', commitid); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('found merge commmit', commitid); renderCommitHistory(svg, commitid[0], branches, direction); branchNum++; renderCommitHistory(svg, commitid[1], branches, direction); @@ -117881,11 +117126,11 @@ var draw = function draw(txt, id, ver) { var parser = _parser_gitGraph__WEBPACK_IMPORTED_MODULE_2___default.a.parser; parser.yy = _gitGraphAst__WEBPACK_IMPORTED_MODULE_1__["default"]; parser.yy.clear(); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('in gitgraph renderer', txt + '\n', 'id:', id, ver); // Parse the graph definition + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('in gitgraph renderer', txt + '\n', 'id:', id, ver); // Parse the graph definition parser.parse(txt + '\n'); config = Object.assign(config, apiConfig, _gitGraphAst__WEBPACK_IMPORTED_MODULE_1__["default"].getOptions()); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('effective options', config); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('effective options', config); var direction = _gitGraphAst__WEBPACK_IMPORTED_MODULE_1__["default"].getDirection(); allCommitsDict = _gitGraphAst__WEBPACK_IMPORTED_MODULE_1__["default"].getCommits(); var branches = _gitGraphAst__WEBPACK_IMPORTED_MODULE_1__["default"].getBranchesAsObjArray(); @@ -117912,8 +117157,8 @@ var draw = function draw(txt, id, ver) { return (branches.length + 1) * config.branchOffset; }); } catch (e) { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].error('Error while rendering gitgraph'); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].error(e.message); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error('Error while rendering gitgraph'); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error(e.message); } }; /* harmony default export */ __webpack_exports__["default"] = ({ @@ -118635,7 +117880,7 @@ __webpack_require__.r(__webpack_exports__); var message = ''; var info = false; var setMessage = function setMessage(txt) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Setting message to: ' + txt); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Setting message to: ' + txt); message = txt; }; var getMessage = function getMessage() { @@ -118698,10 +117943,10 @@ var draw = function draw(txt, id, ver) { try { var parser = _parser_info__WEBPACK_IMPORTED_MODULE_2___default.a.parser; parser.yy = _infoDb__WEBPACK_IMPORTED_MODULE_1__["default"]; - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Renering info diagram\n' + txt); // Parse the graph definition + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Renering info diagram\n' + txt); // Parse the graph definition parser.parse(txt); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Parsed info diagram'); // Fetch the default direction, use TD if none was found + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Parsed info diagram'); // Fetch the default direction, use TD if none was found var svg = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + id); var g = svg.append('g'); @@ -118710,8 +117955,8 @@ var draw = function draw(txt, id, ver) { svg.attr('height', 100); svg.attr('width', 400); // svg.attr('viewBox', '0 0 300 150'); } catch (e) { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].error('Error while rendering info diagram'); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].error(e.message); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error('Error while rendering info diagram'); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error(e.message); } }; /* harmony default export */ __webpack_exports__["default"] = ({ @@ -119429,45 +118674,42 @@ var getStyles = function getStyles() { } */ var parser = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,4],$V1=[1,5],$V2=[1,6],$V3=[1,7],$V4=[1,9],$V5=[1,11,13,20,21,22,23],$V6=[2,5],$V7=[1,6,11,13,20,21,22,23],$V8=[20,21,22],$V9=[2,8],$Va=[1,18],$Vb=[1,19],$Vc=[1,24],$Vd=[6,20,21,22,23]; +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,4],$V1=[1,5],$V2=[1,6],$V3=[1,7],$V4=[1,9],$V5=[1,10,12,19,20,21,22],$V6=[1,6,10,12,19,20,21,22],$V7=[19,20,21],$V8=[1,22],$V9=[6,19,20,21,22]; var parser = {trace: function trace () { }, yy: {}, -symbols_: {"error":2,"start":3,"eol":4,"directive":5,"PIE":6,"document":7,"showData":8,"line":9,"statement":10,"txt":11,"value":12,"title":13,"title_value":14,"openDirective":15,"typeDirective":16,"closeDirective":17,":":18,"argDirective":19,"NEWLINE":20,";":21,"EOF":22,"open_directive":23,"type_directive":24,"arg_directive":25,"close_directive":26,"$accept":0,"$end":1}, -terminals_: {2:"error",6:"PIE",8:"showData",11:"txt",12:"value",13:"title",14:"title_value",18:":",20:"NEWLINE",21:";",22:"EOF",23:"open_directive",24:"type_directive",25:"arg_directive",26:"close_directive"}, -productions_: [0,[3,2],[3,2],[3,2],[3,3],[7,0],[7,2],[9,2],[10,0],[10,2],[10,2],[10,1],[5,3],[5,5],[4,1],[4,1],[4,1],[15,1],[16,1],[19,1],[17,1]], +symbols_: {"error":2,"start":3,"eol":4,"directive":5,"PIE":6,"document":7,"line":8,"statement":9,"txt":10,"value":11,"title":12,"title_value":13,"openDirective":14,"typeDirective":15,"closeDirective":16,":":17,"argDirective":18,"NEWLINE":19,";":20,"EOF":21,"open_directive":22,"type_directive":23,"arg_directive":24,"close_directive":25,"$accept":0,"$end":1}, +terminals_: {2:"error",6:"PIE",10:"txt",11:"value",12:"title",13:"title_value",17:":",19:"NEWLINE",20:";",21:"EOF",22:"open_directive",23:"type_directive",24:"arg_directive",25:"close_directive"}, +productions_: [0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[9,0],[9,2],[9,2],[9,1],[5,3],[5,5],[4,1],[4,1],[4,1],[14,1],[15,1],[18,1],[16,1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ var $0 = $$.length - 1; switch (yystate) { -case 4: -yy.setShowData(true); -break; -case 7: +case 6: this.$ = $$[$0-1]; break; -case 9: +case 8: yy.addSection($$[$0-1],yy.cleanupValue($$[$0])); break; -case 10: +case 9: this.$=$$[$0].trim();yy.setTitle(this.$); break; -case 17: +case 16: yy.parseDirective('%%{', 'open_directive'); break; -case 18: +case 17: yy.parseDirective($$[$0], 'type_directive'); break; -case 19: +case 18: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); break; -case 20: +case 19: yy.parseDirective('}%%', 'close_directive', 'pie'); break; } }, -table: [{3:1,4:2,5:3,6:$V0,15:8,20:$V1,21:$V2,22:$V3,23:$V4},{1:[3]},{3:10,4:2,5:3,6:$V0,15:8,20:$V1,21:$V2,22:$V3,23:$V4},{3:11,4:2,5:3,6:$V0,15:8,20:$V1,21:$V2,22:$V3,23:$V4},o($V5,$V6,{7:12,8:[1,13]}),o($V7,[2,14]),o($V7,[2,15]),o($V7,[2,16]),{16:14,24:[1,15]},{24:[2,17]},{1:[2,1]},{1:[2,2]},o($V8,$V9,{15:8,9:16,10:17,5:20,1:[2,3],11:$Va,13:$Vb,23:$V4}),o($V5,$V6,{7:21}),{17:22,18:[1,23],26:$Vc},o([18,26],[2,18]),o($V5,[2,6]),{4:25,20:$V1,21:$V2,22:$V3},{12:[1,26]},{14:[1,27]},o($V8,[2,11]),o($V8,$V9,{15:8,9:16,10:17,5:20,1:[2,4],11:$Va,13:$Vb,23:$V4}),o($Vd,[2,12]),{19:28,25:[1,29]},o($Vd,[2,20]),o($V5,[2,7]),o($V8,[2,9]),o($V8,[2,10]),{17:30,26:$Vc},{26:[2,19]},o($Vd,[2,13])], -defaultActions: {9:[2,17],10:[2,1],11:[2,2],29:[2,19]}, +table: [{3:1,4:2,5:3,6:$V0,14:8,19:$V1,20:$V2,21:$V3,22:$V4},{1:[3]},{3:10,4:2,5:3,6:$V0,14:8,19:$V1,20:$V2,21:$V3,22:$V4},{3:11,4:2,5:3,6:$V0,14:8,19:$V1,20:$V2,21:$V3,22:$V4},o($V5,[2,4],{7:12}),o($V6,[2,13]),o($V6,[2,14]),o($V6,[2,15]),{15:13,23:[1,14]},{23:[2,16]},{1:[2,1]},{1:[2,2]},o($V7,[2,7],{14:8,8:15,9:16,5:19,1:[2,3],10:[1,17],12:[1,18],22:$V4}),{16:20,17:[1,21],25:$V8},o([17,25],[2,17]),o($V5,[2,5]),{4:23,19:$V1,20:$V2,21:$V3},{11:[1,24]},{13:[1,25]},o($V7,[2,10]),o($V9,[2,11]),{18:26,24:[1,27]},o($V9,[2,19]),o($V5,[2,6]),o($V7,[2,8]),o($V7,[2,9]),{16:28,25:$V8},{25:[2,18]},o($V9,[2,12])], +defaultActions: {9:[2,16],10:[2,1],11:[2,2],27:[2,18]}, parseError: function parseError (str, hash) { if (hash.recoverable) { this.trace(str); @@ -119934,20 +119176,20 @@ stateStackSize:function stateStackSize() { options: {"case-insensitive":true}, performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { switch($avoiding_name_collisions) { -case 0: this.begin('open_directive'); return 23; -case 1: this.begin('type_directive'); return 24; -case 2: this.popState(); this.begin('arg_directive'); return 18; -case 3: this.popState(); this.popState(); return 26; -case 4:return 25; +case 0: this.begin('open_directive'); return 22; +case 1: this.begin('type_directive'); return 23; +case 2: this.popState(); this.begin('arg_directive'); return 17; +case 3: this.popState(); this.popState(); return 25; +case 4:return 24; case 5:/* skip comments */ break; case 6:break; -case 7:return 20; +case 7:return 19; case 8:/* do nothing */ break; case 9:/* ignore */ break; -case 10: this.begin("title");return 13; +case 10: this.begin("title");return 12; case 11: this.popState(); return "title_value"; case 12: this.begin("string"); break; @@ -119955,13 +119197,12 @@ case 13: this.popState(); break; case 14: return "txt"; case 15:return 6; -case 16:return 8; -case 17:return "value"; -case 18:return 22; +case 16:return "value"; +case 17:return 21; } }, -rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[\s]+)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:pie\b)/i,/^(?:showData\b)/i,/^(?::[\s]*[\d]+(?:\.[\d]+)?)/i,/^(?:$)/i], -conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"title":{"rules":[11],"inclusive":false},"string":{"rules":[13,14],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,12,15,16,17,18],"inclusive":true}} +rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:[\s]+)/i,/^(?:title\b)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:pie\b)/i,/^(?::[\s]*[\d]+(?:\.[\d]+)?)/i,/^(?:$)/i], +conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"title":{"rules":[11],"inclusive":false},"string":{"rules":[13,14],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,12,15,16,17],"inclusive":true}} }); return lexer; })(); @@ -120013,7 +119254,6 @@ __webpack_require__.r(__webpack_exports__); var sections = {}; var title = ''; -var showData = false; var parseDirective = function parseDirective(statement, context, type) { _mermaidAPI__WEBPACK_IMPORTED_MODULE_1__["default"].parseDirective(this, statement, context, type); }; @@ -120021,7 +119261,7 @@ var parseDirective = function parseDirective(statement, context, type) { var addSection = function addSection(id, value) { if (typeof sections[id] === 'undefined') { sections[id] = value; - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].debug('Added new section :', id); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].debug('Added new section :', id); } }; @@ -120033,14 +119273,6 @@ var setTitle = function setTitle(txt) { title = txt; }; -var setShowData = function setShowData(toggle) { - showData = toggle; -}; - -var getShowData = function getShowData() { - return showData; -}; - var getTitle = function getTitle() { return title; }; @@ -120057,7 +119289,6 @@ var cleanupValue = function cleanupValue(value) { var clear = function clear() { sections = {}; title = ''; - showData = false; }; // export const parseError = (err, hash) => { // global.mermaidAPI.parseError(err, hash) // } @@ -120073,9 +119304,7 @@ var clear = function clear() { cleanupValue: cleanupValue, clear: clear, setTitle: setTitle, - getTitle: getTitle, - setShowData: setShowData, - getShowData: getShowData // parseError + getTitle: getTitle // parseError }); @@ -120085,9 +119314,10 @@ var clear = function clear() { /*!*****************************************!*\ !*** ./src/diagrams/pie/pieRenderer.js ***! \*****************************************/ -/*! exports provided: draw, default */ +/*! exports provided: setConf, draw, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; }); /* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); /* harmony import */ var _pieDb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pieDb */ "./src/diagrams/pie/pieDb.js"); @@ -120095,7 +119325,6 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _parser_pie__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_parser_pie__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../config */ "./src/config.js"); /** * Created by AshishJ on 11-09-2019. */ @@ -120104,8 +119333,13 @@ __webpack_require__.r(__webpack_exports__); - -var conf = _config__WEBPACK_IMPORTED_MODULE_5__["getConfig"](); +var conf = {}; +var setConf = function setConf(cnf) { + var keys = Object.keys(cnf); + keys.forEach(function (key) { + conf[key] = cnf[key]; + }); +}; /** * Draws a Pie Chart with the data given in text. * @param text @@ -120116,14 +119350,13 @@ var width; var height = 450; var draw = function draw(txt, id) { try { - conf = _config__WEBPACK_IMPORTED_MODULE_5__["getConfig"](); var parser = _parser_pie__WEBPACK_IMPORTED_MODULE_2___default.a.parser; parser.yy = _pieDb__WEBPACK_IMPORTED_MODULE_1__["default"]; - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Rendering info diagram\n' + txt); // Parse the Pie Chart definition + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Rendering info diagram\n' + txt); // Parse the Pie Chart definition parser.yy.clear(); parser.parse(txt); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Parsed info diagram'); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Parsed info diagram'); var elem = document.getElementById(id); width = elem.parentElement.offsetWidth; @@ -120135,12 +119368,8 @@ var draw = function draw(txt, id) { width = conf.useWidth; } - if (typeof conf.pie.useWidth !== 'undefined') { - width = conf.pie.useWidth; - } - var diagram = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + id); - Object(_utils__WEBPACK_IMPORTED_MODULE_4__["configureSvgSize"])(diagram, height, width, conf.pie.useMaxWidth); // Set viewBox + Object(_utils__WEBPACK_IMPORTED_MODULE_4__["configureSvgSize"])(diagram, height, width, conf.useMaxWidth); // Set viewBox elem.setAttribute('viewBox', '0 0 ' + width + ' ' + height); // Fetch the default direction, use TD if none was found @@ -120153,11 +119382,9 @@ var draw = function draw(txt, id) { var sum = 0; Object.keys(data).forEach(function (key) { sum += data[key]; - }); - var themeVariables = conf.themeVariables; - var myGeneratedColors = [themeVariables.pie1, themeVariables.pie2, themeVariables.pie3, themeVariables.pie4, themeVariables.pie5, themeVariables.pie6, themeVariables.pie7, themeVariables.pie8, themeVariables.pie9, themeVariables.pie10, themeVariables.pie11, themeVariables.pie12]; // Set the color scale + }); // Set the color scale - var color = Object(d3__WEBPACK_IMPORTED_MODULE_0__["scaleOrdinal"])().domain(data).range(myGeneratedColors); // Compute the position of each group on the pie: + var color = Object(d3__WEBPACK_IMPORTED_MODULE_0__["scaleOrdinal"])().domain(data).range(d3__WEBPACK_IMPORTED_MODULE_0__["schemeSet2"]); // Compute the position of each group on the pie: var pie = Object(d3__WEBPACK_IMPORTED_MODULE_0__["pie"])().value(function (d) { return d.value; @@ -120168,16 +119395,14 @@ var draw = function draw(txt, id) { svg.selectAll('mySlices').data(dataReady).enter().append('path').attr('d', arcGenerator).attr('fill', function (d) { return color(d.data.key); - }).attr('class', 'pieCircle'); // Now add the percentage. + }).attr('stroke', 'black').style('stroke-width', '2px').style('opacity', 0.7); // Now add the percentage. // Use the centroid method to get the best coordinates. - svg.selectAll('mySlices').data(dataReady.filter(function (value) { - return value.data.value !== 0; - })).enter().append('text').text(function (d) { + svg.selectAll('mySlices').data(dataReady).enter().append('text').text(function (d) { return (d.data.value / sum * 100).toFixed(0) + '%'; }).attr('transform', function (d) { return 'translate(' + arcGenerator.centroid(d) + ')'; - }).style('text-anchor', 'middle').attr('class', 'slice'); + }).style('text-anchor', 'middle').attr('class', 'slice').style('font-size', 17); svg.append('text').text(parser.yy.getTitle()).attr('x', 0).attr('y', -(height - 50) / 2).attr('class', 'pieTitleText'); // Add the legends/annotations for each section var legend = svg.selectAll('.legend').data(color.domain()).enter().append('g').attr('class', 'legend').attr('transform', function (d, i) { @@ -120188,21 +119413,16 @@ var draw = function draw(txt, id) { return 'translate(' + horz + ',' + vert + ')'; }); legend.append('rect').attr('width', legendRectSize).attr('height', legendRectSize).style('fill', color).style('stroke', color); - legend.data(dataReady.filter(function (value) { - return value.data.value !== 0; - })).append('text').attr('x', legendRectSize + legendSpacing).attr('y', legendRectSize - legendSpacing).text(function (d) { - if (parser.yy.getShowData() || conf.showData || conf.pie.showData) { - return d.data.key + ' [' + d.data.value + ']'; - } else { - return d.data.key; - } + legend.append('text').attr('x', legendRectSize + legendSpacing).attr('y', legendRectSize - legendSpacing).text(function (d) { + return d; }); } catch (e) { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].error('Error while rendering info diagram'); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].error(e); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error('Error while rendering info diagram'); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error(e); } }; /* harmony default export */ __webpack_exports__["default"] = ({ + setConf: setConf, draw: draw }); @@ -120216,17 +119436,17 @@ var draw = function draw(txt, id) { /***/ (function(module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); var getStyles = function getStyles(options) { - return "\n .pieCircle{\n stroke: ".concat(options.pieStrokeColor, ";\n stroke-width : ").concat(options.pieStrokeWidth, ";\n opacity : ").concat(options.pieOpacity, ";\n }\n .pieTitleText {\n text-anchor: middle;\n font-size: ").concat(options.pieTitleTextSize, ";\n fill: ").concat(options.pieTitleTextColor, ";\n font-family: ").concat(options.fontFamily, ";\n }\n .slice {\n font-family: ").concat(options.fontFamily, ";\n fill: ").concat(options.pieSectionTextColor, ";\n font-size:").concat(options.pieSectionTextSize, ";\n // fill: white;\n }\n .legend text {\n fill: ").concat(options.pieLegendTextColor, ";\n font-family: ").concat(options.fontFamily, ";\n font-size: ").concat(options.pieLegendTextSize, ";\n }\n"); + return ".pieTitleText {\n text-anchor: middle;\n font-size: 25px;\n fill: ".concat(options.taskTextDarkColor, ";\n font-family: ").concat(options.fontFamily, ";\n }\n .slice {\n font-family: ").concat(options.fontFamily, ";\n fill: ").concat(options.textColor, ";\n // fill: white;\n }\n .legend text {\n fill: ").concat(options.taskTextDarkColor, ";\n font-family: ").concat(options.fontFamily, ";\n font-size: 17px;\n }\n"); }; /* harmony default export */ __webpack_exports__["default"] = (getStyles); /***/ }), -/***/ "./src/diagrams/requirement/parser/requirementDiagram.jison": -/*!******************************************************************!*\ - !*** ./src/diagrams/requirement/parser/requirementDiagram.jison ***! - \******************************************************************/ +/***/ "./src/diagrams/sequence/parser/sequenceDiagram.jison": +/*!************************************************************!*\ + !*** ./src/diagrams/sequence/parser/sequenceDiagram.jison ***! + \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { @@ -120304,126 +119524,168 @@ var getStyles = function getStyles(options) { } */ var parser = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,3],$V1=[1,5],$V2=[1,17],$V3=[2,10],$V4=[1,21],$V5=[1,22],$V6=[1,23],$V7=[1,24],$V8=[1,25],$V9=[1,26],$Va=[1,19],$Vb=[1,27],$Vc=[1,28],$Vd=[1,31],$Ve=[66,67],$Vf=[5,8,14,35,36,37,38,39,40,48,55,57,66,67],$Vg=[5,6,8,14,35,36,37,38,39,40,48,66,67],$Vh=[1,51],$Vi=[1,52],$Vj=[1,53],$Vk=[1,54],$Vl=[1,55],$Vm=[1,56],$Vn=[1,57],$Vo=[57,58],$Vp=[1,69],$Vq=[1,65],$Vr=[1,66],$Vs=[1,67],$Vt=[1,68],$Vu=[1,70],$Vv=[1,74],$Vw=[1,75],$Vx=[1,72],$Vy=[1,73],$Vz=[5,8,14,35,36,37,38,39,40,48,66,67]; +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,5],$V3=[1,7],$V4=[2,5],$V5=[1,15],$V6=[1,17],$V7=[1,18],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,24],$Vc=[1,25],$Vd=[1,26],$Ve=[1,27],$Vf=[1,28],$Vg=[1,29],$Vh=[1,32],$Vi=[1,33],$Vj=[1,36],$Vk=[1,4,5,16,21,22,23,25,27,28,29,30,31,33,35,36,37,48,56],$Vl=[1,44],$Vm=[4,5,16,21,22,23,25,27,28,29,30,31,33,37,48,56],$Vn=[4,5,16,21,22,23,25,27,28,29,30,31,33,36,37,48,56],$Vo=[4,5,16,21,22,23,25,27,28,29,30,31,33,35,37,48,56],$Vp=[46,47,48],$Vq=[1,4,5,7,16,21,22,23,25,27,28,29,30,31,33,35,36,37,48,56]; var parser = {trace: function trace () { }, yy: {}, -symbols_: {"error":2,"start":3,"directive":4,"NEWLINE":5,"RD":6,"diagram":7,"EOF":8,"openDirective":9,"typeDirective":10,"closeDirective":11,":":12,"argDirective":13,"open_directive":14,"type_directive":15,"arg_directive":16,"close_directive":17,"requirementDef":18,"elementDef":19,"relationshipDef":20,"requirementType":21,"requirementName":22,"STRUCT_START":23,"requirementBody":24,"ID":25,"COLONSEP":26,"id":27,"TEXT":28,"text":29,"RISK":30,"riskLevel":31,"VERIFYMTHD":32,"verifyType":33,"STRUCT_STOP":34,"REQUIREMENT":35,"FUNCTIONAL_REQUIREMENT":36,"INTERFACE_REQUIREMENT":37,"PERFORMANCE_REQUIREMENT":38,"PHYSICAL_REQUIREMENT":39,"DESIGN_CONSTRAINT":40,"LOW_RISK":41,"MED_RISK":42,"HIGH_RISK":43,"VERIFY_ANALYSIS":44,"VERIFY_DEMONSTRATION":45,"VERIFY_INSPECTION":46,"VERIFY_TEST":47,"ELEMENT":48,"elementName":49,"elementBody":50,"TYPE":51,"type":52,"DOCREF":53,"ref":54,"END_ARROW_L":55,"relationship":56,"LINE":57,"END_ARROW_R":58,"CONTAINS":59,"COPIES":60,"DERIVES":61,"SATISFIES":62,"VERIFIES":63,"REFINES":64,"TRACES":65,"unqString":66,"qString":67,"$accept":0,"$end":1}, -terminals_: {2:"error",5:"NEWLINE",6:"RD",8:"EOF",12:":",14:"open_directive",15:"type_directive",16:"arg_directive",17:"close_directive",23:"STRUCT_START",25:"ID",26:"COLONSEP",28:"TEXT",30:"RISK",32:"VERIFYMTHD",34:"STRUCT_STOP",35:"REQUIREMENT",36:"FUNCTIONAL_REQUIREMENT",37:"INTERFACE_REQUIREMENT",38:"PERFORMANCE_REQUIREMENT",39:"PHYSICAL_REQUIREMENT",40:"DESIGN_CONSTRAINT",41:"LOW_RISK",42:"MED_RISK",43:"HIGH_RISK",44:"VERIFY_ANALYSIS",45:"VERIFY_DEMONSTRATION",46:"VERIFY_INSPECTION",47:"VERIFY_TEST",48:"ELEMENT",51:"TYPE",53:"DOCREF",55:"END_ARROW_L",57:"LINE",58:"END_ARROW_R",59:"CONTAINS",60:"COPIES",61:"DERIVES",62:"SATISFIES",63:"VERIFIES",64:"REFINES",65:"TRACES",66:"unqString",67:"qString"}, -productions_: [0,[3,3],[3,2],[3,4],[4,3],[4,5],[9,1],[10,1],[13,1],[11,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[18,5],[24,5],[24,5],[24,5],[24,5],[24,2],[24,1],[21,1],[21,1],[21,1],[21,1],[21,1],[21,1],[31,1],[31,1],[31,1],[33,1],[33,1],[33,1],[33,1],[19,5],[50,5],[50,5],[50,2],[50,1],[20,5],[20,5],[56,1],[56,1],[56,1],[56,1],[56,1],[56,1],[56,1],[22,1],[22,1],[27,1],[27,1],[29,1],[29,1],[49,1],[49,1],[52,1],[52,1],[54,1],[54,1]], +symbols_: {"error":2,"start":3,"SPACE":4,"NEWLINE":5,"directive":6,"SD":7,"document":8,"line":9,"statement":10,"openDirective":11,"typeDirective":12,"closeDirective":13,":":14,"argDirective":15,"participant":16,"actor":17,"AS":18,"restOfLine":19,"signal":20,"autonumber":21,"activate":22,"deactivate":23,"note_statement":24,"title":25,"text2":26,"loop":27,"end":28,"rect":29,"opt":30,"alt":31,"else_sections":32,"par":33,"par_sections":34,"and":35,"else":36,"note":37,"placement":38,"over":39,"actor_pair":40,"spaceList":41,",":42,"left_of":43,"right_of":44,"signaltype":45,"+":46,"-":47,"ACTOR":48,"SOLID_OPEN_ARROW":49,"DOTTED_OPEN_ARROW":50,"SOLID_ARROW":51,"DOTTED_ARROW":52,"SOLID_CROSS":53,"DOTTED_CROSS":54,"TXT":55,"open_directive":56,"type_directive":57,"arg_directive":58,"close_directive":59,"$accept":0,"$end":1}, +terminals_: {2:"error",4:"SPACE",5:"NEWLINE",7:"SD",14:":",16:"participant",18:"AS",19:"restOfLine",21:"autonumber",22:"activate",23:"deactivate",25:"title",27:"loop",28:"end",29:"rect",30:"opt",31:"alt",33:"par",35:"and",36:"else",37:"note",39:"over",42:",",43:"left_of",44:"right_of",46:"+",47:"-",48:"ACTOR",49:"SOLID_OPEN_ARROW",50:"DOTTED_OPEN_ARROW",51:"SOLID_ARROW",52:"DOTTED_ARROW",53:"SOLID_CROSS",54:"DOTTED_CROSS",55:"TXT",56:"open_directive",57:"type_directive",58:"arg_directive",59:"close_directive"}, +productions_: [0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[6,4],[6,6],[10,5],[10,3],[10,2],[10,1],[10,3],[10,3],[10,2],[10,3],[10,4],[10,4],[10,4],[10,4],[10,4],[10,1],[34,1],[34,4],[32,1],[32,4],[24,4],[24,4],[41,2],[41,1],[40,3],[40,1],[38,1],[38,1],[20,5],[20,5],[20,4],[17,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[26,1],[11,1],[12,1],[15,1],[13,1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ var $0 = $$.length - 1; switch (yystate) { -case 6: - yy.parseDirective('%%{', 'open_directive'); +case 4: + yy.apply($$[$0]);return $$[$0]; +case 5: + this.$ = []; break; -case 7: - yy.parseDirective($$[$0], 'type_directive'); +case 6: +$$[$0-1].push($$[$0]);this.$ = $$[$0-1]; break; -case 8: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +case 7: case 8: + this.$ = $$[$0]; break; case 9: - yy.parseDirective('}%%', 'close_directive', 'pie'); + this.$=[]; break; -case 10: - this.$ = []; +case 12: +$$[$0-3].description=yy.parseMessage($$[$0-1]); this.$=$$[$0-3]; +break; +case 13: +this.$=$$[$0-1]; +break; +case 15: +yy.enableSequenceNumbers(); break; case 16: - yy.addRequirement($$[$0-3], $$[$0-4]); +this.$={type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]}; break; case 17: - yy.setNewReqId($$[$0-2]); -break; -case 18: - yy.setNewReqText($$[$0-2]); +this.$={type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-1]}; break; case 19: - yy.setNewReqRisk($$[$0-2]); +this.$=[{type:'setTitle', text:$$[$0-1]}]; break; case 20: - yy.setNewReqVerifyMethod($$[$0-2]); + + $$[$0-1].unshift({type: 'loopStart', loopText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.LOOP_START}); + $$[$0-1].push({type: 'loopEnd', loopText:$$[$0-2], signalType: yy.LINETYPE.LOOP_END}); + this.$=$$[$0-1]; break; -case 23: - this.$=yy.RequirementType.REQUIREMENT; +case 21: + + $$[$0-1].unshift({type: 'rectStart', color:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.RECT_START }); + $$[$0-1].push({type: 'rectEnd', color:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.RECT_END }); + this.$=$$[$0-1]; break; -case 24: - this.$=yy.RequirementType.FUNCTIONAL_REQUIREMENT; +case 22: + + $$[$0-1].unshift({type: 'optStart', optText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.OPT_START}); + $$[$0-1].push({type: 'optEnd', optText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.OPT_END}); + this.$=$$[$0-1]; break; -case 25: - this.$=yy.RequirementType.INTERFACE_REQUIREMENT; +case 23: + + // Alt start + $$[$0-1].unshift({type: 'altStart', altText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.ALT_START}); + // Content in alt is already in $$[$0-1] + // End + $$[$0-1].push({type: 'altEnd', signalType: yy.LINETYPE.ALT_END}); + this.$=$$[$0-1]; break; -case 26: - this.$=yy.RequirementType.PERFORMANCE_REQUIREMENT; +case 24: + + // Parallel start + $$[$0-1].unshift({type: 'parStart', parText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.PAR_START}); + // Content in par is already in $$[$0-1] + // End + $$[$0-1].push({type: 'parEnd', signalType: yy.LINETYPE.PAR_END}); + this.$=$$[$0-1]; break; case 27: - this.$=yy.RequirementType.PHYSICAL_REQUIREMENT; -break; -case 28: - this.$=yy.RequirementType.DESIGN_CONSTRAINT; + this.$ = $$[$0-3].concat([{type: 'and', parText:yy.parseMessage($$[$0-1]), signalType: yy.LINETYPE.PAR_AND}, $$[$0]]); break; case 29: - this.$=yy.RiskLevel.LOW_RISK; + this.$ = $$[$0-3].concat([{type: 'else', altText:yy.parseMessage($$[$0-1]), signalType: yy.LINETYPE.ALT_ELSE}, $$[$0]]); break; case 30: - this.$=yy.RiskLevel.MED_RISK; + + this.$ = [$$[$0-1], {type:'addNote', placement:$$[$0-2], actor:$$[$0-1].actor, text:$$[$0]}]; break; case 31: - this.$=yy.RiskLevel.HIGH_RISK; -break; -case 32: - this.$=yy.VerifyType.VERIFY_ANALYSIS; -break; -case 33: - this.$=yy.VerifyType.VERIFY_DEMONSTRATION; + + // Coerce actor_pair into a [to, from, ...] array + $$[$0-2] = [].concat($$[$0-1], $$[$0-1]).slice(0, 2); + $$[$0-2][0] = $$[$0-2][0].actor; + $$[$0-2][1] = $$[$0-2][1].actor; + this.$ = [$$[$0-1], {type:'addNote', placement:yy.PLACEMENT.OVER, actor:$$[$0-2].slice(0, 2), text:$$[$0]}]; break; case 34: - this.$=yy.VerifyType.VERIFY_INSPECTION; + this.$ = [$$[$0-2], $$[$0]]; break; case 35: - this.$=yy.VerifyType.VERIFY_TEST; + this.$ = $$[$0]; break; case 36: - yy.addElement($$[$0-3]); + this.$ = yy.PLACEMENT.LEFTOF; break; case 37: - yy.setNewElementType($$[$0-2]); + this.$ = yy.PLACEMENT.RIGHTOF; break; case 38: - yy.setNewElementDocRef($$[$0-2]); + this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]}, + {type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]} + ]; +break; +case 39: + this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]}, + {type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-4]} + ]; +break; +case 40: + this.$ = [$$[$0-3],$$[$0-1],{type: 'addMessage', from:$$[$0-3].actor, to:$$[$0-1].actor, signalType:$$[$0-2], msg:$$[$0]}]; break; case 41: - yy.addRelationship($$[$0-2], $$[$0], $$[$0-4]); +this.$={type: 'addActor', actor:$$[$0]}; break; case 42: - yy.addRelationship($$[$0-2], $$[$0-4], $$[$0]); + this.$ = yy.LINETYPE.SOLID_OPEN; break; case 43: - this.$=yy.Relationships.CONTAINS; + this.$ = yy.LINETYPE.DOTTED_OPEN; break; case 44: - this.$=yy.Relationships.COPIES; + this.$ = yy.LINETYPE.SOLID; break; case 45: - this.$=yy.Relationships.DERIVES; + this.$ = yy.LINETYPE.DOTTED; break; case 46: - this.$=yy.Relationships.SATISFIES; + this.$ = yy.LINETYPE.SOLID_CROSS; break; case 47: - this.$=yy.Relationships.VERIFIES; + this.$ = yy.LINETYPE.DOTTED_CROSS; break; case 48: - this.$=yy.Relationships.REFINES; +this.$ = yy.parseMessage($$[$0].trim().substring(1)); break; case 49: - this.$=yy.Relationships.TRACES; + yy.parseDirective('%%{', 'open_directive'); +break; +case 50: + yy.parseDirective($$[$0], 'type_directive'); +break; +case 51: + $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); +break; +case 52: + yy.parseDirective('}%%', 'close_directive', 'sequence'); break; } }, -table: [{3:1,4:2,6:$V0,9:4,14:$V1},{1:[3]},{3:7,4:2,5:[1,6],6:$V0,9:4,14:$V1},{5:[1,8]},{10:9,15:[1,10]},{15:[2,6]},{3:11,4:2,6:$V0,9:4,14:$V1},{1:[2,2]},{4:16,5:$V2,7:12,8:$V3,9:4,14:$V1,18:13,19:14,20:15,21:18,27:20,35:$V4,36:$V5,37:$V6,38:$V7,39:$V8,40:$V9,48:$Va,66:$Vb,67:$Vc},{11:29,12:[1,30],17:$Vd},o([12,17],[2,7]),{1:[2,1]},{8:[1,32]},{4:16,5:$V2,7:33,8:$V3,9:4,14:$V1,18:13,19:14,20:15,21:18,27:20,35:$V4,36:$V5,37:$V6,38:$V7,39:$V8,40:$V9,48:$Va,66:$Vb,67:$Vc},{4:16,5:$V2,7:34,8:$V3,9:4,14:$V1,18:13,19:14,20:15,21:18,27:20,35:$V4,36:$V5,37:$V6,38:$V7,39:$V8,40:$V9,48:$Va,66:$Vb,67:$Vc},{4:16,5:$V2,7:35,8:$V3,9:4,14:$V1,18:13,19:14,20:15,21:18,27:20,35:$V4,36:$V5,37:$V6,38:$V7,39:$V8,40:$V9,48:$Va,66:$Vb,67:$Vc},{4:16,5:$V2,7:36,8:$V3,9:4,14:$V1,18:13,19:14,20:15,21:18,27:20,35:$V4,36:$V5,37:$V6,38:$V7,39:$V8,40:$V9,48:$Va,66:$Vb,67:$Vc},{4:16,5:$V2,7:37,8:$V3,9:4,14:$V1,18:13,19:14,20:15,21:18,27:20,35:$V4,36:$V5,37:$V6,38:$V7,39:$V8,40:$V9,48:$Va,66:$Vb,67:$Vc},{22:38,66:[1,39],67:[1,40]},{49:41,66:[1,42],67:[1,43]},{55:[1,44],57:[1,45]},o($Ve,[2,23]),o($Ve,[2,24]),o($Ve,[2,25]),o($Ve,[2,26]),o($Ve,[2,27]),o($Ve,[2,28]),o($Vf,[2,52]),o($Vf,[2,53]),o($Vg,[2,4]),{13:46,16:[1,47]},o($Vg,[2,9]),{1:[2,3]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{23:[1,48]},{23:[2,50]},{23:[2,51]},{23:[1,49]},{23:[2,56]},{23:[2,57]},{56:50,59:$Vh,60:$Vi,61:$Vj,62:$Vk,63:$Vl,64:$Vm,65:$Vn},{56:58,59:$Vh,60:$Vi,61:$Vj,62:$Vk,63:$Vl,64:$Vm,65:$Vn},{11:59,17:$Vd},{17:[2,8]},{5:[1,60]},{5:[1,61]},{57:[1,62]},o($Vo,[2,43]),o($Vo,[2,44]),o($Vo,[2,45]),o($Vo,[2,46]),o($Vo,[2,47]),o($Vo,[2,48]),o($Vo,[2,49]),{58:[1,63]},o($Vg,[2,5]),{5:$Vp,24:64,25:$Vq,28:$Vr,30:$Vs,32:$Vt,34:$Vu},{5:$Vv,34:$Vw,50:71,51:$Vx,53:$Vy},{27:76,66:$Vb,67:$Vc},{27:77,66:$Vb,67:$Vc},o($Vz,[2,16]),{26:[1,78]},{26:[1,79]},{26:[1,80]},{26:[1,81]},{5:$Vp,24:82,25:$Vq,28:$Vr,30:$Vs,32:$Vt,34:$Vu},o($Vz,[2,22]),o($Vz,[2,36]),{26:[1,83]},{26:[1,84]},{5:$Vv,34:$Vw,50:85,51:$Vx,53:$Vy},o($Vz,[2,40]),o($Vz,[2,41]),o($Vz,[2,42]),{27:86,66:$Vb,67:$Vc},{29:87,66:[1,88],67:[1,89]},{31:90,41:[1,91],42:[1,92],43:[1,93]},{33:94,44:[1,95],45:[1,96],46:[1,97],47:[1,98]},o($Vz,[2,21]),{52:99,66:[1,100],67:[1,101]},{54:102,66:[1,103],67:[1,104]},o($Vz,[2,39]),{5:[1,105]},{5:[1,106]},{5:[2,54]},{5:[2,55]},{5:[1,107]},{5:[2,29]},{5:[2,30]},{5:[2,31]},{5:[1,108]},{5:[2,32]},{5:[2,33]},{5:[2,34]},{5:[2,35]},{5:[1,109]},{5:[2,58]},{5:[2,59]},{5:[1,110]},{5:[2,60]},{5:[2,61]},{5:$Vp,24:111,25:$Vq,28:$Vr,30:$Vs,32:$Vt,34:$Vu},{5:$Vp,24:112,25:$Vq,28:$Vr,30:$Vs,32:$Vt,34:$Vu},{5:$Vp,24:113,25:$Vq,28:$Vr,30:$Vs,32:$Vt,34:$Vu},{5:$Vp,24:114,25:$Vq,28:$Vr,30:$Vs,32:$Vt,34:$Vu},{5:$Vv,34:$Vw,50:115,51:$Vx,53:$Vy},{5:$Vv,34:$Vw,50:116,51:$Vx,53:$Vy},o($Vz,[2,17]),o($Vz,[2,18]),o($Vz,[2,19]),o($Vz,[2,20]),o($Vz,[2,37]),o($Vz,[2,38])], -defaultActions: {5:[2,6],7:[2,2],11:[2,1],32:[2,3],33:[2,11],34:[2,12],35:[2,13],36:[2,14],37:[2,15],39:[2,50],40:[2,51],42:[2,56],43:[2,57],47:[2,8],88:[2,54],89:[2,55],91:[2,29],92:[2,30],93:[2,31],95:[2,32],96:[2,33],97:[2,34],98:[2,35],100:[2,58],101:[2,59],103:[2,60],104:[2,61]}, +table: [{3:1,4:$V0,5:$V1,6:4,7:$V2,11:6,56:$V3},{1:[3]},{3:8,4:$V0,5:$V1,6:4,7:$V2,11:6,56:$V3},{3:9,4:$V0,5:$V1,6:4,7:$V2,11:6,56:$V3},{3:10,4:$V0,5:$V1,6:4,7:$V2,11:6,56:$V3},o([1,4,5,16,21,22,23,25,27,29,30,31,33,37,48,56],$V4,{8:11}),{12:12,57:[1,13]},{57:[2,49]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:$V5,5:$V6,6:30,9:14,10:16,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,29:$Vd,30:$Ve,31:$Vf,33:$Vg,37:$Vh,48:$Vi,56:$V3},{13:34,14:[1,35],59:$Vj},o([14,59],[2,50]),o($Vk,[2,6]),{6:30,10:37,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,29:$Vd,30:$Ve,31:$Vf,33:$Vg,37:$Vh,48:$Vi,56:$V3},o($Vk,[2,8]),o($Vk,[2,9]),{17:38,48:$Vi},{5:[1,39]},o($Vk,[2,15]),{17:40,48:$Vi},{17:41,48:$Vi},{5:[1,42]},{26:43,55:$Vl},{19:[1,45]},{19:[1,46]},{19:[1,47]},{19:[1,48]},{19:[1,49]},o($Vk,[2,25]),{45:50,49:[1,51],50:[1,52],51:[1,53],52:[1,54],53:[1,55],54:[1,56]},{38:57,39:[1,58],43:[1,59],44:[1,60]},o([5,18,42,49,50,51,52,53,54,55],[2,41]),{5:[1,61]},{15:62,58:[1,63]},{5:[2,52]},o($Vk,[2,7]),{5:[1,65],18:[1,64]},o($Vk,[2,14]),{5:[1,66]},{5:[1,67]},o($Vk,[2,18]),{5:[1,68]},{5:[2,48]},o($Vm,$V4,{8:69}),o($Vm,$V4,{8:70}),o($Vm,$V4,{8:71}),o($Vn,$V4,{32:72,8:73}),o($Vo,$V4,{34:74,8:75}),{17:78,46:[1,76],47:[1,77],48:$Vi},o($Vp,[2,42]),o($Vp,[2,43]),o($Vp,[2,44]),o($Vp,[2,45]),o($Vp,[2,46]),o($Vp,[2,47]),{17:79,48:$Vi},{17:81,40:80,48:$Vi},{48:[2,36]},{48:[2,37]},o($Vq,[2,10]),{13:82,59:$Vj},{59:[2,51]},{19:[1,83]},o($Vk,[2,13]),o($Vk,[2,16]),o($Vk,[2,17]),o($Vk,[2,19]),{4:$V5,5:$V6,6:30,9:14,10:16,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,28:[1,84],29:$Vd,30:$Ve,31:$Vf,33:$Vg,37:$Vh,48:$Vi,56:$V3},{4:$V5,5:$V6,6:30,9:14,10:16,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,28:[1,85],29:$Vd,30:$Ve,31:$Vf,33:$Vg,37:$Vh,48:$Vi,56:$V3},{4:$V5,5:$V6,6:30,9:14,10:16,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,28:[1,86],29:$Vd,30:$Ve,31:$Vf,33:$Vg,37:$Vh,48:$Vi,56:$V3},{28:[1,87]},{4:$V5,5:$V6,6:30,9:14,10:16,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,28:[2,28],29:$Vd,30:$Ve,31:$Vf,33:$Vg,36:[1,88],37:$Vh,48:$Vi,56:$V3},{28:[1,89]},{4:$V5,5:$V6,6:30,9:14,10:16,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,28:[2,26],29:$Vd,30:$Ve,31:$Vf,33:$Vg,35:[1,90],37:$Vh,48:$Vi,56:$V3},{17:91,48:$Vi},{17:92,48:$Vi},{26:93,55:$Vl},{26:94,55:$Vl},{26:95,55:$Vl},{42:[1,96],55:[2,35]},{5:[1,97]},{5:[1,98]},o($Vk,[2,20]),o($Vk,[2,21]),o($Vk,[2,22]),o($Vk,[2,23]),{19:[1,99]},o($Vk,[2,24]),{19:[1,100]},{26:101,55:$Vl},{26:102,55:$Vl},{5:[2,40]},{5:[2,30]},{5:[2,31]},{17:103,48:$Vi},o($Vq,[2,11]),o($Vk,[2,12]),o($Vn,$V4,{8:73,32:104}),o($Vo,$V4,{8:75,34:105}),{5:[2,38]},{5:[2,39]},{55:[2,34]},{28:[2,29]},{28:[2,27]}], +defaultActions: {7:[2,49],8:[2,1],9:[2,2],10:[2,3],36:[2,52],44:[2,48],59:[2,36],60:[2,37],63:[2,51],93:[2,40],94:[2,30],95:[2,31],101:[2,38],102:[2,39],103:[2,34],104:[2,29],105:[2,27]}, parseError: function parseError (str, hash) { if (hash.recoverable) { this.trace(str); @@ -120890,1347 +120152,62 @@ stateStackSize:function stateStackSize() { options: {"case-insensitive":true}, performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { switch($avoiding_name_collisions) { -case 0: this.begin('open_directive'); return 14; -case 1: this.begin('type_directive'); return 15; -case 2: this.popState(); this.begin('arg_directive'); return 12; -case 3: this.popState(); this.popState(); return 17; -case 4:return 16; +case 0: this.begin('open_directive'); return 56; +case 1: this.begin('type_directive'); return 57; +case 2: this.popState(); this.begin('arg_directive'); return 14; +case 3: this.popState(); this.popState(); return 59; +case 4:return 58; case 5:return 5; case 6:/* skip all whitespace */ break; -case 7:/* skip comments */ +case 7:/* skip same-line whitespace */ break; case 8:/* skip comments */ break; -case 9:return 8; -case 10:return 6; -case 11:return 23; -case 12:return 34; -case 13:return 26; -case 14:return 25; -case 15:return 28; -case 16:return 30; -case 17:return 32; -case 18:return 35; -case 19:return 36; -case 20:return 37; -case 21:return 38; -case 22:return 39; -case 23:return 40; -case 24:return 41; -case 25:return 42; -case 26:return 43; -case 27:return 44; -case 28:return 45; -case 29:return 46; -case 30:return 47; -case 31:return 48; -case 32:return 59; -case 33:return 60; -case 34:return 61; -case 35:return 62; -case 36:return 63; -case 37:return 64; -case 38:return 65; -case 39:return 51; -case 40:return 53; -case 41:return 55; -case 42:return 58; -case 43:return 57; -case 44: this.begin("string"); +case 9:/* skip comments */ break; -case 45: this.popState(); +case 10:/* skip comments */ break; -case 46: return "qString"; -case 47: yy_.yytext = yy_.yytext.trim(); return 66; +case 11: this.begin('ID'); return 16; +case 12: yy_.yytext = yy_.yytext.trim(); this.begin('ALIAS'); return 48; +case 13: this.popState(); this.popState(); this.begin('LINE'); return 18; +case 14: this.popState(); this.popState(); return 5; +case 15: this.begin('LINE'); return 27; +case 16: this.begin('LINE'); return 29; +case 17: this.begin('LINE'); return 30; +case 18: this.begin('LINE'); return 31; +case 19: this.begin('LINE'); return 36; +case 20: this.begin('LINE'); return 33; +case 21: this.begin('LINE'); return 35; +case 22: this.popState(); return 19; +case 23:return 28; +case 24:return 43; +case 25:return 44; +case 26:return 39; +case 27:return 37; +case 28: this.begin('ID'); return 22; +case 29: this.begin('ID'); return 23; +case 30:return 25; +case 31:return 7; +case 32:return 21; +case 33:return 42; +case 34:return 5; +case 35: yy_.yytext = yy_.yytext.trim(); return 48; +case 36:return 51; +case 37:return 52; +case 38:return 49; +case 39:return 50; +case 40:return 53; +case 41:return 54; +case 42:return 55; +case 43:return 46; +case 44:return 47; +case 45:return 5; +case 46:return 'INVALID'; } }, -rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:(\r?\n)+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:$)/i,/^(?:requirementDiagram\b)/i,/^(?:\{)/i,/^(?:\})/i,/^(?::)/i,/^(?:id\b)/i,/^(?:text\b)/i,/^(?:risk\b)/i,/^(?:verifyMethod\b)/i,/^(?:requirement\b)/i,/^(?:functionalRequirement\b)/i,/^(?:interfaceRequirement\b)/i,/^(?:performanceRequirement\b)/i,/^(?:physicalRequirement\b)/i,/^(?:designConstraint\b)/i,/^(?:low\b)/i,/^(?:medium\b)/i,/^(?:high\b)/i,/^(?:analysis\b)/i,/^(?:demonstration\b)/i,/^(?:inspection\b)/i,/^(?:test\b)/i,/^(?:element\b)/i,/^(?:contains\b)/i,/^(?:copies\b)/i,/^(?:derives\b)/i,/^(?:satisfies\b)/i,/^(?:verifies\b)/i,/^(?:refines\b)/i,/^(?:traces\b)/i,/^(?:type\b)/i,/^(?:docref\b)/i,/^(?:<-)/i,/^(?:->)/i,/^(?:-)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[\w][^\r\n\{\<\>\-\=]*)/i], -conditions: {"close_directive":{"rules":[],"inclusive":false},"arg_directive":{"rules":[3,4],"inclusive":false},"type_directive":{"rules":[2,3],"inclusive":false},"open_directive":{"rules":[1],"inclusive":false},"unqString":{"rules":[],"inclusive":false},"token":{"rules":[],"inclusive":false},"string":{"rules":[45,46],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,47],"inclusive":true}} -}); -return lexer; -})(); -parser.lexer = lexer; -function Parser () { - this.yy = {}; -} -Parser.prototype = parser;parser.Parser = Parser; -return new Parser; -})(); - - -{ -exports.parser = parser; -exports.Parser = parser.Parser; -exports.parse = function () { return parser.parse.apply(parser, arguments); }; -exports.main = function commonjsMain (args) { - if (!args[1]) { - console.log('Usage: '+args[0]+' FILE'); - process.exit(1); - } - var source = __webpack_require__(/*! fs */ "./node_modules/node-libs-browser/mock/empty.js").readFileSync(__webpack_require__(/*! path */ "./node_modules/path-browserify/index.js").normalize(args[1]), "utf8"); - return exports.parser.parse(source); -}; -if ( __webpack_require__.c[__webpack_require__.s] === module) { - exports.main(process.argv.slice(1)); -} -} -/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../../node_modules/process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../../../../node_modules/webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))); - -/***/ }), - -/***/ "./src/diagrams/requirement/requirementDb.js": -/*!***************************************************!*\ - !*** ./src/diagrams/requirement/requirementDb.js ***! - \***************************************************/ -/*! exports provided: parseDirective, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseDirective", function() { return parseDirective; }); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../config */ "./src/config.js"); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); -/* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js"); - - - -var relations = []; -var latestRequirement = {}; -var requirements = {}; -var latestElement = {}; -var elements = {}; -var RequirementType = { - REQUIREMENT: 'Requirement', - FUNCTIONAL_REQUIREMENT: 'Functional Requirement', - INTERFACE_REQUIREMENT: 'Interface Requirement', - PERFORMANCE_REQUIREMENT: 'Performance Requirement', - PHYSICAL_REQUIREMENT: 'Physical Requirement', - DESIGN_CONSTRAINT: 'Design Constraint' -}; -var RiskLevel = { - LOW_RISK: 'Low', - MED_RISK: 'Medium', - HIGH_RISK: 'High' -}; -var VerifyType = { - VERIFY_ANALYSIS: 'Analysis', - VERIFY_DEMONSTRATION: 'Demonstration', - VERIFY_INSPECTION: 'Inspection', - VERIFY_TEST: 'Test' -}; -var Relationships = { - CONTAINS: 'contains', - COPIES: 'copies', - DERIVES: 'derives', - SATISFIES: 'satisfies', - VERIFIES: 'verifies', - REFINES: 'refines', - TRACES: 'traces' -}; -var parseDirective = function parseDirective(statement, context, type) { - _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__["default"].parseDirective(this, statement, context, type); -}; - -var addRequirement = function addRequirement(name, type) { - if (typeof requirements[name] === 'undefined') { - requirements[name] = { - name: name, - type: type, - id: latestRequirement.id, - text: latestRequirement.text, - risk: latestRequirement.risk, - verifyMethod: latestRequirement.verifyMethod - }; - } - - latestRequirement = {}; - return requirements[name]; -}; - -var getRequirements = function getRequirements() { - return requirements; -}; - -var setNewReqId = function setNewReqId(id) { - if (typeof latestRequirement != 'undefined') { - latestRequirement.id = id; - } -}; - -var setNewReqText = function setNewReqText(text) { - if (typeof latestRequirement != 'undefined') { - latestRequirement.text = text; - } -}; - -var setNewReqRisk = function setNewReqRisk(risk) { - if (typeof latestRequirement != 'undefined') { - latestRequirement.risk = risk; - } -}; - -var setNewReqVerifyMethod = function setNewReqVerifyMethod(verifyMethod) { - if (typeof latestRequirement != 'undefined') { - latestRequirement.verifyMethod = verifyMethod; - } -}; - -var addElement = function addElement(name) { - if (typeof elements[name] === 'undefined') { - elements[name] = { - name: name, - type: latestElement.type, - docRef: latestElement.docRef - }; - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].info('Added new requirement: ', name); - } - - latestElement = {}; - return elements[name]; -}; - -var getElements = function getElements() { - return elements; -}; - -var setNewElementType = function setNewElementType(type) { - if (typeof latestElement != 'undefined') { - latestElement.type = type; - } -}; - -var setNewElementDocRef = function setNewElementDocRef(docRef) { - if (typeof latestElement != 'undefined') { - latestElement.docRef = docRef; - } -}; - -var addRelationship = function addRelationship(type, src, dst) { - relations.push({ - type: type, - src: src, - dst: dst - }); -}; - -var getRelationships = function getRelationships() { - return relations; -}; - -var clear = function clear() { - relations = []; - latestRequirement = {}; - requirements = {}; - latestElement = {}; - elements = {}; -}; - -/* harmony default export */ __webpack_exports__["default"] = ({ - RequirementType: RequirementType, - RiskLevel: RiskLevel, - VerifyType: VerifyType, - Relationships: Relationships, - parseDirective: parseDirective, - getConfig: function getConfig() { - return _config__WEBPACK_IMPORTED_MODULE_0__["getConfig"]().req; - }, - addRequirement: addRequirement, - getRequirements: getRequirements, - setNewReqId: setNewReqId, - setNewReqText: setNewReqText, - setNewReqRisk: setNewReqRisk, - setNewReqVerifyMethod: setNewReqVerifyMethod, - addElement: addElement, - getElements: getElements, - setNewElementType: setNewElementType, - setNewElementDocRef: setNewElementDocRef, - addRelationship: addRelationship, - getRelationships: getRelationships, - clear: clear -}); - -/***/ }), - -/***/ "./src/diagrams/requirement/requirementMarkers.js": -/*!********************************************************!*\ - !*** ./src/diagrams/requirement/requirementMarkers.js ***! - \********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { -__webpack_require__.r(__webpack_exports__); -var ReqMarkers = { - CONTAINS: 'contains', - ARROW: 'arrow' -}; - -var insertLineEndings = function insertLineEndings(parentNode, conf) { - var containsNode = parentNode.append('defs').append('marker').attr('id', ReqMarkers.CONTAINS + '_line_ending').attr('refX', 0).attr('refY', conf.line_height / 2).attr('markerWidth', conf.line_height).attr('markerHeight', conf.line_height).attr('orient', 'auto').append('g'); - containsNode.append('circle').attr('cx', conf.line_height / 2).attr('cy', conf.line_height / 2).attr('r', conf.line_height / 2) // .attr('stroke', conf.rect_border_color) - // .attr('stroke-width', 1) - .attr('fill', 'none'); - containsNode.append('line').attr('x1', 0).attr('x2', conf.line_height).attr('y1', conf.line_height / 2).attr('y2', conf.line_height / 2) // .attr('stroke', conf.rect_border_color) - .attr('stroke-width', 1); - containsNode.append('line').attr('y1', 0).attr('y2', conf.line_height).attr('x1', conf.line_height / 2).attr('x2', conf.line_height / 2) // .attr('stroke', conf.rect_border_color) - .attr('stroke-width', 1); - parentNode.append('defs').append('marker').attr('id', ReqMarkers.ARROW + '_line_ending').attr('refX', conf.line_height).attr('refY', 0.5 * conf.line_height).attr('markerWidth', conf.line_height).attr('markerHeight', conf.line_height).attr('orient', 'auto').append('path').attr('d', "M0,0\n L".concat(conf.line_height, ",").concat(conf.line_height / 2, "\n M").concat(conf.line_height, ",").concat(conf.line_height / 2, "\n L0,").concat(conf.line_height)).attr('stroke-width', 1); // .attr('stroke', conf.rect_border_color); -}; - -/* harmony default export */ __webpack_exports__["default"] = ({ - ReqMarkers: ReqMarkers, - insertLineEndings: insertLineEndings -}); - -/***/ }), - -/***/ "./src/diagrams/requirement/requirementRenderer.js": -/*!*********************************************************!*\ - !*** ./src/diagrams/requirement/requirementRenderer.js ***! - \*********************************************************/ -/*! exports provided: setConf, drawReqs, drawElements, draw, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setConf", function() { return setConf; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawReqs", function() { return drawReqs; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawElements", function() { return drawElements; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "draw", function() { return draw; }); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); -/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! dagre */ "dagre"); -/* harmony import */ var dagre__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(dagre__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! graphlib */ "graphlib"); -/* harmony import */ var graphlib__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(graphlib__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); -/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); -/* harmony import */ var _parser_requirementDiagram__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./parser/requirementDiagram */ "./src/diagrams/requirement/parser/requirementDiagram.jison"); -/* harmony import */ var _requirementDb__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./requirementDb */ "./src/diagrams/requirement/requirementDb.js"); -/* harmony import */ var _requirementMarkers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./requirementMarkers */ "./src/diagrams/requirement/requirementMarkers.js"); - - - // import * as configApi from '../../config'; - - - - - - - -var conf = {}; -var relCnt = 0; -var setConf = function setConf(cnf) { - if (typeof cnf === 'undefined') { - return; - } - - var keys = Object.keys(cnf); - - for (var i = 0; i < keys.length; i++) { - conf[keys[i]] = cnf[keys[i]]; - } -}; - -var newRectNode = function newRectNode(parentNode, id) { - return parentNode.insert('rect', '#' + id).attr('class', 'req reqBox').attr('x', 0).attr('y', 0).attr('width', conf.rect_min_width + 'px').attr('height', conf.rect_min_height + 'px'); -}; - -var newTitleNode = function newTitleNode(parentNode, id, txts) { - var x = conf.rect_min_width / 2; - var title = parentNode.append('text').attr('class', 'req reqLabel reqTitle').attr('id', id).attr('x', x).attr('y', conf.rect_padding).attr('dominant-baseline', 'hanging'); // .attr( - // 'style', - // 'font-family: ' + configApi.getConfig().fontFamily + '; font-size: ' + conf.fontSize + 'px' - // ) - - var i = 0; - txts.forEach(function (textStr) { - if (i == 0) { - title.append('tspan').attr('text-anchor', 'middle').attr('x', conf.rect_min_width / 2).attr('dy', 0).text(textStr); - } else { - title.append('tspan').attr('text-anchor', 'middle').attr('x', conf.rect_min_width / 2).attr('dy', conf.line_height * 0.75).text(textStr); - } - - i++; - }); - var yPadding = 1.5 * conf.rect_padding; - var linePadding = i * conf.line_height * 0.75; - var totalY = yPadding + linePadding; - parentNode.append('line').attr('class', 'req-title-line').attr('x1', '0').attr('x2', conf.rect_min_width).attr('y1', totalY).attr('y2', totalY); - return { - titleNode: title, - y: totalY - }; -}; - -var newBodyNode = function newBodyNode(parentNode, id, txts, yStart) { - var body = parentNode.append('text').attr('class', 'req reqLabel').attr('id', id).attr('x', conf.rect_padding).attr('y', yStart).attr('dominant-baseline', 'hanging'); // .attr( - // 'style', - // 'font-family: ' + configApi.getConfig().fontFamily + '; font-size: ' + conf.fontSize + 'px' - // ); - - var currentRow = 0; - var charLimit = 30; - var wrappedTxts = []; - txts.forEach(function (textStr) { - var currentTextLen = textStr.length; - - while (currentTextLen > charLimit && currentRow < 3) { - var firstPart = textStr.substring(0, charLimit); - textStr = textStr.substring(charLimit, textStr.length); - currentTextLen = textStr.length; - wrappedTxts[wrappedTxts.length] = firstPart; - currentRow++; - } - - if (currentRow == 3) { - var lastStr = wrappedTxts[wrappedTxts.length - 1]; - wrappedTxts[wrappedTxts.length - 1] = lastStr.substring(0, lastStr.length - 4) + '...'; - } else { - wrappedTxts[wrappedTxts.length] = textStr; - } - - currentRow = 0; - }); - wrappedTxts.forEach(function (textStr) { - body.append('tspan').attr('x', conf.rect_padding).attr('dy', conf.line_height).text(textStr); - }); - return body; -}; - -var addEdgeLabel = function addEdgeLabel(parentNode, svgPath, conf, txt) { - // Find the half-way point - var len = svgPath.node().getTotalLength(); - var labelPoint = svgPath.node().getPointAtLength(len * 0.5); // Append a text node containing the label - - var labelId = 'rel' + relCnt; - relCnt++; - var labelNode = parentNode.append('text').attr('class', 'req relationshipLabel').attr('id', labelId).attr('x', labelPoint.x).attr('y', labelPoint.y).attr('text-anchor', 'middle').attr('dominant-baseline', 'middle') // .attr('style', 'font-family: ' + conf.fontFamily + '; font-size: ' + conf.fontSize + 'px') - .text(txt); // Figure out how big the opaque 'container' rectangle needs to be - - var labelBBox = labelNode.node().getBBox(); // Insert the opaque rectangle before the text label - - parentNode.insert('rect', '#' + labelId).attr('class', 'req reqLabelBox').attr('x', labelPoint.x - labelBBox.width / 2).attr('y', labelPoint.y - labelBBox.height / 2).attr('width', labelBBox.width).attr('height', labelBBox.height).attr('fill', 'white').attr('fill-opacity', '85%'); -}; - -var drawRelationshipFromLayout = function drawRelationshipFromLayout(svg, rel, g, insert) { - // Find the edge relating to this relationship - var edge = g.edge(elementString(rel.src), elementString(rel.dst)); // Get a function that will generate the line path - - var lineFunction = Object(d3__WEBPACK_IMPORTED_MODULE_0__["line"])().x(function (d) { - return d.x; - }).y(function (d) { - return d.y; - }); // Insert the line at the right place - - var svgPath = svg.insert('path', '#' + insert).attr('class', 'er relationshipLine').attr('d', lineFunction(edge.points)).attr('fill', 'none'); - - if (rel.type == _requirementDb__WEBPACK_IMPORTED_MODULE_7__["default"].Relationships.CONTAINS) { - svgPath.attr('marker-start', 'url(' + _common_common__WEBPACK_IMPORTED_MODULE_5__["default"].getUrl(conf.arrowMarkerAbsolute) + '#' + rel.type + '_line_ending' + ')'); - } else { - svgPath.attr('stroke-dasharray', '10,7'); - svgPath.attr('marker-end', 'url(' + _common_common__WEBPACK_IMPORTED_MODULE_5__["default"].getUrl(conf.arrowMarkerAbsolute) + '#' + _requirementMarkers__WEBPACK_IMPORTED_MODULE_8__["default"].ReqMarkers.ARROW + '_line_ending' + ')'); - } - - addEdgeLabel(svg, svgPath, conf, "<<".concat(rel.type, ">>")); - return; -}; - -var drawReqs = function drawReqs(reqs, graph, svgNode) { - Object.keys(reqs).forEach(function (reqName) { - var req = reqs[reqName]; - reqName = elementString(reqName); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('Added new requirement: ', reqName); - var groupNode = svgNode.append('g').attr('id', reqName); - var textId = 'req-' + reqName; - var rectNode = newRectNode(groupNode, textId); - var titleNodeInfo = newTitleNode(groupNode, reqName + '_title', ["<<".concat(req.type, ">>"), "".concat(req.name)]); - newBodyNode(groupNode, reqName + '_body', ["Id: ".concat(req.id), "Text: ".concat(req.text), "Risk: ".concat(req.risk), "Verification: ".concat(req.verifyMethod)], titleNodeInfo.y); - var rectBBox = rectNode.node().getBBox(); // Add the entity to the graph - - graph.setNode(reqName, { - width: rectBBox.width, - height: rectBBox.height, - shape: 'rect', - id: reqName - }); - }); -}; -var drawElements = function drawElements(els, graph, svgNode) { - Object.keys(els).forEach(function (elName) { - var el = els[elName]; - var id = elementString(elName); - var groupNode = svgNode.append('g').attr('id', id); - var textId = 'element-' + id; - var rectNode = newRectNode(groupNode, textId); - var titleNodeInfo = newTitleNode(groupNode, textId + '_title', ["<>", "".concat(elName)]); - newBodyNode(groupNode, textId + '_body', ["Type: ".concat(el.type || 'Not Specified'), "Doc Ref: ".concat(el.docRef || 'None')], titleNodeInfo.y); - var rectBBox = rectNode.node().getBBox(); // Add the entity to the graph - - graph.setNode(id, { - width: rectBBox.width, - height: rectBBox.height, - shape: 'rect', - id: id - }); - }); -}; - -var addRelationships = function addRelationships(relationships, g) { - relationships.forEach(function (r) { - var src = elementString(r.src); - var dst = elementString(r.dst); - g.setEdge(src, dst, { - relationship: r - }); - }); - return relationships; -}; - -var adjustEntities = function adjustEntities(svgNode, graph) { - graph.nodes().forEach(function (v) { - if (typeof v !== 'undefined' && typeof graph.node(v) !== 'undefined') { - svgNode.select('#' + v); - svgNode.select('#' + v).attr('transform', 'translate(' + (graph.node(v).x - graph.node(v).width / 2) + ',' + (graph.node(v).y - graph.node(v).height / 2) + ' )'); - } - }); - return; -}; - -var elementString = function elementString(str) { - return str.replace(/\s/g, '').replace(/\./g, '_'); -}; - -var draw = function draw(text, id) { - _parser_requirementDiagram__WEBPACK_IMPORTED_MODULE_6__["parser"].yy = _requirementDb__WEBPACK_IMPORTED_MODULE_7__["default"]; - _parser_requirementDiagram__WEBPACK_IMPORTED_MODULE_6__["parser"].yy.clear(); - _parser_requirementDiagram__WEBPACK_IMPORTED_MODULE_6__["parser"].parse(text); - var svg = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])("[id='".concat(id, "']")); - _requirementMarkers__WEBPACK_IMPORTED_MODULE_8__["default"].insertLineEndings(svg, conf); - var g = new graphlib__WEBPACK_IMPORTED_MODULE_2___default.a.Graph({ - multigraph: false, - compound: false, - directed: true - }).setGraph({ - rankdir: conf.layoutDirection, - marginx: 20, - marginy: 20, - nodesep: 100, - edgesep: 100, - ranksep: 100 - }).setDefaultEdgeLabel(function () { - return {}; - }); - var requirements = _requirementDb__WEBPACK_IMPORTED_MODULE_7__["default"].getRequirements(); - var elements = _requirementDb__WEBPACK_IMPORTED_MODULE_7__["default"].getElements(); - var relationships = _requirementDb__WEBPACK_IMPORTED_MODULE_7__["default"].getRelationships(); - drawReqs(requirements, g, svg); - drawElements(elements, g, svg); - addRelationships(relationships, g); - dagre__WEBPACK_IMPORTED_MODULE_1___default.a.layout(g); - adjustEntities(svg, g); - relationships.forEach(function (rel) { - drawRelationshipFromLayout(svg, rel, g, id); - }); // svg.attr('height', '500px'); - - var padding = conf.rect_padding; - var svgBounds = svg.node().getBBox(); - var width = svgBounds.width + padding * 2; - var height = svgBounds.height + padding * 2; - Object(_utils__WEBPACK_IMPORTED_MODULE_4__["configureSvgSize"])(svg, height, width, conf.useMaxWidth); - svg.attr('viewBox', "".concat(svgBounds.x - padding, " ").concat(svgBounds.y - padding, " ").concat(width, " ").concat(height)); -}; -/* harmony default export */ __webpack_exports__["default"] = ({ - setConf: setConf, - draw: draw -}); - -/***/ }), - -/***/ "./src/diagrams/requirement/styles.js": -/*!********************************************!*\ - !*** ./src/diagrams/requirement/styles.js ***! - \********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { -__webpack_require__.r(__webpack_exports__); -var getStyles = function getStyles(options) { - return "\n\n marker {\n fill: ".concat(options.relationColor, ";\n stroke: ").concat(options.relationColor, ";\n }\n\n marker.cross {\n stroke: ").concat(options.lineColor, ";\n }\n\n svg {\n font-family: ").concat(options.fontFamily, ";\n font-size: ").concat(options.fontSize, ";\n }\n\n .reqBox {\n fill: ").concat(options.requirementBackground, ";\n fill-opacity: 100%;\n stroke: ").concat(options.requirementBorderColor, ";\n stroke-width: ").concat(options.requirementBorderSize, ";\n }\n \n .reqTitle, .reqLabel{\n fill: ").concat(options.requirementTextColor, ";\n }\n .reqLabelBox {\n fill: ").concat(options.relationLabelBackground, ";\n fill-opacity: 100%;\n }\n\n .req-title-line {\n stroke: ").concat(options.requirementBorderColor, ";\n stroke-width: ").concat(options.requirementBorderSize, ";\n }\n .relationshipLine {\n stroke: ").concat(options.relationColor, ";\n stroke-width: 1;\n }\n .relationshipLabel {\n fill: ").concat(options.relationLabelColor, ";\n }\n\n"); -}; // fill', conf.rect_fill) - - -/* harmony default export */ __webpack_exports__["default"] = (getStyles); - -/***/ }), - -/***/ "./src/diagrams/sequence/parser/sequenceDiagram.jison": -/*!************************************************************!*\ - !*** ./src/diagrams/sequence/parser/sequenceDiagram.jison ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -/* WEBPACK VAR INJECTION */(function(process, module) {/* parser generated by jison 0.4.18 */ -/* - Returns a Parser object of the following structure: - - Parser: { - yy: {} - } - - Parser.prototype: { - yy: {}, - trace: function(), - symbols_: {associative list: name ==> number}, - terminals_: {associative list: number ==> name}, - productions_: [...], - performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$), - table: [...], - defaultActions: {...}, - parseError: function(str, hash), - parse: function(input), - - lexer: { - EOF: 1, - parseError: function(str, hash), - setInput: function(input), - input: function(), - unput: function(str), - more: function(), - less: function(n), - pastInput: function(), - upcomingInput: function(), - showPosition: function(), - test_match: function(regex_match_array, rule_index), - next: function(), - lex: function(), - begin: function(condition), - popState: function(), - _currentRules: function(), - topState: function(), - pushState: function(condition), - - options: { - ranges: boolean (optional: true ==> token location info will include a .range[] member) - flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match) - backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code) - }, - - performAction: function(yy, yy_, $avoiding_name_collisions, YY_START), - rules: [...], - conditions: {associative list: name ==> set}, - } - } - - - token location info (@$, _$, etc.): { - first_line: n, - last_line: n, - first_column: n, - last_column: n, - range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based) - } - - - the parseError function receives a 'hash' object with these members for lexer and parser errors: { - text: (matched text) - token: (the produced terminal token, if any) - line: (yylineno) - } - while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: { - loc: (yylloc) - expected: (string describing the set of expected tokens) - recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error) - } -*/ -var parser = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,5],$V3=[1,7],$V4=[2,5],$V5=[1,15],$V6=[1,17],$V7=[1,18],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,24],$Vc=[1,25],$Vd=[1,26],$Ve=[1,27],$Vf=[1,28],$Vg=[1,29],$Vh=[1,32],$Vi=[1,33],$Vj=[1,36],$Vk=[1,4,5,16,21,22,23,25,27,28,29,30,31,33,35,36,37,48,58],$Vl=[1,44],$Vm=[4,5,16,21,22,23,25,27,28,29,30,31,33,37,48,58],$Vn=[4,5,16,21,22,23,25,27,28,29,30,31,33,36,37,48,58],$Vo=[4,5,16,21,22,23,25,27,28,29,30,31,33,35,37,48,58],$Vp=[46,47,48],$Vq=[1,4,5,7,16,21,22,23,25,27,28,29,30,31,33,35,36,37,48,58]; -var parser = {trace: function trace () { }, -yy: {}, -symbols_: {"error":2,"start":3,"SPACE":4,"NEWLINE":5,"directive":6,"SD":7,"document":8,"line":9,"statement":10,"openDirective":11,"typeDirective":12,"closeDirective":13,":":14,"argDirective":15,"participant":16,"actor":17,"AS":18,"restOfLine":19,"signal":20,"autonumber":21,"activate":22,"deactivate":23,"note_statement":24,"title":25,"text2":26,"loop":27,"end":28,"rect":29,"opt":30,"alt":31,"else_sections":32,"par":33,"par_sections":34,"and":35,"else":36,"note":37,"placement":38,"over":39,"actor_pair":40,"spaceList":41,",":42,"left_of":43,"right_of":44,"signaltype":45,"+":46,"-":47,"ACTOR":48,"SOLID_OPEN_ARROW":49,"DOTTED_OPEN_ARROW":50,"SOLID_ARROW":51,"DOTTED_ARROW":52,"SOLID_CROSS":53,"DOTTED_CROSS":54,"SOLID_POINT":55,"DOTTED_POINT":56,"TXT":57,"open_directive":58,"type_directive":59,"arg_directive":60,"close_directive":61,"$accept":0,"$end":1}, -terminals_: {2:"error",4:"SPACE",5:"NEWLINE",7:"SD",14:":",16:"participant",18:"AS",19:"restOfLine",21:"autonumber",22:"activate",23:"deactivate",25:"title",27:"loop",28:"end",29:"rect",30:"opt",31:"alt",33:"par",35:"and",36:"else",37:"note",39:"over",42:",",43:"left_of",44:"right_of",46:"+",47:"-",48:"ACTOR",49:"SOLID_OPEN_ARROW",50:"DOTTED_OPEN_ARROW",51:"SOLID_ARROW",52:"DOTTED_ARROW",53:"SOLID_CROSS",54:"DOTTED_CROSS",55:"SOLID_POINT",56:"DOTTED_POINT",57:"TXT",58:"open_directive",59:"type_directive",60:"arg_directive",61:"close_directive"}, -productions_: [0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[6,4],[6,6],[10,5],[10,3],[10,2],[10,1],[10,3],[10,3],[10,2],[10,3],[10,4],[10,4],[10,4],[10,4],[10,4],[10,1],[34,1],[34,4],[32,1],[32,4],[24,4],[24,4],[41,2],[41,1],[40,3],[40,1],[38,1],[38,1],[20,5],[20,5],[20,4],[17,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[45,1],[26,1],[11,1],[12,1],[15,1],[13,1]], -performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { -/* this == yyval */ - -var $0 = $$.length - 1; -switch (yystate) { -case 4: - yy.apply($$[$0]);return $$[$0]; -case 5: - this.$ = []; -break; -case 6: -$$[$0-1].push($$[$0]);this.$ = $$[$0-1]; -break; -case 7: case 8: - this.$ = $$[$0]; -break; -case 9: - this.$=[]; -break; -case 12: -$$[$0-3].description=yy.parseMessage($$[$0-1]); this.$=$$[$0-3]; -break; -case 13: -this.$=$$[$0-1]; -break; -case 15: -yy.enableSequenceNumbers(); -break; -case 16: -this.$={type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]}; -break; -case 17: -this.$={type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-1]}; -break; -case 19: -this.$=[{type:'setTitle', text:$$[$0-1]}]; -break; -case 20: - - $$[$0-1].unshift({type: 'loopStart', loopText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.LOOP_START}); - $$[$0-1].push({type: 'loopEnd', loopText:$$[$0-2], signalType: yy.LINETYPE.LOOP_END}); - this.$=$$[$0-1]; -break; -case 21: - - $$[$0-1].unshift({type: 'rectStart', color:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.RECT_START }); - $$[$0-1].push({type: 'rectEnd', color:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.RECT_END }); - this.$=$$[$0-1]; -break; -case 22: - - $$[$0-1].unshift({type: 'optStart', optText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.OPT_START}); - $$[$0-1].push({type: 'optEnd', optText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.OPT_END}); - this.$=$$[$0-1]; -break; -case 23: - - // Alt start - $$[$0-1].unshift({type: 'altStart', altText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.ALT_START}); - // Content in alt is already in $$[$0-1] - // End - $$[$0-1].push({type: 'altEnd', signalType: yy.LINETYPE.ALT_END}); - this.$=$$[$0-1]; -break; -case 24: - - // Parallel start - $$[$0-1].unshift({type: 'parStart', parText:yy.parseMessage($$[$0-2]), signalType: yy.LINETYPE.PAR_START}); - // Content in par is already in $$[$0-1] - // End - $$[$0-1].push({type: 'parEnd', signalType: yy.LINETYPE.PAR_END}); - this.$=$$[$0-1]; -break; -case 27: - this.$ = $$[$0-3].concat([{type: 'and', parText:yy.parseMessage($$[$0-1]), signalType: yy.LINETYPE.PAR_AND}, $$[$0]]); -break; -case 29: - this.$ = $$[$0-3].concat([{type: 'else', altText:yy.parseMessage($$[$0-1]), signalType: yy.LINETYPE.ALT_ELSE}, $$[$0]]); -break; -case 30: - - this.$ = [$$[$0-1], {type:'addNote', placement:$$[$0-2], actor:$$[$0-1].actor, text:$$[$0]}]; -break; -case 31: - - // Coerce actor_pair into a [to, from, ...] array - $$[$0-2] = [].concat($$[$0-1], $$[$0-1]).slice(0, 2); - $$[$0-2][0] = $$[$0-2][0].actor; - $$[$0-2][1] = $$[$0-2][1].actor; - this.$ = [$$[$0-1], {type:'addNote', placement:yy.PLACEMENT.OVER, actor:$$[$0-2].slice(0, 2), text:$$[$0]}]; -break; -case 34: - this.$ = [$$[$0-2], $$[$0]]; -break; -case 35: - this.$ = $$[$0]; -break; -case 36: - this.$ = yy.PLACEMENT.LEFTOF; -break; -case 37: - this.$ = yy.PLACEMENT.RIGHTOF; -break; -case 38: - this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]}, - {type: 'activeStart', signalType: yy.LINETYPE.ACTIVE_START, actor: $$[$0-1]} - ]; -break; -case 39: - this.$ = [$$[$0-4],$$[$0-1],{type: 'addMessage', from:$$[$0-4].actor, to:$$[$0-1].actor, signalType:$$[$0-3], msg:$$[$0]}, - {type: 'activeEnd', signalType: yy.LINETYPE.ACTIVE_END, actor: $$[$0-4]} - ]; -break; -case 40: - this.$ = [$$[$0-3],$$[$0-1],{type: 'addMessage', from:$$[$0-3].actor, to:$$[$0-1].actor, signalType:$$[$0-2], msg:$$[$0]}]; -break; -case 41: -this.$={type: 'addActor', actor:$$[$0]}; -break; -case 42: - this.$ = yy.LINETYPE.SOLID_OPEN; -break; -case 43: - this.$ = yy.LINETYPE.DOTTED_OPEN; -break; -case 44: - this.$ = yy.LINETYPE.SOLID; -break; -case 45: - this.$ = yy.LINETYPE.DOTTED; -break; -case 46: - this.$ = yy.LINETYPE.SOLID_CROSS; -break; -case 47: - this.$ = yy.LINETYPE.DOTTED_CROSS; -break; -case 48: - this.$ = yy.LINETYPE.SOLID_POINT; -break; -case 49: - this.$ = yy.LINETYPE.DOTTED_POINT; -break; -case 50: -this.$ = yy.parseMessage($$[$0].trim().substring(1)); -break; -case 51: - yy.parseDirective('%%{', 'open_directive'); -break; -case 52: - yy.parseDirective($$[$0], 'type_directive'); -break; -case 53: - $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); -break; -case 54: - yy.parseDirective('}%%', 'close_directive', 'sequence'); -break; -} -}, -table: [{3:1,4:$V0,5:$V1,6:4,7:$V2,11:6,58:$V3},{1:[3]},{3:8,4:$V0,5:$V1,6:4,7:$V2,11:6,58:$V3},{3:9,4:$V0,5:$V1,6:4,7:$V2,11:6,58:$V3},{3:10,4:$V0,5:$V1,6:4,7:$V2,11:6,58:$V3},o([1,4,5,16,21,22,23,25,27,29,30,31,33,37,48,58],$V4,{8:11}),{12:12,59:[1,13]},{59:[2,51]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:$V5,5:$V6,6:30,9:14,10:16,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,29:$Vd,30:$Ve,31:$Vf,33:$Vg,37:$Vh,48:$Vi,58:$V3},{13:34,14:[1,35],61:$Vj},o([14,61],[2,52]),o($Vk,[2,6]),{6:30,10:37,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,29:$Vd,30:$Ve,31:$Vf,33:$Vg,37:$Vh,48:$Vi,58:$V3},o($Vk,[2,8]),o($Vk,[2,9]),{17:38,48:$Vi},{5:[1,39]},o($Vk,[2,15]),{17:40,48:$Vi},{17:41,48:$Vi},{5:[1,42]},{26:43,57:$Vl},{19:[1,45]},{19:[1,46]},{19:[1,47]},{19:[1,48]},{19:[1,49]},o($Vk,[2,25]),{45:50,49:[1,51],50:[1,52],51:[1,53],52:[1,54],53:[1,55],54:[1,56],55:[1,57],56:[1,58]},{38:59,39:[1,60],43:[1,61],44:[1,62]},o([5,18,42,49,50,51,52,53,54,55,56,57],[2,41]),{5:[1,63]},{15:64,60:[1,65]},{5:[2,54]},o($Vk,[2,7]),{5:[1,67],18:[1,66]},o($Vk,[2,14]),{5:[1,68]},{5:[1,69]},o($Vk,[2,18]),{5:[1,70]},{5:[2,50]},o($Vm,$V4,{8:71}),o($Vm,$V4,{8:72}),o($Vm,$V4,{8:73}),o($Vn,$V4,{32:74,8:75}),o($Vo,$V4,{34:76,8:77}),{17:80,46:[1,78],47:[1,79],48:$Vi},o($Vp,[2,42]),o($Vp,[2,43]),o($Vp,[2,44]),o($Vp,[2,45]),o($Vp,[2,46]),o($Vp,[2,47]),o($Vp,[2,48]),o($Vp,[2,49]),{17:81,48:$Vi},{17:83,40:82,48:$Vi},{48:[2,36]},{48:[2,37]},o($Vq,[2,10]),{13:84,61:$Vj},{61:[2,53]},{19:[1,85]},o($Vk,[2,13]),o($Vk,[2,16]),o($Vk,[2,17]),o($Vk,[2,19]),{4:$V5,5:$V6,6:30,9:14,10:16,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,28:[1,86],29:$Vd,30:$Ve,31:$Vf,33:$Vg,37:$Vh,48:$Vi,58:$V3},{4:$V5,5:$V6,6:30,9:14,10:16,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,28:[1,87],29:$Vd,30:$Ve,31:$Vf,33:$Vg,37:$Vh,48:$Vi,58:$V3},{4:$V5,5:$V6,6:30,9:14,10:16,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,28:[1,88],29:$Vd,30:$Ve,31:$Vf,33:$Vg,37:$Vh,48:$Vi,58:$V3},{28:[1,89]},{4:$V5,5:$V6,6:30,9:14,10:16,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,28:[2,28],29:$Vd,30:$Ve,31:$Vf,33:$Vg,36:[1,90],37:$Vh,48:$Vi,58:$V3},{28:[1,91]},{4:$V5,5:$V6,6:30,9:14,10:16,11:6,16:$V7,17:31,20:19,21:$V8,22:$V9,23:$Va,24:23,25:$Vb,27:$Vc,28:[2,26],29:$Vd,30:$Ve,31:$Vf,33:$Vg,35:[1,92],37:$Vh,48:$Vi,58:$V3},{17:93,48:$Vi},{17:94,48:$Vi},{26:95,57:$Vl},{26:96,57:$Vl},{26:97,57:$Vl},{42:[1,98],57:[2,35]},{5:[1,99]},{5:[1,100]},o($Vk,[2,20]),o($Vk,[2,21]),o($Vk,[2,22]),o($Vk,[2,23]),{19:[1,101]},o($Vk,[2,24]),{19:[1,102]},{26:103,57:$Vl},{26:104,57:$Vl},{5:[2,40]},{5:[2,30]},{5:[2,31]},{17:105,48:$Vi},o($Vq,[2,11]),o($Vk,[2,12]),o($Vn,$V4,{8:75,32:106}),o($Vo,$V4,{8:77,34:107}),{5:[2,38]},{5:[2,39]},{57:[2,34]},{28:[2,29]},{28:[2,27]}], -defaultActions: {7:[2,51],8:[2,1],9:[2,2],10:[2,3],36:[2,54],44:[2,50],61:[2,36],62:[2,37],65:[2,53],95:[2,40],96:[2,30],97:[2,31],103:[2,38],104:[2,39],105:[2,34],106:[2,29],107:[2,27]}, -parseError: function parseError (str, hash) { - if (hash.recoverable) { - this.trace(str); - } else { - var error = new Error(str); - error.hash = hash; - throw error; - } -}, -parse: function parse(input) { - var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, TERROR = 2, EOF = 1; - var args = lstack.slice.call(arguments, 1); - var lexer = Object.create(this.lexer); - var sharedState = { yy: {} }; - for (var k in this.yy) { - if (Object.prototype.hasOwnProperty.call(this.yy, k)) { - sharedState.yy[k] = this.yy[k]; - } - } - lexer.setInput(input, sharedState.yy); - sharedState.yy.lexer = lexer; - sharedState.yy.parser = this; - if (typeof lexer.yylloc == 'undefined') { - lexer.yylloc = {}; - } - var yyloc = lexer.yylloc; - lstack.push(yyloc); - var ranges = lexer.options && lexer.options.ranges; - if (typeof sharedState.yy.parseError === 'function') { - this.parseError = sharedState.yy.parseError; - } else { - this.parseError = Object.getPrototypeOf(this).parseError; - } - function lex() { - var token; - token = tstack.pop() || lexer.lex() || EOF; - if (typeof token !== 'number') { - if (token instanceof Array) { - tstack = token; - token = tstack.pop(); - } - token = self.symbols_[token] || token; - } - return token; - } - var symbol, state, action, r, yyval = {}, p, len, newState, expected; - while (true) { - state = stack[stack.length - 1]; - if (this.defaultActions[state]) { - action = this.defaultActions[state]; - } else { - if (symbol === null || typeof symbol == 'undefined') { - symbol = lex(); - } - action = table[state] && table[state][symbol]; - } - if (typeof action === 'undefined' || !action.length || !action[0]) { - var errStr = ''; - expected = []; - for (p in table[state]) { - if (this.terminals_[p] && p > TERROR) { - expected.push('\'' + this.terminals_[p] + '\''); - } - } - if (lexer.showPosition) { - errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\''; - } else { - errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\''); - } - this.parseError(errStr, { - text: lexer.match, - token: this.terminals_[symbol] || symbol, - line: lexer.yylineno, - loc: yyloc, - expected: expected - }); - } - if (action[0] instanceof Array && action.length > 1) { - throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol); - } - switch (action[0]) { - case 1: - stack.push(symbol); - vstack.push(lexer.yytext); - lstack.push(lexer.yylloc); - stack.push(action[1]); - symbol = null; - { - yyleng = lexer.yyleng; - yytext = lexer.yytext; - yylineno = lexer.yylineno; - yyloc = lexer.yylloc; - } - break; - case 2: - len = this.productions_[action[1]][1]; - yyval.$ = vstack[vstack.length - len]; - yyval._$ = { - first_line: lstack[lstack.length - (len || 1)].first_line, - last_line: lstack[lstack.length - 1].last_line, - first_column: lstack[lstack.length - (len || 1)].first_column, - last_column: lstack[lstack.length - 1].last_column - }; - if (ranges) { - yyval._$.range = [ - lstack[lstack.length - (len || 1)].range[0], - lstack[lstack.length - 1].range[1] - ]; - } - r = this.performAction.apply(yyval, [ - yytext, - yyleng, - yylineno, - sharedState.yy, - action[1], - vstack, - lstack - ].concat(args)); - if (typeof r !== 'undefined') { - return r; - } - if (len) { - stack = stack.slice(0, -1 * len * 2); - vstack = vstack.slice(0, -1 * len); - lstack = lstack.slice(0, -1 * len); - } - stack.push(this.productions_[action[1]][0]); - vstack.push(yyval.$); - lstack.push(yyval._$); - newState = table[stack[stack.length - 2]][stack[stack.length - 1]]; - stack.push(newState); - break; - case 3: - return true; - } - } - return true; -}}; - -/* generated by jison-lex 0.3.4 */ -var lexer = (function(){ -var lexer = ({ - -EOF:1, - -parseError:function parseError(str, hash) { - if (this.yy.parser) { - this.yy.parser.parseError(str, hash); - } else { - throw new Error(str); - } - }, - -// resets the lexer, sets new input -setInput:function (input, yy) { - this.yy = yy || this.yy || {}; - this._input = input; - this._more = this._backtrack = this.done = false; - this.yylineno = this.yyleng = 0; - this.yytext = this.matched = this.match = ''; - this.conditionStack = ['INITIAL']; - this.yylloc = { - first_line: 1, - first_column: 0, - last_line: 1, - last_column: 0 - }; - if (this.options.ranges) { - this.yylloc.range = [0,0]; - } - this.offset = 0; - return this; - }, - -// consumes and returns one char from the input -input:function () { - var ch = this._input[0]; - this.yytext += ch; - this.yyleng++; - this.offset++; - this.match += ch; - this.matched += ch; - var lines = ch.match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno++; - this.yylloc.last_line++; - } else { - this.yylloc.last_column++; - } - if (this.options.ranges) { - this.yylloc.range[1]++; - } - - this._input = this._input.slice(1); - return ch; - }, - -// unshifts one char (or a string) into the input -unput:function (ch) { - var len = ch.length; - var lines = ch.split(/(?:\r\n?|\n)/g); - - this._input = ch + this._input; - this.yytext = this.yytext.substr(0, this.yytext.length - len); - //this.yyleng -= len; - this.offset -= len; - var oldLines = this.match.split(/(?:\r\n?|\n)/g); - this.match = this.match.substr(0, this.match.length - 1); - this.matched = this.matched.substr(0, this.matched.length - 1); - - if (lines.length - 1) { - this.yylineno -= lines.length - 1; - } - var r = this.yylloc.range; - - this.yylloc = { - first_line: this.yylloc.first_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.first_column, - last_column: lines ? - (lines.length === oldLines.length ? this.yylloc.first_column : 0) - + oldLines[oldLines.length - lines.length].length - lines[0].length : - this.yylloc.first_column - len - }; - - if (this.options.ranges) { - this.yylloc.range = [r[0], r[0] + this.yyleng - len]; - } - this.yyleng = this.yytext.length; - return this; - }, - -// When called from action, caches matched text and appends it on next action -more:function () { - this._more = true; - return this; - }, - -// When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead. -reject:function () { - if (this.options.backtrack_lexer) { - this._backtrack = true; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - - } - return this; - }, - -// retain first n characters of the match -less:function (n) { - this.unput(this.match.slice(n)); - }, - -// displays already matched input, i.e. for error messages -pastInput:function () { - var past = this.matched.substr(0, this.matched.length - this.match.length); - return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\n/g, ""); - }, - -// displays upcoming input, i.e. for error messages -upcomingInput:function () { - var next = this.match; - if (next.length < 20) { - next += this._input.substr(0, 20-next.length); - } - return (next.substr(0,20) + (next.length > 20 ? '...' : '')).replace(/\n/g, ""); - }, - -// displays the character position where the lexing error occurred, i.e. for error messages -showPosition:function () { - var pre = this.pastInput(); - var c = new Array(pre.length + 1).join("-"); - return pre + this.upcomingInput() + "\n" + c + "^"; - }, - -// test the lexed token: return FALSE when not a match, otherwise return token -test_match:function(match, indexed_rule) { - var token, - lines, - backup; - - if (this.options.backtrack_lexer) { - // save context - backup = { - yylineno: this.yylineno, - yylloc: { - first_line: this.yylloc.first_line, - last_line: this.last_line, - first_column: this.yylloc.first_column, - last_column: this.yylloc.last_column - }, - yytext: this.yytext, - match: this.match, - matches: this.matches, - matched: this.matched, - yyleng: this.yyleng, - offset: this.offset, - _more: this._more, - _input: this._input, - yy: this.yy, - conditionStack: this.conditionStack.slice(0), - done: this.done - }; - if (this.options.ranges) { - backup.yylloc.range = this.yylloc.range.slice(0); - } - } - - lines = match[0].match(/(?:\r\n?|\n).*/g); - if (lines) { - this.yylineno += lines.length; - } - this.yylloc = { - first_line: this.yylloc.last_line, - last_line: this.yylineno + 1, - first_column: this.yylloc.last_column, - last_column: lines ? - lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : - this.yylloc.last_column + match[0].length - }; - this.yytext += match[0]; - this.match += match[0]; - this.matches = match; - this.yyleng = this.yytext.length; - if (this.options.ranges) { - this.yylloc.range = [this.offset, this.offset += this.yyleng]; - } - this._more = false; - this._backtrack = false; - this._input = this._input.slice(match[0].length); - this.matched += match[0]; - token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]); - if (this.done && this._input) { - this.done = false; - } - if (token) { - return token; - } else if (this._backtrack) { - // recover context - for (var k in backup) { - this[k] = backup[k]; - } - return false; // rule action called reject() implying the next rule should be tested instead. - } - return false; - }, - -// return next match in input -next:function () { - if (this.done) { - return this.EOF; - } - if (!this._input) { - this.done = true; - } - - var token, - match, - tempMatch, - index; - if (!this._more) { - this.yytext = ''; - this.match = ''; - } - var rules = this._currentRules(); - for (var i = 0; i < rules.length; i++) { - tempMatch = this._input.match(this.rules[rules[i]]); - if (tempMatch && (!match || tempMatch[0].length > match[0].length)) { - match = tempMatch; - index = i; - if (this.options.backtrack_lexer) { - token = this.test_match(tempMatch, rules[i]); - if (token !== false) { - return token; - } else if (this._backtrack) { - match = false; - continue; // rule action called reject() implying a rule MISmatch. - } else { - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - } else if (!this.options.flex) { - break; - } - } - } - if (match) { - token = this.test_match(match, rules[index]); - if (token !== false) { - return token; - } - // else: this is a lexer rule which consumes input without producing a token (e.g. whitespace) - return false; - } - if (this._input === "") { - return this.EOF; - } else { - return this.parseError('Lexical error on line ' + (this.yylineno + 1) + '. Unrecognized text.\n' + this.showPosition(), { - text: "", - token: null, - line: this.yylineno - }); - } - }, - -// return next match that has a token -lex:function lex () { - var r = this.next(); - if (r) { - return r; - } else { - return this.lex(); - } - }, - -// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack) -begin:function begin (condition) { - this.conditionStack.push(condition); - }, - -// pop the previously active lexer condition state off the condition stack -popState:function popState () { - var n = this.conditionStack.length - 1; - if (n > 0) { - return this.conditionStack.pop(); - } else { - return this.conditionStack[0]; - } - }, - -// produce the lexer rule set which is active for the currently active lexer condition state -_currentRules:function _currentRules () { - if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) { - return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules; - } else { - return this.conditions["INITIAL"].rules; - } - }, - -// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available -topState:function topState (n) { - n = this.conditionStack.length - 1 - Math.abs(n || 0); - if (n >= 0) { - return this.conditionStack[n]; - } else { - return "INITIAL"; - } - }, - -// alias for begin(condition) -pushState:function pushState (condition) { - this.begin(condition); - }, - -// return the number of states currently on the stack -stateStackSize:function stateStackSize() { - return this.conditionStack.length; - }, -options: {"case-insensitive":true}, -performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { -switch($avoiding_name_collisions) { -case 0: this.begin('open_directive'); return 58; -case 1: this.begin('type_directive'); return 59; -case 2: this.popState(); this.begin('arg_directive'); return 14; -case 3: this.popState(); this.popState(); return 61; -case 4:return 60; -case 5:return 5; -case 6:/* skip all whitespace */ -break; -case 7:/* skip same-line whitespace */ -break; -case 8:/* skip comments */ -break; -case 9:/* skip comments */ -break; -case 10:/* skip comments */ -break; -case 11: this.begin('ID'); return 16; -case 12: yy_.yytext = yy_.yytext.trim(); this.begin('ALIAS'); return 48; -case 13: this.popState(); this.popState(); this.begin('LINE'); return 18; -case 14: this.popState(); this.popState(); return 5; -case 15: this.begin('LINE'); return 27; -case 16: this.begin('LINE'); return 29; -case 17: this.begin('LINE'); return 30; -case 18: this.begin('LINE'); return 31; -case 19: this.begin('LINE'); return 36; -case 20: this.begin('LINE'); return 33; -case 21: this.begin('LINE'); return 35; -case 22: this.popState(); return 19; -case 23:return 28; -case 24:return 43; -case 25:return 44; -case 26:return 39; -case 27:return 37; -case 28: this.begin('ID'); return 22; -case 29: this.begin('ID'); return 23; -case 30:return 25; -case 31:return 7; -case 32:return 21; -case 33:return 42; -case 34:return 5; -case 35: yy_.yytext = yy_.yytext.trim(); return 48; -case 36:return 51; -case 37:return 52; -case 38:return 49; -case 39:return 50; -case 40:return 53; -case 41:return 54; -case 42:return 55; -case 43:return 56; -case 44:return 57; -case 45:return 46; -case 46:return 47; -case 47:return 5; -case 48:return 'INVALID'; -} -}, -rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:participant\b)/i,/^(?:[^\->:\n,;]+?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:and\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i], -conditions: {"open_directive":{"rules":[1,8],"inclusive":false},"type_directive":{"rules":[2,3,8],"inclusive":false},"arg_directive":{"rules":[3,4,8],"inclusive":false},"ID":{"rules":[7,8,12],"inclusive":false},"ALIAS":{"rules":[7,8,13,14],"inclusive":false},"LINE":{"rules":[7,8,22],"inclusive":false},"INITIAL":{"rules":[0,5,6,8,9,10,11,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48],"inclusive":true}} +rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:participant\b)/i,/^(?:[^\->:\n,;]+?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:and\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\b)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\->:\n,;]+((?!(-x|--x))[\-]*[^\+\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i], +conditions: {"open_directive":{"rules":[1,8],"inclusive":false},"type_directive":{"rules":[2,3,8],"inclusive":false},"arg_directive":{"rules":[3,4,8],"inclusive":false},"ID":{"rules":[7,8,12],"inclusive":false},"ALIAS":{"rules":[7,8,13,14],"inclusive":false},"LINE":{"rules":[7,8,22],"inclusive":false},"INITIAL":{"rules":[0,5,6,8,9,10,11,15,16,17,18,19,20,21,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],"inclusive":true}} }); return lexer; })(); @@ -122294,7 +120271,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "apply", function() { return apply; }); /* harmony import */ var _mermaidAPI__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../mermaidAPI */ "./src/mermaidAPI.js"); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../config */ "./src/config.js"); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); +/* harmony import */ var _common_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../common/common */ "./src/diagrams/common/common.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../logger */ "./src/logger.js"); + @@ -122441,9 +120420,9 @@ var parseMessage = function parseMessage(str) { var message = { text: _str.replace(/^[:]?(?:no)?wrap:/, '').trim(), - wrap: _str.match(/^[:]?wrap:/) !== null ? true : _str.match(/^[:]?nowrap:/) !== null ? false : undefined + wrap: _str.match(/^[:]?(?:no)?wrap:/) === null ? _common_common__WEBPACK_IMPORTED_MODULE_2__["default"].hasBreaks(_str) || undefined : _str.match(/^[:]?wrap:/) !== null ? true : _str.match(/^[:]?nowrap:/) !== null ? false : undefined }; - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].debug('parseMessage:', message); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('parseMessage:', message); return message; }; var LINETYPE = { @@ -122467,9 +120446,7 @@ var LINETYPE = { PAR_AND: 20, PAR_END: 21, RECT_START: 22, - RECT_END: 23, - SOLID_POINT: 24, - DOTTED_POINT: 25 + RECT_END: 23 }; var ARROWTYPE = { FILLED: 0, @@ -122880,6 +120857,7 @@ var drawNote = function drawNote(elem, noteModel) { textObj.anchor = conf.noteAlign; textObj.textMargin = conf.noteMargin; textObj.valign = conf.noteAlign; + textObj.wrap = true; var textElem = Object(_svgDraw__WEBPACK_IMPORTED_MODULE_1__["drawText"])(g, textObj); var textHeight = Math.round(textElem.map(function (te) { return (te._groups || te)[0][0].getBBox().height; @@ -122932,7 +120910,8 @@ var drawMessage = function drawMessage(g, msgModel) { starty = msgModel.starty, message = msgModel.message, type = msgModel.type, - sequenceIndex = msgModel.sequenceIndex; + sequenceIndex = msgModel.sequenceIndex, + wrap = msgModel.wrap; var lines = _common_common__WEBPACK_IMPORTED_MODULE_4__["default"].splitBreaks(message).length; var textDims = _utils__WEBPACK_IMPORTED_MODULE_7__["default"].calculateTextDimensions(message, messageFont(conf)); var lineHeight = textDims.height / lines; @@ -122952,6 +120931,7 @@ var drawMessage = function drawMessage(g, msgModel) { textObj.valign = conf.messageAlign; textObj.textMargin = conf.wrapPadding; textObj.tspan = false; + textObj.wrap = wrap; Object(_svgDraw__WEBPACK_IMPORTED_MODULE_1__["drawText"])(g, textObj); var totalOffset = textDims.height - 10; var textWidth = textDims.width; @@ -122984,7 +120964,7 @@ var drawMessage = function drawMessage(g, msgModel) { // Draw the line - if (type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED || type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_CROSS || type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_POINT || type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_OPEN) { + if (type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED || type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_CROSS || type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_OPEN) { line.style('stroke-dasharray', '3, 3'); line.attr('class', 'messageLine1'); } else { @@ -123008,10 +120988,6 @@ var drawMessage = function drawMessage(g, msgModel) { line.attr('marker-end', 'url(' + url + '#arrowhead)'); } - if (type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_POINT || type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_POINT) { - line.attr('marker-end', 'url(' + url + '#filled-head)'); - } - if (type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_CROSS || type === _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_CROSS) { line.attr('marker-end', 'url(' + url + '#crosshead)'); } // add node number @@ -123101,7 +121077,7 @@ function adjustLoopHeightForWrap(loopWidths, msg, preMargin, postMargin, addLoop var textDims = _utils__WEBPACK_IMPORTED_MODULE_7__["default"].calculateTextDimensions(msg.message, textConf); var totalOffset = Math.max(textDims.height, conf.labelBoxHeight); heightAdjust = postMargin + totalOffset; - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].debug("".concat(totalOffset, " - ").concat(msg.message)); + _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug("".concat(totalOffset, " - ").concat(msg.message)); } addLoopFn(msg); @@ -123120,7 +121096,7 @@ var draw = function draw(text, id) { _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.setWrap(conf.wrap); _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].parse(text + '\n'); bounds.init(); - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].debug("C:".concat(JSON.stringify(conf, null, 2))); + _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug("C:".concat(JSON.stringify(conf, null, 2))); var diagram = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])("[id=\"".concat(id, "\"]")); // Fetch data from the parsing var actors = _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.getActors(); @@ -123134,7 +121110,6 @@ var draw = function draw(text, id) { _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].insertArrowHead(diagram); _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].insertArrowCrossHead(diagram); - _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].insertArrowFilledHead(diagram); _svgDraw__WEBPACK_IMPORTED_MODULE_1__["default"].insertSequenceNumber(diagram); function activeEnd(msg, verticalPos) { @@ -123254,13 +121229,13 @@ var draw = function draw(text, id) { drawMessage(diagram, msgModel); bounds.models.addMessage(msgModel); } catch (e) { - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].error('error while drawing message', e); + _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].error('error while drawing message', e); } } // Increment sequence counter if msg.type is a line (and not another event like activation or note, etc) - if ([_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_OPEN, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_OPEN, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_CROSS, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_CROSS, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_POINT, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_POINT].includes(msg.type)) { + if ([_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_OPEN, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_OPEN, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_CROSS, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_CROSS].includes(msg.type)) { sequenceIndex++; } }); @@ -123275,7 +121250,7 @@ var draw = function draw(text, id) { box = _bounds$getBounds.bounds; // Adjust line height of actor lines now that the height of the diagram is known - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].debug('For line height fix Querying: #' + id + ' .actor-line'); + _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('For line height fix Querying: #' + id + ' .actor-line'); var actorLines = Object(d3__WEBPACK_IMPORTED_MODULE_0__["selectAll"])('#' + id + ' .actor-line'); actorLines.attr('y2', box.stopy); var height = box.stopy - box.starty + 2 * conf.diagramMarginY; @@ -123293,7 +121268,7 @@ var draw = function draw(text, id) { Object(_utils__WEBPACK_IMPORTED_MODULE_7__["configureSvgSize"])(diagram, height, width, conf.useMaxWidth); var extraVertForTitle = title ? 40 : 0; diagram.attr('viewBox', box.startx - conf.diagramMarginX + ' -' + (conf.diagramMarginY + extraVertForTitle) + ' ' + width + ' ' + (height + extraVertForTitle)); - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].debug("models:", bounds.models); + _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug("models:", bounds.models); }; /** * Retrieves the max message width of each actor, supports signals (messages, loops) @@ -123366,7 +121341,7 @@ var getMaxMessageWidthPerActor = function getMaxMessageWidthPerActor(actors, mes } } }); - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].debug('maxMessageWidthPerActor:', maxMessageWidthPerActor); + _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('maxMessageWidthPerActor:', maxMessageWidthPerActor); return maxMessageWidthPerActor; }; /** @@ -123451,14 +121426,14 @@ var buildNoteModel = function buildNoteModel(msg, actors) { noteModel.message = _utils__WEBPACK_IMPORTED_MODULE_7__["default"].wrapLabel(msg.message, noteModel.width - 2 * conf.wrapPadding, noteFont(conf)); } - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].debug("NM:[".concat(noteModel.startx, ",").concat(noteModel.stopx, ",").concat(noteModel.starty, ",").concat(noteModel.stopy, ":").concat(noteModel.width, ",").concat(noteModel.height, "=").concat(msg.message, "]")); + _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug("NM:[".concat(noteModel.startx, ",").concat(noteModel.stopx, ",").concat(noteModel.starty, ",").concat(noteModel.stopy, ":").concat(noteModel.width, ",").concat(noteModel.height, "=").concat(msg.message, "]")); return noteModel; }; var buildMessageModel = function buildMessageModel(msg, actors) { var process = false; - if ([_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_OPEN, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_OPEN, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_CROSS, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_CROSS, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_POINT, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_POINT].includes(msg.type)) { + if ([_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_OPEN, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_OPEN, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.SOLID_CROSS, _parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_3__["parser"].yy.LINETYPE.DOTTED_CROSS].includes(msg.type)) { process = true; } @@ -123472,12 +121447,12 @@ var buildMessageModel = function buildMessageModel(msg, actors) { var toIdx = fromBounds[0] < toBounds[0] ? 0 : 1; var allBounds = fromBounds.concat(toBounds); var boundedWidth = Math.abs(toBounds[toIdx] - fromBounds[fromIdx]); + var msgDims = _utils__WEBPACK_IMPORTED_MODULE_7__["default"].calculateTextDimensions(msg.message, messageFont(conf)); if (msg.wrap && msg.message) { msg.message = _utils__WEBPACK_IMPORTED_MODULE_7__["default"].wrapLabel(msg.message, Math.max(boundedWidth + 2 * conf.wrapPadding, conf.width), messageFont(conf)); } - var msgDims = _utils__WEBPACK_IMPORTED_MODULE_7__["default"].calculateTextDimensions(msg.message, messageFont(conf)); return { width: Math.max(msg.wrap ? 0 : msgDims.width + 2 * conf.wrapPadding, boundedWidth + 2 * conf.wrapPadding, conf.width), height: 0, @@ -123595,7 +121570,7 @@ var calculateLoopBounds = function calculateLoopBounds(messages, actors) { } }); bounds.activations = []; - _logger__WEBPACK_IMPORTED_MODULE_2__["log"].debug('Loop type widths:', loops); + _logger__WEBPACK_IMPORTED_MODULE_2__["logger"].debug('Loop type widths:', loops); return loops; }; @@ -123627,7 +121602,7 @@ var getStyles = function getStyles(options) { /*!******************************************!*\ !*** ./src/diagrams/sequence/svgDraw.js ***! \******************************************/ -/*! exports provided: drawRect, drawText, drawLabel, drawActor, anchorElement, drawActivation, drawLoop, drawBackgroundRect, insertArrowHead, insertArrowFilledHead, insertSequenceNumber, insertArrowCrossHead, getTextObj, getNoteRect, default */ +/*! exports provided: drawRect, drawText, drawLabel, drawActor, anchorElement, drawActivation, drawLoop, drawBackgroundRect, insertArrowHead, insertSequenceNumber, insertArrowCrossHead, getTextObj, getNoteRect, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawRect", function() { return drawRect; }); @@ -123639,7 +121614,6 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawLoop", function() { return drawLoop; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "drawBackgroundRect", function() { return drawBackgroundRect; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertArrowHead", function() { return insertArrowHead; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertArrowFilledHead", function() { return insertArrowFilledHead; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertSequenceNumber", function() { return insertSequenceNumber; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "insertArrowCrossHead", function() { return insertArrowCrossHead; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getTextObj", function() { return getTextObj; }); @@ -123666,7 +121640,7 @@ var drawRect = function drawRect(elem, rectData) { var drawText = function drawText(elem, textData) { var prevTextHeight = 0, textHeight = 0; - var lines = textData.text.split(_common_common__WEBPACK_IMPORTED_MODULE_0__["default"].lineBreakRegex); + var lines = textData.wrap ? textData.text.split(_common_common__WEBPACK_IMPORTED_MODULE_0__["default"].lineBreakRegex) : [textData.text.replace(_common_common__WEBPACK_IMPORTED_MODULE_0__["default"].lineBreakRegex, ' ')]; var textElems = []; var dy = 0; @@ -123973,14 +121947,7 @@ var drawBackgroundRect = function drawBackgroundRect(elem, bounds) { */ var insertArrowHead = function insertArrowHead(elem) { - elem.append('defs').append('marker').attr('id', 'arrowhead').attr('refX', 9).attr('refY', 5).attr('markerUnits', 'userSpaceOnUse').attr('markerWidth', 12).attr('markerHeight', 12).attr('orient', 'auto').append('path').attr('d', 'M 0 0 L 10 5 L 0 10 z'); // this is actual shape for arrowhead -}; -/** - * Setup arrow head and define the marker. The result is appended to the svg. - */ - -var insertArrowFilledHead = function insertArrowFilledHead(elem) { - elem.append('defs').append('marker').attr('id', 'filled-head').attr('refX', 18).attr('refY', 7).attr('markerWidth', 20).attr('markerHeight', 28).attr('orient', 'auto').append('path').attr('d', 'M 18,7 L9,13 L14,7 L9,1 Z'); + elem.append('defs').append('marker').attr('id', 'arrowhead').attr('refX', 5).attr('refY', 2).attr('markerWidth', 6).attr('markerHeight', 4).attr('orient', 'auto').append('path').attr('d', 'M 0,0 V 4 L6,2 Z'); // this is actual shape for arrowhead }; /** * Setup node number. The result is appended to the svg. @@ -124088,7 +122055,6 @@ var _drawTextCandidateFunc = function () { drawLoop: drawLoop, drawBackgroundRect: drawBackgroundRect, insertArrowHead: insertArrowHead, - insertArrowFilledHead: insertArrowFilledHead, insertSequenceNumber: insertSequenceNumber, insertArrowCrossHead: insertArrowCrossHead, getTextObj: getTextObj, @@ -124211,12 +122177,12 @@ var size = function size() { } */ var parser = (function(){ -var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,5],$V3=[1,7],$V4=[2,5],$V5=[1,15],$V6=[1,17],$V7=[1,19],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,30],$Vc=[1,23],$Vd=[1,24],$Ve=[1,25],$Vf=[1,26],$Vg=[1,27],$Vh=[1,32],$Vi=[1,33],$Vj=[1,34],$Vk=[1,35],$Vl=[1,31],$Vm=[1,38],$Vn=[1,4,5,14,15,17,19,20,22,23,24,25,26,27,36,37,38,39,42,45],$Vo=[1,4,5,12,13,14,15,17,19,20,22,23,24,25,26,27,36,37,38,39,42,45],$Vp=[1,4,5,7,14,15,17,19,20,22,23,24,25,26,27,36,37,38,39,42,45],$Vq=[4,5,14,15,17,19,20,22,23,24,25,26,27,36,37,38,39,42,45]; +var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,2],$V1=[1,3],$V2=[1,5],$V3=[1,7],$V4=[2,5],$V5=[1,15],$V6=[1,17],$V7=[1,19],$V8=[1,20],$V9=[1,21],$Va=[1,22],$Vb=[1,28],$Vc=[1,23],$Vd=[1,24],$Ve=[1,25],$Vf=[1,26],$Vg=[1,29],$Vh=[1,32],$Vi=[1,4,5,14,15,17,19,20,22,23,24,25,26,36,39],$Vj=[1,4,5,12,13,14,15,17,19,20,22,23,24,25,26,36,39],$Vk=[1,4,5,7,14,15,17,19,20,22,23,24,25,26,36,39],$Vl=[4,5,14,15,17,19,20,22,23,24,25,26,36,39]; var parser = {trace: function trace () { }, yy: {}, -symbols_: {"error":2,"start":3,"SPACE":4,"NL":5,"directive":6,"SD":7,"document":8,"line":9,"statement":10,"idStatement":11,"DESCR":12,"-->":13,"HIDE_EMPTY":14,"scale":15,"WIDTH":16,"COMPOSIT_STATE":17,"STRUCT_START":18,"STRUCT_STOP":19,"STATE_DESCR":20,"AS":21,"ID":22,"FORK":23,"JOIN":24,"CHOICE":25,"CONCURRENT":26,"note":27,"notePosition":28,"NOTE_TEXT":29,"direction":30,"openDirective":31,"typeDirective":32,"closeDirective":33,":":34,"argDirective":35,"direction_tb":36,"direction_bt":37,"direction_rl":38,"direction_lr":39,"eol":40,";":41,"EDGE_STATE":42,"left_of":43,"right_of":44,"open_directive":45,"type_directive":46,"arg_directive":47,"close_directive":48,"$accept":0,"$end":1}, -terminals_: {2:"error",4:"SPACE",5:"NL",7:"SD",12:"DESCR",13:"-->",14:"HIDE_EMPTY",15:"scale",16:"WIDTH",17:"COMPOSIT_STATE",18:"STRUCT_START",19:"STRUCT_STOP",20:"STATE_DESCR",21:"AS",22:"ID",23:"FORK",24:"JOIN",25:"CHOICE",26:"CONCURRENT",27:"note",29:"NOTE_TEXT",34:":",36:"direction_tb",37:"direction_bt",38:"direction_rl",39:"direction_lr",41:";",42:"EDGE_STATE",43:"left_of",44:"right_of",45:"open_directive",46:"type_directive",47:"arg_directive",48:"close_directive"}, -productions_: [0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,1],[10,2],[10,1],[10,4],[10,3],[10,6],[10,1],[10,1],[10,1],[10,1],[10,4],[10,4],[10,1],[10,1],[6,3],[6,5],[30,1],[30,1],[30,1],[30,1],[40,1],[40,1],[11,1],[11,1],[28,1],[28,1],[31,1],[32,1],[35,1],[33,1]], +symbols_: {"error":2,"start":3,"SPACE":4,"NL":5,"directive":6,"SD":7,"document":8,"line":9,"statement":10,"idStatement":11,"DESCR":12,"-->":13,"HIDE_EMPTY":14,"scale":15,"WIDTH":16,"COMPOSIT_STATE":17,"STRUCT_START":18,"STRUCT_STOP":19,"STATE_DESCR":20,"AS":21,"ID":22,"FORK":23,"JOIN":24,"CONCURRENT":25,"note":26,"notePosition":27,"NOTE_TEXT":28,"openDirective":29,"typeDirective":30,"closeDirective":31,":":32,"argDirective":33,"eol":34,";":35,"EDGE_STATE":36,"left_of":37,"right_of":38,"open_directive":39,"type_directive":40,"arg_directive":41,"close_directive":42,"$accept":0,"$end":1}, +terminals_: {2:"error",4:"SPACE",5:"NL",7:"SD",12:"DESCR",13:"-->",14:"HIDE_EMPTY",15:"scale",16:"WIDTH",17:"COMPOSIT_STATE",18:"STRUCT_START",19:"STRUCT_STOP",20:"STATE_DESCR",21:"AS",22:"ID",23:"FORK",24:"JOIN",25:"CONCURRENT",26:"note",28:"NOTE_TEXT",32:":",35:";",36:"EDGE_STATE",37:"left_of",38:"right_of",39:"open_directive",40:"type_directive",41:"arg_directive",42:"close_directive"}, +productions_: [0,[3,2],[3,2],[3,2],[3,2],[8,0],[8,2],[9,2],[9,1],[9,1],[10,1],[10,2],[10,3],[10,4],[10,1],[10,2],[10,1],[10,4],[10,3],[10,6],[10,1],[10,1],[10,1],[10,4],[10,4],[10,1],[6,3],[6,5],[34,1],[34,1],[11,1],[11,1],[27,1],[27,1],[29,1],[30,1],[33,1],[31,1]], performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) { /* this == yyval */ @@ -124261,6 +122227,7 @@ case 13: break; case 17: + /* console.warn('Adding document for state without id ', $$[$0-3]);*/ this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: '', doc: $$[$0-1] }; @@ -124280,7 +122247,7 @@ case 18: break; case 19: - // console.warn('Adding document for state with id zxzx', $$[$0-3], $$[$0-2], yy.getDirection()); yy.addDocument($$[$0-3]); + //console.warn('Adding document for state with id ', $$[$0-3], $$[$0-2]); yy.addDocument($$[$0-3]); this.$={ stmt: 'state', id: $$[$0-3], type: 'default', description: $$[$0-5], doc: $$[$0-1] }; break; @@ -124296,51 +122263,34 @@ case 21: break; case 22: - this.$={ stmt: 'state', id: $$[$0], type: 'choice' }; - -break; -case 23: - this.$={ stmt: 'state', id: yy.getDividerId(), type: 'divider' }; break; -case 24: +case 23: - /* console.warn('got NOTE, position: ', $$[$0-2].trim(), 'id = ', $$[$0-1].trim(), 'note: ', $$[$0]);*/ + /*console.warn('got NOTE, position: ', $$[$0-2].trim(), 'id = ', $$[$0-1].trim(), 'note: ', $$[$0]);*/ this.$={ stmt: 'state', id: $$[$0-1].trim(), note:{position: $$[$0-2].trim(), text: $$[$0].trim()}}; break; -case 30: - yy.setDirection('TB');this.$={stmt:'dir', value:'TB'}; -break; -case 31: - yy.setDirection('BT');this.$={stmt:'dir', value:'BT'}; -break; -case 32: - yy.setDirection('RL'); this.$={stmt:'dir', value:'RL'}; -break; -case 33: - yy.setDirection('LR');this.$={stmt:'dir', value:'LR'}; -break; -case 36: case 37: +case 30: case 31: this.$=$$[$0]; break; -case 40: +case 34: yy.parseDirective('%%{', 'open_directive'); break; -case 41: +case 35: yy.parseDirective($$[$0], 'type_directive'); break; -case 42: +case 36: $$[$0] = $$[$0].trim().replace(/'/g, '"'); yy.parseDirective($$[$0], 'arg_directive'); break; -case 43: +case 37: yy.parseDirective('}%%', 'close_directive', 'state'); break; } }, -table: [{3:1,4:$V0,5:$V1,6:4,7:$V2,31:6,45:$V3},{1:[3]},{3:8,4:$V0,5:$V1,6:4,7:$V2,31:6,45:$V3},{3:9,4:$V0,5:$V1,6:4,7:$V2,31:6,45:$V3},{3:10,4:$V0,5:$V1,6:4,7:$V2,31:6,45:$V3},o([1,4,5,14,15,17,20,22,23,24,25,26,27,36,37,38,39,42,45],$V4,{8:11}),{32:12,46:[1,13]},{46:[2,40]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:6,36:$Vh,37:$Vi,38:$Vj,39:$Vk,42:$Vl,45:$V3},{33:36,34:[1,37],48:$Vm},o([34,48],[2,41]),o($Vn,[2,6]),{6:28,10:39,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:6,36:$Vh,37:$Vi,38:$Vj,39:$Vk,42:$Vl,45:$V3},o($Vn,[2,8]),o($Vn,[2,9]),o($Vn,[2,10],{12:[1,40],13:[1,41]}),o($Vn,[2,14]),{16:[1,42]},o($Vn,[2,16],{18:[1,43]}),{21:[1,44]},o($Vn,[2,20]),o($Vn,[2,21]),o($Vn,[2,22]),o($Vn,[2,23]),{28:45,29:[1,46],43:[1,47],44:[1,48]},o($Vn,[2,26]),o($Vn,[2,27]),o($Vo,[2,36]),o($Vo,[2,37]),o($Vn,[2,30]),o($Vn,[2,31]),o($Vn,[2,32]),o($Vn,[2,33]),o($Vp,[2,28]),{35:49,47:[1,50]},o($Vp,[2,43]),o($Vn,[2,7]),o($Vn,[2,11]),{11:51,22:$Vb,42:$Vl},o($Vn,[2,15]),o($Vq,$V4,{8:52}),{22:[1,53]},{22:[1,54]},{21:[1,55]},{22:[2,38]},{22:[2,39]},{33:56,48:$Vm},{48:[2,42]},o($Vn,[2,12],{12:[1,57]}),{4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,58],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:6,36:$Vh,37:$Vi,38:$Vj,39:$Vk,42:$Vl,45:$V3},o($Vn,[2,18],{18:[1,59]}),{29:[1,60]},{22:[1,61]},o($Vp,[2,29]),o($Vn,[2,13]),o($Vn,[2,17]),o($Vq,$V4,{8:62}),o($Vn,[2,24]),o($Vn,[2,25]),{4:$V5,5:$V6,6:28,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,63],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,27:$Vg,30:29,31:6,36:$Vh,37:$Vi,38:$Vj,39:$Vk,42:$Vl,45:$V3},o($Vn,[2,19])], -defaultActions: {7:[2,40],8:[2,1],9:[2,2],10:[2,3],47:[2,38],48:[2,39],50:[2,42]}, +table: [{3:1,4:$V0,5:$V1,6:4,7:$V2,29:6,39:$V3},{1:[3]},{3:8,4:$V0,5:$V1,6:4,7:$V2,29:6,39:$V3},{3:9,4:$V0,5:$V1,6:4,7:$V2,29:6,39:$V3},{3:10,4:$V0,5:$V1,6:4,7:$V2,29:6,39:$V3},o([1,4,5,14,15,17,20,22,23,24,25,26,36,39],$V4,{8:11}),{30:12,40:[1,13]},{40:[2,34]},{1:[2,1]},{1:[2,2]},{1:[2,3]},{1:[2,4],4:$V5,5:$V6,6:27,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,29:6,36:$Vg,39:$V3},{31:30,32:[1,31],42:$Vh},o([32,42],[2,35]),o($Vi,[2,6]),{6:27,10:33,11:18,14:$V7,15:$V8,17:$V9,20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,29:6,36:$Vg,39:$V3},o($Vi,[2,8]),o($Vi,[2,9]),o($Vi,[2,10],{12:[1,34],13:[1,35]}),o($Vi,[2,14]),{16:[1,36]},o($Vi,[2,16],{18:[1,37]}),{21:[1,38]},o($Vi,[2,20]),o($Vi,[2,21]),o($Vi,[2,22]),{27:39,28:[1,40],37:[1,41],38:[1,42]},o($Vi,[2,25]),o($Vj,[2,30]),o($Vj,[2,31]),o($Vk,[2,26]),{33:43,41:[1,44]},o($Vk,[2,37]),o($Vi,[2,7]),o($Vi,[2,11]),{11:45,22:$Vb,36:$Vg},o($Vi,[2,15]),o($Vl,$V4,{8:46}),{22:[1,47]},{22:[1,48]},{21:[1,49]},{22:[2,32]},{22:[2,33]},{31:50,42:$Vh},{42:[2,36]},o($Vi,[2,12],{12:[1,51]}),{4:$V5,5:$V6,6:27,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,52],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,29:6,36:$Vg,39:$V3},o($Vi,[2,18],{18:[1,53]}),{28:[1,54]},{22:[1,55]},o($Vk,[2,27]),o($Vi,[2,13]),o($Vi,[2,17]),o($Vl,$V4,{8:56}),o($Vi,[2,23]),o($Vi,[2,24]),{4:$V5,5:$V6,6:27,9:14,10:16,11:18,14:$V7,15:$V8,17:$V9,19:[1,57],20:$Va,22:$Vb,23:$Vc,24:$Vd,25:$Ve,26:$Vf,29:6,36:$Vg,39:$V3},o($Vi,[2,19])], +defaultActions: {7:[2,34],8:[2,1],9:[2,2],10:[2,3],41:[2,32],42:[2,33],44:[2,36]}, parseError: function parseError (str, hash) { if (hash.recoverable) { this.trace(str); @@ -124807,84 +122757,75 @@ stateStackSize:function stateStackSize() { options: {"case-insensitive":true}, performAction: function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) { switch($avoiding_name_collisions) { -case 0:return 36; -case 1:return 37; -case 2:return 38; -case 3:return 39; -case 4: this.begin('open_directive'); return 45; -case 5: this.begin('type_directive'); return 46; -case 6: this.popState(); this.begin('arg_directive'); return 34; -case 7: this.popState(); this.popState(); return 48; -case 8:return 47; -case 9:/* skip comments */ +case 0: this.begin('open_directive'); return 39; +case 1: this.begin('type_directive'); return 40; +case 2: this.popState(); this.begin('arg_directive'); return 32; +case 3: this.popState(); this.popState(); return 42; +case 4:return 41; +case 5:/* skip comments */ break; -case 10:break; -case 11:return 5; -case 12:/* skip all whitespace */ +case 6:/* skip comments */{ console.log('Crap after close'); } break; -case 13:/* skip same-line whitespace */ +case 7:return 5; +case 8:/* skip all whitespace */ break; -case 14:/* skip comments */ +case 9:/* skip same-line whitespace */ break; -case 15:/* skip comments */ +case 10:/* skip comments */ break; -case 16: this.pushState('SCALE'); /* console.log('Got scale', yy_.yytext);*/ return 15; -case 17:return 16; -case 18:this.popState(); +case 11:/* skip comments */ break; -case 19: /*console.log('Starting STATE zxzx'+yy.getDirection());*/this.pushState('STATE'); +case 12: this.pushState('SCALE'); /* console.log('Got scale', yy_.yytext);*/ return 15; +case 13:return 16; +case 14:this.popState(); break; -case 20:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim(); /*console.warn('Fork Fork: ',yy_.yytext);*/return 23; -case 21:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24; -case 22:this.popState();yy_.yytext=yy_.yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 25; -case 23:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Fork: ',yy_.yytext);*/return 23; -case 24:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24; -case 25:this.popState();yy_.yytext=yy_.yytext.slice(0,-10).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 25; -case 26: return 36; -case 27: return 37; -case 28: return 38; -case 29: return 39; -case 30: /*console.log('Starting STATE_STRING zxzx');*/this.begin("STATE_STRING"); +case 15: this.pushState('STATE'); break; -case 31:this.popState();this.pushState('STATE_ID');return "AS"; -case 32:this.popState();/* console.log('STATE_ID', yy_.yytext);*/return "ID"; -case 33:this.popState(); +case 16:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim(); /*console.warn('Fork Fork: ',yy_.yytext);*/return 23; +case 17:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24; +case 18:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Fork: ',yy_.yytext);*/return 23; +case 19:this.popState();yy_.yytext=yy_.yytext.slice(0,-8).trim();/*console.warn('Fork Join: ',yy_.yytext);*/return 24; +case 20:this.begin("STATE_STRING"); break; -case 34: /*console.log('Long description:', yy_.yytext);*/return "STATE_DESCR"; -case 35:/*console.log('COMPOSIT_STATE', yy_.yytext);*/return 17; -case 36:this.popState(); +case 21:this.popState();this.pushState('STATE_ID');return "AS"; +case 22:this.popState();/* console.log('STATE_ID', yy_.yytext);*/return "ID"; +case 23:this.popState(); break; -case 37:this.popState();this.pushState('struct'); /*console.log('begin struct', yy_.yytext);*/return 18; -case 38: /*console.log('Ending struct');*/ this.popState(); return 19; -case 39:/* nothing */ +case 24: /*console.log('Long description:', yy_.yytext);*/return "STATE_DESCR"; +case 25:/*console.log('COMPOSIT_STATE', yy_.yytext);*/return 17; +case 26:this.popState(); +break; +case 27:this.popState();this.pushState('struct'); /*console.log('begin struct', yy_.yytext);*/return 18; +case 28: /*console.log('Ending struct');*/ this.popState(); return 19; +case 29:/* nothing */ break; -case 40: this.begin('NOTE'); return 27; -case 41: this.popState();this.pushState('NOTE_ID');return 43; -case 42: this.popState();this.pushState('NOTE_ID');return 44; -case 43: this.popState();this.pushState('FLOATING_NOTE'); +case 30: this.begin('NOTE'); return 26; +case 31: this.popState();this.pushState('NOTE_ID');return 37; +case 32: this.popState();this.pushState('NOTE_ID');return 38; +case 33: this.popState();this.pushState('FLOATING_NOTE'); break; -case 44:this.popState();this.pushState('FLOATING_NOTE_ID');return "AS"; -case 45:/**/ +case 34:this.popState();this.pushState('FLOATING_NOTE_ID');return "AS"; +case 35:/**/ break; -case 46: /*console.log('Floating note text: ', yy_.yytext);*/return "NOTE_TEXT"; -case 47:this.popState();/*console.log('Floating note ID', yy_.yytext);*/return "ID"; -case 48: this.popState();this.pushState('NOTE_TEXT');/*console.log('Got ID for note', yy_.yytext);*/return 22; -case 49: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.substr(2).trim();return 29; -case 50: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.slice(0,-8).trim();return 29; -case 51: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7; -case 52: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7; -case 53: /*console.log('HIDE_EMPTY', yy_.yytext,'#');*/return 14; -case 54: /*console.log('EDGE_STATE=',yy_.yytext);*/ return 42; -case 55: /*console.log('=>ID=',yy_.yytext);*/ return 22; -case 56: yy_.yytext = yy_.yytext.trim(); /*console.log('Descr = ', yy_.yytext);*/ return 12; -case 57:return 13; -case 58:return 26; -case 59:return 5; -case 60:return 'INVALID'; +case 36: /*console.log('Floating note text: ', yy_.yytext);*/return "NOTE_TEXT"; +case 37:this.popState();/*console.log('Floating note ID', yy_.yytext);*/return "ID"; +case 38: this.popState();this.pushState('NOTE_TEXT');/*console.log('Got ID for note', yy_.yytext);*/return 22; +case 39: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.substr(2).trim();return 28; +case 40: this.popState();/*console.log('Got NOTE_TEXT for note',yy_.yytext);*/yy_.yytext = yy_.yytext.slice(0,-8).trim();return 28; +case 41: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7; +case 42: /*console.log('Got state diagram', yy_.yytext,'#');*/return 7; +case 43: /*console.log('HIDE_EMPTY', yy_.yytext,'#');*/return 14; +case 44: /*console.log('EDGE_STATE=',yy_.yytext);*/ return 36; +case 45: /*console.log('=>ID=',yy_.yytext);*/ return 22; +case 46: yy_.yytext = yy_.yytext.trim(); /*console.log('Descr = ', yy_.yytext);*/ return 12; +case 47:return 13; +case 48:return 25; +case 49:return 5; +case 50:return 'INVALID'; } }, -rules: [/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?:$)/i,/^(?:.)/i], -conditions: {"LINE":{"rules":[13,14],"inclusive":false},"close_directive":{"rules":[13,14],"inclusive":false},"arg_directive":{"rules":[7,8,13,14],"inclusive":false},"type_directive":{"rules":[6,7,13,14],"inclusive":false},"open_directive":{"rules":[5,13,14],"inclusive":false},"struct":{"rules":[13,14,19,26,27,28,29,38,39,40,54,55,56,57,58],"inclusive":false},"FLOATING_NOTE_ID":{"rules":[47],"inclusive":false},"FLOATING_NOTE":{"rules":[44,45,46],"inclusive":false},"NOTE_TEXT":{"rules":[49,50],"inclusive":false},"NOTE_ID":{"rules":[48],"inclusive":false},"NOTE":{"rules":[41,42,43],"inclusive":false},"SCALE":{"rules":[17,18],"inclusive":false},"ALIAS":{"rules":[],"inclusive":false},"STATE_ID":{"rules":[32],"inclusive":false},"STATE_STRING":{"rules":[33,34],"inclusive":false},"FORK_STATE":{"rules":[],"inclusive":false},"STATE":{"rules":[13,14,20,21,22,23,24,25,30,31,35,36,37],"inclusive":false},"ID":{"rules":[13,14],"inclusive":false},"INITIAL":{"rules":[0,1,2,3,4,9,10,11,12,14,15,16,19,37,40,51,52,53,54,55,56,57,59,60],"inclusive":true}} +rules: [/^(?:%%\{)/i,/^(?:((?:(?!\}%%)[^:.])*))/i,/^(?::)/i,/^(?:\}%%)/i,/^(?:((?:(?!\}%%).|\n)*))/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?:$)/i,/^(?:.)/i], +conditions: {"LINE":{"rules":[9,10],"inclusive":false},"close_directive":{"rules":[9,10],"inclusive":false},"arg_directive":{"rules":[3,4,9,10],"inclusive":false},"type_directive":{"rules":[2,3,9,10],"inclusive":false},"open_directive":{"rules":[1,9,10],"inclusive":false},"struct":{"rules":[9,10,15,28,29,30,44,45,46,47,48],"inclusive":false},"FLOATING_NOTE_ID":{"rules":[37],"inclusive":false},"FLOATING_NOTE":{"rules":[34,35,36],"inclusive":false},"NOTE_TEXT":{"rules":[39,40],"inclusive":false},"NOTE_ID":{"rules":[38],"inclusive":false},"NOTE":{"rules":[31,32,33],"inclusive":false},"SCALE":{"rules":[13,14],"inclusive":false},"ALIAS":{"rules":[],"inclusive":false},"STATE_ID":{"rules":[22],"inclusive":false},"STATE_STRING":{"rules":[23,24],"inclusive":false},"FORK_STATE":{"rules":[],"inclusive":false},"STATE":{"rules":[9,10,16,17,18,19,20,21,25,26,27],"inclusive":false},"ID":{"rules":[9,10],"inclusive":false},"INITIAL":{"rules":[0,5,6,7,8,10,11,12,15,27,30,41,42,43,44,45,46,47,49,50],"inclusive":true}} }); return lexer; })(); @@ -125282,12 +123223,12 @@ var drawEdge = function drawEdge(elem, path, relation) { var boundstmp = title.node().getBBox(); maxWidth = Math.max(maxWidth, boundstmp.width); minX = Math.min(minX, boundstmp.x); - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].info(boundstmp.x, x, y + titleHeight); + _logger__WEBPACK_IMPORTED_MODULE_6__["logger"].info(boundstmp.x, x, y + titleHeight); if (titleHeight === 0) { var titleBox = title.node().getBBox(); titleHeight = titleBox.height; - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].info('Title height', titleHeight, y); + _logger__WEBPACK_IMPORTED_MODULE_6__["logger"].info('Title height', titleHeight, y); } titleRows.push(title); @@ -125305,7 +123246,7 @@ var drawEdge = function drawEdge(elem, path, relation) { var bounds = label.node().getBBox(); label.insert('rect', ':first-child').attr('class', 'box').attr('x', x - maxWidth / 2 - Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding / 2).attr('y', y - boxHeight / 2 - Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding / 2 - 3.5).attr('width', maxWidth + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding).attr('height', boxHeight + Object(_config__WEBPACK_IMPORTED_MODULE_5__["getConfig"])().state.padding); - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].info(bounds); //label.attr('transform', '0 -' + (bounds.y / 2)); + _logger__WEBPACK_IMPORTED_MODULE_6__["logger"].info(bounds); //label.attr('transform', '0 -' + (bounds.y / 2)); // Debug points // path.points.forEach(point => { // g.append('circle') @@ -125367,7 +123308,7 @@ var parseDirective = function parseDirective(statement, context, type) { }; var setRootDoc = function setRootDoc(o) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('Setting root doc', o); // rootDoc = { id: 'root', doc: o }; + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('Setting root doc', o); // rootDoc = { id: 'root', doc: o }; rootDoc = o; }; @@ -125435,7 +123376,7 @@ var getRootDocV2 = function getRootDocV2() { return { id: 'root', doc: rootDoc - }; // Here + }; }; var extract = function extract(_doc) { @@ -125452,9 +123393,9 @@ var extract = function extract(_doc) { // } - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info(doc); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info(doc); clear(); - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('Extract', doc); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('Extract', doc); doc.forEach(function (item) { if (item.stmt === 'state') { addState(item.id, item.type, item.doc, item.description, item.note); @@ -125509,7 +123450,7 @@ var addState = function addState(id, type, doc, descr, note) { } if (descr) { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('Adding state ', id, descr); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('Adding state ', id, descr); if (typeof descr === 'string') addDescription(id, descr.trim()); if (_typeof(descr) === 'object') { @@ -125538,7 +123479,7 @@ var getStates = function getStates() { return currentDocument.states; }; var logDocuments = function logDocuments() { - _logger__WEBPACK_IMPORTED_MODULE_0__["log"].info('Documents = ', documents); + _logger__WEBPACK_IMPORTED_MODULE_0__["logger"].info('Documents = ', documents); }; var getRelations = function getRelations() { return currentDocument.relations; @@ -125604,14 +123545,8 @@ var getClasses = function getClasses() { return classes; }; -var direction = 'TB'; - var getDirection = function getDirection() { - return direction; -}; - -var setDirection = function setDirection(dir) { - direction = dir; + return 'TB'; }; var relationType = { @@ -125639,7 +123574,6 @@ var trimColon = function trimColon(str) { getDirection: getDirection, addRelation: addRelation, getDividerId: getDividerId, - setDirection: setDirection, // addDescription, cleanupLabel: cleanupLabel, lineType: lineType, @@ -125678,7 +123612,6 @@ __webpack_require__.r(__webpack_exports__); - // import { evaluate } from '../common/common'; @@ -125698,7 +123631,7 @@ var nodeDb = {}; */ var getClasses = function getClasses(text) { - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].trace('Extracting classes'); + _logger__WEBPACK_IMPORTED_MODULE_6__["logger"].trace('Extracting classes'); _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear(); var parser = _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_3___default.a.parser; parser.yy = _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"]; // Parse the graph definition @@ -125761,9 +123694,8 @@ var setupNode = function setupNode(g, parent, node, altFlag) { if (!nodeDb[node.id].type && node.doc) { - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].info('Setting cluster for ', node.id, getDir(node)); + _logger__WEBPACK_IMPORTED_MODULE_6__["logger"].info('Setting cluser for ', node.id); nodeDb[node.id].type = 'group'; - nodeDb[node.id].dir = getDir(node); nodeDb[node.id].shape = node.type === 'divider' ? 'divider' : 'roundedWithTitle'; nodeDb[node.id].classes = nodeDb[node.id].classes + ' ' + (altFlag ? 'statediagram-cluster statediagram-cluster-alt' : 'statediagram-cluster'); } @@ -125772,15 +123704,11 @@ var setupNode = function setupNode(g, parent, node, altFlag) { labelStyle: '', shape: nodeDb[node.id].shape, labelText: nodeDb[node.id].description, - // typeof nodeDb[node.id].description === 'object' - // ? nodeDb[node.id].description[0] - // : nodeDb[node.id].description, classes: nodeDb[node.id].classes, //classStr, style: '', //styles.style, id: node.id, - dir: nodeDb[node.id].dir, domId: 'state-' + node.id + '-' + cnt, type: nodeDb[node.id].type, padding: 15 //getConfig().flowchart.padding @@ -125797,7 +123725,7 @@ var setupNode = function setupNode(g, parent, node, altFlag) { //classStr, style: '', //styles.style, - id: node.id + '----note-' + cnt, + id: node.id + '----note', domId: 'state-' + node.id + '----note-' + cnt, type: nodeDb[node.id].type, padding: 15 //getConfig().flowchart.padding @@ -125849,13 +123777,13 @@ var setupNode = function setupNode(g, parent, node, altFlag) { if (parent) { if (parent.id !== 'root') { - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].trace('Setting node ', node.id, ' to be child of its parent ', parent.id); + _logger__WEBPACK_IMPORTED_MODULE_6__["logger"].info('Setting node ', node.id, ' to be child of its parent ', parent.id); g.setParent(node.id, parent.id); } } if (node.doc) { - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].trace('Adding nodes children '); + _logger__WEBPACK_IMPORTED_MODULE_6__["logger"].info('Adding nodes children '); setupDoc(g, node, node.doc, !altFlag); } }; @@ -125863,8 +123791,8 @@ var setupNode = function setupNode(g, parent, node, altFlag) { var cnt = 0; var setupDoc = function setupDoc(g, parent, doc, altFlag) { - // cnt = 0; - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].trace('items', doc); + cnt = 0; + _logger__WEBPACK_IMPORTED_MODULE_6__["logger"].trace('items', doc); doc.forEach(function (item) { if (item.stmt === 'state' || item.stmt === 'default') { setupNode(g, parent, item, altFlag); @@ -125891,22 +123819,6 @@ var setupDoc = function setupDoc(g, parent, doc, altFlag) { } }); }; - -var getDir = function getDir(nodes, defaultDir) { - var dir = defaultDir || 'TB'; - - if (nodes.doc) { - for (var i = 0; i < nodes.doc.length; i++) { - var node = nodes.doc[i]; - - if (node.stmt === 'dir') { - dir = node.value; - } - } - } - - return dir; -}; /** * Draws a flowchart in the tag with id: id based on the graph definition in text. * @param text @@ -125915,7 +123827,7 @@ var getDir = function getDir(nodes, defaultDir) { var draw = function draw(text, id) { - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].info('Drawing state diagram (v2)', id); + _logger__WEBPACK_IMPORTED_MODULE_6__["logger"].info('Drawing state diagram (v2)', id); _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].clear(); nodeDb = {}; var parser = _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_3___default.a.parser; @@ -125927,16 +123839,13 @@ var draw = function draw(text, id) { var conf = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().state; var nodeSpacing = conf.nodeSpacing || 50; - var rankSpacing = conf.rankSpacing || 50; - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].info(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2()); - _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].extract(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2()); - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].info(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2()); // Create the input mermaid.graph + var rankSpacing = conf.rankSpacing || 50; // Create the input mermaid.graph var g = new graphlib__WEBPACK_IMPORTED_MODULE_0___default.a.Graph({ multigraph: true, compound: true }).setGraph({ - rankdir: getDir(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2()), + rankdir: 'TB', nodesep: nodeSpacing, ranksep: rankSpacing, marginx: 8, @@ -125944,6 +123853,9 @@ var draw = function draw(text, id) { }).setDefaultEdgeLabel(function () { return {}; }); + _logger__WEBPACK_IMPORTED_MODULE_6__["logger"].info(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2()); + _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].extract(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2()); + _logger__WEBPACK_IMPORTED_MODULE_6__["logger"].info(_stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2()); setupNode(g, undefined, _stateDb__WEBPACK_IMPORTED_MODULE_2__["default"].getRootDocV2(), true); // Set up an SVG group so that we can translate the final graph. var svg = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])("[id=\"".concat(id, "\"]")); // Run the renderer. This is what draws the final graph. @@ -125960,22 +123872,23 @@ var draw = function draw(text, id) { Object(_utils__WEBPACK_IMPORTED_MODULE_7__["configureSvgSize"])(svg, height, width * 1.75, conf.useMaxWidth); // Ensure the viewBox includes the whole svgBounds area with extra space for padding var vBox = "".concat(svgBounds.x - padding, " ").concat(svgBounds.y - padding, " ").concat(width, " ").concat(height); - _logger__WEBPACK_IMPORTED_MODULE_6__["log"].debug("viewBox ".concat(vBox)); + _logger__WEBPACK_IMPORTED_MODULE_6__["logger"].debug("viewBox ".concat(vBox)); svg.attr('viewBox', vBox); // Add label rects for non html labels - // if (!evaluate(conf.htmlLabels) || true) { - var labels = document.querySelectorAll('[id="' + id + '"] .edgeLabel .label'); + if (!conf.htmlLabels) { + var labels = document.querySelectorAll('[id="' + id + '"] .edgeLabel .label'); - for (var k = 0; k < labels.length; k++) { - var label = labels[k]; // Get dimensions of label + for (var k = 0; k < labels.length; k++) { + var label = labels[k]; // Get dimensions of label - var dim = label.getBBox(); - var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect'); - rect.setAttribute('rx', 0); - rect.setAttribute('ry', 0); - rect.setAttribute('width', dim.width); - rect.setAttribute('height', dim.height); - label.insertBefore(rect, label.firstChild); // } + var dim = label.getBBox(); + var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect'); + rect.setAttribute('rx', 0); + rect.setAttribute('ry', 0); + rect.setAttribute('width', dim.width); + rect.setAttribute('height', dim.height); + label.insertBefore(rect, label.firstChild); + } } }; /* harmony default export */ __webpack_exports__["default"] = ({ @@ -126042,7 +123955,7 @@ var draw = function draw(text, id) { conf = Object(_config__WEBPACK_IMPORTED_MODULE_8__["getConfig"])().state; _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_6__["parser"].yy.clear(); _parser_stateDiagram__WEBPACK_IMPORTED_MODULE_6__["parser"].parse(text); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Rendering diagram ' + text); // Fetch the default direction, use TD if none was found + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Rendering diagram ' + text); // Fetch the default direction, use TD if none was found var diagram = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])("[id='".concat(id, "']")); insertMarkers(diagram); // Layout graph, Create a new directed graph @@ -126182,11 +124095,11 @@ var renderDoc = function renderDoc(doc, diagram, parentId, altBkg) { } } - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Count=', graph.nodeCount(), graph); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Count=', graph.nodeCount(), graph); var cnt = 0; relations.forEach(function (relation) { cnt++; - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Setting edge', relation); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Setting edge', relation); graph.setEdge(relation.id1, relation.id2, { relation: relation, width: getLabelWidth(relation.title), @@ -126195,11 +124108,11 @@ var renderDoc = function renderDoc(doc, diagram, parentId, altBkg) { }, 'id' + cnt); }); dagre__WEBPACK_IMPORTED_MODULE_1___default.a.layout(graph); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Graph after layout', graph.nodes()); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Graph after layout', graph.nodes()); var svgElem = diagram.node(); graph.nodes().forEach(function (v) { if (typeof v !== 'undefined' && typeof graph.node(v) !== 'undefined') { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].warn('Node ' + v + ': ' + JSON.stringify(graph.node(v))); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].warn('Node ' + v + ': ' + JSON.stringify(graph.node(v))); Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + svgElem.id + ' #' + v).attr('transform', 'translate(' + (graph.node(v).x - graph.node(v).width / 2) + ',' + (graph.node(v).y + (transformationLog[v] ? transformationLog[v].y : 0) - graph.node(v).height / 2) + ' )'); Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + svgElem.id + ' #' + v).attr('data-x-shift', graph.node(v).x - graph.node(v).width / 2); var dividers = document.querySelectorAll('#' + svgElem.id + ' #' + v + ' .divider'); @@ -126221,13 +124134,13 @@ var renderDoc = function renderDoc(doc, diagram, parentId, altBkg) { divider.setAttribute('x2', pWidth - pShift - 8); }); } else { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('No Node ' + v + ': ' + JSON.stringify(graph.node(v))); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('No Node ' + v + ': ' + JSON.stringify(graph.node(v))); } }); var stateBox = svgElem.getBBox(); graph.edges().forEach(function (e) { if (typeof e !== 'undefined' && typeof graph.edge(e) !== 'undefined') { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(graph.edge(e))); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Edge ' + e.v + ' -> ' + e.w + ': ' + JSON.stringify(graph.edge(e))); Object(_shapes__WEBPACK_IMPORTED_MODULE_7__["drawEdge"])(diagram, graph.edge(e), graph.edge(e).relation); } }); @@ -126240,7 +124153,7 @@ var renderDoc = function renderDoc(doc, diagram, parentId, altBkg) { }; stateInfo.width = stateBox.width + 2 * conf.padding; stateInfo.height = stateBox.height + 2 * conf.padding; - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Doc rendered', stateInfo, graph); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Doc rendered', stateInfo, graph); return stateInfo; }; @@ -126259,7 +124172,7 @@ var renderDoc = function renderDoc(doc, diagram, parentId, altBkg) { /***/ (function(module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); var getStyles = function getStyles(options) { - return "\ndefs #statediagram-barbEnd {\n fill: ".concat(options.transitionColor, ";\n stroke: ").concat(options.transitionColor, ";\n }\ng.stateGroup text {\n fill: ").concat(options.nodeBorder, ";\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ").concat(options.textColor, ";\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ").concat(options.stateLabelColor, ";\n}\n\ng.stateGroup rect {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n}\n\ng.stateGroup line {\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1;\n}\n\n.transition {\n stroke: ").concat(options.transitionColor, ";\n stroke-width: 1;\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ").concat(options.background, ";\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ").concat(options.noteBorderColor, ";\n fill: ").concat(options.noteBkgColor, ";\n\n text {\n fill: ").concat(options.noteTextColor, ";\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ").concat(options.mainBkg, ";\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ").concat(options.labelBackgroundColor, ";\n opacity: 0.5;\n}\n.edgeLabel .label text {\n fill: ").concat(options.transitionLabelColor || options.tertiaryTextColor, ";\n}\n.label div .edgeLabel {\n color: ").concat(options.transitionLabelColor || options.tertiaryTextColor, ";\n}\n\n.stateLabel text {\n fill: ").concat(options.stateLabelColor, ";\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ").concat(options.specialStateColor, ";\n stroke: ").concat(options.specialStateColor, ";\n}\n\n.node .fork-join {\n fill: ").concat(options.specialStateColor, ";\n stroke: ").concat(options.specialStateColor, ";\n}\n\n.node circle.state-end {\n fill: ").concat(options.innerEndBackground, ";\n stroke: ").concat(options.background, ";\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ").concat(options.compositeBackground || options.background, ";\n // stroke: ").concat(options.background, ";\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ").concat(options.stateBkg || options.mainBkg, ";\n stroke: ").concat(options.stateBorder || options.nodeBorder, ";\n stroke-width: 1px;\n}\n.node polygon {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.stateBorder || options.nodeBorder, ";;\n stroke-width: 1px;\n}\n#statediagram-barbEnd {\n fill: ").concat(options.lineColor, ";\n}\n\n.statediagram-cluster rect {\n fill: ").concat(options.compositeTitleBackground, ";\n stroke: ").concat(options.stateBorder || options.nodeBorder, ";\n stroke-width: 1px;\n}\n\n.cluster-label, .nodeLabel {\n color: ").concat(options.stateLabelColor, ";\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ").concat(options.stateBorder || options.nodeBorder, ";\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ").concat(options.compositeBackground || options.background, ";\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ").concat(options.altBackground ? options.altBackground : '#efefef', ";\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ").concat(options.altBackground ? options.altBackground : '#efefef', ";\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ").concat(options.noteBkgColor, ";\n stroke: ").concat(options.noteBorderColor, ";\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ").concat(options.noteBkgColor, ";\n stroke: ").concat(options.noteBorderColor, ";\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ").concat(options.noteTextColor, ";\n}\n\n.statediagram-note .nodeLabel {\n color: ").concat(options.noteTextColor, ";\n}\n.statediagram .edgeLabel {\n color: red; // ").concat(options.noteTextColor, ";\n}\n\n#dependencyStart, #dependencyEnd {\n fill: ").concat(options.lineColor, ";\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1;\n}\n"); + return "g.stateGroup text {\n fill: ".concat(options.nodeBorder, ";\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ").concat(options.textColor, ";\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ").concat(options.labelColor, ";\n}\n\ng.stateGroup rect {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n}\n\ng.stateGroup line {\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1;\n}\n\n.transition {\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1;\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ").concat(options.background, ";\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ").concat(options.noteBorderColor, ";\n fill: ").concat(options.noteBkgColor, ";\n\n text {\n fill: black;\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ").concat(options.mainBkg, ";\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ").concat(options.tertiaryColor, ";\n opacity: 0.5;\n}\n.edgeLabel .label text {\n fill: ").concat(options.tertiaryTextColor, ";\n}\n.label div .edgeLabel {\n color: ").concat(options.tertiaryTextColor, ";\n}\n\n.stateLabel text {\n fill: ").concat(options.labelColor, ";\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ").concat(options.lineColor, ";\n stroke: black;\n}\n.node circle.state-end {\n fill: ").concat(options.primaryBorderColor, ";\n stroke: ").concat(options.background, ";\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ").concat(options.background, ";\n // stroke: ").concat(options.background, ";\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n stroke-width: 1px;\n}\n#statediagram-barbEnd {\n fill: ").concat(options.lineColor, ";\n}\n\n.statediagram-cluster rect {\n fill: ").concat(options.mainBkg, ";\n stroke: ").concat(options.nodeBorder, ";\n stroke-width: 1px;\n}\n\n.cluster-label, .nodeLabel {\n color: ").concat(options.textColor, ";\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ").concat(options.nodeBorder, ";\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ").concat(options.background, ";\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: #e0e0e0;\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ").concat(options.altBackground ? options.altBackground : '#efefef', ";\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ").concat(options.noteBkgColor, ";\n stroke: ").concat(options.noteBorderColor, ";\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ").concat(options.noteBkgColor, ";\n stroke: ").concat(options.noteBorderColor, ";\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ").concat(options.noteTextColor, ";\n}\n\n.statediagram-note .nodeLabel {\n color: ").concat(options.noteTextColor, ";\n}\n\n#dependencyStart, #dependencyEnd {\n fill: ").concat(options.lineColor, ";\n stroke: ").concat(options.lineColor, ";\n stroke-width: 1;\n}\n"); }; /* harmony default export */ __webpack_exports__["default"] = (getStyles); @@ -126435,15 +124348,44 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _parser_journey__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parser/journey */ "./src/diagrams/user-journey/parser/journey.jison"); /* harmony import */ var _journeyDb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./journeyDb */ "./src/diagrams/user-journey/journeyDb.js"); /* harmony import */ var _svgDraw__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./svgDraw */ "./src/diagrams/user-journey/svgDraw.js"); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../config */ "./src/config.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); - +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils */ "./src/utils.js"); _parser_journey__WEBPACK_IMPORTED_MODULE_1__["parser"].yy = _journeyDb__WEBPACK_IMPORTED_MODULE_2__["default"]; +var conf = { + leftMargin: 150, + diagramMarginX: 50, + diagramMarginY: 20, + // Margin between tasks + taskMargin: 50, + // Width of task boxes + width: 150, + // Height of task boxes + height: 50, + taskFontSize: 14, + taskFontFamily: '"Open-Sans", "sans-serif"', + // Margin around loop boxes + boxMargin: 10, + boxTextMargin: 5, + noteMargin: 10, + // Space between messages + messageMargin: 35, + // Multiline message alignment + messageAlign: 'center', + // Depending on css styling this might need adjustment + // Projects the edge of the diagram downwards + bottomMarginAdj: 1, + // width of activation box + activationWidth: 10, + // text placement as: tspan | fo | old only text as before + textPlacement: 'fo', + actorColours: ['#8FBC8F', '#7CFC00', '#00FFFF', '#20B2AA', '#B0E0E6', '#FFFFE0'], + sectionFills: ['#191970', '#8B008B', '#4B0082', '#2F4F4F', '#800000', '#8B4513', '#00008B'], + sectionColours: ['#fff'] +}; var setConf = function setConf(cnf) { var keys = Object.keys(cnf); keys.forEach(function (key) { @@ -126453,8 +124395,7 @@ var setConf = function setConf(cnf) { var actors = {}; function drawActorLegend(diagram) { - var conf = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().journey; // Draw the actors - + // Draw the actors var yPos = 60; Object.keys(actors).forEach(function (person) { var colour = actors[person]; @@ -126478,10 +124419,8 @@ function drawActorLegend(diagram) { }); } -var conf = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().journey; -var LEFT_MARGIN = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().journey.leftMargin; +var LEFT_MARGIN = conf.leftMargin; var draw = function draw(text, id) { - var conf = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().journey; _parser_journey__WEBPACK_IMPORTED_MODULE_1__["parser"].yy.clear(); _parser_journey__WEBPACK_IMPORTED_MODULE_1__["parser"].parse(text + '\n'); bounds.init(); @@ -126512,7 +124451,7 @@ var draw = function draw(text, id) { var height = box.stopy - box.starty + 2 * conf.diagramMarginY; var width = LEFT_MARGIN + box.stopx + 2 * conf.diagramMarginX; - Object(_utils__WEBPACK_IMPORTED_MODULE_5__["configureSvgSize"])(diagram, height, width, conf.useMaxWidth); // Draw activity line + Object(_utils__WEBPACK_IMPORTED_MODULE_4__["configureSvgSize"])(diagram, height, width, conf.useMaxWidth); // Draw activity line diagram.append('line').attr('x1', LEFT_MARGIN).attr('y1', conf.height * 4) // One section head + one task + margins .attr('x2', width - LEFT_MARGIN - 4) // Subtract stroke width so arrow point is retained @@ -126520,7 +124459,6 @@ var draw = function draw(text, id) { var extraVertForTitle = title ? 70 : 0; diagram.attr('viewBox', "".concat(box.startx, " -25 ").concat(width, " ").concat(height + extraVertForTitle)); diagram.attr('preserveAspectRatio', 'xMinYMin meet'); - diagram.attr('height', height + extraVertForTitle + 25); }; var bounds = { data: { @@ -126549,8 +124487,6 @@ var bounds = { } }, updateBounds: function updateBounds(startx, starty, stopx, stopy) { - var conf = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().journey; - var _self = this; var cnt = 0; @@ -126612,7 +124548,6 @@ var bounds = { var fills = conf.sectionFills; var textColours = conf.sectionColours; var drawTasks = function drawTasks(diagram, tasks, verticalPos) { - var conf = Object(_config__WEBPACK_IMPORTED_MODULE_4__["getConfig"])().journey; var lastSection = ''; var sectionVHeight = conf.height * 2 + conf.diagramMarginY; var taskPos = verticalPos + sectionVHeight; @@ -127664,7 +125599,7 @@ var setConf = function setConf(cnf) { var draw = function draw(id, ver) { try { - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].debug('Renering svg for syntax error\n'); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('Renering svg for syntax error\n'); var svg = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#' + id); var g = svg.append('g'); g.append('path').attr('class', 'error-icon').attr('d', 'm411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z'); @@ -127681,8 +125616,8 @@ var draw = function draw(id, ver) { svg.attr('width', 400); svg.attr('viewBox', '768 0 512 512'); } catch (e) { - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].error('Error while rendering info diagram'); - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].error(e.message); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].error('Error while rendering info diagram'); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].error(e.message); } }; /* harmony default export */ __webpack_exports__["default"] = ({ @@ -127696,14 +125631,15 @@ var draw = function draw(id, ver) { /*!***********************!*\ !*** ./src/logger.js ***! \***********************/ -/*! exports provided: LEVELS, log, setLogLevel */ +/*! exports provided: LEVELS, logger, setLogLevel */ /***/ (function(module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "LEVELS", function() { return LEVELS; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "log", function() { return log; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "logger", function() { return logger; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setLogLevel", function() { return setLogLevel; }); /* harmony import */ var moment_mini__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! moment-mini */ "moment-mini"); /* harmony import */ var moment_mini__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(moment_mini__WEBPACK_IMPORTED_MODULE_0__); + // var LEVELS = { debug: 1, @@ -127712,7 +125648,7 @@ var LEVELS = { error: 4, fatal: 5 }; -var log = { +var logger = { debug: function debug() {}, info: function info() {}, warn: function warn() {}, @@ -127730,37 +125666,37 @@ var setLogLevel = function setLogLevel() { } } - log.trace = function () {}; + logger.trace = function () {}; - log.debug = function () {}; + logger.debug = function () {}; - log.info = function () {}; + logger.info = function () {}; - log.warn = function () {}; + logger.warn = function () {}; - log.error = function () {}; + logger.error = function () {}; - log.fatal = function () {}; + logger.fatal = function () {}; if (level <= LEVELS.fatal) { - log.fatal = console.error ? console.error.bind(console, format('FATAL'), 'color: orange') : console.log.bind(console, '\x1b[35m', format('FATAL')); + logger.fatal = console.error ? console.error.bind(console, format('FATAL'), 'color: orange') : console.log.bind(console, '\x1b[35m', format('FATAL')); } if (level <= LEVELS.error) { - log.error = console.error ? console.error.bind(console, format('ERROR'), 'color: orange') : console.log.bind(console, '\x1b[31m', format('ERROR')); + logger.error = console.error ? console.error.bind(console, format('ERROR'), 'color: orange') : console.log.bind(console, '\x1b[31m', format('ERROR')); } if (level <= LEVELS.warn) { - log.warn = console.warn ? console.warn.bind(console, format('WARN'), 'color: orange') : console.log.bind(console, "\x1B[33m", format('WARN')); + logger.warn = console.warn ? console.warn.bind(console, format('WARN'), 'color: orange') : console.log.bind(console, "\x1B[33m", format('WARN')); } if (level <= LEVELS.info) { - log.info = console.info // ? console.info.bind(console, '\x1b[34m', format('INFO'), 'color: blue') - ? console.info.bind(console, format('INFO'), 'color: lightblue') : console.log.bind(console, '\x1b[34m', format('INFO')); + logger.info = console.info ? // ? console.info.bind(console, '\x1b[34m', format('INFO'), 'color: blue') + console.info.bind(console, format('INFO'), 'color: lightblue') : console.log.bind(console, '\x1b[34m', format('INFO')); } if (level <= LEVELS.debug) { - log.debug = console.debug ? console.debug.bind(console, format('DEBUG'), 'color: lightgreen') : console.log.bind(console, '\x1b[32m', format('DEBUG')); + logger.debug = console.debug ? console.debug.bind(console, format('DEBUG'), 'color: lightgreen') : console.log.bind(console, '\x1b[32m', format('DEBUG')); } }; @@ -127837,24 +125773,24 @@ var init = function init() { if (typeof arguments[arguments.length - 1] === 'function') { callback = arguments[arguments.length - 1]; - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].debug('Callback function found'); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('Callback function found'); } else { if (typeof conf.mermaid !== 'undefined') { if (typeof conf.mermaid.callback === 'function') { callback = conf.mermaid.callback; - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].debug('Callback function found'); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('Callback function found'); } else { - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].debug('No Callback function found'); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('No Callback function found'); } } } nodes = nodes === undefined ? document.querySelectorAll('.mermaid') : typeof nodes === 'string' ? document.querySelectorAll(nodes) : nodes instanceof window.Node ? [nodes] : nodes; // Last case - sequence config was passed pick next - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].debug('Start On Load before: ' + mermaid.startOnLoad); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('Start On Load before: ' + mermaid.startOnLoad); if (typeof mermaid.startOnLoad !== 'undefined') { - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].debug('Start On Load inner: ' + mermaid.startOnLoad); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('Start On Load inner: ' + mermaid.startOnLoad); _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__["default"].updateSiteConfig({ startOnLoad: mermaid.startOnLoad }); @@ -127866,7 +125802,7 @@ var init = function init() { }); } - var idGeneratior = new _utils__WEBPACK_IMPORTED_MODULE_3__["default"].initIdGeneratior(conf.deterministicIds, conf.deterministicIDSeed); + var nextId = _utils__WEBPACK_IMPORTED_MODULE_3__["default"].initIdGeneratior(conf.deterministicIds, conf.deterministicIDSeed).next; var txt; var _loop = function _loop(i) { @@ -127879,7 +125815,7 @@ var init = function init() { return "continue"; } - var id = "mermaid-".concat(idGeneratior.next()); // Fetch the graph definition including tags + var id = "mermaid-".concat(nextId()); // Fetch the graph definition including tags txt = element.innerHTML; // transforms the html to pure text @@ -127887,7 +125823,7 @@ var init = function init() { var init = _utils__WEBPACK_IMPORTED_MODULE_3__["default"].detectInit(txt); if (init) { - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].debug('Detected early reinit: ', init); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('Detected early reinit: ', init); } try { @@ -127901,8 +125837,8 @@ var init = function init() { if (bindFunctions) bindFunctions(element); }, element); } catch (e) { - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].warn('Syntax Error rendering'); - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].warn(e); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].warn('Syntax Error rendering'); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].warn(e); if (_this.parseError) { _this.parseError(e); @@ -127925,7 +125861,7 @@ var initialize = function initialize(config) { } if (typeof config.mermaid.htmlLabels !== 'undefined') { - mermaid.htmlLabels = config.mermaid.htmlLabels === 'false' || config.mermaid.htmlLabels === false ? false : true; + mermaid.htmlLabels = config.mermaid.htmlLabels; } } @@ -127950,7 +125886,7 @@ var contentLoaded = function contentLoaded() { } } else { if (typeof mermaid.startOnLoad === 'undefined') { - _logger__WEBPACK_IMPORTED_MODULE_1__["log"].debug('In start, no config'); + _logger__WEBPACK_IMPORTED_MODULE_1__["logger"].debug('In start, no config'); config = _mermaidAPI__WEBPACK_IMPORTED_MODULE_2__["default"].getConfig(); if (config.startOnLoad) { @@ -127992,63 +125928,59 @@ var mermaid = { __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "encodeEntities", function() { return encodeEntities; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "decodeEntities", function() { return decodeEntities; }); -/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3 */ "d3"); -/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! stylis */ "stylis"); -/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(stylis__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! stylis */ "stylis"); +/* harmony import */ var stylis__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(stylis__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3 */ "d3"); /* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../package.json */ "./package.json"); -/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./config */ "./src/config.js"); -/* harmony import */ var _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./diagrams/class/classDb */ "./src/diagrams/class/classDb.js"); -/* harmony import */ var _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./diagrams/class/classRenderer */ "./src/diagrams/class/classRenderer.js"); -/* harmony import */ var _diagrams_class_classRenderer_v2__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./diagrams/class/classRenderer-v2 */ "./src/diagrams/class/classRenderer-v2.js"); -/* harmony import */ var _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./diagrams/class/parser/classDiagram */ "./src/diagrams/class/parser/classDiagram.jison"); -/* harmony import */ var _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_7__); -/* harmony import */ var _diagrams_er_erDb__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./diagrams/er/erDb */ "./src/diagrams/er/erDb.js"); -/* harmony import */ var _diagrams_er_erRenderer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./diagrams/er/erRenderer */ "./src/diagrams/er/erRenderer.js"); -/* harmony import */ var _diagrams_er_parser_erDiagram__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./diagrams/er/parser/erDiagram */ "./src/diagrams/er/parser/erDiagram.jison"); -/* harmony import */ var _diagrams_er_parser_erDiagram__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_diagrams_er_parser_erDiagram__WEBPACK_IMPORTED_MODULE_10__); -/* harmony import */ var _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./diagrams/flowchart/flowDb */ "./src/diagrams/flowchart/flowDb.js"); -/* harmony import */ var _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./diagrams/flowchart/flowRenderer */ "./src/diagrams/flowchart/flowRenderer.js"); -/* harmony import */ var _diagrams_flowchart_flowRenderer_v2__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./diagrams/flowchart/flowRenderer-v2 */ "./src/diagrams/flowchart/flowRenderer-v2.js"); -/* harmony import */ var _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./diagrams/flowchart/parser/flow */ "./src/diagrams/flowchart/parser/flow.jison"); -/* harmony import */ var _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_14__); -/* harmony import */ var _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./diagrams/gantt/ganttDb */ "./src/diagrams/gantt/ganttDb.js"); -/* harmony import */ var _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./diagrams/gantt/ganttRenderer */ "./src/diagrams/gantt/ganttRenderer.js"); -/* harmony import */ var _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./diagrams/gantt/parser/gantt */ "./src/diagrams/gantt/parser/gantt.jison"); -/* harmony import */ var _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_17__); -/* harmony import */ var _diagrams_git_gitGraphAst__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./diagrams/git/gitGraphAst */ "./src/diagrams/git/gitGraphAst.js"); -/* harmony import */ var _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./diagrams/git/gitGraphRenderer */ "./src/diagrams/git/gitGraphRenderer.js"); -/* harmony import */ var _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./diagrams/git/parser/gitGraph */ "./src/diagrams/git/parser/gitGraph.jison"); -/* harmony import */ var _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_20__); -/* harmony import */ var _diagrams_info_infoDb__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./diagrams/info/infoDb */ "./src/diagrams/info/infoDb.js"); -/* harmony import */ var _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./diagrams/info/infoRenderer */ "./src/diagrams/info/infoRenderer.js"); -/* harmony import */ var _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./diagrams/info/parser/info */ "./src/diagrams/info/parser/info.jison"); -/* harmony import */ var _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(_diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_23__); -/* harmony import */ var _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./diagrams/pie/parser/pie */ "./src/diagrams/pie/parser/pie.jison"); -/* harmony import */ var _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(_diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_24__); -/* harmony import */ var _diagrams_pie_pieDb__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./diagrams/pie/pieDb */ "./src/diagrams/pie/pieDb.js"); -/* harmony import */ var _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./diagrams/pie/pieRenderer */ "./src/diagrams/pie/pieRenderer.js"); -/* harmony import */ var _diagrams_requirement_parser_requirementDiagram__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./diagrams/requirement/parser/requirementDiagram */ "./src/diagrams/requirement/parser/requirementDiagram.jison"); -/* harmony import */ var _diagrams_requirement_parser_requirementDiagram__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(_diagrams_requirement_parser_requirementDiagram__WEBPACK_IMPORTED_MODULE_27__); -/* harmony import */ var _diagrams_requirement_requirementDb__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./diagrams/requirement/requirementDb */ "./src/diagrams/requirement/requirementDb.js"); -/* harmony import */ var _diagrams_requirement_requirementRenderer__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./diagrams/requirement/requirementRenderer */ "./src/diagrams/requirement/requirementRenderer.js"); -/* harmony import */ var _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./diagrams/sequence/parser/sequenceDiagram */ "./src/diagrams/sequence/parser/sequenceDiagram.jison"); -/* harmony import */ var _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_30___default = /*#__PURE__*/__webpack_require__.n(_diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_30__); -/* harmony import */ var _diagrams_sequence_sequenceDb__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./diagrams/sequence/sequenceDb */ "./src/diagrams/sequence/sequenceDb.js"); -/* harmony import */ var _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./diagrams/sequence/sequenceRenderer */ "./src/diagrams/sequence/sequenceRenderer.js"); -/* harmony import */ var _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./diagrams/state/parser/stateDiagram */ "./src/diagrams/state/parser/stateDiagram.jison"); -/* harmony import */ var _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_33___default = /*#__PURE__*/__webpack_require__.n(_diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_33__); -/* harmony import */ var _diagrams_state_stateDb__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./diagrams/state/stateDb */ "./src/diagrams/state/stateDb.js"); -/* harmony import */ var _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./diagrams/state/stateRenderer */ "./src/diagrams/state/stateRenderer.js"); -/* harmony import */ var _diagrams_state_stateRenderer_v2__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./diagrams/state/stateRenderer-v2 */ "./src/diagrams/state/stateRenderer-v2.js"); +/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./logger */ "./src/logger.js"); +/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./src/utils.js"); +/* harmony import */ var _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./diagrams/flowchart/flowRenderer */ "./src/diagrams/flowchart/flowRenderer.js"); +/* harmony import */ var _diagrams_flowchart_flowRenderer_v2__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./diagrams/flowchart/flowRenderer-v2 */ "./src/diagrams/flowchart/flowRenderer-v2.js"); +/* harmony import */ var _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./diagrams/flowchart/parser/flow */ "./src/diagrams/flowchart/parser/flow.jison"); +/* harmony import */ var _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7__); +/* harmony import */ var _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./diagrams/flowchart/flowDb */ "./src/diagrams/flowchart/flowDb.js"); +/* harmony import */ var _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./diagrams/sequence/sequenceRenderer */ "./src/diagrams/sequence/sequenceRenderer.js"); +/* harmony import */ var _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./diagrams/sequence/parser/sequenceDiagram */ "./src/diagrams/sequence/parser/sequenceDiagram.jison"); +/* harmony import */ var _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10__); +/* harmony import */ var _diagrams_sequence_sequenceDb__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./diagrams/sequence/sequenceDb */ "./src/diagrams/sequence/sequenceDb.js"); +/* harmony import */ var _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./diagrams/gantt/ganttRenderer */ "./src/diagrams/gantt/ganttRenderer.js"); +/* harmony import */ var _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./diagrams/gantt/parser/gantt */ "./src/diagrams/gantt/parser/gantt.jison"); +/* harmony import */ var _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13__); +/* harmony import */ var _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./diagrams/gantt/ganttDb */ "./src/diagrams/gantt/ganttDb.js"); +/* harmony import */ var _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./diagrams/class/classRenderer */ "./src/diagrams/class/classRenderer.js"); +/* harmony import */ var _diagrams_class_classRenderer_v2__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./diagrams/class/classRenderer-v2 */ "./src/diagrams/class/classRenderer-v2.js"); +/* harmony import */ var _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./diagrams/class/parser/classDiagram */ "./src/diagrams/class/parser/classDiagram.jison"); +/* harmony import */ var _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_17__); +/* harmony import */ var _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./diagrams/class/classDb */ "./src/diagrams/class/classDb.js"); +/* harmony import */ var _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./diagrams/state/stateRenderer */ "./src/diagrams/state/stateRenderer.js"); +/* harmony import */ var _diagrams_state_stateRenderer_v2__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./diagrams/state/stateRenderer-v2 */ "./src/diagrams/state/stateRenderer-v2.js"); +/* harmony import */ var _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./diagrams/state/parser/stateDiagram */ "./src/diagrams/state/parser/stateDiagram.jison"); +/* harmony import */ var _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(_diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_21__); +/* harmony import */ var _diagrams_state_stateDb__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./diagrams/state/stateDb */ "./src/diagrams/state/stateDb.js"); +/* harmony import */ var _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./diagrams/git/gitGraphRenderer */ "./src/diagrams/git/gitGraphRenderer.js"); +/* harmony import */ var _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./diagrams/git/parser/gitGraph */ "./src/diagrams/git/parser/gitGraph.jison"); +/* harmony import */ var _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(_diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_24__); +/* harmony import */ var _diagrams_git_gitGraphAst__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./diagrams/git/gitGraphAst */ "./src/diagrams/git/gitGraphAst.js"); +/* harmony import */ var _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./diagrams/info/infoRenderer */ "./src/diagrams/info/infoRenderer.js"); +/* harmony import */ var _errorRenderer__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./errorRenderer */ "./src/errorRenderer.js"); +/* harmony import */ var _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./diagrams/info/parser/info */ "./src/diagrams/info/parser/info.jison"); +/* harmony import */ var _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(_diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_28__); +/* harmony import */ var _diagrams_info_infoDb__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./diagrams/info/infoDb */ "./src/diagrams/info/infoDb.js"); +/* harmony import */ var _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./diagrams/pie/pieRenderer */ "./src/diagrams/pie/pieRenderer.js"); +/* harmony import */ var _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./diagrams/pie/parser/pie */ "./src/diagrams/pie/parser/pie.jison"); +/* harmony import */ var _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_31___default = /*#__PURE__*/__webpack_require__.n(_diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_31__); +/* harmony import */ var _diagrams_pie_pieDb__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./diagrams/pie/pieDb */ "./src/diagrams/pie/pieDb.js"); +/* harmony import */ var _diagrams_er_erDb__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./diagrams/er/erDb */ "./src/diagrams/er/erDb.js"); +/* harmony import */ var _diagrams_er_parser_erDiagram__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./diagrams/er/parser/erDiagram */ "./src/diagrams/er/parser/erDiagram.jison"); +/* harmony import */ var _diagrams_er_parser_erDiagram__WEBPACK_IMPORTED_MODULE_34___default = /*#__PURE__*/__webpack_require__.n(_diagrams_er_parser_erDiagram__WEBPACK_IMPORTED_MODULE_34__); +/* harmony import */ var _diagrams_er_erRenderer__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./diagrams/er/erRenderer */ "./src/diagrams/er/erRenderer.js"); +/* harmony import */ var _diagrams_user_journey_parser_journey__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./diagrams/user-journey/parser/journey */ "./src/diagrams/user-journey/parser/journey.jison"); +/* harmony import */ var _diagrams_user_journey_parser_journey__WEBPACK_IMPORTED_MODULE_36___default = /*#__PURE__*/__webpack_require__.n(_diagrams_user_journey_parser_journey__WEBPACK_IMPORTED_MODULE_36__); /* harmony import */ var _diagrams_user_journey_journeyDb__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./diagrams/user-journey/journeyDb */ "./src/diagrams/user-journey/journeyDb.js"); /* harmony import */ var _diagrams_user_journey_journeyRenderer__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./diagrams/user-journey/journeyRenderer */ "./src/diagrams/user-journey/journeyRenderer.js"); -/* harmony import */ var _diagrams_user_journey_parser_journey__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./diagrams/user-journey/parser/journey */ "./src/diagrams/user-journey/parser/journey.jison"); -/* harmony import */ var _diagrams_user_journey_parser_journey__WEBPACK_IMPORTED_MODULE_39___default = /*#__PURE__*/__webpack_require__.n(_diagrams_user_journey_parser_journey__WEBPACK_IMPORTED_MODULE_39__); -/* harmony import */ var _errorRenderer__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./errorRenderer */ "./src/errorRenderer.js"); -/* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./logger */ "./src/logger.js"); -/* harmony import */ var _styles__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./styles */ "./src/styles.js"); -/* harmony import */ var _themes__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./themes */ "./src/themes/index.js"); -/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./utils */ "./src/utils.js"); +/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./config */ "./src/config.js"); +/* harmony import */ var _styles__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./styles */ "./src/styles.js"); +/* harmony import */ var _themes__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./themes */ "./src/themes/index.js"); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } /** @@ -128068,6 +126000,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi */ + // import * as configApi from './config'; +// // , { +// // setConfig, +// // configApi.getConfig, +// // configApi.updateSiteConfig, +// // configApi.setSiteConfig, +// // configApi.getSiteConfig, +// // configApi.defaultConfig +// // } @@ -128103,18 +126044,6 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi - - - - // import * as configApi from './config'; -// // , { -// // setConfig, -// // configApi.getConfig, -// // configApi.updateSiteConfig, -// // configApi.setSiteConfig, -// // configApi.getSiteConfig, -// // configApi.defaultConfig -// // } @@ -128122,95 +126051,87 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi function parse(text) { - var cnf = _config__WEBPACK_IMPORTED_MODULE_3__["getConfig"](); - var graphInit = _utils__WEBPACK_IMPORTED_MODULE_44__["default"].detectInit(text, cnf); + var graphInit = _utils__WEBPACK_IMPORTED_MODULE_4__["default"].detectInit(text); if (graphInit) { - _logger__WEBPACK_IMPORTED_MODULE_41__["log"].debug('reinit ', graphInit); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('reinit ', graphInit); } - var graphType = _utils__WEBPACK_IMPORTED_MODULE_44__["default"].detectType(text, cnf); + var graphType = _utils__WEBPACK_IMPORTED_MODULE_4__["default"].detectType(text); var parser; - _logger__WEBPACK_IMPORTED_MODULE_41__["log"].debug('Type ' + graphType); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Type ' + graphType); switch (graphType) { case 'git': - parser = _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_20___default.a; - parser.parser.yy = _diagrams_git_gitGraphAst__WEBPACK_IMPORTED_MODULE_18__["default"]; + parser = _diagrams_git_parser_gitGraph__WEBPACK_IMPORTED_MODULE_24___default.a; + parser.parser.yy = _diagrams_git_gitGraphAst__WEBPACK_IMPORTED_MODULE_25__["default"]; break; case 'flowchart': - _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_11__["default"].clear(); - parser = _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_14___default.a; - parser.parser.yy = _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_11__["default"]; + _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__["default"].clear(); + parser = _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7___default.a; + parser.parser.yy = _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__["default"]; break; case 'flowchart-v2': - _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_11__["default"].clear(); - parser = _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_14___default.a; - parser.parser.yy = _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_11__["default"]; + _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__["default"].clear(); + parser = _diagrams_flowchart_parser_flow__WEBPACK_IMPORTED_MODULE_7___default.a; + parser.parser.yy = _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__["default"]; break; case 'sequence': - parser = _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_30___default.a; - parser.parser.yy = _diagrams_sequence_sequenceDb__WEBPACK_IMPORTED_MODULE_31__["default"]; + parser = _diagrams_sequence_parser_sequenceDiagram__WEBPACK_IMPORTED_MODULE_10___default.a; + parser.parser.yy = _diagrams_sequence_sequenceDb__WEBPACK_IMPORTED_MODULE_11__["default"]; break; case 'gantt': - parser = _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_17___default.a; - parser.parser.yy = _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_15__["default"]; + parser = _diagrams_gantt_parser_gantt__WEBPACK_IMPORTED_MODULE_13___default.a; + parser.parser.yy = _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_14__["default"]; break; case 'class': - parser = _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_7___default.a; - parser.parser.yy = _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_4__["default"]; + parser = _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_17___default.a; + parser.parser.yy = _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_18__["default"]; break; case 'classDiagram': - parser = _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_7___default.a; - parser.parser.yy = _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_4__["default"]; + parser = _diagrams_class_parser_classDiagram__WEBPACK_IMPORTED_MODULE_17___default.a; + parser.parser.yy = _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_18__["default"]; break; case 'state': - parser = _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_33___default.a; - parser.parser.yy = _diagrams_state_stateDb__WEBPACK_IMPORTED_MODULE_34__["default"]; + parser = _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_21___default.a; + parser.parser.yy = _diagrams_state_stateDb__WEBPACK_IMPORTED_MODULE_22__["default"]; break; case 'stateDiagram': - parser = _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_33___default.a; - parser.parser.yy = _diagrams_state_stateDb__WEBPACK_IMPORTED_MODULE_34__["default"]; + parser = _diagrams_state_parser_stateDiagram__WEBPACK_IMPORTED_MODULE_21___default.a; + parser.parser.yy = _diagrams_state_stateDb__WEBPACK_IMPORTED_MODULE_22__["default"]; break; case 'info': - _logger__WEBPACK_IMPORTED_MODULE_41__["log"].debug('info info info'); - parser = _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_23___default.a; - parser.parser.yy = _diagrams_info_infoDb__WEBPACK_IMPORTED_MODULE_21__["default"]; + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('info info info'); + parser = _diagrams_info_parser_info__WEBPACK_IMPORTED_MODULE_28___default.a; + parser.parser.yy = _diagrams_info_infoDb__WEBPACK_IMPORTED_MODULE_29__["default"]; break; case 'pie': - _logger__WEBPACK_IMPORTED_MODULE_41__["log"].debug('pie'); - parser = _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_24___default.a; - parser.parser.yy = _diagrams_pie_pieDb__WEBPACK_IMPORTED_MODULE_25__["default"]; + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('pie'); + parser = _diagrams_pie_parser_pie__WEBPACK_IMPORTED_MODULE_31___default.a; + parser.parser.yy = _diagrams_pie_pieDb__WEBPACK_IMPORTED_MODULE_32__["default"]; break; case 'er': - _logger__WEBPACK_IMPORTED_MODULE_41__["log"].debug('er'); - parser = _diagrams_er_parser_erDiagram__WEBPACK_IMPORTED_MODULE_10___default.a; - parser.parser.yy = _diagrams_er_erDb__WEBPACK_IMPORTED_MODULE_8__["default"]; + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('er'); + parser = _diagrams_er_parser_erDiagram__WEBPACK_IMPORTED_MODULE_34___default.a; + parser.parser.yy = _diagrams_er_erDb__WEBPACK_IMPORTED_MODULE_33__["default"]; break; case 'journey': - _logger__WEBPACK_IMPORTED_MODULE_41__["log"].debug('Journey'); - parser = _diagrams_user_journey_parser_journey__WEBPACK_IMPORTED_MODULE_39___default.a; + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Journey'); + parser = _diagrams_user_journey_parser_journey__WEBPACK_IMPORTED_MODULE_36___default.a; parser.parser.yy = _diagrams_user_journey_journeyDb__WEBPACK_IMPORTED_MODULE_37__["default"]; break; - - case 'requirement': - case 'requirementDiagram': - _logger__WEBPACK_IMPORTED_MODULE_41__["log"].debug('RequirementDiagram'); - parser = _diagrams_requirement_parser_requirementDiagram__WEBPACK_IMPORTED_MODULE_27___default.a; - parser.parser.yy = _diagrams_requirement_requirementDb__WEBPACK_IMPORTED_MODULE_28__["default"]; - break; } parser.parser.yy.graphType = graphType; @@ -128286,12 +126207,12 @@ var decodeEntities = function decodeEntities(text) { */ var render = function render(id, _txt, cb, container) { - _config__WEBPACK_IMPORTED_MODULE_3__["reset"](); + _config__WEBPACK_IMPORTED_MODULE_39__["reset"](); var txt = _txt; - var graphInit = _utils__WEBPACK_IMPORTED_MODULE_44__["default"].detectInit(txt); + var graphInit = _utils__WEBPACK_IMPORTED_MODULE_4__["default"].detectInit(txt); if (graphInit) { - _config__WEBPACK_IMPORTED_MODULE_3__["addDirective"](graphInit); + _config__WEBPACK_IMPORTED_MODULE_39__["addDirective"](graphInit); } // else { // configApi.reset(); // const siteConfig = configApi.getSiteConfig(); @@ -128300,7 +126221,13 @@ var render = function render(id, _txt, cb, container) { // console.warn('Render fetching config'); - var cnf = _config__WEBPACK_IMPORTED_MODULE_3__["getConfig"](); // Check the maximum allowed text size + var cnf = _config__WEBPACK_IMPORTED_MODULE_39__["getConfig"](); // console.warn('Render with config after adding new directives', cnf.sequence); + // console.warn( + // 'Render with config after adding new directives', + // cnf.fontFamily, + // cnf.themeVariables.fontFamily + // ); + // Check the maximum allowed text size if (_txt.length > cnf.maxTextSize) { txt = 'graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa'; @@ -128308,7 +126235,7 @@ var render = function render(id, _txt, cb, container) { if (typeof container !== 'undefined') { container.innerHTML = ''; - Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])(container).append('div').attr('id', 'd' + id).attr('style', 'font-family: ' + cnf.fontFamily).append('svg').attr('id', id).attr('width', '100%').attr('xmlns', 'http://www.w3.org/2000/svg').append('g'); + Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])(container).append('div').attr('id', 'd' + id).attr('style', 'font-family: ' + cnf.fontFamily).append('svg').attr('id', id).attr('width', '100%').attr('xmlns', 'http://www.w3.org/2000/svg').append('g'); } else { var existingSvg = document.getElementById(id); @@ -128322,13 +126249,13 @@ var render = function render(id, _txt, cb, container) { _element.remove(); } - Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('body').append('div').attr('id', 'd' + id).append('svg').attr('id', id).attr('width', '100%').attr('xmlns', 'http://www.w3.org/2000/svg').append('g'); + Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('body').append('div').attr('id', 'd' + id).append('svg').attr('id', id).attr('width', '100%').attr('xmlns', 'http://www.w3.org/2000/svg').append('g'); } window.txt = txt; txt = encodeEntities(txt); - var element = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#d' + id).node(); - var graphType = _utils__WEBPACK_IMPORTED_MODULE_44__["default"].detectType(txt, cnf); // insert inline style into svg + var element = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('#d' + id).node(); + var graphType = _utils__WEBPACK_IMPORTED_MODULE_4__["default"].detectType(txt); // insert inline style into svg var svg = element.firstChild; var firstChild = svg.firstChild; @@ -128350,30 +126277,20 @@ var render = function render(id, _txt, cb, container) { if (graphType === 'flowchart' || graphType === 'flowchart-v2' || graphType === 'graph') { - var classes = _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_12__["default"].getClasses(txt); - var htmlLabels = cnf.htmlLabels || cnf.flowchart.htmlLabels; + var classes = _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_5__["default"].getClasses(txt); for (var className in classes) { - if (htmlLabels) { - userStyles += "\n.".concat(className, " > * { ").concat(classes[className].styles.join(' !important; '), " !important; }"); - userStyles += "\n.".concat(className, " span { ").concat(classes[className].styles.join(' !important; '), " !important; }"); - } else { - userStyles += "\n.".concat(className, " path { ").concat(classes[className].styles.join(' !important; '), " !important; }"); - userStyles += "\n.".concat(className, " rect { ").concat(classes[className].styles.join(' !important; '), " !important; }"); - userStyles += "\n.".concat(className, " polygon { ").concat(classes[className].styles.join(' !important; '), " !important; }"); - userStyles += "\n.".concat(className, " ellipse { ").concat(classes[className].styles.join(' !important; '), " !important; }"); - userStyles += "\n.".concat(className, " circle { ").concat(classes[className].styles.join(' !important; '), " !important; }"); + userStyles += "\n.".concat(className, " > * { ").concat(classes[className].styles.join(' !important; '), " !important; }"); - if (classes[className].textStyles) { - userStyles += "\n.".concat(className, " tspan { ").concat(classes[className].textStyles.join(' !important; '), " !important; }"); - } + if (classes[className].textStyles) { + userStyles += "\n.".concat(className, " tspan { ").concat(classes[className].textStyles.join(' !important; '), " !important; }"); } } - } // log.warn(cnf.themeVariables); + } // logger.warn(cnf.themeVariables); - var stylis = new stylis__WEBPACK_IMPORTED_MODULE_1___default.a(); - var rules = stylis("#".concat(id), Object(_styles__WEBPACK_IMPORTED_MODULE_42__["default"])(graphType, userStyles, cnf.themeVariables)); + var stylis = new stylis__WEBPACK_IMPORTED_MODULE_0___default.a(); + var rules = stylis("#".concat(id), Object(_styles__WEBPACK_IMPORTED_MODULE_40__["default"])(graphType, userStyles, cnf.themeVariables)); var style1 = document.createElement('style'); style1.innerHTML = rules; svg.insertBefore(style1, firstChild); // Verify that the generated svgs are ok before removing this @@ -128391,20 +126308,20 @@ var render = function render(id, _txt, cb, container) { switch (graphType) { case 'git': cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_19__["default"].setConf(cnf.git); - _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_19__["default"].draw(txt, id, false); + _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_23__["default"].setConf(cnf.git); + _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_23__["default"].draw(txt, id, false); break; case 'flowchart': cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_12__["default"].setConf(cnf.flowchart); - _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_12__["default"].draw(txt, id, false); + _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_5__["default"].setConf(cnf.flowchart); + _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_5__["default"].draw(txt, id, false); break; case 'flowchart-v2': cnf.flowchart.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - _diagrams_flowchart_flowRenderer_v2__WEBPACK_IMPORTED_MODULE_13__["default"].setConf(cnf.flowchart); - _diagrams_flowchart_flowRenderer_v2__WEBPACK_IMPORTED_MODULE_13__["default"].draw(txt, id, false); + _diagrams_flowchart_flowRenderer_v2__WEBPACK_IMPORTED_MODULE_6__["default"].setConf(cnf.flowchart); + _diagrams_flowchart_flowRenderer_v2__WEBPACK_IMPORTED_MODULE_6__["default"].draw(txt, id, false); break; case 'sequence': @@ -128412,79 +126329,74 @@ var render = function render(id, _txt, cb, container) { if (cnf.sequenceDiagram) { // backwards compatibility - _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_32__["default"].setConf(Object.assign(cnf.sequence, cnf.sequenceDiagram)); + _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].setConf(Object.assign(cnf.sequence, cnf.sequenceDiagram)); console.error('`mermaid config.sequenceDiagram` has been renamed to `config.sequence`. Please update your mermaid config.'); } else { - _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_32__["default"].setConf(cnf.sequence); + _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].setConf(cnf.sequence); } - _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_32__["default"].draw(txt, id); + _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].draw(txt, id); break; case 'gantt': cnf.gantt.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_16__["default"].setConf(cnf.gantt); - _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_16__["default"].draw(txt, id); + _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__["default"].setConf(cnf.gantt); + _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__["default"].draw(txt, id); break; case 'class': cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_5__["default"].setConf(cnf.class); - _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_5__["default"].draw(txt, id); + _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__["default"].setConf(cnf.class); + _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__["default"].draw(txt, id); break; case 'classDiagram': cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - _diagrams_class_classRenderer_v2__WEBPACK_IMPORTED_MODULE_6__["default"].setConf(cnf.class); - _diagrams_class_classRenderer_v2__WEBPACK_IMPORTED_MODULE_6__["default"].draw(txt, id); + _diagrams_class_classRenderer_v2__WEBPACK_IMPORTED_MODULE_16__["default"].setConf(cnf.class); + _diagrams_class_classRenderer_v2__WEBPACK_IMPORTED_MODULE_16__["default"].draw(txt, id); break; case 'state': cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_35__["default"].setConf(cnf.state); - _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_35__["default"].draw(txt, id); + _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_19__["default"].setConf(cnf.state); + _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_19__["default"].draw(txt, id); break; case 'stateDiagram': cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - _diagrams_state_stateRenderer_v2__WEBPACK_IMPORTED_MODULE_36__["default"].setConf(cnf.state); - _diagrams_state_stateRenderer_v2__WEBPACK_IMPORTED_MODULE_36__["default"].draw(txt, id); + _diagrams_state_stateRenderer_v2__WEBPACK_IMPORTED_MODULE_20__["default"].setConf(cnf.state); + _diagrams_state_stateRenderer_v2__WEBPACK_IMPORTED_MODULE_20__["default"].draw(txt, id); break; case 'info': cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_22__["default"].setConf(cnf.class); - _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_22__["default"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version); + _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_26__["default"].setConf(cnf.class); + _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_26__["default"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version); break; case 'pie': - //cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; - //pieRenderer.setConf(cnf.pie); - _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_26__["default"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version); + cnf.class.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute; + _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_30__["default"].setConf(cnf.pie); + _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_30__["default"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version); break; case 'er': - _diagrams_er_erRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].setConf(cnf.er); - _diagrams_er_erRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version); + _diagrams_er_erRenderer__WEBPACK_IMPORTED_MODULE_35__["default"].setConf(cnf.er); + _diagrams_er_erRenderer__WEBPACK_IMPORTED_MODULE_35__["default"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version); break; case 'journey': _diagrams_user_journey_journeyRenderer__WEBPACK_IMPORTED_MODULE_38__["default"].setConf(cnf.journey); _diagrams_user_journey_journeyRenderer__WEBPACK_IMPORTED_MODULE_38__["default"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version); break; - - case 'requirement': - _diagrams_requirement_requirementRenderer__WEBPACK_IMPORTED_MODULE_29__["default"].setConf(cnf.requirement); - _diagrams_requirement_requirementRenderer__WEBPACK_IMPORTED_MODULE_29__["default"].draw(txt, id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version); - break; } } catch (e) { // errorRenderer.setConf(cnf.class); - _errorRenderer__WEBPACK_IMPORTED_MODULE_40__["default"].draw(id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version); + _errorRenderer__WEBPACK_IMPORTED_MODULE_27__["default"].draw(id, _package_json__WEBPACK_IMPORTED_MODULE_2__.version); throw e; } - Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])("[id=\"".concat(id, "\"]")).selectAll('foreignobject > *').attr('xmlns', 'http://www.w3.org/1999/xhtml'); // if (cnf.arrowMarkerAbsolute) { + Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])("[id=\"".concat(id, "\"]")).selectAll('foreignobject > *').attr('xmlns', 'http://www.w3.org/1999/xhtml'); // if (cnf.arrowMarkerAbsolute) { // url = // window.location.protocol + // '//' + @@ -128496,44 +126408,42 @@ var render = function render(id, _txt, cb, container) { // } // Fix for when the base tag is used - var svgCode = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#d' + id).node().innerHTML; - _logger__WEBPACK_IMPORTED_MODULE_41__["log"].debug('cnf.arrowMarkerAbsolute', cnf.arrowMarkerAbsolute); + var svgCode = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('#d' + id).node().innerHTML; + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('cnf.arrowMarkerAbsolute', cnf.arrowMarkerAbsolute); if (!cnf.arrowMarkerAbsolute || cnf.arrowMarkerAbsolute === 'false') { svgCode = svgCode.replace(/marker-end="url\(.*?#/g, 'marker-end="url(#', 'g'); } - svgCode = decodeEntities(svgCode); // Fix for when the br tag is used - - svgCode = svgCode.replace(/
/g, '
'); + svgCode = decodeEntities(svgCode); if (typeof cb !== 'undefined') { switch (graphType) { case 'flowchart': case 'flowchart-v2': - cb(svgCode, _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_11__["default"].bindFunctions); + cb(svgCode, _diagrams_flowchart_flowDb__WEBPACK_IMPORTED_MODULE_8__["default"].bindFunctions); break; case 'gantt': - cb(svgCode, _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_15__["default"].bindFunctions); + cb(svgCode, _diagrams_gantt_ganttDb__WEBPACK_IMPORTED_MODULE_14__["default"].bindFunctions); break; case 'class': case 'classDiagram': - cb(svgCode, _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_4__["default"].bindFunctions); + cb(svgCode, _diagrams_class_classDb__WEBPACK_IMPORTED_MODULE_18__["default"].bindFunctions); break; default: cb(svgCode); } } else { - _logger__WEBPACK_IMPORTED_MODULE_41__["log"].debug('CB = undefined!'); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('CB = undefined!'); } - var node = Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#d' + id).node(); + var node = Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('#d' + id).node(); if (node !== null && typeof node.remove === 'function') { - Object(d3__WEBPACK_IMPORTED_MODULE_0__["select"])('#d' + id).node().remove(); + Object(d3__WEBPACK_IMPORTED_MODULE_1__["select"])('#d' + id).node().remove(); } return svgCode; @@ -128566,13 +126476,13 @@ var parseDirective = function parseDirective(p, statement, context, type) { } } } catch (error) { - _logger__WEBPACK_IMPORTED_MODULE_41__["log"].error("Error while rendering sequenceDiagram directive: ".concat(statement, " jison context: ").concat(context)); - _logger__WEBPACK_IMPORTED_MODULE_41__["log"].error(error.message); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error("Error while rendering sequenceDiagram directive: ".concat(statement, " jison context: ").concat(context)); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error(error.message); } }; var handleDirective = function handleDirective(p, directive, type) { - _logger__WEBPACK_IMPORTED_MODULE_41__["log"].debug("Directive type=".concat(directive.type, " with args:"), directive.args); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug("Directive type=".concat(directive.type, " with args:"), directive.args); switch (directive.type) { case 'init': @@ -128589,7 +126499,7 @@ var handleDirective = function handleDirective(p, directive, type) { } }); reinitialize(directive.args); - _config__WEBPACK_IMPORTED_MODULE_3__["addDirective"](directive.args); + _config__WEBPACK_IMPORTED_MODULE_39__["addDirective"](directive.args); break; } @@ -128602,32 +126512,30 @@ var handleDirective = function handleDirective(p, directive, type) { break; default: - _logger__WEBPACK_IMPORTED_MODULE_41__["log"].warn("Unhandled directive: source: '%%{".concat(directive.type, ": ").concat(JSON.stringify(directive.args ? directive.args : {}), "}%%"), directive); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].warn("Unhandled directive: source: '%%{".concat(directive.type, ": ").concat(JSON.stringify(directive.args ? directive.args : {}), "}%%"), directive); break; } }; function updateRendererConfigs(conf) { - // Todo remove, all diagrams should get config on demoand from the config object, no need for this - _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_19__["default"].setConf(conf.git); - _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_12__["default"].setConf(conf.flowchart); - _diagrams_flowchart_flowRenderer_v2__WEBPACK_IMPORTED_MODULE_13__["default"].setConf(conf.flowchart); + _diagrams_git_gitGraphRenderer__WEBPACK_IMPORTED_MODULE_23__["default"].setConf(conf.git); + _diagrams_flowchart_flowRenderer__WEBPACK_IMPORTED_MODULE_5__["default"].setConf(conf.flowchart); + _diagrams_flowchart_flowRenderer_v2__WEBPACK_IMPORTED_MODULE_6__["default"].setConf(conf.flowchart); if (typeof conf['sequenceDiagram'] !== 'undefined') { - _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_32__["default"].setConf(Object(_utils__WEBPACK_IMPORTED_MODULE_44__["assignWithDepth"])(conf.sequence, conf['sequenceDiagram'])); + _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].setConf(Object(_utils__WEBPACK_IMPORTED_MODULE_4__["assignWithDepth"])(conf.sequence, conf['sequenceDiagram'])); } - _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_32__["default"].setConf(conf.sequence); - _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_16__["default"].setConf(conf.gantt); - _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_5__["default"].setConf(conf.class); - _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_35__["default"].setConf(conf.state); - _diagrams_state_stateRenderer_v2__WEBPACK_IMPORTED_MODULE_36__["default"].setConf(conf.state); - _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_22__["default"].setConf(conf.class); // pieRenderer.setConf(conf.class); - - _diagrams_er_erRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].setConf(conf.er); + _diagrams_sequence_sequenceRenderer__WEBPACK_IMPORTED_MODULE_9__["default"].setConf(conf.sequence); + _diagrams_gantt_ganttRenderer__WEBPACK_IMPORTED_MODULE_12__["default"].setConf(conf.gantt); + _diagrams_class_classRenderer__WEBPACK_IMPORTED_MODULE_15__["default"].setConf(conf.class); + _diagrams_state_stateRenderer__WEBPACK_IMPORTED_MODULE_19__["default"].setConf(conf.state); + _diagrams_state_stateRenderer_v2__WEBPACK_IMPORTED_MODULE_20__["default"].setConf(conf.state); + _diagrams_info_infoRenderer__WEBPACK_IMPORTED_MODULE_26__["default"].setConf(conf.class); + _diagrams_pie_pieRenderer__WEBPACK_IMPORTED_MODULE_30__["default"].setConf(conf.class); + _diagrams_er_erRenderer__WEBPACK_IMPORTED_MODULE_35__["default"].setConf(conf.er); _diagrams_user_journey_journeyRenderer__WEBPACK_IMPORTED_MODULE_38__["default"].setConf(conf.journey); - _diagrams_requirement_requirementRenderer__WEBPACK_IMPORTED_MODULE_29__["default"].setConf(conf.requirement); - _errorRenderer__WEBPACK_IMPORTED_MODULE_40__["default"].setConf(conf.class); + _errorRenderer__WEBPACK_IMPORTED_MODULE_27__["default"].setConf(conf.class); } function reinitialize() {// `mermaidAPI.reinitialize: v${pkg.version}`, @@ -128641,7 +126549,7 @@ function reinitialize() {// `mermaidAPI.reinitialize: v${pkg.version}`, // typeof options === 'object' ? configApi.setConfig(options) : configApi.getSiteConfig(); // updateRendererConfigs(config); // setLogLevel(config.logLevel); - // log.debug('mermaidAPI.reinitialize: ', config); + // logger.debug('mermaidAPI.reinitialize: ', config); } function initialize(options) { @@ -128662,18 +126570,18 @@ function initialize(options) { } // Set default options - _config__WEBPACK_IMPORTED_MODULE_3__["saveConfigFromInitilize"](options); + _config__WEBPACK_IMPORTED_MODULE_39__["setSiteConfigDelta"](options); - if (options && options.theme && _themes__WEBPACK_IMPORTED_MODULE_43__["default"][options.theme]) { + if (options && options.theme && _themes__WEBPACK_IMPORTED_MODULE_41__["default"][options.theme]) { // Todo merge with user options - options.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_43__["default"][options.theme].getThemeVariables(options.themeVariables); + options.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_41__["default"][options.theme].getThemeVariables(options.themeVariables); } else { - if (options) options.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_43__["default"].default.getThemeVariables(options.themeVariables); + if (options) options.themeVariables = _themes__WEBPACK_IMPORTED_MODULE_41__["default"].default.getThemeVariables(options.themeVariables); } - var config = _typeof(options) === 'object' ? _config__WEBPACK_IMPORTED_MODULE_3__["setSiteConfig"](options) : _config__WEBPACK_IMPORTED_MODULE_3__["getSiteConfig"](); + var config = _typeof(options) === 'object' ? _config__WEBPACK_IMPORTED_MODULE_39__["setSiteConfig"](options) : _config__WEBPACK_IMPORTED_MODULE_39__["getSiteConfig"](); updateRendererConfigs(config); - Object(_logger__WEBPACK_IMPORTED_MODULE_41__["setLogLevel"])(config.logLevel); // log.debug('mermaidAPI.initialize: ', config); + Object(_logger__WEBPACK_IMPORTED_MODULE_3__["setLogLevel"])(config.logLevel); // logger.debug('mermaidAPI.initialize: ', config); } var mermaidAPI = Object.freeze({ @@ -128682,23 +126590,23 @@ var mermaidAPI = Object.freeze({ parseDirective: parseDirective, initialize: initialize, reinitialize: reinitialize, - getConfig: _config__WEBPACK_IMPORTED_MODULE_3__["getConfig"], - setConfig: _config__WEBPACK_IMPORTED_MODULE_3__["setConfig"], - getSiteConfig: _config__WEBPACK_IMPORTED_MODULE_3__["getSiteConfig"], - updateSiteConfig: _config__WEBPACK_IMPORTED_MODULE_3__["updateSiteConfig"], + getConfig: _config__WEBPACK_IMPORTED_MODULE_39__["getConfig"], + setConfig: _config__WEBPACK_IMPORTED_MODULE_39__["setConfig"], + getSiteConfig: _config__WEBPACK_IMPORTED_MODULE_39__["getSiteConfig"], + updateSiteConfig: _config__WEBPACK_IMPORTED_MODULE_39__["updateSiteConfig"], reset: function reset() { // console.warn('reset'); - _config__WEBPACK_IMPORTED_MODULE_3__["reset"](); // const siteConfig = configApi.getSiteConfig(); + _config__WEBPACK_IMPORTED_MODULE_39__["reset"](); // const siteConfig = configApi.getSiteConfig(); // updateRendererConfigs(siteConfig); }, globalReset: function globalReset() { - _config__WEBPACK_IMPORTED_MODULE_3__["reset"](_config__WEBPACK_IMPORTED_MODULE_3__["defaultConfig"]); - updateRendererConfigs(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"]()); + _config__WEBPACK_IMPORTED_MODULE_39__["reset"](_config__WEBPACK_IMPORTED_MODULE_39__["defaultConfig"]); + updateRendererConfigs(_config__WEBPACK_IMPORTED_MODULE_39__["getConfig"]()); }, - defaultConfig: _config__WEBPACK_IMPORTED_MODULE_3__["defaultConfig"] + defaultConfig: _config__WEBPACK_IMPORTED_MODULE_39__["defaultConfig"] }); -Object(_logger__WEBPACK_IMPORTED_MODULE_41__["setLogLevel"])(_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"]().logLevel); -_config__WEBPACK_IMPORTED_MODULE_3__["reset"](_config__WEBPACK_IMPORTED_MODULE_3__["getConfig"]()); +Object(_logger__WEBPACK_IMPORTED_MODULE_3__["setLogLevel"])(_config__WEBPACK_IMPORTED_MODULE_39__["getConfig"]().logLevel); +_config__WEBPACK_IMPORTED_MODULE_39__["reset"](_config__WEBPACK_IMPORTED_MODULE_39__["getConfig"]()); /* harmony default export */ __webpack_exports__["default"] = (mermaidAPI); /** * ## mermaidAPI configuration defaults @@ -128726,7 +126634,7 @@ _config__WEBPACK_IMPORTED_MODULE_3__["reset"](_config__WEBPACK_IMPORTED_MODULE_3 * flowchart:{ * diagramPadding:8, * htmlLabels:true, - * curve:'basis', + * curve:'linear', * }, * sequence:{ * diagramMarginX:50, @@ -128756,7 +126664,6 @@ _config__WEBPACK_IMPORTED_MODULE_3__["reset"](_config__WEBPACK_IMPORTED_MODULE_3 * fontFamily:'"Open-Sans", "sans-serif"', * numberSectionStyles:4, * axisFormat:'%Y-%m-%d', - * topAxis:false, * } * }; * mermaid.initialize(config); @@ -128781,11 +126688,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var _diagrams_git_styles__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./diagrams/git/styles */ "./src/diagrams/git/styles.js"); /* harmony import */ var _diagrams_info_styles__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./diagrams/info/styles */ "./src/diagrams/info/styles.js"); /* harmony import */ var _diagrams_pie_styles__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./diagrams/pie/styles */ "./src/diagrams/pie/styles.js"); -/* harmony import */ var _diagrams_requirement_styles__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./diagrams/requirement/styles */ "./src/diagrams/requirement/styles.js"); -/* harmony import */ var _diagrams_sequence_styles__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./diagrams/sequence/styles */ "./src/diagrams/sequence/styles.js"); -/* harmony import */ var _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./diagrams/state/styles */ "./src/diagrams/state/styles.js"); -/* harmony import */ var _diagrams_user_journey_styles__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./diagrams/user-journey/styles */ "./src/diagrams/user-journey/styles.js"); - +/* harmony import */ var _diagrams_sequence_styles__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./diagrams/sequence/styles */ "./src/diagrams/sequence/styles.js"); +/* harmony import */ var _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./diagrams/state/styles */ "./src/diagrams/state/styles.js"); +/* harmony import */ var _diagrams_user_journey_styles__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./diagrams/user-journey/styles */ "./src/diagrams/user-journey/styles.js"); @@ -128799,19 +126704,18 @@ __webpack_require__.r(__webpack_exports__); var themes = { flowchart: _diagrams_flowchart_styles__WEBPACK_IMPORTED_MODULE_2__["default"], 'flowchart-v2': _diagrams_flowchart_styles__WEBPACK_IMPORTED_MODULE_2__["default"], - sequence: _diagrams_sequence_styles__WEBPACK_IMPORTED_MODULE_8__["default"], + sequence: _diagrams_sequence_styles__WEBPACK_IMPORTED_MODULE_7__["default"], gantt: _diagrams_gantt_styles__WEBPACK_IMPORTED_MODULE_3__["default"], classDiagram: _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_0__["default"], 'classDiagram-v2': _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_0__["default"], class: _diagrams_class_styles__WEBPACK_IMPORTED_MODULE_0__["default"], - stateDiagram: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_9__["default"], - state: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_9__["default"], + stateDiagram: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_8__["default"], + state: _diagrams_state_styles__WEBPACK_IMPORTED_MODULE_8__["default"], git: _diagrams_git_styles__WEBPACK_IMPORTED_MODULE_4__["default"], info: _diagrams_info_styles__WEBPACK_IMPORTED_MODULE_5__["default"], pie: _diagrams_pie_styles__WEBPACK_IMPORTED_MODULE_6__["default"], er: _diagrams_er_styles__WEBPACK_IMPORTED_MODULE_1__["default"], - journey: _diagrams_user_journey_styles__WEBPACK_IMPORTED_MODULE_10__["default"], - requirement: _diagrams_requirement_styles__WEBPACK_IMPORTED_MODULE_7__["default"] + journey: _diagrams_user_journey_styles__WEBPACK_IMPORTED_MODULE_9__["default"] }; var calcThemeVariables = function calcThemeVariables(theme, userOverRides) { return theme.calcColors(userOverRides); @@ -128819,7 +126723,7 @@ var calcThemeVariables = function calcThemeVariables(theme, userOverRides) { var getStyles = function getStyles(type, userStyles, options) { //console.warn('options in styles: ', options); - return " {\n font-family: ".concat(options.fontFamily, ";\n font-size: ").concat(options.fontSize, ";\n fill: ").concat(options.textColor, "\n }\n\n /* Classes common for multiple diagrams */\n\n .error-icon {\n fill: ").concat(options.errorBkgColor, ";\n }\n .error-text {\n fill: ").concat(options.errorTextColor, ";\n stroke: ").concat(options.errorTextColor, ";\n }\n\n .edge-thickness-normal {\n stroke-width: 2px;\n }\n .edge-thickness-thick {\n stroke-width: 3.5px\n }\n .edge-pattern-solid {\n stroke-dasharray: 0;\n }\n\n .edge-pattern-dashed{\n stroke-dasharray: 3;\n }\n .edge-pattern-dotted {\n stroke-dasharray: 2;\n }\n\n .marker {\n fill: ").concat(options.lineColor, ";\n stroke: ").concat(options.lineColor, ";\n }\n .marker.cross {\n stroke: ").concat(options.lineColor, ";\n }\n\n svg {\n font-family: ").concat(options.fontFamily, ";\n font-size: ").concat(options.fontSize, ";\n }\n\n ").concat(themes[type](options), "\n\n ").concat(userStyles, "\n"); + return " {\n font-family: ".concat(options.fontFamily, ";\n font-size: ").concat(options.fontSize, ";\n fill: ").concat(options.textColor, "\n }\n\n /* Classes common for multiple diagrams */\n\n .error-icon {\n fill: ").concat(options.errorBkgColor, ";\n }\n .error-text {\n fill: ").concat(options.errorTextColor, ";\n stroke: ").concat(options.errorTextColor, ";\n }\n\n .edge-thickness-normal {\n stroke-width: 2px;\n }\n .edge-thickness-thick {\n stroke-width: 3.5px\n }\n .edge-pattern-solid {\n stroke-dasharray: 0;\n }\n\n .edge-pattern-dashed{\n stroke-dasharray: 3;\n }\n .edge-pattern-dotted {\n stroke-dasharray: 2;\n }\n\n .marker {\n fill: ").concat(options.lineColor, ";\n }\n .marker.cross {\n stroke: ").concat(options.lineColor, ";\n }\n\n svg {\n font-family: ").concat(options.fontFamily, ";\n font-size: ").concat(options.fontSize, ";\n }\n\n ").concat(themes[type](options), "\n\n ").concat(userStyles, "\n\n ").concat(type, " { fill: apa;}\n"); }; /* harmony default export */ __webpack_exports__["default"] = (getStyles); @@ -128936,8 +126840,6 @@ function () { this.secondaryBorderColor = this.secondaryBorderColor || Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.secondaryColor, this.darkMode); this.tertiaryBorderColor = this.tertiaryBorderColor || Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.tertiaryColor, this.darkMode); this.noteBorderColor = this.noteBorderColor || Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.noteBkgColor, this.darkMode); - this.noteBkgColor = this.noteBkgColor || '#fff5ad'; - this.noteTextColor = this.noteTextColor || '#333'; this.secondaryTextColor = this.secondaryTextColor || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.secondaryColor); this.tertiaryTextColor = this.tertiaryTextColor || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.tertiaryColor); this.lineColor = this.lineColor || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.background); @@ -128993,22 +126895,10 @@ function () { this.taskTextClickableColor = this.taskTextClickableColor || '#003163'; /* state colors */ - this.transitionColor = this.transitionColor || this.lineColor; - this.transitionLabelColor = this.transitionLabelColor || this.textColor; - /* The color of the text tables of the tstates*/ - - this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; - this.stateBkg = this.stateBkg || this.mainBkg; - this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; - this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; + this.labelColor = this.labelColor || this.primaryTextColor; this.altBackground = this.altBackground || this.tertiaryColor; - this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; - this.compositeBorder = this.compositeBorder || this.nodeBorder; - this.innerEndBackground = this.nodeBorder; this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; - this.transitionColor = this.transitionColor || this.lineColor; - this.specialStateColor = this.lineColor; /* class */ this.classText = this.classText || this.textColor; @@ -129034,62 +126924,6 @@ function () { this.fillType7 = this.fillType7 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { h: 128 }); - /* pie */ - - this.pie1 = this.pie1 || this.primaryColor; - this.pie2 = this.pie2 || this.secondaryColor; - this.pie3 = this.pie3 || this.tertiaryColor; - this.pie4 = this.pie4 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - l: -10 - }); - this.pie5 = this.pie5 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - l: -10 - }); - this.pie6 = this.pie6 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.tertiaryColor, { - l: -10 - }); - this.pie7 = this.pie7 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: +60, - l: -10 - }); - this.pie8 = this.pie8 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: -60, - l: -10 - }); - this.pie9 = this.pie9 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 120, - l: 0 - }); - this.pie10 = this.pie10 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: +60, - l: -20 - }); - this.pie11 = this.pie11 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: -60, - l: -20 - }); - this.pie12 = this.pie12 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 120, - l: -10 - }); - this.pieTitleTextSize = this.pieTitleTextSize || '25px'; - this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; - this.pieSectionTextSize = this.pieSectionTextSize || '17px'; - this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; - this.pieLegendTextSize = this.pieLegendTextSize || '17px'; - this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; - this.pieStrokeColor = this.pieStrokeColor || 'black'; - this.pieStrokeWidth = this.pieStrokeWidth || '2px'; - this.pieOpacity = this.pieOpacity || '0.7'; - /* requirement-diagram */ - - this.requirementBackground = this.requirementBackground || this.primaryColor; - this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; - this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; - this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; - this.relationColor = this.relationColor || this.lineColor; - this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? Object(khroma__WEBPACK_IMPORTED_MODULE_0__["darken"])(this.secondaryColor, 30) : this.secondaryColor); - this.relationLabelColor = this.relationLabelColor || this.actorTextColor; } }, { key: "calculate", @@ -129260,9 +127094,8 @@ function () { this.labelBoxBorderColor = this.actorBorder; this.labelTextColor = this.mainContrastColor; this.loopTextColor = this.mainContrastColor; - this.noteBorderColor = this.secondaryBorderColor; - this.noteBkgColor = this.secondBkg; - this.noteTextColor = this.secondaryTextColor; + this.noteBorderColor = this.border2; + this.noteTextColor = this.mainBkg; this.activationBorderColor = this.border1; this.activationBkgColor = this.secondBkg; /* Gantt chart variables */ @@ -129277,292 +127110,8 @@ function () { this.taskTextDarkColor = this.darkTextColor; /* state colors */ - this.transitionColor = this.transitionColor || this.lineColor; - this.transitionLabelColor = this.transitionLabelColor || this.textColor; - this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; - this.stateBkg = this.stateBkg || this.mainBkg; - this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; - this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; - this.altBackground = this.altBackground || '#555'; - this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; - this.compositeBorder = this.compositeBorder || this.nodeBorder; - this.innerEndBackground = this.primaryBorderColor; - this.specialStateColor = '#f4f4f4'; // this.lineColor; - - this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; - this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; - this.fillType0 = this.primaryColor; - this.fillType1 = this.secondaryColor; - this.fillType2 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 64 - }); - this.fillType3 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - h: 64 - }); - this.fillType4 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: -64 - }); - this.fillType5 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - h: -64 - }); - this.fillType6 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 128 - }); - this.fillType7 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - h: 128 - }); - /* pie */ - - this.pie1 = this.pie1 || '#0b0000'; - this.pie2 = this.pie2 || '#4d1037'; - this.pie3 = this.pie3 || '#3f5258'; - this.pie4 = this.pie4 || '#4f2f1b'; - this.pie5 = this.pie5 || '#6e0a0a'; - this.pie6 = this.pie6 || '#3b0048'; - this.pie7 = this.pie7 || '#995a01'; - this.pie8 = this.pie8 || '#154706'; - this.pie9 = this.pie9 || '#161722'; - this.pie10 = this.pie10 || '#00296f'; - this.pie11 = this.pie11 || '#01629c'; - this.pie12 = this.pie12 || '#010029'; - this.pieTitleTextSize = this.pieTitleTextSize || '25px'; - this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; - this.pieSectionTextSize = this.pieSectionTextSize || '17px'; - this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; - this.pieLegendTextSize = this.pieLegendTextSize || '17px'; - this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; - this.pieStrokeColor = this.pieStrokeColor || 'black'; - this.pieStrokeWidth = this.pieStrokeWidth || '2px'; - this.pieOpacity = this.pieOpacity || '0.7'; - /* class */ - - this.classText = this.primaryTextColor; - /* requirement-diagram */ - - this.requirementBackground = this.requirementBackground || this.primaryColor; - this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; - this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; - this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; - this.relationColor = this.relationColor || this.lineColor; - this.relationLabelBackground = this.relationLabelBackground || (this.darkMode ? Object(khroma__WEBPACK_IMPORTED_MODULE_0__["darken"])(this.secondaryColor, 30) : this.secondaryColor); - this.relationLabelColor = this.relationLabelColor || this.actorTextColor; - } - }, { - key: "calculate", - value: function calculate(overrides) { - var _this = this; - - if (_typeof(overrides) !== 'object') { - // Calculate colors form base colors - this.updateColors(); - return; - } - - var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors - - keys.forEach(function (k) { - _this[k] = overrides[k]; - }); // Calculate colors form base colors - - this.updateColors(); // Copy values from overrides again in case of an override of derived value - - keys.forEach(function (k) { - _this[k] = overrides[k]; - }); - } - }]); - - return Theme; -}(); - -var getThemeVariables = function getThemeVariables(userOverrides) { - var theme = new Theme(); - theme.calculate(userOverrides); - return theme; -}; - -/***/ }), - -/***/ "./src/themes/theme-default.js": -/*!*************************************!*\ - !*** ./src/themes/theme-default.js ***! - \*************************************/ -/*! exports provided: getThemeVariables */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getThemeVariables", function() { return getThemeVariables; }); -/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "khroma"); -/* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); -function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } - -function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } - - - - -var Theme = -/*#__PURE__*/ -function () { - function Theme() { - _classCallCheck(this, Theme); - - /* Base variables */ - this.background = '#f4f4f4'; - this.primaryColor = '#ECECFF'; - this.secondaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 120 - }); - this.secondaryColor = '#ffffde'; - this.tertiaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: -160 - }); - this.primaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.primaryColor, this.darkMode); - this.secondaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.secondaryColor, this.darkMode); - this.tertiaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.tertiaryColor, this.darkMode); // this.noteBorderColor = mkBorder(this.noteBkgColor, this.darkMode); - - this.primaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.primaryColor); - this.secondaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.secondaryColor); - this.tertiaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.tertiaryColor); - this.lineColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.background); - this.textColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.background); - this.background = 'white'; - this.mainBkg = '#ECECFF'; - this.secondBkg = '#ffffde'; - this.lineColor = '#333333'; - this.border1 = '#9370DB'; - this.border2 = '#aaaa33'; - this.arrowheadColor = '#333333'; - this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; - this.fontSize = '16px'; - this.labelBackground = '#e8e8e8'; - this.textColor = '#333'; - /* Flowchart variables */ - - this.nodeBkg = 'calculated'; - this.nodeBorder = 'calculated'; - this.clusterBkg = 'calculated'; - this.clusterBorder = 'calculated'; - this.defaultLinkColor = 'calculated'; - this.titleColor = 'calculated'; - this.edgeLabelBackground = 'calculated'; - /* Sequence Diagram variables */ - - this.actorBorder = 'calculated'; - this.actorBkg = 'calculated'; - this.actorTextColor = 'black'; - this.actorLineColor = 'grey'; - this.signalColor = 'calculated'; - this.signalTextColor = 'calculated'; - this.labelBoxBkgColor = 'calculated'; - this.labelBoxBorderColor = 'calculated'; - this.labelTextColor = 'calculated'; - this.loopTextColor = 'calculated'; - this.noteBorderColor = 'calculated'; - this.noteBkgColor = '#fff5ad'; - this.noteTextColor = 'calculated'; - this.activationBorderColor = '#666'; - this.activationBkgColor = '#f4f4f4'; - this.sequenceNumberColor = 'white'; - /* Gantt chart variables */ - - this.sectionBkgColor = 'calculated'; - this.altSectionBkgColor = 'calculated'; - this.sectionBkgColor2 = 'calculated'; - this.taskBorderColor = 'calculated'; - this.taskBkgColor = 'calculated'; - this.taskTextLightColor = 'calculated'; - this.taskTextColor = this.taskTextLightColor; - this.taskTextDarkColor = 'calculated'; - this.taskTextOutsideColor = this.taskTextDarkColor; - this.taskTextClickableColor = 'calculated'; - this.activeTaskBorderColor = 'calculated'; - this.activeTaskBkgColor = 'calculated'; - this.gridColor = 'calculated'; - this.doneTaskBkgColor = 'calculated'; - this.doneTaskBorderColor = 'calculated'; - this.critBorderColor = 'calculated'; - this.critBkgColor = 'calculated'; - this.todayLineColor = 'calculated'; - this.sectionBkgColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["rgba"])(102, 102, 255, 0.49); - this.altSectionBkgColor = 'white'; - this.sectionBkgColor2 = '#fff400'; - this.taskBorderColor = '#534fbc'; - this.taskBkgColor = '#8a90dd'; - this.taskTextLightColor = 'white'; - this.taskTextColor = 'calculated'; - this.taskTextDarkColor = 'black'; - this.taskTextOutsideColor = 'calculated'; - this.taskTextClickableColor = '#003163'; - this.activeTaskBorderColor = '#534fbc'; - this.activeTaskBkgColor = '#bfc7ff'; - this.gridColor = 'lightgrey'; - this.doneTaskBkgColor = 'lightgrey'; - this.doneTaskBorderColor = 'grey'; - this.critBorderColor = '#ff8888'; - this.critBkgColor = 'red'; - this.todayLineColor = 'red'; - /* state colors */ - - this.labelColor = 'black'; - this.errorBkgColor = '#552222'; - this.errorTextColor = '#552222'; - this.updateColors(); - } - - _createClass(Theme, [{ - key: "updateColors", - value: function updateColors() { - /* Flowchart variables */ - this.nodeBkg = this.mainBkg; - this.nodeBorder = this.border1; // border 1 - - this.clusterBkg = this.secondBkg; - this.clusterBorder = this.border2; - this.defaultLinkColor = this.lineColor; - this.titleColor = this.textColor; - this.edgeLabelBackground = this.labelBackground; - /* Sequence Diagram variables */ - // this.actorBorder = lighten(this.border1, 0.5); - - this.actorBorder = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(this.border1, 23); - this.actorBkg = this.mainBkg; - this.labelBoxBkgColor = this.actorBkg; - this.signalColor = this.textColor; - this.signalTextColor = this.textColor; - this.labelBoxBorderColor = this.actorBorder; - this.labelTextColor = this.actorTextColor; - this.loopTextColor = this.actorTextColor; - this.noteBorderColor = this.border2; - this.noteTextColor = this.actorTextColor; - /* Gantt chart variables */ - - this.taskTextColor = this.taskTextLightColor; - this.taskTextOutsideColor = this.taskTextDarkColor; - /* state colors */ - - this.transitionColor = this.transitionColor || this.lineColor; - this.transitionLabelColor = this.transitionLabelColor || this.textColor; - this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; - this.stateBkg = this.stateBkg || this.mainBkg; - this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; - this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; - this.altBackground = this.altBackground || '#f0f0f0'; - this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; - this.compositeBorder = this.compositeBorder || this.nodeBorder; - this.innerEndBackground = this.nodeBorder; - this.specialStateColor = this.lineColor; - this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; - this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; - this.transitionColor = this.transitionColor || this.lineColor; - /* class */ - - this.classText = this.primaryTextColor; - /* journey */ - + this.labelColor = this.textColor; + this.altBackground = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(this.background, 20); this.fillType0 = this.primaryColor; this.fillType1 = this.secondaryColor; this.fillType2 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { @@ -129583,64 +127132,232 @@ function () { this.fillType7 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { h: 128 }); - /* pie */ + /* class */ - this.pie1 = this.pie1 || this.primaryColor; - this.pie2 = this.pie2 || this.secondaryColor; - this.pie3 = this.pie3 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.tertiaryColor, { - l: -40 - }); - this.pie4 = this.pie4 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - l: -10 - }); - this.pie5 = this.pie5 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - l: -30 - }); - this.pie6 = this.pie6 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.tertiaryColor, { - l: -20 + this.classText = this.primaryTextColor; + } + }, { + key: "calculate", + value: function calculate(overrides) { + var _this = this; + + if (_typeof(overrides) !== 'object') { + // Calculate colors form base colors + this.updateColors(); + return; + } + + var keys = Object.keys(overrides); // Copy values from overrides, this is mainly for base colors + + keys.forEach(function (k) { + _this[k] = overrides[k]; + }); // Calculate colors form base colors + + this.updateColors(); // Copy values from overrides again in case of an override of derived value + + keys.forEach(function (k) { + _this[k] = overrides[k]; }); - this.pie7 = this.pie7 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: +60, - l: -20 + } + }]); + + return Theme; +}(); + +var getThemeVariables = function getThemeVariables(userOverrides) { + var theme = new Theme(); + theme.calculate(userOverrides); + return theme; +}; + +/***/ }), + +/***/ "./src/themes/theme-default.js": +/*!*************************************!*\ + !*** ./src/themes/theme-default.js ***! + \*************************************/ +/*! exports provided: getThemeVariables */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getThemeVariables", function() { return getThemeVariables; }); +/* harmony import */ var khroma__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! khroma */ "khroma"); +/* harmony import */ var _theme_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./theme-helpers */ "./src/themes/theme-helpers.js"); +function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } + + + + +var Theme = +/*#__PURE__*/ +function () { + function Theme() { + _classCallCheck(this, Theme); + + /* Base variables */ + this.background = '#f4f4f4'; + this.primaryColor = '#ECECFF'; + this.secondaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { + h: 120 + }); + this.secondaryColor = '#ffffde'; + this.tertiaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { + h: -160 + }); + this.primaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.primaryColor, this.darkMode); + this.secondaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.secondaryColor, this.darkMode); + this.tertiaryBorderColor = Object(_theme_helpers__WEBPACK_IMPORTED_MODULE_1__["mkBorder"])(this.tertiaryColor, this.darkMode); // this.noteBorderColor = mkBorder(this.noteBkgColor, this.darkMode); + + this.primaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.primaryColor); + this.secondaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.secondaryColor); + this.tertiaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.tertiaryColor); + this.lineColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.background); + this.textColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.background); + this.background = 'white'; + this.mainBkg = '#ECECFF'; + this.secondBkg = '#ffffde'; + this.lineColor = '#333333'; + this.border1 = '#9370DB'; + this.border2 = '#aaaa33'; + this.arrowheadColor = '#333333'; + this.fontFamily = '"trebuchet ms", verdana, arial, sans-serif'; + this.fontSize = '16px'; + this.labelBackground = '#e8e8e8'; + this.textColor = '#333'; + /* Flowchart variables */ + + this.nodeBkg = 'calculated'; + this.nodeBorder = 'calculated'; + this.clusterBkg = 'calculated'; + this.clusterBorder = 'calculated'; + this.defaultLinkColor = 'calculated'; + this.titleColor = 'calculated'; + this.edgeLabelBackground = 'calculated'; + /* Sequence Diagram variables */ + + this.actorBorder = 'calculated'; + this.actorBkg = 'calculated'; + this.actorTextColor = 'black'; + this.actorLineColor = 'grey'; + this.signalColor = 'calculated'; + this.signalTextColor = 'calculated'; + this.labelBoxBkgColor = 'calculated'; + this.labelBoxBorderColor = 'calculated'; + this.labelTextColor = 'calculated'; + this.loopTextColor = 'calculated'; + this.noteBorderColor = 'calculated'; + this.noteBkgColor = '#fff5ad'; + this.noteTextColor = 'calculated'; + this.activationBorderColor = '#666'; + this.activationBkgColor = '#f4f4f4'; + this.sequenceNumberColor = 'white'; + /* Gantt chart variables */ + + this.sectionBkgColor = 'calculated'; + this.altSectionBkgColor = 'calculated'; + this.sectionBkgColor2 = 'calculated'; + this.taskBorderColor = 'calculated'; + this.taskBkgColor = 'calculated'; + this.taskTextLightColor = 'calculated'; + this.taskTextColor = this.taskTextLightColor; + this.taskTextDarkColor = 'calculated'; + this.taskTextOutsideColor = this.taskTextDarkColor; + this.taskTextClickableColor = 'calculated'; + this.activeTaskBorderColor = 'calculated'; + this.activeTaskBkgColor = 'calculated'; + this.gridColor = 'calculated'; + this.doneTaskBkgColor = 'calculated'; + this.doneTaskBorderColor = 'calculated'; + this.critBorderColor = 'calculated'; + this.critBkgColor = 'calculated'; + this.todayLineColor = 'calculated'; + this.sectionBkgColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["rgba"])(102, 102, 255, 0.49); + this.altSectionBkgColor = 'white'; + this.sectionBkgColor2 = '#fff400'; + this.taskBorderColor = '#534fbc'; + this.taskBkgColor = '#8a90dd'; + this.taskTextLightColor = 'white'; + this.taskTextColor = 'calculated'; + this.taskTextDarkColor = 'black'; + this.taskTextOutsideColor = 'calculated'; + this.taskTextClickableColor = '#003163'; + this.activeTaskBorderColor = '#534fbc'; + this.activeTaskBkgColor = '#bfc7ff'; + this.gridColor = 'lightgrey'; + this.doneTaskBkgColor = 'lightgrey'; + this.doneTaskBorderColor = 'grey'; + this.critBorderColor = '#ff8888'; + this.critBkgColor = 'red'; + this.todayLineColor = 'red'; + /* state colors */ + + this.labelColor = 'black'; + this.errorBkgColor = '#552222'; + this.errorTextColor = '#552222'; + this.updateColors(); + } + + _createClass(Theme, [{ + key: "updateColors", + value: function updateColors() { + /* Flowchart variables */ + this.nodeBkg = this.mainBkg; + this.nodeBorder = this.border1; // border 1 + + this.clusterBkg = this.secondBkg; + this.clusterBorder = this.border2; + this.defaultLinkColor = this.lineColor; + this.titleColor = this.textColor; + this.edgeLabelBackground = this.labelBackground; + /* Sequence Diagram variables */ + // this.actorBorder = lighten(this.border1, 0.5); + + this.actorBorder = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(this.border1, 23); + this.actorBkg = this.mainBkg; + this.labelBoxBkgColor = this.actorBkg; + this.signalColor = this.textColor; + this.signalTextColor = this.textColor; + this.labelBoxBorderColor = this.actorBorder; + this.labelTextColor = this.actorTextColor; + this.loopTextColor = this.actorTextColor; + this.noteBorderColor = this.border2; + this.noteTextColor = this.actorTextColor; + /* Gantt chart variables */ + + this.taskTextColor = this.taskTextLightColor; + this.taskTextOutsideColor = this.taskTextDarkColor; + /* state colors */ + + /* class */ + + this.classText = this.primaryTextColor; + /* journey */ + + this.fillType0 = this.primaryColor; + this.fillType1 = this.secondaryColor; + this.fillType2 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { + h: 64 }); - this.pie8 = this.pie8 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: -60, - l: -40 + this.fillType3 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { + h: 64 }); - this.pie9 = this.pie9 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 120, - l: -40 + this.fillType4 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { + h: -64 }); - this.pie10 = this.pie10 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: +60, - l: -40 + this.fillType5 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { + h: -64 }); - this.pie11 = this.pie11 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: -90, - l: -40 + this.fillType6 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { + h: 128 }); - this.pie12 = this.pie12 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 120, - l: -30 + this.fillType7 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { + h: 128 }); - this.pieTitleTextSize = this.pieTitleTextSize || '25px'; - this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; - this.pieSectionTextSize = this.pieSectionTextSize || '17px'; - this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; - this.pieLegendTextSize = this.pieLegendTextSize || '17px'; - this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; - this.pieStrokeColor = this.pieStrokeColor || 'black'; - this.pieStrokeWidth = this.pieStrokeWidth || '2px'; - this.pieOpacity = this.pieOpacity || '0.7'; - /* requirement-diagram */ - - this.requirementBackground = this.requirementBackground || this.primaryColor; - this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; - this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; - this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; - this.relationColor = this.relationColor || this.lineColor; - this.relationLabelBackground = this.relationLabelBackground || this.labelBackground; - this.relationLabelColor = this.relationLabelColor || this.actorTextColor; } }, { key: "calculate", @@ -129808,20 +127525,6 @@ function () { this.activeTaskBkgColor = this.mainBkg; /* state colors */ - this.transitionColor = this.transitionColor || this.lineColor; - this.transitionLabelColor = this.transitionLabelColor || this.textColor; - this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; - this.stateBkg = this.stateBkg || this.mainBkg; - this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; - this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; - this.altBackground = this.altBackground || '#f0f0f0'; - this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; - this.compositeBorder = this.compositeBorder || this.nodeBorder; - this.innerEndBackground = this.primaryBorderColor; - this.specialStateColor = this.lineColor; - this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; - this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; - this.transitionColor = this.transitionColor || this.lineColor; /* class */ this.classText = this.primaryTextColor; @@ -129847,63 +127550,6 @@ function () { this.fillType7 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { h: 128 }); - /* pie */ - - this.pie1 = this.pie1 || this.primaryColor; - this.pie2 = this.pie2 || this.secondaryColor; - this.pie3 = this.pie3 || this.tertiaryColor; - this.pie4 = this.pie4 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - l: -30 - }); - this.pie5 = this.pie5 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { - l: -30 - }); - this.pie6 = this.pie6 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.tertiaryColor, { - h: +40, - l: -40 - }); - this.pie7 = this.pie7 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: +60, - l: -10 - }); - this.pie8 = this.pie8 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: -60, - l: -10 - }); - this.pie9 = this.pie9 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 120, - l: 0 - }); - this.pie10 = this.pie10 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: +60, - l: -50 - }); - this.pie11 = this.pie11 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: -60, - l: -50 - }); - this.pie12 = this.pie12 || Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.primaryColor, { - h: 120, - l: -50 - }); - this.pieTitleTextSize = this.pieTitleTextSize || '25px'; - this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; - this.pieSectionTextSize = this.pieSectionTextSize || '17px'; - this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; - this.pieLegendTextSize = this.pieLegendTextSize || '17px'; - this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; - this.pieStrokeColor = this.pieStrokeColor || 'black'; - this.pieStrokeWidth = this.pieStrokeWidth || '2px'; - this.pieOpacity = this.pieOpacity || '0.7'; - /* requirement-diagram */ - - this.requirementBackground = this.requirementBackground || this.primaryColor; - this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; - this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; - this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; - this.relationColor = this.relationColor || this.lineColor; - this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground; - this.relationLabelColor = this.relationLabelColor || this.actorTextColor; } }, { key: "calculate", @@ -129992,7 +127638,7 @@ function () { _classCallCheck(this, Theme); this.primaryColor = '#eee'; - this.contrast = '#707070'; + this.contrast = '#26a'; this.secondaryColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(this.contrast, 55); this.background = '#ffffff'; // this.secondaryColor = adjust(this.primaryColor, { h: 120 }); @@ -130007,8 +127653,8 @@ function () { this.secondaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.secondaryColor); this.tertiaryTextColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.tertiaryColor); this.lineColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.background); - this.textColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.background); // this.altBackground = lighten(this.contrast, 55); - + this.textColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["invert"])(this.background); + this.altBackground = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(this.contrast, 55); this.mainBkg = '#eee'; this.secondBkg = 'calculated'; this.lineColor = '#666'; @@ -130100,9 +127746,9 @@ function () { this.labelBoxBorderColor = this.actorBorder; this.labelTextColor = this.text; this.loopTextColor = this.text; - this.noteBorderColor = '#999'; - this.noteBkgColor = '#666'; - this.noteTextColor = '#fff'; + this.noteBorderColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["darken"])(this.note, 60); + this.noteBkgColor = this.note; + this.noteTextColor = this.actorTextColor; /* Gantt chart variables */ this.sectionBkgColor = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["lighten"])(this.contrast, 30); @@ -130122,19 +127768,6 @@ function () { this.todayLineColor = this.critBkgColor; /* state colors */ - this.transitionColor = this.transitionColor || '#000'; - this.transitionLabelColor = this.transitionLabelColor || this.textColor; - this.stateLabelColor = this.stateLabelColor || this.stateBkg || this.primaryTextColor; - this.stateBkg = this.stateBkg || this.mainBkg; - this.labelBackgroundColor = this.labelBackgroundColor || this.stateBkg; - this.compositeBackground = this.compositeBackground || this.background || this.tertiaryColor; - this.altBackground = this.altBackground || '#f4f4f4'; - this.compositeTitleBackground = this.compositeTitleBackground || this.mainBkg; - this.stateBorder = this.stateBorder || '#000'; - this.innerEndBackground = this.primaryBorderColor; - this.specialStateColor = '#222'; - this.errorBkgColor = this.errorBkgColor || this.tertiaryColor; - this.errorTextColor = this.errorTextColor || this.tertiaryTextColor; /* class */ this.classText = this.primaryTextColor; @@ -130159,50 +127792,7 @@ function () { }); this.fillType7 = Object(khroma__WEBPACK_IMPORTED_MODULE_0__["adjust"])(this.secondaryColor, { h: 128 - }); // /* pie */ - - this.pie1 = this.pie1 || '#F4F4F4'; - this.pie2 = this.pie2 || '#555'; - this.pie3 = this.pie3 || '#BBB'; - this.pie4 = this.pie4 || '#777'; - this.pie5 = this.pie5 || '#999'; - this.pie6 = this.pie6 || '#DDD'; - this.pie7 = this.pie7 || '#FFF'; - this.pie8 = this.pie8 || '#DDD'; - this.pie9 = this.pie9 || '#BBB'; - this.pie10 = this.pie10 || '#999'; - this.pie11 = this.pie11 || '#777'; - this.pie12 = this.pie12 || '#555'; - this.pieTitleTextSize = this.pieTitleTextSize || '25px'; - this.pieTitleTextColor = this.pieTitleTextColor || this.taskTextDarkColor; - this.pieSectionTextSize = this.pieSectionTextSize || '17px'; - this.pieSectionTextColor = this.pieSectionTextColor || this.textColor; - this.pieLegendTextSize = this.pieLegendTextSize || '17px'; - this.pieLegendTextColor = this.pieLegendTextColor || this.taskTextDarkColor; - this.pieStrokeColor = this.pieStrokeColor || 'black'; - this.pieStrokeWidth = this.pieStrokeWidth || '2px'; - this.pieOpacity = this.pieOpacity || '0.7'; // this.pie1 = this.pie1 || '#212529'; - // this.pie2 = this.pie2 || '#343A40'; - // this.pie3 = this.pie3 || '#495057'; - // this.pie4 = this.pie4 || '#6C757D'; - // this.pie5 = this.pie5 || adjust(this.secondaryColor, { l: -10 }); - // this.pie6 = this.pie6 || adjust(this.tertiaryColor, { l: -10 }); - // this.pie7 = this.pie7 || adjust(this.primaryColor, { h: +60, l: -10 }); - // this.pie8 = this.pie8 || adjust(this.primaryColor, { h: -60, l: -10 }); - // this.pie9 = this.pie9 || adjust(this.primaryColor, { h: 120, l: 0 }); - // this.pie10 = this.pie10 || adjust(this.primaryColor, { h: +60, l: -20 }); - // this.pie11 = this.pie11 || adjust(this.primaryColor, { h: -60, l: -20 }); - // this.pie12 = this.pie12 || adjust(this.primaryColor, { h: 120, l: -10 }); - - /* requirement-diagram */ - - this.requirementBackground = this.requirementBackground || this.primaryColor; - this.requirementBorderColor = this.requirementBorderColor || this.primaryBorderColor; - this.requirementBorderSize = this.requirementBorderSize || this.primaryBorderColor; - this.requirementTextColor = this.requirementTextColor || this.primaryTextColor; - this.relationColor = this.relationColor || this.lineColor; - this.relationLabelBackground = this.relationLabelBackground || this.edgeLabelBackground; - this.relationLabelColor = this.relationLabelColor || this.actorTextColor; + }); } }, { key: "calculate", @@ -130342,7 +127932,7 @@ var anyComment = /\s*%%.*\n/gm; * @returns {object} the json object representing the init passed to mermaid.initialize() */ -var detectInit = function detectInit(text, cnf) { +var detectInit = function detectInit(text) { var inits = detectDirective(text, /(?:init\b)|(?:initialize\b)/); var results = {}; @@ -130356,7 +127946,7 @@ var detectInit = function detectInit(text, cnf) { } if (results) { - var type = detectType(text, cnf); + var type = detectType(text); ['config'].forEach(function (prop) { if (typeof results[prop] !== 'undefined') { if (type === 'flowchart-v2') { @@ -130399,7 +127989,7 @@ var detectDirective = function detectDirective(text) { try { var commentWithoutDirectives = new RegExp("[%]{2}(?![{]".concat(directiveWithoutOpen.source, ")(?=[}][%]{2}).*\n"), 'ig'); text = text.trim().replace(commentWithoutDirectives, '').replace(/'/gm, '"'); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug("Detecting diagram directive".concat(type !== null ? ' type:' + type : '', " based on the text:").concat(text)); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug("Detecting diagram directive".concat(type !== null ? ' type:' + type : '', " based on the text:").concat(text)); var match, result = []; @@ -130429,7 +128019,7 @@ var detectDirective = function detectDirective(text) { return result.length === 1 ? result[0] : result; } catch (error) { - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].error("ERROR: ".concat(error.message, " - Unable to parse directive\n ").concat(type !== null ? ' type:' + type : '', " based on the text:").concat(text)); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].error("ERROR: ".concat(error.message, " - Unable to parse directive").concat(type !== null ? ' type:' + type : '', " based on the text:").concat(text)); return { type: null, args: null @@ -130456,9 +128046,9 @@ var detectDirective = function detectDirective(text) { * @returns {string} A graph definition key */ -var detectType = function detectType(text, cnf) { +var detectType = function detectType(text) { text = text.replace(directive, '').replace(anyComment, '\n'); - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].debug('Detecting diagram type based on the text ' + text); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].debug('Detecting diagram type based on the text ' + text); if (text.match(/^\s*sequenceDiagram/)) { return 'sequence'; @@ -130473,7 +128063,6 @@ var detectType = function detectType(text, cnf) { } if (text.match(/^\s*classDiagram/)) { - if (cnf && cnf.class && cnf.class.defaultRenderer === 'dagre-wrapper') return 'classDiagram'; return 'class'; } @@ -130482,7 +128071,6 @@ var detectType = function detectType(text, cnf) { } if (text.match(/^\s*stateDiagram/)) { - if (cnf && cnf.class && cnf.state.defaultRenderer === 'dagre-wrapper') return 'stateDiagram'; return 'state'; } @@ -130510,11 +128098,6 @@ var detectType = function detectType(text, cnf) { return 'journey'; } - if (text.match(/^\s*requirement/) || text.match(/^\s*requirementDiagram/)) { - return 'requirement'; - } - - if (cnf && cnf.flowchart && cnf.flowchart.defaultRenderer === 'dagre-wrapper') return 'flowchart-v2'; return 'flowchart'; }; @@ -130644,7 +128227,7 @@ var calcCardinalityPosition = function calcCardinalityPosition(isRelationTypePre var prevPoint; var totalDistance = 0; // eslint-disable-line - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('our points', points); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('our points', points); if (points[0] !== initialPosition) { points = points.reverse(); @@ -130710,7 +128293,7 @@ var calcTerminalLabelPosition = function calcTerminalLabelPosition(terminalMarke var prevPoint; var totalDistance = 0; // eslint-disable-line - _logger__WEBPACK_IMPORTED_MODULE_3__["log"].info('our points', points); + _logger__WEBPACK_IMPORTED_MODULE_3__["logger"].info('our points', points); if (position !== 'start_left' && position !== 'start_right') { points = points.reverse(); @@ -131195,27 +128778,34 @@ var configureSvgSize = function configureSvgSize(svgElem, height, width, useMaxW var attrs = calculateSvgSizeAttrs(height, width, useMaxWidth); d3Attrs(svgElem, attrs); }; -var initIdGeneratior = -/*#__PURE__*/ -function () { - function iterator(deterministic, seed) { - _classCallCheck(this, iterator); +var initIdGeneratior = function initIdGeneratior(deterministic, seed) { + if (!deterministic) return { + next: function next() { + return Date.now(); + } + }; - this.deterministic = deterministic; - this.seed = seed; - this.count = seed ? seed.length : 0; - } + var iterator = + /*#__PURE__*/ + function () { + function iterator() { + _classCallCheck(this, iterator); - _createClass(iterator, [{ - key: "next", - value: function next() { - if (!this.deterministic) return Date.now(); - return this.count++; + return this.count = seed ? seed.length : 0; } - }]); - return iterator; -}(); + _createClass(iterator, [{ + key: "next", + value: function next() { + return this.count++; + } + }]); + + return iterator; + }(); + + return new iterator(); +}; /* harmony default export */ __webpack_exports__["default"] = ({ assignWithDepth: assignWithDepth, wrapLabel: wrapLabel, @@ -131408,24 +128998,11 @@ function useWillUnmount(fn) { }, []); } -/** - * Returns the owner window of a given element. - * - * @param node the element - */ - function ownerWindow(node) { var doc = ownerDocument$1(node); return doc && doc.defaultView || window; } -/** - * Returns one or all computed style properties of an element. - * - * @param node the element - * @param psuedoElement the style property - */ - function getComputedStyle(node, psuedoElement) { return ownerWindow(node).getComputedStyle(node, psuedoElement); } @@ -131477,36 +129054,18 @@ function style(node, property) { node.style.cssText += ";" + css; } -/** - * Triggers an event on a given element. - * - * @param node the element - * @param eventName the event name to trigger - * @param bubbles whether the event should bubble up - * @param cancelable whether the event should be cancelable - */ -function triggerEvent(node, eventName, bubbles, cancelable) { - if (bubbles === void 0) { - bubbles = false; - } - - if (cancelable === void 0) { - cancelable = true; - } - - if (node) { - var event = document.createEvent('HTMLEvents'); - event.initEvent(eventName, bubbles, cancelable); - node.dispatchEvent(event); - } -} - -function parseDuration$1(node) { +function parseDuration(node) { var str = style(node, 'transitionDuration') || ''; var mult = str.indexOf('ms') === -1 ? 1000 : 1; return parseFloat(str) * mult; } +function triggerTransitionEnd(element) { + var evt = document.createEvent('HTMLEvents'); + evt.initEvent('transitionend', true, true); + element.dispatchEvent(evt); +} + function emulateTransitionEnd(element, duration, padding) { if (padding === void 0) { padding = 5; @@ -131514,7 +129073,7 @@ function emulateTransitionEnd(element, duration, padding) { var called = false; var handle = setTimeout(function () { - if (!called) triggerEvent(element, 'transitionend', true); + if (!called) triggerTransitionEnd(element); }, duration + padding); var remove = listen(element, 'transitionend', function () { called = true; @@ -131528,7 +129087,7 @@ function emulateTransitionEnd(element, duration, padding) { } function transitionEnd(element, handler, duration, padding) { - if (duration == null) duration = parseDuration$1(element) || 0; + if (duration == null) duration = parseDuration(element) || 0; var removeEmulate = emulateTransitionEnd(element, duration, padding); var remove = listen(element, 'transitionend', handler); return function () { @@ -131538,9 +129097,9 @@ function transitionEnd(element, handler, duration, padding) { } /** - * Returns the actively focused element safely. + * Return the actively focused element safely. * - * @param doc the document to check + * @param doc the document to checl */ function activeElement(doc) { @@ -131562,13 +129121,6 @@ function activeElement(doc) { } } -/** - * Adds a CSS class to a given element. - * - * @param element the element - * @param className the CSS class name - */ - function addClass(element, className) { if (element.classList) element.classList.add(className);else if (!hasClass(element, className)) if (typeof element.className === 'string') element.className = element.className + " " + className;else element.setAttribute('class', (element.className && element.className.baseVal || '') + " " + className); } @@ -131576,13 +129128,6 @@ function addClass(element, className) { function replaceClassName(origClass, classToRemove) { return origClass.replace(new RegExp("(^|\\s)" + classToRemove + "(?:\\s|$)", 'g'), '$1').replace(/\s+/g, ' ').replace(/^\s*|\s*$/g, ''); } -/** - * Removes a CSS class from a given element. - * - * @param element the element - * @param className the CSS class name - */ - function removeClass(element, className) { if (element.classList) { @@ -131824,7 +129369,7 @@ var resolveContainerRef = function resolveContainerRef(ref) { if (ref == null) return ownerDocument$1().body; if (typeof ref === 'function') ref = ref(); if (ref && 'current' in ref) ref = ref.current; - if ((_ref = ref) != null && _ref.nodeType) return ref || null; + if ((_ref = ref) == null ? void 0 : _ref.nodeType) return ref || null; return null; }; function useWaitForDOMRef(ref, onResolved) { @@ -132777,10 +130322,7 @@ Transition.propTypes = { * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)). */ nodeRef: propTypes$6.shape({ - current: typeof Element === 'undefined' ? propTypes$6.any : function (propValue, key, componentName, location, propFullName, secret) { - var value = propValue[key]; - return propTypes$6.instanceOf(value && 'ownerDocument' in value ? value.ownerDocument.defaultView.Element : Element)(propValue, key, componentName, location, propFullName, secret); - } + current: typeof Element === 'undefined' ? propTypes$6.any : propTypes$6.instanceOf(Element) }), /** @@ -132974,23 +130516,6 @@ Transition.ENTERING = ENTERING; Transition.ENTERED = ENTERED; Transition.EXITING = EXITING; -function parseDuration(node, property) { - var str = style(node, property) || ''; - var mult = str.indexOf('ms') === -1 ? 1000 : 1; - return parseFloat(str) * mult; -} - -function transitionEndListener(element, handler) { - var duration = parseDuration(element, 'transitionDuration'); - var delay = parseDuration(element, 'transitionDelay'); - var remove = transitionEnd(element, function (e) { - if (e.target === element) { - remove(); - handler(e); - } - }, duration + delay); -} - // reading a dimension prop will cause the browser to recalculate, // which will let our animations work function triggerBrowserReflow(node) { @@ -132998,8 +130523,6 @@ function triggerBrowserReflow(node) { node.offsetHeight; } -var _excluded$f = ["className", "children"]; - var _fadeStyles; var defaultProps$9 = { in: false, @@ -133009,10 +130532,10 @@ var defaultProps$9 = { appear: false }; var fadeStyles = (_fadeStyles = {}, _fadeStyles[ENTERING] = 'show', _fadeStyles[ENTERED] = 'show', _fadeStyles); -var Fade = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var Fade = react.forwardRef(function (_ref, ref) { var className = _ref.className, children = _ref.children, - props = _objectWithoutPropertiesLoose(_ref, _excluded$f); + props = _objectWithoutPropertiesLoose(_ref, ["className", "children"]); var handleEnter = react_9(function (node) { triggerBrowserReflow(node); @@ -133020,11 +130543,11 @@ var Fade = /*#__PURE__*/react.forwardRef(function (_ref, ref) { }, [props]); return /*#__PURE__*/react.createElement(Transition, _extends({ ref: ref, - addEndListener: transitionEndListener + addEndListener: transitionEnd }, props, { onEnter: handleEnter }), function (status, innerProps) { - return /*#__PURE__*/react.cloneElement(children, _extends({}, innerProps, { + return react.cloneElement(children, _extends({}, innerProps, { className: classnames('fade', className, children.props.className, fadeStyles[status]) })); }); @@ -133034,13 +130557,12 @@ Fade.displayName = 'Fade'; var ModalBody = createWithBsPrefix('modal-body'); -var ModalContext = /*#__PURE__*/react.createContext({ +var ModalContext = react.createContext({ // eslint-disable-next-line @typescript-eslint/no-empty-function onHide: function onHide() {} }); -var _excluded$e = ["bsPrefix", "className", "contentClassName", "centered", "size", "children", "scrollable"]; -var ModalDialog = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var ModalDialog = react.forwardRef(function (_ref, ref) { var bsPrefix = _ref.bsPrefix, className = _ref.className, contentClassName = _ref.contentClassName, @@ -133048,7 +130570,7 @@ var ModalDialog = /*#__PURE__*/react.forwardRef(function (_ref, ref) { size = _ref.size, children = _ref.children, scrollable = _ref.scrollable, - props = _objectWithoutPropertiesLoose(_ref, _excluded$e); + props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "className", "contentClassName", "centered", "size", "children", "scrollable"]); bsPrefix = useBootstrapPrefix(bsPrefix, 'modal'); var dialogClass = bsPrefix + "-dialog"; @@ -133063,7 +130585,6 @@ ModalDialog.displayName = 'ModalDialog'; var ModalFooter = createWithBsPrefix('modal-footer'); -var _excluded$d = ["label", "onClick", "className"]; var propTypes = { label: propTypes$6.string.isRequired, onClick: propTypes$6.func @@ -133071,11 +130592,11 @@ var propTypes = { var defaultProps$8 = { label: 'Close' }; -var CloseButton = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var CloseButton = react.forwardRef(function (_ref, ref) { var label = _ref.label, onClick = _ref.onClick, className = _ref.className, - props = _objectWithoutPropertiesLoose(_ref, _excluded$d); + props = _objectWithoutPropertiesLoose(_ref, ["label", "onClick", "className"]); return /*#__PURE__*/react.createElement("button", _extends({ ref: ref, @@ -133092,19 +130613,18 @@ CloseButton.displayName = 'CloseButton'; CloseButton.propTypes = propTypes; CloseButton.defaultProps = defaultProps$8; -var _excluded$c = ["bsPrefix", "closeLabel", "closeButton", "onHide", "className", "children"]; var defaultProps$7 = { closeLabel: 'Close', closeButton: false }; -var ModalHeader = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var ModalHeader = react.forwardRef(function (_ref, ref) { var bsPrefix = _ref.bsPrefix, closeLabel = _ref.closeLabel, closeButton = _ref.closeButton, onHide = _ref.onHide, className = _ref.className, children = _ref.children, - props = _objectWithoutPropertiesLoose(_ref, _excluded$c); + props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "closeLabel", "closeButton", "onHide", "className", "children"]); bsPrefix = useBootstrapPrefix(bsPrefix, 'modal-header'); var context = react_13(ModalContext); @@ -133125,7 +130645,7 @@ ModalHeader.displayName = 'ModalHeader'; ModalHeader.defaultProps = defaultProps$7; var divWithClassName = (function (className) { - return /*#__PURE__*/react.forwardRef(function (p, ref) { + return react.forwardRef(function (p, ref) { return /*#__PURE__*/react.createElement("div", _extends({}, p, { ref: ref, className: classnames(p.className, className) @@ -133138,7 +130658,6 @@ var ModalTitle = createWithBsPrefix('modal-title', { Component: DivStyledAsH4 }); -var _excluded$b = ["bsPrefix", "className", "style", "dialogClassName", "contentClassName", "children", "dialogAs", "aria-labelledby", "show", "animation", "backdrop", "keyboard", "onEscapeKeyDown", "onShow", "onHide", "container", "autoFocus", "enforceFocus", "restoreFocus", "restoreFocusOptions", "onEntered", "onExit", "onExiting", "onEnter", "onEntering", "onExited", "backdropClassName", "manager"]; var manager; var defaultProps$6 = { show: false, @@ -133153,20 +130672,16 @@ var defaultProps$6 = { /* eslint-disable no-use-before-define, react/no-multi-comp */ function DialogTransition(props) { - return /*#__PURE__*/react.createElement(Fade, _extends({}, props, { - timeout: null - })); + return /*#__PURE__*/react.createElement(Fade, props); } function BackdropTransition(props) { - return /*#__PURE__*/react.createElement(Fade, _extends({}, props, { - timeout: null - })); + return /*#__PURE__*/react.createElement(Fade, props); } /* eslint-enable no-use-before-define */ -var Modal = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var Modal = react.forwardRef(function (_ref, ref) { var bsPrefix = _ref.bsPrefix, className = _ref.className, style = _ref.style, @@ -133195,7 +130710,7 @@ var Modal = /*#__PURE__*/react.forwardRef(function (_ref, ref) { onExited = _ref.onExited, backdropClassName = _ref.backdropClassName, propsManager = _ref.manager, - props = _objectWithoutPropertiesLoose(_ref, _excluded$b); + props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "className", "style", "dialogClassName", "contentClassName", "children", "dialogAs", "aria-labelledby", "show", "animation", "backdrop", "keyboard", "onEscapeKeyDown", "onShow", "onHide", "container", "autoFocus", "enforceFocus", "restoreFocus", "restoreFocusOptions", "onEntered", "onExit", "onExiting", "onEnter", "onEntering", "onExited", "backdropClassName", "manager"]); var _useState = react_16({}), modalStyle = _useState[0], @@ -133366,7 +130881,7 @@ var Modal = /*#__PURE__*/react.forwardRef(function (_ref, ref) { })); }, [animation, backdropClassName, bsPrefix]); - var baseModalStyle = _extends({}, style, modalStyle); // Sets `display` always block when `animation` is false + var baseModalStyle = _extends({}, style, {}, modalStyle); // Sets `display` always block when `animation` is false if (!animation) { @@ -133383,6 +130898,7 @@ var Modal = /*#__PURE__*/react.forwardRef(function (_ref, ref) { onMouseUp: handleMouseUp, "aria-labelledby": ariaLabelledby }), /*#__PURE__*/react.createElement(Dialog, _extends({}, props, { + role: "document", onMouseDown: handleDialogMouseDown, className: dialogClassName, contentClassName: contentClassName @@ -133429,24 +130945,22 @@ Modal.Dialog = ModalDialog; Modal.TRANSITION_DURATION = 300; Modal.BACKDROP_TRANSITION_DURATION = 150; -var context = /*#__PURE__*/react.createContext(null); +var context = react.createContext(null); context.displayName = 'CardContext'; -var TabContext = /*#__PURE__*/react.createContext(null); - -var _excluded$a = ["as", "onSelect", "activeKey", "role", "onKeyDown"]; +var TabContext = react.createContext(null); // eslint-disable-next-line @typescript-eslint/no-empty-function var noop = function noop() {}; -var AbstractNav = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var AbstractNav = react.forwardRef(function (_ref, ref) { var _ref$as = _ref.as, Component = _ref$as === void 0 ? 'ul' : _ref$as, onSelect = _ref.onSelect, activeKey = _ref.activeKey, role = _ref.role, onKeyDown = _ref.onKeyDown, - props = _objectWithoutPropertiesLoose(_ref, _excluded$a); + props = _objectWithoutPropertiesLoose(_ref, ["as", "onSelect", "activeKey", "role", "onKeyDown"]); // A ref and forceUpdate for refocus, b/c we only want to trigger when needed // and don't want to reset the set in the effect @@ -133537,15 +131051,14 @@ var AbstractNav = /*#__PURE__*/react.forwardRef(function (_ref, ref) { })))); }); -var _excluded$9 = ["bsPrefix", "className", "children", "as"]; -var NavItem = /*#__PURE__*/react.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595 +var NavItem = react.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595 function (_ref, ref) { var bsPrefix = _ref.bsPrefix, className = _ref.className, children = _ref.children, _ref$as = _ref.as, Component = _ref$as === void 0 ? 'div' : _ref$as, - props = _objectWithoutPropertiesLoose(_ref, _excluded$9); + props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "className", "children", "as"]); bsPrefix = useBootstrapPrefix(bsPrefix, 'nav-item'); return /*#__PURE__*/react.createElement(Component, _extends({}, props, { @@ -133555,18 +131068,17 @@ function (_ref, ref) { }); NavItem.displayName = 'NavItem'; -var _excluded$8 = ["active", "className", "eventKey", "onSelect", "onClick", "as"]; var defaultProps$5 = { disabled: false }; -var AbstractNavItem = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var AbstractNavItem = react.forwardRef(function (_ref, ref) { var active = _ref.active, className = _ref.className, eventKey = _ref.eventKey, onSelect = _ref.onSelect, onClick = _ref.onClick, Component = _ref.as, - props = _objectWithoutPropertiesLoose(_ref, _excluded$8); + props = _objectWithoutPropertiesLoose(_ref, ["active", "className", "eventKey", "onSelect", "onClick", "as"]); var navKey = makeEventKey(eventKey, props.href); var parentOnSelect = react_13(SelectableContext); @@ -133586,11 +131098,7 @@ var AbstractNavItem = /*#__PURE__*/react.forwardRef(function (_ref, ref) { } if (props.role === 'tab') { - if (props.disabled) { - props.tabIndex = -1; - props['aria-disabled'] = true; - } - + props.tabIndex = isActive ? props.tabIndex : -1; props['aria-selected'] = isActive; } @@ -133608,12 +131116,11 @@ var AbstractNavItem = /*#__PURE__*/react.forwardRef(function (_ref, ref) { }); AbstractNavItem.defaultProps = defaultProps$5; -var _excluded$7 = ["bsPrefix", "disabled", "className", "href", "eventKey", "onSelect", "as"]; var defaultProps$4 = { disabled: false, as: SafeAnchor }; -var NavLink = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var NavLink = react.forwardRef(function (_ref, ref) { var bsPrefix = _ref.bsPrefix, disabled = _ref.disabled, className = _ref.className, @@ -133621,7 +131128,7 @@ var NavLink = /*#__PURE__*/react.forwardRef(function (_ref, ref) { eventKey = _ref.eventKey, onSelect = _ref.onSelect, as = _ref.as, - props = _objectWithoutPropertiesLoose(_ref, _excluded$7); + props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "disabled", "className", "href", "eventKey", "onSelect", "as"]); bsPrefix = useBootstrapPrefix(bsPrefix, 'nav-link'); return /*#__PURE__*/react.createElement(AbstractNavItem, _extends({}, props, { @@ -133637,12 +131144,11 @@ var NavLink = /*#__PURE__*/react.forwardRef(function (_ref, ref) { NavLink.displayName = 'NavLink'; NavLink.defaultProps = defaultProps$4; -var _excluded$6 = ["as", "bsPrefix", "variant", "fill", "justify", "navbar", "navbarScroll", "className", "children", "activeKey"]; var defaultProps$3 = { justify: false, fill: false }; -var Nav = /*#__PURE__*/react.forwardRef(function (uncontrolledProps, ref) { +var Nav = react.forwardRef(function (uncontrolledProps, ref) { var _classNames; var _useUncontrolled = useUncontrolled(uncontrolledProps, { @@ -133655,11 +131161,10 @@ var Nav = /*#__PURE__*/react.forwardRef(function (uncontrolledProps, ref) { fill = _useUncontrolled.fill, justify = _useUncontrolled.justify, navbar = _useUncontrolled.navbar, - navbarScroll = _useUncontrolled.navbarScroll, className = _useUncontrolled.className, children = _useUncontrolled.children, activeKey = _useUncontrolled.activeKey, - props = _objectWithoutPropertiesLoose(_useUncontrolled, _excluded$6); + props = _objectWithoutPropertiesLoose(_useUncontrolled, ["as", "bsPrefix", "variant", "fill", "justify", "navbar", "className", "children", "activeKey"]); var bsPrefix = useBootstrapPrefix(initialBsPrefix, 'nav'); var navbarBsPrefix; @@ -133679,7 +131184,7 @@ var Nav = /*#__PURE__*/react.forwardRef(function (uncontrolledProps, ref) { as: as, ref: ref, activeKey: activeKey, - className: classnames(className, (_classNames = {}, _classNames[bsPrefix] = !isNavbar, _classNames[navbarBsPrefix + "-nav"] = isNavbar, _classNames[navbarBsPrefix + "-nav-scroll"] = isNavbar && navbarScroll, _classNames[cardHeaderBsPrefix + "-" + variant] = !!cardHeaderBsPrefix, _classNames[bsPrefix + "-" + variant] = !!variant, _classNames[bsPrefix + "-fill"] = fill, _classNames[bsPrefix + "-justified"] = justify, _classNames)) + className: classnames(className, (_classNames = {}, _classNames[bsPrefix] = !isNavbar, _classNames[navbarBsPrefix + "-nav"] = isNavbar, _classNames[cardHeaderBsPrefix + "-" + variant] = !!cardHeaderBsPrefix, _classNames[bsPrefix + "-" + variant] = !!variant, _classNames[bsPrefix + "-fill"] = fill, _classNames[bsPrefix + "-justified"] = justify, _classNames)) }, props), children); }); Nav.displayName = 'Nav'; @@ -133687,12 +131192,11 @@ Nav.defaultProps = defaultProps$3; Nav.Item = NavItem; Nav.Link = NavLink; -var _excluded$5 = ["bsPrefix", "className", "as"]; -var NavbarBrand = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var NavbarBrand = react.forwardRef(function (_ref, ref) { var bsPrefix = _ref.bsPrefix, className = _ref.className, as = _ref.as, - props = _objectWithoutPropertiesLoose(_ref, _excluded$5); + props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "className", "as"]); bsPrefix = useBootstrapPrefix(bsPrefix, 'navbar-brand'); var Component = as || (props.href ? 'a' : 'span'); @@ -133703,8 +131207,6 @@ var NavbarBrand = /*#__PURE__*/react.forwardRef(function (_ref, ref) { }); NavbarBrand.displayName = 'NavbarBrand'; -var _excluded$4 = ["onEnter", "onEntering", "onEntered", "onExit", "onExiting", "className", "children", "dimension", "getDimensionValue"]; - var _collapseStyles; var MARGINS = { height: ['marginTop', 'marginBottom'], @@ -133729,7 +131231,7 @@ var defaultProps$2 = { appear: false, getDimensionValue: getDefaultDimensionValue }; -var Collapse = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var Collapse = react.forwardRef(function (_ref, ref) { var onEnter = _ref.onEnter, onEntering = _ref.onEntering, onEntered = _ref.onEntered, @@ -133741,7 +131243,7 @@ var Collapse = /*#__PURE__*/react.forwardRef(function (_ref, ref) { dimension = _ref$dimension === void 0 ? 'height' : _ref$dimension, _ref$getDimensionValu = _ref.getDimensionValue, getDimensionValue = _ref$getDimensionValu === void 0 ? getDefaultDimensionValue : _ref$getDimensionValu, - props = _objectWithoutPropertiesLoose(_ref, _excluded$4); + props = _objectWithoutPropertiesLoose(_ref, ["onEnter", "onEntering", "onEntered", "onExit", "onExiting", "className", "children", "dimension", "getDimensionValue"]); /* Compute dimension */ var computedDimension = typeof dimension === 'function' ? dimension() : dimension; @@ -133779,7 +131281,7 @@ var Collapse = /*#__PURE__*/react.forwardRef(function (_ref, ref) { return /*#__PURE__*/react.createElement(Transition // @ts-ignore , _extends({ ref: ref, - addEndListener: transitionEndListener + addEndListener: transitionEnd }, props, { "aria-expanded": props.role ? props.in : null, onEnter: handleEnter, @@ -133788,7 +131290,7 @@ var Collapse = /*#__PURE__*/react.forwardRef(function (_ref, ref) { onExit: handleExit, onExiting: handleExiting }), function (state, innerProps) { - return /*#__PURE__*/react.cloneElement(children, _extends({}, innerProps, { + return react.cloneElement(children, _extends({}, innerProps, { className: classnames(className, children.props.className, collapseStyles[state], computedDimension === 'width' && 'width') })); }); @@ -133797,11 +131299,10 @@ var Collapse = /*#__PURE__*/react.forwardRef(function (_ref, ref) { // @ts-ignore Collapse.defaultProps = defaultProps$2; -var _excluded$3 = ["children", "bsPrefix"]; -var NavbarCollapse = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var NavbarCollapse = react.forwardRef(function (_ref, ref) { var children = _ref.children, bsPrefix = _ref.bsPrefix, - props = _objectWithoutPropertiesLoose(_ref, _excluded$3); + props = _objectWithoutPropertiesLoose(_ref, ["children", "bsPrefix"]); bsPrefix = useBootstrapPrefix(bsPrefix, 'navbar-collapse'); return /*#__PURE__*/react.createElement(context$1.Consumer, null, function (context) { @@ -133815,11 +131316,10 @@ var NavbarCollapse = /*#__PURE__*/react.forwardRef(function (_ref, ref) { }); NavbarCollapse.displayName = 'NavbarCollapse'; -var _excluded$2 = ["bsPrefix", "className", "children", "label", "as", "onClick"]; var defaultProps$1 = { label: 'Toggle navigation' }; -var NavbarToggle = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var NavbarToggle = react.forwardRef(function (_ref, ref) { var bsPrefix = _ref.bsPrefix, className = _ref.className, children = _ref.children, @@ -133827,7 +131327,7 @@ var NavbarToggle = /*#__PURE__*/react.forwardRef(function (_ref, ref) { _ref$as = _ref.as, Component = _ref$as === void 0 ? 'button' : _ref$as, onClick = _ref.onClick, - props = _objectWithoutPropertiesLoose(_ref, _excluded$2); + props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "className", "children", "label", "as", "onClick"]); bsPrefix = useBootstrapPrefix(bsPrefix, 'navbar-toggler'); @@ -133856,7 +131356,6 @@ var NavbarToggle = /*#__PURE__*/react.forwardRef(function (_ref, ref) { NavbarToggle.displayName = 'NavbarToggle'; NavbarToggle.defaultProps = defaultProps$1; -var _excluded$1 = ["bsPrefix", "expand", "variant", "bg", "fixed", "sticky", "className", "children", "as", "expanded", "onToggle", "onSelect", "collapseOnSelect"]; var NavbarText = createWithBsPrefix('navbar-text', { Component: 'span' }); @@ -133865,7 +131364,7 @@ var defaultProps = { variant: 'light', collapseOnSelect: false }; -var Navbar = /*#__PURE__*/react.forwardRef(function (props, ref) { +var Navbar = react.forwardRef(function (props, ref) { var _useUncontrolled = useUncontrolled(props, { expanded: 'onToggle' }), @@ -133883,7 +131382,7 @@ var Navbar = /*#__PURE__*/react.forwardRef(function (props, ref) { _onToggle = _useUncontrolled.onToggle, onSelect = _useUncontrolled.onSelect, collapseOnSelect = _useUncontrolled.collapseOnSelect, - controlledProps = _objectWithoutPropertiesLoose(_useUncontrolled, _excluded$1); + controlledProps = _objectWithoutPropertiesLoose(_useUncontrolled, ["bsPrefix", "expand", "variant", "bg", "fixed", "sticky", "className", "children", "as", "expanded", "onToggle", "onSelect", "collapseOnSelect"]); var bsPrefix = useBootstrapPrefix(initialBsPrefix, 'navbar'); var handleCollapse = react_9(function () { @@ -134454,8 +131953,7 @@ class n{constructor(e,t,n,r){this.file=e,this.offset=t,this.line=n,this.col=r;}t var Prettier = unwrapExports(standalone); -var _excluded = ["bsPrefix", "variant", "animation", "size", "children", "as", "className"]; -var Spinner = /*#__PURE__*/react.forwardRef(function (_ref, ref) { +var Spinner = react.forwardRef(function (_ref, ref) { var bsPrefix = _ref.bsPrefix, variant = _ref.variant, animation = _ref.animation, @@ -134464,7 +131962,7 @@ var Spinner = /*#__PURE__*/react.forwardRef(function (_ref, ref) { _ref$as = _ref.as, Component = _ref$as === void 0 ? 'div' : _ref$as, className = _ref.className, - props = _objectWithoutPropertiesLoose(_ref, _excluded); + props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "variant", "animation", "size", "children", "as", "className"]); bsPrefix = useBootstrapPrefix(bsPrefix, 'spinner'); var bsSpinnerPrefix = bsPrefix + "-" + animation; @@ -134547,7 +132045,7 @@ var hashSum = sum; var marked = createCommonjsModule(function (module, exports) { /** * marked - a markdown parser - * Copyright (c) 2011-2021, Christopher Jeffrey. (MIT Licensed) + * Copyright (c) 2011-2020, Christopher Jeffrey. (MIT Licensed) * https://github.com/markedjs/marked */ @@ -134617,9 +132115,8 @@ var marked = createCommonjsModule(function (module, exports) { return it.next.bind(it); } - function createCommonjsModule(fn) { - var module = { exports: {} }; - return fn(module, module.exports), module.exports; + function createCommonjsModule(fn, module) { + return module = { exports: {} }, fn(module, module.exports), module.exports; } var defaults = createCommonjsModule(function (module) { @@ -134656,6 +132153,9 @@ var marked = createCommonjsModule(function (module, exports) { changeDefaults: changeDefaults }; }); + defaults.defaults; + defaults.getDefaults; + defaults.changeDefaults; /** * Helpers @@ -135045,7 +132545,7 @@ var marked = createCommonjsModule(function (module, exports) { }; } - var text = cap[0].replace(/^ {1,4}/gm, ''); + var text = cap[0].replace(/^ {4}/gm, ''); return { type: 'code', raw: cap[0], @@ -135076,12 +132576,12 @@ var marked = createCommonjsModule(function (module, exports) { if (cap) { var text = cap[2].trim(); // remove trailing #s - if (/#$/.test(text)) { + if (text.endsWith('#')) { var trimmed = rtrim$1(text, '#'); if (this.options.pedantic) { text = trimmed.trim(); - } else if (!trimmed || / $/.test(trimmed)) { + } else if (!trimmed || trimmed.endsWith(' ')) { // CommonMark requires space before trailing #s text = trimmed.trim(); } @@ -135196,7 +132696,7 @@ var marked = createCommonjsModule(function (module, exports) { if (i !== l - 1) { bnext = this.rules.block.listItemStart.exec(itemMatch[i + 1]); - if (!this.options.pedantic ? bnext[1].length > bcurr[0].length || bnext[1].length > 3 : bnext[1].length > bcurr[1].length) { + if (bnext[1].length > bcurr[0].length || bnext[1].length > 3) { // nested list itemMatch.splice(i, 2, itemMatch[i] + '\n' + itemMatch[i + 1]); i--; @@ -135421,9 +132921,9 @@ var marked = createCommonjsModule(function (module, exports) { if (cap) { var trimmedUrl = cap[2].trim(); - if (!this.options.pedantic && /^$/.test(trimmedUrl)) { + if (!trimmedUrl.endsWith('>')) { return; } // ending angle bracket cannot be escaped @@ -135463,8 +132963,8 @@ var marked = createCommonjsModule(function (module, exports) { href = href.trim(); - if (/^$/.test(trimmedUrl)) { + if (href.startsWith('<')) { + if (this.options.pedantic && !trimmedUrl.endsWith('>')) { // pedantic allows starting angle bracket without ending angle bracket href = href.slice(1); } else { @@ -135559,7 +133059,7 @@ var marked = createCommonjsModule(function (module, exports) { if (cap) { var text = cap[2].replace(/\n/g, ' '); var hasNonSpaceChars = /[^ ]/.test(text); - var hasSpaceCharsOnBothEnds = /^ /.test(text) && / $/.test(text); + var hasSpaceCharsOnBothEnds = text.startsWith(' ') && text.endsWith(' '); if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) { text = text.substring(1, text.length - 1); @@ -135697,8 +133197,8 @@ var marked = createCommonjsModule(function (module, exports) { */ var block = { - newline: /^(?: *(?:\n|$))+/, - code: /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, + newline: /^\n+/, + code: /^( {4}[^\n]+\n*)+/, fences: /^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/, hr: /^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/, heading: /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, @@ -135720,7 +133220,7 @@ var marked = createCommonjsModule(function (module, exports) { lheading: /^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/, // regex template, placeholders will be replaced according to different paragraph // interruption rules of commonmark and the original markdown spec: - _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/, + _paragraph: /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/, text: /^[^\n]+/ }; block._label = /(?!\s*\])(?:\\[\[\]]|[^\[\]])+/; @@ -136022,10 +133522,7 @@ var marked = createCommonjsModule(function (module, exports) { top = true; } - if (this.options.pedantic) { - src = src.replace(/^ +$/gm, ''); - } - + src = src.replace(/^ +$/gm, ''); var token, i, l, lastToken; while (src) { @@ -136446,8 +133943,6 @@ var marked = createCommonjsModule(function (module, exports) { } } - _code = _code.replace(/\n$/, '') + '\n'; - if (!lang) { return '
' + (escaped ? _code : escape$1(_code, true)) + '
\n'; } @@ -137498,7 +134993,7 @@ const findRepository = async repositoryName => { return false; }; -const createRepository = async repositoryName => post(eq(201), 'user/repos', { +const createRepository = async (repositoryName) => post(eq(201), 'user/repos', { name: repositoryName, auto_init: true }); @@ -137654,7 +135149,7 @@ class Ui extends react.PureComponent { files: [], selectedPaths: [], notebookData: [], - domElementByHash: new Map() + jsEditorAdvice: {} }; this.onChangeJsEditor = this.onChangeJsEditor.bind(this); this.onClickEditorLink = this.onClickEditorLink.bind(this); @@ -137759,7 +135254,7 @@ class Ui extends react.PureComponent { workspace }); // Invalidate the path in all workers. - await askServices({ + await tellServices({ touchFile: { path, workspace @@ -137786,6 +135281,7 @@ class Ui extends react.PureComponent { this.setState({ logLastDate: now }); + return; } const { @@ -138414,6 +135910,7 @@ class Ui extends react.PureComponent { const { ask, jsEditorData, + jsEditorAdvice, path, workspace } = this.state; @@ -138451,6 +135948,7 @@ class Ui extends react.PureComponent { path, topLevel }); + jsEditorAdvice.definitions = topLevel; await ask({ evaluate: ecmascript, workspace, @@ -138535,10 +136033,10 @@ class Ui extends react.PureComponent { render() { const { ask, - domElementByHash, file, path, jsEditorData = '', + jsEditorAdvice, files, mode = 'Notebook', modal, @@ -138700,8 +136198,7 @@ class Ui extends react.PureComponent { data: jsEditorData, file: file, ask: ask, - workspace: workspace, - domElementByHash: domElementByHash + workspace: workspace }))))); } else if (file.endsWith('.cloud')) { const resolution = 0.25; @@ -138783,8 +136280,7 @@ class Ui extends react.PureComponent { data: jsEditorData, file: file, ask: ask, - workspace: workspace, - domElementByHash: domElementByHash + workspace: workspace }))))); } else if (file.endsWith('.stl')) { panes.push( /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement(SplitPane, { @@ -138802,8 +136298,7 @@ class Ui extends react.PureComponent { data: jsEditorData, file: file, ask: ask, - workspace: workspace, - domElementByHash: domElementByHash + workspace: workspace }))))); } else if (file.endsWith('.md')) { panes.push( /*#__PURE__*/react.createElement("div", null, /*#__PURE__*/react.createElement(SplitPane, { @@ -138828,8 +136323,7 @@ class Ui extends react.PureComponent { data: jsEditorData, file: file, ask: ask, - workspace: workspace, - domElementByHash: domElementByHash + workspace: workspace }))))); setTimeout(() => Mermaid.init(undefined, '.mermaid'), 0); } else { @@ -138901,11 +136395,11 @@ class Ui extends react.PureComponent { onChange: this.onChangeJsEditor, onClickLink: this.onClickEditorLink, data: jsEditorData, + advice: jsEditorAdvice, file: file, ask: ask, workspace: workspace, - notebookData: notebookData, - domElementByHash: domElementByHash + notebookData: notebookData })))))))))); } } diff --git a/dist/maslowWorker.js b/dist/maslowWorker.js index 1d2981d2..09a51131 100644 --- a/dist/maslowWorker.js +++ b/dist/maslowWorker.js @@ -128,11 +128,13 @@ const maslowRead = async (path) => { const agent = async ({ ask, - question + question, + statement }) => { - if (question.touchFile) { - const { path, workspace } = question.touchFile; + if ((statement || question).touchFile) { + const { path, workspace } = (statement || question).touchFile; await touch(path, { workspace }); + return; } try{