(self["webpackChunkviewer"] = self["webpackChunkviewer"] || []).push([["vendor"],{ /***/ 41691 /*!****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/codec-charls/dist/charlswasm_decode.js ***! \****************************************************************************/ (module, __unused_webpack_exports, __webpack_require__) { var CharLSWASM = (() => { var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; return function (CharLSWASM) { CharLSWASM = CharLSWASM || {}; var Module = typeof CharLSWASM != "undefined" ? CharLSWASM : {}; var readyPromiseResolve, readyPromiseReject; Module["ready"] = new Promise(function (resolve, reject) { readyPromiseResolve = resolve; readyPromiseReject = reject; }); var moduleOverrides = Object.assign({}, Module); var arguments_ = []; var thisProgram = "./this.program"; var quit_ = (status, toThrow) => { throw toThrow; }; var ENVIRONMENT_IS_WEB = typeof window == "object"; var ENVIRONMENT_IS_WORKER = typeof importScripts == "function"; var ENVIRONMENT_IS_NODE = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string"; var scriptDirectory = ""; function locateFile(path) { if (Module["locateFile"]) { return Module["locateFile"](path, scriptDirectory); } return scriptDirectory + path; } var read_, readAsync, readBinary, setWindowTitle; function logExceptionOnExit(e) { if (e instanceof ExitStatus) return; let toLog = e; err("exiting due to exception: " + toLog); } if (ENVIRONMENT_IS_NODE) { var fs = __webpack_require__(/*! fs */ 6221); var nodePath = __webpack_require__(/*! path */ 53548); if (ENVIRONMENT_IS_WORKER) { scriptDirectory = nodePath.dirname(scriptDirectory) + "/"; } else { scriptDirectory = __dirname + "/"; } read_ = (filename, binary) => { filename = isFileURI(filename) ? new URL(filename) : nodePath.normalize(filename); return fs.readFileSync(filename, binary ? undefined : "utf8"); }; readBinary = filename => { var ret = read_(filename, true); if (!ret.buffer) { ret = new Uint8Array(ret); } return ret; }; readAsync = (filename, onload, onerror) => { filename = isFileURI(filename) ? new URL(filename) : nodePath.normalize(filename); fs.readFile(filename, function (err, data) { if (err) onerror(err);else onload(data.buffer); }); }; if (process["argv"].length > 1) { thisProgram = process["argv"][1].replace(/\\/g, "/"); } arguments_ = process["argv"].slice(2); process["on"]("uncaughtException", function (ex) { if (!(ex instanceof ExitStatus)) { throw ex; } }); process["on"]("unhandledRejection", function (reason) { throw reason; }); quit_ = (status, toThrow) => { if (keepRuntimeAlive()) { process["exitCode"] = status; throw toThrow; } logExceptionOnExit(toThrow); process["exit"](status); }; Module["inspect"] = function () { return "[Emscripten Module object]"; }; } 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.replace(/[?#].*/, "").lastIndexOf("/") + 1); } else { scriptDirectory = ""; } { read_ = url => { var xhr = new XMLHttpRequest(); xhr.open("GET", url, false); xhr.send(null); return xhr.responseText; }; if (ENVIRONMENT_IS_WORKER) { readBinary = url => { var xhr = new XMLHttpRequest(); xhr.open("GET", url, false); xhr.responseType = "arraybuffer"; xhr.send(null); return new Uint8Array(xhr.response); }; } readAsync = (url, onload, onerror) => { var xhr = new XMLHttpRequest(); xhr.open("GET", url, true); xhr.responseType = "arraybuffer"; xhr.onload = () => { if (xhr.status == 200 || xhr.status == 0 && xhr.response) { onload(xhr.response); return; } onerror(); }; xhr.onerror = onerror; xhr.send(null); }; } setWindowTitle = title => document.title = title; } else {} var out = Module["print"] || console.log.bind(console); var err = Module["printErr"] || console.warn.bind(console); Object.assign(Module, moduleOverrides); moduleOverrides = null; if (Module["arguments"]) arguments_ = Module["arguments"]; if (Module["thisProgram"]) thisProgram = Module["thisProgram"]; if (Module["quit"]) quit_ = Module["quit"]; var wasmBinary; if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"]; var noExitRuntime = Module["noExitRuntime"] || true; if (typeof WebAssembly != "object") { abort("no native wasm support detected"); } var wasmMemory; var ABORT = false; var EXITSTATUS; function assert(condition, text) { if (!condition) { abort(text); } } var UTF8Decoder = typeof TextDecoder != "undefined" ? new TextDecoder("utf8") : undefined; function UTF8ArrayToString(heapOrArray, idx, maxBytesToRead) { var endIdx = idx + maxBytesToRead; var endPtr = idx; while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr; if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) { return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr)); } var str = ""; while (idx < endPtr) { var u0 = heapOrArray[idx++]; if (!(u0 & 128)) { str += String.fromCharCode(u0); continue; } var u1 = heapOrArray[idx++] & 63; if ((u0 & 224) == 192) { str += String.fromCharCode((u0 & 31) << 6 | u1); continue; } var u2 = heapOrArray[idx++] & 63; if ((u0 & 240) == 224) { u0 = (u0 & 15) << 12 | u1 << 6 | u2; } else { u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[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; 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) { return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); } function lengthBytesUTF8(str) { var len = 0; for (var i = 0; i < str.length; ++i) { var c = str.charCodeAt(i); if (c <= 127) { len++; } else if (c <= 2047) { len += 2; } else if (c >= 55296 && c <= 57343) { len += 4; ++i; } else { len += 3; } } return len; } 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 INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 52428800; var wasmTable; var __ATPRERUN__ = []; var __ATINIT__ = []; var __ATPOSTRUN__ = []; var runtimeInitialized = false; function keepRuntimeAlive() { return noExitRuntime; } 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() { runtimeInitialized = true; callRuntimeCallbacks(__ATINIT__); } function postRun() { 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); } var runDependencies = 0; var runDependencyWatcher = null; var dependenciesFulfilled = null; function addRunDependency(id) { runDependencies++; if (Module["monitorRunDependencies"]) { Module["monitorRunDependencies"](runDependencies); } } function removeRunDependency(id) { runDependencies--; if (Module["monitorRunDependencies"]) { Module["monitorRunDependencies"](runDependencies); } if (runDependencies == 0) { if (runDependencyWatcher !== null) { clearInterval(runDependencyWatcher); runDependencyWatcher = null; } if (dependenciesFulfilled) { var callback = dependenciesFulfilled; dependenciesFulfilled = null; callback(); } } } function abort(what) { if (Module["onAbort"]) { Module["onAbort"](what); } what = "Aborted(" + what + ")"; err(what); ABORT = true; EXITSTATUS = 1; what += ". Build with -sASSERTIONS for more info."; 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://"); } var wasmBinaryFile; wasmBinaryFile = "charlswasm_decode.wasm"; if (!isDataURI(wasmBinaryFile)) { wasmBinaryFile = locateFile(wasmBinaryFile); } function getBinary(file) { try { if (file == wasmBinaryFile && wasmBinary) { return new Uint8Array(wasmBinary); } if (readBinary) { return readBinary(file); } 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 = { "a": asmLibraryArg }; function receiveInstance(instance, module) { var exports = instance.exports; Module["asm"] = exports; wasmMemory = Module["asm"]["z"]; updateGlobalBufferAndViews(wasmMemory.buffer); wasmTable = Module["asm"]["C"]; addOnInit(Module["asm"]["A"]); removeRunDependency("wasm-instantiate"); } addRunDependency("wasm-instantiate"); function receiveInstantiationResult(result) { receiveInstance(result["instance"]); } function instantiateArrayBuffer(receiver) { return getBinaryPromise().then(function (binary) { return WebAssembly.instantiate(binary, info); }).then(function (instance) { return instance; }).then(receiver, function (reason) { err("failed to asynchronously prepare wasm: " + reason); abort(reason); }); } function instantiateAsync() { if (!wasmBinary && typeof WebAssembly.instantiateStreaming == "function" && !isDataURI(wasmBinaryFile) && !isFileURI(wasmBinaryFile) && !ENVIRONMENT_IS_NODE && 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); readyPromiseReject(e); } } instantiateAsync().catch(readyPromiseReject); return {}; } function ExitStatus(status) { this.name = "ExitStatus"; this.message = "Program terminated with exit(" + status + ")"; this.status = status; } function callRuntimeCallbacks(callbacks) { while (callbacks.length > 0) { callbacks.shift()(Module); } } function ExceptionInfo(excPtr) { this.excPtr = excPtr; this.ptr = excPtr - 24; this.set_type = function (type) { HEAPU32[this.ptr + 4 >> 2] = type; }; this.get_type = function () { return HEAPU32[this.ptr + 4 >> 2]; }; this.set_destructor = function (destructor) { HEAPU32[this.ptr + 8 >> 2] = destructor; }; this.get_destructor = function () { return HEAPU32[this.ptr + 8 >> 2]; }; this.set_refcount = function (refcount) { HEAP32[this.ptr >> 2] = refcount; }; this.set_caught = function (caught) { caught = caught ? 1 : 0; HEAP8[this.ptr + 12 >> 0] = caught; }; this.get_caught = function () { return HEAP8[this.ptr + 12 >> 0] != 0; }; this.set_rethrown = function (rethrown) { rethrown = rethrown ? 1 : 0; HEAP8[this.ptr + 13 >> 0] = rethrown; }; this.get_rethrown = function () { return HEAP8[this.ptr + 13 >> 0] != 0; }; this.init = function (type, destructor) { this.set_adjusted_ptr(0); 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 >> 2]; HEAP32[this.ptr >> 2] = value + 1; }; this.release_ref = function () { var prev = HEAP32[this.ptr >> 2]; HEAP32[this.ptr >> 2] = prev - 1; return prev === 1; }; this.set_adjusted_ptr = function (adjustedPtr) { HEAPU32[this.ptr + 16 >> 2] = adjustedPtr; }; this.get_adjusted_ptr = function () { return HEAPU32[this.ptr + 16 >> 2]; }; this.get_exception_ptr = function () { var isPointer = ___cxa_is_pointer_type(this.get_type()); if (isPointer) { return HEAPU32[this.excPtr >> 2]; } var adjusted = this.get_adjusted_ptr(); if (adjusted !== 0) return adjusted; return this.excPtr; }; } var exceptionLast = 0; var uncaughtExceptionCount = 0; function ___cxa_throw(ptr, type, destructor) { var info = new ExceptionInfo(ptr); info.init(type, destructor); exceptionLast = ptr; uncaughtExceptionCount++; throw ptr; } var structRegistrations = {}; function runDestructors(destructors) { while (destructors.length) { var ptr = destructors.pop(); var del = destructors.pop(); del(ptr); } } function simpleReadValueFromPointer(pointer) { return this["fromWireType"](HEAP32[pointer >> 2]); } 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; } 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 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((dt, i) => { if (registeredTypes.hasOwnProperty(dt)) { typeConverters[i] = registeredTypes[dt]; } else { unregisteredTypes.push(dt); if (!awaitingDependencies.hasOwnProperty(dt)) { awaitingDependencies[dt] = []; } awaitingDependencies[dt].push(() => { typeConverters[i] = registeredTypes[dt]; ++registered; if (registered === unregisteredTypes.length) { onComplete(typeConverters); } }); } }); if (0 === unregisteredTypes.length) { onComplete(typeConverters); } } function __embind_finalize_value_object(structType) { var reg = structRegistrations[structType]; delete structRegistrations[structType]; var rawConstructor = reg.rawConstructor; var rawDestructor = reg.rawDestructor; var fieldRecords = reg.fields; var fieldTypes = fieldRecords.map(field => field.getterReturnType).concat(fieldRecords.map(field => field.setterArgumentType)); whenDependentTypesAreResolved([structType], fieldTypes, fieldTypes => { var fields = {}; fieldRecords.forEach((field, i) => { var fieldName = field.fieldName; var getterReturnType = fieldTypes[i]; var getter = field.getter; var getterContext = field.getterContext; var setterArgumentType = fieldTypes[i + fieldRecords.length]; var setter = field.setter; var setterContext = field.setterContext; fields[fieldName] = { read: ptr => { return getterReturnType["fromWireType"](getter(getterContext, ptr)); }, write: (ptr, o) => { var destructors = []; setter(setterContext, ptr, setterArgumentType["toWireType"](destructors, o)); runDestructors(destructors); } }; }); return [{ name: reg.name, "fromWireType": function (ptr) { var rv = {}; for (var i in fields) { rv[i] = fields[i].read(ptr); } rawDestructor(ptr); return rv; }, "toWireType": function (destructors, o) { for (var fieldName in fields) { if (!(fieldName in o)) { throw new TypeError('Missing field: "' + fieldName + '"'); } } var ptr = rawConstructor(); for (fieldName in fields) { fields[fieldName].write(ptr, o[fieldName]); } if (destructors !== null) { destructors.push(rawDestructor, ptr); } return ptr; }, "argPackAdvance": 8, "readValueFromPointer": simpleReadValueFromPointer, destructorFunction: rawDestructor }]; }); } 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 BindingError = undefined; function throwBindingError(message) { throw new BindingError(message); } function registerType(rawType, registeredInstance, 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(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 finalizationRegistry = 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 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); } var registeredPointers = {}; 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; } var deletionQueue = []; function flushPendingDeletes() { while (deletionQueue.length) { var obj = deletionQueue.pop(); obj.$$.deleteScheduled = false; obj["delete"](); } } var delayFunction = undefined; 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 attachFinalizer(handle) { if ("undefined" === typeof FinalizationRegistry) { attachFinalizer = handle => handle; return handle; } finalizationRegistry = new FinalizationRegistry(info => { releaseClassHandle(info.$$); }); attachFinalizer = handle => { var $$ = handle.$$; var hasSmartPtr = !!$$.smartPtr; if (hasSmartPtr) { var info = { $$: $$ }; finalizationRegistry.register(handle, info, handle); } return handle; }; detachFinalizer = handle => finalizationRegistry.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; } 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() {} 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 "' + embindRepr(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 "' + embindRepr(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.toHandle(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 "' + embindRepr(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 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 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) { var f = Module["dynCall_" + sig]; return args && args.length ? f.apply(null, [ptr].concat(args)) : f.call(null, ptr); } var wasmTableMirror = []; function getWasmTableEntry(funcPtr) { var func = wasmTableMirror[funcPtr]; if (!func) { if (funcPtr >= wasmTableMirror.length) wasmTableMirror.length = funcPtr + 1; wasmTableMirror[funcPtr] = func = wasmTable.get(funcPtr); } return func; } function dynCall(sig, ptr, args) { if (sig.includes("j")) { return dynCallLegacy(sig, ptr, args); } var rtn = getWasmTableEntry(ptr).apply(null, args); return rtn; } function getDynCaller(sig, ptr) { var argCache = []; return function () { argCache.length = 0; Object.assign(argCache, arguments); return dynCall(sig, ptr, argCache); }; } function embind__requireFunction(signature, rawFunction) { signature = readLatin1String(signature); function makeDynCaller() { if (signature.includes("j")) { return getDynCaller(signature, rawFunction); } return getWasmTableEntry(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(HEAPU32[firstElement + i * 4 >> 2]); } return array; } 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"; } else {} invokerFnBody += "}\n"; args1.push(invokerFnBody); var invokerFunction = new_(Function, args1).apply(null, args2); return invokerFunction; } function __embind_register_class_constructor(rawClassType, argCount, rawArgTypesAddr, invokerSignature, invoker, rawConstructor) { assert(argCount > 0); var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr); invoker = embind__requireFunction(invokerSignature, invoker); 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] = () => { throwUnboundTypeError("Cannot construct " + classType.name + " due to unbound types", rawArgTypes); }; whenDependentTypesAreResolved([], rawArgTypes, function (argTypes) { argTypes.splice(1, 0, null); classType.registeredClass.constructor_body[argCount - 1] = craftInvokerFunction(humanName, argTypes, null, invoker, rawConstructor); return []; }); return []; }); } 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; } var Emval = { toValue: handle => { if (!handle) { throwBindingError("Cannot use deleted val. handle = " + handle); } return emval_handle_array[handle].value; }, toHandle: 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.toValue(handle); __emval_decref(handle); return rv; }, "toWireType": function (destructors, value) { return Emval.toHandle(value); }, "argPackAdvance": 8, "readValueFromPointer": simpleReadValueFromPointer, destructorFunction: null }); } function embindRepr(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) { 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 = value => value; if (minRange === 0) { var bitshift = 32 - 8 * size; fromWireType = value => value << bitshift >>> bitshift; } var isUnsignedType = name.includes("unsigned"); var checkAssertions = (value, toTypeName) => {}; var toWireType; if (isUnsignedType) { toWireType = function (destructors, value) { checkAssertions(value, this.name); return value >>> 0; }; } else { toWireType = function (destructors, value) { checkAssertions(value, this.name); return value; }; } registerType(primitiveType, { name: name, "fromWireType": fromWireType, "toWireType": toWireType, "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 payload = value + 4; var str; if (stdStringIsUTF8) { var decodeStartPtr = payload; for (var i = 0; i <= length; ++i) { var currentBytePtr = payload + 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[payload + i]); } str = a.join(""); } _free(value); return str; }, "toWireType": function (destructors, value) { if (value instanceof ArrayBuffer) { value = new Uint8Array(value); } var length; 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) { length = lengthBytesUTF8(value); } else { length = value.length; } var base = _malloc(4 + length + 1); var ptr = base + 4; HEAPU32[base >> 2] = length; if (stdStringIsUTF8 && valueIsOfTypeString) { stringToUTF8(value, ptr, 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 + i] = charCode; } } else { for (var i = 0; i < length; ++i) { HEAPU8[ptr + i] = value[i]; } } } if (destructors !== null) { destructors.push(_free, base); } return base; }, "argPackAdvance": 8, "readValueFromPointer": simpleReadValueFromPointer, destructorFunction: function (ptr) { _free(ptr); } }); } var UTF16Decoder = typeof TextDecoder != "undefined" ? new TextDecoder("utf-16le") : undefined; function UTF16ToString(ptr, maxBytesToRead) { 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)); 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) { 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) { 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) { 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 __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 = () => HEAPU16; shift = 1; } else if (charSize === 4) { decodeString = UTF32ToString; encodeString = stringToUTF32; lengthBytesUTF = lengthBytesUTF32; getHeap = () => 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_value_object(rawType, name, constructorSignature, rawConstructor, destructorSignature, rawDestructor) { structRegistrations[rawType] = { name: readLatin1String(name), rawConstructor: embind__requireFunction(constructorSignature, rawConstructor), rawDestructor: embind__requireFunction(destructorSignature, rawDestructor), fields: [] }; } function __embind_register_value_object_field(structType, fieldName, getterReturnType, getterSignature, getter, getterContext, setterArgumentType, setterSignature, setter, setterContext) { structRegistrations[structType].fields.push({ fieldName: readLatin1String(fieldName), getterReturnType: getterReturnType, getter: embind__requireFunction(getterSignature, getter), getterContext: getterContext, setterArgumentType: setterArgumentType, setter: embind__requireFunction(setterSignature, setter), setterContext: setterContext }); } 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; } }); } var emval_symbols = {}; function getStringOrSymbol(address) { var symbol = emval_symbols[address]; if (symbol === undefined) { return readLatin1String(address); } return symbol; } function emval_get_global() { if (typeof globalThis == "object") { return globalThis; } return function () { return Function; }()("return this")(); } function __emval_get_global(name) { if (name === 0) { return Emval.toHandle(emval_get_global()); } else { name = getStringOrSymbol(name); return Emval.toHandle(emval_get_global()[name]); } } function __emval_incref(handle) { if (handle > 4) { emval_handle_array[handle].refcount += 1; } } function requireRegisteredType(rawType, humanName) { var impl = registeredTypes[rawType]; if (undefined === impl) { throwBindingError(humanName + " has unknown type " + getTypeName(rawType)); } return impl; } function craftEmvalAllocator(argCount) { var argsList = ""; for (var i = 0; i < argCount; ++i) { argsList += (i !== 0 ? ", " : "") + "arg" + i; } var getMemory = () => HEAPU32; var functionBody = "return function emval_allocator_" + argCount + "(constructor, argTypes, args) {\n" + " var HEAPU32 = getMemory();\n"; for (var i = 0; i < argCount; ++i) { functionBody += "var argType" + i + " = requireRegisteredType(HEAPU32[((argTypes)>>2)], 'parameter " + i + "');\n" + "var arg" + i + " = argType" + i + ".readValueFromPointer(args);\n" + "args += argType" + i + "['argPackAdvance'];\n" + "argTypes += 4;\n"; } functionBody += "var obj = new constructor(" + argsList + ");\n" + "return valueToHandle(obj);\n" + "}\n"; return new Function("requireRegisteredType", "Module", "valueToHandle", "getMemory", functionBody)(requireRegisteredType, Module, Emval.toHandle, getMemory); } var emval_newers = {}; function __emval_new(handle, argCount, argTypes, args) { handle = Emval.toValue(handle); var newer = emval_newers[argCount]; if (!newer) { newer = craftEmvalAllocator(argCount); emval_newers[argCount] = newer; } return newer(handle, argTypes, args); } function __emval_take_value(type, arg) { type = requireRegisteredType(type, "_emval_take_value"); var v = type["readValueFromPointer"](arg); return Emval.toHandle(v); } function _abort() { abort(""); } function _emscripten_memcpy_big(dest, src, num) { HEAPU8.copyWithin(dest, src, src + num); } function getHeapMax() { return 2147483648; } function emscripten_realloc_buffer(size) { try { wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); updateGlobalBufferAndViews(wasmMemory.buffer); return 1; } catch (e) {} } function _emscripten_resize_heap(requestedSize) { var oldSize = HEAPU8.length; requestedSize = requestedSize >>> 0; var maxHeapSize = getHeapMax(); if (requestedSize > maxHeapSize) { return false; } let alignUp = (x, multiple) => x + (multiple - x % multiple) % multiple; 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; } } return false; } function getCFunc(ident) { var func = Module["_" + ident]; return func; } function writeArrayToMemory(array, buffer) { HEAP8.set(array, buffer); } function ccall(ident, returnType, argTypes, args, opts) { var toC = { "string": str => { var ret = 0; if (str !== null && str !== undefined && str !== 0) { var len = (str.length << 2) + 1; ret = stackAlloc(len); stringToUTF8(str, ret, len); } return ret; }, "array": arr => { var ret = stackAlloc(arr.length); writeArrayToMemory(arr, ret); return ret; } }; function convertReturnValue(ret) { if (returnType === "string") { return UTF8ToString(ret); } if (returnType === "boolean") return Boolean(ret); return ret; } var func = getCFunc(ident); var cArgs = []; var stack = 0; if (args) { for (var i = 0; i < args.length; i++) { var converter = toC[argTypes[i]]; if (converter) { if (stack === 0) stack = stackSave(); cArgs[i] = converter(args[i]); } else { cArgs[i] = args[i]; } } } var ret = func.apply(null, cArgs); function onDone(ret) { if (stack !== 0) stackRestore(stack); return convertReturnValue(ret); } ret = onDone(ret); return ret; } InternalError = Module["InternalError"] = extendError(Error, "InternalError"); embind_init_charCodes(); BindingError = Module["BindingError"] = extendError(Error, "BindingError"); init_ClassHandle(); init_embind(); init_RegisteredPointer(); UnboundTypeError = Module["UnboundTypeError"] = extendError(Error, "UnboundTypeError"); init_emval(); var asmLibraryArg = { "h": ___cxa_throw, "q": __embind_finalize_value_object, "r": __embind_register_bigint, "w": __embind_register_bool, "p": __embind_register_class, "o": __embind_register_class_constructor, "c": __embind_register_class_function, "v": __embind_register_emval, "k": __embind_register_float, "e": __embind_register_function, "b": __embind_register_integer, "a": __embind_register_memory_view, "j": __embind_register_std_string, "g": __embind_register_std_wstring, "u": __embind_register_value_object, "d": __embind_register_value_object_field, "x": __embind_register_void, "i": __emval_decref, "m": __emval_get_global, "l": __emval_incref, "y": __emval_new, "n": __emval_take_value, "f": _abort, "t": _emscripten_memcpy_big, "s": _emscripten_resize_heap }; var asm = createWasm(); var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function () { return (___wasm_call_ctors = Module["___wasm_call_ctors"] = Module["asm"]["A"]).apply(null, arguments); }; var _malloc = Module["_malloc"] = function () { return (_malloc = Module["_malloc"] = Module["asm"]["B"]).apply(null, arguments); }; var ___getTypeName = Module["___getTypeName"] = function () { return (___getTypeName = Module["___getTypeName"] = Module["asm"]["D"]).apply(null, arguments); }; var __embind_initialize_bindings = Module["__embind_initialize_bindings"] = function () { return (__embind_initialize_bindings = Module["__embind_initialize_bindings"] = Module["asm"]["E"]).apply(null, arguments); }; var _free = Module["_free"] = function () { return (_free = Module["_free"] = Module["asm"]["F"]).apply(null, arguments); }; var stackSave = Module["stackSave"] = function () { return (stackSave = Module["stackSave"] = Module["asm"]["G"]).apply(null, arguments); }; var stackRestore = Module["stackRestore"] = function () { return (stackRestore = Module["stackRestore"] = Module["asm"]["H"]).apply(null, arguments); }; var stackAlloc = Module["stackAlloc"] = function () { return (stackAlloc = Module["stackAlloc"] = Module["asm"]["I"]).apply(null, arguments); }; var ___cxa_is_pointer_type = Module["___cxa_is_pointer_type"] = function () { return (___cxa_is_pointer_type = Module["___cxa_is_pointer_type"] = Module["asm"]["J"]).apply(null, arguments); }; Module["ccall"] = ccall; var calledRun; dependenciesFulfilled = function runCaller() { if (!calledRun) run(); if (!calledRun) dependenciesFulfilled = runCaller; }; function run(args) { args = args || arguments_; if (runDependencies > 0) { return; } 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"](); postRun(); } if (Module["setStatus"]) { Module["setStatus"]("Running..."); setTimeout(function () { setTimeout(function () { Module["setStatus"](""); }, 1); doRun(); }, 1); } else { doRun(); } } if (Module["preInit"]) { if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]]; while (Module["preInit"].length > 0) { Module["preInit"].pop()(); } } run(); return CharLSWASM.ready; }; })(); if (true) module.exports = CharLSWASM;else // removed by dead control flow {} /***/ }, /***/ 21674 /*!**********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/codec-libjpeg-turbo-8bit/dist/libjpegturbowasm_decode.js ***! \**********************************************************************************************/ (module, __unused_webpack_exports, __webpack_require__) { var libjpegturbowasm_decode = (() => { var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; return function (libjpegturbowasm_decode) { libjpegturbowasm_decode = libjpegturbowasm_decode || {}; var Module = typeof libjpegturbowasm_decode != "undefined" ? libjpegturbowasm_decode : {}; var readyPromiseResolve, readyPromiseReject; Module["ready"] = new Promise(function (resolve, reject) { readyPromiseResolve = resolve; readyPromiseReject = reject; }); var moduleOverrides = Object.assign({}, Module); var arguments_ = []; var thisProgram = "./this.program"; var quit_ = (status, toThrow) => { throw toThrow; }; var ENVIRONMENT_IS_WEB = typeof window == "object"; var ENVIRONMENT_IS_WORKER = typeof importScripts == "function"; var ENVIRONMENT_IS_NODE = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string"; var scriptDirectory = ""; function locateFile(path) { if (Module["locateFile"]) { return Module["locateFile"](path, scriptDirectory); } return scriptDirectory + path; } var read_, readAsync, readBinary, setWindowTitle; function logExceptionOnExit(e) { if (e instanceof ExitStatus) return; let toLog = e; err("exiting due to exception: " + toLog); } if (ENVIRONMENT_IS_NODE) { var fs = __webpack_require__(/*! fs */ 64150); var nodePath = __webpack_require__(/*! path */ 53548); if (ENVIRONMENT_IS_WORKER) { scriptDirectory = nodePath.dirname(scriptDirectory) + "/"; } else { scriptDirectory = __dirname + "/"; } read_ = (filename, binary) => { filename = isFileURI(filename) ? new URL(filename) : nodePath.normalize(filename); return fs.readFileSync(filename, binary ? undefined : "utf8"); }; readBinary = filename => { var ret = read_(filename, true); if (!ret.buffer) { ret = new Uint8Array(ret); } return ret; }; readAsync = (filename, onload, onerror) => { filename = isFileURI(filename) ? new URL(filename) : nodePath.normalize(filename); fs.readFile(filename, function (err, data) { if (err) onerror(err);else onload(data.buffer); }); }; if (process["argv"].length > 1) { thisProgram = process["argv"][1].replace(/\\/g, "/"); } arguments_ = process["argv"].slice(2); process["on"]("uncaughtException", function (ex) { if (!(ex instanceof ExitStatus)) { throw ex; } }); process["on"]("unhandledRejection", function (reason) { throw reason; }); quit_ = (status, toThrow) => { if (keepRuntimeAlive()) { process["exitCode"] = status; throw toThrow; } logExceptionOnExit(toThrow); process["exit"](status); }; Module["inspect"] = function () { return "[Emscripten Module object]"; }; } 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.replace(/[?#].*/, "").lastIndexOf("/") + 1); } else { scriptDirectory = ""; } { read_ = url => { var xhr = new XMLHttpRequest(); xhr.open("GET", url, false); xhr.send(null); return xhr.responseText; }; if (ENVIRONMENT_IS_WORKER) { readBinary = url => { var xhr = new XMLHttpRequest(); xhr.open("GET", url, false); xhr.responseType = "arraybuffer"; xhr.send(null); return new Uint8Array(xhr.response); }; } readAsync = (url, onload, onerror) => { var xhr = new XMLHttpRequest(); xhr.open("GET", url, true); xhr.responseType = "arraybuffer"; xhr.onload = () => { if (xhr.status == 200 || xhr.status == 0 && xhr.response) { onload(xhr.response); return; } onerror(); }; xhr.onerror = onerror; xhr.send(null); }; } setWindowTitle = title => document.title = title; } else {} var out = Module["print"] || console.log.bind(console); var err = Module["printErr"] || console.warn.bind(console); Object.assign(Module, moduleOverrides); moduleOverrides = null; if (Module["arguments"]) arguments_ = Module["arguments"]; if (Module["thisProgram"]) thisProgram = Module["thisProgram"]; if (Module["quit"]) quit_ = Module["quit"]; var wasmBinary; if (Module["wasmBinary"]) wasmBinary = Module["wasmBinary"]; var noExitRuntime = Module["noExitRuntime"] || true; if (typeof WebAssembly != "object") { abort("no native wasm support detected"); } var wasmMemory; var ABORT = false; var EXITSTATUS; function assert(condition, text) { if (!condition) { abort(text); } } var UTF8Decoder = typeof TextDecoder != "undefined" ? new TextDecoder("utf8") : undefined; function UTF8ArrayToString(heapOrArray, idx, maxBytesToRead) { var endIdx = idx + maxBytesToRead; var endPtr = idx; while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr; if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) { return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr)); } var str = ""; while (idx < endPtr) { var u0 = heapOrArray[idx++]; if (!(u0 & 128)) { str += String.fromCharCode(u0); continue; } var u1 = heapOrArray[idx++] & 63; if ((u0 & 224) == 192) { str += String.fromCharCode((u0 & 31) << 6 | u1); continue; } var u2 = heapOrArray[idx++] & 63; if ((u0 & 240) == 224) { u0 = (u0 & 15) << 12 | u1 << 6 | u2; } else { u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[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; 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) { return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); } function lengthBytesUTF8(str) { var len = 0; for (var i = 0; i < str.length; ++i) { var c = str.charCodeAt(i); if (c <= 127) { len++; } else if (c <= 2047) { len += 2; } else if (c >= 55296 && c <= 57343) { len += 4; ++i; } else { len += 3; } } return len; } 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 INITIAL_MEMORY = Module["INITIAL_MEMORY"] || 52428800; var wasmTable; var __ATPRERUN__ = []; var __ATINIT__ = []; var __ATPOSTRUN__ = []; var runtimeInitialized = false; function keepRuntimeAlive() { return noExitRuntime; } 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() { runtimeInitialized = true; callRuntimeCallbacks(__ATINIT__); } function postRun() { 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); } var runDependencies = 0; var runDependencyWatcher = null; var dependenciesFulfilled = null; function addRunDependency(id) { runDependencies++; if (Module["monitorRunDependencies"]) { Module["monitorRunDependencies"](runDependencies); } } function removeRunDependency(id) { runDependencies--; if (Module["monitorRunDependencies"]) { Module["monitorRunDependencies"](runDependencies); } if (runDependencies == 0) { if (runDependencyWatcher !== null) { clearInterval(runDependencyWatcher); runDependencyWatcher = null; } if (dependenciesFulfilled) { var callback = dependenciesFulfilled; dependenciesFulfilled = null; callback(); } } } function abort(what) { if (Module["onAbort"]) { Module["onAbort"](what); } what = "Aborted(" + what + ")"; err(what); ABORT = true; EXITSTATUS = 1; what += ". Build with -sASSERTIONS for more info."; 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://"); } var wasmBinaryFile; wasmBinaryFile = "libjpegturbowasm_decode.wasm"; if (!isDataURI(wasmBinaryFile)) { wasmBinaryFile = locateFile(wasmBinaryFile); } function getBinary(file) { try { if (file == wasmBinaryFile && wasmBinary) { return new Uint8Array(wasmBinary); } if (readBinary) { return readBinary(file); } 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 = { "a": asmLibraryArg }; function receiveInstance(instance, module) { var exports = instance.exports; Module["asm"] = exports; wasmMemory = Module["asm"]["K"]; updateGlobalBufferAndViews(wasmMemory.buffer); wasmTable = Module["asm"]["M"]; addOnInit(Module["asm"]["L"]); removeRunDependency("wasm-instantiate"); } addRunDependency("wasm-instantiate"); function receiveInstantiationResult(result) { receiveInstance(result["instance"]); } function instantiateArrayBuffer(receiver) { return getBinaryPromise().then(function (binary) { return WebAssembly.instantiate(binary, info); }).then(function (instance) { return instance; }).then(receiver, function (reason) { err("failed to asynchronously prepare wasm: " + reason); abort(reason); }); } function instantiateAsync() { if (!wasmBinary && typeof WebAssembly.instantiateStreaming == "function" && !isDataURI(wasmBinaryFile) && !isFileURI(wasmBinaryFile) && !ENVIRONMENT_IS_NODE && 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); readyPromiseReject(e); } } instantiateAsync().catch(readyPromiseReject); return {}; } function ExitStatus(status) { this.name = "ExitStatus"; this.message = "Program terminated with exit(" + status + ")"; this.status = status; } function callRuntimeCallbacks(callbacks) { while (callbacks.length > 0) { callbacks.shift()(Module); } } function ExceptionInfo(excPtr) { this.excPtr = excPtr; this.ptr = excPtr - 24; this.set_type = function (type) { HEAPU32[this.ptr + 4 >> 2] = type; }; this.get_type = function () { return HEAPU32[this.ptr + 4 >> 2]; }; this.set_destructor = function (destructor) { HEAPU32[this.ptr + 8 >> 2] = destructor; }; this.get_destructor = function () { return HEAPU32[this.ptr + 8 >> 2]; }; this.set_refcount = function (refcount) { HEAP32[this.ptr >> 2] = refcount; }; this.set_caught = function (caught) { caught = caught ? 1 : 0; HEAP8[this.ptr + 12 >> 0] = caught; }; this.get_caught = function () { return HEAP8[this.ptr + 12 >> 0] != 0; }; this.set_rethrown = function (rethrown) { rethrown = rethrown ? 1 : 0; HEAP8[this.ptr + 13 >> 0] = rethrown; }; this.get_rethrown = function () { return HEAP8[this.ptr + 13 >> 0] != 0; }; this.init = function (type, destructor) { this.set_adjusted_ptr(0); 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 >> 2]; HEAP32[this.ptr >> 2] = value + 1; }; this.release_ref = function () { var prev = HEAP32[this.ptr >> 2]; HEAP32[this.ptr >> 2] = prev - 1; return prev === 1; }; this.set_adjusted_ptr = function (adjustedPtr) { HEAPU32[this.ptr + 16 >> 2] = adjustedPtr; }; this.get_adjusted_ptr = function () { return HEAPU32[this.ptr + 16 >> 2]; }; this.get_exception_ptr = function () { var isPointer = ___cxa_is_pointer_type(this.get_type()); if (isPointer) { return HEAPU32[this.excPtr >> 2]; } var adjusted = this.get_adjusted_ptr(); if (adjusted !== 0) return adjusted; return this.excPtr; }; } var exceptionLast = 0; var uncaughtExceptionCount = 0; function ___cxa_throw(ptr, type, destructor) { var info = new ExceptionInfo(ptr); info.init(type, destructor); exceptionLast = ptr; uncaughtExceptionCount++; throw ptr; } var structRegistrations = {}; function runDestructors(destructors) { while (destructors.length) { var ptr = destructors.pop(); var del = destructors.pop(); del(ptr); } } function simpleReadValueFromPointer(pointer) { return this["fromWireType"](HEAP32[pointer >> 2]); } 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; } 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 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((dt, i) => { if (registeredTypes.hasOwnProperty(dt)) { typeConverters[i] = registeredTypes[dt]; } else { unregisteredTypes.push(dt); if (!awaitingDependencies.hasOwnProperty(dt)) { awaitingDependencies[dt] = []; } awaitingDependencies[dt].push(() => { typeConverters[i] = registeredTypes[dt]; ++registered; if (registered === unregisteredTypes.length) { onComplete(typeConverters); } }); } }); if (0 === unregisteredTypes.length) { onComplete(typeConverters); } } function __embind_finalize_value_object(structType) { var reg = structRegistrations[structType]; delete structRegistrations[structType]; var rawConstructor = reg.rawConstructor; var rawDestructor = reg.rawDestructor; var fieldRecords = reg.fields; var fieldTypes = fieldRecords.map(field => field.getterReturnType).concat(fieldRecords.map(field => field.setterArgumentType)); whenDependentTypesAreResolved([structType], fieldTypes, fieldTypes => { var fields = {}; fieldRecords.forEach((field, i) => { var fieldName = field.fieldName; var getterReturnType = fieldTypes[i]; var getter = field.getter; var getterContext = field.getterContext; var setterArgumentType = fieldTypes[i + fieldRecords.length]; var setter = field.setter; var setterContext = field.setterContext; fields[fieldName] = { read: ptr => { return getterReturnType["fromWireType"](getter(getterContext, ptr)); }, write: (ptr, o) => { var destructors = []; setter(setterContext, ptr, setterArgumentType["toWireType"](destructors, o)); runDestructors(destructors); } }; }); return [{ name: reg.name, "fromWireType": function (ptr) { var rv = {}; for (var i in fields) { rv[i] = fields[i].read(ptr); } rawDestructor(ptr); return rv; }, "toWireType": function (destructors, o) { for (var fieldName in fields) { if (!(fieldName in o)) { throw new TypeError('Missing field: "' + fieldName + '"'); } } var ptr = rawConstructor(); for (fieldName in fields) { fields[fieldName].write(ptr, o[fieldName]); } if (destructors !== null) { destructors.push(rawDestructor, ptr); } return ptr; }, "argPackAdvance": 8, "readValueFromPointer": simpleReadValueFromPointer, destructorFunction: rawDestructor }]; }); } 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 BindingError = undefined; function throwBindingError(message) { throw new BindingError(message); } function registerType(rawType, registeredInstance, 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(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 finalizationRegistry = 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 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); } var registeredPointers = {}; 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; } var deletionQueue = []; function flushPendingDeletes() { while (deletionQueue.length) { var obj = deletionQueue.pop(); obj.$$.deleteScheduled = false; obj["delete"](); } } var delayFunction = undefined; 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 attachFinalizer(handle) { if ("undefined" === typeof FinalizationRegistry) { attachFinalizer = handle => handle; return handle; } finalizationRegistry = new FinalizationRegistry(info => { releaseClassHandle(info.$$); }); attachFinalizer = handle => { var $$ = handle.$$; var hasSmartPtr = !!$$.smartPtr; if (hasSmartPtr) { var info = { $$: $$ }; finalizationRegistry.register(handle, info, handle); } return handle; }; detachFinalizer = handle => finalizationRegistry.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; } 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() {} 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 "' + embindRepr(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 "' + embindRepr(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.toHandle(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 "' + embindRepr(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 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 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) { var f = Module["dynCall_" + sig]; return args && args.length ? f.apply(null, [ptr].concat(args)) : f.call(null, ptr); } var wasmTableMirror = []; function getWasmTableEntry(funcPtr) { var func = wasmTableMirror[funcPtr]; if (!func) { if (funcPtr >= wasmTableMirror.length) wasmTableMirror.length = funcPtr + 1; wasmTableMirror[funcPtr] = func = wasmTable.get(funcPtr); } return func; } function dynCall(sig, ptr, args) { if (sig.includes("j")) { return dynCallLegacy(sig, ptr, args); } var rtn = getWasmTableEntry(ptr).apply(null, args); return rtn; } function getDynCaller(sig, ptr) { var argCache = []; return function () { argCache.length = 0; Object.assign(argCache, arguments); return dynCall(sig, ptr, argCache); }; } function embind__requireFunction(signature, rawFunction) { signature = readLatin1String(signature); function makeDynCaller() { if (signature.includes("j")) { return getDynCaller(signature, rawFunction); } return getWasmTableEntry(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(HEAPU32[firstElement + i * 4 >> 2]); } return array; } 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"; } else {} invokerFnBody += "}\n"; args1.push(invokerFnBody); var invokerFunction = new_(Function, args1).apply(null, args2); return invokerFunction; } function __embind_register_class_constructor(rawClassType, argCount, rawArgTypesAddr, invokerSignature, invoker, rawConstructor) { assert(argCount > 0); var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr); invoker = embind__requireFunction(invokerSignature, invoker); 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] = () => { throwUnboundTypeError("Cannot construct " + classType.name + " due to unbound types", rawArgTypes); }; whenDependentTypesAreResolved([], rawArgTypes, function (argTypes) { argTypes.splice(1, 0, null); classType.registeredClass.constructor_body[argCount - 1] = craftInvokerFunction(humanName, argTypes, null, invoker, rawConstructor); return []; }); return []; }); } 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; } var Emval = { toValue: handle => { if (!handle) { throwBindingError("Cannot use deleted val. handle = " + handle); } return emval_handle_array[handle].value; }, toHandle: 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.toValue(handle); __emval_decref(handle); return rv; }, "toWireType": function (destructors, value) { return Emval.toHandle(value); }, "argPackAdvance": 8, "readValueFromPointer": simpleReadValueFromPointer, destructorFunction: null }); } function embindRepr(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) { return value; }, "argPackAdvance": 8, "readValueFromPointer": floatReadValueFromPointer(name, shift), destructorFunction: null }); } 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 = value => value; if (minRange === 0) { var bitshift = 32 - 8 * size; fromWireType = value => value << bitshift >>> bitshift; } var isUnsignedType = name.includes("unsigned"); var checkAssertions = (value, toTypeName) => {}; var toWireType; if (isUnsignedType) { toWireType = function (destructors, value) { checkAssertions(value, this.name); return value >>> 0; }; } else { toWireType = function (destructors, value) { checkAssertions(value, this.name); return value; }; } registerType(primitiveType, { name: name, "fromWireType": fromWireType, "toWireType": toWireType, "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 payload = value + 4; var str; if (stdStringIsUTF8) { var decodeStartPtr = payload; for (var i = 0; i <= length; ++i) { var currentBytePtr = payload + 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[payload + i]); } str = a.join(""); } _free(value); return str; }, "toWireType": function (destructors, value) { if (value instanceof ArrayBuffer) { value = new Uint8Array(value); } var length; 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) { length = lengthBytesUTF8(value); } else { length = value.length; } var base = _malloc(4 + length + 1); var ptr = base + 4; HEAPU32[base >> 2] = length; if (stdStringIsUTF8 && valueIsOfTypeString) { stringToUTF8(value, ptr, 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 + i] = charCode; } } else { for (var i = 0; i < length; ++i) { HEAPU8[ptr + i] = value[i]; } } } if (destructors !== null) { destructors.push(_free, base); } return base; }, "argPackAdvance": 8, "readValueFromPointer": simpleReadValueFromPointer, destructorFunction: function (ptr) { _free(ptr); } }); } var UTF16Decoder = typeof TextDecoder != "undefined" ? new TextDecoder("utf-16le") : undefined; function UTF16ToString(ptr, maxBytesToRead) { 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)); 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) { 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) { 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) { 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 __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 = () => HEAPU16; shift = 1; } else if (charSize === 4) { decodeString = UTF32ToString; encodeString = stringToUTF32; lengthBytesUTF = lengthBytesUTF32; getHeap = () => 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_value_object(rawType, name, constructorSignature, rawConstructor, destructorSignature, rawDestructor) { structRegistrations[rawType] = { name: readLatin1String(name), rawConstructor: embind__requireFunction(constructorSignature, rawConstructor), rawDestructor: embind__requireFunction(destructorSignature, rawDestructor), fields: [] }; } function __embind_register_value_object_field(structType, fieldName, getterReturnType, getterSignature, getter, getterContext, setterArgumentType, setterSignature, setter, setterContext) { structRegistrations[structType].fields.push({ fieldName: readLatin1String(fieldName), getterReturnType: getterReturnType, getter: embind__requireFunction(getterSignature, getter), getterContext: getterContext, setterArgumentType: setterArgumentType, setter: embind__requireFunction(setterSignature, setter), setterContext: setterContext }); } 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 __emscripten_throw_longjmp() { throw Infinity; } var emval_symbols = {}; function getStringOrSymbol(address) { var symbol = emval_symbols[address]; if (symbol === undefined) { return readLatin1String(address); } return symbol; } function emval_get_global() { if (typeof globalThis == "object") { return globalThis; } return function () { return Function; }()("return this")(); } function __emval_get_global(name) { if (name === 0) { return Emval.toHandle(emval_get_global()); } else { name = getStringOrSymbol(name); return Emval.toHandle(emval_get_global()[name]); } } function __emval_incref(handle) { if (handle > 4) { emval_handle_array[handle].refcount += 1; } } function requireRegisteredType(rawType, humanName) { var impl = registeredTypes[rawType]; if (undefined === impl) { throwBindingError(humanName + " has unknown type " + getTypeName(rawType)); } return impl; } function craftEmvalAllocator(argCount) { var argsList = ""; for (var i = 0; i < argCount; ++i) { argsList += (i !== 0 ? ", " : "") + "arg" + i; } var getMemory = () => HEAPU32; var functionBody = "return function emval_allocator_" + argCount + "(constructor, argTypes, args) {\n" + " var HEAPU32 = getMemory();\n"; for (var i = 0; i < argCount; ++i) { functionBody += "var argType" + i + " = requireRegisteredType(HEAPU32[((argTypes)>>2)], 'parameter " + i + "');\n" + "var arg" + i + " = argType" + i + ".readValueFromPointer(args);\n" + "args += argType" + i + "['argPackAdvance'];\n" + "argTypes += 4;\n"; } functionBody += "var obj = new constructor(" + argsList + ");\n" + "return valueToHandle(obj);\n" + "}\n"; return new Function("requireRegisteredType", "Module", "valueToHandle", "getMemory", functionBody)(requireRegisteredType, Module, Emval.toHandle, getMemory); } var emval_newers = {}; function __emval_new(handle, argCount, argTypes, args) { handle = Emval.toValue(handle); var newer = emval_newers[argCount]; if (!newer) { newer = craftEmvalAllocator(argCount); emval_newers[argCount] = newer; } return newer(handle, argTypes, args); } function __emval_take_value(type, arg) { type = requireRegisteredType(type, "_emval_take_value"); var v = type["readValueFromPointer"](arg); return Emval.toHandle(v); } function _abort() { abort(""); } function _emscripten_memcpy_big(dest, src, num) { HEAPU8.copyWithin(dest, src, src + num); } function getHeapMax() { return 2147483648; } function emscripten_realloc_buffer(size) { try { wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); updateGlobalBufferAndViews(wasmMemory.buffer); return 1; } catch (e) {} } function _emscripten_resize_heap(requestedSize) { var oldSize = HEAPU8.length; requestedSize = requestedSize >>> 0; var maxHeapSize = getHeapMax(); if (requestedSize > maxHeapSize) { return false; } let alignUp = (x, multiple) => x + (multiple - x % multiple) % multiple; 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; } } 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 writeAsciiToMemory(str, buffer, dontAddNull) { for (var i = 0; i < str.length; ++i) { HEAP8[buffer++ >> 0] = str.charCodeAt(i); } if (!dontAddNull) HEAP8[buffer >> 0] = 0; } var SYSCALLS = { varargs: undefined, get: function () { SYSCALLS.varargs += 4; var ret = HEAP32[SYSCALLS.varargs - 4 >> 2]; return ret; }, getStr: function (ptr) { var ret = UTF8ToString(ptr); return ret; } }; function _environ_get(__environ, environ_buf) { var bufSize = 0; getEnvStrings().forEach(function (string, i) { var ptr = environ_buf + bufSize; HEAPU32[__environ + i * 4 >> 2] = ptr; writeAsciiToMemory(string, ptr); bufSize += string.length + 1; }); return 0; } function _environ_sizes_get(penviron_count, penviron_buf_size) { var strings = getEnvStrings(); HEAPU32[penviron_count >> 2] = strings.length; var bufSize = 0; strings.forEach(function (string) { bufSize += string.length + 1; }); HEAPU32[penviron_buf_size >> 2] = bufSize; return 0; } function _proc_exit(code) { EXITSTATUS = code; if (!keepRuntimeAlive()) { if (Module["onExit"]) Module["onExit"](code); ABORT = true; } quit_(code, new ExitStatus(code)); } function exitJS(status, implicit) { EXITSTATUS = status; _proc_exit(status); } var _exit = exitJS; function _fd_close(fd) { return 52; } function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { return 70; } var printCharBuffers = [null, [], []]; function printChar(stream, curr) { var buffer = printCharBuffers[stream]; if (curr === 0 || curr === 10) { (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0)); buffer.length = 0; } else { buffer.push(curr); } } function _fd_write(fd, iov, iovcnt, pnum) { var num = 0; for (var i = 0; i < iovcnt; i++) { var ptr = HEAPU32[iov >> 2]; var len = HEAPU32[iov + 4 >> 2]; iov += 8; for (var j = 0; j < len; j++) { printChar(fd, HEAPU8[ptr + j]); } num += len; } HEAPU32[pnum >> 2] = num; return 0; } function getCFunc(ident) { var func = Module["_" + ident]; return func; } function writeArrayToMemory(array, buffer) { HEAP8.set(array, buffer); } function ccall(ident, returnType, argTypes, args, opts) { var toC = { "string": str => { var ret = 0; if (str !== null && str !== undefined && str !== 0) { var len = (str.length << 2) + 1; ret = stackAlloc(len); stringToUTF8(str, ret, len); } return ret; }, "array": arr => { var ret = stackAlloc(arr.length); writeArrayToMemory(arr, ret); return ret; } }; function convertReturnValue(ret) { if (returnType === "string") { return UTF8ToString(ret); } if (returnType === "boolean") return Boolean(ret); return ret; } var func = getCFunc(ident); var cArgs = []; var stack = 0; if (args) { for (var i = 0; i < args.length; i++) { var converter = toC[argTypes[i]]; if (converter) { if (stack === 0) stack = stackSave(); cArgs[i] = converter(args[i]); } else { cArgs[i] = args[i]; } } } var ret = func.apply(null, cArgs); function onDone(ret) { if (stack !== 0) stackRestore(stack); return convertReturnValue(ret); } ret = onDone(ret); return ret; } InternalError = Module["InternalError"] = extendError(Error, "InternalError"); embind_init_charCodes(); BindingError = Module["BindingError"] = extendError(Error, "BindingError"); init_ClassHandle(); init_embind(); init_RegisteredPointer(); UnboundTypeError = Module["UnboundTypeError"] = extendError(Error, "UnboundTypeError"); init_emval(); var asmLibraryArg = { "g": ___cxa_throw, "A": __embind_finalize_value_object, "w": __embind_register_bigint, "F": __embind_register_bool, "u": __embind_register_class, "t": __embind_register_class_constructor, "c": __embind_register_class_function, "E": __embind_register_emval, "m": __embind_register_float, "b": __embind_register_integer, "a": __embind_register_memory_view, "l": __embind_register_std_string, "h": __embind_register_std_wstring, "J": __embind_register_value_object, "d": __embind_register_value_object_field, "G": __embind_register_void, "x": __emscripten_throw_longjmp, "i": __emval_decref, "r": __emval_get_global, "p": __emval_incref, "q": __emval_new, "s": __emval_take_value, "j": _abort, "D": _emscripten_memcpy_big, "y": _emscripten_resize_heap, "z": _environ_get, "B": _environ_sizes_get, "I": _exit, "C": _fd_close, "v": _fd_seek, "k": _fd_write, "o": invoke_ii, "n": invoke_iii, "H": invoke_iiii, "f": invoke_vi, "e": invoke_viii }; var asm = createWasm(); var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function () { return (___wasm_call_ctors = Module["___wasm_call_ctors"] = Module["asm"]["L"]).apply(null, arguments); }; var _malloc = Module["_malloc"] = function () { return (_malloc = Module["_malloc"] = Module["asm"]["N"]).apply(null, arguments); }; var _free = Module["_free"] = function () { return (_free = Module["_free"] = Module["asm"]["O"]).apply(null, arguments); }; var ___getTypeName = Module["___getTypeName"] = function () { return (___getTypeName = Module["___getTypeName"] = Module["asm"]["P"]).apply(null, arguments); }; var __embind_initialize_bindings = Module["__embind_initialize_bindings"] = function () { return (__embind_initialize_bindings = Module["__embind_initialize_bindings"] = Module["asm"]["Q"]).apply(null, arguments); }; var _setThrew = Module["_setThrew"] = function () { return (_setThrew = Module["_setThrew"] = Module["asm"]["R"]).apply(null, arguments); }; var stackSave = Module["stackSave"] = function () { return (stackSave = Module["stackSave"] = Module["asm"]["S"]).apply(null, arguments); }; var stackRestore = Module["stackRestore"] = function () { return (stackRestore = Module["stackRestore"] = Module["asm"]["T"]).apply(null, arguments); }; var stackAlloc = Module["stackAlloc"] = function () { return (stackAlloc = Module["stackAlloc"] = Module["asm"]["U"]).apply(null, arguments); }; var ___cxa_is_pointer_type = Module["___cxa_is_pointer_type"] = function () { return (___cxa_is_pointer_type = Module["___cxa_is_pointer_type"] = Module["asm"]["V"]).apply(null, arguments); }; var dynCall_jiji = Module["dynCall_jiji"] = function () { return (dynCall_jiji = Module["dynCall_jiji"] = Module["asm"]["W"]).apply(null, arguments); }; function invoke_vi(index, a1) { var sp = stackSave(); try { getWasmTableEntry(index)(a1); } catch (e) { stackRestore(sp); if (e !== e + 0) throw e; _setThrew(1, 0); } } function invoke_ii(index, a1) { var sp = stackSave(); try { return getWasmTableEntry(index)(a1); } catch (e) { stackRestore(sp); if (e !== e + 0) throw e; _setThrew(1, 0); } } function invoke_viii(index, a1, a2, a3) { var sp = stackSave(); try { getWasmTableEntry(index)(a1, a2, a3); } catch (e) { stackRestore(sp); if (e !== e + 0) throw e; _setThrew(1, 0); } } function invoke_iiii(index, a1, a2, a3) { var sp = stackSave(); try { return getWasmTableEntry(index)(a1, a2, a3); } catch (e) { stackRestore(sp); if (e !== e + 0) throw e; _setThrew(1, 0); } } function invoke_iii(index, a1, a2) { var sp = stackSave(); try { return getWasmTableEntry(index)(a1, a2); } catch (e) { stackRestore(sp); if (e !== e + 0) throw e; _setThrew(1, 0); } } Module["ccall"] = ccall; var calledRun; dependenciesFulfilled = function runCaller() { if (!calledRun) run(); if (!calledRun) dependenciesFulfilled = runCaller; }; function run(args) { args = args || arguments_; if (runDependencies > 0) { return; } 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"](); postRun(); } if (Module["setStatus"]) { Module["setStatus"]("Running..."); setTimeout(function () { setTimeout(function () { Module["setStatus"](""); }, 1); doRun(); }, 1); } else { doRun(); } } if (Module["preInit"]) { if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]]; while (Module["preInit"].length > 0) { Module["preInit"].pop()(); } } run(); return libjpegturbowasm_decode.ready; }; })(); if (true) module.exports = libjpegturbowasm_decode;else // removed by dead control flow {} /***/ }, /***/ 57595 /*!********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/codec-openjpeg/dist/openjpegwasm_decode.js ***! \********************************************************************************/ (module, __unused_webpack_exports, __webpack_require__) { var _asyncToGenerator = (__webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/asyncToGenerator.js */ 87687)["default"]); var OpenJPEGWASM = (() => { var _scriptName = typeof document != 'undefined' ? document.currentScript?.src : undefined; if (typeof __filename != 'undefined') _scriptName = _scriptName || __filename; return function (moduleArg = {}) { var moduleRtn; var Module = moduleArg; var readyPromiseResolve, readyPromiseReject; var readyPromise = new Promise((resolve, reject) => { readyPromiseResolve = resolve; readyPromiseReject = reject; }); var ENVIRONMENT_IS_WEB = typeof window == "object"; var ENVIRONMENT_IS_WORKER = typeof WorkerGlobalScope != "undefined"; var ENVIRONMENT_IS_NODE = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string" && process.type != "renderer"; if (ENVIRONMENT_IS_NODE) {} var moduleOverrides = Object.assign({}, Module); var arguments_ = []; var thisProgram = "./this.program"; var quit_ = (status, toThrow) => { throw toThrow; }; var scriptDirectory = ""; function locateFile(path) { if (Module["locateFile"]) { return Module["locateFile"](path, scriptDirectory); } return scriptDirectory + path; } var readAsync, readBinary; if (ENVIRONMENT_IS_NODE) { var fs = __webpack_require__(/*! fs */ 79696); var nodePath = __webpack_require__(/*! path */ 53548); scriptDirectory = __dirname + "/"; readBinary = filename => { filename = isFileURI(filename) ? new URL(filename) : filename; var ret = fs.readFileSync(filename); return ret; }; readAsync = /*#__PURE__*/function () { var _ref = _asyncToGenerator(function* (filename, binary = true) { filename = isFileURI(filename) ? new URL(filename) : filename; var ret = fs.readFileSync(filename, binary ? undefined : "utf8"); return ret; }); return function readAsync(_x) { return _ref.apply(this, arguments); }; }(); if (!Module["thisProgram"] && process.argv.length > 1) { thisProgram = process.argv[1].replace(/\\/g, "/"); } arguments_ = process.argv.slice(2); quit_ = (status, toThrow) => { process.exitCode = status; throw toThrow; }; } 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 (_scriptName) { scriptDirectory = _scriptName; } if (scriptDirectory.startsWith("blob:")) { scriptDirectory = ""; } else { scriptDirectory = scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf("/") + 1); } { if (ENVIRONMENT_IS_WORKER) { readBinary = url => { var xhr = new XMLHttpRequest(); xhr.open("GET", url, false); xhr.responseType = "arraybuffer"; xhr.send(null); return new Uint8Array(xhr.response); }; } readAsync = /*#__PURE__*/function () { var _ref2 = _asyncToGenerator(function* (url) { if (isFileURI(url)) { return new Promise((resolve, reject) => { var xhr = new XMLHttpRequest(); xhr.open("GET", url, true); xhr.responseType = "arraybuffer"; xhr.onload = () => { if (xhr.status == 200 || xhr.status == 0 && xhr.response) { resolve(xhr.response); return; } reject(xhr.status); }; xhr.onerror = reject; xhr.send(null); }); } var response = yield fetch(url, { credentials: "same-origin" }); if (response.ok) { return response.arrayBuffer(); } throw new Error(response.status + " : " + response.url); }); return function readAsync(_x2) { return _ref2.apply(this, arguments); }; }(); } } else {} var out = Module["print"] || console.log.bind(console); var err = Module["printErr"] || console.error.bind(console); Object.assign(Module, moduleOverrides); moduleOverrides = null; if (Module["arguments"]) arguments_ = Module["arguments"]; if (Module["thisProgram"]) thisProgram = Module["thisProgram"]; var wasmBinary = Module["wasmBinary"]; var wasmMemory; var ABORT = false; var HEAP8, HEAPU8, HEAP16, HEAPU16, HEAP32, HEAPU32, HEAPF32, HEAPF64; function updateMemoryViews() { var b = wasmMemory.buffer; Module["HEAP8"] = HEAP8 = new Int8Array(b); Module["HEAP16"] = HEAP16 = new Int16Array(b); Module["HEAPU8"] = HEAPU8 = new Uint8Array(b); Module["HEAPU16"] = HEAPU16 = new Uint16Array(b); Module["HEAP32"] = HEAP32 = new Int32Array(b); Module["HEAPU32"] = HEAPU32 = new Uint32Array(b); Module["HEAPF32"] = HEAPF32 = new Float32Array(b); Module["HEAPF64"] = HEAPF64 = new Float64Array(b); } var __ATPRERUN__ = []; var __ATINIT__ = []; var __ATPOSTRUN__ = []; var runtimeInitialized = 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() { runtimeInitialized = true; callRuntimeCallbacks(__ATINIT__); } function postRun() { 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); } var runDependencies = 0; var dependenciesFulfilled = null; function addRunDependency(id) { runDependencies++; Module["monitorRunDependencies"]?.(runDependencies); } function removeRunDependency(id) { runDependencies--; Module["monitorRunDependencies"]?.(runDependencies); if (runDependencies == 0) { if (dependenciesFulfilled) { var callback = dependenciesFulfilled; dependenciesFulfilled = null; callback(); } } } function abort(what) { Module["onAbort"]?.(what); what = "Aborted(" + what + ")"; err(what); ABORT = true; what += ". Build with -sASSERTIONS for more info."; var e = new WebAssembly.RuntimeError(what); readyPromiseReject(e); throw e; } var dataURIPrefix = "data:application/octet-stream;base64,"; var isDataURI = filename => filename.startsWith(dataURIPrefix); var isFileURI = filename => filename.startsWith("file://"); function findWasmBinary() { var f = "openjpegwasm_decode.wasm"; if (!isDataURI(f)) { return locateFile(f); } return f; } var wasmBinaryFile; function getBinarySync(file) { if (file == wasmBinaryFile && wasmBinary) { return new Uint8Array(wasmBinary); } if (readBinary) { return readBinary(file); } throw "both async and sync fetching of the wasm failed"; } function getWasmBinary(_x3) { return _getWasmBinary.apply(this, arguments); } function _getWasmBinary() { _getWasmBinary = _asyncToGenerator(function* (binaryFile) { if (!wasmBinary) { try { var response = yield readAsync(binaryFile); return new Uint8Array(response); } catch {} } return getBinarySync(binaryFile); }); return _getWasmBinary.apply(this, arguments); } function instantiateArrayBuffer(_x4, _x5) { return _instantiateArrayBuffer.apply(this, arguments); } function _instantiateArrayBuffer() { _instantiateArrayBuffer = _asyncToGenerator(function* (binaryFile, imports) { try { var binary = yield getWasmBinary(binaryFile); var instance = yield WebAssembly.instantiate(binary, imports); return instance; } catch (reason) { err(`failed to asynchronously prepare wasm: ${reason}`); abort(reason); } }); return _instantiateArrayBuffer.apply(this, arguments); } function instantiateAsync(_x6, _x7, _x8) { return _instantiateAsync.apply(this, arguments); } function _instantiateAsync() { _instantiateAsync = _asyncToGenerator(function* (binary, binaryFile, imports) { if (!binary && typeof WebAssembly.instantiateStreaming == "function" && !isDataURI(binaryFile) && !isFileURI(binaryFile) && !ENVIRONMENT_IS_NODE && typeof fetch == "function") { try { var response = fetch(binaryFile, { credentials: "same-origin" }); var instantiationResult = yield WebAssembly.instantiateStreaming(response, imports); return instantiationResult; } catch (reason) { err(`wasm streaming compile failed: ${reason}`); err("falling back to ArrayBuffer instantiation"); } } return instantiateArrayBuffer(binaryFile, imports); }); return _instantiateAsync.apply(this, arguments); } function getWasmImports() { return { a: wasmImports }; } function createWasm() { return _createWasm.apply(this, arguments); } function _createWasm() { _createWasm = _asyncToGenerator(function* () { function receiveInstance(instance, module) { wasmExports = instance.exports; wasmMemory = wasmExports["F"]; updateMemoryViews(); wasmTable = wasmExports["I"]; addOnInit(wasmExports["G"]); removeRunDependency("wasm-instantiate"); return wasmExports; } addRunDependency("wasm-instantiate"); function receiveInstantiationResult(result) { receiveInstance(result["instance"]); } var info = getWasmImports(); if (Module["instantiateWasm"]) { try { return Module["instantiateWasm"](info, receiveInstance); } catch (e) { err(`Module.instantiateWasm callback failed with error: ${e}`); readyPromiseReject(e); } } wasmBinaryFile ??= findWasmBinary(); try { var result = yield instantiateAsync(wasmBinary, wasmBinaryFile, info); receiveInstantiationResult(result); return result; } catch (e) { readyPromiseReject(e); return; } }); return _createWasm.apply(this, arguments); } class ExitStatus { name = "ExitStatus"; constructor(status) { this.message = `Program terminated with exit(${status})`; this.status = status; } } var callRuntimeCallbacks = callbacks => { while (callbacks.length > 0) { callbacks.shift()(Module); } }; var noExitRuntime = Module["noExitRuntime"] || true; var stackRestore = val => __emscripten_stack_restore(val); var stackSave = () => _emscripten_stack_get_current(); class ExceptionInfo { constructor(excPtr) { this.excPtr = excPtr; this.ptr = excPtr - 24; } set_type(type) { HEAPU32[this.ptr + 4 >> 2] = type; } get_type() { return HEAPU32[this.ptr + 4 >> 2]; } set_destructor(destructor) { HEAPU32[this.ptr + 8 >> 2] = destructor; } get_destructor() { return HEAPU32[this.ptr + 8 >> 2]; } set_caught(caught) { caught = caught ? 1 : 0; HEAP8[this.ptr + 12] = caught; } get_caught() { return HEAP8[this.ptr + 12] != 0; } set_rethrown(rethrown) { rethrown = rethrown ? 1 : 0; HEAP8[this.ptr + 13] = rethrown; } get_rethrown() { return HEAP8[this.ptr + 13] != 0; } init(type, destructor) { this.set_adjusted_ptr(0); this.set_type(type); this.set_destructor(destructor); } set_adjusted_ptr(adjustedPtr) { HEAPU32[this.ptr + 16 >> 2] = adjustedPtr; } get_adjusted_ptr() { return HEAPU32[this.ptr + 16 >> 2]; } } var exceptionLast = 0; var uncaughtExceptionCount = 0; var ___cxa_throw = (ptr, type, destructor) => { var info = new ExceptionInfo(ptr); info.init(type, destructor); exceptionLast = ptr; uncaughtExceptionCount++; throw exceptionLast; }; var __abort_js = () => abort(""); var structRegistrations = {}; var runDestructors = destructors => { while (destructors.length) { var ptr = destructors.pop(); var del = destructors.pop(); del(ptr); } }; function readPointer(pointer) { return this["fromWireType"](HEAPU32[pointer >> 2]); } var awaitingDependencies = {}; var registeredTypes = {}; var typeDependencies = {}; var InternalError; var throwInternalError = message => { throw new InternalError(message); }; var whenDependentTypesAreResolved = (myTypes, dependentTypes, getTypeConverters) => { myTypes.forEach(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((dt, i) => { if (registeredTypes.hasOwnProperty(dt)) { typeConverters[i] = registeredTypes[dt]; } else { unregisteredTypes.push(dt); if (!awaitingDependencies.hasOwnProperty(dt)) { awaitingDependencies[dt] = []; } awaitingDependencies[dt].push(() => { typeConverters[i] = registeredTypes[dt]; ++registered; if (registered === unregisteredTypes.length) { onComplete(typeConverters); } }); } }); if (0 === unregisteredTypes.length) { onComplete(typeConverters); } }; var __embind_finalize_value_object = structType => { var reg = structRegistrations[structType]; delete structRegistrations[structType]; var rawConstructor = reg.rawConstructor; var rawDestructor = reg.rawDestructor; var fieldRecords = reg.fields; var fieldTypes = fieldRecords.map(field => field.getterReturnType).concat(fieldRecords.map(field => field.setterArgumentType)); whenDependentTypesAreResolved([structType], fieldTypes, fieldTypes => { var fields = {}; fieldRecords.forEach((field, i) => { var fieldName = field.fieldName; var getterReturnType = fieldTypes[i]; var getter = field.getter; var getterContext = field.getterContext; var setterArgumentType = fieldTypes[i + fieldRecords.length]; var setter = field.setter; var setterContext = field.setterContext; fields[fieldName] = { read: ptr => getterReturnType["fromWireType"](getter(getterContext, ptr)), write: (ptr, o) => { var destructors = []; setter(setterContext, ptr, setterArgumentType["toWireType"](destructors, o)); runDestructors(destructors); } }; }); return [{ name: reg.name, fromWireType: ptr => { var rv = {}; for (var i in fields) { rv[i] = fields[i].read(ptr); } rawDestructor(ptr); return rv; }, toWireType: (destructors, o) => { for (var fieldName in fields) { if (!(fieldName in o)) { throw new TypeError(`Missing field: "${fieldName}"`); } } var ptr = rawConstructor(); for (fieldName in fields) { fields[fieldName].write(ptr, o[fieldName]); } if (destructors !== null) { destructors.push(rawDestructor, ptr); } return ptr; }, argPackAdvance: GenericWireTypeSize, readValueFromPointer: readPointer, destructorFunction: rawDestructor }]; }); }; var __embind_register_bigint = (primitiveType, name, size, minRange, maxRange) => {}; var 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; var readLatin1String = ptr => { var ret = ""; var c = ptr; while (HEAPU8[c]) { ret += embind_charCodes[HEAPU8[c++]]; } return ret; }; var BindingError; var throwBindingError = message => { throw new BindingError(message); }; function sharedRegisterType(rawType, registeredInstance, options = {}) { 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(cb => cb()); } } function registerType(rawType, registeredInstance, options = {}) { return sharedRegisterType(rawType, registeredInstance, options); } var GenericWireTypeSize = 8; var __embind_register_bool = (rawType, name, trueValue, falseValue) => { name = readLatin1String(name); registerType(rawType, { name, fromWireType: function (wt) { return !!wt; }, toWireType: function (destructors, o) { return o ? trueValue : falseValue; }, argPackAdvance: GenericWireTypeSize, readValueFromPointer: function (pointer) { return this["fromWireType"](HEAPU8[pointer]); }, destructorFunction: null }); }; var shallowCopyInternalPointer = o => ({ count: o.count, deleteScheduled: o.deleteScheduled, preservePointerOnDelete: o.preservePointerOnDelete, ptr: o.ptr, ptrType: o.ptrType, smartPtr: o.smartPtr, smartPtrType: o.smartPtrType }); var throwInstanceAlreadyDeleted = obj => { function getInstanceTypeName(handle) { return handle.$$.ptrType.registeredClass.name; } throwBindingError(getInstanceTypeName(obj) + " instance already deleted"); }; var finalizationRegistry = false; var detachFinalizer = handle => {}; var runDestructor = $$ => { if ($$.smartPtr) { $$.smartPtrType.rawDestructor($$.smartPtr); } else { $$.ptrType.registeredClass.rawDestructor($$.ptr); } }; var releaseClassHandle = $$ => { $$.count.value -= 1; var toDelete = 0 === $$.count.value; if (toDelete) { runDestructor($$); } }; var 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); }; var registeredPointers = {}; var registeredInstances = {}; var getBasestPointer = (class_, ptr) => { if (ptr === undefined) { throwBindingError("ptr should not be undefined"); } while (class_.baseClass) { ptr = class_.upcast(ptr); class_ = class_.baseClass; } return ptr; }; var getInheritedInstance = (class_, ptr) => { ptr = getBasestPointer(class_, ptr); return registeredInstances[ptr]; }; var 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, writable: true } })); }; 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 }); } } 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 }); } } var attachFinalizer = handle => { if ("undefined" === typeof FinalizationRegistry) { attachFinalizer = handle => handle; return handle; } finalizationRegistry = new FinalizationRegistry(info => { releaseClassHandle(info.$$); }); attachFinalizer = handle => { var $$ = handle.$$; var hasSmartPtr = !!$$.smartPtr; if (hasSmartPtr) { var info = { $$ }; finalizationRegistry.register(handle, info, handle); } return handle; }; detachFinalizer = handle => finalizationRegistry.unregister(handle); return attachFinalizer(handle); }; var deletionQueue = []; var flushPendingDeletes = () => { while (deletionQueue.length) { var obj = deletionQueue.pop(); obj.$$.deleteScheduled = false; obj["delete"](); } }; var delayFunction; var init_ClassHandle = () => { Object.assign(ClassHandle.prototype, { isAliasOf(other) { if (!(this instanceof ClassHandle)) { return false; } if (!(other instanceof ClassHandle)) { return false; } var leftClass = this.$$.ptrType.registeredClass; var left = this.$$.ptr; other.$$ = other.$$; 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; }, 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; } }, 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; } }, isDeleted() { return !this.$$.ptr; }, 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 ClassHandle() {} var createNamedFunction = (name, body) => Object.defineProperty(body, "name", { value: name }); var ensureOverloadTable = (proto, methodName, humanName) => { if (undefined === proto[methodName].overloadTable) { var prevFunc = proto[methodName]; proto[methodName] = function (...args) { if (!proto[methodName].overloadTable.hasOwnProperty(args.length)) { throwBindingError(`Function '${humanName}' called with an invalid number of arguments (${args.length}) - expects one of (${proto[methodName].overloadTable})!`); } return proto[methodName].overloadTable[args.length].apply(this, args); }; proto[methodName].overloadTable = []; proto[methodName].overloadTable[prevFunc.argCount] = prevFunc; } }; var 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[name].overloadTable.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; Module[name].argCount = numArguments; } }; var char_0 = 48; var char_9 = 57; var makeLegalFunctionName = name => { name = name.replace(/[^a-zA-Z0-9_]/g, "$"); var f = name.charCodeAt(0); if (f >= char_0 && f <= char_9) { return `_${name}`; } return name; }; 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 = []; } var 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 "${embindRepr(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 || !handle.$$) { throwBindingError(`Cannot pass "${embindRepr(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.toHandle(() => 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 "${embindRepr(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; } var init_RegisteredPointer = () => { Object.assign(RegisteredPointer.prototype, { getPointee(ptr) { if (this.rawGetPointee) { ptr = this.rawGetPointee(ptr); } return ptr; }, destructor(ptr) { this.rawDestructor?.(ptr); }, argPackAdvance: GenericWireTypeSize, readValueFromPointer: readPointer, 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; } } var replacePublicSymbol = (name, value, numArguments) => { if (!Module.hasOwnProperty(name)) { throwInternalError("Replacing nonexistent public symbol"); } if (undefined !== Module[name].overloadTable && undefined !== numArguments) { Module[name].overloadTable[numArguments] = value; } else { Module[name] = value; Module[name].argCount = numArguments; } }; var dynCallLegacy = (sig, ptr, args) => { sig = sig.replace(/p/g, "i"); var f = Module["dynCall_" + sig]; return f(ptr, ...args); }; var wasmTableMirror = []; var wasmTable; var getWasmTableEntry = funcPtr => { var func = wasmTableMirror[funcPtr]; if (!func) { if (funcPtr >= wasmTableMirror.length) wasmTableMirror.length = funcPtr + 1; wasmTableMirror[funcPtr] = func = wasmTable.get(funcPtr); } return func; }; var dynCall = (sig, ptr, args = []) => { if (sig.includes("j")) { return dynCallLegacy(sig, ptr, args); } var rtn = getWasmTableEntry(ptr)(...args); return rtn; }; var getDynCaller = (sig, ptr) => (...args) => dynCall(sig, ptr, args); var embind__requireFunction = (signature, rawFunction) => { signature = readLatin1String(signature); function makeDynCaller() { if (signature.includes("j")) { return getDynCaller(signature, rawFunction); } return getWasmTableEntry(rawFunction); } var fp = makeDynCaller(); if (typeof fp != "function") { throwBindingError(`unknown function pointer with signature ${signature}: ${rawFunction}`); } return fp; }; var 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 UnboundTypeError; var getTypeName = type => { var ptr = ___getTypeName(type); var rv = readLatin1String(ptr); _free(ptr); return rv; }; var 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([", "])); }; var __embind_register_class = (rawType, rawPointerType, rawConstPointerType, baseClassRawType, getActualTypeSignature, getActualType, upcastSignature, upcast, downcastSignature, downcast, name, destructorSignature, rawDestructor) => { name = readLatin1String(name); getActualType = embind__requireFunction(getActualTypeSignature, getActualType); upcast &&= embind__requireFunction(upcastSignature, upcast); 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] : [], base => { base = base[0]; var baseClass; var basePrototype; if (baseClassRawType) { baseClass = base.registeredClass; basePrototype = baseClass.instancePrototype; } else { basePrototype = ClassHandle.prototype; } var constructor = createNamedFunction(name, function (...args) { 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[args.length]; if (undefined === body) { throw new BindingError(`Tried to invoke ctor of ${name} with invalid number of parameters (${args.length}) - expected (${Object.keys(registeredClass.constructor_body).toString()}) parameters instead!`); } return body.apply(this, args); }); var instancePrototype = Object.create(basePrototype, { constructor: { value: constructor } }); constructor.prototype = instancePrototype; var registeredClass = new RegisteredClass(name, constructor, instancePrototype, rawDestructor, baseClass, getActualType, upcast, downcast); if (registeredClass.baseClass) { registeredClass.baseClass.__derivedClasses ??= []; registeredClass.baseClass.__derivedClasses.push(registeredClass); } 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]; }); }; var heap32VectorToArray = (count, firstElement) => { var array = []; for (var i = 0; i < count; i++) { array.push(HEAPU32[firstElement + i * 4 >> 2]); } return array; }; function usesDestructorStack(argTypes) { for (var i = 1; i < argTypes.length; ++i) { if (argTypes[i] !== null && argTypes[i].destructorFunction === undefined) { return true; } } return false; } function newFunc(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 createJsInvoker(argTypes, isClassMethodFunc, returns, isAsync) { var needsDestructorStack = usesDestructorStack(argTypes); var argCount = argTypes.length - 2; var argsList = []; var argsListWired = ["fn"]; if (isClassMethodFunc) { argsListWired.push("thisWired"); } for (var i = 0; i < argCount; ++i) { argsList.push(`arg${i}`); argsListWired.push(`arg${i}Wired`); } argsList = argsList.join(","); argsListWired = argsListWired.join(","); var invokerFnBody = `return function (${argsList}) {\n`; if (needsDestructorStack) { invokerFnBody += "var destructors = [];\n"; } var dtorStack = needsDestructorStack ? "destructors" : "null"; var args1 = ["humanName", "throwBindingError", "invoker", "fn", "runDestructors", "retType", "classParam"]; if (isClassMethodFunc) { invokerFnBody += `var thisWired = classParam['toWireType'](${dtorStack}, this);\n`; } for (var i = 0; i < argCount; ++i) { invokerFnBody += `var arg${i}Wired = argType${i}['toWireType'](${dtorStack}, arg${i});\n`; args1.push(`argType${i}`); } invokerFnBody += (returns || isAsync ? "var rv = " : "") + `invoker(${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});\n`; args1.push(`${paramName}_dtor`); } } } if (returns) { invokerFnBody += "var ret = retType['fromWireType'](rv);\n" + "return ret;\n"; } else {} invokerFnBody += "}\n"; return [args1, invokerFnBody]; } function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cppTargetFunc, isAsync) { 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 = usesDestructorStack(argTypes); var returns = argTypes[0].name !== "void"; var closureArgs = [humanName, throwBindingError, cppInvokerFunc, cppTargetFunc, runDestructors, argTypes[0], argTypes[1]]; for (var i = 0; i < argCount - 2; ++i) { closureArgs.push(argTypes[i + 2]); } if (!needsDestructorStack) { for (var i = isClassMethodFunc ? 1 : 2; i < argTypes.length; ++i) { if (argTypes[i].destructorFunction !== null) { closureArgs.push(argTypes[i].destructorFunction); } } } let [args, invokerFnBody] = createJsInvoker(argTypes, isClassMethodFunc, returns, isAsync); args.push(invokerFnBody); var invokerFn = newFunc(Function, args)(...closureArgs); return createNamedFunction(humanName, invokerFn); } var __embind_register_class_constructor = (rawClassType, argCount, rawArgTypesAddr, invokerSignature, invoker, rawConstructor) => { var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr); invoker = embind__requireFunction(invokerSignature, invoker); whenDependentTypesAreResolved([], [rawClassType], 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] = () => { throwUnboundTypeError(`Cannot construct ${classType.name} due to unbound types`, rawArgTypes); }; whenDependentTypesAreResolved([], rawArgTypes, argTypes => { argTypes.splice(1, 0, null); classType.registeredClass.constructor_body[argCount - 1] = craftInvokerFunction(humanName, argTypes, null, invoker, rawConstructor); return []; }); return []; }); }; var getFunctionName = signature => { signature = signature.trim(); const argsIndex = signature.indexOf("("); if (argsIndex !== -1) { return signature.substr(0, argsIndex); } else { return signature; } }; var __embind_register_class_function = (rawClassType, methodName, argCount, rawArgTypesAddr, invokerSignature, rawInvoker, context, isPureVirtual, isAsync, isNonnullReturn) => { var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr); methodName = readLatin1String(methodName); methodName = getFunctionName(methodName); rawInvoker = embind__requireFunction(invokerSignature, rawInvoker); whenDependentTypesAreResolved([], [rawClassType], 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, argTypes => { var memberFunction = craftInvokerFunction(humanName, argTypes, classType, rawInvoker, context, isAsync); if (undefined === proto[methodName].overloadTable) { memberFunction.argCount = argCount - 2; proto[methodName] = memberFunction; } else { proto[methodName].overloadTable[argCount - 2] = memberFunction; } return []; }); return []; }); }; var emval_freelist = []; var emval_handles = []; var __emval_decref = handle => { if (handle > 9 && 0 === --emval_handles[handle + 1]) { emval_handles[handle] = undefined; emval_freelist.push(handle); } }; var count_emval_handles = () => emval_handles.length / 2 - 5 - emval_freelist.length; var init_emval = () => { emval_handles.push(0, 1, undefined, 1, null, 1, true, 1, false, 1); Module["count_emval_handles"] = count_emval_handles; }; var Emval = { toValue: handle => { if (!handle) { throwBindingError("Cannot use deleted val. handle = " + handle); } return emval_handles[handle]; }, toHandle: value => { switch (value) { case undefined: return 2; case null: return 4; case true: return 6; case false: return 8; default: { const handle = emval_freelist.pop() || emval_handles.length; emval_handles[handle] = value; emval_handles[handle + 1] = 1; return handle; } } } }; var EmValType = { name: "emscripten::val", fromWireType: handle => { var rv = Emval.toValue(handle); __emval_decref(handle); return rv; }, toWireType: (destructors, value) => Emval.toHandle(value), argPackAdvance: GenericWireTypeSize, readValueFromPointer: readPointer, destructorFunction: null }; var __embind_register_emval = rawType => registerType(rawType, EmValType); var embindRepr = v => { if (v === null) { return "null"; } var t = typeof v; if (t === "object" || t === "array" || t === "function") { return v.toString(); } else { return "" + v; } }; var floatReadValueFromPointer = (name, width) => { switch (width) { case 4: return function (pointer) { return this["fromWireType"](HEAPF32[pointer >> 2]); }; case 8: return function (pointer) { return this["fromWireType"](HEAPF64[pointer >> 3]); }; default: throw new TypeError(`invalid float width (${width}): ${name}`); } }; var __embind_register_float = (rawType, name, size) => { name = readLatin1String(name); registerType(rawType, { name, fromWireType: value => value, toWireType: (destructors, value) => value, argPackAdvance: GenericWireTypeSize, readValueFromPointer: floatReadValueFromPointer(name, size), destructorFunction: null }); }; var integerReadValueFromPointer = (name, width, signed) => { switch (width) { case 1: return signed ? pointer => HEAP8[pointer] : pointer => HEAPU8[pointer]; case 2: return signed ? pointer => HEAP16[pointer >> 1] : pointer => HEAPU16[pointer >> 1]; case 4: return signed ? pointer => HEAP32[pointer >> 2] : pointer => HEAPU32[pointer >> 2]; default: throw new TypeError(`invalid integer width (${width}): ${name}`); } }; var __embind_register_integer = (primitiveType, name, size, minRange, maxRange) => { name = readLatin1String(name); if (maxRange === -1) { maxRange = 4294967295; } var fromWireType = value => value; if (minRange === 0) { var bitshift = 32 - 8 * size; fromWireType = value => value << bitshift >>> bitshift; } var isUnsignedType = name.includes("unsigned"); var checkAssertions = (value, toTypeName) => {}; var toWireType; if (isUnsignedType) { toWireType = function (destructors, value) { checkAssertions(value, this.name); return value >>> 0; }; } else { toWireType = function (destructors, value) { checkAssertions(value, this.name); return value; }; } registerType(primitiveType, { name, fromWireType, toWireType, argPackAdvance: GenericWireTypeSize, readValueFromPointer: integerReadValueFromPointer(name, size, minRange !== 0), destructorFunction: null }); }; var __embind_register_memory_view = (rawType, dataTypeIndex, name) => { var typeMapping = [Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array]; var TA = typeMapping[dataTypeIndex]; function decodeMemoryView(handle) { var size = HEAPU32[handle >> 2]; var data = HEAPU32[handle + 4 >> 2]; return new TA(HEAP8.buffer, data, size); } name = readLatin1String(name); registerType(rawType, { name, fromWireType: decodeMemoryView, argPackAdvance: GenericWireTypeSize, readValueFromPointer: decodeMemoryView }, { ignoreDuplicateRegistrations: true }); }; var 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; 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; }; var stringToUTF8 = (str, outPtr, maxBytesToWrite) => stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); var lengthBytesUTF8 = str => { var len = 0; for (var i = 0; i < str.length; ++i) { var c = str.charCodeAt(i); if (c <= 127) { len++; } else if (c <= 2047) { len += 2; } else if (c >= 55296 && c <= 57343) { len += 4; ++i; } else { len += 3; } } return len; }; var UTF8Decoder = typeof TextDecoder != "undefined" ? new TextDecoder() : undefined; var UTF8ArrayToString = (heapOrArray, idx = 0, maxBytesToRead = NaN) => { var endIdx = idx + maxBytesToRead; var endPtr = idx; while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr; if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) { return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr)); } var str = ""; while (idx < endPtr) { var u0 = heapOrArray[idx++]; if (!(u0 & 128)) { str += String.fromCharCode(u0); continue; } var u1 = heapOrArray[idx++] & 63; if ((u0 & 224) == 192) { str += String.fromCharCode((u0 & 31) << 6 | u1); continue; } var u2 = heapOrArray[idx++] & 63; if ((u0 & 240) == 224) { u0 = (u0 & 15) << 12 | u1 << 6 | u2; } else { u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[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; }; var UTF8ToString = (ptr, maxBytesToRead) => ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : ""; var __embind_register_std_string = (rawType, name) => { name = readLatin1String(name); var stdStringIsUTF8 = true; registerType(rawType, { name, fromWireType(value) { var length = HEAPU32[value >> 2]; var payload = value + 4; var str; if (stdStringIsUTF8) { var decodeStartPtr = payload; for (var i = 0; i <= length; ++i) { var currentBytePtr = payload + 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[payload + i]); } str = a.join(""); } _free(value); return str; }, toWireType(destructors, value) { if (value instanceof ArrayBuffer) { value = new Uint8Array(value); } var length; 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) { length = lengthBytesUTF8(value); } else { length = value.length; } var base = _malloc(4 + length + 1); var ptr = base + 4; HEAPU32[base >> 2] = length; if (stdStringIsUTF8 && valueIsOfTypeString) { stringToUTF8(value, ptr, 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 + i] = charCode; } } else { for (var i = 0; i < length; ++i) { HEAPU8[ptr + i] = value[i]; } } } if (destructors !== null) { destructors.push(_free, base); } return base; }, argPackAdvance: GenericWireTypeSize, readValueFromPointer: readPointer, destructorFunction(ptr) { _free(ptr); } }); }; var UTF16Decoder = typeof TextDecoder != "undefined" ? new TextDecoder("utf-16le") : undefined; var UTF16ToString = (ptr, maxBytesToRead) => { 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)); 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; }; var stringToUTF16 = (str, outPtr, maxBytesToWrite) => { 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; }; var lengthBytesUTF16 = str => str.length * 2; var UTF32ToString = (ptr, maxBytesToRead) => { 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; }; var stringToUTF32 = (str, outPtr, maxBytesToWrite) => { 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; }; var 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; }; var __embind_register_std_wstring = (rawType, charSize, name) => { name = readLatin1String(name); var decodeString, encodeString, readCharAt, lengthBytesUTF; if (charSize === 2) { decodeString = UTF16ToString; encodeString = stringToUTF16; lengthBytesUTF = lengthBytesUTF16; readCharAt = pointer => HEAPU16[pointer >> 1]; } else if (charSize === 4) { decodeString = UTF32ToString; encodeString = stringToUTF32; lengthBytesUTF = lengthBytesUTF32; readCharAt = pointer => HEAPU32[pointer >> 2]; } registerType(rawType, { name, fromWireType: value => { var length = HEAPU32[value >> 2]; var str; var decodeStartPtr = value + 4; for (var i = 0; i <= length; ++i) { var currentBytePtr = value + 4 + i * charSize; if (i == length || readCharAt(currentBytePtr) == 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: (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 / charSize; encodeString(value, ptr + 4, length + charSize); if (destructors !== null) { destructors.push(_free, ptr); } return ptr; }, argPackAdvance: GenericWireTypeSize, readValueFromPointer: readPointer, destructorFunction(ptr) { _free(ptr); } }); }; var __embind_register_value_object = (rawType, name, constructorSignature, rawConstructor, destructorSignature, rawDestructor) => { structRegistrations[rawType] = { name: readLatin1String(name), rawConstructor: embind__requireFunction(constructorSignature, rawConstructor), rawDestructor: embind__requireFunction(destructorSignature, rawDestructor), fields: [] }; }; var __embind_register_value_object_field = (structType, fieldName, getterReturnType, getterSignature, getter, getterContext, setterArgumentType, setterSignature, setter, setterContext) => { structRegistrations[structType].fields.push({ fieldName: readLatin1String(fieldName), getterReturnType, getter: embind__requireFunction(getterSignature, getter), getterContext, setterArgumentType, setter: embind__requireFunction(setterSignature, setter), setterContext }); }; var __embind_register_void = (rawType, name) => { name = readLatin1String(name); registerType(rawType, { isVoid: true, name, argPackAdvance: 0, fromWireType: () => undefined, toWireType: (destructors, o) => undefined }); }; var __emscripten_memcpy_js = (dest, src, num) => HEAPU8.copyWithin(dest, src, src + num); var emval_methodCallers = []; var __emval_call = (caller, handle, destructorsRef, args) => { caller = emval_methodCallers[caller]; handle = Emval.toValue(handle); return caller(null, handle, destructorsRef, args); }; var emval_symbols = {}; var getStringOrSymbol = address => { var symbol = emval_symbols[address]; if (symbol === undefined) { return readLatin1String(address); } return symbol; }; var emval_get_global = () => { if (typeof globalThis == "object") { return globalThis; } return function () { return Function; }()("return this")(); }; var __emval_get_global = name => { if (name === 0) { return Emval.toHandle(emval_get_global()); } else { name = getStringOrSymbol(name); return Emval.toHandle(emval_get_global()[name]); } }; var emval_addMethodCaller = caller => { var id = emval_methodCallers.length; emval_methodCallers.push(caller); return id; }; var requireRegisteredType = (rawType, humanName) => { var impl = registeredTypes[rawType]; if (undefined === impl) { throwBindingError(`${humanName} has unknown type ${getTypeName(rawType)}`); } return impl; }; var emval_lookupTypes = (argCount, argTypes) => { var a = new Array(argCount); for (var i = 0; i < argCount; ++i) { a[i] = requireRegisteredType(HEAPU32[argTypes + i * 4 >> 2], "parameter " + i); } return a; }; var reflectConstruct = Reflect.construct; var emval_returnValue = (returnType, destructorsRef, handle) => { var destructors = []; var result = returnType["toWireType"](destructors, handle); if (destructors.length) { HEAPU32[destructorsRef >> 2] = Emval.toHandle(destructors); } return result; }; var __emval_get_method_caller = (argCount, argTypes, kind) => { var types = emval_lookupTypes(argCount, argTypes); var retType = types.shift(); argCount--; var functionBody = `return function (obj, func, destructorsRef, args) {\n`; var offset = 0; var argsList = []; if (kind === 0) { argsList.push("obj"); } var params = ["retType"]; var args = [retType]; for (var i = 0; i < argCount; ++i) { argsList.push("arg" + i); params.push("argType" + i); args.push(types[i]); functionBody += ` var arg${i} = argType${i}.readValueFromPointer(args${offset ? "+" + offset : ""});\n`; offset += types[i].argPackAdvance; } var invoker = kind === 1 ? "new func" : "func.call"; functionBody += ` var rv = ${invoker}(${argsList.join(", ")});\n`; if (!retType.isVoid) { params.push("emval_returnValue"); args.push(emval_returnValue); functionBody += " return emval_returnValue(retType, destructorsRef, rv);\n"; } functionBody += "};\n"; params.push(functionBody); var invokerFunction = newFunc(Function, params)(...args); var functionName = `methodCaller<(${types.map(t => t.name).join(", ")}) => ${retType.name}>`; return emval_addMethodCaller(createNamedFunction(functionName, invokerFunction)); }; var __emval_run_destructors = handle => { var destructors = Emval.toValue(handle); runDestructors(destructors); __emval_decref(handle); }; var __emval_take_value = (type, arg) => { type = requireRegisteredType(type, "_emval_take_value"); var v = type["readValueFromPointer"](arg); return Emval.toHandle(v); }; var getHeapMax = () => 2147483648; var _emscripten_get_heap_max = () => getHeapMax(); var alignMemory = (size, alignment) => Math.ceil(size / alignment) * alignment; var growMemory = size => { var b = wasmMemory.buffer; var pages = (size - b.byteLength + 65535) / 65536 | 0; try { wasmMemory.grow(pages); updateMemoryViews(); return 1; } catch (e) {} }; var _emscripten_resize_heap = requestedSize => { var oldSize = HEAPU8.length; requestedSize >>>= 0; var maxHeapSize = getHeapMax(); if (requestedSize > maxHeapSize) { 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, alignMemory(Math.max(requestedSize, overGrownHeapSize), 65536)); var replacement = growMemory(newSize); if (replacement) { return true; } } return false; }; var ENV = {}; var getExecutableName = () => thisProgram || "./this.program"; var 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; }; var stringToAscii = (str, buffer) => { for (var i = 0; i < str.length; ++i) { HEAP8[buffer++] = str.charCodeAt(i); } HEAP8[buffer] = 0; }; var _environ_get = (__environ, environ_buf) => { var bufSize = 0; getEnvStrings().forEach((string, i) => { var ptr = environ_buf + bufSize; HEAPU32[__environ + i * 4 >> 2] = ptr; stringToAscii(string, ptr); bufSize += string.length + 1; }); return 0; }; var _environ_sizes_get = (penviron_count, penviron_buf_size) => { var strings = getEnvStrings(); HEAPU32[penviron_count >> 2] = strings.length; var bufSize = 0; strings.forEach(string => bufSize += string.length + 1); HEAPU32[penviron_buf_size >> 2] = bufSize; return 0; }; var _fd_close = fd => 52; var convertI32PairToI53Checked = (lo, hi) => hi + 2097152 >>> 0 < 4194305 - !!lo ? (lo >>> 0) + hi * 4294967296 : NaN; function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { var offset = convertI32PairToI53Checked(offset_low, offset_high); return 70; } var printCharBuffers = [null, [], []]; var printChar = (stream, curr) => { var buffer = printCharBuffers[stream]; if (curr === 0 || curr === 10) { (stream === 1 ? out : err)(UTF8ArrayToString(buffer)); buffer.length = 0; } else { buffer.push(curr); } }; var _fd_write = (fd, iov, iovcnt, pnum) => { var num = 0; for (var i = 0; i < iovcnt; i++) { var ptr = HEAPU32[iov >> 2]; var len = HEAPU32[iov + 4 >> 2]; iov += 8; for (var j = 0; j < len; j++) { printChar(fd, HEAPU8[ptr + j]); } num += len; } HEAPU32[pnum >> 2] = num; return 0; }; var getCFunc = ident => { var func = Module["_" + ident]; return func; }; var writeArrayToMemory = (array, buffer) => { HEAP8.set(array, buffer); }; var stackAlloc = sz => __emscripten_stack_alloc(sz); var stringToUTF8OnStack = str => { var size = lengthBytesUTF8(str) + 1; var ret = stackAlloc(size); stringToUTF8(str, ret, size); return ret; }; var ccall = (ident, returnType, argTypes, args, opts) => { var toC = { string: str => { var ret = 0; if (str !== null && str !== undefined && str !== 0) { ret = stringToUTF8OnStack(str); } return ret; }, array: arr => { var ret = stackAlloc(arr.length); writeArrayToMemory(arr, ret); return ret; } }; function convertReturnValue(ret) { if (returnType === "string") { return UTF8ToString(ret); } if (returnType === "boolean") return Boolean(ret); return ret; } var func = getCFunc(ident); var cArgs = []; var stack = 0; if (args) { for (var i = 0; i < args.length; i++) { var converter = toC[argTypes[i]]; if (converter) { if (stack === 0) stack = stackSave(); cArgs[i] = converter(args[i]); } else { cArgs[i] = args[i]; } } } var ret = func(...cArgs); function onDone(ret) { if (stack !== 0) stackRestore(stack); return convertReturnValue(ret); } ret = onDone(ret); return ret; }; InternalError = Module["InternalError"] = class InternalError extends Error { constructor(message) { super(message); this.name = "InternalError"; } }; embind_init_charCodes(); BindingError = Module["BindingError"] = class BindingError extends Error { constructor(message) { super(message); this.name = "BindingError"; } }; init_ClassHandle(); init_RegisteredPointer(); UnboundTypeError = Module["UnboundTypeError"] = extendError(Error, "UnboundTypeError"); init_emval(); var wasmImports = { A: ___cxa_throw, p: __abort_js, e: __embind_finalize_value_object, o: __embind_register_bigint, y: __embind_register_bool, m: __embind_register_class, l: __embind_register_class_constructor, b: __embind_register_class_function, w: __embind_register_emval, i: __embind_register_float, d: __embind_register_integer, a: __embind_register_memory_view, x: __embind_register_std_string, g: __embind_register_std_wstring, f: __embind_register_value_object, c: __embind_register_value_object_field, z: __embind_register_void, v: __emscripten_memcpy_js, C: __emval_call, D: __emval_decref, E: __emval_get_global, j: __emval_get_method_caller, B: __emval_run_destructors, k: __emval_take_value, r: _emscripten_get_heap_max, q: _emscripten_resize_heap, s: _environ_get, t: _environ_sizes_get, u: _fd_close, n: _fd_seek, h: _fd_write }; var wasmExports; createWasm(); var ___wasm_call_ctors = () => (___wasm_call_ctors = wasmExports["G"])(); var ___getTypeName = a0 => (___getTypeName = wasmExports["H"])(a0); var _malloc = a0 => (_malloc = wasmExports["J"])(a0); var _free = a0 => (_free = wasmExports["K"])(a0); var __emscripten_stack_restore = a0 => (__emscripten_stack_restore = wasmExports["L"])(a0); var __emscripten_stack_alloc = a0 => (__emscripten_stack_alloc = wasmExports["M"])(a0); var _emscripten_stack_get_current = () => (_emscripten_stack_get_current = wasmExports["N"])(); var dynCall_iji = Module["dynCall_iji"] = (a0, a1, a2, a3) => (dynCall_iji = Module["dynCall_iji"] = wasmExports["O"])(a0, a1, a2, a3); var dynCall_jji = Module["dynCall_jji"] = (a0, a1, a2, a3) => (dynCall_jji = Module["dynCall_jji"] = wasmExports["P"])(a0, a1, a2, a3); var dynCall_iiji = Module["dynCall_iiji"] = (a0, a1, a2, a3, a4) => (dynCall_iiji = Module["dynCall_iiji"] = wasmExports["Q"])(a0, a1, a2, a3, a4); var dynCall_jiji = Module["dynCall_jiji"] = (a0, a1, a2, a3, a4) => (dynCall_jiji = Module["dynCall_jiji"] = wasmExports["R"])(a0, a1, a2, a3, a4); Module["ccall"] = ccall; var calledRun; dependenciesFulfilled = function runCaller() { if (!calledRun) run(); if (!calledRun) dependenciesFulfilled = runCaller; }; function run() { if (runDependencies > 0) { return; } preRun(); if (runDependencies > 0) { return; } function doRun() { if (calledRun) return; calledRun = true; Module["calledRun"] = true; if (ABORT) return; initRuntime(); readyPromiseResolve(Module); Module["onRuntimeInitialized"]?.(); postRun(); } if (Module["setStatus"]) { Module["setStatus"]("Running..."); setTimeout(() => { setTimeout(() => Module["setStatus"](""), 1); doRun(); }, 1); } else { doRun(); } } if (Module["preInit"]) { if (typeof Module["preInit"] == "function") Module["preInit"] = [Module["preInit"]]; while (Module["preInit"].length > 0) { Module["preInit"].pop()(); } } run(); moduleRtn = readyPromise; return moduleRtn; }; })(); if (true) { module.exports = OpenJPEGWASM; // This default export looks redundant, but it allows TS to import this // commonjs style module. module.exports["default"] = OpenJPEGWASM; } else // removed by dead control flow {} /***/ }, /***/ 18521 /*!*********************************************************************!*\ !*** ./node_modules/@cornerstonejs/codec-openjph/dist/openjphjs.js ***! \*********************************************************************/ (module, __unused_webpack_exports, __webpack_require__) { var Module = (() => { var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined; if (typeof __filename !== 'undefined') _scriptDir = _scriptDir || __filename; return function (Module) { Module = Module || {}; // The Module object: Our interface to the outside world. We import // and export values on it. There are various ways Module can be used: // 1. Not defined. We create it here // 2. A function parameter, function(Module) { ..generated code.. } // 3. pre-run appended it, var Module = {}; ..generated code.. // 4. External script tag defines var Module. // We need to check if Module already exists (e.g. case 3 above). // Substitution will be replaced with actual code on later stage of the build, // this way Closure Compiler will not mangle it (e.g. case 4. above). // Note that if you want to run closure, and also to use Module // after the generated code, you will need to define var Module = {}; // before the code. Then that object will be used in the code, and you // can continue to use Module afterwards as well. var Module = typeof Module != 'undefined' ? Module : {}; // See https://caniuse.com/mdn-javascript_builtins_object_assign // See https://caniuse.com/mdn-javascript_builtins_bigint64array // Set up the promise that indicates the Module is initialized var readyPromiseResolve, readyPromiseReject; Module['ready'] = new Promise(function (resolve, reject) { readyPromiseResolve = resolve; readyPromiseReject = reject; }); // --pre-jses are emitted after the Module integration code, so that they can // refer to Module (if they choose; they can also define Module) // {{PRE_JSES}} // Sometimes an existing Module object exists with properties // meant to overwrite the default module functionality. Here // we collect those properties and reapply _after_ we configure // the current environment's defaults to avoid having to be so // defensive during initialization. var moduleOverrides = Object.assign({}, Module); var arguments_ = []; var thisProgram = './this.program'; var quit_ = (status, toThrow) => { throw toThrow; }; // Determine the runtime environment we are in. You can customize this by // setting the ENVIRONMENT setting at compile time (see settings.js). // Attempt to auto-detect the environment var ENVIRONMENT_IS_WEB = typeof window == 'object'; var ENVIRONMENT_IS_WORKER = typeof importScripts == 'function'; // N.b. Electron.js environment is simultaneously a NODE-environment, but // also a web environment. var ENVIRONMENT_IS_NODE = typeof process == 'object' && typeof process.versions == 'object' && typeof process.versions.node == 'string'; var ENVIRONMENT_IS_SHELL = !ENVIRONMENT_IS_WEB && !ENVIRONMENT_IS_NODE && !ENVIRONMENT_IS_WORKER; // `/` should be present at the end if `scriptDirectory` is not empty var scriptDirectory = ''; function locateFile(path) { if (Module['locateFile']) { return Module['locateFile'](path, scriptDirectory); } return scriptDirectory + path; } // Hooks that are implemented differently in different runtime environments. var read_, readAsync, readBinary, setWindowTitle; // Normally we don't log exceptions but instead let them bubble out the top // level where the embedding environment (e.g. the browser) can handle // them. // However under v8 and node we sometimes exit the process direcly in which case // its up to use us to log the exception before exiting. // If we fix https://github.com/emscripten-core/emscripten/issues/15080 // this may no longer be needed under node. function logExceptionOnExit(e) { if (e instanceof ExitStatus) return; let toLog = e; err('exiting due to exception: ' + toLog); } if (ENVIRONMENT_IS_NODE) { // `require()` is no-op in an ESM module, use `createRequire()` to construct // the require()` function. This is only necessary for multi-environment // builds, `-sENVIRONMENT=node` emits a static import declaration instead. // TODO: Swap all `require()`'s with `import()`'s? // These modules will usually be used on Node.js. Load them eagerly to avoid // the complexity of lazy-loading. var fs = __webpack_require__(/*! fs */ 94304); var nodePath = __webpack_require__(/*! path */ 53548); if (ENVIRONMENT_IS_WORKER) { scriptDirectory = nodePath.dirname(scriptDirectory) + '/'; } else { scriptDirectory = __dirname + '/'; } // include: node_shell_read.js read_ = (filename, binary) => { // We need to re-wrap `file://` strings to URLs. Normalizing isn't // necessary in that case, the path should already be absolute. filename = isFileURI(filename) ? new URL(filename) : nodePath.normalize(filename); return fs.readFileSync(filename, binary ? undefined : 'utf8'); }; readBinary = filename => { var ret = read_(filename, true); if (!ret.buffer) { ret = new Uint8Array(ret); } return ret; }; readAsync = (filename, onload, onerror) => { // See the comment in the `read_` function. filename = isFileURI(filename) ? new URL(filename) : nodePath.normalize(filename); fs.readFile(filename, function (err, data) { if (err) onerror(err);else onload(data.buffer); }); }; // end include: node_shell_read.js if (process['argv'].length > 1) { thisProgram = process['argv'][1].replace(/\\/g, '/'); } arguments_ = process['argv'].slice(2); // MODULARIZE will export the module in the proper place outside, we don't need to export here process['on']('uncaughtException', function (ex) { // suppress ExitStatus exceptions from showing an error if (!(ex instanceof ExitStatus)) { throw ex; } }); // Without this older versions of node (< v15) will log unhandled rejections // but return 0, which is not normally the desired behaviour. This is // not be needed with node v15 and about because it is now the default // behaviour: // See https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode process['on']('unhandledRejection', function (reason) { throw reason; }); quit_ = (status, toThrow) => { if (keepRuntimeAlive()) { process['exitCode'] = status; throw toThrow; } logExceptionOnExit(toThrow); process['exit'](status); }; Module['inspect'] = function () { return '[Emscripten Module object]'; }; } else // Note that this includes Node.js workers when relevant (pthreads is enabled). // Node.js workers are detected as a combination of ENVIRONMENT_IS_WORKER and // ENVIRONMENT_IS_NODE. if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) { if (ENVIRONMENT_IS_WORKER) { // Check worker, not web, since window could be polyfilled scriptDirectory = self.location.href; } else if (typeof document != 'undefined' && document.currentScript) { // web scriptDirectory = document.currentScript.src; } // When MODULARIZE, this JS may be executed later, after document.currentScript // is gone, so we saved it, and we use it here instead of any other info. if (_scriptDir) { scriptDirectory = _scriptDir; } // blob urls look like blob:http://site.com/etc/etc and we cannot infer anything from them. // otherwise, slice off the final part of the url to find the script directory. // if scriptDirectory does not contain a slash, lastIndexOf will return -1, // and scriptDirectory will correctly be replaced with an empty string. // If scriptDirectory contains a query (starting with ?) or a fragment (starting with #), // they are removed because they could contain a slash. if (scriptDirectory.indexOf('blob:') !== 0) { scriptDirectory = scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, "").lastIndexOf('/') + 1); } else { scriptDirectory = ''; } // Differentiate the Web Worker from the Node Worker case, as reading must // be done differently. { // include: web_or_worker_shell_read.js read_ = url => { var xhr = new XMLHttpRequest(); xhr.open('GET', url, false); xhr.send(null); return xhr.responseText; }; if (ENVIRONMENT_IS_WORKER) { readBinary = url => { var xhr = new XMLHttpRequest(); xhr.open('GET', url, false); xhr.responseType = 'arraybuffer'; xhr.send(null); return new Uint8Array(/** @type{!ArrayBuffer} */xhr.response); }; } readAsync = (url, onload, onerror) => { var xhr = new XMLHttpRequest(); xhr.open('GET', url, true); xhr.responseType = 'arraybuffer'; xhr.onload = () => { if (xhr.status == 200 || xhr.status == 0 && xhr.response) { // file URLs can return 0 onload(xhr.response); return; } onerror(); }; xhr.onerror = onerror; xhr.send(null); }; // end include: web_or_worker_shell_read.js } setWindowTitle = title => document.title = title; } else {} var out = Module['print'] || console.log.bind(console); var err = Module['printErr'] || console.warn.bind(console); // Merge back in the overrides Object.assign(Module, moduleOverrides); // Free the object hierarchy contained in the overrides, this lets the GC // reclaim data used e.g. in memoryInitializerRequest, which is a large typed array. moduleOverrides = null; // Emit code to handle expected values on the Module object. This applies Module.x // to the proper local x. This has two benefits: first, we only emit it if it is // expected to arrive, and second, by using a local everywhere else that can be // minified. if (Module['arguments']) arguments_ = Module['arguments']; if (Module['thisProgram']) thisProgram = Module['thisProgram']; if (Module['quit']) quit_ = Module['quit']; // perform assertions in shell.js after we set up out() and err(), as otherwise if an assertion fails it cannot print the message var STACK_ALIGN = 16; var POINTER_SIZE = 4; function getNativeTypeSize(type) { switch (type) { case 'i1': case 'i8': case 'u8': return 1; case 'i16': case 'u16': return 2; case 'i32': case 'u32': return 4; case 'i64': case 'u64': return 8; case 'float': return 4; case 'double': return 8; default: { if (type[type.length - 1] === '*') { return POINTER_SIZE; } if (type[0] === 'i') { const bits = Number(type.substr(1)); assert(bits % 8 === 0, 'getNativeTypeSize invalid bits ' + bits + ', type ' + type); return bits / 8; } return 0; } } } // include: runtime_debug.js // end include: runtime_debug.js // === Preamble library stuff === // Documentation for the public APIs defined in this file must be updated in: // site/source/docs/api_reference/preamble.js.rst // A prebuilt local version of the documentation is available at: // site/build/text/docs/api_reference/preamble.js.txt // You can also build docs locally as HTML or other formats in site/ // An online HTML version (which may be of a different version of Emscripten) // is up at http://kripken.github.io/emscripten-site/docs/api_reference/preamble.js.html var wasmBinary; if (Module['wasmBinary']) wasmBinary = Module['wasmBinary']; var noExitRuntime = Module['noExitRuntime'] || true; if (typeof WebAssembly != 'object') { abort('no native wasm support detected'); } // Wasm globals var wasmMemory; //======================================== // Runtime essentials //======================================== // whether we are quitting the application. no code should run after this. // set in exit() and abort() var ABORT = false; // set by exit() and abort(). Passed to 'onExit' handler. // NOTE: This is also used as the process return code code in shell environments // but only when noExitRuntime is false. var EXITSTATUS; /** @type {function(*, string=)} */ function assert(condition, text) { if (!condition) { // This build was created without ASSERTIONS defined. `assert()` should not // ever be called in this configuration but in case there are callers in // the wild leave this simple abort() implemenation here for now. abort(text); } } // include: runtime_strings.js // runtime_strings.js: String related runtime functions that are part of both // MINIMAL_RUNTIME and regular runtime. var UTF8Decoder = typeof TextDecoder != 'undefined' ? new TextDecoder('utf8') : undefined; /** * Given a pointer 'idx' to a null-terminated UTF8-encoded string in the given * array that contains uint8 values, returns a copy of that string as a * Javascript String object. * heapOrArray is either a regular array, or a JavaScript typed array view. * @param {number} idx * @param {number=} maxBytesToRead * @return {string} */ function UTF8ArrayToString(heapOrArray, idx, maxBytesToRead) { var endIdx = idx + maxBytesToRead; var endPtr = idx; // TextDecoder needs to know the byte length in advance, it doesn't stop on // null terminator by itself. Also, use the length info to avoid running tiny // strings through TextDecoder, since .subarray() allocates garbage. // (As a tiny code save trick, compare endPtr against endIdx using a negation, // so that undefined means Infinity) while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr; if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) { return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr)); } var str = ''; // If building with TextDecoder, we have already computed the string length // above, so test loop end condition against that while (idx < endPtr) { // For UTF8 byte structure, see: // http://en.wikipedia.org/wiki/UTF-8#Description // https://www.ietf.org/rfc/rfc2279.txt // https://tools.ietf.org/html/rfc3629 var u0 = heapOrArray[idx++]; if (!(u0 & 0x80)) { str += String.fromCharCode(u0); continue; } var u1 = heapOrArray[idx++] & 63; if ((u0 & 0xE0) == 0xC0) { str += String.fromCharCode((u0 & 31) << 6 | u1); continue; } var u2 = heapOrArray[idx++] & 63; if ((u0 & 0xF0) == 0xE0) { u0 = (u0 & 15) << 12 | u1 << 6 | u2; } else { u0 = (u0 & 7) << 18 | u1 << 12 | u2 << 6 | heapOrArray[idx++] & 63; } if (u0 < 0x10000) { str += String.fromCharCode(u0); } else { var ch = u0 - 0x10000; str += String.fromCharCode(0xD800 | ch >> 10, 0xDC00 | ch & 0x3FF); } } return str; } /** * Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the * emscripten HEAP, returns a copy of that string as a Javascript String object. * * @param {number} ptr * @param {number=} maxBytesToRead - An optional length that specifies the * maximum number of bytes to read. You can omit this parameter to scan the * string until the first \0 byte. If maxBytesToRead is passed, and the string * at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the * string will cut short at that byte index (i.e. maxBytesToRead will not * produce a string of exact length [ptr, ptr+maxBytesToRead[) N.B. mixing * frequent uses of UTF8ToString() with and without maxBytesToRead may throw * JS JIT optimizations off, so it is worth to consider consistently using one * @return {string} */ function UTF8ToString(ptr, maxBytesToRead) { return ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : ''; } /** * Copies the given Javascript String object 'str' to the given byte array at * address 'outIdx', encoded in UTF8 form and null-terminated. The copy will * require at most str.length*4+1 bytes of space in the HEAP. Use the function * lengthBytesUTF8 to compute the exact number of bytes (excluding null * terminator) that this function will write. * * @param {string} str - The Javascript string to copy. * @param {ArrayBufferView|Array} heap - The array to copy to. Each * index in this array is assumed * to be one 8-byte element. * @param {number} outIdx - The starting offset in the array to begin the copying. * @param {number} maxBytesToWrite - The maximum number of bytes this function * can write to the array. This count should * include the null terminator, i.e. if * maxBytesToWrite=1, only the null terminator * will be written and nothing else. * maxBytesToWrite=0 does not write any bytes * to the output, not even the null * terminator. * @return {number} The number of bytes written, EXCLUDING the null terminator. */ function stringToUTF8Array(str, heap, outIdx, maxBytesToWrite) { // Parameter maxBytesToWrite is not optional. Negative values, 0, null, // undefined and false each don't write out any bytes. if (!(maxBytesToWrite > 0)) return 0; var startIdx = outIdx; var endIdx = outIdx + maxBytesToWrite - 1; // -1 for string null terminator. for (var i = 0; i < str.length; ++i) { // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code // unit, not a Unicode code point of the character! So decode // UTF16->UTF32->UTF8. // See http://unicode.org/faq/utf_bom.html#utf16-3 // For UTF8 byte structure, see http://en.wikipedia.org/wiki/UTF-8#Description // and https://www.ietf.org/rfc/rfc2279.txt // and https://tools.ietf.org/html/rfc3629 var u = str.charCodeAt(i); // possibly a lead surrogate if (u >= 0xD800 && u <= 0xDFFF) { var u1 = str.charCodeAt(++i); u = 0x10000 + ((u & 0x3FF) << 10) | u1 & 0x3FF; } if (u <= 0x7F) { if (outIdx >= endIdx) break; heap[outIdx++] = u; } else if (u <= 0x7FF) { if (outIdx + 1 >= endIdx) break; heap[outIdx++] = 0xC0 | u >> 6; heap[outIdx++] = 0x80 | u & 63; } else if (u <= 0xFFFF) { if (outIdx + 2 >= endIdx) break; heap[outIdx++] = 0xE0 | u >> 12; heap[outIdx++] = 0x80 | u >> 6 & 63; heap[outIdx++] = 0x80 | u & 63; } else { if (outIdx + 3 >= endIdx) break; heap[outIdx++] = 0xF0 | u >> 18; heap[outIdx++] = 0x80 | u >> 12 & 63; heap[outIdx++] = 0x80 | u >> 6 & 63; heap[outIdx++] = 0x80 | u & 63; } } // Null-terminate the pointer to the buffer. heap[outIdx] = 0; return outIdx - startIdx; } /** * Copies the given Javascript String object 'str' to the emscripten HEAP at * address 'outPtr', null-terminated and encoded in UTF8 form. The copy will * require at most str.length*4+1 bytes of space in the HEAP. * Use the function lengthBytesUTF8 to compute the exact number of bytes * (excluding null terminator) that this function will write. * * @return {number} The number of bytes written, EXCLUDING the null terminator. */ function stringToUTF8(str, outPtr, maxBytesToWrite) { return stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite); } /** * Returns the number of bytes the given Javascript string takes if encoded as a * UTF8 byte array, EXCLUDING the null terminator byte. * * @param {string} str - JavaScript string to operator on * @return {number} Length, in bytes, of the UTF8 encoded string. */ function lengthBytesUTF8(str) { var len = 0; for (var i = 0; i < str.length; ++i) { // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code // unit, not a Unicode code point of the character! So decode // UTF16->UTF32->UTF8. // See http://unicode.org/faq/utf_bom.html#utf16-3 var c = str.charCodeAt(i); // possibly a lead surrogate if (c <= 0x7F) { len++; } else if (c <= 0x7FF) { len += 2; } else if (c >= 0xD800 && c <= 0xDFFF) { len += 4; ++i; } else { len += 3; } } return len; } // end include: runtime_strings.js // Memory management var HEAP, /** @type {!ArrayBuffer} */ buffer, /** @type {!Int8Array} */ HEAP8, /** @type {!Uint8Array} */ HEAPU8, /** @type {!Int16Array} */ HEAP16, /** @type {!Uint16Array} */ HEAPU16, /** @type {!Int32Array} */ HEAP32, /** @type {!Uint32Array} */ HEAPU32, /** @type {!Float32Array} */ HEAPF32, /** @type {!Float64Array} */ 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 STACK_SIZE = 65536; var INITIAL_MEMORY = Module['INITIAL_MEMORY'] || 52428800; // include: runtime_init_table.js // In regular non-RELOCATABLE mode the table is exported // from the wasm module and this will be assigned once // the exports are available. var wasmTable; // end include: runtime_init_table.js // include: runtime_stack_check.js // end include: runtime_stack_check.js // include: runtime_assertions.js // end include: runtime_assertions.js var __ATPRERUN__ = []; // functions called before the runtime is initialized var __ATINIT__ = []; // functions called during startup var __ATEXIT__ = []; // functions called during shutdown var __ATPOSTRUN__ = []; // functions called after the main() is called var runtimeInitialized = false; function keepRuntimeAlive() { return noExitRuntime; } 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() { runtimeInitialized = true; callRuntimeCallbacks(__ATINIT__); } function postRun() { 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 addOnExit(cb) {} function addOnPostRun(cb) { __ATPOSTRUN__.unshift(cb); } // include: runtime_math.js // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/imul // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/fround // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/clz32 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/trunc // end include: runtime_math.js // A counter of dependencies for calling run(). If we need to // do asynchronous work before running, increment this and // decrement it. Incrementing must happen in a place like // Module.preRun (used by emcc to add file preloading). // Note that you can add dependencies in preRun, even though // it happens right before run - run will be postponed until // the dependencies are met. var runDependencies = 0; var runDependencyWatcher = null; var dependenciesFulfilled = null; // overridden to take different actions when all run dependencies are fulfilled function getUniqueRunDependency(id) { return id; } function addRunDependency(id) { runDependencies++; if (Module['monitorRunDependencies']) { Module['monitorRunDependencies'](runDependencies); } } function removeRunDependency(id) { runDependencies--; if (Module['monitorRunDependencies']) { Module['monitorRunDependencies'](runDependencies); } if (runDependencies == 0) { if (runDependencyWatcher !== null) { clearInterval(runDependencyWatcher); runDependencyWatcher = null; } if (dependenciesFulfilled) { var callback = dependenciesFulfilled; dependenciesFulfilled = null; callback(); // can add another dependenciesFulfilled } } } /** @param {string|number=} what */ function abort(what) { if (Module['onAbort']) { Module['onAbort'](what); } what = 'Aborted(' + what + ')'; // TODO(sbc): Should we remove printing and leave it up to whoever // catches the exception? err(what); ABORT = true; EXITSTATUS = 1; what += '. Build with -sASSERTIONS for more info.'; // Use a wasm runtime error, because a JS error might be seen as a foreign // exception, which means we'd run destructors on it. We need the error to // simply make the program stop. // FIXME This approach does not work in Wasm EH because it currently does not assume // all RuntimeErrors are from traps; it decides whether a RuntimeError is from // a trap or not based on a hidden field within the object. So at the moment // we don't have a way of throwing a wasm trap from JS. TODO Make a JS API that // allows this in the wasm spec. // Suppress closure compiler warning here. Closure compiler's builtin extern // defintion for WebAssembly.RuntimeError claims it takes no arguments even // though it can. // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure gets fixed. /** @suppress {checkTypes} */ var e = new WebAssembly.RuntimeError(what); readyPromiseReject(e); // Throw the error whether or not MODULARIZE is set because abort is used // in code paths apart from instantiation where an exception is expected // to be thrown when abort is called. throw e; } // {{MEM_INITIALIZER}} // include: memoryprofiler.js // end include: memoryprofiler.js // include: URIUtils.js // Prefix of data URIs emitted by SINGLE_FILE and related options. var dataURIPrefix = 'data:application/octet-stream;base64,'; // Indicates whether filename is a base64 data URI. function isDataURI(filename) { // Prefix of data URIs emitted by SINGLE_FILE and related options. return filename.startsWith(dataURIPrefix); } // Indicates whether filename is delivered via file protocol (as opposed to http/https) function isFileURI(filename) { return filename.startsWith('file://'); } // end include: URIUtils.js var wasmBinaryFile; wasmBinaryFile = 'openjphjs.wasm'; if (!isDataURI(wasmBinaryFile)) { wasmBinaryFile = locateFile(wasmBinaryFile); } function getBinary(file) { try { if (file == wasmBinaryFile && wasmBinary) { return new Uint8Array(wasmBinary); } if (readBinary) { return readBinary(file); } throw "both async and sync fetching of the wasm failed"; } catch (err) { abort(err); } } function getBinaryPromise() { // If we don't have the binary yet, try to to load it asynchronously. // Fetch has some additional restrictions over XHR, like it can't be used on a file:// url. // See https://github.com/github/fetch/pull/92#issuecomment-140665932 // Cordova or Electron apps are typically loaded from a file:// url. // So use fetch if it is available and the url is not a file, otherwise fall back to XHR. 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) { // fetch is not available or url is file => try XHR (readAsync uses XHR internally) return new Promise(function (resolve, reject) { readAsync(wasmBinaryFile, function (response) { resolve(new Uint8Array(/** @type{!ArrayBuffer} */response)); }, reject); }); } } } // Otherwise, getBinary should be able to get it synchronously return Promise.resolve().then(function () { return getBinary(wasmBinaryFile); }); } // Create the wasm instance. // Receives the wasm imports, returns the exports. function createWasm() { // prepare imports var info = { 'env': asmLibraryArg, 'wasi_snapshot_preview1': asmLibraryArg }; // Load the wasm module and create an instance of using native support in the JS engine. // handle a generated wasm instance, receiving its exports and // performing other necessary setup /** @param {WebAssembly.Module=} module*/ function receiveInstance(instance, module) { var exports = instance.exports; Module['asm'] = exports; wasmMemory = Module['asm']['memory']; updateGlobalBufferAndViews(wasmMemory.buffer); wasmTable = Module['asm']['__indirect_function_table']; addOnInit(Module['asm']['__wasm_call_ctors']); removeRunDependency('wasm-instantiate'); } // we can't run yet (except in a pthread, where we have a custom sync instantiator) addRunDependency('wasm-instantiate'); // Prefer streaming instantiation if available. function receiveInstantiationResult(result) { // 'result' is a ResultObject object which has both the module and instance. // receiveInstance() will swap in the exports (to Module.asm) so they can be called // TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193, the above line no longer optimizes out down to the following line. // When the regression is fixed, can restore the above USE_PTHREADS-enabled path. receiveInstance(result['instance']); } function instantiateArrayBuffer(receiver) { return getBinaryPromise().then(function (binary) { return WebAssembly.instantiate(binary, info); }).then(function (instance) { return instance; }).then(receiver, function (reason) { err('failed to asynchronously prepare wasm: ' + reason); abort(reason); }); } function instantiateAsync() { if (!wasmBinary && typeof WebAssembly.instantiateStreaming == 'function' && !isDataURI(wasmBinaryFile) && // Don't use streaming for file:// delivered objects in a webview, fetch them synchronously. !isFileURI(wasmBinaryFile) && // Avoid instantiateStreaming() on Node.js environment for now, as while // Node.js v18.1.0 implements it, it does not have a full fetch() // implementation yet. // // Reference: // https://github.com/emscripten-core/emscripten/pull/16917 !ENVIRONMENT_IS_NODE && typeof fetch == 'function') { return fetch(wasmBinaryFile, { credentials: 'same-origin' }).then(function (response) { // Suppress closure warning here since the upstream definition for // instantiateStreaming only allows Promise rather than // an actual Response. // TODO(https://github.com/google/closure-compiler/pull/3913): Remove if/when upstream closure is fixed. /** @suppress {checkTypes} */ var result = WebAssembly.instantiateStreaming(response, info); return result.then(receiveInstantiationResult, function (reason) { // We expect the most common failure cause to be a bad MIME type for the binary, // in which case falling back to ArrayBuffer instantiation should work. err('wasm streaming compile failed: ' + reason); err('falling back to ArrayBuffer instantiation'); return instantiateArrayBuffer(receiveInstantiationResult); }); }); } else { return instantiateArrayBuffer(receiveInstantiationResult); } } // User shell pages can write their own Module.instantiateWasm = function(imports, successCallback) callback // to manually instantiate the Wasm module themselves. This allows pages to run the instantiation parallel // to any other async startup actions they are performing. // Also pthreads and wasm workers initialize the wasm instance through this path. if (Module['instantiateWasm']) { try { var exports = Module['instantiateWasm'](info, receiveInstance); return exports; } catch (e) { err('Module.instantiateWasm callback failed with error: ' + e); // If instantiation fails, reject the module ready promise. readyPromiseReject(e); } } // If instantiation fails, reject the module ready promise. instantiateAsync().catch(readyPromiseReject); return {}; // no exports yet; we'll fill them in later } // Globals used by JS i64 conversions (see makeSetValue) var tempDouble; var tempI64; // === Body === var ASM_CONSTS = {}; /** @constructor */ function ExitStatus(status) { this.name = 'ExitStatus'; this.message = 'Program terminated with exit(' + status + ')'; this.status = status; } function callRuntimeCallbacks(callbacks) { while (callbacks.length > 0) { // Pass the module as the first argument. callbacks.shift()(Module); } } /** * @param {number} ptr * @param {string} type */ function getValue(ptr, type = 'i8') { if (type.endsWith('*')) type = '*'; switch (type) { case 'i1': return HEAP8[ptr >> 0]; case 'i8': return HEAP8[ptr >> 0]; case 'i16': return HEAP16[ptr >> 1]; case 'i32': return HEAP32[ptr >> 2]; case 'i64': return HEAP32[ptr >> 2]; case 'float': return HEAPF32[ptr >> 2]; case 'double': return HEAPF64[ptr >> 3]; case '*': return HEAPU32[ptr >> 2]; default: abort('invalid type for getValue: ' + type); } return null; } /** * @param {number} ptr * @param {number} value * @param {string} type */ function setValue(ptr, value, type = 'i8') { if (type.endsWith('*')) type = '*'; switch (type) { case 'i1': HEAP8[ptr >> 0] = value; break; case 'i8': HEAP8[ptr >> 0] = value; break; case 'i16': HEAP16[ptr >> 1] = value; break; case 'i32': HEAP32[ptr >> 2] = value; break; case 'i64': tempI64 = [value >>> 0, (tempDouble = value, +Math.abs(tempDouble) >= 1.0 ? tempDouble > 0.0 ? (Math.min(+Math.floor(tempDouble / 4294967296.0), 4294967295.0) | 0) >>> 0 : ~~+Math.ceil((tempDouble - +(~~tempDouble >>> 0)) / 4294967296.0) >>> 0 : 0)], HEAP32[ptr >> 2] = tempI64[0], HEAP32[ptr + 4 >> 2] = tempI64[1]; break; case 'float': HEAPF32[ptr >> 2] = value; break; case 'double': HEAPF64[ptr >> 3] = value; break; case '*': HEAPU32[ptr >> 2] = value; break; default: abort('invalid type for setValue: ' + type); } } 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 exceptionCaught = []; function exception_addRef(info) { info.add_ref(); } var uncaughtExceptionCount = 0; function ___cxa_begin_catch(ptr) { var info = new ExceptionInfo(ptr); if (!info.get_caught()) { info.set_caught(true); uncaughtExceptionCount--; } info.set_rethrown(false); exceptionCaught.push(info); exception_addRef(info); return info.get_exception_ptr(); } var exceptionLast = 0; var wasmTableMirror = []; function getWasmTableEntry(funcPtr) { var func = wasmTableMirror[funcPtr]; if (!func) { if (funcPtr >= wasmTableMirror.length) wasmTableMirror.length = funcPtr + 1; wasmTableMirror[funcPtr] = func = wasmTable.get(funcPtr); } return func; } function exception_decRef(info) { // A rethrown exception can reach refcount 0; it must not be discarded // Its next handler will clear the rethrown flag and addRef it, prior to // final decRef and destruction here if (info.release_ref() && !info.get_rethrown()) { var destructor = info.get_destructor(); if (destructor) { // In Wasm, destructors return 'this' as in ARM getWasmTableEntry(destructor)(info.excPtr); } ___cxa_free_exception(info.excPtr); } } function ___cxa_end_catch() { // Clear state flag. _setThrew(0); // Call destructor if one is registered then clear it. var info = exceptionCaught.pop(); exception_decRef(info); exceptionLast = 0; // XXX in decRef? } /** @constructor */ function ExceptionInfo(excPtr) { this.excPtr = excPtr; this.ptr = excPtr - 24; this.set_type = function (type) { HEAPU32[this.ptr + 4 >> 2] = type; }; this.get_type = function () { return HEAPU32[this.ptr + 4 >> 2]; }; this.set_destructor = function (destructor) { HEAPU32[this.ptr + 8 >> 2] = destructor; }; this.get_destructor = function () { return HEAPU32[this.ptr + 8 >> 2]; }; this.set_refcount = function (refcount) { HEAP32[this.ptr >> 2] = refcount; }; this.set_caught = function (caught) { caught = caught ? 1 : 0; HEAP8[this.ptr + 12 >> 0] = caught; }; this.get_caught = function () { return HEAP8[this.ptr + 12 >> 0] != 0; }; this.set_rethrown = function (rethrown) { rethrown = rethrown ? 1 : 0; HEAP8[this.ptr + 13 >> 0] = rethrown; }; this.get_rethrown = function () { return HEAP8[this.ptr + 13 >> 0] != 0; }; // Initialize native structure fields. Should be called once after allocated. this.init = function (type, destructor) { this.set_adjusted_ptr(0); 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 >> 2]; HEAP32[this.ptr >> 2] = value + 1; }; // Returns true if last reference released. this.release_ref = function () { var prev = HEAP32[this.ptr >> 2]; HEAP32[this.ptr >> 2] = prev - 1; return prev === 1; }; this.set_adjusted_ptr = function (adjustedPtr) { HEAPU32[this.ptr + 16 >> 2] = adjustedPtr; }; this.get_adjusted_ptr = function () { return HEAPU32[this.ptr + 16 >> 2]; }; // Get pointer which is expected to be received by catch clause in C++ code. It may be adjusted // when the pointer is casted to some of the exception object base classes (e.g. when virtual // inheritance is used). When a pointer is thrown this method should return the thrown pointer // itself. this.get_exception_ptr = function () { // Work around a fastcomp bug, this code is still included for some reason in a build without // exceptions support. var isPointer = ___cxa_is_pointer_type(this.get_type()); if (isPointer) { return HEAPU32[this.excPtr >> 2]; } var adjusted = this.get_adjusted_ptr(); if (adjusted !== 0) return adjusted; return this.excPtr; }; } function ___resumeException(ptr) { if (!exceptionLast) { exceptionLast = ptr; } throw ptr; } function ___cxa_find_matching_catch_2() { var thrown = exceptionLast; if (!thrown) { // just pass through the null ptr setTempRet0(0); return 0; } var info = new ExceptionInfo(thrown); info.set_adjusted_ptr(thrown); var thrownType = info.get_type(); if (!thrownType) { // just pass through the thrown ptr setTempRet0(0); return thrown; } // can_catch receives a **, add indirection // The different catch blocks are denoted by different types. // Due to inheritance, those types may not precisely match the // type of the thrown object. Find one which matches, and // return the type of the catch block which should be called. for (var i = 0; i < arguments.length; i++) { var caughtType = arguments[i]; if (caughtType === 0 || caughtType === thrownType) { // Catch all clause matched or exactly the same type is caught break; } var adjusted_ptr_addr = info.ptr + 16; if (___cxa_can_catch(caughtType, thrownType, adjusted_ptr_addr)) { setTempRet0(caughtType); return thrown; } } setTempRet0(thrownType); return thrown; } function ___cxa_find_matching_catch_3() { var thrown = exceptionLast; if (!thrown) { // just pass through the null ptr setTempRet0(0); return 0; } var info = new ExceptionInfo(thrown); info.set_adjusted_ptr(thrown); var thrownType = info.get_type(); if (!thrownType) { // just pass through the thrown ptr setTempRet0(0); return thrown; } // can_catch receives a **, add indirection // The different catch blocks are denoted by different types. // Due to inheritance, those types may not precisely match the // type of the thrown object. Find one which matches, and // return the type of the catch block which should be called. for (var i = 0; i < arguments.length; i++) { var caughtType = arguments[i]; if (caughtType === 0 || caughtType === thrownType) { // Catch all clause matched or exactly the same type is caught break; } var adjusted_ptr_addr = info.ptr + 16; if (___cxa_can_catch(caughtType, thrownType, adjusted_ptr_addr)) { setTempRet0(caughtType); return thrown; } } setTempRet0(thrownType); return thrown; } function ___cxa_throw(ptr, type, destructor) { var info = new ExceptionInfo(ptr); // Initialize ExceptionInfo content after it was allocated in __cxa_allocate_exception. info.init(type, destructor); exceptionLast = ptr; uncaughtExceptionCount++; throw ptr; } var structRegistrations = {}; function runDestructors(destructors) { while (destructors.length) { var ptr = destructors.pop(); var del = destructors.pop(); del(ptr); } } function simpleReadValueFromPointer(pointer) { return this['fromWireType'](HEAP32[pointer >> 2]); } 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; } return name; } function createNamedFunction(name, body) { name = makeLegalFunctionName(name); /*jshint evil:true*/ 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 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((dt, i) => { if (registeredTypes.hasOwnProperty(dt)) { typeConverters[i] = registeredTypes[dt]; } else { unregisteredTypes.push(dt); if (!awaitingDependencies.hasOwnProperty(dt)) { awaitingDependencies[dt] = []; } awaitingDependencies[dt].push(() => { typeConverters[i] = registeredTypes[dt]; ++registered; if (registered === unregisteredTypes.length) { onComplete(typeConverters); } }); } }); if (0 === unregisteredTypes.length) { onComplete(typeConverters); } } function __embind_finalize_value_object(structType) { var reg = structRegistrations[structType]; delete structRegistrations[structType]; var rawConstructor = reg.rawConstructor; var rawDestructor = reg.rawDestructor; var fieldRecords = reg.fields; var fieldTypes = fieldRecords.map(field => field.getterReturnType).concat(fieldRecords.map(field => field.setterArgumentType)); whenDependentTypesAreResolved([structType], fieldTypes, fieldTypes => { var fields = {}; fieldRecords.forEach((field, i) => { var fieldName = field.fieldName; var getterReturnType = fieldTypes[i]; var getter = field.getter; var getterContext = field.getterContext; var setterArgumentType = fieldTypes[i + fieldRecords.length]; var setter = field.setter; var setterContext = field.setterContext; fields[fieldName] = { read: ptr => { return getterReturnType['fromWireType'](getter(getterContext, ptr)); }, write: (ptr, o) => { var destructors = []; setter(setterContext, ptr, setterArgumentType['toWireType'](destructors, o)); runDestructors(destructors); } }; }); return [{ name: reg.name, 'fromWireType': function (ptr) { var rv = {}; for (var i in fields) { rv[i] = fields[i].read(ptr); } rawDestructor(ptr); return rv; }, 'toWireType': function (destructors, o) { // todo: Here we have an opportunity for -O3 level "unsafe" optimizations: // assume all fields are present without checking. for (var fieldName in fields) { if (!(fieldName in o)) { throw new TypeError('Missing field: "' + fieldName + '"'); } } var ptr = rawConstructor(); for (fieldName in fields) { fields[fieldName].write(ptr, o[fieldName]); } if (destructors !== null) { destructors.push(rawDestructor, ptr); } return ptr; }, 'argPackAdvance': 8, 'readValueFromPointer': simpleReadValueFromPointer, destructorFunction: rawDestructor }]; }); } 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 BindingError = undefined; function throwBindingError(message) { throw new BindingError(message); } /** @param {Object=} options */ function registerType(rawType, registeredInstance, 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(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) { // ambiguous emscripten ABI: sometimes return values are // true or false, and sometimes integers (0 or 1) return !!wt; }, 'toWireType': function (destructors, o) { return o ? trueValue : falseValue; }, 'argPackAdvance': 8, 'readValueFromPointer': function (pointer) { // TODO: if heap is fixed (like in asm.js) this could be executed outside 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 // This type does not need a destructor }); } 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 finalizationRegistry = 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 downcastPointer(ptr, ptrClass, desiredClass) { if (ptrClass === desiredClass) { return ptr; } if (undefined === desiredClass.baseClass) { return null; // no conversion } var rv = downcastPointer(ptr, ptrClass, desiredClass.baseClass); if (rv === null) { return null; } return desiredClass.downcast(rv); } var registeredPointers = {}; 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; } var deletionQueue = []; function flushPendingDeletes() { while (deletionQueue.length) { var obj = deletionQueue.pop(); obj.$$.deleteScheduled = false; obj['delete'](); } } var delayFunction = undefined; 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) { // ptr is a raw pointer (or a raw smartpointer) // rawPointer is a maybe-null raw pointer var rawPointer = this.getPointee(ptr); if (!rawPointer) { this.destructor(ptr); return null; } var registeredInstance = getInheritedInstance(this.registeredClass, rawPointer); if (undefined !== registeredInstance) { // JS object has been neutered, time to repopulate it if (0 === registeredInstance.$$.count.value) { registeredInstance.$$.ptr = rawPointer; registeredInstance.$$.smartPtr = ptr; return registeredInstance['clone'](); } else { // else, just increment reference count on existing object // it already has a reference to the smart pointer 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 attachFinalizer(handle) { if ('undefined' === typeof FinalizationRegistry) { attachFinalizer = handle => handle; return handle; } // If the running environment has a FinalizationRegistry (see // https://github.com/tc39/proposal-weakrefs), then attach finalizers // for class handles. We check for the presence of FinalizationRegistry // at run-time, not build-time. finalizationRegistry = new FinalizationRegistry(info => { releaseClassHandle(info.$$); }); attachFinalizer = handle => { var $$ = handle.$$; var hasSmartPtr = !!$$.smartPtr; if (hasSmartPtr) { // We should not call the destructor on raw pointers in case other code expects the pointee to live var info = { $$: $$ }; finalizationRegistry.register(handle, info, handle); } return handle; }; detachFinalizer = handle => finalizationRegistry.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; } 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() {} function ensureOverloadTable(proto, methodName, humanName) { if (undefined === proto[methodName].overloadTable) { var prevFunc = proto[methodName]; // Inject an overload resolver function that routes to the appropriate overload based on the number of arguments. proto[methodName] = function () { // TODO This check can be removed in -O3 level "unsafe" optimizations. 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); }; // Move the previous function into the overload table. proto[methodName].overloadTable = []; proto[methodName].overloadTable[prevFunc.argCount] = prevFunc; } } /** @param {number=} numArguments */ 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"); } // We are exposing a function with the same name as an existing function. Create an overload table and a function selector // that routes between the two. ensureOverloadTable(Module, name, name); if (Module.hasOwnProperty(numArguments)) { throwBindingError("Cannot register multiple overloads of a function with the same number of arguments (" + numArguments + ")!"); } // Add the new function into the overload table. Module[name].overloadTable[numArguments] = value; } else { Module[name] = value; if (undefined !== numArguments) { Module[name].numArguments = numArguments; } } } /** @constructor */ 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 "' + embindRepr(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 "' + embindRepr(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) { // TODO: this is not strictly true // We could support BY_EMVAL conversions from raw pointers to smart pointers // because the smart pointer can hold a reference to the handle if (undefined === handle.$$.smartPtr) { throwBindingError('Passing raw pointer to smart pointer is illegal'); } switch (this.sharingPolicy) { case 0: // NONE // no upcasting 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: // INTRUSIVE ptr = handle.$$.smartPtr; break; case 2: // BY_EMVAL if (handle.$$.smartPtrType === this) { ptr = handle.$$.smartPtr; } else { var clonedHandle = handle['clone'](); ptr = this.rawShare(ptr, Emval.toHandle(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 "' + embindRepr(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 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 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; } /** @constructor @param {*=} pointeeType, @param {*=} sharingPolicy, @param {*=} rawGetPointee, @param {*=} rawConstructor, @param {*=} rawShare, @param {*=} rawDestructor, */ function RegisteredPointer(name, registeredClass, isReference, isConst, // smart pointer properties isSmartPointer, pointeeType, sharingPolicy, rawGetPointee, rawConstructor, rawShare, rawDestructor) { this.name = name; this.registeredClass = registeredClass; this.isReference = isReference; this.isConst = isConst; // smart pointer properties 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; // Here we must leave this.destructorFunction undefined, since whether genericPointerToWireType returns // a pointer that needs to be freed up is runtime-dependent, and cannot be evaluated at registration time. // TODO: Create an alternative mechanism that allows removing the use of var destructors = []; array in // craftInvokerFunction altogether. } } /** @param {number=} numArguments */ function replacePublicSymbol(name, value, numArguments) { if (!Module.hasOwnProperty(name)) { throwInternalError('Replacing nonexistant public symbol'); } // If there's an overload table for this symbol, replace the symbol in the overload table instead. 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) { var f = Module['dynCall_' + sig]; return args && args.length ? f.apply(null, [ptr].concat(args)) : f.call(null, ptr); } /** @param {Object=} args */ function dynCall(sig, ptr, args) { // Without WASM_BIGINT support we cannot directly call function with i64 as // part of thier signature, so we rely the dynCall functions generated by // wasm-emscripten-finalize if (sig.includes('j')) { return dynCallLegacy(sig, ptr, args); } var rtn = getWasmTableEntry(ptr).apply(null, args); return rtn; } function getDynCaller(sig, ptr) { var argCache = []; return function () { argCache.length = 0; Object.assign(argCache, arguments); return dynCall(sig, ptr, argCache); }; } function embind__requireFunction(signature, rawFunction) { signature = readLatin1String(signature); function makeDynCaller() { if (signature.includes('j')) { return getDynCaller(signature, rawFunction); } return getWasmTableEntry(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 () { // this code cannot run if baseClassRawType is zero 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++) { // TODO(https://github.com/emscripten-core/emscripten/issues/17310): // Find a way to hoist the `>> 2` or `>> 3` out of this loop. array.push(HEAPU32[firstElement + i * 4 >> 2]); } return array; } function new_(constructor, argumentList) { if (!(constructor instanceof Function)) { throw new TypeError('new_ called with constructor type ' + typeof constructor + " which is not a function"); } /* * Previously, the following line was just: * function dummy() {}; * Unfortunately, Chrome was preserving 'dummy' as the object's name, even * though at creation, the 'dummy' has the correct constructor name. Thus, * objects created with IMVU.new would show up in the debugger as 'dummy', * which isn't very helpful. Using IMVU.createNamedFunction addresses the * issue. Doublely-unfortunately, there's no way to write a test for this * behavior. -NRD 2013.02.22 */ 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) { // humanName: a human-readable string name for the function to be generated. // argTypes: An array that contains the embind type objects for all types in the function signature. // argTypes[0] is the type object for the function return value. // argTypes[1] is the type object for function this object/class type, or null if not crafting an invoker for a class method. // argTypes[2...] are the actual function parameters. // classType: The embind type object for the class to be bound, or null if this is not a method of a class. // cppInvokerFunc: JS Function object to the C++-side function that interops into C++ code. // cppTargetFunc: Function pointer (an integer to FUNCTION_TABLE) to the target C++ function the cppInvokerFunc will end up calling. 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; // Free functions with signature "void function()" do not need an invoker that marshalls between wire types. // TODO: This omits argument count check - enable only at -O3 or similar. // if (ENABLE_UNSAFE_OPTS && argCount == 2 && argTypes[0].name == "void" && !isClassMethodFunc) { // return FUNCTION_TABLE[fn]; // } // Determine if we need to use a dynamic stack to store the destructors for the function parameters. // TODO: Remove this completely once all function invokers are being dynamically generated. var needsDestructorStack = false; for (var i = 1; i < argTypes.length; ++i) { // Skip return value at index 0 - it's not deleted here. if (argTypes[i] !== null && argTypes[i].destructorFunction === undefined) { // The type does not define a destructor function - must use dynamic stack 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) { // Skip return value at index 0 - it's not deleted here. Also skip class type if not a method. 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"; } else {} invokerFnBody += "}\n"; args1.push(invokerFnBody); var invokerFunction = new_(Function, args1).apply(null, args2); return invokerFunction; } 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] = () => { throwUnboundTypeError('Cannot construct ' + classType.name + ' due to unbound types', rawArgTypes); }; whenDependentTypesAreResolved([], rawArgTypes, function (argTypes) { // Insert empty slot for context type (argTypes[1]). argTypes.splice(1, 0, null); classType.registeredClass.constructor_body[argCount - 1] = craftInvokerFunction(humanName, argTypes, null, invoker, rawConstructor); return []; }); return []; }); } function __embind_register_class_function(rawClassType, methodName, argCount, rawArgTypesAddr, // [ReturnType, ThisType, Args...] 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) { // This is the first overload to be registered, OR we are replacing a // function in the base class with a function in the derived class. unboundTypesHandler.argCount = argCount - 2; unboundTypesHandler.className = classType.name; proto[methodName] = unboundTypesHandler; } else { // There was an existing function with the same name registered. Set up // a function overload routing table. ensureOverloadTable(proto, methodName, humanName); proto[methodName].overloadTable[argCount - 2] = unboundTypesHandler; } whenDependentTypesAreResolved([], rawArgTypes, function (argTypes) { var memberFunction = craftInvokerFunction(humanName, argTypes, classType, rawInvoker, context); // Replace the initial unbound-handler-stub function with the appropriate member function, now that all types // are resolved. If multiple overloads are registered for this function, the function goes into an overload table. if (undefined === proto[methodName].overloadTable) { // Set argCount in case an overload is registered later 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; } var Emval = { toValue: handle => { if (!handle) { throwBindingError('Cannot use deleted val. handle = ' + handle); } return emval_handle_array[handle].value; }, toHandle: 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.toValue(handle); __emval_decref(handle); return rv; }, 'toWireType': function (destructors, value) { return Emval.toHandle(value); }, 'argPackAdvance': 8, 'readValueFromPointer': simpleReadValueFromPointer, destructorFunction: null // This type does not need a destructor // TODO: do we need a deleteObject here? write a test where // emval is passed into JS via an interface }); } function embindRepr(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) { // The VM will perform JS to Wasm value conversion, according to the spec: // https://www.w3.org/TR/wasm-js-api-1/#towebassemblyvalue return value; }, 'argPackAdvance': 8, 'readValueFromPointer': floatReadValueFromPointer(name, shift), destructorFunction: null // This type does not need a destructor }); } 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] /* return value */, null /* no class 'this'*/].concat(argTypes.slice(1) /* actual params */); replacePublicSymbol(name, craftInvokerFunction(name, invokerArgsArray, null /* no class 'this'*/, rawInvoker, fn), argCount - 1); return []; }); } function integerReadValueFromPointer(name, shift, signed) { // integers are quite common, so generate very specialized functions 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); // LLVM doesn't have signed and unsigned 32-bit types, so u32 literals come // out as 'i32 -1'. Always treat those as max u32. if (maxRange === -1) { maxRange = 4294967295; } var shift = getShiftFromSize(size); var fromWireType = value => value; if (minRange === 0) { var bitshift = 32 - 8 * size; fromWireType = value => value << bitshift >>> bitshift; } var isUnsignedType = name.includes('unsigned'); var checkAssertions = (value, toTypeName) => {}; var toWireType; if (isUnsignedType) { toWireType = function (destructors, value) { checkAssertions(value, this.name); return value >>> 0; }; } else { toWireType = function (destructors, value) { checkAssertions(value, this.name); // The VM will perform JS to Wasm value conversion, according to the spec: // https://www.w3.org/TR/wasm-js-api-1/#towebassemblyvalue return value; }; } registerType(primitiveType, { name: name, 'fromWireType': fromWireType, 'toWireType': toWireType, 'argPackAdvance': 8, 'readValueFromPointer': integerReadValueFromPointer(name, shift, minRange !== 0), destructorFunction: null // This type does not need a destructor }); } 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]; // in elements var data = heap[handle + 1]; // byte offset into emscripten heap 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 //process only std::string bindings with UTF8 support, in contrast to e.g. std::basic_string = name === "std::string"; registerType(rawType, { name: name, 'fromWireType': function (value) { var length = HEAPU32[value >> 2]; var payload = value + 4; var str; if (stdStringIsUTF8) { var decodeStartPtr = payload; // Looping here to support possible embedded '0' bytes for (var i = 0; i <= length; ++i) { var currentBytePtr = payload + 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[payload + i]); } str = a.join(''); } _free(value); return str; }, 'toWireType': function (destructors, value) { if (value instanceof ArrayBuffer) { value = new Uint8Array(value); } var length; 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) { length = lengthBytesUTF8(value); } else { length = value.length; } // assumes 4-byte alignment var base = _malloc(4 + length + 1); var ptr = base + 4; HEAPU32[base >> 2] = length; if (stdStringIsUTF8 && valueIsOfTypeString) { stringToUTF8(value, ptr, 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 + i] = charCode; } } else { for (var i = 0; i < length; ++i) { HEAPU8[ptr + i] = value[i]; } } } if (destructors !== null) { destructors.push(_free, base); } return base; }, 'argPackAdvance': 8, 'readValueFromPointer': simpleReadValueFromPointer, destructorFunction: function (ptr) { _free(ptr); } }); } var UTF16Decoder = typeof TextDecoder != 'undefined' ? new TextDecoder('utf-16le') : undefined; ; function UTF16ToString(ptr, maxBytesToRead) { var endPtr = ptr; // TextDecoder needs to know the byte length in advance, it doesn't stop on // null terminator by itself. // Also, use the length info to avoid running tiny strings through // TextDecoder, since .subarray() allocates garbage. var idx = endPtr >> 1; var maxIdx = idx + maxBytesToRead / 2; // If maxBytesToRead is not passed explicitly, it will be undefined, and this // will always evaluate to true. This saves on code size. while (!(idx >= maxIdx) && HEAPU16[idx]) ++idx; endPtr = idx << 1; if (endPtr - ptr > 32 && UTF16Decoder) return UTF16Decoder.decode(HEAPU8.subarray(ptr, endPtr)); // Fallback: decode without UTF16Decoder var str = ''; // If maxBytesToRead is not passed explicitly, it will be undefined, and the // for-loop's condition will always evaluate to true. The loop is then // terminated on the first null char. for (var i = 0; !(i >= maxBytesToRead / 2); ++i) { var codeUnit = HEAP16[ptr + i * 2 >> 1]; if (codeUnit == 0) break; // fromCharCode constructs a character from a UTF-16 code unit, so we can // pass the UTF16 string right through. str += String.fromCharCode(codeUnit); } return str; } function stringToUTF16(str, outPtr, maxBytesToWrite) { // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed. if (maxBytesToWrite === undefined) { maxBytesToWrite = 0x7FFFFFFF; } if (maxBytesToWrite < 2) return 0; maxBytesToWrite -= 2; // Null terminator. var startPtr = outPtr; var numCharsToWrite = maxBytesToWrite < str.length * 2 ? maxBytesToWrite / 2 : str.length; for (var i = 0; i < numCharsToWrite; ++i) { // charCodeAt returns a UTF-16 encoded code unit, so it can be directly written to the HEAP. var codeUnit = str.charCodeAt(i); // possibly a lead surrogate HEAP16[outPtr >> 1] = codeUnit; outPtr += 2; } // Null-terminate the pointer to the HEAP. HEAP16[outPtr >> 1] = 0; return outPtr - startPtr; } function lengthBytesUTF16(str) { return str.length * 2; } function UTF32ToString(ptr, maxBytesToRead) { var i = 0; var str = ''; // If maxBytesToRead is not passed explicitly, it will be undefined, and this // will always evaluate to true. This saves on code size. while (!(i >= maxBytesToRead / 4)) { var utf32 = HEAP32[ptr + i * 4 >> 2]; if (utf32 == 0) break; ++i; // Gotcha: fromCharCode constructs a character from a UTF-16 encoded code (pair), not from a Unicode code point! So encode the code point to UTF-16 for constructing. // See http://unicode.org/faq/utf_bom.html#utf16-3 if (utf32 >= 0x10000) { var ch = utf32 - 0x10000; str += String.fromCharCode(0xD800 | ch >> 10, 0xDC00 | ch & 0x3FF); } else { str += String.fromCharCode(utf32); } } return str; } function stringToUTF32(str, outPtr, maxBytesToWrite) { // Backwards compatibility: if max bytes is not specified, assume unsafe unbounded write is allowed. if (maxBytesToWrite === undefined) { maxBytesToWrite = 0x7FFFFFFF; } if (maxBytesToWrite < 4) return 0; var startPtr = outPtr; var endPtr = startPtr + maxBytesToWrite - 4; for (var i = 0; i < str.length; ++i) { // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap. // See http://unicode.org/faq/utf_bom.html#utf16-3 var codeUnit = str.charCodeAt(i); // possibly a lead surrogate if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) { var trailSurrogate = str.charCodeAt(++i); codeUnit = 0x10000 + ((codeUnit & 0x3FF) << 10) | trailSurrogate & 0x3FF; } HEAP32[outPtr >> 2] = codeUnit; outPtr += 4; if (outPtr + 4 > endPtr) break; } // Null-terminate the pointer to the HEAP. HEAP32[outPtr >> 2] = 0; return outPtr - startPtr; } function lengthBytesUTF32(str) { var len = 0; for (var i = 0; i < str.length; ++i) { // Gotcha: charCodeAt returns a 16-bit word that is a UTF-16 encoded code unit, not a Unicode code point of the character! We must decode the string to UTF-32 to the heap. // See http://unicode.org/faq/utf_bom.html#utf16-3 var codeUnit = str.charCodeAt(i); if (codeUnit >= 0xD800 && codeUnit <= 0xDFFF) ++i; // possibly a lead surrogate, so skip over the tail surrogate. len += 4; } return len; } 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 = () => HEAPU16; shift = 1; } else if (charSize === 4) { decodeString = UTF32ToString; encodeString = stringToUTF32; lengthBytesUTF = lengthBytesUTF32; getHeap = () => HEAPU32; shift = 2; } registerType(rawType, { name: name, 'fromWireType': function (value) { // Code mostly taken from _embind_register_std_string fromWireType var length = HEAPU32[value >> 2]; var HEAP = getHeap(); var str; var decodeStartPtr = value + 4; // Looping here to support possible embedded '0' bytes 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); } // assumes 4-byte alignment 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_value_object(rawType, name, constructorSignature, rawConstructor, destructorSignature, rawDestructor) { structRegistrations[rawType] = { name: readLatin1String(name), rawConstructor: embind__requireFunction(constructorSignature, rawConstructor), rawDestructor: embind__requireFunction(destructorSignature, rawDestructor), fields: [] }; } function __embind_register_value_object_field(structType, fieldName, getterReturnType, getterSignature, getter, getterContext, setterArgumentType, setterSignature, setter, setterContext) { structRegistrations[structType].fields.push({ fieldName: readLatin1String(fieldName), getterReturnType: getterReturnType, getter: embind__requireFunction(getterSignature, getter), getterContext: getterContext, setterArgumentType: setterArgumentType, setter: embind__requireFunction(setterSignature, setter), setterContext: setterContext }); } function __embind_register_void(rawType, name) { name = readLatin1String(name); registerType(rawType, { isVoid: true, // void return values can be optimized out sometimes name: name, 'argPackAdvance': 0, 'fromWireType': function () { return undefined; }, 'toWireType': function (destructors, o) { // TODO: assert if anything else is given? return undefined; } }); } function __emval_incref(handle) { if (handle > 4) { emval_handle_array[handle].refcount += 1; } } function requireRegisteredType(rawType, humanName) { var impl = registeredTypes[rawType]; if (undefined === impl) { throwBindingError(humanName + " has unknown type " + getTypeName(rawType)); } return impl; } function __emval_take_value(type, arg) { type = requireRegisteredType(type, '_emval_take_value'); var v = type['readValueFromPointer'](arg); return Emval.toHandle(v); } function _abort() { abort(''); } function _emscripten_memcpy_big(dest, src, num) { HEAPU8.copyWithin(dest, src, src + num); } function getHeapMax() { // Stay one Wasm page short of 4GB: while e.g. Chrome is able to allocate // full 4GB Wasm memories, the size will wrap back to 0 bytes in Wasm side // for any code that deals with heap sizes, which would require special // casing all heap size related code to treat 0 specially. return 2147483648; } function emscripten_realloc_buffer(size) { try { // round size grow request up to wasm page size (fixed 64KB per spec) wasmMemory.grow(size - buffer.byteLength + 65535 >>> 16); // .grow() takes a delta compared to the previous size updateGlobalBufferAndViews(wasmMemory.buffer); return 1 /*success*/; } catch (e) {} // implicit 0 return to save code size (caller will cast "undefined" into 0 // anyhow) } function _emscripten_resize_heap(requestedSize) { var oldSize = HEAPU8.length; requestedSize = requestedSize >>> 0; // With multithreaded builds, races can happen (another thread might increase the size // in between), so return a failure, and let the caller retry. // Memory resize rules: // 1. Always increase heap size to at least the requested size, rounded up // to next page multiple. // 2a. If MEMORY_GROWTH_LINEAR_STEP == -1, excessively resize the heap // geometrically: increase the heap size according to // MEMORY_GROWTH_GEOMETRIC_STEP factor (default +20%), At most // overreserve by MEMORY_GROWTH_GEOMETRIC_CAP bytes (default 96MB). // 2b. If MEMORY_GROWTH_LINEAR_STEP != -1, excessively resize the heap // linearly: increase the heap size by at least // MEMORY_GROWTH_LINEAR_STEP bytes. // 3. Max size for the heap is capped at 2048MB-WASM_PAGE_SIZE, or by // MAXIMUM_MEMORY, or by ASAN limit, depending on which is smallest // 4. If we were unable to allocate as much memory, it may be due to // over-eager decision to excessively reserve due to (3) above. // Hence if an allocation fails, cut down on the amount of excess // growth, in an attempt to succeed to perform a smaller allocation. // A limit is set for how much we can grow. We should not exceed that // (the wasm binary specifies it, so if we tried, we'd fail anyhow). var maxHeapSize = getHeapMax(); if (requestedSize > maxHeapSize) { return false; } let alignUp = (x, multiple) => x + (multiple - x % multiple) % multiple; // Loop through potential heap size increases. If we attempt a too eager // reservation that fails, cut down on the attempted size and reserve a // smaller bump instead. (max 3 times, chosen somewhat arbitrarily) for (var cutDown = 1; cutDown <= 4; cutDown *= 2) { var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown); // ensure geometric growth // but limit overreserving (default to capping at +96MB overgrowth at most) 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; } } return false; } var SYSCALLS = { varargs: undefined, get: function () { SYSCALLS.varargs += 4; var ret = HEAP32[SYSCALLS.varargs - 4 >> 2]; return ret; }, getStr: function (ptr) { var ret = UTF8ToString(ptr); return ret; } }; function _fd_close(fd) { return 52; } function convertI32PairToI53Checked(lo, hi) { return hi + 0x200000 >>> 0 < 0x400001 - !!lo ? (lo >>> 0) + hi * 4294967296 : NaN; } function _fd_seek(fd, offset_low, offset_high, whence, newOffset) { return 70; } var printCharBuffers = [null, [], []]; function printChar(stream, curr) { var buffer = printCharBuffers[stream]; if (curr === 0 || curr === 10) { (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0)); buffer.length = 0; } else { buffer.push(curr); } } function flush_NO_FILESYSTEM() { // flush anything remaining in the buffers during shutdown if (printCharBuffers[1].length) printChar(1, 10); if (printCharBuffers[2].length) printChar(2, 10); } function _fd_write(fd, iov, iovcnt, pnum) { // hack to support printf in SYSCALLS_REQUIRE_FILESYSTEM=0 var num = 0; for (var i = 0; i < iovcnt; i++) { var ptr = HEAPU32[iov >> 2]; var len = HEAPU32[iov + 4 >> 2]; iov += 8; for (var j = 0; j < len; j++) { printChar(fd, HEAPU8[ptr + j]); } num += len; } HEAPU32[pnum >> 2] = num; return 0; } function _llvm_eh_typeid_for(type) { return type; } function getCFunc(ident) { var func = Module['_' + ident]; // closure exported function return func; } function writeArrayToMemory(array, buffer) { HEAP8.set(array, buffer); } /** * @param {string|null=} returnType * @param {Array=} argTypes * @param {Arguments|Array=} args * @param {Object=} opts */ function ccall(ident, returnType, argTypes, args, opts) { // For fast lookup of conversion functions var toC = { 'string': str => { var ret = 0; if (str !== null && str !== undefined && str !== 0) { // null string // at most 4 bytes per UTF-8 code point, +1 for the trailing '\0' var len = (str.length << 2) + 1; ret = stackAlloc(len); stringToUTF8(str, ret, len); } return ret; }, 'array': arr => { var ret = stackAlloc(arr.length); writeArrayToMemory(arr, ret); return ret; } }; function convertReturnValue(ret) { if (returnType === 'string') { return UTF8ToString(ret); } if (returnType === 'boolean') return Boolean(ret); return ret; } var func = getCFunc(ident); var cArgs = []; var stack = 0; if (args) { for (var i = 0; i < args.length; i++) { var converter = toC[argTypes[i]]; if (converter) { if (stack === 0) stack = stackSave(); cArgs[i] = converter(args[i]); } else { cArgs[i] = args[i]; } } } var ret = func.apply(null, cArgs); function onDone(ret) { if (stack !== 0) stackRestore(stack); return convertReturnValue(ret); } ret = onDone(ret); return ret; } InternalError = Module['InternalError'] = extendError(Error, 'InternalError'); ; embind_init_charCodes(); BindingError = Module['BindingError'] = extendError(Error, 'BindingError'); ; init_ClassHandle(); init_embind(); ; init_RegisteredPointer(); UnboundTypeError = Module['UnboundTypeError'] = extendError(Error, 'UnboundTypeError'); ; init_emval(); ; var ASSERTIONS = false; var asmLibraryArg = { "__assert_fail": ___assert_fail, "__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_throw": ___cxa_throw, "__resumeException": ___resumeException, "_embind_finalize_value_object": __embind_finalize_value_object, "_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_value_object": __embind_register_value_object, "_embind_register_value_object_field": __embind_register_value_object_field, "_embind_register_void": __embind_register_void, "_emval_decref": __emval_decref, "_emval_incref": __emval_incref, "_emval_take_value": __emval_take_value, "abort": _abort, "emscripten_memcpy_big": _emscripten_memcpy_big, "emscripten_resize_heap": _emscripten_resize_heap, "fd_close": _fd_close, "fd_seek": _fd_seek, "fd_write": _fd_write, "invoke_i": invoke_i, "invoke_ii": invoke_ii, "invoke_iii": invoke_iii, "invoke_iiii": invoke_iiii, "invoke_v": invoke_v, "invoke_vi": invoke_vi, "invoke_viiii": invoke_viiii, "invoke_viiiiii": invoke_viiiiii, "llvm_eh_typeid_for": _llvm_eh_typeid_for }; var asm = createWasm(); /** @type {function(...*):?} */ var ___wasm_call_ctors = Module["___wasm_call_ctors"] = function () { return (___wasm_call_ctors = Module["___wasm_call_ctors"] = Module["asm"]["__wasm_call_ctors"]).apply(null, arguments); }; /** @type {function(...*):?} */ var _malloc = Module["_malloc"] = function () { return (_malloc = Module["_malloc"] = Module["asm"]["malloc"]).apply(null, arguments); }; /** @type {function(...*):?} */ var _free = Module["_free"] = function () { return (_free = Module["_free"] = Module["asm"]["free"]).apply(null, arguments); }; /** @type {function(...*):?} */ var ___cxa_free_exception = Module["___cxa_free_exception"] = function () { return (___cxa_free_exception = Module["___cxa_free_exception"] = Module["asm"]["__cxa_free_exception"]).apply(null, arguments); }; /** @type {function(...*):?} */ var ___getTypeName = Module["___getTypeName"] = function () { return (___getTypeName = Module["___getTypeName"] = Module["asm"]["__getTypeName"]).apply(null, arguments); }; /** @type {function(...*):?} */ var __embind_initialize_bindings = Module["__embind_initialize_bindings"] = function () { return (__embind_initialize_bindings = Module["__embind_initialize_bindings"] = Module["asm"]["_embind_initialize_bindings"]).apply(null, arguments); }; /** @type {function(...*):?} */ var ___errno_location = Module["___errno_location"] = function () { return (___errno_location = Module["___errno_location"] = Module["asm"]["__errno_location"]).apply(null, arguments); }; /** @type {function(...*):?} */ var setTempRet0 = Module["setTempRet0"] = function () { return (setTempRet0 = Module["setTempRet0"] = Module["asm"]["setTempRet0"]).apply(null, arguments); }; /** @type {function(...*):?} */ var stackSave = Module["stackSave"] = function () { return (stackSave = Module["stackSave"] = Module["asm"]["stackSave"]).apply(null, arguments); }; /** @type {function(...*):?} */ var stackRestore = Module["stackRestore"] = function () { return (stackRestore = Module["stackRestore"] = Module["asm"]["stackRestore"]).apply(null, arguments); }; /** @type {function(...*):?} */ var stackAlloc = Module["stackAlloc"] = function () { return (stackAlloc = Module["stackAlloc"] = Module["asm"]["stackAlloc"]).apply(null, arguments); }; /** @type {function(...*):?} */ var ___cxa_can_catch = Module["___cxa_can_catch"] = function () { return (___cxa_can_catch = Module["___cxa_can_catch"] = Module["asm"]["__cxa_can_catch"]).apply(null, arguments); }; /** @type {function(...*):?} */ var ___cxa_is_pointer_type = Module["___cxa_is_pointer_type"] = function () { return (___cxa_is_pointer_type = Module["___cxa_is_pointer_type"] = Module["asm"]["__cxa_is_pointer_type"]).apply(null, arguments); }; /** @type {function(...*):?} */ var dynCall_ji = Module["dynCall_ji"] = function () { return (dynCall_ji = Module["dynCall_ji"] = Module["asm"]["dynCall_ji"]).apply(null, arguments); }; /** @type {function(...*):?} */ var dynCall_iiji = Module["dynCall_iiji"] = function () { return (dynCall_iiji = Module["dynCall_iiji"] = Module["asm"]["dynCall_iiji"]).apply(null, arguments); }; /** @type {function(...*):?} */ var dynCall_jiji = Module["dynCall_jiji"] = function () { return (dynCall_jiji = Module["dynCall_jiji"] = Module["asm"]["dynCall_jiji"]).apply(null, arguments); }; function invoke_ii(index, a1) { var sp = stackSave(); try { return getWasmTableEntry(index)(a1); } catch (e) { stackRestore(sp); if (e !== e + 0) throw e; _setThrew(1, 0); } } function invoke_vi(index, a1) { var sp = stackSave(); try { getWasmTableEntry(index)(a1); } catch (e) { stackRestore(sp); if (e !== e + 0) throw e; _setThrew(1, 0); } } function invoke_viiii(index, a1, a2, a3, a4) { var sp = stackSave(); try { getWasmTableEntry(index)(a1, a2, a3, a4); } catch (e) { stackRestore(sp); if (e !== e + 0) throw e; _setThrew(1, 0); } } function invoke_v(index) { var sp = stackSave(); try { getWasmTableEntry(index)(); } catch (e) { stackRestore(sp); if (e !== e + 0) throw e; _setThrew(1, 0); } } function invoke_iiii(index, a1, a2, a3) { var sp = stackSave(); try { return getWasmTableEntry(index)(a1, a2, a3); } catch (e) { stackRestore(sp); if (e !== e + 0) throw e; _setThrew(1, 0); } } function invoke_i(index) { var sp = stackSave(); try { return getWasmTableEntry(index)(); } catch (e) { stackRestore(sp); if (e !== e + 0) throw e; _setThrew(1, 0); } } function invoke_viiiiii(index, a1, a2, a3, a4, a5, a6) { var sp = stackSave(); try { getWasmTableEntry(index)(a1, a2, a3, a4, a5, a6); } catch (e) { stackRestore(sp); if (e !== e + 0) throw e; _setThrew(1, 0); } } function invoke_iii(index, a1, a2) { var sp = stackSave(); try { return getWasmTableEntry(index)(a1, a2); } catch (e) { stackRestore(sp); if (e !== e + 0) throw e; _setThrew(1, 0); } } // === Auto-generated postamble setup entry stuff === Module["ccall"] = ccall; var calledRun; dependenciesFulfilled = function runCaller() { // If run has never been called, and we should call run (INVOKE_RUN is true, and Module.noInitialRun is not false) if (!calledRun) run(); if (!calledRun) dependenciesFulfilled = runCaller; // try this again later, after new deps are fulfilled }; /** @type {function(Array=)} */ function run(args) { args = args || arguments_; if (runDependencies > 0) { return; } preRun(); // a preRun added a dependency, run will be called later if (runDependencies > 0) { return; } function doRun() { // run may have just been called through dependencies being fulfilled just in this very frame, // or while the async setStatus time below was happening if (calledRun) return; calledRun = true; Module['calledRun'] = true; if (ABORT) return; initRuntime(); readyPromiseResolve(Module); if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized'](); postRun(); } if (Module['setStatus']) { Module['setStatus']('Running...'); setTimeout(function () { setTimeout(function () { Module['setStatus'](''); }, 1); doRun(); }, 1); } else { doRun(); } } if (Module['preInit']) { if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']]; while (Module['preInit'].length > 0) { Module['preInit'].pop()(); } } run(); return Module.ready; }; })(); if (true) module.exports = Module;else // removed by dead control flow {} /***/ }, /***/ 82838 /*!******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/BaseRenderingEngine.js ***! \******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ VIEWPORT_MIN_SIZE: () => (/* binding */ VIEWPORT_MIN_SIZE), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums/Events */ 14566); /* harmony import */ var _renderingEngineCache__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./renderingEngineCache */ 70935); /* harmony import */ var _eventTarget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../eventTarget */ 28699); /* harmony import */ var _utilities_uuidv4__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utilities/uuidv4 */ 29760); /* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utilities/triggerEvent */ 91133); /* harmony import */ var _enums_ViewportType__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../enums/ViewportType */ 43089); /* harmony import */ var _BaseVolumeViewport__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./BaseVolumeViewport */ 19401); /* harmony import */ var _StackViewport__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./StackViewport */ 67461); /* harmony import */ var _helpers_viewportTypeUsesCustomRenderingPipeline__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./helpers/viewportTypeUsesCustomRenderingPipeline */ 65072); /* harmony import */ var _helpers_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers/getOrCreateCanvas */ 63628); /* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../init */ 15678); /* harmony import */ var _helpers_viewportTypeToViewportClass__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers/viewportTypeToViewportClass */ 93158); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../enums */ 80600); /* harmony import */ var _helpers_stats__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./helpers/stats */ 6769); /* harmony import */ var _utilities_convertColorArrayToRgbString__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../utilities/convertColorArrayToRgbString */ 12685); const VIEWPORT_MIN_SIZE = 2; class BaseRenderingEngine { constructor(id) { this._needsRender = new Set(); this._animationFrameSet = false; this._animationFrameHandle = null; this.renderFrameOfReference = FrameOfReferenceUID => { const viewports = this._getViewportsAsArray(); const viewportIdsWithSameFrameOfReferenceUID = viewports.map(vp => { if (vp.getFrameOfReferenceUID() === FrameOfReferenceUID) { return vp.id; } }); this.renderViewports(viewportIdsWithSameFrameOfReferenceUID); }; this.id = id ? id : (0,_utilities_uuidv4__WEBPACK_IMPORTED_MODULE_3__["default"])(); this.useCPURendering = (0,_init__WEBPACK_IMPORTED_MODULE_10__.getShouldUseCPURendering)(); _renderingEngineCache__WEBPACK_IMPORTED_MODULE_1__["default"].set(this); if (!(0,_init__WEBPACK_IMPORTED_MODULE_10__.isCornerstoneInitialized)()) { throw new Error('@cornerstonejs/core is not initialized, run init() first'); } this._viewports = new Map(); this.hasBeenDestroyed = false; const config = (0,_init__WEBPACK_IMPORTED_MODULE_10__.getConfiguration)(); if (config?.debug?.statsOverlay) { _helpers_stats__WEBPACK_IMPORTED_MODULE_13__.StatsOverlay.setup(); } } enableElement(viewportInputEntry) { const viewportInput = this._normalizeViewportInputEntry(viewportInputEntry); this._throwIfDestroyed(); const { element, viewportId } = viewportInput; if (!element) { throw new Error('No element provided'); } const viewport = this.getViewport(viewportId); if (viewport) { this.disableElement(viewportId); } const { type } = viewportInput; const viewportUsesCustomRenderingPipeline = (0,_helpers_viewportTypeUsesCustomRenderingPipeline__WEBPACK_IMPORTED_MODULE_8__["default"])(type); if (!this.useCPURendering && !viewportUsesCustomRenderingPipeline) { this.enableVTKjsDrivenViewport(viewportInput); } else { this.addCustomViewport(viewportInput); } const canvas = (0,_helpers_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_9__["default"])(element); const { background } = viewportInput.defaultOptions; this.fillCanvasWithBackgroundColor(canvas, background); } disableElement(viewportId) { this._throwIfDestroyed(); const viewport = this.getViewport(viewportId); if (!viewport) { console.warn(`viewport ${viewportId} does not exist`); return; } this._resetViewport(viewport); if (!(0,_helpers_viewportTypeUsesCustomRenderingPipeline__WEBPACK_IMPORTED_MODULE_8__["default"])(viewport.type) && !this.useCPURendering) { if (this.offscreenMultiRenderWindow) { this.offscreenMultiRenderWindow.removeRenderer(viewportId); } } this._removeViewport(viewportId); viewport.isDisabled = true; this._needsRender.delete(viewportId); const viewports = this.getViewports(); if (!viewports.length) { this._clearAnimationFrame(); } } setViewports(publicViewportInputEntries) { const viewportInputEntries = this._normalizeViewportInputEntries(publicViewportInputEntries); this._throwIfDestroyed(); this._reset(); const vtkDrivenViewportInputEntries = []; const customRenderingViewportInputEntries = []; viewportInputEntries.forEach(vpie => { if (!this.useCPURendering && !(0,_helpers_viewportTypeUsesCustomRenderingPipeline__WEBPACK_IMPORTED_MODULE_8__["default"])(vpie.type)) { vtkDrivenViewportInputEntries.push(vpie); } else { customRenderingViewportInputEntries.push(vpie); } }); this.setVtkjsDrivenViewports(vtkDrivenViewportInputEntries); this.setCustomViewports(customRenderingViewportInputEntries); viewportInputEntries.forEach(vp => { const canvas = (0,_helpers_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_9__["default"])(vp.element); const { background } = vp.defaultOptions; this.fillCanvasWithBackgroundColor(canvas, background); }); } resize(immediate = true, keepCamera = true) { this._throwIfDestroyed(); const viewports = this._getViewportsAsArray(); const vtkDrivenViewports = []; const customRenderingViewports = []; viewports.forEach(vpie => { if (!(0,_helpers_viewportTypeUsesCustomRenderingPipeline__WEBPACK_IMPORTED_MODULE_8__["default"])(vpie.type)) { vtkDrivenViewports.push(vpie); } else { customRenderingViewports.push(vpie); } }); if (vtkDrivenViewports.length) { this._resizeVTKViewports(vtkDrivenViewports, keepCamera, immediate); } if (customRenderingViewports.length) { this._resizeUsingCustomResizeHandler(customRenderingViewports, keepCamera, immediate); } } getViewport(viewportId) { return this._viewports?.get(viewportId); } getViewports() { this._throwIfDestroyed(); return this._getViewportsAsArray(); } getStackViewport(viewportId) { this._throwIfDestroyed(); const viewport = this.getViewport(viewportId); if (!viewport) { throw new Error(`Viewport with Id ${viewportId} does not exist`); } if (!(viewport instanceof _StackViewport__WEBPACK_IMPORTED_MODULE_7__["default"])) { throw new Error(`Viewport with Id ${viewportId} is not a StackViewport.`); } return viewport; } getStackViewports() { this._throwIfDestroyed(); const viewports = this.getViewports(); return viewports.filter(vp => vp instanceof _StackViewport__WEBPACK_IMPORTED_MODULE_7__["default"]); } getVolumeViewports() { this._throwIfDestroyed(); const viewports = this.getViewports(); const isVolumeViewport = viewport => { return viewport instanceof _BaseVolumeViewport__WEBPACK_IMPORTED_MODULE_6__["default"]; }; return viewports.filter(isVolumeViewport); } render() { const viewports = this.getViewports(); const viewportIds = viewports.map(vp => vp.id); this._setViewportsToBeRenderedNextFrame(viewportIds); } renderViewports(viewportIds) { this._setViewportsToBeRenderedNextFrame(viewportIds); } renderViewport(viewportId) { this._setViewportsToBeRenderedNextFrame([viewportId]); } destroy() { if (this.hasBeenDestroyed) { return; } _helpers_stats__WEBPACK_IMPORTED_MODULE_13__.StatsOverlay.cleanup(); if (!this.useCPURendering) { const viewports = this._getViewportsAsArray(); viewports.forEach(vp => { if (this.offscreenMultiRenderWindow) { this.offscreenMultiRenderWindow.removeRenderer(vp.id); } }); if (this.offscreenMultiRenderWindow) { this.offscreenMultiRenderWindow.delete(); } delete this.offscreenMultiRenderWindow; } this._reset(); _renderingEngineCache__WEBPACK_IMPORTED_MODULE_1__["default"].delete(this.id); this.hasBeenDestroyed = true; } fillCanvasWithBackgroundColor(canvas, backgroundColor) { const ctx = canvas.getContext('2d'); const fillStyle = backgroundColor ? (0,_utilities_convertColorArrayToRgbString__WEBPACK_IMPORTED_MODULE_14__.convertColorArrayToRgbString)(backgroundColor) : 'black'; ctx.fillStyle = fillStyle; ctx.fillRect(0, 0, canvas.width, canvas.height); } _normalizeViewportInputEntry(viewportInputEntry) { const { type, defaultOptions } = viewportInputEntry; let options = defaultOptions; if (!options || Object.keys(options).length === 0) { options = { background: [0, 0, 0], orientation: null, displayArea: null }; if (type === _enums_ViewportType__WEBPACK_IMPORTED_MODULE_5__["default"].ORTHOGRAPHIC) { options = { ...options, orientation: _enums__WEBPACK_IMPORTED_MODULE_12__["default"].AXIAL }; } } return { ...viewportInputEntry, defaultOptions: options }; } _normalizeViewportInputEntries(viewportInputEntries) { const normalizedViewportInputs = []; viewportInputEntries.forEach(viewportInput => { normalizedViewportInputs.push(this._normalizeViewportInputEntry(viewportInput)); }); return normalizedViewportInputs; } _resizeUsingCustomResizeHandler(customRenderingViewports, keepCamera = true, immediate = true) { customRenderingViewports.forEach(vp => { if (typeof vp.resize === 'function') { vp.resize(); } }); customRenderingViewports.forEach(vp => { const prevCamera = vp.getCamera(); vp.resetCamera(); if (keepCamera) { vp.setCamera(prevCamera); } }); if (immediate) { this.render(); } } _removeViewport(viewportId) { const viewport = this.getViewport(viewportId); if (!viewport) { console.warn(`viewport ${viewportId} does not exist`); return; } this._viewports.delete(viewportId); } addCustomViewport(viewportInputEntry) { const { element, viewportId, type, defaultOptions } = viewportInputEntry; element.tabIndex = -1; const canvas = (0,_helpers_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_9__["default"])(element); const { clientWidth, clientHeight } = canvas; if (canvas.width !== clientWidth || canvas.height !== clientHeight) { canvas.width = clientWidth; canvas.height = clientHeight; } const viewportInput = { id: viewportId, renderingEngineId: this.id, element, type, canvas, sx: 0, sy: 0, sWidth: clientWidth, sHeight: clientHeight, defaultOptions: defaultOptions || {} }; const ViewportType = _helpers_viewportTypeToViewportClass__WEBPACK_IMPORTED_MODULE_11__["default"][type]; const viewport = new ViewportType(viewportInput); this._viewports.set(viewportId, viewport); const eventDetail = { element, viewportId, renderingEngineId: this.id }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_4__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_2__["default"], _enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].ELEMENT_ENABLED, eventDetail); } getRenderer(viewportId) { return this.offscreenMultiRenderWindow.getRenderer(viewportId); } getOffscreenMultiRenderWindow(viewportId) { if (this.useCPURendering) { throw new Error('Offscreen multi render window is not available when using CPU rendering.'); } return this.offscreenMultiRenderWindow; } setCustomViewports(viewportInputEntries) { viewportInputEntries.forEach(vpie => { this.addCustomViewport(vpie); }); } _getViewportsAsArray() { return Array.from(this._viewports.values()); } _setViewportsToBeRenderedNextFrame(viewportIds) { viewportIds.forEach(viewportId => { this._needsRender.add(viewportId); }); this._render(); } _render() { if (this._needsRender.size > 0 && !this._animationFrameSet) { this._animationFrameHandle = window.requestAnimationFrame(this._renderFlaggedViewports); this._animationFrameSet = true; } } _resetViewport(viewport) { const renderingEngineId = this.id; const { element, canvas, id: viewportId } = viewport; const eventDetail = { element, viewportId, renderingEngineId }; viewport.removeWidgets(); (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_4__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_2__["default"], _enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].ELEMENT_DISABLED, eventDetail); element.removeAttribute('data-viewport-uid'); element.removeAttribute('data-rendering-engine-uid'); const context = canvas.getContext('2d'); context.clearRect(0, 0, canvas.width, canvas.height); } _clearAnimationFrame() { window.cancelAnimationFrame(this._animationFrameHandle); this._needsRender.clear(); this._animationFrameSet = false; this._animationFrameHandle = null; } _reset() { const viewports = this._getViewportsAsArray(); viewports.forEach(viewport => { this._resetViewport(viewport); }); this._clearAnimationFrame(); this._viewports = new Map(); } _throwIfDestroyed() { if (this.hasBeenDestroyed) { throw new Error('this.destroy() has been manually called to free up memory, can not longer use this instance. Instead make a new one.'); } } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BaseRenderingEngine); /***/ }, /***/ 19401 /*!*****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/BaseVolumeViewport.js ***! \*****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _kitware_vtk_js_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/ColorTransferFunction */ 15722); /* harmony import */ var _kitware_vtk_js_Rendering_Core_ColorTransferFunction_ColorMaps__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps */ 56609); /* harmony import */ var _kitware_vtk_js_Common_DataModel_PiecewiseFunction__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @kitware/vtk.js/Common/DataModel/PiecewiseFunction */ 53173); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! gl-matrix */ 93067); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../cache/cache */ 38277); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../constants */ 33876); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../constants/mprCameraValues */ 50260); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../constants */ 3362); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../enums */ 14566); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../enums */ 80600); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../enums */ 78700); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../enums */ 15247); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../enums */ 94649); /* harmony import */ var _enums_ViewportType__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../enums/ViewportType */ 43089); /* harmony import */ var _eventTarget__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../eventTarget */ 28699); /* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../init */ 15678); /* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../utilities/triggerEvent */ 91133); /* harmony import */ var _utilities_colormap__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../utilities/colormap */ 33358); /* harmony import */ var _utilities_invertRgbTransferFunction__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../utilities/invertRgbTransferFunction */ 12265); /* harmony import */ var _utilities_createSigmoidRGBTransferFunction__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../utilities/createSigmoidRGBTransferFunction */ 11469); /* harmony import */ var _utilities_transformWorldToIndex__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../utilities/transformWorldToIndex */ 19598); /* harmony import */ var _utilities_transferFunctionUtils__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../utilities/transferFunctionUtils */ 19813); /* harmony import */ var _helpers_createVolumeActor__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./helpers/createVolumeActor */ 24402); /* harmony import */ var _helpers_volumeNewImageEventDispatcher__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./helpers/volumeNewImageEventDispatcher */ 35551); /* harmony import */ var _Viewport__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./Viewport */ 38589); /* harmony import */ var _vtkClasses_vtkSlabCamera__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./vtkClasses/vtkSlabCamera */ 61153); /* harmony import */ var _utilities_getVolumeViewportScrollInfo__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../utilities/getVolumeViewportScrollInfo */ 15376); /* harmony import */ var _utilities_actorCheck__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../utilities/actorCheck */ 36506); /* harmony import */ var _utilities_snapFocalPointToSlice__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../utilities/snapFocalPointToSlice */ 40579); /* harmony import */ var _utilities_getVoiFromSigmoidRGBTransferFunction__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../utilities/getVoiFromSigmoidRGBTransferFunction */ 66143); /* harmony import */ var _utilities_isEqual__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../utilities/isEqual */ 17137); /* harmony import */ var _utilities_applyPreset__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../utilities/applyPreset */ 92574); /* harmony import */ var _utilities_uuidv4__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../utilities/uuidv4 */ 29760); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../metaData */ 90161); /* harmony import */ var _helpers_getCameraVectors__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./helpers/getCameraVectors */ 14488); /* harmony import */ var _helpers_isContextPoolRenderingEngine__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./helpers/isContextPoolRenderingEngine */ 16080); /* harmony import */ var _helpers_isInvalidNumber__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./helpers/isInvalidNumber */ 70263); /* harmony import */ var _renderPasses__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./renderPasses */ 50765); /* harmony import */ var _renderPasses__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./renderPasses */ 38386); class BaseVolumeViewport extends _Viewport__WEBPACK_IMPORTED_MODULE_26__["default"] { constructor(props) { super(props); this.useCPURendering = false; this.sharpening = 0; this.smoothing = 0; this.perVolumeIdDefaultProperties = new Map(); this.viewportProperties = {}; this.volumeIds = new Set(); this.setRotation = rotation => { const panFit = this.getPan(this.fitToCanvasCamera); const pan = this.getPan(); const previousCamera = this.getCamera(); const panSub = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.sub([0, 0], panFit, pan); this.setPan(panSub, false); const { flipVertical } = this.getCamera(); const initialViewUp = flipVertical ? gl_matrix__WEBPACK_IMPORTED_MODULE_5__.negate([0, 0, 0], this.initialViewUp) : this.initialViewUp; this.setCameraNoEvent({ viewUp: initialViewUp }); this.rotateCamera(rotation); const afterPan = this.getPan(); const afterPanFit = this.getPan(this.fitToCanvasCamera); const newCenter = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.sub([0, 0], afterPan, afterPanFit); const newOffset = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.add([0, 0], panFit, newCenter); this.setPan(newOffset, false); if (this._suppressCameraModifiedEvents) { return; } const camera = this.getCamera(); const eventDetail = { previousCamera, camera, element: this.element, viewportId: this.id, renderingEngineId: this.renderingEngineId }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_18__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_10__["default"].CAMERA_MODIFIED, eventDetail); }; this.setSharpening = sharpening => { this.sharpening = sharpening; this.render(); }; this.setSmoothing = smoothing => { this.smoothing = smoothing; this.render(); }; this.getRenderPasses = () => { if (!this.shouldUseCustomRenderPass()) { return null; } const renderPasses = []; try { if (this.smoothing > 0) { renderPasses.push((0,_renderPasses__WEBPACK_IMPORTED_MODULE_40__.createSmoothingRenderPass)(this.smoothing)); } if (this.sharpening > 0) { renderPasses.push((0,_renderPasses__WEBPACK_IMPORTED_MODULE_39__.createSharpeningRenderPass)(this.sharpening)); } return renderPasses.length ? renderPasses : null; } catch (e) { console.warn('Failed to create custom render passes:', e); return null; } }; this.getDefaultProperties = volumeId => { let volumeProperties; if (volumeId !== undefined) { volumeProperties = this.perVolumeIdDefaultProperties.get(volumeId); } if (volumeProperties !== undefined) { return volumeProperties; } return { ...this.globalDefaultProperties }; }; this.getProperties = volumeId => { const applicableVolumeActorInfo = this._getApplicableVolumeActor(volumeId); if (!applicableVolumeActorInfo) { return; } const { colormap: latestColormap, VOILUTFunction, interpolationType, invert, slabThickness, preset } = this.viewportProperties; volumeId ||= this.getVolumeId(); const volume = _cache_cache__WEBPACK_IMPORTED_MODULE_6__["default"].getVolume(volumeId); if (!volume) { return null; } const volumeActorEntry = this.getActors().find(actorEntry => { return actorEntry.referencedId === volumeId; }); if (!volumeActorEntry) { return; } const volumeActor = volumeActorEntry.actor; const cfun = volumeActor.getProperty().getRGBTransferFunction(0); const [lower, upper] = this.viewportProperties?.VOILUTFunction === 'SIGMOID' ? (0,_utilities_getVoiFromSigmoidRGBTransferFunction__WEBPACK_IMPORTED_MODULE_31__["default"])(cfun) : cfun.getRange(); const voiRange = { lower, upper }; const volumeColormap = this.getColormap(volumeId); const colormap = volumeId && volumeColormap ? volumeColormap : latestColormap; return { colormap: colormap, voiRange: voiRange, VOILUTFunction: VOILUTFunction, interpolationType: interpolationType, invert: invert, slabThickness: slabThickness, preset, sharpening: this.sharpening, smoothing: this.smoothing }; }; this.getColormap = volumeId => { const applicableVolumeActorInfo = this._getApplicableVolumeActor(volumeId); if (!applicableVolumeActorInfo) { return; } const { volumeActor } = applicableVolumeActorInfo; const cfun = this._getOrCreateColorTransferFunction(volumeId); const { nodes } = cfun.getState(); const RGBPoints = nodes.reduce((acc, node) => { acc.push(node.x, node.r, node.g, node.b); return acc; }, []); const matchedColormap = (0,_utilities_colormap__WEBPACK_IMPORTED_MODULE_19__.findMatchingColormap)(RGBPoints, volumeActor) || {}; const threshold = (0,_utilities_colormap__WEBPACK_IMPORTED_MODULE_19__.getThresholdValue)(volumeActor); const opacity = (0,_utilities_colormap__WEBPACK_IMPORTED_MODULE_19__.getMaxOpacity)(volumeActor); matchedColormap.threshold = threshold; matchedColormap.opacity = opacity; return matchedColormap; }; this.getRotation = () => { const { viewUp: currentViewUp, viewPlaneNormal, flipVertical } = this.getCameraNoRotation(); const initialViewUp = flipVertical ? gl_matrix__WEBPACK_IMPORTED_MODULE_5__.negate([0, 0, 0], this.initialViewUp) : this.initialViewUp; if (!initialViewUp) { return 0; } const initialToCurrentViewUpAngle = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.angle(initialViewUp, currentViewUp) * 180 / Math.PI; const initialToCurrentViewUpCross = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.cross([0, 0, 0], initialViewUp, currentViewUp); const normalDot = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.dot(initialToCurrentViewUpCross, viewPlaneNormal); const value = normalDot >= 0 ? initialToCurrentViewUpAngle : (360 - initialToCurrentViewUpAngle) % 360; return value; }; this.getFrameOfReferenceUID = () => { return this._FrameOfReferenceUID; }; this.canvasToWorldTiled = canvasPos => { const vtkCamera = this.getVtkActiveCamera(); vtkCamera.setIsPerformingCoordinateTransformation?.(true); const renderer = this.getRenderer(); const displayCoords = this.getVtkDisplayCoordsTiled(canvasPos); const offscreenMultiRenderWindow = this.getRenderingEngine().offscreenMultiRenderWindow; const openGLRenderWindow = offscreenMultiRenderWindow.getOpenGLRenderWindow(); const worldCoord = openGLRenderWindow.displayToWorld(displayCoords[0], displayCoords[1], displayCoords[2], renderer); vtkCamera.setIsPerformingCoordinateTransformation?.(false); return [worldCoord[0], worldCoord[1], worldCoord[2]]; }; this.canvasToWorldContextPool = canvasPos => { const vtkCamera = this.getVtkActiveCamera(); vtkCamera.setIsPerformingCoordinateTransformation?.(true); const renderer = this.getRenderer(); const devicePixelRatio = window.devicePixelRatio || 1; const { width, height } = this.canvas; const aspectRatio = width / height; const [xMin, yMin, xMax, yMax] = renderer.getViewport(); const viewportWidth = xMax - xMin; const viewportHeight = yMax - yMin; const canvasPosWithDPR = [canvasPos[0] * devicePixelRatio, canvasPos[1] * devicePixelRatio]; const normalizedDisplay = [xMin + canvasPosWithDPR[0] / width * viewportWidth, yMin + (1 - canvasPosWithDPR[1] / height) * viewportHeight, 0]; const projCoords = renderer.normalizedDisplayToProjection(normalizedDisplay[0], normalizedDisplay[1], normalizedDisplay[2]); const viewCoords = renderer.projectionToView(projCoords[0], projCoords[1], projCoords[2], aspectRatio); const worldCoord = renderer.viewToWorld(viewCoords[0], viewCoords[1], viewCoords[2]); vtkCamera.setIsPerformingCoordinateTransformation?.(false); return [worldCoord[0], worldCoord[1], worldCoord[2]]; }; this.getVtkDisplayCoordsTiled = canvasPos => { const devicePixelRatio = window.devicePixelRatio || 1; const canvasPosWithDPR = [canvasPos[0] * devicePixelRatio, canvasPos[1] * devicePixelRatio]; const offscreenMultiRenderWindow = this.getRenderingEngine().offscreenMultiRenderWindow; const openGLRenderWindow = offscreenMultiRenderWindow.getOpenGLRenderWindow(); const size = openGLRenderWindow.getSize(); const displayCoord = [canvasPosWithDPR[0] + this.sx, canvasPosWithDPR[1] + this.sy]; displayCoord[1] = size[1] - displayCoord[1]; return [displayCoord[0], displayCoord[1], 0]; }; this.getVtkDisplayCoordsContextPool = canvasPos => { const devicePixelRatio = window.devicePixelRatio || 1; const canvasPosWithDPR = [canvasPos[0] * devicePixelRatio, canvasPos[1] * devicePixelRatio]; const renderer = this.getRenderer(); const { width, height } = this.canvas; const [xMin, yMin, xMax, yMax] = renderer.getViewport(); const viewportWidth = xMax - xMin; const viewportHeight = yMax - yMin; const scaledX = canvasPosWithDPR[0] / width * viewportWidth * width; const scaledY = canvasPosWithDPR[1] / height * viewportHeight * height; const displayCoord = [scaledX, viewportHeight * height - scaledY]; return [displayCoord[0], displayCoord[1], 0]; }; this.worldToCanvasTiled = worldPos => { const vtkCamera = this.getVtkActiveCamera(); vtkCamera.setIsPerformingCoordinateTransformation?.(true); const renderer = this.getRenderer(); const offscreenMultiRenderWindow = this.getRenderingEngine().offscreenMultiRenderWindow; const openGLRenderWindow = offscreenMultiRenderWindow.getOpenGLRenderWindow(); const size = openGLRenderWindow.getSize(); const displayCoord = openGLRenderWindow.worldToDisplay(...worldPos, renderer); displayCoord[1] = size[1] - displayCoord[1]; const canvasCoord = [displayCoord[0] - this.sx, displayCoord[1] - this.sy]; const devicePixelRatio = window.devicePixelRatio || 1; const canvasCoordWithDPR = [canvasCoord[0] / devicePixelRatio, canvasCoord[1] / devicePixelRatio]; vtkCamera.setIsPerformingCoordinateTransformation(false); return canvasCoordWithDPR; }; this.worldToCanvasContextPool = worldPos => { const vtkCamera = this.getVtkActiveCamera(); vtkCamera.setIsPerformingCoordinateTransformation?.(true); const renderer = this.getRenderer(); const { width, height } = this.canvas; const aspectRatio = width / height; const [xMin, yMin, xMax, yMax] = renderer.getViewport(); const viewportWidth = xMax - xMin; const viewportHeight = yMax - yMin; const viewCoords = renderer.worldToView(worldPos[0], worldPos[1], worldPos[2]); const projCoords = renderer.viewToProjection(viewCoords[0], viewCoords[1], viewCoords[2], aspectRatio); const normalizedDisplay = renderer.projectionToNormalizedDisplay(projCoords[0], projCoords[1], projCoords[2]); const canvasNormalizedX = (normalizedDisplay[0] - xMin) / viewportWidth; const canvasNormalizedY = (normalizedDisplay[1] - yMin) / viewportHeight; const canvasX = canvasNormalizedX * width; const canvasY = (1 - canvasNormalizedY) * height; const devicePixelRatio = window.devicePixelRatio || 1; const canvasCoordWithDPR = [canvasX / devicePixelRatio, canvasY / devicePixelRatio]; vtkCamera.setIsPerformingCoordinateTransformation(false); return canvasCoordWithDPR; }; this.hasImageURI = imageURI => { const volumeActors = this.getActors().filter(actorEntry => (0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_29__.actorIsA)(actorEntry, 'vtkVolume')); return volumeActors.some(({ uid, referencedId }) => { const volume = _cache_cache__WEBPACK_IMPORTED_MODULE_6__["default"].getVolume(referencedId || uid); if (!volume?.getImageIdIndex) { return false; } return volume.getImageIdIndex(imageURI) !== undefined || volume.getImageURIIndex(imageURI) !== undefined; }); }; this.getImageIds = volumeId => { const applicableVolumeActorInfo = this._getApplicableVolumeActor(volumeId); if (!applicableVolumeActorInfo) { throw new Error(`No actor found for the given volumeId: ${volumeId}`); } const volumeIdToUse = applicableVolumeActorInfo.volumeId; const imageVolume = _cache_cache__WEBPACK_IMPORTED_MODULE_6__["default"].getVolume(volumeIdToUse); if (!imageVolume) { throw new Error(`imageVolume with id: ${volumeIdToUse} does not exist in cache`); } return imageVolume.imageIds; }; this.renderingPipelineFunctions = { worldToCanvas: { tiled: this.worldToCanvasTiled, contextPool: this.worldToCanvasContextPool }, canvasToWorld: { tiled: this.canvasToWorldTiled, contextPool: this.canvasToWorldContextPool }, getVtkDisplayCoords: { tiled: this.getVtkDisplayCoordsTiled, contextPool: this.getVtkDisplayCoordsContextPool }, getRenderer: { tiled: this.getRendererTiled, contextPool: this.getRendererContextPool } }; this.useCPURendering = (0,_init__WEBPACK_IMPORTED_MODULE_17__.getShouldUseCPURendering)(); if (this.useCPURendering) { throw new Error('VolumeViewports cannot be used whilst CPU Fallback Rendering is enabled.'); } this._configureRenderingPipeline(); const renderer = this.getRenderer(); const camera = _vtkClasses_vtkSlabCamera__WEBPACK_IMPORTED_MODULE_27__["default"].newInstance(); renderer.setActiveCamera(camera); switch (this.type) { case _enums_ViewportType__WEBPACK_IMPORTED_MODULE_15__["default"].ORTHOGRAPHIC: camera.setParallelProjection(true); break; case _enums_ViewportType__WEBPACK_IMPORTED_MODULE_15__["default"].VOLUME_3D: camera.setParallelProjection(true); break; case _enums_ViewportType__WEBPACK_IMPORTED_MODULE_15__["default"].PERSPECTIVE: camera.setParallelProjection(false); break; default: throw new Error(`Unrecognized viewport type: ${this.type}`); } this.initializeVolumeNewImageEventDispatcher(); } static get useCustomRenderingPipeline() { return false; } getSliceViewInfo() { throw new Error('Method not implemented.'); } applyViewOrientation(orientation, resetCamera = true, suppressEvents = false) { const { viewPlaneNormal, viewUp } = this._getOrientationVectors(orientation) || {}; if (!viewPlaneNormal || !viewUp) { return; } const camera = this.getVtkActiveCamera(); camera.setDirectionOfProjection(-viewPlaneNormal[0], -viewPlaneNormal[1], -viewPlaneNormal[2]); camera.setViewUpFrom(viewUp); this.initialViewUp = viewUp; if (resetCamera) { const t = this; t.resetCamera({ resetOrientation: false, resetRotation: false, suppressEvents }); } } initializeVolumeNewImageEventDispatcher() { const volumeNewImageHandlerBound = volumeNewImageHandler.bind(this); const volumeNewImageCleanUpBound = volumeNewImageCleanUp.bind(this); function volumeNewImageHandler(cameraEvent) { const { viewportId } = cameraEvent.detail; if (viewportId !== this.id || this.isDisabled) { return; } const viewportImageData = this.getImageData(); if (!viewportImageData) { return; } (0,_helpers_volumeNewImageEventDispatcher__WEBPACK_IMPORTED_MODULE_25__["default"])(cameraEvent); } function volumeNewImageCleanUp(evt) { const { viewportId } = evt.detail; if (viewportId !== this.id) { return; } this.element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__["default"].CAMERA_MODIFIED, volumeNewImageHandlerBound); _eventTarget__WEBPACK_IMPORTED_MODULE_16__["default"].removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__["default"].ELEMENT_DISABLED, volumeNewImageCleanUpBound); (0,_helpers_volumeNewImageEventDispatcher__WEBPACK_IMPORTED_MODULE_25__.resetVolumeNewImageState)(viewportId); } this.element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__["default"].CAMERA_MODIFIED, volumeNewImageHandlerBound); this.element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__["default"].CAMERA_MODIFIED, volumeNewImageHandlerBound); _eventTarget__WEBPACK_IMPORTED_MODULE_16__["default"].addEventListener(_enums__WEBPACK_IMPORTED_MODULE_10__["default"].ELEMENT_DISABLED, volumeNewImageCleanUpBound); } setVOILUTFunction(voiLUTFunction, volumeId, suppressEvents) { if (!Object.values(_enums__WEBPACK_IMPORTED_MODULE_12__["default"]).includes(voiLUTFunction)) { voiLUTFunction = _enums__WEBPACK_IMPORTED_MODULE_12__["default"].LINEAR; } const { voiRange } = this.getProperties(); this.setVOI(voiRange, volumeId, suppressEvents); this.viewportProperties.VOILUTFunction = voiLUTFunction; } setColormap(colormap, volumeId, suppressEvents) { const applicableVolumeActorInfo = this._getApplicableVolumeActor(volumeId); if (!applicableVolumeActorInfo) { return; } const { volumeActor } = applicableVolumeActorInfo; const cfun = _kitware_vtk_js_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_1__["default"].newInstance(); let colormapObj = _utilities_colormap__WEBPACK_IMPORTED_MODULE_19__.getColormap(colormap.name); const { name } = colormap; if (!colormapObj) { colormapObj = _kitware_vtk_js_Rendering_Core_ColorTransferFunction_ColorMaps__WEBPACK_IMPORTED_MODULE_2__["default"].getPresetByName(name); } if (!colormapObj) { throw new Error(`Colormap ${colormap} not found`); } const range = volumeActor.getProperty().getRGBTransferFunction(0).getRange(); cfun.applyColorMap(colormapObj); cfun.setMappingRange(range[0], range[1]); volumeActor.getProperty().setRGBTransferFunction(0, cfun); this.viewportProperties.colormap = colormap; if (!suppressEvents) { const completeColormap = this.getColormap(volumeId); const eventDetail = { viewportId: this.id, colormap: completeColormap, volumeId }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_18__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_10__["default"].VOI_MODIFIED, eventDetail); (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_18__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_10__["default"].COLORMAP_MODIFIED, eventDetail); } } setOpacity(colormap, volumeId) { const applicableVolumeActorInfo = this._getApplicableVolumeActor(volumeId); if (!applicableVolumeActorInfo) { return; } const { volumeActor } = applicableVolumeActorInfo; const ofun = _kitware_vtk_js_Common_DataModel_PiecewiseFunction__WEBPACK_IMPORTED_MODULE_3__["default"].newInstance(); if (typeof colormap.opacity === 'number') { (0,_utilities_colormap__WEBPACK_IMPORTED_MODULE_19__.updateOpacity)(volumeActor, colormap.opacity); } else { colormap.opacity.forEach(({ opacity, value }) => { ofun.addPoint(value, opacity); }); volumeActor.getProperty().setScalarOpacity(0, ofun); } if (!this.viewportProperties.colormap) { this.viewportProperties.colormap = {}; } this.viewportProperties.colormap.opacity = colormap.opacity; const matchedColormap = this.getColormap(volumeId); const eventDetail = { viewportId: this.id, colormap: matchedColormap, volumeId }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_18__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_10__["default"].COLORMAP_MODIFIED, eventDetail); } setInvert(inverted, volumeId, suppressEvents) { const applicableVolumeActorInfo = this._getApplicableVolumeActor(volumeId); if (!applicableVolumeActorInfo) { return; } const volumeIdToUse = applicableVolumeActorInfo.volumeId; const cfun = this._getOrCreateColorTransferFunction(volumeIdToUse); (0,_utilities_invertRgbTransferFunction__WEBPACK_IMPORTED_MODULE_20__["default"])(cfun); this.viewportProperties.invert = inverted; if (!suppressEvents) { const eventDetail = { ...this.getVOIModifiedEventDetail(volumeIdToUse), invertStateChanged: true }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_18__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_10__["default"].VOI_MODIFIED, eventDetail); } } getVOIModifiedEventDetail(volumeId) { const applicableVolumeActorInfo = this._getApplicableVolumeActor(volumeId); if (!applicableVolumeActorInfo) { throw new Error(`No actor found for the given volumeId: ${volumeId}`); } const volumeActor = applicableVolumeActorInfo.volumeActor; const transferFunction = volumeActor.getProperty().getRGBTransferFunction(0); const range = transferFunction.getMappingRange(); const matchedColormap = this.getColormap(volumeId); const { VOILUTFunction, invert } = this.getProperties(volumeId); return { viewportId: this.id, range: { lower: range[0], upper: range[1] }, volumeId: applicableVolumeActorInfo.volumeId, VOILUTFunction: VOILUTFunction, colormap: matchedColormap, invert }; } _getOrCreateColorTransferFunction(volumeId) { const applicableVolumeActorInfo = this._getApplicableVolumeActor(volumeId); if (!applicableVolumeActorInfo) { return null; } const { volumeActor } = applicableVolumeActorInfo; const rgbTransferFunction = volumeActor.getProperty().getRGBTransferFunction(0); if (rgbTransferFunction) { return rgbTransferFunction; } const newRGBTransferFunction = _kitware_vtk_js_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_1__["default"].newInstance(); volumeActor.getProperty().setRGBTransferFunction(0, newRGBTransferFunction); return newRGBTransferFunction; } setInterpolationType(interpolationType, volumeId) { const applicableVolumeActorInfo = this._getApplicableVolumeActor(volumeId); if (!applicableVolumeActorInfo) { return; } const { volumeActor } = applicableVolumeActorInfo; const volumeProperty = volumeActor.getProperty(); volumeProperty.setInterpolationType(interpolationType); this.viewportProperties.interpolationType = interpolationType; } setVOI(voiRange, volumeId, suppressEvents = false) { const applicableVolumeActorInfo = this._getApplicableVolumeActor(volumeId); if (!applicableVolumeActorInfo) { return; } const { volumeActor } = applicableVolumeActorInfo; const volumeIdToUse = applicableVolumeActorInfo.volumeId; const voiRangeToUse = voiRange; if (typeof voiRangeToUse === 'undefined') { throw new Error('voiRangeToUse is undefined, need to implement this in the new volume model'); } if ([voiRangeToUse.lower, voiRangeToUse.upper].some(_helpers_isInvalidNumber__WEBPACK_IMPORTED_MODULE_38__.isInvalidNumber)) { console.warn('VOI range contains invalid values, ignoring setVOI request', voiRangeToUse); return; } const { VOILUTFunction } = this.getProperties(volumeIdToUse); if (VOILUTFunction === _enums__WEBPACK_IMPORTED_MODULE_12__["default"].SAMPLED_SIGMOID) { const cfun = (0,_utilities_createSigmoidRGBTransferFunction__WEBPACK_IMPORTED_MODULE_21__["default"])(voiRangeToUse); volumeActor.getProperty().setRGBTransferFunction(0, cfun); } else { const { lower, upper } = voiRangeToUse; volumeActor.getProperty().getRGBTransferFunction(0).setRange(lower, upper); } if (!suppressEvents) { const eventDetail = { ...this.getVOIModifiedEventDetail(volumeIdToUse) }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_18__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_10__["default"].VOI_MODIFIED, eventDetail); } this.viewportProperties.voiRange = voiRangeToUse; } rotateCamera(rotation) { const rotationToApply = rotation - this.getRotation(); this.getVtkActiveCamera().roll(-rotationToApply); } setDefaultProperties(ViewportProperties, volumeId) { if (volumeId == null) { this.globalDefaultProperties = ViewportProperties; } else { this.perVolumeIdDefaultProperties.set(volumeId, ViewportProperties); } } clearDefaultProperties(volumeId) { if (volumeId == null) { this.globalDefaultProperties = {}; this.resetProperties(); } else { this.perVolumeIdDefaultProperties.delete(volumeId); this.resetToDefaultProperties(volumeId); } } getViewReference(viewRefSpecifier = {}) { const target = super.getViewReference(viewRefSpecifier); const volumeId = this.getVolumeId(viewRefSpecifier); if (viewRefSpecifier?.forFrameOfReference !== false) { target.volumeId = volumeId; } if (typeof viewRefSpecifier?.sliceIndex !== 'number') { return target; } const { viewPlaneNormal } = target; const delta = viewRefSpecifier?.sliceIndex - this.getSliceIndex(); const { sliceRangeInfo } = (0,_utilities_getVolumeViewportScrollInfo__WEBPACK_IMPORTED_MODULE_28__["default"])(this, volumeId, true); const { sliceRange, spacingInNormalDirection, camera } = sliceRangeInfo; const { focalPoint, position } = camera; const { newFocalPoint } = (0,_utilities_snapFocalPointToSlice__WEBPACK_IMPORTED_MODULE_30__["default"])(focalPoint, position, sliceRange, viewPlaneNormal, spacingInNormalDirection, delta); target.cameraFocalPoint = newFocalPoint; return target; } isReferenceViewable(viewRef, options) { if (!viewRef.FrameOfReferenceUID) { return false; } if (!super.isReferenceViewable(viewRef, options)) { return false; } if (options?.withNavigation) { const { referencedImageId } = viewRef; return !referencedImageId || this.hasImageURI(referencedImageId); } const currentSliceIndex = this.getSliceIndex(); const { sliceIndex } = viewRef; if (Array.isArray(sliceIndex)) { return sliceIndex[0] <= currentSliceIndex && currentSliceIndex <= sliceIndex[1]; } return sliceIndex === undefined || sliceIndex === currentSliceIndex; } scroll(delta = 1) { const volumeId = this.getVolumeId(); const { sliceRangeInfo } = (0,_utilities_getVolumeViewportScrollInfo__WEBPACK_IMPORTED_MODULE_28__["default"])(this, volumeId, true); if (!sliceRangeInfo) { return; } const { sliceRange, spacingInNormalDirection, camera } = sliceRangeInfo; const { focalPoint, viewPlaneNormal, position } = camera; const { newFocalPoint, newPosition } = (0,_utilities_snapFocalPointToSlice__WEBPACK_IMPORTED_MODULE_30__["default"])(focalPoint, position, sliceRange, viewPlaneNormal, spacingInNormalDirection, delta); this.setCamera({ focalPoint: newFocalPoint, position: newPosition }); this.render(); } setBestOrentation(inPlaneVector1, inPlaneVector2) { if (!inPlaneVector1 && !inPlaneVector2) { return; } const { viewPlaneNormal } = this.getCamera(); if (isCompatible(viewPlaneNormal, inPlaneVector2) && isCompatible(viewPlaneNormal, inPlaneVector1)) { return; } const acquisition = this._getAcquisitionPlaneOrientation(); if (isCompatible(acquisition.viewPlaneNormal, inPlaneVector2) && isCompatible(acquisition.viewPlaneNormal, inPlaneVector1)) { this.setOrientation(acquisition); return; } for (const orientation of Object.values(_constants__WEBPACK_IMPORTED_MODULE_8__["default"])) { if (isCompatible(orientation.viewPlaneNormal, inPlaneVector2) && isCompatible(orientation.viewPlaneNormal, inPlaneVector1)) { this.setOrientation(orientation); return; } } const planeNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.cross(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), inPlaneVector2 || acquisition.viewPlaneNormal, inPlaneVector1); gl_matrix__WEBPACK_IMPORTED_MODULE_5__.normalize(planeNormal, planeNormal); this.setOrientation({ viewPlaneNormal: planeNormal }); } setViewPlane(planeRestriction) { const { point, inPlaneVector1, inPlaneVector2, FrameOfReferenceUID } = planeRestriction; this.setBestOrentation(inPlaneVector1, inPlaneVector2); const { focalPoint, viewPlaneNormal } = this.getCamera(); const deltaFocal = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), point, focalPoint); const alongNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.dot(deltaFocal, viewPlaneNormal); const deltaNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.scaleAndAdd(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), focalPoint, viewPlaneNormal, alongNormal); this.setViewReference({ FrameOfReferenceUID, cameraFocalPoint: deltaNormal, viewPlaneNormal: viewPlaneNormal }); } setViewReference(viewRef) { if (!viewRef) { return; } const volumeId = this.getVolumeId(); const { FrameOfReferenceUID: refFrameOfReference, cameraFocalPoint, referencedImageId, planeRestriction, viewPlaneNormal: refViewPlaneNormal, viewUp } = viewRef; let { sliceIndex } = viewRef; if (planeRestriction && !refViewPlaneNormal) { return this.setViewPlane(planeRestriction); } const { focalPoint, viewPlaneNormal, position } = this.getCamera(); const isNegativeNormal = (0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_32__.isEqualNegative)(viewPlaneNormal, refViewPlaneNormal); const isSameNormal = (0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_32__["default"])(viewPlaneNormal, refViewPlaneNormal); if (typeof sliceIndex === 'number' && volumeId !== undefined && viewRef.volumeId === volumeId && (isNegativeNormal || isSameNormal)) { const { currentStepIndex, sliceRangeInfo, numScrollSteps } = (0,_utilities_getVolumeViewportScrollInfo__WEBPACK_IMPORTED_MODULE_28__["default"])(this, volumeId, true); const { sliceRange, spacingInNormalDirection } = sliceRangeInfo; if (isNegativeNormal) { sliceIndex = numScrollSteps - sliceIndex - 1; } const delta = sliceIndex - currentStepIndex; const { newFocalPoint, newPosition } = (0,_utilities_snapFocalPointToSlice__WEBPACK_IMPORTED_MODULE_30__["default"])(focalPoint, position, sliceRange, viewPlaneNormal, spacingInNormalDirection, delta); this.setCamera({ focalPoint: newFocalPoint, position: newPosition }); } else if (refFrameOfReference === this.getFrameOfReferenceUID()) { if (refViewPlaneNormal && !isNegativeNormal && !isSameNormal) { this.setOrientation({ viewPlaneNormal: refViewPlaneNormal, viewUp }, true, true); this.setViewReference(viewRef); return; } if (referencedImageId && this.isInAcquisitionPlane()) { const imagePlaneModule = _metaData__WEBPACK_IMPORTED_MODULE_35__.get(_enums__WEBPACK_IMPORTED_MODULE_14__["default"].IMAGE_PLANE, referencedImageId); const { imagePositionPatient } = imagePlaneModule; const { focalPoint } = this.getCamera(); const diffVector = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), focalPoint, imagePositionPatient); const projectedDistance = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.dot(diffVector, viewPlaneNormal); const newImagePositionPatient = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.scaleAndAdd(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), focalPoint, [-viewPlaneNormal[0], -viewPlaneNormal[1], -viewPlaneNormal[2]], projectedDistance); const focalShift = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), newImagePositionPatient, focalPoint); const newPosition = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.add(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), position, focalShift); this.setCamera({ focalPoint: newImagePositionPatient, position: newPosition }); this.render(); return; } if (cameraFocalPoint) { const focalDelta = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.subtract([0, 0, 0], cameraFocalPoint, focalPoint); const useNormal = refViewPlaneNormal ?? viewPlaneNormal; const normalDot = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.dot(focalDelta, useNormal); if (!(0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_32__["default"])(normalDot, 0)) { gl_matrix__WEBPACK_IMPORTED_MODULE_5__.scale(focalDelta, useNormal, normalDot); } const newFocal = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.add([0, 0, 0], focalPoint, focalDelta); const newPosition = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.add([0, 0, 0], position, focalDelta); this.setCamera({ focalPoint: newFocal, position: newPosition }); } } else { throw new Error(`Incompatible view refs: ${refFrameOfReference}!==${this.getFrameOfReferenceUID()}`); } } setThreshold(colormap, volumeId) { const applicableVolumeActorInfo = this._getApplicableVolumeActor(volumeId); if (!applicableVolumeActorInfo) { return; } const { volumeActor } = applicableVolumeActorInfo; (0,_utilities_colormap__WEBPACK_IMPORTED_MODULE_19__.updateThreshold)(volumeActor, colormap.threshold); if (!this.viewportProperties.colormap) { this.viewportProperties.colormap = {}; } this.viewportProperties.colormap.threshold = colormap.threshold; const matchedColormap = this.getColormap(volumeId); const eventDetail = { viewportId: this.id, colormap: matchedColormap, volumeId }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_18__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_10__["default"].COLORMAP_MODIFIED, eventDetail); } setProperties({ voiRange, VOILUTFunction, invert, colormap, preset, interpolationType, slabThickness, sampleDistanceMultiplier, sharpening, smoothing } = {}, volumeId, suppressEvents = false) { if (this.globalDefaultProperties == null) { this.setDefaultProperties({ voiRange, VOILUTFunction, invert, colormap, preset, slabThickness, sampleDistanceMultiplier }); } if (invert !== undefined && this.viewportProperties.invert !== invert) { this.setInvert(invert, volumeId, suppressEvents); } if (colormap?.name) { this.setColormap(colormap, volumeId, suppressEvents); } if (colormap?.opacity != null) { this.setOpacity(colormap, volumeId); } if (colormap?.threshold != null) { this.setThreshold(colormap, volumeId); } if (voiRange !== undefined) { this.setVOI(voiRange, volumeId, suppressEvents); } if (typeof interpolationType !== 'undefined') { this.setInterpolationType(interpolationType); } if (VOILUTFunction !== undefined) { this.setVOILUTFunction(VOILUTFunction, volumeId, suppressEvents); } if (preset !== undefined) { this.setPreset(preset, volumeId, suppressEvents); } if (slabThickness !== undefined) { this.setSlabThickness(slabThickness); } if (sampleDistanceMultiplier !== undefined) { this.setSampleDistanceMultiplier(sampleDistanceMultiplier); } if (typeof sharpening !== 'undefined') { this.setSharpening(sharpening); } if (typeof smoothing !== 'undefined') { this.setSmoothing(smoothing); } } shouldUseCustomRenderPass() { return !this.useCPURendering; } resetToDefaultProperties(volumeId) { const properties = this.globalDefaultProperties; if (properties.colormap?.name) { this.setColormap(properties.colormap, volumeId); } if (properties.colormap?.opacity != null) { this.setOpacity(properties.colormap, volumeId); } if (properties.voiRange !== undefined) { this.setVOI(properties.voiRange, volumeId); } if (properties.VOILUTFunction !== undefined) { this.setVOILUTFunction(properties.VOILUTFunction, volumeId); } if (properties.invert !== undefined) { this.setInvert(properties.invert, volumeId); } if (properties.slabThickness !== undefined) { this.setSlabThickness(properties.slabThickness); this.viewportProperties.slabThickness = properties.slabThickness; } if (properties.sampleDistanceMultiplier !== undefined) { this.setSampleDistanceMultiplier(properties.sampleDistanceMultiplier); } if (properties.preset !== undefined) { this.setPreset(properties.preset, volumeId, false); } this.render(); } setPreset(presetNameOrObj, volumeId, suppressEvents) { const applicableVolumeActorInfo = this._getApplicableVolumeActor(volumeId); if (!applicableVolumeActorInfo) { return; } const { volumeActor } = applicableVolumeActorInfo; let preset = presetNameOrObj; if (typeof preset === 'string') { preset = _constants__WEBPACK_IMPORTED_MODULE_9__["default"].find(preset => { return preset.name === presetNameOrObj; }); } if (!preset) { return; } (0,_utilities_applyPreset__WEBPACK_IMPORTED_MODULE_33__["default"])(volumeActor, preset); this.viewportProperties.preset = preset; this.render(); if (!suppressEvents) { (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_18__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_10__["default"].PRESET_MODIFIED, { viewportId: this.id, volumeId: applicableVolumeActorInfo.volumeId, actor: volumeActor, presetName: preset.name }); } } setSampleDistanceMultiplier(multiplier) {} setVolumes(_x) { var _this = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (volumeInputArray, immediate = false, suppressEvents = false) { const volumeId = volumeInputArray[0].volumeId; const firstImageVolume = _cache_cache__WEBPACK_IMPORTED_MODULE_6__["default"].getVolume(volumeId); if (!firstImageVolume) { throw new Error(`imageVolume with id: ${volumeId} does not exist, you need to create/allocate the volume first`); } const FrameOfReferenceUID = firstImageVolume.metadata.FrameOfReferenceUID; _this._isValidVolumeInputArray(volumeInputArray, FrameOfReferenceUID); _this._FrameOfReferenceUID = FrameOfReferenceUID; volumeInputArray.forEach(volumeInput => { _this._addVolumeId(volumeInput.volumeId); }); const volumeActors = []; for (let i = 0; i < volumeInputArray.length; i++) { const { volumeId, actorUID, slabThickness, ...rest } = volumeInputArray[i]; const actor = yield (0,_helpers_createVolumeActor__WEBPACK_IMPORTED_MODULE_24__["default"])(volumeInputArray[i], _this.element, _this.id, suppressEvents); const uid = actorUID || (0,_utilities_uuidv4__WEBPACK_IMPORTED_MODULE_34__["default"])(); volumeActors.push({ uid, actor, slabThickness, referencedId: volumeId, ...rest }); } _this._setVolumeActors(volumeActors); _this.viewportStatus = _enums__WEBPACK_IMPORTED_MODULE_13__["default"].PRE_RENDER; _this.initializeColorTransferFunction(volumeInputArray); (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_18__["default"])(_this.element, _enums__WEBPACK_IMPORTED_MODULE_10__["default"].VOLUME_VIEWPORT_NEW_VOLUME, { viewportId: _this.id, volumeActors }); if (immediate) { _this.render(); } }).apply(this, arguments); } addVolumes(_x2) { var _this2 = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (volumeInputArray, immediate = false, suppressEvents = false) { const firstImageVolume = _cache_cache__WEBPACK_IMPORTED_MODULE_6__["default"].getVolume(volumeInputArray[0].volumeId); if (!firstImageVolume) { throw new Error(`imageVolume with id: ${firstImageVolume.volumeId} does not exist`); } const volumeActors = []; _this2._isValidVolumeInputArray(volumeInputArray, _this2._FrameOfReferenceUID); volumeInputArray.forEach(volumeInput => { _this2._addVolumeId(volumeInput.volumeId); }); for (let i = 0; i < volumeInputArray.length; i++) { const { volumeId, visibility, actorUID, slabThickness, ...rest } = volumeInputArray[i]; const actor = yield (0,_helpers_createVolumeActor__WEBPACK_IMPORTED_MODULE_24__["default"])(volumeInputArray[i], _this2.element, _this2.id, suppressEvents); if (!visibility) { actor.setVisibility(false); } const uid = actorUID || (0,_utilities_uuidv4__WEBPACK_IMPORTED_MODULE_34__["default"])(); volumeActors.push({ uid, actor, slabThickness, referencedId: volumeId, ...rest }); } _this2.addActors(volumeActors); _this2.initializeColorTransferFunction(volumeInputArray); if (immediate) { _this2.render(); } }).apply(this, arguments); } removeVolumeActors(actorUIDs, immediate = false) { this.removeActors(actorUIDs); if (immediate) { this.render(); } } setOrientation(_orientation, _immediate = true, _suppressEvents = false) { console.warn('Method "setOrientation" needs implementation'); } initializeColorTransferFunction(volumeInputArray) { const selectedVolumeId = volumeInputArray[0].volumeId; const colorTransferFunction = this._getOrCreateColorTransferFunction(selectedVolumeId); if (!this.initialTransferFunctionNodes && colorTransferFunction) { this.initialTransferFunctionNodes = (0,_utilities_transferFunctionUtils__WEBPACK_IMPORTED_MODULE_23__.getTransferFunctionNodes)(colorTransferFunction); } } _getApplicableVolumeActor(volumeId) { const actorEntries = this.getActors(); if (!actorEntries?.length) { return; } if (volumeId) { const actorEntry = actorEntries.find(actor => actor.referencedId === volumeId); if (!actorEntry) { return; } return { volumeActor: actorEntry.actor, volumeId, actorUID: actorEntry.uid }; } const defaultActorEntry = actorEntries[0]; return { volumeActor: defaultActorEntry.actor, volumeId: defaultActorEntry.referencedId, actorUID: defaultActorEntry.uid }; } _isValidVolumeInputArray(volumeInputArray, FrameOfReferenceUID) { var _this3 = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { const numVolumes = volumeInputArray.length; for (let i = 1; i < numVolumes; i++) { const imageVolume = _cache_cache__WEBPACK_IMPORTED_MODULE_6__["default"].getVolume(volumeInputArray[i].volumeId); if (FrameOfReferenceUID !== imageVolume.metadata.FrameOfReferenceUID) { throw new Error(`Volumes being added to viewport ${_this3.id} do not share the same FrameOfReferenceUID. This is not yet supported`); } } return true; })(); } getBounds() { const renderer = this.getRenderer(); const bounds = renderer.computeVisiblePropBounds(); return bounds; } flip(flipDirection) { super.flip(flipDirection); } hasVolumeId(volumeId) { return this.volumeIds.has(volumeId); } hasVolumeURI(volumeURI) { for (const volumeId of this.volumeIds) { if (volumeId.includes(volumeURI)) { return true; } } return false; } getImageData(volumeId) { const defaultActor = this.getDefaultActor(); if (!defaultActor) { return; } volumeId ||= this.getVolumeId(); const actorEntry = this.getActors()?.find(actor => actor.referencedId === volumeId); if (!actorEntry || !(0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_29__.actorIsA)(actorEntry, 'vtkVolume')) { return; } const actor = actorEntry.actor; const volume = _cache_cache__WEBPACK_IMPORTED_MODULE_6__["default"].getVolume(volumeId); const vtkImageData = actor.getMapper().getInputData(); return { dimensions: vtkImageData.getDimensions(), spacing: vtkImageData.getSpacing(), origin: vtkImageData.getOrigin(), direction: vtkImageData.getDirection(), imageData: actor.getMapper().getInputData(), metadata: { Modality: volume?.metadata?.Modality, FrameOfReferenceUID: volume?.metadata?.FrameOfReferenceUID }, get scalarData() { return volume?.voxelManager?.getScalarData(); }, scaling: volume?.scaling, hasPixelSpacing: true, voxelManager: volume?.voxelManager }; } setCameraClippingRange() { throw new Error('Method not implemented.'); } getSliceIndex() { throw new Error('Method not implemented.'); } setCamera(cameraInterface, storeAsInitialCamera) { super.setCamera(cameraInterface, storeAsInitialCamera); this.setCameraClippingRange(); } _setVolumeActors(volumeActorEntries) { for (let i = 0; i < volumeActorEntries.length; i++) { this.viewportProperties.invert = false; } this.setActors(volumeActorEntries); } getRendererContextPool() { const renderingEngine = this.getRenderingEngine(); return renderingEngine.getRenderer(this.id); } getRendererTiled() { const renderingEngine = this.getRenderingEngine(); if (!renderingEngine || renderingEngine.hasBeenDestroyed) { throw new Error('Rendering engine has been destroyed'); } return renderingEngine.offscreenMultiRenderWindow?.getRenderer(this.id); } _getViewUp(viewPlaneNormal) { const { viewUp } = this.getCamera(); const dot = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.dot(viewUp, viewPlaneNormal); if ((0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_32__["default"])(dot, 0)) { return viewUp; } if ((0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_32__.isEqualAbs)(viewPlaneNormal[0], 1)) { return [0, 0, 1]; } if ((0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_32__.isEqualAbs)(viewPlaneNormal[1], 1)) { return [0, 0, 1]; } if ((0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_32__.isEqualAbs)(viewPlaneNormal[2], 1)) { return [0, -1, 0]; } const vupOrthogonal = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.scaleAndAdd(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), viewUp, viewPlaneNormal, -dot); gl_matrix__WEBPACK_IMPORTED_MODULE_5__.normalize(vupOrthogonal, vupOrthogonal); return vupOrthogonal; } _getOrientationVectors(orientation) { if (typeof orientation === 'object') { if (orientation.viewPlaneNormal) { return { ...orientation, viewUp: orientation.viewUp || this._getViewUp(orientation.viewPlaneNormal) }; } else { throw new Error('Invalid orientation object. It must contain viewPlaneNormal'); } } else if (typeof orientation === 'string') { if (orientation === _enums__WEBPACK_IMPORTED_MODULE_11__["default"].ACQUISITION) { return this._getAcquisitionPlaneOrientation(); } else if (orientation === _enums__WEBPACK_IMPORTED_MODULE_11__["default"].REFORMAT) { return (0,_helpers_getCameraVectors__WEBPACK_IMPORTED_MODULE_36__.getCameraVectors)(this, { useViewportNormal: true }); } else if (orientation === _enums__WEBPACK_IMPORTED_MODULE_11__["default"].AXIAL_REFORMAT || orientation === _enums__WEBPACK_IMPORTED_MODULE_11__["default"].SAGITTAL_REFORMAT || orientation === _enums__WEBPACK_IMPORTED_MODULE_11__["default"].CORONAL_REFORMAT) { let baseOrientation; if (orientation === _enums__WEBPACK_IMPORTED_MODULE_11__["default"].AXIAL_REFORMAT) { baseOrientation = _enums__WEBPACK_IMPORTED_MODULE_11__["default"].AXIAL; } else if (orientation === _enums__WEBPACK_IMPORTED_MODULE_11__["default"].SAGITTAL_REFORMAT) { baseOrientation = _enums__WEBPACK_IMPORTED_MODULE_11__["default"].SAGITTAL; } else { baseOrientation = _enums__WEBPACK_IMPORTED_MODULE_11__["default"].CORONAL; } return (0,_helpers_getCameraVectors__WEBPACK_IMPORTED_MODULE_36__.getCameraVectors)(this, { useViewportNormal: true, orientation: baseOrientation }); } else if (_constants__WEBPACK_IMPORTED_MODULE_8__["default"][orientation]) { this.viewportProperties.orientation = orientation; return _constants__WEBPACK_IMPORTED_MODULE_8__["default"][orientation]; } } throw new Error(`Invalid orientation: ${orientation}. Valid orientations are: ${Object.keys(_constants__WEBPACK_IMPORTED_MODULE_8__["default"]).join(', ')}, ${_enums__WEBPACK_IMPORTED_MODULE_11__["default"].ACQUISITION}, ${_enums__WEBPACK_IMPORTED_MODULE_11__["default"].REFORMAT}, ${_enums__WEBPACK_IMPORTED_MODULE_11__["default"].AXIAL_REFORMAT}, ${_enums__WEBPACK_IMPORTED_MODULE_11__["default"].SAGITTAL_REFORMAT}, ${_enums__WEBPACK_IMPORTED_MODULE_11__["default"].CORONAL_REFORMAT}`); } _getAcquisitionPlaneOrientation() { const actorEntry = this.getDefaultActor(); if (!actorEntry) { return; } const volumeId = this.getVolumeId(); const imageVolume = _cache_cache__WEBPACK_IMPORTED_MODULE_6__["default"].getVolume(volumeId); if (!imageVolume) { throw new Error(`imageVolume with id: ${volumeId} does not exist in cache`); } const { direction } = imageVolume; const viewPlaneNormal = direction.slice(6, 9).map(x => -x); const viewUp = direction.slice(3, 6).map(x => -x); return { viewPlaneNormal, viewUp }; } getSlabThickness() { const actors = this.getActors(); let slabThickness = _constants__WEBPACK_IMPORTED_MODULE_7__["default"].MINIMUM_SLAB_THICKNESS; actors.forEach(actor => { if (actor.slabThickness > slabThickness) { slabThickness = actor.slabThickness; } }); return slabThickness; } getIntensityFromWorld(point) { const actorEntry = this.getDefaultActor(); if (!(0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_29__.actorIsA)(actorEntry, 'vtkVolume')) { return; } const { actor } = actorEntry; const imageData = actor.getMapper().getInputData(); const volume = _cache_cache__WEBPACK_IMPORTED_MODULE_6__["default"].getVolume(this.getVolumeId()); const index = (0,_utilities_transformWorldToIndex__WEBPACK_IMPORTED_MODULE_22__["default"])(imageData, point); return volume.voxelManager.getAtIJKPoint(index); } getVolumeId(specifier) { const actorEntries = this.getActors(); if (!actorEntries) { return; } if (!specifier?.volumeId) { const found = actorEntries.find(actorEntry => actorEntry.actor.getClassName() === 'vtkVolume'); return found?.referencedId || found?.uid; } const found = actorEntries.find(actorEntry => actorEntry.actor.getClassName() === 'vtkVolume' && actorEntry.referencedId === specifier?.volumeId); return found?.referencedId || found?.uid; } getViewReferenceId(specifier = {}) { let { volumeId, sliceIndex: sliceIndex } = specifier; if (!volumeId) { const actorEntries = this.getActors(); if (!actorEntries) { return; } volumeId = actorEntries.find(actorEntry => actorEntry.actor.getClassName() === 'vtkVolume')?.referencedId; if (!volumeId) { return; } } const currentIndex = this.getSliceIndex(); sliceIndex ??= currentIndex; const { viewPlaneNormal, focalPoint } = this.getCamera(); const querySeparator = volumeId.includes('?') ? '&' : '?'; const formattedNormal = viewPlaneNormal.map(v => v.toFixed(3)).join(','); return `volumeId:${volumeId}${querySeparator}sliceIndex=${sliceIndex}&viewPlaneNormal=${formattedNormal}`; } _addVolumeId(volumeId) { this.volumeIds.add(volumeId); } getAllVolumeIds() { return Array.from(this.volumeIds); } _configureRenderingPipeline() { const isContextPool = (0,_helpers_isContextPoolRenderingEngine__WEBPACK_IMPORTED_MODULE_37__.isContextPoolRenderingEngine)(); for (const key in this.renderingPipelineFunctions) { if (Object.prototype.hasOwnProperty.call(this.renderingPipelineFunctions, key)) { const functions = this.renderingPipelineFunctions[key]; this[key] = isContextPool ? functions.contextPool : functions.tiled; } } } } function isCompatible(viewPlaneNormal, vector) { return !vector || (0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_32__["default"])(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.dot(viewPlaneNormal, vector), 0); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BaseVolumeViewport); /***/ }, /***/ 82032 /*!***********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/CanvasActor/CanvasMapper.js ***! \***********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ CanvasMapper) /* harmony export */ }); class CanvasMapper { constructor(actor) { this.actor = actor; } getInputData() { return this.actor.getImage(); } } /***/ }, /***/ 39732 /*!***************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/CanvasActor/CanvasProperties.js ***! \***************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ CanvasProperties) /* harmony export */ }); class CanvasProperties { constructor(actor) { this.opacity = 0.4; this.outlineOpacity = 0.4; this.transferFunction = []; this.actor = actor; } setRGBTransferFunction(index, cfun) { this.transferFunction[index] = cfun; } setScalarOpacity(opacity) {} setInterpolationTypeToNearest() {} setUseLabelOutline() {} setLabelOutlineOpacity(opacity) { this.outlineOpacity = opacity; } setLabelOutlineThickness() {} getColor(index) { const cfun = this.transferFunction[0]; const r = cfun.getRedValue(index); const g = cfun.getGreenValue(index); const b = cfun.getBlueValue(index); return [r, g, b, this.opacity]; } } /***/ }, /***/ 77885 /*!****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/CanvasActor/index.js ***! \****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ CanvasActor) /* harmony export */ }); /* harmony import */ var _CanvasProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CanvasProperties */ 39732); /* harmony import */ var _CanvasMapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CanvasMapper */ 82032); class CanvasActor { constructor(viewport, derivedImage) { this.canvasProperties = new _CanvasProperties__WEBPACK_IMPORTED_MODULE_0__["default"](this); this.visibility = false; this.mapper = new _CanvasMapper__WEBPACK_IMPORTED_MODULE_1__["default"](this); this.className = 'CanvasActor'; this.derivedImage = derivedImage; this.viewport = viewport; } renderRLE(viewport, context, voxelManager) { const { width, height } = this.image; let { canvas } = this; if (!canvas || canvas.width !== width || canvas.height !== height) { this.canvas = canvas = new window.OffscreenCanvas(width, height); } const localContext = canvas.getContext('2d'); const imageData = localContext.createImageData(width, height); const { data: imageArray } = imageData; imageArray.fill(0); const { map } = voxelManager; let dirtyX = Infinity; let dirtyY = Infinity; let dirtyX2 = -Infinity; let dirtyY2 = -Infinity; for (let y = 0; y < height; y++) { const row = map.getRun(y, 0); if (!row) { continue; } dirtyY = Math.min(dirtyY, y); dirtyY2 = Math.max(dirtyY2, y); const baseOffset = y * width << 2; let indicesToDelete; for (const run of row) { const { start, end, value: segmentIndex } = run; if (segmentIndex === 0) { indicesToDelete ||= []; indicesToDelete.push(row.indexOf(run)); continue; } dirtyX = Math.min(dirtyX, start); dirtyX2 = Math.max(dirtyX2, end); const rgb = this.canvasProperties.getColor(segmentIndex).map(v => v * 255); let startOffset = baseOffset + (start << 2); for (let i = start; i < end; i++) { imageArray[startOffset++] = rgb[0]; imageArray[startOffset++] = rgb[1]; imageArray[startOffset++] = rgb[2]; imageArray[startOffset++] = rgb[3]; } } } if (dirtyX > width) { return; } const dirtyWidth = dirtyX2 - dirtyX; const dirtyHeight = dirtyY2 - dirtyY; localContext.putImageData(imageData, 0, 0, dirtyX - 1, dirtyY - 1, dirtyWidth + 2, dirtyHeight + 2); context.drawImage(canvas, dirtyX, dirtyY, dirtyWidth, dirtyHeight, dirtyX, dirtyY, dirtyWidth, dirtyHeight); } setMapper(mapper) { this.mapper = mapper; } render(viewport, context) { if (!this.visibility) { return; } const image = this.image || this.getImage(); const { width, height } = image; const data = image.getScalarData(); if (!data) { return; } const { voxelManager } = image; if (voxelManager) { if (voxelManager.map.getRun) { this.renderRLE(viewport, context, voxelManager); return; } } let { canvas } = this; if (!canvas || canvas.width !== width || canvas.height !== height) { this.canvas = canvas = new window.OffscreenCanvas(width, height); } const localContext = canvas.getContext('2d'); const imageData = localContext.createImageData(width, height); const { data: imageArray } = imageData; let offset = 0; let destOffset = 0; let dirtyX = Infinity; let dirtyY = Infinity; let dirtyX2 = -Infinity; let dirtyY2 = -Infinity; for (let y = 0; y < height; y++) { for (let x = 0; x < width; x++) { const segmentIndex = data[offset++]; if (segmentIndex) { dirtyX = Math.min(x, dirtyX); dirtyY = Math.min(y, dirtyY); dirtyX2 = Math.max(x, dirtyX2); dirtyY2 = Math.max(y, dirtyY2); const rgb = this.canvasProperties.getColor(segmentIndex); imageArray[destOffset] = rgb[0] * 255; imageArray[destOffset + 1] = rgb[1] * 255; imageArray[destOffset + 2] = rgb[2] * 255; imageArray[destOffset + 3] = 127; } destOffset += 4; } } if (dirtyX > width) { return; } const dirtyWidth = dirtyX2 - dirtyX + 1; const dirtyHeight = dirtyY2 - dirtyY + 1; localContext.putImageData(imageData, 0, 0, dirtyX, dirtyY, dirtyWidth, dirtyHeight); context.drawImage(canvas, dirtyX, dirtyY, dirtyWidth, dirtyHeight, dirtyX, dirtyY, dirtyWidth, dirtyHeight); } getClassName() { return this.className; } getProperty() { return this.canvasProperties; } setVisibility(visibility) { this.visibility = visibility; } getMapper() { return this.mapper; } isA(actorType) { return actorType === this.className; } getImage() { if (this.image) { return this.image; } this.image = { ...this.derivedImage }; const imageData = this.viewport.getImageData(); Object.assign(this.image, { worldToIndex: worldPos => imageData.imageData.worldToIndex(worldPos), indexToWorld: (index, destPoint) => imageData.imageData.indexToWorld(index, destPoint), getDimensions: () => imageData.dimensions, getScalarData: () => this.derivedImage?.getPixelData(), getDirection: () => imageData.direction, getSpacing: () => imageData.spacing, setOrigin: () => null, setDerivedImage: image => { this.derivedImage = image; this.image = null; }, modified: () => null }); return this.image; } } /***/ }, /***/ 73386 /*!*************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/ContextPoolRenderingEngine.js ***! \*************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _BaseRenderingEngine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BaseRenderingEngine */ 82838); /* harmony import */ var _WebGLContextPool__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./WebGLContextPool */ 24733); /* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../init */ 15678); /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../enums/Events */ 14566); /* harmony import */ var _eventTarget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../eventTarget */ 28699); /* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utilities/triggerEvent */ 91133); /* harmony import */ var _enums_ViewportType__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../enums/ViewportType */ 43089); /* harmony import */ var _VolumeViewport__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./VolumeViewport */ 93667); /* harmony import */ var _StackViewport__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./StackViewport */ 67461); /* harmony import */ var _VolumeViewport3D__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./VolumeViewport3D */ 50600); /* harmony import */ var _helpers_viewportTypeUsesCustomRenderingPipeline__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./helpers/viewportTypeUsesCustomRenderingPipeline */ 65072); /* harmony import */ var _helpers_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./helpers/getOrCreateCanvas */ 63628); class ContextPoolRenderingEngine extends _BaseRenderingEngine__WEBPACK_IMPORTED_MODULE_0__["default"] { constructor(id) { super(id); this._renderFlaggedViewports = () => { this._throwIfDestroyed(); const viewports = this._getViewportsAsArray(); const viewportsToRender = viewports.filter(vp => this._needsRender.has(vp.id)); if (viewportsToRender.length === 0) { this._animationFrameSet = false; this._animationFrameHandle = null; return; } const eventDetails = viewportsToRender.map(viewport => { const eventDetail = this.renderViewportUsingCustomOrVtkPipeline(viewport); viewport.setRendered(); this._needsRender.delete(viewport.id); return eventDetail; }); this._animationFrameSet = false; this._animationFrameHandle = null; eventDetails.forEach(eventDetail => { if (eventDetail?.element) { (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_5__["default"])(eventDetail.element, _enums_Events__WEBPACK_IMPORTED_MODULE_3__["default"].IMAGE_RENDERED, eventDetail); } }); }; const { rendering } = (0,_init__WEBPACK_IMPORTED_MODULE_2__.getConfiguration)(); const { webGlContextCount } = rendering; if (!this.useCPURendering) { this.contextPool = new _WebGLContextPool__WEBPACK_IMPORTED_MODULE_1__["default"](webGlContextCount); } } enableVTKjsDrivenViewport(viewportInputEntry) { const viewports = this._getViewportsAsArray(); const viewportsDrivenByVtkJs = viewports.filter(vp => (0,_helpers_viewportTypeUsesCustomRenderingPipeline__WEBPACK_IMPORTED_MODULE_10__["default"])(vp.type) === false); const canvasesDrivenByVtkJs = viewportsDrivenByVtkJs.map(vp => vp.canvas); const canvas = (0,_helpers_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_11__["default"])(viewportInputEntry.element); (0,_helpers_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_11__.updateCanvasSizeAndAspectRatio)(canvas); canvasesDrivenByVtkJs.push(canvas); const internalViewportEntry = { ...viewportInputEntry, canvas }; this.addVtkjsDrivenViewport(internalViewportEntry); } addVtkjsDrivenViewport(viewportInputEntry) { const { element, canvas, viewportId, type, defaultOptions } = viewportInputEntry; element.tabIndex = -1; let contextIndex = 0; if (type === _enums_ViewportType__WEBPACK_IMPORTED_MODULE_6__["default"].STACK) { const contexts = this.contextPool.getAllContexts(); contextIndex = this._viewports.size % contexts.length; } this.contextPool.assignViewportToContext(viewportId, contextIndex); this.contextPool.updateViewportSize(viewportId, canvas.width, canvas.height); const contextData = this.contextPool.getContextByIndex(contextIndex); const { context: offscreenMultiRenderWindow, container } = contextData; const maxSize = this.contextPool.getMaxSizeForContext(contextIndex); container.width = maxSize.width; container.height = maxSize.height; offscreenMultiRenderWindow.resize(); offscreenMultiRenderWindow.addRenderer({ viewport: [0, 0, 1, 1], id: viewportId, background: defaultOptions.background ? defaultOptions.background : [0, 0, 0] }); const viewportInput = { id: viewportId, element, renderingEngineId: this.id, type, canvas, sx: 0, sy: 0, sWidth: canvas.width, sHeight: canvas.height, defaultOptions: defaultOptions || {} }; let viewport; if (type === _enums_ViewportType__WEBPACK_IMPORTED_MODULE_6__["default"].STACK) { viewport = new _StackViewport__WEBPACK_IMPORTED_MODULE_8__["default"](viewportInput); } else if (type === _enums_ViewportType__WEBPACK_IMPORTED_MODULE_6__["default"].ORTHOGRAPHIC || type === _enums_ViewportType__WEBPACK_IMPORTED_MODULE_6__["default"].PERSPECTIVE) { viewport = new _VolumeViewport__WEBPACK_IMPORTED_MODULE_7__["default"](viewportInput); } else if (type === _enums_ViewportType__WEBPACK_IMPORTED_MODULE_6__["default"].VOLUME_3D) { viewport = new _VolumeViewport3D__WEBPACK_IMPORTED_MODULE_9__["default"](viewportInput); } else { throw new Error(`Viewport Type ${type} is not supported`); } this._viewports.set(viewportId, viewport); const eventDetail = { element, viewportId, renderingEngineId: this.id }; if (!viewport.suppressEvents) { (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_5__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_4__["default"], _enums_Events__WEBPACK_IMPORTED_MODULE_3__["default"].ELEMENT_ENABLED, eventDetail); } } setVtkjsDrivenViewports(viewportInputEntries) { if (viewportInputEntries.length) { const vtkDrivenCanvases = viewportInputEntries.map(vp => (0,_helpers_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_11__["default"])(vp.element)); vtkDrivenCanvases.forEach(canvas => (0,_helpers_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_11__.updateCanvasSizeAndAspectRatio)(canvas)); for (let i = 0; i < viewportInputEntries.length; i++) { const vtkDrivenViewportInputEntry = viewportInputEntries[i]; const canvas = vtkDrivenCanvases[i]; const internalViewportEntry = { ...vtkDrivenViewportInputEntry, canvas }; this.addVtkjsDrivenViewport(internalViewportEntry); } } } _resizeVTKViewports(vtkDrivenViewports, keepCamera = true, immediate = true) { const devicePixelRatio = window.devicePixelRatio || 1; const viewportsNeedingResize = []; for (const vp of vtkDrivenViewports) { const canvas = (0,_helpers_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_11__["default"])(vp.element); const displayedWidth = Math.round(canvas.clientWidth * devicePixelRatio); const displayedHeight = Math.round(canvas.clientHeight * devicePixelRatio); if (displayedWidth === 0 || displayedHeight === 0) { continue; } const renderedWidth = canvas.width; const renderedHeight = canvas.height; if (displayedWidth === renderedWidth && displayedHeight === renderedHeight) { continue; } viewportsNeedingResize.push(vp); } if (viewportsNeedingResize.length === 0) { return; } if (this._animationFrameSet) { return; } for (const vp of viewportsNeedingResize) { const canvas = (0,_helpers_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_11__["default"])(vp.element); const displayedWidth = Math.round(canvas.clientWidth * devicePixelRatio); const displayedHeight = Math.round(canvas.clientHeight * devicePixelRatio); const targetWidth = Math.max(_BaseRenderingEngine__WEBPACK_IMPORTED_MODULE_0__.VIEWPORT_MIN_SIZE, displayedWidth); const targetHeight = Math.max(_BaseRenderingEngine__WEBPACK_IMPORTED_MODULE_0__.VIEWPORT_MIN_SIZE, displayedHeight); vp.sWidth = targetWidth; vp.sHeight = targetHeight; } if (vtkDrivenViewports.length) { this._resize(vtkDrivenViewports); } vtkDrivenViewports.forEach(vp => { const prevCamera = vp.getCamera(); const rotation = vp.getRotation(); const { flipHorizontal } = prevCamera; vp.resetCameraForResize(); const displayArea = vp.getDisplayArea(); if (keepCamera) { if (displayArea) { if (flipHorizontal) { vp.setCamera({ flipHorizontal }); } if (rotation) { vp.setViewPresentation({ rotation }); } } else { vp.setCamera(prevCamera); } } }); if (immediate) { this.render(); } } renderViewportUsingCustomOrVtkPipeline(viewport) { if ((0,_helpers_viewportTypeUsesCustomRenderingPipeline__WEBPACK_IMPORTED_MODULE_10__["default"])(viewport.type)) { const eventDetail = viewport.customRenderViewportToCanvas(); return eventDetail; } if (this.useCPURendering) { throw new Error('GPU not available, and using a viewport with no custom render pipeline.'); } const assignedContextIndex = this.contextPool.getContextIndexForViewport(viewport.id); const contextData = this.contextPool.getContextByIndex(assignedContextIndex); const { context, container } = contextData; const eventDetail = this._renderViewportWithContext(viewport, context, container); return eventDetail; } _renderViewportWithContext(viewport, offscreenMultiRenderWindow, offScreenCanvasContainer) { if (viewport.canvas.clientWidth === 0 || viewport.canvas.clientHeight === 0) { return; } if (viewport.sWidth < _BaseRenderingEngine__WEBPACK_IMPORTED_MODULE_0__.VIEWPORT_MIN_SIZE || viewport.sHeight < _BaseRenderingEngine__WEBPACK_IMPORTED_MODULE_0__.VIEWPORT_MIN_SIZE) { console.warn('Viewport is too small', viewport.sWidth, viewport.sHeight); return; } if ((0,_helpers_viewportTypeUsesCustomRenderingPipeline__WEBPACK_IMPORTED_MODULE_10__["default"])(viewport.type)) { return viewport.customRenderViewportToCanvas(); } if (this.useCPURendering) { throw new Error('GPU not available, and using a viewport with no custom render pipeline.'); } if (!offscreenMultiRenderWindow.getRenderer(viewport.id)) { offscreenMultiRenderWindow.addRenderer({ viewport: [0, 0, 1, 1], id: viewport.id, background: viewport.defaultOptions?.background || [0, 0, 0] }); } const renderWindow = offscreenMultiRenderWindow.getRenderWindow(); const view = renderWindow.getViews()[0]; const originalRenderPasses = view.getRenderPasses(); const viewportRenderPasses = this.getViewportRenderPasses(viewport.id); if (viewportRenderPasses) { view.setRenderPasses(viewportRenderPasses); } this._resizeOffScreenCanvasForViewport(viewport, offScreenCanvasContainer, offscreenMultiRenderWindow); const renderer = offscreenMultiRenderWindow.getRenderer(viewport.id); const contextIndex = this.contextPool.getContextIndexForViewport(viewport.id); const maxSize = this.contextPool.getMaxSizeForContext(contextIndex); const viewportWidth = viewport.sWidth; const viewportHeight = viewport.sHeight; const xEnd = Math.min(1, viewportWidth / maxSize.width); const yEnd = Math.min(1, viewportHeight / maxSize.height); renderer.setViewport(0, 0, xEnd, yEnd); const allRenderers = offscreenMultiRenderWindow.getRenderers(); allRenderers.forEach(({ renderer: r, id }) => { r.setDraw(id === viewport.id); }); const widgetRenderers = this.getWidgetRenderers(); widgetRenderers.forEach((viewportId, renderer) => { renderer.setDraw(viewportId === viewport.id); }); renderWindow.render(); allRenderers.forEach(({ renderer: r }) => r.setDraw(false)); widgetRenderers.forEach((_, renderer) => { renderer.setDraw(false); }); if (originalRenderPasses) { view.setRenderPasses(originalRenderPasses); } const openGLRenderWindow = offscreenMultiRenderWindow.getOpenGLRenderWindow(); const context = openGLRenderWindow.get3DContext(); const offScreenCanvas = context.canvas; const eventDetail = this._copyToOnscreenCanvas(viewport, offScreenCanvas); return eventDetail; } _renderViewportFromVtkCanvasToOnscreenCanvas(viewport, offScreenCanvas) { return this._copyToOnscreenCanvas(viewport, offScreenCanvas); } _resizeOffScreenCanvasForViewport(viewport, offScreenCanvasContainer, offscreenMultiRenderWindow) { const contextIndex = this.contextPool.getContextIndexForViewport(viewport.id); if (contextIndex === undefined) { return; } const maxSizeChanged = this.contextPool.updateViewportSize(viewport.id, viewport.sWidth, viewport.sHeight); if (!maxSizeChanged) { return; } const maxSize = this.contextPool.getMaxSizeForContext(contextIndex); if (offScreenCanvasContainer.width === maxSize.width && offScreenCanvasContainer.height === maxSize.height) { return; } offScreenCanvasContainer.width = maxSize.width; offScreenCanvasContainer.height = maxSize.height; offscreenMultiRenderWindow.resize(); } _copyToOnscreenCanvas(viewport, offScreenCanvas) { const { element, canvas, id: viewportId, renderingEngineId, suppressEvents } = viewport; const dWidth = viewport.sWidth; const dHeight = viewport.sHeight; (0,_helpers_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_11__.updateCanvasSizeAndAspectRatio)(canvas, { width: dWidth, height: dHeight }); const onScreenContext = canvas.getContext('2d'); const contextIndex = this.contextPool.getContextIndexForViewport(viewportId); const maxSize = this.contextPool.getMaxSizeForContext(contextIndex); const sourceY = maxSize.height - dHeight; onScreenContext.drawImage(offScreenCanvas, 0, sourceY, dWidth, dHeight, 0, 0, dWidth, dHeight); return { element, suppressEvents, viewportId, renderingEngineId, viewportStatus: viewport.viewportStatus }; } _resize(viewportsDrivenByVtkJs) { const contextsToResize = new Set(); for (const viewport of viewportsDrivenByVtkJs) { viewport.sx = 0; viewport.sy = 0; const contextIndex = this.contextPool.getContextIndexForViewport(viewport.id); const maxSizeChanged = this.contextPool.updateViewportSize(viewport.id, viewport.sWidth, viewport.sHeight); if (maxSizeChanged) { contextsToResize.add(contextIndex); } const contextData = this.contextPool.getContextByIndex(contextIndex); const { context: offscreenMultiRenderWindow } = contextData; const renderer = offscreenMultiRenderWindow.getRenderer(viewport.id); const maxSize = this.contextPool.getMaxSizeForContext(contextIndex); const xEnd = Math.min(1, viewport.sWidth / maxSize.width); const yEnd = Math.min(1, viewport.sHeight / maxSize.height); renderer.setViewport(0, 0, xEnd, yEnd); } contextsToResize.forEach(contextIndex => { const contextData = this.contextPool.getContextByIndex(contextIndex); if (contextData) { const { context: offscreenMultiRenderWindow, container } = contextData; const maxSize = this.contextPool.getMaxSizeForContext(contextIndex); container.width = maxSize.width; container.height = maxSize.height; offscreenMultiRenderWindow.resize(); } }); } getWidgetRenderers() { const allViewports = this._getViewportsAsArray(); const widgetRenderers = new Map(); allViewports.forEach(vp => { const widgets = vp.getWidgets ? vp.getWidgets() : []; widgets.forEach(widget => { const renderer = widget.getRenderer ? widget.getRenderer() : null; if (renderer) { widgetRenderers.set(renderer, vp.id); } }); }); return widgetRenderers; } getViewportRenderPasses(viewportId) { const viewport = this.getViewport(viewportId); return viewport?.getRenderPasses ? viewport.getRenderPasses() : null; } getRenderer(viewportId) { const contextIndex = this.contextPool?.getContextIndexForViewport(viewportId); const contextData = this.contextPool.getContextByIndex(contextIndex); const { context: offscreenMultiRenderWindow } = contextData; return offscreenMultiRenderWindow.getRenderer(viewportId); } disableElement(viewportId) { const viewport = this.getViewport(viewportId); if (!viewport) { return; } super.disableElement(viewportId); if (!(0,_helpers_viewportTypeUsesCustomRenderingPipeline__WEBPACK_IMPORTED_MODULE_10__["default"])(viewport.type) && !this.useCPURendering) { const contextIndex = this.contextPool.getContextIndexForViewport(viewportId); if (contextIndex !== undefined) { const contextData = this.contextPool.getContextByIndex(contextIndex); if (contextData) { const { context: offscreenMultiRenderWindow } = contextData; offscreenMultiRenderWindow.removeRenderer(viewportId); } } this.contextPool.removeViewport(viewportId); } } destroy() { if (this.contextPool) { this.contextPool.destroy(); } super.destroy(); } getOffscreenMultiRenderWindow(viewportId) { if (this.useCPURendering) { throw new Error('Offscreen multi render window is not available when using CPU rendering.'); } const contextIndex = this.contextPool.getContextIndexForViewport(viewportId); const contextData = this.contextPool.getContextByIndex(contextIndex); return contextData.context; } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ContextPoolRenderingEngine); /***/ }, /***/ 49180 /*!**********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/ECGViewport.js ***! \**********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums */ 14566); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enums */ 94649); /* harmony import */ var _helpers_cpuFallback_rendering_transform__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./helpers/cpuFallback/rendering/transform */ 98233); /* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utilities/triggerEvent */ 91133); /* harmony import */ var _Viewport__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Viewport */ 38589); /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers */ 63628); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../metaData */ 90161); const SECONDS_WIDTH = 150; const CHANNEL_SPACING = 5; const ECG_AMPLITUDE_INDEX_SIZE = 65536; const COLOR_GRID_MAJOR = '#7f0000'; const COLOR_GRID_MINOR = '#3f0000'; const COLOR_BASELINE = '#7F4C00'; const COLOR_TRACE = '#ffffff'; const COLOR_LABEL = '#ffff00'; const COLOR_BACKGROUND = '#000000'; function computeMinMax(data) { let min = 0; let max = 0; for (let i = 0; i < data.length; i++) { if (data[i] < min) { min = data[i]; } if (data[i] > max) { max = data[i]; } } return { min, max }; } class ECGViewport extends _Viewport__WEBPACK_IMPORTED_MODULE_5__["default"] { constructor(props) { super({ ...props, canvas: props.canvas || (0,_helpers__WEBPACK_IMPORTED_MODULE_6__.getOrCreateCanvas)(props.element) }); this.imageId = null; this.channels = []; this.waveformData = null; this.ecgWidth = 0; this.ecgHeight = 0; this.channelScale = 0; this.ecgCamera = { panWorld: [0, 0], parallelScale: 1 }; this.getProperties = () => { return { visibleChannels: this.channels.map((ch, i) => ch.visible ? i : -1).filter(i => i >= 0) }; }; this.resetCamera = () => { this.refreshRenderValues(); this.canvasContext.fillRect(0, 0, this.canvas.width, this.canvas.height); this.renderFrame(); return true; }; this.getFrameOfReferenceUID = () => { return `ecg-viewport-${this.id}`; }; this.resize = () => { const canvas = this.canvas; const { clientWidth, clientHeight } = canvas; if (canvas.width !== clientWidth || canvas.height !== clientHeight) { canvas.width = clientWidth; canvas.height = clientHeight; } if (this.waveformData) { this.computeChannelScale(); this.recalculateHeight(); } this.refreshRenderValues(); this.renderFrame(); }; this.canvasToWorld = (canvasPos, destPos = [0, 0, 0]) => { if (!this.waveformData) { destPos[0] = 0; destPos[1] = 0; destPos[2] = 0; return destPos; } const scale = this.getWorldToCanvasRatio(); const pan = this.ecgCamera.panWorld; const layouts = this.computeChannelLayouts(); const subCanvasPos = [canvasPos[0] / scale - pan[0], canvasPos[1] / scale - pan[1]]; let z = 0; for (let i = 0; i < layouts.length; i++) { const layout = layouts[i]; if (subCanvasPos[1] <= layout.yOffset) { z = i; break; } if (i === layouts.length - 1) { z = i; } } const x = Math.max(0, Math.min(this.waveformData.numberOfSamples - 1, subCanvasPos[0] * this.waveformData.numberOfSamples / this.ecgWidth)); const layout = layouts[z]; const y = (layout.baseline - subCanvasPos[1]) / this.channelScale; destPos[0] = x; destPos[1] = y; destPos[2] = z; return destPos; }; this.worldToCanvas = worldPos => { if (!this.waveformData) { return [0, 0]; } const scale = this.getWorldToCanvasRatio(); const pan = this.ecgCamera.panWorld; const layouts = this.computeChannelLayouts(); const z = Math.round(worldPos[2]); if (z < 0 || z >= layouts.length) { return [0, 0]; } const layout = layouts[z]; const canvasX = worldPos[0] / this.waveformData.numberOfSamples * this.ecgWidth * scale + pan[0] * scale; const canvasY = (layout.baseline - worldPos[1] * this.channelScale) * scale + pan[1] * scale; return [canvasX, canvasY]; }; this.getRotation = () => 0; this.getNumberOfSlices = () => { return 1; }; this.getCurrentImageIdIndex = () => { return 0; }; this.getCurrentImageId = () => { return this.imageId; }; this.getSliceIndex = () => { return 0; }; this.getImageIds = () => { return this.imageId ? [this.imageId] : []; }; this.scroll = () => {}; this.customRenderViewportToCanvas = () => { this.renderFrame(); }; this.renderFrame = () => { if (!this.waveformData) { return; } const dpr = window.devicePixelRatio || 1; const transform = this.getTransform(); const m = transform.getMatrix(); const ctx = this.canvasContext; ctx.resetTransform(); ctx.fillStyle = COLOR_BACKGROUND; ctx.fillRect(0, 0, this.canvas.width, this.canvas.height); ctx.setTransform(m[0] / dpr, m[1] / dpr, m[2] / dpr, m[3] / dpr, m[4] / dpr, m[5] / dpr); const layouts = this.computeChannelLayouts(); this.drawGrid(ctx); this.drawTraces(ctx, layouts); this.drawLabels(ctx, layouts); ctx.resetTransform(); (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_4__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_1__["default"].IMAGE_RENDERED, { element: this.element, viewportId: this.id, viewport: this, renderingEngineId: this.renderingEngineId }); }; this.getMiddleSliceData = () => { throw new Error('Method not implemented for ECG viewport.'); }; this.canvasContext = this.canvas.getContext('2d'); this.renderingEngineId = props.renderingEngineId; this.element.setAttribute('data-viewport-uid', this.id); this.element.setAttribute('data-rendering-engine-uid', this.renderingEngineId); this.addEventListeners(); this.resize(); } static get useCustomRenderingPipeline() { return true; } addEventListeners() { this.canvas.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_1__["default"].ELEMENT_DISABLED, this.elementDisabledHandler); } removeEventListeners() { this.canvas.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_1__["default"].ELEMENT_DISABLED, this.elementDisabledHandler); } elementDisabledHandler() { this.removeEventListeners(); } setEcg(imageId) { var _this = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { _this.imageId = imageId; const ecgModule = _metaData__WEBPACK_IMPORTED_MODULE_7__.get(_enums__WEBPACK_IMPORTED_MODULE_2__["default"].ECG, imageId); if (!ecgModule?.waveformData?.retrieveBulkData) { throw new Error(`[ECGViewport] No ECG waveform data for imageId: ${imageId}`); } const { numberOfWaveformChannels: numberOfChannels, numberOfWaveformSamples: numberOfSamples, samplingFrequency, waveformBitsAllocated: bitsAllocated = 16, waveformSampleInterpretation: sampleInterpretation = 'SS', multiplexGroupLabel, channelDefinitionSequence: channelDefinitions = [] } = ecgModule; const channelArrays = yield ecgModule.waveformData.retrieveBulkData(); _this.channels = []; for (let i = 0; i < numberOfChannels; i++) { const channelDef = channelDefinitions[i] || {}; const name = channelDef.channelSourceSequence?.codeMeaning || channelDef.ChannelSourceSequence?.CodeMeaning || `Channel ${i + 1}`; const data = channelArrays[i] || new Int16Array(0); const { min, max } = computeMinMax(data); _this.channels.push({ name, data, visible: true, min, max }); } _this.waveformData = { channels: _this.channels, numberOfChannels, numberOfSamples, samplingFrequency, bitsAllocated, sampleInterpretation, multiplexGroupLabel }; _this.calibration = _metaData__WEBPACK_IMPORTED_MODULE_7__.get(_enums__WEBPACK_IMPORTED_MODULE_2__["default"].CALIBRATION, imageId); _this.ecgWidth = Math.ceil(numberOfSamples * SECONDS_WIDTH / samplingFrequency); _this.computeChannelScale(); _this.recalculateHeight(); _this.refreshRenderValues(); _this.renderFrame(); })(); } setChannelVisibility(index, visible) { if (index >= 0 && index < this.channels.length) { this.channels[index].visible = visible; this.computeChannelScale(); this.recalculateHeight(); this.refreshRenderValues(); this.renderFrame(); } } getVisibleChannels() { return this.channels.map(ch => ({ name: ch.name, visible: ch.visible })); } getWaveformData() { return this.waveformData; } getContentDimensions() { return { width: this.ecgWidth, height: this.ecgHeight }; } computeChannelScale() { const visibleChannels = this.channels.filter(c => c.visible && c.data.length > 0); if (visibleChannels.length === 0 || this.ecgWidth === 0) { this.channelScale = 0; return; } let maxRange = 1; for (const channel of visibleChannels) { const range = channel.max - channel.min; maxRange = Math.max(maxRange, range); } const canvasAspect = this.canvas.offsetHeight && this.canvas.offsetWidth ? this.canvas.offsetHeight / this.canvas.offsetWidth : 2 / 3; const targetTotalHeight = this.ecgWidth * canvasAspect; const totalSpacing = CHANNEL_SPACING * visibleChannels.length; const heightPerChannel = (targetTotalHeight - totalSpacing) / visibleChannels.length; this.channelScale = heightPerChannel / (maxRange * 1.25); } recalculateHeight() { const scale = this.channelScale; let totalHeight = 0; for (const channel of this.channels) { if (!channel.visible || channel.data.length === 0) { continue; } const itemHeight = (channel.max - channel.min) * scale * 1.25; totalHeight += itemHeight + CHANNEL_SPACING; } this.ecgHeight = totalHeight; } computeChannelLayouts() { const scale = this.channelScale; const layouts = []; let yOffset = 0; for (const channel of this.channels) { if (!channel.visible || channel.data.length === 0) { continue; } const itemHeight = (channel.max - channel.min) * scale * 1.25; yOffset += itemHeight + CHANNEL_SPACING; const baseline = yOffset + channel.min * scale; layouts.push({ channel, itemHeight, yOffset, baseline }); } return layouts; } setProperties(props) { if (props.visibleChannels !== undefined) { for (let i = 0; i < this.channels.length; i++) { this.channels[i].visible = props.visibleChannels.includes(i); } this.computeChannelScale(); this.recalculateHeight(); this.refreshRenderValues(); this.renderFrame(); } } resetProperties() { for (const channel of this.channels) { channel.visible = true; } this.computeChannelScale(); this.recalculateHeight(); this.refreshRenderValues(); this.renderFrame(); } setCamera(camera) { const { parallelScale, focalPoint } = camera; if (parallelScale) { this.ecgCamera.parallelScale = this.element.clientHeight / 2 / parallelScale; } if (focalPoint !== undefined) { const focalPointCanvas = this.worldToCanvas(focalPoint); const canvasCenter = [this.element.clientWidth / 2, this.element.clientHeight / 2]; const panWorldDelta = [(focalPointCanvas[0] - canvasCenter[0]) / this.ecgCamera.parallelScale, (focalPointCanvas[1] - canvasCenter[1]) / this.ecgCamera.parallelScale]; this.ecgCamera.panWorld = [this.ecgCamera.panWorld[0] - panWorldDelta[0], this.ecgCamera.panWorld[1] - panWorldDelta[1]]; } this.canvasContext.fillStyle = COLOR_BACKGROUND; this.canvasContext.fillRect(0, 0, this.canvas.width, this.canvas.height); this.renderFrame(); } getCamera() { const { parallelScale } = this.ecgCamera; const canvasCenter = [this.element.clientWidth / 2, this.element.clientHeight / 2]; const canvasCenterWorld = this.canvasToWorld(canvasCenter); return { parallelProjection: true, focalPoint: canvasCenterWorld, position: [0, 0, 0], viewUp: [0, -1, 0], parallelScale: this.element.clientHeight / 2 / parallelScale, viewPlaneNormal: [0, 0, 1] }; } getPan() { const panWorld = this.ecgCamera.panWorld; return [panWorld[0], panWorld[1]]; } getViewReferenceId(_specifier) { return `imageId:${this.imageId}`; } hasImageURI(imageURI) { return this.imageId?.includes(imageURI) ?? false; } isReferenceViewable(viewRef) { if (viewRef.FrameOfReferenceUID && viewRef.FrameOfReferenceUID !== this.getFrameOfReferenceUID()) { return false; } return true; } updateCameraClippingPlanesAndRange() {} refreshRenderValues() { if (!this.ecgWidth || !this.ecgHeight) { return; } let worldToCanvasRatio = this.canvas.offsetWidth / this.ecgWidth; if (this.ecgHeight * worldToCanvasRatio > this.canvas.offsetHeight) { worldToCanvasRatio = this.canvas.offsetHeight / this.ecgHeight; } const drawWidth = Math.floor(this.ecgWidth * worldToCanvasRatio); const drawHeight = Math.floor(this.ecgHeight * worldToCanvasRatio); const xOffsetCanvas = (this.canvas.offsetWidth - drawWidth) / 2; const yOffsetCanvas = (this.canvas.offsetHeight - drawHeight) / 2; const xOffsetWorld = xOffsetCanvas / worldToCanvasRatio; const yOffsetWorld = yOffsetCanvas / worldToCanvasRatio; this.ecgCamera.panWorld = [xOffsetWorld, yOffsetWorld]; this.ecgCamera.parallelScale = worldToCanvasRatio; } getWorldToCanvasRatio() { return this.ecgCamera.parallelScale; } getTransform() { const panWorld = this.ecgCamera.panWorld; const dpr = window.devicePixelRatio || 1; const worldToCanvasRatio = this.getWorldToCanvasRatio(); const canvasToWorldRatio = 1.0 / worldToCanvasRatio; const halfCanvas = [this.canvas.offsetWidth / 2, this.canvas.offsetHeight / 2]; const halfCanvasWorldCoordinates = [halfCanvas[0] * canvasToWorldRatio, halfCanvas[1] * canvasToWorldRatio]; const transform = new _helpers_cpuFallback_rendering_transform__WEBPACK_IMPORTED_MODULE_3__.Transform(); transform.scale(dpr, dpr); transform.translate(halfCanvas[0], halfCanvas[1]); transform.scale(worldToCanvasRatio, worldToCanvasRatio); transform.translate(panWorld[0], panWorld[1]); transform.translate(-halfCanvasWorldCoordinates[0], -halfCanvasWorldCoordinates[1]); return transform; } drawGrid(ctx) { const scale = this.channelScale; const pxWidth = this.ecgWidth; const pxHeight = this.ecgHeight; if (scale <= 0) { return; } const MIN_LINE_SPACING = 8; let hGridUnit = 100; while (hGridUnit * scale < MIN_LINE_SPACING) { hGridUnit *= 2; } const minorH = hGridUnit * scale; const majorH = minorH * 5; const minorV = SECONDS_WIDTH / 25; const majorV = SECONDS_WIDTH / 5; ctx.strokeStyle = COLOR_GRID_MINOR; ctx.lineWidth = 0.5; ctx.beginPath(); const hLines = Math.floor(pxHeight / minorH); for (let h = 1; h <= hLines; h++) { if (h % 5 !== 0) { const y = h * minorH; ctx.moveTo(0, y); ctx.lineTo(pxWidth, y); } } const vLines = Math.floor(pxWidth / minorV); for (let v = 1; v <= vLines; v++) { if (v % 5 !== 0) { const x = v * minorV; ctx.moveTo(x, 0); ctx.lineTo(x, pxHeight); } } ctx.stroke(); ctx.strokeStyle = COLOR_GRID_MAJOR; ctx.lineWidth = 1; ctx.beginPath(); const hMajorLines = Math.floor(pxHeight / majorH); for (let h = 1; h <= hMajorLines; h++) { const y = h * majorH; ctx.moveTo(0, y); ctx.lineTo(pxWidth, y); } const vMajorLines = Math.floor(pxWidth / majorV); for (let v = 1; v <= vMajorLines; v++) { const x = v * majorV; ctx.moveTo(x, 0); ctx.lineTo(x, pxHeight); } ctx.stroke(); } drawTraces(ctx, layouts) { const scale = this.channelScale; const pxWidth = this.ecgWidth; for (const { channel, baseline } of layouts) { ctx.strokeStyle = COLOR_BASELINE; ctx.lineWidth = 2; ctx.beginPath(); ctx.moveTo(0, baseline); ctx.lineTo(pxWidth, baseline); ctx.stroke(); ctx.strokeStyle = COLOR_TRACE; ctx.lineWidth = 1; ctx.beginPath(); for (let i = 0; i < channel.data.length; i++) { const x = i * pxWidth / channel.data.length; const y = baseline - channel.data[i] * scale; if (i === 0) { ctx.moveTo(x, y); } else { ctx.lineTo(x, y); } } ctx.stroke(); } } drawLabels(ctx, layouts) { const worldToCanvas = this.getWorldToCanvasRatio(); const fontSize = 14 / worldToCanvas; for (const { channel, itemHeight, yOffset } of layouts) { const labelY = yOffset - itemHeight + fontSize; ctx.font = `${fontSize}px monospace`; const textWidth = ctx.measureText(channel.name).width; ctx.fillStyle = COLOR_BACKGROUND; ctx.fillRect(5, labelY - fontSize, textWidth + 4, fontSize + 4); ctx.fillStyle = COLOR_LABEL; ctx.fillText(channel.name, 5, labelY); } } getImageData() { if (!this.waveformData) { return null; } const nSamples = this.waveformData.numberOfSamples; const nChannels = this.waveformData.numberOfChannels; const dimensions = [nSamples, ECG_AMPLITUDE_INDEX_SIZE, nChannels]; const spacing = [1, 1, 1]; const origin = [0, 0, 0]; const direction = [1, 0, 0, 0, 1, 0, 0, 0, 1]; const amplitudeOffset = ECG_AMPLITUDE_INDEX_SIZE / 2; const imageData = { getDirection: () => direction, getDimensions: () => dimensions, getRange: () => [0, 1], getSpacing: () => spacing, worldToIndex: point => { return [point[0], point[1] + amplitudeOffset, point[2]]; }, indexToWorld: point => { return [point[0], point[1] - amplitudeOffset, point[2]]; } }; return { dimensions, spacing, origin, direction, imageData, hasPixelSpacing: false, calibration: this.calibration, preScale: { scaled: false }, metadata: { Modality: 'ECG' } }; } getSliceViewInfo() { throw new Error('Method not implemented for ECG viewport.'); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ECGViewport); /***/ }, /***/ 23357 /*!**************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/RenderingEngine.js ***! \**************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../init */ 15678); /* harmony import */ var _TiledRenderingEngine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TiledRenderingEngine */ 84405); /* harmony import */ var _ContextPoolRenderingEngine__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ContextPoolRenderingEngine */ 73386); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../enums */ 78015); class RenderingEngine { constructor(id) { const config = (0,_init__WEBPACK_IMPORTED_MODULE_0__.getConfiguration)(); const renderingEngineMode = config?.rendering?.renderingEngineMode; switch (renderingEngineMode) { case _enums__WEBPACK_IMPORTED_MODULE_3__["default"].Tiled: this._implementation = new _TiledRenderingEngine__WEBPACK_IMPORTED_MODULE_1__["default"](id); break; case _enums__WEBPACK_IMPORTED_MODULE_3__["default"].ContextPool: this._implementation = new _ContextPoolRenderingEngine__WEBPACK_IMPORTED_MODULE_2__["default"](id); break; default: console.warn(`RenderingEngine: Unknown rendering engine mode "${renderingEngineMode}". Defaulting to Next rendering engine.`); this._implementation = new _ContextPoolRenderingEngine__WEBPACK_IMPORTED_MODULE_2__["default"](id); break; } } get id() { return this._implementation.id; } enableElement(viewportInputEntry) { return this._implementation.enableElement(viewportInputEntry); } disableElement(viewportId) { return this._implementation.disableElement(viewportId); } setViewports(publicViewportInputEntries) { return this._implementation.setViewports(publicViewportInputEntries); } resize(immediate = true, keepCamera = true) { return this._implementation.resize(immediate, keepCamera); } getViewport(viewportId) { return this._implementation.getViewport(viewportId); } getViewports() { return this._implementation.getViewports(); } getStackViewport(viewportId) { return this._implementation.getStackViewport(viewportId); } getStackViewports() { return this._implementation.getStackViewports(); } getVolumeViewports() { return this._implementation.getVolumeViewports(); } getRenderer(viewportId) { return this._implementation.getRenderer(viewportId); } fillCanvasWithBackgroundColor(canvas, backgroundColor) { return this._implementation.fillCanvasWithBackgroundColor(canvas, backgroundColor); } render() { return this._implementation.render(); } renderViewports(viewportIds) { return this._implementation.renderViewports(viewportIds); } renderViewport(viewportId) { return this._implementation.renderViewport(viewportId); } destroy() { return this._implementation.destroy(); } getOffscreenMultiRenderWindow(viewportId) { return this._implementation.getOffscreenMultiRenderWindow(viewportId); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RenderingEngine); /***/ }, /***/ 67461 /*!************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/StackViewport.js ***! \************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _kitware_vtk_js_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @kitware/vtk.js/Common/Core/DataArray */ 40928); /* harmony import */ var _kitware_vtk_js_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @kitware/vtk.js/Common/DataModel/ImageData */ 56394); /* harmony import */ var _kitware_vtk_js_Rendering_Core_Camera__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/Camera */ 7047); /* harmony import */ var _kitware_vtk_js_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/ColorTransferFunction */ 15722); /* harmony import */ var _kitware_vtk_js_Rendering_Core_ColorTransferFunction_ColorMaps__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps */ 56609); /* harmony import */ var _kitware_vtk_js_Rendering_Core_ImageMapper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/ImageMapper */ 31498); /* harmony import */ var _kitware_vtk_js_Rendering_Core_ImageSlice__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/ImageSlice */ 32745); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! gl-matrix */ 95329); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! gl-matrix */ 93067); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _eventTarget__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../eventTarget */ 28699); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../metaData */ 90161); /* harmony import */ var _utilities_getImageDataMetadata__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../utilities/getImageDataMetadata */ 3589); /* harmony import */ var _utilities_logger__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../utilities/logger */ 67821); /* harmony import */ var _utilities_actorCheck__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../utilities/actorCheck */ 36506); /* harmony import */ var _utilities_colormap__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../utilities/colormap */ 33358); /* harmony import */ var _utilities_transferFunctionUtils__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../utilities/transferFunctionUtils */ 19813); /* harmony import */ var _utilities_windowLevel__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../utilities/windowLevel */ 88871); /* harmony import */ var _utilities_createLinearRGBTransferFunction__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../utilities/createLinearRGBTransferFunction */ 59022); /* harmony import */ var _utilities_createSigmoidRGBTransferFunction__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../utilities/createSigmoidRGBTransferFunction */ 11469); /* harmony import */ var _utilities_updateVTKImageDataWithCornerstoneImage__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../utilities/updateVTKImageDataWithCornerstoneImage */ 99543); /* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../utilities/triggerEvent */ 91133); /* harmony import */ var _utilities_isEqual__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../utilities/isEqual */ 17137); /* harmony import */ var _utilities_invertRgbTransferFunction__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../utilities/invertRgbTransferFunction */ 12265); /* harmony import */ var _utilities_imageRetrieveMetadataProvider__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../utilities/imageRetrieveMetadataProvider */ 49024); /* harmony import */ var _utilities_imageIdToURI__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../utilities/imageIdToURI */ 40232); /* harmony import */ var _Viewport__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./Viewport */ 38589); /* harmony import */ var _helpers_cpuFallback_drawImageSync__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./helpers/cpuFallback/drawImageSync */ 67434); /* harmony import */ var _utilities_buildMetadata__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../utilities/buildMetadata */ 15856); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../enums */ 14566); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../enums */ 9742); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../enums */ 86461); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../enums */ 78700); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../enums */ 15247); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../enums */ 94649); /* harmony import */ var _loaders_imageLoader__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../loaders/imageLoader */ 96035); /* harmony import */ var _requestPool_imageLoadPoolManager__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../requestPool/imageLoadPoolManager */ 11062); /* harmony import */ var _helpers_cpuFallback_rendering_calculateTransform__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./helpers/cpuFallback/rendering/calculateTransform */ 45649); /* harmony import */ var _helpers_cpuFallback_rendering_canvasToPixel__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./helpers/cpuFallback/rendering/canvasToPixel */ 1518); /* harmony import */ var _helpers_cpuFallback_rendering_getDefaultViewport__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./helpers/cpuFallback/rendering/getDefaultViewport */ 20486); /* harmony import */ var _helpers_cpuFallback_rendering_pixelToCanvas__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./helpers/cpuFallback/rendering/pixelToCanvas */ 39632); /* harmony import */ var _helpers_cpuFallback_rendering_resize__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./helpers/cpuFallback/rendering/resize */ 21757); /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ../cache/cache */ 38277); /* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ../init */ 15678); /* harmony import */ var _loaders_ProgressiveRetrieveImages__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ../loaders/ProgressiveRetrieveImages */ 77360); /* harmony import */ var _helpers_cpuFallback_rendering_correctShift__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./helpers/cpuFallback/rendering/correctShift */ 26903); /* harmony import */ var _helpers_cpuFallback_rendering_resetCamera__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./helpers/cpuFallback/rendering/resetCamera */ 14325); /* harmony import */ var _helpers_cpuFallback_rendering_transform__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./helpers/cpuFallback/rendering/transform */ 98233); /* harmony import */ var _utilities_uuidv4__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ../utilities/uuidv4 */ 29760); /* harmony import */ var _utilities_getSpacingInNormalDirection__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ../utilities/getSpacingInNormalDirection */ 7127); /* harmony import */ var _utilities_getClosestImageId__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ../utilities/getClosestImageId */ 61200); /* harmony import */ var _utilities_adjustInitialViewUp__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ../utilities/adjustInitialViewUp */ 91720); /* harmony import */ var _helpers_isContextPoolRenderingEngine__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./helpers/isContextPoolRenderingEngine */ 16080); /* harmony import */ var _renderPasses__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./renderPasses */ 50765); /* harmony import */ var _renderPasses__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./renderPasses */ 38386); const log = _utilities_logger__WEBPACK_IMPORTED_MODULE_14__.coreLog.getLogger('RenderingEngine', 'StackViewport'); class StackViewport extends _Viewport__WEBPACK_IMPORTED_MODULE_27__["default"] { constructor(props) { super(props); this.imageIds = []; this.imageKeyToIndexMap = new Map(); this.currentImageIdIndex = 0; this.targetImageIdIndex = 0; this.imagesLoader = this; this.globalDefaultProperties = {}; this.perImageIdDefaultProperties = new Map(); this.voiUpdatedWithSetProperties = false; this.sharpening = 0; this.smoothing = 0; this.invert = false; this.initialInvert = false; this.initialTransferFunctionNodes = null; this.stackInvalidated = false; this._publishCalibratedEvent = false; this.updateRenderingPipeline = () => { this._configureRenderingPipeline(); }; this.setSharpening = sharpening => { this.sharpening = sharpening; this.render(); }; this.setSmoothing = smoothing => { this.smoothing = smoothing; this.render(); }; this.getRenderPasses = () => { if (!this.shouldUseCustomRenderPass()) { return null; } const renderPasses = []; try { if (this.smoothing > 0) { renderPasses.push((0,_renderPasses__WEBPACK_IMPORTED_MODULE_55__.createSmoothingRenderPass)(this.smoothing)); } if (this.sharpening > 0) { renderPasses.push((0,_renderPasses__WEBPACK_IMPORTED_MODULE_54__.createSharpeningRenderPass)(this.sharpening)); } return renderPasses.length ? renderPasses : null; } catch (e) { console.warn('Failed to create custom render passes:', e); return null; } }; this.resize = () => { if (this.useCPURendering) { this._resizeCPU(); } }; this._resizeCPU = () => { if (this._cpuFallbackEnabledElement.viewport) { (0,_helpers_cpuFallback_rendering_resize__WEBPACK_IMPORTED_MODULE_42__["default"])(this._cpuFallbackEnabledElement); } }; this.getFrameOfReferenceUID = sliceIndex => this.getImagePlaneReferenceData(sliceIndex)?.FrameOfReferenceUID; this.getCornerstoneImage = () => this.csImage; this.createActorMapper = imageData => { const mapper = _kitware_vtk_js_Rendering_Core_ImageMapper__WEBPACK_IMPORTED_MODULE_6__["default"].newInstance(); mapper.setInputData(imageData); const actor = _kitware_vtk_js_Rendering_Core_ImageSlice__WEBPACK_IMPORTED_MODULE_7__["default"].newInstance(); actor.setMapper(mapper); if (imageData.getPointData().getScalars().getNumberOfComponents() > 1) { actor.getProperty().setIndependentComponents(false); } return actor; }; this.getNumberOfSlices = () => { return this.imageIds.length; }; this.getDefaultProperties = imageId => { let imageProperties; if (imageId !== undefined) { imageProperties = this.perImageIdDefaultProperties.get(imageId); } if (imageProperties !== undefined) { return imageProperties; } return { ...this.globalDefaultProperties }; }; this.getProperties = () => { const { colormap, voiRange, VOILUTFunction, interpolationType, invert, voiUpdatedWithSetProperties } = this; return { colormap, voiRange, VOILUTFunction, interpolationType, invert, isComputedVOI: !voiUpdatedWithSetProperties, sharpening: this.sharpening, smoothing: this.smoothing }; }; this.resetCameraForResize = () => { return this.resetCamera({ resetPan: true, resetZoom: true, resetToCenter: true, suppressEvents: true }); }; this.getRotationCPU = () => { const { viewport } = this._cpuFallbackEnabledElement; return viewport.rotation; }; this.getRotationGPU = () => { const { viewUp: currentViewUp, viewPlaneNormal, flipVertical, flipHorizontal } = this.getCameraNoRotation(); const adjustedViewUp = (0,_utilities_adjustInitialViewUp__WEBPACK_IMPORTED_MODULE_52__.adjustInitialViewUp)(this.initialViewUp, flipHorizontal, flipVertical, viewPlaneNormal); const angleRad = gl_matrix__WEBPACK_IMPORTED_MODULE_10__.angle(adjustedViewUp, currentViewUp); const initialToCurrentViewUpAngle = angleRad * 180 / Math.PI; const initialToCurrentViewUpCross = gl_matrix__WEBPACK_IMPORTED_MODULE_10__.cross(gl_matrix__WEBPACK_IMPORTED_MODULE_10__.create(), adjustedViewUp, currentViewUp); const normalDot = gl_matrix__WEBPACK_IMPORTED_MODULE_10__.dot(initialToCurrentViewUpCross, viewPlaneNormal); return normalDot >= 0 ? initialToCurrentViewUpAngle : (360 - initialToCurrentViewUpAngle) % 360; }; this.setRotation = rotation => { const previousCamera = this.getCamera(); if (this.useCPURendering) { this.setRotationCPU(rotation); } else { this.setRotationGPU(rotation); } if (this._suppressCameraModifiedEvents) { return; } const camera = this.getCamera(); const eventDetail = { previousCamera, camera, element: this.element, viewportId: this.id, renderingEngineId: this.renderingEngineId }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_22__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_30__["default"].CAMERA_MODIFIED, eventDetail); }; this.renderImageObject = image => { this._setCSImage(image); const renderFn = this.useCPURendering ? this._updateToDisplayImageCPU : this._updateActorToDisplayImageId; renderFn.call(this, image); }; this._setCSImage = image => { image.isPreScaled = image.preScale?.scaled; this.csImage = image; }; this.canvasToWorldCPU = (canvasPos, worldPos = [0, 0, 0]) => { if (!this._cpuFallbackEnabledElement.image) { return; } const [px, py] = (0,_helpers_cpuFallback_rendering_canvasToPixel__WEBPACK_IMPORTED_MODULE_39__["default"])(this._cpuFallbackEnabledElement, canvasPos); const { origin, spacing, direction } = this.getImageData(); const iVector = direction.slice(0, 3); const jVector = direction.slice(3, 6); gl_matrix__WEBPACK_IMPORTED_MODULE_10__.scaleAndAdd(worldPos, origin, iVector, px * spacing[0]); gl_matrix__WEBPACK_IMPORTED_MODULE_10__.scaleAndAdd(worldPos, worldPos, jVector, py * spacing[1]); return worldPos; }; this.worldToCanvasCPU = worldPos => { const { spacing, direction, origin } = this.getImageData(); const iVector = direction.slice(0, 3); const jVector = direction.slice(3, 6); const diff = gl_matrix__WEBPACK_IMPORTED_MODULE_10__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_10__.create(), worldPos, origin); const indexPoint = [gl_matrix__WEBPACK_IMPORTED_MODULE_10__.dot(diff, iVector) / spacing[0], gl_matrix__WEBPACK_IMPORTED_MODULE_10__.dot(diff, jVector) / spacing[1]]; const canvasPoint = (0,_helpers_cpuFallback_rendering_pixelToCanvas__WEBPACK_IMPORTED_MODULE_41__["default"])(this._cpuFallbackEnabledElement, indexPoint); return canvasPoint; }; this.canvasToWorldGPUContextPool = canvasPos => { const renderer = this.getRenderer(); const vtkCamera = this.getVtkActiveCamera(); const crange = vtkCamera.getClippingRange(); const distance = vtkCamera.getDistance(); vtkCamera.setClippingRange(distance, distance + 0.1); const devicePixelRatio = window.devicePixelRatio || 1; const { width, height } = this.canvas; const aspectRatio = width / height; const canvasPosWithDPR = [canvasPos[0] * devicePixelRatio, canvasPos[1] * devicePixelRatio]; const viewport = renderer.getViewport(); const [xStart, yStart, xEnd, yEnd] = viewport; const viewportWidth = xEnd - xStart; const viewportHeight = yEnd - yStart; const normalizedDisplay = [xStart + canvasPosWithDPR[0] / width * viewportWidth, yStart + (1 - canvasPosWithDPR[1] / height) * viewportHeight, 0]; const projCoords = renderer.normalizedDisplayToProjection(normalizedDisplay[0], normalizedDisplay[1], normalizedDisplay[2]); const viewCoords = renderer.projectionToView(projCoords[0], projCoords[1], projCoords[2], aspectRatio); const worldCoord = renderer.viewToWorld(viewCoords[0], viewCoords[1], viewCoords[2]); vtkCamera.setClippingRange(crange[0], crange[1]); return [worldCoord[0], worldCoord[1], worldCoord[2]]; }; this.canvasToWorldGPUTiled = canvasPos => { const renderer = this.getRenderer(); const vtkCamera = this.getVtkActiveCamera(); const crange = vtkCamera.getClippingRange(); const distance = vtkCamera.getDistance(); vtkCamera.setClippingRange(distance, distance + 0.1); const offscreenMultiRenderWindow = this.getRenderingEngine().offscreenMultiRenderWindow; const openGLRenderWindow = offscreenMultiRenderWindow.getOpenGLRenderWindow(); const size = openGLRenderWindow.getSize(); const devicePixelRatio = window.devicePixelRatio || 1; const canvasPosWithDPR = [canvasPos[0] * devicePixelRatio, canvasPos[1] * devicePixelRatio]; const displayCoord = [canvasPosWithDPR[0] + this.sx, canvasPosWithDPR[1] + this.sy]; displayCoord[1] = size[1] - displayCoord[1]; const worldCoord = openGLRenderWindow.displayToWorld(displayCoord[0], displayCoord[1], 0, renderer); vtkCamera.setClippingRange(crange[0], crange[1]); return [worldCoord[0], worldCoord[1], worldCoord[2]]; }; this.worldToCanvasGPUContextPool = worldPos => { const renderer = this.getRenderer(); const vtkCamera = this.getVtkActiveCamera(); const crange = vtkCamera.getClippingRange(); const distance = vtkCamera.getDistance(); vtkCamera.setClippingRange(distance, distance + 0.1); const devicePixelRatio = window.devicePixelRatio || 1; const { width, height } = this.canvas; const aspectRatio = width / height; const viewCoords = renderer.worldToView(worldPos[0], worldPos[1], worldPos[2]); const projCoords = renderer.viewToProjection(viewCoords[0], viewCoords[1], viewCoords[2], aspectRatio); const normalizedDisplay = renderer.projectionToNormalizedDisplay(projCoords[0], projCoords[1], projCoords[2]); const viewport = renderer.getViewport(); const [xStart, yStart, xEnd, yEnd] = viewport; const viewportWidth = xEnd - xStart; const viewportHeight = yEnd - yStart; const canvasX = (normalizedDisplay[0] - xStart) / viewportWidth * width; const canvasY = (1 - (normalizedDisplay[1] - yStart) / viewportHeight) * height; vtkCamera.setClippingRange(crange[0], crange[1]); const canvasCoordWithDPR = [canvasX / devicePixelRatio, canvasY / devicePixelRatio]; return canvasCoordWithDPR; }; this.worldToCanvasGPUTiled = worldPos => { const renderer = this.getRenderer(); const vtkCamera = this.getVtkActiveCamera(); const crange = vtkCamera.getClippingRange(); const distance = vtkCamera.getDistance(); vtkCamera.setClippingRange(distance, distance + 0.1); const offscreenMultiRenderWindow = this.getRenderingEngine().offscreenMultiRenderWindow; const openGLRenderWindow = offscreenMultiRenderWindow.getOpenGLRenderWindow(); const size = openGLRenderWindow.getSize(); const displayCoord = openGLRenderWindow.worldToDisplay(...worldPos, renderer); displayCoord[1] = size[1] - displayCoord[1]; const canvasCoord = [displayCoord[0] - this.sx, displayCoord[1] - this.sy]; vtkCamera.setClippingRange(crange[0], crange[1]); const devicePixelRatio = window.devicePixelRatio || 1; const canvasCoordWithDPR = [canvasCoord[0] / devicePixelRatio, canvasCoord[1] / devicePixelRatio]; return canvasCoordWithDPR; }; this.getCurrentImageIdIndex = () => { return this.currentImageIdIndex; }; this.getSliceIndex = () => { return this.currentImageIdIndex; }; this.getTargetImageIdIndex = () => { return this.targetImageIdIndex; }; this.getImageIds = () => { return this.imageIds; }; this.getCurrentImageId = (index = this.getCurrentImageIdIndex()) => { return this.imageIds[index]; }; this.hasImageId = imageId => { return this.imageKeyToIndexMap.has(imageId); }; this.hasImageURI = imageURI => { return this.imageKeyToIndexMap.has(imageURI); }; this.customRenderViewportToCanvas = () => { if (!this.useCPURendering) { throw new Error('Custom cpu rendering pipeline should only be hit in CPU rendering mode'); } if (this._cpuFallbackEnabledElement.image) { (0,_helpers_cpuFallback_drawImageSync__WEBPACK_IMPORTED_MODULE_28__["default"])(this._cpuFallbackEnabledElement, this.cpuRenderingInvalidated); this.cpuRenderingInvalidated = false; } else { this.fillWithBackgroundColor(); } return { canvas: this.canvas, element: this.element, viewportId: this.id, renderingEngineId: this.renderingEngineId, viewportStatus: this.viewportStatus }; }; this.renderingPipelineFunctions = { getImageData: { cpu: this.getImageDataCPU, gpu: this.getImageDataGPU }, setColormap: { cpu: this.setColormapCPU, gpu: this.setColormapGPU }, getCamera: { cpu: this.getCameraCPU, gpu: super.getCamera }, setCamera: { cpu: this.setCameraCPU, gpu: super.setCamera }, getPan: { cpu: this.getPanCPU, gpu: super.getPan }, setPan: { cpu: this.setPanCPU, gpu: super.setPan }, getZoom: { cpu: this.getZoomCPU, gpu: super.getZoom }, setZoom: { cpu: this.setZoomCPU, gpu: super.setZoom }, setVOI: { cpu: this.setVOICPU, gpu: this.setVOIGPU }, getRotation: { cpu: this.getRotationCPU, gpu: this.getRotationGPU }, setInterpolationType: { cpu: this.setInterpolationTypeCPU, gpu: this.setInterpolationTypeGPU }, setInvertColor: { cpu: this.setInvertColorCPU, gpu: this.setInvertColorGPU }, resetCamera: { cpu: (options = {}) => { const { resetPan = true, resetZoom = true } = options; this.resetCameraCPU({ resetPan, resetZoom }); return true; }, gpu: (options = {}) => { const { resetPan = true, resetZoom = true } = options; this.resetCameraGPU({ resetPan, resetZoom }); return true; } }, canvasToWorld: { cpu: this.canvasToWorldCPU, gpu: { tiled: this.canvasToWorldGPUTiled, contextPool: this.canvasToWorldGPUContextPool } }, worldToCanvas: { cpu: this.worldToCanvasCPU, gpu: { tiled: this.worldToCanvasGPUTiled, contextPool: this.worldToCanvasGPUContextPool } }, getRenderer: { cpu: () => this.getCPUFallbackError('getRenderer'), gpu: { tiled: this.getRendererTiled, contextPool: this.getRendererContextPool } }, getDefaultActor: { cpu: () => this.getCPUFallbackError('getDefaultActor'), gpu: super.getDefaultActor }, getActors: { cpu: () => this.getCPUFallbackError('getActors'), gpu: super.getActors }, getActor: { cpu: () => this.getCPUFallbackError('getActor'), gpu: super.getActor }, setActors: { cpu: () => this.getCPUFallbackError('setActors'), gpu: super.setActors }, addActors: { cpu: () => this.getCPUFallbackError('addActors'), gpu: super.addActors }, addActor: { cpu: () => this.getCPUFallbackError('addActor'), gpu: super.addActor }, removeAllActors: { cpu: () => this.getCPUFallbackError('removeAllActors'), gpu: super.removeAllActors }, unsetColormap: { cpu: this.unsetColormapCPU, gpu: this.unsetColormapGPU } }; this.scaling = {}; this.modality = null; this.useCPURendering = (0,_init__WEBPACK_IMPORTED_MODULE_44__.getShouldUseCPURendering)(); this._configureRenderingPipeline(); const result = this.useCPURendering ? this._resetCPUFallbackElement() : this._resetGPUViewport(); this.currentImageIdIndex = 0; this.targetImageIdIndex = 0; this.resetCamera(); this.initializeElementDisabledHandler(); } setUseCPURendering(value) { this.useCPURendering = value; this._configureRenderingPipeline(value); } static get useCustomRenderingPipeline() { return (0,_init__WEBPACK_IMPORTED_MODULE_44__.getShouldUseCPURendering)(); } _configureRenderingPipeline(value) { const isContextPool = (0,_helpers_isContextPoolRenderingEngine__WEBPACK_IMPORTED_MODULE_53__.isContextPoolRenderingEngine)(); this.useCPURendering = value ?? (0,_init__WEBPACK_IMPORTED_MODULE_44__.getShouldUseCPURendering)(); for (const key in this.renderingPipelineFunctions) { if (Object.prototype.hasOwnProperty.call(this.renderingPipelineFunctions, key)) { const functions = this.renderingPipelineFunctions[key]; if (this.useCPURendering) { this[key] = functions.cpu; } else { if (typeof functions.gpu === 'object' && functions.gpu.tiled && functions.gpu.contextPool) { this[key] = isContextPool ? functions.gpu.contextPool : functions.gpu.tiled; } else { this[key] = functions.gpu; } } } } const result = this.useCPURendering ? this._resetCPUFallbackElement() : this._resetGPUViewport(); } _resetCPUFallbackElement() { this._cpuFallbackEnabledElement = { canvas: this.canvas, renderingTools: {}, transform: new _helpers_cpuFallback_rendering_transform__WEBPACK_IMPORTED_MODULE_48__.Transform(), viewport: { rotation: 0 } }; } _resetGPUViewport() { const renderer = this.getRenderer(); const camera = _kitware_vtk_js_Rendering_Core_Camera__WEBPACK_IMPORTED_MODULE_3__["default"].newInstance(); renderer.setActiveCamera(camera); const viewPlaneNormal = [0, 0, -1]; this.initialViewUp = [0, -1, 0]; camera.setDirectionOfProjection(-viewPlaneNormal[0], -viewPlaneNormal[1], -viewPlaneNormal[2]); camera.setViewUp(...this.initialViewUp); camera.setParallelProjection(true); camera.setThicknessFromFocalPoint(0.1); camera.setFreezeFocalPoint(true); } shouldUseCustomRenderPass() { return !this.useCPURendering; } initializeElementDisabledHandler() { _eventTarget__WEBPACK_IMPORTED_MODULE_11__["default"].addEventListener(_enums__WEBPACK_IMPORTED_MODULE_30__["default"].ELEMENT_DISABLED, function elementDisabledHandler() { clearTimeout(this.debouncedTimeout); _eventTarget__WEBPACK_IMPORTED_MODULE_11__["default"].removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_30__["default"].ELEMENT_DISABLED, elementDisabledHandler); }); } getImageDataGPU() { const defaultActor = this.getDefaultActor(); if (!defaultActor) { return; } if (!(0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_15__.isImageActor)(defaultActor)) { return; } const { actor } = defaultActor; const vtkImageData = actor.getMapper().getInputData(); const csImage = this.csImage; return { dimensions: vtkImageData.getDimensions(), spacing: vtkImageData.getSpacing(), origin: vtkImageData.getOrigin(), direction: vtkImageData.getDirection(), get scalarData() { return csImage?.voxelManager.getScalarData(); }, imageData: actor.getMapper().getInputData(), metadata: { Modality: this.modality, FrameOfReferenceUID: this.getFrameOfReferenceUID() }, scaling: this.scaling, hasPixelSpacing: this.hasPixelSpacing, calibration: { ...csImage?.calibration, ...this.calibration }, preScale: { ...csImage?.preScale }, voxelManager: csImage?.voxelManager }; } getImageDataCPU() { const { metadata } = this._cpuFallbackEnabledElement; if (!metadata) { return; } const spacing = metadata.spacing; const csImage = this.csImage; return { dimensions: metadata.dimensions, spacing, origin: metadata.origin, direction: metadata.direction, metadata: { Modality: this.modality, FrameOfReferenceUID: this.getFrameOfReferenceUID() }, scaling: this.scaling, imageData: { getDirection: () => metadata.direction, getDimensions: () => metadata.dimensions, getScalarData: () => this.cpuImagePixelData, getSpacing: () => spacing, worldToIndex: point => { const canvasPoint = this.worldToCanvasCPU(point); const pixelCoord = (0,_helpers_cpuFallback_rendering_canvasToPixel__WEBPACK_IMPORTED_MODULE_39__["default"])(this._cpuFallbackEnabledElement, canvasPoint); return [pixelCoord[0], pixelCoord[1], 0]; }, indexToWorld: (point, destPoint) => { const canvasPoint = (0,_helpers_cpuFallback_rendering_pixelToCanvas__WEBPACK_IMPORTED_MODULE_41__["default"])(this._cpuFallbackEnabledElement, [point[0], point[1]]); return this.canvasToWorldCPU(canvasPoint, destPoint); } }, scalarData: this.cpuImagePixelData, hasPixelSpacing: this.hasPixelSpacing, calibration: { ...csImage?.calibration, ...this.calibration }, preScale: { ...csImage?.preScale }, voxelManager: csImage?.voxelManager }; } calibrateIfNecessary(imageId, imagePlaneModule) { const calibration = _metaData__WEBPACK_IMPORTED_MODULE_12__.get('calibratedPixelSpacing', imageId); const isUpdated = this.calibration !== calibration; const scale = calibration?.scale; this.hasPixelSpacing = scale > 0 || !imagePlaneModule.usingDefaultValues && imagePlaneModule.rowPixelSpacing > 0; imagePlaneModule.calibration = calibration; if (!isUpdated) { return imagePlaneModule; } this.calibration = calibration; this._publishCalibratedEvent = true; this._calibrationEvent = { scale, calibration }; return imagePlaneModule; } setDefaultProperties(ViewportProperties, imageId) { if (imageId == null) { this.globalDefaultProperties = ViewportProperties; } else { this.perImageIdDefaultProperties.set(imageId, ViewportProperties); if (this.getCurrentImageId() === imageId) { this.setProperties(ViewportProperties); } } } clearDefaultProperties(imageId) { if (imageId == null) { this.globalDefaultProperties = {}; this.resetProperties(); } else { this.perImageIdDefaultProperties.delete(imageId); this.resetToDefaultProperties(); } } setProperties({ colormap, voiRange, VOILUTFunction, invert, interpolationType, sharpening, smoothing } = {}, suppressEvents = false) { this.viewportStatus = this.csImage ? _enums__WEBPACK_IMPORTED_MODULE_34__["default"].PRE_RENDER : _enums__WEBPACK_IMPORTED_MODULE_34__["default"].LOADING; this.globalDefaultProperties = { colormap: this.globalDefaultProperties.colormap ?? colormap, voiRange: this.globalDefaultProperties.voiRange ?? voiRange, VOILUTFunction: this.globalDefaultProperties.VOILUTFunction ?? VOILUTFunction, invert: this.globalDefaultProperties.invert ?? invert, interpolationType: this.globalDefaultProperties.interpolationType ?? interpolationType, sharpening: this.globalDefaultProperties.sharpening ?? sharpening, smoothing: this.globalDefaultProperties.smoothing ?? smoothing }; if (typeof colormap !== 'undefined') { this.setColormap(colormap); } if (typeof voiRange !== 'undefined') { const voiUpdatedWithSetProperties = true; this.setVOI(voiRange, { suppressEvents, voiUpdatedWithSetProperties }); } if (typeof VOILUTFunction !== 'undefined') { this.setVOILUTFunction(VOILUTFunction, suppressEvents); } if (typeof invert !== 'undefined') { this.setInvertColor(invert); } if (typeof interpolationType !== 'undefined') { this.setInterpolationType(interpolationType); } if (typeof sharpening !== 'undefined') { this.setSharpening(sharpening); } if (typeof smoothing !== 'undefined') { this.setSmoothing(smoothing); } } resetProperties() { this.cpuRenderingInvalidated = true; this.voiUpdatedWithSetProperties = false; this.viewportStatus = _enums__WEBPACK_IMPORTED_MODULE_34__["default"].PRE_RENDER; this.fillWithBackgroundColor(); if (this.useCPURendering) { this._cpuFallbackEnabledElement.renderingTools = {}; } this._resetProperties(); this.render(); } _resetProperties() { let voiRange; if (this._isCurrentImagePTPrescaled()) { voiRange = this._getDefaultPTPrescaledVOIRange(); } else { voiRange = this._getVOIRangeForCurrentImage(); } this.setVOI(voiRange); this.setInvertColor(this.initialInvert); this.setInterpolationType(_enums__WEBPACK_IMPORTED_MODULE_32__["default"].LINEAR); if (!this.useCPURendering) { const transferFunction = this.getTransferFunction(); (0,_utilities_transferFunctionUtils__WEBPACK_IMPORTED_MODULE_17__.setTransferFunctionNodes)(transferFunction, this.initialTransferFunctionNodes); const nodes = (0,_utilities_transferFunctionUtils__WEBPACK_IMPORTED_MODULE_17__.getTransferFunctionNodes)(transferFunction); const RGBPoints = nodes.reduce((acc, node) => { acc.push(node[0], node[1], node[2], node[3]); return acc; }, []); const defaultActor = this.getDefaultActor(); const matchedColormap = _utilities_colormap__WEBPACK_IMPORTED_MODULE_16__.findMatchingColormap(RGBPoints, defaultActor.actor); this.setColormap(matchedColormap); } } resetToDefaultProperties() { this.cpuRenderingInvalidated = true; this.viewportStatus = _enums__WEBPACK_IMPORTED_MODULE_34__["default"].PRE_RENDER; this.fillWithBackgroundColor(); if (this.useCPURendering) { this._cpuFallbackEnabledElement.renderingTools = {}; } const currentImageId = this.getCurrentImageId(); const properties = this.perImageIdDefaultProperties.get(currentImageId) || this.globalDefaultProperties; if (properties.colormap?.name) { this.setColormap(properties.colormap); } let voiRange; if (properties.voiRange == undefined) { voiRange = this._getVOIRangeForCurrentImage(); } else { voiRange = properties.voiRange; } this.setVOI(voiRange); this.setInterpolationType(_enums__WEBPACK_IMPORTED_MODULE_32__["default"].LINEAR); this.setInvertColor(false); this.render(); } _getVOIFromCache() { let voiRange; if (this.voiUpdatedWithSetProperties) { voiRange = this.voiRange; } else if (this._isCurrentImagePTPrescaled()) { voiRange = this._getDefaultPTPrescaledVOIRange(); } else { voiRange = this._getVOIRangeForCurrentImage() ?? this.voiRange; } return voiRange; } _setPropertiesFromCache() { const voiRange = this._getVOIFromCache(); const { interpolationType, invert } = this; this.setVOI(voiRange); this.setInterpolationType(interpolationType); this.setInvertColor(invert); } getCameraCPU() { const { metadata, viewport } = this._cpuFallbackEnabledElement; if (!metadata) { return {}; } const { direction } = metadata; const viewPlaneNormal = direction.slice(6, 9).map(x => -x); let viewUp = direction.slice(3, 6).map(x => -x); if (viewport.rotation) { const rotationMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_8__.fromRotation(gl_matrix__WEBPACK_IMPORTED_MODULE_8__.create(), viewport.rotation * Math.PI / 180, viewPlaneNormal); viewUp = gl_matrix__WEBPACK_IMPORTED_MODULE_10__.transformMat4(gl_matrix__WEBPACK_IMPORTED_MODULE_10__.create(), viewUp, rotationMatrix); } const canvasCenter = [this.element.clientWidth / 2, this.element.clientHeight / 2]; const canvasCenterWorld = this.canvasToWorld(canvasCenter); const topLeftWorld = this.canvasToWorld([0, 0]); const bottomLeftWorld = this.canvasToWorld([0, this.element.clientHeight]); const parallelScale = gl_matrix__WEBPACK_IMPORTED_MODULE_10__.distance(topLeftWorld, bottomLeftWorld) / 2; return { parallelProjection: true, focalPoint: canvasCenterWorld, position: [0, 0, 0], parallelScale, scale: viewport.scale, viewPlaneNormal: [viewPlaneNormal[0], viewPlaneNormal[1], viewPlaneNormal[2]], viewUp: [viewUp[0], viewUp[1], viewUp[2]], flipHorizontal: this.flipHorizontal, flipVertical: this.flipVertical }; } setCameraCPU(cameraInterface) { const { viewport, image } = this._cpuFallbackEnabledElement; const previousCamera = this.getCameraCPU(); const { focalPoint, parallelScale, scale, flipHorizontal, flipVertical } = cameraInterface; const { clientHeight } = this.element; if (focalPoint) { const focalPointCanvas = this.worldToCanvasCPU(focalPoint); const focalPointPixel = (0,_helpers_cpuFallback_rendering_canvasToPixel__WEBPACK_IMPORTED_MODULE_39__["default"])(this._cpuFallbackEnabledElement, focalPointCanvas); const prevFocalPointCanvas = this.worldToCanvasCPU(previousCamera.focalPoint); const prevFocalPointPixel = (0,_helpers_cpuFallback_rendering_canvasToPixel__WEBPACK_IMPORTED_MODULE_39__["default"])(this._cpuFallbackEnabledElement, prevFocalPointCanvas); const deltaPixel = gl_matrix__WEBPACK_IMPORTED_MODULE_9__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_9__.subtract(deltaPixel, gl_matrix__WEBPACK_IMPORTED_MODULE_9__.fromValues(focalPointPixel[0], focalPointPixel[1]), gl_matrix__WEBPACK_IMPORTED_MODULE_9__.fromValues(prevFocalPointPixel[0], prevFocalPointPixel[1])); const shift = (0,_helpers_cpuFallback_rendering_correctShift__WEBPACK_IMPORTED_MODULE_46__["default"])({ x: deltaPixel[0], y: deltaPixel[1] }, viewport); viewport.translation.x -= shift.x; viewport.translation.y -= shift.y; } if (parallelScale) { const { rowPixelSpacing } = image; const scale = clientHeight * rowPixelSpacing * 0.5 / parallelScale; viewport.scale = scale; viewport.parallelScale = parallelScale; } if (scale) { const { rowPixelSpacing } = image; viewport.scale = scale; viewport.parallelScale = clientHeight * rowPixelSpacing * 0.5 / scale; } if (flipHorizontal !== undefined || flipVertical !== undefined) { this.setFlipCPU({ flipHorizontal, flipVertical }); } this._cpuFallbackEnabledElement.transform = (0,_helpers_cpuFallback_rendering_calculateTransform__WEBPACK_IMPORTED_MODULE_38__["default"])(this._cpuFallbackEnabledElement); const eventDetail = { previousCamera, camera: this.getCamera(), element: this.element, viewportId: this.id, renderingEngineId: this.renderingEngineId }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_22__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_30__["default"].CAMERA_MODIFIED, eventDetail); } getPanCPU() { const { viewport } = this._cpuFallbackEnabledElement; return [viewport.translation?.x ?? 0, viewport.translation?.y ?? 0]; } setPanCPU(pan) { const camera = this.getCameraCPU(); this.setCameraCPU({ ...camera, focalPoint: [...pan.map(p => -p), 0] }); } getZoomCPU() { const { viewport } = this._cpuFallbackEnabledElement; return viewport.scale; } setZoomCPU(zoom) { const camera = this.getCameraCPU(); this.setCameraCPU({ ...camera, scale: zoom }); } setFlipCPU({ flipHorizontal, flipVertical }) { const { viewport } = this._cpuFallbackEnabledElement; if (flipHorizontal !== undefined) { viewport.hflip = flipHorizontal; this.flipHorizontal = viewport.hflip; } if (flipVertical !== undefined) { viewport.vflip = flipVertical; this.flipVertical = viewport.vflip; } } setVOILUTFunction(voiLUTFunction, suppressEvents) { if (this.useCPURendering) { throw new Error('VOI LUT function is not supported in CPU rendering'); } const newVOILUTFunction = this._getValidVOILUTFunction(voiLUTFunction); let forceRecreateLUTFunction = false; if (this.VOILUTFunction !== newVOILUTFunction) { forceRecreateLUTFunction = true; } this.VOILUTFunction = newVOILUTFunction; const { voiRange } = this.getProperties(); this.setVOI(voiRange, { suppressEvents, forceRecreateLUTFunction }); } setRotationCPU(rotation) { const { viewport } = this._cpuFallbackEnabledElement; viewport.rotation = rotation; } setRotationGPU(rotation) { const panFit = this.getPan(this.fitToCanvasCamera); const pan = this.getPan(); const panSub = gl_matrix__WEBPACK_IMPORTED_MODULE_9__.sub([0, 0], panFit, pan); this.setPan(panSub, false); const { flipVertical, flipHorizontal, viewPlaneNormal } = this.getCamera(); const adjustedViewUp = (0,_utilities_adjustInitialViewUp__WEBPACK_IMPORTED_MODULE_52__.adjustInitialViewUp)(this.initialViewUp, flipHorizontal, flipVertical, viewPlaneNormal); this.setCameraNoEvent({ viewUp: adjustedViewUp }); this.getVtkActiveCamera().roll(-rotation); const afterPan = this.getPan(); const afterPanFit = this.getPan(this.fitToCanvasCamera); const newCenter = gl_matrix__WEBPACK_IMPORTED_MODULE_9__.sub([0, 0], afterPan, afterPanFit); const newOffset = gl_matrix__WEBPACK_IMPORTED_MODULE_9__.add([0, 0], panFit, newCenter); this.setPan(newOffset, false); } setInterpolationTypeGPU(interpolationType) { const defaultActor = this.getDefaultActor(); if (!defaultActor) { return; } if (!(0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_15__.isImageActor)(defaultActor)) { return; } const { actor } = defaultActor; const volumeProperty = actor.getProperty(); volumeProperty.setInterpolationType(interpolationType); this.interpolationType = interpolationType; } setInterpolationTypeCPU(interpolationType) { const { viewport } = this._cpuFallbackEnabledElement; viewport.pixelReplication = interpolationType === _enums__WEBPACK_IMPORTED_MODULE_32__["default"].LINEAR ? false : true; this.interpolationType = interpolationType; } setInvertColorCPU(invert) { const { viewport } = this._cpuFallbackEnabledElement; if (!viewport) { return; } viewport.invert = invert; this.invert = invert; } setInvertColorGPU(invert) { const defaultActor = this.getDefaultActor(); if (!defaultActor) { return; } if (!(0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_15__.isImageActor)(defaultActor)) { return; } if ((0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_15__.actorIsA)(defaultActor, 'vtkVolume')) { const volumeActor = defaultActor.actor; const tfunc = volumeActor.getProperty().getRGBTransferFunction(0); if (!this.invert && invert || this.invert && !invert) { (0,_utilities_invertRgbTransferFunction__WEBPACK_IMPORTED_MODULE_24__["default"])(tfunc); } this.invert = invert; } else if ((0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_15__.actorIsA)(defaultActor, 'vtkImageSlice')) { const imageSliceActor = defaultActor.actor; const tfunc = imageSliceActor.getProperty().getRGBTransferFunction(0); if (!this.invert && invert || this.invert && !invert) { (0,_utilities_invertRgbTransferFunction__WEBPACK_IMPORTED_MODULE_24__["default"])(tfunc); } this.invert = invert; } } setVOICPU(voiRange, options = {}) { const { suppressEvents = false } = options; const { viewport, image } = this._cpuFallbackEnabledElement; if (!viewport || !image) { return; } if (typeof voiRange === 'undefined') { const { windowWidth: ww, windowCenter: wc } = image; const wwToUse = Array.isArray(ww) ? ww[0] : ww; const wcToUse = Array.isArray(wc) ? wc[0] : wc; viewport.voi = { windowWidth: wwToUse, windowCenter: wcToUse, voiLUTFunction: image.voiLUTFunction }; const { lower, upper } = _utilities_windowLevel__WEBPACK_IMPORTED_MODULE_18__.toLowHighRange(wwToUse, wcToUse, image.voiLUTFunction); voiRange = { lower, upper }; } else { const { lower, upper } = voiRange; const { windowCenter, windowWidth } = _utilities_windowLevel__WEBPACK_IMPORTED_MODULE_18__.toWindowLevel(lower, upper); if (!viewport.voi) { viewport.voi = { windowWidth: 0, windowCenter: 0, voiLUTFunction: image.voiLUTFunction }; } viewport.voi.windowWidth = windowWidth; viewport.voi.windowCenter = windowCenter; } this.voiRange = voiRange; const eventDetail = { viewportId: this.id, range: voiRange }; if (!suppressEvents) { (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_22__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_30__["default"].VOI_MODIFIED, eventDetail); } } getTransferFunction() { const defaultActor = this.getDefaultActor(); if (!defaultActor) { return; } if (!(0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_15__.isImageActor)(defaultActor)) { return; } const imageActor = defaultActor.actor; return imageActor.getProperty().getRGBTransferFunction(0); } setVOIGPU(voiRange, options = {}) { const { suppressEvents = false, forceRecreateLUTFunction = false, voiUpdatedWithSetProperties = false } = options; if (voiRange && this.voiRange && this.voiRange.lower === voiRange.lower && this.voiRange.upper === voiRange.upper && !forceRecreateLUTFunction && !this.stackInvalidated) { return; } const defaultActor = this.getDefaultActor(); if (!defaultActor) { return; } if (!(0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_15__.isImageActor)(defaultActor)) { return; } const imageActor = defaultActor.actor; let voiRangeToUse = voiRange; if (typeof voiRangeToUse === 'undefined') { const imageData = imageActor.getMapper().getInputData(); const range = imageData.getPointData().getScalars().getRange(); const maxVoiRange = { lower: range[0], upper: range[1] }; voiRangeToUse = maxVoiRange; } imageActor.getProperty().setUseLookupTableScalarRange(true); let transferFunction = imageActor.getProperty().getRGBTransferFunction(0); const isSigmoidTFun = this.VOILUTFunction === _enums__WEBPACK_IMPORTED_MODULE_33__["default"].SAMPLED_SIGMOID; if (isSigmoidTFun || !transferFunction || forceRecreateLUTFunction) { const transferFunctionCreator = isSigmoidTFun ? _utilities_createSigmoidRGBTransferFunction__WEBPACK_IMPORTED_MODULE_20__["default"] : _utilities_createLinearRGBTransferFunction__WEBPACK_IMPORTED_MODULE_19__["default"]; transferFunction = transferFunctionCreator(voiRangeToUse); if (this.invert) { (0,_utilities_invertRgbTransferFunction__WEBPACK_IMPORTED_MODULE_24__["default"])(transferFunction); } imageActor.getProperty().setRGBTransferFunction(0, transferFunction); this.initialTransferFunctionNodes = (0,_utilities_transferFunctionUtils__WEBPACK_IMPORTED_MODULE_17__.getTransferFunctionNodes)(transferFunction); } if (!isSigmoidTFun) { transferFunction.setRange(voiRangeToUse.lower, voiRangeToUse.upper); } this.voiRange = voiRangeToUse; if (!this.voiUpdatedWithSetProperties) { this.voiUpdatedWithSetProperties = voiUpdatedWithSetProperties; } if (suppressEvents) { return; } const eventDetail = { viewportId: this.id, range: voiRangeToUse, VOILUTFunction: this.VOILUTFunction }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_22__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_30__["default"].VOI_MODIFIED, eventDetail); } _addScalingToViewport(imageIdScalingFactor) { if (this.scaling.PT) { return; } const { suvbw, suvlbm, suvbsa } = imageIdScalingFactor; const ptScaling = {}; if (suvlbm) { ptScaling.suvbwToSuvlbm = suvlbm / suvbw; } if (suvbsa) { ptScaling.suvbwToSuvbsa = suvbsa / suvbw; } this.scaling.PT = ptScaling; } getImageDataMetadata(image) { const imageId = image.imageId; const props = (0,_utilities_getImageDataMetadata__WEBPACK_IMPORTED_MODULE_13__.getImageDataMetadata)(image); const { numberOfComponents, origin, direction, dimensions, spacing, numVoxels, imagePixelModule, voiLUTFunction, modality, scalingFactor, calibration } = props; if (modality === 'PT' && scalingFactor) { this._addScalingToViewport(scalingFactor); } this.modality = modality; const voiLUTFunctionEnum = this._getValidVOILUTFunction(voiLUTFunction); this.VOILUTFunction = voiLUTFunctionEnum; this.calibration = calibration; let imagePlaneModule = this._getImagePlaneModule(imageId); if (!this.useCPURendering) { imagePlaneModule = this.calibrateIfNecessary(imageId, imagePlaneModule); } return { bitsAllocated: imagePixelModule.bitsAllocated, numberOfComponents, origin, direction, dimensions, spacing, numVoxels, imagePlaneModule, imagePixelModule }; } matchImagesForOverlay(currentImageId, targetOverlayImageId) { const matchImagesForOverlay = targetImageId => { const overlayImagePlaneModule = _metaData__WEBPACK_IMPORTED_MODULE_12__.get(_enums__WEBPACK_IMPORTED_MODULE_35__["default"].IMAGE_PLANE, targetOverlayImageId); const currentImagePlaneModule = _metaData__WEBPACK_IMPORTED_MODULE_12__.get(_enums__WEBPACK_IMPORTED_MODULE_35__["default"].IMAGE_PLANE, targetImageId); const overlayOrientation = overlayImagePlaneModule.imageOrientationPatient; const currentOrientation = currentImagePlaneModule.imageOrientationPatient; if (overlayOrientation && currentOrientation) { const closeEnough = (0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_23__.isEqual)(overlayImagePlaneModule.imageOrientationPatient, currentImagePlaneModule.imageOrientationPatient); if (closeEnough) { const referencePosition = overlayImagePlaneModule.imagePositionPatient; const currentPosition = currentImagePlaneModule.imagePositionPatient; if (referencePosition && currentPosition) { const closeEnough = (0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_23__.isEqual)(referencePosition, currentPosition); if (closeEnough) { const referenceRows = overlayImagePlaneModule.rows; const referenceColumns = overlayImagePlaneModule.columns; const currentRows = currentImagePlaneModule.rows; const currentColumns = currentImagePlaneModule.columns; if (referenceRows === currentRows && referenceColumns === currentColumns) { return targetImageId; } } } } } else { const referenceRows = overlayImagePlaneModule.rows; const referenceColumns = overlayImagePlaneModule.columns; const currentRows = currentImagePlaneModule.rows; const currentColumns = currentImagePlaneModule.columns; if (referenceRows === currentRows && referenceColumns === currentColumns) { return targetImageId; } } }; return matchImagesForOverlay(currentImageId); } getImagePlaneReferenceData(sliceIndex = this.getCurrentImageIdIndex()) { const imageId = this.imageIds[sliceIndex]; if (!imageId) { return; } const imagePlaneModule = _metaData__WEBPACK_IMPORTED_MODULE_12__.get(_enums__WEBPACK_IMPORTED_MODULE_35__["default"].IMAGE_PLANE, imageId); if (!imagePlaneModule) { return; } const { imagePositionPatient, frameOfReferenceUID: FrameOfReferenceUID } = imagePlaneModule; let { rowCosines, columnCosines } = imagePlaneModule; rowCosines ||= [1, 0, 0]; columnCosines ||= [0, 1, 0]; const viewPlaneNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_10__.cross([0, 0, 0], columnCosines, rowCosines); return { FrameOfReferenceUID, viewPlaneNormal, cameraFocalPoint: imagePositionPatient, referencedImageId: imageId, sliceIndex }; } _getCameraOrientation(imageDataDirection) { const viewPlaneNormal = imageDataDirection.slice(6, 9).map(x => -x); const viewUp = imageDataDirection.slice(3, 6).map(x => -x); return { viewPlaneNormal: [viewPlaneNormal[0], viewPlaneNormal[1], viewPlaneNormal[2]], viewUp: [viewUp[0], viewUp[1], viewUp[2]] }; } createVTKImageData({ origin, direction, dimensions, spacing, numberOfComponents, pixelArray }) { const values = new pixelArray.constructor(pixelArray.length); const scalarArray = _kitware_vtk_js_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__["default"].newInstance({ name: 'Pixels', numberOfComponents: numberOfComponents, values: values }); const imageData = _kitware_vtk_js_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_2__["default"].newInstance(); imageData.setDimensions(dimensions); imageData.setSpacing(spacing); imageData.setDirection(direction); imageData.setOrigin(origin); imageData.getPointData().setScalars(scalarArray); return imageData; } _createVTKImageData({ origin, direction, dimensions, spacing, numberOfComponents, pixelArray }) { try { this._imageData = this.createVTKImageData({ origin, direction, dimensions, spacing, numberOfComponents, pixelArray }); } catch (e) { log.error(e); } } setStack(_x) { var _this = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (imageIds, currentImageIdIndex = 0) { _this._throwIfDestroyed(); _this.imageIds = imageIds; if (currentImageIdIndex > imageIds.length) { throw new Error('Current image index is greater than the number of images in the stack'); } _this.imageKeyToIndexMap.clear(); imageIds.forEach((imageId, index) => { _this.imageKeyToIndexMap.set(imageId, index); _this.imageKeyToIndexMap.set((0,_utilities_imageIdToURI__WEBPACK_IMPORTED_MODULE_26__["default"])(imageId), index); }); _this.currentImageIdIndex = currentImageIdIndex; _this.targetImageIdIndex = currentImageIdIndex; const imageRetrieveConfiguration = _metaData__WEBPACK_IMPORTED_MODULE_12__.get(_utilities_imageRetrieveMetadataProvider__WEBPACK_IMPORTED_MODULE_25__["default"].IMAGE_RETRIEVE_CONFIGURATION, imageIds[currentImageIdIndex], 'stack'); _this.imagesLoader = imageRetrieveConfiguration ? (imageRetrieveConfiguration.create || _loaders_ProgressiveRetrieveImages__WEBPACK_IMPORTED_MODULE_45__.createProgressive)(imageRetrieveConfiguration) : _this; _this.stackInvalidated = true; _this.flipVertical = false; _this.flipHorizontal = false; _this.voiRange = null; _this.interpolationType = _enums__WEBPACK_IMPORTED_MODULE_32__["default"].LINEAR; _this.invert = false; _this.viewportStatus = _enums__WEBPACK_IMPORTED_MODULE_34__["default"].LOADING; _this.fillWithBackgroundColor(); if (_this.useCPURendering) { _this._cpuFallbackEnabledElement.renderingTools = {}; delete _this._cpuFallbackEnabledElement.viewport.colormap; } const imageId = yield _this._setImageIdIndex(currentImageIdIndex); const eventDetail = { imageIds, viewportId: _this.id, element: _this.element, currentImageIdIndex: currentImageIdIndex }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_22__["default"])(_this.element, _enums__WEBPACK_IMPORTED_MODULE_30__["default"].VIEWPORT_NEW_IMAGE_SET, eventDetail); return imageId; }).apply(this, arguments); } _throwIfDestroyed() { if (this.isDisabled) { throw new Error('The stack viewport has been destroyed and is no longer usable. Renderings will not be performed. If you ' + 'are using the same viewportId and have re-enabled the viewport, you need to grab the new viewport instance ' + 'using renderingEngine.getViewport(viewportId), instead of using your lexical scoped reference to the viewport instance.'); } } _checkVTKImageDataMatchesCornerstoneImage(image, imageData) { if (!imageData) { return false; } const [xSpacing, ySpacing] = imageData.getSpacing(); const [xVoxels, yVoxels] = imageData.getDimensions(); const imagePlaneModule = this._getImagePlaneModule(image.imageId); const direction = imageData.getDirection(); const rowCosines = direction.slice(0, 3); const columnCosines = direction.slice(3, 6); const dataType = imageData.getPointData().getScalars().getDataType(); const isSameXSpacing = (0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_23__.isEqual)(xSpacing, image.columnPixelSpacing); const isSameYSpacing = (0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_23__.isEqual)(ySpacing, image.rowPixelSpacing); const isXSpacingValid = isSameXSpacing || image.columnPixelSpacing === null && xSpacing === 1.0; const isYSpacingValid = isSameYSpacing || image.rowPixelSpacing === null && ySpacing === 1.0; const isXVoxelsMatching = xVoxels === image.columns; const isYVoxelsMatching = yVoxels === image.rows; const isRowCosinesMatching = (0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_23__.isEqual)(imagePlaneModule.rowCosines, rowCosines); const isColumnCosinesMatching = (0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_23__.isEqual)(imagePlaneModule.columnCosines, columnCosines); const isDataTypeMatching = dataType === image.voxelManager.getScalarData().constructor.name; const result = isXSpacingValid && isYSpacingValid && isXVoxelsMatching && isYVoxelsMatching && isRowCosinesMatching && isColumnCosinesMatching && isDataTypeMatching; return result; } _updateVTKImageDataFromCornerstoneImage(image) { const imagePlaneModule = this._getImagePlaneModule(image.imageId); let origin = imagePlaneModule.imagePositionPatient; if (origin == null) { origin = [0, 0, 0]; } this._imageData.setOrigin(origin); const actor = this.getActor(this.id); if (actor) { actor.referencedId = image.imageId; } (0,_utilities_updateVTKImageDataWithCornerstoneImage__WEBPACK_IMPORTED_MODULE_21__.updateVTKImageDataWithCornerstoneImage)(this._imageData, image); } _loadAndDisplayImage(imageId, imageIdIndex) { return this.useCPURendering ? this._loadAndDisplayImageCPU(imageId, imageIdIndex) : this._loadAndDisplayImageGPU(imageId, imageIdIndex); } _loadAndDisplayImageCPU(imageId, imageIdIndex) { return new Promise((resolve, reject) => { function successCallback(image, imageIdIndex, imageId) { if (this.currentImageIdIndex !== imageIdIndex) { return; } const pixelData = image.voxelManager.getScalarData(); const preScale = image.preScale; const scalingParams = preScale?.scalingParameters; const scaledWithNonIntegers = preScale?.scaled && scalingParams?.rescaleIntercept % 1 !== 0 || scalingParams?.rescaleSlope % 1 !== 0; if (pixelData instanceof Float32Array && scaledWithNonIntegers) { const floatMinMax = { min: image.minPixelValue, max: image.maxPixelValue }; const floatRange = Math.abs(floatMinMax.max - floatMinMax.min); const intRange = 65535; const slope = floatRange / intRange; const intercept = floatMinMax.min; const numPixels = pixelData.length; const intPixelData = new Uint16Array(numPixels); let min = 65535; let max = 0; for (let i = 0; i < numPixels; i++) { const rescaledPixel = Math.floor((pixelData[i] - intercept) / slope); intPixelData[i] = rescaledPixel; min = Math.min(min, rescaledPixel); max = Math.max(max, rescaledPixel); } image.minPixelValue = min; image.maxPixelValue = max; image.slope = slope; image.intercept = intercept; if (image.voxelManager) { image.voxelManager.getScalarData = () => intPixelData; } else { image.getPixelData = () => intPixelData; } image.preScale = { ...image.preScale, scaled: false }; } this._setCSImage(image); this.viewportStatus = _enums__WEBPACK_IMPORTED_MODULE_34__["default"].PRE_RENDER; const eventDetail = { image, imageId, imageIdIndex, viewportId: this.id, renderingEngineId: this.renderingEngineId }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_22__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_30__["default"].STACK_NEW_IMAGE, eventDetail); this._updateToDisplayImageCPU(image); this.render(); this.currentImageIdIndex = imageIdIndex; resolve(imageId); } function errorCallback(error, imageIdIndex, imageId) { const eventDetail = { error, imageIdIndex, imageId }; if (!this.suppressEvents) { (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_22__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_11__["default"], _enums__WEBPACK_IMPORTED_MODULE_30__["default"].IMAGE_LOAD_ERROR, eventDetail); } reject(error); } function sendRequest(imageId, imageIdIndex, options) { return (0,_loaders_imageLoader__WEBPACK_IMPORTED_MODULE_36__.loadAndCacheImage)(imageId, options).then(image => { successCallback.call(this, image, imageIdIndex, imageId); }, error => { errorCallback.call(this, error, imageIdIndex, imageId); }); } const priority = -5; const requestType = _enums__WEBPACK_IMPORTED_MODULE_31__["default"].Interaction; const additionalDetails = { imageId, imageIdIndex }; const options = { useRGBA: true, requestType }; const eventDetail = { imageId, imageIdIndex, viewportId: this.id, renderingEngineId: this.renderingEngineId }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_22__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_30__["default"].PRE_STACK_NEW_IMAGE, eventDetail); _requestPool_imageLoadPoolManager__WEBPACK_IMPORTED_MODULE_37__["default"].addRequest(sendRequest.bind(this, imageId, imageIdIndex, options), requestType, additionalDetails, priority); }); } successCallback(imageId, image) { const imageIdIndex = this.imageIds.indexOf(imageId); if (this.currentImageIdIndex !== imageIdIndex) { return; } const csImgFrame = this.csImage?.imageFrame; const imgFrame = image?.imageFrame; const photometricInterpretation = csImgFrame?.photometricInterpretation || this.csImage?.photometricInterpretation; const newPhotometricInterpretation = imgFrame?.photometricInterpretation || image?.photometricInterpretation; if (photometricInterpretation !== newPhotometricInterpretation) { this.stackInvalidated = true; } this._setCSImage(image); const eventDetail = { image, imageId, imageIdIndex, viewportId: this.id, renderingEngineId: this.renderingEngineId }; this._updateActorToDisplayImageId(image); (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_22__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_30__["default"].STACK_NEW_IMAGE, eventDetail); this.render(); this.currentImageIdIndex = imageIdIndex; } errorCallback(imageId, permanent, error) { if (!permanent) { return; } const imageIdIndex = this.imageIds.indexOf(imageId); const eventDetail = { error, imageIdIndex, imageId }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_22__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_11__["default"], _enums__WEBPACK_IMPORTED_MODULE_30__["default"].IMAGE_LOAD_ERROR, eventDetail); } getLoaderImageOptions(imageId) { const imageIdIndex = this.imageIds.indexOf(imageId); const { transferSyntaxUID } = _metaData__WEBPACK_IMPORTED_MODULE_12__.get('transferSyntax', imageId) || {}; const options = { useRGBA: false, transferSyntaxUID, priority: 5, requestType: _enums__WEBPACK_IMPORTED_MODULE_31__["default"].Interaction, additionalDetails: { imageId, imageIdIndex } }; return options; } loadImages(imageIds, listener) { var _this2 = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { const resultList = yield Promise.allSettled(imageIds.map(imageId => { const options = _this2.getLoaderImageOptions(imageId); return (0,_loaders_imageLoader__WEBPACK_IMPORTED_MODULE_36__.loadAndCacheImage)(imageId, options).then(image => { listener.successCallback(imageId, image); return imageId; }, error => { listener.errorCallback(imageId, true, error); return imageId; }); })); const errorList = resultList.filter(item => item.status === 'rejected'); if (errorList && errorList.length) { const event = new CustomEvent(_enums__WEBPACK_IMPORTED_MODULE_30__["default"].IMAGE_LOAD_ERROR, { detail: errorList, cancelable: true }); _eventTarget__WEBPACK_IMPORTED_MODULE_11__["default"].dispatchEvent(event); } return resultList; })(); } _loadAndDisplayImageGPU(imageId, imageIdIndex) { if (!imageId) { console.warn('No image id set yet to load'); return; } const eventDetail = { imageId, imageIdIndex, viewportId: this.id, renderingEngineId: this.renderingEngineId }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_22__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_30__["default"].PRE_STACK_NEW_IMAGE, eventDetail); return this.imagesLoader.loadImages([imageId], this).then(() => { return imageId; }); } _updateToDisplayImageCPU(image) { const metadata = this.getImageDataMetadata(image); const viewport = (0,_helpers_cpuFallback_rendering_getDefaultViewport__WEBPACK_IMPORTED_MODULE_40__["default"])(this.canvas, image, this.modality, this._cpuFallbackEnabledElement.viewport.colormap); const { windowCenter, windowWidth, voiLUTFunction } = viewport.voi; this.voiRange = _utilities_windowLevel__WEBPACK_IMPORTED_MODULE_18__.toLowHighRange(windowWidth, windowCenter, voiLUTFunction); this._cpuFallbackEnabledElement.image = image; this._cpuFallbackEnabledElement.metadata = { ...metadata }; this.cpuImagePixelData = image.voxelManager.getScalarData(); const viewportSettingToUse = Object.assign({}, viewport, this._cpuFallbackEnabledElement.viewport); this._cpuFallbackEnabledElement.viewport = this.stackInvalidated ? viewport : viewportSettingToUse; this.stackInvalidated = false; this.cpuRenderingInvalidated = true; this._cpuFallbackEnabledElement.transform = (0,_helpers_cpuFallback_rendering_calculateTransform__WEBPACK_IMPORTED_MODULE_38__["default"])(this._cpuFallbackEnabledElement); } getSliceViewInfo() { throw new Error('Method not implemented.'); } addImages(stackInputs) { const actors = []; stackInputs.forEach(stackInput => { const { imageId, ...rest } = stackInput; const image = _cache_cache__WEBPACK_IMPORTED_MODULE_43__["default"].getImage(imageId); const { origin, dimensions, direction, spacing, numberOfComponents } = this.getImageDataMetadata(image); const imagedata = this.createVTKImageData({ origin, dimensions, direction, spacing, numberOfComponents, pixelArray: image.voxelManager.getScalarData() }); const imageActor = this.createActorMapper(imagedata); if (imageActor) { actors.push({ uid: stackInput.actorUID ?? (0,_utilities_uuidv4__WEBPACK_IMPORTED_MODULE_49__["default"])(), actor: imageActor, referencedId: imageId, ...rest }); if (stackInput.callback) { stackInput.callback({ imageActor, imageId: stackInput.imageId }); } } }); this.addActors(actors); } _updateActorToDisplayImageId(image) { const sameImageData = this._checkVTKImageDataMatchesCornerstoneImage(image, this._imageData); const viewPresentation = this.getViewPresentation(); if (sameImageData && !this.stackInvalidated) { this._updateVTKImageDataFromCornerstoneImage(image); this.resetCameraNoEvent(); this.setViewPresentation(viewPresentation); this._setPropertiesFromCache(); this.stackActorReInitialized = false; return; } const { origin, direction, dimensions, spacing, numberOfComponents, imagePixelModule } = this.getImageDataMetadata(image); const pixelArray = image.voxelManager.getScalarData(); this._createVTKImageData({ origin, direction, dimensions, spacing, numberOfComponents, pixelArray }); this._updateVTKImageDataFromCornerstoneImage(image); const actor = this.createActorMapper(this._imageData); const oldActors = this.getActors(); if (oldActors.length && oldActors[0].uid === this.id) { oldActors[0].actor = actor; } else { oldActors.unshift({ uid: this.id, actor, referencedId: image.imageId }); } this.setActors(oldActors); const { viewPlaneNormal, viewUp } = this._getCameraOrientation(direction); const previousCamera = this.getCamera(); this.setCameraNoEvent({ viewUp, viewPlaneNormal }); this.initialViewUp = viewUp; this.resetCameraNoEvent(); this.setViewPresentation(viewPresentation); this.triggerCameraEvent(this.getCamera(), previousCamera); const monochrome1 = imagePixelModule.photometricInterpretation === 'MONOCHROME1'; this.stackInvalidated = true; const voiRange = this._getInitialVOIRange(image); this.setVOI(voiRange, { forceRecreateLUTFunction: !!monochrome1 }); this.initialInvert = !!monochrome1; this.setInvertColor(this.invert || this.initialInvert); this.stackInvalidated = false; this.stackActorReInitialized = true; if (this._publishCalibratedEvent) { this.triggerCalibrationEvent(); } } _getInitialVOIRange(image) { if (this.voiRange && this.voiUpdatedWithSetProperties) { return this.voiRange; } const { windowCenter, windowWidth, voiLUTFunction } = image; let voiRange = this._getVOIRangeFromWindowLevel(windowWidth, windowCenter, voiLUTFunction); voiRange = this._getPTPreScaledRange() || voiRange; return voiRange; } _getPTPreScaledRange() { if (!this._isCurrentImagePTPrescaled()) { return undefined; } return this._getDefaultPTPrescaledVOIRange(); } _isCurrentImagePTPrescaled() { if (this.modality !== 'PT' || !this.csImage.isPreScaled) { return false; } if (!this.csImage.preScale?.scalingParameters.suvbw) { return false; } return true; } _getDefaultPTPrescaledVOIRange() { return { lower: 0, upper: 5 }; } _getVOIRangeFromWindowLevel(windowWidth, windowCenter, voiLUTFunction = _enums__WEBPACK_IMPORTED_MODULE_33__["default"].LINEAR) { let center, width; if (typeof windowCenter === 'number' && typeof windowWidth === 'number') { center = windowCenter; width = windowWidth; } else if (Array.isArray(windowCenter) && Array.isArray(windowWidth)) { center = windowCenter[0]; width = windowWidth[0]; } if (center !== undefined && width !== undefined) { return _utilities_windowLevel__WEBPACK_IMPORTED_MODULE_18__.toLowHighRange(width, center, voiLUTFunction); } } _setImageIdIndex(imageIdIndex) { var _this3 = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { if (imageIdIndex >= _this3.imageIds.length) { throw new Error(`ImageIdIndex provided ${imageIdIndex} is invalid, the stack only has ${_this3.imageIds.length} elements`); } _this3.currentImageIdIndex = imageIdIndex; _this3.hasPixelSpacing = true; _this3.viewportStatus = _enums__WEBPACK_IMPORTED_MODULE_34__["default"].PRE_RENDER; const imageId = yield _this3._loadAndDisplayImage(_this3.imageIds[imageIdIndex], imageIdIndex); if (_this3.perImageIdDefaultProperties.size >= 1) { const defaultProperties = _this3.perImageIdDefaultProperties.get(imageId); if (defaultProperties !== undefined) { _this3.setProperties(defaultProperties); } else if (_this3.globalDefaultProperties !== undefined) { _this3.setProperties(_this3.globalDefaultProperties); } } return imageId; })(); } resetCameraCPU({ resetPan = true, resetZoom = true }) { const { image } = this._cpuFallbackEnabledElement; if (!image) { return; } (0,_helpers_cpuFallback_rendering_resetCamera__WEBPACK_IMPORTED_MODULE_47__["default"])(this._cpuFallbackEnabledElement, resetPan, resetZoom); const { scale } = this._cpuFallbackEnabledElement.viewport; const { clientWidth, clientHeight } = this.element; const center = [clientWidth / 2, clientHeight / 2]; const centerWorld = this.canvasToWorldCPU(center); this.setCameraCPU({ focalPoint: centerWorld, scale }); } resetCameraGPU({ resetPan, resetZoom }) { this.setCamera({ flipHorizontal: false, flipVertical: false, viewUp: this.initialViewUp }); const resetToCenter = true; return super.resetCamera({ resetPan, resetZoom, resetToCenter }); } scroll(delta, debounce = true, loop = false) { const imageIds = this.imageIds; if (isNaN(this.targetImageIdIndex)) { return; } const currentTargetImageIdIndex = this.targetImageIdIndex; const numberOfFrames = imageIds.length; let newTargetImageIdIndex = currentTargetImageIdIndex + delta; if (loop) { newTargetImageIdIndex = (newTargetImageIdIndex + numberOfFrames) % numberOfFrames; } else { newTargetImageIdIndex = Math.max(0, Math.min(numberOfFrames - 1, newTargetImageIdIndex)); } this.targetImageIdIndex = newTargetImageIdIndex; const targetImageId = imageIds[newTargetImageIdIndex]; const imageAlreadyLoaded = _cache_cache__WEBPACK_IMPORTED_MODULE_43__["default"].isLoaded(targetImageId); if (imageAlreadyLoaded || !debounce) { this.setImageIdIndex(newTargetImageIdIndex); } else { clearTimeout(this.debouncedTimeout); this.debouncedTimeout = window.setTimeout(() => { this.setImageIdIndex(newTargetImageIdIndex); }, 40); } const eventData = { newImageIdIndex: newTargetImageIdIndex, imageId: targetImageId, direction: delta }; if (newTargetImageIdIndex !== currentTargetImageIdIndex) { (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_22__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_30__["default"].STACK_VIEWPORT_SCROLL, eventData); } } setImageIdIndex(imageIdIndex) { this._throwIfDestroyed(); if (this.currentImageIdIndex === imageIdIndex) { return Promise.resolve(this.getCurrentImageId()); } const imageIdPromise = this._setImageIdIndex(imageIdIndex); this.targetImageIdIndex = imageIdIndex; return imageIdPromise; } calibrateSpacing(imageId) { const imageIdIndex = this.getImageIds().indexOf(imageId); this.stackInvalidated = true; this._loadAndDisplayImage(imageId, imageIdIndex); } triggerCameraEvent(camera, previousCamera) { const eventDetail = { previousCamera, camera, element: this.element, viewportId: this.id, renderingEngineId: this.renderingEngineId }; if (!this.suppressEvents) { (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_22__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_30__["default"].CAMERA_MODIFIED, eventDetail); } } triggerCalibrationEvent() { const { imageData } = this.getImageData(); const eventDetail = { element: this.element, viewportId: this.id, renderingEngineId: this.renderingEngineId, imageId: this.getCurrentImageId(), imageData: imageData, worldToIndex: imageData.getWorldToIndex(), ...this._calibrationEvent }; if (!this.suppressEvents) { (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_22__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_30__["default"].IMAGE_SPACING_CALIBRATED, eventDetail); } this._publishCalibratedEvent = false; } jumpToWorld(worldPos) { const imageIds = this.getImageIds(); const imageData = this.getImageData(); const { direction, spacing } = imageData; const imageId = (0,_utilities_getClosestImageId__WEBPACK_IMPORTED_MODULE_51__["default"])({ direction, spacing, imageIds }, worldPos, this.getCamera().viewPlaneNormal, { ignoreSpacing: true }); const index = imageIds.indexOf(imageId); if (index === -1) { return false; } this.setImageIdIndex(index); this.render(); return true; } getRendererContextPool() { const renderingEngine = this.getRenderingEngine(); return renderingEngine.getRenderer(this.id); } getRendererTiled() { const renderingEngine = this.getRenderingEngine(); if (!renderingEngine || renderingEngine.hasBeenDestroyed) { throw new Error('Rendering engine has been destroyed'); } return renderingEngine.offscreenMultiRenderWindow?.getRenderer(this.id); } _getVOIRangeForCurrentImage() { const { windowCenter, windowWidth, voiLUTFunction } = this.csImage; return this._getVOIRangeFromWindowLevel(windowWidth, windowCenter, voiLUTFunction); } _getValidVOILUTFunction(voiLUTFunction) { if (!Object.values(_enums__WEBPACK_IMPORTED_MODULE_33__["default"]).includes(voiLUTFunction)) { return _enums__WEBPACK_IMPORTED_MODULE_33__["default"].LINEAR; } return voiLUTFunction; } getSliceInfo() { const sliceIndex = this.getSliceIndex(); const { dimensions } = this.getImageData(); return { width: dimensions[0], height: dimensions[1], sliceIndex, slicePlane: 2 }; } isReferenceViewable(viewRef, options = {}) { const testIndex = this.getCurrentImageIdIndex(); const currentImageId = this.imageIds[testIndex]; if (!currentImageId || !viewRef) { return false; } const { referencedImageId, multiSliceReference } = viewRef; if (referencedImageId) { if (referencedImageId === currentImageId) { return true; } viewRef.referencedImageURI ||= (0,_utilities_imageIdToURI__WEBPACK_IMPORTED_MODULE_26__["default"])(referencedImageId); const { referencedImageURI } = viewRef; const foundSliceIndex = this.imageKeyToIndexMap.get(referencedImageURI); if (options.asOverlay) { const matchedImageId = this.matchImagesForOverlay(currentImageId, referencedImageId); if (matchedImageId) { return true; } } if (foundSliceIndex === undefined) { return false; } if (options.withNavigation) { return true; } const rangeEndSliceIndex = multiSliceReference && this.imageKeyToIndexMap.get(multiSliceReference.referencedImageId); return testIndex <= rangeEndSliceIndex && testIndex >= foundSliceIndex; } if (!super.isReferenceViewable(viewRef, { ...options, withOrientation: options?.asVolume })) { return false; } if (viewRef.volumeId || viewRef.FrameOfReferenceUID) { return options.asVolume; } const { cameraFocalPoint } = viewRef; if (options.asNearbyProjection && cameraFocalPoint) { const { spacing, direction, origin } = this.getImageData(); const viewPlaneNormal = direction.slice(6, 9); const sliceThickness = (0,_utilities_getSpacingInNormalDirection__WEBPACK_IMPORTED_MODULE_50__["default"])({ direction, spacing }, viewPlaneNormal); const diff = gl_matrix__WEBPACK_IMPORTED_MODULE_10__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_10__.create(), cameraFocalPoint, origin); const distanceToPlane = gl_matrix__WEBPACK_IMPORTED_MODULE_10__.dot(diff, viewPlaneNormal); const threshold = sliceThickness / 2; if (Math.abs(distanceToPlane) <= threshold) { return true; } } return false; } getViewReference(viewRefSpecifier = {}) { const { sliceIndex = this.getCurrentImageIdIndex() } = viewRefSpecifier; const reference = super.getViewReference(viewRefSpecifier); const referencedImageId = this.getCurrentImageId(sliceIndex); if (!referencedImageId) { return; } reference.referencedImageId = referencedImageId; if (this.getCurrentImageIdIndex() !== sliceIndex) { const referenceData = this.getImagePlaneReferenceData(sliceIndex); if (!referenceData) { return; } Object.assign(reference, referenceData); } return reference; } setViewReference(viewRef) { if (!viewRef?.referencedImageId) { if (viewRef?.sliceIndex !== undefined) { this.scroll(viewRef.sliceIndex - this.targetImageIdIndex); } return; } const { referencedImageId } = viewRef; viewRef.referencedImageURI ||= (0,_utilities_imageIdToURI__WEBPACK_IMPORTED_MODULE_26__["default"])(referencedImageId); const { referencedImageURI } = viewRef; const sliceIndex = this.imageKeyToIndexMap.get(referencedImageURI); if (sliceIndex === undefined) { log.error(`No image URI found for ${referencedImageURI}`); return; } this.scroll(sliceIndex - this.targetImageIdIndex); } getViewReferenceId(specifier = {}) { const { sliceIndex = this.currentImageIdIndex } = specifier; return `imageId:${this.imageIds[sliceIndex]}`; } getSliceIndexForImage(reference) { if (!reference) { return; } if (typeof reference === 'string') { return this.imageKeyToIndexMap.get(reference); } if (reference.referencedImageId) { return this.imageKeyToIndexMap.get(reference.referencedImageId); } return; } getCPUFallbackError(method) { return new Error(`method ${method} cannot be used during CPU Fallback mode`); } fillWithBackgroundColor() { const renderingEngine = this.getRenderingEngine(); if (renderingEngine) { renderingEngine.fillCanvasWithBackgroundColor(this.canvas, this.options.background); } } unsetColormapCPU() { delete this._cpuFallbackEnabledElement.viewport.colormap; this._cpuFallbackEnabledElement.renderingTools = {}; this.cpuRenderingInvalidated = true; this.fillWithBackgroundColor(); this.render(); } setColormapCPU(colormapData) { this.colormap = colormapData; const colormap = _utilities_colormap__WEBPACK_IMPORTED_MODULE_16__.getColormap(colormapData.name); this._cpuFallbackEnabledElement.viewport.colormap = colormap; this._cpuFallbackEnabledElement.renderingTools = {}; this.fillWithBackgroundColor(); this.cpuRenderingInvalidated = true; this.render(); const eventDetail = { viewportId: this.id, colormap: colormapData }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_22__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_30__["default"].COLORMAP_MODIFIED, eventDetail); } setColormapGPU(colormap) { const ActorEntry = this.getDefaultActor(); const actor = ActorEntry.actor; const actorProp = actor.getProperty(); const rgbTransferFunction = actorProp.getRGBTransferFunction(); const colormapObj = _utilities_colormap__WEBPACK_IMPORTED_MODULE_16__.getColormap(colormap.name) || _kitware_vtk_js_Rendering_Core_ColorTransferFunction_ColorMaps__WEBPACK_IMPORTED_MODULE_5__["default"].getPresetByName(colormap.name); if (!rgbTransferFunction) { const cfun = _kitware_vtk_js_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_4__["default"].newInstance(); cfun.applyColorMap(colormapObj); cfun.setMappingRange(this.voiRange.lower, this.voiRange.upper); actorProp.setRGBTransferFunction(0, cfun); } else { rgbTransferFunction.applyColorMap(colormapObj); rgbTransferFunction.setMappingRange(this.voiRange.lower, this.voiRange.upper); actorProp.setRGBTransferFunction(0, rgbTransferFunction); } this.colormap = colormap; this.render(); const eventDetail = { viewportId: this.id, colormap }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_22__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_30__["default"].COLORMAP_MODIFIED, eventDetail); } unsetColormapGPU() { throw new Error('unsetColormapGPU not implemented.'); } _getImagePlaneModule(imageId) { const imagePlaneModule = (0,_utilities_buildMetadata__WEBPACK_IMPORTED_MODULE_29__.getImagePlaneModule)(imageId); this.hasPixelSpacing = !imagePlaneModule.usingDefaultValues || this.calibration?.scale > 0 || this.calibration?.rowPixelSpacing > 0; this.calibration ||= imagePlaneModule.calibration; return imagePlaneModule; } isInAcquisitionPlane() { return true; } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (StackViewport); /***/ }, /***/ 84405 /*!*******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/TiledRenderingEngine.js ***! \*******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _BaseRenderingEngine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BaseRenderingEngine */ 82838); /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums/Events */ 14566); /* harmony import */ var _eventTarget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../eventTarget */ 28699); /* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utilities/triggerEvent */ 91133); /* harmony import */ var _enums_ViewportType__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../enums/ViewportType */ 43089); /* harmony import */ var _VolumeViewport__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./VolumeViewport */ 93667); /* harmony import */ var _StackViewport__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./StackViewport */ 67461); /* harmony import */ var _helpers_viewportTypeUsesCustomRenderingPipeline__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./helpers/viewportTypeUsesCustomRenderingPipeline */ 65072); /* harmony import */ var _helpers_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./helpers/getOrCreateCanvas */ 63628); /* harmony import */ var _VolumeViewport3D__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./VolumeViewport3D */ 50600); /* harmony import */ var _vtkClasses__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./vtkClasses */ 51676); class TiledRenderingEngine extends _BaseRenderingEngine__WEBPACK_IMPORTED_MODULE_0__["default"] { constructor(id) { super(id); this._renderFlaggedViewports = () => { this._throwIfDestroyed(); if (!this.useCPURendering) { this.performVtkDrawCall(); } const viewports = this._getViewportsAsArray(); const eventDetailArray = []; for (let i = 0; i < viewports.length; i++) { const viewport = viewports[i]; if (this._needsRender.has(viewport.id)) { const eventDetail = this.renderViewportUsingCustomOrVtkPipeline(viewport); eventDetailArray.push(eventDetail); viewport.setRendered(); this._needsRender.delete(viewport.id); if (this._needsRender.size === 0) { break; } } } this._animationFrameSet = false; this._animationFrameHandle = null; eventDetailArray.forEach(eventDetail => { if (!eventDetail?.element) { return; } (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_3__["default"])(eventDetail.element, _enums_Events__WEBPACK_IMPORTED_MODULE_1__["default"].IMAGE_RENDERED, eventDetail); }); }; if (!this.useCPURendering) { this.offscreenMultiRenderWindow = _vtkClasses__WEBPACK_IMPORTED_MODULE_10__["default"].newInstance(); this.offScreenCanvasContainer = document.createElement('div'); this.offscreenMultiRenderWindow.setContainer(this.offScreenCanvasContainer); } } enableVTKjsDrivenViewport(viewportInputEntry) { const viewports = this._getViewportsAsArray(); const viewportsDrivenByVtkJs = viewports.filter(vp => (0,_helpers_viewportTypeUsesCustomRenderingPipeline__WEBPACK_IMPORTED_MODULE_7__["default"])(vp.type) === false); const canvasesDrivenByVtkJs = viewportsDrivenByVtkJs.map(vp => vp.canvas); const canvas = (0,_helpers_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_8__["default"])(viewportInputEntry.element); canvasesDrivenByVtkJs.push(canvas); const { offScreenCanvasWidth, offScreenCanvasHeight } = this._resizeOffScreenCanvas(canvasesDrivenByVtkJs); const xOffset = this._resize(viewportsDrivenByVtkJs, offScreenCanvasWidth, offScreenCanvasHeight); const internalViewportEntry = { ...viewportInputEntry, canvas }; this.addVtkjsDrivenViewport(internalViewportEntry, { offScreenCanvasWidth, offScreenCanvasHeight, xOffset }); } addVtkjsDrivenViewport(viewportInputEntry, offscreenCanvasProperties) { const { element, canvas, viewportId, type, defaultOptions } = viewportInputEntry; element.tabIndex = -1; const { offScreenCanvasWidth, offScreenCanvasHeight, xOffset } = offscreenCanvasProperties; const { sxStartDisplayCoords, syStartDisplayCoords, sxEndDisplayCoords, syEndDisplayCoords, sx, sy, sWidth, sHeight } = this._getViewportCoordsOnOffScreenCanvas(viewportInputEntry, offScreenCanvasWidth, offScreenCanvasHeight, xOffset); this.offscreenMultiRenderWindow.addRenderer({ viewport: [sxStartDisplayCoords, syStartDisplayCoords, sxEndDisplayCoords, syEndDisplayCoords], id: viewportId, background: defaultOptions.background ? defaultOptions.background : [0, 0, 0] }); const viewportInput = { id: viewportId, element, renderingEngineId: this.id, type, canvas, sx, sy, sWidth, sHeight, defaultOptions: defaultOptions || {} }; let viewport; if (type === _enums_ViewportType__WEBPACK_IMPORTED_MODULE_4__["default"].STACK) { viewport = new _StackViewport__WEBPACK_IMPORTED_MODULE_6__["default"](viewportInput); } else if (type === _enums_ViewportType__WEBPACK_IMPORTED_MODULE_4__["default"].ORTHOGRAPHIC || type === _enums_ViewportType__WEBPACK_IMPORTED_MODULE_4__["default"].PERSPECTIVE) { viewport = new _VolumeViewport__WEBPACK_IMPORTED_MODULE_5__["default"](viewportInput); } else if (type === _enums_ViewportType__WEBPACK_IMPORTED_MODULE_4__["default"].VOLUME_3D) { viewport = new _VolumeViewport3D__WEBPACK_IMPORTED_MODULE_9__["default"](viewportInput); } else { throw new Error(`Viewport Type ${type} is not supported`); } this._viewports.set(viewportId, viewport); const eventDetail = { element, viewportId, renderingEngineId: this.id }; if (!viewport.suppressEvents) { (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_3__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_2__["default"], _enums_Events__WEBPACK_IMPORTED_MODULE_1__["default"].ELEMENT_ENABLED, eventDetail); } } setVtkjsDrivenViewports(viewportInputEntries) { if (viewportInputEntries.length) { const vtkDrivenCanvases = viewportInputEntries.map(vp => (0,_helpers_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_8__["default"])(vp.element)); vtkDrivenCanvases.forEach(canvas => { const devicePixelRatio = window.devicePixelRatio || 1; const rect = canvas.getBoundingClientRect(); canvas.width = rect.width * devicePixelRatio; canvas.height = rect.height * devicePixelRatio; }); const { offScreenCanvasWidth, offScreenCanvasHeight } = this._resizeOffScreenCanvas(vtkDrivenCanvases); let xOffset = 0; for (let i = 0; i < viewportInputEntries.length; i++) { const vtkDrivenViewportInputEntry = viewportInputEntries[i]; const canvas = vtkDrivenCanvases[i]; const internalViewportEntry = { ...vtkDrivenViewportInputEntry, canvas }; this.addVtkjsDrivenViewport(internalViewportEntry, { offScreenCanvasWidth, offScreenCanvasHeight, xOffset }); xOffset += canvas.width; } } } _resizeVTKViewports(vtkDrivenViewports, keepCamera = true, immediate = true) { const canvasesDrivenByVtkJs = vtkDrivenViewports.map(vp => { return (0,_helpers_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_8__["default"])(vp.element); }); canvasesDrivenByVtkJs.forEach(canvas => { const devicePixelRatio = window.devicePixelRatio || 1; canvas.width = canvas.clientWidth * devicePixelRatio; canvas.height = canvas.clientHeight * devicePixelRatio; }); if (canvasesDrivenByVtkJs.length) { const { offScreenCanvasWidth, offScreenCanvasHeight } = this._resizeOffScreenCanvas(canvasesDrivenByVtkJs); this._resize(vtkDrivenViewports, offScreenCanvasWidth, offScreenCanvasHeight); } vtkDrivenViewports.forEach(vp => { const prevCamera = vp.getCamera(); const rotation = vp.getRotation(); const { flipHorizontal } = prevCamera; vp.resetCameraForResize(); const displayArea = vp.getDisplayArea(); if (keepCamera) { if (displayArea) { if (flipHorizontal) { vp.setCamera({ flipHorizontal }); } if (rotation) { vp.setViewPresentation({ rotation }); } } else { vp.setCamera(prevCamera); } } }); if (immediate) { this.render(); } } performVtkDrawCall() { const { offscreenMultiRenderWindow } = this; const renderWindow = offscreenMultiRenderWindow.getRenderWindow(); const renderers = offscreenMultiRenderWindow.getRenderers(); if (!renderers.length) { return; } for (let i = 0; i < renderers.length; i++) { const { renderer, id } = renderers[i]; if (this._needsRender.has(id)) { renderer.setDraw(true); } else { renderer.setDraw(false); } } renderWindow.render(); for (let i = 0; i < renderers.length; i++) { renderers[i].renderer.setDraw(false); } } renderViewportUsingCustomOrVtkPipeline(viewport) { let eventDetail; if (viewport.sWidth < _BaseRenderingEngine__WEBPACK_IMPORTED_MODULE_0__.VIEWPORT_MIN_SIZE || viewport.sHeight < _BaseRenderingEngine__WEBPACK_IMPORTED_MODULE_0__.VIEWPORT_MIN_SIZE) { console.warn('Viewport is too small', viewport.sWidth, viewport.sHeight); return; } if ((0,_helpers_viewportTypeUsesCustomRenderingPipeline__WEBPACK_IMPORTED_MODULE_7__["default"])(viewport.type) === true) { eventDetail = viewport.customRenderViewportToCanvas(); } else { if (this.useCPURendering) { throw new Error('GPU not available, and using a viewport with no custom render pipeline.'); } const { offscreenMultiRenderWindow } = this; const openGLRenderWindow = offscreenMultiRenderWindow.getOpenGLRenderWindow(); const context = openGLRenderWindow.get3DContext(); const offScreenCanvas = context.canvas; eventDetail = this._renderViewportFromVtkCanvasToOnscreenCanvas(viewport, offScreenCanvas); } return eventDetail; } _renderViewportFromVtkCanvasToOnscreenCanvas(viewport, offScreenCanvas) { const { element, canvas, sx, sy, sWidth, sHeight, id: viewportId, renderingEngineId, suppressEvents } = viewport; const { width: dWidth, height: dHeight } = canvas; const onScreenContext = canvas.getContext('2d'); onScreenContext.drawImage(offScreenCanvas, sx, sy, sWidth, sHeight, 0, 0, dWidth, dHeight); return { element, suppressEvents, viewportId, renderingEngineId, viewportStatus: viewport.viewportStatus }; } _resizeOffScreenCanvas(canvasesDrivenByVtkJs) { const { offScreenCanvasContainer, offscreenMultiRenderWindow } = this; const offScreenCanvasHeight = Math.max(...canvasesDrivenByVtkJs.map(canvas => canvas.height)); let offScreenCanvasWidth = 0; canvasesDrivenByVtkJs.forEach(canvas => { offScreenCanvasWidth += canvas.width; }); offScreenCanvasContainer.width = offScreenCanvasWidth; offScreenCanvasContainer.height = offScreenCanvasHeight; offscreenMultiRenderWindow.resize(); return { offScreenCanvasWidth, offScreenCanvasHeight }; } _resize(viewportsDrivenByVtkJs, offScreenCanvasWidth, offScreenCanvasHeight) { let _xOffset = 0; for (let i = 0; i < viewportsDrivenByVtkJs.length; i++) { const viewport = viewportsDrivenByVtkJs[i]; const { sxStartDisplayCoords, syStartDisplayCoords, sxEndDisplayCoords, syEndDisplayCoords, sx, sy, sWidth, sHeight } = this._getViewportCoordsOnOffScreenCanvas(viewport, offScreenCanvasWidth, offScreenCanvasHeight, _xOffset); _xOffset += viewport.canvas.width; viewport.sx = sx; viewport.sy = sy; viewport.sWidth = sWidth; viewport.sHeight = sHeight; const renderer = this.offscreenMultiRenderWindow.getRenderer(viewport.id); renderer.setViewport(sxStartDisplayCoords, syStartDisplayCoords, sxEndDisplayCoords, syEndDisplayCoords); } return _xOffset; } _getViewportCoordsOnOffScreenCanvas(viewport, offScreenCanvasWidth, offScreenCanvasHeight, _xOffset) { const { canvas } = viewport; const { width: sWidth, height: sHeight } = canvas; const sx = _xOffset; const sy = 0; const sxStartDisplayCoords = sx / offScreenCanvasWidth; const syStartDisplayCoords = sy + (offScreenCanvasHeight - sHeight) / offScreenCanvasHeight; const sWidthDisplayCoords = sWidth / offScreenCanvasWidth; const sHeightDisplayCoords = sHeight / offScreenCanvasHeight; return { sxStartDisplayCoords, syStartDisplayCoords, sxEndDisplayCoords: sxStartDisplayCoords + sWidthDisplayCoords, syEndDisplayCoords: syStartDisplayCoords + sHeightDisplayCoords, sx, sy, sWidth, sHeight }; } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TiledRenderingEngine); /***/ }, /***/ 51610 /*!************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/VideoViewport.js ***! \************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enums */ 14566); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../enums */ 65836); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../enums */ 94649); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../metaData */ 90161); /* harmony import */ var _helpers_cpuFallback_rendering_transform__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./helpers/cpuFallback/rendering/transform */ 98233); /* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utilities/triggerEvent */ 91133); /* harmony import */ var _Viewport__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Viewport */ 38589); /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers */ 63628); /* harmony import */ var _CanvasActor__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./CanvasActor */ 77885); /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../cache/cache */ 38277); /* harmony import */ var _utilities_uuidv4__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../utilities/uuidv4 */ 29760); /* harmony import */ var _utilities_FrameRange__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../utilities/FrameRange */ 49451); /* harmony import */ var _utilities_pointInShapeCallback__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../utilities/pointInShapeCallback */ 83872); class VideoViewport extends _Viewport__WEBPACK_IMPORTED_MODULE_8__["default"] { static { this.frameRangeExtractor = /(\/frames\/|[&?]frameNumber=)([^/&?]*)/i; } constructor(props) { super({ ...props, canvas: props.canvas || (0,_helpers__WEBPACK_IMPORTED_MODULE_9__.getOrCreateCanvas)(props.element) }); this.videoWidth = 0; this.videoHeight = 0; this.loop = true; this.mute = true; this.isPlaying = false; this.scrollSpeed = 1; this.playbackRate = 1; this.frameRange = [0, 0]; this.fps = 30; this.videoCamera = { panWorld: [0, 0], parallelScale: 1 }; this.voiRange = { lower: 0, upper: 255 }; this.getProperties = () => { return { loop: this.videoElement.loop, muted: this.videoElement.muted, playbackRate: this.playbackRate, scrollSpeed: this.scrollSpeed, voiRange: { ...this.voiRange } }; }; this.getMiddleSliceData = () => { throw new Error('Method not implemented.'); }; this.useCustomRenderingPipeline = true; this.resetCamera = () => { this.refreshRenderValues(); this.canvasContext.fillRect(0, 0, this.canvas.width, this.canvas.height); if (!this.isPlaying) { this.renderFrame(); } return true; }; this.getNumberOfSlices = () => { const computedSlices = Math.round(this.videoElement.duration * this.fps / this.scrollSpeed); return isNaN(computedSlices) ? this.numberOfFrames : computedSlices; }; this.getFrameOfReferenceUID = () => { return this.videoElement.src; }; this.resize = () => { const canvas = this.canvas; const { clientWidth, clientHeight } = canvas; if (canvas.width !== clientWidth || canvas.height !== clientHeight) { canvas.width = clientWidth; canvas.height = clientHeight; } this.refreshRenderValues(); if (!this.isPlaying) { this.renderFrame(); } }; this.canvasToWorld = (canvasPos, destPos = [0, 0, 0]) => { const pan = this.videoCamera.panWorld; const worldToCanvasRatio = this.getWorldToCanvasRatio(); const panOffsetCanvas = [pan[0] * worldToCanvasRatio, pan[1] * worldToCanvasRatio]; const subCanvasPos = [canvasPos[0] - panOffsetCanvas[0], canvasPos[1] - panOffsetCanvas[1]]; destPos.splice(0, 2, subCanvasPos[0] / worldToCanvasRatio, subCanvasPos[1] / worldToCanvasRatio); return destPos; }; this.worldToCanvas = worldPos => { const pan = this.videoCamera.panWorld; const worldToCanvasRatio = this.getWorldToCanvasRatio(); const canvasPos = [(worldPos[0] + pan[0]) * worldToCanvasRatio, (worldPos[1] + pan[1]) * worldToCanvasRatio]; return canvasPos; }; this.getRotation = () => 0; this.canvasToIndex = canvasPos => { const transform = this.getTransform(); transform.invert(); return transform.transformPoint(canvasPos.map(it => it * devicePixelRatio)); }; this.indexToCanvas = indexPos => { const transform = this.getTransform(); return transform.transformPoint(indexPos).map(it => it / devicePixelRatio); }; this.customRenderViewportToCanvas = () => { this.renderFrame(); }; this.renderFrame = () => { const dpr = window.devicePixelRatio || 1; const transform = this.getTransform(); const transformationMatrix = transform.getMatrix(); const ctx = this.canvasContext; ctx.resetTransform(); ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); ctx.transform(transformationMatrix[0] / dpr, transformationMatrix[1] / dpr, transformationMatrix[2] / dpr, transformationMatrix[3] / dpr, transformationMatrix[4] / dpr, transformationMatrix[5] / dpr); ctx.drawImage(this.videoElement, 0, 0, this.videoWidth, this.videoHeight); for (const actor of this.getActors()) { actor.actor.render(this, this.canvasContext); } this.canvasContext.resetTransform(); (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_7__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_2__["default"].STACK_NEW_IMAGE, { element: this.element, viewportId: this.id, viewport: this, renderingEngineId: this.renderingEngineId, time: this.videoElement.currentTime, duration: this.videoElement.duration }); (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_7__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_2__["default"].IMAGE_RENDERED, { element: this.element, viewportId: this.id, viewport: this, imageIndex: this.getCurrentImageIdIndex(), numberOfSlices: this.numberOfFrames, renderingEngineId: this.renderingEngineId, time: this.videoElement.currentTime, duration: this.videoElement.duration }); this.initialRender?.(); const frame = this.getFrameNumber(); if (this.isPlaying) { if (frame < this.frameRange[0]) { this.setFrameNumber(this.frameRange[0]); } else if (frame > this.frameRange[1]) { if (this.loop) { this.setFrameNumber(this.frameRange[0]); } else { this.pause(); } } } }; this.renderWhilstPlaying = () => { this.renderFrame(); if (this.isPlaying) { requestAnimationFrame(this.renderWhilstPlaying); } }; this.canvasContext = this.canvas.getContext('2d'); this.renderingEngineId = props.renderingEngineId; this.element.setAttribute('data-viewport-uid', this.id); this.element.setAttribute('data-rendering-engine-uid', this.renderingEngineId); this.videoElement = document.createElement('video'); this.videoElement.muted = this.mute; this.videoElement.loop = this.loop; this.videoElement.autoplay = true; this.videoElement.crossOrigin = 'anonymous'; this.addEventListeners(); this.resize(); } static get useCustomRenderingPipeline() { return true; } addEventListeners() { this.canvas.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_2__["default"].ELEMENT_DISABLED, this.elementDisabledHandler); } removeEventListeners() { this.canvas.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_2__["default"].ELEMENT_DISABLED, this.elementDisabledHandler); } elementDisabledHandler() { this.removeEventListeners(); this.videoElement.remove(); } getImageDataMetadata(image) { const imageId = typeof image === 'string' ? image : image.imageId; const imagePlaneModule = _metaData__WEBPACK_IMPORTED_MODULE_5__.get(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].IMAGE_PLANE, imageId); let rowCosines = imagePlaneModule.rowCosines; let columnCosines = imagePlaneModule.columnCosines; const usingDefaultValues = imagePlaneModule.usingDefaultValues; if (usingDefaultValues || rowCosines == null || columnCosines == null) { rowCosines = [1, 0, 0]; columnCosines = [0, 1, 0]; } const rowCosineVec = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.fromValues(rowCosines[0], rowCosines[1], rowCosines[2]); const colCosineVec = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.fromValues(columnCosines[0], columnCosines[1], columnCosines[2]); const { rows, columns } = imagePlaneModule; const scanAxisNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_1__.cross(scanAxisNormal, rowCosineVec, colCosineVec); let origin = imagePlaneModule.imagePositionPatient; if (origin == null) { origin = [0, 0, 0]; } const xSpacing = imagePlaneModule.columnPixelSpacing || 1; const ySpacing = imagePlaneModule.rowPixelSpacing || 1; const xVoxels = imagePlaneModule.columns; const yVoxels = imagePlaneModule.rows; const zSpacing = 1; const zVoxels = 1; this.hasPixelSpacing = !!imagePlaneModule.columnPixelSpacing; return { bitsAllocated: 8, numberOfComponents: 3, origin, rows, columns, direction: [...rowCosineVec, ...colCosineVec, ...scanAxisNormal], dimensions: [xVoxels, yVoxels, zVoxels], spacing: [xSpacing, ySpacing, zSpacing], hasPixelSpacing: this.hasPixelSpacing, numVoxels: xVoxels * yVoxels * zVoxels, imagePlaneModule }; } setDataIds(imageIds, options) { this.setVideo(imageIds[0], (options.viewReference?.sliceIndex || 0) + 1); } setVideo(imageId, frameNumber) { this.imageId = Array.isArray(imageId) ? imageId[0] : imageId; const imageUrlModule = _metaData__WEBPACK_IMPORTED_MODULE_5__.get(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].IMAGE_URL, imageId); if (!imageUrlModule?.rendered) { throw new Error(`Video Image ID ${imageId} does not have a rendered video view`); } const { rendered } = imageUrlModule; const generalSeries = _metaData__WEBPACK_IMPORTED_MODULE_5__.get(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].GENERAL_SERIES, imageId); this.modality = generalSeries?.Modality; this.metadata = this.getImageDataMetadata(imageId); let { cineRate, numberOfFrames } = _metaData__WEBPACK_IMPORTED_MODULE_5__.get(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].CINE, imageId); this.numberOfFrames = numberOfFrames; return this.setVideoURL(rendered).then(() => { if (!numberOfFrames || numberOfFrames === 1) { numberOfFrames = Math.round(this.videoElement.duration * (cineRate || 30)); } if (!cineRate) { cineRate = Math.round(numberOfFrames / this.videoElement.duration); } this.fps = cineRate; this.numberOfFrames = numberOfFrames; this.setFrameRange([1, numberOfFrames]); this.initialRender = () => { this.initialRender = null; this.pause(); this.setFrameNumber(frameNumber || 1); }; return new Promise(resolve => { window.setTimeout(() => { this.setFrameNumber(frameNumber || 1); resolve(this); }, 25); }); }); } setVideoURL(videoURL) { var _this = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { return new Promise(resolve => { _this.videoElement.src = videoURL; _this.videoElement.preload = 'auto'; const loadedMetadataEventHandler = () => { _this.videoWidth = _this.videoElement.videoWidth; _this.videoHeight = _this.videoElement.videoHeight; _this.videoElement.removeEventListener('loadedmetadata', loadedMetadataEventHandler); _this.refreshRenderValues(); resolve(true); }; _this.videoElement.addEventListener('loadedmetadata', loadedMetadataEventHandler); }); })(); } getImageIds() { const imageIds = new Array(this.numberOfFrames); const baseImageId = this.imageId.replace(/[0-9]+$/, ''); for (let i = 0; i < this.numberOfFrames; i++) { imageIds[i] = `${baseImageId}${i + 1}`; } return imageIds; } togglePlayPause() { if (this.isPlaying) { this.pause(); return false; } else { this.play(); return true; } } play() { var _this2 = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { try { if (!_this2.isPlaying) { _this2.isPlaying = true; yield _this2.videoElement.play(); _this2.renderWhilstPlaying(); } } catch (e) {} })(); } pause() { try { this.isPlaying = false; this.videoElement.pause(); } catch (e) {} } scroll() { var _this3 = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (delta = 1) { yield _this3.pause(); const videoElement = _this3.videoElement; const renderFrame = _this3.renderFrame; const currentTime = videoElement.currentTime; const newTime = currentTime + delta * _this3.scrollSpeed / _this3.fps; videoElement.currentTime = newTime; const seekEventListener = evt => { renderFrame(); videoElement.removeEventListener('seeked', seekEventListener); }; videoElement.addEventListener('seeked', seekEventListener); }).apply(this, arguments); } start() { var _this4 = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { const videoElement = _this4.videoElement; const renderFrame = _this4.renderFrame; videoElement.currentTime = 0; if (videoElement.paused) { const seekEventListener = evt => { renderFrame(); videoElement.removeEventListener('seeked', seekEventListener); }; videoElement.addEventListener('seeked', seekEventListener); } })(); } end() { var _this5 = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { const videoElement = _this5.videoElement; const renderFrame = _this5.renderFrame; videoElement.currentTime = videoElement.duration; if (videoElement.paused) { const seekEventListener = evt => { renderFrame(); videoElement.removeEventListener('seeked', seekEventListener); }; videoElement.addEventListener('seeked', seekEventListener); } })(); } setTime(timeInSeconds) { var _this6 = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { const videoElement = _this6.videoElement; const renderFrame = _this6.renderFrame; videoElement.currentTime = timeInSeconds; if (videoElement.paused) { const seekEventListener = evt => { renderFrame(); videoElement.removeEventListener('seeked', seekEventListener); }; videoElement.addEventListener('seeked', seekEventListener); } })(); } getSliceViewInfo() { throw new Error('Method not implemented.'); } setFrameNumber(frame) { var _this7 = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { _this7.setTime((frame - 1) / _this7.fps); })(); } setFrameRange(frameRange) { if (!frameRange) { this.frameRange = [1, this.numberOfFrames]; return; } if (frameRange.length !== 2 || frameRange[0] === frameRange[1]) { return; } this.frameRange = [frameRange[0], frameRange[1]]; } getSliceIndexForImage(reference) { if (!reference) { return; } if (typeof reference === 'string') { return _utilities_FrameRange__WEBPACK_IMPORTED_MODULE_13__["default"].imageIdToFrameStart(reference); } if (reference.referencedImageId) { return _utilities_FrameRange__WEBPACK_IMPORTED_MODULE_13__["default"].imageIdToFrameStart(reference.referencedImageId); } return; } getFrameRange() { return this.frameRange; } setProperties(props) { if (props.loop !== undefined) { this.videoElement.loop = props.loop; } if (props.muted !== undefined) { this.videoElement.muted = props.muted; } if (props.playbackRate !== undefined) { this.setPlaybackRate(props.playbackRate); } if (props.scrollSpeed !== undefined) { this.setScrollSpeed(props.scrollSpeed); } if (props.voiRange) { this.setVOI(props.voiRange); } } setPlaybackRate(rate = 1) { this.playbackRate = rate; if (rate < 0.0625) { this.pause(); return; } if (!this.videoElement) { return; } this.videoElement.playbackRate = rate; this.play(); } setScrollSpeed(scrollSpeed = 1, unit = _enums__WEBPACK_IMPORTED_MODULE_3__.SpeedUnit.FRAME) { this.scrollSpeed = unit === _enums__WEBPACK_IMPORTED_MODULE_3__.SpeedUnit.SECOND ? scrollSpeed * this.fps : scrollSpeed; } resetProperties() { this.setProperties({ loop: false, muted: true, voiRange: { lower: 0, upper: 255 } }); } getScalarData() { if (this.scalarData?.frameNumber === this.getFrameNumber()) { return this.scalarData; } if (!this.videoElement || !this.videoElement.videoWidth || !this.videoElement.videoHeight) { console.debug('Video not ready yet, returning empty scalar data'); const emptyData = new Uint8ClampedArray(); emptyData.getRange = () => [0, 255]; emptyData.frameNumber = -1; return emptyData; } const canvas = document.createElement('canvas'); canvas.width = this.videoElement.videoWidth; canvas.height = this.videoElement.videoHeight; const context = canvas.getContext('2d'); context.drawImage(this.videoElement, 0, 0); const canvasData = context.getImageData(0, 0, canvas.width, canvas.height); const scalarData = canvasData.data; scalarData.getRange = () => [0, 255]; scalarData.frameNumber = this.getFrameNumber(); this.scalarData = scalarData; return scalarData; } getImageData() { const { metadata } = this; const spacing = metadata.spacing; const imageData = { getDirection: () => metadata.direction, getDimensions: () => metadata.dimensions, getRange: () => [0, 255], getScalarData: () => this.getScalarData(), getSpacing: () => metadata.spacing, worldToIndex: point => { const canvasPoint = this.worldToCanvas(point); const pixelCoord = this.canvasToIndex(canvasPoint); return [pixelCoord[0], pixelCoord[1], 0]; }, indexToWorld: (point, destPoint) => { const canvasPoint = this.indexToCanvas([point[0], point[1]]); return this.canvasToWorld(canvasPoint, destPoint); } }; const imageDataForReturn = { dimensions: metadata.dimensions, spacing, origin: metadata.origin, direction: metadata.direction, metadata: { Modality: this.modality, FrameOfReferenceUID: metadata.FrameOfReferenceUID }, getScalarData: () => this.getScalarData(), scalarData: this.getScalarData(), imageData, voxelManager: { forEach: (callback, options) => { return (0,_utilities_pointInShapeCallback__WEBPACK_IMPORTED_MODULE_14__.pointInShapeCallback)(options.imageData, { pointInShapeFn: options.isInObject ?? (() => true), callback: callback, boundsIJK: options.boundsIJK, returnPoints: options.returnPoints ?? false }); } }, hasPixelSpacing: this.hasPixelSpacing, calibration: this.calibration, preScale: { scaled: false } }; Object.defineProperty(imageData, 'scalarData', { get: () => this.getScalarData(), enumerable: true }); return imageDataForReturn; } hasImageURI(imageURI) { const framesMatch = imageURI.match(VideoViewport.frameRangeExtractor); const testURI = framesMatch ? imageURI.substring(0, framesMatch.index) : imageURI; return this.imageId.includes(testURI); } setVOI(voiRange) { this.voiRange = voiRange; const feFilter = this.setColorTransform(voiRange, this.averageWhite); this.canvas.style.filter = feFilter; } setWindowLevel(windowWidth = 256, windowCenter = 128) { const lower = windowCenter - windowWidth / 2; const upper = windowCenter + windowWidth / 2 - 1; this.setVOI({ lower, upper }); this.setColorTransform({ lower, upper }, this.averageWhite); } setAverageWhite(averageWhite) { this.averageWhite = averageWhite; this.setColorTransform(this.voiRange, averageWhite); } setCamera(camera) { const { parallelScale, focalPoint } = camera; if (parallelScale) { this.videoCamera.parallelScale = this.element.clientHeight / 2 / parallelScale; } if (focalPoint !== undefined) { const focalPointCanvas = this.worldToCanvas(focalPoint); const canvasCenter = [this.element.clientWidth / 2, this.element.clientHeight / 2]; const panWorldDelta = [(focalPointCanvas[0] - canvasCenter[0]) / this.videoCamera.parallelScale, (focalPointCanvas[1] - canvasCenter[1]) / this.videoCamera.parallelScale]; this.videoCamera.panWorld = [this.videoCamera.panWorld[0] - panWorldDelta[0], this.videoCamera.panWorld[1] - panWorldDelta[1]]; } this.canvasContext.fillStyle = 'rgba(0,0,0,1)'; this.canvasContext.fillRect(0, 0, this.canvas.width, this.canvas.height); if (!this.isPlaying) { this.renderFrame(); } } getCurrentImageId(index = this.getCurrentImageIdIndex()) { const current = this.imageId?.replace('/frames/1', `/frames/${index + 1}`); return current; } getViewReferenceId(specifier = {}) { const { sliceIndex: sliceIndex } = specifier; if (sliceIndex === undefined) { return `videoId:${this.getCurrentImageId()}`; } if (Array.isArray(sliceIndex)) { return `videoId:${this.imageId.substring(0, this.imageId.length - 1)}${sliceIndex[0] + 1}-${sliceIndex[1] + 1}`; } const baseTarget = this.imageId.replace('/frames/1', `/frames/${1 + sliceIndex}`); return `videoId:${baseTarget}`; } isReferenceViewable(viewRef, options = {}) { let { imageURI } = options; const { referencedImageId, sliceIndex, multiSliceReference } = viewRef; if (!super.isReferenceViewable(viewRef)) { return false; } const imageId = this.getCurrentImageId(); if (!imageURI) { const colonIndex = imageId.indexOf(':'); imageURI = imageId.substring(colonIndex + 1, imageId.length - 1); } if (options.withNavigation) { return true; } const currentIndex = this.getSliceIndex(); if (multiSliceReference) { const rangeEndSliceIndex = _utilities_FrameRange__WEBPACK_IMPORTED_MODULE_13__["default"].imageIdToFrameEnd(multiSliceReference.referencedImageId); return currentIndex >= sliceIndex && currentIndex <= rangeEndSliceIndex; } if (sliceIndex !== undefined) { return currentIndex === sliceIndex; } if (!referencedImageId) { return false; } const match = referencedImageId.match(VideoViewport.frameRangeExtractor); if (!match) { return true; } if (!match[2]) { return true; } const range = match[2].split('-').map(it => Number(it)); const frame = currentIndex + 1; return range[0] <= frame && frame <= (range[1] ?? range[0]); } setViewReference(viewRef) { if (typeof viewRef.sliceIndex === 'number') { this.setFrameNumber(viewRef.sliceIndex + 1); } else if (Array.isArray(viewRef.sliceIndex)) { this.setFrameRange(viewRef.sliceIndex); } } getViewReference(viewRefSpecifier) { const sliceIndex = viewRefSpecifier?.sliceIndex ?? (this.isPlaying ? this.frameRange[0] : this.getCurrentImageIdIndex()); const rangeEndSliceIndex = viewRefSpecifier?.rangeEndSliceIndex ?? (this.isPlaying ? this.frameRange[1] - 1 : undefined); const multiSliceReference = rangeEndSliceIndex > sliceIndex ? { sliceIndex: rangeEndSliceIndex, referencedImageId: this.getCurrentImageId(rangeEndSliceIndex) } : undefined; return { ...super.getViewReference(viewRefSpecifier), referencedImageId: this.getViewReferenceId(viewRefSpecifier), sliceIndex, multiSliceReference }; } getFrameNumber() { return 1 + this.getCurrentImageIdIndex(); } getCurrentImageIdIndex() { return Math.round(this.videoElement.currentTime * this.fps); } getSliceIndex() { return this.getCurrentImageIdIndex() / this.scrollSpeed; } getCamera() { const { parallelScale } = this.videoCamera; const canvasCenter = [this.element.clientWidth / 2, this.element.clientHeight / 2]; const canvasCenterWorld = this.canvasToWorld(canvasCenter); return { parallelProjection: true, focalPoint: canvasCenterWorld, position: [0, 0, 0], viewUp: [0, -1, 0], parallelScale: this.element.clientHeight / 2 / parallelScale, viewPlaneNormal: [0, 0, 1] }; } getFrameRate() { return this.fps; } getPan() { const panWorld = this.videoCamera.panWorld; return [panWorld[0], panWorld[1]]; } refreshRenderValues() { let worldToCanvasRatio = this.canvas.offsetWidth / this.videoWidth; if (this.videoHeight * worldToCanvasRatio > this.canvas.height) { worldToCanvasRatio = this.canvas.offsetHeight / this.videoHeight; } const drawWidth = Math.floor(this.videoWidth * worldToCanvasRatio); const drawHeight = Math.floor(this.videoHeight * worldToCanvasRatio); const xOffsetCanvas = (this.canvas.offsetWidth - drawWidth) / 2; const yOffsetCanvas = (this.canvas.offsetHeight - drawHeight) / 2; const xOffsetWorld = xOffsetCanvas / worldToCanvasRatio; const yOffsetWorld = yOffsetCanvas / worldToCanvasRatio; this.videoCamera.panWorld = [xOffsetWorld, yOffsetWorld]; this.videoCamera.parallelScale = worldToCanvasRatio; } getWorldToCanvasRatio() { return this.videoCamera.parallelScale; } getCanvasToWorldRatio() { return 1.0 / this.videoCamera.parallelScale; } getTransform() { const panWorld = this.videoCamera.panWorld; const devicePixelRatio = window.devicePixelRatio || 1; const worldToCanvasRatio = this.getWorldToCanvasRatio(); const canvasToWorldRatio = this.getCanvasToWorldRatio(); const halfCanvas = [this.canvas.offsetWidth / 2, this.canvas.offsetHeight / 2]; const halfCanvasWorldCoordinates = [halfCanvas[0] * canvasToWorldRatio, halfCanvas[1] * canvasToWorldRatio]; const transform = new _helpers_cpuFallback_rendering_transform__WEBPACK_IMPORTED_MODULE_6__.Transform(); transform.scale(devicePixelRatio, devicePixelRatio); transform.translate(halfCanvas[0], halfCanvas[1]); transform.scale(worldToCanvasRatio, worldToCanvasRatio); transform.translate(panWorld[0], panWorld[1]); transform.translate(-halfCanvasWorldCoordinates[0], -halfCanvasWorldCoordinates[1]); return transform; } updateCameraClippingPlanesAndRange() {} addImages(stackInputs) { const actors = this.getActors(); stackInputs.forEach(stackInput => { const { imageId, ...rest } = stackInput; const image = _cache_cache__WEBPACK_IMPORTED_MODULE_11__["default"].getImage(imageId); const imageActor = this.createActorMapper(image); const uid = stackInput.actorUID ?? (0,_utilities_uuidv4__WEBPACK_IMPORTED_MODULE_12__["default"])(); if (imageActor) { actors.push({ uid, actor: imageActor, referencedId: imageId, ...rest }); if (stackInput.callback) { stackInput.callback({ imageActor: imageActor, imageId }); } } }); this.setActors(actors); } createActorMapper(image) { return new _CanvasActor__WEBPACK_IMPORTED_MODULE_10__["default"](this, image); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (VideoViewport); /***/ }, /***/ 38589 /*!*******************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/Viewport.js ***! \*******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _kitware_vtk_js_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @kitware/vtk.js/Common/Core/MatrixBuilder */ 56345); /* harmony import */ var _kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @kitware/vtk.js/Common/Core/Math */ 52999); /* harmony import */ var _kitware_vtk_js_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @kitware/vtk.js/Common/DataModel/Plane */ 68497); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! gl-matrix */ 93067); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../enums/Events */ 14566); /* harmony import */ var _enums_ViewportStatus__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../enums/ViewportStatus */ 15247); /* harmony import */ var _enums_ViewportType__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../enums/ViewportType */ 43089); /* harmony import */ var _renderingEngineCache__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./renderingEngineCache */ 70935); /* harmony import */ var _utilities_actorCheck__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utilities/actorCheck */ 36506); /* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utilities/triggerEvent */ 91133); /* harmony import */ var _utilities_planar__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../utilities/planar */ 87229); /* harmony import */ var _utilities_isEqual__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../utilities/isEqual */ 17137); /* harmony import */ var _utilities_hasNaNValues__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../utilities/hasNaNValues */ 96718); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../constants */ 33876); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../enums */ 86461); /* harmony import */ var _utilities_deepClone__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../utilities/deepClone */ 47858); /* harmony import */ var _utilities_updatePlaneRestriction__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../utilities/updatePlaneRestriction */ 78648); /* harmony import */ var _utilities_getPlaneCubeIntersectionDimensions__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../utilities/getPlaneCubeIntersectionDimensions */ 80138); /* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../init */ 15678); class Viewport { static { this.CameraViewPresentation = { rotation: true, pan: true, zoom: true, displayArea: true }; } static { this.TransferViewPresentation = { windowLevel: true, paletteLut: true }; } constructor(props) { this.insetImageMultiplier = (0,_init__WEBPACK_IMPORTED_MODULE_20__.getConfiguration)().rendering?.useLegacyCameraFOV ? 1.1 : 1; this.flipHorizontal = false; this.flipVertical = false; this.viewportStatus = _enums_ViewportStatus__WEBPACK_IMPORTED_MODULE_7__["default"].NO_DATA; this._suppressCameraModifiedEvents = false; this.hasPixelSpacing = true; this.getProperties = () => ({}); this.setRotation = _rotation => {}; this.viewportWidgets = new Map(); this.addWidget = (widgetId, widget) => { this.viewportWidgets.set(widgetId, widget); }; this.getWidget = id => { return this.viewportWidgets.get(id); }; this.getWidgets = () => { return Array.from(this.viewportWidgets.values()); }; this.getRenderPasses = () => { return null; }; this.removeWidgets = () => { const widgets = this.getWidgets(); widgets.forEach(widget => { if (widget.getEnabled()) { widget.setEnabled(false); } if (widget.getActor && widget.getRenderer) { const actor = widget.getActor(); const renderer = widget.getRenderer(); if (renderer && actor) { renderer.removeActor(actor); } } }); }; this.id = props.id; this.renderingEngineId = props.renderingEngineId; this.type = props.type; this.element = props.element; this.canvas = props.canvas; this.sx = props.sx; this.sy = props.sy; this.sWidth = props.sWidth; this.sHeight = props.sHeight; this._actors = new Map(); this.element.setAttribute('data-viewport-uid', this.id); this.element.setAttribute('data-rendering-engine-uid', this.renderingEngineId); this.defaultOptions = (0,_utilities_deepClone__WEBPACK_IMPORTED_MODULE_17__.deepClone)(props.defaultOptions); this.suppressEvents = props.defaultOptions.suppressEvents ? props.defaultOptions.suppressEvents : false; this.options = (0,_utilities_deepClone__WEBPACK_IMPORTED_MODULE_17__.deepClone)(props.defaultOptions); this.isDisabled = false; } static get useCustomRenderingPipeline() { return false; } setRendered() { if (this.viewportStatus === _enums_ViewportStatus__WEBPACK_IMPORTED_MODULE_7__["default"].NO_DATA || this.viewportStatus === _enums_ViewportStatus__WEBPACK_IMPORTED_MODULE_7__["default"].LOADING) { return; } this.viewportStatus = _enums_ViewportStatus__WEBPACK_IMPORTED_MODULE_7__["default"].RENDERED; } setColorTransform(voiRange, averageWhite) { let feFilter = null; if (!voiRange && !averageWhite) { return; } const white = averageWhite || [255, 255, 255]; const maxWhite = Math.max(...white); const scaleWhite = white.map(c => maxWhite / c); const { lower = 0, upper = 255 } = voiRange || {}; const wlScale = (upper - lower + 1) / 255; const wlDelta = lower / 255; feFilter = `url('data:image/svg+xml,\ \ \ \ \ #colour')`; return feFilter; } getRenderingEngine() { return _renderingEngineCache__WEBPACK_IMPORTED_MODULE_9__["default"].get(this.renderingEngineId); } getRenderer() { const renderingEngine = this.getRenderingEngine(); if (!renderingEngine || renderingEngine.hasBeenDestroyed) { throw new Error('Rendering engine has been destroyed'); } return renderingEngine.offscreenMultiRenderWindow?.getRenderer(this.id); } render() { const renderingEngine = this.getRenderingEngine(); renderingEngine.renderViewport(this.id); } setOptions(options, immediate = false) { this.options = structuredClone(options); if (this.options?.displayArea) { this.setDisplayArea(this.options?.displayArea); } if (immediate) { this.render(); } } reset(immediate = false) { this.options = structuredClone(this.defaultOptions); if (immediate) { this.render(); } } getSliceViewInfo() { throw new Error('Method not implemented.'); } flip({ flipHorizontal, flipVertical }) { const imageData = this.getDefaultImageData(); if (!imageData) { return; } const camera = this.getCamera(); const { viewPlaneNormal, viewUp, focalPoint, position } = camera; const viewRight = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.cross(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), viewPlaneNormal, viewUp); let viewUpToSet = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.copy(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), viewUp); const viewPlaneNormalToSet = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.negate(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), viewPlaneNormal); const distance = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.distance(position, focalPoint); const dimensions = imageData.getDimensions(); const middleIJK = dimensions.map(d => Math.floor(d / 2)); const idx = [middleIJK[0], middleIJK[1], middleIJK[2]]; const centeredFocalPoint = imageData.indexToWorld(idx, gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create()); const resetFocalPoint = this._getFocalPointForResetCamera(centeredFocalPoint, camera, { resetPan: true, resetToCenter: false }); const panDir = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), focalPoint, resetFocalPoint); const panValue = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.length(panDir); const getPanDir = mirrorVec => { const panDirMirror = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.scale(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), mirrorVec, 2 * gl_matrix__WEBPACK_IMPORTED_MODULE_5__.dot(panDir, mirrorVec)); gl_matrix__WEBPACK_IMPORTED_MODULE_5__.subtract(panDirMirror, panDirMirror, panDir); gl_matrix__WEBPACK_IMPORTED_MODULE_5__.normalize(panDirMirror, panDirMirror); return panDirMirror; }; if (flipHorizontal) { const panDirMirror = getPanDir(viewUpToSet); const newFocalPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.scaleAndAdd(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), resetFocalPoint, panDirMirror, panValue); const newPosition = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.scaleAndAdd(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), newFocalPoint, viewPlaneNormalToSet, distance); this.setCamera({ viewPlaneNormal: viewPlaneNormalToSet, position: newPosition, focalPoint: newFocalPoint }); this.flipHorizontal = !this.flipHorizontal; } if (flipVertical) { viewUpToSet = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.negate(viewUpToSet, viewUp); const panDirMirror = getPanDir(viewRight); const newFocalPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.scaleAndAdd(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), resetFocalPoint, panDirMirror, panValue); const newPosition = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.scaleAndAdd(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), newFocalPoint, viewPlaneNormalToSet, distance); this.setCamera({ focalPoint: newFocalPoint, viewPlaneNormal: viewPlaneNormalToSet, viewUp: viewUpToSet, position: newPosition }); this.flipVertical = !this.flipVertical; } this.render(); } getDefaultImageData() { const actorEntry = this.getDefaultActor(); if (actorEntry && (0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_10__.isImageActor)(actorEntry)) { return actorEntry.actor.getMapper().getInputData(); } } getDefaultActor() { return this.getActors()[0]; } getActors() { return Array.from(this._actors.values()); } getActorUIDs() { return Array.from(this._actors.keys()); } getActor(actorUID) { return this._actors.get(actorUID); } getImageActor(volumeId) { const actorEntries = this.getActors(); let actorEntry = actorEntries[0]; if (volumeId) { actorEntry = actorEntries.find(a => a.referencedId === volumeId); } if (!actorEntry || !(0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_10__.isImageActor)(actorEntry)) { return null; } const actor = actorEntry.actor; return actor; } getActorUIDByIndex(index) { const actor = this.getActors()[index]; if (actor) { return actor.uid; } } getActorByIndex(index) { return this.getActors()[index]; } setActors(actors) { const currentActors = this.getActors(); this.removeAllActors(); this.addActors(actors, { resetCamera: true }); (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_11__["default"])(this.element, _enums_Events__WEBPACK_IMPORTED_MODULE_6__["default"].ACTORS_CHANGED, { viewportId: this.id, removedActors: currentActors, addedActors: actors, currentActors: actors }); } _removeActor(actorUID) { const actorEntry = this.getActor(actorUID); if (!actorEntry) { console.warn(`Actor ${actorUID} does not exist in ${this.id}, can't remove`); return; } const renderer = this.getRenderer(); renderer.removeActor(actorEntry.actor); this._actors.delete(actorUID); return actorEntry; } removeActors(actorUIDs) { const removedActors = []; actorUIDs.forEach(actorUID => { const removedActor = this._removeActor(actorUID); if (removedActor) { removedActors.push(removedActor); } }); const currentActors = this.getActors(); (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_11__["default"])(this.element, _enums_Events__WEBPACK_IMPORTED_MODULE_6__["default"].ACTORS_CHANGED, { viewportId: this.id, removedActors, addedActors: [], currentActors }); } addActors(actors, options = {}) { const { resetCamera = false } = options; const renderingEngine = this.getRenderingEngine(); if (!renderingEngine || renderingEngine.hasBeenDestroyed) { console.warn('Viewport::addActors::Rendering engine has not been initialized or has been destroyed'); return; } actors.forEach(actor => { this.addActor(actor); }); if (!resetCamera) { const prevViewPresentation = this.getViewPresentation(); const prevViewRef = this.getViewReference(); this.resetCamera(); this.setViewReference(prevViewRef); this.setViewPresentation(prevViewPresentation); } else { this.resetCamera(); } (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_11__["default"])(this.element, _enums_Events__WEBPACK_IMPORTED_MODULE_6__["default"].ACTORS_CHANGED, { viewportId: this.id, removedActors: [], addedActors: actors, currentActors: this.getActors() }); } addActor(actorEntry) { const { uid: actorUID, actor } = actorEntry; const renderingEngine = this.getRenderingEngine(); if (!renderingEngine || renderingEngine.hasBeenDestroyed) { console.warn(`Cannot add actor UID of ${actorUID} Rendering Engine has been destroyed`); return; } if (!actorUID || !actor) { throw new Error('Actors should have uid and vtk Actor properties'); } if (this.getActor(actorUID)) { console.warn(`Actor ${actorUID} already exists for this viewport`); return; } const renderer = this.getRenderer(); renderer?.addActor(actor); this._actors.set(actorUID, Object.assign({}, actorEntry)); this.updateCameraClippingPlanesAndRange(); (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_11__["default"])(this.element, _enums_Events__WEBPACK_IMPORTED_MODULE_6__["default"].ACTORS_CHANGED, { viewportId: this.id, removedActors: [], addedActors: [actorEntry], currentActors: this.getActors() }); } removeAllActors() { const currentActors = this.getActors(); this.getRenderer()?.removeAllViewProps(); this._actors = new Map(); (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_11__["default"])(this.element, _enums_Events__WEBPACK_IMPORTED_MODULE_6__["default"].ACTORS_CHANGED, { viewportId: this.id, removedActors: currentActors, addedActors: [], currentActors: [] }); return; } resetCameraNoEvent() { const savedValue = this._suppressCameraModifiedEvents; this._suppressCameraModifiedEvents = true; this.resetCamera(); this._suppressCameraModifiedEvents = savedValue; } setCameraNoEvent(camera) { const savedValue = this._suppressCameraModifiedEvents; this._suppressCameraModifiedEvents = true; this.setCamera(camera); this._suppressCameraModifiedEvents = savedValue; } _getViewImageDataIntersections(imageData, focalPoint, normal) { const A = normal[0]; const B = normal[1]; const C = normal[2]; const D = A * focalPoint[0] + B * focalPoint[1] + C * focalPoint[2]; const bounds = imageData.getBounds(); const edges = this._getEdges(bounds); const intersections = []; for (const edge of edges) { const [[x0, y0, z0], [x1, y1, z1]] = edge; if (A * (x1 - x0) + B * (y1 - y0) + C * (z1 - z0) === 0) { continue; } const intersectionPoint = _utilities_planar__WEBPACK_IMPORTED_MODULE_12__.linePlaneIntersection([x0, y0, z0], [x1, y1, z1], [A, B, C, D]); if (this._isInBounds(intersectionPoint, bounds)) { intersections.push(intersectionPoint); } } return intersections; } setInterpolationType(_interpolationType, _arg) {} setDisplayArea(displayArea, suppressEvents = false) { if (!displayArea) { return; } const { storeAsInitialCamera, type: areaType } = displayArea; if (storeAsInitialCamera) { this.options.displayArea = displayArea; } const { _suppressCameraModifiedEvents } = this; this._suppressCameraModifiedEvents = true; this.setCamera(this.fitToCanvasCamera); if (areaType === 'SCALE') { this.setDisplayAreaScale(displayArea); } else { this.setInterpolationType(this.getProperties()?.interpolationType ?? _enums__WEBPACK_IMPORTED_MODULE_16__["default"].LINEAR); this.setDisplayAreaFit(displayArea); } if (storeAsInitialCamera) { this.initialCamera = this.getCamera(); } this._suppressCameraModifiedEvents = _suppressCameraModifiedEvents; if (!suppressEvents && !_suppressCameraModifiedEvents) { const eventDetail = { viewportId: this.id, displayArea: displayArea, storeAsInitialCamera: storeAsInitialCamera }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_11__["default"])(this.element, _enums_Events__WEBPACK_IMPORTED_MODULE_6__["default"].DISPLAY_AREA_MODIFIED, eventDetail); this.setCamera(this.getCamera()); } } setDisplayAreaScale(displayArea) { const { scale = 1 } = displayArea; const canvas = this.canvas; const height = canvas.height; const width = canvas.width; if (height < 8 || width < 8) { return; } const imageData = this.getDefaultImageData(); const spacingWorld = imageData.getSpacing(); const spacing = spacingWorld[1]; this.setInterpolationType(_enums__WEBPACK_IMPORTED_MODULE_16__["default"].NEAREST); this.setCamera({ parallelScale: height * spacing / (2 * scale) }); delete displayArea.imageArea; this.setDisplayAreaFit(displayArea); const { focalPoint, position, viewUp, viewPlaneNormal } = this.getCamera(); const focalChange = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(); if (canvas.height % 2) { gl_matrix__WEBPACK_IMPORTED_MODULE_5__.scaleAndAdd(focalChange, focalChange, viewUp, scale * 0.5 * spacing); } if (canvas.width % 2) { const viewRight = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.cross(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), viewUp, viewPlaneNormal); gl_matrix__WEBPACK_IMPORTED_MODULE_5__.scaleAndAdd(focalChange, focalChange, viewRight, scale * 0.5 * spacing); } if (!focalChange[0] && !focalChange[1] && !focalChange[2]) { return; } this.setCamera({ focalPoint: gl_matrix__WEBPACK_IMPORTED_MODULE_5__.add(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), focalPoint, focalChange), position: gl_matrix__WEBPACK_IMPORTED_MODULE_5__.add(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), position, focalChange) }); } setDisplayAreaFit(displayArea) { const { imageArea, imageCanvasPoint } = displayArea; const devicePixelRatio = window?.devicePixelRatio || 1; const imageData = this.getDefaultImageData(); if (!imageData) { return; } const canvasWidth = this.sWidth / devicePixelRatio; const canvasHeight = this.sHeight / devicePixelRatio; const dimensions = imageData.getDimensions(); const canvasZero = this.worldToCanvas(imageData.indexToWorld([0, 0, 0])); const canvasEdge = this.worldToCanvas(imageData.indexToWorld([dimensions[0], dimensions[1], dimensions[2]])); const canvasImage = [Math.abs(canvasEdge[0] - canvasZero[0]), Math.abs(canvasEdge[1] - canvasZero[1])]; const [imgWidth, imgHeight] = canvasImage; let zoom = this.getZoom() / this.insetImageMultiplier; if (imageArea) { const [areaX, areaY] = imageArea; const currentScale = Math.max(Math.abs(imgWidth / canvasWidth), Math.abs(imgHeight / canvasHeight)); const requireX = Math.abs(areaX * imgWidth / canvasWidth); const requireY = Math.abs(areaY * imgHeight / canvasHeight); const initZoom = this.getZoom(); const fitZoom = this.getZoom(this.fitToCanvasCamera); const absZoom = requireX > requireY ? currentScale / requireX : currentScale / requireY; const applyZoom = absZoom * initZoom / fitZoom; zoom = applyZoom; this.setZoom(this.insetImageMultiplier * zoom, false); } if (imageCanvasPoint) { const { imagePoint, canvasPoint = imagePoint || [0.5, 0.5] } = imageCanvasPoint; const [canvasX, canvasY] = canvasPoint; const canvasPanX = canvasWidth * (canvasX - 0.5); const canvasPanY = canvasHeight * (canvasY - 0.5); const [imageX, imageY] = imagePoint || canvasPoint; const useZoom = zoom; const imagePanX = this.insetImageMultiplier * useZoom * imgWidth * (0.5 - imageX); const imagePanY = this.insetImageMultiplier * useZoom * imgHeight * (0.5 - imageY); const newPositionX = imagePanX + canvasPanX; const newPositionY = imagePanY + canvasPanY; const deltaPoint2 = [newPositionX, newPositionY]; gl_matrix__WEBPACK_IMPORTED_MODULE_4__.add(deltaPoint2, deltaPoint2, this.getPan()); this.setPan(deltaPoint2, false); } } getDisplayArea() { return this.options?.displayArea; } resetCamera(options) { const { resetPan = true, resetZoom = true, resetToCenter = true, storeAsInitialCamera = true } = options || {}; const renderer = this.getRenderer(); this.setCameraNoEvent({ flipHorizontal: false, flipVertical: false }); const previousCamera = this.getCamera(); let bounds; const defaultActor = this.getDefaultActor(); if (defaultActor && (0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_10__.isImageActor)(defaultActor)) { const imageData = defaultActor.actor.getMapper().getInputData(); bounds = imageData.getBounds(); } else { bounds = renderer.computeVisiblePropBounds(); } const focalPoint = [0, 0, 0]; const imageData = this.getDefaultImageData(); const activeCamera = this.getVtkActiveCamera(); const viewPlaneNormal = activeCamera.getViewPlaneNormal(); const viewUp = activeCamera.getViewUp(); focalPoint[0] = (bounds[0] + bounds[1]) / 2.0; focalPoint[1] = (bounds[2] + bounds[3]) / 2.0; focalPoint[2] = (bounds[4] + bounds[5]) / 2.0; if (imageData) { const dimensions = imageData.getDimensions(); const middleIJK = dimensions.map(d => Math.floor(d / 2)); const idx = [middleIJK[0], middleIJK[1], middleIJK[2]]; imageData.indexToWorld(idx, focalPoint); } let { widthWorld, heightWorld } = imageData ? (0,_utilities_getPlaneCubeIntersectionDimensions__WEBPACK_IMPORTED_MODULE_19__.getCubeSizeInView)(imageData, viewPlaneNormal, viewUp) : this._getWorldDistanceViewUpAndViewRight(bounds, viewUp, viewPlaneNormal); if (imageData) { const spacing = imageData.getSpacing(); widthWorld = Math.max(spacing[0], widthWorld - spacing[0]); heightWorld = Math.max(spacing[1], heightWorld - spacing[1]); } const canvasSize = [this.sWidth, this.sHeight]; const boundsAspectRatio = widthWorld / heightWorld; const canvasAspectRatio = canvasSize[0] / canvasSize[1]; const scaleFactor = boundsAspectRatio / canvasAspectRatio; const parallelScale = scaleFactor < 1 ? this.insetImageMultiplier * heightWorld / 2 : this.insetImageMultiplier * heightWorld * scaleFactor / 2; const radius = Viewport.boundsRadius(bounds) * (this.type === _enums_ViewportType__WEBPACK_IMPORTED_MODULE_8__["default"].VOLUME_3D ? 10 : 1); const distance = this.insetImageMultiplier * radius; const viewUpToSet = Math.abs(_kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__["default"].dot(viewUp, viewPlaneNormal)) > 0.999 ? [-viewUp[2], viewUp[0], viewUp[1]] : viewUp; const focalPointToSet = this._getFocalPointForResetCamera(focalPoint, previousCamera, { resetPan, resetToCenter }); const positionToSet = [focalPointToSet[0] + distance * viewPlaneNormal[0], focalPointToSet[1] + distance * viewPlaneNormal[1], focalPointToSet[2] + distance * viewPlaneNormal[2]]; renderer.resetCameraClippingRange(bounds); const clippingRangeToUse = [-_constants__WEBPACK_IMPORTED_MODULE_15__["default"].MAXIMUM_RAY_DISTANCE, _constants__WEBPACK_IMPORTED_MODULE_15__["default"].MAXIMUM_RAY_DISTANCE]; activeCamera.setPhysicalScale(radius); activeCamera.setPhysicalTranslation(-focalPointToSet[0], -focalPointToSet[1], -focalPointToSet[2]); this.setCamera({ parallelScale: resetZoom ? parallelScale : previousCamera.parallelScale, focalPoint: focalPointToSet, position: positionToSet, viewAngle: 90, viewUp: viewUpToSet, clippingRange: clippingRangeToUse }); const modifiedCamera = this.getCamera(); this.setFitToCanvasCamera(this.getCamera()); if (storeAsInitialCamera) { this.setInitialCamera(modifiedCamera); } if (resetZoom) { this.setZoom(1, storeAsInitialCamera); } const RESET_CAMERA_EVENT = { type: 'ResetCameraEvent', renderer }; renderer.invokeEvent(RESET_CAMERA_EVENT); this.triggerCameraModifiedEventIfNecessary(previousCamera, modifiedCamera); if (imageData && this.options.displayArea && resetZoom && resetPan && resetToCenter) { this.setDisplayArea(this.options.displayArea); } return true; } setInitialCamera(camera) { this.initialCamera = camera; } setFitToCanvasCamera(camera) { this.fitToCanvasCamera = camera; } getPan(initialCamera = this.initialCamera) { if (!initialCamera) { return [0, 0]; } const activeCamera = this.getVtkActiveCamera(); const focalPoint = activeCamera.getFocalPoint(); const zero3 = this.canvasToWorld([0, 0]); const initialCanvasFocal = this.worldToCanvas(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.subtract([0, 0, 0], initialCamera.focalPoint, zero3)); const currentCanvasFocal = this.worldToCanvas(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.subtract([0, 0, 0], focalPoint, zero3)); const result = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.subtract([0, 0], initialCanvasFocal, currentCanvasFocal); return result; } getCurrentImageIdIndex() { throw new Error('Not implemented'); } getSliceIndex() { throw new Error('Not implemented'); } getImageData() { throw new Error('Not implemented'); } getViewReferenceId(_specifier) { return null; } setPan(pan, storeAsInitialCamera = false) { const previousCamera = this.getCamera(); const { focalPoint, position } = previousCamera; const zero3 = this.canvasToWorld([0, 0]); const delta2 = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.subtract([0, 0], pan, this.getPan()); if (Math.abs(delta2[0]) < 1 && Math.abs(delta2[1]) < 1 && !storeAsInitialCamera) { return; } const delta = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), this.canvasToWorld(delta2), zero3); const newFocal = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), focalPoint, delta); const newPosition = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), position, delta); this.setCamera({ ...previousCamera, focalPoint: newFocal, position: newPosition }, storeAsInitialCamera); } getZoom(compareCamera = this.initialCamera) { if (!compareCamera) { return 1; } const activeCamera = this.getVtkActiveCamera(); const { parallelScale: initialParallelScale } = compareCamera; return initialParallelScale / activeCamera.getParallelScale(); } setZoom(value, storeAsInitialCamera = false) { const camera = this.getCamera(); const { parallelScale: initialParallelScale } = this.initialCamera; const parallelScale = initialParallelScale / value; if (camera.parallelScale === parallelScale && !storeAsInitialCamera) { return; } this.setCamera({ ...camera, parallelScale }, storeAsInitialCamera); } _getFocalPointForViewPlaneReset(imageData) { const { focalPoint, viewPlaneNormal: normal } = this.getCamera(); const intersections = this._getViewImageDataIntersections(imageData, focalPoint, normal); let x = 0; let y = 0; let z = 0; intersections.forEach(([point_x, point_y, point_z]) => { x += point_x; y += point_y; z += point_z; }); const newFocalPoint = [x / intersections.length, y / intersections.length, z / intersections.length]; return newFocalPoint; } getCanvas() { return this.canvas; } getVtkActiveCamera() { const renderer = this.getRenderer(); if (!renderer) { console.warn('No renderer found for the viewport'); return null; } return renderer.getActiveCamera(); } getCameraNoRotation() { const vtkCamera = this.getVtkActiveCamera(); const sanitizeVector = (vector, defaultValue) => { return vector.some(v => isNaN(v)) ? defaultValue : vector; }; const viewUp = sanitizeVector([...vtkCamera.getViewUp()], [0, 1, 0]); const viewPlaneNormal = sanitizeVector([...vtkCamera.getViewPlaneNormal()], [0, 0, -1]); const position = sanitizeVector([...vtkCamera.getPosition()], [0, 0, 1]); const focalPoint = sanitizeVector([...vtkCamera.getFocalPoint()], [0, 0, 0]); return { viewUp, viewPlaneNormal, position, focalPoint, parallelProjection: vtkCamera.getParallelProjection(), parallelScale: vtkCamera.getParallelScale(), viewAngle: vtkCamera.getViewAngle(), flipHorizontal: this.flipHorizontal, flipVertical: this.flipVertical }; } getCamera() { const camera = this.getCameraNoRotation(); return { ...camera, rotation: this.getRotation() }; } setCamera(cameraInterface, storeAsInitialCamera = false) { const vtkCamera = this.getVtkActiveCamera(); const previousCamera = this.getCamera(); const updatedCamera = Object.assign({}, previousCamera, cameraInterface); const { viewUp, viewPlaneNormal, position, focalPoint, parallelScale, viewAngle, flipHorizontal, flipVertical, clippingRange } = cameraInterface; if (flipHorizontal !== undefined) { const flipH = flipHorizontal && !this.flipHorizontal || !flipHorizontal && this.flipHorizontal; if (flipH) { this.flip({ flipHorizontal: flipH }); } } if (flipVertical !== undefined) { const flipV = flipVertical && !this.flipVertical || !flipVertical && this.flipVertical; if (flipV) { this.flip({ flipVertical: flipV }); } } if (viewUp !== undefined) { vtkCamera.setViewUp(viewUp); } if (viewPlaneNormal !== undefined) { vtkCamera.setDirectionOfProjection(-viewPlaneNormal[0], -viewPlaneNormal[1], -viewPlaneNormal[2]); } if (position !== undefined) { vtkCamera.setPosition(...position); } if (focalPoint !== undefined) { vtkCamera.setFocalPoint(...focalPoint); } if (parallelScale !== undefined) { vtkCamera.setParallelScale(parallelScale); } if (viewAngle !== undefined) { vtkCamera.setViewAngle(viewAngle); } if (clippingRange !== undefined) { vtkCamera.setClippingRange(clippingRange); } const prevFocalPoint = previousCamera.focalPoint; const prevViewUp = previousCamera.viewUp; if (prevFocalPoint && focalPoint || prevViewUp && viewUp) { const currentViewPlaneNormal = vtkCamera.getViewPlaneNormal(); const currentViewUp = vtkCamera.getViewUp(); let cameraModifiedOutOfPlane = false; let viewUpHasChanged = false; if (focalPoint) { const deltaCamera = [focalPoint[0] - prevFocalPoint[0], focalPoint[1] - prevFocalPoint[1], focalPoint[2] - prevFocalPoint[2]]; cameraModifiedOutOfPlane = Math.abs(_kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__["default"].dot(deltaCamera, currentViewPlaneNormal)) > 0; } if (viewUp) { viewUpHasChanged = !(0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_13__["default"])(currentViewUp, prevViewUp); } if (cameraModifiedOutOfPlane || viewUpHasChanged) { const actorEntry = this.getDefaultActor(); if (!actorEntry?.actor) { return; } if (!(0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_10__.actorIsA)(actorEntry, 'vtkActor')) { this.updateClippingPlanesForActors(updatedCamera); } if ((0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_10__.actorIsA)(actorEntry, 'vtkImageSlice') || this.type === _enums_ViewportType__WEBPACK_IMPORTED_MODULE_8__["default"].VOLUME_3D) { const renderer = this.getRenderer(); renderer.resetCameraClippingRange(); } } } if (storeAsInitialCamera) { this.setInitialCamera(updatedCamera); } this.triggerCameraModifiedEventIfNecessary(previousCamera, this.getCamera()); } triggerCameraModifiedEventIfNecessary(previousCamera, updatedCamera) { if (!this._suppressCameraModifiedEvents && !this.suppressEvents) { const eventDetail = { previousCamera, camera: updatedCamera, element: this.element, viewportId: this.id, renderingEngineId: this.renderingEngineId }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_11__["default"])(this.element, _enums_Events__WEBPACK_IMPORTED_MODULE_6__["default"].CAMERA_MODIFIED, eventDetail); } } updateCameraClippingPlanesAndRange() { const currentCamera = this.getCamera(); this.updateClippingPlanesForActors(currentCamera); this.getRenderer().resetCameraClippingRange(); } updateClippingPlanesForActors(updatedCamera) { var _this = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { const actorEntries = _this.getActors(); actorEntries.map(actorEntry => { if (!actorEntry.actor) { return; } const mapper = actorEntry.actor.getMapper(); let vtkPlanes = actorEntry?.clippingFilter ? actorEntry?.clippingFilter.getClippingPlanes() : mapper.getClippingPlanes(); if (vtkPlanes.length === 0 && actorEntry?.clippingFilter) { vtkPlanes = [_kitware_vtk_js_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_3__["default"].newInstance(), _kitware_vtk_js_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_3__["default"].newInstance()]; } let slabThickness = _constants__WEBPACK_IMPORTED_MODULE_15__["default"].MINIMUM_SLAB_THICKNESS; if (actorEntry.slabThickness) { slabThickness = actorEntry.slabThickness; } const { viewPlaneNormal, focalPoint } = updatedCamera; _this.setOrientationOfClippingPlanes(vtkPlanes, slabThickness, viewPlaneNormal, focalPoint); (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_11__["default"])(_this.element, _enums_Events__WEBPACK_IMPORTED_MODULE_6__["default"].CLIPPING_PLANES_UPDATED, { actorEntry, focalPoint, vtkPlanes, viewport: _this }); }); })(); } setOrientationOfClippingPlanes(vtkPlanes, slabThickness, viewPlaneNormal, focalPoint) { if (vtkPlanes.length < 2) { return; } const scaledDistance = [viewPlaneNormal[0], viewPlaneNormal[1], viewPlaneNormal[2]]; _kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__["default"].multiplyScalar(scaledDistance, slabThickness); vtkPlanes[0].setNormal(viewPlaneNormal); const newOrigin1 = [0, 0, 0]; _kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__["default"].subtract(focalPoint, scaledDistance, newOrigin1); vtkPlanes[0].setOrigin(newOrigin1); vtkPlanes[1].setNormal(-viewPlaneNormal[0], -viewPlaneNormal[1], -viewPlaneNormal[2]); const newOrigin2 = [0, 0, 0]; _kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__["default"].add(focalPoint, scaledDistance, newOrigin2); vtkPlanes[1].setOrigin(newOrigin2); } getClippingPlanesForActor(actorEntry) { if (!actorEntry) { actorEntry = this.getDefaultActor(); } if (!actorEntry.actor) { throw new Error('Invalid actor entry: Actor is undefined'); } const mapper = actorEntry.actor.getMapper(); let vtkPlanes = actorEntry?.clippingFilter ? actorEntry?.clippingFilter.getClippingPlanes() : mapper.getClippingPlanes(); if (vtkPlanes.length === 0 && actorEntry?.clippingFilter) { vtkPlanes = [_kitware_vtk_js_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_3__["default"].newInstance(), _kitware_vtk_js_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_3__["default"].newInstance()]; } return vtkPlanes; } _getWorldDistanceViewUpAndViewRight(bounds, viewUp, viewPlaneNormal) { const viewUpCorners = this._getCorners(bounds); const viewRightCorners = this._getCorners(bounds); const viewRight = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.cross(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), viewUp, viewPlaneNormal); let transform = _kitware_vtk_js_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_1__["default"].buildFromDegree().identity().rotateFromDirections(viewUp, [1, 0, 0]); viewUpCorners.forEach(pt => transform.apply(pt)); let minY = Infinity; let maxY = -Infinity; for (let i = 0; i < 8; i++) { const y = viewUpCorners[i][0]; if (y > maxY) { maxY = y; } if (y < minY) { minY = y; } } transform = _kitware_vtk_js_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_1__["default"].buildFromDegree().identity().rotateFromDirections([viewRight[0], viewRight[1], viewRight[2]], [1, 0, 0]); viewRightCorners.forEach(pt => transform.apply(pt)); let minX = Infinity; let maxX = -Infinity; for (let i = 0; i < 8; i++) { const x = viewRightCorners[i][0]; if (x > maxX) { maxX = x; } if (x < minX) { minX = x; } } return { widthWorld: maxX - minX, heightWorld: maxY - minY }; } getViewReference(viewRefSpecifier) { const { focalPoint: cameraFocalPoint, viewPlaneNormal, viewUp } = this.getCamera(); const FrameOfReferenceUID = this.getFrameOfReferenceUID(); const target = { FrameOfReferenceUID, cameraFocalPoint, viewPlaneNormal, viewUp, sliceIndex: viewRefSpecifier?.sliceIndex ?? this.getSliceIndex(), planeRestriction: { FrameOfReferenceUID, point: viewRefSpecifier?.points?.[0] || cameraFocalPoint, inPlaneVector1: viewUp, inPlaneVector2: gl_matrix__WEBPACK_IMPORTED_MODULE_5__.cross(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), viewUp, viewPlaneNormal) } }; if (viewRefSpecifier?.points) { (0,_utilities_updatePlaneRestriction__WEBPACK_IMPORTED_MODULE_18__.updatePlaneRestriction)(viewRefSpecifier.points, target.planeRestriction); } return target; } isPlaneViewable(planeRestriction, options) { if (planeRestriction.FrameOfReferenceUID !== this.getFrameOfReferenceUID()) { return false; } const { focalPoint, viewPlaneNormal } = this.getCamera(); const { point, inPlaneVector1, inPlaneVector2 } = planeRestriction; if (options?.withOrientation) { return true; } if (inPlaneVector1 && !(0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_13__["default"])(0, gl_matrix__WEBPACK_IMPORTED_MODULE_5__.dot(viewPlaneNormal, inPlaneVector1))) { return false; } if (inPlaneVector2 && !(0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_13__["default"])(0, gl_matrix__WEBPACK_IMPORTED_MODULE_5__.dot(viewPlaneNormal, inPlaneVector2))) { return false; } if (options?.withNavigation) { return true; } const pointVector = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.sub(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), point, focalPoint); return (0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_13__["default"])(0, gl_matrix__WEBPACK_IMPORTED_MODULE_5__.dot(pointVector, viewPlaneNormal)); } isReferenceViewable(viewRef, options) { if (viewRef.planeRestriction) { return this.isPlaneViewable(viewRef.planeRestriction, options); } if (viewRef.FrameOfReferenceUID && viewRef.FrameOfReferenceUID !== this.getFrameOfReferenceUID()) { return false; } const { viewPlaneNormal } = viewRef; const camera = this.getCamera(); if (viewPlaneNormal && !(0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_13__["default"])(viewPlaneNormal, camera.viewPlaneNormal) && !(0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_13__["default"])(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.negate(camera.viewPlaneNormal, camera.viewPlaneNormal), viewPlaneNormal)) { return options?.withOrientation; } return true; } getViewPresentation(viewPresSel = { rotation: true, displayArea: true, zoom: true, pan: true, flipHorizontal: true, flipVertical: true }) { const target = {}; const { rotation, displayArea, zoom, pan, flipHorizontal, flipVertical } = viewPresSel; if (rotation) { target.rotation = this.getRotation(); } if (displayArea) { target.displayArea = this.getDisplayArea(); } const initZoom = this.getZoom(); if (zoom) { target.zoom = initZoom; } if (pan) { target.pan = this.getPan(); gl_matrix__WEBPACK_IMPORTED_MODULE_4__.scale(target.pan, target.pan, 1 / initZoom); } if (flipHorizontal) { target.flipHorizontal = this.flipHorizontal; } if (flipVertical) { target.flipVertical = this.flipVertical; } return target; } setViewReference(viewRef) {} setViewPresentation(viewPres) { if (!viewPres) { return; } const { displayArea, zoom = this.getZoom(), pan, rotation, flipHorizontal = this.flipHorizontal, flipVertical = this.flipVertical } = viewPres; if (displayArea !== this.getDisplayArea()) { this.setDisplayArea(displayArea); } this.setZoom(zoom); if (pan) { this.setPan(gl_matrix__WEBPACK_IMPORTED_MODULE_4__.scale([0, 0], pan, zoom)); } if (flipHorizontal !== undefined && flipHorizontal !== this.flipHorizontal) { this.flip({ flipHorizontal }); } if (flipVertical !== undefined && flipVertical !== this.flipVertical) { this.flip({ flipVertical }); } if (rotation >= 0) { this.setRotation(rotation); } } _getCorners(bounds) { return [[bounds[0], bounds[2], bounds[4]], [bounds[0], bounds[2], bounds[5]], [bounds[0], bounds[3], bounds[4]], [bounds[0], bounds[3], bounds[5]], [bounds[1], bounds[2], bounds[4]], [bounds[1], bounds[2], bounds[5]], [bounds[1], bounds[3], bounds[4]], [bounds[1], bounds[3], bounds[5]]]; } _getFocalPointForResetCamera(centeredFocalPoint, previousCamera, { resetPan = true, resetToCenter = true }) { if (resetToCenter && resetPan) { return centeredFocalPoint; } if (resetToCenter && !resetPan) { return (0,_utilities_hasNaNValues__WEBPACK_IMPORTED_MODULE_14__["default"])(previousCamera.focalPoint) ? centeredFocalPoint : previousCamera.focalPoint; } if (!resetToCenter && resetPan) { const oldCamera = previousCamera; const oldFocalPoint = oldCamera.focalPoint; const oldViewPlaneNormal = oldCamera.viewPlaneNormal; const vectorFromOldFocalPointToCenteredFocalPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), centeredFocalPoint, oldFocalPoint); const distanceFromOldFocalPointToCenteredFocalPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.dot(vectorFromOldFocalPointToCenteredFocalPoint, oldViewPlaneNormal); const newFocalPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_5__.scaleAndAdd(gl_matrix__WEBPACK_IMPORTED_MODULE_5__.create(), centeredFocalPoint, oldViewPlaneNormal, -1 * distanceFromOldFocalPointToCenteredFocalPoint); return [newFocalPoint[0], newFocalPoint[1], newFocalPoint[2]]; } if (!resetPan && !resetToCenter) { return (0,_utilities_hasNaNValues__WEBPACK_IMPORTED_MODULE_14__["default"])(previousCamera.focalPoint) ? centeredFocalPoint : previousCamera.focalPoint; } } _isInBounds(point, bounds) { const [xMin, xMax, yMin, yMax, zMin, zMax] = bounds; const [x, y, z] = point; if (x < xMin || x > xMax || y < yMin || y > yMax || z < zMin || z > zMax) { return false; } return true; } _getEdges(bounds) { const [p1, p2, p3, p4, p5, p6, p7, p8] = this._getCorners(bounds); return [[p1, p2], [p1, p5], [p1, p3], [p2, p4], [p2, p6], [p3, p4], [p3, p7], [p4, p8], [p5, p7], [p5, p6], [p6, p8], [p7, p8]]; } static boundsRadius(bounds) { const w1 = (bounds[1] - bounds[0]) ** 2; const w2 = (bounds[3] - bounds[2]) ** 2; const w3 = (bounds[5] - bounds[4]) ** 2; const radius = Math.sqrt(w1 + w2 + w3 || 1) * 0.5; return radius; } setDataIds(_imageIds, _options) { throw new Error('Unsupported operatoin setDataIds'); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Viewport); /***/ }, /***/ 93667 /*!*************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/VolumeViewport.js ***! \*************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! gl-matrix */ 95329); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _kitware_vtk_js_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @kitware/vtk.js/Common/DataModel/Plane */ 68497); /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../cache/cache */ 38277); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../constants */ 33876); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../constants */ 19050); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../constants */ 50260); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../enums */ 14566); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../enums */ 80600); /* harmony import */ var _utilities_actorCheck__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utilities/actorCheck */ 36506); /* harmony import */ var _utilities_getClosestImageId__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utilities/getClosestImageId */ 61200); /* harmony import */ var _utilities_getSliceRange__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../utilities/getSliceRange */ 39790); /* harmony import */ var _utilities_getSpacingInNormalDirection__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../utilities/getSpacingInNormalDirection */ 7127); /* harmony import */ var _utilities_snapFocalPointToSlice__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../utilities/snapFocalPointToSlice */ 40579); /* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../utilities/triggerEvent */ 91133); /* harmony import */ var _BaseVolumeViewport__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./BaseVolumeViewport */ 19401); /* harmony import */ var _helpers_setDefaultVolumeVOI__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./helpers/setDefaultVolumeVOI */ 38198); /* harmony import */ var _utilities_transferFunctionUtils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../utilities/transferFunctionUtils */ 19813); /* harmony import */ var _utilities_getImageSliceDataForVolumeViewport__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../utilities/getImageSliceDataForVolumeViewport */ 84081); /* harmony import */ var _utilities_transformCanvasToIJK__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../utilities/transformCanvasToIJK */ 81594); /* harmony import */ var _utilities_transformIJKToCanvas__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../utilities/transformIJKToCanvas */ 2952); /* harmony import */ var _utilities_getVolumeViewportScrollInfo__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../utilities/getVolumeViewportScrollInfo */ 15376); /* harmony import */ var _helpers_getCameraVectors__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./helpers/getCameraVectors */ 14488); class VolumeViewport extends _BaseVolumeViewport__WEBPACK_IMPORTED_MODULE_16__["default"] { constructor(props) { super(props); this._useAcquisitionPlaneForViewPlane = false; this.getNumberOfSlices = () => { const { numberOfSlices } = (0,_utilities_getImageSliceDataForVolumeViewport__WEBPACK_IMPORTED_MODULE_19__["default"])(this) || {}; return numberOfSlices; }; this.resetCameraForResize = () => { return this.resetCamera({ resetPan: true, resetZoom: true, resetToCenter: true, resetRotation: false, suppressEvents: true }); }; this.getCurrentImageIdIndex = (volumeId = this.getVolumeId(), useSlabThickness = true) => { if (!volumeId) { return 0; } const { currentStepIndex } = (0,_utilities_getVolumeViewportScrollInfo__WEBPACK_IMPORTED_MODULE_22__["default"])(this, volumeId, useSlabThickness); return currentStepIndex; }; this.getSliceIndex = () => { const { imageIndex } = (0,_utilities_getImageSliceDataForVolumeViewport__WEBPACK_IMPORTED_MODULE_19__["default"])(this) || {}; return imageIndex; }; this.getCurrentImageId = () => { const actorEntry = this.getDefaultActor(); if (!actorEntry || !(0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_10__.actorIsA)(actorEntry, 'vtkVolume')) { return; } const volume = _cache_cache__WEBPACK_IMPORTED_MODULE_4__["default"].getVolume(this.getVolumeId()); if (!volume) { return; } const { viewPlaneNormal, focalPoint } = this.getCamera(); return (0,_utilities_getClosestImageId__WEBPACK_IMPORTED_MODULE_11__["default"])(volume, focalPoint, viewPlaneNormal); }; this.getSlicePlaneCoordinates = () => { const actorEntry = this.getDefaultActor(); if (!actorEntry?.actor) { console.warn('No image data found for calculating vtkPlanes.'); return []; } const volumeId = this.getVolumeId(); const imageVolume = _cache_cache__WEBPACK_IMPORTED_MODULE_4__["default"].getVolume(volumeId); const camera = this.getCamera(); const { focalPoint, position, viewPlaneNormal } = camera; const spacingInNormalDirection = (0,_utilities_getSpacingInNormalDirection__WEBPACK_IMPORTED_MODULE_13__["default"])(imageVolume, viewPlaneNormal); const sliceRange = (0,_utilities_getSliceRange__WEBPACK_IMPORTED_MODULE_12__["default"])(actorEntry.actor, viewPlaneNormal, focalPoint); const numSlicesBackward = Math.round((sliceRange.current - sliceRange.min) / spacingInNormalDirection); const numSlicesForward = Math.round((sliceRange.max - sliceRange.current) / spacingInNormalDirection); const currentSliceIndex = this.getSliceIndex(); const focalPoints = []; for (let i = -numSlicesBackward; i <= numSlicesForward; i++) { const { newFocalPoint: point } = (0,_utilities_snapFocalPointToSlice__WEBPACK_IMPORTED_MODULE_14__["default"])(focalPoint, position, sliceRange, viewPlaneNormal, spacingInNormalDirection, i); focalPoints.push({ sliceIndex: currentSliceIndex + i, point }); } return focalPoints; }; const { orientation } = this.options; if (orientation && orientation !== _enums__WEBPACK_IMPORTED_MODULE_9__["default"].ACQUISITION) { this.applyViewOrientation(orientation); return; } this._useAcquisitionPlaneForViewPlane = true; } setVolumes(_x) { var _superprop_getSetVolumes = () => super.setVolumes, _this = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (volumeInputArray, immediate = false, suppressEvents = false) { const volumeId = volumeInputArray[0].volumeId; const firstImageVolume = _cache_cache__WEBPACK_IMPORTED_MODULE_4__["default"].getVolume(volumeId); if (!firstImageVolume) { throw new Error(`imageVolume with id: ${volumeId} does not exist`); } if (_this._useAcquisitionPlaneForViewPlane) { _this._setViewPlaneToAcquisitionPlane(firstImageVolume); _this._useAcquisitionPlaneForViewPlane = false; } else if (_this.options.orientation && typeof _this.options.orientation === 'string') { if (_this.options.orientation.includes('_reformat')) { _this._setViewPlaneToReformatOrientation(_this.options.orientation, firstImageVolume); } } return _superprop_getSetVolumes().call(_this, volumeInputArray, immediate, suppressEvents); }).apply(this, arguments); } addVolumes(_x2) { var _superprop_getAddVolumes = () => super.addVolumes, _this2 = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (volumeInputArray, immediate = false, suppressEvents = false) { const firstImageVolume = _cache_cache__WEBPACK_IMPORTED_MODULE_4__["default"].getVolume(volumeInputArray[0].volumeId); if (!firstImageVolume) { throw new Error(`imageVolume with id: ${firstImageVolume.volumeId} does not exist`); } if (_this2._useAcquisitionPlaneForViewPlane) { _this2._setViewPlaneToAcquisitionPlane(firstImageVolume); _this2._useAcquisitionPlaneForViewPlane = false; } else if (_this2.options.orientation && typeof _this2.options.orientation === 'string') { if (_this2.options.orientation.includes('_reformat')) { _this2._setViewPlaneToReformatOrientation(_this2.options.orientation, firstImageVolume); } } return _superprop_getAddVolumes().call(_this2, volumeInputArray, immediate, suppressEvents); }).apply(this, arguments); } jumpToWorld(worldPos) { let targetWorldPos = worldPos; const imageData = this.getImageData(); if (imageData?.imageData) { const bounds = imageData.imageData.getBounds(); targetWorldPos = [Math.max(bounds[0], Math.min(bounds[1], worldPos[0])), Math.max(bounds[2], Math.min(bounds[3], worldPos[1])), Math.max(bounds[4], Math.min(bounds[5], worldPos[2]))]; } const { focalPoint } = this.getCamera(); const delta = [0, 0, 0]; gl_matrix__WEBPACK_IMPORTED_MODULE_2__.sub(delta, targetWorldPos, focalPoint); const camera = this.getCamera(); const normal = camera.viewPlaneNormal; const dotProd = gl_matrix__WEBPACK_IMPORTED_MODULE_2__.dot(delta, normal); const projectedDelta = gl_matrix__WEBPACK_IMPORTED_MODULE_2__.fromValues(normal[0], normal[1], normal[2]); gl_matrix__WEBPACK_IMPORTED_MODULE_2__.scale(projectedDelta, projectedDelta, dotProd); if (Math.abs(projectedDelta[0]) > 1e-3 || Math.abs(projectedDelta[1]) > 1e-3 || Math.abs(projectedDelta[2]) > 1e-3) { const newFocalPoint = [0, 0, 0]; const newPosition = [0, 0, 0]; gl_matrix__WEBPACK_IMPORTED_MODULE_2__.add(newFocalPoint, camera.focalPoint, projectedDelta); gl_matrix__WEBPACK_IMPORTED_MODULE_2__.add(newPosition, camera.position, projectedDelta); this.setCamera({ focalPoint: newFocalPoint, position: newPosition }); this.render(); } return true; } setOrientation(orientation, immediate = true, suppressEvents = false) { let viewPlaneNormal, viewUp; if (typeof orientation === 'string') { if (orientation === _enums__WEBPACK_IMPORTED_MODULE_9__["default"].ACQUISITION) { ({ viewPlaneNormal, viewUp } = super._getAcquisitionPlaneOrientation()); } else if (orientation === _enums__WEBPACK_IMPORTED_MODULE_9__["default"].REFORMAT) { ({ viewPlaneNormal, viewUp } = (0,_helpers_getCameraVectors__WEBPACK_IMPORTED_MODULE_23__.getCameraVectors)(this, { useViewportNormal: true })); } else if (orientation === _enums__WEBPACK_IMPORTED_MODULE_9__["default"].AXIAL_REFORMAT || orientation === _enums__WEBPACK_IMPORTED_MODULE_9__["default"].SAGITTAL_REFORMAT || orientation === _enums__WEBPACK_IMPORTED_MODULE_9__["default"].CORONAL_REFORMAT) { let baseOrientation; if (orientation === _enums__WEBPACK_IMPORTED_MODULE_9__["default"].AXIAL_REFORMAT) { baseOrientation = _enums__WEBPACK_IMPORTED_MODULE_9__["default"].AXIAL; } else if (orientation === _enums__WEBPACK_IMPORTED_MODULE_9__["default"].SAGITTAL_REFORMAT) { baseOrientation = _enums__WEBPACK_IMPORTED_MODULE_9__["default"].SAGITTAL; } else { baseOrientation = _enums__WEBPACK_IMPORTED_MODULE_9__["default"].CORONAL; } ({ viewPlaneNormal, viewUp } = (0,_helpers_getCameraVectors__WEBPACK_IMPORTED_MODULE_23__.getCameraVectors)(this, { useViewportNormal: true, orientation: baseOrientation })); } else if (_constants__WEBPACK_IMPORTED_MODULE_7__["default"][orientation]) { ({ viewPlaneNormal, viewUp } = _constants__WEBPACK_IMPORTED_MODULE_7__["default"][orientation]); } else { throw new Error(`Invalid orientation: ${orientation}. Use Enums.OrientationAxis instead.`); } this.setCamera({ viewPlaneNormal, viewUp }); this.viewportProperties.orientation = orientation; this.resetCamera({ suppressEvents: true }); } else { ({ viewPlaneNormal, viewUp } = orientation); this.applyViewOrientation(orientation, true, suppressEvents); } if (immediate) { this.render(); } } setCameraClippingRange() { const activeCamera = this.getVtkActiveCamera(); if (!activeCamera) { console.warn('No active camera found'); return; } if (activeCamera.getParallelProjection()) { activeCamera.setClippingRange(-_constants__WEBPACK_IMPORTED_MODULE_5__["default"].MAXIMUM_RAY_DISTANCE, _constants__WEBPACK_IMPORTED_MODULE_5__["default"].MAXIMUM_RAY_DISTANCE); } else { activeCamera.setClippingRange(_constants__WEBPACK_IMPORTED_MODULE_5__["default"].MINIMUM_SLAB_THICKNESS, _constants__WEBPACK_IMPORTED_MODULE_5__["default"].MAXIMUM_RAY_DISTANCE); } } _setViewPlaneToReformatOrientation(orientation, imageVolume) { let viewPlaneNormal, viewUp; if (imageVolume) { const { direction } = imageVolume; ({ viewPlaneNormal, viewUp } = (0,_helpers_getCameraVectors__WEBPACK_IMPORTED_MODULE_23__.calculateCameraPosition)(direction.slice(0, 3), direction.slice(3, 6), direction.slice(6, 9), orientation)); } else { ({ viewPlaneNormal, viewUp } = this._getAcquisitionPlaneOrientation()); } this.setCamera({ viewPlaneNormal, viewUp }); this.initialViewUp = viewUp; this.resetCamera(); } _setViewPlaneToAcquisitionPlane(imageVolume) { let viewPlaneNormal, viewUp; if (imageVolume) { const { direction } = imageVolume; viewPlaneNormal = direction.slice(6, 9).map(x => -x); viewUp = direction.slice(3, 6).map(x => -x); } else { ({ viewPlaneNormal, viewUp } = this._getAcquisitionPlaneOrientation()); } this.setCamera({ viewPlaneNormal, viewUp }); this.initialViewUp = viewUp; this.resetCamera(); } getBlendMode(filterActorUIDs) { const actorEntries = this.getActors(); const actorForBlend = filterActorUIDs?.length > 0 ? actorEntries.find(actorEntry => filterActorUIDs.includes(actorEntry.uid)) : actorEntries[0]; return actorForBlend?.blendMode || actorForBlend?.actor.getMapper().getBlendMode(); } setBlendMode(blendMode, filterActorUIDs = [], immediate = false) { let actorEntries = this.getActors(); if (filterActorUIDs?.length > 0) { actorEntries = actorEntries.filter(actorEntry => { return filterActorUIDs.includes(actorEntry.uid); }); } actorEntries.forEach(actorEntry => { const { actor } = actorEntry; const mapper = actor.getMapper(); mapper.setBlendMode?.(blendMode); actorEntry.blendMode = blendMode; }); if (immediate) { this.render(); } } resetCamera(options) { const { resetPan = true, resetZoom = true, resetRotation = true, resetToCenter = true, suppressEvents = false, resetOrientation = true } = options || {}; const { orientation } = this.viewportProperties; if (orientation && resetOrientation) { this.applyViewOrientation(orientation, false); } super.resetCamera({ resetPan, resetZoom, resetToCenter }); const activeCamera = this.getVtkActiveCamera(); const viewPlaneNormal = activeCamera.getViewPlaneNormal(); const focalPoint = activeCamera.getFocalPoint(); const actorEntries = this.getActors(); actorEntries.forEach(actorEntry => { if (!actorEntry.actor) { return; } const mapper = actorEntry.actor.getMapper(); const vtkPlanes = mapper.getClippingPlanes(); if (vtkPlanes.length === 0 && !actorEntry?.clippingFilter) { const clipPlane1 = _kitware_vtk_js_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_3__["default"].newInstance(); const clipPlane2 = _kitware_vtk_js_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_3__["default"].newInstance(); const newVtkPlanes = [clipPlane1, clipPlane2]; let slabThickness = _constants__WEBPACK_IMPORTED_MODULE_5__["default"].MINIMUM_SLAB_THICKNESS; if (actorEntry.slabThickness) { slabThickness = actorEntry.slabThickness; } this.setOrientationOfClippingPlanes(newVtkPlanes, slabThickness, viewPlaneNormal, focalPoint); mapper.addClippingPlane(clipPlane1); mapper.addClippingPlane(clipPlane2); } }); if (resetRotation && _constants__WEBPACK_IMPORTED_MODULE_7__["default"][this.viewportProperties.orientation] !== undefined) { const viewToReset = _constants__WEBPACK_IMPORTED_MODULE_7__["default"][this.viewportProperties.orientation]; this.setCameraNoEvent({ viewUp: viewToReset.viewUp, viewPlaneNormal: viewToReset.viewPlaneNormal }); } if (!suppressEvents) { const eventDetail = { viewportId: this.id, camera: this.getCamera(), renderingEngineId: this.renderingEngineId, element: this.element }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_15__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_8__["default"].CAMERA_RESET, eventDetail); } return true; } setSlabThickness(slabThickness, filterActorUIDs = []) { if (slabThickness < 0.1) { slabThickness = 0.1; } let actorEntries = this.getActors(); if (filterActorUIDs?.length > 0) { actorEntries = actorEntries.filter(actorEntry => { return filterActorUIDs.includes(actorEntry.uid); }); } actorEntries.forEach(actorEntry => { if ((0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_10__.actorIsA)(actorEntry, 'vtkVolume')) { actorEntry.slabThickness = slabThickness; } }); const currentCamera = this.getCamera(); this.updateClippingPlanesForActors(currentCamera); this.triggerCameraModifiedEventIfNecessary(currentCamera, currentCamera); this.viewportProperties.slabThickness = slabThickness; } resetSlabThickness() { const actorEntries = this.getActors(); actorEntries.forEach(actorEntry => { if ((0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_10__.actorIsA)(actorEntry, 'vtkVolume')) { actorEntry.slabThickness = _constants__WEBPACK_IMPORTED_MODULE_5__["default"].MINIMUM_SLAB_THICKNESS; } }); const currentCamera = this.getCamera(); this.updateClippingPlanesForActors(currentCamera); this.triggerCameraModifiedEventIfNecessary(currentCamera, currentCamera); this.viewportProperties.slabThickness = undefined; } isInAcquisitionPlane() { const imageData = this.getImageData(); if (!imageData) { return false; } const { direction } = imageData; const { viewPlaneNormal } = this.getCamera(); const normalDirection = [direction[6], direction[7], direction[8]]; const TOLERANCE = 0.99; return Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_2__.dot(viewPlaneNormal, normalDirection)) > TOLERANCE; } getSliceViewInfo() { const { width: canvasWidth, height: canvasHeight } = this.getCanvas(); const ijkOriginPoint = (0,_utilities_transformCanvasToIJK__WEBPACK_IMPORTED_MODULE_20__.transformCanvasToIJK)(this, [0, 0]); const ijkRowPoint = (0,_utilities_transformCanvasToIJK__WEBPACK_IMPORTED_MODULE_20__.transformCanvasToIJK)(this, [canvasWidth - 1, 0]); const ijkColPoint = (0,_utilities_transformCanvasToIJK__WEBPACK_IMPORTED_MODULE_20__.transformCanvasToIJK)(this, [0, canvasHeight - 1]); const ijkRowVec = gl_matrix__WEBPACK_IMPORTED_MODULE_2__.sub(gl_matrix__WEBPACK_IMPORTED_MODULE_2__.create(), ijkRowPoint, ijkOriginPoint); const ijkColVec = gl_matrix__WEBPACK_IMPORTED_MODULE_2__.sub(gl_matrix__WEBPACK_IMPORTED_MODULE_2__.create(), ijkColPoint, ijkOriginPoint); const ijkSliceVec = gl_matrix__WEBPACK_IMPORTED_MODULE_2__.cross(gl_matrix__WEBPACK_IMPORTED_MODULE_2__.create(), ijkRowVec, ijkColVec); gl_matrix__WEBPACK_IMPORTED_MODULE_2__.normalize(ijkRowVec, ijkRowVec); gl_matrix__WEBPACK_IMPORTED_MODULE_2__.normalize(ijkColVec, ijkColVec); gl_matrix__WEBPACK_IMPORTED_MODULE_2__.normalize(ijkSliceVec, ijkSliceVec); const { dimensions } = this.getImageData(); const [sx, sy, sz] = dimensions; const ijkCorners = [[0, 0, 0], [sx - 1, 0, 0], [0, sy - 1, 0], [sx - 1, sy - 1, 0], [0, 0, sz - 1], [sx - 1, 0, sz - 1], [0, sy - 1, sz - 1], [sx - 1, sy - 1, sz - 1]]; const canvasCorners = ijkCorners.map(ijkCorner => (0,_utilities_transformIJKToCanvas__WEBPACK_IMPORTED_MODULE_21__.transformIJKToCanvas)(this, ijkCorner)); const canvasAABB = canvasCorners.reduce((aabb, canvasPoint) => { aabb.minX = Math.min(aabb.minX, canvasPoint[0]); aabb.minY = Math.min(aabb.minY, canvasPoint[1]); aabb.maxX = Math.max(aabb.maxX, canvasPoint[0]); aabb.maxY = Math.max(aabb.maxY, canvasPoint[1]); return aabb; }, { minX: Infinity, minY: Infinity, maxX: -Infinity, maxY: -Infinity }); const ijkTopLeft = (0,_utilities_transformCanvasToIJK__WEBPACK_IMPORTED_MODULE_20__.transformCanvasToIJK)(this, [canvasAABB.minX, canvasAABB.minY]); const sliceToIndexMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.fromValues(ijkRowVec[0], ijkRowVec[1], ijkRowVec[2], 0, ijkColVec[0], ijkColVec[1], ijkColVec[2], 0, ijkSliceVec[0], ijkSliceVec[1], ijkSliceVec[2], 0, ijkTopLeft[0], ijkTopLeft[1], ijkTopLeft[2], 1); const ijkBottomRight = (0,_utilities_transformCanvasToIJK__WEBPACK_IMPORTED_MODULE_20__.transformCanvasToIJK)(this, [canvasAABB.maxX, canvasAABB.maxY]); const ijkDiagonal = gl_matrix__WEBPACK_IMPORTED_MODULE_2__.sub(gl_matrix__WEBPACK_IMPORTED_MODULE_2__.create(), ijkBottomRight, ijkTopLeft); const indexToSliceMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.invert(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(), sliceToIndexMatrix); const { viewPlaneNormal } = this.getCamera(); const isOblique = viewPlaneNormal.filter(component => Math.abs(component) > _constants__WEBPACK_IMPORTED_MODULE_6__["default"]).length > 1; if (isOblique) { throw new Error('getSliceInfo is not supported for oblique views'); } const sliceAxis = viewPlaneNormal.findIndex(component => Math.abs(component) > 1 - _constants__WEBPACK_IMPORTED_MODULE_6__["default"]); if (sliceAxis === -1) { throw new Error('Unable to determine slice axis'); } const sliceWidth = gl_matrix__WEBPACK_IMPORTED_MODULE_2__.dot(ijkRowVec, ijkDiagonal) + 1; const sliceHeight = gl_matrix__WEBPACK_IMPORTED_MODULE_2__.dot(ijkColVec, ijkDiagonal) + 1; return { sliceIndex: this.getSliceIndex(), width: sliceWidth, height: sliceHeight, slicePlane: sliceAxis, sliceToIndexMatrix, indexToSliceMatrix }; } getCurrentSlicePixelData() { const { voxelManager } = this.getImageData(); const sliceData = voxelManager.getSliceData(this.getSliceViewInfo()); return sliceData; } getViewReference(viewRefSpecifier = {}) { const viewRef = super.getViewReference(viewRefSpecifier); if (!viewRef?.volumeId) { return; } const volume = _cache_cache__WEBPACK_IMPORTED_MODULE_4__["default"].getVolume(viewRef.volumeId); viewRef.referencedImageId = (0,_utilities_getClosestImageId__WEBPACK_IMPORTED_MODULE_11__["default"])(volume, viewRef.cameraFocalPoint, viewRef.viewPlaneNormal); return viewRef; } resetProperties(volumeId) { this._resetProperties(volumeId); } _resetProperties(volumeId) { const volumeActor = volumeId ? this.getActor(volumeId) : this.getDefaultActor(); if (!volumeActor) { throw new Error(`No actor found for the given volumeId: ${volumeId}`); } if (volumeActor.slabThickness) { volumeActor.slabThickness = _constants__WEBPACK_IMPORTED_MODULE_5__["default"].MINIMUM_SLAB_THICKNESS; this.viewportProperties.slabThickness = undefined; this.updateClippingPlanesForActors(this.getCamera()); } volumeId ||= this.getVolumeId(); const imageVolume = _cache_cache__WEBPACK_IMPORTED_MODULE_4__["default"].getVolume(volumeId); if (!imageVolume) { throw new Error(`imageVolume with id: ${volumeId} does not exist in cache`); } (0,_helpers_setDefaultVolumeVOI__WEBPACK_IMPORTED_MODULE_17__["default"])(volumeActor.actor, imageVolume); if ((0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_10__.isImageActor)(volumeActor)) { const transferFunction = volumeActor.actor.getProperty().getRGBTransferFunction(0); (0,_utilities_transferFunctionUtils__WEBPACK_IMPORTED_MODULE_18__.setTransferFunctionNodes)(transferFunction, this.initialTransferFunctionNodes); } const eventDetails = { ...super.getVOIModifiedEventDetail(volumeId) }; const resetPan = true; const resetZoom = true; const resetToCenter = true; const resetCameraRotation = true; this.resetCamera({ resetPan, resetZoom, resetToCenter, resetCameraRotation }); (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_15__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_8__["default"].VOI_MODIFIED, eventDetails); } getSlicesClippingPlanes() { const focalPoints = this.getSlicePlaneCoordinates(); const { viewPlaneNormal } = this.getCamera(); const slabThickness = _constants__WEBPACK_IMPORTED_MODULE_5__["default"].MINIMUM_SLAB_THICKNESS; return focalPoints.map(({ point, sliceIndex }) => { const vtkPlanes = [_kitware_vtk_js_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_3__["default"].newInstance(), _kitware_vtk_js_Common_DataModel_Plane__WEBPACK_IMPORTED_MODULE_3__["default"].newInstance()]; this.setOrientationOfClippingPlanes(vtkPlanes, slabThickness, viewPlaneNormal, point); return { sliceIndex, planes: vtkPlanes.map(plane => ({ normal: plane.getNormal(), origin: plane.getOrigin() })) }; }); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (VolumeViewport); /***/ }, /***/ 50600 /*!***************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/VolumeViewport3D.js ***! \***************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants */ 33876); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums */ 14566); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enums */ 80600); /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../cache/cache */ 38277); /* harmony import */ var _helpers_setDefaultVolumeVOI__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers/setDefaultVolumeVOI */ 38198); /* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utilities/triggerEvent */ 91133); /* harmony import */ var _utilities_actorCheck__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utilities/actorCheck */ 36506); /* harmony import */ var _utilities_transferFunctionUtils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utilities/transferFunctionUtils */ 19813); /* harmony import */ var _BaseVolumeViewport__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./BaseVolumeViewport */ 19401); class VolumeViewport3D extends _BaseVolumeViewport__WEBPACK_IMPORTED_MODULE_8__["default"] { constructor(props) { super(props); this.setSampleDistanceMultiplier = multiplier => { const actors = this.getActors(); actors.forEach(actorEntry => { if ((0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_6__.actorIsA)(actorEntry, 'vtkVolume')) { const actor = actorEntry.actor; const mapper = actor.getMapper(); if (mapper && mapper.getInputData) { const imageData = mapper.getInputData(); if (imageData) { const spacing = imageData.getSpacing(); const defaultSampleDistance = (spacing[0] + spacing[1] + spacing[2]) / 6; const sampleDistanceMultiplier = multiplier || 1; let sampleDistance = defaultSampleDistance * sampleDistanceMultiplier; if (sampleDistance !== undefined && mapper.setSampleDistance) { const currentSampleDistance = mapper.getSampleDistance(); mapper.setSampleDistance(sampleDistance); } } } } }); this.render(); }; this.getNumberOfSlices = () => { return 1; }; this.getRotation = () => 0; this.getCurrentImageIdIndex = () => { return 0; }; this.getCurrentImageId = () => { return null; }; this.resetCameraForResize = () => { return this.resetCamera({ resetPan: true, resetZoom: true, resetToCenter: true }); }; const { parallelProjection, orientation } = this.options; const activeCamera = this.getVtkActiveCamera(); if (parallelProjection != null) { activeCamera.setParallelProjection(parallelProjection); } if (orientation && orientation !== _enums__WEBPACK_IMPORTED_MODULE_2__["default"].ACQUISITION) { this.applyViewOrientation(orientation); } } isInAcquisitionPlane() { return false; } resetCamera({ resetPan = true, resetZoom = true, resetToCenter = true } = {}) { super.resetCamera({ resetPan, resetZoom, resetToCenter }); const activeCamera = this.getVtkActiveCamera(); if (activeCamera.getParallelProjection()) { activeCamera.setClippingRange(-_constants__WEBPACK_IMPORTED_MODULE_0__["default"].MAXIMUM_RAY_DISTANCE, _constants__WEBPACK_IMPORTED_MODULE_0__["default"].MAXIMUM_RAY_DISTANCE); } else { activeCamera.setClippingRange(_constants__WEBPACK_IMPORTED_MODULE_0__["default"].MINIMUM_SLAB_THICKNESS, _constants__WEBPACK_IMPORTED_MODULE_0__["default"].MAXIMUM_RAY_DISTANCE); } const renderer = this.getRenderer(); renderer.resetCameraClippingRange(); return true; } setSlabThickness(slabThickness, filterActorUIDs) { return null; } setBlendMode(blendMode, filterActorUIDs, immediate) { return null; } resetProperties(volumeId) { const volumeActor = volumeId ? this.getActor(volumeId) : this.getDefaultActor(); if (!volumeActor) { throw new Error(`No actor found for the given volumeId: ${volumeId}`); } if (volumeActor.slabThickness) { volumeActor.slabThickness = _constants__WEBPACK_IMPORTED_MODULE_0__["default"].MINIMUM_SLAB_THICKNESS; this.viewportProperties.slabThickness = undefined; this.updateClippingPlanesForActors(this.getCamera()); } volumeId ||= this.getVolumeId(); const imageVolume = _cache_cache__WEBPACK_IMPORTED_MODULE_3__["default"].getVolume(volumeId); if (!imageVolume) { throw new Error(`imageVolume with id: ${volumeId} does not exist in cache`); } (0,_helpers_setDefaultVolumeVOI__WEBPACK_IMPORTED_MODULE_4__["default"])(volumeActor.actor, imageVolume); if ((0,_utilities_actorCheck__WEBPACK_IMPORTED_MODULE_6__.isImageActor)(volumeActor)) { const transferFunction = volumeActor.actor.getProperty().getRGBTransferFunction(0); (0,_utilities_transferFunctionUtils__WEBPACK_IMPORTED_MODULE_7__.setTransferFunctionNodes)(transferFunction, this.initialTransferFunctionNodes); } this.setCamera(this.initialCamera); (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_5__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_1__["default"].VOI_MODIFIED, super.getVOIModifiedEventDetail(volumeId)); } getSliceIndex() { return null; } setCamera(props) { super.setCamera(props); this.getRenderer().resetCameraClippingRange(); this.render(); } setCameraClippingRange() { const activeCamera = this.getVtkActiveCamera(); if (activeCamera.getParallelProjection()) { activeCamera.setClippingRange(-_constants__WEBPACK_IMPORTED_MODULE_0__["default"].MAXIMUM_RAY_DISTANCE, _constants__WEBPACK_IMPORTED_MODULE_0__["default"].MAXIMUM_RAY_DISTANCE); } else { activeCamera.setClippingRange(_constants__WEBPACK_IMPORTED_MODULE_0__["default"].MINIMUM_SLAB_THICKNESS, _constants__WEBPACK_IMPORTED_MODULE_0__["default"].MAXIMUM_RAY_DISTANCE); } } resetSlabThickness() { return null; } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (VolumeViewport3D); /***/ }, /***/ 55580 /*!**********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/WSIViewport.js ***! \**********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! gl-matrix */ 95329); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../enums */ 14566); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../enums */ 94649); /* harmony import */ var _utilities_uuidv4__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utilities/uuidv4 */ 29760); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../metaData */ 90161); /* harmony import */ var _helpers_cpuFallback_rendering_transform__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./helpers/cpuFallback/rendering/transform */ 98233); /* harmony import */ var _Viewport__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Viewport */ 38589); /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./helpers */ 63628); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../constants */ 19050); /* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utilities/triggerEvent */ 91133); /* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../init */ 15678); /* harmony import */ var _constants_microscopyViewportCss__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../constants/microscopyViewportCss */ 2453); /* harmony import */ var _eventTarget__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../eventTarget */ 28699); /* harmony import */ var _utilities_imageIdToURI__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../utilities/imageIdToURI */ 40232); let WSIUtilFunctions = null; const EVENT_POSTRENDER = 'postrender'; const ANNOTATION_REMOVED = 'CORNERSTONE_TOOLS_ANNOTATION_REMOVED'; class WSIViewport extends _Viewport__WEBPACK_IMPORTED_MODULE_8__["default"] { constructor(props) { super({ ...props, canvas: props.canvas || (0,_helpers__WEBPACK_IMPORTED_MODULE_9__.getOrCreateCanvas)(props.element) }); this.imageURISet = new Set(); this.internalCamera = { rotation: 0, centerIndex: [0, 0], extent: [0, -2, 1, -1], xSpacing: 1, ySpacing: 1, resolution: 1, zoom: 1 }; this.annotationRemovedListener = evt => { const { detail } = evt; const metadata = detail?.annotation?.metadata; if (!metadata) { this.postrender(); return; } const referencedImageURI = metadata.referencedImageURI ?? (metadata.referencedImageId ? (0,_utilities_imageIdToURI__WEBPACK_IMPORTED_MODULE_15__["default"])(metadata.referencedImageId) : null); if (referencedImageURI && !this.hasImageURI(referencedImageURI)) { return; } const annotationFOR = metadata.FrameOfReferenceUID ?? null; if (annotationFOR && annotationFOR !== this.frameOfReferenceUID) { return; } this.postrender(); }; this.voiRange = { lower: 0, upper: 255 }; this.getProperties = () => { return { voiRange: { ...this.voiRange } }; }; this.resetCamera = () => { return true; }; this.getNumberOfSlices = () => { return 1; }; this.getFrameOfReferenceUID = () => { return this.frameOfReferenceUID; }; this.resize = () => { const canvas = this.canvas; const { clientWidth, clientHeight } = canvas; if (canvas.width !== clientWidth || canvas.height !== clientHeight) { canvas.width = clientWidth; canvas.height = clientHeight; } this.refreshRenderValues(); }; this.canvasToWorld = canvasPos => { if (!this.metadata) { return; } const indexPoint = this.canvasToIndex(canvasPos); indexPoint[1] = -indexPoint[1]; return this.indexToWorld(indexPoint); }; this.worldToCanvas = worldPos => { if (!this.metadata) { return; } const indexPoint = this.worldToIndex(worldPos); indexPoint[1] = -indexPoint[1]; const canvasPoint = this.indexToCanvas([indexPoint[0], indexPoint[1], 0]); return canvasPoint; }; this.postrender = () => { this.refreshRenderValues(); (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_11__["default"])(this.element, _enums__WEBPACK_IMPORTED_MODULE_3__["default"].IMAGE_RENDERED, { element: this.element, viewportId: this.id, viewport: this, renderingEngineId: this.renderingEngineId }); }; this.getRotation = () => 0; this.canvasToIndex = canvasPos => { const transform = this.getTransform(); transform.invert(); const indexPoint = transform.transformPoint(canvasPos.map(it => it * devicePixelRatio)); return [indexPoint[0], indexPoint[1], 0]; }; this.indexToCanvas = indexPos => { const transform = this.getTransform(); return transform.transformPoint([indexPos[0], indexPos[1]]).map(it => it / devicePixelRatio); }; this.customRenderViewportToCanvas = () => {}; this.getImageIds = () => { return [this.imageIds[0]]; }; this.renderingEngineId = props.renderingEngineId; this.element.setAttribute('data-viewport-uid', this.id); this.element.setAttribute('data-rendering-engine-uid', this.renderingEngineId); this.element.style.position = 'relative'; this.microscopyElement = document.createElement('div'); this.microscopyElement.setAttribute('class', 'DicomMicroscopyViewer'); this.microscopyElement.id = (0,_utilities_uuidv4__WEBPACK_IMPORTED_MODULE_5__["default"])(); this.microscopyElement.innerText = 'Initial'; this.microscopyElement.style.background = 'grey'; this.microscopyElement.style.width = '100%'; this.microscopyElement.style.height = '100%'; this.microscopyElement.style.position = 'absolute'; this.microscopyElement.style.left = '0'; this.microscopyElement.style.top = '0'; const cs3dElement = this.element.firstElementChild; cs3dElement.insertBefore(this.microscopyElement, cs3dElement.childNodes[1]); this.addEventListeners(); this.addWidget('DicomMicroscopyViewer', { getEnabled: () => !!this.viewer, setEnabled: () => { this.elementDisabledHandler(); } }); this.resize(); } static get useCustomRenderingPipeline() { return true; } addEventListeners() { this.canvas.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].ELEMENT_DISABLED, this.elementDisabledHandler); _eventTarget__WEBPACK_IMPORTED_MODULE_14__["default"].addEventListener(ANNOTATION_REMOVED, this.annotationRemovedListener); } removeEventListeners() { this.canvas.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].ELEMENT_DISABLED, this.elementDisabledHandler); _eventTarget__WEBPACK_IMPORTED_MODULE_14__["default"].removeEventListener(ANNOTATION_REMOVED, this.annotationRemovedListener); } elementDisabledHandler() { this.removeEventListeners(); this.viewer?.cleanup(); this.viewer = null; const cs3dElement = this.element.firstElementChild; cs3dElement.removeChild(this.microscopyElement); this.microscopyElement = null; this.imageURISet.clear(); } getImageDataMetadata(imageIndex = 0) { const maxImage = this.metadataDicomweb.reduce((maxImage, image) => { return maxImage?.NumberOfFrames < image.NumberOfFrames ? image : maxImage; }); const { TotalPixelMatrixColumns: columns, TotalPixelMatrixRows: rows, ImageOrientationSlide, ImagedVolumeWidth: width, ImagedVolumeHeight: height, ImagedVolumeDepth: depth } = maxImage; const imagePlaneModule = _metaData__WEBPACK_IMPORTED_MODULE_6__.get(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].IMAGE_PLANE, this.imageIds[imageIndex]); let rowCosines = ImageOrientationSlide.slice(0, 3); let columnCosines = ImageOrientationSlide.slice(3, 6); if (rowCosines == null || columnCosines == null) { rowCosines = [1, 0, 0]; columnCosines = [0, 1, 0]; } const rowCosineVec = gl_matrix__WEBPACK_IMPORTED_MODULE_2__.fromValues(rowCosines[0], rowCosines[1], rowCosines[2]); const colCosineVec = gl_matrix__WEBPACK_IMPORTED_MODULE_2__.fromValues(columnCosines[0], columnCosines[1], columnCosines[2]); const scanAxisNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_2__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_2__.cross(scanAxisNormal, rowCosineVec, colCosineVec); const { XOffsetInSlideCoordinateSystem = 0, YOffsetInSlideCoordinateSystem = 0, ZOffsetInSlideCoordinateSystem = 0 } = maxImage.TotalPixelMatrixOriginSequence?.[0] || {}; const origin = [XOffsetInSlideCoordinateSystem, YOffsetInSlideCoordinateSystem, ZOffsetInSlideCoordinateSystem]; const xSpacing = width / columns; const ySpacing = height / rows; const xVoxels = columns; const yVoxels = rows; const zSpacing = depth; const zVoxels = 1; this.hasPixelSpacing = !!(width && height); return { bitsAllocated: 8, numberOfComponents: 3, origin, direction: [...rowCosineVec, ...colCosineVec, ...scanAxisNormal], dimensions: [xVoxels, yVoxels, zVoxels], spacing: [xSpacing, ySpacing, zSpacing], hasPixelSpacing: this.hasPixelSpacing, numVoxels: xVoxels * yVoxels * zVoxels, imagePlaneModule }; } setFrameNumber(frame) { return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {})(); } setProperties(props) { if (props.voiRange) { this.setVOI(props.voiRange); } } resetProperties() { this.setProperties({ voiRange: { lower: 0, upper: 255 } }); } setVOI(voiRange) { this.voiRange = voiRange; const feFilter = this.setColorTransform(voiRange, this.averageWhite); const olCanvases = this.map.getViewport().querySelectorAll('.ol-layers canvas'); olCanvases.forEach(canvas => { canvas.style.filter = feFilter; }); } setAverageWhite(averageWhite) { this.averageWhite = averageWhite; this.setColorTransform(this.voiRange, averageWhite); } getScalarData() { return null; } computeTransforms() { const indexToWorld = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(); const worldToIndex = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_1__.fromTranslation(indexToWorld, this.metadata.origin); indexToWorld[0] = this.metadata.direction[0]; indexToWorld[1] = this.metadata.direction[1]; indexToWorld[2] = this.metadata.direction[2]; indexToWorld[4] = this.metadata.direction[3]; indexToWorld[5] = this.metadata.direction[4]; indexToWorld[6] = this.metadata.direction[5]; indexToWorld[8] = this.metadata.direction[6]; indexToWorld[9] = this.metadata.direction[7]; indexToWorld[10] = this.metadata.direction[8]; gl_matrix__WEBPACK_IMPORTED_MODULE_1__.scale(indexToWorld, indexToWorld, this.metadata.spacing); gl_matrix__WEBPACK_IMPORTED_MODULE_1__.invert(worldToIndex, indexToWorld); return { indexToWorld, worldToIndex }; } getImageData() { const { metadata } = this; if (!metadata) { return null; } const { spacing } = metadata; const imageData = { getDirection: () => metadata.direction, getDimensions: () => metadata.dimensions, getRange: () => [0, 255], getScalarData: () => this.getScalarData(), getSpacing: () => metadata.spacing, worldToIndex: point => { return this.worldToIndex(point); }, indexToWorld: point => { return this.indexToWorld(point); } }; const imageDataReturn = { dimensions: metadata.dimensions, spacing, numberOfComponents: 3, origin: metadata.origin, direction: metadata.direction, metadata: { Modality: this.modality, FrameOfReferenceUID: this.frameOfReferenceUID }, hasPixelSpacing: this.hasPixelSpacing, calibration: this.calibration, preScale: { scaled: false }, scalarData: this.getScalarData(), imageData }; return imageDataReturn; } hasImageURI(imageURI) { if (!imageURI) { return false; } return this.imageURISet.has(imageURI); } setCamera(camera) { const previousCamera = this.getCamera(); const { parallelScale, focalPoint } = camera; const view = this.getView(); const { xSpacing } = this.internalCamera; if (parallelScale) { const worldToCanvasRatio = this.element.clientHeight / parallelScale; const resolution = 1 / xSpacing / worldToCanvasRatio; view.setResolution(resolution); } if (focalPoint) { const newCanvas = this.worldToCanvas(focalPoint); const newIndex = this.canvasToIndex(newCanvas); view.setCenter(newIndex); } const updatedCamera = this.getCamera(); this.triggerCameraModifiedEventIfNecessary(previousCamera, updatedCamera); } getCurrentImageId() { return this.imageIds[0]; } getFrameNumber() { return 1; } getCamera() { this.refreshRenderValues(); const { resolution, xSpacing, centerIndex } = this.internalCamera; const canvasToWorldRatio = resolution * xSpacing; const canvasCenter = this.indexToCanvas([centerIndex[0], centerIndex[1], 0]); const focalPoint = this.canvasToWorld(canvasCenter); return { parallelProjection: true, focalPoint, position: focalPoint, viewUp: [0, -1, 0], parallelScale: this.element.clientHeight * canvasToWorldRatio, viewPlaneNormal: [0, 0, 1] }; } static { this.getDicomMicroscopyViewer = /*#__PURE__*/(0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { return (0,_init__WEBPACK_IMPORTED_MODULE_12__.peerImport)('dicom-microscopy-viewer'); }); } worldToIndexWSI(point) { if (!WSIUtilFunctions) { return; } const affine = this.viewer.getAffine(); const pixelCoords = WSIUtilFunctions.applyInverseTransform({ coordinate: [point[0], point[1]], affine }); return [pixelCoords[0], pixelCoords[1]]; } indexToWorldWSI(point) { if (!WSIUtilFunctions) { return; } const sliceCoords = WSIUtilFunctions.applyTransform({ coordinate: [point[0], point[1]], affine: this.viewer.getAffine() }); return [sliceCoords[0], sliceCoords[1], 0]; } worldToIndex(point) { const { worldToIndex: worldToIndexMatrix } = this.computeTransforms(); const imageCoord = gl_matrix__WEBPACK_IMPORTED_MODULE_2__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_2__.transformMat4(imageCoord, point, worldToIndexMatrix); return imageCoord; } indexToWorld(point) { const { indexToWorld: indexToWorldMatrix } = this.computeTransforms(); const worldPos = gl_matrix__WEBPACK_IMPORTED_MODULE_2__.create(); const point3D = gl_matrix__WEBPACK_IMPORTED_MODULE_2__.fromValues(...point); gl_matrix__WEBPACK_IMPORTED_MODULE_2__.transformMat4(worldPos, point3D, indexToWorldMatrix); return [worldPos[0], worldPos[1], worldPos[2]]; } setDataIds(imageIds, options) { if (options?.miniNavigationOverlay !== false) { WSIViewport.addMiniNavigationOverlayCss(); } const webClient = options?.webClient || _metaData__WEBPACK_IMPORTED_MODULE_6__.get(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].WADO_WEB_CLIENT, imageIds[0]); if (!webClient) { throw new Error(`To use setDataIds on WSI data, you must provide metaData.webClient for ${imageIds[0]}.`); } return this.setWSI(imageIds, webClient); } setWSI(imageIds, client) { var _this = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { _this.microscopyElement.style.background = 'black'; _this.microscopyElement.innerText = 'Loading'; _this.imageIds = imageIds; _this.imageURISet = new Set(imageIds.map(imageId => (0,_utilities_imageIdToURI__WEBPACK_IMPORTED_MODULE_15__["default"])(imageId))); const DicomMicroscopyViewer = yield WSIViewport.getDicomMicroscopyViewer(); WSIUtilFunctions ||= DicomMicroscopyViewer.utils; _this.frameOfReferenceUID = null; const metadataDicomweb = _this.imageIds.map(imageId => { const imageMetadata = client.getDICOMwebMetadata(imageId); Object.defineProperty(imageMetadata, 'isMultiframe', { value: imageMetadata.isMultiframe, enumerable: false }); Object.defineProperty(imageMetadata, 'frameNumber', { value: undefined, enumerable: false }); const imageType = imageMetadata['00080008']?.Value; if (imageType?.length === 1) { imageMetadata['00080008'].Value = imageType[0].split('\\'); } const frameOfReference = imageMetadata['00200052']?.Value?.[0]; if (!_this.frameOfReferenceUID) { _this.frameOfReferenceUID = frameOfReference; } else if (frameOfReference !== _this.frameOfReferenceUID) { imageMetadata['00200052'].Value = [_this.frameOfReferenceUID]; } return imageMetadata; }); const volumeImages = []; metadataDicomweb.forEach(m => { const image = new DicomMicroscopyViewer.metadata.VLWholeSlideMicroscopyImage({ metadata: m }); const imageFlavor = image.ImageType[2]; if (imageFlavor === 'VOLUME' || imageFlavor === 'THUMBNAIL') { volumeImages.push(image); } else { console.log('Unknown image type', image.ImageType); } }); _this.metadataDicomweb = volumeImages; const viewer = new DicomMicroscopyViewer.viewer.VolumeImageViewer({ client, metadata: volumeImages, controls: ['overview', 'position'], retrieveRendered: false, bindings: {} }); viewer.render({ container: _this.microscopyElement }); _this.metadata = _this.getImageDataMetadata(); viewer.deactivateDragPanInteraction(); _this.viewer = viewer; _this.map = viewer.getMap(); _this.map.on(EVENT_POSTRENDER, _this.postrender); _this.resize(); _this.microscopyElement.innerText = ''; Object.assign(_this.microscopyElement.style, { '--ol-partial-background-color': 'rgba(127, 127, 127, 0.7)', '--ol-foreground-color': '#000000', '--ol-subtle-foreground-color': '#000', '--ol-subtle-background-color': 'rgba(78, 78, 78, 0.5)', background: 'none' }); })(); } scroll(delta) { const camera = this.getCamera(); this.setCamera({ parallelScale: camera.parallelScale * (1 + 0.1 * delta) }); } getSliceIndex() { return 0; } getView() { if (!this.viewer) { return; } const map = this.viewer.getMap(); const anyWindow = window; anyWindow.map = map; anyWindow.viewer = this.viewer; anyWindow.view = map?.getView(); anyWindow.wsi = this; return map?.getView(); } refreshRenderValues() { const view = this.getView(); if (!view) { return; } const resolution = view.getResolution(); if (!resolution || resolution < _constants__WEBPACK_IMPORTED_MODULE_10__["default"]) { return; } const centerIndex = view.getCenter(); const extent = view.getProjection().getExtent(); const rotation = view.getRotation(); const zoom = view.getZoom(); const { metadata: { spacing: [xSpacing, ySpacing] } } = this; const worldToCanvasRatio = 1 / resolution / xSpacing; Object.assign(this.internalCamera, { extent, centerIndex, worldToCanvasRatio, xSpacing, ySpacing, resolution, rotation, zoom }); } getZoom() { return this.getView()?.getZoom(); } setZoom(zoom) { this.getView()?.setZoom(zoom); } getTransform() { this.refreshRenderValues(); const { centerIndex: center, resolution, rotation } = this.internalCamera; const halfCanvas = [this.canvas.width / 2, this.canvas.height / 2]; const transform = new _helpers_cpuFallback_rendering_transform__WEBPACK_IMPORTED_MODULE_7__.Transform(); transform.translate(halfCanvas[0], halfCanvas[1]); transform.rotate(rotation); transform.scale(1 / resolution, -1 / resolution); transform.translate(-center[0], -center[1]); return transform; } getViewReferenceId() { return `imageId:${this.getCurrentImageId()}`; } getCurrentImageIdIndex() { return 0; } static { this.overlayCssId = 'overlayCss'; } static addMiniNavigationOverlayCss() { if (document.getElementById(this.overlayCssId)) { return; } const overlayCss = document.createElement('style'); overlayCss.innerText = _constants_microscopyViewportCss__WEBPACK_IMPORTED_MODULE_13__["default"]; overlayCss.setAttribute('id', this.overlayCssId); document.getElementsByTagName('head')[0].append(overlayCss); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (WSIViewport); /***/ }, /***/ 24733 /*!***************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/WebGLContextPool.js ***! \***************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _vtkClasses__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./vtkClasses */ 51676); class WebGLContextPool { constructor(count) { this.contexts = []; this.offScreenCanvasContainers = []; this.viewportToContext = new Map(); this.viewportSizes = new Map(); this.contextMaxSizes = new Map(); for (let i = 0; i < count; i++) { const offscreenMultiRenderWindow = _vtkClasses__WEBPACK_IMPORTED_MODULE_0__["default"].newInstance(); const container = document.createElement('div'); offscreenMultiRenderWindow.setContainer(container); this.contexts.push(offscreenMultiRenderWindow); this.offScreenCanvasContainers.push(container); } } getContextByIndex(index) { if (index >= 0 && index < this.contexts.length) { return { context: this.contexts[index], container: this.offScreenCanvasContainers[index] }; } return null; } assignViewportToContext(viewportId, contextIndex) { this.viewportToContext.set(viewportId, contextIndex); } getContextIndexForViewport(viewportId) { return this.viewportToContext.get(viewportId); } getAllContexts() { return this.contexts; } getContextCount() { return this.contexts.length; } updateViewportSize(viewportId, width, height) { const contextIndex = this.viewportToContext.get(viewportId); if (contextIndex === undefined) { return false; } this.viewportSizes.set(viewportId, { width, height }); const previousMax = this.contextMaxSizes.get(contextIndex); const newMax = this.calculateMaxSizeForContext(contextIndex); this.contextMaxSizes.set(contextIndex, newMax); return !previousMax || previousMax.width !== newMax.width || previousMax.height !== newMax.height; } getMaxSizeForContext(contextIndex) { return this.contextMaxSizes.get(contextIndex); } calculateMaxSizeForContext(contextIndex) { let maxWidth = 0; let maxHeight = 0; this.viewportToContext.forEach((assignedContext, viewportId) => { if (assignedContext === contextIndex) { const size = this.viewportSizes.get(viewportId); if (size) { maxWidth = Math.max(maxWidth, size.width); maxHeight = Math.max(maxHeight, size.height); } } }); return { width: maxWidth, height: maxHeight }; } removeViewport(viewportId) { const contextIndex = this.viewportToContext.get(viewportId); this.viewportToContext.delete(viewportId); this.viewportSizes.delete(viewportId); if (contextIndex !== undefined) { const newMax = this.calculateMaxSizeForContext(contextIndex); this.contextMaxSizes.set(contextIndex, newMax); } } destroy() { this.contexts.forEach(context => { context.delete(); }); this.contexts = []; this.offScreenCanvasContainers = []; this.viewportToContext.clear(); this.viewportSizes.clear(); this.contextMaxSizes.clear(); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (WebGLContextPool); /***/ }, /***/ 77569 /*!*****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/getRenderingEngine.js ***! \*****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ getRenderingEngine: () => (/* binding */ getRenderingEngine), /* harmony export */ getRenderingEngines: () => (/* binding */ getRenderingEngines) /* harmony export */ }); /* harmony import */ var _renderingEngineCache__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./renderingEngineCache */ 70935); function getRenderingEngine(id) { return _renderingEngineCache__WEBPACK_IMPORTED_MODULE_0__["default"].get(id); } function getRenderingEngines() { return _renderingEngineCache__WEBPACK_IMPORTED_MODULE_0__["default"].getAll(); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getRenderingEngine); /***/ }, /***/ 37508 /*!********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/addImageSlicesToViewports.js ***! \********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); function addImageSlicesToViewports(renderingEngine, stackInputs, viewportIds) { for (const viewportId of viewportIds) { const viewport = renderingEngine.getViewport(viewportId); if (!viewport) { throw new Error(`Viewport with Id ${viewportId} does not exist`); } if (!viewport.addImages) { console.warn(`Viewport with Id ${viewportId} does not have addImages. Cannot add image segmentation to this viewport.`); return; } } viewportIds.forEach(viewportId => { const viewport = renderingEngine.getViewport(viewportId); viewport.addImages(stackInputs); }); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (addImageSlicesToViewports); /***/ }, /***/ 19371 /*!****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/addVolumesToViewports.js ***! \****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _BaseVolumeViewport__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../BaseVolumeViewport */ 19401); function addVolumesToViewports(_x, _x2, _x3) { return _addVolumesToViewports.apply(this, arguments); } function _addVolumesToViewports() { _addVolumesToViewports = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (renderingEngine, volumeInputs, viewportIds, immediateRender = false, suppressEvents = false) { for (const viewportId of viewportIds) { const viewport = renderingEngine.getViewport(viewportId); if (!viewport) { throw new Error(`Viewport with Id ${viewportId} does not exist`); } if (!(viewport instanceof _BaseVolumeViewport__WEBPACK_IMPORTED_MODULE_1__["default"])) { console.warn(`Viewport with Id ${viewportId} is not a BaseVolumeViewport. Cannot add volume to this viewport.`); return; } } const addVolumePromises = viewportIds.map(/*#__PURE__*/function () { var _ref = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (viewportId) { const viewport = renderingEngine.getViewport(viewportId); yield viewport.addVolumes(volumeInputs, immediateRender, suppressEvents); }); return function (_x4) { return _ref.apply(this, arguments); }; }()); yield Promise.all(addVolumePromises); return; }); return _addVolumesToViewports.apply(this, arguments); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (addVolumesToViewports); /***/ }, /***/ 17940 /*!**********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/colors/colormap.js ***! \**********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getColormap: () => (/* binding */ getColormap), /* harmony export */ getColormapsList: () => (/* binding */ getColormapsList) /* harmony export */ }); /* harmony import */ var _lookupTable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lookupTable */ 59533); /* harmony import */ var _constants_cpuColormaps__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../constants/cpuColormaps */ 4948); const COLOR_TRANSPARENT = [0, 0, 0, 0]; function linspace(a, b, n) { n = n === null ? 100 : n; const increment = (b - a) / (n - 1); const vector = []; while (n-- > 0) { vector.push(a); a += increment; } vector[vector.length - 1] = b; return vector; } function getRank(array, elem) { let left = 0; let right = array.length - 1; while (left <= right) { const mid = left + Math.floor((right - left) / 2); const midElem = array[mid]; if (midElem === elem) { return mid; } else if (elem < midElem) { right = mid - 1; } else { left = mid + 1; } } return left; } function searchSorted(inputArray, values) { let i; const indexes = []; const len = values.length; inputArray.sort(function (a, b) { return a - b; }); for (i = 0; i < len; i++) { indexes[i] = getRank(inputArray, values[i]); } return indexes; } function makeMappingArray(N, data, gamma) { let i; const x = []; const y0 = []; const y1 = []; const lut = []; gamma = gamma === null ? 1 : gamma; for (i = 0; i < data.length; i++) { const element = data[i]; x.push((N - 1) * element[0]); y0.push(element[1]); y1.push(element[1]); } const xLinSpace = linspace(0, 1, N); for (i = 0; i < N; i++) { xLinSpace[i] = (N - 1) * Math.pow(xLinSpace[i], gamma); } const xLinSpaceIndexes = searchSorted(x, xLinSpace); for (i = 1; i < N - 1; i++) { const index = xLinSpaceIndexes[i]; const colorPercent = (xLinSpace[i] - x[index - 1]) / (x[index] - x[index - 1]); const colorDelta = y0[index] - y1[index - 1]; lut[i] = colorPercent * colorDelta + y1[index - 1]; } lut[0] = y1[0]; lut[N - 1] = y0[data.length - 1]; return lut; } function createLinearSegmentedColormap(segmentedData, N, gamma) { let i; const lut = []; N = N === null ? 256 : N; gamma = gamma === null ? 1 : gamma; const redLut = makeMappingArray(N, segmentedData.red, gamma); const greenLut = makeMappingArray(N, segmentedData.green, gamma); const blueLut = makeMappingArray(N, segmentedData.blue, gamma); for (i = 0; i < N; i++) { const red = Math.round(redLut[i] * 255); const green = Math.round(greenLut[i] * 255); const blue = Math.round(blueLut[i] * 255); const rgba = [red, green, blue, 255]; lut.push(rgba); } return lut; } function getColormapsList() { const colormaps = []; const keys = Object.keys(_constants_cpuColormaps__WEBPACK_IMPORTED_MODULE_1__["default"]); keys.forEach(function (key) { if (Object.prototype.hasOwnProperty.call(_constants_cpuColormaps__WEBPACK_IMPORTED_MODULE_1__["default"], key)) { const colormap = _constants_cpuColormaps__WEBPACK_IMPORTED_MODULE_1__["default"][key]; colormaps.push({ id: key, name: colormap.name }); } }); colormaps.sort(function (a, b) { const aName = a.name.toLowerCase(); const bName = b.name.toLowerCase(); if (aName === bName) { return 0; } return aName < bName ? -1 : 1; }); return colormaps; } function getColormap(id, colormapData) { let colormap = _constants_cpuColormaps__WEBPACK_IMPORTED_MODULE_1__["default"][id]; if (!colormap) { colormap = _constants_cpuColormaps__WEBPACK_IMPORTED_MODULE_1__["default"][id] = colormapData || { name: '', colors: [] }; } if (!colormap.colors && colormap.segmentedData) { colormap.colors = createLinearSegmentedColormap(colormap.segmentedData, colormap.numColors, colormap.gamma); } const cpuFallbackColormap = { getId() { return id; }, getColorSchemeName() { return colormap.name; }, setColorSchemeName(name) { colormap.name = name; }, getNumberOfColors() { return colormap.colors.length; }, setNumberOfColors(numColors) { while (colormap.colors.length < numColors) { colormap.colors.push(COLOR_TRANSPARENT); } colormap.colors.length = numColors; }, getColor(index) { if (this.isValidIndex(index)) { return colormap.colors[index]; } return COLOR_TRANSPARENT; }, getColorRepeating(index) { const numColors = colormap.colors.length; index = numColors ? index % numColors : 0; return this.getColor(index); }, setColor(index, rgba) { if (this.isValidIndex(index)) { colormap.colors[index] = rgba; } }, addColor(rgba) { colormap.colors.push(rgba); }, insertColor(index, rgba) { if (this.isValidIndex(index)) { colormap.colors.splice(index, 1, rgba); } }, removeColor(index) { if (this.isValidIndex(index)) { colormap.colors.splice(index, 1); } }, clearColors() { colormap.colors = []; }, buildLookupTable(lut) { if (!lut) { return; } const numColors = colormap.colors.length; lut.setNumberOfTableValues(numColors); for (let i = 0; i < numColors; i++) { lut.setTableValue(i, colormap.colors[i]); } }, createLookupTable() { const lut = new _lookupTable__WEBPACK_IMPORTED_MODULE_0__["default"](); this.buildLookupTable(lut); return lut; }, isValidIndex(index) { return index >= 0 && index < colormap.colors.length; } }; return cpuFallbackColormap; } /***/ }, /***/ 59533 /*!*************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/colors/lookupTable.js ***! \*************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); const BELOW_RANGE_COLOR_INDEX = 0; const ABOVE_RANGE_COLOR_INDEX = 1; const NAN_COLOR_INDEX = 2; function HSVToRGB(hue, sat, val) { if (hue > 1) { throw new Error('HSVToRGB expects hue < 1'); } const rgb = []; if (sat === 0) { rgb[0] = val; rgb[1] = val; rgb[2] = val; return rgb; } const hueCase = Math.floor(hue * 6); const frac = 6 * hue - hueCase; const lx = val * (1 - sat); const ly = val * (1 - sat * frac); const lz = val * (1 - sat * (1 - frac)); switch (hueCase) { case 0: case 6: rgb[0] = val; rgb[1] = lz; rgb[2] = lx; break; case 1: rgb[0] = ly; rgb[1] = val; rgb[2] = lx; break; case 2: rgb[0] = lx; rgb[1] = val; rgb[2] = lz; break; case 3: rgb[0] = lx; rgb[1] = ly; rgb[2] = val; break; case 4: rgb[0] = lz; rgb[1] = lx; rgb[2] = val; break; case 5: rgb[0] = val; rgb[1] = lx; rgb[2] = ly; break; } return rgb; } function linearIndexLookupMain(v, p) { let dIndex; if (v < p.Range[0]) { dIndex = p.MaxIndex + BELOW_RANGE_COLOR_INDEX + 1.5; } else if (v > p.Range[1]) { dIndex = p.MaxIndex + ABOVE_RANGE_COLOR_INDEX + 1.5; } else { dIndex = (v + p.Shift) * p.Scale; } return Math.floor(dIndex); } class LookupTable { constructor() { this.NumberOfColors = 256; this.Ramp = 'linear'; this.TableRange = [0, 255]; this.HueRange = [0, 0.66667]; this.SaturationRange = [1, 1]; this.ValueRange = [1, 1]; this.AlphaRange = [1, 1]; this.NaNColor = [128, 0, 0, 255]; this.BelowRangeColor = [0, 0, 0, 255]; this.UseBelowRangeColor = true; this.AboveRangeColor = [255, 255, 255, 255]; this.UseAboveRangeColor = true; this.InputRange = [0, 255]; this.Table = []; } setNumberOfTableValues(number) { this.NumberOfColors = number; } setRamp(ramp) { this.Ramp = ramp; } setTableRange(start, end) { this.TableRange[0] = start; this.TableRange[1] = end; } setHueRange(start, end) { this.HueRange[0] = start; this.HueRange[1] = end; } setSaturationRange(start, end) { this.SaturationRange[0] = start; this.SaturationRange[1] = end; } setValueRange(start, end) { this.ValueRange[0] = start; this.ValueRange[1] = end; } setRange(start, end) { this.InputRange[0] = start; this.InputRange[1] = end; } setAlphaRange(start, end) { this.AlphaRange[0] = start; this.AlphaRange[1] = end; } getColor(scalar) { return this.mapValue(scalar); } build(force) { if (this.Table.length > 1 && !force) { return; } this.Table = []; const maxIndex = this.NumberOfColors - 1; let hinc, sinc, vinc, ainc; if (maxIndex) { hinc = (this.HueRange[1] - this.HueRange[0]) / maxIndex; sinc = (this.SaturationRange[1] - this.SaturationRange[0]) / maxIndex; vinc = (this.ValueRange[1] - this.ValueRange[0]) / maxIndex; ainc = (this.AlphaRange[1] - this.AlphaRange[0]) / maxIndex; } else { hinc = sinc = vinc = ainc = 0.0; } for (let i = 0; i <= maxIndex; i++) { const hue = this.HueRange[0] + i * hinc; const sat = this.SaturationRange[0] + i * sinc; const val = this.ValueRange[0] + i * vinc; const alpha = this.AlphaRange[0] + i * ainc; const rgb = HSVToRGB(hue, sat, val); const c_rgba = [0, 0, 0, 0]; switch (this.Ramp) { case 'scurve': c_rgba[0] = Math.floor(127.5 * (1.0 + Math.cos((1.0 - rgb[0]) * Math.PI))); c_rgba[1] = Math.floor(127.5 * (1.0 + Math.cos((1.0 - rgb[1]) * Math.PI))); c_rgba[2] = Math.floor(127.5 * (1.0 + Math.cos((1.0 - rgb[2]) * Math.PI))); c_rgba[3] = Math.floor(alpha * 255); break; case 'linear': c_rgba[0] = Math.floor(rgb[0] * 255 + 0.5); c_rgba[1] = Math.floor(rgb[1] * 255 + 0.5); c_rgba[2] = Math.floor(rgb[2] * 255 + 0.5); c_rgba[3] = Math.floor(alpha * 255 + 0.5); break; case 'sqrt': c_rgba[0] = Math.floor(Math.sqrt(rgb[0]) * 255 + 0.5); c_rgba[1] = Math.floor(Math.sqrt(rgb[1]) * 255 + 0.5); c_rgba[2] = Math.floor(Math.sqrt(rgb[2]) * 255 + 0.5); c_rgba[3] = Math.floor(Math.sqrt(alpha) * 255 + 0.5); break; default: throw new Error(`Invalid Ramp value (${this.Ramp})`); } this.Table.push(c_rgba); } this.buildSpecialColors(); } buildSpecialColors() { const numberOfColors = this.NumberOfColors; const belowRangeColorIndex = numberOfColors + BELOW_RANGE_COLOR_INDEX; const aboveRangeColorIndex = numberOfColors + ABOVE_RANGE_COLOR_INDEX; const nanColorIndex = numberOfColors + NAN_COLOR_INDEX; if (this.UseBelowRangeColor || numberOfColors === 0) { this.Table[belowRangeColorIndex] = this.BelowRangeColor; } else { this.Table[belowRangeColorIndex] = this.Table[0]; } if (this.UseAboveRangeColor || numberOfColors === 0) { this.Table[aboveRangeColorIndex] = this.AboveRangeColor; } else { this.Table[aboveRangeColorIndex] = this.Table[numberOfColors - 1]; } this.Table[nanColorIndex] = this.NaNColor; } mapValue(v) { const index = this.getIndex(v); if (index < 0) { return this.NaNColor; } else if (index === 0) { if (this.UseBelowRangeColor && v < this.TableRange[0]) { return this.BelowRangeColor; } } else if (index === this.NumberOfColors - 1) { if (this.UseAboveRangeColor && v > this.TableRange[1]) { return this.AboveRangeColor; } } return this.Table[index]; } getIndex(v) { const p = { Range: [], MaxIndex: this.NumberOfColors - 1, Shift: -this.TableRange[0], Scale: 1 }; if (this.TableRange[1] <= this.TableRange[0]) { p.Scale = Number.MAX_VALUE; } else { p.Scale = p.MaxIndex / (this.TableRange[1] - this.TableRange[0]); } p.Range[0] = this.TableRange[0]; p.Range[1] = this.TableRange[1]; if (isNaN(v)) { return -1; } let index = linearIndexLookupMain(v, p); if (index === this.NumberOfColors + BELOW_RANGE_COLOR_INDEX) { index = 0; } else if (index === this.NumberOfColors + ABOVE_RANGE_COLOR_INDEX) { index = this.NumberOfColors - 1; } return index; } setTableValue(index, rgba, g, b, a) { let colorArray; if (typeof rgba === 'number' && g !== undefined && b !== undefined && a !== undefined) { colorArray = [rgba, g, b, a]; } else if (Array.isArray(rgba)) { colorArray = rgba; } else { throw new Error('Invalid arguments for setTableValue'); } if (index < 0) { throw new Error(`Can't set the table value for negative index (${index})`); } if (index >= this.NumberOfColors) { throw new Error(`Index ${index} is greater than the number of colors ${this.NumberOfColors}`); } this.Table[index] = colorArray; if (index === 0 || index === this.NumberOfColors - 1) { this.buildSpecialColors(); } } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LookupTable); /***/ }, /***/ 67434 /*!********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/drawImageSync.js ***! \********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _rendering_now__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rendering/now */ 68193); /* harmony import */ var _rendering_renderColorImage__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rendering/renderColorImage */ 22917); /* harmony import */ var _rendering_renderGrayscaleImage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./rendering/renderGrayscaleImage */ 94949); /* harmony import */ var _rendering_renderPseudoColorImage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./rendering/renderPseudoColorImage */ 49819); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(enabledElement, invalidated) { const image = enabledElement.image; if (!enabledElement.canvas || !enabledElement.image) { return; } const start = (0,_rendering_now__WEBPACK_IMPORTED_MODULE_0__["default"])(); image.stats = { lastGetPixelDataTime: -1.0, lastStoredPixelDataToCanvasImageDataTime: -1.0, lastPutImageDataTime: -1.0, lastRenderTime: -1.0, lastLutGenerateTime: -1.0 }; if (image) { let render = image.render; if (!render) { if (enabledElement.viewport.colormap) { render = _rendering_renderPseudoColorImage__WEBPACK_IMPORTED_MODULE_3__.renderPseudoColorImage; } else if (image.color) { render = _rendering_renderColorImage__WEBPACK_IMPORTED_MODULE_1__.renderColorImage; } else { render = _rendering_renderGrayscaleImage__WEBPACK_IMPORTED_MODULE_2__.renderGrayscaleImage; } } render(enabledElement, invalidated); } const renderTimeInMs = (0,_rendering_now__WEBPACK_IMPORTED_MODULE_0__["default"])() - start; image.stats.lastRenderTime = renderTimeInMs; enabledElement.invalid = false; enabledElement.needsRedraw = false; } /***/ }, /***/ 45649 /*!***********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/calculateTransform.js ***! \***********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _transform__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transform */ 98233); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(enabledElement, scale) { const transform = new _transform__WEBPACK_IMPORTED_MODULE_0__.Transform(); if (!enabledElement.viewport.displayedArea) { return transform; } transform.translate(enabledElement.canvas.width / 2, enabledElement.canvas.height / 2); const angle = enabledElement.viewport.rotation; if (angle !== 0) { transform.rotate(angle * Math.PI / 180); } let widthScale = enabledElement.viewport.scale; let heightScale = enabledElement.viewport.scale; const width = enabledElement.viewport.displayedArea.brhc.x - (enabledElement.viewport.displayedArea.tlhc.x - 1); const height = enabledElement.viewport.displayedArea.brhc.y - (enabledElement.viewport.displayedArea.tlhc.y - 1); if (enabledElement.viewport.displayedArea.presentationSizeMode === 'NONE') { if (enabledElement.image.rowPixelSpacing < enabledElement.image.columnPixelSpacing) { widthScale *= enabledElement.image.columnPixelSpacing / enabledElement.image.rowPixelSpacing; } else if (enabledElement.image.columnPixelSpacing < enabledElement.image.rowPixelSpacing) { heightScale *= enabledElement.image.rowPixelSpacing / enabledElement.image.columnPixelSpacing; } } else { widthScale = enabledElement.viewport.displayedArea.columnPixelSpacing; heightScale = enabledElement.viewport.displayedArea.rowPixelSpacing; if (enabledElement.viewport.displayedArea.presentationSizeMode === 'SCALE TO FIT') { const verticalScale = enabledElement.canvas.height / (height * heightScale); const horizontalScale = enabledElement.canvas.width / (width * widthScale); widthScale = heightScale = Math.min(horizontalScale, verticalScale); if (enabledElement.viewport.displayedArea.rowPixelSpacing < enabledElement.viewport.displayedArea.columnPixelSpacing) { widthScale *= enabledElement.viewport.displayedArea.columnPixelSpacing / enabledElement.viewport.displayedArea.rowPixelSpacing; } else if (enabledElement.viewport.displayedArea.columnPixelSpacing < enabledElement.viewport.displayedArea.rowPixelSpacing) { heightScale *= enabledElement.viewport.displayedArea.rowPixelSpacing / enabledElement.viewport.displayedArea.columnPixelSpacing; } } } transform.scale(widthScale, heightScale); if (angle !== 0) { transform.rotate(-angle * Math.PI / 180); } transform.translate(enabledElement.viewport.translation.x, enabledElement.viewport.translation.y); if (angle !== 0) { transform.rotate(angle * Math.PI / 180); } if (scale !== undefined) { transform.scale(scale, scale); } if (enabledElement.viewport.hflip) { transform.scale(-1, 1); } if (enabledElement.viewport.vflip) { transform.scale(1, -1); } transform.translate(-width / 2, -height / 2); return transform; } /***/ }, /***/ 1518 /*!******************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/canvasToPixel.js ***! \******************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _getTransform__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getTransform */ 75613); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(enabledElement, pt) { const transform = (0,_getTransform__WEBPACK_IMPORTED_MODULE_0__["default"])(enabledElement); transform.invert(); return transform.transformPoint(pt); } /***/ }, /***/ 61597 /*!*******************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/computeAutoVoi.js ***! \*******************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ computeAutoVoi) /* harmony export */ }); function computeAutoVoi(viewport, image) { if (hasVoi(viewport)) { return; } const maxVoi = image.maxPixelValue * image.slope + image.intercept; const minVoi = image.minPixelValue * image.slope + image.intercept; const ww = maxVoi - minVoi; const wc = (maxVoi + minVoi) / 2; if (viewport.voi === undefined) { viewport.voi = { windowWidth: ww, windowCenter: wc, voiLUTFunction: image.voiLUTFunction }; } else { viewport.voi.windowWidth = ww; viewport.voi.windowCenter = wc; } } function hasVoi(viewport) { const hasLut = viewport.voiLUT && viewport.voiLUT.lut && viewport.voiLUT.lut.length > 0; return hasLut || viewport.voi.windowWidth !== undefined && viewport.voi.windowCenter !== undefined; } /***/ }, /***/ 26903 /*!*****************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/correctShift.js ***! \*****************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(shift, viewportOrientation) { const { hflip, vflip, rotation } = viewportOrientation; shift.x *= hflip ? -1 : 1; shift.y *= vflip ? -1 : 1; if (rotation !== 0) { const angle = rotation * Math.PI / 180; const cosA = Math.cos(angle); const sinA = Math.sin(angle); const newX = shift.x * cosA - shift.y * sinA; const newY = shift.x * sinA + shift.y * cosA; shift.x = newX; shift.y = newY; } return shift; } /***/ }, /***/ 53147 /*!*******************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/createViewport.js ***! \*******************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ createViewport) /* harmony export */ }); /* harmony import */ var _setDefaultViewport__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setDefaultViewport */ 42322); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../enums */ 78700); function createDefaultDisplayedArea() { return { tlhc: { x: 1, y: 1 }, brhc: { x: 1, y: 1 }, rowPixelSpacing: 1, columnPixelSpacing: 1, presentationSizeMode: 'NONE' }; } function createViewport() { const displayedArea = createDefaultDisplayedArea(); const initialDefaultViewport = { scale: 1, translation: { x: 0, y: 0 }, voi: { windowWidth: undefined, windowCenter: undefined, voiLUTFunction: _enums__WEBPACK_IMPORTED_MODULE_1__["default"].LINEAR }, invert: false, pixelReplication: false, rotation: 0, hflip: false, vflip: false, modalityLUT: undefined, voiLUT: undefined, colormap: undefined, labelmap: false, displayedArea }; return Object.assign({}, initialDefaultViewport, _setDefaultViewport__WEBPACK_IMPORTED_MODULE_0__.state.viewport); } /***/ }, /***/ 65138 /*!******************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/doesImageNeedToBeRendered.js ***! \******************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ doesImageNeedToBeRendered) /* harmony export */ }); function doesImageNeedToBeRendered(enabledElement, image) { const lastRenderedImageId = enabledElement.renderingTools.lastRenderedImageId; const lastRenderedViewport = enabledElement.renderingTools.lastRenderedViewport; return image.imageId !== lastRenderedImageId || !lastRenderedViewport || lastRenderedViewport.windowCenter !== enabledElement.viewport.voi.windowCenter || lastRenderedViewport.windowWidth !== enabledElement.viewport.voi.windowWidth || lastRenderedViewport.invert !== enabledElement.viewport.invert || lastRenderedViewport.rotation !== enabledElement.viewport.rotation || lastRenderedViewport.hflip !== enabledElement.viewport.hflip || lastRenderedViewport.vflip !== enabledElement.viewport.vflip || lastRenderedViewport.modalityLUT !== enabledElement.viewport.modalityLUT || lastRenderedViewport.voiLUT !== enabledElement.viewport.voiLUT || lastRenderedViewport.colormap !== enabledElement.viewport.colormap; } /***/ }, /***/ 58335 /*!****************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/fitToWindow.js ***! \****************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _getImageFitScale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getImageFitScale */ 98579); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(enabledElement) { const { image } = enabledElement; enabledElement.viewport.scale = (0,_getImageFitScale__WEBPACK_IMPORTED_MODULE_0__["default"])(enabledElement.canvas, image, enabledElement.viewport.rotation).scaleFactor; enabledElement.viewport.translation.x = 0; enabledElement.viewport.translation.y = 0; } /***/ }, /***/ 50170 /*!*********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/generateColorLUT.js ***! \*********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ generateColorLUT) /* harmony export */ }); /* harmony import */ var _getVOILut__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getVOILut */ 74366); function generateColorLUT(image, windowWidth, windowCenter, invert, voiLUT) { const maxPixelValue = image.maxPixelValue; const minPixelValue = image.minPixelValue; const offset = Math.min(minPixelValue, 0); if (image.cachedLut === undefined) { const length = maxPixelValue - offset + 1; image.cachedLut = {}; image.cachedLut.lutArray = new Uint8ClampedArray(length); } const lut = image.cachedLut.lutArray; const vlutfn = (0,_getVOILut__WEBPACK_IMPORTED_MODULE_0__["default"])(Array.isArray(windowWidth) ? windowWidth[0] : windowWidth, Array.isArray(windowCenter) ? windowCenter[0] : windowCenter, voiLUT); if (invert) { for (let storedValue = minPixelValue; storedValue <= maxPixelValue; storedValue++) { lut[storedValue + -offset] = 255 - vlutfn(storedValue); } } else { for (let storedValue = minPixelValue; storedValue <= maxPixelValue; storedValue++) { lut[storedValue + -offset] = vlutfn(storedValue); } } return lut; } /***/ }, /***/ 43289 /*!****************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/generateLut.js ***! \****************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _getModalityLut__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getModalityLut */ 18253); /* harmony import */ var _getVOILut__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getVOILut */ 74366); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(image, windowWidth, windowCenter, invert, modalityLUT, voiLUT) { const maxPixelValue = image.maxPixelValue; const minPixelValue = image.minPixelValue; const offset = Math.min(minPixelValue, 0); if (image.cachedLut === undefined) { const length = maxPixelValue - offset + 1; image.cachedLut = {}; image.cachedLut.lutArray = new Uint8ClampedArray(length); } const lut = image.cachedLut.lutArray; const mlutfn = (0,_getModalityLut__WEBPACK_IMPORTED_MODULE_0__["default"])(image.slope, image.intercept, modalityLUT); const vlutfn = (0,_getVOILut__WEBPACK_IMPORTED_MODULE_1__["default"])(windowWidth, windowCenter, voiLUT); if (image.isPreScaled) { if (invert) { for (let storedValue = minPixelValue; storedValue <= maxPixelValue; storedValue++) { lut[storedValue + -offset] = 255 - vlutfn(storedValue); } } else { for (let storedValue = minPixelValue; storedValue <= maxPixelValue; storedValue++) { lut[storedValue + -offset] = vlutfn(storedValue); } } } else { if (invert) { for (let storedValue = minPixelValue; storedValue <= maxPixelValue; storedValue++) { lut[storedValue + -offset] = 255 - vlutfn(mlutfn(storedValue)); } } else { for (let storedValue = minPixelValue; storedValue <= maxPixelValue; storedValue++) { lut[storedValue + -offset] = vlutfn(mlutfn(storedValue)); } } } return lut; } /***/ }, /***/ 20486 /*!***********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/getDefaultViewport.js ***! \***********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _createViewport__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createViewport */ 53147); /* harmony import */ var _getImageFitScale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getImageFitScale */ 98579); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(canvas, image, modality, colormap) { if (canvas === undefined) { throw new Error('getDefaultViewport: parameter canvas must not be undefined'); } if (image === undefined) { return (0,_createViewport__WEBPACK_IMPORTED_MODULE_0__["default"])(); } const scale = (0,_getImageFitScale__WEBPACK_IMPORTED_MODULE_1__["default"])(canvas, image, 0).scaleFactor; let voi; if (modality === 'PT' && image.isPreScaled) { voi = { windowWidth: 5, windowCenter: 2.5 }; } else if (image.windowWidth !== undefined && image.windowCenter !== undefined) { voi = { windowWidth: Array.isArray(image.windowWidth) ? image.windowWidth[0] : image.windowWidth, windowCenter: Array.isArray(image.windowCenter) ? image.windowCenter[0] : image.windowCenter }; } return { scale, translation: { x: 0, y: 0 }, voi, invert: image.invert, pixelReplication: false, rotation: 0, hflip: false, vflip: false, modalityLUT: image.modalityLUT, modality, voiLUT: image.voiLUT, colormap: colormap !== undefined ? colormap : image.colormap, displayedArea: { tlhc: { x: 1, y: 1 }, brhc: { x: image.columns, y: image.rows }, rowPixelSpacing: image.rowPixelSpacing === undefined ? 1 : image.rowPixelSpacing, columnPixelSpacing: image.columnPixelSpacing === undefined ? 1 : image.columnPixelSpacing, presentationSizeMode: 'NONE' } }; } /***/ }, /***/ 98579 /*!*********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/getImageFitScale.js ***! \*********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _validator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validator */ 73107); /* harmony import */ var _getImageSize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getImageSize */ 76849); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(canvas, image, rotation = null) { (0,_validator__WEBPACK_IMPORTED_MODULE_0__.validateParameterUndefinedOrNull)(canvas, 'getImageScale: parameter canvas must not be undefined'); (0,_validator__WEBPACK_IMPORTED_MODULE_0__.validateParameterUndefinedOrNull)(image, 'getImageScale: parameter image must not be undefined'); const imageSize = (0,_getImageSize__WEBPACK_IMPORTED_MODULE_1__["default"])(image, rotation); const rowPixelSpacing = image.rowPixelSpacing || 1; const columnPixelSpacing = image.columnPixelSpacing || 1; let verticalRatio = 1; let horizontalRatio = 1; if (rowPixelSpacing < columnPixelSpacing) { horizontalRatio = columnPixelSpacing / rowPixelSpacing; } else { verticalRatio = rowPixelSpacing / columnPixelSpacing; } const verticalScale = canvas.height / imageSize.height / verticalRatio; const horizontalScale = canvas.width / imageSize.width / horizontalRatio; return { verticalScale, horizontalScale, scaleFactor: Math.min(horizontalScale, verticalScale) }; } /***/ }, /***/ 76849 /*!*****************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/getImageSize.js ***! \*****************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _validator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validator */ 73107); function isRotated(rotation) { return !(rotation === null || rotation === undefined || rotation === 0 || rotation === 180); } /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(image, rotation = null) { (0,_validator__WEBPACK_IMPORTED_MODULE_0__.validateParameterUndefinedOrNull)(image, 'getImageSize: parameter image must not be undefined'); (0,_validator__WEBPACK_IMPORTED_MODULE_0__.validateParameterUndefinedOrNull)(image.width, 'getImageSize: parameter image must have width'); (0,_validator__WEBPACK_IMPORTED_MODULE_0__.validateParameterUndefinedOrNull)(image.height, 'getImageSize: parameter image must have height'); if (isRotated(rotation)) { return { height: image.width, width: image.height }; } return { width: image.width, height: image.height }; } /***/ }, /***/ 92880 /*!***********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/getLut.js ***! \***********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _computeAutoVoi__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./computeAutoVoi */ 61597); /* harmony import */ var _lutMatches__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lutMatches */ 83475); /* harmony import */ var _generateLut__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./generateLut */ 43289); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(image, viewport, invalidated) { if (image.cachedLut !== undefined && image.cachedLut.windowCenter === viewport.voi.windowCenter && image.cachedLut.windowWidth === viewport.voi.windowWidth && (0,_lutMatches__WEBPACK_IMPORTED_MODULE_1__["default"])(image.cachedLut.modalityLUT, viewport.modalityLUT) && (0,_lutMatches__WEBPACK_IMPORTED_MODULE_1__["default"])(image.cachedLut.voiLUT, viewport.voiLUT) && image.cachedLut.invert === viewport.invert && !invalidated) { return image.cachedLut.lutArray; } (0,_computeAutoVoi__WEBPACK_IMPORTED_MODULE_0__["default"])(viewport, image); (0,_generateLut__WEBPACK_IMPORTED_MODULE_2__["default"])(image, viewport.voi.windowWidth, viewport.voi.windowCenter, viewport.invert, viewport.modalityLUT, viewport.voiLUT); image.cachedLut.windowWidth = viewport.voi.windowWidth; image.cachedLut.windowCenter = viewport.voi.windowCenter; image.cachedLut.invert = viewport.invert; image.cachedLut.voiLUT = viewport.voiLUT; image.cachedLut.modalityLUT = viewport.modalityLUT; return image.cachedLut.lutArray; } /***/ }, /***/ 18253 /*!*******************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/getModalityLut.js ***! \*******************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); function generateLinearModalityLUT(slope, intercept) { return storedPixelValue => storedPixelValue * slope + intercept; } function generateNonLinearModalityLUT(modalityLUT) { const minValue = modalityLUT.lut[0]; const maxValue = modalityLUT.lut[modalityLUT.lut.length - 1]; const maxValueMapped = modalityLUT.firstValueMapped + modalityLUT.lut.length; return storedPixelValue => { if (storedPixelValue < modalityLUT.firstValueMapped) { return minValue; } else if (storedPixelValue >= maxValueMapped) { return maxValue; } return modalityLUT.lut[storedPixelValue]; }; } /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(slope, intercept, modalityLUT) { if (modalityLUT) { return generateNonLinearModalityLUT(modalityLUT); } return generateLinearModalityLUT(slope, intercept); } /***/ }, /***/ 75613 /*!*****************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/getTransform.js ***! \*****************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _calculateTransform__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./calculateTransform */ 45649); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(enabledElement) { return (0,_calculateTransform__WEBPACK_IMPORTED_MODULE_0__["default"])(enabledElement); } /***/ }, /***/ 74366 /*!**************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/getVOILut.js ***! \**************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); function generateLinearVOILUT(windowWidth, windowCenter) { return function (modalityLutValue) { const value = ((modalityLutValue - (windowCenter - 0.5)) / (windowWidth - 1) + 0.5) * 255.0; return Math.min(Math.max(value, 0), 255); }; } function generateNonLinearVOILUT(voiLUT) { const bitsPerEntry = Math.max(...voiLUT.lut).toString(2).length; const shift = bitsPerEntry - 8; const minValue = voiLUT.lut[0] >> shift; const maxValue = voiLUT.lut[voiLUT.lut.length - 1] >> shift; const maxValueMapped = voiLUT.firstValueMapped + voiLUT.lut.length - 1; return function (modalityLutValue) { if (modalityLutValue < voiLUT.firstValueMapped) { return minValue; } else if (modalityLutValue >= maxValueMapped) { return maxValue; } return voiLUT.lut[modalityLutValue - voiLUT.firstValueMapped] >> shift; }; } /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(windowWidth, windowCenter, voiLUT) { if (voiLUT) { return generateNonLinearVOILUT(voiLUT); } return generateLinearVOILUT(windowWidth, windowCenter); } /***/ }, /***/ 67943 /*!***************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/initializeRenderCanvas.js ***! \***************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(enabledElement, image) { const renderCanvas = enabledElement.renderingTools.renderCanvas; renderCanvas.width = image.width; renderCanvas.height = image.height; const canvasContext = renderCanvas.getContext('2d'); canvasContext.fillStyle = 'white'; canvasContext.fillRect(0, 0, renderCanvas.width, renderCanvas.height); const renderCanvasData = canvasContext.getImageData(0, 0, image.width, image.height); enabledElement.renderingTools.renderCanvasContext = canvasContext; enabledElement.renderingTools.renderCanvasData = renderCanvasData; } /***/ }, /***/ 83475 /*!***************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/lutMatches.js ***! \***************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ lutMatches) /* harmony export */ }); function lutMatches(a, b) { if (!a && !b) { return true; } if (!a || !b) { return false; } return a.id === b.id; } /***/ }, /***/ 68193 /*!********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/now.js ***! \********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__() { if (window.performance) { return performance.now(); } return Date.now(); } /***/ }, /***/ 39632 /*!******************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/pixelToCanvas.js ***! \******************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _getTransform__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getTransform */ 75613); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(enabledElement, pt) { const transform = (0,_getTransform__WEBPACK_IMPORTED_MODULE_0__["default"])(enabledElement); return transform.transformPoint(pt); } /***/ }, /***/ 22917 /*!*********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/renderColorImage.js ***! \*********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ renderColorImage: () => (/* binding */ renderColorImage) /* harmony export */ }); /* harmony import */ var _now__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./now */ 68193); /* harmony import */ var _generateColorLUT__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./generateColorLUT */ 50170); /* harmony import */ var _storedColorPixelDataToCanvasImageData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./storedColorPixelDataToCanvasImageData */ 43569); /* harmony import */ var _storedRGBAPixelDataToCanvasImageData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./storedRGBAPixelDataToCanvasImageData */ 64402); /* harmony import */ var _setToPixelCoordinateSystem__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./setToPixelCoordinateSystem */ 60521); /* harmony import */ var _doesImageNeedToBeRendered__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./doesImageNeedToBeRendered */ 65138); /* harmony import */ var _initializeRenderCanvas__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./initializeRenderCanvas */ 67943); /* harmony import */ var _saveLastRendered__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./saveLastRendered */ 80945); /* harmony import */ var _getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../getOrCreateCanvas */ 63628); function getLut(image, viewport) { if (image.cachedLut !== undefined && image.cachedLut.windowCenter === viewport.voi.windowCenter && image.cachedLut.windowWidth === viewport.voi.windowWidth && image.cachedLut.invert === viewport.invert) { return image.cachedLut.lutArray; } (0,_generateColorLUT__WEBPACK_IMPORTED_MODULE_1__["default"])(image, viewport.voi.windowWidth, viewport.voi.windowCenter, viewport.invert); image.cachedLut.windowWidth = viewport.voi.windowWidth; image.cachedLut.windowCenter = viewport.voi.windowCenter; image.cachedLut.invert = viewport.invert; return image.cachedLut.lutArray; } function getRenderCanvas(enabledElement, image, invalidated) { const canvasWasColor = enabledElement.renderingTools.lastRenderedIsColor; if (!enabledElement.renderingTools.renderCanvas || !canvasWasColor) { enabledElement.renderingTools.renderCanvas = (0,_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_8__.createCanvas)(null, image.width, image.height); } const renderCanvas = enabledElement.renderingTools.renderCanvas; const { windowWidth, windowCenter } = enabledElement.viewport.voi; if ((windowWidth === 256 || windowWidth === 255) && (windowCenter === 128 || windowCenter === 127) && !enabledElement.viewport.invert && image.getCanvas && image.getCanvas()) { return image.getCanvas(); } if (!(0,_doesImageNeedToBeRendered__WEBPACK_IMPORTED_MODULE_5__["default"])(enabledElement, image) && !invalidated) { return renderCanvas; } if (!enabledElement.renderingTools.renderCanvasContext || renderCanvas.width !== image.width || renderCanvas.height !== image.height) { (0,_initializeRenderCanvas__WEBPACK_IMPORTED_MODULE_6__["default"])(enabledElement, image); } let start = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])(); const colorLUT = getLut(image, enabledElement.viewport); image.stats = image.stats || {}; image.stats.lastLutGenerateTime = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])() - start; const renderCanvasData = enabledElement.renderingTools.renderCanvasData; const renderCanvasContext = enabledElement.renderingTools.renderCanvasContext; if (image.rgba) { (0,_storedRGBAPixelDataToCanvasImageData__WEBPACK_IMPORTED_MODULE_3__["default"])(image, colorLUT, renderCanvasData.data); } else { (0,_storedColorPixelDataToCanvasImageData__WEBPACK_IMPORTED_MODULE_2__["default"])(image, colorLUT, renderCanvasData.data); } start = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])(); renderCanvasContext.putImageData(renderCanvasData, 0, 0); image.stats.lastPutImageDataTime = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])() - start; return renderCanvas; } function renderColorImage(enabledElement, invalidated) { if (enabledElement === undefined) { throw new Error('renderColorImage: enabledElement parameter must not be undefined'); } const image = enabledElement.image; if (image === undefined) { throw new Error('renderColorImage: image must be loaded before it can be drawn'); } const context = enabledElement.canvas.getContext('2d'); context.setTransform(1, 0, 0, 1, 0, 0); context.fillStyle = 'black'; context.fillRect(0, 0, enabledElement.canvas.width, enabledElement.canvas.height); context.imageSmoothingEnabled = !enabledElement.viewport.pixelReplication; (0,_setToPixelCoordinateSystem__WEBPACK_IMPORTED_MODULE_4__["default"])(enabledElement, context); const renderCanvas = getRenderCanvas(enabledElement, image, invalidated); const sx = enabledElement.viewport.displayedArea.tlhc.x - 1; const sy = enabledElement.viewport.displayedArea.tlhc.y - 1; const width = enabledElement.viewport.displayedArea.brhc.x - sx; const height = enabledElement.viewport.displayedArea.brhc.y - sy; context.drawImage(renderCanvas, sx, sy, width, height, 0, 0, width, height); enabledElement.renderingTools = (0,_saveLastRendered__WEBPACK_IMPORTED_MODULE_7__["default"])(enabledElement); } /***/ }, /***/ 94949 /*!*************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/renderGrayscaleImage.js ***! \*************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ renderGrayscaleImage: () => (/* binding */ renderGrayscaleImage) /* harmony export */ }); /* harmony import */ var _storedPixelDataToCanvasImageData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./storedPixelDataToCanvasImageData */ 57692); /* harmony import */ var _storedPixelDataToCanvasImageDataPET__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./storedPixelDataToCanvasImageDataPET */ 84819); /* harmony import */ var _storedPixelDataToCanvasImageDataRGBA__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./storedPixelDataToCanvasImageDataRGBA */ 97934); /* harmony import */ var _setToPixelCoordinateSystem__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./setToPixelCoordinateSystem */ 60521); /* harmony import */ var _now__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./now */ 68193); /* harmony import */ var _getLut__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./getLut */ 92880); /* harmony import */ var _doesImageNeedToBeRendered__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./doesImageNeedToBeRendered */ 65138); /* harmony import */ var _initializeRenderCanvas__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./initializeRenderCanvas */ 67943); /* harmony import */ var _saveLastRendered__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./saveLastRendered */ 80945); /* harmony import */ var _getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../getOrCreateCanvas */ 63628); function getRenderCanvas(enabledElement, image, invalidated, useAlphaChannel = true) { const canvasWasColor = enabledElement.renderingTools.lastRenderedIsColor; if (!enabledElement.renderingTools.renderCanvas || canvasWasColor) { enabledElement.renderingTools.renderCanvas = (0,_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_9__.createCanvas)(null, image.width, image.height); (0,_initializeRenderCanvas__WEBPACK_IMPORTED_MODULE_7__["default"])(enabledElement, image); } const renderCanvas = enabledElement.renderingTools.renderCanvas; if (!(0,_doesImageNeedToBeRendered__WEBPACK_IMPORTED_MODULE_6__["default"])(enabledElement, image) && !invalidated) { return renderCanvas; } if (renderCanvas.width !== image.width || renderCanvas.height !== image.height) { (0,_initializeRenderCanvas__WEBPACK_IMPORTED_MODULE_7__["default"])(enabledElement, image); } image.stats = image.stats || {}; const renderCanvasData = enabledElement.renderingTools.renderCanvasData; const renderCanvasContext = enabledElement.renderingTools.renderCanvasContext; let start = (0,_now__WEBPACK_IMPORTED_MODULE_4__["default"])(); image.stats.lastLutGenerateTime = (0,_now__WEBPACK_IMPORTED_MODULE_4__["default"])() - start; const { viewport } = enabledElement; if (viewport.modality === 'PT' && image.isPreScaled) { const { windowWidth, windowCenter } = viewport.voi; const minimum = windowCenter - windowWidth / 2; const maximum = windowCenter + windowWidth / 2; const range = maximum - minimum; const collectedMultiplierTerms = 255.0 / range; let petVOILutFunction; if (viewport.invert) { petVOILutFunction = value => 255 - (value - minimum) * collectedMultiplierTerms; } else { petVOILutFunction = value => (value - minimum) * collectedMultiplierTerms; } (0,_storedPixelDataToCanvasImageDataPET__WEBPACK_IMPORTED_MODULE_1__["default"])(image, petVOILutFunction, renderCanvasData.data); } else { const lut = (0,_getLut__WEBPACK_IMPORTED_MODULE_5__["default"])(image, viewport, invalidated); if (useAlphaChannel) { (0,_storedPixelDataToCanvasImageData__WEBPACK_IMPORTED_MODULE_0__["default"])(image, lut, renderCanvasData.data); } else { (0,_storedPixelDataToCanvasImageDataRGBA__WEBPACK_IMPORTED_MODULE_2__["default"])(image, lut, renderCanvasData.data); } } start = (0,_now__WEBPACK_IMPORTED_MODULE_4__["default"])(); renderCanvasContext.putImageData(renderCanvasData, 0, 0); image.stats.lastPutImageDataTime = (0,_now__WEBPACK_IMPORTED_MODULE_4__["default"])() - start; return renderCanvas; } function renderGrayscaleImage(enabledElement, invalidated) { if (enabledElement === undefined) { throw new Error('drawImage: enabledElement parameter must not be undefined'); } const image = enabledElement.image; if (image === undefined) { throw new Error('drawImage: image must be loaded before it can be drawn'); } const context = enabledElement.canvas.getContext('2d'); context.setTransform(1, 0, 0, 1, 0, 0); context.fillStyle = 'black'; context.fillRect(0, 0, enabledElement.canvas.width, enabledElement.canvas.height); context.imageSmoothingEnabled = !enabledElement.viewport.pixelReplication; (0,_setToPixelCoordinateSystem__WEBPACK_IMPORTED_MODULE_3__["default"])(enabledElement, context); const renderCanvas = getRenderCanvas(enabledElement, image, invalidated); const sx = enabledElement.viewport.displayedArea.tlhc.x - 1; const sy = enabledElement.viewport.displayedArea.tlhc.y - 1; const width = enabledElement.viewport.displayedArea.brhc.x - sx; const height = enabledElement.viewport.displayedArea.brhc.y - sy; context.drawImage(renderCanvas, sx, sy, width, height, 0, 0, width, height); enabledElement.renderingTools = (0,_saveLastRendered__WEBPACK_IMPORTED_MODULE_8__["default"])(enabledElement); } /***/ }, /***/ 49819 /*!***************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/renderPseudoColorImage.js ***! \***************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ renderPseudoColorImage: () => (/* binding */ renderPseudoColorImage) /* harmony export */ }); /* harmony import */ var _setToPixelCoordinateSystem__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setToPixelCoordinateSystem */ 60521); /* harmony import */ var _now__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./now */ 68193); /* harmony import */ var _initializeRenderCanvas__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./initializeRenderCanvas */ 67943); /* harmony import */ var _getLut__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getLut */ 92880); /* harmony import */ var _saveLastRendered__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./saveLastRendered */ 80945); /* harmony import */ var _doesImageNeedToBeRendered__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./doesImageNeedToBeRendered */ 65138); /* harmony import */ var _storedPixelDataToCanvasImageDataPseudocolorLUT__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./storedPixelDataToCanvasImageDataPseudocolorLUT */ 36370); /* harmony import */ var _storedPixelDataToCanvasImageDataPseudocolorLUTPET__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./storedPixelDataToCanvasImageDataPseudocolorLUTPET */ 51029); /* harmony import */ var _colors_index__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../colors/index */ 17940); /* harmony import */ var _utilities_clamp__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../../utilities/clamp */ 67966); /* harmony import */ var _getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../getOrCreateCanvas */ 63628); function getRenderCanvas(enabledElement, image, invalidated) { if (!enabledElement.renderingTools.renderCanvas) { enabledElement.renderingTools.renderCanvas = (0,_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_10__.createCanvas)(null, image.width, image.height); } const renderCanvas = enabledElement.renderingTools.renderCanvas; let colormap = enabledElement.viewport.colormap || enabledElement.options.colormap; if (enabledElement.options && enabledElement.options.colormap) { console.warn('enabledElement.options.colormap is deprecated. Use enabledElement.viewport.colormap instead'); } if (colormap && typeof colormap === 'string') { colormap = _colors_index__WEBPACK_IMPORTED_MODULE_8__.getColormap(colormap); } if (!colormap) { throw new Error('renderPseudoColorImage: colormap not found.'); } const colormapId = colormap.getId(); if (!(0,_doesImageNeedToBeRendered__WEBPACK_IMPORTED_MODULE_5__["default"])(enabledElement, image) && !invalidated && enabledElement.renderingTools.colormapId === colormapId) { return renderCanvas; } if (!enabledElement.renderingTools.renderCanvasContext || renderCanvas.width !== image.width || renderCanvas.height !== image.height) { (0,_initializeRenderCanvas__WEBPACK_IMPORTED_MODULE_2__["default"])(enabledElement, image); } let start = (0,_now__WEBPACK_IMPORTED_MODULE_1__["default"])(); if (!enabledElement.renderingTools.colorLUT || invalidated || enabledElement.renderingTools.colormapId !== colormapId) { colormap.setNumberOfColors(256); enabledElement.renderingTools.colorLUT = colormap.createLookupTable(); enabledElement.renderingTools.colormapId = colormapId; } const renderCanvasData = enabledElement.renderingTools.renderCanvasData; const renderCanvasContext = enabledElement.renderingTools.renderCanvasContext; const { viewport } = enabledElement; const colorLUT = enabledElement.renderingTools.colorLUT; if (viewport.modality === 'PT') { const { windowWidth, windowCenter } = viewport.voi; const minimum = windowCenter - windowWidth / 2; const maximum = windowCenter + windowWidth / 2; const range = maximum - minimum; const collectedMultiplierTerms = 255.0 / range; let petVOILutFunction; if (viewport.invert) { petVOILutFunction = value => { return (0,_utilities_clamp__WEBPACK_IMPORTED_MODULE_9__.clamp)(Math.floor(255 - (value - minimum) * collectedMultiplierTerms), 0, 255); }; } else { petVOILutFunction = value => { return (0,_utilities_clamp__WEBPACK_IMPORTED_MODULE_9__.clamp)(Math.floor((value - minimum) * collectedMultiplierTerms), 0, 255); }; } (0,_storedPixelDataToCanvasImageDataPseudocolorLUTPET__WEBPACK_IMPORTED_MODULE_7__["default"])(image, petVOILutFunction, colorLUT, renderCanvasData.data); } else { const lut = (0,_getLut__WEBPACK_IMPORTED_MODULE_3__["default"])(image, enabledElement.viewport, invalidated); image.stats = image.stats || {}; image.stats.lastLutGenerateTime = (0,_now__WEBPACK_IMPORTED_MODULE_1__["default"])() - start; (0,_storedPixelDataToCanvasImageDataPseudocolorLUT__WEBPACK_IMPORTED_MODULE_6__["default"])(image, lut, colorLUT, renderCanvasData.data); } start = (0,_now__WEBPACK_IMPORTED_MODULE_1__["default"])(); renderCanvasContext.putImageData(renderCanvasData, 0, 0); image.stats.lastPutImageDataTime = (0,_now__WEBPACK_IMPORTED_MODULE_1__["default"])() - start; return renderCanvas; } function renderPseudoColorImage(enabledElement, invalidated) { if (enabledElement === undefined) { throw new Error('drawImage: enabledElement parameter must not be undefined'); } const image = enabledElement.image; if (image === undefined) { throw new Error('drawImage: image must be loaded before it can be drawn'); } const context = enabledElement.canvas.getContext('2d'); context.setTransform(1, 0, 0, 1, 0, 0); context.fillStyle = 'black'; context.fillRect(0, 0, enabledElement.canvas.width, enabledElement.canvas.height); context.imageSmoothingEnabled = !enabledElement.viewport.pixelReplication; (0,_setToPixelCoordinateSystem__WEBPACK_IMPORTED_MODULE_0__["default"])(enabledElement, context); const renderCanvas = getRenderCanvas(enabledElement, image, invalidated); const sx = enabledElement.viewport.displayedArea.tlhc.x - 1; const sy = enabledElement.viewport.displayedArea.tlhc.y - 1; const width = enabledElement.viewport.displayedArea.brhc.x - sx; const height = enabledElement.viewport.displayedArea.brhc.y - sy; context.drawImage(renderCanvas, sx, sy, width, height, 0, 0, width, height); enabledElement.renderingTools = (0,_saveLastRendered__WEBPACK_IMPORTED_MODULE_4__["default"])(enabledElement); } /***/ }, /***/ 14325 /*!****************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/resetCamera.js ***! \****************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _getImageFitScale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getImageFitScale */ 98579); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(enabledElement, resetPan = true, resetZoom = true) { const { canvas, image, viewport } = enabledElement; const scale = (0,_getImageFitScale__WEBPACK_IMPORTED_MODULE_0__["default"])(canvas, image, 0).scaleFactor; viewport.vflip = false; viewport.hflip = false; if (resetPan) { viewport.translation.x = 0; viewport.translation.y = 0; } if (resetZoom) { viewport.displayedArea.tlhc.x = 1; viewport.displayedArea.tlhc.y = 1; viewport.displayedArea.brhc.x = image.columns; viewport.displayedArea.brhc.y = image.rows; viewport.scale = scale; } } /***/ }, /***/ 21757 /*!***********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/resize.js ***! \***********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _fitToWindow__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./fitToWindow */ 58335); /* harmony import */ var _getImageSize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getImageSize */ 76849); function setCanvasSize(enabledElement) { const { canvas } = enabledElement; const { clientWidth, clientHeight } = canvas; if (canvas.width !== clientWidth || canvas.height !== clientHeight) { canvas.width = clientWidth; canvas.height = clientHeight; } } function wasFitToWindow(enabledElement, oldCanvasWidth, oldCanvasHeight) { const scale = enabledElement.viewport.scale; const imageSize = (0,_getImageSize__WEBPACK_IMPORTED_MODULE_1__["default"])(enabledElement.image, enabledElement.viewport.rotation); const imageWidth = Math.round(imageSize.width * scale); const imageHeight = Math.round(imageSize.height * scale); const x = enabledElement.viewport.translation.x; const y = enabledElement.viewport.translation.y; return imageWidth === oldCanvasWidth && imageHeight <= oldCanvasHeight || imageWidth <= oldCanvasWidth && imageHeight === oldCanvasHeight && x === 0 && y === 0; } function relativeRescale(enabledElement, oldCanvasWidth, oldCanvasHeight) { const scale = enabledElement.viewport.scale; const canvasWidth = enabledElement.canvas.width; const canvasHeight = enabledElement.canvas.height; const relWidthChange = canvasWidth / oldCanvasWidth; const relHeightChange = canvasHeight / oldCanvasHeight; const relChange = Math.sqrt(relWidthChange * relHeightChange); enabledElement.viewport.scale = relChange * scale; } /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(enabledElement, forceFitToWindow = false) { const oldCanvasWidth = enabledElement.canvas.width; const oldCanvasHeight = enabledElement.canvas.height; setCanvasSize(enabledElement); if (enabledElement.image === undefined) { return; } if (forceFitToWindow || wasFitToWindow(enabledElement, oldCanvasWidth, oldCanvasHeight)) { (0,_fitToWindow__WEBPACK_IMPORTED_MODULE_0__["default"])(enabledElement); } else { relativeRescale(enabledElement, oldCanvasWidth, oldCanvasHeight); } } /***/ }, /***/ 80945 /*!*********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/saveLastRendered.js ***! \*********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(enabledElement) { const imageId = enabledElement.image.imageId; const viewport = enabledElement.viewport; const isColor = enabledElement.image.color; enabledElement.renderingTools.lastRenderedImageId = imageId; enabledElement.renderingTools.lastRenderedIsColor = isColor; enabledElement.renderingTools.lastRenderedViewport = { windowCenter: viewport.voi.windowCenter, windowWidth: viewport.voi.windowWidth, invert: viewport.invert, rotation: viewport.rotation, hflip: viewport.hflip, vflip: viewport.vflip, modalityLUT: viewport.modalityLUT, voiLUT: viewport.voiLUT, colormap: viewport.colormap }; return enabledElement.renderingTools; } /***/ }, /***/ 42322 /*!***********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/setDefaultViewport.js ***! \***********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__), /* harmony export */ state: () => (/* binding */ state) /* harmony export */ }); const state = { viewport: {} }; /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(viewport) { state.viewport = viewport || {}; } /***/ }, /***/ 60521 /*!*******************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/setToPixelCoordinateSystem.js ***! \*******************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _calculateTransform__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./calculateTransform */ 45649); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(enabledElement, context, scale) { if (enabledElement === undefined) { throw new Error('setToPixelCoordinateSystem: parameter enabledElement must not be undefined'); } if (context === undefined) { throw new Error('setToPixelCoordinateSystem: parameter context must not be undefined'); } const transform = (0,_calculateTransform__WEBPACK_IMPORTED_MODULE_0__["default"])(enabledElement, scale); const m = transform.getMatrix(); context.setTransform(m[0], m[1], m[2], m[3], m[4], m[5]); } /***/ }, /***/ 43569 /*!******************************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/storedColorPixelDataToCanvasImageData.js ***! \******************************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _now__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./now */ 68193); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(image, lut, canvasImageDataData) { let start = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])(); const pixelData = image.voxelManager.getScalarData(); image.stats.lastGetPixelDataTime = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])() - start; const minPixelValue = image.minPixelValue; let canvasImageDataIndex = 0; let storedPixelDataIndex = 0; const numPixels = pixelData.length; start = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])(); if (minPixelValue < 0) { while (storedPixelDataIndex < numPixels) { canvasImageDataData[canvasImageDataIndex++] = lut[pixelData[storedPixelDataIndex++] + -minPixelValue]; canvasImageDataData[canvasImageDataIndex++] = lut[pixelData[storedPixelDataIndex++] + -minPixelValue]; canvasImageDataData[canvasImageDataIndex++] = lut[pixelData[storedPixelDataIndex++] + -minPixelValue]; canvasImageDataData[canvasImageDataIndex++] = 255; } } else { while (storedPixelDataIndex < numPixels) { canvasImageDataData[canvasImageDataIndex++] = lut[pixelData[storedPixelDataIndex++]]; canvasImageDataData[canvasImageDataIndex++] = lut[pixelData[storedPixelDataIndex++]]; canvasImageDataData[canvasImageDataIndex++] = lut[pixelData[storedPixelDataIndex++]]; canvasImageDataData[canvasImageDataIndex++] = 255; } } image.stats.lastStoredPixelDataToCanvasImageDataTime = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])() - start; } /***/ }, /***/ 57692 /*!*************************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/storedPixelDataToCanvasImageData.js ***! \*************************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _now__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./now */ 68193); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(image, lut, canvasImageDataData) { let start = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])(); const pixelData = image.voxelManager.getScalarData(); image.stats.lastGetPixelDataTime = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])() - start; const numPixels = pixelData.length; const minPixelValue = image.minPixelValue; let canvasImageDataIndex = 3; let storedPixelDataIndex = 0; start = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])(); if (pixelData instanceof Int16Array) { if (minPixelValue < 0) { while (storedPixelDataIndex < numPixels) { canvasImageDataData[canvasImageDataIndex] = lut[pixelData[storedPixelDataIndex++] + -minPixelValue]; canvasImageDataIndex += 4; } } else { while (storedPixelDataIndex < numPixels) { canvasImageDataData[canvasImageDataIndex] = lut[pixelData[storedPixelDataIndex++]]; canvasImageDataIndex += 4; } } } else if (pixelData instanceof Uint16Array) { while (storedPixelDataIndex < numPixels) { canvasImageDataData[canvasImageDataIndex] = lut[pixelData[storedPixelDataIndex++]]; canvasImageDataIndex += 4; } } else if (minPixelValue < 0) { while (storedPixelDataIndex < numPixels) { canvasImageDataData[canvasImageDataIndex] = lut[pixelData[storedPixelDataIndex++] + -minPixelValue]; canvasImageDataIndex += 4; } } else { while (storedPixelDataIndex < numPixels) { canvasImageDataData[canvasImageDataIndex] = lut[pixelData[storedPixelDataIndex++]]; canvasImageDataIndex += 4; } } image.stats.lastStoredPixelDataToCanvasImageDataTime = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])() - start; } /***/ }, /***/ 84819 /*!****************************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/storedPixelDataToCanvasImageDataPET.js ***! \****************************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _now__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./now */ 68193); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(image, lutFunction, canvasImageDataData) { let start = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])(); const pixelData = image.voxelManager.getScalarData(); image.stats.lastGetPixelDataTime = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])() - start; const numPixels = pixelData.length; let canvasImageDataIndex = 3; let storedPixelDataIndex = 0; start = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])(); while (storedPixelDataIndex < numPixels) { canvasImageDataData[canvasImageDataIndex] = lutFunction(pixelData[storedPixelDataIndex++]); canvasImageDataIndex += 4; } image.stats.lastStoredPixelDataToCanvasImageDataTime = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])() - start; } /***/ }, /***/ 36370 /*!***************************************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/storedPixelDataToCanvasImageDataPseudocolorLUT.js ***! \***************************************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _colors_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors/index */ 59533); /* harmony import */ var _now__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./now */ 68193); function storedPixelDataToCanvasImageDataPseudocolorLUT(image, grayscaleLut, colorLUT, canvasImageDataData) { let start = (0,_now__WEBPACK_IMPORTED_MODULE_1__["default"])(); const pixelData = image.voxelManager.getScalarData(); image.stats.lastGetPixelDataTime = (0,_now__WEBPACK_IMPORTED_MODULE_1__["default"])() - start; const numPixels = pixelData.length; const minPixelValue = image.minPixelValue; let canvasImageDataIndex = 0; let storedPixelDataIndex = 0; let grayscale; let rgba; let clut; start = (0,_now__WEBPACK_IMPORTED_MODULE_1__["default"])(); if (colorLUT instanceof _colors_index__WEBPACK_IMPORTED_MODULE_0__["default"]) { clut = colorLUT.Table; } else { clut = colorLUT; } if (minPixelValue < 0) { while (storedPixelDataIndex < numPixels) { grayscale = grayscaleLut[pixelData[storedPixelDataIndex++] + -minPixelValue]; rgba = clut[grayscale]; canvasImageDataData[canvasImageDataIndex++] = rgba[0]; canvasImageDataData[canvasImageDataIndex++] = rgba[1]; canvasImageDataData[canvasImageDataIndex++] = rgba[2]; canvasImageDataData[canvasImageDataIndex++] = rgba[3]; } } else { while (storedPixelDataIndex < numPixels) { grayscale = grayscaleLut[pixelData[storedPixelDataIndex++]]; rgba = clut[grayscale]; canvasImageDataData[canvasImageDataIndex++] = rgba[0]; canvasImageDataData[canvasImageDataIndex++] = rgba[1]; canvasImageDataData[canvasImageDataIndex++] = rgba[2]; canvasImageDataData[canvasImageDataIndex++] = rgba[3]; } } image.stats.lastStoredPixelDataToCanvasImageDataTime = (0,_now__WEBPACK_IMPORTED_MODULE_1__["default"])() - start; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (storedPixelDataToCanvasImageDataPseudocolorLUT); /***/ }, /***/ 51029 /*!******************************************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/storedPixelDataToCanvasImageDataPseudocolorLUTPET.js ***! \******************************************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _colors_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../colors/index */ 59533); /* harmony import */ var _now__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./now */ 68193); function storedPixelDataToCanvasImageDataPseudocolorLUTPET(image, lutFunction, colorLUT, canvasImageDataData) { let start = (0,_now__WEBPACK_IMPORTED_MODULE_1__["default"])(); const pixelData = image.voxelManager.getScalarData(); image.stats.lastGetPixelDataTime = (0,_now__WEBPACK_IMPORTED_MODULE_1__["default"])() - start; const numPixels = pixelData.length; const minPixelValue = image.minPixelValue; let canvasImageDataIndex = 0; let storedPixelDataIndex = 0; let grayscale; let rgba; let clut; start = (0,_now__WEBPACK_IMPORTED_MODULE_1__["default"])(); if (colorLUT instanceof _colors_index__WEBPACK_IMPORTED_MODULE_0__["default"]) { clut = colorLUT.Table; } else { clut = colorLUT; } if (minPixelValue < 0) { while (storedPixelDataIndex < numPixels) { grayscale = lutFunction(pixelData[storedPixelDataIndex++] + -minPixelValue); rgba = clut[grayscale]; canvasImageDataData[canvasImageDataIndex++] = rgba[0]; canvasImageDataData[canvasImageDataIndex++] = rgba[1]; canvasImageDataData[canvasImageDataIndex++] = rgba[2]; canvasImageDataData[canvasImageDataIndex++] = rgba[3]; } } else { while (storedPixelDataIndex < numPixels) { grayscale = lutFunction(pixelData[storedPixelDataIndex++]); rgba = clut[grayscale]; canvasImageDataData[canvasImageDataIndex++] = rgba[0]; canvasImageDataData[canvasImageDataIndex++] = rgba[1]; canvasImageDataData[canvasImageDataIndex++] = rgba[2]; canvasImageDataData[canvasImageDataIndex++] = rgba[3]; } } image.stats.lastStoredPixelDataToCanvasImageDataTime = (0,_now__WEBPACK_IMPORTED_MODULE_1__["default"])() - start; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (storedPixelDataToCanvasImageDataPseudocolorLUTPET); /***/ }, /***/ 97934 /*!*****************************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/storedPixelDataToCanvasImageDataRGBA.js ***! \*****************************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _now__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./now */ 68193); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(image, lut, canvasImageDataData) { let start = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])(); const pixelData = image.voxelManager.getScalarData(); image.stats.lastGetPixelDataTime = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])() - start; const numPixels = pixelData.length; const minPixelValue = image.minPixelValue; let canvasImageDataIndex = 0; let storedPixelDataIndex = 0; let pixelValue; start = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])(); if (pixelData instanceof Int16Array) { if (minPixelValue < 0) { while (storedPixelDataIndex < numPixels) { pixelValue = lut[pixelData[storedPixelDataIndex++] + -minPixelValue]; canvasImageDataData[canvasImageDataIndex++] = pixelValue; canvasImageDataData[canvasImageDataIndex++] = pixelValue; canvasImageDataData[canvasImageDataIndex++] = pixelValue; canvasImageDataData[canvasImageDataIndex++] = 255; } } else { while (storedPixelDataIndex < numPixels) { pixelValue = lut[pixelData[storedPixelDataIndex++]]; canvasImageDataData[canvasImageDataIndex++] = pixelValue; canvasImageDataData[canvasImageDataIndex++] = pixelValue; canvasImageDataData[canvasImageDataIndex++] = pixelValue; canvasImageDataData[canvasImageDataIndex++] = 255; } } } else if (pixelData instanceof Uint16Array) { while (storedPixelDataIndex < numPixels) { pixelValue = lut[pixelData[storedPixelDataIndex++]]; canvasImageDataData[canvasImageDataIndex++] = pixelValue; canvasImageDataData[canvasImageDataIndex++] = pixelValue; canvasImageDataData[canvasImageDataIndex++] = pixelValue; canvasImageDataData[canvasImageDataIndex++] = 255; } } else if (minPixelValue < 0) { while (storedPixelDataIndex < numPixels) { pixelValue = lut[pixelData[storedPixelDataIndex++] + -minPixelValue]; canvasImageDataData[canvasImageDataIndex++] = pixelValue; canvasImageDataData[canvasImageDataIndex++] = pixelValue; canvasImageDataData[canvasImageDataIndex++] = pixelValue; canvasImageDataData[canvasImageDataIndex++] = 255; } } else { while (storedPixelDataIndex < numPixels) { pixelValue = lut[pixelData[storedPixelDataIndex++]]; canvasImageDataData[canvasImageDataIndex++] = pixelValue; canvasImageDataData[canvasImageDataIndex++] = pixelValue; canvasImageDataData[canvasImageDataIndex++] = pixelValue; canvasImageDataData[canvasImageDataIndex++] = 255; } } image.stats.lastStoredPixelDataToCanvasImageDataTime = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])() - start; } /***/ }, /***/ 64402 /*!*****************************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/storedRGBAPixelDataToCanvasImageData.js ***! \*****************************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* export default binding */ __WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _now__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./now */ 68193); /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(image, lut, canvasImageDataData) { let start = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])(); const pixelData = image.getPixelData(); image.stats.lastGetPixelDataTime = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])() - start; const minPixelValue = image.minPixelValue; let canvasImageDataIndex = 0; let storedPixelDataIndex = 0; const numPixels = pixelData.length; start = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])(); if (minPixelValue < 0) { while (storedPixelDataIndex < numPixels) { canvasImageDataData[canvasImageDataIndex++] = lut[pixelData[storedPixelDataIndex++] + -minPixelValue]; canvasImageDataData[canvasImageDataIndex++] = lut[pixelData[storedPixelDataIndex++] + -minPixelValue]; canvasImageDataData[canvasImageDataIndex++] = lut[pixelData[storedPixelDataIndex++] + -minPixelValue]; canvasImageDataData[canvasImageDataIndex++] = pixelData[storedPixelDataIndex++]; } } else { while (storedPixelDataIndex < numPixels) { canvasImageDataData[canvasImageDataIndex++] = lut[pixelData[storedPixelDataIndex++]]; canvasImageDataData[canvasImageDataIndex++] = lut[pixelData[storedPixelDataIndex++]]; canvasImageDataData[canvasImageDataIndex++] = lut[pixelData[storedPixelDataIndex++]]; canvasImageDataData[canvasImageDataIndex++] = pixelData[storedPixelDataIndex++]; } } image.stats.lastStoredPixelDataToCanvasImageDataTime = (0,_now__WEBPACK_IMPORTED_MODULE_0__["default"])() - start; } /***/ }, /***/ 98233 /*!**************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/transform.js ***! \**************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Transform: () => (/* binding */ Transform) /* harmony export */ }); class Transform { constructor() { this.reset(); } getMatrix() { return this.m; } reset() { this.m = [1, 0, 0, 1, 0, 0]; } clone() { const transform = new Transform(); transform.m[0] = this.m[0]; transform.m[1] = this.m[1]; transform.m[2] = this.m[2]; transform.m[3] = this.m[3]; transform.m[4] = this.m[4]; transform.m[5] = this.m[5]; return transform; } multiply(matrix) { const m11 = this.m[0] * matrix[0] + this.m[2] * matrix[1]; const m12 = this.m[1] * matrix[0] + this.m[3] * matrix[1]; const m21 = this.m[0] * matrix[2] + this.m[2] * matrix[3]; const m22 = this.m[1] * matrix[2] + this.m[3] * matrix[3]; const dx = this.m[0] * matrix[4] + this.m[2] * matrix[5] + this.m[4]; const dy = this.m[1] * matrix[4] + this.m[3] * matrix[5] + this.m[5]; this.m[0] = m11; this.m[1] = m12; this.m[2] = m21; this.m[3] = m22; this.m[4] = dx; this.m[5] = dy; } invert() { const d = 1 / (this.m[0] * this.m[3] - this.m[1] * this.m[2]); const m0 = this.m[3] * d; const m1 = -this.m[1] * d; const m2 = -this.m[2] * d; const m3 = this.m[0] * d; const m4 = d * (this.m[2] * this.m[5] - this.m[3] * this.m[4]); const m5 = d * (this.m[1] * this.m[4] - this.m[0] * this.m[5]); this.m[0] = m0; this.m[1] = m1; this.m[2] = m2; this.m[3] = m3; this.m[4] = m4; this.m[5] = m5; } rotate(rad) { const c = Math.cos(rad); const s = Math.sin(rad); const m11 = this.m[0] * c + this.m[2] * s; const m12 = this.m[1] * c + this.m[3] * s; const m21 = this.m[0] * -s + this.m[2] * c; const m22 = this.m[1] * -s + this.m[3] * c; this.m[0] = m11; this.m[1] = m12; this.m[2] = m21; this.m[3] = m22; } translate(x, y) { this.m[4] += this.m[0] * x + this.m[2] * y; this.m[5] += this.m[1] * x + this.m[3] * y; } scale(sx, sy) { this.m[0] *= sx; this.m[1] *= sx; this.m[2] *= sy; this.m[3] *= sy; } transformPoint(point) { const x = point[0]; const y = point[1]; return [x * this.m[0] + y * this.m[2] + this.m[4], x * this.m[1] + y * this.m[3] + this.m[5]]; } } /***/ }, /***/ 73107 /*!**************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/cpuFallback/rendering/validator.js ***! \**************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ validateParameterUndefined: () => (/* binding */ validateParameterUndefined), /* harmony export */ validateParameterUndefinedOrNull: () => (/* binding */ validateParameterUndefinedOrNull) /* harmony export */ }); function validateParameterUndefined(checkParam, errorMsg) { if (checkParam === undefined) { throw new Error(errorMsg); } } function validateParameterUndefinedOrNull(checkParam, errorMsg) { if (checkParam === undefined || checkParam === null) { throw new Error(errorMsg); } } /***/ }, /***/ 24402 /*!************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/createVolumeActor.js ***! \************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _kitware_vtk_js_Rendering_Core_Volume__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/Volume */ 40698); /* harmony import */ var _loaders_volumeLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../loaders/volumeLoader */ 10372); /* harmony import */ var _createVolumeMapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./createVolumeMapper */ 59766); /* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utilities/triggerEvent */ 91133); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../enums */ 14566); /* harmony import */ var _setDefaultVolumeVOI__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./setDefaultVolumeVOI */ 38198); /* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../init */ 15678); function createVolumeActor(_x, _x2, _x3) { return _createVolumeActor.apply(this, arguments); } function _createVolumeActor() { _createVolumeActor = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (props, element, viewportId, suppressEvents = false) { const { volumeId, callback, blendMode } = props; const imageVolume = yield (0,_loaders_volumeLoader__WEBPACK_IMPORTED_MODULE_2__.loadVolume)(volumeId); if (!imageVolume) { throw new Error(`imageVolume with id: ${imageVolume.volumeId} does not exist`); } const { imageData, vtkOpenGLTexture } = imageVolume; const volumeMapper = (0,_createVolumeMapper__WEBPACK_IMPORTED_MODULE_3__["default"])(imageData, vtkOpenGLTexture); if (blendMode) { volumeMapper.setBlendMode(blendMode); } const volumeActor = _kitware_vtk_js_Rendering_Core_Volume__WEBPACK_IMPORTED_MODULE_1__["default"].newInstance(); volumeActor.setMapper(volumeMapper); const { numberOfComponents } = imageData.get('numberOfComponents'); const volumeProperty = volumeActor.getProperty(); volumeProperty.set({ viewportId: viewportId }, true); if ((0,_init__WEBPACK_IMPORTED_MODULE_7__.getConfiguration)().rendering.preferSizeOverAccuracy) { volumeProperty.setPreferSizeOverAccuracy(true); } if (numberOfComponents === 3) { volumeActor.getProperty().setIndependentComponents(false); } yield (0,_setDefaultVolumeVOI__WEBPACK_IMPORTED_MODULE_6__["default"])(volumeActor, imageVolume); if (callback) { callback({ volumeActor, volumeId }); } if (!suppressEvents) { triggerVOIModified(element, viewportId, volumeActor, volumeId); } return volumeActor; }); return _createVolumeActor.apply(this, arguments); } function triggerVOIModified(element, viewportId, volumeActor, volumeId) { const voiRange = volumeActor.getProperty().getRGBTransferFunction(0).getRange(); const voiModifiedEventDetail = { viewportId, range: { lower: voiRange[0], upper: voiRange[1] }, volumeId }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_4__["default"])(element, _enums__WEBPACK_IMPORTED_MODULE_5__["default"].VOI_MODIFIED, voiModifiedEventDetail); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (createVolumeActor); /***/ }, /***/ 59766 /*!*************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/createVolumeMapper.js ***! \*************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ convertMapperToNotSharedMapper: () => (/* binding */ convertMapperToNotSharedMapper), /* harmony export */ "default": () => (/* binding */ createVolumeMapper) /* harmony export */ }); /* harmony import */ var _vtkClasses__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../vtkClasses */ 48064); /* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../init */ 15678); /* harmony import */ var _kitware_vtk_js_Rendering_Core_VolumeMapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/VolumeMapper */ 26787); /* harmony import */ var _kitware_vtk_js_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @kitware/vtk.js/Common/Core/DataArray */ 40928); function createVolumeMapper(imageData, vtkOpenGLTexture) { const volumeMapper = _vtkClasses__WEBPACK_IMPORTED_MODULE_0__["default"].newInstance(); volumeMapper.setInputData(imageData); const spacing = imageData.getSpacing(); const sampleDistanceMultiplier = (0,_init__WEBPACK_IMPORTED_MODULE_1__.getConfiguration)().rendering?.volumeRendering?.sampleDistanceMultiplier || 1; const sampleDistance = sampleDistanceMultiplier * (spacing[0] + spacing[1] + spacing[2]) / 6; volumeMapper.setMaximumSamplesPerRay(4000); volumeMapper.setSampleDistance(sampleDistance); volumeMapper.setScalarTexture(vtkOpenGLTexture); return volumeMapper; } function convertMapperToNotSharedMapper(sharedMapper) { const volumeMapper = _kitware_vtk_js_Rendering_Core_VolumeMapper__WEBPACK_IMPORTED_MODULE_2__["default"].newInstance(); volumeMapper.setBlendMode(sharedMapper.getBlendMode()); const imageData = sharedMapper.getInputData(); const { voxelManager } = imageData.get('voxelManager'); const values = voxelManager.getCompleteScalarDataArray(); const scalarArray = _kitware_vtk_js_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_3__["default"].newInstance({ name: `Pixels`, values }); imageData.getPointData().setScalars(scalarArray); volumeMapper.setInputData(imageData); volumeMapper.setMaximumSamplesPerRay(sharedMapper.getMaximumSamplesPerRay()); volumeMapper.setSampleDistance(sharedMapper.getSampleDistance()); return volumeMapper; } /***/ }, /***/ 14488 /*!***********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/getCameraVectors.js ***! \***********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ calculateCameraPosition: () => (/* binding */ calculateCameraPosition), /* harmony export */ getAcquisitionPlaneReformatOrientation: () => (/* binding */ getAcquisitionPlaneReformatOrientation), /* harmony export */ getCameraVectors: () => (/* binding */ getCameraVectors), /* harmony export */ getOrientationFromScanAxisNormal: () => (/* binding */ getOrientationFromScanAxisNormal) /* harmony export */ }); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../metaData */ 90161); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../constants */ 78220); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums */ 67855); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../enums */ 43089); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! gl-matrix */ 87396); const { MPR_CAMERA_VALUES } = _constants__WEBPACK_IMPORTED_MODULE_1__; const { OrientationAxis } = _enums__WEBPACK_IMPORTED_MODULE_2__; function calculateCameraPosition(rowCosineVec, colCosineVec, scanAxisNormal, orientation) { let referenceCameraValues; switch (orientation) { case OrientationAxis.AXIAL: case OrientationAxis.AXIAL_REFORMAT: referenceCameraValues = MPR_CAMERA_VALUES.axial; break; case OrientationAxis.SAGITTAL: case OrientationAxis.SAGITTAL_REFORMAT: referenceCameraValues = MPR_CAMERA_VALUES.sagittal; break; case OrientationAxis.CORONAL: case OrientationAxis.CORONAL_REFORMAT: referenceCameraValues = MPR_CAMERA_VALUES.coronal; break; case OrientationAxis.REFORMAT: const autoDetected = getOrientationFromScanAxisNormal(scanAxisNormal); switch (autoDetected) { case OrientationAxis.AXIAL: referenceCameraValues = MPR_CAMERA_VALUES.axial; break; case OrientationAxis.SAGITTAL: referenceCameraValues = MPR_CAMERA_VALUES.sagittal; break; case OrientationAxis.CORONAL: referenceCameraValues = MPR_CAMERA_VALUES.coronal; break; default: referenceCameraValues = MPR_CAMERA_VALUES.axial; } break; default: referenceCameraValues = MPR_CAMERA_VALUES.axial; break; } const normalizedRowCosine = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.normalize(gl_matrix__WEBPACK_IMPORTED_MODULE_4__.create(), rowCosineVec); const normalizedColCosine = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.normalize(gl_matrix__WEBPACK_IMPORTED_MODULE_4__.create(), colCosineVec); const normalizedScanAxis = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.normalize(gl_matrix__WEBPACK_IMPORTED_MODULE_4__.create(), scanAxisNormal); const inputVectors = [normalizedRowCosine, normalizedColCosine, normalizedScanAxis]; const referenceVectors = [gl_matrix__WEBPACK_IMPORTED_MODULE_4__.fromValues(referenceCameraValues.viewRight[0], referenceCameraValues.viewRight[1], referenceCameraValues.viewRight[2]), gl_matrix__WEBPACK_IMPORTED_MODULE_4__.fromValues(referenceCameraValues.viewUp[0], referenceCameraValues.viewUp[1], referenceCameraValues.viewUp[2]), gl_matrix__WEBPACK_IMPORTED_MODULE_4__.fromValues(referenceCameraValues.viewPlaneNormal[0], referenceCameraValues.viewPlaneNormal[1], referenceCameraValues.viewPlaneNormal[2])]; const usedInputIndices = new Set(); const findBestMatch = refVector => { let bestMatch = 0; let bestDot = -2; let shouldInvert = false; inputVectors.forEach((inputVec, index) => { if (usedInputIndices.has(index)) { return; } const dot = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.dot(refVector, inputVec); const absDot = Math.abs(dot); if (absDot > bestDot) { bestDot = absDot; bestMatch = index; shouldInvert = dot < 0; } }); usedInputIndices.add(bestMatch); const matchedVector = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.clone(inputVectors[bestMatch]); if (shouldInvert) { gl_matrix__WEBPACK_IMPORTED_MODULE_4__.negate(matchedVector, matchedVector); } return matchedVector; }; const viewRight = findBestMatch(referenceVectors[0]); const viewUp = findBestMatch(referenceVectors[1]); const viewPlaneNormal = findBestMatch(referenceVectors[2]); return { viewPlaneNormal: [viewPlaneNormal[0], viewPlaneNormal[1], viewPlaneNormal[2]], viewUp: [viewUp[0], viewUp[1], viewUp[2]], viewRight: [viewRight[0], viewRight[1], viewRight[2]] }; } function getCameraVectors(viewport, config) { if (!viewport.getActors()?.length) { return; } if (viewport.type !== _enums__WEBPACK_IMPORTED_MODULE_3__["default"].ORTHOGRAPHIC) { console.warn('Viewport should be a volume viewport'); } let imageId = viewport.getCurrentImageId(); if (!imageId) { imageId = viewport.getImageIds()?.[0]; } if (!imageId) { return; } const { imageOrientationPatient } = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('imagePlaneModule', imageId); const rowCosineVec = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.fromValues(imageOrientationPatient[0], imageOrientationPatient[1], imageOrientationPatient[2]); const colCosineVec = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.fromValues(imageOrientationPatient[3], imageOrientationPatient[4], imageOrientationPatient[5]); const scanAxisNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.cross(gl_matrix__WEBPACK_IMPORTED_MODULE_4__.create(), rowCosineVec, colCosineVec); let { orientation } = config || {}; const { useViewportNormal } = config || {}; let normalPlaneForOrientation = scanAxisNormal; if (useViewportNormal) { normalPlaneForOrientation = viewport.getCamera().viewPlaneNormal; } if (!orientation || orientation === OrientationAxis.REFORMAT) { orientation = getOrientationFromScanAxisNormal(normalPlaneForOrientation); } return calculateCameraPosition(rowCosineVec, colCosineVec, scanAxisNormal, orientation); } function getOrientationFromScanAxisNormal(scanAxisNormal) { const normalizedScanAxis = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.normalize(gl_matrix__WEBPACK_IMPORTED_MODULE_4__.create(), scanAxisNormal); const axialNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.fromValues(MPR_CAMERA_VALUES.axial.viewPlaneNormal[0], MPR_CAMERA_VALUES.axial.viewPlaneNormal[1], MPR_CAMERA_VALUES.axial.viewPlaneNormal[2]); const sagittalNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.fromValues(MPR_CAMERA_VALUES.sagittal.viewPlaneNormal[0], MPR_CAMERA_VALUES.sagittal.viewPlaneNormal[1], MPR_CAMERA_VALUES.sagittal.viewPlaneNormal[2]); const coronalNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.fromValues(MPR_CAMERA_VALUES.coronal.viewPlaneNormal[0], MPR_CAMERA_VALUES.coronal.viewPlaneNormal[1], MPR_CAMERA_VALUES.coronal.viewPlaneNormal[2]); const axialDot = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_4__.dot(normalizedScanAxis, axialNormal)); const sagittalDot = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_4__.dot(normalizedScanAxis, sagittalNormal)); const coronalDot = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_4__.dot(normalizedScanAxis, coronalNormal)); if (axialDot >= sagittalDot && axialDot >= coronalDot) { return OrientationAxis.AXIAL; } else if (sagittalDot >= coronalDot) { return OrientationAxis.SAGITTAL; } else { return OrientationAxis.CORONAL; } } function getAcquisitionPlaneReformatOrientation(imageOrientationPatient) { if (!imageOrientationPatient || imageOrientationPatient.length !== 6) { return null; } const rowVec = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.fromValues(imageOrientationPatient[0], imageOrientationPatient[1], imageOrientationPatient[2]); const colVec = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.fromValues(imageOrientationPatient[3], imageOrientationPatient[4], imageOrientationPatient[5]); const scanAxisNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_4__.cross(scanAxisNormal, rowVec, colVec); gl_matrix__WEBPACK_IMPORTED_MODULE_4__.normalize(rowVec, rowVec); gl_matrix__WEBPACK_IMPORTED_MODULE_4__.normalize(colVec, colVec); gl_matrix__WEBPACK_IMPORTED_MODULE_4__.normalize(scanAxisNormal, scanAxisNormal); const negRowVec = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_4__.negate(negRowVec, rowVec); const negColVec = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_4__.negate(negColVec, colVec); const negScanAxisNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_4__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_4__.negate(negScanAxisNormal, scanAxisNormal); const acquisitionVectors = [{ vec: rowVec, name: 'row' }, { vec: colVec, name: 'col' }, { vec: scanAxisNormal, name: 'scanAxis' }, { vec: negRowVec, name: '-row' }, { vec: negColVec, name: '-col' }, { vec: negScanAxisNormal, name: '-scanAxis' }]; const standardViews = [{ name: 'axial', viewPlaneNormal: gl_matrix__WEBPACK_IMPORTED_MODULE_4__.fromValues(MPR_CAMERA_VALUES.axial.viewPlaneNormal[0], MPR_CAMERA_VALUES.axial.viewPlaneNormal[1], MPR_CAMERA_VALUES.axial.viewPlaneNormal[2]), viewUp: gl_matrix__WEBPACK_IMPORTED_MODULE_4__.fromValues(MPR_CAMERA_VALUES.axial.viewUp[0], MPR_CAMERA_VALUES.axial.viewUp[1], MPR_CAMERA_VALUES.axial.viewUp[2]) }, { name: 'sagittal', viewPlaneNormal: gl_matrix__WEBPACK_IMPORTED_MODULE_4__.fromValues(MPR_CAMERA_VALUES.sagittal.viewPlaneNormal[0], MPR_CAMERA_VALUES.sagittal.viewPlaneNormal[1], MPR_CAMERA_VALUES.sagittal.viewPlaneNormal[2]), viewUp: gl_matrix__WEBPACK_IMPORTED_MODULE_4__.fromValues(MPR_CAMERA_VALUES.sagittal.viewUp[0], MPR_CAMERA_VALUES.sagittal.viewUp[1], MPR_CAMERA_VALUES.sagittal.viewUp[2]) }, { name: 'coronal', viewPlaneNormal: gl_matrix__WEBPACK_IMPORTED_MODULE_4__.fromValues(MPR_CAMERA_VALUES.coronal.viewPlaneNormal[0], MPR_CAMERA_VALUES.coronal.viewPlaneNormal[1], MPR_CAMERA_VALUES.coronal.viewPlaneNormal[2]), viewUp: gl_matrix__WEBPACK_IMPORTED_MODULE_4__.fromValues(MPR_CAMERA_VALUES.coronal.viewUp[0], MPR_CAMERA_VALUES.coronal.viewUp[1], MPR_CAMERA_VALUES.coronal.viewUp[2]) }]; let bestAlignment = -Infinity; let bestViewPlaneNormal = null; let bestViewUp = null; for (const standardView of standardViews) { let bestPairScore = -Infinity; let bestPairViewPlaneNormal = null; let bestPairViewUp = null; for (let i = 0; i < acquisitionVectors.length; i++) { for (let j = 0; j < acquisitionVectors.length; j++) { if (i === j) continue; const v1 = acquisitionVectors[i].vec; const v2 = acquisitionVectors[j].vec; const dotProduct = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_4__.dot(v1, v2)); if (dotProduct > 0.1) continue; const score1 = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_4__.dot(v1, standardView.viewPlaneNormal)); const score2 = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_4__.dot(v2, standardView.viewUp)); const totalScore = score1 + score2; const score1Swapped = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_4__.dot(v2, standardView.viewPlaneNormal)); const score2Swapped = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_4__.dot(v1, standardView.viewUp)); const totalScoreSwapped = score1Swapped + score2Swapped; if (totalScoreSwapped > totalScore && totalScoreSwapped > bestPairScore) { bestPairScore = totalScoreSwapped; bestPairViewPlaneNormal = v2; bestPairViewUp = v1; } else if (totalScore > bestPairScore) { bestPairScore = totalScore; bestPairViewPlaneNormal = v1; bestPairViewUp = v2; } } } if (bestPairScore > bestAlignment && bestPairViewPlaneNormal && bestPairViewUp) { bestAlignment = bestPairScore; bestViewPlaneNormal = bestPairViewPlaneNormal; bestViewUp = bestPairViewUp; } } if (!bestViewPlaneNormal || !bestViewUp) { return null; } return { viewPlaneNormal: [bestViewPlaneNormal[0], bestViewPlaneNormal[1], bestViewPlaneNormal[2]], viewUp: [bestViewUp[0], bestViewUp[1], bestViewUp[2]] }; } /***/ }, /***/ 63628 /*!************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/getOrCreateCanvas.js ***! \************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ EPSILON: () => (/* binding */ EPSILON), /* harmony export */ createCanvas: () => (/* binding */ createCanvas), /* harmony export */ createViewportElement: () => (/* binding */ createViewportElement), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ getOrCreateCanvas: () => (/* binding */ getOrCreateCanvas), /* harmony export */ setCanvasCreator: () => (/* binding */ setCanvasCreator), /* harmony export */ updateCanvasSizeAndAspectRatio: () => (/* binding */ updateCanvasSizeAndAspectRatio) /* harmony export */ }); const VIEWPORT_ELEMENT = 'viewport-element'; const CANVAS_CSS_CLASS = 'cornerstone-canvas'; const EPSILON = 1e-4; let canvasCreator; function createCanvas(element, width = 512, height = 512) { const canvas = canvasCreator ? canvasCreator(width, height) : document.createElement('canvas'); if (!element) { return canvas; } canvas.style.position = 'absolute'; canvas.style.width = '100%'; canvas.style.height = '100%'; canvas.style.imageRendering = 'pixelated'; canvas.classList.add(CANVAS_CSS_CLASS); element.appendChild(canvas); return canvas; } function createViewportElement(element) { const div = document.createElement('div'); div.style.position = 'relative'; div.style.width = '100%'; div.style.height = '100%'; div.style.overflow = 'hidden'; div.classList.add(VIEWPORT_ELEMENT); element.appendChild(div); return div; } function setCanvasCreator(canvasCreatorArg) { canvasCreator = canvasCreatorArg; } function updateCanvasSizeAndAspectRatio(canvas, extentOrOffscreen) { if (extentOrOffscreen === undefined) { const devicePixelRatio = window.devicePixelRatio || 1; const rect = canvas.getBoundingClientRect(); const w = Math.round(rect.width * devicePixelRatio); const h = Math.round(rect.height * devicePixelRatio); if (w > 0 && h > 0) { canvas.width = w; canvas.height = h; canvas.style.aspectRatio = `${w} / ${h}`; } return undefined; } const { width: targetW, height: targetH } = extentOrOffscreen; if (targetW < 1 || targetH < 1) { return false; } const needsUpdate = canvas.width !== targetW || canvas.height !== targetH; if (needsUpdate) { canvas.width = targetW; canvas.height = targetH; canvas.style.aspectRatio = `${targetW} / ${targetH}`; return true; } return false; } function getOrCreateCanvas(element) { const canvasSelector = `canvas.${CANVAS_CSS_CLASS}`; const viewportElement = `div.${VIEWPORT_ELEMENT}`; const internalDiv = element.querySelector(viewportElement) || createViewportElement(element); const existingCanvas = internalDiv.querySelector(canvasSelector); if (existingCanvas) { return existingCanvas; } const canvas = createCanvas(internalDiv); const rect = internalDiv.getBoundingClientRect(); const devicePixelRatio = window.devicePixelRatio || 1; const width = Math.ceil(rect.width * devicePixelRatio); const height = Math.ceil(rect.height * devicePixelRatio); if (width > 0 && height > 0) { canvas.width = width; canvas.height = height; canvas.style.aspectRatio = `${width} / ${height}`; } return canvas; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getOrCreateCanvas); /***/ }, /***/ 66737 /*!************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/index.js ***! \************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ EPSILON: () => (/* reexport safe */ _getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_2__.EPSILON), /* harmony export */ addImageSlicesToViewports: () => (/* reexport safe */ _addImageSlicesToViewports__WEBPACK_IMPORTED_MODULE_6__["default"]), /* harmony export */ addVolumesToViewports: () => (/* reexport safe */ _addVolumesToViewports__WEBPACK_IMPORTED_MODULE_4__["default"]), /* harmony export */ createCanvas: () => (/* reexport safe */ _getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_2__.createCanvas), /* harmony export */ createViewportElement: () => (/* reexport safe */ _getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_2__.createViewportElement), /* harmony export */ createVolumeActor: () => (/* reexport safe */ _createVolumeActor__WEBPACK_IMPORTED_MODULE_0__["default"]), /* harmony export */ createVolumeMapper: () => (/* reexport safe */ _createVolumeMapper__WEBPACK_IMPORTED_MODULE_1__["default"]), /* harmony export */ getOrCreateCanvas: () => (/* reexport safe */ _getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_2__.getOrCreateCanvas), /* harmony export */ setCanvasCreator: () => (/* reexport safe */ _getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_2__.setCanvasCreator), /* harmony export */ setVolumesForViewports: () => (/* reexport safe */ _setVolumesForViewports__WEBPACK_IMPORTED_MODULE_3__["default"]), /* harmony export */ updateCanvasSizeAndAspectRatio: () => (/* reexport safe */ _getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_2__.updateCanvasSizeAndAspectRatio), /* harmony export */ volumeNewImageEventDispatcher: () => (/* reexport safe */ _volumeNewImageEventDispatcher__WEBPACK_IMPORTED_MODULE_5__["default"]) /* harmony export */ }); /* harmony import */ var _createVolumeActor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createVolumeActor */ 24402); /* harmony import */ var _createVolumeMapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./createVolumeMapper */ 59766); /* harmony import */ var _getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getOrCreateCanvas */ 63628); /* harmony import */ var _setVolumesForViewports__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./setVolumesForViewports */ 22528); /* harmony import */ var _addVolumesToViewports__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./addVolumesToViewports */ 19371); /* harmony import */ var _volumeNewImageEventDispatcher__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./volumeNewImageEventDispatcher */ 35551); /* harmony import */ var _addImageSlicesToViewports__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./addImageSlicesToViewports */ 37508); /***/ }, /***/ 16080 /*!***********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/isContextPoolRenderingEngine.js ***! \***********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isContextPoolRenderingEngine: () => (/* binding */ isContextPoolRenderingEngine) /* harmony export */ }); /* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../init */ 15678); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../enums */ 78015); function isContextPoolRenderingEngine() { const config = (0,_init__WEBPACK_IMPORTED_MODULE_0__.getConfiguration)(); return config?.rendering?.renderingEngineMode === _enums__WEBPACK_IMPORTED_MODULE_1__["default"].ContextPool; } /***/ }, /***/ 70263 /*!**********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/isInvalidNumber.js ***! \**********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isInvalidNumber: () => (/* binding */ isInvalidNumber) /* harmony export */ }); const isInvalidNumber = value => { return !(typeof value === 'number' && Number.isFinite(value)); }; /***/ }, /***/ 38198 /*!**************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/setDefaultVolumeVOI.js ***! \**************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _loaders_imageLoader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../loaders/imageLoader */ 96035); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../metaData */ 90161); /* harmony import */ var _utilities_windowLevel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utilities/windowLevel */ 88871); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../enums */ 9742); /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../cache/cache */ 38277); const PRIORITY = 0; const REQUEST_TYPE = _enums__WEBPACK_IMPORTED_MODULE_4__["default"].Prefetch; function setDefaultVolumeVOI(_x, _x2) { return _setDefaultVolumeVOI.apply(this, arguments); } function _setDefaultVolumeVOI() { _setDefaultVolumeVOI = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (volumeActor, imageVolume) { let voi = getVOIFromMetadata(imageVolume); if (!voi && imageVolume.imageIds.length) { voi = yield getVOIFromMiddleSliceMinMax(imageVolume); voi = handlePreScaledVolume(imageVolume, voi); } if (voi.lower === 0 && voi.upper === 0 || voi.lower === undefined || voi.upper === undefined) { return; } volumeActor.getProperty().getRGBTransferFunction(0).setMappingRange(voi.lower, voi.upper); }); return _setDefaultVolumeVOI.apply(this, arguments); } function handlePreScaledVolume(imageVolume, voi) { const imageIds = imageVolume.imageIds; const imageIdIndex = Math.floor(imageIds.length / 2); const imageId = imageIds[imageIdIndex]; const generalSeriesModule = _metaData__WEBPACK_IMPORTED_MODULE_2__.get('generalSeriesModule', imageId) || {}; if (_isCurrentImagePTPrescaled(generalSeriesModule.modality, imageVolume)) { return { lower: 0, upper: 5 }; } return voi; } function getVOIFromMetadata(imageVolume) { const { imageIds, metadata } = imageVolume; let voi; if (imageIds?.length) { const imageIdIndex = Math.floor(imageIds.length / 2); const imageId = imageIds[imageIdIndex]; const voiLutModule = _metaData__WEBPACK_IMPORTED_MODULE_2__.get('voiLutModule', imageId); if (voiLutModule && voiLutModule.windowWidth && voiLutModule.windowCenter) { if (voiLutModule?.voiLUTFunction) { voi = {}; voi.voiLUTFunction = voiLutModule?.voiLUTFunction; } const { windowWidth, windowCenter } = voiLutModule; const width = Array.isArray(windowWidth) ? windowWidth[0] : windowWidth; const center = Array.isArray(windowCenter) ? windowCenter[0] : windowCenter; if (width !== 0) { voi = { windowWidth: width, windowCenter: center }; } } } else { voi = metadata.voiLut[0]; } if (voi && (voi.windowWidth !== 0 || voi.windowCenter !== 0)) { const { lower, upper } = _utilities_windowLevel__WEBPACK_IMPORTED_MODULE_3__.toLowHighRange(Number(voi.windowWidth), Number(voi.windowCenter), voi.voiLUTFunction); if (isNaN(lower) || isNaN(upper)) { return; } return { lower, upper }; } return undefined; } function getVOIFromMiddleSliceMinMax(_x3) { return _getVOIFromMiddleSliceMinMax.apply(this, arguments); } function _getVOIFromMiddleSliceMinMax() { _getVOIFromMiddleSliceMinMax = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (imageVolume) { const { imageIds } = imageVolume; const imageIdIndex = Math.floor(imageIds.length / 2); const imageId = imageVolume.imageIds[imageIdIndex]; const generalSeriesModule = _metaData__WEBPACK_IMPORTED_MODULE_2__.get('generalSeriesModule', imageId) || {}; const { modality } = generalSeriesModule; const modalityLutModule = _metaData__WEBPACK_IMPORTED_MODULE_2__.get('modalityLutModule', imageId) || {}; const scalingParameters = { rescaleSlope: modalityLutModule.rescaleSlope, rescaleIntercept: modalityLutModule.rescaleIntercept, modality }; let scalingParametersToUse; if (modality === 'PT') { const suvFactor = _metaData__WEBPACK_IMPORTED_MODULE_2__.get('scalingModule', imageId); if (suvFactor) { scalingParametersToUse = { ...scalingParameters, suvbw: suvFactor.suvbw }; } } const options = { priority: PRIORITY, requestType: REQUEST_TYPE, preScale: { scalingParameters: scalingParametersToUse } }; let image = _cache_cache__WEBPACK_IMPORTED_MODULE_5__["default"].getImage(imageId); if (!imageVolume.referencedImageIds?.length) { image = yield (0,_loaders_imageLoader__WEBPACK_IMPORTED_MODULE_1__.loadAndCacheImage)(imageId, { ...options, ignoreCache: true }); } let { min, max } = image.voxelManager.getMinMax(); if (min?.length > 1) { min = Math.min(...min); max = Math.max(...max); } return { lower: min, upper: max }; }); return _getVOIFromMiddleSliceMinMax.apply(this, arguments); } function _isCurrentImagePTPrescaled(modality, imageVolume) { if (modality !== 'PT' || !imageVolume.isPreScaled) { return false; } if (!imageVolume.scaling?.PT.suvbw) { return false; } return true; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (setDefaultVolumeVOI); /***/ }, /***/ 22528 /*!*****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/setVolumesForViewports.js ***! \*****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _BaseVolumeViewport__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../BaseVolumeViewport */ 19401); function setVolumesForViewports(_x, _x2, _x3) { return _setVolumesForViewports.apply(this, arguments); } function _setVolumesForViewports() { _setVolumesForViewports = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (renderingEngine, volumeInputs, viewportIds, immediateRender = false, suppressEvents = false) { viewportIds.forEach(viewportId => { const viewport = renderingEngine.getViewport(viewportId); if (!viewport) { throw new Error(`Viewport with Id ${viewportId} does not exist`); } if (!(viewport instanceof _BaseVolumeViewport__WEBPACK_IMPORTED_MODULE_1__["default"])) { throw new Error('setVolumesForViewports only supports VolumeViewport and VolumeViewport3D'); } }); const setVolumePromises = viewportIds.map(/*#__PURE__*/function () { var _ref = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (viewportId) { const viewport = renderingEngine.getViewport(viewportId); yield viewport.setVolumes(volumeInputs, immediateRender, suppressEvents); }); return function (_x4) { return _ref.apply(this, arguments); }; }()); yield Promise.all(setVolumePromises); return; }); return _setVolumesForViewports.apply(this, arguments); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (setVolumesForViewports); /***/ }, /***/ 14852 /*!*************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/stats/StatsOverlay.js ***! \*************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ StatsOverlay: () => (/* binding */ StatsOverlay) /* harmony export */ }); /* harmony import */ var _StatsPanel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./StatsPanel */ 87538); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./enums */ 70055); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants */ 16056); class StatsOverlay { static { this.instance = null; } constructor() { this.dom = null; this.currentMode = 0; this.startTime = 0; this.lastUpdateTime = 0; this.frameCount = 0; this.panels = new Map(); this.animationFrameId = null; this.isSetup = false; } static getInstance() { if (!StatsOverlay.instance) { StatsOverlay.instance = new StatsOverlay(); } return StatsOverlay.instance; } setup() { if (this.isSetup) { return; } try { this.dom = this.createOverlayElement(); this.startTime = performance.now(); this.lastUpdateTime = this.startTime; this.initializePanels(); this.showPanel(_enums__WEBPACK_IMPORTED_MODULE_1__.PanelType.FPS); this.applyOverlayStyles(); document.body.appendChild(this.dom); this.startLoop(); this.isSetup = true; } catch (error) { console.warn('Failed to setup stats overlay:', error); } } cleanup() { this.stopLoop(); if (this.dom && this.dom.parentNode) { this.dom.parentNode.removeChild(this.dom); } this.dom = null; this.panels.clear(); this.isSetup = false; } showPanel(panelType) { const children = Array.from(this.dom.children); children.forEach((child, index) => { child.style.display = index === panelType ? 'block' : 'none'; }); this.currentMode = panelType; } update() { this.startTime = this.updateStats(); } createOverlayElement() { const element = document.createElement('div'); element.addEventListener('click', this.handleClick.bind(this), false); return element; } applyOverlayStyles() { Object.assign(this.dom.style, _constants__WEBPACK_IMPORTED_MODULE_2__.STATS_CONFIG.OVERLAY_STYLES); } handleClick(event) { event.preventDefault(); const panelCount = this.dom.children.length; this.showPanel((this.currentMode + 1) % panelCount); } initializePanels() { const fpsPanel = new _StatsPanel__WEBPACK_IMPORTED_MODULE_0__.StatsPanel(_constants__WEBPACK_IMPORTED_MODULE_2__.PANEL_CONFIGS[_enums__WEBPACK_IMPORTED_MODULE_1__.PanelType.FPS].name, _constants__WEBPACK_IMPORTED_MODULE_2__.PANEL_CONFIGS[_enums__WEBPACK_IMPORTED_MODULE_1__.PanelType.FPS].foregroundColor, _constants__WEBPACK_IMPORTED_MODULE_2__.PANEL_CONFIGS[_enums__WEBPACK_IMPORTED_MODULE_1__.PanelType.FPS].backgroundColor); this.addPanel(_enums__WEBPACK_IMPORTED_MODULE_1__.PanelType.FPS, fpsPanel); const msPanel = new _StatsPanel__WEBPACK_IMPORTED_MODULE_0__.StatsPanel(_constants__WEBPACK_IMPORTED_MODULE_2__.PANEL_CONFIGS[_enums__WEBPACK_IMPORTED_MODULE_1__.PanelType.MS].name, _constants__WEBPACK_IMPORTED_MODULE_2__.PANEL_CONFIGS[_enums__WEBPACK_IMPORTED_MODULE_1__.PanelType.MS].foregroundColor, _constants__WEBPACK_IMPORTED_MODULE_2__.PANEL_CONFIGS[_enums__WEBPACK_IMPORTED_MODULE_1__.PanelType.MS].backgroundColor); this.addPanel(_enums__WEBPACK_IMPORTED_MODULE_1__.PanelType.MS, msPanel); if (this.isMemoryAvailable()) { const memPanel = new _StatsPanel__WEBPACK_IMPORTED_MODULE_0__.StatsPanel(_constants__WEBPACK_IMPORTED_MODULE_2__.PANEL_CONFIGS[_enums__WEBPACK_IMPORTED_MODULE_1__.PanelType.MEMORY].name, _constants__WEBPACK_IMPORTED_MODULE_2__.PANEL_CONFIGS[_enums__WEBPACK_IMPORTED_MODULE_1__.PanelType.MEMORY].foregroundColor, _constants__WEBPACK_IMPORTED_MODULE_2__.PANEL_CONFIGS[_enums__WEBPACK_IMPORTED_MODULE_1__.PanelType.MEMORY].backgroundColor); this.addPanel(_enums__WEBPACK_IMPORTED_MODULE_1__.PanelType.MEMORY, memPanel); } } isMemoryAvailable() { const perf = performance; return perf.memory !== undefined; } addPanel(type, panel) { this.dom.appendChild(panel.dom); this.panels.set(type, panel); } startLoop() { const loop = () => { this.update(); this.animationFrameId = requestAnimationFrame(loop); }; this.animationFrameId = requestAnimationFrame(loop); } stopLoop() { if (this.animationFrameId !== null) { cancelAnimationFrame(this.animationFrameId); this.animationFrameId = null; } } updateStats() { this.frameCount++; const currentTime = performance.now(); const deltaTime = currentTime - this.startTime; const msPanel = this.panels.get(_enums__WEBPACK_IMPORTED_MODULE_1__.PanelType.MS); if (msPanel) { msPanel.update(deltaTime, _constants__WEBPACK_IMPORTED_MODULE_2__.STATS_CONFIG.MAX_MS_VALUE); } if (currentTime >= this.lastUpdateTime + _constants__WEBPACK_IMPORTED_MODULE_2__.STATS_CONFIG.UPDATE_INTERVAL) { const fps = this.frameCount * _constants__WEBPACK_IMPORTED_MODULE_2__.CONVERSION.MS_PER_SECOND / (currentTime - this.lastUpdateTime); const fpsPanel = this.panels.get(_enums__WEBPACK_IMPORTED_MODULE_1__.PanelType.FPS); if (fpsPanel) { fpsPanel.update(fps, _constants__WEBPACK_IMPORTED_MODULE_2__.STATS_CONFIG.MAX_FPS_VALUE); } this.lastUpdateTime = currentTime; this.frameCount = 0; this.updateMemoryPanel(); } return currentTime; } updateMemoryPanel() { const memPanel = this.panels.get(_enums__WEBPACK_IMPORTED_MODULE_1__.PanelType.MEMORY); if (!memPanel) { return; } const perf = performance; if (perf.memory) { const memoryMB = perf.memory.usedJSHeapSize / _constants__WEBPACK_IMPORTED_MODULE_2__.CONVERSION.BYTES_TO_MB; const maxMemoryMB = perf.memory.jsHeapSizeLimit / _constants__WEBPACK_IMPORTED_MODULE_2__.CONVERSION.BYTES_TO_MB; memPanel.update(memoryMB, maxMemoryMB); } } } /***/ }, /***/ 87538 /*!***********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/stats/StatsPanel.js ***! \***********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ StatsPanel: () => (/* binding */ StatsPanel) /* harmony export */ }); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ 16056); class StatsPanel { constructor(name, foregroundColor, backgroundColor) { this.minValue = Infinity; this.maxValue = 0; this.name = name; this.foregroundColor = foregroundColor; this.backgroundColor = backgroundColor; this.devicePixelRatio = Math.round(window.devicePixelRatio || 1); this.dimensions = this.calculateDimensions(); this.dom = this.createCanvas(); this.context = this.initializeContext(); this.drawInitialPanel(); } update(value, maxValue) { this.updateMinMax(value); this.clearTextArea(); this.drawText(value); this.scrollGraph(); this.drawNewValue(value, maxValue); } calculateDimensions() { const pr = this.devicePixelRatio; return { width: _constants__WEBPACK_IMPORTED_MODULE_0__.PANEL_CONFIG.WIDTH * pr, height: _constants__WEBPACK_IMPORTED_MODULE_0__.PANEL_CONFIG.HEIGHT * pr, textX: _constants__WEBPACK_IMPORTED_MODULE_0__.PANEL_CONFIG.TEXT_PADDING * pr, textY: _constants__WEBPACK_IMPORTED_MODULE_0__.PANEL_CONFIG.TEXT_Y_OFFSET * pr, graphX: _constants__WEBPACK_IMPORTED_MODULE_0__.PANEL_CONFIG.TEXT_PADDING * pr, graphY: _constants__WEBPACK_IMPORTED_MODULE_0__.PANEL_CONFIG.GRAPH_Y_OFFSET * pr, graphWidth: _constants__WEBPACK_IMPORTED_MODULE_0__.PANEL_CONFIG.GRAPH_WIDTH * pr, graphHeight: _constants__WEBPACK_IMPORTED_MODULE_0__.PANEL_CONFIG.GRAPH_HEIGHT * pr }; } createCanvas() { const canvas = document.createElement('canvas'); canvas.width = this.dimensions.width; canvas.height = this.dimensions.height; canvas.style.cssText = `width:${_constants__WEBPACK_IMPORTED_MODULE_0__.PANEL_CONFIG.WIDTH}px;height:${_constants__WEBPACK_IMPORTED_MODULE_0__.PANEL_CONFIG.HEIGHT}px`; return canvas; } initializeContext() { const ctx = this.dom.getContext('2d'); if (!ctx) { throw new Error('Failed to get 2D context'); } ctx.font = `bold ${_constants__WEBPACK_IMPORTED_MODULE_0__.PANEL_CONFIG.FONT_SIZE * this.devicePixelRatio}px ${_constants__WEBPACK_IMPORTED_MODULE_0__.PANEL_CONFIG.FONT_FAMILY}`; ctx.textBaseline = 'top'; return ctx; } drawInitialPanel() { const { width, height, textX, textY, graphX, graphY, graphWidth, graphHeight } = this.dimensions; this.context.fillStyle = this.backgroundColor; this.context.fillRect(0, 0, width, height); this.context.fillStyle = this.foregroundColor; this.context.fillText(this.name, textX, textY); this.context.fillRect(graphX, graphY, graphWidth, graphHeight); this.context.fillStyle = this.backgroundColor; this.context.globalAlpha = _constants__WEBPACK_IMPORTED_MODULE_0__.PANEL_CONFIG.GRAPH_ALPHA; this.context.fillRect(graphX, graphY, graphWidth, graphHeight); this.context.globalAlpha = 1; } updateMinMax(value) { this.minValue = Math.min(this.minValue, value); this.maxValue = Math.max(this.maxValue, value); } clearTextArea() { const { width, graphY } = this.dimensions; this.context.fillStyle = this.backgroundColor; this.context.fillRect(0, 0, width, graphY); } drawText(value) { const { textX, textY } = this.dimensions; const text = this.formatText(value); this.context.fillStyle = this.foregroundColor; this.context.fillText(text, textX, textY); } formatText(value) { const roundedValue = Math.round(value); const roundedMin = Math.round(this.minValue); const roundedMax = Math.round(this.maxValue); return `${roundedValue} ${this.name} (${roundedMin}-${roundedMax})`; } scrollGraph() { const { graphX, graphY, graphWidth, graphHeight } = this.dimensions; const pr = this.devicePixelRatio; this.context.drawImage(this.dom, graphX + pr, graphY, graphWidth - pr, graphHeight, graphX, graphY, graphWidth - pr, graphHeight); } drawNewValue(value, maxValue) { const { graphX, graphY, graphWidth, graphHeight } = this.dimensions; const pr = this.devicePixelRatio; const x = graphX + graphWidth - pr; this.context.fillStyle = this.foregroundColor; this.context.fillRect(x, graphY, pr, graphHeight); const normalizedHeight = Math.round((1 - value / maxValue) * graphHeight); this.context.fillStyle = this.backgroundColor; this.context.globalAlpha = _constants__WEBPACK_IMPORTED_MODULE_0__.PANEL_CONFIG.GRAPH_ALPHA; this.context.fillRect(x, graphY, pr, normalizedHeight); this.context.globalAlpha = 1; } } /***/ }, /***/ 16056 /*!**********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/stats/constants.js ***! \**********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CONVERSION: () => (/* binding */ CONVERSION), /* harmony export */ PANEL_CONFIG: () => (/* binding */ PANEL_CONFIG), /* harmony export */ PANEL_CONFIGS: () => (/* binding */ PANEL_CONFIGS), /* harmony export */ STATS_CONFIG: () => (/* binding */ STATS_CONFIG) /* harmony export */ }); const PANEL_CONFIG = { WIDTH: 160, HEIGHT: 96, TEXT_PADDING: 3, TEXT_Y_OFFSET: 2, GRAPH_Y_OFFSET: 15, GRAPH_WIDTH: 150, GRAPH_HEIGHT: 70, FONT_SIZE: 9, FONT_FAMILY: 'Helvetica,Arial,sans-serif', GRAPH_ALPHA: 0.9 }; const STATS_CONFIG = { UPDATE_INTERVAL: 1000, MAX_MS_VALUE: 200, MAX_FPS_VALUE: 300, OVERLAY_STYLES: { position: 'fixed', top: '0px', right: '0px', left: 'auto', zIndex: '9999', cursor: 'pointer', opacity: '0.9' } }; const CONVERSION = { BYTES_TO_MB: 1048576, MS_PER_SECOND: 1000 }; const PANEL_CONFIGS = [{ name: 'FPS', foregroundColor: '#0ff', backgroundColor: '#002' }, { name: 'MS', foregroundColor: '#0f0', backgroundColor: '#020' }, { name: 'MB', foregroundColor: '#f08', backgroundColor: '#201' }]; /***/ }, /***/ 70055 /*!******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/stats/enums.js ***! \******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ PanelType: () => (/* binding */ PanelType) /* harmony export */ }); var PanelType; (function (PanelType) { PanelType[PanelType["FPS"] = 0] = "FPS"; PanelType[PanelType["MS"] = 1] = "MS"; PanelType[PanelType["MEMORY"] = 2] = "MEMORY"; })(PanelType || (PanelType = {})); /***/ }, /***/ 6769 /*!******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/stats/index.js ***! \******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ StatsOverlay: () => (/* binding */ StatsOverlay) /* harmony export */ }); /* harmony import */ var _StatsOverlay__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./StatsOverlay */ 14852); const StatsOverlay = _StatsOverlay__WEBPACK_IMPORTED_MODULE_0__.StatsOverlay.getInstance(); /***/ }, /***/ 93158 /*!**********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/viewportTypeToViewportClass.js ***! \**********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _StackViewport__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../StackViewport */ 67461); /* harmony import */ var _VolumeViewport__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../VolumeViewport */ 93667); /* harmony import */ var _enums_ViewportType__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/ViewportType */ 43089); /* harmony import */ var _VolumeViewport3D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../VolumeViewport3D */ 50600); /* harmony import */ var _VideoViewport__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../VideoViewport */ 51610); /* harmony import */ var _WSIViewport__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../WSIViewport */ 55580); /* harmony import */ var _ECGViewport__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../ECGViewport */ 49180); const viewportTypeToViewportClass = { [_enums_ViewportType__WEBPACK_IMPORTED_MODULE_2__["default"].ORTHOGRAPHIC]: _VolumeViewport__WEBPACK_IMPORTED_MODULE_1__["default"], [_enums_ViewportType__WEBPACK_IMPORTED_MODULE_2__["default"].PERSPECTIVE]: _VolumeViewport__WEBPACK_IMPORTED_MODULE_1__["default"], [_enums_ViewportType__WEBPACK_IMPORTED_MODULE_2__["default"].STACK]: _StackViewport__WEBPACK_IMPORTED_MODULE_0__["default"], [_enums_ViewportType__WEBPACK_IMPORTED_MODULE_2__["default"].VOLUME_3D]: _VolumeViewport3D__WEBPACK_IMPORTED_MODULE_3__["default"], [_enums_ViewportType__WEBPACK_IMPORTED_MODULE_2__["default"].VIDEO]: _VideoViewport__WEBPACK_IMPORTED_MODULE_4__["default"], [_enums_ViewportType__WEBPACK_IMPORTED_MODULE_2__["default"].WHOLE_SLIDE]: _WSIViewport__WEBPACK_IMPORTED_MODULE_5__["default"], [_enums_ViewportType__WEBPACK_IMPORTED_MODULE_2__["default"].ECG]: _ECGViewport__WEBPACK_IMPORTED_MODULE_6__["default"] }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (viewportTypeToViewportClass); /***/ }, /***/ 65072 /*!**********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/viewportTypeUsesCustomRenderingPipeline.js ***! \**********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ viewportTypeUsesCustomRenderingPipeline) /* harmony export */ }); /* harmony import */ var _viewportTypeToViewportClass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./viewportTypeToViewportClass */ 93158); function viewportTypeUsesCustomRenderingPipeline(viewportType) { return _viewportTypeToViewportClass__WEBPACK_IMPORTED_MODULE_0__["default"][viewportType].useCustomRenderingPipeline; } /***/ }, /***/ 35551 /*!************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/helpers/volumeNewImageEventDispatcher.js ***! \************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ resetVolumeNewImageState: () => (/* binding */ resetVolumeNewImageState) /* harmony export */ }); /* harmony import */ var _utilities_getImageSliceDataForVolumeViewport__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utilities/getImageSliceDataForVolumeViewport */ 84081); /* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utilities/triggerEvent */ 91133); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums */ 14566); /* harmony import */ var _getRenderingEngine__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../getRenderingEngine */ 77569); const state = {}; function resetVolumeNewImageState(viewportId) { if (state[viewportId] !== undefined) { delete state[viewportId]; } } function volumeNewImageEventDispatcher(cameraEvent) { const { renderingEngineId, viewportId } = cameraEvent.detail; const renderingEngine = (0,_getRenderingEngine__WEBPACK_IMPORTED_MODULE_3__.getRenderingEngine)(renderingEngineId); const viewport = renderingEngine.getViewport(viewportId); if (!('setVolumes' in viewport)) { throw new Error(`volumeNewImageEventDispatcher: viewport does not have setVolumes method`); } if (state[viewport.id] === undefined) { state[viewport.id] = 0; } const sliceData = (0,_utilities_getImageSliceDataForVolumeViewport__WEBPACK_IMPORTED_MODULE_0__["default"])(viewport); if (!sliceData) { console.warn(`volumeNewImageEventDispatcher: sliceData is undefined for viewport ${viewport.id}`); return; } const { numberOfSlices, imageIndex } = sliceData; if (state[viewport.id] === imageIndex) { return; } state[viewport.id] = imageIndex; const eventDetail = { imageIndex, viewportId, renderingEngineId, numberOfSlices }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_1__["default"])(viewport.element, _enums__WEBPACK_IMPORTED_MODULE_2__["default"].VOLUME_NEW_IMAGE, eventDetail); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (volumeNewImageEventDispatcher); /***/ }, /***/ 70611 /*!****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/index.js ***! \****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ BaseRenderingEngine: () => (/* reexport safe */ _BaseRenderingEngine__WEBPACK_IMPORTED_MODULE_1__["default"]), /* harmony export */ ContextPoolRenderingEngine: () => (/* reexport safe */ _ContextPoolRenderingEngine__WEBPACK_IMPORTED_MODULE_3__["default"]), /* harmony export */ EPSILON: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_8__.EPSILON), /* harmony export */ RenderingEngine: () => (/* reexport safe */ _RenderingEngine__WEBPACK_IMPORTED_MODULE_0__["default"]), /* harmony export */ StackViewport: () => (/* reexport safe */ _StackViewport__WEBPACK_IMPORTED_MODULE_6__["default"]), /* harmony export */ TiledRenderingEngine: () => (/* reexport safe */ _TiledRenderingEngine__WEBPACK_IMPORTED_MODULE_2__["default"]), /* harmony export */ VolumeViewport: () => (/* reexport safe */ _VolumeViewport__WEBPACK_IMPORTED_MODULE_5__["default"]), /* harmony export */ VolumeViewport3D: () => (/* reexport safe */ _VolumeViewport3D__WEBPACK_IMPORTED_MODULE_7__["default"]), /* harmony export */ addImageSlicesToViewports: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_8__.addImageSlicesToViewports), /* harmony export */ addVolumesToViewports: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_8__.addVolumesToViewports), /* harmony export */ createCanvas: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_8__.createCanvas), /* harmony export */ createViewportElement: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_8__.createViewportElement), /* harmony export */ createVolumeActor: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_8__.createVolumeActor), /* harmony export */ createVolumeMapper: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_8__.createVolumeMapper), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ getOrCreateCanvas: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_8__.getOrCreateCanvas), /* harmony export */ getRenderingEngine: () => (/* reexport safe */ _getRenderingEngine__WEBPACK_IMPORTED_MODULE_4__["default"]), /* harmony export */ setCanvasCreator: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_8__.setCanvasCreator), /* harmony export */ setVolumesForViewports: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_8__.setVolumesForViewports), /* harmony export */ updateCanvasSizeAndAspectRatio: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_8__.updateCanvasSizeAndAspectRatio), /* harmony export */ volumeNewImageEventDispatcher: () => (/* reexport safe */ _helpers__WEBPACK_IMPORTED_MODULE_8__.volumeNewImageEventDispatcher) /* harmony export */ }); /* harmony import */ var _RenderingEngine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RenderingEngine */ 23357); /* harmony import */ var _BaseRenderingEngine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BaseRenderingEngine */ 82838); /* harmony import */ var _TiledRenderingEngine__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TiledRenderingEngine */ 84405); /* harmony import */ var _ContextPoolRenderingEngine__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ContextPoolRenderingEngine */ 73386); /* harmony import */ var _getRenderingEngine__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getRenderingEngine */ 77569); /* harmony import */ var _VolumeViewport__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./VolumeViewport */ 93667); /* harmony import */ var _StackViewport__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./StackViewport */ 67461); /* harmony import */ var _VolumeViewport3D__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./VolumeViewport3D */ 50600); /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./helpers */ 66737); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_RenderingEngine__WEBPACK_IMPORTED_MODULE_0__["default"]); /***/ }, /***/ 50765 /*!********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/renderPasses/sharpeningRenderPass.js ***! \********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ createSharpeningRenderPass: () => (/* binding */ createSharpeningRenderPass) /* harmony export */ }); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_Convolution2DPass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/Convolution2DPass */ 24879); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_ForwardPass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/ForwardPass */ 36650); function createSharpeningRenderPass(intensity) { let renderPass = _kitware_vtk_js_Rendering_OpenGL_ForwardPass__WEBPACK_IMPORTED_MODULE_1__["default"].newInstance(); if (intensity > 0) { const convolutionPass = _kitware_vtk_js_Rendering_OpenGL_Convolution2DPass__WEBPACK_IMPORTED_MODULE_0__["default"].newInstance(); convolutionPass.setDelegates([renderPass]); const k = Math.max(0, intensity); convolutionPass.setKernelDimension(3); convolutionPass.setKernel([-k, -k, -k, -k, 1 + 8 * k, -k, -k, -k, -k]); renderPass = convolutionPass; } return renderPass; } /***/ }, /***/ 38386 /*!*******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/renderPasses/smoothingRenderPass.js ***! \*******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ createSmoothingRenderPass: () => (/* binding */ createSmoothingRenderPass) /* harmony export */ }); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_Convolution2DPass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/Convolution2DPass */ 24879); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_ForwardPass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/ForwardPass */ 36650); function createSmoothingRenderPass(intensity) { let renderPass = _kitware_vtk_js_Rendering_OpenGL_ForwardPass__WEBPACK_IMPORTED_MODULE_1__["default"].newInstance(); if (intensity > 0) { const convolutionPass = _kitware_vtk_js_Rendering_OpenGL_Convolution2DPass__WEBPACK_IMPORTED_MODULE_0__["default"].newInstance(); convolutionPass.setDelegates([renderPass]); const smoothStrength = Math.min(intensity, 1000); const kernelSize = 15; const sigma = 5.0; const gaussianKernel = createGaussianKernel(kernelSize, sigma); const totalElements = kernelSize * kernelSize; const centerIndex = Math.floor(totalElements / 2); const identityKernel = Array(totalElements).fill(0); identityKernel[centerIndex] = 1; const alpha = Math.min(smoothStrength / 10, 1.0); const kernel = gaussianKernel.map((g, i) => (1 - alpha) * identityKernel[i] + alpha * g); convolutionPass.setKernelDimension(15); convolutionPass.setKernel(kernel); renderPass = convolutionPass; } return renderPass; } function createGaussianKernel(size, sigma) { const kernel = []; const mean = (size - 1) / 2; let sum = 0; for (let y = 0; y < size; y++) { for (let x = 0; x < size; x++) { const dx = x - mean; const dy = y - mean; const value = Math.exp(-(dx * dx + dy * dy) / (2 * Math.pow(sigma, 2))); kernel.push(value); sum += value; } } return kernel.map(v => v / sum); } /***/ }, /***/ 70935 /*!*******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/renderingEngineCache.js ***! \*******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); const cache = {}; const renderingEngineCache = { get: id => { return cache[id]; }, set: re => { const renderingEngineId = re.id; cache[renderingEngineId] = re; }, delete: id => { return delete cache[id]; }, getAll: () => { const renderingEngineIds = Object.keys(cache); const renderingEngines = renderingEngineIds.map(id => cache[id]); renderingEngines.sort((a, b) => { if (a.id[0] === '_' && b.id[0] !== '_') { return 1; } else if (a.id[0] !== '_' && b.id[0] === '_') { return -1; } else { return 0; } }); return renderingEngines; } }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (renderingEngineCache); /***/ }, /***/ 51676 /*!***************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/vtkClasses/vtkOffscreenMultiRenderWindow.js ***! \***************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ extend: () => (/* binding */ extend), /* harmony export */ newInstance: () => (/* binding */ newInstance) /* harmony export */ }); /* harmony import */ var _kitware_vtk_js_macros__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kitware/vtk.js/macros */ 64946); /* harmony import */ var _vtkStreamingOpenGLRenderWindow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./vtkStreamingOpenGLRenderWindow */ 18627); /* harmony import */ var _kitware_vtk_js_Rendering_Core_Renderer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/Renderer */ 45471); /* harmony import */ var _kitware_vtk_js_Rendering_Core_RenderWindow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/RenderWindow */ 1072); /* harmony import */ var _kitware_vtk_js_Rendering_Core_RenderWindowInteractor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/RenderWindowInteractor */ 80127); /* harmony import */ var _kitware_vtk_js_Common_Core_Points__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @kitware/vtk.js/Common/Core/Points */ 10254); /* harmony import */ var _kitware_vtk_js_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @kitware/vtk.js/Common/Core/DataArray */ 40928); /* harmony import */ var _kitware_vtk_js_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @kitware/vtk.js/Common/DataModel/PolyData */ 95765); /* harmony import */ var _kitware_vtk_js_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/Actor */ 77251); /* harmony import */ var _kitware_vtk_js_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/Mapper */ 55857); function vtkOffscreenMultiRenderWindow(publicAPI, model) { const invokeResize = publicAPI.invokeResize; delete publicAPI.invokeResize; model.renderWindow = _kitware_vtk_js_Rendering_Core_RenderWindow__WEBPACK_IMPORTED_MODULE_3__["default"].newInstance(); model.rendererMap = {}; model.openGLRenderWindow = _vtkStreamingOpenGLRenderWindow__WEBPACK_IMPORTED_MODULE_1__["default"].newInstance(); model.renderWindow.addView(model.openGLRenderWindow); model.interactor = _kitware_vtk_js_Rendering_Core_RenderWindowInteractor__WEBPACK_IMPORTED_MODULE_4__["default"].newInstance(); model.interactor.setView(model.openGLRenderWindow); model.interactor.initialize(); publicAPI.addRenderer = ({ viewport, id, background }) => { const renderer = _kitware_vtk_js_Rendering_Core_Renderer__WEBPACK_IMPORTED_MODULE_2__["default"].newInstance({ viewport, background: background || model.background }); model.renderWindow.addRenderer(renderer); model.rendererMap[id] = renderer; }; publicAPI.destroy = () => { const rwi = model.renderWindow.getInteractor(); rwi.delete(); }; publicAPI.removeRenderer = id => { const renderer = publicAPI.getRenderer(id); model.renderWindow.removeRenderer(renderer); renderer.delete(); delete model.rendererMap[id]; }; publicAPI.getRenderer = id => { return model.rendererMap[id]; }; publicAPI.getRenderers = () => { const { rendererMap } = model; const renderers = Object.keys(rendererMap).map(id => { return { id, renderer: rendererMap[id] }; }); return renderers; }; publicAPI.resize = () => { if (model.container) { const { width, height } = model.container; model.openGLRenderWindow.setSize(Math.floor(width), Math.floor(height)); invokeResize(); model.renderWindow.render(); } }; publicAPI.setContainer = el => { model.container = el; model.openGLRenderWindow.setContainer(model.container); }; publicAPI.delete = _kitware_vtk_js_macros__WEBPACK_IMPORTED_MODULE_0__["default"].chain(publicAPI.setContainer, publicAPI.destroy, model.openGLRenderWindow.delete, publicAPI.delete); publicAPI.resize(); } const DEFAULT_VALUES = { background: [0.0, 0.0, 0.0], container: null }; function extend(publicAPI, model, initialValues = {}) { Object.assign(model, DEFAULT_VALUES, initialValues); _kitware_vtk_js_macros__WEBPACK_IMPORTED_MODULE_0__["default"].obj(publicAPI, model); _kitware_vtk_js_macros__WEBPACK_IMPORTED_MODULE_0__["default"].get(publicAPI, model, ['renderWindow', 'openGLRenderWindow', 'interactor', 'container']); _kitware_vtk_js_macros__WEBPACK_IMPORTED_MODULE_0__["default"].event(publicAPI, model, 'resize'); vtkOffscreenMultiRenderWindow(publicAPI, model); } const newInstance = _kitware_vtk_js_macros__WEBPACK_IMPORTED_MODULE_0__["default"].newInstance(extend); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ newInstance, extend }); /***/ }, /***/ 48064 /*!*******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/vtkClasses/vtkSharedVolumeMapper.js ***! \*******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ extend: () => (/* binding */ extend), /* harmony export */ newInstance: () => (/* binding */ newInstance) /* harmony export */ }); /* harmony import */ var _kitware_vtk_js_macros__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kitware/vtk.js/macros */ 64946); /* harmony import */ var _kitware_vtk_js_Rendering_Core_VolumeMapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/VolumeMapper */ 26787); function vtkSharedVolumeMapper(publicAPI, model) { model.classHierarchy.push('vtkSharedVolumeMapper'); const superDelete = publicAPI.delete; publicAPI.delete = () => { model.scalarTexture = null; superDelete(); }; } const DEFAULT_VALUES = { scalarTexture: null }; function extend(publicAPI, model, initialValues = {}) { Object.assign(model, DEFAULT_VALUES, initialValues); _kitware_vtk_js_Rendering_Core_VolumeMapper__WEBPACK_IMPORTED_MODULE_1__["default"].extend(publicAPI, model, initialValues); _kitware_vtk_js_macros__WEBPACK_IMPORTED_MODULE_0__["default"].setGet(publicAPI, model, ['scalarTexture']); vtkSharedVolumeMapper(publicAPI, model); } const newInstance = _kitware_vtk_js_macros__WEBPACK_IMPORTED_MODULE_0__["default"].newInstance(extend, 'vtkSharedVolumeMapper'); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ newInstance, extend }); /***/ }, /***/ 61153 /*!***********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/vtkClasses/vtkSlabCamera.js ***! \***********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ extend: () => (/* binding */ extend), /* harmony export */ newInstance: () => (/* binding */ newInstance) /* harmony export */ }); /* harmony import */ var _kitware_vtk_js_macros__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kitware/vtk.js/macros */ 64946); /* harmony import */ var _kitware_vtk_js_Rendering_Core_Camera__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/Camera */ 7047); /* harmony import */ var _kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @kitware/vtk.js/Common/Core/Math */ 52999); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! gl-matrix */ 95329); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! gl-matrix */ 87396); const DEFAULT_VALUES = { isPerformingCoordinateTransformation: false }; function extend(publicAPI, model, initialValues = {}) { Object.assign(model, DEFAULT_VALUES, initialValues); _kitware_vtk_js_Rendering_Core_Camera__WEBPACK_IMPORTED_MODULE_1__["default"].extend(publicAPI, model, initialValues); _kitware_vtk_js_macros__WEBPACK_IMPORTED_MODULE_0__["default"].setGet(publicAPI, model, ['isPerformingCoordinateTransformation']); vtkSlabCamera(publicAPI, model); } const newInstance = _kitware_vtk_js_macros__WEBPACK_IMPORTED_MODULE_0__["default"].newInstance(extend, 'vtkSlabCamera'); function vtkSlabCamera(publicAPI, model) { model.classHierarchy.push('vtkSlabCamera'); const tmpMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_3__.identity(new Float64Array(16)); const tmpvec1 = new Float64Array(3); publicAPI.getProjectionMatrix = (aspect, nearz, farz) => { const result = gl_matrix__WEBPACK_IMPORTED_MODULE_3__.create(); if (model.projectionMatrix) { const scale = 1 / model.physicalScale; gl_matrix__WEBPACK_IMPORTED_MODULE_4__.set(tmpvec1, scale, scale, scale); gl_matrix__WEBPACK_IMPORTED_MODULE_3__.copy(result, model.projectionMatrix); gl_matrix__WEBPACK_IMPORTED_MODULE_3__.scale(result, result, tmpvec1); gl_matrix__WEBPACK_IMPORTED_MODULE_3__.transpose(result, result); return result; } gl_matrix__WEBPACK_IMPORTED_MODULE_3__.identity(tmpMatrix); let cRange0 = model.clippingRange[0]; let cRange1 = model.clippingRange[1]; if (model.isPerformingCoordinateTransformation) { cRange0 = model.distance; cRange1 = model.distance + 0.1; } const cWidth = cRange1 - cRange0; const cRange = [cRange0 + (nearz + 1) * cWidth / 2.0, cRange0 + (farz + 1) * cWidth / 2.0]; if (model.parallelProjection) { const width = model.parallelScale * aspect; const height = model.parallelScale; const xmin = (model.windowCenter[0] - 1.0) * width; const xmax = (model.windowCenter[0] + 1.0) * width; const ymin = (model.windowCenter[1] - 1.0) * height; const ymax = (model.windowCenter[1] + 1.0) * height; gl_matrix__WEBPACK_IMPORTED_MODULE_3__.ortho(tmpMatrix, xmin, xmax, ymin, ymax, cRange[0], cRange[1]); gl_matrix__WEBPACK_IMPORTED_MODULE_3__.transpose(tmpMatrix, tmpMatrix); } else if (model.useOffAxisProjection) { throw new Error('Off-Axis projection is not supported at this time'); } else { const tmp = Math.tan(_kitware_vtk_js_Common_Core_Math__WEBPACK_IMPORTED_MODULE_2__["default"].radiansFromDegrees(model.viewAngle) / 2.0); let width; let height; if (model.useHorizontalViewAngle === true) { width = cRange0 * tmp; height = cRange0 * tmp / aspect; } else { width = cRange0 * tmp * aspect; height = cRange0 * tmp; } const xmin = (model.windowCenter[0] - 1.0) * width; const xmax = (model.windowCenter[0] + 1.0) * width; const ymin = (model.windowCenter[1] - 1.0) * height; const ymax = (model.windowCenter[1] + 1.0) * height; const znear = cRange[0]; const zfar = cRange[1]; tmpMatrix[0] = 2.0 * znear / (xmax - xmin); tmpMatrix[5] = 2.0 * znear / (ymax - ymin); tmpMatrix[2] = (xmin + xmax) / (xmax - xmin); tmpMatrix[6] = (ymin + ymax) / (ymax - ymin); tmpMatrix[10] = -(znear + zfar) / (zfar - znear); tmpMatrix[14] = -1.0; tmpMatrix[11] = -2.0 * znear * zfar / (zfar - znear); tmpMatrix[15] = 0.0; } gl_matrix__WEBPACK_IMPORTED_MODULE_3__.copy(result, tmpMatrix); return result; }; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ newInstance, extend }); /***/ }, /***/ 18627 /*!****************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/vtkClasses/vtkStreamingOpenGLRenderWindow.js ***! \****************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ extend: () => (/* binding */ extend), /* harmony export */ newInstance: () => (/* binding */ newInstance) /* harmony export */ }); /* harmony import */ var _kitware_vtk_js_macros__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kitware/vtk.js/macros */ 64946); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_RenderWindow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/RenderWindow */ 13988); /* harmony import */ var _vtkStreamingOpenGLViewNodeFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./vtkStreamingOpenGLViewNodeFactory */ 16874); function vtkStreamingOpenGLRenderWindow(publicAPI, model) { model.classHierarchy.push('vtkStreamingOpenGLRenderWindow'); } function extend(publicAPI, model, initialValues = {}) { Object.assign(model, initialValues); _kitware_vtk_js_Rendering_OpenGL_RenderWindow__WEBPACK_IMPORTED_MODULE_1__["default"].extend(publicAPI, model, initialValues); model.myFactory = _vtkStreamingOpenGLViewNodeFactory__WEBPACK_IMPORTED_MODULE_2__["default"].newInstance(); (0,_vtkStreamingOpenGLViewNodeFactory__WEBPACK_IMPORTED_MODULE_2__.registerOverride)('vtkRenderWindow', newInstance); vtkStreamingOpenGLRenderWindow(publicAPI, model); } const newInstance = _kitware_vtk_js_macros__WEBPACK_IMPORTED_MODULE_0__["default"].newInstance(extend, 'vtkStreamingOpenGLRenderWindow'); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ newInstance, extend }); /***/ }, /***/ 59576 /*!***********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/vtkClasses/vtkStreamingOpenGLTexture.js ***! \***********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ extend: () => (/* binding */ extend), /* harmony export */ newInstance: () => (/* binding */ newInstance) /* harmony export */ }); /* harmony import */ var _kitware_vtk_js_macros__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kitware/vtk.js/macros */ 64946); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/Texture */ 82829); /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../cache/cache */ 38277); /* harmony import */ var _utilities_getBufferConfiguration__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utilities/getBufferConfiguration */ 96593); function convertDataType(data, targetDataType) { const Constructor = (0,_utilities_getBufferConfiguration__WEBPACK_IMPORTED_MODULE_3__.getConstructorFromType)(targetDataType); const convertedData = new Constructor(data.length); convertedData.set(data); return convertedData; } function vtkStreamingOpenGLTexture(publicAPI, model) { model.classHierarchy.push('vtkStreamingOpenGLTexture'); model.updatedFrames = []; model.volumeId = null; const superCreate3DFilterableFromRaw = publicAPI.create3DFilterableFromRaw; publicAPI.create3DFilterableFromRaw = ({ width, height, depth, numberOfComponents, dataType, data, preferSizeOverAccuracy }) => { model.inputDataType = dataType; model.inputNumComps = numberOfComponents; superCreate3DFilterableFromRaw({ width, height, depth, numberOfComponents, dataType, data, preferSizeOverAccuracy }); }; const superUpdate = publicAPI.updateVolumeInfoForGL; publicAPI.updateVolumeInfoForGL = (dataType, numComps) => { const isScalingApplied = superUpdate(dataType, numComps); model.volumeInfo.dataComputedScale = [1]; model.volumeInfo.dataComputedOffset = [0]; return isScalingApplied; }; publicAPI.update3DFromRaw = () => { const { volumeId } = model; if (!volumeId) { return; } const volume = _cache_cache__WEBPACK_IMPORTED_MODULE_2__["default"].getVolume(volumeId); if (!volume) { return; } model._openGLRenderWindow.activateTexture(publicAPI); publicAPI.createTexture(); publicAPI.bind(); if (volume.isDynamicVolume()) { updateDynamicVolumeTexture(); return; } return publicAPI.hasUpdatedFrames() && updateTextureImagesUsingVoxelManager(); }; const superModified = publicAPI.modified; publicAPI.setUpdatedFrame = frameIndex => { model.updatedFrames[frameIndex] = true; superModified(); }; publicAPI.modified = () => { superModified(); const volume = _cache_cache__WEBPACK_IMPORTED_MODULE_2__["default"].getVolume(model.volumeId); if (!volume) { return; } const imageIds = volume.imageIds; for (let i = 0; i < imageIds.length; i++) { model.updatedFrames[i] = true; } }; function updateTextureImagesUsingVoxelManager() { const volume = _cache_cache__WEBPACK_IMPORTED_MODULE_2__["default"].getVolume(model.volumeId); const imageIds = volume.imageIds; for (let i = 0; i < model.updatedFrames.length; i++) { if (model.updatedFrames[i]) { const image = _cache_cache__WEBPACK_IMPORTED_MODULE_2__["default"].getImage(imageIds[i]); if (!image) { continue; } let data = image.voxelManager.getScalarData(); const gl = model.context; if (volume.dataType !== data.constructor.name) { data = convertDataType(data, volume.dataType); } const [pixData] = publicAPI.updateArrayDataTypeForGL(volume.dataType, [data]); publicAPI.bind(); const zOffset = i; gl.texSubImage3D(model.target, 0, 0, 0, zOffset, model.width, model.height, 1, model.format, model.openGLDataType, pixData); publicAPI.deactivate(); model.updatedFrames[i] = null; } } if (model.generateMipmap) { model.context.generateMipmap(model.target); } publicAPI.deactivate(); return true; } function updateDynamicVolumeTexture() { const volume = _cache_cache__WEBPACK_IMPORTED_MODULE_2__["default"].getVolume(model.volumeId); const imageIds = volume.getCurrentDimensionGroupImageIds(); if (!imageIds.length) { return false; } let constructor; for (let i = 0; i < imageIds.length; i++) { const imageId = imageIds[i]; const image = _cache_cache__WEBPACK_IMPORTED_MODULE_2__["default"].getImage(imageId); let data; if (!image) { constructor = (0,_utilities_getBufferConfiguration__WEBPACK_IMPORTED_MODULE_3__.getConstructorFromType)(volume.dataType, true); data = new constructor(model.width * model.height); } else { data = image.voxelManager.getScalarData(); constructor = data.constructor; } const gl = model.context; if (volume.dataType !== data.constructor.name) { data = convertDataType(data, volume.dataType); } const [pixData] = publicAPI.updateArrayDataTypeForGL(volume.dataType, [data]); publicAPI.bind(); let zOffset = i; gl.texSubImage3D(model.target, 0, 0, 0, zOffset, model.width, model.height, 1, model.format, model.openGLDataType, pixData); publicAPI.deactivate(); } if (model.generateMipmap) { model.context.generateMipmap(model.target); } publicAPI.deactivate(); return true; } publicAPI.hasUpdatedFrames = () => !model.updatedFrames.length || model.updatedFrames.some(frame => frame); publicAPI.getUpdatedFrames = () => model.updatedFrames; publicAPI.setVolumeId = volumeId => { model.volumeId = volumeId; }; publicAPI.getVolumeId = () => model.volumeId; publicAPI.setTextureParameters = ({ width, height, depth, numberOfComponents, dataType }) => { model.width ??= width; model.height ??= height; model.depth ??= depth; model.inputNumComps ??= numberOfComponents; model.inputDataType ??= dataType; }; publicAPI.getTextureParameters = () => ({ width: model.width, height: model.height, depth: model.depth, numberOfComponents: model.inputNumComps, dataType: model.inputDataType }); } const DEFAULT_VALUES = { updatedFrames: [] }; function extend(publicAPI, model, initialValues = {}) { Object.assign(model, DEFAULT_VALUES, initialValues); _kitware_vtk_js_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_1__["default"].extend(publicAPI, model, initialValues); vtkStreamingOpenGLTexture(publicAPI, model); } const newInstance = _kitware_vtk_js_macros__WEBPACK_IMPORTED_MODULE_0__["default"].newInstance(extend, 'vtkStreamingOpenGLTexture'); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ newInstance, extend }); /***/ }, /***/ 16874 /*!*******************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/vtkClasses/vtkStreamingOpenGLViewNodeFactory.js ***! \*******************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ extend: () => (/* binding */ extend), /* harmony export */ newInstance: () => (/* binding */ newInstance), /* harmony export */ registerOverride: () => (/* binding */ registerOverride) /* harmony export */ }); /* harmony import */ var _kitware_vtk_js_macros__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kitware/vtk.js/macros */ 64946); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_Actor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/Actor */ 25687); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_Actor2D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/Actor2D */ 73601); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_Camera__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/Camera */ 75283); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_Glyph3DMapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/Glyph3DMapper */ 68410); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_ImageMapper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/ImageMapper */ 84118); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_ImageCPRMapper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/ImageCPRMapper */ 68901); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_ImageSlice__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/ImageSlice */ 82925); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_PixelSpaceCallbackMapper__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/PixelSpaceCallbackMapper */ 72824); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_PolyDataMapper__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/PolyDataMapper */ 34163); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_Renderer__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/Renderer */ 19219); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_Skybox__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/Skybox */ 17770); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_SphereMapper__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/SphereMapper */ 8468); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_StickMapper__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/StickMapper */ 86815); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/Texture */ 82829); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_Volume__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/Volume */ 98278); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_VolumeMapper__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/VolumeMapper */ 54143); /* harmony import */ var _kitware_vtk_js_Rendering_SceneGraph_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/SceneGraph/ViewNodeFactory */ 51640); /* harmony import */ var _vtkStreamingOpenGLVolumeMapper__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./vtkStreamingOpenGLVolumeMapper */ 74960); const CLASS_MAPPING = Object.create(null); function registerOverride(className, fn) { CLASS_MAPPING[className] = fn; } function vtkStreamingOpenGLViewNodeFactory(publicAPI, model) { model.classHierarchy.push('vtkStreamingOpenGLViewNodeFactory'); publicAPI.createNode = dataObject => { if (dataObject.isDeleted()) { return null; } let cpt = 0; let className = dataObject.getClassName(cpt++); let isObject = false; const keys = Object.keys(model.overrides); while (className && !isObject) { if (keys.includes(className)) { isObject = true; } else { className = dataObject.getClassName(cpt++); } } if (!isObject) { return null; } const initialValues = model.getModelInitialValues(dataObject); const vn = model.overrides[className](initialValues); vn.setMyFactory(publicAPI); return vn; }; model.overrides = CLASS_MAPPING; model.getModelInitialValues = dataObject => { const initialValues = {}; const className = dataObject.getClassName(); if (className === 'vtkSharedVolumeMapper') { initialValues.scalarTexture = dataObject.getScalarTexture(); } return initialValues; }; } const DEFAULT_VALUES = {}; function extend(publicAPI, model, initialValues = {}) { Object.assign(model, DEFAULT_VALUES, initialValues); _kitware_vtk_js_Rendering_SceneGraph_ViewNodeFactory__WEBPACK_IMPORTED_MODULE_17__["default"].extend(publicAPI, model, initialValues); vtkStreamingOpenGLViewNodeFactory(publicAPI, model); registerOverride('vtkActor', _kitware_vtk_js_Rendering_OpenGL_Actor__WEBPACK_IMPORTED_MODULE_1__["default"].newInstance); registerOverride('vtkActor2D', _kitware_vtk_js_Rendering_OpenGL_Actor2D__WEBPACK_IMPORTED_MODULE_2__["default"].newInstance); registerOverride('vtkCamera', _kitware_vtk_js_Rendering_OpenGL_Camera__WEBPACK_IMPORTED_MODULE_3__["default"].newInstance); registerOverride('vtkGlyph3DMapper', _kitware_vtk_js_Rendering_OpenGL_Glyph3DMapper__WEBPACK_IMPORTED_MODULE_4__["default"].newInstance); registerOverride('vtkImageMapper', _kitware_vtk_js_Rendering_OpenGL_ImageMapper__WEBPACK_IMPORTED_MODULE_5__["default"].newInstance); registerOverride('vtkImageCPRMapper', _kitware_vtk_js_Rendering_OpenGL_ImageCPRMapper__WEBPACK_IMPORTED_MODULE_6__["default"].newInstance); registerOverride('vtkImageSlice', _kitware_vtk_js_Rendering_OpenGL_ImageSlice__WEBPACK_IMPORTED_MODULE_7__["default"].newInstance); registerOverride('vtkMapper', _kitware_vtk_js_Rendering_OpenGL_PolyDataMapper__WEBPACK_IMPORTED_MODULE_9__["default"].newInstance); registerOverride('vtkPixelSpaceCallbackMapper', _kitware_vtk_js_Rendering_OpenGL_PixelSpaceCallbackMapper__WEBPACK_IMPORTED_MODULE_8__["default"].newInstance); registerOverride('vtkRenderer', _kitware_vtk_js_Rendering_OpenGL_Renderer__WEBPACK_IMPORTED_MODULE_10__["default"].newInstance); registerOverride('vtkSkybox', _kitware_vtk_js_Rendering_OpenGL_Skybox__WEBPACK_IMPORTED_MODULE_11__["default"].newInstance); registerOverride('vtkSphereMapper', _kitware_vtk_js_Rendering_OpenGL_SphereMapper__WEBPACK_IMPORTED_MODULE_12__["default"].newInstance); registerOverride('vtkStickMapper', _kitware_vtk_js_Rendering_OpenGL_StickMapper__WEBPACK_IMPORTED_MODULE_13__["default"].newInstance); registerOverride('vtkTexture', _kitware_vtk_js_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_14__["default"].newInstance); registerOverride('vtkVolume', _kitware_vtk_js_Rendering_OpenGL_Volume__WEBPACK_IMPORTED_MODULE_15__["default"].newInstance); registerOverride('vtkVolumeMapper', _kitware_vtk_js_Rendering_OpenGL_VolumeMapper__WEBPACK_IMPORTED_MODULE_16__["default"].newInstance); registerOverride('vtkSharedVolumeMapper', _vtkStreamingOpenGLVolumeMapper__WEBPACK_IMPORTED_MODULE_18__["default"].newInstance); } const newInstance = _kitware_vtk_js_macros__WEBPACK_IMPORTED_MODULE_0__["default"].newInstance(extend, 'vtkStreamingOpenGLViewNodeFactory'); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ newInstance, extend }); /***/ }, /***/ 74960 /*!****************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/RenderingEngine/vtkClasses/vtkStreamingOpenGLVolumeMapper.js ***! \****************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ extend: () => (/* binding */ extend), /* harmony export */ newInstance: () => (/* binding */ newInstance) /* harmony export */ }); /* harmony import */ var _kitware_vtk_js_macros__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kitware/vtk.js/macros */ 64946); /* harmony import */ var _kitware_vtk_js_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @kitware/vtk.js/Common/Core/DataArray */ 40928); /* harmony import */ var _kitware_vtk_js_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @kitware/vtk.js/Common/Core/DataArray/Constants */ 69882); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_VolumeMapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/VolumeMapper */ 54143); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/Texture */ 82829); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/Texture/Constants */ 49063); /* harmony import */ var _kitware_vtk_js_Rendering_OpenGL_RenderWindow_resourceSharingHelper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/OpenGL/RenderWindow/resourceSharingHelper */ 42799); /* harmony import */ var _kitware_vtk_js_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/Property/Constants */ 20275); /* harmony import */ var _kitware_vtk_js_Rendering_Core_VolumeMapper_Constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/VolumeMapper/Constants */ 69041); /* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../init */ 15678); function vtkStreamingOpenGLVolumeMapper(publicAPI, model) { model.classHierarchy.push('vtkStreamingOpenGLVolumeMapper'); const graphicsResourceReferenceCount = new Map(); function decreaseGraphicsResourceCount(openGLRenderWindow, coreObject) { if (!coreObject) { return; } const oldCount = graphicsResourceReferenceCount.get(coreObject) ?? 0; const newCount = oldCount - 1; if (newCount <= 0) { openGLRenderWindow.unregisterGraphicsResourceUser(coreObject, publicAPI); graphicsResourceReferenceCount.delete(coreObject); } else { graphicsResourceReferenceCount.set(coreObject, newCount); } } function increaseGraphicsResourceCount(openGLRenderWindow, coreObject) { if (!coreObject) { return; } const oldCount = graphicsResourceReferenceCount.get(coreObject) ?? 0; const newCount = oldCount + 1; graphicsResourceReferenceCount.set(coreObject, newCount); if (oldCount <= 0) { openGLRenderWindow.registerGraphicsResourceUser(coreObject, publicAPI); } } function replaceGraphicsResource(openGLRenderWindow, oldResourceCoreObject, newResourceCoreObject) { if (oldResourceCoreObject === newResourceCoreObject) { return; } decreaseGraphicsResourceCount(openGLRenderWindow, oldResourceCoreObject); increaseGraphicsResourceCount(openGLRenderWindow, newResourceCoreObject); } publicAPI.renderPiece = (ren, actor) => { publicAPI.invokeEvent({ type: 'StartEvent' }); model.renderable.update(); const numberOfInputs = model.renderable.getNumberOfInputPorts(); model.currentValidInputs = []; for (let inputIndex = 0; inputIndex < numberOfInputs; ++inputIndex) { const imageData = model.renderable.getInputData(inputIndex); if (imageData && !imageData.isDeleted()) { model.currentValidInputs.push({ imageData, inputIndex }); } } let newNumberOfLights = 0; if (model.currentValidInputs.length > 0) { const volumeProperties = actor.getProperties(); const firstValidInput = model.currentValidInputs[0]; const firstImageData = firstValidInput.imageData; const firstVolumeProperty = volumeProperties[firstValidInput.inputIndex]; if (firstVolumeProperty.getShade() && model.renderable.getBlendMode() === _kitware_vtk_js_Rendering_Core_VolumeMapper_Constants__WEBPACK_IMPORTED_MODULE_8__.BlendMode.COMPOSITE_BLEND) { ren.getLights().forEach(light => { if (light.getSwitch() > 0) { newNumberOfLights++; } }); } const numberOfValidInputs = model.currentValidInputs.length; const multiTexturePerVolumeEnabled = numberOfValidInputs > 1; const { numberOfComponents } = firstImageData.get('numberOfComponents'); model.numberOfComponents = multiTexturePerVolumeEnabled ? numberOfValidInputs : numberOfComponents; if (model.numberOfComponents > 1) { model.useIndependentComponents = firstVolumeProperty.getIndependentComponents(); } else { model.useIndependentComponents = false; } } if (newNumberOfLights !== model.numberOfLights) { model.numberOfLights = newNumberOfLights; publicAPI.modified(); } publicAPI.invokeEvent({ type: 'EndEvent' }); if (model.currentValidInputs.length === 0) { return; } publicAPI.renderPieceStart(ren, actor); publicAPI.renderPieceDraw(ren, actor); publicAPI.renderPieceFinish(ren, actor); }; publicAPI.buildBufferObjects = (ren, actor) => { if (!model.jitterTexture.getHandle()) { const jitterArray = new Float32Array(32 * 32); for (let i = 0; i < 32 * 32; ++i) { jitterArray[i] = Math.random(); } model.jitterTexture.setMinificationFilter(_kitware_vtk_js_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_5__.Filter.NEAREST); model.jitterTexture.setMagnificationFilter(_kitware_vtk_js_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_5__.Filter.NEAREST); model.jitterTexture.create2DFromRaw({ width: 32, height: 32, numComps: 1, dataType: _kitware_vtk_js_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_2__.VtkDataTypes.FLOAT, data: jitterArray }); } const volumeProperties = actor.getProperties(); const firstValidInput = model.currentValidInputs[0]; const firstVolumeProperty = volumeProperties[firstValidInput.inputIndex]; const numberOfComponents = model.numberOfComponents; const useIndependentComps = model.useIndependentComponents; const numIComps = useIndependentComps ? numberOfComponents : 1; const opacityFunctions = []; for (let component = 0; component < numIComps; ++component) { opacityFunctions.push(firstVolumeProperty.getScalarOpacity(component)); } const opacityFuncHash = (0,_kitware_vtk_js_Rendering_OpenGL_RenderWindow_resourceSharingHelper__WEBPACK_IMPORTED_MODULE_6__.getTransferFunctionsHash)(opacityFunctions, useIndependentComps, numIComps); const firstScalarOpacityFunc = firstVolumeProperty.getScalarOpacity(); const opTex = model._openGLRenderWindow.getGraphicsResourceForObject(firstScalarOpacityFunc); const reBuildOp = !opTex?.oglObject?.getHandle() || opTex.hash !== opacityFuncHash; if (reBuildOp) { const newOpacityTexture = _kitware_vtk_js_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_4__["default"].newInstance(); newOpacityTexture.setOpenGLRenderWindow(model._openGLRenderWindow); let oWidth = model.renderable.getOpacityTextureWidth(); if (oWidth <= 0) { oWidth = model.context.getParameter(model.context.MAX_TEXTURE_SIZE); } const oSize = oWidth * 2 * numIComps; const ofTable = new Float32Array(oSize); const tmpTable = new Float32Array(oWidth); for (let c = 0; c < numIComps; ++c) { const ofun = firstVolumeProperty.getScalarOpacity(c); const opacityFactor = publicAPI.getCurrentSampleDistance(ren) / firstVolumeProperty.getScalarOpacityUnitDistance(c); const oRange = ofun.getRange(); ofun.getTable(oRange[0], oRange[1], oWidth, tmpTable, 1); for (let i = 0; i < oWidth; ++i) { ofTable[c * oWidth * 2 + i] = 1.0 - (1.0 - tmpTable[i]) ** opacityFactor; ofTable[c * oWidth * 2 + i + oWidth] = ofTable[c * oWidth * 2 + i]; } } newOpacityTexture.resetFormatAndType(); newOpacityTexture.setMinificationFilter(_kitware_vtk_js_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_5__.Filter.LINEAR); newOpacityTexture.setMagnificationFilter(_kitware_vtk_js_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_5__.Filter.LINEAR); if (model._openGLRenderWindow.getWebgl2() || model.context.getExtension('OES_texture_float') && model.context.getExtension('OES_texture_float_linear')) { newOpacityTexture.create2DFromRaw({ width: oWidth, height: 2 * numIComps, numComps: 1, dataType: _kitware_vtk_js_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_2__.VtkDataTypes.FLOAT, data: ofTable }); } else { const oTable = new Uint8ClampedArray(oSize); for (let i = 0; i < oSize; ++i) { oTable[i] = 255.0 * ofTable[i]; } newOpacityTexture.create2DFromRaw({ width: oWidth, height: 2 * numIComps, numComps: 1, dataType: _kitware_vtk_js_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_2__.VtkDataTypes.UNSIGNED_CHAR, data: oTable }); } if (firstScalarOpacityFunc) { model._openGLRenderWindow.setGraphicsResourceForObject(firstScalarOpacityFunc, newOpacityTexture, opacityFuncHash); } model.opacityTexture = newOpacityTexture; } else { model.opacityTexture = opTex.oglObject; } replaceGraphicsResource(model._openGLRenderWindow, model._opacityTextureCore, firstScalarOpacityFunc); model._opacityTextureCore = firstScalarOpacityFunc; const colorTransferFunctions = []; for (let component = 0; component < numIComps; ++component) { colorTransferFunctions.push(firstVolumeProperty.getRGBTransferFunction(component)); } const colorFuncHash = (0,_kitware_vtk_js_Rendering_OpenGL_RenderWindow_resourceSharingHelper__WEBPACK_IMPORTED_MODULE_6__.getTransferFunctionsHash)(colorTransferFunctions, useIndependentComps, numIComps); const firstColorTransferFunc = firstVolumeProperty.getRGBTransferFunction(); const cTex = model._openGLRenderWindow.getGraphicsResourceForObject(firstColorTransferFunc); const reBuildC = !cTex?.oglObject?.getHandle() || cTex?.hash !== colorFuncHash; if (reBuildC) { const newColorTexture = _kitware_vtk_js_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_4__["default"].newInstance(); newColorTexture.setOpenGLRenderWindow(model._openGLRenderWindow); let cWidth = model.renderable.getColorTextureWidth(); if (cWidth <= 0) { cWidth = model.context.getParameter(model.context.MAX_TEXTURE_SIZE); } const cSize = cWidth * 2 * numIComps * 3; const cTable = new Uint8ClampedArray(cSize); const tmpTable = new Float32Array(cWidth * 3); for (let c = 0; c < numIComps; ++c) { const cfun = firstVolumeProperty.getRGBTransferFunction(c); const cRange = cfun.getRange(); cfun.getTable(cRange[0], cRange[1], cWidth, tmpTable, 1); for (let i = 0; i < cWidth * 3; ++i) { cTable[c * cWidth * 6 + i] = 255.0 * tmpTable[i]; cTable[c * cWidth * 6 + i + cWidth * 3] = 255.0 * tmpTable[i]; } } newColorTexture.resetFormatAndType(); newColorTexture.setMinificationFilter(_kitware_vtk_js_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_5__.Filter.LINEAR); newColorTexture.setMagnificationFilter(_kitware_vtk_js_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_5__.Filter.LINEAR); newColorTexture.create2DFromRaw({ width: cWidth, height: 2 * numIComps, numComps: 3, dataType: _kitware_vtk_js_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_2__.VtkDataTypes.UNSIGNED_CHAR, data: cTable }); model._openGLRenderWindow.setGraphicsResourceForObject(firstColorTransferFunc, newColorTexture, colorFuncHash); model.colorTexture = newColorTexture; } else { model.colorTexture = cTex.oglObject; } replaceGraphicsResource(model._openGLRenderWindow, model._colorTextureCore, firstColorTransferFunc); model._colorTextureCore = firstColorTransferFunc; model.currentValidInputs.forEach(({ imageData, inputIndex: _inputIndex }, component) => { if (!model.scalarTextures) { model.scalarTextures = []; } if (!model.scalarTextures[component]) { console.warn(`ScalarTexture for component ${component} not initialized, skipping.`); return; } const currentTexture = model.scalarTextures[component]; const toString = `${imageData.getMTime()}-${currentTexture.getMTime()}`; if (!model.scalarTextureStrings) { model.scalarTextureStrings = []; } if (model.scalarTextureStrings[component] !== toString) { const dims = imageData.getDimensions(); currentTexture.setOpenGLRenderWindow(model._openGLRenderWindow); currentTexture.enableUseHalfFloat(false); const previousTextureParameters = currentTexture.getTextureParameters(); const dataType = imageData.get('dataType').dataType; let shouldReset = true; if (previousTextureParameters?.dataType === dataType) { if (previousTextureParameters?.width === dims[0]) { if (previousTextureParameters?.height === dims[1]) { if (previousTextureParameters?.depth === dims[2]) { shouldReset = false; } } } } if (shouldReset) { const norm16Ext = model.context.getExtension('EXT_texture_norm16'); currentTexture.setOglNorm16Ext((0,_init__WEBPACK_IMPORTED_MODULE_9__.getCanUseNorm16Texture)() ? norm16Ext : null); currentTexture.resetFormatAndType(); currentTexture.setTextureParameters({ width: dims[0], height: dims[1], depth: dims[2], numberOfComponents: numIComps, dataType }); currentTexture.create3DFromRaw({ width: dims[0], height: dims[1], depth: dims[2], numComps: numIComps, dataType, data: null }); currentTexture.update3DFromRaw(); } else { currentTexture.deactivate(); currentTexture.update3DFromRaw(); } model.scalarTextureStrings[component] = toString; } if (!model._scalarTexturesCore) { model._scalarTexturesCore = []; } }); const labelOutlineThicknessArray = firstVolumeProperty.getLabelOutlineThickness(); const lTex = model._openGLRenderWindow.getGraphicsResourceForObject(labelOutlineThicknessArray); const labelOutlineThicknessHash = labelOutlineThicknessArray.join('-'); const reBuildL = !lTex?.oglObject?.getHandle() || lTex?.hash !== labelOutlineThicknessHash; if (reBuildL) { const newLabelOutlineThicknessTexture = _kitware_vtk_js_Rendering_OpenGL_Texture__WEBPACK_IMPORTED_MODULE_4__["default"].newInstance(); newLabelOutlineThicknessTexture.setOpenGLRenderWindow(model._openGLRenderWindow); let lWidth = model.renderable.getLabelOutlineTextureWidth(); if (lWidth <= 0) { lWidth = model.context.getParameter(model.context.MAX_TEXTURE_SIZE); } const lHeight = 1; const lSize = lWidth * lHeight; const lTable = new Uint8Array(lSize); for (let i = 0; i < lWidth; ++i) { const thickness = typeof labelOutlineThicknessArray[i] !== 'undefined' ? labelOutlineThicknessArray[i] : labelOutlineThicknessArray[0]; lTable[i] = thickness; } newLabelOutlineThicknessTexture.resetFormatAndType(); newLabelOutlineThicknessTexture.setMinificationFilter(_kitware_vtk_js_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_5__.Filter.NEAREST); newLabelOutlineThicknessTexture.setMagnificationFilter(_kitware_vtk_js_Rendering_OpenGL_Texture_Constants__WEBPACK_IMPORTED_MODULE_5__.Filter.NEAREST); newLabelOutlineThicknessTexture.create2DFromRaw({ width: lWidth, height: lHeight, numComps: 1, dataType: _kitware_vtk_js_Common_Core_DataArray_Constants__WEBPACK_IMPORTED_MODULE_2__.VtkDataTypes.UNSIGNED_CHAR, data: lTable }); if (labelOutlineThicknessArray) { model._openGLRenderWindow.setGraphicsResourceForObject(labelOutlineThicknessArray, newLabelOutlineThicknessTexture, labelOutlineThicknessHash); } model.labelOutlineThicknessTexture = newLabelOutlineThicknessTexture; } else { model.labelOutlineThicknessTexture = lTex.oglObject; } replaceGraphicsResource(model._openGLRenderWindow, model._labelOutlineThicknessTextureCore, labelOutlineThicknessArray); model._labelOutlineThicknessTextureCore = labelOutlineThicknessArray; if (!model.tris.getCABO().getElementCount()) { const ptsArray = new Float32Array(12); for (let i = 0; i < 4; i++) { ptsArray[i * 3] = i % 2 * 2 - 1.0; ptsArray[i * 3 + 1] = i > 1 ? 1.0 : -1.0; ptsArray[i * 3 + 2] = -1.0; } const cellArray = new Uint16Array(8); cellArray[0] = 3; cellArray[1] = 0; cellArray[2] = 1; cellArray[3] = 3; cellArray[4] = 3; cellArray[5] = 0; cellArray[6] = 3; cellArray[7] = 2; const points = _kitware_vtk_js_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__["default"].newInstance({ numberOfComponents: 3, values: ptsArray }); points.setName('points'); const cells = _kitware_vtk_js_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__["default"].newInstance({ numberOfComponents: 1, values: cellArray }); model.tris.getCABO().createVBO(cells, 'polys', _kitware_vtk_js_Rendering_Core_Property_Constants__WEBPACK_IMPORTED_MODULE_7__.Representation.SURFACE, { points, cellOffset: 0 }); } model.VBOBuildTime.modified(); }; publicAPI.getNeedToRebuildBufferObjects = (ren, actor) => { if (model.VBOBuildTime.getMTime() < publicAPI.getMTime() || model.VBOBuildTime.getMTime() < actor.getMTime() || model.VBOBuildTime.getMTime() < model.renderable.getMTime() || model.VBOBuildTime.getMTime() < actor.getProperty().getMTime() || model.VBOBuildTime.getMTime() < model.colorTexture?.getMTime() || model.VBOBuildTime.getMTime() < model.labelOutlineThicknessTexture?.getMTime() || !model.colorTexture?.getHandle() || !model.labelOutlineThicknessTexture?.getHandle()) { return true; } if (model.scalarTextures && model.scalarTextures.length > 0) { for (let i = 0; i < model.scalarTextures.length; i++) { const texture = model.scalarTextures[i]; if (texture && (model.VBOBuildTime.getMTime() < texture.getMTime() || !texture.getHandle())) { return true; } } } if (model.currentValidInputs && model.currentValidInputs.length > 0) { for (let i = 0; i < model.currentValidInputs.length; i++) { const input = model.currentValidInputs[i]; if (input && input.imageData && model.VBOBuildTime.getMTime() < input.imageData.getMTime()) { return true; } } } return false; }; } const DEFAULT_VALUES = {}; function extend(publicAPI, model, initialValues = {}) { Object.assign(model, DEFAULT_VALUES, initialValues); _kitware_vtk_js_Rendering_OpenGL_VolumeMapper__WEBPACK_IMPORTED_MODULE_3__["default"].extend(publicAPI, model, initialValues); if (initialValues.scalarTexture) { model.scalarTextures = [initialValues.scalarTexture]; } else { model.scalarTextures = []; } model.scalarTextureStrings = []; model._scalarTexturesCore = []; model.previousState = {}; vtkStreamingOpenGLVolumeMapper(publicAPI, model); } const newInstance = _kitware_vtk_js_macros__WEBPACK_IMPORTED_MODULE_0__["default"].newInstance(extend, 'vtkStreamingOpenGLVolumeMapper'); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ newInstance, extend }); /***/ }, /***/ 57889 /*!***************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/Settings.js ***! \***************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ Settings) /* harmony export */ }); const DEFAULT_SETTINGS = Symbol('DefaultSettings'); const RUNTIME_SETTINGS = Symbol('RuntimeSettings'); const OBJECT_SETTINGS_MAP = Symbol('ObjectSettingsMap'); const DICTIONARY = Symbol('Dictionary'); class Settings { constructor(base) { const dictionary = Object.create(base instanceof Settings && DICTIONARY in base ? base[DICTIONARY] : null); Object.seal(Object.defineProperty(this, DICTIONARY, { value: dictionary })); } set(key, value) { return set(this[DICTIONARY], key, value, null); } get(key) { return get(this[DICTIONARY], key); } unset(key) { return unset(this[DICTIONARY], key + ''); } forEach(callback) { iterate(this[DICTIONARY], callback); } extend() { return new Settings(this); } import(root) { if (isPlainObject(root)) { Object.keys(root).forEach(key => { set(this[DICTIONARY], key, root[key], null); }); } } dump() { const context = {}; iterate(this[DICTIONARY], (key, value) => { if (typeof value !== 'undefined') { deepSet(context, key, value); } }); return context; } static assert(subject) { return subject instanceof Settings ? subject : Settings.getRuntimeSettings(); } static getDefaultSettings(subfield = null) { let defaultSettings = Settings[DEFAULT_SETTINGS]; if (!(defaultSettings instanceof Settings)) { defaultSettings = new Settings(); Settings[DEFAULT_SETTINGS] = defaultSettings; } if (subfield) { const settingObj = {}; defaultSettings.forEach(name => { if (name.startsWith(subfield)) { const setting = name.split(`${subfield}.`)[1]; settingObj[setting] = defaultSettings.get(name); } }); return settingObj; } return defaultSettings; } static getRuntimeSettings() { let runtimeSettings = Settings[RUNTIME_SETTINGS]; if (!(runtimeSettings instanceof Settings)) { runtimeSettings = new Settings(Settings.getDefaultSettings()); Settings[RUNTIME_SETTINGS] = runtimeSettings; } return runtimeSettings; } static getObjectSettings(subject, from) { let settings = null; if (subject instanceof Settings) { settings = subject; } else if (typeof subject === 'object' && subject !== null) { let objectSettingsMap = Settings[OBJECT_SETTINGS_MAP]; if (!(objectSettingsMap instanceof WeakMap)) { objectSettingsMap = new WeakMap(); Settings[OBJECT_SETTINGS_MAP] = objectSettingsMap; } settings = objectSettingsMap.get(subject); if (!(settings instanceof Settings)) { settings = new Settings(Settings.assert(Settings.getObjectSettings(from))); objectSettingsMap.set(subject, settings); } } return settings; } static extendRuntimeSettings() { return Settings.getRuntimeSettings().extend(); } } function unset(dictionary, name) { if (name.endsWith('.')) { let deleteCount = 0; const namespace = name; const base = namespace.slice(0, -1); const deleteAll = base.length === 0; for (const key in dictionary) { if (Object.prototype.hasOwnProperty.call(dictionary, key) && (deleteAll || key.startsWith(namespace) || key === base)) { delete dictionary[key]; ++deleteCount; } } return deleteCount > 0; } return delete dictionary[name]; } function iterate(dictionary, callback) { for (const key in dictionary) { callback(key, dictionary[key]); } } function setAll(dictionary, prefix, record, references) { let failCount; if (references.has(record)) { return set(dictionary, prefix, null, references); } references.add(record); failCount = 0; for (const field in record) { if (Object.prototype.hasOwnProperty.call(record, field)) { const key = field.length === 0 ? prefix : `${prefix}.${field}`; if (!set(dictionary, key, record[field], references)) { ++failCount; } } } references.delete(record); return failCount === 0; } function set(dictionary, key, value, references) { if (isValidKey(key)) { if (isPlainObject(value)) { return setAll(dictionary, key, value, references instanceof WeakSet ? references : new WeakSet()); } dictionary[key] = value; return true; } return false; } function get(dictionary, key) { return dictionary[key]; } function isValidKey(key) { let last, current, previous; if (typeof key !== 'string' || (last = key.length - 1) < 0) { return false; } previous = -1; while ((current = key.indexOf('.', previous + 1)) >= 0) { if (current - previous < 2 || current === last) { return false; } previous = current; } return true; } function isPlainObject(subject) { if (typeof subject === 'object' && subject !== null) { const prototype = Object.getPrototypeOf(subject); if (prototype === Object.prototype || prototype === null) { return true; } } return false; } function deepSet(context, key, value) { const separator = key.indexOf('.'); if (separator >= 0) { const subKey = key.slice(0, separator); let subContext = context[subKey]; if (typeof subContext !== 'object' || subContext === null) { const subContextValue = subContext; subContext = {}; if (typeof subContextValue !== 'undefined') { subContext[''] = subContextValue; } context[subKey] = subContext; } deepSet(subContext, key.slice(separator + 1, key.length), value); } else { context[key] = value; } } Settings.getDefaultSettings().set('useCursors', true); /***/ }, /***/ 38277 /*!******************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/cache/cache.js ***! \******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Cache: () => (/* binding */ Cache), /* harmony export */ cache: () => (/* binding */ cache), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utilities/triggerEvent */ 91133); /* harmony import */ var _utilities_imageIdToURI__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utilities/imageIdToURI */ 40232); /* harmony import */ var _eventTarget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../eventTarget */ 28699); /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../enums/Events */ 14566); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../enums */ 23995); /* harmony import */ var _utilities_fnv1aHash__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utilities/fnv1aHash */ 81777); const ONE_GB = 1073741824; class Cache { constructor() { this._imageCache = new Map(); this._volumeCache = new Map(); this._imageIdsToVolumeIdCache = new Map(); this._referencedImageIdToImageIdCache = new Map(); this._geometryCache = new Map(); this._imageCacheSize = 0; this._maxCacheSize = 3 * ONE_GB; this._geometryCacheSize = 0; this.setMaxCacheSize = newMaxCacheSize => { if (!newMaxCacheSize || typeof newMaxCacheSize !== 'number') { const errorMessage = `New max cacheSize ${this._maxCacheSize} should be defined and should be a number.`; throw new Error(errorMessage); } this._maxCacheSize = newMaxCacheSize; }; this.isCacheable = byteLength => { const bytesAvailable = this.getBytesAvailable(); const purgableImageBytes = Array.from(this._imageCache.values()).reduce((total, image) => { if (!image.sharedCacheKey) { return total + image.sizeInBytes; } return total; }, 0); const availableSpaceWithoutSharedCacheKey = bytesAvailable + purgableImageBytes; return availableSpaceWithoutSharedCacheKey >= byteLength; }; this.getMaxCacheSize = () => this._maxCacheSize; this.getCacheSize = () => this._imageCacheSize; this._decacheImage = (imageId, force = false) => { const cachedImage = this._imageCache.get(imageId); if (!cachedImage) { return; } if (cachedImage.sharedCacheKey && !force) { throw new Error('Cannot decache an image with a shared cache key. You need to manually decache the volume first.'); } const { imageLoadObject } = cachedImage; if (cachedImage.image?.referencedImageId) { this._referencedImageIdToImageIdCache.delete(cachedImage.image.referencedImageId); } if (imageLoadObject?.cancelFn) { imageLoadObject.cancelFn(); } if (imageLoadObject?.decache) { imageLoadObject.decache(); } this._imageCache.delete(imageId); }; this._decacheVolume = volumeId => { const cachedVolume = this._volumeCache.get(volumeId); if (!cachedVolume) { return; } const { volumeLoadObject, volume } = cachedVolume; if (!volume) { return; } if (volume.cancelLoading) { volume.cancelLoading(); } if (volume.imageData) { volume.imageData.delete(); } if (volumeLoadObject.cancelFn) { volumeLoadObject.cancelFn(); } if (volume.imageIds) { volume.imageIds.forEach(imageId => { const cachedImage = this._imageCache.get(imageId); if (cachedImage && cachedImage.sharedCacheKey === volumeId) { cachedImage.sharedCacheKey = undefined; } }); } this._volumeCache.delete(volumeId); }; this.purgeCache = () => { const imageIterator = this._imageCache.keys(); this.purgeVolumeCache(); while (true) { const { value: imageId, done } = imageIterator.next(); if (done) { break; } this.removeImageLoadObject(imageId, { force: true }); (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_1__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_3__["default"], _enums_Events__WEBPACK_IMPORTED_MODULE_4__["default"].IMAGE_CACHE_IMAGE_REMOVED, { imageId }); } }; this.purgeVolumeCache = () => { const volumeIterator = this._volumeCache.keys(); while (true) { const { value: volumeId, done } = volumeIterator.next(); if (done) { break; } this.removeVolumeLoadObject(volumeId); (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_1__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_3__["default"], _enums_Events__WEBPACK_IMPORTED_MODULE_4__["default"].VOLUME_CACHE_VOLUME_REMOVED, { volumeId }); } }; this.getVolumeLoadObject = volumeId => { if (volumeId === undefined) { throw new Error('getVolumeLoadObject: volumeId must not be undefined'); } const cachedVolume = this._volumeCache.get(volumeId); if (!cachedVolume) { return; } cachedVolume.timeStamp = Date.now(); return cachedVolume.volumeLoadObject; }; this.putGeometryLoadObject = (geometryId, geometryLoadObject) => { if (geometryId === undefined) { throw new Error('putGeometryLoadObject: geometryId must not be undefined'); } if (geometryLoadObject.promise === undefined) { throw new Error('putGeometryLoadObject: geometryLoadObject.promise must not be undefined'); } if (this._geometryCache.has(geometryId)) { throw new Error('putGeometryLoadObject: geometryId already present in geometryCache'); } if (geometryLoadObject.cancelFn && typeof geometryLoadObject.cancelFn !== 'function') { throw new Error('putGeometryLoadObject: geometryLoadObject.cancel must be a function'); } const cachedGeometry = { loaded: false, geometryId, geometryLoadObject, timeStamp: Date.now(), sizeInBytes: 0 }; this._geometryCache.set(geometryId, cachedGeometry); return geometryLoadObject.promise.then(geometry => { try { this._putGeometryCommon(geometryId, geometry, cachedGeometry); } catch (error) { console.debug(`Error in _putGeometryCommon for geometry ${geometryId}:`, error); throw error; } }).catch(error => { console.debug(`Error caching geometry ${geometryId}:`, error); this._geometryCache.delete(geometryId); throw error; }); }; this.getGeometry = geometryId => { if (geometryId === undefined) { throw new Error('getGeometry: geometryId must not be undefined'); } const cachedGeometry = this._geometryCache.get(geometryId); if (!cachedGeometry) { return; } cachedGeometry.timeStamp = Date.now(); return cachedGeometry.geometry; }; this.removeGeometryLoadObject = geometryId => { if (geometryId === undefined) { throw new Error('removeGeometryLoadObject: geometryId must not be undefined'); } const cachedGeometry = this._geometryCache.get(geometryId); if (!cachedGeometry) { throw new Error('removeGeometryLoadObject: geometryId was not present in geometryCache'); } this.decrementGeometryCacheSize(cachedGeometry.sizeInBytes); const eventDetails = { geometry: cachedGeometry, geometryId }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_1__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_3__["default"], _enums_Events__WEBPACK_IMPORTED_MODULE_4__["default"].GEOMETRY_CACHE_GEOMETRY_REMOVED, eventDetails); this._decacheGeometry(geometryId); }; this._decacheGeometry = geometryId => { const cachedGeometry = this._geometryCache.get(geometryId); if (!cachedGeometry) { return; } const { geometryLoadObject } = cachedGeometry; if (geometryLoadObject.cancelFn) { geometryLoadObject.cancelFn(); } if (geometryLoadObject.decache) { geometryLoadObject.decache(); } this._geometryCache.delete(geometryId); }; this.incrementGeometryCacheSize = increment => { this._geometryCacheSize += increment; }; this.decrementGeometryCacheSize = decrement => { this._geometryCacheSize -= decrement; }; this.getImageByReferencedImageId = referencedImageId => { const imageId = this._referencedImageIdToImageIdCache.get(referencedImageId); if (imageId) { return this._imageCache.get(imageId)?.image; } return undefined; }; this.getImage = (imageId, minQuality = _enums__WEBPACK_IMPORTED_MODULE_5__["default"].FAR_REPLICATE) => { if (imageId === undefined) { throw new Error('getImage: imageId must not be undefined'); } const cachedImage = this._imageCache.get(imageId); if (!cachedImage) { return; } cachedImage.timeStamp = Date.now(); if (cachedImage.image?.imageQualityStatus < minQuality) { return; } return cachedImage.image; }; this.getVolume = (volumeId, allowPartialMatch = false) => { if (volumeId === undefined) { throw new Error('getVolume: volumeId must not be undefined'); } const cachedVolume = this._volumeCache.get(volumeId); if (!cachedVolume) { return allowPartialMatch ? [...this._volumeCache.values()].find(cv => cv.volumeId.includes(volumeId))?.volume : undefined; } cachedVolume.timeStamp = Date.now(); return cachedVolume.volume; }; this.getVolumes = () => { const cachedVolumes = Array.from(this._volumeCache.values()); return cachedVolumes.map(cachedVolume => cachedVolume.volume); }; this.filterVolumesByReferenceId = volumeId => { const cachedVolumes = this.getVolumes(); return cachedVolumes.filter(volume => { return volume.referencedVolumeId === volumeId; }); }; this.removeImageLoadObject = (imageId, { force = false } = {}) => { if (imageId === undefined) { throw new Error('removeImageLoadObject: imageId must not be undefined'); } const cachedImage = this._imageCache.get(imageId); if (!cachedImage) { throw new Error('removeImageLoadObject: imageId was not present in imageCache'); } this._decacheImage(imageId, force); this.incrementImageCacheSize(-cachedImage.sizeInBytes); const eventDetails = { image: cachedImage, imageId }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_1__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_3__["default"], _enums_Events__WEBPACK_IMPORTED_MODULE_4__["default"].IMAGE_CACHE_IMAGE_REMOVED, eventDetails); }; this.removeVolumeLoadObject = volumeId => { if (volumeId === undefined) { throw new Error('removeVolumeLoadObject: volumeId must not be undefined'); } const cachedVolume = this._volumeCache.get(volumeId); if (!cachedVolume) { throw new Error('removeVolumeLoadObject: volumeId was not present in volumeCache'); } const eventDetails = { volume: cachedVolume, volumeId }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_1__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_3__["default"], _enums_Events__WEBPACK_IMPORTED_MODULE_4__["default"].VOLUME_CACHE_VOLUME_REMOVED, eventDetails); this._decacheVolume(volumeId); }; this.incrementImageCacheSize = increment => { this._imageCacheSize += increment; }; this.decrementImageCacheSize = decrement => { this._imageCacheSize -= decrement; }; this.getGeometryLoadObject = geometryId => { if (geometryId === undefined) { throw new Error('getGeometryLoadObject: geometryId must not be undefined'); } const cachedGeometry = this._geometryCache.get(geometryId); if (!cachedGeometry) { return; } cachedGeometry.timeStamp = Date.now(); return cachedGeometry.geometryLoadObject; }; } generateVolumeId(imageIds) { const imageURIs = imageIds.map(_utilities_imageIdToURI__WEBPACK_IMPORTED_MODULE_2__["default"]).sort(); let combinedHash = 0x811c9dc5; for (const id of imageURIs) { const idHash = (0,_utilities_fnv1aHash__WEBPACK_IMPORTED_MODULE_6__["default"])(id); for (let i = 0; i < idHash.length; i++) { combinedHash ^= idHash.charCodeAt(i); combinedHash += (combinedHash << 1) + (combinedHash << 4) + (combinedHash << 7) + (combinedHash << 8) + (combinedHash << 24); } } return `volume-${(combinedHash >>> 0).toString(36)}`; } getImageIdsForVolumeId(volumeId) { return Array.from(this._imageIdsToVolumeIdCache.entries()).filter(([_, id]) => id === volumeId).map(([key]) => key); } getBytesAvailable() { return this.getMaxCacheSize() - this.getCacheSize(); } decacheIfNecessaryUntilBytesAvailable(numBytes, volumeImageIds) { let bytesAvailable = this.getBytesAvailable(); if (bytesAvailable >= numBytes) { return bytesAvailable; } const cachedImages = Array.from(this._imageCache.values()).filter(cachedImage => !cachedImage.sharedCacheKey); function compare(a, b) { if (a.timeStamp > b.timeStamp) { return 1; } if (a.timeStamp < b.timeStamp) { return -1; } return 0; } cachedImages.sort(compare); const cachedImageIds = cachedImages.map(im => im.imageId); let imageIdsToPurge = cachedImageIds; if (volumeImageIds) { imageIdsToPurge = cachedImageIds.filter(id => !volumeImageIds.includes(id)); } for (const imageId of imageIdsToPurge) { this.removeImageLoadObject(imageId); (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_1__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_3__["default"], _enums_Events__WEBPACK_IMPORTED_MODULE_4__["default"].IMAGE_CACHE_IMAGE_REMOVED, { imageId }); bytesAvailable = this.getBytesAvailable(); if (bytesAvailable >= numBytes) { return bytesAvailable; } } for (const imageId of cachedImageIds) { this.removeImageLoadObject(imageId); (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_1__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_3__["default"], _enums_Events__WEBPACK_IMPORTED_MODULE_4__["default"].IMAGE_CACHE_IMAGE_REMOVED, { imageId }); bytesAvailable = this.getBytesAvailable(); if (bytesAvailable >= numBytes) { return bytesAvailable; } } } _putImageCommon(imageId, image, cachedImage) { if (!this._imageCache.has(imageId)) { console.warn('The image was purged from the cache before it completed loading.'); return; } if (!image) { console.warn('Image is undefined'); return; } if (image.sizeInBytes === undefined || Number.isNaN(image.sizeInBytes)) { throw new Error('_putImageCommon: image.sizeInBytes must not be undefined'); } if (image.sizeInBytes.toFixed === undefined) { throw new Error('_putImageCommon: image.sizeInBytes is not a number'); } if (!this.isCacheable(image.sizeInBytes)) { throw new Error(_enums_Events__WEBPACK_IMPORTED_MODULE_4__["default"].CACHE_SIZE_EXCEEDED); } this.decacheIfNecessaryUntilBytesAvailable(image.sizeInBytes); cachedImage.loaded = true; cachedImage.image = image; cachedImage.sizeInBytes = image.sizeInBytes; this.incrementImageCacheSize(cachedImage.sizeInBytes); const eventDetails = { image: cachedImage }; if (image.referencedImageId) { this._referencedImageIdToImageIdCache.set(image.referencedImageId, imageId); } (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_1__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_3__["default"], _enums_Events__WEBPACK_IMPORTED_MODULE_4__["default"].IMAGE_CACHE_IMAGE_ADDED, eventDetails); cachedImage.sharedCacheKey = image.sharedCacheKey; } putImageLoadObject(imageId, imageLoadObject) { var _this = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { if (imageId === undefined) { console.error('putImageLoadObject: imageId must not be undefined'); throw new Error('putImageLoadObject: imageId must not be undefined'); } if (imageLoadObject.promise === undefined) { console.error('putImageLoadObject: imageLoadObject.promise must not be undefined'); throw new Error('putImageLoadObject: imageLoadObject.promise must not be undefined'); } const alreadyCached = _this._imageCache.get(imageId); if (alreadyCached?.imageLoadObject) { console.warn(`putImageLoadObject: imageId ${imageId} already in cache`); throw new Error('putImageLoadObject: imageId already in cache'); } if (imageLoadObject.cancelFn && typeof imageLoadObject.cancelFn !== 'function') { console.error('putImageLoadObject: imageLoadObject.cancel must be a function'); throw new Error('putImageLoadObject: imageLoadObject.cancel must be a function'); } const cachedImage = { ...alreadyCached, loaded: false, imageId, sharedCacheKey: undefined, imageLoadObject, timeStamp: Date.now(), sizeInBytes: 0 }; _this._imageCache.set(imageId, cachedImage); return imageLoadObject.promise.then(image => { try { _this._putImageCommon(imageId, image, cachedImage); } catch (error) { console.debug(`Error in _putImageCommon for image ${imageId}:`, error); throw error; } }).catch(error => { console.debug(`Error caching image ${imageId}:`, error); _this._imageCache.delete(imageId); throw error; }); })(); } putImageSync(imageId, image) { if (imageId === undefined) { throw new Error('putImageSync: imageId must not be undefined'); } if (this._imageCache.has(imageId)) { throw new Error('putImageSync: imageId already in cache'); } const cachedImage = { loaded: false, imageId, sharedCacheKey: undefined, imageLoadObject: { promise: Promise.resolve(image) }, timeStamp: Date.now(), sizeInBytes: 0 }; this._imageCache.set(imageId, cachedImage); try { this._putImageCommon(imageId, image, cachedImage); } catch (error) { this._imageCache.delete(imageId); throw error; } } getImageLoadObject(imageId) { if (imageId === undefined) { throw new Error('getImageLoadObject: imageId must not be undefined'); } const cachedImage = this._imageCache.get(imageId); if (!cachedImage) { return; } cachedImage.timeStamp = Date.now(); return cachedImage.imageLoadObject; } isLoaded(imageId) { const cachedImage = this._imageCache.get(imageId); if (!cachedImage) { return false; } return cachedImage.loaded; } getVolumeContainingImageId(imageId) { const volumeIds = Array.from(this._volumeCache.keys()); const imageIdToUse = (0,_utilities_imageIdToURI__WEBPACK_IMPORTED_MODULE_2__["default"])(imageId); for (const volumeId of volumeIds) { const cachedVolume = this._volumeCache.get(volumeId); if (!cachedVolume) { return; } const { volume } = cachedVolume; if (!volume.imageIds.length) { return; } const imageIdIndex = volume.getImageURIIndex(imageIdToUse); if (imageIdIndex > -1) { return { volume, imageIdIndex }; } } } getCachedImageBasedOnImageURI(imageId) { const imageURIToUse = (0,_utilities_imageIdToURI__WEBPACK_IMPORTED_MODULE_2__["default"])(imageId); const cachedImageIds = Array.from(this._imageCache.keys()); const foundImageId = cachedImageIds.find(imageId => { return (0,_utilities_imageIdToURI__WEBPACK_IMPORTED_MODULE_2__["default"])(imageId) === imageURIToUse; }); if (!foundImageId) { return; } return this._imageCache.get(foundImageId); } _putVolumeCommon(volumeId, volume, cachedVolume) { if (!this._volumeCache.get(volumeId)) { console.warn('The volume was purged from the cache before it completed loading.'); return; } cachedVolume.loaded = true; cachedVolume.volume = volume; volume.imageIds?.forEach(imageId => { const image = this._imageCache.get(imageId); if (image) { image.sharedCacheKey = volumeId; } }); const eventDetails = { volume: cachedVolume }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_1__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_3__["default"], _enums_Events__WEBPACK_IMPORTED_MODULE_4__["default"].VOLUME_CACHE_VOLUME_ADDED, eventDetails); } putVolumeSync(volumeId, volume) { if (volumeId === undefined) { throw new Error('putVolumeSync: volumeId must not be undefined'); } if (this._volumeCache.has(volumeId)) { throw new Error('putVolumeSync: volumeId already in cache'); } const cachedVolume = { loaded: false, volumeId, volumeLoadObject: { promise: Promise.resolve(volume) }, timeStamp: Date.now(), sizeInBytes: 0 }; this._volumeCache.set(volumeId, cachedVolume); try { this._putVolumeCommon(volumeId, volume, cachedVolume); } catch (error) { this._volumeCache.delete(volumeId); throw error; } } putVolumeLoadObject(volumeId, volumeLoadObject) { var _this2 = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { if (volumeId === undefined) { throw new Error('putVolumeLoadObject: volumeId must not be undefined'); } if (volumeLoadObject.promise === undefined) { throw new Error('putVolumeLoadObject: volumeLoadObject.promise must not be undefined'); } if (_this2._volumeCache.has(volumeId)) { throw new Error(`putVolumeLoadObject: volumeId:${volumeId} already in cache`); } if (volumeLoadObject.cancelFn && typeof volumeLoadObject.cancelFn !== 'function') { throw new Error('putVolumeLoadObject: volumeLoadObject.cancel must be a function'); } const cachedVolume = { loaded: false, volumeId, volumeLoadObject, timeStamp: Date.now(), sizeInBytes: 0 }; _this2._volumeCache.set(volumeId, cachedVolume); return volumeLoadObject.promise.then(volume => { try { _this2._putVolumeCommon(volumeId, volume, cachedVolume); } catch (error) { console.error(`Error in _putVolumeCommon for volume ${volumeId}:`, error); _this2._volumeCache.delete(volumeId); throw error; } }).catch(error => { _this2._volumeCache.delete(volumeId); throw error; }); })(); } _putGeometryCommon(geometryId, geometry, cachedGeometry) { if (!this._geometryCache.get(geometryId)) { console.warn('The geometry was purged from the cache before it completed loading.'); return; } if (!geometry) { console.warn('Geometry is undefined'); return; } if (geometry.sizeInBytes === undefined || Number.isNaN(geometry.sizeInBytes)) { throw new Error('_putGeometryCommon: geometry.sizeInBytes must not be undefined'); } if (geometry.sizeInBytes.toFixed === undefined) { throw new Error('_putGeometryCommon: geometry.sizeInBytes is not a number'); } if (!this.isCacheable(geometry.sizeInBytes)) { throw new Error(_enums_Events__WEBPACK_IMPORTED_MODULE_4__["default"].CACHE_SIZE_EXCEEDED); } this.decacheIfNecessaryUntilBytesAvailable(geometry.sizeInBytes); cachedGeometry.loaded = true; cachedGeometry.geometry = geometry; cachedGeometry.sizeInBytes = geometry.sizeInBytes; this.incrementGeometryCacheSize(cachedGeometry.sizeInBytes); const eventDetails = { geometry: cachedGeometry }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_1__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_3__["default"], _enums_Events__WEBPACK_IMPORTED_MODULE_4__["default"].GEOMETRY_CACHE_GEOMETRY_ADDED, eventDetails); } putGeometrySync(geometryId, geometry) { if (geometryId === undefined) { throw new Error('putGeometrySync: geometryId must not be undefined'); } if (this._geometryCache.has(geometryId)) { throw new Error('putGeometrySync: geometryId already in cache'); } const cachedGeometry = { loaded: false, geometryId, geometryLoadObject: { promise: Promise.resolve(geometry) }, timeStamp: Date.now(), sizeInBytes: 0 }; this._geometryCache.set(geometryId, cachedGeometry); try { this._putGeometryCommon(geometryId, geometry, cachedGeometry); } catch (error) { this._geometryCache.delete(geometryId); throw error; } } setPartialImage(imageId, partialImage) { const cachedImage = this._imageCache.get(imageId); if (!cachedImage) { if (partialImage) { this._imageCache.set(imageId, { image: partialImage, imageId, loaded: false, timeStamp: Date.now(), sizeInBytes: 0 }); } return; } if (cachedImage.loaded) { cachedImage.loaded = false; cachedImage.imageLoadObject = null; this.incrementImageCacheSize(-cachedImage.sizeInBytes); cachedImage.sizeInBytes = 0; cachedImage.image = partialImage || cachedImage.image; } else { cachedImage.image = partialImage || cachedImage.image; } } getImageQuality(imageId) { const image = this._imageCache.get(imageId)?.image; return image ? image.imageQualityStatus || _enums__WEBPACK_IMPORTED_MODULE_5__["default"].FULL_RESOLUTION : undefined; } } const cache = new Cache(); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (cache); /***/ }, /***/ 52976 /*!*********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/cache/classes/BaseStreamingImageVolume.js ***! \*********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ BaseStreamingImageVolume: () => (/* binding */ BaseStreamingImageVolume), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../metaData */ 90161); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../enums */ 14566); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums */ 9742); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../enums */ 23995); /* harmony import */ var _eventTarget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../eventTarget */ 28699); /* harmony import */ var _requestPool_imageLoadPoolManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../requestPool/imageLoadPoolManager */ 11062); /* harmony import */ var _utilities_ProgressiveIterator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utilities/ProgressiveIterator */ 60308); /* harmony import */ var _utilities_imageRetrieveMetadataProvider__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utilities/imageRetrieveMetadataProvider */ 49024); /* harmony import */ var _utilities_hasFloatScalingParameters__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utilities/hasFloatScalingParameters */ 18142); /* harmony import */ var _utilities_autoLoad__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utilities/autoLoad */ 47214); /* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../utilities/triggerEvent */ 91133); /* harmony import */ var _ImageVolume__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./ImageVolume */ 92367); /* harmony import */ var _loaders_ProgressiveRetrieveImages__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../loaders/ProgressiveRetrieveImages */ 77360); /* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../init */ 15678); /* harmony import */ var _loaders_imageLoader__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../loaders/imageLoader */ 96035); const requestTypeDefault = _enums__WEBPACK_IMPORTED_MODULE_2__["default"].Prefetch; class BaseStreamingImageVolume extends _ImageVolume__WEBPACK_IMPORTED_MODULE_11__["default"] { constructor(imageVolumeProperties, streamingProperties) { super(imageVolumeProperties); this.framesLoaded = 0; this.framesProcessed = 0; this.framesUpdated = 0; this.autoRenderOnLoad = true; this.cachedFrames = []; this.reRenderTarget = 0; this.reRenderFraction = 2; this.imagesLoader = this; this.cancelLoading = () => { const { loadStatus } = this; if (!loadStatus || !loadStatus.loading) { return; } loadStatus.loading = false; loadStatus.cancelled = true; this.clearLoadCallbacks(); const filterFunction = ({ additionalDetails }) => { return additionalDetails.volumeId !== this.volumeId; }; _requestPool_imageLoadPoolManager__WEBPACK_IMPORTED_MODULE_5__["default"].filterRequests(filterFunction); }; this.loadStatus = streamingProperties.loadStatus; } invalidateVolume(immediate) { const { vtkOpenGLTexture } = this; const { numFrames } = this; for (let i = 0; i < numFrames; i++) { vtkOpenGLTexture.setUpdatedFrame(i); } this.modified(); if (immediate) { (0,_utilities_autoLoad__WEBPACK_IMPORTED_MODULE_9__["default"])(this.volumeId); } } clearLoadCallbacks() { this.loadStatus.callbacks = []; } callLoadStatusCallback(evt) { const { framesUpdated, framesProcessed, totalNumFrames } = evt; const { volumeId, reRenderFraction, loadStatus, metadata } = this; const { FrameOfReferenceUID } = metadata; if (this.autoRenderOnLoad) { if (framesUpdated > this.reRenderTarget || framesProcessed === totalNumFrames) { this.reRenderTarget += reRenderFraction; (0,_utilities_autoLoad__WEBPACK_IMPORTED_MODULE_9__["default"])(volumeId); } } if (framesProcessed === totalNumFrames) { loadStatus.callbacks.forEach(callback => callback(evt)); const eventDetail = { FrameOfReferenceUID, volumeId: volumeId }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_10__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_4__["default"], _enums__WEBPACK_IMPORTED_MODULE_1__["default"].IMAGE_VOLUME_LOADING_COMPLETED, eventDetail); } } updateTextureAndTriggerEvents(imageIdIndex, imageId, imageQualityStatus = _enums__WEBPACK_IMPORTED_MODULE_3__["default"].FULL_RESOLUTION) { const frameIndex = this.imageIdIndexToFrameIndex(imageIdIndex); const { cachedFrames, numFrames, totalNumFrames } = this; const { FrameOfReferenceUID } = this.metadata; const currentStatus = cachedFrames[frameIndex]; if (currentStatus > imageQualityStatus) { return; } if (cachedFrames[frameIndex] === _enums__WEBPACK_IMPORTED_MODULE_3__["default"].FULL_RESOLUTION) { return; } const complete = imageQualityStatus === _enums__WEBPACK_IMPORTED_MODULE_3__["default"].FULL_RESOLUTION; cachedFrames[imageIdIndex] = imageQualityStatus; this.framesUpdated++; if (complete) { this.framesLoaded++; this.framesProcessed++; } const eventDetail = { FrameOfReferenceUID, volumeId: this.volumeId, numberOfFrames: numFrames, framesProcessed: this.framesProcessed }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_10__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_4__["default"], _enums__WEBPACK_IMPORTED_MODULE_1__["default"].IMAGE_VOLUME_MODIFIED, eventDetail); if (complete && this.framesProcessed === this.totalNumFrames) { this.loadStatus.loaded = true; this.loadStatus.loading = false; } this.callLoadStatusCallback({ success: true, imageIdIndex, imageId, framesLoaded: this.framesLoaded, framesProcessed: this.framesProcessed, framesUpdated: this.framesUpdated, numFrames, totalNumFrames, complete, imageQualityStatus }); this.vtkOpenGLTexture.setUpdatedFrame(frameIndex); if (this.loadStatus.loaded) { this.loadStatus.callbacks = []; } } successCallback(imageId, image) { const imageIdIndex = this.getImageIdIndex(imageId); const { imageQualityStatus } = image; if (this.loadStatus.cancelled) { console.warn('volume load cancelled, returning for imageIdIndex: ', imageIdIndex); return; } this.updateTextureAndTriggerEvents(imageIdIndex, imageId, imageQualityStatus); if (this.isDynamicVolume()) { this.checkDimensionGroupCompletion(imageIdIndex); } } errorCallback(imageId, permanent, error) { if (!permanent) { return; } const { totalNumFrames, numFrames } = this; const imageIdIndex = this.getImageIdIndex(imageId); this.framesProcessed++; if (this.framesProcessed === totalNumFrames) { this.loadStatus.loaded = true; this.loadStatus.loading = false; } this.callLoadStatusCallback({ success: false, imageId, imageIdIndex, error, framesLoaded: this.framesLoaded, framesProcessed: this.framesProcessed, framesUpdated: this.framesUpdated, numFrames, totalNumFrames }); if (this.loadStatus.loaded) { this.loadStatus.callbacks = []; } const eventDetail = { error, imageIdIndex, imageId }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_10__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_4__["default"], _enums__WEBPACK_IMPORTED_MODULE_1__["default"].IMAGE_LOAD_ERROR, eventDetail); } load(callback) { const { imageIds, loadStatus, numFrames } = this; const { transferSyntaxUID } = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('transferSyntax', imageIds[0]) || {}; const imageRetrieveConfiguration = _metaData__WEBPACK_IMPORTED_MODULE_0__.get(_utilities_imageRetrieveMetadataProvider__WEBPACK_IMPORTED_MODULE_7__["default"].IMAGE_RETRIEVE_CONFIGURATION, this.volumeId, transferSyntaxUID, 'volume'); this.imagesLoader = this.isDynamicVolume() ? this : imageRetrieveConfiguration ? (imageRetrieveConfiguration.create || _loaders_ProgressiveRetrieveImages__WEBPACK_IMPORTED_MODULE_12__["default"].createProgressive)(imageRetrieveConfiguration) : this; if (loadStatus.loading === true) { return; } const { loaded } = this.loadStatus; const totalNumFrames = imageIds.length; if (loaded) { if (callback) { callback({ success: true, framesLoaded: totalNumFrames, framesProcessed: totalNumFrames, numFrames, totalNumFrames }); } return; } if (callback) { this.loadStatus.callbacks.push(callback); } this._prefetchImageIds(); } getLoaderImageOptions(imageId) { const { transferSyntaxUID: transferSyntaxUID } = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('transferSyntax', imageId) || {}; const targetRows = this.dimensions[1]; const targetCols = this.dimensions[0]; const imageIdIndex = this.getImageIdIndex(imageId); const modalityLutModule = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('modalityLutModule', imageId) || {}; const generalSeriesModule = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('generalSeriesModule', imageId) || {}; const scalingParameters = { rescaleSlope: modalityLutModule.rescaleSlope, rescaleIntercept: modalityLutModule.rescaleIntercept, modality: generalSeriesModule.modality }; const modality = scalingParameters.modality; if (modality === 'PT' || modality === 'RTDOSE') { const scalingFactor = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('scalingModule', imageId); if (scalingFactor) { this._addScalingToVolume(scalingFactor); Object.assign(scalingParameters, scalingFactor); } } const floatAfterScale = (0,_utilities_hasFloatScalingParameters__WEBPACK_IMPORTED_MODULE_8__.hasFloatScalingParameters)(scalingParameters); const allowFloatRendering = (0,_init__WEBPACK_IMPORTED_MODULE_13__.canRenderFloatTextures)(); this.isPreScaled = true; if (scalingParameters && scalingParameters.rescaleSlope !== undefined && scalingParameters.rescaleIntercept !== undefined) { const { rescaleSlope, rescaleIntercept } = scalingParameters; this.isPreScaled = typeof rescaleSlope === 'number' && typeof rescaleIntercept === 'number'; } if (!allowFloatRendering && floatAfterScale) { this.isPreScaled = false; } const targetBuffer = { type: this.dataType, rows: targetRows, columns: targetCols }; return { targetBuffer, allowFloatRendering, preScale: { enabled: this.isPreScaled, scalingParameters }, transferPixelData: true, requestType: requestTypeDefault, transferSyntaxUID, additionalDetails: { imageId, imageIdIndex, volumeId: this.volumeId }, retrieveOptions: undefined }; } callLoadImage(imageId, imageIdIndex, options) { const { cachedFrames } = this; if (cachedFrames[imageIdIndex] === _enums__WEBPACK_IMPORTED_MODULE_3__["default"].FULL_RESOLUTION) { return; } const handleImageCacheAdded = event => { const { image } = event.detail; if (image.imageId === imageId) { this.vtkOpenGLTexture.setUpdatedFrame(imageIdIndex); _eventTarget__WEBPACK_IMPORTED_MODULE_4__["default"].removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_1__["default"].IMAGE_CACHE_IMAGE_ADDED, handleImageCacheAdded); } }; _eventTarget__WEBPACK_IMPORTED_MODULE_4__["default"].addEventListener(_enums__WEBPACK_IMPORTED_MODULE_1__["default"].IMAGE_CACHE_IMAGE_ADDED, handleImageCacheAdded); const uncompressedIterator = _utilities_ProgressiveIterator__WEBPACK_IMPORTED_MODULE_6__["default"].as((0,_loaders_imageLoader__WEBPACK_IMPORTED_MODULE_14__.loadAndCacheImage)(imageId, options)); return uncompressedIterator.forEach(image => { this.successCallback(imageId, image); }, this.errorCallback.bind(this, imageIdIndex, imageId)); } getImageIdsRequests(imageIds, priorityDefault) { this.totalNumFrames = this.imageIds.length; const autoRenderPercentage = 2; if (this.autoRenderOnLoad) { this.reRenderFraction = this.totalNumFrames * (autoRenderPercentage / 100); this.reRenderTarget = this.reRenderFraction; } const requests = imageIds.map(imageId => { const imageIdIndex = this.getImageIdIndex(imageId); const requestType = requestTypeDefault; const priority = priorityDefault; const options = this.getLoaderImageOptions(imageId); const { retrieveOptions = {} } = _metaData__WEBPACK_IMPORTED_MODULE_0__.get(_utilities_imageRetrieveMetadataProvider__WEBPACK_IMPORTED_MODULE_7__["default"].IMAGE_RETRIEVE_CONFIGURATION, imageId, 'volume') || {}; options.retrieveOptions = { ...options.retrieveOptions, ...(retrieveOptions.default || Object.values(retrieveOptions)?.[0] || {}) }; return { callLoadImage: this.callLoadImage.bind(this), imageId, imageIdIndex, options, priority, requestType, additionalDetails: { volumeId: this.volumeId } }; }); return requests; } getImageLoadRequests(priority) { throw new Error('Abstract method'); } getImageIdsToLoad() { throw new Error('Abstract method'); } loadImages() { this.loadStatus.loading = true; const requests = this.getImageLoadRequests(5); requests.reverse().forEach(request => { if (!request) { return; } const { callLoadImage, imageId, imageIdIndex, options, priority, requestType, additionalDetails } = request; _requestPool_imageLoadPoolManager__WEBPACK_IMPORTED_MODULE_5__["default"].addRequest(callLoadImage.bind(this, imageId, imageIdIndex, options), requestType, additionalDetails, priority); }); return Promise.resolve(true); } _prefetchImageIds() { this.loadStatus.loading = true; const imageIds = [...this.getImageIdsToLoad()]; this.totalNumFrames = this.imageIds.length; const autoRenderPercentage = 2; if (this.autoRenderOnLoad) { this.reRenderFraction = this.totalNumFrames * (autoRenderPercentage / 100); this.reRenderTarget = this.reRenderFraction; } return this.imagesLoader.loadImages(imageIds, this).catch(e => { console.debug('progressive loading failed to complete', e); }); } _addScalingToVolume(suvFactor) { if (this.scaling) { return; } const { suvbw, suvlbm, suvbsa } = suvFactor; const petScaling = {}; if (suvlbm) { petScaling.suvbwToSuvlbm = suvlbm / suvbw; } if (suvbsa) { petScaling.suvbwToSuvbsa = suvbsa / suvbw; } if (suvbw) { petScaling.suvbw = suvbw; } this.scaling = { PT: petScaling }; } checkDimensionGroupCompletion(imageIdIndex) {} } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BaseStreamingImageVolume); /***/ }, /***/ 92367 /*!********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/cache/classes/ImageVolume.js ***! \********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ImageVolume: () => (/* binding */ ImageVolume), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _kitware_vtk_js_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kitware/vtk.js/Common/DataModel/ImageData */ 56394); /* harmony import */ var _utilities_imageIdToURI__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utilities/imageIdToURI */ 40232); /* harmony import */ var _utilities_VoxelManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utilities/VoxelManager */ 14430); /* harmony import */ var _RenderingEngine_vtkClasses__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../RenderingEngine/vtkClasses */ 59576); /* harmony import */ var _cache__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../cache */ 38277); class ImageVolume { get numTimePoints() { return typeof this.numDimensionGroups === 'number' ? this.numDimensionGroups : 1; } constructor(props) { this._imageIdsIndexMap = new Map(); this._imageURIsIndexMap = new Map(); this.cornerstoneImageMetaData = null; this.isPreScaled = false; this.numFrames = null; const { imageIds, scaling, dimensions, spacing, origin, direction, dataType, volumeId, referencedVolumeId, metadata, referencedImageIds, additionalDetails, voxelManager, numberOfComponents } = props; if (!dataType) { throw new Error('Data type is required, please provide a data type as string such as "Uint8Array", "Float32Array", etc.'); } let { imageData } = props; this.suppressWarnings = true; this.imageIds = imageIds; this.volumeId = volumeId; this.metadata = metadata; this.dimensions = dimensions; this.spacing = spacing; this.origin = origin; this.direction = direction; this.dataType = dataType; this.vtkOpenGLTexture = _RenderingEngine_vtkClasses__WEBPACK_IMPORTED_MODULE_3__["default"].newInstance(); this.vtkOpenGLTexture.setVolumeId(volumeId); this.voxelManager = voxelManager ?? _utilities_VoxelManager__WEBPACK_IMPORTED_MODULE_2__["default"].createImageVolumeVoxelManager({ dimensions, imageIds, numberOfComponents, id: volumeId }); this.numVoxels = this.dimensions[0] * this.dimensions[1] * this.dimensions[2]; if (!imageData) { imageData = _kitware_vtk_js_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_0__["default"].newInstance(); imageData.setDimensions(dimensions); imageData.setSpacing(spacing); imageData.setDirection(direction); imageData.setOrigin(origin); } imageData.set({ dataType: dataType, voxelManager: this.voxelManager, id: volumeId, numberOfComponents: numberOfComponents || 1 }, this.suppressWarnings); imageData.set({ hasScalarVolume: false }, this.suppressWarnings); this.imageData = imageData; this.numFrames = this._getNumFrames(); this._reprocessImageIds(); if (scaling) { this.scaling = scaling; } if (referencedVolumeId) { this.referencedVolumeId = referencedVolumeId; } if (referencedImageIds) { this.referencedImageIds = referencedImageIds; } if (additionalDetails) { this.additionalDetails = additionalDetails; } } get sizeInBytes() { return this.voxelManager.sizeInBytes; } get imageIds() { return this._imageIds; } set imageIds(newImageIds) { this._imageIds = newImageIds; this._reprocessImageIds(); } _reprocessImageIds() { this._imageIdsIndexMap.clear(); this._imageURIsIndexMap.clear(); this._imageIds.forEach((imageId, i) => { const imageURI = (0,_utilities_imageIdToURI__WEBPACK_IMPORTED_MODULE_1__["default"])(imageId); this._imageIdsIndexMap.set(imageId, i); this._imageURIsIndexMap.set(imageURI, i); }); } isDynamicVolume() { if (this.numTimePoints) { return this.numTimePoints > 1; } return false; } getImageIdIndex(imageId) { return this._imageIdsIndexMap.get(imageId); } getImageIdByIndex(imageIdIndex) { return this._imageIds[imageIdIndex]; } getImageURIIndex(imageURI) { return this._imageURIsIndexMap.get(imageURI); } load(callback) {} destroy() { this.imageData.delete(); this.imageData = null; this.voxelManager.clear(); this.vtkOpenGLTexture.releaseGraphicsResources(); this.vtkOpenGLTexture.delete(); } invalidate() { for (let i = 0; i < this.imageIds.length; i++) { this.vtkOpenGLTexture.setUpdatedFrame(i); } this.imageData.modified(); } modified() { this.imageData.modified(); this.vtkOpenGLTexture.modified(); this.numFrames = this._getNumFrames(); } removeFromCache() { _cache__WEBPACK_IMPORTED_MODULE_4__["default"].removeVolumeLoadObject(this.volumeId); } getScalarDataLength() { return this.voxelManager.getScalarDataLength(); } _getNumFrames() { if (!this.isDynamicVolume()) { return this.imageIds.length; } return this.numTimePoints; } imageIdIndexToFrameIndex(imageIdIndex) { return imageIdIndex % this.numFrames; } getCornerstoneImages() { const { imageIds } = this; return imageIds.map(imageId => { return _cache__WEBPACK_IMPORTED_MODULE_4__["default"].getImage(imageId); }); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ImageVolume); /***/ }, /***/ 86993 /*!*****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/cache/classes/StreamingImageVolume.js ***! \*****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ StreamingImageVolume) /* harmony export */ }); /* harmony import */ var _BaseStreamingImageVolume__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BaseStreamingImageVolume */ 52976); class StreamingImageVolume extends _BaseStreamingImageVolume__WEBPACK_IMPORTED_MODULE_0__["default"] { constructor(imageVolumeProperties, streamingProperties) { if (!imageVolumeProperties.imageIds) { imageVolumeProperties.imageIds = streamingProperties.imageIds; } super(imageVolumeProperties, streamingProperties); this.getImageIdsToLoad = () => { const { imageIds } = this; this.numFrames = imageIds.length; return imageIds; }; } getScalarData() { return this.voxelManager.getScalarData(); } getImageLoadRequests(priority) { const { imageIds } = this; return this.getImageIdsRequests(imageIds, priority); } } /***/ }, /***/ 97278 /*!*********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/constants/backgroundColors.js ***! \*********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); const backgroundColors = { slicer3D: [160 / 255, 164 / 255, 217 / 255] }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (backgroundColors); /***/ }, /***/ 4948 /*!*****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/constants/cpuColormaps.js ***! \*****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); const colormapsData = { hotIron: { name: 'Hot Iron', numOfColors: 256, colors: [[0, 0, 0, 255], [2, 0, 0, 255], [4, 0, 0, 255], [6, 0, 0, 255], [8, 0, 0, 255], [10, 0, 0, 255], [12, 0, 0, 255], [14, 0, 0, 255], [16, 0, 0, 255], [18, 0, 0, 255], [20, 0, 0, 255], [22, 0, 0, 255], [24, 0, 0, 255], [26, 0, 0, 255], [28, 0, 0, 255], [30, 0, 0, 255], [32, 0, 0, 255], [34, 0, 0, 255], [36, 0, 0, 255], [38, 0, 0, 255], [40, 0, 0, 255], [42, 0, 0, 255], [44, 0, 0, 255], [46, 0, 0, 255], [48, 0, 0, 255], [50, 0, 0, 255], [52, 0, 0, 255], [54, 0, 0, 255], [56, 0, 0, 255], [58, 0, 0, 255], [60, 0, 0, 255], [62, 0, 0, 255], [64, 0, 0, 255], [66, 0, 0, 255], [68, 0, 0, 255], [70, 0, 0, 255], [72, 0, 0, 255], [74, 0, 0, 255], [76, 0, 0, 255], [78, 0, 0, 255], [80, 0, 0, 255], [82, 0, 0, 255], [84, 0, 0, 255], [86, 0, 0, 255], [88, 0, 0, 255], [90, 0, 0, 255], [92, 0, 0, 255], [94, 0, 0, 255], [96, 0, 0, 255], [98, 0, 0, 255], [100, 0, 0, 255], [102, 0, 0, 255], [104, 0, 0, 255], [106, 0, 0, 255], [108, 0, 0, 255], [110, 0, 0, 255], [112, 0, 0, 255], [114, 0, 0, 255], [116, 0, 0, 255], [118, 0, 0, 255], [120, 0, 0, 255], [122, 0, 0, 255], [124, 0, 0, 255], [126, 0, 0, 255], [128, 0, 0, 255], [130, 0, 0, 255], [132, 0, 0, 255], [134, 0, 0, 255], [136, 0, 0, 255], [138, 0, 0, 255], [140, 0, 0, 255], [142, 0, 0, 255], [144, 0, 0, 255], [146, 0, 0, 255], [148, 0, 0, 255], [150, 0, 0, 255], [152, 0, 0, 255], [154, 0, 0, 255], [156, 0, 0, 255], [158, 0, 0, 255], [160, 0, 0, 255], [162, 0, 0, 255], [164, 0, 0, 255], [166, 0, 0, 255], [168, 0, 0, 255], [170, 0, 0, 255], [172, 0, 0, 255], [174, 0, 0, 255], [176, 0, 0, 255], [178, 0, 0, 255], [180, 0, 0, 255], [182, 0, 0, 255], [184, 0, 0, 255], [186, 0, 0, 255], [188, 0, 0, 255], [190, 0, 0, 255], [192, 0, 0, 255], [194, 0, 0, 255], [196, 0, 0, 255], [198, 0, 0, 255], [200, 0, 0, 255], [202, 0, 0, 255], [204, 0, 0, 255], [206, 0, 0, 255], [208, 0, 0, 255], [210, 0, 0, 255], [212, 0, 0, 255], [214, 0, 0, 255], [216, 0, 0, 255], [218, 0, 0, 255], [220, 0, 0, 255], [222, 0, 0, 255], [224, 0, 0, 255], [226, 0, 0, 255], [228, 0, 0, 255], [230, 0, 0, 255], [232, 0, 0, 255], [234, 0, 0, 255], [236, 0, 0, 255], [238, 0, 0, 255], [240, 0, 0, 255], [242, 0, 0, 255], [244, 0, 0, 255], [246, 0, 0, 255], [248, 0, 0, 255], [250, 0, 0, 255], [252, 0, 0, 255], [254, 0, 0, 255], [255, 0, 0, 255], [255, 2, 0, 255], [255, 4, 0, 255], [255, 6, 0, 255], [255, 8, 0, 255], [255, 10, 0, 255], [255, 12, 0, 255], [255, 14, 0, 255], [255, 16, 0, 255], [255, 18, 0, 255], [255, 20, 0, 255], [255, 22, 0, 255], [255, 24, 0, 255], [255, 26, 0, 255], [255, 28, 0, 255], [255, 30, 0, 255], [255, 32, 0, 255], [255, 34, 0, 255], [255, 36, 0, 255], [255, 38, 0, 255], [255, 40, 0, 255], [255, 42, 0, 255], [255, 44, 0, 255], [255, 46, 0, 255], [255, 48, 0, 255], [255, 50, 0, 255], [255, 52, 0, 255], [255, 54, 0, 255], [255, 56, 0, 255], [255, 58, 0, 255], [255, 60, 0, 255], [255, 62, 0, 255], [255, 64, 0, 255], [255, 66, 0, 255], [255, 68, 0, 255], [255, 70, 0, 255], [255, 72, 0, 255], [255, 74, 0, 255], [255, 76, 0, 255], [255, 78, 0, 255], [255, 80, 0, 255], [255, 82, 0, 255], [255, 84, 0, 255], [255, 86, 0, 255], [255, 88, 0, 255], [255, 90, 0, 255], [255, 92, 0, 255], [255, 94, 0, 255], [255, 96, 0, 255], [255, 98, 0, 255], [255, 100, 0, 255], [255, 102, 0, 255], [255, 104, 0, 255], [255, 106, 0, 255], [255, 108, 0, 255], [255, 110, 0, 255], [255, 112, 0, 255], [255, 114, 0, 255], [255, 116, 0, 255], [255, 118, 0, 255], [255, 120, 0, 255], [255, 122, 0, 255], [255, 124, 0, 255], [255, 126, 0, 255], [255, 128, 4, 255], [255, 130, 8, 255], [255, 132, 12, 255], [255, 134, 16, 255], [255, 136, 20, 255], [255, 138, 24, 255], [255, 140, 28, 255], [255, 142, 32, 255], [255, 144, 36, 255], [255, 146, 40, 255], [255, 148, 44, 255], [255, 150, 48, 255], [255, 152, 52, 255], [255, 154, 56, 255], [255, 156, 60, 255], [255, 158, 64, 255], [255, 160, 68, 255], [255, 162, 72, 255], [255, 164, 76, 255], [255, 166, 80, 255], [255, 168, 84, 255], [255, 170, 88, 255], [255, 172, 92, 255], [255, 174, 96, 255], [255, 176, 100, 255], [255, 178, 104, 255], [255, 180, 108, 255], [255, 182, 112, 255], [255, 184, 116, 255], [255, 186, 120, 255], [255, 188, 124, 255], [255, 190, 128, 255], [255, 192, 132, 255], [255, 194, 136, 255], [255, 196, 140, 255], [255, 198, 144, 255], [255, 200, 148, 255], [255, 202, 152, 255], [255, 204, 156, 255], [255, 206, 160, 255], [255, 208, 164, 255], [255, 210, 168, 255], [255, 212, 172, 255], [255, 214, 176, 255], [255, 216, 180, 255], [255, 218, 184, 255], [255, 220, 188, 255], [255, 222, 192, 255], [255, 224, 196, 255], [255, 226, 200, 255], [255, 228, 204, 255], [255, 230, 208, 255], [255, 232, 212, 255], [255, 234, 216, 255], [255, 236, 220, 255], [255, 238, 224, 255], [255, 240, 228, 255], [255, 242, 232, 255], [255, 244, 236, 255], [255, 246, 240, 255], [255, 248, 244, 255], [255, 250, 248, 255], [255, 252, 252, 255], [255, 255, 255, 255]] }, pet: { name: 'PET', numColors: 256, colors: [[0, 0, 0, 255], [0, 2, 1, 255], [0, 4, 3, 255], [0, 6, 5, 255], [0, 8, 7, 255], [0, 10, 9, 255], [0, 12, 11, 255], [0, 14, 13, 255], [0, 16, 15, 255], [0, 18, 17, 255], [0, 20, 19, 255], [0, 22, 21, 255], [0, 24, 23, 255], [0, 26, 25, 255], [0, 28, 27, 255], [0, 30, 29, 255], [0, 32, 31, 255], [0, 34, 33, 255], [0, 36, 35, 255], [0, 38, 37, 255], [0, 40, 39, 255], [0, 42, 41, 255], [0, 44, 43, 255], [0, 46, 45, 255], [0, 48, 47, 255], [0, 50, 49, 255], [0, 52, 51, 255], [0, 54, 53, 255], [0, 56, 55, 255], [0, 58, 57, 255], [0, 60, 59, 255], [0, 62, 61, 255], [0, 65, 63, 255], [0, 67, 65, 255], [0, 69, 67, 255], [0, 71, 69, 255], [0, 73, 71, 255], [0, 75, 73, 255], [0, 77, 75, 255], [0, 79, 77, 255], [0, 81, 79, 255], [0, 83, 81, 255], [0, 85, 83, 255], [0, 87, 85, 255], [0, 89, 87, 255], [0, 91, 89, 255], [0, 93, 91, 255], [0, 95, 93, 255], [0, 97, 95, 255], [0, 99, 97, 255], [0, 101, 99, 255], [0, 103, 101, 255], [0, 105, 103, 255], [0, 107, 105, 255], [0, 109, 107, 255], [0, 111, 109, 255], [0, 113, 111, 255], [0, 115, 113, 255], [0, 117, 115, 255], [0, 119, 117, 255], [0, 121, 119, 255], [0, 123, 121, 255], [0, 125, 123, 255], [0, 128, 125, 255], [1, 126, 127, 255], [3, 124, 129, 255], [5, 122, 131, 255], [7, 120, 133, 255], [9, 118, 135, 255], [11, 116, 137, 255], [13, 114, 139, 255], [15, 112, 141, 255], [17, 110, 143, 255], [19, 108, 145, 255], [21, 106, 147, 255], [23, 104, 149, 255], [25, 102, 151, 255], [27, 100, 153, 255], [29, 98, 155, 255], [31, 96, 157, 255], [33, 94, 159, 255], [35, 92, 161, 255], [37, 90, 163, 255], [39, 88, 165, 255], [41, 86, 167, 255], [43, 84, 169, 255], [45, 82, 171, 255], [47, 80, 173, 255], [49, 78, 175, 255], [51, 76, 177, 255], [53, 74, 179, 255], [55, 72, 181, 255], [57, 70, 183, 255], [59, 68, 185, 255], [61, 66, 187, 255], [63, 64, 189, 255], [65, 63, 191, 255], [67, 61, 193, 255], [69, 59, 195, 255], [71, 57, 197, 255], [73, 55, 199, 255], [75, 53, 201, 255], [77, 51, 203, 255], [79, 49, 205, 255], [81, 47, 207, 255], [83, 45, 209, 255], [85, 43, 211, 255], [86, 41, 213, 255], [88, 39, 215, 255], [90, 37, 217, 255], [92, 35, 219, 255], [94, 33, 221, 255], [96, 31, 223, 255], [98, 29, 225, 255], [100, 27, 227, 255], [102, 25, 229, 255], [104, 23, 231, 255], [106, 21, 233, 255], [108, 19, 235, 255], [110, 17, 237, 255], [112, 15, 239, 255], [114, 13, 241, 255], [116, 11, 243, 255], [118, 9, 245, 255], [120, 7, 247, 255], [122, 5, 249, 255], [124, 3, 251, 255], [126, 1, 253, 255], [128, 0, 255, 255], [130, 2, 252, 255], [132, 4, 248, 255], [134, 6, 244, 255], [136, 8, 240, 255], [138, 10, 236, 255], [140, 12, 232, 255], [142, 14, 228, 255], [144, 16, 224, 255], [146, 18, 220, 255], [148, 20, 216, 255], [150, 22, 212, 255], [152, 24, 208, 255], [154, 26, 204, 255], [156, 28, 200, 255], [158, 30, 196, 255], [160, 32, 192, 255], [162, 34, 188, 255], [164, 36, 184, 255], [166, 38, 180, 255], [168, 40, 176, 255], [170, 42, 172, 255], [171, 44, 168, 255], [173, 46, 164, 255], [175, 48, 160, 255], [177, 50, 156, 255], [179, 52, 152, 255], [181, 54, 148, 255], [183, 56, 144, 255], [185, 58, 140, 255], [187, 60, 136, 255], [189, 62, 132, 255], [191, 64, 128, 255], [193, 66, 124, 255], [195, 68, 120, 255], [197, 70, 116, 255], [199, 72, 112, 255], [201, 74, 108, 255], [203, 76, 104, 255], [205, 78, 100, 255], [207, 80, 96, 255], [209, 82, 92, 255], [211, 84, 88, 255], [213, 86, 84, 255], [215, 88, 80, 255], [217, 90, 76, 255], [219, 92, 72, 255], [221, 94, 68, 255], [223, 96, 64, 255], [225, 98, 60, 255], [227, 100, 56, 255], [229, 102, 52, 255], [231, 104, 48, 255], [233, 106, 44, 255], [235, 108, 40, 255], [237, 110, 36, 255], [239, 112, 32, 255], [241, 114, 28, 255], [243, 116, 24, 255], [245, 118, 20, 255], [247, 120, 16, 255], [249, 122, 12, 255], [251, 124, 8, 255], [253, 126, 4, 255], [255, 128, 0, 255], [255, 130, 4, 255], [255, 132, 8, 255], [255, 134, 12, 255], [255, 136, 16, 255], [255, 138, 20, 255], [255, 140, 24, 255], [255, 142, 28, 255], [255, 144, 32, 255], [255, 146, 36, 255], [255, 148, 40, 255], [255, 150, 44, 255], [255, 152, 48, 255], [255, 154, 52, 255], [255, 156, 56, 255], [255, 158, 60, 255], [255, 160, 64, 255], [255, 162, 68, 255], [255, 164, 72, 255], [255, 166, 76, 255], [255, 168, 80, 255], [255, 170, 85, 255], [255, 172, 89, 255], [255, 174, 93, 255], [255, 176, 97, 255], [255, 178, 101, 255], [255, 180, 105, 255], [255, 182, 109, 255], [255, 184, 113, 255], [255, 186, 117, 255], [255, 188, 121, 255], [255, 190, 125, 255], [255, 192, 129, 255], [255, 194, 133, 255], [255, 196, 137, 255], [255, 198, 141, 255], [255, 200, 145, 255], [255, 202, 149, 255], [255, 204, 153, 255], [255, 206, 157, 255], [255, 208, 161, 255], [255, 210, 165, 255], [255, 212, 170, 255], [255, 214, 174, 255], [255, 216, 178, 255], [255, 218, 182, 255], [255, 220, 186, 255], [255, 222, 190, 255], [255, 224, 194, 255], [255, 226, 198, 255], [255, 228, 202, 255], [255, 230, 206, 255], [255, 232, 210, 255], [255, 234, 214, 255], [255, 236, 218, 255], [255, 238, 222, 255], [255, 240, 226, 255], [255, 242, 230, 255], [255, 244, 234, 255], [255, 246, 238, 255], [255, 248, 242, 255], [255, 250, 246, 255], [255, 252, 250, 255], [255, 255, 255, 255]] }, hotMetalBlue: { name: 'Hot Metal Blue', numColors: 256, colors: [[0, 0, 0, 255], [0, 0, 2, 255], [0, 0, 4, 255], [0, 0, 6, 255], [0, 0, 8, 255], [0, 0, 10, 255], [0, 0, 12, 255], [0, 0, 14, 255], [0, 0, 16, 255], [0, 0, 17, 255], [0, 0, 19, 255], [0, 0, 21, 255], [0, 0, 23, 255], [0, 0, 25, 255], [0, 0, 27, 255], [0, 0, 29, 255], [0, 0, 31, 255], [0, 0, 33, 255], [0, 0, 35, 255], [0, 0, 37, 255], [0, 0, 39, 255], [0, 0, 41, 255], [0, 0, 43, 255], [0, 0, 45, 255], [0, 0, 47, 255], [0, 0, 49, 255], [0, 0, 51, 255], [0, 0, 53, 255], [0, 0, 55, 255], [0, 0, 57, 255], [0, 0, 59, 255], [0, 0, 61, 255], [0, 0, 63, 255], [0, 0, 65, 255], [0, 0, 67, 255], [0, 0, 69, 255], [0, 0, 71, 255], [0, 0, 73, 255], [0, 0, 75, 255], [0, 0, 77, 255], [0, 0, 79, 255], [0, 0, 81, 255], [0, 0, 83, 255], [0, 0, 84, 255], [0, 0, 86, 255], [0, 0, 88, 255], [0, 0, 90, 255], [0, 0, 92, 255], [0, 0, 94, 255], [0, 0, 96, 255], [0, 0, 98, 255], [0, 0, 100, 255], [0, 0, 102, 255], [0, 0, 104, 255], [0, 0, 106, 255], [0, 0, 108, 255], [0, 0, 110, 255], [0, 0, 112, 255], [0, 0, 114, 255], [0, 0, 116, 255], [0, 0, 117, 255], [0, 0, 119, 255], [0, 0, 121, 255], [0, 0, 123, 255], [0, 0, 125, 255], [0, 0, 127, 255], [0, 0, 129, 255], [0, 0, 131, 255], [0, 0, 133, 255], [0, 0, 135, 255], [0, 0, 137, 255], [0, 0, 139, 255], [0, 0, 141, 255], [0, 0, 143, 255], [0, 0, 145, 255], [0, 0, 147, 255], [0, 0, 149, 255], [0, 0, 151, 255], [0, 0, 153, 255], [0, 0, 155, 255], [0, 0, 157, 255], [0, 0, 159, 255], [0, 0, 161, 255], [0, 0, 163, 255], [0, 0, 165, 255], [0, 0, 167, 255], [3, 0, 169, 255], [6, 0, 171, 255], [9, 0, 173, 255], [12, 0, 175, 255], [15, 0, 177, 255], [18, 0, 179, 255], [21, 0, 181, 255], [24, 0, 183, 255], [26, 0, 184, 255], [29, 0, 186, 255], [32, 0, 188, 255], [35, 0, 190, 255], [38, 0, 192, 255], [41, 0, 194, 255], [44, 0, 196, 255], [47, 0, 198, 255], [50, 0, 200, 255], [52, 0, 197, 255], [55, 0, 194, 255], [57, 0, 191, 255], [59, 0, 188, 255], [62, 0, 185, 255], [64, 0, 182, 255], [66, 0, 179, 255], [69, 0, 176, 255], [71, 0, 174, 255], [74, 0, 171, 255], [76, 0, 168, 255], [78, 0, 165, 255], [81, 0, 162, 255], [83, 0, 159, 255], [85, 0, 156, 255], [88, 0, 153, 255], [90, 0, 150, 255], [93, 2, 144, 255], [96, 4, 138, 255], [99, 6, 132, 255], [102, 8, 126, 255], [105, 9, 121, 255], [108, 11, 115, 255], [111, 13, 109, 255], [114, 15, 103, 255], [116, 17, 97, 255], [119, 19, 91, 255], [122, 21, 85, 255], [125, 23, 79, 255], [128, 24, 74, 255], [131, 26, 68, 255], [134, 28, 62, 255], [137, 30, 56, 255], [140, 32, 50, 255], [143, 34, 47, 255], [146, 36, 44, 255], [149, 38, 41, 255], [152, 40, 38, 255], [155, 41, 35, 255], [158, 43, 32, 255], [161, 45, 29, 255], [164, 47, 26, 255], [166, 49, 24, 255], [169, 51, 21, 255], [172, 53, 18, 255], [175, 55, 15, 255], [178, 56, 12, 255], [181, 58, 9, 255], [184, 60, 6, 255], [187, 62, 3, 255], [190, 64, 0, 255], [194, 66, 0, 255], [198, 68, 0, 255], [201, 70, 0, 255], [205, 72, 0, 255], [209, 73, 0, 255], [213, 75, 0, 255], [217, 77, 0, 255], [221, 79, 0, 255], [224, 81, 0, 255], [228, 83, 0, 255], [232, 85, 0, 255], [236, 87, 0, 255], [240, 88, 0, 255], [244, 90, 0, 255], [247, 92, 0, 255], [251, 94, 0, 255], [255, 96, 0, 255], [255, 98, 3, 255], [255, 100, 6, 255], [255, 102, 9, 255], [255, 104, 12, 255], [255, 105, 15, 255], [255, 107, 18, 255], [255, 109, 21, 255], [255, 111, 24, 255], [255, 113, 26, 255], [255, 115, 29, 255], [255, 117, 32, 255], [255, 119, 35, 255], [255, 120, 38, 255], [255, 122, 41, 255], [255, 124, 44, 255], [255, 126, 47, 255], [255, 128, 50, 255], [255, 130, 53, 255], [255, 132, 56, 255], [255, 134, 59, 255], [255, 136, 62, 255], [255, 137, 65, 255], [255, 139, 68, 255], [255, 141, 71, 255], [255, 143, 74, 255], [255, 145, 76, 255], [255, 147, 79, 255], [255, 149, 82, 255], [255, 151, 85, 255], [255, 152, 88, 255], [255, 154, 91, 255], [255, 156, 94, 255], [255, 158, 97, 255], [255, 160, 100, 255], [255, 162, 103, 255], [255, 164, 106, 255], [255, 166, 109, 255], [255, 168, 112, 255], [255, 169, 115, 255], [255, 171, 118, 255], [255, 173, 121, 255], [255, 175, 124, 255], [255, 177, 126, 255], [255, 179, 129, 255], [255, 181, 132, 255], [255, 183, 135, 255], [255, 184, 138, 255], [255, 186, 141, 255], [255, 188, 144, 255], [255, 190, 147, 255], [255, 192, 150, 255], [255, 194, 153, 255], [255, 196, 156, 255], [255, 198, 159, 255], [255, 200, 162, 255], [255, 201, 165, 255], [255, 203, 168, 255], [255, 205, 171, 255], [255, 207, 174, 255], [255, 209, 176, 255], [255, 211, 179, 255], [255, 213, 182, 255], [255, 215, 185, 255], [255, 216, 188, 255], [255, 218, 191, 255], [255, 220, 194, 255], [255, 222, 197, 255], [255, 224, 200, 255], [255, 226, 203, 255], [255, 228, 206, 255], [255, 229, 210, 255], [255, 231, 213, 255], [255, 233, 216, 255], [255, 235, 219, 255], [255, 237, 223, 255], [255, 239, 226, 255], [255, 240, 229, 255], [255, 242, 232, 255], [255, 244, 236, 255], [255, 246, 239, 255], [255, 248, 242, 255], [255, 250, 245, 255], [255, 251, 249, 255], [255, 253, 252, 255], [255, 255, 255, 255]] }, pet20Step: { name: 'PET 20 Step', numColors: 256, colors: [[0, 0, 0, 255], [0, 0, 0, 255], [0, 0, 0, 255], [0, 0, 0, 255], [0, 0, 0, 255], [0, 0, 0, 255], [0, 0, 0, 255], [0, 0, 0, 255], [0, 0, 0, 255], [0, 0, 0, 255], [0, 0, 0, 255], [0, 0, 0, 255], [0, 0, 0, 255], [96, 0, 80, 255], [96, 0, 80, 255], [96, 0, 80, 255], [96, 0, 80, 255], [96, 0, 80, 255], [96, 0, 80, 255], [96, 0, 80, 255], [96, 0, 80, 255], [96, 0, 80, 255], [96, 0, 80, 255], [96, 0, 80, 255], [96, 0, 80, 255], [96, 0, 80, 255], [48, 48, 80, 255], [48, 48, 80, 255], [48, 48, 80, 255], [48, 48, 80, 255], [48, 48, 80, 255], [48, 48, 80, 255], [48, 48, 80, 255], [48, 48, 80, 255], [48, 48, 80, 255], [48, 48, 80, 255], [48, 48, 80, 255], [48, 48, 80, 255], [48, 48, 80, 255], [48, 48, 112, 255], [48, 48, 112, 255], [48, 48, 112, 255], [48, 48, 112, 255], [48, 48, 112, 255], [48, 48, 112, 255], [48, 48, 112, 255], [48, 48, 112, 255], [48, 48, 112, 255], [48, 48, 112, 255], [48, 48, 112, 255], [48, 48, 112, 255], [80, 80, 128, 255], [80, 80, 128, 255], [80, 80, 128, 255], [80, 80, 128, 255], [80, 80, 128, 255], [80, 80, 128, 255], [80, 80, 128, 255], [80, 80, 128, 255], [80, 80, 128, 255], [80, 80, 128, 255], [80, 80, 128, 255], [80, 80, 128, 255], [80, 80, 128, 255], [96, 96, 176, 255], [96, 96, 176, 255], [96, 96, 176, 255], [96, 96, 176, 255], [96, 96, 176, 255], [96, 96, 176, 255], [96, 96, 176, 255], [96, 96, 176, 255], [96, 96, 176, 255], [96, 96, 176, 255], [96, 96, 176, 255], [96, 96, 176, 255], [96, 96, 176, 255], [112, 112, 192, 255], [112, 112, 192, 255], [112, 112, 192, 255], [112, 112, 192, 255], [112, 112, 192, 255], [112, 112, 192, 255], [112, 112, 192, 255], [112, 112, 192, 255], [112, 112, 192, 255], [112, 112, 192, 255], [112, 112, 192, 255], [112, 112, 192, 255], [112, 112, 192, 255], [128, 128, 224, 255], [128, 128, 224, 255], [128, 128, 224, 255], [128, 128, 224, 255], [128, 128, 224, 255], [128, 128, 224, 255], [128, 128, 224, 255], [128, 128, 224, 255], [128, 128, 224, 255], [128, 128, 224, 255], [128, 128, 224, 255], [128, 128, 224, 255], [48, 96, 48, 255], [48, 96, 48, 255], [48, 96, 48, 255], [48, 96, 48, 255], [48, 96, 48, 255], [48, 96, 48, 255], [48, 96, 48, 255], [48, 96, 48, 255], [48, 96, 48, 255], [48, 96, 48, 255], [48, 96, 48, 255], [48, 96, 48, 255], [48, 96, 48, 255], [48, 144, 48, 255], [48, 144, 48, 255], [48, 144, 48, 255], [48, 144, 48, 255], [48, 144, 48, 255], [48, 144, 48, 255], [48, 144, 48, 255], [48, 144, 48, 255], [48, 144, 48, 255], [48, 144, 48, 255], [48, 144, 48, 255], [48, 144, 48, 255], [48, 144, 48, 255], [80, 192, 80, 255], [80, 192, 80, 255], [80, 192, 80, 255], [80, 192, 80, 255], [80, 192, 80, 255], [80, 192, 80, 255], [80, 192, 80, 255], [80, 192, 80, 255], [80, 192, 80, 255], [80, 192, 80, 255], [80, 192, 80, 255], [80, 192, 80, 255], [80, 192, 80, 255], [64, 224, 64, 255], [64, 224, 64, 255], [64, 224, 64, 255], [64, 224, 64, 255], [64, 224, 64, 255], [64, 224, 64, 255], [64, 224, 64, 255], [64, 224, 64, 255], [64, 224, 64, 255], [64, 224, 64, 255], [64, 224, 64, 255], [64, 224, 64, 255], [224, 224, 80, 255], [224, 224, 80, 255], [224, 224, 80, 255], [224, 224, 80, 255], [224, 224, 80, 255], [224, 224, 80, 255], [224, 224, 80, 255], [224, 224, 80, 255], [224, 224, 80, 255], [224, 224, 80, 255], [224, 224, 80, 255], [224, 224, 80, 255], [224, 224, 80, 255], [208, 208, 96, 255], [208, 208, 96, 255], [208, 208, 96, 255], [208, 208, 96, 255], [208, 208, 96, 255], [208, 208, 96, 255], [208, 208, 96, 255], [208, 208, 96, 255], [208, 208, 96, 255], [208, 208, 96, 255], [208, 208, 96, 255], [208, 208, 96, 255], [208, 208, 96, 255], [208, 176, 64, 255], [208, 176, 64, 255], [208, 176, 64, 255], [208, 176, 64, 255], [208, 176, 64, 255], [208, 176, 64, 255], [208, 176, 64, 255], [208, 176, 64, 255], [208, 176, 64, 255], [208, 176, 64, 255], [208, 176, 64, 255], [208, 176, 64, 255], [208, 176, 64, 255], [208, 144, 0, 255], [208, 144, 0, 255], [208, 144, 0, 255], [208, 144, 0, 255], [208, 144, 0, 255], [208, 144, 0, 255], [208, 144, 0, 255], [208, 144, 0, 255], [208, 144, 0, 255], [208, 144, 0, 255], [208, 144, 0, 255], [208, 144, 0, 255], [192, 96, 0, 255], [192, 96, 0, 255], [192, 96, 0, 255], [192, 96, 0, 255], [192, 96, 0, 255], [192, 96, 0, 255], [192, 96, 0, 255], [192, 96, 0, 255], [192, 96, 0, 255], [192, 96, 0, 255], [192, 96, 0, 255], [192, 96, 0, 255], [192, 96, 0, 255], [176, 48, 0, 255], [176, 48, 0, 255], [176, 48, 0, 255], [176, 48, 0, 255], [176, 48, 0, 255], [176, 48, 0, 255], [176, 48, 0, 255], [176, 48, 0, 255], [176, 48, 0, 255], [176, 48, 0, 255], [176, 48, 0, 255], [176, 48, 0, 255], [176, 48, 0, 255], [255, 0, 0, 255], [255, 0, 0, 255], [255, 0, 0, 255], [255, 0, 0, 255], [255, 0, 0, 255], [255, 0, 0, 255], [255, 0, 0, 255], [255, 0, 0, 255], [255, 0, 0, 255], [255, 0, 0, 255], [255, 0, 0, 255], [255, 0, 0, 255], [255, 0, 0, 255], [255, 255, 255, 255], [255, 255, 255, 255], [255, 255, 255, 255], [255, 255, 255, 255], [255, 255, 255, 255], [255, 255, 255, 255], [255, 255, 255, 255], [255, 255, 255, 255], [255, 255, 255, 255], [255, 255, 255, 255], [255, 255, 255, 255], [255, 255, 255, 255], [255, 255, 255, 255]] }, gray: { name: 'Gray', numColors: 256, gamma: 1, segmentedData: { red: [[0, 0, 0], [1, 1, 1]], green: [[0, 0, 0], [1, 1, 1]], blue: [[0, 0, 0], [1, 1, 1]] } }, jet: { name: 'Jet', numColors: 256, gamma: 1, segmentedData: { red: [[0, 0, 0], [0.35, 0, 0], [0.66, 1, 1], [0.89, 1, 1], [1, 0.5, 0.5]], green: [[0, 0, 0], [0.125, 0, 0], [0.375, 1, 1], [0.64, 1, 1], [0.91, 0, 0], [1, 0, 0]], blue: [[0, 0.5, 0.5], [0.11, 1, 1], [0.34, 1, 1], [0.65, 0, 0], [1, 0, 0]] } }, hsv: { name: 'HSV', numColors: 256, gamma: 1, segmentedData: { red: [[0, 1, 1], [0.15873, 1, 1], [0.174603, 0.96875, 0.96875], [0.333333, 0.03125, 0.03125], [0.349206, 0, 0], [0.666667, 0, 0], [0.68254, 0.03125, 0.03125], [0.84127, 0.96875, 0.96875], [0.857143, 1, 1], [1, 1, 1]], green: [[0, 0, 0], [0.15873, 0.9375, 0.9375], [0.174603, 1, 1], [0.507937, 1, 1], [0.666667, 0.0625, 0.0625], [0.68254, 0, 0], [1, 0, 0]], blue: [[0, 0, 0], [0.333333, 0, 0], [0.349206, 0.0625, 0.0625], [0.507937, 1, 1], [0.84127, 1, 1], [0.857143, 0.9375, 0.9375], [1, 0.09375, 0.09375]] } }, hot: { name: 'Hot', numColors: 256, gamma: 1, segmentedData: { red: [[0, 0.0416, 0.0416], [0.365079, 1, 1], [1, 1, 1]], green: [[0, 0, 0], [0.365079, 0, 0], [0.746032, 1, 1], [1, 1, 1]], blue: [[0, 0, 0], [0.746032, 0, 0], [1, 1, 1]] } }, cool: { name: 'Cool', numColors: 256, gamma: 1, segmentedData: { red: [[0, 0, 0], [1, 1, 1]], green: [[0, 1, 1], [1, 0, 0]], blue: [[0, 1, 1], [1, 1, 1]] } }, spring: { name: 'Spring', numColors: 256, gamma: 1, segmentedData: { red: [[0, 1, 1], [1, 1, 1]], green: [[0, 0, 0], [1, 1, 1]], blue: [[0, 1, 1], [1, 0, 0]] } }, summer: { name: 'Summer', numColors: 256, gamma: 1, segmentedData: { red: [[0, 0, 0], [1, 1, 1]], green: [[0, 0.5, 0.5], [1, 1, 1]], blue: [[0, 0.4, 0.4], [1, 0.4, 0.4]] } }, autumn: { name: 'Autumn', numColors: 256, gamma: 1, segmentedData: { red: [[0, 1, 1], [1, 1, 1]], green: [[0, 0, 0], [1, 1, 1]], blue: [[0, 0, 0], [1, 0, 0]] } }, winter: { name: 'Winter', numColors: 256, gamma: 1, segmentedData: { red: [[0, 0, 0], [1, 0, 0]], green: [[0, 0, 0], [1, 1, 1]], blue: [[0, 1, 1], [1, 0.5, 0.5]] } }, bone: { name: 'Bone', numColors: 256, gamma: 1, segmentedData: { red: [[0, 0, 0], [0.746032, 0.652778, 0.652778], [1, 1, 1]], green: [[0, 0, 0], [0.365079, 0.319444, 0.319444], [0.746032, 0.777778, 0.777778], [1, 1, 1]], blue: [[0, 0, 0], [0.365079, 0.444444, 0.444444], [1, 1, 1]] } }, copper: { name: 'Copper', numColors: 256, gamma: 1, segmentedData: { red: [[0, 0, 0], [0.809524, 1, 1], [1, 1, 1]], green: [[0, 0, 0], [1, 0.7812, 0.7812]], blue: [[0, 0, 0], [1, 0.4975, 0.4975]] } }, spectral: { name: 'Spectral', numColors: 256, gamma: 1, segmentedData: { red: [[0, 0, 0], [0.05, 0.4667, 0.4667], [0.1, 0.5333, 0.5333], [0.15, 0, 0], [0.2, 0, 0], [0.25, 0, 0], [0.3, 0, 0], [0.35, 0, 0], [0.4, 0, 0], [0.45, 0, 0], [0.5, 0, 0], [0.55, 0, 0], [0.6, 0, 0], [0.65, 0.7333, 0.7333], [0.7, 0.9333, 0.9333], [0.75, 1, 1], [0.8, 1, 1], [0.85, 1, 1], [0.9, 0.8667, 0.8667], [0.95, 0.8, 0.8], [1, 0.8, 0.8]], green: [[0, 0, 0], [0.05, 0, 0], [0.1, 0, 0], [0.15, 0, 0], [0.2, 0, 0], [0.25, 0.4667, 0.4667], [0.3, 0.6, 0.6], [0.35, 0.6667, 0.6667], [0.4, 0.6667, 0.6667], [0.45, 0.6, 0.6], [0.5, 0.7333, 0.7333], [0.55, 0.8667, 0.8667], [0.6, 1, 1], [0.65, 1, 1], [0.7, 0.9333, 0.9333], [0.75, 0.8, 0.8], [0.8, 0.6, 0.6], [0.85, 0, 0], [0.9, 0, 0], [0.95, 0, 0], [1, 0.8, 0.8]], blue: [[0, 0, 0], [0.05, 0.5333, 0.5333], [0.1, 0.6, 0.6], [0.15, 0.6667, 0.6667], [0.2, 0.8667, 0.8667], [0.25, 0.8667, 0.8667], [0.3, 0.8667, 0.8667], [0.35, 0.6667, 0.6667], [0.4, 0.5333, 0.5333], [0.45, 0, 0], [0.5, 0, 0], [0.55, 0, 0], [0.6, 0, 0], [0.65, 0, 0], [0.7, 0, 0], [0.75, 0, 0], [0.8, 0, 0], [0.85, 0, 0], [0.9, 0, 0], [0.95, 0, 0], [1, 0.8, 0.8]] } }, coolwarm: { name: 'CoolWarm', numColors: 256, gamma: 1, segmentedData: { red: [[0, 0.2298057, 0.2298057], [0.03125, 0.26623388, 0.26623388], [0.0625, 0.30386891, 0.30386891], [0.09375, 0.342804478, 0.342804478], [0.125, 0.38301334, 0.38301334], [0.15625, 0.424369608, 0.424369608], [0.1875, 0.46666708, 0.46666708], [0.21875, 0.509635204, 0.509635204], [0.25, 0.552953156, 0.552953156], [0.28125, 0.596262162, 0.596262162], [0.3125, 0.639176211, 0.639176211], [0.34375, 0.681291281, 0.681291281], [0.375, 0.722193294, 0.722193294], [0.40625, 0.761464949, 0.761464949], [0.4375, 0.798691636, 0.798691636], [0.46875, 0.833466556, 0.833466556], [0.5, 0.865395197, 0.865395197], [0.53125, 0.897787179, 0.897787179], [0.5625, 0.924127593, 0.924127593], [0.59375, 0.944468518, 0.944468518], [0.625, 0.958852946, 0.958852946], [0.65625, 0.96732803, 0.96732803], [0.6875, 0.969954137, 0.969954137], [0.71875, 0.966811177, 0.966811177], [0.75, 0.958003065, 0.958003065], [0.78125, 0.943660866, 0.943660866], [0.8125, 0.923944917, 0.923944917], [0.84375, 0.89904617, 0.89904617], [0.875, 0.869186849, 0.869186849], [0.90625, 0.834620542, 0.834620542], [0.9375, 0.795631745, 0.795631745], [0.96875, 0.752534934, 0.752534934], [1, 0.705673158, 0.705673158]], green: [[0, 0.298717966, 0.298717966], [0.03125, 0.353094838, 0.353094838], [0.0625, 0.406535296, 0.406535296], [0.09375, 0.458757618, 0.458757618], [0.125, 0.50941904, 0.50941904], [0.15625, 0.558148092, 0.558148092], [0.1875, 0.604562568, 0.604562568], [0.21875, 0.648280772, 0.648280772], [0.25, 0.688929332, 0.688929332], [0.28125, 0.726149107, 0.726149107], [0.3125, 0.759599947, 0.759599947], [0.34375, 0.788964712, 0.788964712], [0.375, 0.813952739, 0.813952739], [0.40625, 0.834302879, 0.834302879], [0.4375, 0.849786142, 0.849786142], [0.46875, 0.860207984, 0.860207984], [0.5, 0.86541021, 0.86541021], [0.53125, 0.848937047, 0.848937047], [0.5625, 0.827384882, 0.827384882], [0.59375, 0.800927443, 0.800927443], [0.625, 0.769767752, 0.769767752], [0.65625, 0.734132809, 0.734132809], [0.6875, 0.694266682, 0.694266682], [0.71875, 0.650421156, 0.650421156], [0.75, 0.602842431, 0.602842431], [0.78125, 0.551750968, 0.551750968], [0.8125, 0.49730856, 0.49730856], [0.84375, 0.439559467, 0.439559467], [0.875, 0.378313092, 0.378313092], [0.90625, 0.312874446, 0.312874446], [0.9375, 0.24128379, 0.24128379], [0.96875, 0.157246067, 0.157246067], [1, 0.01555616, 0.01555616]], blue: [[0, 0.753683153, 0.753683153], [0.03125, 0.801466763, 0.801466763], [0.0625, 0.84495867, 0.84495867], [0.09375, 0.883725899, 0.883725899], [0.125, 0.917387822, 0.917387822], [0.15625, 0.945619588, 0.945619588], [0.1875, 0.968154911, 0.968154911], [0.21875, 0.98478814, 0.98478814], [0.25, 0.995375608, 0.995375608], [0.28125, 0.999836203, 0.999836203], [0.3125, 0.998151185, 0.998151185], [0.34375, 0.990363227, 0.990363227], [0.375, 0.976574709, 0.976574709], [0.40625, 0.956945269, 0.956945269], [0.4375, 0.931688648, 0.931688648], [0.46875, 0.901068838, 0.901068838], [0.5, 0.865395561, 0.865395561], [0.53125, 0.820880546, 0.820880546], [0.5625, 0.774508472, 0.774508472], [0.59375, 0.726736146, 0.726736146], [0.625, 0.678007945, 0.678007945], [0.65625, 0.628751763, 0.628751763], [0.6875, 0.579375448, 0.579375448], [0.71875, 0.530263762, 0.530263762], [0.75, 0.481775914, 0.481775914], [0.78125, 0.434243684, 0.434243684], [0.8125, 0.387970225, 0.387970225], [0.84375, 0.343229596, 0.343229596], [0.875, 0.300267182, 0.300267182], [0.90625, 0.259301199, 0.259301199], [0.9375, 0.220525627, 0.220525627], [0.96875, 0.184115123, 0.184115123], [1, 0.150232812, 0.150232812]] } }, blues: { name: 'Blues', numColors: 256, gamma: 1, segmentedData: { red: [[0, 0.9686274528503418, 0.9686274528503418], [0.125, 0.87058824300765991, 0.87058824300765991], [0.25, 0.7764706015586853, 0.7764706015586853], [0.375, 0.61960786581039429, 0.61960786581039429], [0.5, 0.41960784792900085, 0.41960784792900085], [0.625, 0.25882354378700256, 0.25882354378700256], [0.75, 0.12941177189350128, 0.12941177189350128], [0.875, 0.031372550874948502, 0.031372550874948502], [1, 0.031372550874948502, 0.031372550874948502]], green: [[0, 0.9843137264251709, 0.9843137264251709], [0.125, 0.92156863212585449, 0.92156863212585449], [0.25, 0.85882353782653809, 0.85882353782653809], [0.375, 0.7921568751335144, 0.7921568751335144], [0.5, 0.68235296010971069, 0.68235296010971069], [0.625, 0.57254904508590698, 0.57254904508590698], [0.75, 0.44313725829124451, 0.44313725829124451], [0.875, 0.31764706969261169, 0.31764706969261169], [1, 0.18823529779911041, 0.18823529779911041]], blue: [[0, 1, 1], [0.125, 0.9686274528503418, 0.9686274528503418], [0.25, 0.93725490570068359, 0.93725490570068359], [0.375, 0.88235294818878174, 0.88235294818878174], [0.5, 0.83921569585800171, 0.83921569585800171], [0.625, 0.7764706015586853, 0.7764706015586853], [0.75, 0.70980393886566162, 0.70980393886566162], [0.875, 0.61176472902297974, 0.61176472902297974], [1, 0.41960784792900085, 0.41960784792900085]] } } }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (colormapsData); /***/ }, /***/ 19050 /*!************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/constants/epsilon.js ***! \************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); const EPSILON = 1e-3; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EPSILON); /***/ }, /***/ 78220 /*!**********************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/constants/index.js ***! \**********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ BACKGROUND_COLORS: () => (/* reexport safe */ _backgroundColors__WEBPACK_IMPORTED_MODULE_5__["default"]), /* harmony export */ CPU_COLORMAPS: () => (/* reexport safe */ _cpuColormaps__WEBPACK_IMPORTED_MODULE_0__["default"]), /* harmony export */ EPSILON: () => (/* reexport safe */ _epsilon__WEBPACK_IMPORTED_MODULE_2__["default"]), /* harmony export */ MPR_CAMERA_VALUES: () => (/* reexport safe */ _mprCameraValues__WEBPACK_IMPORTED_MODULE_3__["default"]), /* harmony export */ RENDERING_DEFAULTS: () => (/* reexport safe */ _rendering__WEBPACK_IMPORTED_MODULE_1__["default"]), /* harmony export */ VIEWPORT_PRESETS: () => (/* reexport safe */ _viewportPresets__WEBPACK_IMPORTED_MODULE_4__["default"]) /* harmony export */ }); /* harmony import */ var _cpuColormaps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cpuColormaps */ 4948); /* harmony import */ var _rendering__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rendering */ 33876); /* harmony import */ var _epsilon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./epsilon */ 19050); /* harmony import */ var _mprCameraValues__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mprCameraValues */ 50260); /* harmony import */ var _viewportPresets__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./viewportPresets */ 3362); /* harmony import */ var _backgroundColors__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./backgroundColors */ 97278); /***/ }, /***/ 2453 /*!**************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/constants/microscopyViewportCss.js ***! \**************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); const microscopyViewportCss = ` .DicomMicroscopyViewer { --ol-partial-background-color: rgba(127, 127, 127, 0.7); --ol-foreground-color: #000000; --ol-subtle-foreground-color: #000; --ol-subtle-background-color: rgba(78, 78, 78, 0.5); } .DicomMicroscopyViewer .ol-box { box-sizing: border-box; border-radius: 2px; border: 1.5px solid var(--ol-background-color); background-color: var(--ol-partial-background-color); } .DicomMicroscopyViewer .ol-mouse-position { top: 8px; right: 8px; position: absolute; } .DicomMicroscopyViewer .ol-scale-line { background: var(--ol-partial-background-color); border-radius: 4px; bottom: 8px; left: 8px; padding: 2px; position: absolute; } .DicomMicroscopyViewer .ol-scale-line-inner { border: 1px solid var(--ol-subtle-foreground-color); border-top: none; color: var(--ol-foreground-color); font-size: 10px; text-align: center; margin: 1px; will-change: contents, width; transition: all 0.25s; } .DicomMicroscopyViewer .ol-scale-bar { position: absolute; bottom: 8px; left: 8px; } .DicomMicroscopyViewer .ol-scale-bar-inner { display: flex; } .DicomMicroscopyViewer .ol-scale-step-marker { width: 1px; height: 15px; background-color: var(--ol-foreground-color); float: right; z-index: 10; } .DicomMicroscopyViewer .ol-scale-step-text { position: absolute; bottom: -5px; font-size: 10px; z-index: 11; color: var(--ol-foreground-color); text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color); } .DicomMicroscopyViewer .ol-scale-text { position: absolute; font-size: 12px; text-align: center; bottom: 25px; color: var(--ol-foreground-color); text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color); } .DicomMicroscopyViewer .ol-scale-singlebar { position: relative; height: 10px; z-index: 9; box-sizing: border-box; border: 1px solid var(--ol-foreground-color); } .DicomMicroscopyViewer .ol-scale-singlebar-even { background-color: var(--ol-subtle-foreground-color); } .DicomMicroscopyViewer .ol-scale-singlebar-odd { background-color: var(--ol-background-color); } .DicomMicroscopyViewer .ol-unsupported { display: none; } .DicomMicroscopyViewer .ol-viewport, .DicomMicroscopyViewer .ol-unselectable { -webkit-touch-callout: none; -webkit-user-select: none; -moz-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; } .DicomMicroscopyViewer .ol-viewport canvas { all: unset; } .DicomMicroscopyViewer .ol-selectable { -webkit-touch-callout: default; -webkit-user-select: text; -moz-user-select: text; user-select: text; } .DicomMicroscopyViewer .ol-grabbing { cursor: -webkit-grabbing; cursor: -moz-grabbing; cursor: grabbing; } .DicomMicroscopyViewer .ol-grab { cursor: move; cursor: -webkit-grab; cursor: -moz-grab; cursor: grab; } .DicomMicroscopyViewer .ol-control { position: absolute; background-color: var(--ol-subtle-background-color); border-radius: 4px; } .DicomMicroscopyViewer .ol-zoom { top: 0.5em; left: 0.5em; } .DicomMicroscopyViewer .ol-rotate { top: 0.5em; right: 0.5em; transition: opacity 0.25s linear, visibility 0s linear; } .DicomMicroscopyViewer .ol-rotate.ol-hidden { opacity: 0; visibility: hidden; transition: opacity 0.25s linear, visibility 0s linear 0.25s; } .DicomMicroscopyViewer .ol-zoom-extent { top: 4.643em; left: 0.5em; } .DicomMicroscopyViewer .ol-full-screen { right: 0.5em; top: 0.5em; } .DicomMicroscopyViewer .ol-control button { display: block; margin: 1px; padding: 0; color: var(--ol-subtle-foreground-color); font-weight: bold; text-decoration: none; font-size: inherit; text-align: center; height: 1.375em; width: 1.375em; line-height: 0.4em; background-color: var(--ol-background-color); border: none; border-radius: 2px; } .DicomMicroscopyViewer .ol-control button::-moz-focus-inner { border: none; padding: 0; } .DicomMicroscopyViewer .ol-zoom-extent button { line-height: 1.4em; } .DicomMicroscopyViewer .ol-compass { display: block; font-weight: normal; will-change: transform; } .DicomMicroscopyViewer .ol-touch .ol-control button { font-size: 1.5em; } .DicomMicroscopyViewer .ol-touch .ol-zoom-extent { top: 5.5em; } .DicomMicroscopyViewer .ol-control button:hover, .DicomMicroscopyViewer .ol-control button:focus { text-decoration: none; outline: 1px solid var(--ol-subtle-foreground-color); color: var(--ol-foreground-color); } .DicomMicroscopyViewer .ol-zoom .ol-zoom-in { border-radius: 2px 2px 0 0; } .DicomMicroscopyViewer .ol-zoom .ol-zoom-out { border-radius: 0 0 2px 2px; } .DicomMicroscopyViewer .ol-attribution { text-align: right; bottom: 0.5em; right: 0.5em; max-width: calc(100% - 1.3em); display: flex; flex-flow: row-reverse; align-items: center; } .DicomMicroscopyViewer .ol-attribution a { color: var(--ol-subtle-foreground-color); text-decoration: none; } .DicomMicroscopyViewer .ol-attribution ul { margin: 0; padding: 1px 0.5em; color: var(--ol-foreground-color); text-shadow: 0 0 2px var(--ol-background-color); font-size: 12px; } .DicomMicroscopyViewer .ol-attribution li { display: inline; list-style: none; } .DicomMicroscopyViewer .ol-attribution li:not(:last-child):after { content: ' '; } .DicomMicroscopyViewer .ol-attribution img { max-height: 2em; max-width: inherit; vertical-align: middle; } .DicomMicroscopyViewer .ol-attribution button { flex-shrink: 0; } .DicomMicroscopyViewer .ol-attribution.ol-collapsed ul { display: none; } .DicomMicroscopyViewer .ol-attribution:not(.ol-collapsed) { background: var(--ol-partial-background-color); } .DicomMicroscopyViewer .ol-attribution.ol-uncollapsible { bottom: 0; right: 0; border-radius: 4px 0 0; } .DicomMicroscopyViewer .ol-attribution.ol-uncollapsible img { margin-top: -0.2em; max-height: 1.6em; } .DicomMicroscopyViewer .ol-attribution.ol-uncollapsible button { display: none; } .DicomMicroscopyViewer .ol-zoomslider { top: 4.5em; left: 0.5em; height: 200px; } .DicomMicroscopyViewer .ol-zoomslider button { position: relative; height: 10px; } .DicomMicroscopyViewer .ol-touch .ol-zoomslider { top: 5.5em; } .DicomMicroscopyViewer .ol-overviewmap { left: 0.5em; bottom: 0.5em; } .DicomMicroscopyViewer .ol-overviewmap.ol-uncollapsible { bottom: 0; left: 0; border-radius: 0 4px 0 0; } .DicomMicroscopyViewer .ol-overviewmap .ol-overviewmap-map, .DicomMicroscopyViewer .ol-overviewmap button { display: block; } .DicomMicroscopyViewer .ol-overviewmap .ol-overviewmap-map { border: 1px solid var(--ol-subtle-foreground-color); height: 150px; width: 150px; } .DicomMicroscopyViewer .ol-overviewmap:not(.ol-collapsed) button { bottom: 0; left: 0; position: absolute; } .DicomMicroscopyViewer .ol-overviewmap.ol-collapsed .ol-overviewmap-map, .DicomMicroscopyViewer .ol-overviewmap.ol-uncollapsible button { display: none; } .DicomMicroscopyViewer .ol-overviewmap:not(.ol-collapsed) { background: var(--ol-subtle-background-color); } .DicomMicroscopyViewer .ol-overviewmap-box { border: 0.5px dotted var(--ol-subtle-foreground-color); } .DicomMicroscopyViewer .ol-overviewmap .ol-overviewmap-box:hover { cursor: move; } @layout-header-background: #007ea3; @primary-color: #007ea3; @processing-color: #8cb8c6; @success-color: #3f9c35; @warning-color: #eeaf30; @error-color: #96172e; @font-size-base: 14px; .DicomMicroscopyViewer .ol-tooltip { font-size: 16px !important; } `; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (microscopyViewportCss); /***/ }, /***/ 50260 /*!********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/constants/mprCameraValues.js ***! \********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _utilities_deepFreeze__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utilities/deepFreeze */ 95892); const MPR_CAMERA_VALUES = { axial: { viewPlaneNormal: [0, 0, -1], viewUp: [0, -1, 0], viewRight: [1, 0, 0] }, sagittal: { viewPlaneNormal: [1, 0, 0], viewUp: [0, 0, 1], viewRight: [0, 1, 0] }, coronal: { viewPlaneNormal: [0, -1, 0], viewUp: [0, 0, 1], viewRight: [1, 0, 0] } }; const mprCameraValues = (0,_utilities_deepFreeze__WEBPACK_IMPORTED_MODULE_0__["default"])(MPR_CAMERA_VALUES); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mprCameraValues); /***/ }, /***/ 33876 /*!**************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/constants/rendering.js ***! \**************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); const RENDERING_DEFAULTS = { MINIMUM_SLAB_THICKNESS: 5e-2, MAXIMUM_RAY_DISTANCE: 1e6 }; Object.freeze(RENDERING_DEFAULTS); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RENDERING_DEFAULTS); /***/ }, /***/ 3362 /*!********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/constants/viewportPresets.js ***! \********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); const presets = [{ name: 'CT-AAA', gradientOpacity: '4 0 1 255 1', specularPower: '10', scalarOpacity: '12 -3024 0 143.556 0 166.222 0.686275 214.389 0.696078 419.736 0.833333 3071 0.803922', specular: '0.2', shade: '1', ambient: '0.1', colorTransfer: '24 -3024 0 0 0 143.556 0.615686 0.356863 0.184314 166.222 0.882353 0.603922 0.290196 214.389 1 1 1 419.736 1 0.937033 0.954531 3071 0.827451 0.658824 1', diffuse: '0.9', interpolation: '1' }, { name: 'CT-AAA2', gradientOpacity: '4 0 1 255 1', specularPower: '10', scalarOpacity: '16 -3024 0 129.542 0 145.244 0.166667 157.02 0.5 169.918 0.627451 395.575 0.8125 1578.73 0.8125 3071 0.8125', specular: '0.2', shade: '1', ambient: '0.1', colorTransfer: '32 -3024 0 0 0 129.542 0.54902 0.25098 0.14902 145.244 0.6 0.627451 0.843137 157.02 0.890196 0.47451 0.6 169.918 0.992157 0.870588 0.392157 395.575 1 0.886275 0.658824 1578.73 1 0.829256 0.957922 3071 0.827451 0.658824 1', diffuse: '0.9', interpolation: '1' }, { name: 'CT-Bone', gradientOpacity: '4 0 1 255 1', specularPower: '10', scalarOpacity: '8 -3024 0 -16.4458 0 641.385 0.715686 3071 0.705882', specular: '0.2', shade: '1', ambient: '0.1', colorTransfer: '16 -3024 0 0 0 -16.4458 0.729412 0.254902 0.301961 641.385 0.905882 0.815686 0.552941 3071 1 1 1', diffuse: '0.9', interpolation: '1' }, { name: 'CT-Bones', gradientOpacity: '4 0 1 985.12 1', specularPower: '1', scalarOpacity: '8 -1000 0 152.19 0 278.93 0.190476 952 0.2', specular: '0', shade: '1', ambient: '0.2', colorTransfer: '20 -1000 0.3 0.3 1 -488 0.3 1 0.3 463.28 1 0 0 659.15 1 0.912535 0.0374849 953 1 0.3 0.3', diffuse: '1', interpolation: '1' }, { name: 'CT-Cardiac', gradientOpacity: '4 0 1 255 1', specularPower: '10', scalarOpacity: '12 -3024 0 -77.6875 0 94.9518 0.285714 179.052 0.553571 260.439 0.848214 3071 0.875', specular: '0.2', shade: '1', ambient: '0.1', colorTransfer: '24 -3024 0 0 0 -77.6875 0.54902 0.25098 0.14902 94.9518 0.882353 0.603922 0.290196 179.052 1 0.937033 0.954531 260.439 0.615686 0 0 3071 0.827451 0.658824 1', diffuse: '0.9', interpolation: '1' }, { name: 'CT-Cardiac2', gradientOpacity: '4 0 1 255 1', specularPower: '10', scalarOpacity: '12 -3024 0 42.8964 0 163.488 0.428571 277.642 0.776786 1587 0.754902 3071 0.754902', specular: '0.2', shade: '1', ambient: '0.1', colorTransfer: '24 -3024 0 0 0 42.8964 0.54902 0.25098 0.14902 163.488 0.917647 0.639216 0.0588235 277.642 1 0.878431 0.623529 1587 1 1 1 3071 0.827451 0.658824 1', diffuse: '0.9', interpolation: '1' }, { name: 'CT-Cardiac3', gradientOpacity: '4 0 1 255 1', specularPower: '10', scalarOpacity: '14 -3024 0 -86.9767 0 45.3791 0.169643 139.919 0.589286 347.907 0.607143 1224.16 0.607143 3071 0.616071', specular: '0.2', shade: '1', ambient: '0.1', colorTransfer: '28 -3024 0 0 0 -86.9767 0 0.25098 1 45.3791 1 0 0 139.919 1 0.894893 0.894893 347.907 1 1 0.25098 1224.16 1 1 1 3071 0.827451 0.658824 1', diffuse: '0.9', interpolation: '1' }, { name: 'CT-Chest-Contrast-Enhanced', gradientOpacity: '4 0 1 255 1', specularPower: '10', scalarOpacity: '10 -3024 0 67.0106 0 251.105 0.446429 439.291 0.625 3071 0.616071', specular: '0.2', shade: '1', ambient: '0.1', colorTransfer: '20 -3024 0 0 0 67.0106 0.54902 0.25098 0.14902 251.105 0.882353 0.603922 0.290196 439.291 1 0.937033 0.954531 3071 0.827451 0.658824 1', diffuse: '0.9', interpolation: '1' }, { name: 'CT-Chest-Vessels', gradientOpacity: '4 0 1 255 1', specularPower: '1', scalarOpacity: '10 -3024 0 -1278.35 0 22.8277 0.428571 439.291 0.625 3071 0.616071', specular: '0', shade: '1', ambient: '0.2', colorTransfer: '20 -3024 0 0 0 -1278.35 0.54902 0.25098 0.14902 22.8277 0.882353 0.603922 0.290196 439.291 1 0.937033 0.954531 3071 0.827451 0.658824 1', diffuse: '1', interpolation: '1' }, { name: 'CT-Coronary-Arteries', gradientOpacity: '4 0 1 255 1', specularPower: '1', scalarOpacity: '12 -2048 0 136.47 0 159.215 0.258929 318.43 0.571429 478.693 0.776786 3661 1', specular: '0', shade: '0', ambient: '0.2', colorTransfer: '24 -2048 0 0 0 136.47 0 0 0 159.215 0.159804 0.159804 0.159804 318.43 0.764706 0.764706 0.764706 478.693 1 1 1 3661 1 1 1', diffuse: '1', interpolation: '1' }, { name: 'CT-Coronary-Arteries-2', gradientOpacity: '4 0 1 255 1', specularPower: '1', scalarOpacity: '14 -2048 0 142.677 0 145.016 0.116071 192.174 0.5625 217.24 0.776786 384.347 0.830357 3661 0.830357', specular: '0', shade: '1', ambient: '0.2', colorTransfer: '28 -2048 0 0 0 142.677 0 0 0 145.016 0.615686 0 0.0156863 192.174 0.909804 0.454902 0 217.24 0.972549 0.807843 0.611765 384.347 0.909804 0.909804 1 3661 1 1 1', diffuse: '1', interpolation: '1' }, { name: 'CT-Coronary-Arteries-3', gradientOpacity: '4 0 1 255 1', specularPower: '10', scalarOpacity: '14 -2048 0 128.643 0 129.982 0.0982143 173.636 0.669643 255.884 0.857143 584.878 0.866071 3661 1', specular: '0.2', shade: '1', ambient: '0.1', colorTransfer: '28 -2048 0 0 0 128.643 0 0 0 129.982 0.615686 0 0.0156863 173.636 0.909804 0.454902 0 255.884 0.886275 0.886275 0.886275 584.878 0.968627 0.968627 0.968627 3661 1 1 1', diffuse: '0.9', interpolation: '1' }, { name: 'CT-Cropped-Volume-Bone', gradientOpacity: '4 0 1 255 1', specularPower: '1', scalarOpacity: '10 -2048 0 -451 0 -450 1 1050 1 3661 1', specular: '0', shade: '0', ambient: '0.2', colorTransfer: '20 -2048 0 0 0 -451 0 0 0 -450 0.0556356 0.0556356 0.0556356 1050 1 1 1 3661 1 1 1', diffuse: '1', interpolation: '1' }, { name: 'CT-Fat', gradientOpacity: '6 0 1 985.12 1 988 1', specularPower: '1', scalarOpacity: '14 -1000 0 -100 0 -99 0.15 -60 0.15 -59 0 101.2 0 952 0', specular: '0', shade: '0', ambient: '0.2', colorTransfer: '36 -1000 0.3 0.3 1 -497.5 0.3 1 0.3 -99 0 0 1 -76.946 0 1 0 -65.481 0.835431 0.888889 0.0165387 83.89 1 0 0 463.28 1 0 0 659.15 1 0.912535 0.0374849 2952 1 0.300267 0.299886', diffuse: '1', interpolation: '1' }, { name: 'CT-Liver-Vasculature', gradientOpacity: '4 0 1 255 1', specularPower: '1', scalarOpacity: '14 -2048 0 149.113 0 157.884 0.482143 339.96 0.660714 388.526 0.830357 1197.95 0.839286 3661 0.848214', specular: '0', shade: '0', ambient: '0.2', colorTransfer: '28 -2048 0 0 0 149.113 0 0 0 157.884 0.501961 0.25098 0 339.96 0.695386 0.59603 0.36886 388.526 0.854902 0.85098 0.827451 1197.95 1 1 1 3661 1 1 1', diffuse: '1', interpolation: '1' }, { name: 'CT-Lung', gradientOpacity: '6 0 1 985.12 1 988 1', specularPower: '1', scalarOpacity: '12 -1000 0 -600 0 -599 0.15 -400 0.15 -399 0 2952 0', specular: '0', shade: '1', ambient: '0.2', colorTransfer: '24 -1000 0.3 0.3 1 -600 0 0 1 -530 0.134704 0.781726 0.0724558 -460 0.929244 1 0.109473 -400 0.888889 0.254949 0.0240258 2952 1 0.3 0.3', diffuse: '1', interpolation: '1' }, { name: 'CT-MIP', gradientOpacity: '4 0 1 255 1', specularPower: '10', scalarOpacity: '8 -3024 0 -637.62 0 700 1 3071 1', specular: '0.2', shade: '1', ambient: '0.1', colorTransfer: '16 -3024 0 0 0 -637.62 1 1 1 700 1 1 1 3071 1 1 1', diffuse: '0.9', interpolation: '1' }, { name: 'CT-Muscle', gradientOpacity: '4 0 1 255 1', specularPower: '10', scalarOpacity: '10 -3024 0 -155.407 0 217.641 0.676471 419.736 0.833333 3071 0.803922', specular: '0.2', shade: '1', ambient: '0.1', colorTransfer: '20 -3024 0 0 0 -155.407 0.54902 0.25098 0.14902 217.641 0.882353 0.603922 0.290196 419.736 1 0.937033 0.954531 3071 0.827451 0.658824 1', diffuse: '0.9', interpolation: '1' }, { name: 'CT-Pulmonary-Arteries', gradientOpacity: '4 0 1 255 1', specularPower: '1', scalarOpacity: '14 -2048 0 -568.625 0 -364.081 0.0714286 -244.813 0.401786 18.2775 0.607143 447.798 0.830357 3592.73 0.839286', specular: '0', shade: '1', ambient: '0.2', colorTransfer: '28 -2048 0 0 0 -568.625 0 0 0 -364.081 0.396078 0.301961 0.180392 -244.813 0.611765 0.352941 0.0705882 18.2775 0.843137 0.0156863 0.156863 447.798 0.752941 0.752941 0.752941 3592.73 1 1 1', diffuse: '1', interpolation: '1' }, { name: 'CT-Soft-Tissue', gradientOpacity: '4 0 1 255 1', specularPower: '1', scalarOpacity: '10 -2048 0 -167.01 0 -160 1 240 1 3661 1', specular: '0', shade: '0', ambient: '0.2', colorTransfer: '20 -2048 0 0 0 -167.01 0 0 0 -160 0.0556356 0.0556356 0.0556356 240 1 1 1 3661 1 1 1', diffuse: '1', interpolation: '1' }, { name: 'CT-Air', gradientOpacity: '4 0 1 255 1', specularPower: '10', scalarOpacity: '8 -3024 0.705882 -900.0 0.715686 -500.0 0 3071 0', specular: '0.2', shade: '1', ambient: '0.1', colorTransfer: '16 -3024 1 1 1 -900.0 0.2 1.0 1.0 -500.0 0.3 0.3 1.0 3071 0 0 0 ', diffuse: '0.9', interpolation: '1' }, { name: 'MR-Angio', gradientOpacity: '4 0 1 255 1', specularPower: '1', scalarOpacity: '12 -2048 0 151.354 0 158.279 0.4375 190.112 0.580357 200.873 0.732143 3661 0.741071', specular: '0', shade: '1', ambient: '0.2', colorTransfer: '24 -2048 0 0 0 151.354 0 0 0 158.279 0.74902 0.376471 0 190.112 1 0.866667 0.733333 200.873 0.937255 0.937255 0.937255 3661 1 1 1', diffuse: '1', interpolation: '1' }, { name: 'MR-Default', gradientOpacity: '4 0 1 255 1', specularPower: '1', scalarOpacity: '12 0 0 20 0 40 0.15 120 0.3 220 0.375 1024 0.5', specular: '0', shade: '1', ambient: '0.2', colorTransfer: '24 0 0 0 0 20 0.168627 0 0 40 0.403922 0.145098 0.0784314 120 0.780392 0.607843 0.380392 220 0.847059 0.835294 0.788235 1024 1 1 1', diffuse: '1', interpolation: '1' }, { name: 'MR-MIP', gradientOpacity: '4 0 1 255 1', specularPower: '1', scalarOpacity: '8 0 0 98.3725 0 416.637 1 2800 1', specular: '0', shade: '0', ambient: '0.2', colorTransfer: '16 0 1 1 1 98.3725 1 1 1 416.637 1 1 1 2800 1 1 1', diffuse: '1', interpolation: '1' }, { name: 'MR-T2-Brain', gradientOpacity: '4 0 1 160.25 1', specularPower: '40', scalarOpacity: '10 0 0 36.05 0 218.302 0.171429 412.406 1 641 1', specular: '0.5', shade: '1', ambient: '0.3', colorTransfer: '16 0 0 0 0 98.7223 0.956863 0.839216 0.192157 412.406 0 0.592157 0.807843 641 1 1 1', diffuse: '0.6', interpolation: '1' }, { name: 'DTI-FA-Brain', gradientOpacity: '4 0 1 0.9950 1', specularPower: '40', scalarOpacity: '16 0 0 0 0 0.3501 0.0158 0.49379 0.7619 0.6419 1 0.9920 1 0.9950 0 0.9950 0', specular: '0.5', shade: '1', ambient: '0.3', colorTransfer: '28 0 1 0 0 0 1 0 0 0.24974 0.4941 1 0 0.49949 0 0.9882 1 0.7492 0.51764 0 1 0.9950 1 0 0 0.9950 1 0 0', diffuse: '0.9', interpolation: '1' }]; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (presets); /***/ }, /***/ 27426 /*!***********************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/enums/BlendModes.js ***! \***********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ BlendModes: () => (/* binding */ BlendModes), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _kitware_vtk_js_Rendering_Core_VolumeMapper_Constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/VolumeMapper/Constants */ 69041); const { BlendMode } = _kitware_vtk_js_Rendering_Core_VolumeMapper_Constants__WEBPACK_IMPORTED_MODULE_0__["default"]; var BlendModes; (function (BlendModes) { BlendModes[BlendModes["COMPOSITE"] = BlendMode.COMPOSITE_BLEND] = "COMPOSITE"; BlendModes[BlendModes["MAXIMUM_INTENSITY_BLEND"] = BlendMode.MAXIMUM_INTENSITY_BLEND] = "MAXIMUM_INTENSITY_BLEND"; BlendModes[BlendModes["MINIMUM_INTENSITY_BLEND"] = BlendMode.MINIMUM_INTENSITY_BLEND] = "MINIMUM_INTENSITY_BLEND"; BlendModes[BlendModes["AVERAGE_INTENSITY_BLEND"] = BlendMode.AVERAGE_INTENSITY_BLEND] = "AVERAGE_INTENSITY_BLEND"; BlendModes[BlendModes["LABELMAP_EDGE_PROJECTION_BLEND"] = BlendMode.LABELMAP_EDGE_PROJECTION_BLEND] = "LABELMAP_EDGE_PROJECTION_BLEND"; })(BlendModes || (BlendModes = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BlendModes); /***/ }, /***/ 16682 /*!*****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/enums/CalibrationTypes.js ***! \*****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CalibrationTypes: () => (/* binding */ CalibrationTypes), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var CalibrationTypes; (function (CalibrationTypes) { CalibrationTypes["NOT_APPLICABLE"] = ""; CalibrationTypes["ERMF"] = "ERMF"; CalibrationTypes["USER"] = "User"; CalibrationTypes["PROJECTION"] = "Proj"; CalibrationTypes["REGION"] = "Region"; CalibrationTypes["ERROR"] = "Error"; CalibrationTypes["UNCALIBRATED"] = "Uncalibrated"; CalibrationTypes["CALIBRATED"] = "Calibrated"; CalibrationTypes["UNKNOWN"] = "Unknown"; })(CalibrationTypes || (CalibrationTypes = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CalibrationTypes); /***/ }, /***/ 37029 /*!************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/enums/ContourType.js ***! \************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var ContourType; (function (ContourType) { ContourType["CLOSED_PLANAR"] = "CLOSED_PLANAR"; ContourType["OPEN_PLANAR"] = "OPEN_PLANAR"; })(ContourType || (ContourType = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ContourType); /***/ }, /***/ 66502 /*!********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/enums/DynamicOperatorType.js ***! \********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var DynamicOperatorType; (function (DynamicOperatorType) { DynamicOperatorType["SUM"] = "SUM"; DynamicOperatorType["AVERAGE"] = "AVERAGE"; DynamicOperatorType["SUBTRACT"] = "SUBTRACT"; })(DynamicOperatorType || (DynamicOperatorType = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DynamicOperatorType); /***/ }, /***/ 14566 /*!*******************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/enums/Events.js ***! \*******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var Events; (function (Events) { Events["ERROR_EVENT"] = "CORNERSTONE_ERROR"; Events["CACHE_SIZE_EXCEEDED"] = "CACHE_SIZE_EXCEEDED"; Events["IMAGE_LOAD_ERROR"] = "IMAGE_LOAD_ERROR"; Events["CAMERA_MODIFIED"] = "CORNERSTONE_CAMERA_MODIFIED"; Events["CAMERA_RESET"] = "CORNERSTONE_CAMERA_RESET"; Events["VOI_MODIFIED"] = "CORNERSTONE_VOI_MODIFIED"; Events["PRESET_MODIFIED"] = "CORNERSTONE_VIEWPORT_RENDERING_PRESET_MODIFIED"; Events["DISPLAY_AREA_MODIFIED"] = "CORNERSTONE_DISPLAY_AREA_MODIFIED"; Events["ELEMENT_DISABLED"] = "CORNERSTONE_ELEMENT_DISABLED"; Events["ELEMENT_ENABLED"] = "CORNERSTONE_ELEMENT_ENABLED"; Events["IMAGE_RENDERED"] = "CORNERSTONE_IMAGE_RENDERED"; Events["IMAGE_VOLUME_MODIFIED"] = "CORNERSTONE_IMAGE_VOLUME_MODIFIED"; Events["IMAGE_VOLUME_LOADING_COMPLETED"] = "CORNERSTONE_IMAGE_VOLUME_LOADING_COMPLETED"; Events["IMAGE_LOADED"] = "CORNERSTONE_IMAGE_LOADED"; Events["IMAGE_RETRIEVAL_STAGE"] = "CORNERSTONE_IMAGE_RETRIEVAL_STAGE"; Events["IMAGE_LOAD_FAILED"] = "CORNERSTONE_IMAGE_LOAD_FAILED"; Events["VOLUME_VIEWPORT_NEW_VOLUME"] = "CORNERSTONE_VOLUME_VIEWPORT_NEW_VOLUME"; Events["VOLUME_LOADED"] = "CORNERSTONE_VOLUME_LOADED"; Events["VOLUME_LOADED_FAILED"] = "CORNERSTONE_VOLUME_LOADED_FAILED"; Events["IMAGE_CACHE_IMAGE_ADDED"] = "CORNERSTONE_IMAGE_CACHE_IMAGE_ADDED"; Events["IMAGE_CACHE_IMAGE_REMOVED"] = "CORNERSTONE_IMAGE_CACHE_IMAGE_REMOVED"; Events["VOLUME_CACHE_VOLUME_ADDED"] = "CORNERSTONE_VOLUME_CACHE_VOLUME_ADDED"; Events["VOLUME_CACHE_VOLUME_REMOVED"] = "CORNERSTONE_VOLUME_CACHE_VOLUME_REMOVED"; Events["STACK_NEW_IMAGE"] = "CORNERSTONE_STACK_NEW_IMAGE"; Events["VOLUME_NEW_IMAGE"] = "CORNERSTONE_VOLUME_NEW_IMAGE"; Events["PRE_STACK_NEW_IMAGE"] = "CORNERSTONE_PRE_STACK_NEW_IMAGE"; Events["IMAGE_SPACING_CALIBRATED"] = "CORNERSTONE_IMAGE_SPACING_CALIBRATED"; Events["VIEWPORT_NEW_IMAGE_SET"] = "CORNERSTONE_VIEWPORT_NEW_IMAGE_SET"; Events["STACK_VIEWPORT_SCROLL"] = "CORNERSTONE_STACK_VIEWPORT_SCROLL"; Events["STACK_SCROLL_OUT_OF_BOUNDS"] = "STACK_SCROLL_OUT_OF_BOUNDS"; Events["GEOMETRY_CACHE_GEOMETRY_ADDED"] = "CORNERSTONE_GEOMETRY_CACHE_GEOMETRY_ADDED"; Events["GEOMETRY_CACHE_GEOMETRY_REMOVED"] = "CORNERSTONE_GEOMETRY_CACHE_GEOMETRY_REMOVED"; Events["VOLUME_VIEWPORT_SCROLL_OUT_OF_BOUNDS"] = "VOLUME_VIEWPORT_SCROLL_OUT_OF_BOUNDS"; Events["VOLUME_VIEWPORT_SCROLL"] = "VOLUME_VIEWPORT_SCROLL"; Events["CLIPPING_PLANES_UPDATED"] = "CORNERSTONE_CLIPPING_PLANES_UPDATED"; Events["WEB_WORKER_PROGRESS"] = "CORNERSTONE_WEB_WORKER_PROGRESS"; Events["COLORMAP_MODIFIED"] = "CORNERSTONE_COLORMAP_MODIFIED"; Events["DYNAMIC_VOLUME_DIMENSION_GROUP_CHANGED"] = "DYNAMIC_VOLUME_DIMENSION_GROUP_CHANGED"; Events["DYNAMIC_VOLUME_TIME_POINT_INDEX_CHANGED"] = "DYNAMIC_VOLUME_TIME_POINT_INDEX_CHANGED"; Events["DYNAMIC_VOLUME_DIMENSION_GROUP_LOADED"] = "DYNAMIC_VOLUME_DIMENSION_GROUP_LOADED"; Events["DYNAMIC_VOLUME_TIME_POINT_LOADED"] = "DYNAMIC_VOLUME_TIME_POINT_LOADED"; Events["GEOMETRY_LOADED"] = "GEOMETRY_LOADED"; Events["GEOMETRY_LOAD_PROGRESS"] = "GEOMETRY_LOAD_PROGRESS"; Events["GEOMETRY_LOADED_FAILED"] = "GEOMETRY_LOADED_FAILED"; Events["ACTORS_CHANGED"] = "CORNERSTONE_ACTORS_CHANGED"; })(Events || (Events = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Events); /***/ }, /***/ 72735 /*!******************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/enums/GenerateImageType.js ***! \******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ GenerateImageType: () => (/* binding */ GenerateImageType) /* harmony export */ }); var GenerateImageType; (function (GenerateImageType) { GenerateImageType["SUM"] = "SUM"; GenerateImageType["SUBTRACT"] = "SUBTRACT"; GenerateImageType["AVERAGE"] = "AVERAGE"; })(GenerateImageType || (GenerateImageType = {})); /***/ }, /***/ 74387 /*!*************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/enums/GeometryType.js ***! \*************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var GeometryType; (function (GeometryType) { GeometryType["CONTOUR"] = "CONTOUR"; GeometryType["SURFACE"] = "SURFACE"; GeometryType["MESH"] = "MESH"; })(GeometryType || (GeometryType = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (GeometryType); /***/ }, /***/ 23995 /*!*******************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/enums/ImageQualityStatus.js ***! \*******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var ImageQualityStatus; (function (ImageQualityStatus) { ImageQualityStatus[ImageQualityStatus["FAR_REPLICATE"] = 1] = "FAR_REPLICATE"; ImageQualityStatus[ImageQualityStatus["ADJACENT_REPLICATE"] = 3] = "ADJACENT_REPLICATE"; ImageQualityStatus[ImageQualityStatus["SUBRESOLUTION"] = 6] = "SUBRESOLUTION"; ImageQualityStatus[ImageQualityStatus["LOSSY"] = 7] = "LOSSY"; ImageQualityStatus[ImageQualityStatus["FULL_RESOLUTION"] = 8] = "FULL_RESOLUTION"; })(ImageQualityStatus || (ImageQualityStatus = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ImageQualityStatus); /***/ }, /***/ 86461 /*!******************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/enums/InterpolationType.js ***! \******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var InterpolationType; (function (InterpolationType) { InterpolationType[InterpolationType["NEAREST"] = 0] = "NEAREST"; InterpolationType[InterpolationType["LINEAR"] = 1] = "LINEAR"; InterpolationType[InterpolationType["FAST_LINEAR"] = 2] = "FAST_LINEAR"; })(InterpolationType || (InterpolationType = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InterpolationType); /***/ }, /***/ 16042 /*!*********************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/enums/MeshType.js ***! \*********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var MeshType; (function (MeshType) { MeshType["PLY"] = "PLY"; MeshType["STL"] = "STL"; MeshType["OBJ"] = "OBJ"; MeshType["VTP"] = "VTP"; })(MeshType || (MeshType = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MeshType); /***/ }, /***/ 94649 /*!****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/enums/MetadataModules.js ***! \****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var MetadataModules; (function (MetadataModules) { MetadataModules["CALIBRATION"] = "calibrationModule"; MetadataModules["CINE"] = "cineModule"; MetadataModules["GENERAL_IMAGE"] = "generalImageModule"; MetadataModules["GENERAL_SERIES"] = "generalSeriesModule"; MetadataModules["GENERAL_STUDY"] = "generalStudyModule"; MetadataModules["IMAGE_PIXEL"] = "imagePixelModule"; MetadataModules["IMAGE_PLANE"] = "imagePlaneModule"; MetadataModules["IMAGE_URL"] = "imageUrlModule"; MetadataModules["MODALITY_LUT"] = "modalityLutModule"; MetadataModules["MULTIFRAME"] = "multiframeModule"; MetadataModules["NM_MULTIFRAME_GEOMETRY"] = "nmMultiframeGeometryModule"; MetadataModules["OVERLAY_PLANE"] = "overlayPlaneModule"; MetadataModules["PATIENT"] = "patientModule"; MetadataModules["PATIENT_STUDY"] = "patientStudyModule"; MetadataModules["PET_IMAGE"] = "petImageModule"; MetadataModules["PET_ISOTOPE"] = "petIsotopeModule"; MetadataModules["PET_SERIES"] = "petSeriesModule"; MetadataModules["SOP_COMMON"] = "sopCommonModule"; MetadataModules["ULTRASOUND_ENHANCED_REGION"] = "ultrasoundEnhancedRegionModule"; MetadataModules["ECG"] = "ecgModule"; MetadataModules["VOI_LUT"] = "voiLutModule"; MetadataModules["FRAME_MODULE"] = "frameModule"; MetadataModules["WADO_WEB_CLIENT"] = "wadoWebClient"; MetadataModules["INSTANCE"] = "instance"; MetadataModules["IMAGE_SOP_INSTANCE_REFERENCE"] = "ImageSopInstanceReference"; MetadataModules["REFERENCED_SERIES_REFERENCE"] = "ReferencedSeriesReference"; MetadataModules["PREDECESSOR_SEQUENCE"] = "PredecessorSequence"; MetadataModules["STUDY_DATA"] = "StudyData"; MetadataModules["SERIES_DATA"] = "SeriesData"; MetadataModules["IMAGE_DATA"] = "ImageData"; MetadataModules["RTSS_INSTANCE_DATA"] = "RtssInstanceData"; MetadataModules["NEW_INSTANCE_DATA"] = "NewInstanceData"; MetadataModules["RTSS_CONTOUR"] = "metaRTSSContour"; MetadataModules["SEG_BIT"] = "metaSegBitmap"; MetadataModules["SR_ANNOTATION"] = "metaSrAnnotation"; })(MetadataModules || (MetadataModules = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MetadataModules); /***/ }, /***/ 80600 /*!****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/enums/OrientationAxis.js ***! \****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var OrientationAxis; (function (OrientationAxis) { OrientationAxis["AXIAL"] = "axial"; OrientationAxis["CORONAL"] = "coronal"; OrientationAxis["SAGITTAL"] = "sagittal"; OrientationAxis["ACQUISITION"] = "acquisition"; OrientationAxis["AXIAL_REFORMAT"] = "axial_reformat"; OrientationAxis["CORONAL_REFORMAT"] = "coronal_reformat"; OrientationAxis["SAGITTAL_REFORMAT"] = "sagittal_reformat"; OrientationAxis["REFORMAT"] = "reformat"; })(OrientationAxis || (OrientationAxis = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OrientationAxis); /***/ }, /***/ 78015 /*!************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/enums/RenderingEngineModeEnum.js ***! \************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var RenderingEngineModeEnum; (function (RenderingEngineModeEnum) { RenderingEngineModeEnum["Tiled"] = "tiled"; RenderingEngineModeEnum["ContextPool"] = "contextPool"; })(RenderingEngineModeEnum || (RenderingEngineModeEnum = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RenderingEngineModeEnum); /***/ }, /***/ 9742 /*!************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/enums/RequestType.js ***! \************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var RequestType; (function (RequestType) { RequestType["Interaction"] = "interaction"; RequestType["Thumbnail"] = "thumbnail"; RequestType["Prefetch"] = "prefetch"; RequestType["Compute"] = "compute"; })(RequestType || (RequestType = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RequestType); /***/ }, /***/ 78700 /*!*******************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/enums/VOILUTFunctionType.js ***! \*******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var VOILUTFunctionType; (function (VOILUTFunctionType) { VOILUTFunctionType["LINEAR"] = "LINEAR"; VOILUTFunctionType["SAMPLED_SIGMOID"] = "SIGMOID"; VOILUTFunctionType["LINEAR_EXACT"] = "LINEAR_EXACT"; })(VOILUTFunctionType || (VOILUTFunctionType = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (VOILUTFunctionType); /***/ }, /***/ 65836 /*!***********************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/enums/VideoEnums.js ***! \***********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ SpeedUnit: () => (/* binding */ SpeedUnit) /* harmony export */ }); var SpeedUnit; (function (SpeedUnit) { SpeedUnit["FRAME"] = "f"; SpeedUnit["SECOND"] = "s"; })(SpeedUnit || (SpeedUnit = {})); /***/ }, /***/ 15247 /*!***************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/enums/ViewportStatus.js ***! \***************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var ViewportStatus; (function (ViewportStatus) { ViewportStatus["NO_DATA"] = "noData"; ViewportStatus["LOADING"] = "loading"; ViewportStatus["PRE_RENDER"] = "preRender"; ViewportStatus["RESIZE"] = "resize"; ViewportStatus["RENDERED"] = "rendered"; })(ViewportStatus || (ViewportStatus = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ViewportStatus); /***/ }, /***/ 43089 /*!*************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/enums/ViewportType.js ***! \*************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var ViewportType; (function (ViewportType) { ViewportType["STACK"] = "stack"; ViewportType["ORTHOGRAPHIC"] = "orthographic"; ViewportType["PERSPECTIVE"] = "perspective"; ViewportType["VOLUME_3D"] = "volume3d"; ViewportType["VIDEO"] = "video"; ViewportType["WHOLE_SLIDE"] = "wholeSlide"; ViewportType["ECG"] = "ecg"; })(ViewportType || (ViewportType = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ViewportType); /***/ }, /***/ 94265 /*!*****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/enums/VoxelManagerEnum.js ***! \*****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var VoxelManagerEnum; (function (VoxelManagerEnum) { VoxelManagerEnum["RLE"] = "RLE"; VoxelManagerEnum["Volume"] = "Volume"; })(VoxelManagerEnum || (VoxelManagerEnum = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (VoxelManagerEnum); /***/ }, /***/ 67855 /*!******************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/enums/index.js ***! \******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ BlendModes: () => (/* reexport safe */ _BlendModes__WEBPACK_IMPORTED_MODULE_4__["default"]), /* harmony export */ CalibrationTypes: () => (/* reexport safe */ _CalibrationTypes__WEBPACK_IMPORTED_MODULE_11__["default"]), /* harmony export */ ContourType: () => (/* reexport safe */ _ContourType__WEBPACK_IMPORTED_MODULE_7__["default"]), /* harmony export */ DynamicOperatorType: () => (/* reexport safe */ _DynamicOperatorType__WEBPACK_IMPORTED_MODULE_10__["default"]), /* harmony export */ Events: () => (/* reexport safe */ _Events__WEBPACK_IMPORTED_MODULE_0__["default"]), /* harmony export */ GenerateImageType: () => (/* reexport safe */ _GenerateImageType__WEBPACK_IMPORTED_MODULE_16__.GenerateImageType), /* harmony export */ GeometryType: () => (/* reexport safe */ _GeometryType__WEBPACK_IMPORTED_MODULE_6__["default"]), /* harmony export */ ImageQualityStatus: () => (/* reexport safe */ _ImageQualityStatus__WEBPACK_IMPORTED_MODULE_13__["default"]), /* harmony export */ InterpolationType: () => (/* reexport safe */ _InterpolationType__WEBPACK_IMPORTED_MODULE_3__["default"]), /* harmony export */ MeshType: () => (/* reexport safe */ _MeshType__WEBPACK_IMPORTED_MODULE_8__["default"]), /* harmony export */ MetadataModules: () => (/* reexport safe */ _MetadataModules__WEBPACK_IMPORTED_MODULE_15__["default"]), /* harmony export */ OrientationAxis: () => (/* reexport safe */ _OrientationAxis__WEBPACK_IMPORTED_MODULE_5__["default"]), /* harmony export */ RenderingEngineModeEnum: () => (/* reexport safe */ _RenderingEngineModeEnum__WEBPACK_IMPORTED_MODULE_18__["default"]), /* harmony export */ RequestType: () => (/* reexport safe */ _RequestType__WEBPACK_IMPORTED_MODULE_1__["default"]), /* harmony export */ VOILUTFunctionType: () => (/* reexport safe */ _VOILUTFunctionType__WEBPACK_IMPORTED_MODULE_9__["default"]), /* harmony export */ VideoEnums: () => (/* reexport module object */ _VideoEnums__WEBPACK_IMPORTED_MODULE_14__), /* harmony export */ ViewportStatus: () => (/* reexport safe */ _ViewportStatus__WEBPACK_IMPORTED_MODULE_12__["default"]), /* harmony export */ ViewportType: () => (/* reexport safe */ _ViewportType__WEBPACK_IMPORTED_MODULE_2__["default"]), /* harmony export */ VoxelManagerEnum: () => (/* reexport safe */ _VoxelManagerEnum__WEBPACK_IMPORTED_MODULE_17__["default"]) /* harmony export */ }); /* harmony import */ var _Events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Events */ 14566); /* harmony import */ var _RequestType__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RequestType */ 9742); /* harmony import */ var _ViewportType__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ViewportType */ 43089); /* harmony import */ var _InterpolationType__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./InterpolationType */ 86461); /* harmony import */ var _BlendModes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./BlendModes */ 27426); /* harmony import */ var _OrientationAxis__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./OrientationAxis */ 80600); /* harmony import */ var _GeometryType__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./GeometryType */ 74387); /* harmony import */ var _ContourType__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ContourType */ 37029); /* harmony import */ var _MeshType__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./MeshType */ 16042); /* harmony import */ var _VOILUTFunctionType__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./VOILUTFunctionType */ 78700); /* harmony import */ var _DynamicOperatorType__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./DynamicOperatorType */ 66502); /* harmony import */ var _CalibrationTypes__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./CalibrationTypes */ 16682); /* harmony import */ var _ViewportStatus__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./ViewportStatus */ 15247); /* harmony import */ var _ImageQualityStatus__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./ImageQualityStatus */ 23995); /* harmony import */ var _VideoEnums__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./VideoEnums */ 65836); /* harmony import */ var _MetadataModules__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./MetadataModules */ 94649); /* harmony import */ var _GenerateImageType__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./GenerateImageType */ 72735); /* harmony import */ var _VoxelManagerEnum__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./VoxelManagerEnum */ 94265); /* harmony import */ var _RenderingEngineModeEnum__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./RenderingEngineModeEnum */ 78015); /***/ }, /***/ 28699 /*!******************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/eventTarget.js ***! \******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); class CornerstoneEventTarget { constructor() { this.listeners = {}; this.debouncedListeners = {}; } reset() { this.listeners = {}; this.debouncedListeners = {}; } addEventListenerOnce(type, callback) { const onceWrapper = event => { this.removeEventListener(type, onceWrapper); callback.call(this, event); }; this.addEventListener(type, onceWrapper); } addEventListener(type, callback) { if (!this.listeners[type]) { this.listeners[type] = []; } if (this.listeners[type].indexOf(callback) !== -1) { return; } this.listeners[type].push(callback); } addEventListenerDebounced(type, callback, delay) { this.debouncedListeners[type] = this.debouncedListeners[type] || {}; const debouncedCallbacks = this.debouncedListeners[type]; if (!debouncedCallbacks[callback]) { const handle = event => { if (debouncedCallbacks[callback]) { clearTimeout(debouncedCallbacks[callback].timeoutId); } debouncedCallbacks[callback].timeoutId = setTimeout(() => { callback.call(this, event); }, delay); }; debouncedCallbacks[callback] = { original: callback, handle, timeoutId: null }; this.addEventListener(type, handle); } } removeEventListenerDebounced(type, callback) { if (this.debouncedListeners[type]?.[callback]) { const debounced = this.debouncedListeners[type][callback]; this.removeEventListener(type, debounced.handle); clearTimeout(debounced.timeoutId); delete this.debouncedListeners[type][callback]; } } removeEventListener(type, callback) { if (!this.listeners[type]) { return; } const stack = this.listeners[type]; const stackLength = stack.length; for (let i = 0; i < stackLength; i++) { if (stack[i] === callback) { stack.splice(i, 1); return; } } } dispatchEvent(event) { if (!this.listeners[event.type]) { return !event.defaultPrevented; } const stack = this.listeners[event.type].slice(); const stackLength = stack.length; for (let i = 0; i < stackLength; i++) { try { stack[i].call(this, event); } catch (error) { console.error(`error in event listener of type: ${event.type}`, error); } } return !event.defaultPrevented; } } const eventTarget = new CornerstoneEventTarget(); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (eventTarget); /***/ }, /***/ 98361 /*!************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/getEnabledElement.js ***! \************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getEnabledElement), /* harmony export */ getEnabledElementByIds: () => (/* binding */ getEnabledElementByIds), /* harmony export */ getEnabledElementByViewportId: () => (/* binding */ getEnabledElementByViewportId), /* harmony export */ getEnabledElements: () => (/* binding */ getEnabledElements) /* harmony export */ }); /* harmony import */ var _RenderingEngine_getRenderingEngine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RenderingEngine/getRenderingEngine */ 77569); function getEnabledElement(element) { if (!element) { return; } const { viewportUid, renderingEngineUid } = element.dataset; return getEnabledElementByIds(viewportUid, renderingEngineUid); } function getEnabledElementByIds(viewportId, renderingEngineId) { if (!renderingEngineId || !viewportId) { return; } const renderingEngine = (0,_RenderingEngine_getRenderingEngine__WEBPACK_IMPORTED_MODULE_0__["default"])(renderingEngineId); if (!renderingEngine || renderingEngine.hasBeenDestroyed) { return; } const viewport = renderingEngine.getViewport(viewportId); if (!viewport) { return; } const FrameOfReferenceUID = viewport.getFrameOfReferenceUID(); return { viewport, renderingEngine, viewportId, renderingEngineId, FrameOfReferenceUID }; } function getEnabledElementByViewportId(viewportId) { const renderingEngines = (0,_RenderingEngine_getRenderingEngine__WEBPACK_IMPORTED_MODULE_0__.getRenderingEngines)(); for (let i = 0; i < renderingEngines.length; i++) { const renderingEngine = renderingEngines[i]; const viewport = renderingEngine.getViewport(viewportId); if (viewport) { return getEnabledElementByIds(viewportId, renderingEngine.id); } } } function getEnabledElements() { const enabledElements = []; const renderingEngines = (0,_RenderingEngine_getRenderingEngine__WEBPACK_IMPORTED_MODULE_0__.getRenderingEngines)(); renderingEngines.forEach(renderingEngine => { const viewports = renderingEngine.getViewports(); viewports.forEach(({ element }) => { enabledElements.push(getEnabledElement(element)); }); }); return enabledElements; } /***/ }, /***/ 15678 /*!***********************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/init.js ***! \***********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ canRenderFloatTextures: () => (/* binding */ canRenderFloatTextures), /* harmony export */ getCanUseNorm16Texture: () => (/* binding */ getCanUseNorm16Texture), /* harmony export */ getConfiguration: () => (/* binding */ getConfiguration), /* harmony export */ getShouldUseCPURendering: () => (/* binding */ getShouldUseCPURendering), /* harmony export */ getWebWorkerManager: () => (/* binding */ getWebWorkerManager), /* harmony export */ init: () => (/* binding */ init), /* harmony export */ isCornerstoneInitialized: () => (/* binding */ isCornerstoneInitialized), /* harmony export */ peerImport: () => (/* binding */ peerImport), /* harmony export */ resetInitialization: () => (/* binding */ resetInitialization), /* harmony export */ resetUseCPURendering: () => (/* binding */ resetUseCPURendering), /* harmony export */ setConfiguration: () => (/* binding */ setConfiguration), /* harmony export */ setPreferSizeOverAccuracy: () => (/* binding */ setPreferSizeOverAccuracy), /* harmony export */ setUseCPURendering: () => (/* binding */ setUseCPURendering) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _RenderingEngine_getRenderingEngine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RenderingEngine/getRenderingEngine */ 77569); /* harmony import */ var _utilities_deepMerge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utilities/deepMerge */ 70391); /* harmony import */ var _webWorkerManager_webWorkerManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./webWorkerManager/webWorkerManager */ 6805); /* harmony import */ var _utilities_textureSupport__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utilities/textureSupport */ 78715); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./enums */ 78015); let csRenderInitialized = false; const defaultConfig = { gpuTier: { tier: 2 }, isMobile: false, rendering: { useCPURendering: false, preferSizeOverAccuracy: false, useLegacyCameraFOV: false, strictZSpacingForVolumeViewport: true, renderingEngineMode: _enums__WEBPACK_IMPORTED_MODULE_5__["default"].ContextPool, webGlContextCount: 7, volumeRendering: { sampleDistanceMultiplier: 1 } }, debug: { statsOverlay: false }, peerImport: moduleId => null }; let config = { ...defaultConfig, rendering: { ...defaultConfig.rendering } }; let webWorkerManager = null; let canUseNorm16Texture = false; function _getGLContext() { const canvas = document.createElement('canvas'); const gl = canvas.getContext('webgl2') || canvas.getContext('webgl') || canvas.getContext('experimental-webgl'); return gl; } function _hasActiveWebGLContext() { const gl = _getGLContext(); return gl instanceof WebGLRenderingContext || gl instanceof WebGL2RenderingContext; } function _hasNorm16TextureSupport() { const supportedTextureFormats = (0,_utilities_textureSupport__WEBPACK_IMPORTED_MODULE_4__.getSupportedTextureFormats)(); return supportedTextureFormats.norm16 && supportedTextureFormats.norm16Linear; } function isIOS() { if (/iPad|iPhone|iPod/.test(navigator.platform)) { return true; } else { return navigator.maxTouchPoints && navigator.maxTouchPoints > 2 && navigator.platform.includes('MacIntel'); } } function init(configuration = config) { if (csRenderInitialized) { return csRenderInitialized; } canUseNorm16Texture = _hasNorm16TextureSupport(); config = (0,_utilities_deepMerge__WEBPACK_IMPORTED_MODULE_2__["default"])(defaultConfig, configuration); if (config.isMobile) { config.rendering.webGlContextCount = 1; } if (isIOS()) { if (configuration.rendering?.preferSizeOverAccuracy) { config.rendering.preferSizeOverAccuracy = true; } else { console.log('norm16 texture not supported, you can turn on the preferSizeOverAccuracy flag to use native data type, but be aware of the inaccuracy of the rendering in high bits'); } } const hasWebGLContext = _hasActiveWebGLContext(); if (!hasWebGLContext) { console.log('CornerstoneRender: GPU not detected, using CPU rendering'); config.rendering.useCPURendering = true; } else { console.log('CornerstoneRender: using GPU rendering'); } csRenderInitialized = true; if (!webWorkerManager) { webWorkerManager = new _webWorkerManager_webWorkerManager__WEBPACK_IMPORTED_MODULE_3__["default"](); } return csRenderInitialized; } function getCanUseNorm16Texture() { return canUseNorm16Texture; } function setUseCPURendering(status, updateViewports = true) { config.rendering.useCPURendering = status; csRenderInitialized = true; if (updateViewports) { _updateRenderingPipelinesForAllViewports(); } } function setPreferSizeOverAccuracy(status) { config.rendering.preferSizeOverAccuracy = status; csRenderInitialized = true; _updateRenderingPipelinesForAllViewports(); } function canRenderFloatTextures() { if (!isIOS()) { return true; } return false; } function resetUseCPURendering() { config.rendering.useCPURendering = !_hasActiveWebGLContext(); _updateRenderingPipelinesForAllViewports(); } function getShouldUseCPURendering() { return config.rendering.useCPURendering; } function isCornerstoneInitialized() { return csRenderInitialized; } function resetInitialization() { csRenderInitialized = false; } function getConfiguration() { return config; } function setConfiguration(c) { config = c; _updateRenderingPipelinesForAllViewports(); } function _updateRenderingPipelinesForAllViewports() { (0,_RenderingEngine_getRenderingEngine__WEBPACK_IMPORTED_MODULE_1__.getRenderingEngines)().forEach(engine => { engine.getViewports().forEach(viewport => { viewport.updateRenderingPipeline(); }); }); } function getWebWorkerManager() { if (!webWorkerManager) { webWorkerManager = new _webWorkerManager_webWorkerManager__WEBPACK_IMPORTED_MODULE_3__["default"](); } return webWorkerManager; } function peerImport(_x) { return _peerImport.apply(this, arguments); } function _peerImport() { _peerImport = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (moduleId) { return config.peerImport(moduleId); }); return _peerImport.apply(this, arguments); } /***/ }, /***/ 77360 /*!****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/loaders/ProgressiveRetrieveImages.js ***! \****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ProgressiveRetrieveImages: () => (/* binding */ ProgressiveRetrieveImages), /* harmony export */ createProgressive: () => (/* binding */ createProgressive), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ interleavedRetrieveStages: () => (/* reexport safe */ _configuration_interleavedRetrieve__WEBPACK_IMPORTED_MODULE_3__["default"]), /* harmony export */ sequentialRetrieveStages: () => (/* reexport safe */ _configuration_sequentialRetrieve__WEBPACK_IMPORTED_MODULE_2__["default"]), /* harmony export */ singleRetrieveStages: () => (/* reexport safe */ _configuration_singleRetrieve__WEBPACK_IMPORTED_MODULE_1__["default"]) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _configuration_singleRetrieve__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./configuration/singleRetrieve */ 24134); /* harmony import */ var _configuration_sequentialRetrieve__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./configuration/sequentialRetrieve */ 21449); /* harmony import */ var _configuration_interleavedRetrieve__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./configuration/interleavedRetrieve */ 25179); /* harmony import */ var _imageLoader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./imageLoader */ 96035); /* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utilities/triggerEvent */ 91133); /* harmony import */ var _utilities_ProgressiveIterator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utilities/ProgressiveIterator */ 60308); /* harmony import */ var _utilities_decimate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utilities/decimate */ 32167); /* harmony import */ var _requestPool_imageLoadPoolManager__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../requestPool/imageLoadPoolManager */ 11062); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../enums */ 14566); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../enums */ 9742); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../enums */ 23995); /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../cache/cache */ 38277); /* harmony import */ var _eventTarget__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../eventTarget */ 28699); /* harmony import */ var _fillNearbyFrames__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./fillNearbyFrames */ 93141); class ProgressiveRetrieveImages { static { this.createProgressive = createProgressive; } static { this.interleavedRetrieveStages = { stages: _configuration_interleavedRetrieve__WEBPACK_IMPORTED_MODULE_3__["default"] }; } static { this.singleRetrieveStages = { stages: _configuration_singleRetrieve__WEBPACK_IMPORTED_MODULE_1__["default"] }; } static { this.sequentialRetrieveStages = { stages: _configuration_sequentialRetrieve__WEBPACK_IMPORTED_MODULE_2__["default"] }; } constructor(imageRetrieveConfiguration) { this.stages = imageRetrieveConfiguration.stages || _configuration_singleRetrieve__WEBPACK_IMPORTED_MODULE_1__["default"]; this.retrieveOptions = imageRetrieveConfiguration.retrieveOptions || {}; } loadImages(imageIds, listener) { const instance = new ProgressiveRetrieveImagesInstance(this, imageIds, listener); return instance.loadImages(); } } class ProgressiveRetrieveImagesInstance { constructor(configuration, imageIds, listener) { this.outstandingRequests = 0; this.stageStatusMap = new Map(); this.displayedIterator = new _utilities_ProgressiveIterator__WEBPACK_IMPORTED_MODULE_6__["default"]('displayed'); this.stages = configuration.stages; this.retrieveOptions = configuration.retrieveOptions; this.imageIds = imageIds; this.listener = listener; } loadImages() { var _this = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { const interleaved = _this.createStageRequests(); _this.outstandingRequests = interleaved.length; for (const request of interleaved) { _this.addRequest(request); } if (_this.outstandingRequests === 0) { return Promise.resolve(null); } return _this.displayedIterator.getDonePromise(); })(); } sendRequest(request, options) { var _this2 = this; const { imageId, next } = request; const errorCallback = (reason, done) => { this.listener.errorCallback(imageId, complete || !next, reason); if (done) { this.updateStageStatus(request.stage, reason); } }; const loadedPromise = (options.loader || _imageLoader__WEBPACK_IMPORTED_MODULE_4__.loadAndCacheImage)(imageId, options); const uncompressedIterator = _utilities_ProgressiveIterator__WEBPACK_IMPORTED_MODULE_6__["default"].as(loadedPromise); let complete = false; uncompressedIterator.forEach(/*#__PURE__*/function () { var _ref = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (image, done) { const oldStatus = _cache_cache__WEBPACK_IMPORTED_MODULE_12__["default"].getImageQuality(imageId); if (!image) { console.warn('No image retrieved', imageId); return; } const { imageQualityStatus } = image; complete ||= imageQualityStatus === _enums__WEBPACK_IMPORTED_MODULE_11__["default"].FULL_RESOLUTION; if (oldStatus !== undefined && oldStatus > imageQualityStatus) { _this2.updateStageStatus(request.stage, null, true); return; } _this2.listener.successCallback(imageId, image); _this2.displayedIterator.add(image); if (done) { _this2.updateStageStatus(request.stage); } (0,_fillNearbyFrames__WEBPACK_IMPORTED_MODULE_14__.fillNearbyFrames)(_this2.listener, request, image); }); return function (_x, _x2) { return _ref.apply(this, arguments); }; }(), errorCallback).finally(() => { if (!complete && next) { _cache_cache__WEBPACK_IMPORTED_MODULE_12__["default"].setPartialImage(imageId); this.addRequest(next, options.streamingData); } else { if (!complete) { this.listener.errorCallback(imageId, true, "Couldn't decode"); } this.outstandingRequests--; for (let skip = next; skip; skip = skip.next) { this.updateStageStatus(skip.stage, null, true); } } if (this.outstandingRequests <= 0) { this.displayedIterator.resolve(); } }); const doneLoad = uncompressedIterator.getDonePromise(); return doneLoad.catch(e => null); } addRequest(request, streamingData = {}) { const { imageId, stage } = request; const baseOptions = this.listener.getLoaderImageOptions(imageId); if (!baseOptions) { return; } const { retrieveType = 'default' } = stage; const { retrieveOptions: keyedRetrieveOptions } = this; const retrieveOptions = keyedRetrieveOptions[retrieveType] || keyedRetrieveOptions.default; const options = { ...baseOptions, retrieveType, retrieveOptions, streamingData }; const priority = stage.priority ?? -5; const requestType = stage.requestType || _enums__WEBPACK_IMPORTED_MODULE_10__["default"].Interaction; const additionalDetails = { imageId }; _requestPool_imageLoadPoolManager__WEBPACK_IMPORTED_MODULE_8__["default"].addRequest(this.sendRequest.bind(this, request, options), requestType, additionalDetails, priority); } updateStageStatus(stage, failure, skipped = false) { const { id } = stage; const stageStatus = this.stageStatusMap.get(id); if (!stageStatus) { return; } stageStatus.imageLoadPendingCount--; if (failure) { stageStatus.imageLoadFailedCount++; } else if (!skipped) { stageStatus.totalImageCount++; } if (!skipped && !stageStatus.stageStartTime) { stageStatus.stageStartTime = Date.now(); } if (!stageStatus.imageLoadPendingCount) { const { imageLoadFailedCount: numberOfFailures, totalImageCount: numberOfImages, stageStartTime = Date.now(), startTime } = stageStatus; const detail = { stageId: id, numberOfFailures, numberOfImages, stageDurationInMS: stageStartTime ? Date.now() - stageStartTime : null, startDurationInMS: Date.now() - startTime }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_5__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_13__["default"], _enums__WEBPACK_IMPORTED_MODULE_9__["default"].IMAGE_RETRIEVAL_STAGE, detail); this.stageStatusMap.delete(id); } } createStageRequests() { const interleaved = new Array(); const imageRequests = new Map(); const addStageInstance = (stage, position) => { const index = position < 0 ? this.imageIds.length + position : position < 1 ? Math.floor((this.imageIds.length - 1) * position) : position; const imageId = this.imageIds[index]; if (!imageId) { throw new Error(`No value found to add to requests at ${position}`); } const request = { imageId, stage, index, nearbyRequests: this.findNearbyRequests(index, stage) }; this.addStageStatus(stage); const existingRequest = imageRequests.get(imageId); if (existingRequest) { existingRequest.next = request; } else { interleaved.push(request); } imageRequests.set(imageId, request); }; for (const stage of this.stages) { const indices = stage.positions || (0,_utilities_decimate__WEBPACK_IMPORTED_MODULE_7__["default"])(this.imageIds, stage.decimate || 1, stage.offset ?? 0); indices.forEach(index => { addStageInstance(stage, index); }); } return interleaved; } findNearbyRequests(index, stage) { const nearby = new Array(); if (!stage.nearbyFrames) { return nearby; } for (const nearbyItem of stage.nearbyFrames) { const nearbyIndex = index + nearbyItem.offset; if (nearbyIndex < 0 || nearbyIndex >= this.imageIds.length) { continue; } nearby.push({ itemId: this.imageIds[nearbyIndex], imageQualityStatus: nearbyItem.imageQualityStatus, index: nearbyIndex }); } return nearby; } addStageStatus(stage) { const { id } = stage; const stageStatus = this.stageStatusMap.get(id) || { stageId: id, startTime: Date.now(), stageStartTime: null, totalImageCount: 0, imageLoadFailedCount: 0, imageLoadPendingCount: 0 }; stageStatus.imageLoadPendingCount++; this.stageStatusMap.set(id, stageStatus); return stageStatus; } } function createProgressive(configuration) { return new ProgressiveRetrieveImages(configuration); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProgressiveRetrieveImages); /***/ }, /***/ 25179 /*!************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/loaders/configuration/interleavedRetrieve.js ***! \************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../enums */ 9742); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../enums */ 23995); const nearbyFrames = [{ offset: -1, imageQualityStatus: _enums__WEBPACK_IMPORTED_MODULE_1__["default"].ADJACENT_REPLICATE }, { offset: +1, imageQualityStatus: _enums__WEBPACK_IMPORTED_MODULE_1__["default"].ADJACENT_REPLICATE }, { offset: +2, imageQualityStatus: _enums__WEBPACK_IMPORTED_MODULE_1__["default"].FAR_REPLICATE }]; const interleavedRetrieveConfiguration = [{ id: 'initialImages', positions: [0.5, 0, -1], retrieveType: 'default', requestType: _enums__WEBPACK_IMPORTED_MODULE_0__["default"].Thumbnail, priority: 5, nearbyFrames }, { id: 'quarterThumb', decimate: 4, offset: 3, requestType: _enums__WEBPACK_IMPORTED_MODULE_0__["default"].Thumbnail, retrieveType: 'multipleFast', priority: 6, nearbyFrames }, { id: 'halfThumb', decimate: 4, offset: 1, priority: 7, requestType: _enums__WEBPACK_IMPORTED_MODULE_0__["default"].Thumbnail, retrieveType: 'multipleFast', nearbyFrames }, { id: 'quarterFull', decimate: 4, offset: 2, priority: 8, requestType: _enums__WEBPACK_IMPORTED_MODULE_0__["default"].Thumbnail, retrieveType: 'multipleFinal' }, { id: 'halfFull', decimate: 4, offset: 0, priority: 9, requestType: _enums__WEBPACK_IMPORTED_MODULE_0__["default"].Thumbnail, retrieveType: 'multipleFinal' }, { id: 'threeQuarterFull', decimate: 4, offset: 1, priority: 10, requestType: _enums__WEBPACK_IMPORTED_MODULE_0__["default"].Thumbnail, retrieveType: 'multipleFinal' }, { id: 'finalFull', decimate: 4, offset: 3, priority: 11, requestType: _enums__WEBPACK_IMPORTED_MODULE_0__["default"].Thumbnail, retrieveType: 'multipleFinal' }, { id: 'errorRetrieve' }]; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (interleavedRetrieveConfiguration); /***/ }, /***/ 21449 /*!***********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/loaders/configuration/sequentialRetrieve.js ***! \***********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); const sequentialRetrieveStages = [{ id: 'lossySequential', retrieveType: 'singleFast' }, { id: 'finalSequential', retrieveType: 'singleFinal' }]; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (sequentialRetrieveStages); /***/ }, /***/ 24134 /*!*******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/loaders/configuration/singleRetrieve.js ***! \*******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); const singleRetrieveStages = [{ id: 'initialImages', retrieveType: 'single' }]; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (singleRetrieveStages); /***/ }, /***/ 17291 /*!****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/loaders/cornerstoneStreamingImageVolumeLoader.js ***! \****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ cornerstoneStreamingImageVolumeLoader: () => (/* binding */ cornerstoneStreamingImageVolumeLoader) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../cache/cache */ 38277); /* harmony import */ var _cache_classes_StreamingImageVolume__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../cache/classes/StreamingImageVolume */ 86993); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../enums */ 9742); /* harmony import */ var _requestPool_imageLoadPoolManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../requestPool/imageLoadPoolManager */ 11062); /* harmony import */ var _utilities_generateVolumePropsFromImageIds__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utilities/generateVolumePropsFromImageIds */ 78621); /* harmony import */ var _imageLoader__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./imageLoader */ 96035); function cornerstoneStreamingImageVolumeLoader(volumeId, options) { if (!options || !options.imageIds || !options.imageIds.length) { throw new Error('ImageIds must be provided to create a streaming image volume'); } function getStreamingImageVolume() { return _getStreamingImageVolume.apply(this, arguments); } function _getStreamingImageVolume() { _getStreamingImageVolume = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { if (options.imageIds[0].split(':')[0] === 'wadouri') { const [middleImageIndex, lastImageIndex] = [Math.floor(options.imageIds.length / 2), options.imageIds.length - 1]; const indexesToPrefetch = [0, middleImageIndex, lastImageIndex]; yield Promise.all(indexesToPrefetch.map(index => { if (_cache_cache__WEBPACK_IMPORTED_MODULE_1__["default"].isLoaded(options.imageIds[index])) { return Promise.resolve(true); } return new Promise((resolve, reject) => { const imageId = options.imageIds[index]; _requestPool_imageLoadPoolManager__WEBPACK_IMPORTED_MODULE_4__["default"].addRequest(/*#__PURE__*/(0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { (0,_imageLoader__WEBPACK_IMPORTED_MODULE_6__.loadImage)(imageId).then(() => { console.log(`Prefetched imageId: ${imageId}`); resolve(true); }).catch(err => { reject(err); }); }), _enums__WEBPACK_IMPORTED_MODULE_3__["default"].Prefetch, { volumeId }, 1); }); })).catch(console.error); } const volumeProps = (0,_utilities_generateVolumePropsFromImageIds__WEBPACK_IMPORTED_MODULE_5__.generateVolumePropsFromImageIds)(options.imageIds, volumeId); const { dimensions, spacing, origin, direction, metadata, imageIds, dataType, numberOfComponents } = volumeProps; const streamingImageVolume = new _cache_classes_StreamingImageVolume__WEBPACK_IMPORTED_MODULE_2__["default"]({ volumeId, metadata, dimensions, spacing, origin, direction, imageIds, dataType, numberOfComponents }, { imageIds, loadStatus: { loaded: false, loading: false, cancelled: false, cachedFrames: [], callbacks: [] } }); return streamingImageVolume; }); return _getStreamingImageVolume.apply(this, arguments); } const streamingImageVolumePromise = getStreamingImageVolume(); return { promise: streamingImageVolumePromise, decache: () => { streamingImageVolumePromise.then(streamingImageVolume => { streamingImageVolume.destroy(); streamingImageVolume = null; }); }, cancel: () => { streamingImageVolumePromise.then(streamingImageVolume => { streamingImageVolume.cancelLoading(); }); } }; } /***/ }, /***/ 93141 /*!*******************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/loaders/fillNearbyFrames.js ***! \*******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ fillNearbyFrames: () => (/* binding */ fillNearbyFrames) /* harmony export */ }); /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../cache/cache */ 38277); function fillNearbyFrames(listener, request, image) { if (!request?.nearbyRequests?.length) { return; } for (const nearbyItem of request.nearbyRequests) { try { const { itemId: targetId, imageQualityStatus } = nearbyItem; const currentStatus = _cache_cache__WEBPACK_IMPORTED_MODULE_0__["default"].getImageQuality(targetId); if (currentStatus !== undefined && currentStatus >= imageQualityStatus) { continue; } const nearbyImage = { ...image, imageId: targetId, imageQualityStatus }; _cache_cache__WEBPACK_IMPORTED_MODULE_0__["default"].setPartialImage(targetId, nearbyImage); listener.successCallback(targetId, nearbyImage); } catch (e) { console.warn("Couldn't fill nearby item ", nearbyItem.itemId, e); } } } /***/ }, /***/ 96035 /*!**************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/loaders/imageLoader.js ***! \**************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ cancelLoadAll: () => (/* binding */ cancelLoadAll), /* harmony export */ cancelLoadImage: () => (/* binding */ cancelLoadImage), /* harmony export */ cancelLoadImages: () => (/* binding */ cancelLoadImages), /* harmony export */ createAndCacheDerivedImage: () => (/* binding */ createAndCacheDerivedImage), /* harmony export */ createAndCacheDerivedImages: () => (/* binding */ createAndCacheDerivedImages), /* harmony export */ createAndCacheDerivedLabelmapImage: () => (/* binding */ createAndCacheDerivedLabelmapImage), /* harmony export */ createAndCacheDerivedLabelmapImages: () => (/* binding */ createAndCacheDerivedLabelmapImages), /* harmony export */ createAndCacheLocalImage: () => (/* binding */ createAndCacheLocalImage), /* harmony export */ loadAndCacheImage: () => (/* binding */ loadAndCacheImage), /* harmony export */ loadAndCacheImages: () => (/* binding */ loadAndCacheImages), /* harmony export */ loadImage: () => (/* binding */ loadImage), /* harmony export */ registerImageLoader: () => (/* binding */ registerImageLoader), /* harmony export */ registerUnknownImageLoader: () => (/* binding */ registerUnknownImageLoader), /* harmony export */ unregisterAllImageLoaders: () => (/* binding */ unregisterAllImageLoaders) /* harmony export */ }); /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../cache/cache */ 38277); /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums/Events */ 14566); /* harmony import */ var _eventTarget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../eventTarget */ 28699); /* harmony import */ var _utilities_genericMetadataProvider__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utilities/genericMetadataProvider */ 11468); /* harmony import */ var _utilities_getBufferConfiguration__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utilities/getBufferConfiguration */ 96593); /* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utilities/triggerEvent */ 91133); /* harmony import */ var _utilities_uuidv4__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utilities/uuidv4 */ 29760); /* harmony import */ var _utilities_VoxelManager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utilities/VoxelManager */ 14430); /* harmony import */ var _requestPool_imageLoadPoolManager__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../requestPool/imageLoadPoolManager */ 11062); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../metaData */ 90161); /* harmony import */ var _enums_VoxelManagerEnum__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../enums/VoxelManagerEnum */ 94265); const imageLoaders = {}; let unknownImageLoader; function loadImageFromImageLoader(imageId, options) { const cachedImageLoadObject = _cache_cache__WEBPACK_IMPORTED_MODULE_0__["default"].getImageLoadObject(imageId); if (cachedImageLoadObject) { handleImageLoadPromise(cachedImageLoadObject.promise, imageId); return cachedImageLoadObject; } const scheme = imageId.split(':')[0]; const loader = imageLoaders[scheme] || unknownImageLoader; if (!loader) { throw new Error(`loadImageFromImageLoader: No image loader found for scheme '${scheme}'`); } const imageLoadObject = loader(imageId, options); handleImageLoadPromise(imageLoadObject.promise, imageId); return imageLoadObject; } function handleImageLoadPromise(imagePromise, imageId) { Promise.resolve(imagePromise).then(image => { ensureVoxelManager(image); (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_5__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_2__["default"], _enums_Events__WEBPACK_IMPORTED_MODULE_1__["default"].IMAGE_LOADED, { image }); }).catch(error => { const errorDetails = { imageId, error }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_5__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_2__["default"], _enums_Events__WEBPACK_IMPORTED_MODULE_1__["default"].IMAGE_LOAD_FAILED, errorDetails); }); } function ensureVoxelManager(image) { if (!image.voxelManager) { const { width, height, numberOfComponents } = image; const voxelManager = _utilities_VoxelManager__WEBPACK_IMPORTED_MODULE_7__["default"].createImageVoxelManager({ scalarData: image.getPixelData(), width, height, numberOfComponents }); image.voxelManager = voxelManager; image.getPixelData = () => voxelManager.getScalarData(); delete image.imageFrame.pixelData; } } function loadImage(imageId, options = { priority: 0, requestType: 'prefetch' }) { if (imageId === undefined) { throw new Error('loadImage: parameter imageId must not be undefined'); } return loadImageFromImageLoader(imageId, options).promise; } function loadAndCacheImage(imageId, options = { priority: 0, requestType: 'prefetch' }) { if (imageId === undefined) { throw new Error('loadAndCacheImage: parameter imageId must not be undefined'); } const imageLoadObject = loadImageFromImageLoader(imageId, options); if (!_cache_cache__WEBPACK_IMPORTED_MODULE_0__["default"].getImageLoadObject(imageId)) { _cache_cache__WEBPACK_IMPORTED_MODULE_0__["default"].putImageLoadObject(imageId, imageLoadObject); } return imageLoadObject.promise; } function loadAndCacheImages(imageIds, options = { priority: 0, requestType: 'prefetch' }) { if (!imageIds || imageIds.length === 0) { throw new Error('loadAndCacheImages: parameter imageIds must be list of image Ids'); } const allPromises = imageIds.map(imageId => { return loadAndCacheImage(imageId, options); }); return allPromises; } function createAndCacheDerivedImage(referencedImageId, options = {}) { if (referencedImageId === undefined) { throw new Error('createAndCacheDerivedImage: parameter imageId must not be undefined'); } if (options.imageId === undefined) { options.imageId = `derived:${(0,_utilities_uuidv4__WEBPACK_IMPORTED_MODULE_6__["default"])()}`; } const { imageId, skipCreateBuffer, onCacheAdd, voxelRepresentation } = options; const imagePlaneModule = _metaData__WEBPACK_IMPORTED_MODULE_9__.get('imagePlaneModule', referencedImageId); const length = imagePlaneModule.rows * imagePlaneModule.columns; const { TypedArrayConstructor } = (0,_utilities_getBufferConfiguration__WEBPACK_IMPORTED_MODULE_4__.getBufferConfiguration)(options.targetBuffer?.type, length); const imageScalarData = new TypedArrayConstructor(skipCreateBuffer ? 1 : length); const derivedImageId = imageId; const referencedImagePlaneMetadata = _metaData__WEBPACK_IMPORTED_MODULE_9__.get('imagePlaneModule', referencedImageId); _utilities_genericMetadataProvider__WEBPACK_IMPORTED_MODULE_3__["default"].add(derivedImageId, { type: 'imagePlaneModule', metadata: referencedImagePlaneMetadata }); const referencedImageGeneralSeriesMetadata = _metaData__WEBPACK_IMPORTED_MODULE_9__.get('generalSeriesModule', referencedImageId); _utilities_genericMetadataProvider__WEBPACK_IMPORTED_MODULE_3__["default"].add(derivedImageId, { type: 'generalSeriesModule', metadata: referencedImageGeneralSeriesMetadata }); _utilities_genericMetadataProvider__WEBPACK_IMPORTED_MODULE_3__["default"].add(derivedImageId, { type: 'generalImageModule', metadata: { instanceNumber: options.instanceNumber } }); const imagePixelModule = _metaData__WEBPACK_IMPORTED_MODULE_9__.get('imagePixelModule', referencedImageId); _utilities_genericMetadataProvider__WEBPACK_IMPORTED_MODULE_3__["default"].add(derivedImageId, { type: 'imagePixelModule', metadata: { ...imagePixelModule, bitsAllocated: 8, bitsStored: 8, highBit: 7, samplesPerPixel: 1, pixelRepresentation: 0 } }); const localImage = createAndCacheLocalImage(imageId, { scalarData: imageScalarData, onCacheAdd, skipCreateBuffer, targetBuffer: { type: imageScalarData.constructor.name }, voxelRepresentation, dimensions: [imagePlaneModule.columns, imagePlaneModule.rows], spacing: [imagePlaneModule.columnPixelSpacing, imagePlaneModule.rowPixelSpacing], origin: imagePlaneModule.imagePositionPatient, direction: imagePlaneModule.imageOrientationPatient, frameOfReferenceUID: imagePlaneModule.frameOfReferenceUID, referencedImageId: referencedImageId }); localImage.referencedImageId = referencedImageId; if (!_cache_cache__WEBPACK_IMPORTED_MODULE_0__["default"].getImageLoadObject(imageId)) { _cache_cache__WEBPACK_IMPORTED_MODULE_0__["default"].putImageSync(imageId, localImage); } return localImage; } function createAndCacheDerivedImages(referencedImageIds, options = {}) { if (referencedImageIds.length === 0) { throw new Error('createAndCacheDerivedImages: parameter imageIds must be list of image Ids'); } const derivedImageIds = []; const images = referencedImageIds.map((referencedImageId, index) => { const newOptions = { imageId: options?.getDerivedImageId?.(referencedImageId) || `derived:${(0,_utilities_uuidv4__WEBPACK_IMPORTED_MODULE_6__["default"])()}`, ...options }; derivedImageIds.push(newOptions.imageId); return createAndCacheDerivedImage(referencedImageId, { ...newOptions, instanceNumber: index + 1 }); }); return images; } function createAndCacheLocalImage(imageId, options) { const { scalarData, origin, direction, targetBuffer, skipCreateBuffer, onCacheAdd, frameOfReferenceUID, voxelRepresentation, referencedImageId } = options; const dimensions = options.dimensions; const spacing = options.spacing; if (!dimensions || !spacing) { throw new Error('createAndCacheLocalImage: dimensions and spacing are required'); } const width = dimensions[0]; const height = dimensions[1]; const columnPixelSpacing = spacing[0]; const rowPixelSpacing = spacing[1]; const imagePlaneModule = { frameOfReferenceUID, rows: height, columns: width, imageOrientationPatient: direction ?? [1, 0, 0, 0, 1, 0], rowCosines: direction ? direction.slice(0, 3) : [1, 0, 0], columnCosines: direction ? direction.slice(3, 6) : [0, 1, 0], imagePositionPatient: origin ?? [0, 0, 0], pixelSpacing: [rowPixelSpacing, columnPixelSpacing], rowPixelSpacing: rowPixelSpacing, columnPixelSpacing: columnPixelSpacing }; const length = width * height; const numberOfComponents = scalarData.length / length; let scalarDataToUse; if (scalarData) { if (!(scalarData instanceof Uint8Array || scalarData instanceof Float32Array || scalarData instanceof Uint16Array || scalarData instanceof Int16Array)) { throw new Error('createAndCacheLocalImage: scalarData must be of type Uint8Array, Uint16Array, Int16Array or Float32Array'); } scalarDataToUse = scalarData; } else if (!skipCreateBuffer) { const { TypedArrayConstructor } = (0,_utilities_getBufferConfiguration__WEBPACK_IMPORTED_MODULE_4__.getBufferConfiguration)(targetBuffer?.type, length); const imageScalarData = new TypedArrayConstructor(length); scalarDataToUse = imageScalarData; } let bitsAllocated, bitsStored, highBit; if (scalarDataToUse instanceof Uint8Array) { bitsAllocated = 8; bitsStored = 8; highBit = 7; } else if (scalarDataToUse instanceof Uint16Array) { bitsAllocated = 16; bitsStored = 16; highBit = 15; } else if (scalarDataToUse instanceof Int16Array) { bitsAllocated = 16; bitsStored = 16; highBit = 15; } else if (scalarDataToUse instanceof Float32Array) { bitsAllocated = 32; bitsStored = 32; highBit = 31; } else { throw new Error('Unsupported scalarData type'); } const imagePixelModule = { samplesPerPixel: 1, photometricInterpretation: scalarDataToUse.length > dimensions[0] * dimensions[1] ? 'RGB' : 'MONOCHROME2', rows: height, columns: width, bitsAllocated, bitsStored, highBit }; const metadata = { imagePlaneModule, imagePixelModule }; ['imagePlaneModule', 'imagePixelModule'].forEach(type => { _utilities_genericMetadataProvider__WEBPACK_IMPORTED_MODULE_3__["default"].add(imageId, { type, metadata: metadata[type] || {} }); }); const id = imageId; const voxelManager = voxelRepresentation === _enums_VoxelManagerEnum__WEBPACK_IMPORTED_MODULE_10__["default"].RLE && _utilities_VoxelManager__WEBPACK_IMPORTED_MODULE_7__["default"].createRLEImageVoxelManager({ dimensions, id }) || _utilities_VoxelManager__WEBPACK_IMPORTED_MODULE_7__["default"].createImageVoxelManager({ height, width, numberOfComponents, scalarData: scalarDataToUse, id }); let minPixelValue = scalarDataToUse[0]; let maxPixelValue = scalarDataToUse[0]; for (let i = 1; i < scalarDataToUse.length; i++) { if (scalarDataToUse[i] < minPixelValue) { minPixelValue = scalarDataToUse[i]; } if (scalarDataToUse[i] > maxPixelValue) { maxPixelValue = scalarDataToUse[i]; } } const image = { imageId: imageId, intercept: 0, windowCenter: 0, windowWidth: 0, color: imagePixelModule.photometricInterpretation === 'RGB', numberOfComponents: imagePixelModule.samplesPerPixel, dataType: targetBuffer?.type, slope: 1, minPixelValue, maxPixelValue, rows: imagePixelModule.rows, columns: imagePixelModule.columns, getCanvas: undefined, height: imagePixelModule.rows, width: imagePixelModule.columns, rgba: undefined, columnPixelSpacing: imagePlaneModule.columnPixelSpacing, rowPixelSpacing: imagePlaneModule.rowPixelSpacing, FrameOfReferenceUID: imagePlaneModule.frameOfReferenceUID, invert: false, getPixelData: () => voxelManager.getScalarData(), voxelManager, sizeInBytes: scalarData.byteLength, referencedImageId }; onCacheAdd?.(image); _cache_cache__WEBPACK_IMPORTED_MODULE_0__["default"].putImageSync(image.imageId, image); return image; } function cancelLoadImage(imageId) { const filterFunction = ({ additionalDetails }) => { if (additionalDetails.imageId) { return additionalDetails.imageId !== imageId; } return true; }; _requestPool_imageLoadPoolManager__WEBPACK_IMPORTED_MODULE_8__["default"].filterRequests(filterFunction); const imageLoadObject = _cache_cache__WEBPACK_IMPORTED_MODULE_0__["default"].getImageLoadObject(imageId); if (imageLoadObject) { imageLoadObject.cancelFn(); } } function cancelLoadImages(imageIds) { imageIds.forEach(imageId => { cancelLoadImage(imageId); }); } function cancelLoadAll() { const requestPool = _requestPool_imageLoadPoolManager__WEBPACK_IMPORTED_MODULE_8__["default"].getRequestPool(); Object.keys(requestPool).forEach(type => { const requests = requestPool[type]; Object.keys(requests).forEach(priority => { const requestDetails = requests[priority].pop(); if (!requestDetails) { return; } const additionalDetails = requestDetails.additionalDetails; const { imageId, volumeId } = additionalDetails; let loadObject; if (imageId) { loadObject = _cache_cache__WEBPACK_IMPORTED_MODULE_0__["default"].getImageLoadObject(imageId); } else if (volumeId) { loadObject = _cache_cache__WEBPACK_IMPORTED_MODULE_0__["default"].getVolumeLoadObject(volumeId); } if (loadObject) { loadObject.cancel(); } }); _requestPool_imageLoadPoolManager__WEBPACK_IMPORTED_MODULE_8__["default"].clearRequestStack(type); }); } function registerImageLoader(scheme, imageLoader) { imageLoaders[scheme] = imageLoader; } function registerUnknownImageLoader(imageLoader) { const oldImageLoader = unknownImageLoader; unknownImageLoader = imageLoader; return oldImageLoader; } function unregisterAllImageLoaders() { Object.keys(imageLoaders).forEach(imageLoader => delete imageLoaders[imageLoader]); unknownImageLoader = undefined; } function createAndCacheDerivedLabelmapImages(referencedImageIds, options = {}) { return createAndCacheDerivedImages(referencedImageIds, { ...options, targetBuffer: { type: 'Uint8Array' } }); } function createAndCacheDerivedLabelmapImage(referencedImageId, options = {}) { return createAndCacheDerivedImage(referencedImageId, { ...options, targetBuffer: { type: 'Uint8Array' } }); } /***/ }, /***/ 10372 /*!***************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/loaders/volumeLoader.js ***! \***************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ createAndCacheDerivedLabelmapVolume: () => (/* binding */ createAndCacheDerivedLabelmapVolume), /* harmony export */ createAndCacheDerivedVolume: () => (/* binding */ createAndCacheDerivedVolume), /* harmony export */ createAndCacheVolume: () => (/* binding */ createAndCacheVolume), /* harmony export */ createAndCacheVolumeFromImages: () => (/* binding */ createAndCacheVolumeFromImages), /* harmony export */ createAndCacheVolumeFromImagesSync: () => (/* binding */ createAndCacheVolumeFromImagesSync), /* harmony export */ createLocalLabelmapVolume: () => (/* binding */ createLocalLabelmapVolume), /* harmony export */ createLocalVolume: () => (/* binding */ createLocalVolume), /* harmony export */ getUnknownVolumeLoaderSchema: () => (/* binding */ getUnknownVolumeLoaderSchema), /* harmony export */ getVolumeLoaderSchemes: () => (/* binding */ getVolumeLoaderSchemes), /* harmony export */ loadVolume: () => (/* binding */ loadVolume), /* harmony export */ registerUnknownVolumeLoader: () => (/* binding */ registerUnknownVolumeLoader), /* harmony export */ registerVolumeLoader: () => (/* binding */ registerVolumeLoader) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _kitware_vtk_js_Rendering_Profiles_Volume__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Profiles/Volume */ 33721); /* harmony import */ var _cache_classes_ImageVolume__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../cache/classes/ImageVolume */ 92367); /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../cache/cache */ 38277); /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../enums/Events */ 14566); /* harmony import */ var _eventTarget__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../eventTarget */ 28699); /* harmony import */ var _utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../utilities/triggerEvent */ 91133); /* harmony import */ var _utilities_uuidv4__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utilities/uuidv4 */ 29760); /* harmony import */ var _utilities_VoxelManager__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utilities/VoxelManager */ 14430); /* harmony import */ var _imageLoader__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./imageLoader */ 96035); /* harmony import */ var _utilities_generateVolumePropsFromImageIds__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utilities/generateVolumePropsFromImageIds */ 78621); /* harmony import */ var _cornerstoneStreamingImageVolumeLoader__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./cornerstoneStreamingImageVolumeLoader */ 17291); const volumeLoaders = {}; let unknownVolumeLoader = _cornerstoneStreamingImageVolumeLoader__WEBPACK_IMPORTED_MODULE_11__.cornerstoneStreamingImageVolumeLoader; function loadVolumeFromVolumeLoader(volumeId, options) { const colonIndex = volumeId.indexOf(':'); const scheme = volumeId.substring(0, colonIndex); let loader = volumeLoaders[scheme]; if (loader === undefined || loader === null) { if (unknownVolumeLoader == null || typeof unknownVolumeLoader !== 'function') { throw new Error(`No volume loader for scheme ${scheme} has been registered`); } loader = unknownVolumeLoader; } const volumeLoadObject = loader(volumeId, options); volumeLoadObject.promise.then(function (volume) { (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_6__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_5__["default"], _enums_Events__WEBPACK_IMPORTED_MODULE_4__["default"].VOLUME_LOADED, { volume }); }, function (error) { const errorObject = { volumeId, error }; (0,_utilities_triggerEvent__WEBPACK_IMPORTED_MODULE_6__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_5__["default"], _enums_Events__WEBPACK_IMPORTED_MODULE_4__["default"].VOLUME_LOADED_FAILED, errorObject); }); return volumeLoadObject; } function loadVolume(volumeId, options = { imageIds: [] }) { if (volumeId === undefined) { throw new Error('loadVolume: parameter volumeId must not be undefined'); } let volumeLoadObject = _cache_cache__WEBPACK_IMPORTED_MODULE_3__["default"].getVolumeLoadObject(volumeId); if (volumeLoadObject !== undefined) { return volumeLoadObject.promise; } volumeLoadObject = loadVolumeFromVolumeLoader(volumeId, options); return volumeLoadObject.promise.then(volume => { return volume; }); } function createAndCacheVolume(_x, _x2) { return _createAndCacheVolume.apply(this, arguments); } function _createAndCacheVolume() { _createAndCacheVolume = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (volumeId, options) { if (volumeId === undefined) { throw new Error('createAndCacheVolume: parameter volumeId must not be undefined'); } let volumeLoadObject = _cache_cache__WEBPACK_IMPORTED_MODULE_3__["default"].getVolumeLoadObject(volumeId); if (volumeLoadObject !== undefined) { return volumeLoadObject.promise; } volumeLoadObject = loadVolumeFromVolumeLoader(volumeId, options); _cache_cache__WEBPACK_IMPORTED_MODULE_3__["default"].putVolumeLoadObject(volumeId, volumeLoadObject); return volumeLoadObject.promise; }); return _createAndCacheVolume.apply(this, arguments); } function createAndCacheDerivedVolume(referencedVolumeId, options) { const referencedVolume = _cache_cache__WEBPACK_IMPORTED_MODULE_3__["default"].getVolume(referencedVolumeId); if (!referencedVolume) { throw new Error(`Cannot created derived volume: Referenced volume with id ${referencedVolumeId} does not exist.`); } let { volumeId } = options; const { voxelRepresentation } = options; if (volumeId === undefined) { volumeId = (0,_utilities_uuidv4__WEBPACK_IMPORTED_MODULE_7__["default"])(); } const { metadata, dimensions, spacing, origin, direction } = referencedVolume; const referencedImageIds = referencedVolume.isDynamicVolume() ? referencedVolume.getCurrentDimensionGroupImageIds() : referencedVolume.imageIds ?? []; const derivedImages = (0,_imageLoader__WEBPACK_IMPORTED_MODULE_9__.createAndCacheDerivedImages)(referencedImageIds, { targetBuffer: options.targetBuffer, voxelRepresentation }); const dataType = derivedImages[0].dataType; const derivedVolumeImageIds = derivedImages.map(image => image.imageId); const derivedVolume = new _cache_classes_ImageVolume__WEBPACK_IMPORTED_MODULE_2__.ImageVolume({ volumeId, dataType, metadata: structuredClone(metadata), dimensions: [dimensions[0], dimensions[1], dimensions[2]], spacing, origin, direction, referencedVolumeId, imageIds: derivedVolumeImageIds, referencedImageIds: referencedVolume.imageIds ?? [] }); _cache_cache__WEBPACK_IMPORTED_MODULE_3__["default"].putVolumeSync(volumeId, derivedVolume); return derivedVolume; } function createAndCacheVolumeFromImages(_x3, _x4) { return _createAndCacheVolumeFromImages.apply(this, arguments); } function _createAndCacheVolumeFromImages() { _createAndCacheVolumeFromImages = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (volumeId, imageIds) { if (imageIds === undefined) { throw new Error('createAndCacheVolumeFromImages: parameter imageIds must not be undefined'); } if (volumeId === undefined) { throw new Error('createAndCacheVolumeFromImages: parameter volumeId must not be undefined'); } const cachedVolume = _cache_cache__WEBPACK_IMPORTED_MODULE_3__["default"].getVolume(volumeId); if (cachedVolume) { return cachedVolume; } const imageIdsToLoad = imageIds.filter(imageId => !_cache_cache__WEBPACK_IMPORTED_MODULE_3__["default"].getImage(imageId)); if (imageIdsToLoad.length === 0) { return createAndCacheVolumeFromImagesSync(volumeId, imageIds); } const volume = yield createAndCacheVolume(volumeId, { imageIds }); return volume; }); return _createAndCacheVolumeFromImages.apply(this, arguments); } function createAndCacheVolumeFromImagesSync(volumeId, imageIds) { if (imageIds === undefined) { throw new Error('createAndCacheVolumeFromImagesSync: parameter imageIds must not be undefined'); } if (volumeId === undefined) { throw new Error('createAndCacheVolumeFromImagesSync: parameter volumeId must not be undefined'); } const cachedVolume = _cache_cache__WEBPACK_IMPORTED_MODULE_3__["default"].getVolume(volumeId); if (cachedVolume) { return cachedVolume; } const volumeProps = (0,_utilities_generateVolumePropsFromImageIds__WEBPACK_IMPORTED_MODULE_10__.generateVolumePropsFromImageIds)(imageIds, volumeId); const derivedVolume = new _cache_classes_ImageVolume__WEBPACK_IMPORTED_MODULE_2__.ImageVolume({ volumeId, dataType: volumeProps.dataType, metadata: structuredClone(volumeProps.metadata), dimensions: volumeProps.dimensions, spacing: volumeProps.spacing, origin: volumeProps.origin, direction: volumeProps.direction, referencedVolumeId: volumeProps.referencedVolumeId, imageIds: volumeProps.imageIds, referencedImageIds: volumeProps.referencedImageIds }); _cache_cache__WEBPACK_IMPORTED_MODULE_3__["default"].putVolumeSync(volumeId, derivedVolume); return derivedVolume; } function createLocalVolume(volumeId, options = {}) { const { metadata, dimensions, spacing, origin, direction, scalarData, targetBuffer, preventCache = false } = options; const cachedVolume = _cache_cache__WEBPACK_IMPORTED_MODULE_3__["default"].getVolume(volumeId); if (cachedVolume) { return cachedVolume; } const sliceLength = dimensions[0] * dimensions[1]; const dataType = scalarData ? scalarData.constructor.name : targetBuffer?.type ?? 'Float32Array'; const totalNumberOfVoxels = sliceLength * dimensions[2]; let byteLength; switch (dataType) { case 'Uint8Array': case 'Int8Array': byteLength = totalNumberOfVoxels; break; case 'Uint16Array': case 'Int16Array': byteLength = totalNumberOfVoxels * 2; break; case 'Float32Array': byteLength = totalNumberOfVoxels * 4; break; } const isCacheable = _cache_cache__WEBPACK_IMPORTED_MODULE_3__["default"].isCacheable(byteLength); if (!isCacheable) { throw new Error(`Cannot created derived volume: Volume with id ${volumeId} is not cacheable.`); } const imageIds = []; const derivedImages = []; for (let i = 0; i < dimensions[2]; i++) { const imageId = `${volumeId}_slice_${i}`; imageIds.push(imageId); const sliceData = scalarData.subarray(i * sliceLength, (i + 1) * sliceLength); const derivedImage = (0,_imageLoader__WEBPACK_IMPORTED_MODULE_9__.createAndCacheLocalImage)(imageId, { scalarData: sliceData, dimensions: [dimensions[0], dimensions[1]], spacing: [spacing[0], spacing[1]], origin, direction, targetBuffer: { type: dataType } }); derivedImages.push(derivedImage); } const imageVolume = new _cache_classes_ImageVolume__WEBPACK_IMPORTED_MODULE_2__.ImageVolume({ volumeId, metadata: structuredClone(metadata), dimensions: [dimensions[0], dimensions[1], dimensions[2]], spacing, origin, direction, imageIds, dataType }); const voxelManager = _utilities_VoxelManager__WEBPACK_IMPORTED_MODULE_8__["default"].createImageVolumeVoxelManager({ imageIds, dimensions, numberOfComponents: 1, id: volumeId }); imageVolume.voxelManager = voxelManager; if (!preventCache) { _cache_cache__WEBPACK_IMPORTED_MODULE_3__["default"].putVolumeSync(volumeId, imageVolume); } return imageVolume; } function registerVolumeLoader(scheme, volumeLoader) { volumeLoaders[scheme] = volumeLoader; } function getVolumeLoaderSchemes() { return Object.keys(volumeLoaders); } function registerUnknownVolumeLoader(volumeLoader) { const oldVolumeLoader = unknownVolumeLoader; unknownVolumeLoader = volumeLoader; return oldVolumeLoader; } function getUnknownVolumeLoaderSchema() { return unknownVolumeLoader.name; } function createAndCacheDerivedLabelmapVolume(referencedVolumeId, options = {}) { return createAndCacheDerivedVolume(referencedVolumeId, { ...options, targetBuffer: { type: 'Uint8Array', ...options?.targetBuffer } }); } function createLocalLabelmapVolume(options, volumeId, preventCache = false) { if (!options.scalarData) { options.scalarData = new Uint8Array(options.dimensions[0] * options.dimensions[1] * options.dimensions[2]); } return createLocalVolume(volumeId, { ...options, preventCache }); } /***/ }, /***/ 90161 /*!***************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/metaData.js ***! \***************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ addProvider: () => (/* binding */ addProvider), /* harmony export */ get: () => (/* binding */ getMetaData), /* harmony export */ getNormalized: () => (/* binding */ getNormalized), /* harmony export */ removeAllProviders: () => (/* binding */ removeAllProviders), /* harmony export */ removeProvider: () => (/* binding */ removeProvider), /* harmony export */ toLowerCamelTag: () => (/* binding */ toLowerCamelTag), /* harmony export */ toUpperCamelTag: () => (/* binding */ toUpperCamelTag) /* harmony export */ }); const providers = []; function addProvider(provider, priority = 0) { let i; for (i = 0; i < providers.length; i++) { if (providers[i].priority <= priority) { break; } } providers.splice(i, 0, { priority, provider }); } function removeProvider(provider) { for (let i = 0; i < providers.length; i++) { if (providers[i].provider === provider) { providers.splice(i, 1); break; } } } function removeAllProviders() { while (providers.length > 0) { providers.pop(); } } function getMetaData(type, ...queries) { for (let i = 0; i < providers.length; i++) { const result = providers[i].provider(type, ...queries); if (result !== undefined) { return result; } } } function getNormalized(imageId, types, metaDataProvider = getMetaData) { const result = {}; for (const t of types) { try { const data = metaDataProvider(t, imageId); if (data) { const capitalizedData = {}; for (const key in data) { if (key in data) { const capitalizedKey = toUpperCamelTag(key); capitalizedData[capitalizedKey] = data[key]; } } Object.assign(result, capitalizedData); } } catch (error) { console.error(`Error retrieving ${t} data:`, error); } } return result; } const toUpperCamelTag = tag => { if (tag.startsWith('sop')) { return `SOP${tag.substring(3)}`; } if (tag.endsWith('Id')) { tag = `${tag.substring(0, tag.length - 2)}ID`; } return tag.charAt(0).toUpperCase() + tag.slice(1); }; const toLowerCamelTag = tag => { if (tag.startsWith('SOP')) { return `sop${tag.substring(3)}`; } if (tag.endsWith('ID')) { tag = `${tag.substring(0, tag.length - 2)}Id`; } return tag.charAt(0).toLowerCase() + tag.slice(1); }; /***/ }, /***/ 11062 /*!***************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/requestPool/imageLoadPoolManager.js ***! \***************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _requestPoolManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./requestPoolManager */ 36158); /* harmony import */ var _enums_RequestType__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums/RequestType */ 9742); const imageLoadPoolManager = new _requestPoolManager__WEBPACK_IMPORTED_MODULE_0__.RequestPoolManager('imageLoadPool'); imageLoadPoolManager.grabDelay = 0; imageLoadPoolManager.setMaxSimultaneousRequests(_enums_RequestType__WEBPACK_IMPORTED_MODULE_1__["default"].Interaction, 1000); imageLoadPoolManager.setMaxSimultaneousRequests(_enums_RequestType__WEBPACK_IMPORTED_MODULE_1__["default"].Thumbnail, 1000); imageLoadPoolManager.setMaxSimultaneousRequests(_enums_RequestType__WEBPACK_IMPORTED_MODULE_1__["default"].Prefetch, 1000); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (imageLoadPoolManager); /***/ }, /***/ 85910 /*!********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/requestPool/imageRetrievalPoolManager.js ***! \********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _requestPoolManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./requestPoolManager */ 36158); /* harmony import */ var _enums_RequestType__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums/RequestType */ 9742); const imageRetrievalPoolManager = new _requestPoolManager__WEBPACK_IMPORTED_MODULE_0__.RequestPoolManager('imageRetrievalPool'); imageRetrievalPoolManager.setMaxSimultaneousRequests(_enums_RequestType__WEBPACK_IMPORTED_MODULE_1__["default"].Interaction, 200); imageRetrievalPoolManager.setMaxSimultaneousRequests(_enums_RequestType__WEBPACK_IMPORTED_MODULE_1__["default"].Thumbnail, 200); imageRetrievalPoolManager.setMaxSimultaneousRequests(_enums_RequestType__WEBPACK_IMPORTED_MODULE_1__["default"].Prefetch, 200); imageRetrievalPoolManager.grabDelay = 0; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (imageRetrievalPoolManager); /***/ }, /***/ 36158 /*!*************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/requestPool/requestPoolManager.js ***! \*************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ RequestPoolManager: () => (/* binding */ RequestPoolManager) /* harmony export */ }); /* harmony import */ var _enums_RequestType__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums/RequestType */ 9742); /* harmony import */ var _utilities_uuidv4__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utilities/uuidv4 */ 29760); class RequestPoolManager { constructor(id) { this.numRequests = { [_enums_RequestType__WEBPACK_IMPORTED_MODULE_0__["default"].Interaction]: 0, [_enums_RequestType__WEBPACK_IMPORTED_MODULE_0__["default"].Thumbnail]: 0, [_enums_RequestType__WEBPACK_IMPORTED_MODULE_0__["default"].Prefetch]: 0, [_enums_RequestType__WEBPACK_IMPORTED_MODULE_0__["default"].Compute]: 0 }; this.id = id ? id : (0,_utilities_uuidv4__WEBPACK_IMPORTED_MODULE_1__["default"])(); this.requestPool = { [_enums_RequestType__WEBPACK_IMPORTED_MODULE_0__["default"].Interaction]: { 0: [] }, [_enums_RequestType__WEBPACK_IMPORTED_MODULE_0__["default"].Thumbnail]: { 0: [] }, [_enums_RequestType__WEBPACK_IMPORTED_MODULE_0__["default"].Prefetch]: { 0: [] }, [_enums_RequestType__WEBPACK_IMPORTED_MODULE_0__["default"].Compute]: { 0: [] } }; this.grabDelay = 5; this.awake = false; this.numRequests = { [_enums_RequestType__WEBPACK_IMPORTED_MODULE_0__["default"].Interaction]: 0, [_enums_RequestType__WEBPACK_IMPORTED_MODULE_0__["default"].Thumbnail]: 0, [_enums_RequestType__WEBPACK_IMPORTED_MODULE_0__["default"].Prefetch]: 0, [_enums_RequestType__WEBPACK_IMPORTED_MODULE_0__["default"].Compute]: 0 }; this.maxNumRequests = { [_enums_RequestType__WEBPACK_IMPORTED_MODULE_0__["default"].Interaction]: 6, [_enums_RequestType__WEBPACK_IMPORTED_MODULE_0__["default"].Thumbnail]: 6, [_enums_RequestType__WEBPACK_IMPORTED_MODULE_0__["default"].Prefetch]: 5, [_enums_RequestType__WEBPACK_IMPORTED_MODULE_0__["default"].Compute]: 1000 }; } setMaxSimultaneousRequests(type, maxNumRequests) { this.maxNumRequests[type] = maxNumRequests; } getMaxSimultaneousRequests(type) { return this.maxNumRequests[type]; } destroy() { if (this.timeoutHandle) { window.clearTimeout(this.timeoutHandle); } } addRequest(requestFn, type, additionalDetails, priority = 0) { const requestDetails = { requestFn, type, additionalDetails }; if (this.requestPool[type][priority] === undefined) { this.requestPool[type][priority] = []; } this.requestPool[type][priority].push(requestDetails); this.startGrabbing(); } filterRequests(filterFunction) { Object.keys(this.requestPool).forEach(type => { const requestType = this.requestPool[type]; Object.keys(requestType).forEach(priority => { requestType[priority] = requestType[priority].filter(requestDetails => { return filterFunction(requestDetails); }); }); }); } clearRequestStack(type) { if (!this.requestPool[type]) { throw new Error(`No category for the type ${type} found`); } this.requestPool[type] = { 0: [] }; } sendRequests(type) { const requestsToSend = this.maxNumRequests[type] - this.numRequests[type]; let syncImageCount = 0; for (let i = 0; i < requestsToSend; i++) { const requestDetails = this.getNextRequest(type); if (requestDetails === null) { return false; } else if (requestDetails) { this.numRequests[type]++; this.awake = true; let requestResult; try { requestResult = requestDetails.requestFn(); } catch (e) { console.warn('sendRequest failed', e); } if (requestResult?.finally) { requestResult.finally(() => { this.numRequests[type]--; this.startAgain(); }); } else { this.numRequests[type]--; syncImageCount++; } } } if (syncImageCount) { this.startAgain(); } return true; } getNextRequest(type) { const interactionPriorities = this.getSortedPriorityGroups(type); for (const priority of interactionPriorities) { if (this.requestPool[type][priority].length) { return this.requestPool[type][priority].shift(); } } return null; } startGrabbing() { const hasRemainingInteractionRequests = this.sendRequests(_enums_RequestType__WEBPACK_IMPORTED_MODULE_0__["default"].Interaction); const hasRemainingThumbnailRequests = this.sendRequests(_enums_RequestType__WEBPACK_IMPORTED_MODULE_0__["default"].Thumbnail); const hasRemainingPrefetchRequests = this.sendRequests(_enums_RequestType__WEBPACK_IMPORTED_MODULE_0__["default"].Prefetch); const hasRemainingComputeRequests = this.sendRequests(_enums_RequestType__WEBPACK_IMPORTED_MODULE_0__["default"].Compute); if (!hasRemainingInteractionRequests && !hasRemainingThumbnailRequests && !hasRemainingPrefetchRequests && !hasRemainingComputeRequests) { this.awake = false; } } startAgain() { if (!this.awake) { return; } if (this.grabDelay !== undefined) { if (!this.timeoutHandle) { this.timeoutHandle = window.setTimeout(() => { this.timeoutHandle = null; this.startGrabbing(); }, this.grabDelay); } } else { this.startGrabbing(); } } getSortedPriorityGroups(type) { const priorities = Object.keys(this.requestPool[type]).map(Number).filter(priority => this.requestPool[type][priority].length).sort((a, b) => a - b); return priorities; } getRequestPool() { return this.requestPool; } } /***/ }, /***/ 49451 /*!***************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/FrameRange.js ***! \***************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ FrameRange) /* harmony export */ }); class FrameRange { static { this.frameRangeExtractor = /(\/frames\/|[&?]frameNumber=)([^/&?]*)/i; } static imageIdToFrames(imageId) { const match = imageId.match(this.frameRangeExtractor); if (!match || !match[2]) { return null; } const range = match[2].split('-').map(it => Number(it)); if (range.length === 1) { return range[0]; } return range; } static imageIdToFrameEnd(imageId) { const range = this.imageIdToFrames(imageId); return Array.isArray(range) ? range[1] : range; } static imageIdToFrameStart(imageId) { const range = this.imageIdToFrames(imageId); return Array.isArray(range) ? range[0] : range; } static framesToString(range) { if (Array.isArray(range)) { return `${range[0]}-${range[1]}`; } return String(range); } static framesToImageId(imageId, range) { const match = imageId.match(this.frameRangeExtractor); if (!match || !match[2]) { return null; } const newRangeString = this.framesToString(range); return imageId.replace(this.frameRangeExtractor, `${match[1]}${newRangeString}`); } } /***/ }, /***/ 66631 /*!******************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/PointsManager.js ***! \******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PointsManager) /* harmony export */ }); class PointsManager { constructor(configuration = {}) { this._dimensions = 3; this._length = 0; this._byteSize = 4; this.growSize = 128; const { initialSize = 1024, dimensions = 3, growSize = 128 } = configuration; const itemLength = initialSize * dimensions; this.growSize = growSize; this.array = new ArrayBuffer(itemLength * this._byteSize); this.data = new Float32Array(this.array); this._dimensions = dimensions; } forEach(func) { for (let i = 0; i < this._length; i++) { func(this.getPoint(i), i); } } get length() { return this._length; } get dimensions() { return this._dimensions; } get dimensionLength() { return this._length * this._dimensions; } getPoint(index) { if (index < 0) { index += this._length; } if (index < 0 || index >= this._length) { return; } const offset = this._dimensions * index; return this.data.subarray(offset, offset + this._dimensions); } getPointArray(index) { const array = []; if (index < 0) { index += this._length; } if (index < 0 || index >= this._length) { return; } const offset = this._dimensions * index; for (let i = 0; i < this._dimensions; i++) { array.push(this.data[i + offset]); } return array; } grow(additionalSize = 1, growSize = this.growSize) { if (this.dimensionLength + additionalSize * this._dimensions <= this.data.length) { return; } const newSize = this.data.length + growSize; const newArray = new ArrayBuffer(newSize * this._dimensions * this._byteSize); const newData = new Float32Array(newArray); newData.set(this.data); this.data = newData; this.array = newArray; } reverse() { const midLength = Math.floor(this._length / 2); for (let i = 0; i < midLength; i++) { const indexStart = i * this._dimensions; const indexEnd = (this._length - 1 - i) * this._dimensions; for (let dimension = 0; dimension < this._dimensions; dimension++) { const valueStart = this.data[indexStart + dimension]; this.data[indexStart + dimension] = this.data[indexEnd + dimension]; this.data[indexEnd + dimension] = valueStart; } } } getTypedArray() { return this.data; } push(point) { this.grow(1); const offset = this.length * this._dimensions; for (let i = 0; i < this._dimensions; i++) { this.data[i + offset] = point[i]; } this._length++; } map(f) { const mapData = []; for (let i = 0; i < this._length; i++) { mapData.push(f(this.getPoint(i), i)); } return mapData; } get points() { return this.map(p => p); } toXYZ() { const xyz = { x: [], y: [] }; if (this._dimensions >= 3) { xyz.z = []; } const { x, y, z } = xyz; this.forEach(p => { x.push(p[0]); y.push(p[1]); if (z) { z.push(p[2]); } }); return xyz; } static fromXYZ({ x, y, z }) { const array = PointsManager.create3(x.length); let offset = 0; for (let i = 0; i < x.length; i++) { array.data[offset++] = x[i]; array.data[offset++] = y[i]; array.data[offset++] = z ? z[i] : 0; } array._length = x.length; return array; } subselect(count = 10, offset = 0) { const selected = new PointsManager({ initialSize: count, dimensions: this._dimensions }); for (let i = 0; i < count; i++) { const index = (offset + Math.floor(this.length * i / count)) % this.length; selected.push(this.getPoint(index)); } return selected; } static create3(initialSize = 128, points) { initialSize = Math.max(initialSize, points?.length || 0); const newPoints = new PointsManager({ initialSize, dimensions: 3 }); if (points) { points.forEach(point => newPoints.push(point)); } return newPoints; } static create2(initialSize = 128) { return new PointsManager({ initialSize, dimensions: 2 }); } } /***/ }, /***/ 60308 /*!************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/ProgressiveIterator.js ***! \************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ PromiseIterator: () => (/* binding */ PromiseIterator), /* harmony export */ "default": () => (/* binding */ ProgressiveIterator) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncIterator_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncIterator.js */ 75105); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_awaitAsyncGenerator_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/awaitAsyncGenerator.js */ 60256); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_wrapAsyncGenerator_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/wrapAsyncGenerator.js */ 8014); class PromiseIterator extends Promise {} class ProgressiveIterator { constructor(name) { this.name = name || 'unknown'; } static as(promise) { if (promise.iterator) { return promise.iterator; } const iterator = new ProgressiveIterator('as iterator'); promise.then(v => { try { iterator.add(v, true); } catch (e) { iterator.reject(e); } }, reason => { iterator.reject(reason); }); return iterator; } add(x, done = false) { this.nextValue = x; this.done ||= done; if (this.waiting) { this.waiting.resolve(x); this.waiting = undefined; } } resolve() { this.done = true; if (this.waiting) { this.waiting.resolve(this.nextValue); this.waiting = undefined; } } reject(reason) { this.rejectReason = reason; this.waiting?.reject(reason); } getRecent() { if (this.rejectReason) { throw this.rejectReason; } return this.nextValue; } [Symbol.asyncIterator]() { var _this = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_wrapAsyncGenerator_js__WEBPACK_IMPORTED_MODULE_3__["default"])(function* () { while (!_this.done) { if (_this.rejectReason) { throw _this.rejectReason; } if (_this.nextValue !== undefined) { yield _this.nextValue; if (_this.done) { break; } } if (!_this.waiting) { _this.waiting = {}; _this.waiting.promise = new Promise((resolve, reject) => { _this.waiting.resolve = resolve; _this.waiting.reject = reject; }); } yield (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_awaitAsyncGenerator_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_this.waiting.promise); } yield _this.nextValue; })(); } forEach(callback, errorCallback) { var _this2 = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { let index = 0; try { var _iteratorAbruptCompletion = false; var _didIteratorError = false; var _iteratorError; try { for (var _iterator = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncIterator_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_this2), _step; _iteratorAbruptCompletion = !(_step = yield _iterator.next()).done; _iteratorAbruptCompletion = false) { const value = _step.value; { const { done } = _this2; try { yield callback(value, done, index); index++; } catch (e) { if (!done) { console.warn('Caught exception in intermediate value', e); continue; } if (errorCallback) { errorCallback(e, done); } else { throw e; } } } } } catch (err) { _didIteratorError = true; _iteratorError = err; } finally { try { if (_iteratorAbruptCompletion && _iterator.return != null) { yield _iterator.return(); } } finally { if (_didIteratorError) { throw _iteratorError; } } } } catch (e) { if (errorCallback) { errorCallback(e, true); } else { throw e; } } })(); } generate(processFunction, errorCallback) { return processFunction(this, this.reject.bind(this)).then(() => { if (!this.done) { this.resolve(); } }, reason => { this.reject(reason); if (errorCallback) { errorCallback(reason); } else { console.warn("Couldn't process because", reason); } }); } nextPromise() { var _this3 = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { var _iteratorAbruptCompletion2 = false; var _didIteratorError2 = false; var _iteratorError2; try { for (var _iterator2 = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncIterator_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_this3), _step2; _iteratorAbruptCompletion2 = !(_step2 = yield _iterator2.next()).done; _iteratorAbruptCompletion2 = false) { const i = _step2.value; { if (i) { return i; } } } } catch (err) { _didIteratorError2 = true; _iteratorError2 = err; } finally { try { if (_iteratorAbruptCompletion2 && _iterator2.return != null) { yield _iterator2.return(); } } finally { if (_didIteratorError2) { throw _iteratorError2; } } } return _this3.nextValue; })(); } donePromise() { var _this4 = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { var _iteratorAbruptCompletion3 = false; var _didIteratorError3 = false; var _iteratorError3; try { for (var _iterator3 = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncIterator_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_this4), _step3; _iteratorAbruptCompletion3 = !(_step3 = yield _iterator3.next()).done; _iteratorAbruptCompletion3 = false) { const i = _step3.value; } } catch (err) { _didIteratorError3 = true; _iteratorError3 = err; } finally { try { if (_iteratorAbruptCompletion3 && _iterator3.return != null) { yield _iterator3.return(); } } finally { if (_didIteratorError3) { throw _iteratorError3; } } } return _this4.nextValue; })(); } getNextPromise() { const promise = this.nextPromise(); promise.iterator = this; return promise; } getDonePromise() { const promise = this.donePromise(); promise.iterator = this; return promise; } } /***/ }, /***/ 45202 /*!****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/RLEVoxelMap.js ***! \****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ RLEVoxelMap) /* harmony export */ }); const ADJACENT_ALL = [[0, -1, 0], [0, 1, 0], [0, 0, -1], [0, 0, 1]]; const ADJACENT_SINGLE_PLANE = [[0, -1, 0], [0, 1, 0]]; const ADJACENT_IN = [[0, -1, 0], [0, 1, 0], [0, 0, -1]]; const ADJACENT_OUT = [[0, -1, 0], [0, 1, 0], [0, 0, 1]]; class RLEVoxelMap { static copyMap(destination, source) { for (const [index, row] of source.rows) { destination.rows.set(index, structuredClone(row)); } } constructor(width, height, depth = 1) { this.rows = new Map(); this.height = 1; this.width = 1; this.depth = 1; this.jMultiple = 1; this.kMultiple = 1; this.numComps = 1; this.pixelDataConstructor = Uint8Array; this.updateScalarData = function (scalarData) { scalarData.fill(0); const callback = (index, rle, row) => { const { start, end, value } = rle; for (let i = start; i < end; i++) { scalarData[index + i] = value; } }; this.forEach(callback); }; this.get = index => { const i = index % this.jMultiple; const j = (index - i) / this.jMultiple; const rle = this.getRLE(i, j); return rle?.value ?? this.defaultValue; }; this.getRun = (j, k) => { const runIndex = j + k * this.height; return this.rows.get(runIndex); }; this.set = (index, value) => { if (value === undefined) { return; } const i = index % this.width; const j = (index - i) / this.width; const row = this.rows.get(j); if (!row) { this.rows.set(j, [{ start: i, end: i + 1, value }]); return; } const rleIndex = this.findIndex(row, i); const rle1 = row[rleIndex]; const rle0 = row[rleIndex - 1]; if (!rle1) { if (!rle0 || rle0.value !== value || rle0.end !== i) { row[rleIndex] = { start: i, end: i + 1, value }; return; } rle0.end++; return; } const { start, end, value: oldValue } = rle1; if (value === oldValue && i >= start) { return; } const rleInsert = { start: i, end: i + 1, value }; const isAfter = i > start; const insertIndex = isAfter ? rleIndex + 1 : rleIndex; const rlePrev = isAfter ? rle1 : rle0; let rleNext = isAfter ? row[rleIndex + 1] : rle1; if (rlePrev?.value === value && rlePrev?.end === i) { rlePrev.end++; if (rleNext?.value === value && rleNext.start === i + 1) { rlePrev.end = rleNext.end; row.splice(rleIndex, 1); } else if (rleNext?.start === i) { rleNext.start++; if (rleNext.start === rleNext.end) { row.splice(rleIndex, 1); rleNext = row[rleIndex]; if (rleNext?.start === i + 1 && rleNext.value === value) { rlePrev.end = rleNext.end; row.splice(rleIndex, 1); } } } return; } if (rleNext?.value === value && rleNext.start === i + 1) { rleNext.start--; if (rlePrev?.end > i) { rlePrev.end = i; if (rlePrev.end === rlePrev.start) { row.splice(rleIndex, 1); } } return; } if (rleNext?.start === i && rleNext.end === i + 1) { rleNext.value = value; const nextnext = row[rleIndex + 1]; if (nextnext?.start == i + 1 && nextnext.value === value) { row.splice(rleIndex + 1, 1); rleNext.end = nextnext.end; } return; } if (i === rleNext?.start) { rleNext.start++; } if (isAfter && end > i + 1) { row.splice(insertIndex, 0, rleInsert, { start: i + 1, end: rlePrev.end, value: rlePrev.value }); } else { row.splice(insertIndex, 0, rleInsert); } if (rlePrev?.end > i) { rlePrev.end = i; } }; this.width = width; this.height = height; this.depth = depth; this.jMultiple = width; this.kMultiple = this.jMultiple * height; } static { this.getScalarData = function (ArrayType = Uint8ClampedArray) { const scalarData = new ArrayType(this.frameSize); this.map.updateScalarData(scalarData); return scalarData; }; } toIJK(index) { const i = index % this.jMultiple; const j = (index - i) / this.jMultiple % this.height; const k = Math.floor(index / this.kMultiple); return [i, j, k]; } toIndex([i, j, k]) { return i + k * this.kMultiple + j * this.jMultiple; } getRLE(i, j, k = 0) { const row = this.rows.get(j + k * this.height); if (!row) { return; } const index = this.findIndex(row, i); const rle = row[index]; return i >= rle?.start ? rle : undefined; } has(index) { const i = index % this.jMultiple; const j = (index - i) / this.jMultiple; const rle = this.getRLE(i, j); return rle?.value !== undefined; } delete(index) { const i = index % this.width; const j = (index - i) / this.width; const row = this.rows.get(j); if (!row) { return; } const rleIndex = this.findIndex(row, i); const rle = row[rleIndex]; if (!rle || rle.start > i) { return; } if (rle.end === i + 1) { rle.end--; if (rle.start >= rle.end) { row.splice(rleIndex, 1); if (!row.length) { this.rows.delete(j); } } return; } if (rle.start === i) { rle.start++; return; } const newRle = { value: rle.value, start: i + 1, end: rle.end }; rle.end = i; row.splice(rleIndex + 1, 0, newRle); } findIndex(row, i) { for (let index = 0; index < row.length; index++) { const { end: iEnd } = row[index]; if (i < iEnd) { return index; } } return row.length; } forEach(callback, options) { const rowModified = options?.rowModified; for (const [baseIndex, row] of this.rows) { const rowToUse = rowModified ? [...row] : row; for (const rle of rowToUse) { callback(baseIndex * this.width, rle, row); } } } forEachRow(callback) { for (const [baseIndex, row] of this.rows) { callback(baseIndex * this.width, row); } } clear() { this.rows.clear(); } keys() { return [...this.rows.keys()]; } getPixelData(k = 0, pixelData) { if (!pixelData) { pixelData = new this.pixelDataConstructor(this.width * this.height * this.numComps); } else { pixelData.fill(0); } const { width, height, numComps } = this; for (let j = 0; j < height; j++) { const row = this.getRun(j, k); if (!row) { continue; } if (numComps === 1) { for (const rle of row) { const rowOffset = j * width; const { start, end, value } = rle; for (let i = start; i < end; i++) { pixelData[rowOffset + i] = value; } } } else { for (const rle of row) { const rowOffset = j * width * numComps; const { start, end, value } = rle; for (let i = start; i < end; i += numComps) { for (let comp = 0; comp < numComps; comp++) { pixelData[rowOffset + i + comp] = value[comp]; } } } } } return pixelData; } floodFill(i, j, k, value, options) { const rle = this.getRLE(i, j, k); if (!rle) { throw new Error(`Initial point ${i},${j},${k} isn't in the RLE`); } const stack = [[rle, j, k]]; const replaceValue = rle.value; if (replaceValue === value) { throw new Error(`source (${replaceValue}) and destination (${value}) are identical`); } return this.flood(stack, replaceValue, value, options); } flood(stack, sourceValue, value, options) { let sum = 0; const { planar = true, diagonals = true, singlePlane = false } = options || {}; const childOptions = { planar, diagonals, singlePlane }; while (stack.length) { const top = stack.pop(); const [current] = top; if (current.value !== sourceValue) { continue; } current.value = value; sum += current.end - current.start; const adjacents = this.findAdjacents(top, childOptions).filter(adjacent => adjacent && adjacent[0].value === sourceValue); stack.push(...adjacents); } return sum; } fillFrom(getter, boundsIJK) { for (let k = boundsIJK[2][0]; k <= boundsIJK[2][1]; k++) { for (let j = boundsIJK[1][0]; j <= boundsIJK[1][1]; j++) { let rle; let row; for (let i = boundsIJK[0][0]; i <= boundsIJK[0][1]; i++) { const value = getter(i, j, k); if (value === undefined) { rle = undefined; continue; } if (!row) { row = []; this.rows.set(j + k * this.height, row); } if (rle && rle.value !== value) { rle = undefined; } if (!rle) { rle = { start: i, end: i, value }; row.push(rle); } rle.end++; } } } } findAdjacents(item, { diagonals = true, planar = true, singlePlane = false }) { const [rle, j, k, adjacentsDelta] = item; const { start, end } = rle; const leftRle = start > 0 && this.getRLE(start - 1, j, k); const rightRle = end < this.width && this.getRLE(end, j, k); const range = diagonals ? [start > 0 ? start - 1 : start, end < this.width ? end + 1 : end] : [start, end]; const adjacents = []; if (leftRle) { adjacents.push([leftRle, j, k]); } if (rightRle) { adjacents.push([rightRle, j, k]); } for (const delta of adjacentsDelta || (singlePlane ? ADJACENT_SINGLE_PLANE : ADJACENT_ALL)) { const [, delta1, delta2] = delta; const testJ = delta1 + j; const testK = delta2 + k; if (testJ < 0 || testJ >= this.height) { continue; } if (testK < 0 || testK >= this.depth) { continue; } const row = this.getRun(testJ, testK); if (!row) { continue; } for (const testRle of row) { const newAdjacentDelta = adjacentsDelta || singlePlane && ADJACENT_SINGLE_PLANE || planar && delta2 > 0 && ADJACENT_OUT || planar && delta2 < 0 && ADJACENT_IN || ADJACENT_ALL; if (!(testRle.end <= range[0] || testRle.start >= range[1])) { adjacents.push([testRle, testJ, testK, newAdjacentDelta]); } } } return adjacents; } } /***/ }, /***/ 14430 /*!*****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/VoxelManager.js ***! \*****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ VoxelManager) /* harmony export */ }); /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../cache/cache */ 38277); /* harmony import */ var _RLEVoxelMap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RLEVoxelMap */ 45202); /* harmony import */ var _isEqual__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./isEqual */ 17137); /* harmony import */ var _pointInShapeCallback__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pointInShapeCallback */ 83872); const DEFAULT_RLE_SIZE = 5 * 1024; class VoxelManager { get id() { return this._id; } constructor(dimensions, options) { this.modifiedSlices = new Set(); this.boundsIJK = [[Infinity, -Infinity], [Infinity, -Infinity], [Infinity, -Infinity]]; this.scalarData = null; this._sliceDataCache = null; this.getAtIJK = (i, j, k) => { const index = this.toIndex([i, j, k]); return this._get(index); }; this.setAtIJK = (i, j, k, v) => { const index = this.toIndex([i, j, k]); const changed = this._set(index, v); if (changed !== false) { this.modifiedSlices.add(k); VoxelManager.addBounds(this.boundsIJK, [i, j, k]); } return changed; }; this.getAtIJKPoint = ([i, j, k]) => this.getAtIJK(i, j, k); this.setAtIJKPoint = ([i, j, k], v) => { this.setAtIJK(i, j, k, v); }; this.getAtIndex = index => this._get(index); this.setAtIndex = (index, v) => { const changed = this._set(index, v); if (changed !== false) { const pointIJK = this.toIJK(index); this.modifiedSlices.add(pointIJK[2]); VoxelManager.addBounds(this.boundsIJK, pointIJK); } return changed; }; this.getMiddleSliceData = () => { const middleSliceIndex = Math.floor(this.dimensions[2] / 2); return this.getSliceData({ sliceIndex: middleSliceIndex, slicePlane: 2 }); }; this.forEach = (callback, options = {}) => { const isInObjectBoundsIJK = options.boundsIJK || this.getBoundsIJK(); const isInObject = options.isInObject || this.isInObject || (() => true); const returnPoints = options.returnPoints || false; const useLPSTransform = options.imageData; const iMin = Math.min(isInObjectBoundsIJK[0][0], isInObjectBoundsIJK[0][1]); const iMax = Math.max(isInObjectBoundsIJK[0][0], isInObjectBoundsIJK[0][1]); const jMin = Math.min(isInObjectBoundsIJK[1][0], isInObjectBoundsIJK[1][1]); const jMax = Math.max(isInObjectBoundsIJK[1][0], isInObjectBoundsIJK[1][1]); const kMin = Math.min(isInObjectBoundsIJK[2][0], isInObjectBoundsIJK[2][1]); const kMax = Math.max(isInObjectBoundsIJK[2][0], isInObjectBoundsIJK[2][1]); const pointsInShape = []; if (useLPSTransform) { const pointsInShape = (0,_pointInShapeCallback__WEBPACK_IMPORTED_MODULE_3__.iterateOverPointsInShapeVoxelManager)({ voxelManager: this, imageData: options.imageData, bounds: [[iMin, iMax], [jMin, jMax], [kMin, kMax]], pointInShapeFn: isInObject, callback, returnPoints }); return pointsInShape; } if (this.map) { if (this.map instanceof _RLEVoxelMap__WEBPACK_IMPORTED_MODULE_1__["default"]) { return this.rleForEach(callback, options); } for (const index of this.map.keys()) { const pointIJK = this.toIJK(index); if (!isInObject(null, pointIJK)) { continue; } const value = this._get(index); if (returnPoints) { pointsInShape.push({ value, index, pointIJK, pointLPS: null }); } callback({ value, index, pointIJK, pointLPS: null }); } return pointsInShape; } else { for (let k = kMin; k <= kMax; k++) { const kIndex = k * this.frameSize; for (let j = jMin; j <= jMax; j++) { const jIndex = kIndex + j * this.width; for (let i = iMin, index = jIndex + i; i <= iMax; i++, index++) { const value = this.getAtIndex(index); const pointIJK = [i, j, k]; if (!isInObject(null, pointIJK)) { continue; } if (returnPoints) { pointsInShape.push({ value, index, pointIJK, pointLPS: null }); } callback({ value, index, pointIJK: [i, j, k], pointLPS: null }); } } } return pointsInShape; } }; this.getSliceData = ({ sliceIndex, slicePlane }) => { const [width, height, depth] = this.dimensions; const frameSize = width * height; const startIndex = sliceIndex * frameSize; let sliceSize; const SliceDataConstructor = this.getConstructor(); function isValidConstructor(ctor) { return typeof ctor === 'function'; } if (!isValidConstructor(SliceDataConstructor)) { return new Uint8Array(0); } let sliceData; switch (slicePlane) { case 0: sliceSize = height * depth; sliceData = new SliceDataConstructor(sliceSize); for (let i = 0; i < height; i++) { for (let j = 0; j < depth; j++) { const index = sliceIndex + i * width + j * frameSize; this.setSliceDataValue(sliceData, i * depth + j, this._get(index)); } } break; case 1: sliceSize = width * depth; sliceData = new SliceDataConstructor(sliceSize); for (let i = 0; i < width; i++) { for (let j = 0; j < depth; j++) { const index = i + sliceIndex * width + j * frameSize; this.setSliceDataValue(sliceData, i + j * width, this._get(index)); } } break; case 2: sliceSize = width * height; sliceData = new SliceDataConstructor(sliceSize); for (let i = 0; i < sliceSize; i++) { this.setSliceDataValue(sliceData, i, this._get(startIndex + i)); } break; default: throw new Error('Oblique plane - todo - implement as ortho normal vector'); } return sliceData; }; this.dimensions = dimensions; this.width = dimensions[0]; this.frameSize = this.width * dimensions[1]; this._get = options._get; this._set = options._set; this._id = options._id || ''; this._getConstructor = options._getConstructor; this.numberOfComponents = options.numberOfComponents || 1; this.scalarData = options.scalarData; this._getScalarData = options._getScalarData; this._updateScalarData = options._updateScalarData; } getMinMax() { let min, max; const callback = ({ value: v }) => { const isArray = Array.isArray(v); if (min === undefined) { min = isArray ? [...v] : v; max = isArray ? [...v] : v; } if (isArray) { for (let i = 0; i < v.length; i++) { min[i] = Math.min(min[i], v[i]); max[i] = Math.max(max[i], v[i]); } } else { min = Math.min(min, v); max = Math.max(max, v); } }; this.forEach(callback, { boundsIJK: this.getDefaultBounds() }); return { min, max }; } toIJK(index) { return [index % this.width, Math.floor(index % this.frameSize / this.width), Math.floor(index / this.frameSize)]; } toIndex(ijk) { return ijk[0] + ijk[1] * this.width + ijk[2] * this.frameSize; } getDefaultBounds() { return this.dimensions.map(dimension => [0, dimension - 1]); } getBoundsIJK() { if (this.boundsIJK[0][0] < this.dimensions[0]) { return this.boundsIJK; } return this.getDefaultBounds(); } rleForEach(callback, options) { const boundsIJK = options?.boundsIJK || this.getBoundsIJK(); const { isWithinObject } = options || {}; const map = this.map; if (!map) { console.warn('No map found, you need to use a map voxel manager to use rleForEach'); return; } map.defaultValue = undefined; for (let k = boundsIJK[2][0]; k <= boundsIJK[2][1]; k++) { for (let j = boundsIJK[1][0]; j <= boundsIJK[1][1]; j++) { const row = map.getRun(j, k); if (!row) { continue; } for (const rle of row) { const { start, end, value } = rle; const baseIndex = this.toIndex([0, j, k]); for (let i = start; i < end; i++) { const callbackArguments = { value, index: baseIndex + i, pointIJK: [i, j, k] }; if (isWithinObject?.(callbackArguments) === false) { continue; } callback(callbackArguments); } } } } } getScalarData(storeScalarData = false) { if (this.scalarData) { this._updateScalarData?.(this.scalarData); return this.scalarData; } if (this._getScalarData) { const scalarData = this._getScalarData(); if (storeScalarData) { console.log('Not transient, should store value', scalarData); } return scalarData; } throw new Error('No scalar data available'); } setScalarData(newScalarData) { this.scalarData = newScalarData; } getScalarDataLength() { if (this.scalarData) { return this.scalarData.length; } if (this._getScalarDataLength) { return this._getScalarDataLength(); } throw new Error('No scalar data available'); } get sizeInBytes() { return this.getScalarDataLength() * this.bytePerVoxel; } get bytePerVoxel() { if (this.scalarData) { return this.scalarData.BYTES_PER_ELEMENT; } const value = this._get(0); return value.BYTES_PER_ELEMENT; } clearBounds() { this.boundsIJK.map(bound => { bound[0] = Infinity; bound[1] = -Infinity; }); } clear() { this.map?.clear(); this.clearBounds(); this.modifiedSlices.clear(); this.points?.clear(); } getConstructor() { if (this.scalarData) { return this.scalarData.constructor; } if (this._getConstructor) { return this._getConstructor(); } console.warn('No scalar data available or can be used to get the constructor'); return Float32Array; } getArrayOfModifiedSlices() { return Array.from(this.modifiedSlices); } resetModifiedSlices() { this.modifiedSlices.clear(); } setBounds(bounds) { this.boundsIJK = bounds; } static addBounds(bounds, point) { if (!bounds) { bounds = [[Infinity, -Infinity], [Infinity, -Infinity], [Infinity, -Infinity]]; } bounds[0][0] = Math.min(point[0], bounds[0][0]); bounds[0][1] = Math.max(point[0], bounds[0][1]); bounds[1][0] = Math.min(point[1], bounds[1][0]); bounds[1][1] = Math.max(point[1], bounds[1][1]); bounds[2][0] = Math.min(point[2], bounds[2][0]); bounds[2][1] = Math.max(point[2], bounds[2][1]); } addPoint(point) { const index = Array.isArray(point) ? point[0] + this.width * point[1] + this.frameSize * point[2] : point; if (!this.points) { this.points = new Set(); } this.points.add(index); } getPoints() { return this.points ? [...this.points].map(index => this.toIJK(index)) : []; } setSliceDataValue(sliceData, index, value) { if (Array.isArray(value)) { for (let i = 0; i < value.length; i++) { sliceData[index * value.length + i] = this.toNumber(value[i]); } } else { sliceData[index] = this.toNumber(value); } } toNumber(value) { if (typeof value === 'number') { return value; } if (Array.isArray(value)) { return value[0] || 0; } return 0; } static _createRGBScalarVolumeVoxelManager({ dimensions, scalarData, numberOfComponents = 3, id }) { const voxels = new VoxelManager(dimensions, { _get: index => { index *= numberOfComponents; return [scalarData[index++], scalarData[index++], scalarData[index++]]; }, _id: id || '_createRGBScalarVolumeVoxelManager', _set: (index, v) => { index *= 3; const isChanged = !(0,_isEqual__WEBPACK_IMPORTED_MODULE_2__["default"])(scalarData[index], v); scalarData[index++] = v[0]; scalarData[index++] = v[1]; scalarData[index++] = v[2]; return isChanged; }, numberOfComponents, scalarData }); voxels.clear = () => { scalarData.fill(0); }; return voxels; } static createImageVolumeVoxelManager({ dimensions, imageIds, numberOfComponents = 1, id }) { const pixelsPerSlice = dimensions[0] * dimensions[1]; function getPixelInfo(index) { const sliceIndex = Math.floor(index / pixelsPerSlice); if (sliceIndex < 0 || sliceIndex >= dimensions[2]) { return {}; } const imageId = imageIds[sliceIndex]; if (!imageId) { console.warn(`ImageId not found for sliceIndex: ${sliceIndex}`); return { pixelData: null, pixelIndex: null }; } const image = _cache_cache__WEBPACK_IMPORTED_MODULE_0__["default"].getImage(imageId); if (!image) { console.warn(`Image not found for imageId: ${imageId}`); return { pixelData: null, pixelIndex: null }; } const voxelManager = image.voxelManager; const pixelIndex = index % pixelsPerSlice; return { voxelManager, pixelIndex }; } function getVoxelValue(index) { const { voxelManager: imageVoxelManager, pixelIndex } = getPixelInfo(index); if (!imageVoxelManager || pixelIndex === null) { return null; } return imageVoxelManager.getAtIndex(pixelIndex); } function setVoxelValue(index, v) { const { voxelManager: imageVoxelManager, pixelIndex } = getPixelInfo(index); if (!imageVoxelManager || pixelIndex === null) { return false; } const currentValue = imageVoxelManager.getAtIndex(pixelIndex); const isChanged = !(0,_isEqual__WEBPACK_IMPORTED_MODULE_2__["default"])(v, currentValue); if (!isChanged) { return isChanged; } imageVoxelManager.setAtIndex(pixelIndex, v); return true; } const _getConstructor = () => { const { voxelManager: imageVoxelManager, pixelIndex } = getPixelInfo(0); if (!imageVoxelManager || pixelIndex === null) { return null; } return imageVoxelManager.getConstructor(); }; const voxelManager = new VoxelManager(dimensions, { _get: getVoxelValue, _set: setVoxelValue, numberOfComponents, _getConstructor, _id: id || 'createImageVolumeVoxelManager' }); voxelManager.getMiddleSliceData = () => { const middleSliceIndex = Math.floor(dimensions[2] / 2); return voxelManager.getSliceData({ sliceIndex: middleSliceIndex, slicePlane: 2 }); }; voxelManager.clear = () => { for (const imageId of imageIds) { const image = _cache_cache__WEBPACK_IMPORTED_MODULE_0__["default"].getImage(imageId); image.voxelManager.clear(); } }; voxelManager.getRange = () => { let minValue = Infinity; let maxValue = -Infinity; for (const imageId of imageIds) { const image = _cache_cache__WEBPACK_IMPORTED_MODULE_0__["default"].getImage(imageId); if (!image) { continue; } if (image.minPixelValue < minValue) { minValue = image.minPixelValue; } if (image.maxPixelValue > maxValue) { maxValue = image.maxPixelValue; } } if (minValue === Infinity && maxValue === -Infinity) { return [0, 0]; } return [minValue, maxValue]; }; voxelManager._getScalarDataLength = () => { const { voxelManager: imageVoxelManager, pixelIndex } = getPixelInfo(0); if (!imageVoxelManager || pixelIndex === null) { return 0; } return imageVoxelManager.getScalarDataLength() * dimensions[2]; }; voxelManager.getCompleteScalarDataArray = () => { const ScalarDataConstructor = voxelManager._getConstructor(); if (!ScalarDataConstructor) { return new Uint8Array(0); } const dataLength = voxelManager.getScalarDataLength(); const scalarData = new ScalarDataConstructor(dataLength); const sliceSize = dimensions[0] * dimensions[1] * numberOfComponents; for (let sliceIndex = 0; sliceIndex < dimensions[2]; sliceIndex++) { const { voxelManager: imageVoxelManager, pixelIndex } = getPixelInfo(sliceIndex * sliceSize / numberOfComponents); if (imageVoxelManager && pixelIndex !== null) { const sliceStart = sliceIndex * sliceSize; const pixelData = imageVoxelManager.getScalarData(); if (numberOfComponents === 1) { scalarData.set(pixelData, sliceStart); } else { for (let i = 0; i < pixelData.length; i += numberOfComponents) { for (let j = 0; j < numberOfComponents; j++) { scalarData[sliceStart + i + j] = pixelData[i + j]; } } } } } return scalarData; }; voxelManager.setCompleteScalarDataArray = scalarData => { const sliceSize = dimensions[0] * dimensions[1] * numberOfComponents; const SliceDataConstructor = voxelManager._getConstructor(); let minValue = Infinity; let maxValue = -Infinity; for (let sliceIndex = 0; sliceIndex < dimensions[2]; sliceIndex++) { const { voxelManager: imageVoxelManager } = getPixelInfo(sliceIndex * sliceSize / numberOfComponents); if (imageVoxelManager && SliceDataConstructor) { const sliceStart = sliceIndex * sliceSize; const sliceEnd = sliceStart + sliceSize; const sliceData = new SliceDataConstructor(sliceSize); sliceData.set(scalarData.subarray(sliceStart, sliceEnd)); if (imageVoxelManager.scalarData) { imageVoxelManager.scalarData.set(sliceData); imageVoxelManager.modifiedSlices.add(sliceIndex); } else { for (let i = 0; i < sliceSize; i++) { imageVoxelManager.setAtIndex(i, sliceData[i]); } } for (let i = 0; i < sliceData.length; i++) { const value = sliceData[i]; minValue = Math.min(minValue, value); maxValue = Math.max(maxValue, value); } const imageId = imageIds[sliceIndex]; const image = _cache_cache__WEBPACK_IMPORTED_MODULE_0__["default"].getImage(imageId); if (image) { image.minPixelValue = minValue; image.maxPixelValue = maxValue; } } } for (let k = 0; k < dimensions[2]; k++) { voxelManager.modifiedSlices.add(k); } voxelManager.boundsIJK = [[0, dimensions[0] - 1], [0, dimensions[1] - 1], [0, dimensions[2] - 1]]; }; return voxelManager; } static createScalarVolumeVoxelManager({ dimensions, scalarData, numberOfComponents, id }) { if (dimensions.length !== 3) { throw new Error('Dimensions must be provided as [number, number, number] for [width, height, depth]'); } if (!numberOfComponents) { numberOfComponents = scalarData.length / dimensions[0] / dimensions[1] / dimensions[2]; if (numberOfComponents > 4 || numberOfComponents < 1 || numberOfComponents === 2) { throw new Error(`Number of components ${numberOfComponents} must be 1, 3 or 4`); } } if (numberOfComponents > 1) { return VoxelManager._createRGBScalarVolumeVoxelManager({ dimensions, scalarData, numberOfComponents, id }); } return VoxelManager._createNumberVolumeVoxelManager({ dimensions, scalarData, id }); } static createScalarDynamicVolumeVoxelManager({ imageIdGroups, dimensions, dimensionGroupNumber = 1, timePoint = 0, numberOfComponents = 1, id }) { let activeDimensionGroup = 0; if (dimensionGroupNumber !== undefined) { activeDimensionGroup = dimensionGroupNumber - 1; } else if (timePoint !== undefined) { console.warn('Warning: timePoint parameter is deprecated. Please use dimensionGroupNumber instead. timePoint is zero-based while dimensionGroupNumber starts at 1.'); activeDimensionGroup = timePoint; } if (!numberOfComponents) { const firstImage = _cache_cache__WEBPACK_IMPORTED_MODULE_0__["default"].getImage(imageIdGroups[0][0]); if (!firstImage) { throw new Error('Unable to determine number of components: No image found'); } numberOfComponents = firstImage.getPixelData().length / (dimensions[0] * dimensions[1]); if (numberOfComponents > 4 || numberOfComponents < 1 || numberOfComponents === 2) { throw new Error(`Number of components ${numberOfComponents} must be 1, 3 or 4`); } } const voxelGroups = imageIdGroups.map(imageIds => { return VoxelManager.createImageVolumeVoxelManager({ dimensions, imageIds, numberOfComponents, id }); }); const voxelManager = new VoxelManager(dimensions, { _get: index => voxelGroups[activeDimensionGroup]._get(index), _set: (index, v) => voxelGroups[activeDimensionGroup]._set(index, v), numberOfComponents, _id: id || 'createScalarDynamicVolumeVoxelManager' }); voxelManager.getScalarDataLength = () => { return voxelGroups[activeDimensionGroup].getScalarDataLength(); }; voxelManager.getConstructor = () => { return voxelGroups[activeDimensionGroup].getConstructor(); }; voxelManager.getRange = () => { return voxelGroups[activeDimensionGroup].getRange(); }; voxelManager.getMiddleSliceData = () => { return voxelGroups[activeDimensionGroup].getMiddleSliceData(); }; voxelManager.setTimePoint = newTimePoint => { console.warn('Warning: setTimePoint is deprecated. Please use setDimensionGroupNumber instead. Note that timePoint is zero-based while dimensionGroupNumber starts at 1.'); voxelManager.setDimensionGroupNumber(newTimePoint + 1); }; voxelManager.setDimensionGroupNumber = newDimensionGroupNumber => { activeDimensionGroup = newDimensionGroupNumber - 1; voxelManager._get = index => voxelGroups[activeDimensionGroup]._get(index); voxelManager._set = (index, v) => voxelGroups[activeDimensionGroup]._set(index, v); }; voxelManager.getAtIndexAndTimePoint = (index, tp) => { console.warn('Warning: getAtIndexAndTimePoint is deprecated. Please use getAtIndexAndDimensionGroup instead. Note that timePoint is zero-based while dimensionGroupNumber starts at 1.'); return voxelManager.getAtIndexAndDimensionGroup(index, tp + 1); }; voxelManager.getAtIndexAndDimensionGroup = (index, dimensionGroupNumber) => { return voxelGroups[dimensionGroupNumber - 1]._get(index); }; voxelManager.getTimePointScalarData = tp => { console.warn('Warning: getTimePointScalarData is deprecated. Please use getDimensionGroupScalarData instead. Note that timePoint is zero-based while dimensionGroupNumber starts at 1.'); return voxelManager.getDimensionGroupScalarData(tp + 1); }; voxelManager.getDimensionGroupScalarData = dimensionGroupNumber => { return voxelGroups[dimensionGroupNumber - 1].getCompleteScalarDataArray(); }; voxelManager.getCurrentTimePointScalarData = () => { console.warn('Warning: getCurrentTimePointScalarData is deprecated. Please use getCurrentDimensionGroupScalarData instead.'); return voxelManager.getCurrentDimensionGroupScalarData(); }; voxelManager.getCurrentDimensionGroupScalarData = () => { return voxelGroups[activeDimensionGroup].getCompleteScalarDataArray(); }; voxelManager.getCurrentTimePoint = () => { console.warn('Warning: getCurrentTimePoint is deprecated. Please use getCurrentDimensionGroupNumber instead. Note that timePoint is zero-based while dimensionGroupNumber starts at 1.'); return activeDimensionGroup; }; voxelManager.getCurrentDimensionGroupNumber = () => { return activeDimensionGroup + 1; }; return voxelManager; } static createImageVoxelManager({ width, height, scalarData, numberOfComponents = 1, id }) { const dimensions = [width, height, 1]; if (!numberOfComponents) { numberOfComponents = scalarData.length / width / height; if (numberOfComponents > 4 || numberOfComponents < 1 || numberOfComponents === 2) { throw new Error(`Number of components ${numberOfComponents} must be 1, 3 or 4`); } } if (numberOfComponents > 1) { return VoxelManager._createRGBScalarVolumeVoxelManager({ dimensions, scalarData, numberOfComponents, id }); } return VoxelManager._createNumberVolumeVoxelManager({ dimensions, scalarData, id }); } static _createNumberVolumeVoxelManager({ dimensions, scalarData, id }) { const voxels = new VoxelManager(dimensions, { _get: index => scalarData[index], _set: (index, v) => { const isChanged = scalarData[index] !== v; scalarData[index] = v; return isChanged; }, _getConstructor: () => scalarData.constructor, _id: id || '_createNumberVolumeVoxelManager' }); voxels.scalarData = scalarData; voxels.clear = () => { voxels.scalarData.fill(0); }; voxels.getMiddleSliceData = () => { const middleSliceIndex = Math.floor(dimensions[2] / 2); return voxels.getSliceData({ sliceIndex: middleSliceIndex, slicePlane: 2 }); }; return voxels; } static createMapVoxelManager({ dimension, id }) { const map = new Map(); const voxelManager = new VoxelManager(dimension, { _get: map.get.bind(map), _set: (index, v) => map.set(index, v) && true, _id: id || 'createMapVoxelManager' }); voxelManager.map = map; return voxelManager; } static createHistoryVoxelManager(sourceVoxelManager, id) { const map = new Map(); const { dimensions } = sourceVoxelManager; const voxelManager = new VoxelManager(dimensions, { _get: index => map.get(index), _set: function (index, v) { if (!map.has(index)) { const oldV = this.sourceVoxelManager.getAtIndex(index); if (oldV === v) { return false; } map.set(index, oldV); } else if (v === map.get(index)) { map.delete(index); } this.sourceVoxelManager.setAtIndex(index, v); }, _id: id || 'createHistoryVoxelManager' }); voxelManager.map = map; voxelManager.scalarData = sourceVoxelManager.scalarData; voxelManager.sourceVoxelManager = sourceVoxelManager; return voxelManager; } static createRLEHistoryVoxelManager(sourceVoxelManager, id) { const { dimensions } = sourceVoxelManager; const map = new _RLEVoxelMap__WEBPACK_IMPORTED_MODULE_1__["default"](dimensions[0], dimensions[1], dimensions[2]); const voxelManager = new VoxelManager(dimensions, { _get: index => map.get(index), _set: function (index, v) { const originalV = map.get(index); if (originalV === undefined) { const oldV = this.sourceVoxelManager.getAtIndex(index); if (oldV === v || oldV === undefined && v === 0 || v === null) { return false; } map.set(index, oldV ?? 0); } else if (v === originalV || v === null) { map.delete(index); v = originalV; } this.sourceVoxelManager.setAtIndex(index, v); }, _getScalarData: _RLEVoxelMap__WEBPACK_IMPORTED_MODULE_1__["default"].getScalarData, _updateScalarData: scalarData => { map.updateScalarData(scalarData); return scalarData; }, _id: id || 'createRLEHistoryVoxelManager' }); voxelManager.map = map; voxelManager.sourceVoxelManager = sourceVoxelManager; return voxelManager; } static createLazyVoxelManager({ dimensions, planeFactory, id }) { const map = new Map(); const [width, height] = dimensions; const planeSize = width * height; const voxelManager = new VoxelManager(dimensions, { _get: index => map.get(Math.floor(index / planeSize))[index % planeSize], _set: (index, v) => { const k = Math.floor(index / planeSize); let layer = map.get(k); if (!layer) { layer = planeFactory(width, height); map.set(k, layer); } layer[index % planeSize] = v; return true; }, _id: id || 'createLazyVoxelManager' }); voxelManager.map = map; return voxelManager; } static createRLEVolumeVoxelManager({ dimensions, id }) { const [width, height, depth] = dimensions; const map = new _RLEVoxelMap__WEBPACK_IMPORTED_MODULE_1__["default"](width, height, depth); const voxelManager = new VoxelManager(dimensions, { _get: index => map.get(index), _set: (index, v) => { map.set(index, v); return true; }, _getScalarData: _RLEVoxelMap__WEBPACK_IMPORTED_MODULE_1__["default"].getScalarData, _updateScalarData: scalarData => { map.updateScalarData(scalarData); return scalarData; }, _id: id || 'createRLEVolumeVoxelManager' }); voxelManager.map = map; voxelManager.getPixelData = map.getPixelData.bind(map); return voxelManager; } static createRLEImageVoxelManager({ dimensions, id }) { const [width, height] = dimensions; return VoxelManager.createRLEVolumeVoxelManager({ dimensions: [width, height, 1], id }); } static addInstanceToImage(image) { const { width, height } = image; const scalarData = image.voxelManager.getScalarData(); if (scalarData.length >= width * height) { image.voxelManager = VoxelManager.createScalarVolumeVoxelManager({ dimensions: [width, height, 1], scalarData }); return; } image.voxelManager = VoxelManager.createRLEVolumeVoxelManager({ dimensions: [width, height, 1] }); image.getPixelData = image.voxelManager.getPixelData; image.sizeInBytes = DEFAULT_RLE_SIZE; } } /***/ }, /***/ 36506 /*!***************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/actorCheck.js ***! \***************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ actorIsA: () => (/* binding */ actorIsA), /* harmony export */ isImageActor: () => (/* binding */ isImageActor) /* harmony export */ }); function isImageActor(actorEntry) { return actorIsA(actorEntry, 'vtkVolume') || actorIsA(actorEntry, 'vtkImageSlice'); } function actorIsA(actorEntry, actorType) { const actorToCheck = 'isA' in actorEntry ? actorEntry : actorEntry.actor; if (!actorToCheck) { return false; } return !!actorToCheck.isA(actorType); } /***/ }, /***/ 91720 /*!************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/adjustInitialViewUp.js ***! \************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ adjustInitialViewUp: () => (/* binding */ adjustInitialViewUp) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _reflectVector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./reflectVector */ 51951); function adjustInitialViewUp(initialViewUp, flipHorizontal, flipVertical, viewPlaneNormal) { let adjustedInitialViewUp = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.clone(initialViewUp); if (flipVertical) { gl_matrix__WEBPACK_IMPORTED_MODULE_0__.negate(adjustedInitialViewUp, adjustedInitialViewUp); } if (flipHorizontal) { const screenVerticalAxis = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.cross(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), viewPlaneNormal, adjustedInitialViewUp); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.normalize(screenVerticalAxis, screenVerticalAxis); adjustedInitialViewUp = (0,_reflectVector__WEBPACK_IMPORTED_MODULE_1__.reflectVector)(adjustedInitialViewUp, screenVerticalAxis); } return adjustedInitialViewUp; } /***/ }, /***/ 92574 /*!****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/applyPreset.js ***! \****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ applyPreset) /* harmony export */ }); /* harmony import */ var _kitware_vtk_js_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/ColorTransferFunction */ 15722); /* harmony import */ var _kitware_vtk_js_Common_DataModel_PiecewiseFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @kitware/vtk.js/Common/DataModel/PiecewiseFunction */ 53173); function applyPreset(actor, preset) { const colorTransferArray = preset.colorTransfer.split(' ').splice(1).map(parseFloat); const { shiftRange } = getShiftRange(colorTransferArray); const min = shiftRange[0]; const width = shiftRange[1] - shiftRange[0]; const cfun = _kitware_vtk_js_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_0__["default"].newInstance(); const normColorTransferValuePoints = []; for (let i = 0; i < colorTransferArray.length; i += 4) { let value = colorTransferArray[i]; const r = colorTransferArray[i + 1]; const g = colorTransferArray[i + 2]; const b = colorTransferArray[i + 3]; value = (value - min) / width; normColorTransferValuePoints.push([value, r, g, b]); } applyPointsToRGBFunction(normColorTransferValuePoints, shiftRange, cfun); actor.getProperty().setRGBTransferFunction(0, cfun); const scalarOpacityArray = preset.scalarOpacity.split(' ').splice(1).map(parseFloat); const ofun = _kitware_vtk_js_Common_DataModel_PiecewiseFunction__WEBPACK_IMPORTED_MODULE_1__["default"].newInstance(); const normPoints = []; for (let i = 0; i < scalarOpacityArray.length; i += 2) { let value = scalarOpacityArray[i]; const opacity = scalarOpacityArray[i + 1]; value = (value - min) / width; normPoints.push([value, opacity]); } applyPointsToPiecewiseFunction(normPoints, shiftRange, ofun); const property = actor.getProperty(); property.setScalarOpacity(0, ofun); const [gradientMinValue, gradientMinOpacity, gradientMaxValue, gradientMaxOpacity] = preset.gradientOpacity.split(' ').splice(1).map(parseFloat); property.setUseGradientOpacity(0, true); property.setGradientOpacityMinimumValue(0, gradientMinValue); property.setGradientOpacityMinimumOpacity(0, gradientMinOpacity); property.setGradientOpacityMaximumValue(0, gradientMaxValue); property.setGradientOpacityMaximumOpacity(0, gradientMaxOpacity); if (preset.interpolation === '1') { property.setInterpolationTypeToFastLinear(); } property.setShade(preset.shade === '1'); const ambient = parseFloat(preset.ambient); const diffuse = parseFloat(preset.diffuse); const specular = parseFloat(preset.specular); const specularPower = parseFloat(preset.specularPower); property.setAmbient(ambient); property.setDiffuse(diffuse); property.setSpecular(specular); property.setSpecularPower(specularPower); } function getShiftRange(colorTransferArray) { let min = Infinity; let max = -Infinity; for (let i = 0; i < colorTransferArray.length; i += 4) { min = Math.min(min, colorTransferArray[i]); max = Math.max(max, colorTransferArray[i]); } const center = (max - min) / 2; return { shiftRange: [-center, center], min, max }; } function applyPointsToRGBFunction(points, range, cfun) { const width = range[1] - range[0]; const rescaled = points.map(([x, r, g, b]) => [x * width + range[0], r, g, b]); cfun.removeAllPoints(); rescaled.forEach(([x, r, g, b]) => cfun.addRGBPoint(x, r, g, b)); return rescaled; } function applyPointsToPiecewiseFunction(points, range, pwf) { const width = range[1] - range[0]; const rescaled = points.map(([x, y]) => [x * width + range[0], y]); pwf.removeAllPoints(); rescaled.forEach(([x, y]) => pwf.addPoint(x, y)); return rescaled; } /***/ }, /***/ 74744 /*!************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/asArray.js ***! \************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ asArray: () => (/* binding */ asArray) /* harmony export */ }); function asArray(item) { if (Array.isArray(item)) { return item; } return [item]; } /***/ }, /***/ 47214 /*!*************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/autoLoad.js ***! \*************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _RenderingEngine_getRenderingEngine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../RenderingEngine/getRenderingEngine */ 77569); /* harmony import */ var _getViewportsWithVolumeId__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getViewportsWithVolumeId */ 47289); const autoLoad = volumeId => { const renderingEngineAndViewportIds = getRenderingEngineAndViewportsContainingVolume(volumeId); if (!renderingEngineAndViewportIds?.length) { return; } renderingEngineAndViewportIds.forEach(({ renderingEngine, viewportIds }) => { if (!renderingEngine.hasBeenDestroyed) { renderingEngine.renderViewports(viewportIds); } }); }; function getRenderingEngineAndViewportsContainingVolume(volumeId) { const renderingEnginesArray = (0,_RenderingEngine_getRenderingEngine__WEBPACK_IMPORTED_MODULE_0__.getRenderingEngines)(); const renderingEngineAndViewportIds = []; renderingEnginesArray.forEach(renderingEngine => { const viewports = (0,_getViewportsWithVolumeId__WEBPACK_IMPORTED_MODULE_1__["default"])(volumeId); if (viewports.length) { renderingEngineAndViewportIds.push({ renderingEngine, viewportIds: viewports.map(viewport => viewport.id) }); } }); return renderingEngineAndViewportIds; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (autoLoad); /***/ }, /***/ 15856 /*!******************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/buildMetadata.js ***! \******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ buildMetadata: () => (/* binding */ buildMetadata), /* harmony export */ calibrateImagePlaneModule: () => (/* binding */ calibrateImagePlaneModule), /* harmony export */ getImagePlaneModule: () => (/* binding */ getImagePlaneModule), /* harmony export */ getValidVOILUTFunction: () => (/* binding */ getValidVOILUTFunction) /* harmony export */ }); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../metaData */ 90161); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums */ 78700); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enums */ 94649); function getValidVOILUTFunction(voiLUTFunction) { if (!Object.values(_enums__WEBPACK_IMPORTED_MODULE_1__["default"]).includes(voiLUTFunction)) { return _enums__WEBPACK_IMPORTED_MODULE_1__["default"].LINEAR; } return voiLUTFunction; } function getImagePlaneModule(imageId) { const imagePlaneModule = _metaData__WEBPACK_IMPORTED_MODULE_0__.get(_enums__WEBPACK_IMPORTED_MODULE_2__["default"].IMAGE_PLANE, imageId); const newImagePlaneModule = { ...imagePlaneModule }; if (!newImagePlaneModule.columnPixelSpacing) { newImagePlaneModule.columnPixelSpacing = 1; } if (!newImagePlaneModule.rowPixelSpacing) { newImagePlaneModule.rowPixelSpacing = 1; } if (!newImagePlaneModule.columnCosines) { newImagePlaneModule.columnCosines = [0, 1, 0]; } if (!newImagePlaneModule.rowCosines) { newImagePlaneModule.rowCosines = [1, 0, 0]; } if (!newImagePlaneModule.imagePositionPatient) { newImagePlaneModule.imagePositionPatient = [0, 0, 0]; } if (!newImagePlaneModule.imageOrientationPatient) { newImagePlaneModule.imageOrientationPatient = new Float32Array([1, 0, 0, 0, 1, 0]); } return newImagePlaneModule; } function calibrateImagePlaneModule(imageId, imagePlaneModule, currentCalibration) { const calibration = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('calibratedPixelSpacing', imageId); const isUpdated = currentCalibration !== calibration; const { scale } = calibration || {}; const hasPixelSpacing = scale > 0 || imagePlaneModule.rowPixelSpacing > 0; imagePlaneModule.calibration = calibration; if (!isUpdated) { return { imagePlaneModule, hasPixelSpacing }; } return { imagePlaneModule, hasPixelSpacing, calibrationEvent: { scale, calibration } }; } function buildMetadata(image) { const imageId = image.imageId; const { pixelRepresentation, bitsAllocated, bitsStored, highBit, photometricInterpretation, samplesPerPixel } = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('imagePixelModule', imageId); const { windowWidth, windowCenter, voiLUTFunction } = image; const { modality } = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('generalSeriesModule', imageId); const imageIdScalingFactor = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('scalingModule', imageId); const calibration = _metaData__WEBPACK_IMPORTED_MODULE_0__.get(_enums__WEBPACK_IMPORTED_MODULE_2__["default"].CALIBRATION, imageId); const voiLUTFunctionEnum = getValidVOILUTFunction(voiLUTFunction); const imagePlaneModule = getImagePlaneModule(imageId); return { calibration, scalingFactor: imageIdScalingFactor, voiLUTFunction: voiLUTFunctionEnum, modality, imagePlaneModule, imagePixelModule: { bitsAllocated, bitsStored, samplesPerPixel, highBit, photometricInterpretation, pixelRepresentation, windowWidth: windowWidth, windowCenter: windowCenter, modality, voiLUTFunction: voiLUTFunctionEnum } }; } /***/ }, /***/ 88106 /*!*******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/calculateNeighborhoodStats.js ***! \*******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ calculateNeighborhoodStats: () => (/* binding */ calculateNeighborhoodStats) /* harmony export */ }); function calculateNeighborhoodStats(scalarData, dimensions, centerIjk, radius) { const [width, height, numSlices] = dimensions; const numPixelsPerSlice = width * height; let sum = 0; let sumSq = 0; let count = 0; const [cx, cy, cz] = centerIjk.map(Math.round); for (let z = cz - radius; z <= cz + radius; z++) { if (z < 0 || z >= numSlices) { continue; } for (let y = cy - radius; y <= cy + radius; y++) { if (y < 0 || y >= height) { continue; } for (let x = cx - radius; x <= cx + radius; x++) { if (x < 0 || x >= width) { continue; } const index = z * numPixelsPerSlice + y * width + x; const value = scalarData[index]; sum += value; sumSq += value * value; count++; } } } if (count === 0) { const centerIndex = cz * numPixelsPerSlice + cy * width + cx; if (centerIndex >= 0 && centerIndex < scalarData.length) { const centerValue = scalarData[centerIndex]; return { mean: centerValue, stdDev: 0, count: 1 }; } else { return { mean: 0, stdDev: 0, count: 0 }; } } const mean = sum / count; const variance = sumSq / count - mean * mean; const stdDev = Math.sqrt(Math.max(0, variance)); return { mean, stdDev, count }; } /***/ }, /***/ 95715 /*!************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/calculateSpacingBetweenImageIds.js ***! \************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ calculateSpacingBetweenImageIds) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../metaData */ 90161); /* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../init */ 15678); const DEFAULT_THICKNESS_SINGLE_SLICE = 1; function getPixelSpacingForCubicVoxel(metadata) { if (metadata.columnPixelSpacing !== undefined) { return metadata.columnPixelSpacing; } if (metadata.rowPixelSpacing !== undefined) { return metadata.rowPixelSpacing; } if (metadata.pixelSpacing?.[1] !== undefined) { return metadata.pixelSpacing[1]; } if (metadata.pixelSpacing?.[0] !== undefined) { return metadata.pixelSpacing[0]; } return undefined; } function calculateSpacingBetweenImageIds(imageIds) { const { imagePositionPatient: referenceImagePositionPatient, imageOrientationPatient } = _metaData__WEBPACK_IMPORTED_MODULE_1__.get('imagePlaneModule', imageIds[0]); if (imageIds.length === 1) { const { sliceThickness, spacingBetweenSlices, columnPixelSpacing, rowPixelSpacing, pixelSpacing } = _metaData__WEBPACK_IMPORTED_MODULE_1__.get('imagePlaneModule', imageIds[0]); if (sliceThickness) return sliceThickness; if (spacingBetweenSlices) return spacingBetweenSlices; const pixelSpacingValue = getPixelSpacingForCubicVoxel({ columnPixelSpacing, rowPixelSpacing, pixelSpacing }); if (pixelSpacingValue !== undefined) { return pixelSpacingValue; } return DEFAULT_THICKNESS_SINGLE_SLICE; } const rowCosineVec = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.fromValues(imageOrientationPatient[0], imageOrientationPatient[1], imageOrientationPatient[2]); const colCosineVec = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.fromValues(imageOrientationPatient[3], imageOrientationPatient[4], imageOrientationPatient[5]); const scanAxisNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.cross(scanAxisNormal, rowCosineVec, colCosineVec); const refIppVec = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.fromValues(referenceImagePositionPatient[0], referenceImagePositionPatient[1], referenceImagePositionPatient[2]); const usingWadoUri = imageIds[0].split(':')[0] === 'wadouri'; let spacing; function getDistance(imageId) { const { imagePositionPatient } = _metaData__WEBPACK_IMPORTED_MODULE_1__.get('imagePlaneModule', imageId); const positionVector = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); const ippVec = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.fromValues(imagePositionPatient[0], imagePositionPatient[1], imagePositionPatient[2]); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.sub(positionVector, refIppVec, ippVec); return gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(positionVector, scanAxisNormal); } if (!usingWadoUri) { const distanceImagePairs = imageIds.map(imageId => { const distance = getDistance(imageId); return { distance, imageId }; }); distanceImagePairs.sort((a, b) => b.distance - a.distance); const numImages = distanceImagePairs.length; spacing = Math.abs(distanceImagePairs[numImages - 1].distance - distanceImagePairs[0].distance) / (numImages - 1); } else { const prefetchedImageIds = [imageIds[0], imageIds[Math.floor(imageIds.length / 2)]]; const metadataForMiddleImage = _metaData__WEBPACK_IMPORTED_MODULE_1__.get('imagePlaneModule', prefetchedImageIds[1]); if (!metadataForMiddleImage) { throw new Error('Incomplete metadata required for volume construction.'); } const positionVector = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); const middleIppVec = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.fromValues(metadataForMiddleImage.imagePositionPatient[0], metadataForMiddleImage.imagePositionPatient[1], metadataForMiddleImage.imagePositionPatient[2]); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.sub(positionVector, refIppVec, middleIppVec); const distanceBetweenFirstAndMiddleImages = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(positionVector, scanAxisNormal); spacing = Math.abs(distanceBetweenFirstAndMiddleImages) / Math.floor(imageIds.length / 2); } const { sliceThickness, spacingBetweenSlices, columnPixelSpacing, rowPixelSpacing, pixelSpacing } = _metaData__WEBPACK_IMPORTED_MODULE_1__.get('imagePlaneModule', imageIds[0]); const { strictZSpacingForVolumeViewport } = (0,_init__WEBPACK_IMPORTED_MODULE_2__.getConfiguration)().rendering; if ((spacing === 0 || isNaN(spacing)) && !strictZSpacingForVolumeViewport) { if (spacingBetweenSlices) { console.debug('Could not calculate spacing. Using spacingBetweenSlices'); spacing = spacingBetweenSlices; } else if (sliceThickness) { console.debug('Could not calculate spacing and no spacingBetweenSlices. Using sliceThickness'); spacing = sliceThickness; } else { const pixelSpacingValue = getPixelSpacingForCubicVoxel({ columnPixelSpacing, rowPixelSpacing, pixelSpacing }); if (pixelSpacingValue) { spacing = pixelSpacingValue; } else { console.debug(`Could not calculate spacing and no pixel spacing found. Using default thickness (${DEFAULT_THICKNESS_SINGLE_SLICE} mm)`); spacing = DEFAULT_THICKNESS_SINGLE_SLICE; } } } return spacing; } /***/ }, /***/ 49189 /*!******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/calculateViewportsSpatialRegistration.js ***! \******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 95329); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _spatialRegistrationMetadataProvider__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./spatialRegistrationMetadataProvider */ 22676); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../metaData */ 90161); const ALLOWED_DELTA = 0.05; function calculateViewportsSpatialRegistration(viewport1, viewport2) { const imageId1 = viewport1.getSliceIndex(); const imageId2 = viewport2.getSliceIndex(); const imagePlaneModule1 = (0,_metaData__WEBPACK_IMPORTED_MODULE_3__.get)('imagePlaneModule', imageId1.toString()); const imagePlaneModule2 = (0,_metaData__WEBPACK_IMPORTED_MODULE_3__.get)('imagePlaneModule', imageId2.toString()); if (!imagePlaneModule1 || !imagePlaneModule2) { console.log('Viewport spatial registration requires image plane module'); return; } const { imageOrientationPatient: iop2 } = imagePlaneModule2; const isSameImagePlane = imagePlaneModule1.imageOrientationPatient.every((v, i) => Math.abs(v - iop2[i]) < ALLOWED_DELTA); if (!isSameImagePlane) { console.log('Viewport spatial registration only supported for same orientation (hence translation only) for now', imagePlaneModule1?.imageOrientationPatient, imagePlaneModule2?.imageOrientationPatient); return; } const imagePositionPatient1 = imagePlaneModule1.imagePositionPatient; const imagePositionPatient2 = imagePlaneModule2.imagePositionPatient; const translation = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(), imagePositionPatient1, imagePositionPatient2); const mat = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.fromTranslation(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), translation); _spatialRegistrationMetadataProvider__WEBPACK_IMPORTED_MODULE_2__["default"].add([viewport1.id, viewport2.id], mat); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (calculateViewportsSpatialRegistration); /***/ }, /***/ 81551 /*!*******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/calibratedPixelSpacingMetadataProvider.js ***! \*******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _imageIdToURI__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./imageIdToURI */ 40232); const state = {}; const metadataProvider = { add: (imageId, payload) => { const imageURI = (0,_imageIdToURI__WEBPACK_IMPORTED_MODULE_0__["default"])(imageId); state[imageURI] = payload; }, get: (type, imageId) => { if (type === 'calibratedPixelSpacing') { const imageURI = (0,_imageIdToURI__WEBPACK_IMPORTED_MODULE_0__["default"])(imageId); return state[imageURI]; } } }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (metadataProvider); /***/ }, /***/ 67966 /*!**********************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/clamp.js ***! \**********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ clamp: () => (/* binding */ clamp), /* harmony export */ "default": () => (/* binding */ clamp) /* harmony export */ }); function clamp(value, min, max) { return Math.max(min, Math.min(max, value)); } /***/ }, /***/ 58351 /*!*********************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/clip.js ***! \*********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ clip: () => (/* binding */ clip), /* harmony export */ clipToBox: () => (/* binding */ clipToBox), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); function clip(val, low, high) { return Math.min(Math.max(low, val), high); } function clipToBox(point, box) { point.x = clip(point.x, 0, box.width); point.y = clip(point.y, 0, box.height); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (clip); /***/ }, /***/ 24541 /*!**********************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/color.js ***! \**********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ hexToRgb: () => (/* binding */ hexToRgb), /* harmony export */ rgbToHex: () => (/* binding */ rgbToHex) /* harmony export */ }); function componentToHex(c) { const hex = c.toString(16); return hex.length == 1 ? '0' + hex : hex; } function rgbToHex(r, g, b) { return '#' + componentToHex(r) + componentToHex(g) + componentToHex(b); } function hexToRgb(hex) { const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex); return result ? { r: parseInt(result[1], 16), g: parseInt(result[2], 16), b: parseInt(result[3], 16) } : null; } /***/ }, /***/ 33358 /*!*************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/colormap.js ***! \*************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ findMatchingColormap: () => (/* binding */ findMatchingColormap), /* harmony export */ getColormap: () => (/* binding */ getColormap), /* harmony export */ getColormapNames: () => (/* binding */ getColormapNames), /* harmony export */ getMaxOpacity: () => (/* binding */ getMaxOpacity), /* harmony export */ getThresholdValue: () => (/* binding */ getThresholdValue), /* harmony export */ registerColormap: () => (/* binding */ registerColormap), /* harmony export */ setColorMapTransferFunctionForVolumeActor: () => (/* binding */ setColorMapTransferFunctionForVolumeActor), /* harmony export */ updateOpacity: () => (/* binding */ updateOpacity), /* harmony export */ updateThreshold: () => (/* binding */ updateThreshold) /* harmony export */ }); /* harmony import */ var _kitware_vtk_js_Rendering_Core_ColorTransferFunction_ColorMaps__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/ColorTransferFunction/ColorMaps */ 56609); /* harmony import */ var _kitware_vtk_js_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/ColorTransferFunction */ 15722); /* harmony import */ var _kitware_vtk_js_Common_DataModel_PiecewiseFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @kitware/vtk.js/Common/DataModel/PiecewiseFunction */ 53173); /* harmony import */ var _isEqual__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./isEqual */ 17137); /* harmony import */ var _actorCheck__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./actorCheck */ 36506); const _colormaps = new Map(); function registerColormap(colormap) { colormap.name = colormap.name || colormap.Name; _colormaps.set(colormap.name, colormap); } function getColormap(name) { return _colormaps.get(name); } function getColormapNames() { return Array.from(_colormaps.keys()); } function findMatchingColormap(rgbPoints, actor) { const colormapsVTK = _kitware_vtk_js_Rendering_Core_ColorTransferFunction_ColorMaps__WEBPACK_IMPORTED_MODULE_0__["default"].rgbPresetNames.map(presetName => _kitware_vtk_js_Rendering_Core_ColorTransferFunction_ColorMaps__WEBPACK_IMPORTED_MODULE_0__["default"].getPresetByName(presetName)); const colormapsCS3D = getColormapNames().map(colormapName => getColormap(colormapName)); const colormaps = colormapsVTK.concat(colormapsCS3D); const matchedColormap = colormaps.find(colormap => { const { RGBPoints: presetRGBPoints } = colormap; if (presetRGBPoints.length !== rgbPoints.length) { return false; } for (let i = 0; i < presetRGBPoints.length; i += 4) { if (!(0,_isEqual__WEBPACK_IMPORTED_MODULE_3__["default"])(presetRGBPoints.slice(i + 1, i + 4), rgbPoints.slice(i + 1, i + 4))) { return false; } } return true; }); if (!matchedColormap) { return null; } const opacity = []; if ((0,_actorCheck__WEBPACK_IMPORTED_MODULE_4__.actorIsA)(actor, 'vtkVolume')) { const opacityPoints = actor.getProperty().getScalarOpacity(0).getDataPointer(); if (!opacityPoints) { return { name: matchedColormap.Name }; } for (let i = 0; i < opacityPoints.length; i += 2) { opacity.push({ value: opacityPoints[i], opacity: opacityPoints[i + 1] }); } } const result = { name: matchedColormap.Name, ...(Array.isArray(opacity) && opacity.length > 0 && { opacity }), ...(typeof opacity === 'number' && { opacity }) }; return result; } function setColorMapTransferFunctionForVolumeActor(volumeInfo) { const { volumeActor, preset, opacity = 0.9, threshold = null, colorRange = [0, 5] } = volumeInfo; const mapper = volumeActor.getMapper(); mapper.setSampleDistance(1.0); const cfun = _kitware_vtk_js_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_1__["default"].newInstance(); const presetToUse = preset || _kitware_vtk_js_Rendering_Core_ColorTransferFunction_ColorMaps__WEBPACK_IMPORTED_MODULE_0__["default"].getPresetByName('hsv'); cfun.applyColorMap(presetToUse); cfun.setMappingRange(colorRange[0], colorRange[1]); volumeActor.getProperty().setRGBTransferFunction(0, cfun); updateOpacityWithThreshold(volumeActor, opacity, threshold); } function updateOpacity(volumeActor, newOpacity) { const currentThreshold = getThresholdValue(volumeActor); updateOpacityWithThreshold(volumeActor, newOpacity, currentThreshold); } function updateThreshold(volumeActor, newThreshold) { const currentOpacity = getMaxOpacity(volumeActor); updateOpacityWithThreshold(volumeActor, currentOpacity, newThreshold); } function updateOpacityWithThreshold(volumeActor, opacity, threshold) { const meta = volumeActor.getMapper().getInputData().get('voxelManager'); if (!meta?.voxelManager) { throw new Error('No voxel manager was found for the volume actor, or you cannot yet update opacity with a threshold using stacked images'); } const range = meta.voxelManager.getRange(); const ofun = _kitware_vtk_js_Common_DataModel_PiecewiseFunction__WEBPACK_IMPORTED_MODULE_2__["default"].newInstance(); if (threshold !== null) { const delta = Math.abs(range[1] - range[0]) * 0.001; const thresholdValue = Math.max(range[0], Math.min(range[1], threshold)); ofun.addPoint(range[0], 0); ofun.addPoint(thresholdValue - delta, 0); ofun.addPoint(thresholdValue, opacity); ofun.addPoint(range[1], opacity); } else { ofun.addPoint(range[0], opacity); ofun.addPoint(range[1], opacity); } volumeActor.getProperty().setScalarOpacity(0, ofun); } function getThresholdValue(volumeActor) { const opacityFunction = volumeActor.getProperty().getScalarOpacity(0); if (!opacityFunction) { return null; } const dataArray = opacityFunction.getDataPointer(); if (!dataArray || dataArray.length <= 4) { return null; } for (let i = 0; i < dataArray.length - 2; i += 2) { const x1 = dataArray[i]; const y1 = dataArray[i + 1]; const x2 = dataArray[i + 2]; const y2 = dataArray[i + 3]; if (y1 === 0 && y2 > 0) { return x2; } } return null; } function getMaxOpacity(volumeActor) { const opacityFunction = volumeActor.getProperty().getScalarOpacity(0); if (!opacityFunction) { return 1.0; } const dataArray = opacityFunction.getDataPointer(); if (!dataArray || dataArray.length === 0) { return 1.0; } let maxOpacity = 0; for (let i = 1; i < dataArray.length; i += 2) { if (dataArray[i] > maxOpacity) { maxOpacity = dataArray[i]; } } return maxOpacity; } /***/ }, /***/ 12685 /*!*********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/convertColorArrayToRgbString.js ***! \*********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ convertColorArrayToRgbString: () => (/* binding */ convertColorArrayToRgbString) /* harmony export */ }); function convertColorArrayToRgbString(colorArr) { return Array.isArray(colorArr) ? `rgb(${colorArr.map(v => Math.round(v * 255)).join(',')})` : colorArr; } /***/ }, /***/ 15793 /*!*********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/convertStackToVolumeViewport.js ***! \*********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ convertStackToVolumeViewport: () => (/* binding */ convertStackToVolumeViewport) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _RenderingEngine_helpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../RenderingEngine/helpers */ 22528); /* harmony import */ var _loaders_volumeLoader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../loaders/volumeLoader */ 10372); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../enums */ 14566); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../enums */ 43089); /* harmony import */ var _uuidv4__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./uuidv4 */ 29760); function convertStackToVolumeViewport(_x) { return _convertStackToVolumeViewport.apply(this, arguments); } function _convertStackToVolumeViewport() { _convertStackToVolumeViewport = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* ({ viewport, options = {} }) { const renderingEngine = viewport.getRenderingEngine(); let volumeId = options.volumeId || `${(0,_uuidv4__WEBPACK_IMPORTED_MODULE_5__["default"])()}`; if (volumeId.split(':').length === 0) { const schema = (0,_loaders_volumeLoader__WEBPACK_IMPORTED_MODULE_2__.getUnknownVolumeLoaderSchema)(); volumeId = `${schema}:${volumeId}`; } const { id, element } = viewport; const viewportId = options.viewportId || id; const imageIds = viewport.getImageIds(); const prevViewPresentation = viewport.getViewPresentation(); const prevViewReference = viewport.getViewReference(); renderingEngine.enableElement({ viewportId, type: _enums__WEBPACK_IMPORTED_MODULE_4__["default"].ORTHOGRAPHIC, element, defaultOptions: { background: options.background, orientation: options.orientation } }); const volume = yield (0,_loaders_volumeLoader__WEBPACK_IMPORTED_MODULE_2__.createAndCacheVolume)(volumeId, { imageIds }); volume.load(); const volumeViewport = renderingEngine.getViewport(viewportId); yield (0,_RenderingEngine_helpers__WEBPACK_IMPORTED_MODULE_1__["default"])(renderingEngine, [{ volumeId }], [viewportId]); const volumeViewportNewVolumeHandler = () => { volumeViewport.render(); element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].VOLUME_VIEWPORT_NEW_VOLUME, volumeViewportNewVolumeHandler); }; const addVolumeViewportNewVolumeListener = () => { element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].VOLUME_VIEWPORT_NEW_VOLUME, volumeViewportNewVolumeHandler); }; addVolumeViewportNewVolumeListener(); volumeViewport.setViewPresentation(prevViewPresentation); volumeViewport.setViewReference(prevViewReference); volumeViewport.render(); return volumeViewport; }); return _convertStackToVolumeViewport.apply(this, arguments); } /***/ }, /***/ 99824 /*!***********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/convertToGrayscale.js ***! \***********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ convertToGrayscale) /* harmony export */ }); function convertToGrayscale(scalarData, width, height) { const isRGBA = scalarData.length === width * height * 4; const isRGB = scalarData.length === width * height * 3; if (isRGBA || isRGB) { const newScalarData = new Float32Array(width * height); let offset = 0; let destOffset = 0; const increment = isRGBA ? 4 : 3; for (let x = 0; x < width; x++) { for (let y = 0; y < height; y++) { const r = scalarData[offset]; const g = scalarData[offset + 1]; const b = scalarData[offset + 2]; newScalarData[destOffset] = (r + g + b) / 3; offset += increment; destOffset++; } } return newScalarData; } else { return scalarData; } } /***/ }, /***/ 20515 /*!*********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/convertVolumeToStackViewport.js ***! \*********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ convertVolumeToStackViewport: () => (/* binding */ convertVolumeToStackViewport) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../cache/cache */ 38277); /* harmony import */ var _cache_classes_ImageVolume__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../cache/classes/ImageVolume */ 92367); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../enums */ 43089); function convertVolumeToStackViewport(_x) { return _convertVolumeToStackViewport.apply(this, arguments); } function _convertVolumeToStackViewport() { _convertVolumeToStackViewport = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* ({ viewport, options }) { const volumeViewport = viewport; const { id, element } = volumeViewport; const renderingEngine = viewport.getRenderingEngine(); const { background } = options; const viewportId = options.viewportId || id; const volume = _cache_cache__WEBPACK_IMPORTED_MODULE_1__["default"].getVolume(volumeViewport.getVolumeId()); if (!(volume instanceof _cache_classes_ImageVolume__WEBPACK_IMPORTED_MODULE_2__.ImageVolume)) { throw new Error('Currently, you cannot decache a volume that is not an ImageVolume. So, unfortunately, volumes such as nifti (which are basic Volume, without imageIds) cannot be decached.'); } const viewportInput = { viewportId, type: _enums__WEBPACK_IMPORTED_MODULE_3__["default"].STACK, element, defaultOptions: { background } }; const prevView = volumeViewport.getViewReference(); renderingEngine.enableElement(viewportInput); const stackViewport = renderingEngine.getViewport(viewportId); yield stackViewport.setStack(volume.imageIds); stackViewport.setViewReference(prevView); stackViewport.render(); return stackViewport; }); return _convertVolumeToStackViewport.apply(this, arguments); } /***/ }, /***/ 59022 /*!************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/createLinearRGBTransferFunction.js ***! \************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ createLinearRGBTransferFunction) /* harmony export */ }); /* harmony import */ var _kitware_vtk_js_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/ColorTransferFunction */ 15722); function createLinearRGBTransferFunction(voiRange) { const cfun = _kitware_vtk_js_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_0__["default"].newInstance(); let lower = 0; let upper = 1024; if (voiRange.lower !== undefined && voiRange.upper !== undefined) { lower = voiRange.lower; upper = voiRange.upper; } cfun.addRGBPoint(lower, 0.0, 0.0, 0.0); cfun.addRGBPoint(upper, 1.0, 1.0, 1.0); return cfun; } /***/ }, /***/ 857 /*!***************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/createPositionCallback.js ***! \***************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ createPositionCallback: () => (/* binding */ createPositionCallback) /* harmony export */ }); /* harmony import */ var gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix/vec3 */ 87396); /* harmony import */ var _PointsManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PointsManager */ 66631); function createPositionCallback(imageData) { const currentPos = gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_0__.create(); const dimensions = imageData.getDimensions(); const positionI = _PointsManager__WEBPACK_IMPORTED_MODULE_1__["default"].create3(dimensions[0]); const positionJ = _PointsManager__WEBPACK_IMPORTED_MODULE_1__["default"].create3(dimensions[1]); const positionK = _PointsManager__WEBPACK_IMPORTED_MODULE_1__["default"].create3(dimensions[2]); const direction = imageData.getDirection(); const rowCosines = direction.slice(0, 3); const columnCosines = direction.slice(3, 6); const scanAxisNormal = direction.slice(6, 9); const spacing = imageData.getSpacing(); const [rowSpacing, columnSpacing, scanAxisSpacing] = spacing; const worldPosStart = imageData.indexToWorld([0, 0, 0]); const rowStep = gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_0__.fromValues(rowCosines[0] * rowSpacing, rowCosines[1] * rowSpacing, rowCosines[2] * rowSpacing); const columnStep = gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_0__.fromValues(columnCosines[0] * columnSpacing, columnCosines[1] * columnSpacing, columnCosines[2] * columnSpacing); const scanAxisStep = gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_0__.fromValues(scanAxisNormal[0] * scanAxisSpacing, scanAxisNormal[1] * scanAxisSpacing, scanAxisNormal[2] * scanAxisSpacing); const scaled = gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_0__.create(); for (let i = 0; i < dimensions[0]; i++) { positionI.push(gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_0__.add(scaled, worldPosStart, gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_0__.scale(scaled, rowStep, i))); } for (let j = 0; j < dimensions[1]; j++) { positionJ.push(gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_0__.scale(scaled, columnStep, j)); } for (let k = 0; k < dimensions[2]; k++) { positionK.push(gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_0__.scale(scaled, scanAxisStep, k)); } const dataI = positionI.getTypedArray(); const dataJ = positionJ.getTypedArray(); const dataK = positionK.getTypedArray(); return (ijk, destPoint = currentPos) => { const [i, j, k] = ijk; const offsetI = i * 3; const offsetJ = j * 3; const offsetK = k * 3; destPoint[0] = dataI[offsetI] + dataJ[offsetJ] + dataK[offsetK]; destPoint[1] = dataI[offsetI + 1] + dataJ[offsetJ + 1] + dataK[offsetK + 1]; destPoint[2] = dataI[offsetI + 2] + dataJ[offsetJ + 2] + dataK[offsetK + 2]; return destPoint; }; } /***/ }, /***/ 11469 /*!*************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/createSigmoidRGBTransferFunction.js ***! \*************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ createSigmoidRGBTransferFunction) /* harmony export */ }); /* harmony import */ var _kitware_vtk_js_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/ColorTransferFunction */ 15722); /* harmony import */ var _kitware_vtk_js_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @kitware/vtk.js/Common/Core/DataArray */ 40928); /* harmony import */ var _windowLevel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./windowLevel */ 88871); /* harmony import */ var _logit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./logit */ 57818); function createSigmoidRGBTransferFunction(voiRange, approximationNodes = 1024) { const { windowWidth, windowCenter } = _windowLevel__WEBPACK_IMPORTED_MODULE_2__.toWindowLevel(voiRange.lower, voiRange.upper); const range = Array.from({ length: approximationNodes }, (_, i) => (i + 1) / (approximationNodes + 2)); const table = range.flatMap(y => { const x = (0,_logit__WEBPACK_IMPORTED_MODULE_3__.logit)(y, windowCenter, windowWidth); return [x, y, y, y, 0.5, 0.0]; }); const cfun = _kitware_vtk_js_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_0__["default"].newInstance(); cfun.buildFunctionFromArray(_kitware_vtk_js_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_1__["default"].newInstance({ values: table, numberOfComponents: 6 })); return cfun; } /***/ }, /***/ 50949 /*!********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/createSubVolume.js ***! \********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ createSubVolume: () => (/* binding */ createSubVolume), /* harmony export */ "default": () => (/* binding */ createSubVolume) /* harmony export */ }); /* harmony import */ var _transformWorldToIndex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transformWorldToIndex */ 19598); /* harmony import */ var _transformIndexToWorld__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transformIndexToWorld */ 60214); /* harmony import */ var _uuidv4__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./uuidv4 */ 29760); /* harmony import */ var _loaders_volumeLoader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../loaders/volumeLoader */ 10372); /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../cache/cache */ 38277); function createSubVolume(referencedVolumeId, boundsIJK, options = {}) { const referencedVolume = _cache_cache__WEBPACK_IMPORTED_MODULE_4__["default"].getVolume(referencedVolumeId); if (!referencedVolume) { throw new Error(`Referenced volume with id ${referencedVolumeId} does not exist.`); } const { metadata, spacing, direction, dimensions: refVolumeDim } = referencedVolume; const { minX, maxX, minY, maxY, minZ, maxZ } = boundsIJK; const ijkTopLeft = [Math.min(minX, maxX), Math.min(minY, maxY), Math.min(minZ, maxZ)]; const boundingBoxOriginWorld = (0,_transformIndexToWorld__WEBPACK_IMPORTED_MODULE_1__["default"])(referencedVolume.imageData, ijkTopLeft); const dimensions = [Math.abs(maxX - minX) + 1, Math.abs(maxY - minY) + 1, Math.abs(maxZ - minZ) + 1]; const { targetBuffer } = options; const subVolumeOptions = { metadata, dimensions, spacing, origin: boundingBoxOriginWorld, direction, targetBuffer, scalarData: targetBuffer?.type === 'Float32Array' ? new Float32Array(dimensions[0] * dimensions[1] * dimensions[2]) : undefined }; const subVolume = (0,_loaders_volumeLoader__WEBPACK_IMPORTED_MODULE_3__.createLocalVolume)((0,_uuidv4__WEBPACK_IMPORTED_MODULE_2__["default"])(), subVolumeOptions); const subVolumeData = subVolume.voxelManager.getCompleteScalarDataArray(); const subVolumeSliceSize = dimensions[0] * dimensions[1]; const refVolumeSliceSize = refVolumeDim[0] * refVolumeDim[1]; const refVolumeData = referencedVolume.voxelManager.getCompleteScalarDataArray(); for (let z = 0; z < dimensions[2]; z++) { for (let y = 0; y < dimensions[1]; y++) { const rowStartWorld = (0,_transformIndexToWorld__WEBPACK_IMPORTED_MODULE_1__["default"])(subVolume.imageData, [0, y, z]); const refVolumeRowStartIJK = (0,_transformWorldToIndex__WEBPACK_IMPORTED_MODULE_0__["default"])(referencedVolume.imageData, rowStartWorld); const refVolumeRowStartOffset = refVolumeRowStartIJK[2] * refVolumeSliceSize + refVolumeRowStartIJK[1] * refVolumeDim[0] + refVolumeRowStartIJK[0]; const rowData = refVolumeData.slice(refVolumeRowStartOffset, refVolumeRowStartOffset + dimensions[0]); const subVolumeLineStartOffset = z * subVolumeSliceSize + y * dimensions[0]; subVolumeData.set(rowData, subVolumeLineStartOffset); } } subVolume.voxelManager.setCompleteScalarDataArray(subVolumeData); return subVolume; } /***/ }, /***/ 32167 /*!*************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/decimate.js ***! \*************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ decimate) /* harmony export */ }); function decimate(list, interleave, offset = 0) { const interleaveIndices = []; for (let i = offset; i < list.length; i += interleave) { interleaveIndices.push(i); } return interleaveIndices; } /***/ }, /***/ 47858 /*!**************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/deepClone.js ***! \**************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ deepClone: () => (/* binding */ deepClone) /* harmony export */ }); function deepClone(obj) { if (obj === null || typeof obj !== 'object') { return obj; } if (typeof obj === 'function') { return obj; } if (typeof structuredClone === 'function') { return obj; } if (Array.isArray(obj)) { return obj.map(deepClone); } else { const clonedObj = {}; for (const key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { clonedObj[key] = deepClone(obj[key]); } } return clonedObj; } } /***/ }, /***/ 59355 /*!**************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/deepEqual.js ***! \**************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ deepEqual: () => (/* binding */ deepEqual) /* harmony export */ }); function deepEqual(obj1, obj2) { if (obj1 === obj2) { return true; } if (obj1 == null || obj2 == null) { return false; } try { return JSON.stringify(obj1) === JSON.stringify(obj2); } catch (error) { console.debug('Error in JSON.stringify during deep comparison:', error); return obj1 === obj2; } } /***/ }, /***/ 95892 /*!***************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/deepFreeze.js ***! \***************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); function deepFreeze(object) { const propNames = Object.getOwnPropertyNames(object); for (const name of propNames) { const value = object[name]; if (value && typeof value === 'object') { deepFreeze(value); } } return Object.freeze(object); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (deepFreeze); /***/ }, /***/ 70391 /*!**************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/deepMerge.js ***! \**************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); const isMergeableObject = val => { const nonNullObject = val && typeof val === 'object'; return nonNullObject && Object.prototype.toString.call(val) !== '[object RegExp]' && Object.prototype.toString.call(val) !== '[object Date]'; }; const emptyTarget = val => { const isEmpty = Array.isArray(val) ? [] : {}; return isEmpty; }; const cloneIfNecessary = (value, optionsArgument) => { const clone = optionsArgument && optionsArgument.clone === true; return clone && isMergeableObject(value) ? deepMerge(emptyTarget(value), value, optionsArgument) : value; }; const defaultArrayMerge = (target, source, optionsArgument) => { const destination = target.slice(); source.forEach(function (e, i) { if (typeof destination[i] === 'undefined') { destination[i] = cloneIfNecessary(e, optionsArgument); } else if (isMergeableObject(e)) { destination[i] = deepMerge(target[i], e, optionsArgument); } else if (target.indexOf(e) === -1) { destination[i] = cloneIfNecessary(e, optionsArgument); } }); return destination; }; const mergeObject = (target, source, optionsArgument) => { const destination = {}; if (isMergeableObject(target)) { Object.keys(target).forEach(function (key) { destination[key] = cloneIfNecessary(target[key], optionsArgument); }); } Object.keys(source).forEach(function (key) { if (!isMergeableObject(source[key]) || !target[key]) { destination[key] = cloneIfNecessary(source[key], optionsArgument); } else { destination[key] = deepMerge(target[key], source[key], optionsArgument); } }); return destination; }; const deepMerge = (target = {}, source = {}, optionsArgument = undefined) => { const array = Array.isArray(source); const options = optionsArgument || { arrayMerge: defaultArrayMerge }; const arrayMerge = options.arrayMerge || defaultArrayMerge; if (array) { return Array.isArray(target) ? arrayMerge(target, source, optionsArgument) : cloneIfNecessary(source, optionsArgument); } return mergeObject(target, source, optionsArgument); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (deepMerge); /***/ }, /***/ 50705 /*!**************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/eventListener/MultiTargetEventListenerManager.js ***! \**************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ MultiTargetEventListenerManager: () => (/* binding */ MultiTargetEventListenerManager), /* harmony export */ "default": () => (/* binding */ MultiTargetEventListenerManager) /* harmony export */ }); /* harmony import */ var _TargetEventListeners__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TargetEventListeners */ 17748); class MultiTargetEventListenerManager { constructor() { this._targetsEventListeners = new Map(); } addEventListener(target, type, callback, options) { let eventListeners = this._targetsEventListeners.get(target); if (!eventListeners) { eventListeners = new _TargetEventListeners__WEBPACK_IMPORTED_MODULE_0__["default"](target); this._targetsEventListeners.set(target, eventListeners); } eventListeners.addEventListener(type, callback, options); } removeEventListener(target, type, callback, options) { const eventListeners = this._targetsEventListeners.get(target); if (!eventListeners) { return; } eventListeners.removeEventListener(type, callback, options); if (eventListeners.isEmpty) { this._targetsEventListeners.delete(target); } } reset() { Array.from(this._targetsEventListeners.entries()).forEach(([target, targetEventListeners]) => { targetEventListeners.reset(); this._targetsEventListeners.delete(target); }); } } /***/ }, /***/ 17748 /*!***************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/eventListener/TargetEventListeners.js ***! \***************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ TargetEventListeners: () => (/* binding */ TargetEventListeners), /* harmony export */ "default": () => (/* binding */ TargetEventListeners) /* harmony export */ }); var EventListenerPhases; (function (EventListenerPhases) { EventListenerPhases[EventListenerPhases["None"] = 0] = "None"; EventListenerPhases[EventListenerPhases["Capture"] = 1] = "Capture"; EventListenerPhases[EventListenerPhases["Bubble"] = 2] = "Bubble"; })(EventListenerPhases || (EventListenerPhases = {})); class TargetEventListeners { constructor(target) { this._eventListeners = new Map(); this._children = new Map(); this._target = target; } get isEmpty() { return this._eventListeners.size === 0 && this._children.size === 0; } addEventListener(type, callback, options) { const dotIndex = type.indexOf('.'); const isNamespace = dotIndex !== -1; if (isNamespace) { const namespaceToken = type.substring(0, dotIndex); let childElementEventListener = this._children.get(namespaceToken); if (!childElementEventListener) { childElementEventListener = new TargetEventListeners(this._target); this._children.set(namespaceToken, childElementEventListener); } type = type.substring(dotIndex + 1); childElementEventListener.addEventListener(type, callback, options); } else { this._addEventListener(type, callback, options); } } removeEventListener(type, callback, options) { const dotIndex = type.indexOf('.'); const isNamespace = dotIndex !== -1; if (isNamespace) { const namespaceToken = type.substring(0, dotIndex); const childElementEventListener = this._children.get(namespaceToken); if (!childElementEventListener) { return; } type = type.substring(dotIndex + 1); childElementEventListener.removeEventListener(type, callback, options); if (childElementEventListener.isEmpty) { this._children.delete(namespaceToken); } } else { this._removeEventListener(type, callback, options); } } reset() { Array.from(this._children.entries()).forEach(([namespace, child]) => { child.reset(); if (child.isEmpty) { this._children.delete(namespace); } else { throw new Error('Child is not empty and cannot be removed'); } }); this._unregisterAllEvents(); } _addEventListener(type, callback, options) { let listenersMap = this._eventListeners.get(type); if (!listenersMap) { listenersMap = new Map(); this._eventListeners.set(type, listenersMap); } const useCapture = options?.capture ?? false; const listenerPhase = useCapture ? EventListenerPhases.Capture : EventListenerPhases.Bubble; const registeredPhases = listenersMap.get(callback) ?? EventListenerPhases.None; if (registeredPhases & listenerPhase) { console.warn('A listener is already registered for this phase'); return; } listenersMap.set(callback, registeredPhases | listenerPhase); this._target.addEventListener(type, callback, options); } _removeEventListener(type, callback, options) { const useCapture = options?.capture ?? false; const listenerPhase = useCapture ? EventListenerPhases.Capture : EventListenerPhases.Bubble; const listenersMap = this._eventListeners.get(type); if (!listenersMap) { return; } const callbacks = callback ? [callback] : Array.from(listenersMap.keys()); callbacks.forEach(callbackItem => { const registeredPhases = listenersMap.get(callbackItem) ?? EventListenerPhases.None; const phaseRegistered = !!(registeredPhases & listenerPhase); if (!phaseRegistered) { return; } this._target.removeEventListener(type, callbackItem, options); const newListenerPhase = registeredPhases ^ listenerPhase; if (newListenerPhase === EventListenerPhases.None) { listenersMap.delete(callbackItem); } else { listenersMap.set(callbackItem, newListenerPhase); } }); if (!listenersMap.size) { this._eventListeners.delete(type); } } _unregisterAllListeners(type, listenersMap) { Array.from(listenersMap.entries()).forEach(([listener, eventPhases]) => { const startPhase = EventListenerPhases.Capture; for (let currentPhase = startPhase; eventPhases; currentPhase <<= 1) { if (!(eventPhases & currentPhase)) { continue; } const useCapture = currentPhase === EventListenerPhases.Capture ? true : false; this.removeEventListener(type, listener, { capture: useCapture }); eventPhases ^= currentPhase; } }); } _unregisterAllEvents() { Array.from(this._eventListeners.entries()).forEach(([type, listenersMap]) => { this._unregisterAllListeners(type, listenersMap); }); } } /***/ }, /***/ 12322 /*!************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/eventListener/index.js ***! \************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ MultiTargetEventListenerManager: () => (/* reexport safe */ _MultiTargetEventListenerManager__WEBPACK_IMPORTED_MODULE_1__.MultiTargetEventListenerManager), /* harmony export */ TargetEventListeners: () => (/* reexport safe */ _TargetEventListeners__WEBPACK_IMPORTED_MODULE_0__.TargetEventListeners) /* harmony export */ }); /* harmony import */ var _TargetEventListeners__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TargetEventListeners */ 17748); /* harmony import */ var _MultiTargetEventListenerManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./MultiTargetEventListenerManager */ 50705); /***/ }, /***/ 81777 /*!**************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/fnv1aHash.js ***! \**************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ fnv1aHash) /* harmony export */ }); function fnv1aHash(str) { let hash = 0x811c9dc5; for (let i = 0; i < str.length; i++) { hash ^= str.charCodeAt(i); hash += (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) + (hash << 24); } return (hash >>> 0).toString(36); } /***/ }, /***/ 78621 /*!************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/generateVolumePropsFromImageIds.js ***! \************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ generateVolumePropsFromImageIds: () => (/* binding */ generateVolumePropsFromImageIds) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _makeVolumeMetadata__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./makeVolumeMetadata */ 11440); /* harmony import */ var _sortImageIdsAndGetSpacing__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./sortImageIdsAndGetSpacing */ 54102); /* harmony import */ var _getScalingParameters__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getScalingParameters */ 62248); /* harmony import */ var _hasFloatScalingParameters__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./hasFloatScalingParameters */ 18142); /* harmony import */ var _init__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../init */ 15678); /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../cache/cache */ 38277); const constructorToTypedArray = { Uint8Array: 'Uint8Array', Int16Array: 'Int16Array', Uint16Array: 'Uint16Array', Float32Array: 'Float32Array' }; function generateVolumePropsFromImageIds(imageIds, volumeId) { const volumeMetadata = (0,_makeVolumeMetadata__WEBPACK_IMPORTED_MODULE_1__["default"])(imageIds); const { ImageOrientationPatient, PixelSpacing, Columns, Rows } = volumeMetadata; const rowCosineVec = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.fromValues(ImageOrientationPatient[0], ImageOrientationPatient[1], ImageOrientationPatient[2]); const colCosineVec = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.fromValues(ImageOrientationPatient[3], ImageOrientationPatient[4], ImageOrientationPatient[5]); const scanAxisNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.cross(scanAxisNormal, rowCosineVec, colCosineVec); const { zSpacing, origin, sortedImageIds } = (0,_sortImageIdsAndGetSpacing__WEBPACK_IMPORTED_MODULE_2__["default"])(imageIds, scanAxisNormal); const numFrames = imageIds.length; const spacing = [PixelSpacing[1], PixelSpacing[0], zSpacing]; const dimensions = [Columns, Rows, numFrames].map(it => Math.floor(it)); const direction = [...rowCosineVec, ...colCosineVec, ...scanAxisNormal]; return { dimensions, spacing, origin, dataType: _determineDataType(sortedImageIds, volumeMetadata), direction, metadata: volumeMetadata, imageIds: sortedImageIds, volumeId, voxelManager: null, numberOfComponents: volumeMetadata.PhotometricInterpretation === 'RGB' ? 3 : 1 }; } function _determineDataType(imageIds, volumeMetadata) { const { BitsAllocated, PixelRepresentation } = volumeMetadata; const signed = PixelRepresentation === 1; const cachedDataType = _getDataTypeFromCache(imageIds); if (cachedDataType) { return cachedDataType; } const [firstIndex, middleIndex, lastIndex] = [0, Math.floor(imageIds.length / 2), imageIds.length - 1]; const scalingParameters = [firstIndex, middleIndex, lastIndex].map(index => (0,_getScalingParameters__WEBPACK_IMPORTED_MODULE_3__["default"])(imageIds[index])); const hasNegativeRescale = scalingParameters.some(params => params.rescaleIntercept < 0 || params.rescaleSlope < 0); const floatAfterScale = scalingParameters.some(params => (0,_hasFloatScalingParameters__WEBPACK_IMPORTED_MODULE_4__.hasFloatScalingParameters)(params)); const canRenderFloat = (0,_init__WEBPACK_IMPORTED_MODULE_5__.canRenderFloatTextures)(); switch (BitsAllocated) { case 8: return 'Uint8Array'; case 16: if (canRenderFloat && floatAfterScale) { return 'Float32Array'; } if (signed || hasNegativeRescale) { return 'Int16Array'; } if (!signed && !hasNegativeRescale) { return 'Uint16Array'; } return 'Float32Array'; case 24: return 'Uint8Array'; case 32: return 'Float32Array'; case 64: return 'Float64Array'; default: throw new Error(`Bits allocated of ${BitsAllocated} is not defined to generate scalarData for the volume.`); } } function _getDataTypeFromCache(imageIds) { const indices = [0, Math.floor(imageIds.length / 2), imageIds.length - 1]; const images = indices.map(i => _cache_cache__WEBPACK_IMPORTED_MODULE_6__["default"].getImage(imageIds[i])); if (!images.every(Boolean)) { return null; } const constructorName = images[0].getPixelData().constructor.name; if (images.every(img => img.getPixelData().constructor.name === constructorName) && constructorName in constructorToTypedArray) { return constructorToTypedArray[constructorName]; } return null; } /***/ }, /***/ 11468 /*!****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/genericMetadataProvider.js ***! \****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../metaData */ 90161); let state = {}; const metadataProvider = { add: (imageId, payload) => { metadataProvider.addRaw(imageId, { ...payload, metadata: structuredClone(payload.metadata) }); }, addRaw: (imageId, payload) => { const type = payload.type; if (!state[imageId]) { state[imageId] = {}; } state[imageId][type] = payload.metadata; }, get: (type, imageId) => { return state[imageId]?.[type]; }, clear: () => { state = {}; } }; (0,_metaData__WEBPACK_IMPORTED_MODULE_0__.addProvider)(metadataProvider.get); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (metadataProvider); /***/ }, /***/ 96593 /*!***************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getBufferConfiguration.js ***! \***************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getBufferConfiguration: () => (/* binding */ getBufferConfiguration), /* harmony export */ getConstructorFromType: () => (/* binding */ getConstructorFromType) /* harmony export */ }); function getConstructorFromType(bufferType, isVolumeBuffer) { switch (bufferType) { case 'Float32Array': return Float32Array; case 'Uint8Array': return Uint8Array; case 'Uint32Array': return Uint32Array; case 'Uint16Array': case 'Int16Array': if (!isVolumeBuffer) { return bufferType === 'Uint16Array' ? Uint16Array : Int16Array; } else { console.debug(`${bufferType} is not supported for volume rendering, switching back to Float32Array`); return Float32Array; } default: if (bufferType) { throw new Error('TargetBuffer should be Float32Array, Uint8Array, Uint16Array, Int16Array, or Uint32Array'); } else { return Float32Array; } } } function getBufferConfiguration(targetBufferType, length, options = {}) { const { isVolumeBuffer = false } = options; const TypedArrayConstructor = getConstructorFromType(targetBufferType, isVolumeBuffer); const bytesPerElement = TypedArrayConstructor.BYTES_PER_ELEMENT; const numBytes = length * bytesPerElement; return { numBytes, TypedArrayConstructor }; } /***/ }, /***/ 61200 /*!**********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getClosestImageId.js ***! \**********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getClosestImageId) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../metaData */ 90161); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./logger */ 67821); /* harmony import */ var _getSpacingInNormalDirection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getSpacingInNormalDirection */ 7127); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../constants */ 19050); const log = _logger__WEBPACK_IMPORTED_MODULE_2__.coreLog.getLogger('utilities', 'getClosestImageId'); function getClosestImageId(imageVolume, worldPos, viewPlaneNormal, options) { const { direction, spacing, imageIds } = imageVolume; const { ignoreSpacing = false } = options || {}; if (!imageIds?.length) { return; } const kVector = direction.slice(6, 9); const dotProduct = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(kVector, viewPlaneNormal); if (Math.abs(dotProduct) < 1 - _constants__WEBPACK_IMPORTED_MODULE_4__["default"]) { return; } let halfSpacingInNormalDirection; if (!ignoreSpacing) { const spacingInNormalDirection = (0,_getSpacingInNormalDirection__WEBPACK_IMPORTED_MODULE_3__["default"])({ direction, spacing }, viewPlaneNormal); halfSpacingInNormalDirection = spacingInNormalDirection / 2; } let closestImageId; let minDistance = Infinity; for (let i = 0; i < imageIds.length; i++) { const imageId = imageIds[i]; const imagePlaneModule = _metaData__WEBPACK_IMPORTED_MODULE_1__.get('imagePlaneModule', imageId); if (!imagePlaneModule?.imagePositionPatient) { log.warn(`Missing imagePositionPatient for imageId: ${imageId}`); continue; } const { imagePositionPatient } = imagePlaneModule; const dir = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.sub(dir, worldPos, imagePositionPatient); const distance = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(dir, viewPlaneNormal)); if (ignoreSpacing) { if (distance < minDistance) { minDistance = distance; closestImageId = imageId; } } else { if (distance < halfSpacingInNormalDirection && distance < minDistance) { minDistance = distance; closestImageId = imageId; } } } if (closestImageId === undefined) { log.warn('No imageId found within the specified criteria (half spacing or absolute closest).'); } return closestImageId; } /***/ }, /***/ 1120 /*!**************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getClosestStackImageIndexForPoint.js ***! \**************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ calculateMinimalDistanceForStackViewport: () => (/* binding */ calculateMinimalDistanceForStackViewport), /* harmony export */ "default": () => (/* binding */ getClosestStackImageIndexForPoint) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _planar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./planar */ 87229); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../metaData */ 90161); function getClosestStackImageIndexForPoint(point, viewport) { const minimalDistance = calculateMinimalDistanceForStackViewport(point, viewport); return minimalDistance ? minimalDistance.index : null; } function calculateMinimalDistanceForStackViewport(point, viewport) { const imageIds = viewport.getImageIds(); const currentImageIdIndex = viewport.getCurrentImageIdIndex(); if (imageIds.length === 0) { return null; } const getDistance = imageId => { const planeMetadata = getPlaneMetadata(imageId); if (!planeMetadata) { return null; } const plane = _planar__WEBPACK_IMPORTED_MODULE_1__.planeEquation(planeMetadata.planeNormal, planeMetadata.imagePositionPatient); const distance = _planar__WEBPACK_IMPORTED_MODULE_1__.planeDistanceToPoint(plane, point); return distance; }; const closestStack = { distance: getDistance(imageIds[currentImageIdIndex]) ?? Infinity, index: currentImageIdIndex }; const higherImageIds = imageIds.slice(currentImageIdIndex + 1); for (let i = 0; i < higherImageIds.length; i++) { const id = higherImageIds[i]; const distance = getDistance(id); if (distance === null) { continue; } if (distance <= closestStack.distance) { closestStack.distance = distance; closestStack.index = i + currentImageIdIndex + 1; } else { break; } } const lowerImageIds = imageIds.slice(0, currentImageIdIndex); for (let i = lowerImageIds.length - 1; i >= 0; i--) { const id = lowerImageIds[i]; const distance = getDistance(id); if (distance === null || distance === closestStack.distance) { continue; } if (distance < closestStack.distance) { closestStack.distance = distance; closestStack.index = i; } else { break; } } return closestStack.distance === Infinity ? null : closestStack; } function getPlaneMetadata(imageId) { const targetImagePlane = _metaData__WEBPACK_IMPORTED_MODULE_2__.get('imagePlaneModule', imageId); if (!targetImagePlane || !(targetImagePlane.rowCosines instanceof Array && targetImagePlane.rowCosines.length === 3) || !(targetImagePlane.columnCosines instanceof Array && targetImagePlane.columnCosines.length === 3) || !(targetImagePlane.imagePositionPatient instanceof Array && targetImagePlane.imagePositionPatient.length === 3)) { return null; } const { rowCosines, columnCosines, imagePositionPatient } = targetImagePlane; const rowVec = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.set(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), ...rowCosines); const colVec = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.set(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), ...columnCosines); const planeNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.cross(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), rowVec, colVec); return { rowCosines, columnCosines, imagePositionPatient, planeNormal }; } /***/ }, /***/ 79192 /*!**********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getCurrentVolumeViewportSlice.js ***! \**********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getCurrentVolumeViewportSlice), /* harmony export */ getCurrentVolumeViewportSlice: () => (/* binding */ getCurrentVolumeViewportSlice) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 27182); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _transformCanvasToIJK__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./transformCanvasToIJK */ 81594); function getCurrentVolumeViewportSlice(viewport) { const { width: canvasWidth, height: canvasHeight } = viewport.getCanvas(); const { sliceToIndexMatrix, indexToSliceMatrix } = viewport.getSliceViewInfo(); const ijkOriginPoint = (0,_transformCanvasToIJK__WEBPACK_IMPORTED_MODULE_2__.transformCanvasToIJK)(viewport, [0, 0]); const ijkRowPoint = (0,_transformCanvasToIJK__WEBPACK_IMPORTED_MODULE_2__.transformCanvasToIJK)(viewport, [canvasWidth - 1, 0]); const ijkColPoint = (0,_transformCanvasToIJK__WEBPACK_IMPORTED_MODULE_2__.transformCanvasToIJK)(viewport, [0, canvasHeight - 1]); const ijkRowVec = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.sub(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(), ijkRowPoint, ijkOriginPoint); const ijkColVec = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.sub(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(), ijkColPoint, ijkOriginPoint); const ijkSliceVec = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.cross(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(), ijkRowVec, ijkColVec); gl_matrix__WEBPACK_IMPORTED_MODULE_1__.normalize(ijkRowVec, ijkRowVec); gl_matrix__WEBPACK_IMPORTED_MODULE_1__.normalize(ijkColVec, ijkColVec); gl_matrix__WEBPACK_IMPORTED_MODULE_1__.normalize(ijkSliceVec, ijkSliceVec); const maxIJKRowVec = Math.max(Math.abs(ijkRowVec[0]), Math.abs(ijkRowVec[1]), Math.abs(ijkRowVec[2])); const maxIJKColVec = Math.max(Math.abs(ijkColVec[0]), Math.abs(ijkColVec[1]), Math.abs(ijkColVec[2])); if (!gl_matrix__WEBPACK_IMPORTED_MODULE_0__.equals(1, maxIJKRowVec) || !gl_matrix__WEBPACK_IMPORTED_MODULE_0__.equals(1, maxIJKColVec)) { throw new Error('Livewire is not available for rotate/oblique viewports'); } const { voxelManager } = viewport.getImageData(); const sliceViewInfo = viewport.getSliceViewInfo(); const scalarData = voxelManager.getSliceData(sliceViewInfo); return { width: sliceViewInfo.width, height: sliceViewInfo.height, scalarData, sliceToIndexMatrix, indexToSliceMatrix }; } /***/ }, /***/ 56042 /*!*************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getDynamicVolumeInfo.js ***! \*************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _splitImageIdsBy4DTags__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./splitImageIdsBy4DTags */ 45264); function getDynamicVolumeInfo(imageIds) { const { imageIdGroups: timePoints, splittingTag } = (0,_splitImageIdsBy4DTags__WEBPACK_IMPORTED_MODULE_0__["default"])(imageIds); const isDynamicVolume = timePoints.length > 1; return { isDynamicVolume, timePoints, splittingTag }; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getDynamicVolumeInfo); /***/ }, /***/ 3589 /*!*************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getImageDataMetadata.js ***! \*************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getImageDataMetadata: () => (/* binding */ getImageDataMetadata) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ 19050); /* harmony import */ var _buildMetadata__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./buildMetadata */ 15856); function getImageDataMetadata(image) { const { imagePlaneModule, imagePixelModule, voiLUTFunction, modality, scalingFactor, calibration } = (0,_buildMetadata__WEBPACK_IMPORTED_MODULE_2__.buildMetadata)(image); let { rowCosines, columnCosines } = imagePlaneModule; if (rowCosines == null || columnCosines == null) { rowCosines = [1, 0, 0]; columnCosines = [0, 1, 0]; } const rowCosineVec = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.fromValues(rowCosines[0], rowCosines[1], rowCosines[2]); const colCosineVec = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.fromValues(columnCosines[0], columnCosines[1], columnCosines[2]); const scanAxisNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.cross(scanAxisNormal, rowCosineVec, colCosineVec); let origin = imagePlaneModule.imagePositionPatient; if (origin == null) { origin = [0, 0, 0]; } const xSpacing = imagePlaneModule.columnPixelSpacing || image.columnPixelSpacing; const ySpacing = imagePlaneModule.rowPixelSpacing || image.rowPixelSpacing; const xVoxels = image.columns; const yVoxels = image.rows; const zSpacing = _constants__WEBPACK_IMPORTED_MODULE_1__["default"]; const zVoxels = 1; if (!imagePixelModule.photometricInterpretation && image.sizeInBytes === 3 * image.width * image.height) { image.numberOfComponents = 3; } const numberOfComponents = image.numberOfComponents || _getNumCompsFromPhotometricInterpretation(imagePixelModule.photometricInterpretation); return { numberOfComponents, origin, direction: [...rowCosineVec, ...colCosineVec, ...scanAxisNormal], dimensions: [xVoxels, yVoxels, zVoxels], spacing: [xSpacing, ySpacing, zSpacing], numVoxels: xVoxels * yVoxels * zVoxels, imagePlaneModule, imagePixelModule, bitsAllocated: imagePixelModule.bitsAllocated, voiLUTFunction, modality, scalingFactor, calibration, scanAxisNormal: scanAxisNormal }; } function _getNumCompsFromPhotometricInterpretation(photometricInterpretation) { let numberOfComponents = 1; if (photometricInterpretation === 'RGB' || photometricInterpretation?.includes('YBR') || photometricInterpretation === 'PALETTE COLOR') { numberOfComponents = 3; } return numberOfComponents; } /***/ }, /***/ 49695 /*!*******************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getImageLegacy.js ***! \*******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _RenderingEngine_StackViewport__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../RenderingEngine/StackViewport */ 67461); /* harmony import */ var _getEnabledElement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../getEnabledElement */ 98361); function getImageLegacy(element) { const enabledElement = (0,_getEnabledElement__WEBPACK_IMPORTED_MODULE_1__["default"])(element); if (!enabledElement) { return; } const { viewport } = enabledElement; if (!(viewport instanceof _RenderingEngine_StackViewport__WEBPACK_IMPORTED_MODULE_0__["default"])) { throw new Error(`An image can only be fetched for a stack viewport and not for a viewport of type: ${viewport.type}`); } return viewport.getCornerstoneImage(); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getImageLegacy); /***/ }, /***/ 84081 /*!***************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getImageSliceDataForVolumeViewport.js ***! \***************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _getSliceRange__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getSliceRange */ 39790); /* harmony import */ var _getTargetVolumeAndSpacingInNormalDir__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getTargetVolumeAndSpacingInNormalDir */ 85493); function getImageSliceDataForVolumeViewport(viewport) { const camera = viewport.getCamera(); const { spacingInNormalDirection, imageVolume } = (0,_getTargetVolumeAndSpacingInNormalDir__WEBPACK_IMPORTED_MODULE_1__["default"])(viewport, camera); if (!imageVolume) { return; } const { viewPlaneNormal, focalPoint } = camera; const actorEntry = viewport.getActors().find(a => a.referencedId === imageVolume.volumeId || a.uid === imageVolume.volumeId); if (!actorEntry) { console.warn('No actor found for with actorUID of', imageVolume.volumeId); } const volumeActor = actorEntry.actor; const sliceRange = (0,_getSliceRange__WEBPACK_IMPORTED_MODULE_0__["default"])(volumeActor, viewPlaneNormal, focalPoint); const { min, max, current } = sliceRange; const numberOfSlices = Math.round((max - min) / spacingInNormalDirection) + 1; let imageIndex = (current - min) / (max - min) * numberOfSlices; imageIndex = Math.floor(imageIndex); if (imageIndex > numberOfSlices - 1) { imageIndex = numberOfSlices - 1; } else if (imageIndex < 0) { imageIndex = 0; } return { numberOfSlices, imageIndex }; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getImageSliceDataForVolumeViewport); /***/ }, /***/ 14023 /*!**************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getMinMax.js ***! \**************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getMinMax) /* harmony export */ }); function getMinMax(storedPixelData) { let min = storedPixelData[0]; let max = storedPixelData[0]; let storedPixel; const numPixels = storedPixelData.length; for (let index = 1; index < numPixels; index++) { storedPixel = storedPixelData[index]; min = Math.min(min, storedPixel); max = Math.max(max, storedPixel); } return { min, max }; } /***/ }, /***/ 82308 /*!*******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getPixelSpacingInformation.js ***! \*******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ calculateRadiographicPixelSpacing: () => (/* binding */ calculateRadiographicPixelSpacing), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ getERMF: () => (/* binding */ getERMF), /* harmony export */ getPixelSpacingInformation: () => (/* binding */ getPixelSpacingInformation) /* harmony export */ }); /* harmony import */ var _isEqual__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isEqual */ 17137); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums */ 16682); const projectionRadiographSOPClassUIDs = new Set(['1.2.840.10008.5.1.4.1.1.1', '1.2.840.10008.5.1.4.1.1.1.1', '1.2.840.10008.5.1.4.1.1.1.1.1', '1.2.840.10008.5.1.4.1.1.1.2', '1.2.840.10008.5.1.4.1.1.1.2.1', '1.2.840.10008.5.1.4.1.1.1.3', '1.2.840.10008.5.1.4.1.1.1.3.1', '1.2.840.10008.5.1.4.1.1.12.1', '1.2.840.10008.5.1.4.1.1.12.1.1', '1.2.840.10008.5.1.4.1.1.12.2', '1.2.840.10008.5.1.4.1.1.12.2.1', '1.2.840.10008.5.1.4.1.1.12.3']); function getERMF(instance) { const { PixelSpacing, ImagerPixelSpacing, EstimatedRadiographicMagnificationFactor: ermf, DistanceSourceToDetector: sid, DistanceSourceToPatient: sod } = instance; if (ermf) { return ermf; } if (sod < sid) { return sid / sod; } if (ImagerPixelSpacing?.[0] > PixelSpacing?.[0]) { return true; } } function calculateRadiographicPixelSpacing(instance) { const { PixelSpacing, ImagerPixelSpacing, PixelSpacingCalibrationType } = instance; const isProjection = true; if (PixelSpacing && PixelSpacingCalibrationType === 'GEOMETRY') { if ((0,_isEqual__WEBPACK_IMPORTED_MODULE_0__.isEqual)(PixelSpacing, ImagerPixelSpacing)) { console.warn('Calibration type is geometry, but pixel spacing and imager pixel spacing identical', PixelSpacing, ImagerPixelSpacing); } return { PixelSpacing, type: _enums__WEBPACK_IMPORTED_MODULE_1__["default"].ERMF, isProjection }; } if (PixelSpacing && PixelSpacingCalibrationType === 'FIDUCIAL') { return { PixelSpacing, type: _enums__WEBPACK_IMPORTED_MODULE_1__["default"].CALIBRATED, isProjection }; } if (ImagerPixelSpacing) { const ermf = getERMF(instance); if (ermf > 1) { const correctedPixelSpacing = ImagerPixelSpacing.map(pixelSpacing => pixelSpacing / ermf); return { PixelSpacing: correctedPixelSpacing, type: _enums__WEBPACK_IMPORTED_MODULE_1__["default"].ERMF, isProjection }; } if (ermf === true) { return { PixelSpacing, type: _enums__WEBPACK_IMPORTED_MODULE_1__["default"].ERMF, isProjection }; } if (ermf) { console.error('Illegal ERMF value:', ermf); } return { PixelSpacing: PixelSpacing || ImagerPixelSpacing, type: _enums__WEBPACK_IMPORTED_MODULE_1__["default"].PROJECTION, isProjection }; } return { PixelSpacing, type: _enums__WEBPACK_IMPORTED_MODULE_1__["default"].UNKNOWN, isProjection }; } function getPixelSpacingInformation(instance) { const { PixelSpacing, SOPClassUID } = instance; const isProjection = projectionRadiographSOPClassUIDs.has(SOPClassUID); if (isProjection) { return calculateRadiographicPixelSpacing(instance); } return { PixelSpacing, type: _enums__WEBPACK_IMPORTED_MODULE_1__["default"].NOT_APPLICABLE, isProjection: false }; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getPixelSpacingInformation); /***/ }, /***/ 80138 /*!***************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getPlaneCubeIntersectionDimensions.js ***! \***************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getCubeSizeInView: () => (/* binding */ getCubeSizeInView) /* harmony export */ }); /* harmony import */ var _rotateToViewCoordinates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rotateToViewCoordinates */ 66471); function findMinCornerIndex(viewCorners, dimension) { let minIndex = 0; let minValue = viewCorners[0][dimension]; for (let i = 1; i < viewCorners.length; i++) { if (viewCorners[i][dimension] < minValue) { minValue = viewCorners[i][dimension]; minIndex = i; } } return minIndex; } function calculateSize(viewCorners, dimension) { const minIndex = findMinCornerIndex(viewCorners, dimension); const maxIndex = minIndex ^ 7; return viewCorners[maxIndex][dimension] - viewCorners[minIndex][dimension]; } function getCubeSizeInView(imageData, viewPlaneNormal, viewUp) { const viewCorners = (0,_rotateToViewCoordinates__WEBPACK_IMPORTED_MODULE_0__.rotateToViewCoordinates)(imageData, viewPlaneNormal, viewUp); const maxWidth = calculateSize(viewCorners, 0); const maxHeight = calculateSize(viewCorners, 1); const maxDepth = calculateSize(viewCorners, 2); return { widthWorld: maxWidth, heightWorld: maxHeight, depthWorld: maxDepth }; } /***/ }, /***/ 99799 /*!*****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getRandomSampleFromArray.js ***! \*****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getRandomSampleFromArray: () => (/* binding */ getRandomSampleFromArray) /* harmony export */ }); function getRandomSampleFromArray(array, size) { const clonedArray = [...array]; if (size >= clonedArray.length) { shuffleArray(clonedArray); return clonedArray; } shuffleArray(clonedArray); return clonedArray.slice(0, size); } function shuffleArray(array) { for (let i = array.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [array[i], array[j]] = [array[j], array[i]]; } } /***/ }, /***/ 39796 /*!*****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getRuntimeId.js ***! \*****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getRuntimeId) /* harmony export */ }); const LAST_RUNTIME_ID = Symbol('LastRuntimeId'); const GLOBAL_CONTEXT = {}; const DEFAULT_MAX = 0xffffffff; const DEFAULT_SEPARATOR = '-'; function getRuntimeId(context, separator, max) { return getNextRuntimeId(context !== null && typeof context === 'object' ? context : GLOBAL_CONTEXT, LAST_RUNTIME_ID, (typeof max === 'number' && max > 0 ? max : DEFAULT_MAX) >>> 0).join(typeof separator === 'string' ? separator : DEFAULT_SEPARATOR); } function getNextRuntimeId(context, symbol, max) { let idComponents = context[symbol]; if (!(idComponents instanceof Array)) { idComponents = [0]; Object.defineProperty(context, symbol, { value: idComponents }); } for (let carry = true, i = 0; carry && i < idComponents.length; ++i) { let n = idComponents[i] | 0; if (n < max) { carry = false; n = n + 1; } else { n = 0; if (i + 1 === idComponents.length) { idComponents.push(0); } } idComponents[i] = n; } return idComponents; } /***/ }, /***/ 62248 /*!*************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getScalingParameters.js ***! \*************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getScalingParameters) /* harmony export */ }); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../metaData */ 90161); function getScalingParameters(imageId) { const modalityLutModule = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('modalityLutModule', imageId) || {}; const generalSeriesModule = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('generalSeriesModule', imageId) || {}; const { modality } = generalSeriesModule; const scalingParameters = { rescaleSlope: modalityLutModule.rescaleSlope || 1, rescaleIntercept: modalityLutModule.rescaleIntercept ?? 0, modality }; const scalingModules = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('scalingModule', imageId) || {}; return { ...scalingParameters, ...(modality === 'PT' && { suvbw: scalingModules.suvbw, suvbsa: scalingModules.suvbsa, suvlbm: scalingModules.suvlbm }), ...(modality === 'RTDOSE' && { doseGridScaling: scalingModules.DoseGridScaling, doseSummation: scalingModules.DoseSummation, doseType: scalingModules.DoseType, doseUnit: scalingModules.DoseUnit }) }; } /***/ }, /***/ 39790 /*!******************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getSliceRange.js ***! \******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getSliceRange) /* harmony export */ }); /* harmony import */ var _kitware_vtk_js_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kitware/vtk.js/Common/Core/MatrixBuilder */ 56345); /* harmony import */ var _getVolumeActorCorners__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getVolumeActorCorners */ 49338); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../constants */ 19050); const SMALL_EPSILON = _constants__WEBPACK_IMPORTED_MODULE_2__["default"] * _constants__WEBPACK_IMPORTED_MODULE_2__["default"]; const isOne = v => Math.abs(Math.abs(v) - 1) < SMALL_EPSILON; const isUnit = (v, off) => isOne(v[off]) || isOne(v[off + 1]) || isOne(v[off + 2]); const isOrthonormal = v => isUnit(v, 0) && isUnit(v, 3) && isUnit(v, 6); function getSliceRange(volumeActor, viewPlaneNormal, focalPoint) { const imageData = volumeActor.getMapper().getInputData(); let corners; const direction = imageData.getDirection(); if (isOrthonormal(direction)) { corners = (0,_getVolumeActorCorners__WEBPACK_IMPORTED_MODULE_1__["default"])(volumeActor); } else { const [dx, dy, dz] = imageData.getDimensions(); const cornersIdx = [[0, 0, 0], [dx - 1, 0, 0], [0, dy - 1, 0], [dx - 1, dy - 1, 0], [0, 0, dz - 1], [dx - 1, 0, dz - 1], [0, dy - 1, dz - 1], [dx - 1, dy - 1, dz - 1]]; corners = cornersIdx.map(it => imageData.indexToWorld(it)); } const transform = _kitware_vtk_js_Common_Core_MatrixBuilder__WEBPACK_IMPORTED_MODULE_0__["default"].buildFromDegree().identity().rotateFromDirections(viewPlaneNormal, [1, 0, 0]); corners.forEach(pt => transform.apply(pt)); const transformedFocalPoint = [...focalPoint]; transform.apply(transformedFocalPoint); const currentSlice = transformedFocalPoint[0]; let minX = Infinity; let maxX = -Infinity; for (let i = 0; i < 8; i++) { const x = corners[i][0]; if (x > maxX) { maxX = x; } if (x < minX) { minX = x; } } return { min: minX, max: maxX, current: currentSlice, actor: volumeActor, viewPlaneNormal, focalPoint }; } /***/ }, /***/ 7127 /*!********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getSpacingInNormalDirection.js ***! \********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getSpacingInNormalDirection) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 87396); function getSpacingInNormalDirection(imageVolume, viewPlaneNormal) { const { direction, spacing } = imageVolume; const iVector = direction.slice(0, 3); const jVector = direction.slice(3, 6); const kVector = direction.slice(6, 9); const dotProducts = [gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(iVector, viewPlaneNormal), gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(jVector, viewPlaneNormal), gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(kVector, viewPlaneNormal)]; const projectedSpacing = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.set(projectedSpacing, dotProducts[0] * spacing[0], dotProducts[1] * spacing[1], dotProducts[2] * spacing[2]); const spacingInNormalDirection = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.length(projectedSpacing); return spacingInNormalDirection; } /***/ }, /***/ 85493 /*!*****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getTargetVolumeAndSpacingInNormalDir.js ***! \*****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getTargetVolumeAndSpacingInNormalDir) /* harmony export */ }); /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../cache/cache */ 38277); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ 19050); /* harmony import */ var _getSpacingInNormalDirection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getSpacingInNormalDirection */ 7127); /* harmony import */ var _loaders_volumeLoader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../loaders/volumeLoader */ 10372); /* harmony import */ var _getVolumeId__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getVolumeId */ 96146); const EPSILON_PART = 1 + _constants__WEBPACK_IMPORTED_MODULE_1__["default"]; const startsWith = (str, starts) => starts === str.substring(0, Math.min(str.length, starts.length)); const isPrimaryVolume = volume => !!(0,_loaders_volumeLoader__WEBPACK_IMPORTED_MODULE_3__.getVolumeLoaderSchemes)().find(scheme => startsWith(volume.volumeId, scheme)); function getTargetVolumeAndSpacingInNormalDir(viewport, camera, targetId, useSlabThickness = false) { const { viewPlaneNormal } = camera; const volumeActors = viewport.getActors(); if (!volumeActors.length) { return { spacingInNormalDirection: null, imageVolume: null, actorUID: null }; } const imageVolumes = volumeActors.map(va => { const actorUID = va.referencedId ?? va.uid; return _cache_cache__WEBPACK_IMPORTED_MODULE_0__["default"].getVolume(actorUID); }).filter(iv => !!iv); if (targetId) { const targetVolumeId = (0,_getVolumeId__WEBPACK_IMPORTED_MODULE_4__.getVolumeId)(targetId); const imageVolumeIndex = imageVolumes.findIndex(iv => targetVolumeId.includes(iv.volumeId)); const imageVolume = imageVolumes[imageVolumeIndex]; const { uid: actorUID } = volumeActors[imageVolumeIndex]; const spacingInNormalDirection = getSpacingInNormal(imageVolume, viewPlaneNormal, viewport, useSlabThickness); return { imageVolume, spacingInNormalDirection, actorUID }; } if (!imageVolumes.length) { return { spacingInNormalDirection: null, imageVolume: null, actorUID: null }; } const smallest = { spacingInNormalDirection: Infinity, imageVolume: null, actorUID: null }; const hasPrimaryVolume = imageVolumes.find(isPrimaryVolume); for (let i = 0; i < imageVolumes.length; i++) { const imageVolume = imageVolumes[i]; if (hasPrimaryVolume && !isPrimaryVolume(imageVolume)) { continue; } const spacingInNormalDirection = getSpacingInNormal(imageVolume, viewPlaneNormal, viewport); if (spacingInNormalDirection * EPSILON_PART < smallest.spacingInNormalDirection) { smallest.spacingInNormalDirection = spacingInNormalDirection; smallest.imageVolume = imageVolume; smallest.actorUID = volumeActors[i].uid; } } return smallest; } function getSpacingInNormal(imageVolume, viewPlaneNormal, viewport, useSlabThickness = false) { const { slabThickness } = viewport.getProperties(); let spacingInNormalDirection = slabThickness; if (!slabThickness || !useSlabThickness) { spacingInNormalDirection = (0,_getSpacingInNormalDirection__WEBPACK_IMPORTED_MODULE_2__["default"])(imageVolume, viewPlaneNormal); } return spacingInNormalDirection; } /***/ }, /***/ 12325 /*!***********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getViewportImageCornersInWorld.js ***! \***********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getViewportImageCornersInWorld) /* harmony export */ }); function getViewportImageCornersInWorld(viewport) { const { imageData, dimensions } = viewport.getImageData() || {}; if (!imageData || !dimensions) { return []; } const { canvas } = viewport; const ratio = window.devicePixelRatio; const topLeftCanvas = [0, 0]; const topRightCanvas = [canvas.width / ratio, 0]; const bottomRightCanvas = [canvas.width / ratio, canvas.height / ratio]; const bottomLeftCanvas = [0, canvas.height / ratio]; const topLeftWorld = viewport.canvasToWorld(topLeftCanvas); const topRightWorld = viewport.canvasToWorld(topRightCanvas); const bottomRightWorld = viewport.canvasToWorld(bottomRightCanvas); const bottomLeftWorld = viewport.canvasToWorld(bottomLeftCanvas); const topLeftImage = imageData.worldToIndex(topLeftWorld); const topRightImage = imageData.worldToIndex(topRightWorld); const bottomRightImage = imageData.worldToIndex(bottomRightWorld); const bottomLeftImage = imageData.worldToIndex(bottomLeftWorld); return _getStackViewportImageCorners({ dimensions, imageData, topLeftImage, topRightImage, bottomRightImage, bottomLeftImage, topLeftWorld, topRightWorld, bottomRightWorld, bottomLeftWorld }); } function _getStackViewportImageCorners({ dimensions, imageData, topLeftImage, topRightImage, bottomRightImage, bottomLeftImage, topLeftWorld, topRightWorld, bottomRightWorld, bottomLeftWorld }) { const topLeftImageWorld = _isInBounds(topLeftImage, dimensions) ? topLeftWorld : imageData.indexToWorld([0, 0, 0]); const topRightImageWorld = _isInBounds(topRightImage, dimensions) ? topRightWorld : imageData.indexToWorld([dimensions[0] - 1, 0, 0]); const bottomRightImageWorld = _isInBounds(bottomRightImage, dimensions) ? bottomRightWorld : imageData.indexToWorld([dimensions[0] - 1, dimensions[1] - 1, 0]); const bottomLeftImageWorld = _isInBounds(bottomLeftImage, dimensions) ? bottomLeftWorld : imageData.indexToWorld([0, dimensions[1] - 1, 0]); return [topLeftImageWorld, topRightImageWorld, bottomLeftImageWorld, bottomRightImageWorld]; } function _isInBounds(imageCoord, dimensions) { return imageCoord[0] > 0 || imageCoord[0] < dimensions[0] - 1 || imageCoord[1] > 0 || imageCoord[1] < dimensions[1] - 1 || imageCoord[2] > 0 || imageCoord[2] < dimensions[2] - 1; } /***/ }, /***/ 12982 /*!************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getViewportImageIds.js ***! \************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _RenderingEngine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../RenderingEngine */ 93667); /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../cache/cache */ 38277); function getViewportImageIds(viewport) { if (viewport instanceof _RenderingEngine__WEBPACK_IMPORTED_MODULE_0__["default"]) { const volume = _cache_cache__WEBPACK_IMPORTED_MODULE_1__["default"].getVolume(viewport.getVolumeId()); return volume.imageIds; } else if (viewport.getImageIds) { return viewport.getImageIds(); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getViewportImageIds); /***/ }, /***/ 16280 /*!************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getViewportModality.js ***! \************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ _getViewportModality: () => (/* binding */ _getViewportModality) /* harmony export */ }); function _getViewportModality(viewport, volumeId, getVolume) { if (!getVolume) { throw new Error('getVolume is required, use the utilities export instead '); } if (viewport.modality) { return viewport.modality; } if (viewport.setVolumes) { volumeId = volumeId ?? viewport.getVolumeId(); if (!volumeId || !getVolume) { return; } const volume = getVolume(volumeId); return volume.metadata.Modality; } throw new Error('Invalid viewport type'); } /***/ }, /***/ 39367 /*!*****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getViewportsWithImageURI.js ***! \*****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getViewportsWithImageURI) /* harmony export */ }); /* harmony import */ var _RenderingEngine_getRenderingEngine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../RenderingEngine/getRenderingEngine */ 77569); function getViewportsWithImageURI(imageURI) { const renderingEngines = (0,_RenderingEngine_getRenderingEngine__WEBPACK_IMPORTED_MODULE_0__.getRenderingEngines)(); const viewports = []; renderingEngines.forEach(renderingEngine => { const viewportsForRenderingEngine = renderingEngine.getViewports(); viewportsForRenderingEngine.forEach(viewport => { if (viewport.hasImageURI(imageURI)) { viewports.push(viewport); } }); }); return viewports; } /***/ }, /***/ 47289 /*!*****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getViewportsWithVolumeId.js ***! \*****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _RenderingEngine_getRenderingEngine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../RenderingEngine/getRenderingEngine */ 77569); function getViewportsWithVolumeId(volumeId) { const renderingEngines = (0,_RenderingEngine_getRenderingEngine__WEBPACK_IMPORTED_MODULE_0__.getRenderingEngines)(); const targetViewports = []; renderingEngines.forEach(renderingEngine => { const viewports = renderingEngine.getVolumeViewports(); const filteredViewports = viewports.filter(vp => vp.hasVolumeId(volumeId)); targetViewports.push(...filteredViewports); }); return targetViewports; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getViewportsWithVolumeId); /***/ }, /***/ 66143 /*!*****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getVoiFromSigmoidRGBTransferFunction.js ***! \*****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getVoiFromSigmoidRGBTransferFunction) /* harmony export */ }); function getVoiFromSigmoidRGBTransferFunction(cfun) { let cfunRange = []; const [lower, upper] = cfun.getRange(); cfun.getTable(lower, upper, 1024, cfunRange); cfunRange = cfunRange.filter((v, k) => k % 3 === 0); const cfunDomain = [...Array(1024).keys()].map((v, k) => { return lower + (upper - lower) / (1024 - 1) * k; }); const y1 = cfunRange[256]; const logy1 = Math.log((1 - y1) / y1); const x1 = cfunDomain[256]; const y2 = cfunRange[256 * 3]; const logy2 = Math.log((1 - y2) / y2); const x2 = cfunDomain[256 * 3]; const ww = Math.round(4 * (x2 - x1) / (logy1 - logy2)); const wc = Math.round(x1 + ww * logy1 / 4); return [Math.round(wc - ww / 2), Math.round(wc + ww / 2)]; } /***/ }, /***/ 49338 /*!**************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getVolumeActorCorners.js ***! \**************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getVolumeActorCorners) /* harmony export */ }); function getVolumeActorCorners(volumeActor) { const imageData = volumeActor.getMapper().getInputData(); const bounds = imageData.extentToBounds(imageData.getExtent()); return [[bounds[0], bounds[2], bounds[4]], [bounds[0], bounds[2], bounds[5]], [bounds[0], bounds[3], bounds[4]], [bounds[0], bounds[3], bounds[5]], [bounds[1], bounds[2], bounds[4]], [bounds[1], bounds[2], bounds[5]], [bounds[1], bounds[3], bounds[4]], [bounds[1], bounds[3], bounds[5]]]; } /***/ }, /***/ 47656 /*!******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getVolumeDirectionVectors.js ***! \******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getVolumeDirectionVectors), /* harmony export */ getVolumeDirectionVectors: () => (/* binding */ getVolumeDirectionVectors) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _transformWorldToIndex__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./transformWorldToIndex */ 19598); function getVolumeDirectionVectors(imageData, camera) { const { viewUp, viewPlaneNormal } = camera; const ijkOrigin = (0,_transformWorldToIndex__WEBPACK_IMPORTED_MODULE_1__.transformWorldToIndexContinuous)(imageData, [0, 0, 0]); const worldVecColDir = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.negate(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), viewUp); const worldVecSliceDir = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.negate(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), viewPlaneNormal); const worldVecRowDir = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.cross(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), worldVecColDir, worldVecSliceDir); const ijkVecColDir = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.sub(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), (0,_transformWorldToIndex__WEBPACK_IMPORTED_MODULE_1__.transformWorldToIndexContinuous)(imageData, worldVecColDir), ijkOrigin); const ijkVecSliceDir = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.sub(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), (0,_transformWorldToIndex__WEBPACK_IMPORTED_MODULE_1__.transformWorldToIndexContinuous)(imageData, worldVecSliceDir), ijkOrigin); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.normalize(ijkVecColDir, ijkVecColDir); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.normalize(ijkVecSliceDir, ijkVecSliceDir); const ijkVecRowDir = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.cross(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), ijkVecColDir, ijkVecSliceDir); return { worldVecRowDir, worldVecColDir, worldVecSliceDir, ijkVecRowDir, ijkVecColDir, ijkVecSliceDir }; } /***/ }, /***/ 96146 /*!****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getVolumeId.js ***! \****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getVolumeId: () => (/* binding */ getVolumeId) /* harmony export */ }); const getVolumeId = targetId => { const prefix = 'volumeId:'; const str = targetId.includes(prefix) ? targetId.substring(prefix.length) : targetId; const index = str.indexOf('sliceIndex='); return index === -1 ? str : str.substring(0, index - 1); }; /***/ }, /***/ 34612 /*!****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getVolumeSliceRangeInfo.js ***! \****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _getSliceRange__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getSliceRange */ 39790); /* harmony import */ var _getTargetVolumeAndSpacingInNormalDir__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getTargetVolumeAndSpacingInNormalDir */ 85493); function getVolumeSliceRangeInfo(viewport, volumeId, useSlabThickness = false) { const camera = viewport.getCamera(); const { focalPoint, viewPlaneNormal } = camera; const { spacingInNormalDirection, actorUID } = (0,_getTargetVolumeAndSpacingInNormalDir__WEBPACK_IMPORTED_MODULE_1__["default"])(viewport, camera, volumeId, useSlabThickness); if (!actorUID) { throw new Error(`Could not find image volume with id ${volumeId} in the viewport`); } const actorEntry = viewport.getActor(actorUID); if (!actorEntry) { console.warn('No actor found for with actorUID of', actorUID); return null; } const volumeActor = actorEntry.actor; const sliceRange = (0,_getSliceRange__WEBPACK_IMPORTED_MODULE_0__["default"])(volumeActor, viewPlaneNormal, focalPoint); return { sliceRange, spacingInNormalDirection, camera }; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getVolumeSliceRangeInfo); /***/ }, /***/ 15376 /*!********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getVolumeViewportScrollInfo.js ***! \********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _getVolumeSliceRangeInfo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getVolumeSliceRangeInfo */ 34612); function getVolumeViewportScrollInfo(viewport, volumeId, useSlabThickness = false) { const { sliceRange, spacingInNormalDirection, camera } = (0,_getVolumeSliceRangeInfo__WEBPACK_IMPORTED_MODULE_0__["default"])(viewport, volumeId, useSlabThickness); const { min, max, current } = sliceRange; const numScrollSteps = Math.round((max - min) / spacingInNormalDirection); const fraction = (current - min) / (max - min); const floatingStepNumber = fraction * numScrollSteps; const currentStepIndex = Math.round(floatingStepNumber); return { numScrollSteps, currentStepIndex, sliceRangeInfo: { sliceRange, spacingInNormalDirection, camera } }; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getVolumeViewportScrollInfo); /***/ }, /***/ 1575 /*!********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/getVolumeViewportsContainingSameVolumes.js ***! \********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _RenderingEngine_getRenderingEngine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../RenderingEngine/getRenderingEngine */ 77569); function getVolumeViewportsContainingSameVolumes(targetViewport, renderingEngineId) { let renderingEngines; if (renderingEngineId) { renderingEngines = [(0,_RenderingEngine_getRenderingEngine__WEBPACK_IMPORTED_MODULE_0__.getRenderingEngine)(renderingEngineId)]; } else { renderingEngines = (0,_RenderingEngine_getRenderingEngine__WEBPACK_IMPORTED_MODULE_0__.getRenderingEngines)(); } const sameVolumesViewports = []; renderingEngines.forEach(renderingEngine => { const targetActors = targetViewport.getActors(); const viewports = renderingEngine.getVolumeViewports(); for (const vp of viewports) { const vpActors = vp.getActors(); if (vpActors.length !== targetActors.length) { continue; } const sameVolumes = targetActors.every(({ uid }) => vpActors.find(vpActor => uid === vpActor.uid)); if (sameVolumes) { sameVolumesViewports.push(vp); } } }); return sameVolumesViewports; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getVolumeViewportsContainingSameVolumes); /***/ }, /***/ 18142 /*!******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/hasFloatScalingParameters.js ***! \******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ hasFloatScalingParameters: () => (/* binding */ hasFloatScalingParameters) /* harmony export */ }); const hasFloatScalingParameters = scalingParameters => { const hasFloatRescale = Object.values(scalingParameters).some(value => typeof value === 'number' && !Number.isInteger(value)); return hasFloatRescale; }; /***/ }, /***/ 96718 /*!*****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/hasNaNValues.js ***! \*****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ hasNaNValues) /* harmony export */ }); function hasNaNValues(input) { if (Array.isArray(input)) { return input.some(value => Number.isNaN(value)); } return Number.isNaN(input); } /***/ }, /***/ 28348 /*!**********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/historyMemo/index.js ***! \**********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ DefaultHistoryMemo: () => (/* binding */ DefaultHistoryMemo), /* harmony export */ HistoryMemo: () => (/* binding */ HistoryMemo) /* harmony export */ }); /* harmony import */ var _eventTarget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../eventTarget */ 28699); /* harmony import */ var _asArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../asArray */ 74744); const Events = { HISTORY_UNDO: 'CORNERSTONE_TOOLS_HISTORY_UNDO', HISTORY_REDO: 'CORNERSTONE_TOOLS_HISTORY_REDO' }; class HistoryMemo { constructor(label = 'Tools', size = 50) { this.position = -1; this.redoAvailable = 0; this.undoAvailable = 0; this.ring = new Array(); this.isRecordingGrouped = false; this.label = label; this._size = size; } get size() { return this._size; } set size(newSize) { this.ring = new Array(newSize); this._size = newSize; this.position = -1; this.redoAvailable = 0; this.undoAvailable = 0; } get canUndo() { return this.undoAvailable > 0; } get canRedo() { return this.redoAvailable > 0; } undo(items = 1) { while (items > 0 && this.undoAvailable > 0) { const item = this.ring[this.position]; for (const subitem of (0,_asArray__WEBPACK_IMPORTED_MODULE_1__.asArray)(item).reverse()) { subitem.restoreMemo(true); this.dispatchHistoryEvent({ item: subitem, isUndo: true }); } items--; this.redoAvailable++; this.undoAvailable--; this.position = (this.position - 1 + this.size) % this.size; } } undoIf(condition) { if (this.undoAvailable > 0 && condition(this.ring[this.position])) { this.undo(); return true; } return false; } dispatchHistoryEvent({ item, isUndo }) { if (item.id) { _eventTarget__WEBPACK_IMPORTED_MODULE_0__["default"].dispatchEvent(new CustomEvent(isUndo ? Events.HISTORY_UNDO : Events.HISTORY_REDO, { detail: { isUndo, id: item.id, operationType: item.operationType || 'annotation', memo: item } })); } } redo(items = 1) { while (items > 0 && this.redoAvailable > 0) { const newPosition = (this.position + 1) % this.size; const item = this.ring[newPosition]; for (const subitem of (0,_asArray__WEBPACK_IMPORTED_MODULE_1__.asArray)(item).reverse()) { subitem.restoreMemo(false); this.dispatchHistoryEvent({ item: subitem, isUndo: false }); } items--; this.position = newPosition; this.undoAvailable++; this.redoAvailable--; } } initializeGroupItem() { this.redoAvailable = 0; if (this.undoAvailable < this._size) { this.undoAvailable++; } this.position = (this.position + 1) % this._size; this.ring[this.position] = []; } startGroupRecording() { this.isRecordingGrouped = true; this.initializeGroupItem(); } rollbackUnusedGroupItem() { this.ring[this.position] = undefined; this.position = (this.position - 1) % this._size; this.undoAvailable--; } endGroupRecording() { this.isRecordingGrouped = false; const lastItem = this.ring[this.position]; const lastItemIsEmpty = Array.isArray(lastItem) && lastItem.length === 0; if (lastItemIsEmpty) { this.rollbackUnusedGroupItem(); } } pushGrouped(memo) { const lastMemo = this.ring[this.position]; if (Array.isArray(lastMemo)) { lastMemo.push(memo); return memo; } throw new Error('Last item should be an array for grouped memos.'); } push(item) { if (!item) { return; } const memo = item.restoreMemo ? item : item.createMemo?.(); if (!memo) { return; } if (this.isRecordingGrouped) { return this.pushGrouped(memo); } this.redoAvailable = 0; if (this.undoAvailable < this._size) { this.undoAvailable++; } this.position = (this.position + 1) % this._size; this.ring[this.position] = memo; return memo; } } const DefaultHistoryMemo = new HistoryMemo(); /***/ }, /***/ 40232 /*!*****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/imageIdToURI.js ***! \*****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ imageIdToURI) /* harmony export */ }); function imageIdToURI(imageId) { const colonIndex = imageId.indexOf(':'); return imageId.substring(colonIndex + 1); } /***/ }, /***/ 49024 /*!**********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/imageRetrieveMetadataProvider.js ***! \**********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../metaData */ 90161); const retrieveConfigurationState = new Map(); const IMAGE_RETRIEVE_CONFIGURATION = 'imageRetrieveConfiguration'; const imageRetrieveMetadataProvider = { IMAGE_RETRIEVE_CONFIGURATION, clear: () => { retrieveConfigurationState.clear(); }, add: (key, payload) => { retrieveConfigurationState.set(key, payload); }, clone: () => { return new Map(retrieveConfigurationState); }, restore: state => { retrieveConfigurationState.clear(); state.forEach((value, key) => { retrieveConfigurationState.set(key, value); }); }, get: (type, ...queries) => { if (type === IMAGE_RETRIEVE_CONFIGURATION) { return queries.map(query => retrieveConfigurationState.get(query)).find(it => it !== undefined); } } }; (0,_metaData__WEBPACK_IMPORTED_MODULE_0__.addProvider)(imageRetrieveMetadataProvider.get.bind(imageRetrieveMetadataProvider)); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (imageRetrieveMetadataProvider); /***/ }, /***/ 99203 /*!***********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/imageToWorldCoords.js ***! \***********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ imageToWorldCoords) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../metaData */ 90161); function imageToWorldCoords(imageId, imageCoords) { const imagePlaneModule = (0,_metaData__WEBPACK_IMPORTED_MODULE_1__.get)('imagePlaneModule', imageId); if (!imagePlaneModule) { throw new Error(`No imagePlaneModule found for imageId: ${imageId}`); } const { columnCosines, rowCosines, imagePositionPatient: origin } = imagePlaneModule; let { columnPixelSpacing, rowPixelSpacing } = imagePlaneModule; columnPixelSpacing ||= 1; rowPixelSpacing ||= 1; const imageCoordsInWorld = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.scaleAndAdd(imageCoordsInWorld, origin, rowCosines, rowPixelSpacing * (imageCoords[0] - 0.5)); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.scaleAndAdd(imageCoordsInWorld, imageCoordsInWorld, columnCosines, columnPixelSpacing * (imageCoords[1] - 0.5)); return Array.from(imageCoordsInWorld); } /***/ }, /***/ 80853 /*!**********************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/index.js ***! \**********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FrameRange: () => (/* reexport safe */ _FrameRange__WEBPACK_IMPORTED_MODULE_77__["default"]), /* harmony export */ HistoryMemo: () => (/* reexport module object */ _historyMemo__WEBPACK_IMPORTED_MODULE_24__), /* harmony export */ PointsManager: () => (/* reexport safe */ _PointsManager__WEBPACK_IMPORTED_MODULE_43__["default"]), /* harmony export */ ProgressiveIterator: () => (/* reexport safe */ _ProgressiveIterator__WEBPACK_IMPORTED_MODULE_53__["default"]), /* harmony export */ RLEVoxelMap: () => (/* reexport safe */ _RLEVoxelMap__WEBPACK_IMPORTED_MODULE_62__["default"]), /* harmony export */ VoxelManager: () => (/* reexport safe */ _VoxelManager__WEBPACK_IMPORTED_MODULE_61__["default"]), /* harmony export */ actorIsA: () => (/* reexport safe */ _actorCheck__WEBPACK_IMPORTED_MODULE_34__.actorIsA), /* harmony export */ applyPreset: () => (/* reexport safe */ _applyPreset__WEBPACK_IMPORTED_MODULE_42__["default"]), /* harmony export */ asArray: () => (/* reexport safe */ _asArray__WEBPACK_IMPORTED_MODULE_99__.asArray), /* harmony export */ autoLoad: () => (/* reexport safe */ _autoLoad__WEBPACK_IMPORTED_MODULE_84__["default"]), /* harmony export */ buildMetadata: () => (/* reexport safe */ _buildMetadata__WEBPACK_IMPORTED_MODULE_80__.buildMetadata), /* harmony export */ calculateNeighborhoodStats: () => (/* reexport safe */ _calculateNeighborhoodStats__WEBPACK_IMPORTED_MODULE_95__.calculateNeighborhoodStats), /* harmony export */ calculateRadiographicPixelSpacing: () => (/* reexport safe */ _getPixelSpacingInformation__WEBPACK_IMPORTED_MODULE_96__.calculateRadiographicPixelSpacing), /* harmony export */ calculateSpacingBetweenImageIds: () => (/* reexport safe */ _calculateSpacingBetweenImageIds__WEBPACK_IMPORTED_MODULE_93__["default"]), /* harmony export */ calculateViewportsSpatialRegistration: () => (/* reexport safe */ _calculateViewportsSpatialRegistration__WEBPACK_IMPORTED_MODULE_38__["default"]), /* harmony export */ calibratedPixelSpacingMetadataProvider: () => (/* reexport safe */ _calibratedPixelSpacingMetadataProvider__WEBPACK_IMPORTED_MODULE_11__["default"]), /* harmony export */ clamp: () => (/* reexport safe */ _clamp__WEBPACK_IMPORTED_MODULE_12__["default"]), /* harmony export */ clip: () => (/* reexport safe */ _clip__WEBPACK_IMPORTED_MODULE_90__["default"]), /* harmony export */ color: () => (/* reexport module object */ _color__WEBPACK_IMPORTED_MODULE_75__), /* harmony export */ colormap: () => (/* reexport module object */ _colormap__WEBPACK_IMPORTED_MODULE_73__), /* harmony export */ convertColorArrayToRgbString: () => (/* reexport safe */ _convertColorArrayToRgbString__WEBPACK_IMPORTED_MODULE_65__.convertColorArrayToRgbString), /* harmony export */ convertStackToVolumeViewport: () => (/* reexport safe */ _convertStackToVolumeViewport__WEBPACK_IMPORTED_MODULE_59__.convertStackToVolumeViewport), /* harmony export */ convertToGrayscale: () => (/* reexport safe */ _convertToGrayscale__WEBPACK_IMPORTED_MODULE_64__["default"]), /* harmony export */ convertVolumeToStackViewport: () => (/* reexport safe */ _convertVolumeToStackViewport__WEBPACK_IMPORTED_MODULE_60__.convertVolumeToStackViewport), /* harmony export */ createLinearRGBTransferFunction: () => (/* reexport safe */ _createLinearRGBTransferFunction__WEBPACK_IMPORTED_MODULE_4__["default"]), /* harmony export */ createSigmoidRGBTransferFunction: () => (/* reexport safe */ _createSigmoidRGBTransferFunction__WEBPACK_IMPORTED_MODULE_2__["default"]), /* harmony export */ createSubVolume: () => (/* reexport safe */ _createSubVolume__WEBPACK_IMPORTED_MODULE_91__["default"]), /* harmony export */ decimate: () => (/* reexport safe */ _decimate__WEBPACK_IMPORTED_MODULE_54__["default"]), /* harmony export */ deepClone: () => (/* reexport safe */ _deepClone__WEBPACK_IMPORTED_MODULE_87__.deepClone), /* harmony export */ deepEqual: () => (/* reexport safe */ _deepEqual__WEBPACK_IMPORTED_MODULE_76__.deepEqual), /* harmony export */ deepMerge: () => (/* reexport safe */ _deepMerge__WEBPACK_IMPORTED_MODULE_44__["default"]), /* harmony export */ eventListener: () => (/* reexport module object */ _eventListener__WEBPACK_IMPORTED_MODULE_0__), /* harmony export */ fnv1aHash: () => (/* reexport safe */ _fnv1aHash__WEBPACK_IMPORTED_MODULE_78__["default"]), /* harmony export */ generateFrameImageId: () => (/* reexport safe */ _splitImageIdsBy4DTags__WEBPACK_IMPORTED_MODULE_86__.generateFrameImageId), /* harmony export */ generateVolumePropsFromImageIds: () => (/* reexport safe */ _generateVolumePropsFromImageIds__WEBPACK_IMPORTED_MODULE_58__.generateVolumePropsFromImageIds), /* harmony export */ genericMetadataProvider: () => (/* reexport safe */ _genericMetadataProvider__WEBPACK_IMPORTED_MODULE_50__["default"]), /* harmony export */ getBufferConfiguration: () => (/* reexport safe */ _getBufferConfiguration__WEBPACK_IMPORTED_MODULE_57__.getBufferConfiguration), /* harmony export */ getClosestImageId: () => (/* reexport safe */ _getClosestImageId__WEBPACK_IMPORTED_MODULE_14__["default"]), /* harmony export */ getClosestStackImageIndexForPoint: () => (/* reexport safe */ _getClosestStackImageIndexForPoint__WEBPACK_IMPORTED_MODULE_36__["default"]), /* harmony export */ getCubeSizeInView: () => (/* reexport safe */ _getPlaneCubeIntersectionDimensions__WEBPACK_IMPORTED_MODULE_97__.getCubeSizeInView), /* harmony export */ getCurrentVolumeViewportSlice: () => (/* reexport safe */ _getCurrentVolumeViewportSlice__WEBPACK_IMPORTED_MODULE_37__["default"]), /* harmony export */ getDynamicVolumeInfo: () => (/* reexport safe */ _getDynamicVolumeInfo__WEBPACK_IMPORTED_MODULE_83__["default"]), /* harmony export */ getERMF: () => (/* reexport safe */ _getPixelSpacingInformation__WEBPACK_IMPORTED_MODULE_96__.getERMF), /* harmony export */ getImageDataMetadata: () => (/* reexport safe */ _getImageDataMetadata__WEBPACK_IMPORTED_MODULE_79__.getImageDataMetadata), /* harmony export */ getImageLegacy: () => (/* reexport safe */ _getImageLegacy__WEBPACK_IMPORTED_MODULE_47__["default"]), /* harmony export */ getImageSliceDataForVolumeViewport: () => (/* reexport safe */ _getImageSliceDataForVolumeViewport__WEBPACK_IMPORTED_MODULE_33__["default"]), /* harmony export */ getMinMax: () => (/* reexport safe */ _getMinMax__WEBPACK_IMPORTED_MODULE_8__["default"]), /* harmony export */ getPixelSpacingInformation: () => (/* reexport safe */ _getPixelSpacingInformation__WEBPACK_IMPORTED_MODULE_96__.getPixelSpacingInformation), /* harmony export */ getRandomSampleFromArray: () => (/* reexport safe */ _getRandomSampleFromArray__WEBPACK_IMPORTED_MODULE_67__.getRandomSampleFromArray), /* harmony export */ getRuntimeId: () => (/* reexport safe */ _getRuntimeId__WEBPACK_IMPORTED_MODULE_9__["default"]), /* harmony export */ getScalingParameters: () => (/* reexport safe */ _getScalingParameters__WEBPACK_IMPORTED_MODULE_45__["default"]), /* harmony export */ getSliceRange: () => (/* reexport safe */ _getSliceRange__WEBPACK_IMPORTED_MODULE_31__["default"]), /* harmony export */ getSpacingInNormalDirection: () => (/* reexport safe */ _getSpacingInNormalDirection__WEBPACK_IMPORTED_MODULE_15__["default"]), /* harmony export */ getTargetVolumeAndSpacingInNormalDir: () => (/* reexport safe */ _getTargetVolumeAndSpacingInNormalDir__WEBPACK_IMPORTED_MODULE_16__["default"]), /* harmony export */ getViewportImageCornersInWorld: () => (/* reexport safe */ _getViewportImageCornersInWorld__WEBPACK_IMPORTED_MODULE_40__["default"]), /* harmony export */ getViewportImageIds: () => (/* reexport safe */ _getViewportImageIds__WEBPACK_IMPORTED_MODULE_66__["default"]), /* harmony export */ getViewportModality: () => (/* binding */ getViewportModality), /* harmony export */ getViewportsWithImageURI: () => (/* reexport safe */ _getViewportsWithImageURI__WEBPACK_IMPORTED_MODULE_35__["default"]), /* harmony export */ getViewportsWithVolumeId: () => (/* reexport safe */ _getViewportsWithVolumeId__WEBPACK_IMPORTED_MODULE_20__["default"]), /* harmony export */ getVoiFromSigmoidRGBTransferFunction: () => (/* reexport safe */ _getVoiFromSigmoidRGBTransferFunction__WEBPACK_IMPORTED_MODULE_3__["default"]), /* harmony export */ getVolumeActorCorners: () => (/* reexport safe */ _getVolumeActorCorners__WEBPACK_IMPORTED_MODULE_17__["default"]), /* harmony export */ getVolumeDirectionVectors: () => (/* reexport safe */ _getVolumeDirectionVectors__WEBPACK_IMPORTED_MODULE_92__["default"]), /* harmony export */ getVolumeId: () => (/* reexport safe */ _getVolumeId__WEBPACK_IMPORTED_MODULE_68__.getVolumeId), /* harmony export */ getVolumeSliceRangeInfo: () => (/* reexport safe */ _getVolumeSliceRangeInfo__WEBPACK_IMPORTED_MODULE_29__["default"]), /* harmony export */ getVolumeViewportScrollInfo: () => (/* reexport safe */ _getVolumeViewportScrollInfo__WEBPACK_IMPORTED_MODULE_30__["default"]), /* harmony export */ getVolumeViewportsContainingSameVolumes: () => (/* reexport safe */ _getVolumeViewportsContainingSameVolumes__WEBPACK_IMPORTED_MODULE_19__["default"]), /* harmony export */ handleMultiframe4D: () => (/* reexport safe */ _splitImageIdsBy4DTags__WEBPACK_IMPORTED_MODULE_86__.handleMultiframe4D), /* harmony export */ hasFloatScalingParameters: () => (/* reexport safe */ _hasFloatScalingParameters__WEBPACK_IMPORTED_MODULE_69__.hasFloatScalingParameters), /* harmony export */ hasNaNValues: () => (/* reexport safe */ _hasNaNValues__WEBPACK_IMPORTED_MODULE_41__["default"]), /* harmony export */ imageIdToURI: () => (/* reexport safe */ _imageIdToURI__WEBPACK_IMPORTED_MODULE_10__["default"]), /* harmony export */ imageRetrieveMetadataProvider: () => (/* reexport safe */ _imageRetrieveMetadataProvider__WEBPACK_IMPORTED_MODULE_55__["default"]), /* harmony export */ imageToWorldCoords: () => (/* reexport safe */ _imageToWorldCoords__WEBPACK_IMPORTED_MODULE_28__["default"]), /* harmony export */ indexWithinDimensions: () => (/* reexport safe */ _indexWithinDimensions__WEBPACK_IMPORTED_MODULE_18__["default"]), /* harmony export */ invertRgbTransferFunction: () => (/* reexport safe */ _invertRgbTransferFunction__WEBPACK_IMPORTED_MODULE_1__["default"]), /* harmony export */ isEqual: () => (/* reexport safe */ _isEqual__WEBPACK_IMPORTED_MODULE_101__.isEqual), /* harmony export */ isEqualAbs: () => (/* reexport safe */ _isEqual__WEBPACK_IMPORTED_MODULE_101__.isEqualAbs), /* harmony export */ isEqualNegative: () => (/* reexport safe */ _isEqual__WEBPACK_IMPORTED_MODULE_101__.isEqualNegative), /* harmony export */ isImageActor: () => (/* reexport safe */ _actorCheck__WEBPACK_IMPORTED_MODULE_34__.isImageActor), /* harmony export */ isNumber: () => (/* reexport safe */ _isEqual__WEBPACK_IMPORTED_MODULE_101__.isNumber), /* harmony export */ isOpposite: () => (/* reexport safe */ _isOpposite__WEBPACK_IMPORTED_MODULE_13__["default"]), /* harmony export */ isPTPrescaledWithSUV: () => (/* reexport safe */ _isPTPrescaledWithSUV__WEBPACK_IMPORTED_MODULE_46__["default"]), /* harmony export */ isValidVolume: () => (/* reexport safe */ _isValidVolume__WEBPACK_IMPORTED_MODULE_51__.isValidVolume), /* harmony export */ isVideoTransferSyntax: () => (/* reexport safe */ _isVideoTransferSyntax__WEBPACK_IMPORTED_MODULE_56__["default"]), /* harmony export */ jumpToSlice: () => (/* reexport safe */ _jumpToSlice__WEBPACK_IMPORTED_MODULE_88__.jumpToSlice), /* harmony export */ loadImageToCanvas: () => (/* reexport safe */ _loadImageToCanvas__WEBPACK_IMPORTED_MODULE_23__["default"]), /* harmony export */ logger: () => (/* reexport module object */ _logger__WEBPACK_IMPORTED_MODULE_94__), /* harmony export */ makeVolumeMetadata: () => (/* reexport safe */ _makeVolumeMetadata__WEBPACK_IMPORTED_MODULE_49__["default"]), /* harmony export */ planar: () => (/* reexport module object */ _planar__WEBPACK_IMPORTED_MODULE_71__), /* harmony export */ pointInShapeCallback: () => (/* reexport safe */ _pointInShapeCallback__WEBPACK_IMPORTED_MODULE_70__.pointInShapeCallback), /* harmony export */ renderToCanvasCPU: () => (/* reexport safe */ _renderToCanvasCPU__WEBPACK_IMPORTED_MODULE_25__["default"]), /* harmony export */ renderToCanvasGPU: () => (/* reexport safe */ _renderToCanvasGPU__WEBPACK_IMPORTED_MODULE_26__["default"]), /* harmony export */ rotateToViewCoordinates: () => (/* reexport safe */ _rotateToViewCoordinates__WEBPACK_IMPORTED_MODULE_98__.rotateToViewCoordinates), /* harmony export */ roundNumber: () => (/* reexport safe */ _roundNumber__WEBPACK_IMPORTED_MODULE_63__["default"]), /* harmony export */ roundToPrecision: () => (/* reexport safe */ _roundNumber__WEBPACK_IMPORTED_MODULE_63__.roundToPrecision), /* harmony export */ scaleArray: () => (/* reexport safe */ _scaleArray__WEBPACK_IMPORTED_MODULE_85__["default"]), /* harmony export */ scaleRgbTransferFunction: () => (/* reexport safe */ _scaleRgbTransferFunction__WEBPACK_IMPORTED_MODULE_5__["default"]), /* harmony export */ scroll: () => (/* reexport safe */ _scroll__WEBPACK_IMPORTED_MODULE_89__["default"]), /* harmony export */ snapFocalPointToSlice: () => (/* reexport safe */ _snapFocalPointToSlice__WEBPACK_IMPORTED_MODULE_32__["default"]), /* harmony export */ sortImageIdsAndGetSpacing: () => (/* reexport safe */ _sortImageIdsAndGetSpacing__WEBPACK_IMPORTED_MODULE_48__["default"]), /* harmony export */ spatialRegistrationMetadataProvider: () => (/* reexport safe */ _spatialRegistrationMetadataProvider__WEBPACK_IMPORTED_MODULE_39__["default"]), /* harmony export */ splitImageIdsBy4DTags: () => (/* reexport safe */ _splitImageIdsBy4DTags__WEBPACK_IMPORTED_MODULE_86__["default"]), /* harmony export */ transferFunctionUtils: () => (/* reexport module object */ _transferFunctionUtils__WEBPACK_IMPORTED_MODULE_74__), /* harmony export */ transformIndexToWorld: () => (/* reexport safe */ _transformIndexToWorld__WEBPACK_IMPORTED_MODULE_22__["default"]), /* harmony export */ transformWorldToIndex: () => (/* reexport safe */ _transformWorldToIndex__WEBPACK_IMPORTED_MODULE_21__["default"]), /* harmony export */ transformWorldToIndexContinuous: () => (/* reexport safe */ _transformWorldToIndex__WEBPACK_IMPORTED_MODULE_21__.transformWorldToIndexContinuous), /* harmony export */ triggerEvent: () => (/* reexport safe */ _triggerEvent__WEBPACK_IMPORTED_MODULE_6__["default"]), /* harmony export */ updatePlaneRestriction: () => (/* reexport safe */ _updatePlaneRestriction__WEBPACK_IMPORTED_MODULE_100__.updatePlaneRestriction), /* harmony export */ updateVTKImageDataWithCornerstoneImage: () => (/* reexport safe */ _updateVTKImageDataWithCornerstoneImage__WEBPACK_IMPORTED_MODULE_52__.updateVTKImageDataWithCornerstoneImage), /* harmony export */ uuidv4: () => (/* reexport safe */ _uuidv4__WEBPACK_IMPORTED_MODULE_7__["default"]), /* harmony export */ windowLevel: () => (/* reexport module object */ _windowLevel__WEBPACK_IMPORTED_MODULE_72__), /* harmony export */ worldToImageCoords: () => (/* reexport safe */ _worldToImageCoords__WEBPACK_IMPORTED_MODULE_27__["default"]) /* harmony export */ }); /* harmony import */ var _eventListener__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eventListener */ 12322); /* harmony import */ var _invertRgbTransferFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./invertRgbTransferFunction */ 12265); /* harmony import */ var _createSigmoidRGBTransferFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./createSigmoidRGBTransferFunction */ 11469); /* harmony import */ var _getVoiFromSigmoidRGBTransferFunction__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getVoiFromSigmoidRGBTransferFunction */ 66143); /* harmony import */ var _createLinearRGBTransferFunction__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./createLinearRGBTransferFunction */ 59022); /* harmony import */ var _scaleRgbTransferFunction__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./scaleRgbTransferFunction */ 36539); /* harmony import */ var _triggerEvent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./triggerEvent */ 91133); /* harmony import */ var _uuidv4__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./uuidv4 */ 29760); /* harmony import */ var _getMinMax__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./getMinMax */ 14023); /* harmony import */ var _getRuntimeId__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./getRuntimeId */ 39796); /* harmony import */ var _imageIdToURI__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./imageIdToURI */ 40232); /* harmony import */ var _calibratedPixelSpacingMetadataProvider__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./calibratedPixelSpacingMetadataProvider */ 81551); /* harmony import */ var _clamp__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./clamp */ 67966); /* harmony import */ var _isOpposite__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./isOpposite */ 12880); /* harmony import */ var _getClosestImageId__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./getClosestImageId */ 61200); /* harmony import */ var _getSpacingInNormalDirection__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./getSpacingInNormalDirection */ 7127); /* harmony import */ var _getTargetVolumeAndSpacingInNormalDir__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./getTargetVolumeAndSpacingInNormalDir */ 85493); /* harmony import */ var _getVolumeActorCorners__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./getVolumeActorCorners */ 49338); /* harmony import */ var _indexWithinDimensions__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./indexWithinDimensions */ 39672); /* harmony import */ var _getVolumeViewportsContainingSameVolumes__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./getVolumeViewportsContainingSameVolumes */ 1575); /* harmony import */ var _getViewportsWithVolumeId__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./getViewportsWithVolumeId */ 47289); /* harmony import */ var _transformWorldToIndex__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./transformWorldToIndex */ 19598); /* harmony import */ var _transformIndexToWorld__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./transformIndexToWorld */ 60214); /* harmony import */ var _loadImageToCanvas__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./loadImageToCanvas */ 31517); /* harmony import */ var _historyMemo__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./historyMemo */ 28348); /* harmony import */ var _renderToCanvasCPU__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./renderToCanvasCPU */ 49644); /* harmony import */ var _renderToCanvasGPU__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./renderToCanvasGPU */ 384); /* harmony import */ var _worldToImageCoords__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./worldToImageCoords */ 56349); /* harmony import */ var _imageToWorldCoords__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./imageToWorldCoords */ 99203); /* harmony import */ var _getVolumeSliceRangeInfo__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./getVolumeSliceRangeInfo */ 34612); /* harmony import */ var _getVolumeViewportScrollInfo__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./getVolumeViewportScrollInfo */ 15376); /* harmony import */ var _getSliceRange__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./getSliceRange */ 39790); /* harmony import */ var _snapFocalPointToSlice__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./snapFocalPointToSlice */ 40579); /* harmony import */ var _getImageSliceDataForVolumeViewport__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./getImageSliceDataForVolumeViewport */ 84081); /* harmony import */ var _actorCheck__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./actorCheck */ 36506); /* harmony import */ var _getViewportsWithImageURI__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./getViewportsWithImageURI */ 39367); /* harmony import */ var _getClosestStackImageIndexForPoint__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./getClosestStackImageIndexForPoint */ 1120); /* harmony import */ var _getCurrentVolumeViewportSlice__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./getCurrentVolumeViewportSlice */ 79192); /* harmony import */ var _calculateViewportsSpatialRegistration__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./calculateViewportsSpatialRegistration */ 49189); /* harmony import */ var _spatialRegistrationMetadataProvider__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./spatialRegistrationMetadataProvider */ 22676); /* harmony import */ var _getViewportImageCornersInWorld__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./getViewportImageCornersInWorld */ 12325); /* harmony import */ var _hasNaNValues__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./hasNaNValues */ 96718); /* harmony import */ var _applyPreset__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./applyPreset */ 92574); /* harmony import */ var _PointsManager__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./PointsManager */ 66631); /* harmony import */ var _deepMerge__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./deepMerge */ 70391); /* harmony import */ var _getScalingParameters__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./getScalingParameters */ 62248); /* harmony import */ var _isPTPrescaledWithSUV__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./isPTPrescaledWithSUV */ 31338); /* harmony import */ var _getImageLegacy__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./getImageLegacy */ 49695); /* harmony import */ var _sortImageIdsAndGetSpacing__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./sortImageIdsAndGetSpacing */ 54102); /* harmony import */ var _makeVolumeMetadata__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./makeVolumeMetadata */ 11440); /* harmony import */ var _genericMetadataProvider__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./genericMetadataProvider */ 11468); /* harmony import */ var _isValidVolume__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./isValidVolume */ 36785); /* harmony import */ var _updateVTKImageDataWithCornerstoneImage__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./updateVTKImageDataWithCornerstoneImage */ 99543); /* harmony import */ var _ProgressiveIterator__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./ProgressiveIterator */ 60308); /* harmony import */ var _decimate__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./decimate */ 32167); /* harmony import */ var _imageRetrieveMetadataProvider__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./imageRetrieveMetadataProvider */ 49024); /* harmony import */ var _isVideoTransferSyntax__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./isVideoTransferSyntax */ 74654); /* harmony import */ var _getBufferConfiguration__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./getBufferConfiguration */ 96593); /* harmony import */ var _generateVolumePropsFromImageIds__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./generateVolumePropsFromImageIds */ 78621); /* harmony import */ var _convertStackToVolumeViewport__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./convertStackToVolumeViewport */ 15793); /* harmony import */ var _convertVolumeToStackViewport__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./convertVolumeToStackViewport */ 20515); /* harmony import */ var _VoxelManager__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./VoxelManager */ 14430); /* harmony import */ var _RLEVoxelMap__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./RLEVoxelMap */ 45202); /* harmony import */ var _roundNumber__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./roundNumber */ 72560); /* harmony import */ var _convertToGrayscale__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./convertToGrayscale */ 99824); /* harmony import */ var _convertColorArrayToRgbString__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./convertColorArrayToRgbString */ 12685); /* harmony import */ var _getViewportImageIds__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./getViewportImageIds */ 12982); /* harmony import */ var _getRandomSampleFromArray__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./getRandomSampleFromArray */ 99799); /* harmony import */ var _getVolumeId__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./getVolumeId */ 96146); /* harmony import */ var _hasFloatScalingParameters__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./hasFloatScalingParameters */ 18142); /* harmony import */ var _pointInShapeCallback__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ./pointInShapeCallback */ 83872); /* harmony import */ var _planar__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./planar */ 87229); /* harmony import */ var _windowLevel__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ./windowLevel */ 88871); /* harmony import */ var _colormap__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ./colormap */ 33358); /* harmony import */ var _transferFunctionUtils__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ./transferFunctionUtils */ 19813); /* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(/*! ./color */ 24541); /* harmony import */ var _deepEqual__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(/*! ./deepEqual */ 59355); /* harmony import */ var _FrameRange__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(/*! ./FrameRange */ 49451); /* harmony import */ var _fnv1aHash__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! ./fnv1aHash */ 81777); /* harmony import */ var _getImageDataMetadata__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(/*! ./getImageDataMetadata */ 3589); /* harmony import */ var _buildMetadata__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(/*! ./buildMetadata */ 15856); /* harmony import */ var _getViewportModality__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(/*! ./getViewportModality */ 16280); /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(/*! ../cache/cache */ 38277); /* harmony import */ var _getDynamicVolumeInfo__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(/*! ./getDynamicVolumeInfo */ 56042); /* harmony import */ var _autoLoad__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(/*! ./autoLoad */ 47214); /* harmony import */ var _scaleArray__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(/*! ./scaleArray */ 97450); /* harmony import */ var _splitImageIdsBy4DTags__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ./splitImageIdsBy4DTags */ 45264); /* harmony import */ var _deepClone__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ./deepClone */ 47858); /* harmony import */ var _jumpToSlice__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(/*! ./jumpToSlice */ 63600); /* harmony import */ var _scroll__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(/*! ./scroll */ 3892); /* harmony import */ var _clip__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(/*! ./clip */ 58351); /* harmony import */ var _createSubVolume__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(/*! ./createSubVolume */ 50949); /* harmony import */ var _getVolumeDirectionVectors__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(/*! ./getVolumeDirectionVectors */ 47656); /* harmony import */ var _calculateSpacingBetweenImageIds__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(/*! ./calculateSpacingBetweenImageIds */ 95715); /* harmony import */ var _logger__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(/*! ./logger */ 67821); /* harmony import */ var _calculateNeighborhoodStats__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(/*! ./calculateNeighborhoodStats */ 88106); /* harmony import */ var _getPixelSpacingInformation__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(/*! ./getPixelSpacingInformation */ 82308); /* harmony import */ var _getPlaneCubeIntersectionDimensions__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(/*! ./getPlaneCubeIntersectionDimensions */ 80138); /* harmony import */ var _rotateToViewCoordinates__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(/*! ./rotateToViewCoordinates */ 66471); /* harmony import */ var _asArray__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(/*! ./asArray */ 74744); /* harmony import */ var _updatePlaneRestriction__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(/*! ./updatePlaneRestriction */ 78648); /* harmony import */ var _isEqual__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(/*! ./isEqual */ 17137); const getViewportModality = (viewport, volumeId) => (0,_getViewportModality__WEBPACK_IMPORTED_MODULE_81__._getViewportModality)(viewport, volumeId, _cache_cache__WEBPACK_IMPORTED_MODULE_82__["default"].getVolume); /***/ }, /***/ 39672 /*!**************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/indexWithinDimensions.js ***! \**************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ indexWithinDimensions) /* harmony export */ }); function indexWithinDimensions(index, dimensions) { if (index[0] < 0 || index[0] >= dimensions[0] || index[1] < 0 || index[1] >= dimensions[1] || index[2] < 0 || index[2] >= dimensions[2]) { return false; } return true; } /***/ }, /***/ 12265 /*!******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/invertRgbTransferFunction.js ***! \******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ invertRgbTransferFunction) /* harmony export */ }); function invertRgbTransferFunction(rgbTransferFunction) { if (!rgbTransferFunction) { return; } const size = rgbTransferFunction.getSize(); for (let index = 0; index < size; index++) { const nodeValue1 = []; rgbTransferFunction.getNodeValue(index, nodeValue1); nodeValue1[1] = 1 - nodeValue1[1]; nodeValue1[2] = 1 - nodeValue1[2]; nodeValue1[3] = 1 - nodeValue1[3]; rgbTransferFunction.setNodeValue(index, nodeValue1); } } /***/ }, /***/ 17137 /*!************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/isEqual.js ***! \************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ isEqual: () => (/* binding */ isEqual), /* harmony export */ isEqualAbs: () => (/* binding */ isEqualAbs), /* harmony export */ isEqualNegative: () => (/* binding */ isEqualNegative), /* harmony export */ isNumber: () => (/* binding */ isNumber) /* harmony export */ }); function areNumbersEqualWithTolerance(num1, num2, tolerance) { return Math.abs(num1 - num2) <= tolerance; } function areArraysEqual(arr1, arr2, tolerance = 1e-5) { if (arr1.length !== arr2.length) { return false; } for (let i = 0; i < arr1.length; i++) { if (!areNumbersEqualWithTolerance(arr1[i], arr2[i], tolerance)) { return false; } } return true; } function isNumberType(value) { return typeof value === 'number'; } function isNumberArrayLike(value) { return value && typeof value === 'object' && 'length' in value && typeof value.length === 'number' && value.length > 0 && typeof value[0] === 'number'; } function isEqual(v1, v2, tolerance = 1e-5) { if (typeof v1 !== typeof v2 || v1 === null || v2 === null) { return false; } if (isNumberType(v1) && isNumberType(v2)) { return areNumbersEqualWithTolerance(v1, v2, tolerance); } if (isNumberArrayLike(v1) && isNumberArrayLike(v2)) { return areArraysEqual(v1, v2, tolerance); } return false; } const negative = v => typeof v === 'number' ? -v : v?.map ? v.map(negative) : !v; const abs = v => typeof v === 'number' ? Math.abs(v) : v?.map ? v.map(abs) : v; const isEqualNegative = (v1, v2, tolerance = undefined) => isEqual(v1, negative(v2), tolerance); const isEqualAbs = (v1, v2, tolerance = undefined) => isEqual(abs(v1), abs(v2), tolerance); function isNumber(n) { if (Array.isArray(n)) { return isNumber(n[0]); } return isFinite(n) && !isNaN(n); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isEqual); /***/ }, /***/ 12880 /*!***************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/isOpposite.js ***! \***************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ isOpposite) /* harmony export */ }); function isOpposite(v1, v2, tolerance = 1e-5) { return Math.abs(v1[0] + v2[0]) < tolerance && Math.abs(v1[1] + v2[1]) < tolerance && Math.abs(v1[2] + v2[2]) < tolerance; } /***/ }, /***/ 31338 /*!*************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/isPTPrescaledWithSUV.js ***! \*************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); const isPTPrescaledWithSUV = image => { return image.preScale.scaled && image.preScale.scalingParameters.suvbw; }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isPTPrescaledWithSUV); /***/ }, /***/ 36785 /*!******************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/isValidVolume.js ***! \******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isValidVolume: () => (/* binding */ isValidVolume) /* harmony export */ }); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../metaData */ 90161); /* harmony import */ var _isEqual__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isEqual */ 17137); function isValidVolume(imageIds) { if (!imageIds.length) { return false; } const imageId0 = imageIds[0]; const { modality, seriesInstanceUID } = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('generalSeriesModule', imageId0); const { imageOrientationPatient, pixelSpacing, frameOfReferenceUID, columns, rows, usingDefaultValues } = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('imagePlaneModule', imageId0); if (usingDefaultValues) { return false; } const baseMetadata = { modality, imageOrientationPatient, pixelSpacing, frameOfReferenceUID, columns, rows, seriesInstanceUID }; let validVolume = true; for (let i = 0; i < imageIds.length; i++) { const imageId = imageIds[i]; const { modality, seriesInstanceUID } = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('generalSeriesModule', imageId); const { imageOrientationPatient, pixelSpacing, columns, rows } = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('imagePlaneModule', imageId); if (seriesInstanceUID !== baseMetadata.seriesInstanceUID) { validVolume = false; break; } if (modality !== baseMetadata.modality) { validVolume = false; break; } if (columns !== baseMetadata.columns) { validVolume = false; break; } if (rows !== baseMetadata.rows) { validVolume = false; break; } if (!(0,_isEqual__WEBPACK_IMPORTED_MODULE_1__["default"])(imageOrientationPatient, baseMetadata.imageOrientationPatient)) { validVolume = false; break; } if (!(0,_isEqual__WEBPACK_IMPORTED_MODULE_1__["default"])(pixelSpacing, baseMetadata.pixelSpacing)) { validVolume = false; break; } } return validVolume; } /***/ }, /***/ 74654 /*!**************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/isVideoTransferSyntax.js ***! \**************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ isVideoTransferSyntax), /* harmony export */ videoUIDs: () => (/* binding */ videoUIDs) /* harmony export */ }); const videoUIDs = new Set(['1.2.840.10008.1.2.4.100', '1.2.840.10008.1.2.4.100.1', '1.2.840.10008.1.2.4.101', '1.2.840.10008.1.2.4.101.1', '1.2.840.10008.1.2.4.102', '1.2.840.10008.1.2.4.102.1', '1.2.840.10008.1.2.4.103', '1.2.840.10008.1.2.4.103.1', '1.2.840.10008.1.2.4.104', '1.2.840.10008.1.2.4.104.1', '1.2.840.10008.1.2.4.105', '1.2.840.10008.1.2.4.105.1', '1.2.840.10008.1.2.4.106', '1.2.840.10008.1.2.4.106.1', '1.2.840.10008.1.2.4.107', '1.2.840.10008.1.2.4.108']); function isVideoTransferSyntax(uidOrUids) { if (!uidOrUids) { return false; } const uids = Array.isArray(uidOrUids) ? uidOrUids : [uidOrUids]; return uids.find(uid => videoUIDs.has(uid)); } /***/ }, /***/ 63600 /*!****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/jumpToSlice.js ***! \****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ jumpToSlice: () => (/* binding */ jumpToSlice) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _clip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./clip */ 58351); /* harmony import */ var _scroll__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./scroll */ 3892); /* harmony import */ var _getEnabledElement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../getEnabledElement */ 98361); /* harmony import */ var _RenderingEngine_StackViewport__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../RenderingEngine/StackViewport */ 67461); function jumpToSlice(_x) { return _jumpToSlice.apply(this, arguments); } function _jumpToSlice() { _jumpToSlice = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (element, options = {}) { const { imageIndex, debounceLoading, volumeId } = options; const enabledElement = (0,_getEnabledElement__WEBPACK_IMPORTED_MODULE_3__["default"])(element); if (!enabledElement) { throw new Error('Element has been disabled'); } const { viewport } = enabledElement; const { imageIndex: currentImageIndex, numberOfSlices } = _getImageSliceData(viewport, debounceLoading); const imageIndexToJump = _getImageIndexToJump(numberOfSlices, imageIndex); const delta = imageIndexToJump - currentImageIndex; (0,_scroll__WEBPACK_IMPORTED_MODULE_2__["default"])(viewport, { delta, debounceLoading, volumeId }); }); return _jumpToSlice.apply(this, arguments); } function _getImageSliceData(viewport, debounceLoading) { if (viewport instanceof _RenderingEngine_StackViewport__WEBPACK_IMPORTED_MODULE_4__["default"]) { return { numberOfSlices: viewport.getImageIds().length, imageIndex: debounceLoading ? viewport.getTargetImageIdIndex() : viewport.getCurrentImageIdIndex() }; } return { numberOfSlices: viewport.getNumberOfSlices(), imageIndex: viewport.getSliceIndex() }; } function _getImageIndexToJump(numberOfSlices, imageIndex) { const lastSliceIndex = numberOfSlices - 1; return (0,_clip__WEBPACK_IMPORTED_MODULE_1__["default"])(imageIndex, 0, lastSliceIndex); } /***/ }, /***/ 31517 /*!**********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/loadImageToCanvas.js ***! \**********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ loadImageToCanvas) /* harmony export */ }); /* harmony import */ var _loaders_imageLoader__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../loaders/imageLoader */ 96035); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../metaData */ 90161); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enums */ 9742); /* harmony import */ var _requestPool_imageLoadPoolManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../requestPool/imageLoadPoolManager */ 11062); /* harmony import */ var _renderToCanvasGPU__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./renderToCanvasGPU */ 384); /* harmony import */ var _renderToCanvasCPU__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./renderToCanvasCPU */ 49644); /* harmony import */ var _cache_cache__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../cache/cache */ 38277); function loadImageToCanvas(options) { const { canvas, imageId, viewReference, requestType = _enums__WEBPACK_IMPORTED_MODULE_2__["default"].Thumbnail, priority = -5, renderingEngineId = '_thumbnails', useCPURendering = false, thumbnail = false, imageAspect = false, viewportOptions: baseViewportOptions } = options; const volumeId = viewReference?.volumeId; const isVolume = volumeId && !imageId; const viewportOptions = viewReference && baseViewportOptions ? { ...baseViewportOptions, viewReference } : baseViewportOptions; const renderFn = useCPURendering ? _renderToCanvasCPU__WEBPACK_IMPORTED_MODULE_5__["default"] : _renderToCanvasGPU__WEBPACK_IMPORTED_MODULE_4__["default"]; return new Promise((resolve, reject) => { function successCallback(imageOrVolume, imageId) { const { modality } = _metaData__WEBPACK_IMPORTED_MODULE_1__.get('generalSeriesModule', imageId) || {}; const image = !isVolume && imageOrVolume; const volume = isVolume && imageOrVolume; if (image) { image.isPreScaled = image.isPreScaled || image.preScale?.scaled; } if (thumbnail) { canvas.height = 256; canvas.width = 256; } if (imageAspect && image) { canvas.width = image && canvas.height * image.width / image.height; } canvas.style.width = `${canvas.width / devicePixelRatio}px`; canvas.style.height = `${canvas.height / devicePixelRatio}px`; if (volume && useCPURendering) { reject(new Error('CPU rendering of volume not supported')); } renderFn(canvas, imageOrVolume, modality, renderingEngineId, viewportOptions).then(resolve); } function errorCallback(error, imageId) { console.error(error, imageId); reject(error); } function sendRequest(imageId, imageIdIndex, options) { return (0,_loaders_imageLoader__WEBPACK_IMPORTED_MODULE_0__.loadAndCacheImage)(imageId, options).then(image => { successCallback.call(this, image, imageId); }, error => { errorCallback.call(this, error, imageId); }); } const options = { useRGBA: !!useCPURendering, requestType }; if (volumeId) { const volume = _cache_cache__WEBPACK_IMPORTED_MODULE_6__["default"].getVolume(volumeId); if (!volume) { reject(new Error(`Volume id ${volumeId} not found in cache`)); } const useImageId = volume.imageIds[0]; successCallback(volume, useImageId); } else { _requestPool_imageLoadPoolManager__WEBPACK_IMPORTED_MODULE_3__["default"].addRequest(sendRequest.bind(null, imageId, null, options), requestType, { imageId }, priority); } }); } /***/ }, /***/ 67821 /*!***********************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/logger.js ***! \***********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ aiLog: () => (/* binding */ aiLog), /* harmony export */ coreLog: () => (/* binding */ coreLog), /* harmony export */ cs3dLog: () => (/* binding */ cs3dLog), /* harmony export */ dicomConsistencyLog: () => (/* binding */ dicomConsistencyLog), /* harmony export */ examplesLog: () => (/* binding */ examplesLog), /* harmony export */ getLogger: () => (/* binding */ getLogger), /* harmony export */ getRootLogger: () => (/* binding */ getRootLogger), /* harmony export */ imageConsistencyLog: () => (/* binding */ imageConsistencyLog), /* harmony export */ loaderLog: () => (/* binding */ loaderLog), /* harmony export */ toolsLog: () => (/* binding */ toolsLog) /* harmony export */ }); /* harmony import */ var loglevel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! loglevel */ 79526); /* harmony import */ var loglevel__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(loglevel__WEBPACK_IMPORTED_MODULE_0__); const loglevel = loglevel__WEBPACK_IMPORTED_MODULE_0___default().noConflict(); if (typeof window !== 'undefined') { window.log = loglevel; } function getRootLogger(name) { const logger = loglevel.getLogger(name[0]); logger.getLogger = (...names) => { return getRootLogger(`${name}.${names.join('.')}`); }; return logger; } function getLogger(...name) { return getRootLogger(name.join('.')); } const cs3dLog = getRootLogger('cs3d'); const coreLog = cs3dLog.getLogger('core'); const toolsLog = cs3dLog.getLogger('tools'); const loaderLog = cs3dLog.getLogger('dicomImageLoader'); const aiLog = cs3dLog.getLogger('ai'); const examplesLog = cs3dLog.getLogger('examples'); const dicomConsistencyLog = getLogger('consistency', 'dicom'); const imageConsistencyLog = getLogger('consistency', 'image'); /***/ }, /***/ 57818 /*!**********************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/logit.js ***! \**********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ logit: () => (/* binding */ logit) /* harmony export */ }); const logit = (y, wc, ww) => { return wc - ww / 4 * Math.log((1 - y) / y); }; /***/ }, /***/ 11440 /*!***********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/makeVolumeMetadata.js ***! \***********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ makeVolumeMetadata) /* harmony export */ }); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../metaData */ 90161); function makeVolumeMetadata(imageIds) { const imageId0 = imageIds[0]; const { pixelRepresentation, bitsAllocated, bitsStored, highBit, photometricInterpretation, samplesPerPixel } = (0,_metaData__WEBPACK_IMPORTED_MODULE_0__.get)('imagePixelModule', imageId0); const voiLut = []; const voiLutModule = (0,_metaData__WEBPACK_IMPORTED_MODULE_0__.get)('voiLutModule', imageId0); let voiLUTFunction; if (voiLutModule) { const { windowWidth, windowCenter } = voiLutModule; voiLUTFunction = voiLutModule?.voiLUTFunction; if (Array.isArray(windowWidth)) { for (let i = 0; i < windowWidth.length; i++) { voiLut.push({ windowWidth: windowWidth[i], windowCenter: windowCenter[i] }); } } else { voiLut.push({ windowWidth: windowWidth, windowCenter: windowCenter }); } } else { voiLut.push({ windowWidth: undefined, windowCenter: undefined }); } const { modality, seriesInstanceUID } = (0,_metaData__WEBPACK_IMPORTED_MODULE_0__.get)('generalSeriesModule', imageId0); const { imageOrientationPatient, pixelSpacing, frameOfReferenceUID, columns, rows } = (0,_metaData__WEBPACK_IMPORTED_MODULE_0__.get)('imagePlaneModule', imageId0); return { BitsAllocated: bitsAllocated, BitsStored: bitsStored, SamplesPerPixel: samplesPerPixel, HighBit: highBit, PhotometricInterpretation: photometricInterpretation, PixelRepresentation: pixelRepresentation, Modality: modality, ImageOrientationPatient: imageOrientationPatient, PixelSpacing: pixelSpacing, FrameOfReferenceUID: frameOfReferenceUID, Columns: columns, Rows: rows, voiLut, VOILUTFunction: voiLUTFunction, SeriesInstanceUID: seriesInstanceUID }; } /***/ }, /***/ 87229 /*!***********************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/planar.js ***! \***********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isPointOnPlane: () => (/* binding */ isPointOnPlane), /* harmony export */ linePlaneIntersection: () => (/* binding */ linePlaneIntersection), /* harmony export */ planeDistanceToPoint: () => (/* binding */ planeDistanceToPoint), /* harmony export */ planeEquation: () => (/* binding */ planeEquation), /* harmony export */ threePlaneIntersection: () => (/* binding */ threePlaneIntersection) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 23988); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../constants */ 19050); function linePlaneIntersection(p0, p1, plane) { const [x0, y0, z0] = p0; const [x1, y1, z1] = p1; const [A, B, C, D] = plane; const a = x1 - x0; const b = y1 - y0; const c = z1 - z0; const t = -1 * (A * x0 + B * y0 + C * z0 - D) / (A * a + B * b + C * c); const X = a * t + x0; const Y = b * t + y0; const Z = c * t + z0; return [X, Y, Z]; } function planeEquation(normal, point, normalized = false) { const [A, B, C] = normal; const D = A * point[0] + B * point[1] + C * point[2]; if (normalized) { const length = Math.sqrt(A * A + B * B + C * C); return [A / length, B / length, C / length, D / length]; } return [A, B, C, D]; } function threePlaneIntersection(firstPlane, secondPlane, thirdPlane) { const [A1, B1, C1, D1] = firstPlane; const [A2, B2, C2, D2] = secondPlane; const [A3, B3, C3, D3] = thirdPlane; const m0 = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.fromValues(A1, A2, A3, B1, B2, B3, C1, C2, C3); const m1 = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.fromValues(D1, D2, D3, B1, B2, B3, C1, C2, C3); const m2 = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.fromValues(A1, A2, A3, D1, D2, D3, C1, C2, C3); const m3 = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.fromValues(A1, A2, A3, B1, B2, B3, D1, D2, D3); const x = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.determinant(m1) / gl_matrix__WEBPACK_IMPORTED_MODULE_0__.determinant(m0); const y = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.determinant(m2) / gl_matrix__WEBPACK_IMPORTED_MODULE_0__.determinant(m0); const z = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.determinant(m3) / gl_matrix__WEBPACK_IMPORTED_MODULE_0__.determinant(m0); return [x, y, z]; } function planeDistanceToPoint(plane, point, signed = false) { const [A, B, C, D] = plane; const [x, y, z] = point; const numerator = A * x + B * y + C * z - D; const distance = Math.abs(numerator) / Math.sqrt(A * A + B * B + C * C); const sign = signed ? Math.sign(numerator) : 1; return sign * distance; } function isPointOnPlane(point, plane, tolerance = _constants__WEBPACK_IMPORTED_MODULE_1__["default"]) { return planeDistanceToPoint(plane, point) < tolerance; } /***/ }, /***/ 83872 /*!*************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/pointInShapeCallback.js ***! \*************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ iterateOverPointsInShape: () => (/* binding */ iterateOverPointsInShape), /* harmony export */ iterateOverPointsInShapeVoxelManager: () => (/* binding */ iterateOverPointsInShapeVoxelManager), /* harmony export */ pointInShapeCallback: () => (/* binding */ pointInShapeCallback) /* harmony export */ }); /* harmony import */ var _createPositionCallback__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createPositionCallback */ 857); function pointInShapeCallback(imageData, options) { const { pointInShapeFn, callback, boundsIJK, returnPoints = false } = options; let scalarData; if (imageData.getScalarData) { scalarData = imageData.getScalarData(); } else { const scalars = imageData.getPointData().getScalars(); if (scalars) { scalarData = scalars.getData(); } else { const { voxelManager } = imageData.get('voxelManager') || {}; if (voxelManager) { scalarData = voxelManager.getCompleteScalarDataArray(); } } } const dimensions = imageData.getDimensions(); const defaultBoundsIJK = [[0, dimensions[0]], [0, dimensions[1]], [0, dimensions[2]]]; const bounds = boundsIJK || defaultBoundsIJK; const pointsInShape = iterateOverPointsInShape({ imageData, bounds, scalarData, pointInShapeFn, callback }); return returnPoints ? pointsInShape : undefined; } function iterateOverPointsInShape({ imageData, bounds, scalarData, pointInShapeFn, callback }) { const [[iMin, iMax], [jMin, jMax], [kMin, kMax]] = bounds; const { numComps } = imageData; const dimensions = imageData.getDimensions(); const indexToWorld = (0,_createPositionCallback__WEBPACK_IMPORTED_MODULE_0__.createPositionCallback)(imageData); const pointIJK = [0, 0, 0]; const xMultiple = numComps || scalarData.length / dimensions[2] / dimensions[1] / dimensions[0]; const yMultiple = dimensions[0] * xMultiple; const zMultiple = dimensions[1] * yMultiple; const pointsInShape = []; for (let k = kMin; k <= kMax; k++) { pointIJK[2] = k; const indexK = k * zMultiple; for (let j = jMin; j <= jMax; j++) { pointIJK[1] = j; const indexJK = indexK + j * yMultiple; for (let i = iMin; i <= iMax; i++) { pointIJK[0] = i; const pointLPS = indexToWorld(pointIJK); if (pointInShapeFn(pointLPS, pointIJK)) { const index = indexJK + i * xMultiple; let value; if (xMultiple > 2) { value = [scalarData[index], scalarData[index + 1], scalarData[index + 2]]; } else { value = scalarData[index]; } pointsInShape.push({ value, index, pointIJK, pointLPS: pointLPS.slice() }); callback({ value, index, pointIJK, pointLPS }); } } } } return pointsInShape; } function iterateOverPointsInShapeVoxelManager({ voxelManager, bounds, imageData, pointInShapeFn, callback, returnPoints }) { const [[iMin, iMax], [jMin, jMax], [kMin, kMax]] = bounds; const indexToWorld = (0,_createPositionCallback__WEBPACK_IMPORTED_MODULE_0__.createPositionCallback)(imageData); const pointIJK = [0, 0, 0]; const pointsInShape = []; for (let k = kMin; k <= kMax; k++) { pointIJK[2] = k; for (let j = jMin; j <= jMax; j++) { pointIJK[1] = j; for (let i = iMin; i <= iMax; i++) { pointIJK[0] = i; const pointLPS = indexToWorld(pointIJK); if (pointInShapeFn(pointLPS, pointIJK)) { const index = voxelManager.toIndex(pointIJK); const value = voxelManager.getAtIndex(index); if (returnPoints) { pointsInShape.push({ value, index, pointIJK: [...pointIJK], pointLPS: pointLPS.slice() }); } callback?.({ value, index, pointIJK, pointLPS }); } } } } return pointsInShape; } /***/ }, /***/ 51951 /*!******************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/reflectVector.js ***! \******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ reflectVector: () => (/* binding */ reflectVector) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 87396); function reflectVector(v, normal) { const dotProduct = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(v, normal); const scaledNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.scale(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), normal, 2 * dotProduct); return gl_matrix__WEBPACK_IMPORTED_MODULE_0__.sub(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), v, scaledNormal); } /***/ }, /***/ 49644 /*!**********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/renderToCanvasCPU.js ***! \**********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ renderToCanvasCPU) /* harmony export */ }); /* harmony import */ var _RenderingEngine_helpers_cpuFallback_rendering_getDefaultViewport__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../RenderingEngine/helpers/cpuFallback/rendering/getDefaultViewport */ 20486); /* harmony import */ var _RenderingEngine_helpers_cpuFallback_rendering_calculateTransform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../RenderingEngine/helpers/cpuFallback/rendering/calculateTransform */ 45649); /* harmony import */ var _RenderingEngine_helpers_cpuFallback_drawImageSync__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../RenderingEngine/helpers/cpuFallback/drawImageSync */ 67434); function renderToCanvasCPU(canvas, imageOrVolume, modality, _renderingEngineId, _viewportOptions) { const volume = imageOrVolume; if (volume.volumeId) { throw new Error('Unsupported volume rendering for CPU'); } const image = imageOrVolume; const viewport = (0,_RenderingEngine_helpers_cpuFallback_rendering_getDefaultViewport__WEBPACK_IMPORTED_MODULE_0__["default"])(canvas, image, modality); const enabledElement = { canvas, viewport, image, renderingTools: {} }; enabledElement.transform = (0,_RenderingEngine_helpers_cpuFallback_rendering_calculateTransform__WEBPACK_IMPORTED_MODULE_1__["default"])(enabledElement); const invalidated = true; return new Promise((resolve, reject) => { (0,_RenderingEngine_helpers_cpuFallback_drawImageSync__WEBPACK_IMPORTED_MODULE_2__["default"])(enabledElement, invalidated); resolve(null); }); } /***/ }, /***/ 384 /*!**********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/renderToCanvasGPU.js ***! \**********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ renderToCanvasGPU) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _RenderingEngine_helpers_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../RenderingEngine/helpers/getOrCreateCanvas */ 63628); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enums */ 14566); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../enums */ 43089); /* harmony import */ var _RenderingEngine_getRenderingEngine__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../RenderingEngine/getRenderingEngine */ 77569); /* harmony import */ var _RenderingEngine_TiledRenderingEngine__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../RenderingEngine/TiledRenderingEngine */ 84405); /* harmony import */ var _isPTPrescaledWithSUV__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./isPTPrescaledWithSUV */ 31338); function renderToCanvasGPU(canvas, imageOrVolume, modality = undefined, renderingEngineId = '_thumbnails', viewportOptions = { displayArea: { imageArea: [1, 1] } }) { if (!canvas || !(canvas instanceof HTMLCanvasElement)) { throw new Error('canvas element is required'); } const isVolume = !imageOrVolume.imageId; const image = !isVolume && imageOrVolume; const volume = isVolume && imageOrVolume; const imageIdToPrint = image.imageId || volume.volumeId; const viewportId = `renderGPUViewport-${imageIdToPrint}`; const element = document.createElement('div'); const devicePixelRatio = window.devicePixelRatio || 1; if (!viewportOptions.displayArea) { viewportOptions.displayArea = { imageArea: [1, 1] }; } const originalWidth = canvas.width; const originalHeight = canvas.height; element.style.width = `${originalWidth / devicePixelRatio + _RenderingEngine_helpers_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_1__.EPSILON}px`; element.style.height = `${originalHeight / devicePixelRatio + _RenderingEngine_helpers_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_1__.EPSILON}px`; element.style.visibility = 'hidden'; element.style.position = 'absolute'; document.body.appendChild(element); const uniqueId = viewportId.split(':').join('-'); element.setAttribute('viewport-id-for-remove', uniqueId); const temporaryCanvas = (0,_RenderingEngine_helpers_getOrCreateCanvas__WEBPACK_IMPORTED_MODULE_1__["default"])(element); const renderingEngine = (0,_RenderingEngine_getRenderingEngine__WEBPACK_IMPORTED_MODULE_4__.getRenderingEngine)(renderingEngineId) || new _RenderingEngine_TiledRenderingEngine__WEBPACK_IMPORTED_MODULE_5__["default"](renderingEngineId); let viewport = renderingEngine.getViewport(viewportId); if (!viewport) { const viewportInput = { viewportId, type: isVolume ? _enums__WEBPACK_IMPORTED_MODULE_3__["default"].ORTHOGRAPHIC : _enums__WEBPACK_IMPORTED_MODULE_3__["default"].STACK, element, defaultOptions: { ...viewportOptions, suppressEvents: true } }; renderingEngine.enableElement(viewportInput); viewport = renderingEngine.getViewport(viewportId); } return new Promise(resolve => { let elementRendered = false; let { viewReference } = viewportOptions; const onImageRendered = eventDetail => { if (elementRendered) { return; } if (viewReference) { const useViewRef = viewReference; viewReference = null; viewport.setViewReference(useViewRef); viewport.render(); return; } const context = canvas.getContext('2d'); context.drawImage(temporaryCanvas, 0, 0, temporaryCanvas.width, temporaryCanvas.height, 0, 0, canvas.width, canvas.height); const origin = viewport.canvasToWorld([0, 0]); const topRight = viewport.canvasToWorld([temporaryCanvas.width / devicePixelRatio, 0]); const bottomLeft = viewport.canvasToWorld([0, temporaryCanvas.height / devicePixelRatio]); const rightVector = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.sub([0, 0, 0], viewport.canvasToWorld([1 / devicePixelRatio, 0]), origin); const downVector = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.sub([0, 0, 0], viewport.canvasToWorld([0, 1 / devicePixelRatio]), origin); const thicknessMm = 1; elementRendered = true; element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_2__["default"].IMAGE_RENDERED, onImageRendered); setTimeout(() => { renderingEngine.disableElement(viewportId); const elements = document.querySelectorAll(`[viewport-id-for-remove="${uniqueId}"]`); elements.forEach(element => { element.remove(); }); }, 0); resolve({ origin, bottomLeft, topRight, thicknessMm, rightVector, downVector }); }; element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_2__["default"].IMAGE_RENDERED, onImageRendered); if (isVolume) { viewport.setVolumes([volume], false, true); } else { viewport.renderImageObject(imageOrVolume); } viewport.resetCamera(); if (modality === 'PT' && !(0,_isPTPrescaledWithSUV__WEBPACK_IMPORTED_MODULE_6__["default"])(image)) { viewport.setProperties({ voiRange: { lower: image.minPixelValue, upper: image.maxPixelValue } }); } viewport.render(); }); } /***/ }, /***/ 66471 /*!****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/rotateToViewCoordinates.js ***! \****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ rotateToViewCoordinates: () => (/* binding */ rotateToViewCoordinates) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 87396); function rotateToViewCoordinates(imageData, viewPlaneNormal, viewUp) { const viewRight = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.cross(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), viewPlaneNormal, viewUp); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.normalize(viewRight, viewRight); const extent = imageData.getExtent(); const xMin = extent[0]; const xMax = extent[1] + 1; const yMin = extent[2]; const yMax = extent[3] + 1; const zMin = extent[4]; const zMax = extent[5] + 1; const corners = [[xMin, yMin, zMin], [xMax, yMin, zMin], [xMin, yMax, zMin], [xMax, yMax, zMin], [xMin, yMin, zMax], [xMax, yMin, zMax], [xMin, yMax, zMax], [xMax, yMax, zMax]]; const viewCorners = corners.map(corner => { const worldPoint = [0, 0, 0]; imageData.indexToWorld(corner, worldPoint); const viewPoint = [gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(worldPoint, viewRight), gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(worldPoint, viewUp), gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(worldPoint, viewPlaneNormal)]; return viewPoint; }); return viewCorners; } /***/ }, /***/ 72560 /*!****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/roundNumber.js ***! \****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ roundToPrecision: () => (/* binding */ roundToPrecision) /* harmony export */ }); /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants */ 19050); function roundNumber(value, precision = 2) { if (Array.isArray(value)) { return value.map(v => roundNumber(v, precision)).join(', '); } if (value === undefined || value === null || value === '') { return 'NaN'; } value = Number(value); const absValue = Math.abs(value); if (absValue < 0.0001) { return `${value}`; } const fixedPrecision = absValue >= 100 ? precision - 2 : absValue >= 10 ? precision - 1 : absValue >= 1 ? precision : absValue >= 0.1 ? precision + 1 : absValue >= 0.01 ? precision + 2 : absValue >= 0.001 ? precision + 3 : precision + 4; return value.toFixed(fixedPrecision); } function roundToPrecision(value) { return Math.round(value / _constants__WEBPACK_IMPORTED_MODULE_0__["default"]) * _constants__WEBPACK_IMPORTED_MODULE_0__["default"]; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (roundNumber); /***/ }, /***/ 97450 /*!***************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/scaleArray.js ***! \***************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ scaleArray) /* harmony export */ }); function scaleArray(array, scalingParameters) { const arrayLength = array.length; const { rescaleSlope, rescaleIntercept, suvbw } = scalingParameters; if (scalingParameters.modality === 'PT' && typeof suvbw === 'number') { for (let i = 0; i < arrayLength; i++) { array[i] = suvbw * (array[i] * rescaleSlope + rescaleIntercept); } } else { for (let i = 0; i < arrayLength; i++) { array[i] = array[i] * rescaleSlope + rescaleIntercept; } } return array; } /***/ }, /***/ 36539 /*!*****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/scaleRgbTransferFunction.js ***! \*****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ scaleRGBTransferFunction) /* harmony export */ }); function scaleRGBTransferFunction(rgbTransferFunction, scalingFactor) { const size = rgbTransferFunction.getSize(); for (let index = 0; index < size; index++) { const nodeValue1 = []; rgbTransferFunction.getNodeValue(index, nodeValue1); nodeValue1[1] = nodeValue1[1] * scalingFactor; nodeValue1[2] = nodeValue1[2] * scalingFactor; nodeValue1[3] = nodeValue1[3] * scalingFactor; rgbTransferFunction.setNodeValue(index, nodeValue1); } } /***/ }, /***/ 3892 /*!***********************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/scroll.js ***! \***********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ scroll), /* harmony export */ scrollVolume: () => (/* binding */ scrollVolume) /* harmony export */ }); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums */ 14566); /* harmony import */ var _RenderingEngine__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../RenderingEngine */ 93667); /* harmony import */ var _RenderingEngine__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../RenderingEngine */ 67461); /* harmony import */ var _getVolumeViewportScrollInfo__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getVolumeViewportScrollInfo */ 15376); /* harmony import */ var _snapFocalPointToSlice__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./snapFocalPointToSlice */ 40579); /* harmony import */ var _getEnabledElement__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../getEnabledElement */ 98361); /* harmony import */ var _triggerEvent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./triggerEvent */ 91133); /* harmony import */ var _eventTarget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../eventTarget */ 28699); function scroll(viewport, options) { const enabledElement = (0,_getEnabledElement__WEBPACK_IMPORTED_MODULE_5__["default"])(viewport.element); if (!enabledElement) { throw new Error('Scroll::Viewport is not enabled (it might be disabled)'); } if (viewport instanceof _RenderingEngine__WEBPACK_IMPORTED_MODULE_2__["default"] && viewport.getImageIds().length === 0) { throw new Error('Scroll::Stack Viewport has no images'); } const { volumeId, delta, scrollSlabs } = options; if (viewport instanceof _RenderingEngine__WEBPACK_IMPORTED_MODULE_1__["default"]) { scrollVolume(viewport, volumeId, delta, scrollSlabs); } else { const imageIdIndex = viewport.getCurrentImageIdIndex(); if (imageIdIndex + delta > viewport.getImageIds().length - 1 || imageIdIndex + delta < 0) { const eventData = { imageIdIndex, direction: delta }; (0,_triggerEvent__WEBPACK_IMPORTED_MODULE_6__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_7__["default"], _enums__WEBPACK_IMPORTED_MODULE_0__["default"].STACK_SCROLL_OUT_OF_BOUNDS, eventData); } viewport.scroll(delta, options.debounceLoading, options.loop); } } function scrollVolume(viewport, volumeId, delta, scrollSlabs = false) { const useSlabThickness = scrollSlabs; const { numScrollSteps, currentStepIndex, sliceRangeInfo } = (0,_getVolumeViewportScrollInfo__WEBPACK_IMPORTED_MODULE_3__["default"])(viewport, volumeId, useSlabThickness); if (numScrollSteps === 0) return; if (!sliceRangeInfo) { return; } const { sliceRange, spacingInNormalDirection, camera } = sliceRangeInfo; const { focalPoint, viewPlaneNormal, position } = camera; const { newFocalPoint, newPosition } = (0,_snapFocalPointToSlice__WEBPACK_IMPORTED_MODULE_4__["default"])(focalPoint, position, sliceRange, viewPlaneNormal, spacingInNormalDirection, delta); viewport.setCamera({ focalPoint: newFocalPoint, position: newPosition }); viewport.render(); const desiredStepIndex = currentStepIndex + delta; const VolumeScrollEventDetail = { volumeId, viewport, delta, desiredStepIndex, currentStepIndex, numScrollSteps, currentImageId: viewport.getCurrentImageId() }; if ((desiredStepIndex > numScrollSteps || desiredStepIndex < 0) && viewport.getCurrentImageId()) { (0,_triggerEvent__WEBPACK_IMPORTED_MODULE_6__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_7__["default"], _enums__WEBPACK_IMPORTED_MODULE_0__["default"].VOLUME_VIEWPORT_SCROLL_OUT_OF_BOUNDS, VolumeScrollEventDetail); } else { (0,_triggerEvent__WEBPACK_IMPORTED_MODULE_6__["default"])(_eventTarget__WEBPACK_IMPORTED_MODULE_7__["default"], _enums__WEBPACK_IMPORTED_MODULE_0__["default"].VOLUME_VIEWPORT_SCROLL, VolumeScrollEventDetail); } } /***/ }, /***/ 40579 /*!**************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/snapFocalPointToSlice.js ***! \**************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ snapFocalPointToSlice) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 87396); function snapFocalPointToSlice(focalPoint, position, sliceRange, viewPlaneNormal, spacingInNormalDirection, deltaFrames) { const { min, max, current } = sliceRange; const posDiffFromFocalPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.sub(posDiffFromFocalPoint, position, focalPoint); const steps = Math.round((max - min) / spacingInNormalDirection); const fraction = (current - min) / (max - min); const floatingStepNumber = fraction * steps; let frameIndex = Math.round(floatingStepNumber); let newFocalPoint = [focalPoint[0] - viewPlaneNormal[0] * floatingStepNumber * spacingInNormalDirection, focalPoint[1] - viewPlaneNormal[1] * floatingStepNumber * spacingInNormalDirection, focalPoint[2] - viewPlaneNormal[2] * floatingStepNumber * spacingInNormalDirection]; frameIndex += deltaFrames; if (frameIndex > steps) { frameIndex = steps; } else if (frameIndex < 0) { frameIndex = 0; } const newSlicePosFromMin = frameIndex * spacingInNormalDirection; newFocalPoint = [newFocalPoint[0] + viewPlaneNormal[0] * newSlicePosFromMin, newFocalPoint[1] + viewPlaneNormal[1] * newSlicePosFromMin, newFocalPoint[2] + viewPlaneNormal[2] * newSlicePosFromMin]; const newPosition = [newFocalPoint[0] + posDiffFromFocalPoint[0], newFocalPoint[1] + posDiffFromFocalPoint[1], newFocalPoint[2] + posDiffFromFocalPoint[2]]; return { newFocalPoint, newPosition }; } /***/ }, /***/ 54102 /*!******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/sortImageIdsAndGetSpacing.js ***! \******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ sortImageIdsAndGetSpacing) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../metaData */ 90161); /* harmony import */ var _calculateSpacingBetweenImageIds__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./calculateSpacingBetweenImageIds */ 95715); function sortImageIdsAndGetSpacing(imageIds, scanAxisNormal) { const { imagePositionPatient: referenceImagePositionPatient, imageOrientationPatient } = _metaData__WEBPACK_IMPORTED_MODULE_1__.get('imagePlaneModule', imageIds[0]); if (!scanAxisNormal) { const rowCosineVec = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.fromValues(imageOrientationPatient[0], imageOrientationPatient[1], imageOrientationPatient[2]); const colCosineVec = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.fromValues(imageOrientationPatient[3], imageOrientationPatient[4], imageOrientationPatient[5]); scanAxisNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.cross(scanAxisNormal, rowCosineVec, colCosineVec); } const usingWadoUri = imageIds[0].split(':')[0] === 'wadouri'; const zSpacing = (0,_calculateSpacingBetweenImageIds__WEBPACK_IMPORTED_MODULE_2__["default"])(imageIds); let sortedImageIds; function getDistance(imageId) { const { imagePositionPatient } = _metaData__WEBPACK_IMPORTED_MODULE_1__.get('imagePlaneModule', imageId); const positionVector = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.sub(positionVector, referenceImagePositionPatient, imagePositionPatient); return gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(positionVector, scanAxisNormal); } if (!usingWadoUri) { const distanceImagePairs = imageIds.map(imageId => { const distance = getDistance(imageId); return { distance, imageId }; }); distanceImagePairs.sort((a, b) => b.distance - a.distance); sortedImageIds = distanceImagePairs.map(a => a.imageId); } else { const prefetchedImageIds = [imageIds[0], imageIds[Math.floor(imageIds.length / 2)]]; sortedImageIds = imageIds; const firstImageDistance = getDistance(prefetchedImageIds[0]); const middleImageDistance = getDistance(prefetchedImageIds[1]); if (firstImageDistance - middleImageDistance < 0) { sortedImageIds.reverse(); } } const { imagePositionPatient: origin } = _metaData__WEBPACK_IMPORTED_MODULE_1__.get('imagePlaneModule', sortedImageIds[0]); const result = { zSpacing, origin, sortedImageIds }; return result; } /***/ }, /***/ 22676 /*!****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/spatialRegistrationMetadataProvider.js ***! \****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 95329); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../metaData */ 90161); const state = {}; const spatialRegistrationMetadataProvider = { add: (query, payload) => { const [viewportId1, viewportId2] = query; const entryId = `${viewportId1}_${viewportId2}`; if (!state[entryId]) { state[entryId] = {}; } state[entryId] = payload; }, get: (type, viewportId1, viewportId2) => { if (type !== 'spatialRegistrationModule') { return; } const entryId = `${viewportId1}_${viewportId2}`; if (state[entryId]) { return state[entryId]; } const entryIdReverse = `${viewportId2}_${viewportId1}`; if (state[entryIdReverse]) { return gl_matrix__WEBPACK_IMPORTED_MODULE_0__.invert(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), state[entryIdReverse]); } } }; (0,_metaData__WEBPACK_IMPORTED_MODULE_1__.addProvider)(spatialRegistrationMetadataProvider.get.bind(spatialRegistrationMetadataProvider)); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (spatialRegistrationMetadataProvider); /***/ }, /***/ 45264 /*!**************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/splitImageIdsBy4DTags.js ***! \**************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ generateFrameImageId: () => (/* binding */ generateFrameImageId), /* harmony export */ handleMultiframe4D: () => (/* binding */ handleMultiframe4D) /* harmony export */ }); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../metaData */ 90161); /* harmony import */ var _toNumber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toNumber */ 90085); function generateFrameImageId(baseImageId, frameNumber) { const framePattern = /\/frames\/\d+/; if (!framePattern.test(baseImageId)) { throw new Error(`generateFrameImageId: baseImageId must contain a "/frames/" pattern followed by a digit. ` + `Expected format: e.g., "wadouri:http://example.com/image/frames/1" or "wadors:/path/to/image.dcm/frames/1". ` + `Received: ${baseImageId}`); } return baseImageId.replace(framePattern, `/frames/${frameNumber}`); } function handleMultiframe4D(imageIds) { if (!imageIds || imageIds.length === 0) { return null; } const baseImageId = imageIds[0]; const instance = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('instance', baseImageId); if (!instance) { return null; } const numberOfFrames = instance.NumberOfFrames; if (!numberOfFrames || numberOfFrames <= 1) { return null; } const timeSlotVector = instance.TimeSlotVector; if (!timeSlotVector || !Array.isArray(timeSlotVector)) { return null; } const sliceVector = instance.SliceVector; const numberOfSlices = instance.NumberOfSlices; if (timeSlotVector.length !== numberOfFrames) { console.warn('TimeSlotVector length does not match NumberOfFrames:', timeSlotVector.length, 'vs', numberOfFrames); return null; } if (sliceVector) { if (!Array.isArray(sliceVector)) { console.warn('SliceVector exists but is not an array. Expected length:', numberOfFrames); return null; } if (sliceVector.length !== numberOfFrames || sliceVector.some(val => val === undefined)) { console.warn('SliceVector exists but has invalid length or undefined entries. Expected length:', numberOfFrames, 'Actual length:', sliceVector.length); return null; } } const timeSlotGroups = new Map(); for (let frameIndex = 0; frameIndex < numberOfFrames; frameIndex++) { const timeSlot = timeSlotVector[frameIndex]; const sliceIndex = sliceVector?.[frameIndex] ?? frameIndex; if (!timeSlotGroups.has(timeSlot)) { timeSlotGroups.set(timeSlot, []); } timeSlotGroups.get(timeSlot).push({ frameIndex, sliceIndex }); } const sortedTimeSlots = Array.from(timeSlotGroups.keys()).sort((a, b) => a - b); const imageIdGroups = sortedTimeSlots.map(timeSlot => { const frames = timeSlotGroups.get(timeSlot); frames.sort((a, b) => a.sliceIndex - b.sliceIndex); return frames.map(frame => generateFrameImageId(baseImageId, frame.frameIndex + 1)); }); const expectedSlicesPerTimeSlot = numberOfSlices || imageIdGroups[0]?.length; const allGroupsHaveSameLength = imageIdGroups.every(group => group.length === expectedSlicesPerTimeSlot); if (!allGroupsHaveSameLength) { console.warn('Multiframe 4D split resulted in uneven time slot groups. Expected', expectedSlicesPerTimeSlot, 'slices per time slot.'); } return { imageIdGroups, splittingTag: 'TimeSlotVector' }; } function handleCardiac4D(imageIds) { if (!imageIds || imageIds.length === 0) { return null; } const cardiacNumberOfImages = getFiniteValue(imageIds[0], 'CardiacNumberOfImages'); if (cardiacNumberOfImages === undefined) { return null; } const stacks = new Map(); for (const imageId of imageIds) { const stackId = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('StackID', imageId); const inStackPositionNumber = getFiniteValue(imageId, 'InStackPositionNumber'); const triggerTime = getFiniteValue(imageId, 'TriggerTime'); if (stackId === undefined || inStackPositionNumber === undefined || triggerTime === undefined) { return null; } const stackKey = String(stackId); if (!stacks.has(stackKey)) { stacks.set(stackKey, new Map()); } const positions = stacks.get(stackKey); if (!positions.has(inStackPositionNumber)) { positions.set(inStackPositionNumber, []); } positions.get(inStackPositionNumber).push({ imageId, triggerTime }); } const sortedStackIds = Array.from(stacks.keys()).sort((a, b) => Number(a) - Number(b)); if (sortedStackIds.length === 0) { return null; } const preparedStacks = []; let timeCount; for (const stackId of sortedStackIds) { const positions = stacks.get(stackId); const sortedPositions = Array.from(positions.keys()).sort((a, b) => a - b); for (const position of sortedPositions) { const frames = positions.get(position); frames.sort((a, b) => a.triggerTime - b.triggerTime); if (timeCount === undefined) { timeCount = frames.length; } else if (frames.length !== timeCount) { return null; } } preparedStacks.push({ stackId, positions: sortedPositions, framesByPosition: positions }); } if (!timeCount) { return null; } const imageIdGroups = []; for (let timeIndex = 0; timeIndex < timeCount; timeIndex++) { const group = []; for (const stack of preparedStacks) { for (const position of stack.positions) { const frames = stack.framesByPosition.get(position); group.push(frames[timeIndex].imageId); } } imageIdGroups.push(group); } return { imageIdGroups, splittingTag: 'CardiacTriggerTime' }; } const groupBy = (array, key) => { return array.reduce((rv, x) => { (rv[x[key]] = rv[x[key]] || []).push(x); return rv; }, {}); }; function getIPPGroups(imageIds) { const ippMetadata = imageIds.map(imageId => { const { imagePositionPatient } = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('imagePlaneModule', imageId) || {}; return { imageId, imagePositionPatient }; }); if (!ippMetadata.every(item => item.imagePositionPatient)) { return null; } const positionGroups = groupBy(ippMetadata, 'imagePositionPatient'); const positions = Object.keys(positionGroups); const frame_count = positionGroups[positions[0]].length; if (frame_count === 1) { return null; } const frame_count_equal = positions.every(k => positionGroups[k].length === frame_count); if (!frame_count_equal) { return null; } return positionGroups; } function test4DTag(IPPGroups, value_getter) { const frame_groups = {}; let first_frame_value_set = []; const positions = Object.keys(IPPGroups); for (let i = 0; i < positions.length; i++) { const frame_value_set = new Set(); const frames = IPPGroups[positions[i]]; for (let j = 0; j < frames.length; j++) { const frame_value = value_getter(frames[j].imageId) || 0; frame_groups[frame_value] = frame_groups[frame_value] || []; frame_groups[frame_value].push({ imageId: frames[j].imageId }); frame_value_set.add(frame_value); if (frame_value_set.size - 1 < j) { return undefined; } } if (i == 0) { first_frame_value_set = Array.from(frame_value_set); } else if (!setEquals(first_frame_value_set, frame_value_set)) { return undefined; } } return frame_groups; } function getTagValue(imageId, tag) { const value = _metaData__WEBPACK_IMPORTED_MODULE_0__.get(tag, imageId); try { return parseFloat(value); } catch { return undefined; } } function getFiniteValue(imageId, tag) { return (0,_toNumber__WEBPACK_IMPORTED_MODULE_1__.toFiniteNumber)(getTagValue(imageId, tag)); } function getPhilipsPrivateBValue(imageId) { const value = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('20011003', imageId); try { const { InlineBinary } = value; if (InlineBinary) { const value_bytes = atob(InlineBinary); const ary_buf = new ArrayBuffer(value_bytes.length); const dv = new DataView(ary_buf); for (let i = 0; i < value_bytes.length; i++) { dv.setUint8(i, value_bytes.charCodeAt(i)); } return new Float32Array(ary_buf)[0]; } return parseFloat(value); } catch { return undefined; } } function getSiemensPrivateBValue(imageId) { let value = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('0019100c', imageId) || _metaData__WEBPACK_IMPORTED_MODULE_0__.get('0019100C', imageId); try { const { InlineBinary } = value; if (InlineBinary) { value = atob(InlineBinary); } return parseFloat(value); } catch { return undefined; } } function getGEPrivateBValue(imageId) { let value = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('00431039', imageId); try { const { InlineBinary } = value; if (InlineBinary) { value = atob(InlineBinary).split('//'); } return parseFloat(value[0]) % 100000; } catch { return undefined; } } function setEquals(set_a, set_b) { if (set_a.length != set_b.size) { return false; } for (let i = 0; i < set_a.length; i++) { if (!set_b.has(set_a[i])) { return false; } } return true; } function getPetFrameReferenceTime(imageId) { const moduleInfo = _metaData__WEBPACK_IMPORTED_MODULE_0__.get('petImageModule', imageId); return moduleInfo ? moduleInfo['frameReferenceTime'] : 0; } function splitImageIdsBy4DTags(imageIds) { const multiframeResult = handleMultiframe4D(imageIds); if (multiframeResult) { return multiframeResult; } const cardiacResult = handleCardiac4D(imageIds); if (cardiacResult) { return cardiacResult; } const positionGroups = getIPPGroups(imageIds); if (!positionGroups) { return { imageIdGroups: [imageIds], splittingTag: null }; } const tags = ['TemporalPositionIdentifier', 'DiffusionBValue', 'TriggerTime', 'EchoTime', 'EchoNumber', 'PhilipsPrivateBValue', 'SiemensPrivateBValue', 'GEPrivateBValue', 'PetFrameReferenceTime']; const fncList2 = [imageId => getTagValue(imageId, tags[0]), imageId => getTagValue(imageId, tags[1]), imageId => getTagValue(imageId, tags[2]), imageId => getTagValue(imageId, tags[3]), imageId => getTagValue(imageId, tags[4]), getPhilipsPrivateBValue, getSiemensPrivateBValue, getGEPrivateBValue, getPetFrameReferenceTime]; for (let i = 0; i < fncList2.length; i++) { const frame_groups = test4DTag(positionGroups, fncList2[i]); if (frame_groups) { const sortedKeys = Object.keys(frame_groups).map(Number.parseFloat).sort((a, b) => a - b); const imageIdGroups = sortedKeys.map(key => frame_groups[key].map(item => item.imageId)); return { imageIdGroups, splittingTag: tags[i] }; } } return { imageIdGroups: [imageIds], splittingTag: null }; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (splitImageIdsBy4DTags); /***/ }, /***/ 78715 /*!*******************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/textureSupport.js ***! \*******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getSupportedTextureFormats: () => (/* binding */ getSupportedTextureFormats) /* harmony export */ }); const canvasSize = 4; const texWidth = 5; const texHeight = 1; const pixelToCheck = [1, 1]; function main({ ext, filterType, texData, internalFormat, glDataType }) { try { const canvas = document.createElement('canvas'); canvas.width = canvasSize; canvas.height = canvasSize; const gl = canvas.getContext('webgl2'); if (!gl) { return false; } const vs = `#version 300 es void main() { gl_PointSize = ${canvasSize.toFixed(1)}; gl_Position = vec4(0, 0, 0, 1); } `; const fs = `#version 300 es precision highp float; precision highp int; precision highp sampler2D; uniform sampler2D u_image; out vec4 color; void main() { vec4 intColor = texture(u_image, gl_PointCoord.xy); color = vec4(vec3(intColor.rrr), 1); } `; let extToUse; if (ext) { extToUse = gl.getExtension(ext); if (!extToUse) { return false; } } const vertexShader = gl.createShader(gl.VERTEX_SHADER); gl.shaderSource(vertexShader, vs); gl.compileShader(vertexShader); if (!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) { return false; } const fragmentShader = gl.createShader(gl.FRAGMENT_SHADER); gl.shaderSource(fragmentShader, fs); gl.compileShader(fragmentShader); if (!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) { return false; } const program = gl.createProgram(); gl.attachShader(program, vertexShader); gl.attachShader(program, fragmentShader); gl.linkProgram(program); if (!gl.getProgramParameter(program, gl.LINK_STATUS)) { return false; } const tex = gl.createTexture(); gl.bindTexture(gl.TEXTURE_2D, tex); gl.texImage2D(gl.TEXTURE_2D, 0, internalFormat(gl, extToUse), texWidth, texHeight, 0, gl.RED, glDataType(gl, extToUse), texData); const filter = filterType === 'LINEAR' ? gl.LINEAR : gl.NEAREST; gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, filter); gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, filter); gl.useProgram(program); gl.drawArrays(gl.POINTS, 0, 1); const pixel = new Uint8Array(4); gl.readPixels(pixelToCheck[0], pixelToCheck[1], 1, 1, gl.RGBA, gl.UNSIGNED_BYTE, pixel); const [r, g, b] = pixel; const webglLoseContext = gl.getExtension('WEBGL_lose_context'); if (webglLoseContext) { webglLoseContext.loseContext(); } return r === g && g === b && r !== 0; } catch (e) { return false; } } function getSupportedTextureFormats() { const norm16TexData = new Int16Array([32767, 2000, 3000, 4000, 5000, 16784, 7000, 8000, 9000, 32767]); return { norm16: main({ ext: 'EXT_texture_norm16', filterType: 'NEAREST', texData: norm16TexData, internalFormat: (gl, ext) => ext.R16_SNORM_EXT, glDataType: gl => gl.SHORT }), norm16Linear: main({ ext: 'EXT_texture_norm16', filterType: 'LINEAR', texData: norm16TexData, internalFormat: (gl, ext) => ext.R16_SNORM_EXT, glDataType: gl => gl.SHORT }) }; } /***/ }, /***/ 90085 /*!*************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/toNumber.js ***! \*************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ toFiniteNumber: () => (/* binding */ toFiniteNumber) /* harmony export */ }); function toFiniteNumber(value) { return Number.isFinite(value) ? value : undefined; } /***/ }, /***/ 19813 /*!**************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/transferFunctionUtils.js ***! \**************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getTransferFunctionNodes: () => (/* binding */ getTransferFunctionNodes), /* harmony export */ setTransferFunctionNodes: () => (/* binding */ setTransferFunctionNodes) /* harmony export */ }); function getTransferFunctionNodes(transferFunction) { const size = transferFunction.getSize(); const values = []; for (let index = 0; index < size; index++) { const nodeValue1 = []; transferFunction.getNodeValue(index, nodeValue1); values.push(nodeValue1); } return values; } function setTransferFunctionNodes(transferFunction, nodes) { if (!nodes?.length) { return; } transferFunction.removeAllPoints(); nodes.forEach(node => { transferFunction.addRGBPoint(...node); }); } /***/ }, /***/ 81594 /*!*************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/transformCanvasToIJK.js ***! \*************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ transformCanvasToIJK: () => (/* binding */ transformCanvasToIJK) /* harmony export */ }); /* harmony import */ var _transformWorldToIndex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transformWorldToIndex */ 19598); function transformCanvasToIJK(viewport, canvasPoint) { const { imageData: vtkImageData } = viewport.getImageData(); const worldPoint = viewport.canvasToWorld(canvasPoint); return (0,_transformWorldToIndex__WEBPACK_IMPORTED_MODULE_0__["default"])(vtkImageData, worldPoint); } /***/ }, /***/ 2952 /*!*************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/transformIJKToCanvas.js ***! \*************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ transformIJKToCanvas: () => (/* binding */ transformIJKToCanvas) /* harmony export */ }); /* harmony import */ var _transformIndexToWorld__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transformIndexToWorld */ 60214); function transformIJKToCanvas(viewport, ijkPoint) { const { imageData: vtkImageData } = viewport.getImageData(); const worldPoint = (0,_transformIndexToWorld__WEBPACK_IMPORTED_MODULE_0__["default"])(vtkImageData, ijkPoint); return viewport.worldToCanvas(worldPoint); } /***/ }, /***/ 60214 /*!**************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/transformIndexToWorld.js ***! \**************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ transformIndexToWorld) /* harmony export */ }); function transformIndexToWorld(imageData, voxelPos) { return imageData.indexToWorld(voxelPos); } /***/ }, /***/ 19598 /*!**************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/transformWorldToIndex.js ***! \**************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ transformWorldToIndex), /* harmony export */ transformWorldToIndexContinuous: () => (/* binding */ transformWorldToIndexContinuous) /* harmony export */ }); function transformWorldToIndex(imageData, worldPos) { const continuousIndex = imageData.worldToIndex(worldPos); const index = continuousIndex.map(Math.round); return index; } function transformWorldToIndexContinuous(imageData, worldPos) { return imageData.worldToIndex(worldPos); } /***/ }, /***/ 91133 /*!*****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/triggerEvent.js ***! \*****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ triggerEvent) /* harmony export */ }); /* harmony import */ var _eventTarget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../eventTarget */ 28699); function triggerEvent(el = _eventTarget__WEBPACK_IMPORTED_MODULE_0__["default"], type, detail = null) { if (!type) { throw new Error('Event type was not defined'); } const event = new CustomEvent(type, { detail, cancelable: true }); return el?.dispatchEvent(event); } /***/ }, /***/ 78648 /*!***************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/updatePlaneRestriction.js ***! \***************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ updatePlaneRestriction: () => (/* binding */ updatePlaneRestriction) /* harmony export */ }); /* harmony import */ var _utilities_isEqual__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utilities/isEqual */ 17137); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! gl-matrix */ 87396); const ORTHOGONAL_TEST_VALUE = 0.95; function updatePlaneRestriction(points, reference) { if (!points?.length || !reference.FrameOfReferenceUID) { return; } reference.planeRestriction ||= { FrameOfReferenceUID: reference.FrameOfReferenceUID, point: points[0], inPlaneVector1: null, inPlaneVector2: null }; const { planeRestriction } = reference; if (points.length === 1) { planeRestriction.inPlaneVector1 = null; planeRestriction.inPlaneVector2 = null; return planeRestriction; } const v1 = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.sub(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(), points[0], points[Math.floor(points.length / 2)]); gl_matrix__WEBPACK_IMPORTED_MODULE_1__.normalize(v1, v1); planeRestriction.inPlaneVector1 = v1; planeRestriction.inPlaneVector2 = null; const n = points.length; if (n > 2) { for (let i = Math.floor(n / 3); i < n; i++) { const testVector = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.sub(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(), points[i], points[0]); const length = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.length(testVector); if ((0,_utilities_isEqual__WEBPACK_IMPORTED_MODULE_0__.isEqual)(length, 0)) { continue; } if (gl_matrix__WEBPACK_IMPORTED_MODULE_1__.dot(testVector, planeRestriction.inPlaneVector1) < length * ORTHOGONAL_TEST_VALUE) { gl_matrix__WEBPACK_IMPORTED_MODULE_1__.normalize(testVector, testVector); planeRestriction.inPlaneVector2 = testVector; return planeRestriction; } } } return planeRestriction; } /***/ }, /***/ 99543 /*!*******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/updateVTKImageDataWithCornerstoneImage.js ***! \*******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ updateVTKImageDataWithCornerstoneImage: () => (/* binding */ updateVTKImageDataWithCornerstoneImage) /* harmony export */ }); function updateVTKImageDataWithCornerstoneImage(sourceImageData, image) { const pixelData = image.voxelManager.getScalarData(); if (!sourceImageData.getPointData) { return; } const scalarData = sourceImageData.getPointData().getScalars().getData(); if (image.color && image.rgba) { const newPixelData = new Uint8Array(image.columns * image.rows * 3); for (let i = 0; i < image.columns * image.rows; i++) { newPixelData[i * 3] = pixelData[i * 4]; newPixelData[i * 3 + 1] = pixelData[i * 4 + 1]; newPixelData[i * 3 + 2] = pixelData[i * 4 + 2]; } image.rgba = false; image.getPixelData = () => newPixelData; scalarData.set(newPixelData); } else { scalarData.set(pixelData); } sourceImageData.modified(); } /***/ }, /***/ 29760 /*!***********************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/uuidv4.js ***! \***********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ uuidv4) /* harmony export */ }); function uuidv4() { if (typeof crypto.randomUUID === 'function') { return crypto.randomUUID(); } return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c => (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)); } /***/ }, /***/ 88871 /*!****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/windowLevel.js ***! \****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ toLowHighRange: () => (/* binding */ toLowHighRange), /* harmony export */ toWindowLevel: () => (/* binding */ toWindowLevel) /* harmony export */ }); /* harmony import */ var _enums_VOILUTFunctionType__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums/VOILUTFunctionType */ 78700); function toWindowLevel(low, high) { const windowWidth = Math.abs(high - low) + 1; const windowCenter = (low + high + 1) / 2; return { windowWidth, windowCenter }; } function toLowHighRange(windowWidth, windowCenter, voiLUTFunction = _enums_VOILUTFunctionType__WEBPACK_IMPORTED_MODULE_0__["default"].LINEAR) { if (voiLUTFunction === _enums_VOILUTFunctionType__WEBPACK_IMPORTED_MODULE_0__["default"].LINEAR || voiLUTFunction === _enums_VOILUTFunctionType__WEBPACK_IMPORTED_MODULE_0__["default"].SAMPLED_SIGMOID) { return { lower: windowCenter - 0.5 - (windowWidth - 1) / 2, upper: windowCenter - 0.5 + (windowWidth - 1) / 2 }; } else if (voiLUTFunction === _enums_VOILUTFunctionType__WEBPACK_IMPORTED_MODULE_0__["default"].LINEAR_EXACT) { return { lower: windowCenter - windowWidth / 2, upper: windowCenter + windowWidth / 2 }; } else { throw new Error('Invalid VOI LUT function'); } } /***/ }, /***/ 56349 /*!***********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/utilities/worldToImageCoords.js ***! \***********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _metaData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../metaData */ 90161); function worldToImageCoords(imageId, worldCoords) { const imagePlaneModule = (0,_metaData__WEBPACK_IMPORTED_MODULE_1__.get)('imagePlaneModule', imageId); if (!imagePlaneModule) { throw new Error(`No imagePlaneModule found for imageId: ${imageId}`); } const { columnCosines, rowCosines, imagePositionPatient: origin } = imagePlaneModule; let { columnPixelSpacing, rowPixelSpacing } = imagePlaneModule; columnPixelSpacing ||= 1; rowPixelSpacing ||= 1; const newOrigin = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.scaleAndAdd(newOrigin, origin, columnCosines, -columnPixelSpacing / 2); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.scaleAndAdd(newOrigin, newOrigin, rowCosines, -rowPixelSpacing / 2); const sub = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.sub(sub, worldCoords, newOrigin); const rowDistance = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(sub, rowCosines); const columnDistance = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(sub, columnCosines); const imageCoords = [rowDistance / rowPixelSpacing, columnDistance / columnPixelSpacing]; return imageCoords; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (worldToImageCoords); /***/ }, /***/ 6805 /*!****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/core/dist/esm/webWorkerManager/webWorkerManager.js ***! \****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var comlink__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! comlink */ 67159); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../enums */ 9742); /* harmony import */ var _requestPool_requestPoolManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../requestPool/requestPoolManager */ 36158); class CentralizedWorkerManager { constructor() { this.workerRegistry = {}; this.workerPoolManager = new _requestPool_requestPoolManager__WEBPACK_IMPORTED_MODULE_3__.RequestPoolManager('webworker'); } registerWorker(workerName, workerFn, options = {}) { const { maxWorkerInstances = 1, overwrite = false, autoTerminateOnIdle = { enabled: false, idleTimeThreshold: 3000 } } = options; if (this.workerRegistry[workerName] && !overwrite) { console.warn(`Worker type '${workerName}' is already registered...`); return; } if (overwrite && this.workerRegistry[workerName]?.idleCheckIntervalId) { clearInterval(this.workerRegistry[workerName].idleCheckIntervalId); } const workerProperties = { workerFn: null, instances: [], loadCounters: [], lastActiveTime: [], nativeWorkers: [], autoTerminateOnIdle: autoTerminateOnIdle.enabled, idleCheckIntervalId: null, idleTimeThreshold: autoTerminateOnIdle.idleTimeThreshold }; workerProperties.loadCounters = Array(maxWorkerInstances).fill(0); workerProperties.lastActiveTime = Array(maxWorkerInstances).fill(null); for (let i = 0; i < maxWorkerInstances; i++) { const worker = workerFn(); workerProperties.instances.push(comlink__WEBPACK_IMPORTED_MODULE_1__.wrap(worker)); workerProperties.nativeWorkers.push(worker); workerProperties.workerFn = workerFn; } this.workerRegistry[workerName] = workerProperties; } getNextWorkerAPI(workerName) { const workerProperties = this.workerRegistry[workerName]; if (!workerProperties) { console.error(`Worker type '${workerName}' is not registered.`); return null; } const workerInstances = workerProperties.instances.filter(instance => instance !== null); let minLoadIndex = 0; let minLoadValue = workerProperties.loadCounters[0] || 0; for (let i = 1; i < workerInstances.length; i++) { const currentLoadValue = workerProperties.loadCounters[i] || 0; if (currentLoadValue < minLoadValue) { minLoadIndex = i; minLoadValue = currentLoadValue; } } if (workerProperties.instances[minLoadIndex] === null) { const worker = workerProperties.workerFn(); workerProperties.instances[minLoadIndex] = comlink__WEBPACK_IMPORTED_MODULE_1__.wrap(worker); workerProperties.nativeWorkers[minLoadIndex] = worker; } workerProperties.loadCounters[minLoadIndex] += 1; return { api: workerProperties.instances[minLoadIndex], index: minLoadIndex }; } executeTask(workerName, methodName, args = {}, { requestType = _enums__WEBPACK_IMPORTED_MODULE_2__["default"].Compute, priority = 0, options = {}, callbacks = [] } = {}) { var _this = this; return new Promise((resolve, reject) => { const requestFn = /*#__PURE__*/function () { var _ref = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { const { api, index } = _this.getNextWorkerAPI(workerName); if (!api) { const error = new Error(`No available worker instance for '${workerName}'`); console.error(error); reject(error); return; } try { let finalCallbacks = []; if (callbacks.length) { finalCallbacks = callbacks.map(cb => { return comlink__WEBPACK_IMPORTED_MODULE_1__.proxy(cb); }); } const workerProperties = _this.workerRegistry[workerName]; workerProperties.processing = true; const results = yield api[methodName](args, ...finalCallbacks); workerProperties.processing = false; workerProperties.lastActiveTime[index] = Date.now(); if (workerProperties.autoTerminateOnIdle && !workerProperties.idleCheckIntervalId && workerProperties.idleTimeThreshold) { workerProperties.idleCheckIntervalId = setInterval(() => { _this.terminateIdleWorkers(workerName, workerProperties.idleTimeThreshold); }, workerProperties.idleTimeThreshold); } resolve(results); } catch (err) { console.error(`Error executing method '${methodName}' on worker '${workerName}':`, err); reject(err); } finally { _this.workerRegistry[workerName].loadCounters[index]--; } }); return function requestFn() { return _ref.apply(this, arguments); }; }(); this.workerPoolManager.addRequest(requestFn, requestType, options, priority); }); } terminateIdleWorkers(workerName, idleTimeThreshold) { const workerProperties = this.workerRegistry[workerName]; if (workerProperties.processing) { return; } const now = Date.now(); workerProperties.instances.forEach((_, index) => { const lastActiveTime = workerProperties.lastActiveTime[index]; const isWorkerActive = lastActiveTime !== null && workerProperties.loadCounters[index] > 0; const idleTime = now - lastActiveTime; if (!isWorkerActive && idleTime > idleTimeThreshold) { this.terminateWorkerInstance(workerName, index); } }); } terminate(workerName) { const workerProperties = this.workerRegistry[workerName]; if (!workerProperties) { console.error(`Worker type '${workerName}' is not registered.`); return; } workerProperties.instances.forEach((_, index) => { this.terminateWorkerInstance(workerName, index); }); } terminateWorkerInstance(workerName, index) { const workerProperties = this.workerRegistry[workerName]; const workerInstance = workerProperties.instances[index]; if (workerInstance !== null) { workerInstance[comlink__WEBPACK_IMPORTED_MODULE_1__.releaseProxy](); workerProperties.nativeWorkers[index].terminate(); workerProperties.instances[index] = null; workerProperties.lastActiveTime[index] = null; } } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CentralizedWorkerManager); /***/ }, /***/ 3690 /*!**************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/config.js ***! \**************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getAddOns: () => (/* binding */ getAddOns), /* harmony export */ getConfig: () => (/* binding */ getConfig), /* harmony export */ getPolySeg: () => (/* binding */ getPolySeg), /* harmony export */ setConfig: () => (/* binding */ setConfig) /* harmony export */ }); let config = {}; function getConfig() { return config; } function setConfig(newConfig) { config = newConfig; } function getAddOns() { return config.addons; } let polysegInitialized = false; function getPolySeg() { if (!config.addons?.polySeg) { console.warn('PolySeg add-on not configured. This will prevent automatic conversion between segmentation representations (labelmap, contour, surface). To enable these features, install @cornerstonejs/polymorphic-segmentation and register it during initialization: cornerstoneTools.init({ addons: { polySeg } }).'); return null; } const polyseg = config.addons.polySeg; if (!polysegInitialized) { polyseg.init(); polysegInitialized = true; } return polyseg; } /***/ }, /***/ 74953 /*!***************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/constants/COLOR_LUT.js ***! \***************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); const CORNERSTONE_COLOR_LUT = [[0, 0, 0, 0], [221, 84, 84, 255], [77, 228, 121, 255], [166, 70, 235, 255], [189, 180, 116, 255], [109, 182, 196, 255], [204, 101, 157, 255], [123, 211, 94, 255], [93, 87, 218, 255], [225, 128, 80, 255], [73, 232, 172, 255], [181, 119, 186, 255], [176, 193, 112, 255], [105, 153, 200, 255], [208, 97, 120, 255], [90, 215, 101, 255], [135, 83, 222, 255], [229, 178, 76, 255], [122, 183, 181, 255], [190, 115, 171, 255], [149, 197, 108, 255], [100, 118, 205, 255], [212, 108, 93, 255], [86, 219, 141, 255], [183, 79, 226, 255], [233, 233, 72, 255], [118, 167, 187, 255], [194, 111, 146, 255], [116, 201, 104, 255], [115, 96, 209, 255], [216, 147, 89, 255], [82, 223, 188, 255], [230, 75, 224, 255], [163, 184, 121, 255], [114, 143, 191, 255], [198, 107, 114, 255], [99, 206, 122, 255], [153, 92, 213, 255], [220, 192, 85, 255], [78, 215, 227, 255], [234, 71, 173, 255], [141, 188, 117, 255], [110, 113, 195, 255], [202, 128, 103, 255], [95, 210, 157, 255], [195, 88, 217, 255], [206, 224, 81, 255], [74, 166, 231, 255], [185, 120, 139, 255], [113, 192, 113, 255], [133, 106, 199, 255], [207, 162, 98, 255], [91, 214, 198, 255], [221, 84, 198, 255], [159, 228, 77, 255], [70, 111, 235, 255], [189, 119, 116, 255], [109, 196, 138, 255], [165, 101, 204, 255], [211, 201, 94, 255], [87, 191, 218, 255], [225, 80, 153, 255], [106, 232, 73, 255], [124, 119, 186, 255], [193, 142, 112, 255], [105, 200, 168, 255], [203, 97, 208, 255], [184, 215, 90, 255], [83, 147, 222, 255], [229, 76, 101, 255], [122, 183, 130, 255], [146, 115, 190, 255], [197, 171, 108, 255], [100, 205, 205, 255], [212, 93, 177, 255], [141, 219, 86, 255], [79, 97, 226, 255], [233, 99, 72, 255], [118, 187, 150, 255], [173, 111, 194, 255], [197, 201, 104, 255], [96, 171, 209, 255], [216, 89, 137, 255], [94, 223, 82, 255], [107, 75, 230, 255], [184, 153, 121, 255], [114, 191, 175, 255], [198, 107, 191, 255], [166, 206, 99, 255], [92, 132, 213, 255], [220, 85, 91, 255], [78, 227, 115, 255], [159, 71, 234, 255], [188, 176, 117, 255], [110, 185, 195, 255], [202, 103, 161, 255], [129, 210, 95, 255], [88, 88, 217, 255], [224, 123, 81, 255], [74, 231, 166, 255], [177, 120, 185, 255], [179, 192, 113, 255], [106, 156, 199, 255], [207, 98, 125, 255], [91, 214, 96, 255], [130, 84, 221, 255], [228, 171, 77, 255], [70, 235, 221, 255], [189, 116, 174, 255], [153, 196, 109, 255], [101, 123, 204, 255], [211, 104, 94, 255], [87, 218, 136, 255], [177, 80, 225, 255], [232, 225, 73, 255], [119, 169, 186, 255], [193, 112, 149, 255], [121, 200, 105, 255], [111, 97, 208, 255], [215, 142, 90, 255], [83, 222, 181, 255], [229, 76, 229, 255], [165, 183, 122, 255], [115, 146, 190, 255], [197, 108, 119, 255], [100, 205, 118, 255], [148, 93, 212, 255], [219, 186, 86, 255], [79, 220, 226, 255], [233, 72, 179, 255], [144, 187, 118, 255], [111, 118, 194, 255], [201, 124, 104, 255], [96, 209, 153, 255], [189, 89, 216, 255], [211, 223, 82, 255], [75, 172, 230, 255], [184, 121, 142, 255], [117, 191, 114, 255], [130, 107, 198, 255], [206, 157, 99, 255], [92, 213, 193, 255], [220, 85, 203, 255], [165, 227, 78, 255], [71, 118, 234, 255], [188, 117, 117, 255], [110, 195, 135, 255], [161, 103, 202, 255], [210, 195, 95, 255], [88, 195, 217, 255], [224, 81, 158, 255], [113, 231, 74, 255], [123, 120, 185, 255], [192, 139, 113, 255], [106, 199, 164, 255], [198, 98, 207, 255], [188, 214, 91, 255], [84, 153, 221, 255], [228, 77, 108, 255], [70, 235, 84, 255], [143, 116, 189, 255], [196, 167, 109, 255], [101, 204, 199, 255], [211, 94, 182, 255], [147, 218, 87, 255], [80, 104, 225, 255], [232, 93, 73, 255], [119, 186, 147, 255], [170, 112, 193, 255], [200, 200, 105, 255], [97, 175, 208, 255], [215, 90, 142, 255], [100, 222, 83, 255], [101, 76, 229, 255], [183, 150, 122, 255], [115, 190, 171, 255], [197, 108, 194, 255], [170, 205, 100, 255], [93, 138, 212, 255], [219, 86, 97, 255], [79, 226, 110, 255], [153, 72, 233, 255], [187, 173, 118, 255], [111, 187, 194, 255], [201, 104, 165, 255], [134, 209, 96, 255], [89, 95, 216, 255], [223, 117, 82, 255], [75, 230, 159, 255], [174, 121, 184, 255], [182, 191, 114, 255], [107, 160, 198, 255], [206, 99, 130, 255], [92, 213, 92, 255], [124, 85, 220, 255], [227, 165, 78, 255], [71, 234, 214, 255], [188, 117, 176, 255], [156, 195, 110, 255], [103, 128, 202, 255], [210, 100, 95, 255], [88, 217, 131, 255], [170, 81, 224, 255], [231, 218, 74, 255], [120, 172, 185, 255], [192, 113, 153, 255], [125, 199, 106, 255], [107, 98, 207, 255], [214, 137, 91, 255], [84, 221, 175, 255], [222, 77, 228, 255], [194, 235, 70, 255], [116, 149, 189, 255], [196, 109, 123, 255], [101, 204, 114, 255], [143, 94, 211, 255], [218, 180, 87, 255], [80, 225, 225, 255], [232, 73, 186, 255], [147, 186, 119, 255], [112, 122, 193, 255], [200, 121, 105, 255], [97, 208, 148, 255], [184, 90, 215, 255], [216, 222, 83, 255], [76, 178, 229, 255], [183, 122, 145, 255], [121, 190, 115, 255], [126, 108, 197, 255], [205, 153, 100, 255], [93, 212, 187, 255], [219, 86, 208, 255], [171, 226, 79, 255], [72, 126, 233, 255], [187, 118, 121, 255], [111, 194, 132, 255], [157, 104, 201, 255], [209, 190, 96, 255], [89, 200, 216, 255], [223, 82, 164, 255], [120, 230, 75, 255], [121, 121, 184, 255], [191, 136, 114, 255], [107, 198, 160, 255], [192, 99, 206, 255], [193, 213, 92, 255], [85, 158, 220, 255], [227, 78, 115, 255], [71, 234, 78, 255], [141, 117, 188, 255], [195, 163, 110, 255], [103, 202, 194, 255], [210, 95, 186, 255], [153, 217, 88, 255], [81, 111, 224, 255]]; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CORNERSTONE_COLOR_LUT); /***/ }, /***/ 59698 /*!********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/cursors/ImageMouseCursor.js ***! \********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ImageMouseCursor) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 39796); /* harmony import */ var _MouseCursor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./MouseCursor */ 38771); const DEFAULT_NAME = 'image-cursor'; class ImageMouseCursor extends _MouseCursor__WEBPACK_IMPORTED_MODULE_1__["default"] { constructor(url, x, y, name, fallback) { super(name || ImageMouseCursor.getUniqueInstanceName(DEFAULT_NAME), fallback); this.url = url; this.x = Number(x) || 0; this.y = Number(y) || 0; } getStyleProperty() { const { url, x, y } = this; let style = `url('${url}')`; if (x >= 0 && y >= 0 && (x > 0 || y > 0)) { style += ` ${x} ${y}`; } return this.addFallbackStyleProperty(style); } static getUniqueInstanceName(prefix) { return `${prefix}-${_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"](ImageMouseCursor)}`; } } /***/ }, /***/ 38771 /*!***************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/cursors/MouseCursor.js ***! \***************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ MouseCursor), /* harmony export */ standardCursorNames: () => (/* binding */ standardCursorNames) /* harmony export */ }); const DEFINED_CURSORS = Symbol('DefinedCursors'); const STANDARD_CURSORS = new Set(['alias', 'all-scroll', 'auto', 'cell', 'col-resize', 'context-menu', 'copy', 'crosshair', 'default', 'e-resize', 'ew-resize', 'grab', 'grabbing', 'help', 'move', 'ne-resize', 'nesw-resize', 'no-drop', 'none', 'not-allowed', 'n-resize', 'ns-resize', 'nw-resize', 'nwse-resize', 'pointer', 'progress', 'row-resize', 'se-resize', 's-resize', 'sw-resize', 'text', 'vertical-text', 'wait', 'w-resize', 'zoom-in', 'zoom-out']); class MouseCursor { constructor(name, fallback) { this.name = name + ''; this.fallback = fallback; } getName() { return this.name + ''; } addFallbackStyleProperty(style) { const { fallback } = this; if (fallback instanceof MouseCursor) { return `${style}, ${fallback.getStyleProperty()}`; } return style + ''; } getStyleProperty() { return this.addFallbackStyleProperty(this.name) + ''; } static getDefinedCursor(name) { const definedCursors = getDefinedCursors(MouseCursor, DEFINED_CURSORS); let mouseCursor = definedCursors.get(name); if (mouseCursor instanceof MouseCursor) { return mouseCursor; } if (STANDARD_CURSORS.has(name)) { mouseCursor = new MouseCursor(name); definedCursors.set(name, mouseCursor); return mouseCursor; } } static setDefinedCursor(name, cursor) { if (cursor instanceof MouseCursor) { const definedCursors = getDefinedCursors(MouseCursor, DEFINED_CURSORS); definedCursors.set(name, cursor); return true; } return false; } } function getDefinedCursors(context, symbol) { let definedCursors = context[symbol]; if (!(definedCursors instanceof Map)) { definedCursors = new Map(); Object.defineProperty(context, symbol, { value: definedCursors }); } return definedCursors; } const standardCursorNames = STANDARD_CURSORS.values(); /***/ }, /***/ 70255 /*!***********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/cursors/SVGCursorDescriptor.js ***! \***********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CursorSVG: () => (/* binding */ CursorSVG), /* harmony export */ getDefinedSVGCursorDescriptor: () => (/* binding */ getDefinedSVGCursorDescriptor), /* harmony export */ registerCursor: () => (/* binding */ registerCursor), /* harmony export */ svgCursorNames: () => (/* binding */ svgCursorNames) /* harmony export */ }); const BASE = { iconContent: '', iconSize: 16, viewBox: { x: 16, y: 16 }, mousePoint: { x: 8, y: 8 }, mousePointerGroupString: ` ` }; const SEGMENTATION_CURSOR_BOUNDARIES = { x: 127, y: 60 }; const MINUS_RECT = ` `; const PLUS_RECT = ` `; const SCISSOR_ICON = ``; const RECTANGLE_ICON = ``; const CIRCLE_ICON = ``; const CursorSVG = { Angle: extend(BASE, { name: 'Angle', iconContent: ``, viewBox: { x: 1792, y: 1792 } }), ArrowAnnotate: extend(BASE, { name: 'ArrowAnnotate', iconContent: ` `, viewBox: { x: 24, y: 24 } }), Bidirectional: extend(BASE, { name: 'Bidirectional', iconContent: ` `, viewBox: { x: 48, y: 48 } }), CobbAngle: extend(BASE, { name: 'CobbAngle', iconContent: ` `, viewBox: { x: 32, y: 32 } }), CircleROI: extend(BASE, { name: 'CircleROI', iconContent: ``, viewBox: { x: 32, y: 32 } }), EllipticalROI: extend(BASE, { name: 'EllipticalROI', iconContent: ``, viewBox: { x: 32, y: 32 } }), FreehandROI: extend(BASE, { name: 'FreehandROI', iconContent: ` `, viewBox: { x: 18, y: 18 } }), FreehandROISculptor: extend(BASE, { name: 'FreehandROISculptor', iconContent: ` `, viewBox: { x: 18, y: 18 } }), Length: extend(BASE, { name: 'Length', iconContent: ` `, viewBox: { x: 24, y: 24 } }), Height: extend(BASE, { name: 'Height', iconContent: ``, viewBox: { x: 24, y: 24 } }), Probe: extend(BASE, { name: 'Probe', iconContent: ``, viewBox: { x: 1792, y: 1792 } }), RectangleROI: extend(BASE, { name: 'RectangleROI', iconContent: ``, viewBox: { x: 1792, y: 1792 } }), Label: extend(BASE, { name: 'Label', iconContent: ``, viewBox: { x: 1792, y: 1792 } }), Crosshairs: extend(BASE, { name: 'Crosshairs', iconContent: ``, viewBox: { x: 1792, y: 1792 } }), Eraser: extend(BASE, { name: 'Eraser', iconContent: ``, viewBox: { x: 2048, y: 1792 } }), Magnify: extend(BASE, { name: 'Magnify', iconContent: ``, viewBox: { x: 512, y: 512 } }), Pan: extend(BASE, { name: 'Pan', iconContent: ``, viewBox: { x: 1792, y: 1792 } }), Rotate: extend(BASE, { name: 'Rotate', iconContent: ``, viewBox: { x: 1792, y: 1792 } }), StackScroll: extend(BASE, { name: 'StackScroll', iconContent: ``, viewBox: { x: 24, y: 28 } }), WindowLevelRegion: extend(BASE, { name: 'WindowLevelRegion', iconContent: ``, viewBox: { x: 1792, y: 1792 } }), WindowLevel: extend(BASE, { name: 'WindowLevel', iconContent: ` `, viewBox: { x: 18, y: 18 } }), Zoom: extend(BASE, { name: 'Zoom', iconContent: ` `, viewBox: { x: 640, y: 512 } }), SegmentationFreeHandEraseInside: extend(BASE, { name: 'SegmentationFreeHandEraseInside', iconContent: `${SCISSOR_ICON} ${MINUS_RECT}`, viewBox: SEGMENTATION_CURSOR_BOUNDARIES }), SegmentationFreeHandFillInside: extend(BASE, { name: 'SegmentationFreeHandFillInside', iconContent: `${SCISSOR_ICON} ${PLUS_RECT}`, viewBox: SEGMENTATION_CURSOR_BOUNDARIES }), SegmentationFreeHandEraseOutside: extend(BASE, { name: 'SegmentationFreeHandEraseOutside', iconContent: `${SCISSOR_ICON} ${MINUS_RECT}`, viewBox: SEGMENTATION_CURSOR_BOUNDARIES }), SegmentationFreeHandFillOutside: extend(BASE, { name: 'SegmentationFreeHandFillOutside', iconContent: `${SCISSOR_ICON} ${PLUS_RECT}`, viewBox: SEGMENTATION_CURSOR_BOUNDARIES }), SegmentationRectangleEraseInside: extend(BASE, { name: 'SegmentationRectangleEraseInside', iconContent: `${RECTANGLE_ICON} ${MINUS_RECT}`, viewBox: SEGMENTATION_CURSOR_BOUNDARIES }), RectangleScissor: extend(BASE, { name: 'RectangleScissor', iconContent: `${RECTANGLE_ICON} ${PLUS_RECT}`, viewBox: SEGMENTATION_CURSOR_BOUNDARIES }), 'RectangleScissor.FILL_INSIDE': extend(BASE, { name: 'RectangleScissor.FILL_INSIDE', iconContent: `${RECTANGLE_ICON} ${PLUS_RECT}`, viewBox: SEGMENTATION_CURSOR_BOUNDARIES }), 'RectangleScissor.FILL_OUTSIDE': extend(BASE, { name: 'RectangleScissor.FILL_OUTSIDE', iconContent: `${RECTANGLE_ICON} ${PLUS_RECT}`, viewBox: SEGMENTATION_CURSOR_BOUNDARIES }), 'RectangleScissor.ERASE_OUTSIDE': extend(BASE, { name: 'RectangleScissor.ERASE_OUTSIDE', iconContent: `${RECTANGLE_ICON} ${MINUS_RECT}`, viewBox: SEGMENTATION_CURSOR_BOUNDARIES }), 'RectangleScissor.ERASE_INSIDE': extend(BASE, { name: 'RectangleScissor.ERASE_INSIDE', iconContent: `${RECTANGLE_ICON} ${MINUS_RECT}`, viewBox: SEGMENTATION_CURSOR_BOUNDARIES }), CircleScissor: extend(BASE, { name: 'CircleScissor', iconContent: `${CIRCLE_ICON} ${PLUS_RECT}`, viewBox: SEGMENTATION_CURSOR_BOUNDARIES }), 'CircleScissor.FILL_INSIDE': extend(BASE, { name: 'CircleScissor.FILL_INSIDE', iconContent: `${CIRCLE_ICON} ${PLUS_RECT}`, viewBox: SEGMENTATION_CURSOR_BOUNDARIES }), 'CircleScissor.ERASE_OUTSIDE': extend(BASE, { name: 'CircleScissor.ERASE_OUTSIDE', iconContent: `${CIRCLE_ICON} ${MINUS_RECT}`, viewBox: SEGMENTATION_CURSOR_BOUNDARIES }), 'CircleScissor.FILL_OUTSIDE': extend(BASE, { name: 'CircleScissor.FILL_OUTSIDE', iconContent: `${CIRCLE_ICON} ${PLUS_RECT}`, viewBox: SEGMENTATION_CURSOR_BOUNDARIES }) }; function extend(base, values) { return Object.assign(Object.create(base), { ...values, name: values.name || base.name }); } function registerCursor(toolName, iconContent, viewBox) { CursorSVG[toolName] = extend(BASE, { iconContent, viewBox }); } function getDefinedSVGCursorDescriptor(name) { return CursorSVG[name]; } const svgCursorNames = Object.keys(CursorSVG); /***/ }, /***/ 48231 /*!******************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/cursors/SVGMouseCursor.js ***! \******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SVGMouseCursor) /* harmony export */ }); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums */ 92925); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums */ 16739); /* harmony import */ var _ImageMouseCursor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ImageMouseCursor */ 59698); /* harmony import */ var _SVGCursorDescriptor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SVGCursorDescriptor */ 70255); /* harmony import */ var _stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../stateManagement/annotation/config/helpers */ 48421); const PROPERTY = 'color'; const STATE = _enums__WEBPACK_IMPORTED_MODULE_1__["default"].Highlighted; const MODE = _enums__WEBPACK_IMPORTED_MODULE_0__["default"].Active; class SVGMouseCursor extends _ImageMouseCursor__WEBPACK_IMPORTED_MODULE_2__["default"] { constructor(url, x, y, name, fallback) { super(url, x, y, name, fallback); } static getDefinedCursor(name, pointer = false, color) { if (!color) { color = (0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_4__.getStyleProperty)(PROPERTY, {}, STATE, MODE); } const urn = getCursorURN(name, pointer, color); let cursor = super.getDefinedCursor(urn); const pointerStrokeWidth = Number((0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_4__.getStyleProperty)('pointerStrokeWidth', {})); if (!cursor) { const descriptor = (0,_SVGCursorDescriptor__WEBPACK_IMPORTED_MODULE_3__.getDefinedSVGCursorDescriptor)(name); if (descriptor) { cursor = createSVGMouseCursor(descriptor, urn, pointer, color, pointerStrokeWidth, super.getDefinedCursor('default')); super.setDefinedCursor(urn, cursor); } } return cursor; } } function format(template, dictionary) { const dict = Object(dictionary); const defined = Object.prototype.hasOwnProperty.bind(dict); return (template + '').replace(/\{\{(\w+)\}\}/g, (match, key) => { return defined(key) ? dict[key] + '' : ''; }); } function getCursorURN(name, pointer, color) { const type = pointer ? 'pointer' : 'cursor'; return `${type}:${name}/${color}`; } function createSVGMouseCursor(descriptor, name, pointer, color, pointerStrokeWidth, fallback) { const { x, y } = descriptor.mousePoint; return new SVGMouseCursor(createSVGIconUrl(descriptor, pointer, { color, pointerStrokeWidth }), x, y, name, fallback); } function createSVGIconUrl(descriptor, pointer, options) { const blob = createSVGIconBlob(descriptor, pointer, options); const url = URL.createObjectURL(blob); const urn = `${url}#${descriptor.name || 'unknown'}-${pointer ? 'pointer' : 'cursor'}`; return urn; } function createSVGIconBlob(descriptor, pointer, options) { const svgString = (pointer ? createSVGIconWithPointer : createSVGIcon)(descriptor, options); return new Blob([svgString], { type: 'image/svg+xml' }); } function createSVGIcon(descriptor, options) { const { iconContent, iconSize, viewBox } = descriptor; const svgString = ` ${iconContent} `; return format(svgString, options); } function createSVGIconWithPointer(descriptor, options) { const { iconContent, iconSize, viewBox, mousePointerGroupString } = descriptor; const scale = iconSize / Math.max(viewBox.x, viewBox.y, 1); const svgSize = 16 + iconSize; const pointerStrokeWidth = options.pointerStrokeWidth || 1; const svgString = ` ${mousePointerGroupString} ${iconContent} `; return format(svgString, options); } /***/ }, /***/ 45180 /*!*****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/cursors/elementCursor.js ***! \*****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ hideElementCursor: () => (/* binding */ hideElementCursor), /* harmony export */ initElementCursor: () => (/* binding */ initElementCursor), /* harmony export */ resetElementCursor: () => (/* binding */ resetElementCursor), /* harmony export */ setElementCursor: () => (/* binding */ _setElementCursor) /* harmony export */ }); /* harmony import */ var _MouseCursor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./MouseCursor */ 38771); const ELEMENT_CURSORS_MAP = Symbol('ElementCursorsMap'); function initElementCursor(element, cursor) { _getElementCursors(element)[0] = cursor; _setElementCursor(element, cursor); } function _setElementCursor(element, cursor) { const cursors = _getElementCursors(element); cursors[1] = cursors[0]; cursors[0] = cursor; element.style.cursor = (cursor instanceof _MouseCursor__WEBPACK_IMPORTED_MODULE_0__["default"] ? cursor : _MouseCursor__WEBPACK_IMPORTED_MODULE_0__["default"].getDefinedCursor('auto')).getStyleProperty(); } function resetElementCursor(element) { _setElementCursor(element, _getElementCursors(element)[1]); } function hideElementCursor(element) { _setElementCursor(element, _MouseCursor__WEBPACK_IMPORTED_MODULE_0__["default"].getDefinedCursor('none')); } function _getElementCursors(element) { let map = _getElementCursors[ELEMENT_CURSORS_MAP]; if (!(map instanceof WeakMap)) { map = new WeakMap(); Object.defineProperty(_getElementCursors, ELEMENT_CURSORS_MAP, { value: map }); } let cursors = map.get(element); if (!cursors) { cursors = [null, null]; map.set(element, cursors); } return cursors; } /***/ }, /***/ 47832 /*!***************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/_getHash.js ***! \***************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); function _getHash(annotationUID, drawingElementType, nodeUID) { return `${annotationUID}::${drawingElementType}::${nodeUID}`; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_getHash); /***/ }, /***/ 60321 /*!***********************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/draw.js ***! \***********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _getSvgDrawingHelper__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getSvgDrawingHelper */ 35687); /* harmony import */ var _utilities_drawing_textBoxOverlapRegistry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utilities/drawing/textBoxOverlapRegistry */ 44534); function draw(element, fn) { const svgDrawingHelper = (0,_getSvgDrawingHelper__WEBPACK_IMPORTED_MODULE_0__["default"])(element); if (svgDrawingHelper.svgLayerElement) { (0,_utilities_drawing_textBoxOverlapRegistry__WEBPACK_IMPORTED_MODULE_1__.clearTextBoxRegistry)(svgDrawingHelper.svgLayerElement); } fn(svgDrawingHelper); svgDrawingHelper.clearUntouched(); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (draw); /***/ }, /***/ 77503 /*!*****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawHandle.js ***! \*****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _getHash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getHash */ 47832); /* harmony import */ var _setNewAttributesIfValid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setNewAttributesIfValid */ 96513); /* harmony import */ var _setAttributesIfNecessary__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./setAttributesIfNecessary */ 30734); function drawHandle(svgDrawingHelper, annotationUID, handleGroupUID, handle, options = {}, uniqueIndex) { const { color, handleRadius, width, lineWidth, fill, type, opacity } = Object.assign({ color: 'rgb(0, 255, 0)', handleRadius: '6', width: '2', lineWidth: undefined, fill: 'transparent', type: 'circle', opacity: 1 }, options); const strokeWidth = lineWidth || width; const svgns = 'http://www.w3.org/2000/svg'; const svgNodeHash = (0,_getHash__WEBPACK_IMPORTED_MODULE_0__["default"])(annotationUID, 'handle', `hg-${handleGroupUID}-index-${uniqueIndex}`); let attributes; if (type === 'circle') { attributes = { cx: `${handle[0]}`, cy: `${handle[1]}`, r: handleRadius, stroke: color, fill, 'stroke-width': strokeWidth, opacity: opacity }; } else if (type === 'rect') { const handleRadiusFloat = parseFloat(handleRadius); const side = handleRadiusFloat * 1.5; const x = handle[0] - side * 0.5; const y = handle[1] - side * 0.5; attributes = { x: `${x}`, y: `${y}`, width: `${side}`, height: `${side}`, stroke: color, fill, 'stroke-width': strokeWidth, rx: `${side * 0.1}`, opacity: opacity }; } else { throw new Error(`Unsupported handle type: ${type}`); } const existingHandleElement = svgDrawingHelper.getSvgNode(svgNodeHash); if (existingHandleElement) { (0,_setAttributesIfNecessary__WEBPACK_IMPORTED_MODULE_2__["default"])(attributes, existingHandleElement); svgDrawingHelper.setNodeTouched(svgNodeHash); } else { const newHandleElement = document.createElementNS(svgns, type); (0,_setNewAttributesIfValid__WEBPACK_IMPORTED_MODULE_1__["default"])(attributes, newHandleElement); svgDrawingHelper.appendNode(newHandleElement, svgNodeHash); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (drawHandle); /***/ }, /***/ 22106 /*!******************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawHandles.js ***! \******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _drawHandle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./drawHandle */ 77503); function drawHandles(svgDrawingHelper, annotationUID, handleGroupUID, handlePoints, options = {}) { handlePoints.forEach((handle, i) => { (0,_drawHandle__WEBPACK_IMPORTED_MODULE_0__["default"])(svgDrawingHelper, annotationUID, handleGroupUID, handle, options, i); }); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (drawHandles); /***/ }, /***/ 45339 /*!***************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawLine.js ***! \***************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ drawLine) /* harmony export */ }); /* harmony import */ var _getHash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getHash */ 47832); /* harmony import */ var _setNewAttributesIfValid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setNewAttributesIfValid */ 96513); /* harmony import */ var _setAttributesIfNecessary__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./setAttributesIfNecessary */ 30734); function drawLine(svgDrawingHelper, annotationUID, lineUID, start, end, options = {}, dataId = '') { if (isNaN(start[0]) || isNaN(start[1]) || isNaN(end[0]) || isNaN(end[1])) { return; } const { color = 'rgb(0, 255, 0)', width = 10, lineWidth, lineDash, markerStartId = null, markerEndId = null, shadow = false, strokeOpacity = 1, textBoxLinkLineColor } = options; const strokeWidth = lineWidth || width; const svgns = 'http://www.w3.org/2000/svg'; const svgNodeHash = (0,_getHash__WEBPACK_IMPORTED_MODULE_0__["default"])(annotationUID, 'line', lineUID); const existingLine = svgDrawingHelper.getSvgNode(svgNodeHash); const layerId = svgDrawingHelper.svgLayerElement.id; const dropShadowStyle = shadow ? `filter:url(#shadow-${layerId});` : ''; const attributes = { x1: `${start[0]}`, y1: `${start[1]}`, x2: `${end[0]}`, y2: `${end[1]}`, stroke: textBoxLinkLineColor || color, style: dropShadowStyle, 'stroke-width': strokeWidth, 'stroke-dasharray': lineDash, 'marker-start': markerStartId ? `url(#${markerStartId})` : '', 'marker-end': markerEndId ? `url(#${markerEndId})` : '', 'stroke-opacity': strokeOpacity }; if (existingLine) { (0,_setAttributesIfNecessary__WEBPACK_IMPORTED_MODULE_2__["default"])(attributes, existingLine); svgDrawingHelper.setNodeTouched(svgNodeHash); } else { const newLine = document.createElementNS(svgns, 'line'); if (dataId !== '') { newLine.setAttribute('data-id', dataId); } (0,_setNewAttributesIfValid__WEBPACK_IMPORTED_MODULE_1__["default"])(attributes, newLine); svgDrawingHelper.appendNode(newLine, svgNodeHash); } } /***/ }, /***/ 27097 /*!***************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawLink.js ***! \***************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _drawLine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./drawLine */ 45339); /* harmony import */ var _utilities_math_vec2_findClosestPoint__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utilities/math/vec2/findClosestPoint */ 84797); function drawLink(svgDrawingHelper, annotationUID, linkUID, annotationAnchorPoints, refPoint, boundingBox, options = {}) { const start = annotationAnchorPoints.length > 0 ? (0,_utilities_math_vec2_findClosestPoint__WEBPACK_IMPORTED_MODULE_1__["default"])(annotationAnchorPoints, refPoint) : refPoint; const boundingBoxPoints = _boundingBoxPoints(boundingBox); const end = (0,_utilities_math_vec2_findClosestPoint__WEBPACK_IMPORTED_MODULE_1__["default"])(boundingBoxPoints, start); const mergedOptions = Object.assign({ color: 'rgb(255, 255, 0)', lineWidth: '1', lineDash: '2,3' }, options); (0,_drawLine__WEBPACK_IMPORTED_MODULE_0__["default"])(svgDrawingHelper, annotationUID, `link-${linkUID}`, start, end, mergedOptions); } function _boundingBoxPoints(boundingBox) { const { x: left, y: top, height, width } = boundingBox; const halfWidth = width / 2; const halfHeight = height / 2; const topMiddle = [left + halfWidth, top]; const leftMiddle = [left, top + halfHeight]; const bottomMiddle = [left + halfWidth, top + height]; const rightMiddle = [left + width, top + halfHeight]; return [topMiddle, leftMiddle, bottomMiddle, rightMiddle]; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (drawLink); /***/ }, /***/ 57810 /*!************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawLinkedTextBox.js ***! \************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _drawTextBox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./drawTextBox */ 9901); /* harmony import */ var _drawLink__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./drawLink */ 27097); function drawLinkedTextBox(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, annotationAnchorPoints, textBox, options = {}) { const mergedOptions = Object.assign({ handleRadius: '6', centering: { x: false, y: true } }, options); const canvasBoundingBox = (0,_drawTextBox__WEBPACK_IMPORTED_MODULE_0__["default"])(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, mergedOptions); (0,_drawLink__WEBPACK_IMPORTED_MODULE_1__["default"])(svgDrawingHelper, annotationUID, textBoxUID, annotationAnchorPoints, textBoxPosition, canvasBoundingBox, mergedOptions); return canvasBoundingBox; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (drawLinkedTextBox); /***/ }, /***/ 88086 /*!***************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawPath.js ***! \***************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ drawPath) /* harmony export */ }); /* harmony import */ var _getHash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getHash */ 47832); /* harmony import */ var _setNewAttributesIfValid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setNewAttributesIfValid */ 96513); /* harmony import */ var _setAttributesIfNecessary__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./setAttributesIfNecessary */ 30734); function drawPath(svgDrawingHelper, annotationUID, pathUID, points, options) { const hasSubArrays = points.length && points[0].length && Array.isArray(points[0][0]); const pointsArrays = hasSubArrays ? points : [points]; const { color = 'rgb(0, 255, 0)', width = 10, fillColor = 'none', fillOpacity = 0, lineWidth, lineDash, closePath = false } = options; const strokeWidth = lineWidth || width; const svgns = 'http://www.w3.org/2000/svg'; const svgNodeHash = (0,_getHash__WEBPACK_IMPORTED_MODULE_0__["default"])(annotationUID, 'path', pathUID); const existingNode = svgDrawingHelper.getSvgNode(svgNodeHash); let pointsAttribute = ''; for (let i = 0, numArrays = pointsArrays.length; i < numArrays; i++) { const points = pointsArrays[i]; const numPoints = points.length; if (numPoints < 2) { continue; } for (let j = 0; j < numPoints; j++) { const point = points[j]; const cmd = j ? 'L' : 'M'; pointsAttribute += `${cmd} ${point[0].toFixed(1)}, ${point[1].toFixed(1)} `; } if (closePath) { pointsAttribute += 'Z '; } } if (!pointsAttribute) { return; } const attributes = { d: pointsAttribute, stroke: color, fill: fillColor, 'fill-opacity': fillOpacity, 'stroke-width': strokeWidth, 'stroke-dasharray': lineDash }; if (existingNode) { (0,_setAttributesIfNecessary__WEBPACK_IMPORTED_MODULE_2__["default"])(attributes, existingNode); svgDrawingHelper.setNodeTouched(svgNodeHash); } else { const newNode = document.createElementNS(svgns, 'path'); (0,_setNewAttributesIfValid__WEBPACK_IMPORTED_MODULE_1__["default"])(attributes, newNode); svgDrawingHelper.appendNode(newNode, svgNodeHash); } } /***/ }, /***/ 43517 /*!*******************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawPolyline.js ***! \*******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ drawPolyline) /* harmony export */ }); /* harmony import */ var _getHash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getHash */ 47832); /* harmony import */ var _setNewAttributesIfValid__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setNewAttributesIfValid */ 96513); /* harmony import */ var _setAttributesIfNecessary__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./setAttributesIfNecessary */ 30734); function drawPolyline(svgDrawingHelper, annotationUID, polylineUID, points, options) { if (points.length < 2) { return; } const { color = 'rgb(0, 255, 0)', width = 10, fillColor = 'none', fillOpacity = 0, lineWidth, lineDash, closePath = false, markerStartId = null, markerEndId = null } = options; const strokeWidth = lineWidth || width; const svgns = 'http://www.w3.org/2000/svg'; const svgNodeHash = (0,_getHash__WEBPACK_IMPORTED_MODULE_0__["default"])(annotationUID, 'polyline', polylineUID); const existingPolyLine = svgDrawingHelper.getSvgNode(svgNodeHash); let pointsAttribute = ''; for (const point of points) { pointsAttribute += `${point[0].toFixed(1)}, ${point[1].toFixed(1)} `; } if (closePath) { const firstPoint = points[0]; pointsAttribute += `${firstPoint[0]}, ${firstPoint[1]}`; } const attributes = { points: pointsAttribute, stroke: color, fill: fillColor, 'fill-opacity': fillOpacity, 'stroke-width': strokeWidth, 'stroke-dasharray': lineDash, 'marker-start': markerStartId ? `url(#${markerStartId})` : '', 'marker-end': markerEndId ? `url(#${markerEndId})` : '' }; if (existingPolyLine) { (0,_setAttributesIfNecessary__WEBPACK_IMPORTED_MODULE_2__["default"])(attributes, existingPolyLine); svgDrawingHelper.setNodeTouched(svgNodeHash); } else { const newPolyLine = document.createElementNS(svgns, 'polyline'); (0,_setNewAttributesIfValid__WEBPACK_IMPORTED_MODULE_1__["default"])(attributes, newPolyLine); svgDrawingHelper.appendNode(newPolyLine, svgNodeHash); } } /***/ }, /***/ 9901 /*!******************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/drawTextBox.js ***! \******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _getHash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_getHash */ 47832); /* harmony import */ var _setAttributesIfNecessary__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setAttributesIfNecessary */ 30734); /* harmony import */ var _utilities_drawing_textBoxOverlapRegistry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utilities/drawing/textBoxOverlapRegistry */ 44534); function drawTextBox(svgDrawingHelper, annotationUID, textUID, textLines, position, options = {}) { const mergedOptions = Object.assign({ fontFamily: 'Helvetica, Arial, sans-serif', fontSize: '14px', color: 'rgb(255, 255, 0)', background: '', padding: 25, centerX: false, centerY: true }, options); const textGroupBoundingBox = _drawTextGroup(svgDrawingHelper, annotationUID, textUID, textLines, position, mergedOptions); if (svgDrawingHelper.svgLayerElement) { (0,_utilities_drawing_textBoxOverlapRegistry__WEBPACK_IMPORTED_MODULE_2__.registerTextBox)(svgDrawingHelper.svgLayerElement, textGroupBoundingBox); } return textGroupBoundingBox; } function _drawTextGroup(svgDrawingHelper, annotationUID, textUID, textLines = [''], position, options) { const { padding, color, fontFamily, fontSize, background, textBoxBorderRadius, textBoxMargin } = options; let textGroupBoundingBox; const [x, y] = [position[0] + padding, position[1] + padding]; const backgroundStyles = { color: background, textBoxBorderRadius, textBoxMargin }; const svgns = 'http://www.w3.org/2000/svg'; const svgNodeHash = (0,_getHash__WEBPACK_IMPORTED_MODULE_0__["default"])(annotationUID, 'text', textUID); const existingTextGroup = svgDrawingHelper.getSvgNode(svgNodeHash); if (existingTextGroup) { const textElement = existingTextGroup.querySelector('text'); const textSpans = Array.from(textElement.children); for (let i = 0; i < textSpans.length; i++) { const textSpanElement = textSpans[i]; const text = textLines[i] || ''; textSpanElement.textContent = text; } if (textLines.length > textSpans.length) { for (let i = 0; i < textLines.length - textSpans.length; i++) { const textLine = textLines[i + textSpans.length]; const textSpan = _createTextSpan(textLine); textElement.appendChild(textSpan); } existingTextGroup.appendChild(textElement); svgDrawingHelper.appendNode(existingTextGroup, svgNodeHash); } const textAttributes = { fill: color, 'font-size': fontSize, 'font-family': fontFamily }; const textGroupAttributes = { transform: `translate(${x} ${y})` }; (0,_setAttributesIfNecessary__WEBPACK_IMPORTED_MODULE_1__["default"])(textAttributes, textElement); (0,_setAttributesIfNecessary__WEBPACK_IMPORTED_MODULE_1__["default"])(textGroupAttributes, existingTextGroup); existingTextGroup.setAttribute('data-annotation-uid', annotationUID); textGroupBoundingBox = _drawTextBackground(existingTextGroup, backgroundStyles); svgDrawingHelper.setNodeTouched(svgNodeHash); } else { const textGroup = document.createElementNS(svgns, 'g'); textGroup.setAttribute('data-annotation-uid', annotationUID); textGroup.setAttribute('transform', `translate(${x} ${y})`); const textElement = _createTextElement(svgDrawingHelper, options); for (let i = 0; i < textLines.length; i++) { const textLine = textLines[i]; const textSpan = _createTextSpan(textLine); textElement.appendChild(textSpan); } textGroup.appendChild(textElement); svgDrawingHelper.appendNode(textGroup, svgNodeHash); textGroupBoundingBox = _drawTextBackground(textGroup, backgroundStyles); } return Object.assign({}, textGroupBoundingBox, { x: x + textGroupBoundingBox.x, y: y + textGroupBoundingBox.y, height: textGroupBoundingBox.height, width: textGroupBoundingBox.width }); } function _createTextElement(svgDrawingHelper, options) { const { color, fontFamily, fontSize } = options; const svgns = 'http://www.w3.org/2000/svg'; const textElement = document.createElementNS(svgns, 'text'); const noSelectStyle = 'user-select: none; pointer-events: none; -webkit-tap-highlight-color: rgba(255, 255, 255, 0);'; const dropShadowStyle = `filter:url(#shadow-${svgDrawingHelper.svgLayerElement.id});`; const combinedStyle = `${noSelectStyle}${dropShadowStyle}`; textElement.setAttribute('x', '0'); textElement.setAttribute('y', '0'); textElement.setAttribute('fill', color); textElement.setAttribute('font-family', fontFamily); textElement.setAttribute('font-size', fontSize); textElement.setAttribute('style', combinedStyle); textElement.setAttribute('pointer-events', 'visible'); return textElement; } function _createTextSpan(text) { const svgns = 'http://www.w3.org/2000/svg'; const textSpanElement = document.createElementNS(svgns, 'tspan'); textSpanElement.setAttribute('x', '0'); textSpanElement.setAttribute('dy', '1.2em'); textSpanElement.textContent = text; return textSpanElement; } function _drawTextBackground(group, backgroundStyles) { const { color, textBoxBorderRadius = 0, textBoxMargin = 0 } = backgroundStyles; let element = group.querySelector('rect.background'); const textElement = group.querySelector('text').getBBox(); if (!color) { if (element) { group.removeChild(element); } return group.getBBox(); } if (!element) { element = document.createElementNS('http://www.w3.org/2000/svg', 'rect'); element.setAttribute('class', 'background'); group.insertBefore(element, group.firstChild); } const bBox = group.getBBox(); const attributes = { x: `${bBox.x}`, y: `${bBox.y}`, width: `${textElement.width + Number(textBoxMargin) * 2}`, height: `${textElement.height + Number(textBoxMargin) * 2}`, fill: color, rx: textBoxBorderRadius, ry: textBoxBorderRadius }; if (textBoxMargin) { const tSpans = Array.from(group.querySelector('text').querySelectorAll('tspan')); tSpans.forEach((tspan, i) => { i === 0 && tspan.setAttribute('y', textBoxMargin); tspan.setAttribute('x', textBoxMargin); }); } (0,_setAttributesIfNecessary__WEBPACK_IMPORTED_MODULE_1__["default"])(attributes, element); return bBox; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (drawTextBox); /***/ }, /***/ 35687 /*!**************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/getSvgDrawingHelper.js ***! \**************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../store/state */ 90125); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); const VIEWPORT_ELEMENT = 'viewport-element'; function getSvgDrawingHelper(element) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(element); const { viewportId, renderingEngineId } = enabledElement; const canvasHash = `${viewportId}:${renderingEngineId}`; const svgLayerElement = _getSvgLayer(element); Object.keys(_store_state__WEBPACK_IMPORTED_MODULE_0__.state.svgNodeCache[canvasHash]).forEach(cacheKey => { _store_state__WEBPACK_IMPORTED_MODULE_0__.state.svgNodeCache[canvasHash][cacheKey].touched = false; }); return { svgLayerElement: svgLayerElement, svgNodeCacheForCanvas: _store_state__WEBPACK_IMPORTED_MODULE_0__.state.svgNodeCache, getSvgNode: getSvgNode.bind(this, canvasHash), appendNode: appendNode.bind(this, svgLayerElement, canvasHash), setNodeTouched: setNodeTouched.bind(this, canvasHash), clearUntouched: clearUntouched.bind(this, svgLayerElement, canvasHash) }; } function _getSvgLayer(element) { const viewportElement = `.${VIEWPORT_ELEMENT}`; const internalDivElement = element.querySelector(viewportElement); const svgLayer = internalDivElement?.querySelector(':scope > .svg-layer'); return svgLayer; } function getSvgNode(canvasHash, cacheKey) { if (!_store_state__WEBPACK_IMPORTED_MODULE_0__.state.svgNodeCache[canvasHash]) { return; } if (_store_state__WEBPACK_IMPORTED_MODULE_0__.state.svgNodeCache[canvasHash][cacheKey]) { return _store_state__WEBPACK_IMPORTED_MODULE_0__.state.svgNodeCache[canvasHash][cacheKey].domRef; } } function appendNode(svgLayerElement, canvasHash, svgNode, cacheKey) { if (!_store_state__WEBPACK_IMPORTED_MODULE_0__.state.svgNodeCache[canvasHash]) { return null; } _store_state__WEBPACK_IMPORTED_MODULE_0__.state.svgNodeCache[canvasHash][cacheKey] = { touched: true, domRef: svgNode }; svgLayerElement.appendChild(svgNode); } function setNodeTouched(canvasHash, cacheKey) { if (!_store_state__WEBPACK_IMPORTED_MODULE_0__.state.svgNodeCache[canvasHash]) { return; } if (_store_state__WEBPACK_IMPORTED_MODULE_0__.state.svgNodeCache[canvasHash][cacheKey]) { _store_state__WEBPACK_IMPORTED_MODULE_0__.state.svgNodeCache[canvasHash][cacheKey].touched = true; } } function clearUntouched(svgLayerElement, canvasHash) { if (!_store_state__WEBPACK_IMPORTED_MODULE_0__.state.svgNodeCache[canvasHash]) { return; } Object.keys(_store_state__WEBPACK_IMPORTED_MODULE_0__.state.svgNodeCache[canvasHash]).forEach(cacheKey => { const cacheEntry = _store_state__WEBPACK_IMPORTED_MODULE_0__.state.svgNodeCache[canvasHash][cacheKey]; if (!cacheEntry.touched && cacheEntry.domRef) { svgLayerElement.removeChild(cacheEntry.domRef); delete _store_state__WEBPACK_IMPORTED_MODULE_0__.state.svgNodeCache[canvasHash][cacheKey]; } }); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getSvgDrawingHelper); /***/ }, /***/ 30734 /*!*******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/setAttributesIfNecessary.js ***! \*******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ setAttributesIfNecessary: () => (/* binding */ setAttributesIfNecessary) /* harmony export */ }); function setAttributesIfNecessary(attributes, svgNode) { Object.keys(attributes).forEach(key => { const currentValue = svgNode.getAttribute(key); const newValue = attributes[key]; if (newValue === undefined || newValue === '') { svgNode.removeAttribute(key); } else if (currentValue !== newValue) { svgNode.setAttribute(key, newValue); } }); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (setAttributesIfNecessary); /***/ }, /***/ 96513 /*!******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/drawingSvg/setNewAttributesIfValid.js ***! \******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ setNewAttributesIfValid: () => (/* binding */ setNewAttributesIfValid) /* harmony export */ }); function setNewAttributesIfValid(attributes, svgNode) { Object.keys(attributes).forEach(key => { const newValue = attributes[key]; if (newValue !== undefined && newValue !== '') { svgNode.setAttribute(key, newValue); } }); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (setNewAttributesIfValid); /***/ }, /***/ 16739 /*!***********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/enums/AnnotationStyleStates.js ***! \***********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var AnnotationStyleStates; (function (AnnotationStyleStates) { AnnotationStyleStates["Default"] = ""; AnnotationStyleStates["Highlighted"] = "Highlighted"; AnnotationStyleStates["Selected"] = "Selected"; AnnotationStyleStates["Locked"] = "Locked"; AnnotationStyleStates["AutoGenerated"] = "AutoGenerated"; })(AnnotationStyleStates || (AnnotationStyleStates = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AnnotationStyleStates); /***/ }, /***/ 46190 /*!*************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/enums/ChangeTypes.js ***! \*************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var ChangeTypes; (function (ChangeTypes) { ChangeTypes["Interaction"] = "Interaction"; ChangeTypes["HandlesUpdated"] = "HandlesUpdated"; ChangeTypes["StatsUpdated"] = "StatsUpdated"; ChangeTypes["InitialSetup"] = "InitialSetup"; ChangeTypes["Completed"] = "Completed"; ChangeTypes["InterpolationUpdated"] = "InterpolationUpdated"; ChangeTypes["History"] = "History"; ChangeTypes["MetadataReferenceModified"] = "MetadataReferenceModified"; ChangeTypes["LabelChange"] = "LabelChange"; })(ChangeTypes || (ChangeTypes = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChangeTypes); /***/ }, /***/ 54870 /*!********************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/enums/Events.js ***! \********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var Events; (function (Events) { Events["TOOL_ACTIVATED"] = "CORNERSTONE_TOOLS_TOOL_ACTIVATED"; Events["TOOLGROUP_VIEWPORT_ADDED"] = "CORNERSTONE_TOOLS_TOOLGROUP_VIEWPORT_ADDED"; Events["TOOLGROUP_VIEWPORT_REMOVED"] = "CORNERSTONE_TOOLS_TOOLGROUP_VIEWPORT_REMOVED"; Events["TOOL_MODE_CHANGED"] = "CORNERSTONE_TOOLS_TOOL_MODE_CHANGED"; Events["CROSSHAIR_TOOL_CENTER_CHANGED"] = "CORNERSTONE_TOOLS_CROSSHAIR_TOOL_CENTER_CHANGED"; Events["VOLUMECROPPINGCONTROL_TOOL_CHANGED"] = "CORNERSTONE_TOOLS_VOLUMECROPPINGCONTROL_TOOL_CHANGED"; Events["VOLUMECROPPING_TOOL_CHANGED"] = "CORNERSTONE_TOOLS_VOLUMECROPPING_TOOL_CHANGED"; Events["STACK_PREFETCH_COMPLETE"] = "CORNERSTONE_TOOLS_STACK_PREFETCH_COMPLETE"; Events["ANNOTATION_ADDED"] = "CORNERSTONE_TOOLS_ANNOTATION_ADDED"; Events["ANNOTATION_COMPLETED"] = "CORNERSTONE_TOOLS_ANNOTATION_COMPLETED"; Events["ANNOTATION_MODIFIED"] = "CORNERSTONE_TOOLS_ANNOTATION_MODIFIED"; Events["ANNOTATION_REMOVED"] = "CORNERSTONE_TOOLS_ANNOTATION_REMOVED"; Events["ANNOTATION_SELECTION_CHANGE"] = "CORNERSTONE_TOOLS_ANNOTATION_SELECTION_CHANGE"; Events["ANNOTATION_LOCK_CHANGE"] = "CORNERSTONE_TOOLS_ANNOTATION_LOCK_CHANGE"; Events["ANNOTATION_VISIBILITY_CHANGE"] = "CORNERSTONE_TOOLS_ANNOTATION_VISIBILITY_CHANGE"; Events["ANNOTATION_RENDERED"] = "CORNERSTONE_TOOLS_ANNOTATION_RENDERED"; Events["ANNOTATION_CUT_MERGE_PROCESS_COMPLETED"] = "CORNERSTONE_TOOLS_ANNOTATION_CUT_MERGE_PROCESS_COMPLETED"; Events["ANNOTATION_INTERPOLATION_PROCESS_COMPLETED"] = "CORNERSTONE_TOOLS_ANNOTATION_INTERPOLATION_PROCESS_COMPLETED"; Events["INTERPOLATED_ANNOTATIONS_REMOVED"] = "CORNERSTONE_TOOLS_INTERPOLATED_ANNOTATIONS_REMOVED"; Events["SEGMENTATION_MODIFIED"] = "CORNERSTONE_TOOLS_SEGMENTATION_MODIFIED"; Events["SEGMENTATION_RENDERED"] = "CORNERSTONE_TOOLS_SEGMENTATION_RENDERED"; Events["SEGMENTATION_REPRESENTATION_ADDED"] = "CORNERSTONE_TOOLS_SEGMENTATION_REPRESENTATION_ADDED"; Events["SEGMENTATION_ADDED"] = "CORNERSTONE_TOOLS_SEGMENTATION_ADDED"; Events["SEGMENTATION_REPRESENTATION_MODIFIED"] = "CORNERSTONE_TOOLS_SEGMENTATION_REPRESENTATION_MODIFIED"; Events["SEGMENTATION_REMOVED"] = "CORNERSTONE_TOOLS_SEGMENTATION_REMOVED"; Events["SEGMENTATION_REPRESENTATION_REMOVED"] = "CORNERSTONE_TOOLS_SEGMENTATION_REPRESENTATION_REMOVED"; Events["SEGMENTATION_DATA_MODIFIED"] = "CORNERSTONE_TOOLS_SEGMENTATION_DATA_MODIFIED"; Events["HISTORY_UNDO"] = "CORNERSTONE_TOOLS_HISTORY_UNDO"; Events["HISTORY_REDO"] = "CORNERSTONE_TOOLS_HISTORY_REDO"; Events["KEY_DOWN"] = "CORNERSTONE_TOOLS_KEY_DOWN"; Events["KEY_UP"] = "CORNERSTONE_TOOLS_KEY_UP"; Events["MOUSE_DOWN"] = "CORNERSTONE_TOOLS_MOUSE_DOWN"; Events["MOUSE_UP"] = "CORNERSTONE_TOOLS_MOUSE_UP"; Events["MOUSE_DOWN_ACTIVATE"] = "CORNERSTONE_TOOLS_MOUSE_DOWN_ACTIVATE"; Events["MOUSE_DRAG"] = "CORNERSTONE_TOOLS_MOUSE_DRAG"; Events["MOUSE_MOVE"] = "CORNERSTONE_TOOLS_MOUSE_MOVE"; Events["MOUSE_CLICK"] = "CORNERSTONE_TOOLS_MOUSE_CLICK"; Events["MOUSE_DOUBLE_CLICK"] = "CORNERSTONE_TOOLS_MOUSE_DOUBLE_CLICK"; Events["MOUSE_WHEEL"] = "CORNERSTONE_TOOLS_MOUSE_WHEEL"; Events["TOUCH_START"] = "CORNERSTONE_TOOLS_TOUCH_START"; Events["TOUCH_START_ACTIVATE"] = "CORNERSTONE_TOOLS_TOUCH_START_ACTIVATE"; Events["TOUCH_PRESS"] = "CORNERSTONE_TOOLS_TOUCH_PRESS"; Events["TOUCH_DRAG"] = "CORNERSTONE_TOOLS_TOUCH_DRAG"; Events["TOUCH_END"] = "CORNERSTONE_TOOLS_TOUCH_END"; Events["TOUCH_TAP"] = "CORNERSTONE_TOOLS_TAP"; Events["TOUCH_SWIPE"] = "CORNERSTONE_TOOLS_SWIPE"; })(Events || (Events = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Events); /***/ }, /***/ 50319 /*!*****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/enums/MeasurementType.js ***! \*****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ MeasurementType: () => (/* binding */ MeasurementType) /* harmony export */ }); var MeasurementType; (function (MeasurementType) { MeasurementType["Linear"] = "Linear"; MeasurementType["Area"] = "Area"; MeasurementType["Volume"] = "Volume"; MeasurementType["Pixel"] = "Pixel"; })(MeasurementType || (MeasurementType = {})); /***/ }, /***/ 85543 /*!*****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/enums/SegmentationRepresentations.js ***! \*****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var SegmentationRepresentations; (function (SegmentationRepresentations) { SegmentationRepresentations["Labelmap"] = "Labelmap"; SegmentationRepresentations["Contour"] = "Contour"; SegmentationRepresentations["Surface"] = "Surface"; })(SegmentationRepresentations || (SegmentationRepresentations = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SegmentationRepresentations); /***/ }, /***/ 64543 /*!**************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/enums/ToolBindings.js ***! \**************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ KeyboardBindings: () => (/* binding */ KeyboardBindings), /* harmony export */ MouseBindings: () => (/* binding */ MouseBindings) /* harmony export */ }); var MouseBindings; (function (MouseBindings) { MouseBindings[MouseBindings["Primary"] = 1] = "Primary"; MouseBindings[MouseBindings["Secondary"] = 2] = "Secondary"; MouseBindings[MouseBindings["Primary_And_Secondary"] = 3] = "Primary_And_Secondary"; MouseBindings[MouseBindings["Auxiliary"] = 4] = "Auxiliary"; MouseBindings[MouseBindings["Primary_And_Auxiliary"] = 5] = "Primary_And_Auxiliary"; MouseBindings[MouseBindings["Secondary_And_Auxiliary"] = 6] = "Secondary_And_Auxiliary"; MouseBindings[MouseBindings["Primary_And_Secondary_And_Auxiliary"] = 7] = "Primary_And_Secondary_And_Auxiliary"; MouseBindings[MouseBindings["Fourth_Button"] = 8] = "Fourth_Button"; MouseBindings[MouseBindings["Fifth_Button"] = 16] = "Fifth_Button"; MouseBindings[MouseBindings["Wheel"] = 524288] = "Wheel"; MouseBindings[MouseBindings["Wheel_Primary"] = 524289] = "Wheel_Primary"; })(MouseBindings || (MouseBindings = {})); var KeyboardBindings; (function (KeyboardBindings) { KeyboardBindings[KeyboardBindings["Shift"] = 16] = "Shift"; KeyboardBindings[KeyboardBindings["Ctrl"] = 17] = "Ctrl"; KeyboardBindings[KeyboardBindings["Alt"] = 18] = "Alt"; KeyboardBindings[KeyboardBindings["Meta"] = 91] = "Meta"; KeyboardBindings[KeyboardBindings["ShiftCtrl"] = 1617] = "ShiftCtrl"; KeyboardBindings[KeyboardBindings["ShiftAlt"] = 1618] = "ShiftAlt"; KeyboardBindings[KeyboardBindings["ShiftMeta"] = 1691] = "ShiftMeta"; KeyboardBindings[KeyboardBindings["CtrlAlt"] = 1718] = "CtrlAlt"; KeyboardBindings[KeyboardBindings["CtrlMeta"] = 1791] = "CtrlMeta"; KeyboardBindings[KeyboardBindings["AltMeta"] = 1891] = "AltMeta"; })(KeyboardBindings || (KeyboardBindings = {})); /***/ }, /***/ 92925 /*!***********************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/enums/ToolModes.js ***! \***********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); var ToolModes; (function (ToolModes) { ToolModes["Active"] = "Active"; ToolModes["Passive"] = "Passive"; ToolModes["Enabled"] = "Enabled"; ToolModes["Disabled"] = "Disabled"; })(ToolModes || (ToolModes = {})); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ToolModes); /***/ }, /***/ 11232 /*!*******************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/enums/Touch.js ***! \*******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Swipe: () => (/* binding */ Swipe) /* harmony export */ }); var Swipe; (function (Swipe) { Swipe["UP"] = "UP"; Swipe["DOWN"] = "DOWN"; Swipe["LEFT"] = "LEFT"; Swipe["RIGHT"] = "RIGHT"; })(Swipe || (Swipe = {})); /***/ }, /***/ 64647 /*!***************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/annotationInterpolationEventDispatcher.js ***! \***************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 28699); /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums/Events */ 54870); /* harmony import */ var _utilities_segmentation_InterpolationManager_InterpolationManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utilities/segmentation/InterpolationManager/InterpolationManager */ 6259); const enable = function () { _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].addEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_1__["default"].ANNOTATION_COMPLETED, _utilities_segmentation_InterpolationManager_InterpolationManager__WEBPACK_IMPORTED_MODULE_2__["default"].handleAnnotationCompleted); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].addEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_1__["default"].ANNOTATION_MODIFIED, _utilities_segmentation_InterpolationManager_InterpolationManager__WEBPACK_IMPORTED_MODULE_2__["default"].handleAnnotationUpdate); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].addEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_1__["default"].ANNOTATION_REMOVED, _utilities_segmentation_InterpolationManager_InterpolationManager__WEBPACK_IMPORTED_MODULE_2__["default"].handleAnnotationDelete); }; const disable = function () { _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].removeEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_1__["default"].ANNOTATION_COMPLETED, _utilities_segmentation_InterpolationManager_InterpolationManager__WEBPACK_IMPORTED_MODULE_2__["default"].handleAnnotationCompleted); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].removeEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_1__["default"].ANNOTATION_MODIFIED, _utilities_segmentation_InterpolationManager_InterpolationManager__WEBPACK_IMPORTED_MODULE_2__["default"].handleAnnotationUpdate); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].removeEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_1__["default"].ANNOTATION_REMOVED, _utilities_segmentation_InterpolationManager_InterpolationManager__WEBPACK_IMPORTED_MODULE_2__["default"].handleAnnotationDelete); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ enable, disable }); /***/ }, /***/ 58740 /*!******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/cameraModifiedEventDispatcher.js ***! \******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 14566); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums */ 92925); /* harmony import */ var _shared_getToolsWithModesForMouseEvent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shared/getToolsWithModesForMouseEvent */ 34677); const { Active, Passive, Enabled } = _enums__WEBPACK_IMPORTED_MODULE_1__["default"]; const onCameraModified = function (evt) { const enabledTools = (0,_shared_getToolsWithModesForMouseEvent__WEBPACK_IMPORTED_MODULE_2__["default"])(evt, [Active, Passive, Enabled]); enabledTools.forEach(tool => { if (tool.onCameraModified) { tool.onCameraModified(evt); } }); }; const enable = function (element) { element.addEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].CAMERA_MODIFIED, onCameraModified); }; const disable = function (element) { element.removeEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].CAMERA_MODIFIED, onCameraModified); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ enable, disable }); /***/ }, /***/ 21046 /*!***************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/cameraResetEventDispatcher.js ***! \***************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 14566); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums */ 92925); /* harmony import */ var _shared_getToolsWithModesForMouseEvent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shared/getToolsWithModesForMouseEvent */ 34677); const { Active, Passive, Enabled } = _enums__WEBPACK_IMPORTED_MODULE_1__["default"]; const onCameraReset = function (evt) { const enabledTools = (0,_shared_getToolsWithModesForMouseEvent__WEBPACK_IMPORTED_MODULE_2__["default"])(evt, [Active, Passive, Enabled]); enabledTools.forEach(tool => { if (tool.onResetCamera) { tool.onResetCamera(evt); } }); }; const enable = function (element) { element.addEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].CAMERA_RESET, onCameraReset); }; const disable = function (element) { element.removeEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].CAMERA_RESET, onCameraReset); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ enable, disable }); /***/ }, /***/ 58128 /*!*****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/imageRenderedEventDispatcher.js ***! \*****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 14566); /* harmony import */ var _utilities_triggerAnnotationRender__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utilities/triggerAnnotationRender */ 78928); const onImageRendered = function (evt) { (0,_utilities_triggerAnnotationRender__WEBPACK_IMPORTED_MODULE_1__["default"])(evt.detail.element); }; const enable = function (element) { element.addEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].IMAGE_RENDERED, onImageRendered); }; const disable = function (element) { element.removeEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].IMAGE_RENDERED, onImageRendered); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ enable, disable }); /***/ }, /***/ 90507 /*!**************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/imageSpacingCalibratedEventDispatcher.js ***! \**************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 14566); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../enums */ 92925); /* harmony import */ var _shared_getToolsWithModesForMouseEvent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shared/getToolsWithModesForMouseEvent */ 34677); const { Active, Passive, Enabled } = _enums__WEBPACK_IMPORTED_MODULE_1__["default"]; const onImageSpacingCalibrated = function (evt) { const enabledTools = (0,_shared_getToolsWithModesForMouseEvent__WEBPACK_IMPORTED_MODULE_2__["default"])(evt, [Active, Passive, Enabled]); enabledTools.forEach(tool => { if (tool.onImageSpacingCalibrated) { tool.onImageSpacingCalibrated(evt); } }); }; const enable = function (element) { element.addEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].IMAGE_SPACING_CALIBRATED, onImageSpacingCalibrated); }; const disable = function (element) { element.removeEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].IMAGE_SPACING_CALIBRATED, onImageSpacingCalibrated); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ enable, disable }); /***/ }, /***/ 96824 /*!******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/keyboardEventHandlers/keyDown.js ***! \******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ keyDown) /* harmony export */ }); /* harmony import */ var _shared_getActiveToolForKeyboardEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/getActiveToolForKeyboardEvent */ 46521); /* harmony import */ var _shared_getToolsWithActionsForKeyboardEvents__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/getToolsWithActionsForKeyboardEvents */ 90734); /* harmony import */ var _enums_ToolModes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/ToolModes */ 92925); /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../store/ToolGroupManager */ 43551); function keyDown(evt) { const activeTool = (0,_shared_getActiveToolForKeyboardEvent__WEBPACK_IMPORTED_MODULE_0__["default"])(evt); if (activeTool) { const { renderingEngineId, viewportId } = evt.detail; const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_3__["default"])(viewportId, renderingEngineId); const toolName = activeTool.getToolName(); if (Object.keys(toolGroup.toolOptions).includes(toolName)) { toolGroup.setViewportsCursorByToolName(toolName); } } const activeToolsWithEventBinding = (0,_shared_getToolsWithActionsForKeyboardEvents__WEBPACK_IMPORTED_MODULE_1__["default"])(evt, [_enums_ToolModes__WEBPACK_IMPORTED_MODULE_2__["default"].Active]); if (activeToolsWithEventBinding?.size) { const { element } = evt.detail; for (const [key, value] of [...activeToolsWithEventBinding.entries()]) { const method = typeof value.method === 'function' ? value.method : key[value.method]; method.call(key, element, value, evt); } } } /***/ }, /***/ 66606 /*!****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/keyboardEventHandlers/keyUp.js ***! \****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ keyUp) /* harmony export */ }); /* harmony import */ var _eventListeners_keyboard_keyDownListener__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../eventListeners/keyboard/keyDownListener */ 19297); /* harmony import */ var _shared_getActiveToolForKeyboardEvent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/getActiveToolForKeyboardEvent */ 46521); /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../store/ToolGroupManager */ 43551); function keyUp(evt) { const activeTool = (0,_shared_getActiveToolForKeyboardEvent__WEBPACK_IMPORTED_MODULE_1__["default"])(evt); if (!activeTool) { return; } const { renderingEngineId, viewportId } = evt.detail; const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_2__["default"])(viewportId, renderingEngineId); (0,_eventListeners_keyboard_keyDownListener__WEBPACK_IMPORTED_MODULE_0__.resetModifierKey)(); const toolName = activeTool.getToolName(); if (Object.keys(toolGroup.toolOptions).includes(toolName)) { toolGroup.setViewportsCursorByToolName(toolName); } } /***/ }, /***/ 8153 /*!****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/keyboardToolEventDispatcher.js ***! \****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums/Events */ 54870); /* harmony import */ var _keyboardEventHandlers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keyboardEventHandlers */ 96824); /* harmony import */ var _keyboardEventHandlers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./keyboardEventHandlers */ 66606); const enable = function (element) { element.addEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].KEY_DOWN, _keyboardEventHandlers__WEBPACK_IMPORTED_MODULE_1__["default"]); element.addEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].KEY_UP, _keyboardEventHandlers__WEBPACK_IMPORTED_MODULE_2__["default"]); }; const disable = function (element) { element.removeEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].KEY_DOWN, _keyboardEventHandlers__WEBPACK_IMPORTED_MODULE_1__["default"]); element.removeEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].KEY_UP, _keyboardEventHandlers__WEBPACK_IMPORTED_MODULE_2__["default"]); }; const keyboardToolEventDispatcher = { enable, disable }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (keyboardToolEventDispatcher); /***/ }, /***/ 95449 /*!******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/mouseEventHandlers/mouseClick.js ***! \******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _shared_customCallbackHandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/customCallbackHandler */ 89931); const mouseClick = _shared_customCallbackHandler__WEBPACK_IMPORTED_MODULE_0__["default"].bind(null, 'Mouse', 'mouseClickCallback'); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mouseClick); /***/ }, /***/ 72670 /*!************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/mouseEventHandlers/mouseDoubleClick.js ***! \************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _shared_customCallbackHandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/customCallbackHandler */ 89931); const mouseDoubleClick = _shared_customCallbackHandler__WEBPACK_IMPORTED_MODULE_0__["default"].bind(null, 'Mouse', 'doubleClickCallback'); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mouseDoubleClick); /***/ }, /***/ 96529 /*!*****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/mouseEventHandlers/mouseDown.js ***! \*****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ mouseDown) /* harmony export */ }); /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../store/state */ 90125); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../enums */ 92925); /* harmony import */ var _stateManagement_annotation_annotationSelection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../stateManagement/annotation/annotationSelection */ 1736); /* harmony import */ var _stateManagement_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../stateManagement/annotation/annotationLocking */ 11399); /* harmony import */ var _stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../stateManagement/annotation/annotationVisibility */ 97240); /* harmony import */ var _store_filterToolsWithMoveableHandles__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../store/filterToolsWithMoveableHandles */ 31433); /* harmony import */ var _store_filterToolsWithAnnotationsForElement__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../store/filterToolsWithAnnotationsForElement */ 55694); /* harmony import */ var _store_filterMoveableAnnotationTools__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../store/filterMoveableAnnotationTools */ 16945); /* harmony import */ var _shared_getActiveToolForMouseEvent__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../shared/getActiveToolForMouseEvent */ 26221); /* harmony import */ var _shared_getToolsWithModesForMouseEvent__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../shared/getToolsWithModesForMouseEvent */ 34677); /* harmony import */ var _mouseDownAnnotationAction__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./mouseDownAnnotationAction */ 27886); const { Active, Passive } = _enums__WEBPACK_IMPORTED_MODULE_1__["default"]; function mouseDown(evt) { if (_store_state__WEBPACK_IMPORTED_MODULE_0__.state.isInteractingWithTool) { return; } const activeTool = (0,_shared_getActiveToolForMouseEvent__WEBPACK_IMPORTED_MODULE_8__["default"])(evt); if (activeTool && typeof activeTool.preMouseDownCallback === 'function') { const consumedEvent = activeTool.preMouseDownCallback(evt); if (consumedEvent) { return; } } const allActiveTools = (0,_shared_getToolsWithModesForMouseEvent__WEBPACK_IMPORTED_MODULE_9__["default"])(evt, [Active]); const allPassiveTools = (0,_shared_getToolsWithModesForMouseEvent__WEBPACK_IMPORTED_MODULE_9__["default"])(evt, [Passive]); const applicableTools = [...(allActiveTools || []), ...(allPassiveTools || [])]; const actionExecuted = (0,_mouseDownAnnotationAction__WEBPACK_IMPORTED_MODULE_10__["default"])(evt); if (actionExecuted) { return; } const eventDetail = evt.detail; const { element } = eventDetail; const annotationToolsWithAnnotations = (0,_store_filterToolsWithAnnotationsForElement__WEBPACK_IMPORTED_MODULE_6__["default"])(element, applicableTools); const canvasCoords = eventDetail.currentPoints.canvas; const annotationToolsWithMoveableHandles = (0,_store_filterToolsWithMoveableHandles__WEBPACK_IMPORTED_MODULE_5__["default"])(element, annotationToolsWithAnnotations, canvasCoords, 'mouse'); const isMultiSelect = !!evt.detail.event.shiftKey; if (annotationToolsWithMoveableHandles.length > 0) { const { tool, annotation, handle } = getAnnotationForSelection(annotationToolsWithMoveableHandles); toggleAnnotationSelection(annotation.annotationUID, isMultiSelect); tool.handleSelectedCallback(evt, annotation, handle, 'Mouse'); return; } const moveableAnnotationTools = (0,_store_filterMoveableAnnotationTools__WEBPACK_IMPORTED_MODULE_7__["default"])(element, annotationToolsWithAnnotations, canvasCoords, 'mouse'); if (moveableAnnotationTools.length > 0) { const { tool, annotation } = getAnnotationForSelection(moveableAnnotationTools); toggleAnnotationSelection(annotation.annotationUID, isMultiSelect); tool.toolSelectedCallback(evt, annotation, 'Mouse', canvasCoords); return; } if (activeTool && typeof activeTool.postMouseDownCallback === 'function') { const consumedEvent = activeTool.postMouseDownCallback(evt); if (consumedEvent) { return; } } } function getAnnotationForSelection(toolsWithMovableHandles) { if (toolsWithMovableHandles.length > 1) { const unlockAndVisibleAnnotation = toolsWithMovableHandles.find(item => { const isUnlocked = !(0,_stateManagement_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_3__.isAnnotationLocked)(item.annotation.annotationUID); const isVisible = (0,_stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_4__.isAnnotationVisible)(item.annotation.annotationUID); return isUnlocked && isVisible; }); if (unlockAndVisibleAnnotation) { return unlockAndVisibleAnnotation; } } return toolsWithMovableHandles[0]; } function toggleAnnotationSelection(annotationUID, isMultiSelect = false) { if (isMultiSelect) { if ((0,_stateManagement_annotation_annotationSelection__WEBPACK_IMPORTED_MODULE_2__.isAnnotationSelected)(annotationUID)) { (0,_stateManagement_annotation_annotationSelection__WEBPACK_IMPORTED_MODULE_2__.setAnnotationSelected)(annotationUID, false); } else { const preserveSelected = true; (0,_stateManagement_annotation_annotationSelection__WEBPACK_IMPORTED_MODULE_2__.setAnnotationSelected)(annotationUID, true, preserveSelected); } } else { const preserveSelected = false; (0,_stateManagement_annotation_annotationSelection__WEBPACK_IMPORTED_MODULE_2__.setAnnotationSelected)(annotationUID, true, preserveSelected); } } /***/ }, /***/ 86036 /*!*************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/mouseEventHandlers/mouseDownActivate.js ***! \*************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ mouseDownActivate) /* harmony export */ }); /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../store/state */ 90125); /* harmony import */ var _shared_getActiveToolForMouseEvent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/getActiveToolForMouseEvent */ 26221); /* harmony import */ var _stateManagement_annotation_annotationSelection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../stateManagement/annotation/annotationSelection */ 1736); function mouseDownActivate(evt) { if (_store_state__WEBPACK_IMPORTED_MODULE_0__.state.isInteractingWithTool) { return; } const activeTool = (0,_shared_getActiveToolForMouseEvent__WEBPACK_IMPORTED_MODULE_1__["default"])(evt); if (!activeTool) { return; } if (_store_state__WEBPACK_IMPORTED_MODULE_0__.state.isMultiPartToolActive) { return; } if (activeTool.addNewAnnotation) { try { const annotation = activeTool.addNewAnnotation(evt, 'mouse'); (0,_stateManagement_annotation_annotationSelection__WEBPACK_IMPORTED_MODULE_2__.setAnnotationSelected)(annotation.annotationUID); } catch (error) { console.warn('Error adding new annotation, viewport not ready:', error); } } } /***/ }, /***/ 27886 /*!*********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/mouseEventHandlers/mouseDownAnnotationAction.js ***! \*********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ mouseDownAnnotationAction) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../store/state */ 90125); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums */ 92925); /* harmony import */ var _store_filterToolsWithAnnotationsForElement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../store/filterToolsWithAnnotationsForElement */ 55694); /* harmony import */ var _store_filterMoveableAnnotationTools__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../store/filterMoveableAnnotationTools */ 16945); /* harmony import */ var _shared_getToolsWithActionsForMouseEvent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../shared/getToolsWithActionsForMouseEvent */ 43595); const { Active, Passive } = _enums__WEBPACK_IMPORTED_MODULE_2__["default"]; function mouseDownAnnotationAction(evt) { if (_store_state__WEBPACK_IMPORTED_MODULE_1__.state.isInteractingWithTool) { return false; } const eventDetail = evt.detail; const { element } = eventDetail; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element); const { canvas: canvasCoords } = eventDetail.currentPoints; if (!enabledElement) { return false; } const toolsWithActions = (0,_shared_getToolsWithActionsForMouseEvent__WEBPACK_IMPORTED_MODULE_5__["default"])(evt, [Active, Passive]); const tools = Array.from(toolsWithActions.keys()); const annotationToolsWithAnnotations = (0,_store_filterToolsWithAnnotationsForElement__WEBPACK_IMPORTED_MODULE_3__["default"])(element, tools); const moveableAnnotationTools = (0,_store_filterMoveableAnnotationTools__WEBPACK_IMPORTED_MODULE_4__["default"])(element, annotationToolsWithAnnotations, canvasCoords); if (moveableAnnotationTools.length > 0) { const { tool, annotation } = moveableAnnotationTools[0]; const action = toolsWithActions.get(tool); const method = typeof action.method === 'string' ? tool[action.method] : action.method; method.call(tool, evt, annotation); return true; } return false; } /***/ }, /***/ 95159 /*!*****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/mouseEventHandlers/mouseDrag.js ***! \*****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ mouseDrag) /* harmony export */ }); /* harmony import */ var _shared_getActiveToolForMouseEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/getActiveToolForMouseEvent */ 26221); /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../store/state */ 90125); function mouseDrag(evt) { if (_store_state__WEBPACK_IMPORTED_MODULE_1__.state.isInteractingWithTool) { return; } const activeTool = (0,_shared_getActiveToolForMouseEvent__WEBPACK_IMPORTED_MODULE_0__["default"])(evt); const noFoundToolOrDoesNotHaveMouseDragCallback = !activeTool || typeof activeTool.mouseDragCallback !== 'function'; if (noFoundToolOrDoesNotHaveMouseDragCallback) { return; } activeTool.mouseDragCallback(evt); } /***/ }, /***/ 56176 /*!*****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/mouseEventHandlers/mouseMove.js ***! \*****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ mouseMove) /* harmony export */ }); /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../store/state */ 90125); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../enums */ 92925); /* harmony import */ var _store_filterToolsWithAnnotationsForElement__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../store/filterToolsWithAnnotationsForElement */ 55694); /* harmony import */ var _shared_getToolsWithModesForMouseEvent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shared/getToolsWithModesForMouseEvent */ 34677); /* harmony import */ var _utilities_triggerAnnotationRender__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utilities/triggerAnnotationRender */ 78928); const { Active, Passive } = _enums__WEBPACK_IMPORTED_MODULE_1__["default"]; function mouseMove(evt) { if (_store_state__WEBPACK_IMPORTED_MODULE_0__.state.isInteractingWithTool || _store_state__WEBPACK_IMPORTED_MODULE_0__.state.isMultiPartToolActive) { return; } const activeAndPassiveTools = (0,_shared_getToolsWithModesForMouseEvent__WEBPACK_IMPORTED_MODULE_3__["default"])(evt, [Active, Passive]); const eventDetail = evt.detail; const { element } = eventDetail; const toolsWithAnnotations = (0,_store_filterToolsWithAnnotationsForElement__WEBPACK_IMPORTED_MODULE_2__["default"])(element, activeAndPassiveTools); const toolsWithoutAnnotations = activeAndPassiveTools.filter(tool => { const doesNotHaveAnnotations = !toolsWithAnnotations.some(toolAndAnnotation => toolAndAnnotation.tool.getToolName() === tool.getToolName()); return doesNotHaveAnnotations; }); let annotationsNeedToBeRedrawn = false; for (const { tool, annotations } of toolsWithAnnotations) { if (typeof tool.mouseMoveCallback === 'function') { annotationsNeedToBeRedrawn = tool.mouseMoveCallback(evt, annotations) || annotationsNeedToBeRedrawn; } } toolsWithoutAnnotations.forEach(tool => { if (typeof tool.mouseMoveCallback === 'function') { tool.mouseMoveCallback(evt); } }); if (annotationsNeedToBeRedrawn === true) { (0,_utilities_triggerAnnotationRender__WEBPACK_IMPORTED_MODULE_4__["default"])(element); } } /***/ }, /***/ 5776 /*!***************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/mouseEventHandlers/mouseUp.js ***! \***************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _shared_customCallbackHandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/customCallbackHandler */ 89931); const mouseUp = _shared_customCallbackHandler__WEBPACK_IMPORTED_MODULE_0__["default"].bind(null, 'Mouse', 'mouseUpCallback'); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mouseUp); /***/ }, /***/ 25734 /*!******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/mouseEventHandlers/mouseWheel.js ***! \******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../store/state */ 90125); /* harmony import */ var _shared_getActiveToolForMouseEvent__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shared/getActiveToolForMouseEvent */ 26221); /* harmony import */ var _enums_ToolBindings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/ToolBindings */ 64543); function mouseWheel(evt) { if (_store_state__WEBPACK_IMPORTED_MODULE_0__.state.isInteractingWithTool) { return; } evt.detail.buttons = _enums_ToolBindings__WEBPACK_IMPORTED_MODULE_2__.MouseBindings.Wheel | (evt.detail.event.buttons || 0); const activeTool = (0,_shared_getActiveToolForMouseEvent__WEBPACK_IMPORTED_MODULE_1__["default"])(evt); if (!activeTool) { return; } return activeTool.mouseWheelCallback(evt); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mouseWheel); /***/ }, /***/ 42511 /*!*************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/mouseToolEventDispatcher.js ***! \*************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums/Events */ 54870); /* harmony import */ var _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mouseEventHandlers */ 95449); /* harmony import */ var _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mouseEventHandlers */ 72670); /* harmony import */ var _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mouseEventHandlers */ 96529); /* harmony import */ var _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mouseEventHandlers */ 86036); /* harmony import */ var _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./mouseEventHandlers */ 95159); /* harmony import */ var _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mouseEventHandlers */ 56176); /* harmony import */ var _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./mouseEventHandlers */ 5776); /* harmony import */ var _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./mouseEventHandlers */ 25734); const enable = function (element) { element.addEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].MOUSE_CLICK, _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_1__["default"]); element.addEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].MOUSE_DOWN, _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_3__["default"]); element.addEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].MOUSE_DOWN_ACTIVATE, _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_4__["default"]); element.addEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].MOUSE_DOUBLE_CLICK, _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_2__["default"]); element.addEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].MOUSE_DRAG, _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_5__["default"]); element.addEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].MOUSE_MOVE, _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_6__["default"]); element.addEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].MOUSE_UP, _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_7__["default"]); element.addEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].MOUSE_WHEEL, _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_8__["default"]); }; const disable = function (element) { element.removeEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].MOUSE_CLICK, _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_1__["default"]); element.removeEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].MOUSE_DOWN, _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_3__["default"]); element.removeEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].MOUSE_DOWN_ACTIVATE, _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_4__["default"]); element.removeEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].MOUSE_DOUBLE_CLICK, _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_2__["default"]); element.removeEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].MOUSE_DRAG, _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_5__["default"]); element.removeEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].MOUSE_MOVE, _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_6__["default"]); element.removeEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].MOUSE_UP, _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_7__["default"]); element.removeEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].MOUSE_WHEEL, _mouseEventHandlers__WEBPACK_IMPORTED_MODULE_8__["default"]); }; const mouseToolEventDispatcher = { enable, disable }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mouseToolEventDispatcher); /***/ }, /***/ 89931 /*!*****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/shared/customCallbackHandler.js ***! \*****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ customCallbackHandler) /* harmony export */ }); /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../store/state */ 90125); /* harmony import */ var _enums_ToolModes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../enums/ToolModes */ 92925); /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../store/ToolGroupManager */ 43551); const { Active } = _enums_ToolModes__WEBPACK_IMPORTED_MODULE_1__["default"]; function customCallbackHandler(handlerType, customFunction, evt) { if (_store_state__WEBPACK_IMPORTED_MODULE_0__.state.isInteractingWithTool) { return false; } const { renderingEngineId, viewportId } = evt.detail; const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_2__["default"])(viewportId, renderingEngineId); if (!toolGroup) { return false; } let activeTool; const toolGroupToolNames = Object.keys(toolGroup.toolOptions); for (let j = 0; j < toolGroupToolNames.length; j++) { const toolName = toolGroupToolNames[j]; const tool = toolGroup.toolOptions[toolName]; const toolInstance = toolGroup.getToolInstance(toolName); if (tool.mode === Active && typeof toolInstance[customFunction] === 'function') { activeTool = toolGroup.getToolInstance(toolName); break; } } if (!activeTool) { return; } activeTool[customFunction](evt); } /***/ }, /***/ 46521 /*!*************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/shared/getActiveToolForKeyboardEvent.js ***! \*************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getActiveToolForKeyboardEvent) /* harmony export */ }); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../enums */ 92925); /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../eventListeners */ 6738); /* harmony import */ var _eventListeners_mouse_mouseDownListener__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../eventListeners/mouse/mouseDownListener */ 92313); /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../store/ToolGroupManager */ 43551); const { Active } = _enums__WEBPACK_IMPORTED_MODULE_0__["default"]; function getActiveToolForKeyboardEvent(evt) { const { renderingEngineId, viewportId } = evt.detail; const mouseButton = (0,_eventListeners_mouse_mouseDownListener__WEBPACK_IMPORTED_MODULE_2__.getMouseButton)(); const modifierKey = _eventListeners__WEBPACK_IMPORTED_MODULE_1__["default"].getModifierKey(); const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_3__["default"])(viewportId, renderingEngineId); if (!toolGroup) { return null; } const toolGroupToolNames = Object.keys(toolGroup.toolOptions); const defaultMousePrimary = toolGroup.getDefaultMousePrimary(); for (let j = 0; j < toolGroupToolNames.length; j++) { const toolName = toolGroupToolNames[j]; const toolOptions = toolGroup.toolOptions[toolName]; if (toolOptions.mode !== Active) { continue; } const correctBinding = toolOptions.bindings.length && toolOptions.bindings.some(binding => binding.mouseButton === (mouseButton ?? defaultMousePrimary) && binding.modifierKey === modifierKey); if (correctBinding) { return toolGroup.getToolInstance(toolName); } } } /***/ }, /***/ 26221 /*!**********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/shared/getActiveToolForMouseEvent.js ***! \**********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getActiveToolForMouseEvent) /* harmony export */ }); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../enums */ 92925); /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../eventListeners */ 6738); /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../store/ToolGroupManager */ 43551); /* harmony import */ var _getMouseModifier__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getMouseModifier */ 6501); const { Active } = _enums__WEBPACK_IMPORTED_MODULE_0__["default"]; function getActiveToolForMouseEvent(evt) { const { renderingEngineId, viewportId, event: mouseEvent } = evt.detail; const modifierKey = (0,_getMouseModifier__WEBPACK_IMPORTED_MODULE_3__["default"])(mouseEvent) || _eventListeners__WEBPACK_IMPORTED_MODULE_1__["default"].getModifierKey(); const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_2__["default"])(viewportId, renderingEngineId); if (!toolGroup) { return null; } const toolGroupToolNames = Object.keys(toolGroup.toolOptions); const defaultMousePrimary = toolGroup.getDefaultMousePrimary(); const mouseButton = evt.detail.buttons ?? mouseEvent?.buttons ?? defaultMousePrimary; for (let j = 0; j < toolGroupToolNames.length; j++) { const toolName = toolGroupToolNames[j]; const toolOptions = toolGroup.toolOptions[toolName]; const correctBinding = toolOptions.bindings.length && toolOptions.bindings.some(binding => { return binding.mouseButton === mouseButton && binding.modifierKey === modifierKey; }); if (toolOptions.mode === Active && correctBinding) { return toolGroup.getToolInstance(toolName); } } } /***/ }, /***/ 26513 /*!**********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/shared/getActiveToolForTouchEvent.js ***! \**********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getActiveToolForTouchEvent) /* harmony export */ }); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../enums */ 92925); /* harmony import */ var _getMouseModifier__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getMouseModifier */ 6501); /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../eventListeners */ 6738); /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../store/ToolGroupManager */ 43551); const { Active } = _enums__WEBPACK_IMPORTED_MODULE_0__["default"]; function getActiveToolForTouchEvent(evt) { const { renderingEngineId, viewportId } = evt.detail; const touchEvent = evt.detail.event; const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_3__["default"])(viewportId, renderingEngineId); if (!toolGroup) { return null; } const toolGroupToolNames = Object.keys(toolGroup.toolOptions); const numTouchPoints = Object.keys(touchEvent.touches).length; const modifierKey = (0,_getMouseModifier__WEBPACK_IMPORTED_MODULE_1__["default"])(touchEvent) || _eventListeners__WEBPACK_IMPORTED_MODULE_2__["default"].getModifierKey(); const defaultMousePrimary = toolGroup.getDefaultMousePrimary(); for (let j = 0; j < toolGroupToolNames.length; j++) { const toolName = toolGroupToolNames[j]; const toolOptions = toolGroup.toolOptions[toolName]; const correctBinding = toolOptions.bindings.length && toolOptions.bindings.some(binding => (binding.numTouchPoints === numTouchPoints || numTouchPoints === 1 && binding.mouseButton === defaultMousePrimary) && binding.modifierKey === modifierKey); if (toolOptions.mode === Active && correctBinding) { return toolGroup.getToolInstance(toolName); } } } /***/ }, /***/ 6501 /*!************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/shared/getMouseModifier.js ***! \************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../enums */ 64543); const getMouseModifierKey = evt => { if (evt.shiftKey) { if (evt.ctrlKey) { return _enums__WEBPACK_IMPORTED_MODULE_0__.KeyboardBindings.ShiftCtrl; } if (evt.altKey) { return _enums__WEBPACK_IMPORTED_MODULE_0__.KeyboardBindings.ShiftAlt; } if (evt.metaKey) { return _enums__WEBPACK_IMPORTED_MODULE_0__.KeyboardBindings.ShiftMeta; } return _enums__WEBPACK_IMPORTED_MODULE_0__.KeyboardBindings.Shift; } if (evt.ctrlKey) { if (evt.altKey) { return _enums__WEBPACK_IMPORTED_MODULE_0__.KeyboardBindings.CtrlAlt; } if (evt.metaKey) { return _enums__WEBPACK_IMPORTED_MODULE_0__.KeyboardBindings.CtrlMeta; } return _enums__WEBPACK_IMPORTED_MODULE_0__.KeyboardBindings.Ctrl; } if (evt.altKey) { return evt.metaKey && _enums__WEBPACK_IMPORTED_MODULE_0__.KeyboardBindings.AltMeta || _enums__WEBPACK_IMPORTED_MODULE_0__.KeyboardBindings.Alt; } if (evt.metaKey) { return _enums__WEBPACK_IMPORTED_MODULE_0__.KeyboardBindings.Meta; } return undefined; }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getMouseModifierKey); /***/ }, /***/ 90734 /*!********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/shared/getToolsWithActionsForKeyboardEvents.js ***! \********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getToolsWithModesForKeyboardEvent) /* harmony export */ }); /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../store/ToolGroupManager */ 43551); function getToolsWithModesForKeyboardEvent(evt, toolModes) { const toolsWithActions = new Map(); const { renderingEngineId, viewportId } = evt.detail; const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_0__["default"])(viewportId, renderingEngineId); if (!toolGroup) { return toolsWithActions; } const toolGroupToolNames = Object.keys(toolGroup.toolOptions); const key = evt.detail.key; for (let j = 0; j < toolGroupToolNames.length; j++) { const toolName = toolGroupToolNames[j]; const tool = toolGroup.getToolInstance(toolName); const actionsConfig = tool.configuration?.actions; if (!actionsConfig) { continue; } const actions = Object.values(actionsConfig); if (!actions?.length || !toolModes.includes(tool.mode)) { continue; } const action = actions.find(action => action.bindings?.some(binding => binding.key === key)); if (action) { toolsWithActions.set(tool, action); } } return toolsWithActions; } /***/ }, /***/ 43595 /*!****************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/shared/getToolsWithActionsForMouseEvent.js ***! \****************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getToolsWithActionsForMouseEvent) /* harmony export */ }); /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../eventListeners */ 6738); /* harmony import */ var _getMouseModifier__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getMouseModifier */ 6501); /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../store/ToolGroupManager */ 43551); function getToolsWithActionsForMouseEvent(evt, toolModes) { const toolsWithActions = new Map(); const { renderingEngineId, viewportId } = evt.detail; const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_2__["default"])(viewportId, renderingEngineId); if (!toolGroup) { return toolsWithActions; } const toolGroupToolNames = Object.keys(toolGroup.toolOptions); const defaultMousePrimary = toolGroup.getDefaultMousePrimary(); const mouseEvent = evt.detail.event; const mouseButton = mouseEvent?.buttons ?? defaultMousePrimary; const modifierKey = (0,_getMouseModifier__WEBPACK_IMPORTED_MODULE_1__["default"])(mouseEvent) || _eventListeners__WEBPACK_IMPORTED_MODULE_0__["default"].getModifierKey(); for (let j = 0; j < toolGroupToolNames.length; j++) { const toolName = toolGroupToolNames[j]; const tool = toolGroup.getToolInstance(toolName); const actionsConfig = tool.configuration?.actions ?? {}; const actions = Object.values(actionsConfig); if (!actions?.length || !toolModes.includes(tool.mode)) { continue; } const action = actions.find(action => action.bindings?.length && action.bindings.some(binding => binding.mouseButton === mouseButton && binding.modifierKey === modifierKey)); if (action) { toolsWithActions.set(tool, action); } } return toolsWithActions; } /***/ }, /***/ 34677 /*!**************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/shared/getToolsWithModesForMouseEvent.js ***! \**************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getToolsWithModesForMouseEvent) /* harmony export */ }); /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../store/ToolGroupManager */ 43551); function getToolsWithModesForMouseEvent(evt, modesFilter, evtButton) { const { renderingEngineId, viewportId } = evt.detail; const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_0__["default"])(viewportId, renderingEngineId); if (!toolGroup) { return []; } const enabledTools = []; const toolGroupToolNames = Object.keys(toolGroup.toolOptions); for (let j = 0; j < toolGroupToolNames.length; j++) { const toolName = toolGroupToolNames[j]; const tool = toolGroup.toolOptions[toolName]; const correctBinding = evtButton != null && tool.bindings.length && tool.bindings.some(binding => binding.mouseButton === evtButton); if (modesFilter.includes(tool.mode) && (!evtButton || correctBinding)) { const toolInstance = toolGroup.getToolInstance(toolName); enabledTools.push(toolInstance); } } return enabledTools; } /***/ }, /***/ 45950 /*!**************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/shared/getToolsWithModesForTouchEvent.js ***! \**************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getToolsWithModesForTouchEvent) /* harmony export */ }); /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../store/ToolGroupManager */ 43551); function getToolsWithModesForTouchEvent(evt, modesFilter, numTouchPoints) { const { renderingEngineId, viewportId } = evt.detail; const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_0__["default"])(viewportId, renderingEngineId); if (!toolGroup) { return []; } const enabledTools = []; const toolGroupToolNames = Object.keys(toolGroup.toolOptions); for (let j = 0; j < toolGroupToolNames.length; j++) { const toolName = toolGroupToolNames[j]; const tool = toolGroup.toolOptions[toolName]; const correctBinding = numTouchPoints != null && tool.bindings.length && tool.bindings.some(binding => binding.numTouchPoints === numTouchPoints); if (modesFilter.includes(tool.mode) && (!numTouchPoints || correctBinding)) { const toolInstance = toolGroup.getToolInstance(toolName); enabledTools.push(toolInstance); } } return enabledTools; } /***/ }, /***/ 45575 /*!*****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/touchEventHandlers/touchDrag.js ***! \*****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ touchDrag) /* harmony export */ }); /* harmony import */ var _shared_getActiveToolForTouchEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/getActiveToolForTouchEvent */ 26513); /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../store/state */ 90125); function touchDrag(evt) { if (_store_state__WEBPACK_IMPORTED_MODULE_1__.state.isInteractingWithTool) { return; } const activeTool = (0,_shared_getActiveToolForTouchEvent__WEBPACK_IMPORTED_MODULE_0__["default"])(evt); const noFoundToolOrDoesNotHaveTouchDragCallback = !activeTool || typeof activeTool.touchDragCallback !== 'function'; if (noFoundToolOrDoesNotHaveTouchDragCallback) { return; } activeTool.touchDragCallback(evt); } /***/ }, /***/ 98768 /*!****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/touchEventHandlers/touchEnd.js ***! \****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _shared_customCallbackHandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/customCallbackHandler */ 89931); const touchEnd = _shared_customCallbackHandler__WEBPACK_IMPORTED_MODULE_0__["default"].bind(null, 'Touch', 'touchEndCallback'); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (touchEnd); /***/ }, /***/ 5902 /*!******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/touchEventHandlers/touchPress.js ***! \******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _shared_customCallbackHandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/customCallbackHandler */ 89931); const touchPress = _shared_customCallbackHandler__WEBPACK_IMPORTED_MODULE_0__["default"].bind(null, 'Touch', 'touchPressCallback'); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (touchPress); /***/ }, /***/ 59281 /*!******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/touchEventHandlers/touchStart.js ***! \******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ touchStart) /* harmony export */ }); /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../store/state */ 90125); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../enums */ 92925); /* harmony import */ var _stateManagement_annotation_annotationSelection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../stateManagement/annotation/annotationSelection */ 1736); /* harmony import */ var _stateManagement_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../stateManagement/annotation/annotationLocking */ 11399); /* harmony import */ var _stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../stateManagement/annotation/annotationVisibility */ 97240); /* harmony import */ var _store_filterToolsWithMoveableHandles__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../store/filterToolsWithMoveableHandles */ 31433); /* harmony import */ var _store_filterToolsWithAnnotationsForElement__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../store/filterToolsWithAnnotationsForElement */ 55694); /* harmony import */ var _store_filterMoveableAnnotationTools__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../store/filterMoveableAnnotationTools */ 16945); /* harmony import */ var _shared_getActiveToolForTouchEvent__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../shared/getActiveToolForTouchEvent */ 26513); /* harmony import */ var _shared_getToolsWithModesForTouchEvent__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../shared/getToolsWithModesForTouchEvent */ 45950); const { Active, Passive } = _enums__WEBPACK_IMPORTED_MODULE_1__["default"]; function touchStart(evt) { if (_store_state__WEBPACK_IMPORTED_MODULE_0__.state.isInteractingWithTool) { return; } const activeTool = (0,_shared_getActiveToolForTouchEvent__WEBPACK_IMPORTED_MODULE_8__["default"])(evt); if (activeTool && typeof activeTool.preTouchStartCallback === 'function') { const consumedEvent = activeTool.preTouchStartCallback(evt); if (consumedEvent) { return; } } const allActiveTools = (0,_shared_getToolsWithModesForTouchEvent__WEBPACK_IMPORTED_MODULE_9__["default"])(evt, [Active]); const allPassiveTools = (0,_shared_getToolsWithModesForTouchEvent__WEBPACK_IMPORTED_MODULE_9__["default"])(evt, [Passive]); const applicableTools = [...(allActiveTools || []), ...(allPassiveTools || [])]; const eventDetail = evt.detail; const { element } = eventDetail; const annotationToolsWithAnnotations = (0,_store_filterToolsWithAnnotationsForElement__WEBPACK_IMPORTED_MODULE_6__["default"])(element, applicableTools); const canvasCoords = eventDetail.currentPoints.canvas; const annotationToolsWithMoveableHandles = (0,_store_filterToolsWithMoveableHandles__WEBPACK_IMPORTED_MODULE_5__["default"])(element, annotationToolsWithAnnotations, canvasCoords, 'touch'); const isMultiSelect = false; if (annotationToolsWithMoveableHandles.length > 0) { const { tool, annotation, handle } = getAnnotationForSelection(annotationToolsWithMoveableHandles); toggleAnnotationSelection(annotation.annotationUID, isMultiSelect); tool.handleSelectedCallback(evt, annotation, handle, 'Touch'); return; } const moveableAnnotationTools = (0,_store_filterMoveableAnnotationTools__WEBPACK_IMPORTED_MODULE_7__["default"])(element, annotationToolsWithAnnotations, canvasCoords, 'touch'); if (moveableAnnotationTools.length > 0) { const { tool, annotation } = getAnnotationForSelection(moveableAnnotationTools); toggleAnnotationSelection(annotation.annotationUID, isMultiSelect); tool.toolSelectedCallback(evt, annotation, 'Touch', canvasCoords); return; } if (activeTool && typeof activeTool.postTouchStartCallback === 'function') { const consumedEvent = activeTool.postTouchStartCallback(evt); if (consumedEvent) { return; } } } function getAnnotationForSelection(toolsWithMovableHandles) { return toolsWithMovableHandles.length > 1 && toolsWithMovableHandles.find(item => !(0,_stateManagement_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_3__.isAnnotationLocked)(item.annotation.annotationUID) && (0,_stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_4__.isAnnotationVisible)(item.annotation.annotationUID)) || toolsWithMovableHandles[0]; } function toggleAnnotationSelection(annotationUID, isMultiSelect = false) { if (isMultiSelect) { if ((0,_stateManagement_annotation_annotationSelection__WEBPACK_IMPORTED_MODULE_2__.isAnnotationSelected)(annotationUID)) { (0,_stateManagement_annotation_annotationSelection__WEBPACK_IMPORTED_MODULE_2__.setAnnotationSelected)(annotationUID, false); } else { const preserveSelected = true; (0,_stateManagement_annotation_annotationSelection__WEBPACK_IMPORTED_MODULE_2__.setAnnotationSelected)(annotationUID, true, preserveSelected); } } else { const preserveSelected = false; (0,_stateManagement_annotation_annotationSelection__WEBPACK_IMPORTED_MODULE_2__.setAnnotationSelected)(annotationUID, true, preserveSelected); } } /***/ }, /***/ 37716 /*!**************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/touchEventHandlers/touchStartActivate.js ***! \**************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ touchStartActivate) /* harmony export */ }); /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../store/state */ 90125); /* harmony import */ var _stateManagement_annotation_annotationSelection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../stateManagement/annotation/annotationSelection */ 1736); /* harmony import */ var _shared_getActiveToolForTouchEvent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shared/getActiveToolForTouchEvent */ 26513); function touchStartActivate(evt) { if (_store_state__WEBPACK_IMPORTED_MODULE_0__.state.isInteractingWithTool) { return; } const activeTool = (0,_shared_getActiveToolForTouchEvent__WEBPACK_IMPORTED_MODULE_2__["default"])(evt); if (!activeTool) { return; } if (_store_state__WEBPACK_IMPORTED_MODULE_0__.state.isMultiPartToolActive) { return; } if (activeTool.addNewAnnotation) { const annotation = activeTool.addNewAnnotation(evt, 'touch'); (0,_stateManagement_annotation_annotationSelection__WEBPACK_IMPORTED_MODULE_1__.setAnnotationSelected)(annotation.annotationUID); } } /***/ }, /***/ 45524 /*!****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/touchEventHandlers/touchTap.js ***! \****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _shared_customCallbackHandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../shared/customCallbackHandler */ 89931); const touchTap = _shared_customCallbackHandler__WEBPACK_IMPORTED_MODULE_0__["default"].bind(null, 'Touch', 'touchTapCallback'); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (touchTap); /***/ }, /***/ 55475 /*!*************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventDispatchers/touchToolEventDispatcher.js ***! \*************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../enums/Events */ 54870); /* harmony import */ var _touchEventHandlers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./touchEventHandlers */ 59281); /* harmony import */ var _touchEventHandlers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./touchEventHandlers */ 37716); /* harmony import */ var _touchEventHandlers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./touchEventHandlers */ 45575); /* harmony import */ var _touchEventHandlers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./touchEventHandlers */ 98768); /* harmony import */ var _touchEventHandlers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./touchEventHandlers */ 45524); /* harmony import */ var _touchEventHandlers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./touchEventHandlers */ 5902); const enable = function (element) { element.addEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].TOUCH_START, _touchEventHandlers__WEBPACK_IMPORTED_MODULE_1__["default"]); element.addEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].TOUCH_START_ACTIVATE, _touchEventHandlers__WEBPACK_IMPORTED_MODULE_2__["default"]); element.addEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].TOUCH_DRAG, _touchEventHandlers__WEBPACK_IMPORTED_MODULE_3__["default"]); element.addEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].TOUCH_END, _touchEventHandlers__WEBPACK_IMPORTED_MODULE_4__["default"]); element.addEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].TOUCH_TAP, _touchEventHandlers__WEBPACK_IMPORTED_MODULE_5__["default"]); element.addEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].TOUCH_PRESS, _touchEventHandlers__WEBPACK_IMPORTED_MODULE_6__["default"]); }; const disable = function (element) { element.removeEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].TOUCH_START, _touchEventHandlers__WEBPACK_IMPORTED_MODULE_1__["default"]); element.removeEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].TOUCH_START_ACTIVATE, _touchEventHandlers__WEBPACK_IMPORTED_MODULE_2__["default"]); element.removeEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].TOUCH_DRAG, _touchEventHandlers__WEBPACK_IMPORTED_MODULE_3__["default"]); element.removeEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].TOUCH_END, _touchEventHandlers__WEBPACK_IMPORTED_MODULE_4__["default"]); element.removeEventListener(_enums_Events__WEBPACK_IMPORTED_MODULE_0__["default"].TOUCH_PRESS, _touchEventHandlers__WEBPACK_IMPORTED_MODULE_6__["default"]); }; const touchToolEventDispatcher = { enable, disable }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (touchToolEventDispatcher); /***/ }, /***/ 11153 /*!**************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/annotations/annotationCompletedListener.js ***! \**************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ annotationCompletedListener) /* harmony export */ }); /* harmony import */ var _utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utilities/contourSegmentation */ 30323); /* harmony import */ var _contourSegmentation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contourSegmentation */ 90295); function annotationCompletedListener(evt) { const annotation = evt.detail.annotation; if (_utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_0__["default"](annotation)) { (0,_contourSegmentation__WEBPACK_IMPORTED_MODULE_1__["default"])(evt); } } /***/ }, /***/ 47729 /*!*************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/annotations/annotationModifiedListener.js ***! \*************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utilities/triggerAnnotationRenderForViewportIds */ 613); function annotationModifiedListener(evt) { const { viewportId } = evt.detail; (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_0__["default"])([viewportId]); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (annotationModifiedListener); /***/ }, /***/ 89848 /*!************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/annotations/annotationRemovedListener.js ***! \************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ annotationRemovedListener) /* harmony export */ }); /* harmony import */ var _utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utilities/contourSegmentation */ 30323); /* harmony import */ var _contourSegmentation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contourSegmentation */ 66910); function annotationRemovedListener(evt) { const annotation = evt.detail.annotation; if (_utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_0__["default"](annotation)) { (0,_contourSegmentation__WEBPACK_IMPORTED_MODULE_1__["default"])(evt); } } /***/ }, /***/ 85146 /*!**************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/annotations/annotationSelectionListener.js ***! \**************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 77569); /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utilities/triggerAnnotationRenderForViewportIds */ 613); function annotationSelectionListener(evt) { const deselectedAnnotation = evt.detail.removed; if (!deselectedAnnotation.length) { return; } const renderingEngines = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getRenderingEngines)(); renderingEngines.forEach(renderingEngine => { const viewports = renderingEngine.getViewports(); const viewportIds = viewports.map(vp => vp.id); (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_1__.triggerAnnotationRenderForViewportIds)(viewportIds); }); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (annotationSelectionListener); /***/ }, /***/ 90295 /*!***********************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationCompleted.js ***! \***********************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ contourSegmentationCompletedListener) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 28699); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _utilities_getViewportsForAnnotation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../utilities/getViewportsForAnnotation */ 7022); /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../stateManagement/annotation/annotationState */ 24703); /* harmony import */ var _utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../utilities/contourSegmentation */ 61057); /* harmony import */ var _utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../utilities/contourSegmentation */ 30323); /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../store/ToolGroupManager */ 43551); /* harmony import */ var _utilities_contourSegmentation_getIntersectingAnnotations__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../utilities/contourSegmentation/getIntersectingAnnotations */ 84327); /* harmony import */ var _utilities_contourSegmentation_mergeMultipleAnnotations__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../utilities/contourSegmentation/mergeMultipleAnnotations */ 21042); /* harmony import */ var _utilities_contourSegmentation_sharedOperations__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../utilities/contourSegmentation/sharedOperations */ 68267); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../enums */ 54870); const DEFAULT_CONTOUR_SEG_TOOL_NAME = 'PlanarFreehandContourSegmentationTool'; function contourSegmentationCompletedListener(_x) { return _contourSegmentationCompletedListener.apply(this, arguments); } function _contourSegmentationCompletedListener() { _contourSegmentationCompletedListener = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (evt) { const sourceAnnotation = evt.detail.annotation; if (!(0,_utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_6__["default"])(sourceAnnotation)) { return; } const viewport = getViewport(sourceAnnotation); const contourSegmentationAnnotations = getValidContourSegmentationAnnotations(viewport, sourceAnnotation); if (!contourSegmentationAnnotations.length) { (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"], _enums__WEBPACK_IMPORTED_MODULE_11__["default"].ANNOTATION_CUT_MERGE_PROCESS_COMPLETED, { element: viewport.element, sourceAnnotation }); return; } const sourcePolyline = (0,_utilities_contourSegmentation_sharedOperations__WEBPACK_IMPORTED_MODULE_10__.convertContourPolylineToCanvasSpace)(sourceAnnotation.data.contour.polyline, viewport); const intersectingContours = (0,_utilities_contourSegmentation_getIntersectingAnnotations__WEBPACK_IMPORTED_MODULE_8__.findAllIntersectingContours)(viewport, sourcePolyline, contourSegmentationAnnotations); if (!intersectingContours.length) { (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"], _enums__WEBPACK_IMPORTED_MODULE_11__["default"].ANNOTATION_CUT_MERGE_PROCESS_COMPLETED, { element: viewport.element, sourceAnnotation }); return; } if (intersectingContours.length > 1) { (0,_utilities_contourSegmentation_mergeMultipleAnnotations__WEBPACK_IMPORTED_MODULE_9__.processMultipleIntersections)(viewport, sourceAnnotation, sourcePolyline, intersectingContours); return; } const { targetAnnotation, targetPolyline, isContourHole } = intersectingContours[0]; if (isContourHole) { const { contourHoleProcessingEnabled = false } = evt.detail; if (!contourHoleProcessingEnabled) { return; } (0,_utilities_contourSegmentation_sharedOperations__WEBPACK_IMPORTED_MODULE_10__.createPolylineHole)(viewport, targetAnnotation, sourceAnnotation); } else { (0,_utilities_contourSegmentation_sharedOperations__WEBPACK_IMPORTED_MODULE_10__.combinePolylines)(viewport, targetAnnotation, targetPolyline, sourceAnnotation, sourcePolyline); } }); return _contourSegmentationCompletedListener.apply(this, arguments); } function isFreehandContourSegToolRegisteredForViewport(viewport, silent = false) { const toolName = 'PlanarFreehandContourSegmentationTool'; const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_7__["default"])(viewport.id, viewport.renderingEngineId); let errorMessage; if (!toolGroup) { errorMessage = `ToolGroup not found for viewport ${viewport.id}`; } else if (!toolGroup.hasTool(toolName)) { errorMessage = `Tool ${toolName} not added to ${toolGroup.id} toolGroup`; } else if (!toolGroup.getToolOptions(toolName)) { errorMessage = `Tool ${toolName} must be in active/passive state in ${toolGroup.id} toolGroup`; } if (errorMessage && !silent) { console.warn(errorMessage); } return !errorMessage; } function getViewport(annotation) { const viewports = (0,_utilities_getViewportsForAnnotation__WEBPACK_IMPORTED_MODULE_3__["default"])(annotation); const viewportWithToolRegistered = viewports.find(viewport => isFreehandContourSegToolRegisteredForViewport(viewport, true)); return viewportWithToolRegistered ?? viewports[0]; } function getValidContourSegmentationAnnotations(viewport, sourceAnnotation) { const { annotationUID: sourceAnnotationUID } = sourceAnnotation; const allAnnotations = (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__.getAllAnnotations)(); return allAnnotations.filter(targetAnnotation => targetAnnotation.annotationUID && targetAnnotation.annotationUID !== sourceAnnotationUID && (0,_utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_6__["default"])(targetAnnotation) && (0,_utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_5__["default"])(targetAnnotation, sourceAnnotation) && viewport.isReferenceViewable(targetAnnotation.metadata)); } /***/ }, /***/ 66910 /*!*********************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/annotations/contourSegmentation/contourSegmentationRemoved.js ***! \*********************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ contourSegmentationRemovedListener) /* harmony export */ }); /* harmony import */ var _utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../utilities/contourSegmentation */ 97379); function contourSegmentationRemovedListener(evt) { const annotation = evt.detail.annotation; (0,_utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_0__.removeContourSegmentationAnnotation)(annotation); } /***/ }, /***/ 6738 /*!*************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/keyboard/index.js ***! \*************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _keyDownListener__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./keyDownListener */ 19297); function enable(element) { disable(element); element.addEventListener('keydown', _keyDownListener__WEBPACK_IMPORTED_MODULE_0__["default"]); } function disable(element) { element.removeEventListener('keydown', _keyDownListener__WEBPACK_IMPORTED_MODULE_0__["default"]); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ enable, disable, getModifierKey: _keyDownListener__WEBPACK_IMPORTED_MODULE_0__.getModifierKey }); /***/ }, /***/ 19297 /*!***********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/keyboard/keyDownListener.js ***! \***********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ getModifierKey: () => (/* binding */ getModifierKey), /* harmony export */ resetModifierKey: () => (/* binding */ resetModifierKey) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/Events */ 54870); const defaultState = { renderingEngineId: undefined, viewportId: undefined, key: undefined, keyCode: undefined, element: null }; let state = { renderingEngineId: undefined, viewportId: undefined, key: undefined, keyCode: undefined, element: null }; function keyListener(evt) { state.element = evt.currentTarget; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(state.element); const { renderingEngineId, viewportId } = enabledElement; state.renderingEngineId = renderingEngineId; state.viewportId = viewportId; state.key = evt.key; state.keyCode = evt.keyCode; evt.preventDefault(); const eventDetail = { renderingEngineId: state.renderingEngineId, viewportId: state.viewportId, element: state.element, key: state.key, keyCode: state.keyCode }; (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(eventDetail.element, _enums_Events__WEBPACK_IMPORTED_MODULE_2__["default"].KEY_DOWN, eventDetail); document.addEventListener('keyup', _onKeyUp); document.addEventListener('visibilitychange', _onVisibilityChange); state.element.removeEventListener('keydown', keyListener); } function _onVisibilityChange() { document.removeEventListener('visibilitychange', _onVisibilityChange); if (document.visibilityState === 'hidden') { resetModifierKey(); } } function _onKeyUp(evt) { const eventDetail = { renderingEngineId: state.renderingEngineId, viewportId: state.viewportId, element: state.element, key: state.key, keyCode: state.keyCode }; document.removeEventListener('keyup', _onKeyUp); document.removeEventListener('visibilitychange', _onVisibilityChange); state.element.addEventListener('keydown', keyListener); state = structuredClone(defaultState); (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(eventDetail.element, _enums_Events__WEBPACK_IMPORTED_MODULE_2__["default"].KEY_UP, eventDetail); } function getModifierKey() { return state.keyCode; } function resetModifierKey() { state.keyCode = undefined; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (keyListener); /***/ }, /***/ 44948 /*!************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/mouse/getMouseEventPoints.js ***! \************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getMouseEventPoints) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); function getMouseEventPoints(evt, element) { const elementToUse = element || evt.currentTarget; const { viewport } = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(elementToUse) || {}; if (!viewport) { return; } const clientPoint = _clientToPoint(evt); const pagePoint = _pageToPoint(evt); const canvasPoint = _pagePointsToCanvasPoints(elementToUse, pagePoint); const worldPoint = viewport.canvasToWorld(canvasPoint); return { page: pagePoint, client: clientPoint, canvas: canvasPoint, world: worldPoint }; } function _pagePointsToCanvasPoints(element, pagePoint) { const rect = element.getBoundingClientRect(); return [pagePoint[0] - rect.left - window.pageXOffset, pagePoint[1] - rect.top - window.pageYOffset]; } function _pageToPoint(evt) { return [evt.pageX, evt.pageY]; } function _clientToPoint(evt) { return [evt.clientX, evt.clientY]; } /***/ }, /***/ 92582 /*!**********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/mouse/index.js ***! \**********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _mouseDoubleClickListener__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mouseDoubleClickListener */ 33814); /* harmony import */ var _mouseDownListener__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mouseDownListener */ 92313); /* harmony import */ var _mouseMoveListener__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mouseMoveListener */ 52548); function disable(element) { element.removeEventListener('dblclick', _mouseDoubleClickListener__WEBPACK_IMPORTED_MODULE_0__["default"]); element.removeEventListener('mousedown', _mouseDownListener__WEBPACK_IMPORTED_MODULE_1__["default"]); element.removeEventListener('mousemove', _mouseMoveListener__WEBPACK_IMPORTED_MODULE_2__["default"]); element.removeEventListener('dblclick', _mouseDownListener__WEBPACK_IMPORTED_MODULE_1__.mouseDoubleClickIgnoreListener, { capture: true }); } function enable(element) { disable(element); element.addEventListener('dblclick', _mouseDoubleClickListener__WEBPACK_IMPORTED_MODULE_0__["default"]); element.addEventListener('mousedown', _mouseDownListener__WEBPACK_IMPORTED_MODULE_1__["default"]); element.addEventListener('mousemove', _mouseMoveListener__WEBPACK_IMPORTED_MODULE_2__["default"]); element.addEventListener('dblclick', _mouseDownListener__WEBPACK_IMPORTED_MODULE_1__.mouseDoubleClickIgnoreListener, { capture: true }); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ enable, disable }); /***/ }, /***/ 33814 /*!*****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/mouse/mouseDoubleClickListener.js ***! \*****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/Events */ 54870); /* harmony import */ var _getMouseEventPoints__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getMouseEventPoints */ 44948); function mouseDoubleClickListener(evt) { const element = evt.currentTarget; const { viewportId, renderingEngineId } = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element); const startPoints = (0,_getMouseEventPoints__WEBPACK_IMPORTED_MODULE_3__["default"])(evt, element); const deltaPoints = { page: [0, 0], client: [0, 0], canvas: [0, 0], world: [0, 0, 0] }; const eventDetail = { event: evt, eventName: _enums_Events__WEBPACK_IMPORTED_MODULE_2__["default"].MOUSE_DOUBLE_CLICK, viewportId, renderingEngineId, camera: {}, element, startPoints, lastPoints: startPoints, currentPoints: startPoints, deltaPoints }; const consumed = !(0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(element, _enums_Events__WEBPACK_IMPORTED_MODULE_2__["default"].MOUSE_DOUBLE_CLICK, eventDetail); if (consumed) { evt.stopImmediatePropagation(); evt.preventDefault(); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mouseDoubleClickListener); /***/ }, /***/ 92313 /*!**********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/mouse/mouseDownListener.js ***! \**********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ getMouseButton: () => (/* binding */ getMouseButton), /* harmony export */ mouseDoubleClickIgnoreListener: () => (/* binding */ mouseDoubleClickIgnoreListener) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/Events */ 54870); /* harmony import */ var _mouseMoveListener__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mouseMoveListener */ 52548); /* harmony import */ var _getMouseEventPoints__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getMouseEventPoints */ 44948); const { MOUSE_DOWN, MOUSE_DOWN_ACTIVATE, MOUSE_CLICK, MOUSE_UP, MOUSE_DRAG } = _enums_Events__WEBPACK_IMPORTED_MODULE_2__["default"]; const DOUBLE_CLICK_TOLERANCE_MS = 400; const MULTI_BUTTON_TOLERANCE_MS = 150; const DOUBLE_CLICK_DRAG_TOLERANCE = 3; const defaultState = { mouseButton: undefined, element: null, renderingEngineId: undefined, viewportId: undefined, isClickEvent: true, clickDelay: 200, preventClickTimeout: null, startPoints: { page: [0, 0], client: [0, 0], canvas: [0, 0], world: [0, 0, 0] }, lastPoints: { page: [0, 0], client: [0, 0], canvas: [0, 0], world: [0, 0, 0] } }; let state = { mouseButton: undefined, renderingEngineId: undefined, viewportId: undefined, isClickEvent: true, clickDelay: 200, element: null, preventClickTimeout: null, startPoints: { page: [0, 0], client: [0, 0], canvas: [0, 0], world: [0, 0, 0] }, lastPoints: { page: [0, 0], client: [0, 0], canvas: [0, 0], world: [0, 0, 0] } }; const doubleClickState = { doubleClickTimeout: null, mouseDownEvent: null, mouseUpEvent: null, ignoreDoubleClick: false }; function mouseDownListener(evt) { if (doubleClickState.doubleClickTimeout) { if (evt.buttons === doubleClickState.mouseDownEvent.buttons) { return; } doubleClickState.mouseDownEvent = evt; _doStateMouseDownAndUp(); return; } doubleClickState.doubleClickTimeout = setTimeout(_doStateMouseDownAndUp, evt.buttons === 1 ? DOUBLE_CLICK_TOLERANCE_MS : MULTI_BUTTON_TOLERANCE_MS); doubleClickState.mouseDownEvent = evt; doubleClickState.ignoreDoubleClick = false; state.element = evt.currentTarget; state.mouseButton = evt.buttons; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(state.element); const { renderingEngineId, viewportId } = enabledElement; state.renderingEngineId = renderingEngineId; state.viewportId = viewportId; state.preventClickTimeout = setTimeout(_preventClickHandler, state.clickDelay); state.element.removeEventListener('mousemove', _mouseMoveListener__WEBPACK_IMPORTED_MODULE_3__["default"]); const startPoints = (0,_getMouseEventPoints__WEBPACK_IMPORTED_MODULE_4__["default"])(evt, state.element); state.startPoints = _copyPoints(startPoints); state.lastPoints = _copyPoints(startPoints); document.addEventListener('mouseup', _onMouseUp); document.addEventListener('mousemove', _onMouseDrag); } function _doMouseDown(evt) { const deltaPoints = _getDeltaPoints(state.startPoints, state.startPoints); const eventDetail = { event: evt, eventName: MOUSE_DOWN, element: state.element, mouseButton: state.mouseButton, renderingEngineId: state.renderingEngineId, viewportId: state.viewportId, camera: {}, startPoints: state.startPoints, lastPoints: state.startPoints, currentPoints: state.startPoints, deltaPoints }; state.lastPoints = _copyPoints(eventDetail.lastPoints); const notConsumed = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(eventDetail.element, MOUSE_DOWN, eventDetail); if (notConsumed) { (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(eventDetail.element, MOUSE_DOWN_ACTIVATE, eventDetail); } } function _onMouseDrag(evt) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(state.element); if (!enabledElement?.viewport) { return; } const currentPoints = (0,_getMouseEventPoints__WEBPACK_IMPORTED_MODULE_4__["default"])(evt, state.element); const lastPoints = _updateMouseEventsLastPoints(state.element, state.lastPoints); const deltaPoints = _getDeltaPoints(currentPoints, lastPoints); if (doubleClickState.doubleClickTimeout) { if (_isDragPastDoubleClickTolerance(deltaPoints.canvas)) { _doStateMouseDownAndUp(); } else { return; } } const eventDetail = { event: evt, eventName: MOUSE_DRAG, mouseButton: state.mouseButton, renderingEngineId: state.renderingEngineId, viewportId: state.viewportId, camera: {}, element: state.element, startPoints: _copyPoints(state.startPoints), lastPoints: _copyPoints(lastPoints), currentPoints, deltaPoints }; const consumed = !(0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(state.element, MOUSE_DRAG, eventDetail); if (consumed) { evt.stopImmediatePropagation(); evt.preventDefault(); } state.lastPoints = _copyPoints(currentPoints); } function _onMouseUp(evt) { clearTimeout(state.preventClickTimeout); if (doubleClickState.doubleClickTimeout) { if (!doubleClickState.mouseUpEvent) { doubleClickState.mouseUpEvent = evt; state.element.addEventListener('mousemove', _onMouseMove); } else { _cleanUp(); } } else { const eventName = state.isClickEvent ? MOUSE_CLICK : MOUSE_UP; const currentPoints = (0,_getMouseEventPoints__WEBPACK_IMPORTED_MODULE_4__["default"])(evt, state.element); const deltaPoints = _getDeltaPoints(currentPoints, state.lastPoints); const eventDetail = { event: evt, eventName, mouseButton: state.mouseButton, element: state.element, renderingEngineId: state.renderingEngineId, viewportId: state.viewportId, camera: {}, startPoints: _copyPoints(state.startPoints), lastPoints: _copyPoints(state.lastPoints), currentPoints, deltaPoints }; (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(eventDetail.element, eventName, eventDetail); _cleanUp(); } document.removeEventListener('mousemove', _onMouseDrag); } function _onMouseMove(evt) { const currentPoints = (0,_getMouseEventPoints__WEBPACK_IMPORTED_MODULE_4__["default"])(evt, state.element); const lastPoints = _updateMouseEventsLastPoints(state.element, state.lastPoints); const deltaPoints = _getDeltaPoints(currentPoints, lastPoints); if (!_isDragPastDoubleClickTolerance(deltaPoints.canvas)) { return; } _doStateMouseDownAndUp(); (0,_mouseMoveListener__WEBPACK_IMPORTED_MODULE_3__["default"])(evt); } function _isDragPastDoubleClickTolerance(delta) { return Math.abs(delta[0]) + Math.abs(delta[1]) > DOUBLE_CLICK_DRAG_TOLERANCE; } function _preventClickHandler() { state.isClickEvent = false; } function _doStateMouseDownAndUp() { doubleClickState.ignoreDoubleClick = true; const mouseDownEvent = doubleClickState.mouseDownEvent; const mouseUpEvent = doubleClickState.mouseUpEvent; _clearDoubleClickTimeoutAndEvents(); _doMouseDown(mouseDownEvent); if (mouseUpEvent) { _onMouseUp(mouseUpEvent); } } function _clearDoubleClickTimeoutAndEvents() { if (doubleClickState.doubleClickTimeout) { clearTimeout(doubleClickState.doubleClickTimeout); doubleClickState.doubleClickTimeout = null; } doubleClickState.mouseDownEvent = null; doubleClickState.mouseUpEvent = null; } function _cleanUp() { document.removeEventListener('mouseup', _onMouseUp); state.element?.removeEventListener('mousemove', _onMouseMove); state.element?.addEventListener('mousemove', _mouseMoveListener__WEBPACK_IMPORTED_MODULE_3__["default"]); _clearDoubleClickTimeoutAndEvents(); state = JSON.parse(JSON.stringify(defaultState)); } function _copyPoints(points) { return JSON.parse(JSON.stringify(points)); } function _updateMouseEventsLastPoints(element, lastPoints) { const { viewport } = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element) || {}; if (!viewport) { return lastPoints; } const world = viewport.canvasToWorld(lastPoints.canvas); return { page: lastPoints.page, client: lastPoints.client, canvas: lastPoints.canvas, world }; } function _getDeltaPoints(currentPoints, lastPoints) { if (!currentPoints || !lastPoints) { return { page: [0, 0], client: [0, 0], canvas: [0, 0], world: [0, 0, 0] }; } return { page: _subtractPoints2D(currentPoints.page, lastPoints.page), client: _subtractPoints2D(currentPoints.client, lastPoints.client), canvas: _subtractPoints2D(currentPoints.canvas, lastPoints.canvas), world: _subtractPoints3D(currentPoints.world, lastPoints.world) }; } function _subtractPoints2D(point0, point1) { return [point0[0] - point1[0], point0[1] - point1[1]]; } function _subtractPoints3D(point0, point1) { return [point0[0] - point1[0], point0[1] - point1[1], point0[2] - point1[2]]; } function getMouseButton() { return state.mouseButton; } function mouseDoubleClickIgnoreListener(evt) { if (doubleClickState.ignoreDoubleClick) { doubleClickState.ignoreDoubleClick = false; evt.stopImmediatePropagation(); evt.preventDefault(); } else { _cleanUp(); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mouseDownListener); /***/ }, /***/ 52548 /*!**********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/mouse/mouseMoveListener.js ***! \**********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/Events */ 54870); /* harmony import */ var _getMouseEventPoints__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getMouseEventPoints */ 44948); const eventName = _enums_Events__WEBPACK_IMPORTED_MODULE_2__["default"].MOUSE_MOVE; function mouseMoveListener(evt) { const element = evt.currentTarget; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element); if (!enabledElement) { return; } const { renderingEngineId, viewportId } = enabledElement; const currentPoints = (0,_getMouseEventPoints__WEBPACK_IMPORTED_MODULE_3__["default"])(evt); const eventDetail = { renderingEngineId, viewportId, camera: {}, element, currentPoints, eventName, event: evt }; const consumed = !(0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(element, eventName, eventDetail); if (consumed) { evt.stopImmediatePropagation(); evt.preventDefault(); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mouseMoveListener); /***/ }, /***/ 83170 /*!************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/segmentation/imageChangeEventListener.js ***! \************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _kitware_vtk_js_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @kitware/vtk.js/Common/Core/DataArray */ 40928); /* harmony import */ var _kitware_vtk_js_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @kitware/vtk.js/Common/DataModel/ImageData */ 56394); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 14566); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/core */ 19401); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @cornerstonejs/core */ 38277); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @cornerstonejs/core */ 99543); /* harmony import */ var _stateManagement_segmentation_SegmentationRenderingEngine__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../stateManagement/segmentation/SegmentationRenderingEngine */ 32598); /* harmony import */ var _stateManagement_segmentation_updateLabelmapSegmentationImageReferences__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../stateManagement/segmentation/updateLabelmapSegmentationImageReferences */ 74360); /* harmony import */ var _stateManagement_segmentation_getCurrentLabelmapImageIdForViewport__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../stateManagement/segmentation/getCurrentLabelmapImageIdForViewport */ 96340); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../enums */ 85543); /* harmony import */ var _stateManagement_segmentation_helpers_getSegmentationActor__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../stateManagement/segmentation/helpers/getSegmentationActor */ 82165); /* harmony import */ var _stateManagement_segmentation_getSegmentationRepresentation__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../stateManagement/segmentation/getSegmentationRepresentation */ 34625); const enable = function (element) { if (!element) { return; } const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__["default"])(element); if (!enabledElement) { return; } const { viewport } = enabledElement; if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__["default"]) { return; } element.addEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"].PRE_STACK_NEW_IMAGE, _imageChangeEventListener); element.addEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"].IMAGE_RENDERED, _imageChangeEventListener); }; const disable = function (element) { element.removeEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"].PRE_STACK_NEW_IMAGE, _imageChangeEventListener); element.removeEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"].IMAGE_RENDERED, _imageChangeEventListener); }; const perViewportManualTriggers = new Map(); function _imageChangeEventListener(evt) { const eventData = evt.detail; const { viewportId, renderingEngineId } = eventData; const { viewport } = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__.getEnabledElementByIds)(viewportId, renderingEngineId); const representations = (0,_stateManagement_segmentation_getSegmentationRepresentation__WEBPACK_IMPORTED_MODULE_12__.getSegmentationRepresentations)(viewportId); if (!representations?.length) { return; } const labelmapRepresentations = representations.filter(representation => representation.type === _enums__WEBPACK_IMPORTED_MODULE_10__["default"].Labelmap); const actors = viewport.getActors(); labelmapRepresentations.forEach(representation => { const { segmentationId } = representation; (0,_stateManagement_segmentation_updateLabelmapSegmentationImageReferences__WEBPACK_IMPORTED_MODULE_8__.updateLabelmapSegmentationImageReferences)(viewportId, segmentationId); }); const labelmapActors = labelmapRepresentations.flatMap(representation => { return (0,_stateManagement_segmentation_helpers_getSegmentationActor__WEBPACK_IMPORTED_MODULE_11__.getLabelmapActorEntries)(viewportId, representation.segmentationId); }).filter(actor => actor !== undefined); if (!labelmapActors.length) { return; } labelmapActors.forEach(actor => { const validActor = labelmapRepresentations.find(representation => { const derivedImageIds = (0,_stateManagement_segmentation_getCurrentLabelmapImageIdForViewport__WEBPACK_IMPORTED_MODULE_9__.getCurrentLabelmapImageIdsForViewport)(viewportId, representation.segmentationId); return derivedImageIds?.includes(actor.referencedId); }); if (!validActor) { viewport.removeActors([actor.uid]); } }); labelmapRepresentations.forEach(representation => { const { segmentationId } = representation; const currentImageId = viewport.getCurrentImageId(); const derivedImageIds = (0,_stateManagement_segmentation_getCurrentLabelmapImageIdForViewport__WEBPACK_IMPORTED_MODULE_9__.getCurrentLabelmapImageIdsForViewport)(viewportId, segmentationId); if (!derivedImageIds) { return; } let shouldTriggerSegmentationRender = false; const updateSegmentationActor = derivedImageId => { const derivedImage = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__["default"].getImage(derivedImageId); if (!derivedImage) { console.warn('No derived image found in the cache for segmentation representation', representation); return; } const segmentationActorInput = actors.find(actor => actor.referencedId === derivedImageId); if (!segmentationActorInput) { const { dimensions, spacing, direction } = viewport.getImageDataMetadata(derivedImage); const currentImage = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__["default"].getImage(currentImageId) || { imageId: currentImageId }; const { origin: currentOrigin } = viewport.getImageDataMetadata(currentImage); const originToUse = currentOrigin; const constructor = derivedImage.voxelManager.getConstructor(); const newPixelData = derivedImage.voxelManager.getScalarData(); const scalarArray = _kitware_vtk_js_Common_Core_DataArray__WEBPACK_IMPORTED_MODULE_0__["default"].newInstance({ name: 'Pixels', numberOfComponents: 1, values: new constructor(newPixelData) }); const imageData = _kitware_vtk_js_Common_DataModel_ImageData__WEBPACK_IMPORTED_MODULE_1__["default"].newInstance(); imageData.setDimensions(dimensions[0], dimensions[1], 1); imageData.setSpacing(spacing); imageData.setDirection(direction); imageData.setOrigin(originToUse); imageData.getPointData().setScalars(scalarArray); imageData.modified(); viewport.addImages([{ imageId: derivedImageId, representationUID: `${segmentationId}-${_enums__WEBPACK_IMPORTED_MODULE_10__["default"].Labelmap}-${derivedImage.imageId}`, callback: ({ imageActor }) => { imageActor.getMapper().setInputData(imageData); } }]); shouldTriggerSegmentationRender = true; return; } else { const segmentationImageData = segmentationActorInput.actor.getMapper().getInputData(); if (segmentationImageData.setDerivedImage) { segmentationImageData.setDerivedImage(derivedImage); } else { _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__.updateVTKImageDataWithCornerstoneImage(segmentationImageData, derivedImage); } } }; derivedImageIds.forEach(updateSegmentationActor); if (shouldTriggerSegmentationRender) { (0,_stateManagement_segmentation_SegmentationRenderingEngine__WEBPACK_IMPORTED_MODULE_7__.triggerSegmentationRender)(viewportId); } viewport.render(); if (evt.type === _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"].IMAGE_RENDERED) { viewport.element.removeEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"].IMAGE_RENDERED, _imageChangeEventListener); } }); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ enable, disable }); /***/ }, /***/ 48992 /*!*******************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/segmentation/labelmap/onLabelmapSegmentationDataModified.js ***! \*******************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 93667); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 67461); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../enums */ 85543); /* harmony import */ var _performVolumeLabelmapUpdate__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./performVolumeLabelmapUpdate */ 76364); /* harmony import */ var _performStackLabelmapUpdate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./performStackLabelmapUpdate */ 68834); /* harmony import */ var _stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../stateManagement/segmentation/getSegmentation */ 42952); /* harmony import */ var _stateManagement_segmentation_getViewportIdsWithSegmentation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../stateManagement/segmentation/getViewportIdsWithSegmentation */ 72370); const getViewportByViewportId = viewportId => { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.getEnabledElementByViewportId)(viewportId); return enabledElement?.viewport ?? undefined; }; const onLabelmapSegmentationDataModified = function (evt) { const { segmentationId, modifiedSlicesToUse } = evt.detail; const { representationData } = (0,_stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_6__.getSegmentation)(segmentationId); const viewportIds = (0,_stateManagement_segmentation_getViewportIdsWithSegmentation__WEBPACK_IMPORTED_MODULE_7__.getViewportIdsWithSegmentation)(segmentationId); const hasVolumeViewport = viewportIds.some(viewportId => { const viewport = getViewportByViewportId(viewportId); return viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"]; }); const hasStackViewport = viewportIds.some(viewportId => { const viewport = getViewportByViewportId(viewportId); return viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"]; }); const hasBothStackAndVolume = hasVolumeViewport && hasStackViewport; viewportIds.forEach(viewportId => { const viewport = getViewportByViewportId(viewportId); if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"]) { (0,_performVolumeLabelmapUpdate__WEBPACK_IMPORTED_MODULE_4__.performVolumeLabelmapUpdate)({ modifiedSlicesToUse: hasBothStackAndVolume ? [] : modifiedSlicesToUse, representationData, type: _enums__WEBPACK_IMPORTED_MODULE_3__["default"].Labelmap }); } if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"]) { (0,_performStackLabelmapUpdate__WEBPACK_IMPORTED_MODULE_5__.performStackLabelmapUpdate)({ viewportIds, segmentationId }); } }); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (onLabelmapSegmentationDataModified); /***/ }, /***/ 68834 /*!***********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/segmentation/labelmap/performStackLabelmapUpdate.js ***! \***********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ performStackLabelmapUpdate: () => (/* binding */ performStackLabelmapUpdate) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 93667); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 38277); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/core */ 99543); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../enums */ 85543); /* harmony import */ var _stateManagement_segmentation_helpers_getSegmentationActor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../stateManagement/segmentation/helpers/getSegmentationActor */ 82165); /* harmony import */ var _stateManagement_segmentation_getSegmentationRepresentation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../stateManagement/segmentation/getSegmentationRepresentation */ 34625); /* harmony import */ var _stateManagement_segmentation_getCurrentLabelmapImageIdForViewport__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../stateManagement/segmentation/getCurrentLabelmapImageIdForViewport */ 96340); function performStackLabelmapUpdate({ viewportIds, segmentationId }) { viewportIds.forEach(viewportId => { let representations = (0,_stateManagement_segmentation_getSegmentationRepresentation__WEBPACK_IMPORTED_MODULE_6__.getSegmentationRepresentations)(viewportId, { segmentationId }); representations = representations.filter(representation => representation.type === _enums__WEBPACK_IMPORTED_MODULE_4__["default"].Labelmap); representations.forEach(representation => { if (representation.segmentationId !== segmentationId) { return; } const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.getEnabledElementByViewportId)(viewportId); if (!enabledElement) { return; } const { viewport } = enabledElement; if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"]) { return; } const actorEntries = (0,_stateManagement_segmentation_helpers_getSegmentationActor__WEBPACK_IMPORTED_MODULE_5__.getLabelmapActorEntries)(viewportId, segmentationId); if (!actorEntries?.length) { return; } actorEntries.forEach((actorEntry, i) => { const segImageData = actorEntry.actor.getMapper().getInputData(); const currentSegmentationImageIds = (0,_stateManagement_segmentation_getCurrentLabelmapImageIdForViewport__WEBPACK_IMPORTED_MODULE_7__.getCurrentLabelmapImageIdsForViewport)(viewportId, segmentationId); const segmentationImage = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].getImage(currentSegmentationImageIds[i]); segImageData.modified(); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__.updateVTKImageDataWithCornerstoneImage(segImageData, segmentationImage); }); }); }); } /***/ }, /***/ 76364 /*!************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/segmentation/labelmap/performVolumeLabelmapUpdate.js ***! \************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ performVolumeLabelmapUpdate: () => (/* binding */ performVolumeLabelmapUpdate) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 38277); function performVolumeLabelmapUpdate({ modifiedSlicesToUse, representationData, type }) { const segmentationVolume = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].getVolume(representationData[type].volumeId); if (!segmentationVolume) { console.warn('segmentation not found in cache'); return; } const { imageData, vtkOpenGLTexture } = segmentationVolume; let slicesToUpdate; if (modifiedSlicesToUse?.length > 0) { slicesToUpdate = modifiedSlicesToUse; } else { const numSlices = imageData.getDimensions()[2]; slicesToUpdate = [...Array(numSlices).keys()]; } slicesToUpdate.forEach(i => { vtkOpenGLTexture.setUpdatedFrame(i); }); imageData.modified(); } /***/ }, /***/ 52446 /*!*************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/segmentation/segmentationDataModifiedEventListener.js ***! \*************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _stateManagement_segmentation_SegmentationRenderingEngine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stateManagement/segmentation/SegmentationRenderingEngine */ 32598); /* harmony import */ var _labelmap_onLabelmapSegmentationDataModified__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./labelmap/onLabelmapSegmentationDataModified */ 48992); /* harmony import */ var _stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../stateManagement/segmentation/getSegmentation */ 42952); const onSegmentationDataModified = function (evt) { const { segmentationId } = evt.detail; const { representationData } = (0,_stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_2__.getSegmentation)(segmentationId); if (representationData.Labelmap) { (0,_labelmap_onLabelmapSegmentationDataModified__WEBPACK_IMPORTED_MODULE_1__["default"])(evt); } (0,_stateManagement_segmentation_SegmentationRenderingEngine__WEBPACK_IMPORTED_MODULE_0__.triggerSegmentationRenderBySegmentationId)(segmentationId); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (onSegmentationDataModified); /***/ }, /***/ 83494 /*!*********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/segmentation/segmentationModifiedEventListener.js ***! \*********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _stateManagement_segmentation_SegmentationRenderingEngine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stateManagement/segmentation/SegmentationRenderingEngine */ 32598); const segmentationModifiedListener = function (evt) { const { segmentationId } = evt.detail; (0,_stateManagement_segmentation_SegmentationRenderingEngine__WEBPACK_IMPORTED_MODULE_0__.triggerSegmentationRenderBySegmentationId)(segmentationId); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (segmentationModifiedListener); /***/ }, /***/ 78599 /*!********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/segmentation/segmentationRemovedEventListener.js ***! \********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stateManagement/annotation/annotationState */ 24703); const segmentationRemovedListener = function (evt) { const { segmentationId } = evt.detail; const annotationsToRemove = (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__.getAllAnnotations)().filter(annotation => segmentationId === annotation?.data?.segmentation?.segmentationId); annotationsToRemove.forEach(annotation => { (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__.removeAnnotation)(annotation.annotationUID); }); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (segmentationRemovedListener); /***/ }, /***/ 43293 /*!******************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/segmentation/segmentationRepresentationModifiedListener.js ***! \******************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _stateManagement_segmentation_SegmentationRenderingEngine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stateManagement/segmentation/SegmentationRenderingEngine */ 32598); const segmentationRepresentationModifiedListener = function (evt) { const { viewportId } = evt.detail; (0,_stateManagement_segmentation_SegmentationRenderingEngine__WEBPACK_IMPORTED_MODULE_0__.triggerSegmentationRender)(viewportId); }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (segmentationRepresentationModifiedListener); /***/ }, /***/ 44444 /*!************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/touch/getTouchEventPoints.js ***! \************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getTouchEventPoints) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); function getTouchEventPoints(evt, element) { const elementToUse = element || evt.currentTarget; const touches = evt.type === 'touchend' ? evt.changedTouches : evt.touches; return Object.keys(touches).map(i => { const clientPoint = _clientToPoint(touches[i]); const pagePoint = _pageToPoint(touches[i]); const canvasPoint = _pagePointsToCanvasPoints(elementToUse, pagePoint); const { viewport } = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(elementToUse); const worldPoint = viewport.canvasToWorld(canvasPoint); return { page: pagePoint, client: clientPoint, canvas: canvasPoint, world: worldPoint, touch: { identifier: i, radiusX: touches[i].radiusX, radiusY: touches[i].radiusY, force: touches[i].force, rotationAngle: touches[i].rotationAngle } }; }); } function _pagePointsToCanvasPoints(element, pagePoint) { const rect = element.getBoundingClientRect(); return [pagePoint[0] - rect.left - window.pageXOffset, pagePoint[1] - rect.top - window.pageYOffset]; } function _pageToPoint(touch) { return [touch.pageX, touch.pageY]; } function _clientToPoint(touch) { return [touch.clientX, touch.clientY]; } /***/ }, /***/ 41026 /*!**********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/touch/index.js ***! \**********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _preventGhostClick__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./preventGhostClick */ 43489); /* harmony import */ var _touchStartListener__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./touchStartListener */ 72073); function disable(element) { _preventGhostClick__WEBPACK_IMPORTED_MODULE_0__["default"].disable(element); element.removeEventListener('touchstart', _touchStartListener__WEBPACK_IMPORTED_MODULE_1__["default"]); } function enable(element) { disable(element); _preventGhostClick__WEBPACK_IMPORTED_MODULE_0__["default"].enable(element); element.addEventListener('touchstart', _touchStartListener__WEBPACK_IMPORTED_MODULE_1__["default"], { passive: false }); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ enable, disable }); /***/ }, /***/ 43489 /*!**********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/touch/preventGhostClick.js ***! \**********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); const antiGhostDelay = 2000, pointerType = { mouse: 0, touch: 1 }; let lastInteractionType, lastInteractionTime; function handleTap(type, e) { const now = Date.now(); if (type !== lastInteractionType) { if (now - lastInteractionTime <= antiGhostDelay) { e.preventDefault(); e.stopPropagation(); e.stopImmediatePropagation(); return false; } lastInteractionType = type; } lastInteractionTime = now; } const handleTapMouse = handleTap.bind(null, pointerType.mouse); const handleTapTouch = handleTap.bind(null, pointerType.touch); function attachEvents(element, eventList, interactionType) { const tapHandler = interactionType ? handleTapMouse : handleTapTouch; eventList.forEach(function (eventName) { element.addEventListener(eventName, tapHandler, { passive: false }); }); } function removeEvents(element, eventList, interactionType) { const tapHandler = interactionType ? handleTapMouse : handleTapTouch; eventList.forEach(function (eventName) { element.removeEventListener(eventName, tapHandler); }); } const mouseEvents = ['mousedown', 'mouseup', 'mousemove']; const touchEvents = ['touchstart', 'touchend']; function disable(element) { removeEvents(element, mouseEvents, pointerType.mouse); removeEvents(element, touchEvents, pointerType.touch); } function enable(element) { disable(element); attachEvents(element, mouseEvents, pointerType.mouse); attachEvents(element, touchEvents, pointerType.touch); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ enable, disable }); /***/ }, /***/ 72073 /*!***********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/touch/touchStartListener.js ***! \***********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/Events */ 54870); /* harmony import */ var _enums_Touch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../enums/Touch */ 11232); /* harmony import */ var _getTouchEventPoints__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getTouchEventPoints */ 44444); /* harmony import */ var _utilities_touch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utilities/touch */ 11913); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @cornerstonejs/core */ 57889); const runtimeSettings = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__["default"].getRuntimeSettings(); const { TOUCH_START, TOUCH_START_ACTIVATE, TOUCH_PRESS, TOUCH_DRAG, TOUCH_END, TOUCH_TAP, TOUCH_SWIPE } = _enums_Events__WEBPACK_IMPORTED_MODULE_2__["default"]; const zeroIPoint = { page: [0, 0], client: [0, 0], canvas: [0, 0], world: [0, 0, 0] }; const zeroIDistance = { page: 0, client: 0, canvas: 0, world: 0 }; const defaultState = { renderingEngineId: undefined, viewportId: undefined, element: null, startPointsList: [{ ...zeroIPoint, touch: null }], lastPointsList: [{ ...zeroIPoint, touch: null }], isTouchStart: false, startTime: null, pressTimeout: null, pressDelay: 700, pressMaxDistance: 5, accumulatedDistance: zeroIDistance, swipeDistanceThreshold: 48, swiped: false, swipeToleranceMs: 300 }; const defaultTapState = { renderingEngineId: undefined, viewportId: undefined, element: null, startPointsList: [{ ...zeroIPoint, touch: null }], taps: 0, tapTimeout: null, tapMaxDistance: 24, tapToleranceMs: 300 }; let state = JSON.parse(JSON.stringify(defaultState)); let tapState = JSON.parse(JSON.stringify(defaultTapState)); function triggerEventCallback(ele, name, eventDetail) { return (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(ele, name, eventDetail); } function touchStartListener(evt) { state.element = evt.currentTarget; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(state.element); const { renderingEngineId, viewportId } = enabledElement; state.renderingEngineId = renderingEngineId; state.viewportId = viewportId; if (state.isTouchStart) { return; } clearTimeout(state.pressTimeout); state.pressTimeout = setTimeout(() => _onTouchPress(evt), state.pressDelay); _onTouchStart(evt); document.addEventListener('touchmove', _onTouchDrag); document.addEventListener('touchend', _onTouchEnd); } function _onTouchPress(evt) { const totalDistance = state.accumulatedDistance.canvas; if (totalDistance > state.pressMaxDistance) { return; } const eventDetail = { event: evt, eventName: TOUCH_PRESS, renderingEngineId: state.renderingEngineId, viewportId: state.viewportId, camera: {}, element: state.element, startPointsList: (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.copyPointsList)(state.startPointsList), lastPointsList: (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.copyPointsList)(state.lastPointsList), startPoints: (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.copyPoints)((0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.getMeanTouchPoints)(state.startPointsList)), lastPoints: (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.copyPoints)((0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.getMeanTouchPoints)(state.lastPointsList)) }; triggerEventCallback(eventDetail.element, TOUCH_PRESS, eventDetail); } function _onTouchStart(evt) { state.isTouchStart = true; state.startTime = new Date(); const startPointsList = (0,_getTouchEventPoints__WEBPACK_IMPORTED_MODULE_4__["default"])(evt, state.element); const startPoints = (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.getMeanTouchPoints)(startPointsList); const deltaPoints = zeroIPoint; const deltaDistance = zeroIDistance; const eventDetail = { event: evt, eventName: TOUCH_START, element: state.element, renderingEngineId: state.renderingEngineId, viewportId: state.viewportId, camera: {}, startPointsList: startPointsList, lastPointsList: startPointsList, currentPointsList: startPointsList, startPoints: startPoints, lastPoints: startPoints, currentPoints: startPoints, deltaPoints, deltaDistance }; state.startPointsList = (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.copyPointsList)(eventDetail.startPointsList); state.lastPointsList = (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.copyPointsList)(eventDetail.lastPointsList); const eventDidPropagate = triggerEventCallback(eventDetail.element, TOUCH_START, eventDetail); if (eventDidPropagate) { triggerEventCallback(eventDetail.element, TOUCH_START_ACTIVATE, eventDetail); } } function _onTouchDrag(evt) { const currentPointsList = (0,_getTouchEventPoints__WEBPACK_IMPORTED_MODULE_4__["default"])(evt, state.element); const lastPointsList = _updateTouchEventsLastPoints(state.element, state.lastPointsList); const deltaPoints = currentPointsList.length === lastPointsList.length ? (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.getDeltaPoints)(currentPointsList, lastPointsList) : zeroIPoint; const deltaDistance = currentPointsList.length === lastPointsList.length ? (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.getDeltaDistanceBetweenIPoints)(currentPointsList, lastPointsList) : zeroIDistance; const totalDistance = currentPointsList.length === lastPointsList.length ? (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.getDeltaDistance)(currentPointsList, state.lastPointsList) : zeroIDistance; state.accumulatedDistance = { page: state.accumulatedDistance.page + totalDistance.page, client: state.accumulatedDistance.client + totalDistance.client, canvas: state.accumulatedDistance.canvas + totalDistance.canvas, world: state.accumulatedDistance.world + totalDistance.world }; const eventDetail = { event: evt, eventName: TOUCH_DRAG, renderingEngineId: state.renderingEngineId, viewportId: state.viewportId, camera: {}, element: state.element, startPoints: (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.getMeanTouchPoints)(state.startPointsList), lastPoints: (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.getMeanTouchPoints)(lastPointsList), currentPoints: (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.getMeanTouchPoints)(currentPointsList), startPointsList: (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.copyPointsList)(state.startPointsList), lastPointsList: (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.copyPointsList)(lastPointsList), currentPointsList, deltaPoints: deltaPoints, deltaDistance: deltaDistance }; triggerEventCallback(state.element, TOUCH_DRAG, eventDetail); _checkTouchSwipe(evt, deltaPoints); state.lastPointsList = (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.copyPointsList)(currentPointsList); } function _onTouchEnd(evt) { clearTimeout(state.pressTimeout); const currentPointsList = (0,_getTouchEventPoints__WEBPACK_IMPORTED_MODULE_4__["default"])(evt, state.element); const lastPointsList = _updateTouchEventsLastPoints(state.element, state.lastPointsList); const deltaPoints = currentPointsList.length === lastPointsList.length ? (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.getDeltaPoints)(currentPointsList, lastPointsList) : (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.getDeltaPoints)(currentPointsList, currentPointsList); const deltaDistance = currentPointsList.length === lastPointsList.length ? (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.getDeltaDistanceBetweenIPoints)(currentPointsList, lastPointsList) : (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.getDeltaDistanceBetweenIPoints)(currentPointsList, currentPointsList); const eventDetail = { event: evt, eventName: TOUCH_END, element: state.element, renderingEngineId: state.renderingEngineId, viewportId: state.viewportId, camera: {}, startPointsList: (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.copyPointsList)(state.startPointsList), lastPointsList: (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.copyPointsList)(lastPointsList), currentPointsList, startPoints: (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.getMeanTouchPoints)(state.startPointsList), lastPoints: (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.getMeanTouchPoints)(lastPointsList), currentPoints: (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.getMeanTouchPoints)(currentPointsList), deltaPoints, deltaDistance }; triggerEventCallback(eventDetail.element, TOUCH_END, eventDetail); _checkTouchTap(evt); state = JSON.parse(JSON.stringify(defaultState)); document.removeEventListener('touchmove', _onTouchDrag); document.removeEventListener('touchend', _onTouchEnd); } function _checkTouchTap(evt) { const currentTime = new Date().getTime(); const startTime = state.startTime.getTime(); if (currentTime - startTime > tapState.tapToleranceMs) { return; } if (tapState.taps === 0) { tapState.element = state.element; tapState.renderingEngineId = state.renderingEngineId; tapState.viewportId = state.viewportId; tapState.startPointsList = state.startPointsList; } if (tapState.taps > 0 && !(tapState.element == state.element && tapState.renderingEngineId == state.renderingEngineId && tapState.viewportId == state.viewportId)) { return; } const currentPointsList = (0,_getTouchEventPoints__WEBPACK_IMPORTED_MODULE_4__["default"])(evt, tapState.element); const distanceFromStart = (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.getDeltaDistance)(currentPointsList, tapState.startPointsList).canvas; if (distanceFromStart > tapState.tapMaxDistance) { return; } clearTimeout(tapState.tapTimeout); tapState.taps += 1; tapState.tapTimeout = setTimeout(() => { const eventDetail = { event: evt, eventName: TOUCH_TAP, element: tapState.element, renderingEngineId: tapState.renderingEngineId, viewportId: tapState.viewportId, camera: {}, currentPointsList, currentPoints: (0,_utilities_touch__WEBPACK_IMPORTED_MODULE_5__.getMeanTouchPoints)(currentPointsList), taps: tapState.taps }; triggerEventCallback(eventDetail.element, TOUCH_TAP, eventDetail); tapState = JSON.parse(JSON.stringify(defaultTapState)); }, tapState.tapToleranceMs); } function _checkTouchSwipe(evt, deltaPoints) { const currentTime = new Date().getTime(); const startTime = state.startTime.getTime(); if (state.swiped || currentTime - startTime > state.swipeToleranceMs) { return; } const [x, y] = deltaPoints.canvas; const eventDetail = { event: evt, eventName: TOUCH_SWIPE, renderingEngineId: state.renderingEngineId, viewportId: state.viewportId, camera: {}, element: state.element, swipe: null }; if (Math.abs(x) > state.swipeDistanceThreshold) { eventDetail.swipe = x > 0 ? _enums_Touch__WEBPACK_IMPORTED_MODULE_3__.Swipe.RIGHT : _enums_Touch__WEBPACK_IMPORTED_MODULE_3__.Swipe.LEFT; triggerEventCallback(eventDetail.element, TOUCH_SWIPE, eventDetail); state.swiped = true; } if (Math.abs(y) > state.swipeDistanceThreshold) { eventDetail.swipe = y > 0 ? _enums_Touch__WEBPACK_IMPORTED_MODULE_3__.Swipe.DOWN : _enums_Touch__WEBPACK_IMPORTED_MODULE_3__.Swipe.UP; triggerEventCallback(eventDetail.element, TOUCH_SWIPE, eventDetail); state.swiped = true; } } function _updateTouchEventsLastPoints(element, lastPoints) { const { viewport } = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element); return lastPoints.map(lp => { const world = viewport.canvasToWorld(lp.canvas); return { page: lp.page, client: lp.client, canvas: lp.canvas, world, touch: lp.touch }; }); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (touchStartListener); /***/ }, /***/ 84602 /*!**********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/wheel/index.js ***! \**********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _wheelListener__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./wheelListener */ 14286); function enable(element) { disable(element); element.addEventListener('wheel', _wheelListener__WEBPACK_IMPORTED_MODULE_0__["default"], { passive: false }); } function disable(element) { element.removeEventListener('wheel', _wheelListener__WEBPACK_IMPORTED_MODULE_0__["default"]); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ enable, disable }); /***/ }, /***/ 4558 /*!*******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/wheel/normalizeWheel.js ***! \*******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ normalizeWheel) /* harmony export */ }); const PIXEL_STEP = 10; const LINE_HEIGHT = 40; const PAGE_HEIGHT = 800; function normalizeWheel(event) { let spinX = 0, spinY = 0, pixelX = 0, pixelY = 0; if ('detail' in event) { spinY = event.detail; } if ('wheelDelta' in event) { spinY = -event.wheelDelta / 120; } if ('wheelDeltaY' in event) { spinY = -event.wheelDeltaY / 120; } if ('wheelDeltaX' in event) { spinX = -event.wheelDeltaX / 120; } pixelX = spinX * PIXEL_STEP; pixelY = spinY * PIXEL_STEP; if ('deltaY' in event) { pixelY = event.deltaY; } if ('deltaX' in event) { pixelX = event.deltaX; } if ((pixelX || pixelY) && event.deltaMode) { if (event.deltaMode === 1) { pixelX *= LINE_HEIGHT; pixelY *= LINE_HEIGHT; } else { pixelX *= PAGE_HEIGHT; pixelY *= PAGE_HEIGHT; } } if (pixelX && !spinX) { spinX = pixelX < 1 ? -1 : 1; } if (pixelY && !spinY) { spinY = pixelY < 1 ? -1 : 1; } return { spinX, spinY, pixelX, pixelY }; } /***/ }, /***/ 14286 /*!******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/eventListeners/wheel/wheelListener.js ***! \******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _normalizeWheel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./normalizeWheel */ 4558); /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../enums/Events */ 54870); /* harmony import */ var _mouse_getMouseEventPoints__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../mouse/getMouseEventPoints */ 44948); function wheelListener(evt) { const element = evt.currentTarget; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element); const { renderingEngineId, viewportId } = enabledElement; if (evt.deltaY > -1 && evt.deltaY < 1) { return; } evt.preventDefault(); const { spinX, spinY, pixelX, pixelY } = (0,_normalizeWheel__WEBPACK_IMPORTED_MODULE_2__["default"])(evt); const direction = spinY < 0 ? -1 : 1; const eventDetail = { event: evt, eventName: _enums_Events__WEBPACK_IMPORTED_MODULE_3__["default"].MOUSE_WHEEL, renderingEngineId, viewportId, element, camera: {}, detail: evt, wheel: { spinX, spinY, pixelX, pixelY, direction }, points: (0,_mouse_getMouseEventPoints__WEBPACK_IMPORTED_MODULE_4__["default"])(evt) }; (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(element, _enums_Events__WEBPACK_IMPORTED_MODULE_3__["default"].MOUSE_WHEEL, eventDetail); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (wheelListener); /***/ }, /***/ 16974 /*!************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/init.js ***! \************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ destroy: () => (/* binding */ destroy), /* harmony export */ init: () => (/* binding */ init) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 14566); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 28699); /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./stateManagement/annotation/annotationState */ 24703); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./enums */ 54870); /* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./store */ 98896); /* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./store */ 3413); /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./store/state */ 90125); /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./eventListeners */ 11153); /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./eventListeners */ 52446); /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./eventListeners */ 85146); /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./eventListeners */ 83494); /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./eventListeners */ 47729); /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./eventListeners */ 89848); /* harmony import */ var _eventDispatchers__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./eventDispatchers */ 64647); /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./store/ToolGroupManager */ 19107); /* harmony import */ var _stateManagement_segmentation_SegmentationStateManager__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./stateManagement/segmentation/SegmentationStateManager */ 64790); /* harmony import */ var _eventListeners_segmentation_segmentationRepresentationModifiedListener__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./eventListeners/segmentation/segmentationRepresentationModifiedListener */ 43293); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./config */ 3690); /* harmony import */ var _eventListeners_segmentation_segmentationRemovedEventListener__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./eventListeners/segmentation/segmentationRemovedEventListener */ 78599); let csToolsInitialized = false; function init(defaultConfiguration = {}) { if (csToolsInitialized) { return; } (0,_config__WEBPACK_IMPORTED_MODULE_17__.setConfig)(defaultConfiguration); _addCornerstoneEventListeners(); _addCornerstoneToolsEventListeners(); csToolsInitialized = true; } function destroy() { _removeCornerstoneEventListeners(); _removeCornerstoneToolsEventListeners(); _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_14__["default"](); (0,_store_state__WEBPACK_IMPORTED_MODULE_6__.resetCornerstoneToolsState)(); const annotationManager = (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_2__.getAnnotationManager)(); const segmentationStateManager = _stateManagement_segmentation_SegmentationStateManager__WEBPACK_IMPORTED_MODULE_15__.defaultSegmentationStateManager; annotationManager.restoreAnnotations({}); segmentationStateManager.resetState(); csToolsInitialized = false; } function _addCornerstoneEventListeners() { _removeCornerstoneEventListeners(); const elementEnabledEvent = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].ELEMENT_ENABLED; const elementDisabledEvent = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].ELEMENT_DISABLED; _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].addEventListener(elementEnabledEvent, _store__WEBPACK_IMPORTED_MODULE_4__["default"]); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].addEventListener(elementDisabledEvent, _store__WEBPACK_IMPORTED_MODULE_5__["default"]); _eventDispatchers__WEBPACK_IMPORTED_MODULE_13__["default"].enable(); } function _removeCornerstoneEventListeners() { const elementEnabledEvent = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].ELEMENT_ENABLED; const elementDisabledEvent = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].ELEMENT_DISABLED; _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].removeEventListener(elementEnabledEvent, _store__WEBPACK_IMPORTED_MODULE_4__["default"]); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].removeEventListener(elementDisabledEvent, _store__WEBPACK_IMPORTED_MODULE_5__["default"]); _eventDispatchers__WEBPACK_IMPORTED_MODULE_13__["default"].disable(); } function _addCornerstoneToolsEventListeners() { _removeCornerstoneToolsEventListeners(); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].addEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].ANNOTATION_COMPLETED, _eventListeners__WEBPACK_IMPORTED_MODULE_7__["default"]); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].addEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].ANNOTATION_MODIFIED, _eventListeners__WEBPACK_IMPORTED_MODULE_11__["default"]); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].addEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].ANNOTATION_SELECTION_CHANGE, _eventListeners__WEBPACK_IMPORTED_MODULE_9__["default"]); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].addEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].ANNOTATION_SELECTION_CHANGE, _eventListeners__WEBPACK_IMPORTED_MODULE_9__["default"]); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].addEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].ANNOTATION_REMOVED, _eventListeners__WEBPACK_IMPORTED_MODULE_12__["default"]); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].addEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].SEGMENTATION_MODIFIED, _eventListeners__WEBPACK_IMPORTED_MODULE_10__["default"]); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].addEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].SEGMENTATION_DATA_MODIFIED, _eventListeners__WEBPACK_IMPORTED_MODULE_8__["default"]); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].addEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].SEGMENTATION_REPRESENTATION_MODIFIED, _eventListeners_segmentation_segmentationRepresentationModifiedListener__WEBPACK_IMPORTED_MODULE_16__["default"]); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].addEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].SEGMENTATION_REPRESENTATION_ADDED, _eventListeners_segmentation_segmentationRepresentationModifiedListener__WEBPACK_IMPORTED_MODULE_16__["default"]); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].addEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].SEGMENTATION_REMOVED, _eventListeners_segmentation_segmentationRemovedEventListener__WEBPACK_IMPORTED_MODULE_18__["default"]); } function _removeCornerstoneToolsEventListeners() { _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].ANNOTATION_COMPLETED, _eventListeners__WEBPACK_IMPORTED_MODULE_7__["default"]); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].ANNOTATION_MODIFIED, _eventListeners__WEBPACK_IMPORTED_MODULE_11__["default"]); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].ANNOTATION_SELECTION_CHANGE, _eventListeners__WEBPACK_IMPORTED_MODULE_9__["default"]); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].ANNOTATION_SELECTION_CHANGE, _eventListeners__WEBPACK_IMPORTED_MODULE_9__["default"]); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].ANNOTATION_REMOVED, _eventListeners__WEBPACK_IMPORTED_MODULE_12__["default"]); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].SEGMENTATION_MODIFIED, _eventListeners__WEBPACK_IMPORTED_MODULE_10__["default"]); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].SEGMENTATION_DATA_MODIFIED, _eventListeners__WEBPACK_IMPORTED_MODULE_8__["default"]); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].SEGMENTATION_REPRESENTATION_MODIFIED, _eventListeners_segmentation_segmentationRepresentationModifiedListener__WEBPACK_IMPORTED_MODULE_16__["default"]); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].SEGMENTATION_REPRESENTATION_ADDED, _eventListeners_segmentation_segmentationRepresentationModifiedListener__WEBPACK_IMPORTED_MODULE_16__["default"]); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].SEGMENTATION_REMOVED, _eventListeners_segmentation_segmentationRemovedEventListener__WEBPACK_IMPORTED_MODULE_18__["default"]); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (init); /***/ }, /***/ 18961 /*!**************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/AnnotationGroup.js ***! \**************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ AnnotationGroup) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 28699); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums/Events */ 54870); /* harmony import */ var _annotationState__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./annotationState */ 24703); class AnnotationGroup { constructor() { this.annotationUIDs = new Set(); this._isVisible = true; this.visibleFilter = this.unboundVisibleFilter.bind(this); } unboundVisibleFilter(uid) { return !this._isVisible || !this.annotationUIDs.has(uid); } has(uid) { return this.annotationUIDs.has(uid); } setVisible(isVisible = true, baseEvent, filter) { if (this._isVisible === isVisible) { return; } this._isVisible = isVisible; this.annotationUIDs.forEach(uid => { const annotation = (0,_annotationState__WEBPACK_IMPORTED_MODULE_3__.getAnnotation)(uid); if (!annotation) { this.annotationUIDs.delete(uid); return; } if (annotation.isVisible === isVisible) { return; } if (!isVisible && filter?.(uid) === false) { return; } annotation.isVisible = isVisible; const eventDetail = { ...baseEvent, annotation }; (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"], _enums_Events__WEBPACK_IMPORTED_MODULE_2__["default"].ANNOTATION_MODIFIED, eventDetail); }); } get isVisible() { return this._isVisible; } findNearby(uid, direction) { const uids = [...this.annotationUIDs]; if (uids.length === 0) { return null; } if (!uid) { return uids[direction === 1 ? 0 : uids.length - 1]; } const index = uids.indexOf(uid); if (index === -1 || index + direction < 0 || index + direction >= uids.length) { return null; } return uids[index + direction]; } add(...annotationUIDs) { annotationUIDs.forEach(annotationUID => this.annotationUIDs.add(annotationUID)); } remove(...annotationUIDs) { annotationUIDs.forEach(annotationUID => this.annotationUIDs.delete(annotationUID)); } clear() { this.annotationUIDs.clear(); } } /***/ }, /***/ 99024 /*!************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/AnnotationRenderingEngine.js ***! \************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ annotationRenderingEngine: () => (/* binding */ annotationRenderingEngine) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 77569); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../enums */ 92925); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../enums */ 54870); /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../drawingSvg */ 60321); /* harmony import */ var _utilities_getToolsWithModesForElement__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utilities/getToolsWithModesForElement */ 40685); const { Active, Passive, Enabled } = _enums__WEBPACK_IMPORTED_MODULE_3__["default"]; class AnnotationRenderingEngine { constructor() { this._needsRender = new Set(); this._animationFrameSet = false; this._animationFrameHandle = null; this._renderFlaggedViewports = () => { this._throwIfDestroyed(); const elements = Array.from(this._viewportElements.values()); for (let i = 0; i < elements.length; i++) { const element = elements[i]; if (this._needsRender.has(element)) { this._triggerRender(element); this._needsRender.delete(element); if (this._needsRender.size === 0) { break; } } } this._animationFrameSet = false; this._animationFrameHandle = null; this._render(); }; this._viewportElements = new Map(); } addViewportElement(viewportId, element) { this._viewportElements.set(viewportId, element); } removeViewportElement(viewportId, element) { this._viewportElements.delete(viewportId); this._needsRender.delete(element); this._reset(); } renderViewport(element) { this._setViewportsToBeRenderedNextFrame([element]); } _throwIfDestroyed() { if (this.hasBeenDestroyed) { throw new Error('this.destroy() has been manually called to free up memory, can not longer use this instance. Instead make a new one.'); } } _setAllViewportsToBeRenderedNextFrame() { const elements = [...this._viewportElements.values()]; elements.forEach(element => { this._needsRender.add(element); }); this._renderFlaggedViewports(); } _setViewportsToBeRenderedNextFrame(elements) { const elementsEnabled = [...this._viewportElements.values()]; elements.forEach(element => { if (elementsEnabled.indexOf(element) !== -1) { this._needsRender.add(element); } }); this._render(); } _render() { if (this._needsRender.size > 0 && this._animationFrameSet === false) { this._animationFrameHandle = window.requestAnimationFrame(this._renderFlaggedViewports); this._animationFrameSet = true; } } _triggerRender(element) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(element); if (!enabledElement) { return; } const renderingEngine = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getRenderingEngine)(enabledElement.renderingEngineId); if (!renderingEngine) { console.warn('rendering Engine has been destroyed'); return; } const enabledTools = (0,_utilities_getToolsWithModesForElement__WEBPACK_IMPORTED_MODULE_6__["default"])(element, [Active, Passive, Enabled]); const { renderingEngineId, viewportId } = enabledElement; const eventDetail = { element, renderingEngineId, viewportId }; (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_5__["default"])(element, svgDrawingHelper => { let anyRendered = false; const handleDrawSvg = tool => { if (tool.renderAnnotation) { const rendered = tool.renderAnnotation(enabledElement, svgDrawingHelper); anyRendered = anyRendered || rendered; } }; enabledTools.forEach(handleDrawSvg); if (anyRendered) { (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(element, _enums__WEBPACK_IMPORTED_MODULE_4__["default"].ANNOTATION_RENDERED, { ...eventDetail }); } }); } _reset() { window.cancelAnimationFrame(this._animationFrameHandle); this._needsRender.clear(); this._animationFrameSet = false; this._animationFrameHandle = null; this._setAllViewportsToBeRenderedNextFrame(); } } const annotationRenderingEngine = new AnnotationRenderingEngine(); /***/ }, /***/ 26394 /*!****************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/FrameOfReferenceSpecificAnnotationManager.js ***! \****************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ defaultFrameOfReferenceSpecificAnnotationManager: () => (/* binding */ defaultFrameOfReferenceSpecificAnnotationManager) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 14566); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 28699); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/core */ 29760); class FrameOfReferenceSpecificAnnotationManager { constructor(uid) { this.getGroupKey = annotationGroupSelector => { if (typeof annotationGroupSelector === 'string') { return annotationGroupSelector; } const element = annotationGroupSelector; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(element); if (!enabledElement) { throw new Error('Element not enabled, you must have an enabled element if you are not providing a FrameOfReferenceUID'); } return enabledElement.FrameOfReferenceUID; }; this._imageVolumeModifiedHandler = evt => { const eventDetail = evt.detail; const { FrameOfReferenceUID } = eventDetail; const annotations = this.annotations; const frameOfReferenceSpecificAnnotations = annotations[FrameOfReferenceUID]; if (!frameOfReferenceSpecificAnnotations) { return; } Object.keys(frameOfReferenceSpecificAnnotations).forEach(toolName => { const toolSpecificAnnotations = frameOfReferenceSpecificAnnotations[toolName]; toolSpecificAnnotations.forEach(annotation => { const invalidated = annotation.invalidated; if (invalidated !== undefined) { annotation.invalidated = true; } }); }); }; this.getFramesOfReference = () => { return Object.keys(this.annotations); }; this.getAnnotations = (groupKey, toolName) => { const annotations = this.annotations; if (!annotations[groupKey]) { return []; } if (toolName) { return annotations[groupKey][toolName] ? annotations[groupKey][toolName] : []; } return annotations[groupKey]; }; this.getAnnotation = annotationUID => { const annotations = this.annotations; for (const frameOfReferenceUID in annotations) { const frameOfReferenceAnnotations = annotations[frameOfReferenceUID]; for (const toolName in frameOfReferenceAnnotations) { const toolSpecificAnnotations = frameOfReferenceAnnotations[toolName]; for (const annotation of toolSpecificAnnotations) { if (annotationUID === annotation.annotationUID) { return annotation; } } } } }; this.getNumberOfAnnotations = (groupKey, toolName) => { const annotations = this.getAnnotations(groupKey, toolName); if (!annotations.length) { return 0; } if (toolName) { return annotations.length; } let total = 0; for (const toolName in annotations) { total += annotations[toolName].length; } return total; }; this.addAnnotation = (annotation, groupKey) => { const { metadata } = annotation; const { FrameOfReferenceUID, toolName } = metadata; groupKey = groupKey || FrameOfReferenceUID; const annotations = this.annotations; let frameOfReferenceSpecificAnnotations = annotations[groupKey]; if (!frameOfReferenceSpecificAnnotations) { annotations[groupKey] = {}; frameOfReferenceSpecificAnnotations = annotations[groupKey]; } let toolSpecificAnnotations = frameOfReferenceSpecificAnnotations[toolName]; if (!toolSpecificAnnotations) { frameOfReferenceSpecificAnnotations[toolName] = []; toolSpecificAnnotations = frameOfReferenceSpecificAnnotations[toolName]; } if (this.preprocessingFn) { annotation = this.preprocessingFn(annotation); } toolSpecificAnnotations.push(annotation); }; this.removeAnnotation = annotationUID => { const { annotations } = this; for (const groupKey in annotations) { const groupAnnotations = annotations[groupKey]; for (const toolName in groupAnnotations) { const toolAnnotations = groupAnnotations[toolName]; const index = toolAnnotations.findIndex(annotation => annotation.annotationUID === annotationUID); if (index !== -1) { toolAnnotations.splice(index, 1); if (toolAnnotations.length === 0) { delete groupAnnotations[toolName]; } } } if (Object.keys(groupAnnotations).length === 0) { delete annotations[groupKey]; } } }; this.removeAnnotations = (groupKey, toolName) => { const annotations = this.annotations; const removedAnnotations = []; if (!annotations[groupKey]) { return removedAnnotations; } if (toolName) { const annotationsForTool = annotations[groupKey][toolName]; if (annotationsForTool) { for (const annotation of annotationsForTool) { this.removeAnnotation(annotation.annotationUID); removedAnnotations.push(annotation); } } } else { for (const toolName in annotations[groupKey]) { const annotationsForTool = annotations[groupKey][toolName]; for (const annotation of annotationsForTool) { this.removeAnnotation(annotation.annotationUID); removedAnnotations.push(annotation); } } } return removedAnnotations; }; this.saveAnnotations = (groupKey, toolName) => { const annotations = this.annotations; if (groupKey && toolName) { const frameOfReferenceSpecificAnnotations = annotations[groupKey]; if (!frameOfReferenceSpecificAnnotations) { return; } const toolSpecificAnnotations = frameOfReferenceSpecificAnnotations[toolName]; return structuredClone(toolSpecificAnnotations); } else if (groupKey) { const frameOfReferenceSpecificAnnotations = annotations[groupKey]; return structuredClone(frameOfReferenceSpecificAnnotations); } return structuredClone(annotations); }; this.restoreAnnotations = (state, groupKey, toolName) => { const annotations = this.annotations; if (groupKey && toolName) { let frameOfReferenceSpecificAnnotations = annotations[groupKey]; if (!frameOfReferenceSpecificAnnotations) { annotations[groupKey] = {}; frameOfReferenceSpecificAnnotations = annotations[groupKey]; } frameOfReferenceSpecificAnnotations[toolName] = state; } else if (groupKey) { annotations[groupKey] = state; } else { this.annotations = structuredClone(state); } }; this.getAllAnnotations = () => { return Object.values(this.annotations).map(frameOfReferenceSpecificAnnotations => Object.values(frameOfReferenceSpecificAnnotations)).flat(2); }; this.getNumberOfAllAnnotations = () => { let count = 0; const annotations = this.annotations; for (const groupKey in annotations) { const frameOfReferenceSpecificAnnotations = annotations[groupKey]; for (const toolName in frameOfReferenceSpecificAnnotations) { const toolSpecificAnnotations = frameOfReferenceSpecificAnnotations[toolName]; count += toolSpecificAnnotations.length; } } return count; }; this.removeAllAnnotations = () => { const removedAnnotations = []; for (const annotation of this.getAllAnnotations()) { this.removeAnnotation(annotation.annotationUID); removedAnnotations.push(annotation); } return removedAnnotations; }; if (!uid) { uid = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__["default"](); } this.annotations = {}; this.uid = uid; _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].addEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].IMAGE_VOLUME_MODIFIED, this._imageVolumeModifiedHandler); } setPreprocessingFn(preprocessingFn) { this.preprocessingFn = preprocessingFn; } } const defaultFrameOfReferenceSpecificAnnotationManager = new FrameOfReferenceSpecificAnnotationManager('DEFAULT'); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FrameOfReferenceSpecificAnnotationManager); /***/ }, /***/ 11399 /*!****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/annotationLocking.js ***! \****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ checkAndSetAnnotationLocked: () => (/* binding */ checkAndSetAnnotationLocked), /* harmony export */ getAnnotationsLocked: () => (/* binding */ getAnnotationsLocked), /* harmony export */ getAnnotationsLockedCount: () => (/* binding */ getAnnotationsLockedCount), /* harmony export */ isAnnotationLocked: () => (/* binding */ isAnnotationLocked), /* harmony export */ setAnnotationLocked: () => (/* binding */ setAnnotationLocked), /* harmony export */ unlockAllAnnotations: () => (/* binding */ unlockAllAnnotations) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 28699); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums */ 54870); /* harmony import */ var _annotationState__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./annotationState */ 24703); const globalLockedAnnotationUIDsSet = new Set(); function setAnnotationLocked(annotationUID, locked = true) { const detail = makeEventDetail(); if (annotationUID) { if (locked) { lock(annotationUID, globalLockedAnnotationUIDsSet, detail); } else { unlock(annotationUID, globalLockedAnnotationUIDsSet, detail); } } publish(detail, globalLockedAnnotationUIDsSet); } function unlockAllAnnotations() { const detail = makeEventDetail(); clearLockedAnnotationsSet(globalLockedAnnotationUIDsSet, detail); publish(detail, globalLockedAnnotationUIDsSet); } function getAnnotationsLocked() { return Array.from(globalLockedAnnotationUIDsSet); } function isAnnotationLocked(annotationUID) { return globalLockedAnnotationUIDsSet.has(annotationUID); } function getAnnotationsLockedCount() { return globalLockedAnnotationUIDsSet.size; } function checkAndSetAnnotationLocked(annotationUID) { const isLocked = isAnnotationLocked(annotationUID); setAnnotationLocked(annotationUID, isLocked); return isLocked; } function makeEventDetail() { return Object.freeze({ added: [], removed: [], locked: [] }); } function lock(annotationUID, lockedAnnotationUIDsSet, detail) { if (!lockedAnnotationUIDsSet.has(annotationUID)) { lockedAnnotationUIDsSet.add(annotationUID); detail.added.push(annotationUID); const annotation = (0,_annotationState__WEBPACK_IMPORTED_MODULE_3__.getAnnotation)(annotationUID); if (annotation) { annotation.isLocked = true; } } } function unlock(annotationUID, lockedAnnotationUIDsSet, detail) { if (lockedAnnotationUIDsSet.delete(annotationUID)) { detail.removed.push(annotationUID); const annotation = (0,_annotationState__WEBPACK_IMPORTED_MODULE_3__.getAnnotation)(annotationUID); if (annotation) { annotation.isLocked = false; } } } function clearLockedAnnotationsSet(lockedAnnotationUIDsSet, detail) { lockedAnnotationUIDsSet.forEach(annotationUID => { unlock(annotationUID, lockedAnnotationUIDsSet, detail); }); } function publish(detail, lockedAnnotationUIDsSet) { if (detail.added.length > 0 || detail.removed.length > 0) { lockedAnnotationUIDsSet.forEach(item => void detail.locked.push(item)); (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"], _enums__WEBPACK_IMPORTED_MODULE_2__["default"].ANNOTATION_LOCK_CHANGE, detail); } } /***/ }, /***/ 1736 /*!******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/annotationSelection.js ***! \******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ deselectAnnotation: () => (/* binding */ deselectAnnotation), /* harmony export */ getAnnotationsSelected: () => (/* binding */ getAnnotationsSelected), /* harmony export */ getAnnotationsSelectedByToolName: () => (/* binding */ getAnnotationsSelectedByToolName), /* harmony export */ getAnnotationsSelectedCount: () => (/* binding */ getAnnotationsSelectedCount), /* harmony export */ isAnnotationSelected: () => (/* binding */ isAnnotationSelected), /* harmony export */ setAnnotationSelected: () => (/* binding */ setAnnotationSelected) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 28699); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums */ 54870); /* harmony import */ var _annotationState__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./annotationState */ 24703); const selectedAnnotationUIDs = new Set(); function setAnnotationSelected(annotationUID, selected = true, preserveSelected = false) { if (selected) { selectAnnotation(annotationUID, preserveSelected); } else { deselectAnnotation(annotationUID); } } function selectAnnotation(annotationUID, preserveSelected = false) { const detail = makeEventDetail(); if (!preserveSelected) { clearSelectionSet(selectedAnnotationUIDs, detail); const annotation = (0,_annotationState__WEBPACK_IMPORTED_MODULE_3__.getAnnotation)(annotationUID); if (annotation) { annotation.isSelected = true; } } if (annotationUID && !selectedAnnotationUIDs.has(annotationUID)) { selectedAnnotationUIDs.add(annotationUID); detail.added.push(annotationUID); const annotation = (0,_annotationState__WEBPACK_IMPORTED_MODULE_3__.getAnnotation)(annotationUID); if (annotation) { annotation.isSelected = true; } } publish(detail, selectedAnnotationUIDs); } function deselectAnnotation(annotationUID) { const detail = makeEventDetail(); if (annotationUID) { if (selectedAnnotationUIDs.delete(annotationUID)) { detail.removed.push(annotationUID); const annotation = (0,_annotationState__WEBPACK_IMPORTED_MODULE_3__.getAnnotation)(annotationUID); annotation.isSelected = false; } } else { clearSelectionSet(selectedAnnotationUIDs, detail); } publish(detail, selectedAnnotationUIDs); } function getAnnotationsSelected() { return Array.from(selectedAnnotationUIDs); } function getAnnotationsSelectedByToolName(toolName) { return getAnnotationsSelected().filter(annotationUID => { const annotation = (0,_annotationState__WEBPACK_IMPORTED_MODULE_3__.getAnnotation)(annotationUID); return annotation?.metadata?.toolName === toolName; }); } function isAnnotationSelected(annotationUID) { return selectedAnnotationUIDs.has(annotationUID); } function getAnnotationsSelectedCount() { return selectedAnnotationUIDs.size; } function makeEventDetail() { return Object.freeze({ added: [], removed: [], selection: [] }); } function clearSelectionSet(selectionSet, detail) { selectionSet.forEach(value => { if (selectionSet.delete(value)) { detail.removed.push(value); const annotation = (0,_annotationState__WEBPACK_IMPORTED_MODULE_3__.getAnnotation)(value); if (annotation) { annotation.isSelected = false; } } }); } function publish(detail, selectionSet) { if (detail.added.length > 0 || detail.removed.length > 0) { selectionSet.forEach(item => void detail.selection.push(item)); (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"], _enums__WEBPACK_IMPORTED_MODULE_2__["default"].ANNOTATION_SELECTION_CHANGE, detail); } } /***/ }, /***/ 24703 /*!**************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/annotationState.js ***! \**************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ addAnnotation: () => (/* binding */ addAnnotation), /* harmony export */ addChildAnnotation: () => (/* binding */ addChildAnnotation), /* harmony export */ clearParentAnnotation: () => (/* binding */ clearParentAnnotation), /* harmony export */ getAllAnnotations: () => (/* binding */ getAllAnnotations), /* harmony export */ getAnnotation: () => (/* binding */ getAnnotation), /* harmony export */ getAnnotationManager: () => (/* binding */ getAnnotationManager), /* harmony export */ getAnnotations: () => (/* binding */ getAnnotations), /* harmony export */ getChildAnnotations: () => (/* binding */ getChildAnnotations), /* harmony export */ getNumberOfAnnotations: () => (/* binding */ getNumberOfAnnotations), /* harmony export */ getParentAnnotation: () => (/* binding */ getParentAnnotation), /* harmony export */ invalidateAnnotation: () => (/* binding */ invalidateAnnotation), /* harmony export */ removeAllAnnotations: () => (/* binding */ removeAllAnnotations), /* harmony export */ removeAnnotation: () => (/* binding */ removeAnnotation), /* harmony export */ removeAnnotations: () => (/* binding */ removeAnnotations), /* harmony export */ setAnnotationManager: () => (/* binding */ setAnnotationManager) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 29760); /* harmony import */ var _helpers_state__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./helpers/state */ 9906); let defaultManager; function getAnnotationManager() { return defaultManager; } function setAnnotationManager(annotationManager) { defaultManager = annotationManager; } function getAnnotations(toolName, annotationGroupSelector) { const manager = getAnnotationManager(); const groupKey = manager.getGroupKey(annotationGroupSelector); return manager.getAnnotations(groupKey, toolName); } function getAnnotation(annotationUID) { const manager = getAnnotationManager(); return manager.getAnnotation(annotationUID); } function getAllAnnotations() { const manager = getAnnotationManager(); return manager.getAllAnnotations(); } function clearParentAnnotation(annotation) { const { annotationUID: childUID, parentAnnotationUID } = annotation; if (!parentAnnotationUID) { return; } const parentAnnotation = getAnnotation(parentAnnotationUID); const childUIDIndex = parentAnnotation.childAnnotationUIDs.indexOf(childUID); parentAnnotation.childAnnotationUIDs.splice(childUIDIndex, 1); annotation.parentAnnotationUID = undefined; } function addChildAnnotation(parentAnnotation, childAnnotation) { const { annotationUID: parentUID } = parentAnnotation; const { annotationUID: childUID } = childAnnotation; clearParentAnnotation(childAnnotation); if (!parentAnnotation.childAnnotationUIDs) { parentAnnotation.childAnnotationUIDs = []; } if (parentAnnotation.childAnnotationUIDs.includes(childUID)) { return; } parentAnnotation.childAnnotationUIDs.push(childUID); childAnnotation.parentAnnotationUID = parentUID; } function getParentAnnotation(annotation) { return annotation.parentAnnotationUID ? getAnnotation(annotation.parentAnnotationUID) : undefined; } function getChildAnnotations(annotation) { return annotation.childAnnotationUIDs?.map(childAnnotationUID => getAnnotation(childAnnotationUID)) ?? []; } function addAnnotation(annotation, annotationGroupSelector) { if (!annotation.annotationUID) { annotation.annotationUID = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"](); } const manager = getAnnotationManager(); if (annotationGroupSelector instanceof HTMLDivElement && (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(annotationGroupSelector)) { const groupKey = manager.getGroupKey(annotationGroupSelector); manager.addAnnotation(annotation, groupKey); (0,_helpers_state__WEBPACK_IMPORTED_MODULE_2__.triggerAnnotationAddedForElement)(annotation, annotationGroupSelector); } else { manager.addAnnotation(annotation, undefined); (0,_helpers_state__WEBPACK_IMPORTED_MODULE_2__.triggerAnnotationAddedForFOR)(annotation); } return annotation.annotationUID; } function getNumberOfAnnotations(toolName, annotationGroupSelector) { const manager = getAnnotationManager(); const groupKey = manager.getGroupKey(annotationGroupSelector); return manager.getNumberOfAnnotations(groupKey, toolName); } function removeAnnotation(annotationUID) { if (!annotationUID) { return; } const manager = getAnnotationManager(); const annotation = manager.getAnnotation(annotationUID); if (!annotation) { return; } annotation.childAnnotationUIDs?.forEach(childAnnotationUID => removeAnnotation(childAnnotationUID)); manager.removeAnnotation(annotationUID); (0,_helpers_state__WEBPACK_IMPORTED_MODULE_2__.triggerAnnotationRemoved)({ annotation, annotationManagerUID: manager.uid }); } function removeAllAnnotations() { const manager = getAnnotationManager(); const removedAnnotations = manager.removeAllAnnotations(); for (const annotation of removedAnnotations) { (0,_helpers_state__WEBPACK_IMPORTED_MODULE_2__.triggerAnnotationRemoved)({ annotation, annotationManagerUID: manager.uid }); } } function removeAnnotations(toolName, annotationGroupSelector) { const manager = getAnnotationManager(); const groupKey = manager.getGroupKey(annotationGroupSelector); const removedAnnotations = manager.removeAnnotations(groupKey, toolName); for (const annotation of removedAnnotations) { (0,_helpers_state__WEBPACK_IMPORTED_MODULE_2__.triggerAnnotationRemoved)({ annotation, annotationManagerUID: manager.uid }); } } function invalidateAnnotation(annotation) { let currAnnotation = annotation; while (currAnnotation) { currAnnotation.invalidated = true; currAnnotation = currAnnotation.parentAnnotationUID ? getAnnotation(currAnnotation.parentAnnotationUID) : undefined; } } /***/ }, /***/ 97240 /*!*******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/annotationVisibility.js ***! \*******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ checkAndSetAnnotationVisibility: () => (/* binding */ checkAndSetAnnotationVisibility), /* harmony export */ isAnnotationVisible: () => (/* binding */ isAnnotationVisible), /* harmony export */ setAnnotationVisibility: () => (/* binding */ setAnnotationVisibility), /* harmony export */ showAllAnnotations: () => (/* binding */ showAllAnnotations) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 28699); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums */ 54870); /* harmony import */ var _annotationSelection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./annotationSelection */ 1736); /* harmony import */ var _annotationState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./annotationState */ 24703); const globalHiddenAnnotationUIDsSet = new Set(); function setAnnotationVisibility(annotationUID, visible = true) { const detail = makeEventDetail(); if (annotationUID) { if (visible) { show(annotationUID, globalHiddenAnnotationUIDsSet, detail); } else { hide(annotationUID, globalHiddenAnnotationUIDsSet, detail); } } publish(detail); } function showAllAnnotations() { const detail = makeEventDetail(); globalHiddenAnnotationUIDsSet.forEach(annotationUID => { show(annotationUID, globalHiddenAnnotationUIDsSet, detail); }); publish(detail); } function isAnnotationVisible(annotationUID) { const annotation = (0,_annotationState__WEBPACK_IMPORTED_MODULE_4__.getAnnotation)(annotationUID); if (annotation) { return !globalHiddenAnnotationUIDsSet.has(annotationUID); } } function makeEventDetail() { return Object.freeze({ lastVisible: [], lastHidden: [], hidden: [] }); } function show(annotationUID, annotationUIDsSet, detail) { if (annotationUIDsSet.delete(annotationUID)) { detail.lastVisible.push(annotationUID); const annotation = (0,_annotationState__WEBPACK_IMPORTED_MODULE_4__.getAnnotation)(annotationUID); annotation.isVisible = true; } } function hide(annotationUID, annotationUIDsSet, detail) { if (!annotationUIDsSet.has(annotationUID)) { annotationUIDsSet.add(annotationUID); if ((0,_annotationSelection__WEBPACK_IMPORTED_MODULE_3__.isAnnotationSelected)(annotationUID)) { (0,_annotationSelection__WEBPACK_IMPORTED_MODULE_3__.deselectAnnotation)(annotationUID); } detail.lastHidden.push(annotationUID); const annotation = (0,_annotationState__WEBPACK_IMPORTED_MODULE_4__.getAnnotation)(annotationUID); annotation.isVisible = false; } } function publish(detail) { if (detail.lastHidden.length > 0 || detail.lastVisible.length > 0) { globalHiddenAnnotationUIDsSet.forEach(item => void detail.hidden.push(item)); (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"], _enums__WEBPACK_IMPORTED_MODULE_2__["default"].ANNOTATION_VISIBILITY_CHANGE, detail); } } function checkAndSetAnnotationVisibility(annotationUID) { const isVisible = !globalHiddenAnnotationUIDsSet.has(annotationUID); setAnnotationVisibility(annotationUID, isVisible); return isVisible; } /***/ }, /***/ 37356 /*!***************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/config/ToolStyle.js ***! \***************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); class ToolStyle { constructor() { const defaultConfig = { color: 'rgb(255, 255, 0)', colorHighlighted: 'rgb(0, 255, 0)', colorSelected: 'rgb(0, 220, 0)', colorLocked: 'rgb(209, 193, 90)', lineWidth: '1', lineDash: '', shadow: true, textBoxVisibility: true, textBoxFontFamily: 'Helvetica Neue, Helvetica, Arial, sans-serif', textBoxFontSize: '14px', textBoxColor: 'rgb(255, 255, 0)', textBoxColorHighlighted: 'rgb(0, 255, 0)', textBoxColorSelected: 'rgb(0, 255, 0)', textBoxColorLocked: 'rgb(209, 193, 90)', textBoxBackground: '', textBoxLinkLineWidth: '1', textBoxLinkLineDash: '2,3', textBoxShadow: true, markerSize: '10', angleArcLineDash: '' }; this._initializeConfig(defaultConfig); } getAnnotationToolStyles(annotationUID) { return this.config.annotations && this.config.annotations[annotationUID]; } getViewportToolStyles(viewportId) { return this.config.viewports && this.config.viewports[viewportId]; } getToolGroupToolStyles(toolGroupId) { return this.config.toolGroups && this.config.toolGroups[toolGroupId]; } getDefaultToolStyles() { return this.config.default; } setAnnotationStyles(annotationUID, styles) { let annotationSpecificStyles = this.config.annotations; if (!annotationSpecificStyles) { this.config = { ...this.config, annotations: {} }; annotationSpecificStyles = this.config.annotations; } annotationSpecificStyles[annotationUID] = styles; } setViewportToolStyles(viewportId, styles) { let viewportSpecificStyles = this.config.viewports; if (!viewportSpecificStyles) { this.config = { ...this.config, viewports: {} }; viewportSpecificStyles = this.config.viewports; } viewportSpecificStyles[viewportId] = styles; } setToolGroupToolStyles(toolGroupId, styles) { let toolGroupSpecificStyles = this.config.toolGroups; if (!toolGroupSpecificStyles) { this.config = { ...this.config, toolGroups: {} }; toolGroupSpecificStyles = this.config.toolGroups; } toolGroupSpecificStyles[toolGroupId] = styles; } setDefaultToolStyles(styles) { this.config.default = styles; } getStyleProperty(toolStyle, specifications) { const { annotationUID, viewportId, toolGroupId, toolName } = specifications; return this._getToolStyle(toolStyle, annotationUID, viewportId, toolGroupId, toolName); } _getToolStyle(property, annotationUID, viewportId, toolGroupId, toolName) { if (annotationUID) { const annotationToolStyles = this.getAnnotationToolStyles(annotationUID); if (annotationToolStyles) { if (annotationToolStyles[property] !== undefined) { return annotationToolStyles[property]; } } } if (viewportId) { const viewportToolStyles = this.getViewportToolStyles(viewportId); if (viewportToolStyles) { if (viewportToolStyles[toolName] && viewportToolStyles[toolName][property] !== undefined) { return viewportToolStyles[toolName][property]; } if (viewportToolStyles.global && viewportToolStyles.global[property] !== undefined) { return viewportToolStyles.global[property]; } } } if (toolGroupId) { const toolGroupToolStyles = this.getToolGroupToolStyles(toolGroupId); if (toolGroupToolStyles) { if (toolGroupToolStyles[toolName] && toolGroupToolStyles[toolName][property] !== undefined) { return toolGroupToolStyles[toolName][property]; } if (toolGroupToolStyles.global && toolGroupToolStyles.global[property] !== undefined) { return toolGroupToolStyles.global[property]; } } } const globalStyles = this.getDefaultToolStyles(); if (globalStyles[toolName] && globalStyles[toolName][property] !== undefined) { return globalStyles[toolName][property]; } if (globalStyles.global && globalStyles.global[property] !== undefined) { return globalStyles.global[property]; } } _initializeConfig(config) { const toolStyles = {}; for (const name in config) { toolStyles[name] = config[name]; } this.config = { default: { global: toolStyles } }; } } const toolStyle = new ToolStyle(); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (toolStyle); /***/ }, /***/ 48657 /*!*************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/config/getFont.js ***! \*************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _helpers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers */ 48421); function getFont(styleSpecifier, state, mode) { const fontSize = (0,_helpers__WEBPACK_IMPORTED_MODULE_0__.getStyleProperty)('textBoxFontSize', styleSpecifier, state, mode); const fontFamily = (0,_helpers__WEBPACK_IMPORTED_MODULE_0__.getStyleProperty)('textBoxFontFamily', styleSpecifier, state, mode); return `${fontSize}px ${fontFamily}`; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getFont); /***/ }, /***/ 68591 /*!**************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/config/getState.js ***! \**************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _annotationLocking__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../annotationLocking */ 11399); /* harmony import */ var _annotationSelection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../annotationSelection */ 1736); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../enums */ 16739); function getState(annotation) { if (annotation) { if (annotation.data && annotation.highlighted) { return _enums__WEBPACK_IMPORTED_MODULE_2__["default"].Highlighted; } if ((0,_annotationSelection__WEBPACK_IMPORTED_MODULE_1__.isAnnotationSelected)(annotation.annotationUID)) { return _enums__WEBPACK_IMPORTED_MODULE_2__["default"].Selected; } if ((0,_annotationLocking__WEBPACK_IMPORTED_MODULE_0__.isAnnotationLocked)(annotation.annotationUID)) { return _enums__WEBPACK_IMPORTED_MODULE_2__["default"].Locked; } if (annotation.data && annotation.autoGenerated) { return _enums__WEBPACK_IMPORTED_MODULE_2__["default"].AutoGenerated; } } return _enums__WEBPACK_IMPORTED_MODULE_2__["default"].Default; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getState); /***/ }, /***/ 48421 /*!*************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/config/helpers.js ***! \*************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getStyleProperty: () => (/* binding */ getStyleProperty) /* harmony export */ }); /* harmony import */ var _ToolStyle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ToolStyle */ 37356); function getHierarchalPropertyStyles(property, state, mode) { const list = [`${property}`]; if (state) { list.push(`${list[0]}${state}`); } if (mode) { list.push(`${list[list.length - 1]}${mode}`); } return list; } function getStyleProperty(property, styleSpecifier, state, mode) { const alternatives = getHierarchalPropertyStyles(property, state, mode); for (let i = alternatives.length - 1; i >= 0; --i) { const style = _ToolStyle__WEBPACK_IMPORTED_MODULE_0__["default"].getStyleProperty(alternatives[i], styleSpecifier); if (style !== undefined) { return style; } } } /***/ }, /***/ 14232 /*!***********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/config/index.js ***! \***********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getFont: () => (/* reexport safe */ _getFont__WEBPACK_IMPORTED_MODULE_1__["default"]), /* harmony export */ getState: () => (/* reexport safe */ _getState__WEBPACK_IMPORTED_MODULE_0__["default"]), /* harmony export */ style: () => (/* reexport safe */ _ToolStyle__WEBPACK_IMPORTED_MODULE_2__["default"]) /* harmony export */ }); /* harmony import */ var _getState__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getState */ 68591); /* harmony import */ var _getFont__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getFont */ 48657); /* harmony import */ var _ToolStyle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ToolStyle */ 37356); /***/ }, /***/ 9906 /*!************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/helpers/state.js ***! \************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ triggerAnnotationAddedForElement: () => (/* binding */ triggerAnnotationAddedForElement), /* harmony export */ triggerAnnotationAddedForFOR: () => (/* binding */ triggerAnnotationAddedForFOR), /* harmony export */ triggerAnnotationCompleted: () => (/* binding */ triggerAnnotationCompleted), /* harmony export */ triggerAnnotationModified: () => (/* binding */ triggerAnnotationModified), /* harmony export */ triggerAnnotationRemoved: () => (/* binding */ triggerAnnotationRemoved), /* harmony export */ triggerContourAnnotationCompleted: () => (/* binding */ triggerContourAnnotationCompleted) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 28699); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../enums */ 54870); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../enums */ 46190); /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../store/ToolGroupManager */ 69762); function triggerAnnotationAddedForElement(annotation, element) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(element); const { renderingEngine, viewportId } = enabledElement; const eventType = _enums__WEBPACK_IMPORTED_MODULE_3__["default"].ANNOTATION_ADDED; const eventDetail = { annotation, viewportId, renderingEngineId: renderingEngine.id }; (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"], eventType, eventDetail); } function triggerAnnotationAddedForFOR(annotation) { const { toolName } = annotation.metadata; const toolGroups = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_5__["default"])(toolName); if (!toolGroups.length) { return; } const viewportsToRender = []; toolGroups.forEach(toolGroup => { toolGroup.viewportsInfo.forEach(viewportInfo => { const { renderingEngineId, viewportId } = viewportInfo; const { FrameOfReferenceUID } = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.getEnabledElementByIds)(viewportId, renderingEngineId); if (annotation.metadata.FrameOfReferenceUID === FrameOfReferenceUID) { viewportsToRender.push(viewportInfo); } }); }); const eventType = _enums__WEBPACK_IMPORTED_MODULE_3__["default"].ANNOTATION_ADDED; const eventDetail = { annotation }; if (!viewportsToRender.length) { (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"], eventType, eventDetail); return; } viewportsToRender.forEach(({ renderingEngineId, viewportId }) => { eventDetail.viewportId = viewportId; eventDetail.renderingEngineId = renderingEngineId; (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"], eventType, eventDetail); }); } function triggerAnnotationRemoved(eventDetail) { const eventType = _enums__WEBPACK_IMPORTED_MODULE_3__["default"].ANNOTATION_REMOVED; (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"], eventType, eventDetail); } function triggerAnnotationModified(annotation, element, changeType = _enums__WEBPACK_IMPORTED_MODULE_4__["default"].HandlesUpdated) { const enabledElement = element && (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(element); const { viewportId, renderingEngineId } = enabledElement || {}; const eventType = _enums__WEBPACK_IMPORTED_MODULE_3__["default"].ANNOTATION_MODIFIED; const eventDetail = { annotation, viewportId, renderingEngineId, changeType }; (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"], eventType, eventDetail); } function triggerAnnotationCompleted(annotation) { const eventDetail = { annotation }; _triggerAnnotationCompleted(eventDetail); } function triggerContourAnnotationCompleted(annotation, contourHoleProcessingEnabled = false) { const eventDetail = { annotation, contourHoleProcessingEnabled }; _triggerAnnotationCompleted(eventDetail); } function _triggerAnnotationCompleted(eventDetail) { const eventType = _enums__WEBPACK_IMPORTED_MODULE_3__["default"].ANNOTATION_COMPLETED; (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"], eventType, eventDetail); } /***/ }, /***/ 38829 /*!****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/index.js ***! \****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AnnotationGroup: () => (/* reexport safe */ _AnnotationGroup__WEBPACK_IMPORTED_MODULE_7__["default"]), /* harmony export */ FrameOfReferenceSpecificAnnotationManager: () => (/* reexport safe */ _FrameOfReferenceSpecificAnnotationManager__WEBPACK_IMPORTED_MODULE_6__["default"]), /* harmony export */ config: () => (/* reexport module object */ _config__WEBPACK_IMPORTED_MODULE_0__), /* harmony export */ locking: () => (/* reexport module object */ _annotationLocking__WEBPACK_IMPORTED_MODULE_1__), /* harmony export */ selection: () => (/* reexport module object */ _annotationSelection__WEBPACK_IMPORTED_MODULE_2__), /* harmony export */ state: () => (/* binding */ state), /* harmony export */ visibility: () => (/* reexport module object */ _annotationVisibility__WEBPACK_IMPORTED_MODULE_5__) /* harmony export */ }); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./config */ 14232); /* harmony import */ var _annotationLocking__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./annotationLocking */ 11399); /* harmony import */ var _annotationSelection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./annotationSelection */ 1736); /* harmony import */ var _annotationState__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./annotationState */ 24703); /* harmony import */ var _helpers_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./helpers/state */ 9906); /* harmony import */ var _annotationVisibility__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./annotationVisibility */ 97240); /* harmony import */ var _FrameOfReferenceSpecificAnnotationManager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./FrameOfReferenceSpecificAnnotationManager */ 26394); /* harmony import */ var _AnnotationGroup__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./AnnotationGroup */ 18961); /* harmony import */ var _resetAnnotationManager__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./resetAnnotationManager */ 12976); const state = { ..._annotationState__WEBPACK_IMPORTED_MODULE_3__, ..._helpers_state__WEBPACK_IMPORTED_MODULE_4__, resetAnnotationManager: _resetAnnotationManager__WEBPACK_IMPORTED_MODULE_8__.resetAnnotationManager }; /***/ }, /***/ 12976 /*!*********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/resetAnnotationManager.js ***! \*********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ resetAnnotationManager: () => (/* binding */ resetAnnotationManager) /* harmony export */ }); /* harmony import */ var _utilities_defineProperties__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utilities/defineProperties */ 58106); /* harmony import */ var _annotationLocking__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./annotationLocking */ 11399); /* harmony import */ var _annotationVisibility__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./annotationVisibility */ 97240); /* harmony import */ var _FrameOfReferenceSpecificAnnotationManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./FrameOfReferenceSpecificAnnotationManager */ 26394); /* harmony import */ var _annotationState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./annotationState */ 24703); const defaultManager = _FrameOfReferenceSpecificAnnotationManager__WEBPACK_IMPORTED_MODULE_3__.defaultFrameOfReferenceSpecificAnnotationManager; const preprocessingFn = annotation => { annotation = (0,_utilities_defineProperties__WEBPACK_IMPORTED_MODULE_0__.checkAndDefineTextBoxProperty)(annotation); annotation = (0,_utilities_defineProperties__WEBPACK_IMPORTED_MODULE_0__.checkAndDefineCachedStatsProperty)(annotation); const uid = annotation.annotationUID; const isLocked = (0,_annotationLocking__WEBPACK_IMPORTED_MODULE_1__.checkAndSetAnnotationLocked)(uid); annotation.isLocked = isLocked; const isVisible = (0,_annotationVisibility__WEBPACK_IMPORTED_MODULE_2__.checkAndSetAnnotationVisibility)(uid); annotation.isVisible = isVisible; return annotation; }; defaultManager.setPreprocessingFn(preprocessingFn); (0,_annotationState__WEBPACK_IMPORTED_MODULE_4__.setAnnotationManager)(defaultManager); function resetAnnotationManager() { (0,_annotationState__WEBPACK_IMPORTED_MODULE_4__.setAnnotationManager)(defaultManager); } /***/ }, /***/ 58106 /*!*************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/annotation/utilities/defineProperties.js ***! \*************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ checkAndDefineCachedStatsProperty: () => (/* binding */ checkAndDefineCachedStatsProperty), /* harmony export */ checkAndDefineTextBoxProperty: () => (/* binding */ checkAndDefineTextBoxProperty) /* harmony export */ }); const checkAndDefineTextBoxProperty = annotation => { if (!annotation.data) { annotation.data = {}; } if (!annotation.data.handles) { annotation.data.handles = {}; } if (!annotation.data.handles.textBox) { annotation.data.handles.textBox = {}; } return annotation; }; const checkAndDefineCachedStatsProperty = annotation => { if (!annotation.data) { annotation.data = {}; } if (!annotation.data.cachedStats) { annotation.data.cachedStats = {}; } return annotation; }; /***/ }, /***/ 32598 /*!****************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/SegmentationRenderingEngine.js ***! \****************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ segmentationRenderingEngine: () => (/* binding */ segmentationRenderingEngine), /* harmony export */ triggerSegmentationRender: () => (/* binding */ triggerSegmentationRender), /* harmony export */ triggerSegmentationRenderBySegmentationId: () => (/* binding */ triggerSegmentationRenderBySegmentationId) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 14566); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 28699); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 77569); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../enums */ 54870); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../enums/SegmentationRepresentations */ 85543); /* harmony import */ var _getSegmentation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./getSegmentation */ 42952); /* harmony import */ var _getSegmentationRepresentation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./getSegmentationRepresentation */ 34625); /* harmony import */ var _tools_displayTools_Surface_surfaceDisplay__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../tools/displayTools/Surface/surfaceDisplay */ 67707); /* harmony import */ var _tools_displayTools_Contour_contourDisplay__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../tools/displayTools/Contour/contourDisplay */ 50011); /* harmony import */ var _tools_displayTools_Labelmap_labelmapDisplay__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../tools/displayTools/Labelmap/labelmapDisplay */ 86101); /* harmony import */ var _store_addTool__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../store/addTool */ 49541); /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../store/state */ 90125); /* harmony import */ var _tools_annotation_PlanarFreehandContourSegmentationTool__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../tools/annotation/PlanarFreehandContourSegmentationTool */ 57265); /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../store/ToolGroupManager */ 43551); /* harmony import */ var _segmentationEventManager__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./segmentationEventManager */ 57569); const renderers = { [_enums__WEBPACK_IMPORTED_MODULE_6__["default"].Labelmap]: _tools_displayTools_Labelmap_labelmapDisplay__WEBPACK_IMPORTED_MODULE_11__["default"], [_enums__WEBPACK_IMPORTED_MODULE_6__["default"].Contour]: _tools_displayTools_Contour_contourDisplay__WEBPACK_IMPORTED_MODULE_10__["default"], [_enums__WEBPACK_IMPORTED_MODULE_6__["default"].Surface]: _tools_displayTools_Surface_surfaceDisplay__WEBPACK_IMPORTED_MODULE_9__["default"] }; const planarContourToolName = _tools_annotation_PlanarFreehandContourSegmentationTool__WEBPACK_IMPORTED_MODULE_14__["default"].toolName; class SegmentationRenderingEngine { constructor() { this._needsRender = new Set(); this._pendingRenderQueue = []; this._animationFrameSet = false; this._animationFrameHandle = null; this._getAllViewports = () => { const renderingEngine = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.getRenderingEngines)(); return renderingEngine.flatMap(renderingEngine => renderingEngine.getViewports()); }; this._renderFlaggedSegmentations = () => { this._throwIfDestroyed(); const viewportIds = Array.from(this._needsRender); viewportIds.forEach(viewportId => { this._triggerRender(viewportId); }); this._needsRender.clear(); this._animationFrameSet = false; this._animationFrameHandle = null; if (this._pendingRenderQueue.length > 0) { const nextViewportIds = this._pendingRenderQueue.shift(); if (nextViewportIds && nextViewportIds.length > 0) { this._setViewportsToBeRenderedNextFrame(nextViewportIds); } } }; } renderSegmentationsForViewport(viewportId) { const viewportIds = viewportId ? [viewportId] : this._getViewportIdsForSegmentation(); this._setViewportsToBeRenderedNextFrame(viewportIds); } renderSegmentation(segmentationId) { const viewportIds = this._getViewportIdsForSegmentation(segmentationId); this._setViewportsToBeRenderedNextFrame(viewportIds); } _getViewportIdsForSegmentation(segmentationId) { const viewports = this._getAllViewports(); const viewportIds = []; for (const viewport of viewports) { const viewportId = viewport.id; if (segmentationId) { const segmentationRepresentations = (0,_getSegmentationRepresentation__WEBPACK_IMPORTED_MODULE_8__.getSegmentationRepresentations)(viewportId, { segmentationId }); if (segmentationRepresentations?.length > 0) { viewportIds.push(viewportId); } } else { const segmentationRepresentations = (0,_getSegmentationRepresentation__WEBPACK_IMPORTED_MODULE_8__.getSegmentationRepresentations)(viewportId); if (segmentationRepresentations?.length > 0) { viewportIds.push(viewportId); } } } return viewportIds; } _throwIfDestroyed() { if (this.hasBeenDestroyed) { throw new Error('this.destroy() has been manually called to free up memory, can not longer use this instance. Instead make a new one.'); } } _setViewportsToBeRenderedNextFrame(viewportIds) { if (this._animationFrameSet) { this._pendingRenderQueue.push(viewportIds); return; } viewportIds.forEach(viewportId => { this._needsRender.add(viewportId); }); this._render(); } _render() { if (this._needsRender.size > 0 && this._animationFrameSet === false) { this._animationFrameHandle = window.requestAnimationFrame(this._renderFlaggedSegmentations); this._animationFrameSet = true; } } _triggerRender(viewportId) { const segmentationRepresentations = (0,_getSegmentationRepresentation__WEBPACK_IMPORTED_MODULE_8__.getSegmentationRepresentations)(viewportId); if (!segmentationRepresentations?.length) { return; } const { viewport } = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__.getEnabledElementByViewportId)(viewportId) || {}; if (!viewport) { return; } const segmentationRenderList = segmentationRepresentations.map(representation => { if (representation.type === _enums__WEBPACK_IMPORTED_MODULE_6__["default"].Contour) { this._addPlanarFreeHandToolIfAbsent(viewport); } const display = renderers[representation.type]; const segmentation = (0,_getSegmentation__WEBPACK_IMPORTED_MODULE_7__.getSegmentation)(representation.segmentationId); const existingRepresentation = segmentation.representationData[representation.type] !== undefined; try { display.render(viewport, representation).then(() => { if (!existingRepresentation) { (0,_segmentationEventManager__WEBPACK_IMPORTED_MODULE_16__.addDefaultSegmentationListener)(viewport, representation.segmentationId, representation.type); } }); } catch (error) { console.error(error); } return Promise.resolve({ segmentationId: representation.segmentationId, type: representation.type }); }); Promise.allSettled(segmentationRenderList).then(results => { const segmentationDetails = results.filter(r => r.status === 'fulfilled').map(r => r.value); function onSegmentationRender(evt) { const { element, viewportId } = evt.detail; element.removeEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].IMAGE_RENDERED, onSegmentationRender); segmentationDetails.forEach(detail => { const eventDetail = { viewportId, segmentationId: detail.segmentationId, type: detail.type }; (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"], _enums__WEBPACK_IMPORTED_MODULE_5__["default"].SEGMENTATION_RENDERED, { ...eventDetail }); }); } const element = viewport.element; element.addEventListener(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].IMAGE_RENDERED, onSegmentationRender); viewport.render(); }); } _addPlanarFreeHandToolIfAbsent(viewport) { if (!(planarContourToolName in _store_state__WEBPACK_IMPORTED_MODULE_13__.state.tools)) { (0,_store_addTool__WEBPACK_IMPORTED_MODULE_12__.addTool)(_tools_annotation_PlanarFreehandContourSegmentationTool__WEBPACK_IMPORTED_MODULE_14__["default"]); } const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_15__["default"])(viewport.id); if (!toolGroup.hasTool(planarContourToolName)) { toolGroup.addTool(planarContourToolName); toolGroup.setToolPassive(planarContourToolName); } } } function triggerSegmentationRender(viewportId) { segmentationRenderingEngine.renderSegmentationsForViewport(viewportId); } function triggerSegmentationRenderBySegmentationId(segmentationId) { segmentationRenderingEngine.renderSegmentation(segmentationId); } const segmentationRenderingEngine = new SegmentationRenderingEngine(); /***/ }, /***/ 64790 /*!*************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/SegmentationStateManager.js ***! \*************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ SegmentationStateManager), /* harmony export */ defaultSegmentationStateManager: () => (/* binding */ defaultSegmentationStateManager), /* harmony export */ internalComputeVolumeLabelmapFromStack: () => (/* binding */ internalComputeVolumeLabelmapFromStack), /* harmony export */ internalConvertStackToVolumeLabelmap: () => (/* binding */ internalConvertStackToVolumeLabelmap) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 19401); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 38277); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @cornerstonejs/core */ 10372); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @cornerstonejs/core */ 29760); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @cornerstonejs/core */ 47858); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../enums */ 85543); /* harmony import */ var _kitware_vtk_js_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/ColorTransferFunction */ 15722); /* harmony import */ var _kitware_vtk_js_Common_DataModel_PiecewiseFunction__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @kitware/vtk.js/Common/DataModel/PiecewiseFunction */ 53173); /* harmony import */ var _triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./triggerSegmentationEvents */ 43815); /* harmony import */ var _triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./triggerSegmentationEvents */ 12218); /* harmony import */ var _triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./triggerSegmentationEvents */ 20566); /* harmony import */ var _triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./triggerSegmentationEvents */ 62005); /* harmony import */ var _SegmentationStyle__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./SegmentationStyle */ 21257); /* harmony import */ var _events_triggerSegmentationAdded__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./events/triggerSegmentationAdded */ 64948); const initialDefaultState = { colorLUT: [], segmentations: [], viewportSegRepresentations: {} }; class SegmentationStateManager { constructor(uid) { this._stackLabelmapImageIdReferenceMap = new Map(); this._labelmapImageIdReferenceMap = new Map(); uid ||= _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__["default"](); this.state = Object.freeze(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__.deepClone(initialDefaultState)); this.uid = uid; } getState() { return this.state; } updateState(updater) { const newState = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__.deepClone(this.state); updater(newState); this.state = Object.freeze(newState); } getColorLUT(lutIndex) { return this.state.colorLUT[lutIndex]; } getNextColorLUTIndex() { return this.state.colorLUT.length; } resetState() { this._stackLabelmapImageIdReferenceMap.clear(); this._labelmapImageIdReferenceMap.clear(); this.state = Object.freeze(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__.deepClone(initialDefaultState)); } getSegmentation(segmentationId) { return this.state.segmentations.find(segmentation => segmentation.segmentationId === segmentationId); } updateSegmentation(segmentationId, payload) { this.updateState(draftState => { const segmentation = draftState.segmentations.find(segmentation => segmentation.segmentationId === segmentationId); if (!segmentation) { console.warn(`Segmentation with id ${segmentationId} not found. Update aborted.`); return; } Object.assign(segmentation, payload); }); (0,_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_10__.triggerSegmentationModified)(segmentationId); } addSegmentation(segmentation) { if (this.getSegmentation(segmentation.segmentationId)) { throw new Error(`Segmentation with id ${segmentation.segmentationId} already exists`); } this.updateState(state => { const newSegmentation = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__.deepClone(segmentation); if (newSegmentation.representationData.Labelmap && 'volumeId' in newSegmentation.representationData.Labelmap && !('imageIds' in newSegmentation.representationData.Labelmap)) { const imageIds = this.getLabelmapImageIds(newSegmentation.representationData); newSegmentation.representationData.Labelmap.imageIds = imageIds; } state.segmentations.push(newSegmentation); }); (0,_events_triggerSegmentationAdded__WEBPACK_IMPORTED_MODULE_15__.triggerSegmentationAdded)(segmentation.segmentationId); } removeSegmentation(segmentationId) { this.updateState(state => { const filteredSegmentations = state.segmentations.filter(segmentation => segmentation.segmentationId !== segmentationId); state.segmentations.splice(0, state.segmentations.length, ...filteredSegmentations); }); (0,_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_11__.triggerSegmentationRemoved)(segmentationId); } addSegmentationRepresentation(viewportId, segmentationId, type, renderingConfig) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__.getEnabledElementByViewportId)(viewportId); if (!enabledElement) { return; } const existingRepresentations = this.getSegmentationRepresentations(viewportId, { type: type, segmentationId }); if (existingRepresentations.length > 0) { console.debug('A segmentation representation of type', type, 'already exists in viewport', viewportId, 'for segmentation', segmentationId); return; } this.updateState(state => { if (!state.viewportSegRepresentations[viewportId]) { state.viewportSegRepresentations[viewportId] = []; _SegmentationStyle__WEBPACK_IMPORTED_MODULE_14__.segmentationStyle.setRenderInactiveSegmentations(viewportId, true); } if (type !== _enums__WEBPACK_IMPORTED_MODULE_7__["default"].Labelmap) { this.addDefaultSegmentationRepresentation(state, viewportId, segmentationId, type, renderingConfig); } else { this.addLabelmapRepresentation(state, viewportId, segmentationId, renderingConfig); } }); (0,_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_12__.triggerSegmentationRepresentationModified)(viewportId, segmentationId, type); } addDefaultSegmentationRepresentation(state, viewportId, segmentationId, type, renderingConfig) { const segmentation = state.segmentations.find(segmentation => segmentation.segmentationId === segmentationId); if (!segmentation) { return; } const segmentReps = {}; Object.keys(segmentation.segments).forEach(segmentIndex => { segmentReps[Number(segmentIndex)] = { visible: true }; }); state.viewportSegRepresentations[viewportId].push({ segmentationId, type, active: true, visible: true, colorLUTIndex: renderingConfig?.colorLUTIndex || 0, segments: segmentReps, config: { ...getDefaultRenderingConfig(type), ...renderingConfig } }); this._setActiveSegmentation(state, viewportId, segmentationId); } addLabelmapRepresentation(state, viewportId, segmentationId, renderingConfig = getDefaultRenderingConfig(_enums__WEBPACK_IMPORTED_MODULE_7__["default"].Labelmap)) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__.getEnabledElementByViewportId)(viewportId); if (!enabledElement) { return; } const segmentation = this.getSegmentation(segmentationId); if (!segmentation) { return; } const { representationData } = segmentation; if (!representationData.Labelmap) { return this.addDefaultSegmentationRepresentation(state, viewportId, segmentationId, _enums__WEBPACK_IMPORTED_MODULE_7__["default"].Labelmap, renderingConfig); } this.processLabelmapRepresentationAddition(viewportId, segmentationId); this.addDefaultSegmentationRepresentation(state, viewportId, segmentationId, _enums__WEBPACK_IMPORTED_MODULE_7__["default"].Labelmap, renderingConfig); } processLabelmapRepresentationAddition(viewportId, segmentationId) { var _this = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__.getEnabledElementByViewportId)(viewportId); if (!enabledElement) { return; } const segmentation = _this.getSegmentation(segmentationId); if (!segmentation) { return; } const volumeViewport = enabledElement.viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"]; const { representationData } = segmentation; const isBaseVolumeSegmentation = 'volumeId' in representationData.Labelmap; const viewport = enabledElement.viewport; if (!volumeViewport && !isBaseVolumeSegmentation) { !_this.updateLabelmapSegmentationImageReferences(viewportId, segmentation.segmentationId); } })(); } _updateLabelmapSegmentationReferences(segmentationId, viewport, labelmapImageIds, updateCallback) { const referenceImageId = viewport.getCurrentImageId(); let viewableLabelmapImageIdFound = false; for (const labelmapImageId of labelmapImageIds) { const viewableImageId = viewport.isReferenceViewable({ referencedImageId: labelmapImageId }, { asOverlay: true }); if (viewableImageId) { viewableLabelmapImageIdFound = true; this._stackLabelmapImageIdReferenceMap.get(segmentationId).set(referenceImageId, labelmapImageId); this._updateLabelmapImageIdReferenceMap({ segmentationId, referenceImageId, labelmapImageId }); } } if (updateCallback) { updateCallback(viewport, segmentationId, labelmapImageIds); } return viewableLabelmapImageIdFound ? this._stackLabelmapImageIdReferenceMap.get(segmentationId).get(referenceImageId) : undefined; } updateLabelmapSegmentationImageReferences(viewportId, segmentationId) { const segmentation = this.getSegmentation(segmentationId); if (!segmentation) { return; } if (!this._stackLabelmapImageIdReferenceMap.has(segmentationId)) { this._stackLabelmapImageIdReferenceMap.set(segmentationId, new Map()); } const { representationData } = segmentation; if (!representationData.Labelmap) { return; } const labelmapImageIds = this.getLabelmapImageIds(representationData); const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__.getEnabledElementByViewportId)(viewportId); const stackViewport = enabledElement.viewport; return this._updateLabelmapSegmentationReferences(segmentationId, stackViewport, labelmapImageIds, null); } _updateAllLabelmapSegmentationImageReferences(viewportId, segmentationId) { const segmentation = this.getSegmentation(segmentationId); if (!segmentation) { return; } if (!this._stackLabelmapImageIdReferenceMap.has(segmentationId)) { this._stackLabelmapImageIdReferenceMap.set(segmentationId, new Map()); } const { representationData } = segmentation; if (!representationData.Labelmap) { return; } const labelmapImageIds = this.getLabelmapImageIds(representationData); const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__.getEnabledElementByViewportId)(viewportId); const stackViewport = enabledElement.viewport; this._updateLabelmapSegmentationReferences(segmentationId, stackViewport, labelmapImageIds, (stackViewport, segmentationId, labelmapImageIds) => { const imageIds = stackViewport.getImageIds(); imageIds.forEach((referenceImageId, index) => { for (const labelmapImageId of labelmapImageIds) { const viewableImageId = stackViewport.isReferenceViewable({ referencedImageId: labelmapImageId, sliceIndex: index }, { asOverlay: true, withNavigation: true }); if (viewableImageId) { this._stackLabelmapImageIdReferenceMap.get(segmentationId).set(referenceImageId, labelmapImageId); this._updateLabelmapImageIdReferenceMap({ segmentationId, referenceImageId, labelmapImageId }); } } }); }); } getLabelmapImageIds(representationData) { const labelmapData = representationData.Labelmap; let labelmapImageIds; if (labelmapData.imageIds) { labelmapImageIds = labelmapData.imageIds; } else if (!labelmapImageIds && labelmapData.volumeId) { const volumeId = labelmapData.volumeId; const volume = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"].getVolume(volumeId); labelmapImageIds = volume.imageIds; } return labelmapImageIds; } getLabelmapImageIdsForImageId(imageId, segmentationId) { const key = this._generateMapKey({ segmentationId, referenceImageId: imageId }); return this._labelmapImageIdReferenceMap.get(key); } getCurrentLabelmapImageIdsForViewport(viewportId, segmentationId) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__.getEnabledElementByViewportId)(viewportId); if (!enabledElement) { return; } const stackViewport = enabledElement.viewport; const referenceImageId = stackViewport.getCurrentImageId(); return this.getLabelmapImageIdsForImageId(referenceImageId, segmentationId); } getCurrentLabelmapImageIdForViewport(viewportId, segmentationId) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__.getEnabledElementByViewportId)(viewportId); if (!enabledElement) { return; } if (!this._stackLabelmapImageIdReferenceMap.has(segmentationId)) { return; } const stackViewport = enabledElement.viewport; const currentImageId = stackViewport.getCurrentImageId(); const imageIdReferenceMap = this._stackLabelmapImageIdReferenceMap.get(segmentationId); return imageIdReferenceMap.get(currentImageId); } getStackSegmentationImageIdsForViewport(viewportId, segmentationId) { const segmentation = this.getSegmentation(segmentationId); if (!segmentation) { return []; } this._updateAllLabelmapSegmentationImageReferences(viewportId, segmentationId); const { viewport } = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__.getEnabledElementByViewportId)(viewportId); const imageIds = viewport.getImageIds(); const associatedReferenceImageAndLabelmapImageIds = this._stackLabelmapImageIdReferenceMap.get(segmentationId); return imageIds.map(imageId => { return associatedReferenceImageAndLabelmapImageIds.get(imageId); }); } removeSegmentationRepresentationsInternal(viewportId, specifier) { const removedRepresentations = []; this.updateState(state => { if (!state.viewportSegRepresentations[viewportId]) { return; } const currentRepresentations = state.viewportSegRepresentations[viewportId]; let activeRepresentationRemoved = false; if (!specifier || Object.values(specifier).every(value => value === undefined)) { removedRepresentations.push(...currentRepresentations); delete state.viewportSegRepresentations[viewportId]; } else { const { segmentationId, type } = specifier; state.viewportSegRepresentations[viewportId] = currentRepresentations.filter(representation => { const shouldRemove = segmentationId && type && representation.segmentationId === segmentationId && representation.type === type || segmentationId && !type && representation.segmentationId === segmentationId || !segmentationId && type && representation.type === type; if (shouldRemove) { removedRepresentations.push(representation); if (representation.active) { activeRepresentationRemoved = true; } } return !shouldRemove; }); if (state.viewportSegRepresentations[viewportId].length === 0) { delete state.viewportSegRepresentations[viewportId]; } else if (activeRepresentationRemoved) { state.viewportSegRepresentations[viewportId][0].active = true; } } }); return removedRepresentations; } removeSegmentationRepresentations(viewportId, specifier) { const removedRepresentations = this.removeSegmentationRepresentationsInternal(viewportId, specifier); removedRepresentations.forEach(representation => { (0,_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_13__.triggerSegmentationRepresentationRemoved)(viewportId, representation.segmentationId, representation.type); }); const remainingRepresentations = this.getSegmentationRepresentations(viewportId); if (remainingRepresentations.length > 0 && remainingRepresentations[0].active) { (0,_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_12__.triggerSegmentationRepresentationModified)(viewportId, remainingRepresentations[0].segmentationId, remainingRepresentations[0].type); } return removedRepresentations; } removeSegmentationRepresentation(viewportId, specifier, suppressEvent) { const removedRepresentations = this.removeSegmentationRepresentationsInternal(viewportId, specifier); if (!suppressEvent) { removedRepresentations.forEach(({ segmentationId, type }) => { (0,_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_13__.triggerSegmentationRepresentationRemoved)(viewportId, segmentationId, type); }); } return removedRepresentations; } _updateLabelmapImageIdReferenceMap({ segmentationId, referenceImageId, labelmapImageId }) { const key = this._generateMapKey({ segmentationId, referenceImageId }); if (!this._labelmapImageIdReferenceMap.has(key)) { this._labelmapImageIdReferenceMap.set(key, [labelmapImageId]); return; } const currentValues = this._labelmapImageIdReferenceMap.get(key); const newValues = Array.from(new Set([...currentValues, labelmapImageId])); this._labelmapImageIdReferenceMap.set(key, newValues); } _setActiveSegmentation(state, viewportId, segmentationId) { const viewport = state.viewportSegRepresentations[viewportId]; if (!viewport) { return; } viewport.forEach(value => { value.active = value.segmentationId === segmentationId; }); } setActiveSegmentation(viewportId, segmentationId) { this.updateState(state => { const viewport = state.viewportSegRepresentations[viewportId]; if (!viewport) { return; } viewport.forEach(value => { value.active = value.segmentationId === segmentationId; }); }); (0,_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_12__.triggerSegmentationRepresentationModified)(viewportId, segmentationId); } getActiveSegmentation(viewportId) { if (!this.state.viewportSegRepresentations[viewportId]) { return; } const activeSegRep = this.state.viewportSegRepresentations[viewportId].find(segRep => segRep.active); if (!activeSegRep) { return; } return this.getSegmentation(activeSegRep.segmentationId); } getSegmentationRepresentations(viewportId, specifier = {}) { const viewportRepresentations = this.state.viewportSegRepresentations[viewportId]; if (!viewportRepresentations) { return []; } if (!specifier.type && !specifier.segmentationId) { return viewportRepresentations; } return viewportRepresentations.filter(representation => { const typeMatch = specifier.type ? representation.type === specifier.type : true; const idMatch = specifier.segmentationId ? representation.segmentationId === specifier.segmentationId : true; return typeMatch && idMatch; }); } getSegmentationRepresentation(viewportId, specifier) { return this.getSegmentationRepresentations(viewportId, specifier)[0]; } getSegmentationRepresentationVisibility(viewportId, specifier) { const viewportRepresentation = this.getSegmentationRepresentation(viewportId, specifier); return viewportRepresentation?.visible; } setSegmentationRepresentationVisibility(viewportId, specifier, visible) { this.updateState(state => { const viewportRepresentations = this.getSegmentationRepresentations(viewportId, specifier); if (!viewportRepresentations) { return; } viewportRepresentations.forEach(representation => { representation.visible = visible; Object.entries(representation.segments).forEach(([segmentIndex, segment]) => { segment.visible = visible; }); }); }); (0,_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_12__.triggerSegmentationRepresentationModified)(viewportId, specifier.segmentationId, specifier.type); } addColorLUT(colorLUT, lutIndex) { this.updateState(state => { if (state.colorLUT[lutIndex]) { console.warn('Color LUT table already exists, overwriting'); } state.colorLUT[lutIndex] = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__.deepClone(colorLUT); }); } removeColorLUT(colorLUTIndex) { this.updateState(state => { delete state.colorLUT[colorLUTIndex]; }); } _getStackIdForImageIds(imageIds) { return imageIds.map(imageId => imageId.slice(-Math.round(imageId.length * 0.15))).join('_'); } getAllViewportSegmentationRepresentations() { return Object.entries(this.state.viewportSegRepresentations).map(([viewportId, representations]) => ({ viewportId, representations })); } getSegmentationRepresentationsBySegmentationId(segmentationId) { const result = []; Object.entries(this.state.viewportSegRepresentations).forEach(([viewportId, viewportReps]) => { const filteredReps = viewportReps.filter(representation => representation.segmentationId === segmentationId); if (filteredReps.length > 0) { result.push({ viewportId, representations: filteredReps }); } }); return result; } _generateMapKey({ segmentationId, referenceImageId }) { return `${segmentationId}-${referenceImageId}`; } } function internalComputeVolumeLabelmapFromStack(_x) { return _internalComputeVolumeLabelmapFromStack.apply(this, arguments); } function _internalComputeVolumeLabelmapFromStack() { _internalComputeVolumeLabelmapFromStack = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* ({ imageIds, options }) { const segmentationImageIds = imageIds; const volumeId = options?.volumeId || _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__["default"](); yield _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.createAndCacheVolumeFromImages(volumeId, segmentationImageIds); return { volumeId }; }); return _internalComputeVolumeLabelmapFromStack.apply(this, arguments); } function internalConvertStackToVolumeLabelmap(_x2) { return _internalConvertStackToVolumeLabelmap.apply(this, arguments); } function _internalConvertStackToVolumeLabelmap() { _internalConvertStackToVolumeLabelmap = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* ({ segmentationId, options }) { const segmentation = defaultSegmentationStateManager.getSegmentation(segmentationId); const data = segmentation.representationData.Labelmap; const { volumeId } = yield internalComputeVolumeLabelmapFromStack({ imageIds: data.imageIds, options }); segmentation.representationData.Labelmap.volumeId = volumeId; }); return _internalConvertStackToVolumeLabelmap.apply(this, arguments); } function getDefaultRenderingConfig(type) { const cfun = _kitware_vtk_js_Rendering_Core_ColorTransferFunction__WEBPACK_IMPORTED_MODULE_8__["default"].newInstance(); const ofun = _kitware_vtk_js_Common_DataModel_PiecewiseFunction__WEBPACK_IMPORTED_MODULE_9__["default"].newInstance(); ofun.addPoint(0, 0); if (type === _enums__WEBPACK_IMPORTED_MODULE_7__["default"].Labelmap) { return { cfun, ofun }; } else { return {}; } } const defaultSegmentationStateManager = new SegmentationStateManager('DEFAULT'); /***/ }, /***/ 21257 /*!******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/SegmentationStyle.js ***! \******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ segmentationStyle: () => (/* binding */ segmentationStyle) /* harmony export */ }); /* harmony import */ var _tools_displayTools_Contour_contourConfig__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../tools/displayTools/Contour/contourConfig */ 57639); /* harmony import */ var _tools_displayTools_Labelmap_labelmapConfig__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../tools/displayTools/Labelmap/labelmapConfig */ 17461); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums */ 85543); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/core */ 59355); class SegmentationStyle { constructor() { this.config = { global: {}, segmentations: {}, viewportsStyle: {} }; } setStyle(specifier, styles, merge = true) { const { viewportId, segmentationId, type, segmentIndex } = specifier; const currentStyles = this.getStyle(specifier); const mergedStyles = merge ? { ...currentStyles, ...styles } : styles; let updatedStyles; if (!viewportId && !segmentationId) { updatedStyles = mergedStyles; } else if (merge) { updatedStyles = this.copyActiveToInactiveIfNotProvided(mergedStyles, type); } else { updatedStyles = mergedStyles; } if (!type) { throw new Error('Type is required to set a style'); } if (viewportId) { if (!this.config.viewportsStyle[viewportId]) { this.config.viewportsStyle[viewportId] = { renderInactiveSegmentations: false, representations: {} }; } const representations = this.config.viewportsStyle[viewportId].representations; if (segmentationId) { if (!representations[segmentationId]) { representations[segmentationId] = {}; } if (!representations[segmentationId][type]) { representations[segmentationId][type] = {}; } const repConfig = representations[segmentationId][type]; if (segmentIndex !== undefined) { if (!repConfig.perSegment) { repConfig.perSegment = {}; } repConfig.perSegment[segmentIndex] = updatedStyles; } else { repConfig.allSegments = updatedStyles; } } else { const ALL_SEGMENTATIONS_KEY = '__allSegmentations__'; if (!representations[ALL_SEGMENTATIONS_KEY]) { representations[ALL_SEGMENTATIONS_KEY] = {}; } if (!representations[ALL_SEGMENTATIONS_KEY][type]) { representations[ALL_SEGMENTATIONS_KEY][type] = {}; } representations[ALL_SEGMENTATIONS_KEY][type].allSegments = updatedStyles; } } else if (segmentationId) { if (!this.config.segmentations[segmentationId]) { this.config.segmentations[segmentationId] = {}; } if (!this.config.segmentations[segmentationId][type]) { this.config.segmentations[segmentationId][type] = {}; } const segConfig = this.config.segmentations[segmentationId][type]; if (segmentIndex !== undefined) { if (!segConfig.perSegment) { segConfig.perSegment = {}; } segConfig.perSegment[segmentIndex] = updatedStyles; } else { segConfig.allSegments = updatedStyles; } } else { this.config.global[type] = updatedStyles; } } copyActiveToInactiveIfNotProvided(styles, type) { const processedStyles = { ...styles }; if (type === _enums__WEBPACK_IMPORTED_MODULE_2__["default"].Labelmap) { const labelmapStyles = processedStyles; labelmapStyles.renderOutlineInactive ??= labelmapStyles.renderOutline; labelmapStyles.outlineWidthInactive ??= labelmapStyles.outlineWidth; labelmapStyles.renderFillInactive ??= labelmapStyles.renderFill; labelmapStyles.fillAlphaInactive ??= labelmapStyles.fillAlpha; labelmapStyles.outlineOpacityInactive ??= labelmapStyles.outlineOpacity; } else if (type === _enums__WEBPACK_IMPORTED_MODULE_2__["default"].Contour) { const contourStyles = processedStyles; contourStyles.outlineWidthInactive ??= contourStyles.outlineWidth; contourStyles.outlineOpacityInactive ??= contourStyles.outlineOpacity; contourStyles.outlineDashInactive ??= contourStyles.outlineDash; contourStyles.renderOutlineInactive ??= contourStyles.renderOutline; contourStyles.renderFillInactive ??= contourStyles.renderFill; contourStyles.fillAlphaInactive ??= contourStyles.fillAlpha; } return processedStyles; } getStyle(specifier) { const { viewportId, segmentationId, type, segmentIndex } = specifier; let combinedStyle = this.getDefaultStyle(type); let renderInactiveSegmentations = false; if (this.config.global[type]) { combinedStyle = { ...combinedStyle, ...this.config.global[type] }; } if (this.config.segmentations[segmentationId]?.[type]) { combinedStyle = { ...combinedStyle, ...this.config.segmentations[segmentationId][type].allSegments }; if (segmentIndex !== undefined && this.config.segmentations[segmentationId][type].perSegment?.[segmentIndex]) { combinedStyle = { ...combinedStyle, ...this.config.segmentations[segmentationId][type].perSegment[segmentIndex] }; } } if (viewportId && this.config.viewportsStyle[viewportId]) { renderInactiveSegmentations = this.config.viewportsStyle[viewportId].renderInactiveSegmentations; const allSegmentationsKey = '__allSegmentations__'; if (this.config.viewportsStyle[viewportId].representations[allSegmentationsKey]?.[type]) { combinedStyle = { ...combinedStyle, ...this.config.viewportsStyle[viewportId].representations[allSegmentationsKey][type].allSegments }; } if (segmentationId && this.config.viewportsStyle[viewportId].representations[segmentationId]?.[type]) { combinedStyle = { ...combinedStyle, ...this.config.viewportsStyle[viewportId].representations[segmentationId][type].allSegments }; if (segmentIndex !== undefined && this.config.viewportsStyle[viewportId].representations[segmentationId][type].perSegment?.[segmentIndex]) { combinedStyle = { ...combinedStyle, ...this.config.viewportsStyle[viewportId].representations[segmentationId][type].perSegment[segmentIndex] }; } } } return combinedStyle; } getRenderInactiveSegmentations(viewportId) { return this.config.viewportsStyle[viewportId]?.renderInactiveSegmentations; } setRenderInactiveSegmentations(viewportId, renderInactiveSegmentations) { if (!this.config.viewportsStyle[viewportId]) { this.config.viewportsStyle[viewportId] = { renderInactiveSegmentations: false, representations: {} }; } this.config.viewportsStyle[viewportId].renderInactiveSegmentations = renderInactiveSegmentations; } getDefaultStyle(type) { switch (type) { case _enums__WEBPACK_IMPORTED_MODULE_2__["default"].Labelmap: return (0,_tools_displayTools_Labelmap_labelmapConfig__WEBPACK_IMPORTED_MODULE_1__["default"])(); case _enums__WEBPACK_IMPORTED_MODULE_2__["default"].Contour: return (0,_tools_displayTools_Contour_contourConfig__WEBPACK_IMPORTED_MODULE_0__["default"])(); case _enums__WEBPACK_IMPORTED_MODULE_2__["default"].Surface: return {}; default: throw new Error(`Unknown representation type: ${type}`); } } clearSegmentationStyle(segmentationId) { if (this.config.segmentations[segmentationId]) { delete this.config.segmentations[segmentationId]; } } clearAllSegmentationStyles() { this.config.segmentations = {}; } clearViewportStyle(viewportId) { if (this.config.viewportsStyle[viewportId]) { delete this.config.viewportsStyle[viewportId]; } } clearAllViewportStyles() { for (const viewportId in this.config.viewportsStyle) { const viewportStyle = this.config.viewportsStyle[viewportId]; const renderInactiveSegmentations = viewportStyle.renderInactiveSegmentations; this.config.viewportsStyle[viewportId] = { renderInactiveSegmentations, representations: {} }; } } resetToGlobalStyle() { this.clearAllSegmentationStyles(); this.clearAllViewportStyles(); } hasCustomStyle(specifier) { const { type } = specifier; const style = this.getStyle(specifier); const defaultStyle = this.getDefaultStyle(type); return !_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__.deepEqual(style, defaultStyle); } } const segmentationStyle = new SegmentationStyle(); /***/ }, /***/ 19560 /*!*******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/activeSegmentation.js ***! \*******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getActiveSegmentation: () => (/* binding */ getActiveSegmentation), /* harmony export */ setActiveSegmentation: () => (/* binding */ setActiveSegmentation) /* harmony export */ }); /* harmony import */ var _getActiveSegmentation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getActiveSegmentation */ 4290); /* harmony import */ var _setActiveSegmentation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./setActiveSegmentation */ 47486); function getActiveSegmentation(viewportId) { return (0,_getActiveSegmentation__WEBPACK_IMPORTED_MODULE_0__.getActiveSegmentation)(viewportId); } function setActiveSegmentation(viewportId, segmentationId) { (0,_setActiveSegmentation__WEBPACK_IMPORTED_MODULE_1__.setActiveSegmentation)(viewportId, segmentationId); } /***/ }, /***/ 48261 /*!************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/addColorLUT.js ***! \************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ addColorLUT: () => (/* binding */ addColorLUT) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 17137); /* harmony import */ var _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SegmentationStateManager */ 64790); /* harmony import */ var _getNextColorLUTIndex__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getNextColorLUTIndex */ 33063); /* harmony import */ var _constants_COLOR_LUT__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../constants/COLOR_LUT */ 74953); function addColorLUT(colorLUT, index) { const segmentationStateManager = _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_1__.defaultSegmentationStateManager; const indexToUse = index ?? (0,_getNextColorLUTIndex__WEBPACK_IMPORTED_MODULE_2__.getNextColorLUTIndex)(); let colorLUTToUse = [...colorLUT]; if (!_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.isEqual(colorLUTToUse[0], [0, 0, 0, 0])) { console.warn('addColorLUT: [0, 0, 0, 0] color is not provided for the background color (segmentIndex =0), automatically adding it'); colorLUTToUse = [[0, 0, 0, 0], ...colorLUTToUse]; } colorLUTToUse = colorLUTToUse.map(color => { if (color.length === 3) { return [color[0], color[1], color[2], 255]; } return color; }); if (colorLUTToUse.length < 255) { const missingColorLUTs = _constants_COLOR_LUT__WEBPACK_IMPORTED_MODULE_3__["default"].slice(colorLUTToUse.length); colorLUTToUse = [...colorLUTToUse, ...missingColorLUTs]; } segmentationStateManager.addColorLUT(colorLUTToUse, indexToUse); return indexToUse; } /***/ }, /***/ 87024 /*!*************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/config/segmentationColor.js ***! \*************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ addColorLUT: () => (/* binding */ addColorLUT), /* harmony export */ getSegmentIndexColor: () => (/* binding */ getSegmentIndexColor), /* harmony export */ setColorLUT: () => (/* binding */ setColorLUT), /* harmony export */ setSegmentIndexColor: () => (/* binding */ setSegmentIndexColor) /* harmony export */ }); /* harmony import */ var _addColorLUT__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../addColorLUT */ 48261); /* harmony import */ var _getColorLUT__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../getColorLUT */ 59922); /* harmony import */ var _getSegmentationRepresentation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../getSegmentationRepresentation */ 34625); /* harmony import */ var _triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../triggerSegmentationEvents */ 20566); function addColorLUT(colorLUT, colorLUTIndex) { if (!colorLUT) { throw new Error('addColorLUT: colorLUT is required'); } return (0,_addColorLUT__WEBPACK_IMPORTED_MODULE_0__.addColorLUT)(colorLUT, colorLUTIndex); } function setColorLUT(viewportId, segmentationId, colorLUTsIndex) { if (!(0,_getColorLUT__WEBPACK_IMPORTED_MODULE_1__.getColorLUT)(colorLUTsIndex)) { throw new Error(`setColorLUT: could not find colorLUT with index ${colorLUTsIndex}`); } const segmentationRepresentations = (0,_getSegmentationRepresentation__WEBPACK_IMPORTED_MODULE_2__.getSegmentationRepresentations)(viewportId, { segmentationId }); if (!segmentationRepresentations) { throw new Error(`viewport specific state for viewport ${viewportId} does not exist`); } segmentationRepresentations.forEach(segmentationRepresentation => { segmentationRepresentation.colorLUTIndex = colorLUTsIndex; }); (0,_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_3__.triggerSegmentationRepresentationModified)(viewportId, segmentationId); } function getSegmentIndexColor(viewportId, segmentationId, segmentIndex) { const representations = (0,_getSegmentationRepresentation__WEBPACK_IMPORTED_MODULE_2__.getSegmentationRepresentations)(viewportId, { segmentationId }); if (!representations || representations.length === 0) { return null; } const representation = representations[0]; const { colorLUTIndex } = representation; const colorLUT = (0,_getColorLUT__WEBPACK_IMPORTED_MODULE_1__.getColorLUT)(colorLUTIndex); let colorValue = colorLUT[segmentIndex]; if (!colorValue) { if (typeof segmentIndex !== 'number') { console.warn(`Can't create colour for LUT index ${segmentIndex}`); return null; } colorValue = colorLUT[segmentIndex] = [0, 0, 0, 0]; } return colorValue; } function setSegmentIndexColor(viewportId, segmentationId, segmentIndex, color) { const colorReference = getSegmentIndexColor(viewportId, segmentationId, segmentIndex); for (let i = 0; i < color.length; i++) { colorReference[i] = color[i]; } (0,_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_3__.triggerSegmentationRepresentationModified)(viewportId, segmentationId); } /***/ }, /***/ 64948 /*!********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/events/triggerSegmentationAdded.js ***! \********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ triggerSegmentationAdded: () => (/* binding */ triggerSegmentationAdded) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 28699); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../enums */ 54870); function triggerSegmentationAdded(segmentationId) { const eventDetail = { segmentationId }; (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"], _enums__WEBPACK_IMPORTED_MODULE_2__["default"].SEGMENTATION_ADDED, eventDetail); } /***/ }, /***/ 82703 /*!***************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/events/triggerSegmentationDataModified.js ***! \***************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ triggerSegmentationDataModified: () => (/* binding */ triggerSegmentationDataModified) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 28699); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../enums */ 54870); /* harmony import */ var _utilities_segmentation_utilities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../utilities/segmentation/utilities */ 65048); function triggerSegmentationDataModified(segmentationId, modifiedSlicesToUse, segmentIndex) { const eventDetail = { segmentationId, modifiedSlicesToUse, segmentIndex }; (0,_utilities_segmentation_utilities__WEBPACK_IMPORTED_MODULE_3__.setSegmentationDirty)(segmentationId); (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"], _enums__WEBPACK_IMPORTED_MODULE_2__["default"].SEGMENTATION_DATA_MODIFIED, eventDetail); } /***/ }, /***/ 43815 /*!***********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/events/triggerSegmentationModified.js ***! \***********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ triggerSegmentationModified: () => (/* binding */ triggerSegmentationModified) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 28699); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../enums */ 54870); function triggerSegmentationModified(segmentationId) { const eventDetail = { segmentationId }; (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"], _enums__WEBPACK_IMPORTED_MODULE_2__["default"].SEGMENTATION_MODIFIED, eventDetail); } /***/ }, /***/ 12218 /*!**********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/events/triggerSegmentationRemoved.js ***! \**********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ triggerSegmentationRemoved: () => (/* binding */ triggerSegmentationRemoved) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 28699); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../enums */ 54870); function triggerSegmentationRemoved(segmentationId) { const eventDetail = { segmentationId }; (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"], _enums__WEBPACK_IMPORTED_MODULE_2__["default"].SEGMENTATION_REMOVED, eventDetail); } /***/ }, /***/ 20566 /*!*************************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/events/triggerSegmentationRepresentationModified.js ***! \*************************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ triggerSegmentationRepresentationModified: () => (/* binding */ triggerSegmentationRepresentationModified) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 28699); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../enums */ 54870); function triggerSegmentationRepresentationModified(viewportId, segmentationId, type) { const eventDetail = { segmentationId, type, viewportId }; (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"], _enums__WEBPACK_IMPORTED_MODULE_2__["default"].SEGMENTATION_REPRESENTATION_MODIFIED, eventDetail); } /***/ }, /***/ 62005 /*!************************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/events/triggerSegmentationRepresentationRemoved.js ***! \************************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ triggerSegmentationRepresentationRemoved: () => (/* binding */ triggerSegmentationRepresentationRemoved) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 28699); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../enums */ 54870); function triggerSegmentationRepresentationRemoved(viewportId, segmentationId, type) { const eventDetail = { viewportId, segmentationId, type }; (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"], _enums__WEBPACK_IMPORTED_MODULE_2__["default"].SEGMENTATION_REPRESENTATION_REMOVED, eventDetail); } /***/ }, /***/ 9943 /*!**********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getActiveSegmentIndex.js ***! \**********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getActiveSegmentIndex: () => (/* binding */ getActiveSegmentIndex) /* harmony export */ }); /* harmony import */ var _getSegmentation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getSegmentation */ 42952); function getActiveSegmentIndex(segmentationId) { const segmentation = (0,_getSegmentation__WEBPACK_IMPORTED_MODULE_0__.getSegmentation)(segmentationId); if (segmentation) { const activeSegmentIndex = Object.keys(segmentation.segments).find(segmentIndex => segmentation.segments[segmentIndex].active); return activeSegmentIndex ? Number(activeSegmentIndex) : undefined; } return undefined; } /***/ }, /***/ 4290 /*!**********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getActiveSegmentation.js ***! \**********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getActiveSegmentation: () => (/* binding */ getActiveSegmentation) /* harmony export */ }); /* harmony import */ var _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SegmentationStateManager */ 64790); function getActiveSegmentation(viewportId) { const segmentationStateManager = _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__.defaultSegmentationStateManager; return segmentationStateManager.getActiveSegmentation(viewportId); } /***/ }, /***/ 59922 /*!************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getColorLUT.js ***! \************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getColorLUT: () => (/* binding */ getColorLUT) /* harmony export */ }); /* harmony import */ var _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SegmentationStateManager */ 64790); function getColorLUT(index) { const segmentationStateManager = _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__.defaultSegmentationStateManager; return segmentationStateManager.getColorLUT(index); } /***/ }, /***/ 96340 /*!*************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getCurrentLabelmapImageIdForViewport.js ***! \*************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getCurrentLabelmapImageIdForViewport: () => (/* binding */ getCurrentLabelmapImageIdForViewport), /* harmony export */ getCurrentLabelmapImageIdsForViewport: () => (/* binding */ getCurrentLabelmapImageIdsForViewport), /* harmony export */ getLabelmapImageIdsForImageId: () => (/* binding */ getLabelmapImageIdsForImageId) /* harmony export */ }); /* harmony import */ var _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SegmentationStateManager */ 64790); function getCurrentLabelmapImageIdForViewport(viewportId, segmentationId) { const imageIds = getCurrentLabelmapImageIdsForViewport(viewportId, segmentationId); if (!imageIds?.length) { return; } return imageIds[0]; } function getCurrentLabelmapImageIdsForViewport(viewportId, segmentationId) { const segmentationStateManager = _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__.defaultSegmentationStateManager; return segmentationStateManager.getCurrentLabelmapImageIdsForViewport(viewportId, segmentationId); } function getLabelmapImageIdsForImageId(imageId, segmentationId) { const segmentationStateManager = _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__.defaultSegmentationStateManager; return segmentationStateManager.getLabelmapImageIdsForImageId(imageId, segmentationId); } /***/ }, /***/ 33063 /*!*********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getNextColorLUTIndex.js ***! \*********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getNextColorLUTIndex: () => (/* binding */ getNextColorLUTIndex) /* harmony export */ }); /* harmony import */ var _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SegmentationStateManager */ 64790); function getNextColorLUTIndex() { const segmentationStateManager = _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__.defaultSegmentationStateManager; return segmentationStateManager.getNextColorLUTIndex(); } /***/ }, /***/ 42952 /*!****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getSegmentation.js ***! \****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getSegmentation: () => (/* binding */ getSegmentation) /* harmony export */ }); /* harmony import */ var _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SegmentationStateManager */ 64790); function getSegmentation(segmentationId) { const segmentationStateManager = _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__.defaultSegmentationStateManager; return segmentationStateManager.getSegmentation(segmentationId); } /***/ }, /***/ 34625 /*!******************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getSegmentationRepresentation.js ***! \******************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getSegmentationRepresentation: () => (/* binding */ getSegmentationRepresentation), /* harmony export */ getSegmentationRepresentations: () => (/* binding */ getSegmentationRepresentations), /* harmony export */ getSegmentationRepresentationsBySegmentationId: () => (/* binding */ getSegmentationRepresentationsBySegmentationId) /* harmony export */ }); /* harmony import */ var _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SegmentationStateManager */ 64790); function getSegmentationRepresentations(viewportId, specifier = {}) { const segmentationStateManager = _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__.defaultSegmentationStateManager; return segmentationStateManager.getSegmentationRepresentations(viewportId, specifier); } function getSegmentationRepresentation(viewportId, specifier) { const segmentationStateManager = _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__.defaultSegmentationStateManager; if (!specifier.segmentationId || !specifier.type) { throw new Error('getSegmentationRepresentation: No segmentationId or type provided, you need to provide at least one of them'); } const representations = segmentationStateManager.getSegmentationRepresentations(viewportId, specifier); return representations?.[0]; } function getSegmentationRepresentationsBySegmentationId(segmentationId) { const segmentationStateManager = _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__.defaultSegmentationStateManager; return segmentationStateManager.getSegmentationRepresentationsBySegmentationId(segmentationId); } /***/ }, /***/ 88169 /*!****************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getSegmentationRepresentationVisibility.js ***! \****************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getSegmentationRepresentationVisibility: () => (/* binding */ getSegmentationRepresentationVisibility) /* harmony export */ }); /* harmony import */ var _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SegmentationStateManager */ 64790); function getSegmentationRepresentationVisibility(viewportId, specifier) { const segmentationStateManager = _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__.defaultSegmentationStateManager; return segmentationStateManager.getSegmentationRepresentationVisibility(viewportId, specifier); } /***/ }, /***/ 72370 /*!*******************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/getViewportIdsWithSegmentation.js ***! \*******************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getViewportIdsWithSegmentation: () => (/* binding */ getViewportIdsWithSegmentation) /* harmony export */ }); /* harmony import */ var _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SegmentationStateManager */ 64790); function getViewportIdsWithSegmentation(segmentationId) { const segmentationStateManager = _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__.defaultSegmentationStateManager; const state = segmentationStateManager.getState(); const viewportSegRepresentations = state.viewportSegRepresentations; const viewportIdsWithSegmentation = Object.entries(viewportSegRepresentations).filter(([, viewportSegmentations]) => viewportSegmentations.some(segRep => segRep.segmentationId === segmentationId)).map(([viewportId]) => viewportId); return viewportIdsWithSegmentation; } /***/ }, /***/ 82165 /*!*****************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/helpers/getSegmentationActor.js ***! \*****************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getLabelmapActorEntries: () => (/* binding */ getLabelmapActorEntries), /* harmony export */ getLabelmapActorEntry: () => (/* binding */ getLabelmapActorEntry), /* harmony export */ getLabelmapActorUID: () => (/* binding */ getLabelmapActorUID), /* harmony export */ getSurfaceActorEntry: () => (/* binding */ getSurfaceActorEntry), /* harmony export */ getSurfaceRepresentationUID: () => (/* binding */ getSurfaceRepresentationUID) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../enums */ 85543); function getActorEntry(viewportId, segmentationId, filterFn) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElementByViewportId)(viewportId); if (!enabledElement) { return; } const { renderingEngine, viewport } = enabledElement; if (!renderingEngine || !viewport) { return; } const actors = viewport.getActors(); const filteredActors = actors.filter(filterFn); return filteredActors.length > 0 ? filteredActors[0] : undefined; } function getActorEntries(viewportId, filterFn) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElementByViewportId)(viewportId); if (!enabledElement) { return; } const { renderingEngine, viewport } = enabledElement; if (!renderingEngine || !viewport) { return; } const actors = viewport.getActors(); const filteredActors = actors.filter(filterFn); return filteredActors.length > 0 ? filteredActors : undefined; } function getLabelmapActorUID(viewportId, segmentationId) { const actorEntry = getLabelmapActorEntry(viewportId, segmentationId); return actorEntry?.uid; } function getLabelmapActorEntries(viewportId, segmentationId) { return getActorEntries(viewportId, actor => actor.representationUID?.startsWith(`${segmentationId}-${_enums__WEBPACK_IMPORTED_MODULE_1__["default"].Labelmap}`)); } function getLabelmapActorEntry(viewportId, segmentationId) { return getActorEntry(viewportId, segmentationId, actor => actor.representationUID?.startsWith(`${segmentationId}-${_enums__WEBPACK_IMPORTED_MODULE_1__["default"].Labelmap}`)); } function getSurfaceActorEntry(viewportId, segmentationId, segmentIndex) { return getActorEntry(viewportId, segmentationId, actor => actor.representationUID === getSurfaceRepresentationUID(segmentationId, segmentIndex)); } function getSurfaceRepresentationUID(segmentationId, segmentIndex) { return `${segmentationId}-${_enums__WEBPACK_IMPORTED_MODULE_1__["default"].Surface}-${segmentIndex}`; } /***/ }, /***/ 8881 /*!****************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/helpers/internalGetHiddenSegmentIndices.js ***! \****************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ internalGetHiddenSegmentIndices: () => (/* binding */ internalGetHiddenSegmentIndices) /* harmony export */ }); /* harmony import */ var _getSegmentationRepresentation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getSegmentationRepresentation */ 34625); function internalGetHiddenSegmentIndices(viewportId, specifier) { const representation = (0,_getSegmentationRepresentation__WEBPACK_IMPORTED_MODULE_0__.getSegmentationRepresentation)(viewportId, specifier); if (!representation) { return new Set(); } const segmentsHidden = Object.entries(representation.segments).reduce((acc, [segmentIndex, segment]) => { if (!segment.visible) { acc.add(Number(segmentIndex)); } return acc; }, new Set()); return segmentsHidden; } /***/ }, /***/ 23807 /*!******************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/internalAddRepresentationData.js ***! \******************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _getSegmentation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getSegmentation */ 42952); /* harmony import */ var _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../enums/SegmentationRepresentations */ 85543); function internalAddRepresentationData({ segmentationId, type, data }) { const segmentation = (0,_getSegmentation__WEBPACK_IMPORTED_MODULE_0__.getSegmentation)(segmentationId); if (!segmentation) { throw new Error(`Segmentation ${segmentationId} not found`); } if (segmentation.representationData[type]) { console.warn(`Representation data of type ${type} already exists for segmentation ${segmentationId}, overwriting it.`); } switch (type) { case _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_1__["default"].Labelmap: if (data) { segmentation.representationData[type] = data; } break; case _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_1__["default"].Contour: if (data) { segmentation.representationData[type] = data; } break; case _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_1__["default"].Surface: if (data) { segmentation.representationData[type] = data; } break; default: throw new Error(`Invalid representation type ${type}`); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (internalAddRepresentationData); /***/ }, /***/ 7474 /*!***************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/segmentLocking.js ***! \***************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getLockedSegmentIndices: () => (/* binding */ getLockedSegmentIndices), /* harmony export */ isSegmentIndexLocked: () => (/* binding */ isSegmentIndexLocked), /* harmony export */ setSegmentIndexLocked: () => (/* binding */ setSegmentIndexLocked) /* harmony export */ }); /* harmony import */ var _stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stateManagement/segmentation/getSegmentation */ 42952); /* harmony import */ var _annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../annotation/annotationLocking */ 11399); /* harmony import */ var _triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./triggerSegmentationEvents */ 43815); /* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utilities */ 32397); function _setContourSegmentationSegmentAnnotationsLocked(segmentation, segmentIndex, locked) { const annotationUIDsMap = (0,_utilities__WEBPACK_IMPORTED_MODULE_3__.getAnnotationsUIDMapFromSegmentation)(segmentation.segmentationId); if (!annotationUIDsMap) { return; } const annotationUIDs = annotationUIDsMap.get(segmentIndex); if (!annotationUIDs) { return; } annotationUIDs.forEach(annotationUID => { (0,_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_1__.setAnnotationLocked)(annotationUID, locked); }); } function isSegmentIndexLocked(segmentationId, segmentIndex) { const segmentation = (0,_stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_0__.getSegmentation)(segmentationId); if (!segmentation) { throw new Error(`No segmentation state found for ${segmentationId}`); } const { segments } = segmentation; return segments[segmentIndex].locked; } function setSegmentIndexLocked(segmentationId, segmentIndex, locked = true) { const segmentation = (0,_stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_0__.getSegmentation)(segmentationId); if (!segmentation) { throw new Error(`No segmentation state found for ${segmentationId}`); } const { segments } = segmentation; segments[segmentIndex].locked = locked; if (segmentation?.representationData?.Contour) { _setContourSegmentationSegmentAnnotationsLocked(segmentation, segmentIndex, locked); } (0,_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_2__.triggerSegmentationModified)(segmentationId); } function getLockedSegmentIndices(segmentationId) { const segmentation = (0,_stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_0__.getSegmentation)(segmentationId); if (!segmentation) { throw new Error(`No segmentation state found for ${segmentationId}`); } const { segments } = segmentation; const lockedSegmentIndices = Object.keys(segments).filter(segmentIndex => segments[segmentIndex].locked); return lockedSegmentIndices.map(segmentIndex => parseInt(segmentIndex)); } /***/ }, /***/ 57569 /*!*************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/segmentationEventManager.js ***! \*************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ addDefaultSegmentationListener: () => (/* binding */ addDefaultSegmentationListener), /* harmony export */ addSegmentationListener: () => (/* binding */ addSegmentationListener), /* harmony export */ removeAllSegmentationListeners: () => (/* binding */ removeAllSegmentationListeners), /* harmony export */ removeSegmentationListener: () => (/* binding */ removeSegmentationListener) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 28699); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../enums */ 54870); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums */ 85543); /* harmony import */ var _triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./triggerSegmentationEvents */ 43815); /* harmony import */ var _utilities_debounce__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utilities/debounce */ 7154); /* harmony import */ var _tools_displayTools_Surface_surfaceDisplay__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../tools/displayTools/Surface/surfaceDisplay */ 67707); /* harmony import */ var _tools_displayTools_Contour_contourDisplay__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../tools/displayTools/Contour/contourDisplay */ 50011); /* harmony import */ var _tools_displayTools_Labelmap_labelmapDisplay__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../tools/displayTools/Labelmap/labelmapDisplay */ 86101); /* harmony import */ var _getSegmentation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./getSegmentation */ 42952); const renderers = { [_enums__WEBPACK_IMPORTED_MODULE_2__["default"].Labelmap]: _tools_displayTools_Labelmap_labelmapDisplay__WEBPACK_IMPORTED_MODULE_7__["default"], [_enums__WEBPACK_IMPORTED_MODULE_2__["default"].Contour]: _tools_displayTools_Contour_contourDisplay__WEBPACK_IMPORTED_MODULE_6__["default"], [_enums__WEBPACK_IMPORTED_MODULE_2__["default"].Surface]: _tools_displayTools_Surface_surfaceDisplay__WEBPACK_IMPORTED_MODULE_5__["default"] }; const segmentationListeners = new Map(); function addDefaultSegmentationListener(viewport, segmentationId, representationType) { const updateFunction = renderers[representationType].getUpdateFunction(viewport); if (updateFunction) { addSegmentationListener(segmentationId, representationType, updateFunction); } } function addSegmentationListener(segmentationId, representationType, updateFunction) { if (!segmentationListeners.has(segmentationId)) { segmentationListeners.set(segmentationId, new Map()); } const listenerMap = segmentationListeners.get(segmentationId); if (listenerMap.has(representationType)) { removeSegmentationListener(segmentationId, representationType); } const listener = createDebouncedSegmentationListener(segmentationId, representationType, updateFunction); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].addEventListener(_enums__WEBPACK_IMPORTED_MODULE_1__["default"].SEGMENTATION_DATA_MODIFIED, listener); listenerMap.set(representationType, listener); } function removeSegmentationListener(segmentationId, representationType) { const listenerMap = segmentationListeners.get(segmentationId); if (!listenerMap) { return; } const listener = listenerMap.get(representationType); if (!listener) { return; } _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_1__["default"].SEGMENTATION_DATA_MODIFIED, listener); listenerMap.delete(representationType); } function removeAllSegmentationListeners(segmentationId) { const listenerMap = segmentationListeners.get(segmentationId); if (!listenerMap) { return; } for (const listener of listenerMap.values()) { _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_1__["default"].SEGMENTATION_DATA_MODIFIED, listener); } segmentationListeners.delete(segmentationId); } function createDebouncedSegmentationListener(segmentationId, representationType, updateFunction) { const debouncedHandler = (0,_utilities_debounce__WEBPACK_IMPORTED_MODULE_4__["default"])(event => { const eventSegmentationId = event.detail?.segmentationId; const segmentation = (0,_getSegmentation__WEBPACK_IMPORTED_MODULE_8__.getSegmentation)(eventSegmentationId); if (eventSegmentationId === segmentationId && !!segmentation?.representationData?.[representationType]) { updateFunction(segmentationId); (0,_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_3__.triggerSegmentationModified)(segmentationId); } }, 300); return event => { debouncedHandler(event); }; } /***/ }, /***/ 47486 /*!**********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/setActiveSegmentation.js ***! \**********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ setActiveSegmentation: () => (/* binding */ setActiveSegmentation) /* harmony export */ }); /* harmony import */ var _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SegmentationStateManager */ 64790); function setActiveSegmentation(viewportId, segmentationId) { const segmentationStateManager = _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__.defaultSegmentationStateManager; segmentationStateManager.setActiveSegmentation(viewportId, segmentationId); } /***/ }, /***/ 74360 /*!******************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/updateLabelmapSegmentationImageReferences.js ***! \******************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ updateLabelmapSegmentationImageReferences: () => (/* binding */ updateLabelmapSegmentationImageReferences) /* harmony export */ }); /* harmony import */ var _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SegmentationStateManager */ 64790); function updateLabelmapSegmentationImageReferences(viewportId, segmentationId) { const segmentationStateManager = _SegmentationStateManager__WEBPACK_IMPORTED_MODULE_0__.defaultSegmentationStateManager; return segmentationStateManager.updateLabelmapSegmentationImageReferences(viewportId, segmentationId); } /***/ }, /***/ 32397 /*!***********************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/stateManagement/segmentation/utilities/getAnnotationsUIDMapFromSegmentation.js ***! \***********************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getAnnotationsUIDMapFromSegmentation: () => (/* binding */ getAnnotationsUIDMapFromSegmentation) /* harmony export */ }); /* harmony import */ var _getSegmentation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../getSegmentation */ 42952); function getAnnotationsUIDMapFromSegmentation(segmentationId) { const segmentation = (0,_getSegmentation__WEBPACK_IMPORTED_MODULE_0__.getSegmentation)(segmentationId); if (!segmentation) { return; } const contourRepresentationData = segmentation.representationData?.Contour; if (!contourRepresentationData) { return; } const { annotationUIDsMap } = contourRepresentationData; if (!annotationUIDsMap) { return; } return annotationUIDsMap; } /***/ }, /***/ 70626 /*!*************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/store/SynchronizerManager/getSynchronizersForViewport.js ***! \*************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../state */ 90125); function getSynchronizersForViewport(viewportId, renderingEngineId) { const synchronizersFilteredByIds = []; if (!renderingEngineId && !viewportId) { throw new Error('At least one of renderingEngineId or viewportId should be given'); } for (let i = 0; i < _state__WEBPACK_IMPORTED_MODULE_0__.state.synchronizers.length; i++) { const synchronizer = _state__WEBPACK_IMPORTED_MODULE_0__.state.synchronizers[i]; const notDisabled = !synchronizer.isDisabled(); const hasSourceViewport = synchronizer.hasSourceViewport(renderingEngineId, viewportId); const hasTargetViewport = synchronizer.hasTargetViewport(renderingEngineId, viewportId); if (notDisabled && (hasSourceViewport || hasTargetViewport)) { synchronizersFilteredByIds.push(synchronizer); } } return synchronizersFilteredByIds; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getSynchronizersForViewport); /***/ }, /***/ 64324 /*!****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/store/ToolGroupManager/ToolGroup.js ***! \****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ToolGroup) /* harmony export */ }); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../enums */ 64543); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../enums */ 92925); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums */ 54870); /* harmony import */ var lodash_get__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash.get */ 42211); /* harmony import */ var lodash_get__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_get__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @cornerstonejs/core */ 28699); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @cornerstonejs/core */ 77569); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @cornerstonejs/core */ 57889); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @cornerstonejs/core */ 47858); /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../state */ 90125); /* harmony import */ var _cursors__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../cursors */ 38771); /* harmony import */ var _cursors__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../cursors */ 48231); /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../cursors/elementCursor */ 45180); /* harmony import */ var _getToolGroup__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./getToolGroup */ 92792); const { Active, Passive, Enabled, Disabled } = _enums__WEBPACK_IMPORTED_MODULE_1__["default"]; const PRIMARY_BINDINGS = [{ mouseButton: _enums__WEBPACK_IMPORTED_MODULE_0__.MouseBindings.Primary }]; class ToolGroup { constructor(id) { this.viewportsInfo = []; this.toolOptions = {}; this.currentActivePrimaryToolName = null; this.prevActivePrimaryToolName = null; this.restoreToolOptions = {}; this._toolInstances = {}; this.id = id; } getViewportIds() { return this.viewportsInfo.map(({ viewportId }) => viewportId); } getViewportsInfo() { return this.viewportsInfo.slice(); } getToolInstance(toolInstanceName) { const toolInstance = this._toolInstances[toolInstanceName]; if (!toolInstance) { console.warn(`'${toolInstanceName}' is not registered with this toolGroup (${this.id}).`); return; } return toolInstance; } getToolInstances() { return this._toolInstances; } hasTool(toolName) { return !!this._toolInstances[toolName]; } addTool(toolName, configuration = {}) { const toolDefinition = _state__WEBPACK_IMPORTED_MODULE_10__.state.tools[toolName]; const hasToolName = typeof toolName !== 'undefined' && toolName !== ''; const localToolInstance = this.toolOptions[toolName]; if (!hasToolName) { console.warn('Tool with configuration did not produce a toolName: ', configuration); return; } if (!toolDefinition) { console.warn(`'${toolName}' is not registered with the library. You need to use cornerstoneTools.addTool to register it.`); return; } if (localToolInstance) { console.warn(`'${toolName}' is already registered for ToolGroup ${this.id}.`); return; } const { toolClass: ToolClass } = toolDefinition; const toolProps = { name: toolName, toolGroupId: this.id, configuration }; const instantiatedTool = new ToolClass(toolProps); this._toolInstances[toolName] = instantiatedTool; } addToolInstance(toolName, parentClassName, configuration = {}) { let ToolClassToUse = _state__WEBPACK_IMPORTED_MODULE_10__.state.tools[toolName]?.toolClass; if (!ToolClassToUse) { const ParentClass = _state__WEBPACK_IMPORTED_MODULE_10__.state.tools[parentClassName].toolClass; class ToolInstance extends ParentClass {} ToolInstance.toolName = toolName; ToolClassToUse = ToolInstance; _state__WEBPACK_IMPORTED_MODULE_10__.state.tools[toolName] = { toolClass: ToolInstance }; } this.addTool(ToolClassToUse.toolName, configuration); } addViewport(viewportId, renderingEngineId) { if (typeof viewportId !== 'string') { throw new Error('viewportId must be defined and be a string'); } const renderingEngineUIDToUse = this._findRenderingEngine(viewportId, renderingEngineId); if (!this.viewportsInfo.some(({ viewportId: vpId }) => vpId === viewportId)) { this.viewportsInfo.push({ viewportId, renderingEngineId: renderingEngineUIDToUse }); } const toolName = this.getActivePrimaryMouseButtonTool(); this.setViewportsCursorByToolName(toolName); const eventDetail = { toolGroupId: this.id, viewportId, renderingEngineId: renderingEngineUIDToUse }; (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_8__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__["default"], _enums__WEBPACK_IMPORTED_MODULE_2__["default"].TOOLGROUP_VIEWPORT_ADDED, eventDetail); } removeViewports(renderingEngineId, viewportId) { const indices = []; this.viewportsInfo.forEach((vpInfo, index) => { let match = false; if (vpInfo.renderingEngineId === renderingEngineId) { match = true; if (viewportId && vpInfo.viewportId !== viewportId) { match = false; } } if (match) { indices.push(index); } }); if (indices.length) { for (let i = indices.length - 1; i >= 0; i--) { this.viewportsInfo.splice(indices[i], 1); } } const eventDetail = { toolGroupId: this.id, viewportId, renderingEngineId }; (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_8__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__["default"], _enums__WEBPACK_IMPORTED_MODULE_2__["default"].TOOLGROUP_VIEWPORT_REMOVED, eventDetail); } setActiveStrategy(toolName, strategyName) { const toolInstance = this._toolInstances[toolName]; if (toolInstance === undefined) { console.warn(`Tool ${toolName} not added to toolGroup, can't set tool configuration.`); return; } toolInstance.setActiveStrategy(strategyName); } setToolMode(toolName, mode, options = {}) { if (!toolName) { console.warn('setToolMode: toolName must be defined'); return; } if (mode === _enums__WEBPACK_IMPORTED_MODULE_1__["default"].Active) { this.setToolActive(toolName, options || this.restoreToolOptions[toolName]); return; } if (mode === _enums__WEBPACK_IMPORTED_MODULE_1__["default"].Passive) { this.setToolPassive(toolName); return; } if (mode === _enums__WEBPACK_IMPORTED_MODULE_1__["default"].Enabled) { this.setToolEnabled(toolName); return; } if (mode === _enums__WEBPACK_IMPORTED_MODULE_1__["default"].Disabled) { this.setToolDisabled(toolName); return; } console.warn('setToolMode: mode must be defined'); } setToolActive(toolName, toolBindingsOptions = {}) { const toolInstance = this._toolInstances[toolName]; if (toolInstance === undefined) { console.warn(`Tool ${toolName} not added to toolGroup, can't set tool mode.`); return; } if (!toolInstance) { console.warn(`'${toolName}' instance ${toolInstance} is not registered with this toolGroup, can't set tool mode.`); return; } const prevBindings = this.toolOptions[toolName] ? this.toolOptions[toolName].bindings : []; const newBindings = toolBindingsOptions.bindings ? toolBindingsOptions.bindings : []; const bindingsToUse = [...prevBindings, ...newBindings].reduce((unique, binding) => { const TouchBinding = binding.numTouchPoints !== undefined; const MouseBinding = binding.mouseButton !== undefined; if (!unique.some(obj => hasSameBinding(obj, binding)) && (TouchBinding || MouseBinding)) { unique.push(binding); } return unique; }, []); const toolOptions = { bindings: bindingsToUse, mode: Active }; this.toolOptions[toolName] = toolOptions; this._toolInstances[toolName].mode = Active; if (!this._hasMousePrimaryButtonBinding(toolBindingsOptions)) { const activeToolIdentifier = this.getActivePrimaryMouseButtonTool(); if (!activeToolIdentifier) { const cursor = _cursors__WEBPACK_IMPORTED_MODULE_11__["default"].getDefinedCursor('default'); this._setCursorForViewports(cursor); } toolInstance.isPrimary = false; } else { this.setViewportsCursorByToolName(toolName); toolInstance.isPrimary = true; } if (this._hasMousePrimaryButtonBinding(toolBindingsOptions)) { if (this.prevActivePrimaryToolName === null) { this.prevActivePrimaryToolName = toolName; } else { this.prevActivePrimaryToolName = this.currentActivePrimaryToolName; } this.currentActivePrimaryToolName = toolName; } if (typeof toolInstance.onSetToolActive === 'function') { toolInstance.onSetToolActive(); } this._renderViewports(); const eventDetail = { toolGroupId: this.id, toolName, toolBindingsOptions }; (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_8__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__["default"], _enums__WEBPACK_IMPORTED_MODULE_2__["default"].TOOL_ACTIVATED, eventDetail); this._triggerToolModeChangedEvent(toolName, Active, toolBindingsOptions); } setToolPassive(toolName, options) { const toolInstance = this._toolInstances[toolName]; if (toolInstance === undefined) { console.warn(`Tool ${toolName} not added to toolGroup, can't set tool mode.`); return; } const prevToolOptions = this.getToolOptions(toolName); const toolOptions = Object.assign({ bindings: prevToolOptions ? prevToolOptions.bindings : [] }, prevToolOptions, { mode: Passive }); const matchBindings = Array.isArray(options?.removeAllBindings) ? options.removeAllBindings : this.getDefaultPrimaryBindings(); toolOptions.bindings = toolOptions.bindings.filter(binding => options?.removeAllBindings !== true && !matchBindings.some(matchBinding => hasSameBinding(binding, matchBinding))); let mode = Passive; if (toolOptions.bindings.length !== 0) { mode = Active; toolOptions.mode = mode; } this.toolOptions[toolName] = toolOptions; toolInstance.mode = mode; toolInstance.isPrimary = false; if (typeof toolInstance.onSetToolPassive === 'function') { toolInstance.onSetToolPassive(); } this._renderViewports(); this._triggerToolModeChangedEvent(toolName, Passive); } setToolEnabled(toolName) { const toolInstance = this._toolInstances[toolName]; if (toolInstance === undefined) { console.warn(`Tool ${toolName} not added to toolGroup, can't set tool mode.`); return; } const toolOptions = { bindings: [], mode: Enabled }; this.toolOptions[toolName] = toolOptions; toolInstance.mode = Enabled; if (typeof toolInstance.onSetToolEnabled === 'function') { toolInstance.onSetToolEnabled(); } this._renderViewports(); this._triggerToolModeChangedEvent(toolName, Enabled); } setToolDisabled(toolName) { const toolInstance = this._toolInstances[toolName]; if (toolInstance === undefined) { console.warn(`Tool ${toolName} not added to toolGroup, can't set tool mode.`); return; } const toolOptions = { bindings: [], mode: Disabled }; this.restoreToolOptions[toolName] = this.toolOptions[toolName]; this.toolOptions[toolName] = toolOptions; toolInstance.mode = Disabled; if (typeof toolInstance.onSetToolDisabled === 'function') { toolInstance.onSetToolDisabled(); } this._renderViewports(); this._triggerToolModeChangedEvent(toolName, Disabled); } getToolOptions(toolName) { const toolOptionsForTool = this.toolOptions[toolName]; if (toolOptionsForTool === undefined) { return; } return toolOptionsForTool; } getActivePrimaryMouseButtonTool() { return Object.keys(this.toolOptions).find(toolName => { const toolOptions = this.toolOptions[toolName]; return toolOptions.mode === Active && this._hasMousePrimaryButtonBinding(toolOptions); }); } setViewportsCursorByToolName(toolName, strategyName) { const cursor = this._getCursor(toolName, strategyName); this._setCursorForViewports(cursor); } _getCursor(toolName, strategyName) { let cursorName; let cursor; if (strategyName) { cursorName = `${toolName}.${strategyName}`; cursor = _cursors__WEBPACK_IMPORTED_MODULE_12__["default"].getDefinedCursor(cursorName, true); if (cursor) { return cursor; } } cursorName = `${toolName}`; cursor = _cursors__WEBPACK_IMPORTED_MODULE_12__["default"].getDefinedCursor(cursorName, true); if (cursor) { return cursor; } cursorName = toolName; cursor = _cursors__WEBPACK_IMPORTED_MODULE_12__["default"].getDefinedCursor(cursorName, true); if (cursor) { return cursor; } return _cursors__WEBPACK_IMPORTED_MODULE_11__["default"].getDefinedCursor('default'); } _setCursorForViewports(cursor) { const runtimeSettings = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_7__["default"].getRuntimeSettings(); if (!runtimeSettings.get('useCursors')) { return; } this.viewportsInfo.forEach(({ renderingEngineId, viewportId }) => { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__.getEnabledElementByIds)(viewportId, renderingEngineId); if (!enabledElement) { return; } const { viewport } = enabledElement; (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_13__.initElementCursor)(viewport.element, cursor); }); } setToolConfiguration(toolName, configuration, overwrite) { const toolInstance = this._toolInstances[toolName]; if (toolInstance === undefined) { console.warn(`Tool ${toolName} not present, can't set tool configuration.`); return false; } let _configuration; if (overwrite) { _configuration = configuration; } else { _configuration = Object.assign(toolInstance.configuration, configuration); } toolInstance.configuration = _configuration; if (typeof toolInstance.onSetToolConfiguration === 'function') { toolInstance.onSetToolConfiguration(); } this._renderViewports(); return true; } getDefaultMousePrimary() { return _enums__WEBPACK_IMPORTED_MODULE_0__.MouseBindings.Primary; } getDefaultPrimaryBindings() { return PRIMARY_BINDINGS; } getToolConfiguration(toolName, configurationPath) { if (this._toolInstances[toolName] === undefined) { console.warn(`Tool ${toolName} not present, can't set tool configuration.`); return; } const _configuration = lodash_get__WEBPACK_IMPORTED_MODULE_3___default()(this._toolInstances[toolName].configuration, configurationPath) || this._toolInstances[toolName].configuration; return _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_9__.deepClone(_configuration); } getPrevActivePrimaryToolName() { return this.prevActivePrimaryToolName; } setActivePrimaryTool(toolName) { const activeToolName = this.getCurrentActivePrimaryToolName(); this.setToolDisabled(activeToolName); this.setToolActive(toolName, { bindings: [{ mouseButton: _enums__WEBPACK_IMPORTED_MODULE_0__.MouseBindings.Primary }] }); } getCurrentActivePrimaryToolName() { return this.currentActivePrimaryToolName; } clone(newToolGroupId, fnToolFilter = null) { let toolGroup = (0,_getToolGroup__WEBPACK_IMPORTED_MODULE_14__["default"])(newToolGroupId); if (toolGroup) { console.debug(`ToolGroup ${newToolGroupId} already exists`); return toolGroup; } toolGroup = new ToolGroup(newToolGroupId); _state__WEBPACK_IMPORTED_MODULE_10__.state.toolGroups.push(toolGroup); fnToolFilter = fnToolFilter ?? (() => true); Object.keys(this._toolInstances).filter(fnToolFilter).forEach(toolName => { const sourceToolInstance = this._toolInstances[toolName]; const sourceToolOptions = this.toolOptions[toolName]; const sourceToolMode = sourceToolInstance.mode; toolGroup.addTool(toolName); toolGroup.setToolMode(toolName, sourceToolMode, { bindings: sourceToolOptions.bindings ?? [] }); }); return toolGroup; } _hasMousePrimaryButtonBinding(toolOptions) { const primaryBindings = this.getDefaultPrimaryBindings(); return toolOptions?.bindings?.some(binding => primaryBindings.some(primary => hasSameBinding(binding, primary))); } _renderViewports() { this.viewportsInfo.forEach(({ renderingEngineId, viewportId }) => { (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__.getRenderingEngine)(renderingEngineId).renderViewport(viewportId); }); } _triggerToolModeChangedEvent(toolName, mode, toolBindingsOptions) { const eventDetail = { toolGroupId: this.id, toolName, mode, toolBindingsOptions }; (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_8__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__["default"], _enums__WEBPACK_IMPORTED_MODULE_2__["default"].TOOL_MODE_CHANGED, eventDetail); } _findRenderingEngine(viewportId, renderingEngineId) { const renderingEngines = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__.getRenderingEngines)(); if (renderingEngines?.length === 0) { throw new Error('No rendering engines found.'); } if (renderingEngineId) { return renderingEngineId; } const matchingEngines = renderingEngines.filter(engine => engine.getViewport(viewportId)); if (matchingEngines.length === 0) { if (renderingEngines.length === 1) { return renderingEngines[0].id; } throw new Error('No rendering engines found that contain the viewport with the same viewportId, you must specify a renderingEngineId.'); } if (matchingEngines.length > 1) { throw new Error('Multiple rendering engines found that contain the viewport with the same viewportId, you must specify a renderingEngineId.'); } return matchingEngines[0].id; } } function hasSameBinding(binding1, binding2) { if (binding1.mouseButton !== binding2.mouseButton) { return false; } if (binding1.numTouchPoints !== binding2.numTouchPoints) { return false; } return binding1.modifierKey === binding2.modifierKey; } /***/ }, /***/ 14904 /*!**********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/store/ToolGroupManager/createToolGroup.js ***! \**********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../state */ 90125); /* harmony import */ var _ToolGroup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ToolGroup */ 64324); function createToolGroup(toolGroupId) { const toolGroupWithIdExists = _state__WEBPACK_IMPORTED_MODULE_0__.state.toolGroups.some(tg => tg.id === toolGroupId); if (toolGroupWithIdExists) { console.warn(`'${toolGroupId}' already exists.`); return; } const toolGroup = new _ToolGroup__WEBPACK_IMPORTED_MODULE_1__["default"](toolGroupId); _state__WEBPACK_IMPORTED_MODULE_0__.state.toolGroups.push(toolGroup); return toolGroup; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (createToolGroup); /***/ }, /***/ 19107 /*!**************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/store/ToolGroupManager/destroy.js ***! \**************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../state */ 90125); /* harmony import */ var _destroyToolGroup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./destroyToolGroup */ 80338); function destroy() { const toolGroups = [..._state__WEBPACK_IMPORTED_MODULE_0__.state.toolGroups]; for (const toolGroup of toolGroups) { (0,_destroyToolGroup__WEBPACK_IMPORTED_MODULE_1__["default"])(toolGroup.id); } _state__WEBPACK_IMPORTED_MODULE_0__.state.toolGroups = []; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (destroy); /***/ }, /***/ 80338 /*!***********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/store/ToolGroupManager/destroyToolGroup.js ***! \***********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../state */ 90125); function destroyToolGroup(toolGroupId) { const toolGroupIndex = _state__WEBPACK_IMPORTED_MODULE_0__.state.toolGroups.findIndex(tg => tg.id === toolGroupId); if (toolGroupIndex > -1) { _state__WEBPACK_IMPORTED_MODULE_0__.state.toolGroups.splice(toolGroupIndex, 1); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (destroyToolGroup); /***/ }, /***/ 92792 /*!*******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/store/ToolGroupManager/getToolGroup.js ***! \*******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../state */ 90125); function getToolGroup(toolGroupId) { return _state__WEBPACK_IMPORTED_MODULE_0__.state.toolGroups.find(s => s.id === toolGroupId); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getToolGroup); /***/ }, /***/ 43551 /*!******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/store/ToolGroupManager/getToolGroupForViewport.js ***! \******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 77569); /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../state */ 90125); function getToolGroupForViewport(viewportId, renderingEngineId) { if (!renderingEngineId) { renderingEngineId = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getRenderingEngines)().find(re => re.getViewports().find(vp => vp.id === viewportId))?.id; } const toolGroupFilteredByIds = _state__WEBPACK_IMPORTED_MODULE_1__.state.toolGroups.filter(tg => tg.viewportsInfo.some(vp => vp.renderingEngineId === renderingEngineId && (!vp.viewportId || vp.viewportId === viewportId))); if (!toolGroupFilteredByIds.length) { return; } if (toolGroupFilteredByIds.length > 1) { throw new Error(`Multiple tool groups found for renderingEngineId: ${renderingEngineId} and viewportId: ${viewportId}. You should only have one tool group per viewport in a renderingEngine.`); } return toolGroupFilteredByIds[0]; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getToolGroupForViewport); /***/ }, /***/ 69762 /*!********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/store/ToolGroupManager/getToolGroupsWithToolName.js ***! \********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../state */ 90125); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../enums */ 92925); const MODES = [_enums__WEBPACK_IMPORTED_MODULE_1__["default"].Active, _enums__WEBPACK_IMPORTED_MODULE_1__["default"].Passive, _enums__WEBPACK_IMPORTED_MODULE_1__["default"].Enabled]; function getToolGroupsWithToolName(toolName) { return _state__WEBPACK_IMPORTED_MODULE_0__.state.toolGroups.filter(({ toolOptions }) => { const toolGroupToolNames = Object.keys(toolOptions); for (let i = 0; i < toolGroupToolNames.length; i++) { if (toolName !== toolGroupToolNames[i]) { continue; } if (!toolOptions[toolName]) { continue; } if (MODES.includes(toolOptions[toolName].mode)) { return true; } } return false; }); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getToolGroupsWithToolName); /***/ }, /***/ 98896 /*!*******************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/store/addEnabledElement.js ***! \*******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ addEnabledElement) /* harmony export */ }); /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../eventListeners */ 92582); /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../eventListeners */ 41026); /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../eventListeners */ 84602); /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../eventListeners */ 83170); /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../eventListeners */ 6738); /* harmony import */ var _eventDispatchers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../eventDispatchers */ 58128); /* harmony import */ var _eventDispatchers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../eventDispatchers */ 42511); /* harmony import */ var _eventDispatchers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../eventDispatchers */ 8153); /* harmony import */ var _eventDispatchers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../eventDispatchers */ 58740); /* harmony import */ var _eventDispatchers__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../eventDispatchers */ 90507); /* harmony import */ var _eventDispatchers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../eventDispatchers */ 55475); /* harmony import */ var _eventDispatchers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../eventDispatchers */ 21046); /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./state */ 90125); /* harmony import */ var _stateManagement_annotation_AnnotationRenderingEngine__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../stateManagement/annotation/AnnotationRenderingEngine */ 99024); function addEnabledElement(evt) { const { element, viewportId } = evt.detail; const svgLayer = _createSvgAnnotationLayer(viewportId); _setSvgNodeCache(element); _appendChild(svgLayer, element); _stateManagement_annotation_AnnotationRenderingEngine__WEBPACK_IMPORTED_MODULE_13__.annotationRenderingEngine.addViewportElement(viewportId, element); _eventListeners__WEBPACK_IMPORTED_MODULE_0__["default"].enable(element); _eventListeners__WEBPACK_IMPORTED_MODULE_2__["default"].enable(element); _eventListeners__WEBPACK_IMPORTED_MODULE_1__["default"].enable(element); _eventListeners__WEBPACK_IMPORTED_MODULE_4__["default"].enable(element); _eventListeners__WEBPACK_IMPORTED_MODULE_3__["default"].enable(element); _eventDispatchers__WEBPACK_IMPORTED_MODULE_5__["default"].enable(element); _eventDispatchers__WEBPACK_IMPORTED_MODULE_8__["default"].enable(element); _eventDispatchers__WEBPACK_IMPORTED_MODULE_9__["default"].enable(element); _eventDispatchers__WEBPACK_IMPORTED_MODULE_11__["default"].enable(element); _eventDispatchers__WEBPACK_IMPORTED_MODULE_6__["default"].enable(element); _eventDispatchers__WEBPACK_IMPORTED_MODULE_7__["default"].enable(element); _eventDispatchers__WEBPACK_IMPORTED_MODULE_10__["default"].enable(element); _state__WEBPACK_IMPORTED_MODULE_12__.state.enabledElements.push(element); } function _createSvgAnnotationLayer(viewportId) { const svgns = 'http://www.w3.org/2000/svg'; const svgLayer = document.createElementNS(svgns, 'svg'); const svgLayerId = `svg-layer-${viewportId}`; svgLayer.classList.add('svg-layer'); svgLayer.setAttribute('id', svgLayerId); svgLayer.setAttribute('xmlns', 'http://www.w3.org/2000/svg'); svgLayer.style.width = '100%'; svgLayer.style.height = '100%'; svgLayer.style.pointerEvents = 'none'; svgLayer.style.position = 'absolute'; const defs = document.createElementNS(svgns, 'defs'); const filter = document.createElementNS(svgns, 'filter'); const feOffset = document.createElementNS(svgns, 'feOffset'); const feColorMatrix = document.createElementNS(svgns, 'feColorMatrix'); const feBlend = document.createElementNS(svgns, 'feBlend'); filter.setAttribute('id', `shadow-${svgLayerId}`); filter.setAttribute('filterUnits', 'userSpaceOnUse'); feOffset.setAttribute('result', 'offOut'); feOffset.setAttribute('in', 'SourceGraphic'); feOffset.setAttribute('dx', '0.5'); feOffset.setAttribute('dy', '0.5'); feColorMatrix.setAttribute('result', 'matrixOut'); feColorMatrix.setAttribute('in', 'offOut'); feColorMatrix.setAttribute('in2', 'matrix'); feColorMatrix.setAttribute('values', '0.2 0 0 0 0 0 0.2 0 0 0 0 0 0.2 0 0 0 0 0 1 0'); feBlend.setAttribute('in', 'SourceGraphic'); feBlend.setAttribute('in2', 'matrixOut'); feBlend.setAttribute('mode', 'normal'); filter.appendChild(feOffset); filter.appendChild(feColorMatrix); filter.appendChild(feBlend); defs.appendChild(filter); svgLayer.appendChild(defs); return svgLayer; } function _setSvgNodeCache(element) { const { viewportUid: viewportId, renderingEngineUid: renderingEngineId } = element.dataset; const elementHash = `${viewportId}:${renderingEngineId}`; _state__WEBPACK_IMPORTED_MODULE_12__.state.svgNodeCache[elementHash] = {}; } function _appendChild(newNode, referenceNode) { referenceNode.querySelector('div.viewport-element').appendChild(newNode); } /***/ }, /***/ 49541 /*!*********************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/store/addTool.js ***! \*********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ addTool: () => (/* binding */ addTool), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ hasTool: () => (/* binding */ hasTool), /* harmony export */ hasToolByName: () => (/* binding */ hasToolByName), /* harmony export */ removeTool: () => (/* binding */ removeTool) /* harmony export */ }); /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./state */ 90125); function addTool(ToolClass) { const toolName = ToolClass.toolName; if (!toolName) { throw new Error(`No Tool Found for the ToolClass ${ToolClass.name}`); } if (!_state__WEBPACK_IMPORTED_MODULE_0__.state.tools[toolName]) { _state__WEBPACK_IMPORTED_MODULE_0__.state.tools[toolName] = { toolClass: ToolClass }; } } function hasTool(ToolClass) { const toolName = ToolClass.toolName; return !!(toolName && _state__WEBPACK_IMPORTED_MODULE_0__.state.tools[toolName]); } function hasToolByName(toolName) { return !!(toolName && _state__WEBPACK_IMPORTED_MODULE_0__.state.tools[toolName]); } function removeTool(ToolClass) { const toolName = ToolClass.toolName; if (!toolName) { throw new Error(`No tool found for: ${ToolClass.name}`); } if (!_state__WEBPACK_IMPORTED_MODULE_0__.state.tools[toolName] !== undefined) { delete _state__WEBPACK_IMPORTED_MODULE_0__.state.tools[toolName]; } else { throw new Error(`${toolName} cannot be removed because it has not been added`); } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (addTool); /***/ }, /***/ 16945 /*!*******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/store/filterMoveableAnnotationTools.js ***! \*******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ filterMoveableAnnotationTools) /* harmony export */ }); function filterMoveableAnnotationTools(element, ToolAndAnnotations, canvasCoords, interactionType = 'mouse') { const proximity = interactionType === 'touch' ? 36 : 6; const moveableAnnotationTools = []; ToolAndAnnotations.forEach(({ tool, annotations }) => { for (const annotation of annotations) { if (annotation.isLocked || !annotation.isVisible) { continue; } const near = tool.isPointNearTool(element, annotation, canvasCoords, proximity, interactionType); if (near) { moveableAnnotationTools.push({ tool, annotation }); break; } } }); return moveableAnnotationTools; } /***/ }, /***/ 55694 /*!**************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/store/filterToolsWithAnnotationsForElement.js ***! \**************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ filterToolsWithAnnotationsForElement) /* harmony export */ }); /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../stateManagement/annotation/annotationState */ 24703); function filterToolsWithAnnotationsForElement(element, tools) { const result = []; for (let i = 0; i < tools.length; i++) { const tool = tools[i]; if (!tool) { console.warn('undefined tool in filterToolsWithAnnotationsForElement'); continue; } let annotations = (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__.getAnnotations)(tool.constructor.toolName, element); if (!annotations?.length) { continue; } if (typeof tool.filterInteractableAnnotationsForElement === 'function') { annotations = tool.filterInteractableAnnotationsForElement(element, annotations); } if (annotations?.length > 0) { result.push({ tool, annotations }); } } return result; } /***/ }, /***/ 31433 /*!********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/store/filterToolsWithMoveableHandles.js ***! \********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ filterToolsWithMoveableHandles) /* harmony export */ }); function filterToolsWithMoveableHandles(element, ToolAndAnnotations, canvasCoords, interactionType = 'mouse') { const proximity = interactionType === 'touch' ? 36 : 6; const toolsWithMoveableHandles = []; ToolAndAnnotations.forEach(({ tool, annotations }) => { for (const annotation of annotations) { if (annotation.isLocked || !annotation.isVisible) { continue; } const handle = tool.getHandleNearImagePoint(element, annotation, canvasCoords, proximity); if (handle) { toolsWithMoveableHandles.push({ tool, annotation, handle }); break; } } }); return toolsWithMoveableHandles; } /***/ }, /***/ 3413 /*!**********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/store/removeEnabledElement.js ***! \**********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../eventListeners */ 92582); /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../eventListeners */ 41026); /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../eventListeners */ 84602); /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../eventListeners */ 83170); /* harmony import */ var _eventListeners__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../eventListeners */ 6738); /* harmony import */ var _eventDispatchers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../eventDispatchers */ 58128); /* harmony import */ var _eventDispatchers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../eventDispatchers */ 42511); /* harmony import */ var _eventDispatchers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../eventDispatchers */ 8153); /* harmony import */ var _eventDispatchers__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../eventDispatchers */ 58740); /* harmony import */ var _eventDispatchers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../eventDispatchers */ 90507); /* harmony import */ var _eventDispatchers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../eventDispatchers */ 55475); /* harmony import */ var _eventDispatchers__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../eventDispatchers */ 21046); /* harmony import */ var _filterToolsWithAnnotationsForElement__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./filterToolsWithAnnotationsForElement */ 55694); /* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./state */ 90125); /* harmony import */ var _utilities_getToolsWithModesForElement__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../utilities/getToolsWithModesForElement */ 40685); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../enums */ 92925); /* harmony import */ var _stateManagement__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../stateManagement */ 24703); /* harmony import */ var _SynchronizerManager_getSynchronizersForViewport__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./SynchronizerManager/getSynchronizersForViewport */ 70626); /* harmony import */ var _ToolGroupManager_getToolGroupForViewport__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./ToolGroupManager/getToolGroupForViewport */ 43551); /* harmony import */ var _stateManagement_annotation_AnnotationRenderingEngine__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../stateManagement/annotation/AnnotationRenderingEngine */ 99024); const VIEWPORT_ELEMENT = 'viewport-element'; function removeEnabledElement(elementDisabledEvt) { const { element, viewportId } = elementDisabledEvt.detail; _resetSvgNodeCache(element); _removeSvgNode(element); _stateManagement_annotation_AnnotationRenderingEngine__WEBPACK_IMPORTED_MODULE_20__.annotationRenderingEngine.removeViewportElement(viewportId, element); _eventListeners__WEBPACK_IMPORTED_MODULE_1__["default"].disable(element); _eventListeners__WEBPACK_IMPORTED_MODULE_3__["default"].disable(element); _eventListeners__WEBPACK_IMPORTED_MODULE_2__["default"].disable(element); _eventListeners__WEBPACK_IMPORTED_MODULE_5__["default"].disable(element); _eventListeners__WEBPACK_IMPORTED_MODULE_4__["default"].disable(element); _eventDispatchers__WEBPACK_IMPORTED_MODULE_6__["default"].disable(element); _eventDispatchers__WEBPACK_IMPORTED_MODULE_9__["default"].disable(element); _eventDispatchers__WEBPACK_IMPORTED_MODULE_10__["default"].disable(element); _eventDispatchers__WEBPACK_IMPORTED_MODULE_12__["default"].disable(element); _eventDispatchers__WEBPACK_IMPORTED_MODULE_7__["default"].disable(element); _eventDispatchers__WEBPACK_IMPORTED_MODULE_8__["default"].disable(element); _eventDispatchers__WEBPACK_IMPORTED_MODULE_11__["default"].disable(element); _removeViewportFromSynchronizers(element); _removeViewportFromToolGroup(element); _removeEnabledElement(element); } const _removeViewportFromSynchronizers = element => { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element); if (!enabledElement) { return; } const synchronizers = (0,_SynchronizerManager_getSynchronizersForViewport__WEBPACK_IMPORTED_MODULE_18__["default"])(enabledElement.viewportId, enabledElement.renderingEngineId); synchronizers.forEach(sync => { sync.remove(enabledElement); }); }; const _removeViewportFromToolGroup = element => { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element); if (!enabledElement) { return; } const { renderingEngineId, viewportId } = enabledElement; const toolGroup = (0,_ToolGroupManager_getToolGroupForViewport__WEBPACK_IMPORTED_MODULE_19__["default"])(viewportId, renderingEngineId); if (toolGroup) { toolGroup.removeViewports(renderingEngineId, viewportId); } }; const _removeAllToolsForElement = function (element) { const tools = (0,_utilities_getToolsWithModesForElement__WEBPACK_IMPORTED_MODULE_15__["default"])(element, [_enums__WEBPACK_IMPORTED_MODULE_16__["default"].Active, _enums__WEBPACK_IMPORTED_MODULE_16__["default"].Passive]); const toolsWithData = (0,_filterToolsWithAnnotationsForElement__WEBPACK_IMPORTED_MODULE_13__["default"])(element, tools); toolsWithData.forEach(({ annotations }) => { annotations.forEach(annotation => { (0,_stateManagement__WEBPACK_IMPORTED_MODULE_17__.removeAnnotation)(annotation.annotationUID); }); }); }; function _resetSvgNodeCache(element) { const { viewportUid: viewportId, renderingEngineUid: renderingEngineId } = element.dataset; const elementHash = `${viewportId}:${renderingEngineId}`; delete _state__WEBPACK_IMPORTED_MODULE_14__.state.svgNodeCache[elementHash]; } function _removeSvgNode(element) { const internalViewportNode = element.querySelector(`div.${VIEWPORT_ELEMENT}`); const svgLayer = internalViewportNode.querySelector('svg'); if (svgLayer) { internalViewportNode.removeChild(svgLayer); } } const _removeEnabledElement = function (element) { const foundElementIndex = _state__WEBPACK_IMPORTED_MODULE_14__.state.enabledElements.findIndex(el => el === element); if (foundElementIndex > -1) { _state__WEBPACK_IMPORTED_MODULE_14__.state.enabledElements.splice(foundElementIndex, 1); } }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (removeEnabledElement); /***/ }, /***/ 90125 /*!*******************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/store/state.js ***! \*******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ state), /* harmony export */ resetCornerstoneToolsState: () => (/* binding */ resetCornerstoneToolsState), /* harmony export */ state: () => (/* binding */ state) /* harmony export */ }); /* harmony import */ var _svgNodeCache__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./svgNodeCache */ 91934); const defaultState = { isInteractingWithTool: false, isMultiPartToolActive: false, tools: {}, toolGroups: [], synchronizers: [], svgNodeCache: _svgNodeCache__WEBPACK_IMPORTED_MODULE_0__["default"], enabledElements: [], handleRadius: 6 }; let state = { isInteractingWithTool: false, isMultiPartToolActive: false, tools: {}, toolGroups: [], synchronizers: [], svgNodeCache: _svgNodeCache__WEBPACK_IMPORTED_MODULE_0__["default"], enabledElements: [], handleRadius: 6 }; function resetCornerstoneToolsState() { (0,_svgNodeCache__WEBPACK_IMPORTED_MODULE_0__.resetSvgNodeCache)(); state = { ...structuredClone({ ...defaultState, svgNodeCache: {} }), svgNodeCache: { ...defaultState.svgNodeCache } }; } /***/ }, /***/ 91934 /*!**************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/store/svgNodeCache.js ***! \**************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ resetSvgNodeCache: () => (/* binding */ resetSvgNodeCache) /* harmony export */ }); let svgNodeCache = {}; function resetSvgNodeCache() { svgNodeCache = {}; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (svgNodeCache); /***/ }, /***/ 1773 /*!*****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/StackScrollTool.js ***! \*****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 93667); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 19401); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/core */ 3892); /* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./base */ 4003); class StackScrollTool extends _base__WEBPACK_IMPORTED_MODULE_4__["default"] { constructor(toolProps = {}, defaultToolProps = { supportedInteractionTypes: ['Mouse', 'Touch'], configuration: { invert: false, debounceIfNotLoaded: true, loop: false } }) { super(toolProps, defaultToolProps); this.deltaY = 1; } mouseWheelCallback(evt) { this._scroll(evt); } mouseDragCallback(evt) { this._dragCallback(evt); } touchDragCallback(evt) { this._dragCallback(evt); } _dragCallback(evt) { this._scrollDrag(evt); } _scrollDrag(evt) { const { deltaPoints, viewportId, renderingEngineId } = evt.detail; const { viewport } = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.getEnabledElementByIds)(viewportId, renderingEngineId); const { debounceIfNotLoaded, invert, loop } = this.configuration; const deltaPointY = deltaPoints.canvas[1]; let volumeId; if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"]) { volumeId = viewport.getVolumeId(); } const pixelsPerImage = this._getPixelPerImage(viewport); const deltaY = deltaPointY + this.deltaY; if (!pixelsPerImage) { return; } if (Math.abs(deltaY) >= pixelsPerImage) { const imageIdIndexOffset = Math.round(deltaY / pixelsPerImage); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__["default"](viewport, { delta: invert ? -imageIdIndexOffset : imageIdIndexOffset, volumeId, debounceLoading: debounceIfNotLoaded, loop: loop }); this.deltaY = deltaY % pixelsPerImage; } else { this.deltaY = deltaY; } } _scroll(evt) { const { wheel, element } = evt.detail; const { direction } = wheel; const { invert } = this.configuration; const { viewport } = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(element); const delta = direction * (invert ? -1 : 1); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__["default"](viewport, { delta, debounceLoading: this.configuration.debounceIfNotLoaded, loop: this.configuration.loop, volumeId: viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"] ? viewport.getVolumeId() : undefined, scrollSlabs: this.configuration.scrollSlabs }); } _getPixelPerImage(viewport) { const { element } = viewport; const numberOfSlices = viewport.getNumberOfSlices(); return Math.max(2, element.offsetHeight / Math.max(numberOfSlices, 8)); } } StackScrollTool.toolName = 'StackScroll'; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (StackScrollTool); /***/ }, /***/ 57265 /*!**************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/annotation/PlanarFreehandContourSegmentationTool.js ***! \**************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ PlanarFreehandContourSegmentationTool: () => (/* binding */ PlanarFreehandContourSegmentationTool), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 70391); /* harmony import */ var _stateManagement_segmentation_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../stateManagement/segmentation/triggerSegmentationEvents */ 82703); /* harmony import */ var _PlanarFreehandROITool__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PlanarFreehandROITool */ 3383); /* harmony import */ var _utilities_contours_AnnotationToPointData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utilities/contours/AnnotationToPointData */ 91683); class PlanarFreehandContourSegmentationTool extends _PlanarFreehandROITool__WEBPACK_IMPORTED_MODULE_2__["default"] { static { this.toolName = 'PlanarFreehandContourSegmentationTool'; } constructor(toolProps) { const initialProps = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"]({ configuration: { calculateStats: false, allowOpenContours: false } }, toolProps); super(initialProps); } static { _utilities_contours_AnnotationToPointData__WEBPACK_IMPORTED_MODULE_3__["default"].register(this); } isContourSegmentationTool() { return true; } renderAnnotationInstance(renderContext) { const annotation = renderContext.annotation; const { invalidated } = annotation; const renderResult = super.renderAnnotationInstance(renderContext); if (invalidated) { const { segmentationId } = annotation.data.segmentation; (0,_stateManagement_segmentation_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_1__.triggerSegmentationDataModified)(segmentationId); } return renderResult; } } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PlanarFreehandContourSegmentationTool); /***/ }, /***/ 3383 /*!**********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/annotation/PlanarFreehandROITool.js ***! \**********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 78220); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 93667); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/core */ 90161); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @cornerstonejs/core */ 19598); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @cornerstonejs/core */ 85493); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @cornerstonejs/core */ 17137); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @cornerstonejs/core */ 70391); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @cornerstonejs/core */ 72560); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../utilities/getCalibratedUnits */ 6423); /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../utilities/math */ 5431); /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../utilities/math */ 4265); /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../utilities/math */ 96800); /* harmony import */ var _utilities_planar__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../utilities/planar */ 77337); /* harmony import */ var _utilities_throttle__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../utilities/throttle */ 79909); /* harmony import */ var _utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../utilities/viewportFilters */ 68348); /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../utilities/triggerAnnotationRenderForViewportIds */ 613); /* harmony import */ var _planarFreehandROITool_drawLoop__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./planarFreehandROITool/drawLoop */ 29602); /* harmony import */ var _planarFreehandROITool_editLoopCommon__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./planarFreehandROITool/editLoopCommon */ 69353); /* harmony import */ var _planarFreehandROITool_closedContourEditLoop__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./planarFreehandROITool/closedContourEditLoop */ 40640); /* harmony import */ var _planarFreehandROITool_openContourEditLoop__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./planarFreehandROITool/openContourEditLoop */ 59220); /* harmony import */ var _planarFreehandROITool_openContourEndEditLoop__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./planarFreehandROITool/openContourEndEditLoop */ 48059); /* harmony import */ var _planarFreehandROITool_renderMethods__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./planarFreehandROITool/renderMethods */ 22282); /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../stateManagement/annotation/helpers/state */ 9906); /* harmony import */ var _utilities_math_polyline__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../../utilities/math/polyline */ 81611); /* harmony import */ var _utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../../utilities/viewport/isViewportPreScaled */ 58377); /* harmony import */ var _utilities_math_basic__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../utilities/math/basic */ 96064); /* harmony import */ var _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../base/ContourSegmentationBaseTool */ 12329); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../../enums */ 64543); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../../enums */ 46190); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../../enums */ 50319); /* harmony import */ var _utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../../utilities/getPixelValueUnits */ 46893); const { pointCanProjectOnLine } = _utilities_math__WEBPACK_IMPORTED_MODULE_12__; const { EPSILON } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__; const PARALLEL_THRESHOLD = 1 - EPSILON; class PlanarFreehandROITool extends _base_ContourSegmentationBaseTool__WEBPACK_IMPORTED_MODULE_28__["default"] { static { this.toolName = 'PlanarFreehandROI'; } constructor(toolProps = {}, defaultToolProps = { supportedInteractionTypes: ['Mouse', 'Touch'], configuration: { storePointData: false, shadow: true, preventHandleOutsideImage: false, contourHoleAdditionModifierKey: _enums__WEBPACK_IMPORTED_MODULE_29__.KeyboardBindings.Shift, alwaysRenderOpenContourHandles: { enabled: false, radius: 2 }, allowOpenContours: true, closeContourProximity: 10, checkCanvasEditFallbackProximity: 6, makeClockWise: true, subPixelResolution: 4, smoothing: { smoothOnAdd: false, smoothOnEdit: false, knotsRatioPercentageOnAdd: 40, knotsRatioPercentageOnEdit: 40 }, interpolation: { enabled: false, onInterpolationComplete: null }, decimate: { enabled: false, epsilon: 0.1 }, displayOnePointAsCrosshairs: false, calculateStats: true, getTextLines: defaultGetTextLines, statsCalculator: _utilities_math_basic__WEBPACK_IMPORTED_MODULE_27__.BasicStatsCalculator } }) { super(toolProps, defaultToolProps); this.isDrawing = false; this.isEditingClosed = false; this.isEditingOpen = false; this.addNewAnnotation = evt => { const eventDetail = evt.detail; const { element } = eventDetail; const annotation = this.createAnnotation(evt); this.addAnnotation(annotation, element); const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_16__["default"])(element, this.getToolName()); this.activateDraw(evt, annotation, viewportIdsToRender); evt.preventDefault(); (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_17__["default"])(viewportIdsToRender); return annotation; }; this.handleSelectedCallback = (evt, annotation, handle) => { const eventDetail = evt.detail; const { element } = eventDetail; const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_16__["default"])(element, this.getToolName()); this.activateOpenContourEndEdit(evt, annotation, viewportIdsToRender, handle); }; this.toolSelectedCallback = (evt, annotation) => { const eventDetail = evt.detail; const { element } = eventDetail; const viewportIdsToRender = (0,_utilities_viewportFilters__WEBPACK_IMPORTED_MODULE_16__["default"])(element, this.getToolName()); if (annotation.data.contour.closed) { this.activateClosedContourEdit(evt, annotation, viewportIdsToRender); } else { this.activateOpenContourEdit(evt, annotation, viewportIdsToRender); } evt.preventDefault(); }; this.isPointNearTool = (element, annotation, canvasCoords, proximity) => { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(element); const { viewport } = enabledElement; const { polyline: points } = annotation.data.contour; let previousPoint = viewport.worldToCanvas(points[0]); for (let i = 1; i < points.length; i++) { const p1 = previousPoint; const p2 = viewport.worldToCanvas(points[i]); const canProject = pointCanProjectOnLine(canvasCoords, p1, p2, proximity); if (canProject) { return true; } previousPoint = p2; } if (!annotation.data.contour.closed) { return false; } const pStart = viewport.worldToCanvas(points[0]); const pEnd = viewport.worldToCanvas(points[points.length - 1]); return pointCanProjectOnLine(canvasCoords, pStart, pEnd, proximity); }; this.cancel = element => { const isDrawing = this.isDrawing; const isEditingOpen = this.isEditingOpen; const isEditingClosed = this.isEditingClosed; if (isDrawing) { this.cancelDrawing(element); } else if (isEditingOpen) { this.cancelOpenContourEdit(element); } else if (isEditingClosed) { this.cancelClosedContourEdit(element); } }; this._calculateCachedStats = (annotation, viewport, renderingEngine, enabledElement) => { const { data } = annotation; const { cachedStats } = data; const { polyline: points, closed } = data.contour; const targetIds = Object.keys(cachedStats); for (let i = 0; i < targetIds.length; i++) { const targetId = targetIds[i]; const image = this.getTargetImageData(targetId); if (!image) { continue; } const { imageData, metadata } = image; const canvasCoordinates = points.map(p => viewport.worldToCanvas(p)); const modalityUnitOptions = { isPreScaled: (0,_utilities_viewport_isViewportPreScaled__WEBPACK_IMPORTED_MODULE_26__.isViewportPreScaled)(viewport, targetId), isSuvScaled: this.isSuvScaled(viewport, targetId, annotation.metadata.referencedImageId) }; const modalityUnit = (0,_utilities_getPixelValueUnits__WEBPACK_IMPORTED_MODULE_32__.getPixelValueUnits)(metadata.Modality, annotation.metadata.referencedImageId, modalityUnitOptions); const polyline = data.contour.polyline; const numPoints = polyline.length; const projectedPolyline = new Array(numPoints); for (let i = 0; i < numPoints; i++) { projectedPolyline[i] = viewport.worldToCanvas(polyline[i]); } const { maxX: canvasMaxX, maxY: canvasMaxY, minX: canvasMinX, minY: canvasMinY } = _utilities_math__WEBPACK_IMPORTED_MODULE_11__["default"](projectedPolyline); const topLeftBBWorld = viewport.canvasToWorld([canvasMinX, canvasMinY]); const topLeftBBIndex = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__["default"](imageData, topLeftBBWorld); const bottomRightBBWorld = viewport.canvasToWorld([canvasMaxX, canvasMaxY]); const bottomRightBBIndex = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__["default"](imageData, bottomRightBBWorld); const handles = [topLeftBBIndex, bottomRightBBIndex]; const calibratedScale = (0,_utilities_getCalibratedUnits__WEBPACK_IMPORTED_MODULE_10__.getCalibratedLengthUnitsAndScale)(image, handles); const canvasPoint = canvasCoordinates[0]; const originalWorldPoint = viewport.canvasToWorld(canvasPoint); const deltaXPoint = viewport.canvasToWorld([canvasPoint[0] + 1, canvasPoint[1]]); const deltaYPoint = viewport.canvasToWorld([canvasPoint[0], canvasPoint[1] + 1]); const deltaInX = gl_matrix__WEBPACK_IMPORTED_MODULE_9__.distance(originalWorldPoint, deltaXPoint); const deltaInY = gl_matrix__WEBPACK_IMPORTED_MODULE_9__.distance(originalWorldPoint, deltaYPoint); const statsArgs = { targetId, viewport, canvasCoordinates, points, imageData, metadata, cachedStats, modalityUnit, calibratedScale, deltaInX, deltaInY }; if (closed) { this.updateClosedCachedStats(statsArgs); } else { this.updateOpenCachedStats(statsArgs); } } const invalidated = annotation.invalidated; annotation.invalidated = false; if (invalidated) { (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_24__.triggerAnnotationModified)(annotation, enabledElement.viewport.element, _enums__WEBPACK_IMPORTED_MODULE_30__["default"].StatsUpdated); } return cachedStats; }; this._renderStats = (annotation, viewport, enabledElement, svgDrawingHelper) => { const { data } = annotation; const targetId = this.getTargetId(viewport, data); const styleSpecifier = { toolGroupId: this.toolGroupId, toolName: this.getToolName(), viewportId: enabledElement.viewport.id, annotationUID: annotation.annotationUID }; const textLines = this.configuration.getTextLines(data, targetId); if (!textLines || textLines.length === 0) { return; } const canvasCoordinates = data.contour.polyline.map(p => viewport.worldToCanvas(p)); this.renderLinkedTextBoxAnnotation({ enabledElement, svgDrawingHelper, annotation, styleSpecifier, textLines, canvasCoordinates }); }; (0,_planarFreehandROITool_drawLoop__WEBPACK_IMPORTED_MODULE_18__["default"])(this); (0,_planarFreehandROITool_editLoopCommon__WEBPACK_IMPORTED_MODULE_19__["default"])(this); (0,_planarFreehandROITool_closedContourEditLoop__WEBPACK_IMPORTED_MODULE_20__["default"])(this); (0,_planarFreehandROITool_openContourEditLoop__WEBPACK_IMPORTED_MODULE_21__["default"])(this); (0,_planarFreehandROITool_openContourEndEditLoop__WEBPACK_IMPORTED_MODULE_22__["default"])(this); (0,_planarFreehandROITool_renderMethods__WEBPACK_IMPORTED_MODULE_23__["default"])(this); this._throttledCalculateCachedStats = (0,_utilities_throttle__WEBPACK_IMPORTED_MODULE_15__["default"])(this._calculateCachedStats, 100, { trailing: true }); } filterInteractableAnnotationsForElement(element, annotations) { if (!annotations?.length) { return []; } const baseFilteredAnnotations = super.filterInteractableAnnotationsForElement(element, annotations); if (!baseFilteredAnnotations?.length) { return []; } const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(element); const { viewport } = enabledElement; let annotationsToDisplay; if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"]) { const camera = viewport.getCamera(); const { spacingInNormalDirection } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__["default"](viewport, camera); annotationsToDisplay = this.filterAnnotationsWithinSlice(baseFilteredAnnotations, camera, spacingInNormalDirection); } else { annotationsToDisplay = (0,_utilities_planar__WEBPACK_IMPORTED_MODULE_14__["default"])(viewport, annotations); } return annotationsToDisplay; } filterAnnotationsWithinSlice(annotations, camera, spacingInNormalDirection) { const { viewPlaneNormal } = camera; const annotationsWithParallelNormals = annotations.filter(td => { let annotationViewPlaneNormal = td.metadata.viewPlaneNormal; if (!td.metadata.referencedImageId && !annotationViewPlaneNormal && td.metadata.FrameOfReferenceUID) { for (const point of td.data.contour.polyline) { const vector = gl_matrix__WEBPACK_IMPORTED_MODULE_9__.sub(gl_matrix__WEBPACK_IMPORTED_MODULE_9__.create(), point, camera.focalPoint); const dotProduct = gl_matrix__WEBPACK_IMPORTED_MODULE_9__.dot(vector, camera.viewPlaneNormal); if (!_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__.isEqual(dotProduct, 0)) { return false; } } td.metadata.viewPlaneNormal = camera.viewPlaneNormal; td.metadata.cameraFocalPoint = camera.focalPoint; return true; } if (!annotationViewPlaneNormal) { const { referencedImageId } = td.metadata; const { imageOrientationPatient } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__.get('imagePlaneModule', referencedImageId); const rowCosineVec = gl_matrix__WEBPACK_IMPORTED_MODULE_9__.fromValues(imageOrientationPatient[0], imageOrientationPatient[1], imageOrientationPatient[2]); const colCosineVec = gl_matrix__WEBPACK_IMPORTED_MODULE_9__.fromValues(imageOrientationPatient[3], imageOrientationPatient[4], imageOrientationPatient[5]); annotationViewPlaneNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_9__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_9__.cross(annotationViewPlaneNormal, rowCosineVec, colCosineVec); td.metadata.viewPlaneNormal = annotationViewPlaneNormal; } const isParallel = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_9__.dot(viewPlaneNormal, annotationViewPlaneNormal)) > PARALLEL_THRESHOLD; return annotationViewPlaneNormal && isParallel; }); if (!annotationsWithParallelNormals.length) { return []; } const halfSpacingInNormalDirection = spacingInNormalDirection / 2; const { focalPoint } = camera; const annotationsWithinSlice = []; for (const annotation of annotationsWithParallelNormals) { const data = annotation.data; const point = data.contour.polyline[0]; if (!annotation.isVisible) { continue; } const dir = gl_matrix__WEBPACK_IMPORTED_MODULE_9__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_9__.sub(dir, focalPoint, point); const dot = gl_matrix__WEBPACK_IMPORTED_MODULE_9__.dot(dir, viewPlaneNormal); if (Math.abs(dot) < halfSpacingInNormalDirection) { annotationsWithinSlice.push(annotation); } } return annotationsWithinSlice; } isContourSegmentationTool() { return false; } createAnnotation(evt) { const worldPos = evt.detail.currentPoints.world; const contourAnnotation = super.createAnnotation(evt); const onInterpolationComplete = annotation => { annotation.data.handles.points.length = 0; }; const annotation = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_7__["default"](contourAnnotation, { data: { contour: { polyline: [[...worldPos]] }, label: '', cachedStats: {} }, onInterpolationComplete }); return annotation; } getAnnotationStyle(context) { return super.getAnnotationStyle(context); } renderAnnotationInstance(renderContext) { const { enabledElement, targetId, svgDrawingHelper } = renderContext; const annotation = renderContext.annotation; let renderStatus = false; const { viewport, renderingEngine } = enabledElement; const isDrawing = this.isDrawing; const isEditingOpen = this.isEditingOpen; const isEditingClosed = this.isEditingClosed; if (!(isDrawing || isEditingOpen || isEditingClosed)) { if (this.configuration.displayOnePointAsCrosshairs && annotation.data.contour.polyline.length === 1) { this.renderPointContourWithMarker(enabledElement, svgDrawingHelper, annotation); } else { this.renderContour(enabledElement, svgDrawingHelper, annotation); } } else { const activeAnnotationUID = this.commonData.annotation.annotationUID; if (annotation.annotationUID === activeAnnotationUID) { if (isDrawing) { this.renderContourBeingDrawn(enabledElement, svgDrawingHelper, annotation); } else if (isEditingClosed) { this.renderClosedContourBeingEdited(enabledElement, svgDrawingHelper, annotation); } else if (isEditingOpen) { this.renderOpenContourBeingEdited(enabledElement, svgDrawingHelper, annotation); } else { throw new Error(`Unknown ${this.getToolName()} annotation rendering state`); } } else { if (this.configuration.displayOnePointAsCrosshairs && annotation.data.contour.polyline.length === 1) { this.renderPointContourWithMarker(enabledElement, svgDrawingHelper, annotation); } else { this.renderContour(enabledElement, svgDrawingHelper, annotation); } } renderStatus = true; } if (!this.configuration.calculateStats) { return; } if (annotation.invalidated) { this._calculateStatsIfActive(annotation, targetId, viewport, renderingEngine, enabledElement); } this._renderStats(annotation, viewport, enabledElement, svgDrawingHelper); return renderStatus; } _calculateStatsIfActive(annotation, targetId, viewport, renderingEngine, enabledElement) { const activeAnnotationUID = this.commonData?.annotation.annotationUID; if (annotation.annotationUID === activeAnnotationUID && !this.commonData?.movingTextBox) { return; } if (!this.commonData?.movingTextBox) { const { data } = annotation; if (!data.cachedStats[targetId]?.unit) { data.cachedStats[targetId] = { Modality: null, area: null, max: null, mean: null, stdDev: null, areaUnit: null, unit: null }; this._calculateCachedStats(annotation, viewport, renderingEngine, enabledElement); } else if (annotation.invalidated) { this._throttledCalculateCachedStats(annotation, viewport, renderingEngine, enabledElement); } } } updateClosedCachedStats({ viewport, points, imageData, metadata, cachedStats, targetId, modalityUnit, canvasCoordinates, calibratedScale, deltaInX, deltaInY }) { const { scale, areaUnit, unit } = calibratedScale; const { voxelManager } = viewport.getImageData(); const indexPoints = points.map(point => imageData.worldToIndex(point)); let iMin = Number.MAX_SAFE_INTEGER; let iMax = Number.MIN_SAFE_INTEGER; let jMin = Number.MAX_SAFE_INTEGER; let jMax = Number.MIN_SAFE_INTEGER; let kMin = Number.MAX_SAFE_INTEGER; let kMax = Number.MIN_SAFE_INTEGER; for (let j = 0; j < points.length; j++) { const worldPosIndex = indexPoints[j].map(Math.floor); iMin = Math.min(iMin, worldPosIndex[0]); iMax = Math.max(iMax, worldPosIndex[0]); jMin = Math.min(jMin, worldPosIndex[1]); jMax = Math.max(jMax, worldPosIndex[1]); kMin = Math.min(kMin, worldPosIndex[2]); kMax = Math.max(kMax, worldPosIndex[2]); } let area = _utilities_math__WEBPACK_IMPORTED_MODULE_13__["default"](canvasCoordinates) / scale / scale; area *= deltaInX * deltaInY; const perimeter = PlanarFreehandROITool.calculateLengthInIndex(calibratedScale, indexPoints, closed); const iDelta = 0.01 * (iMax - iMin); const jDelta = 0.01 * (jMax - jMin); const kDelta = 0.01 * (kMax - kMin); iMin = Math.floor(iMin - iDelta); iMax = Math.ceil(iMax + iDelta); jMin = Math.floor(jMin - jDelta); jMax = Math.ceil(jMax + jDelta); kMin = Math.floor(kMin - kDelta); kMax = Math.ceil(kMax + kDelta); const boundsIJK = [[iMin, iMax], [jMin, jMax], [kMin, kMax]]; const worldPosEnd = imageData.indexToWorld([iMax, jMax, kMax]); const canvasPosEnd = viewport.worldToCanvas(worldPosEnd); let curRow = 0; let intersections = []; let intersectionCounter = 0; let pointsInShape; if (voxelManager) { pointsInShape = voxelManager.forEach(this.configuration.statsCalculator.statsCallback, { imageData, isInObject: (pointLPS, _pointIJK) => { let result = true; const point = viewport.worldToCanvas(pointLPS); if (point[1] != curRow) { intersectionCounter = 0; curRow = point[1]; intersections = (0,_utilities_math_polyline__WEBPACK_IMPORTED_MODULE_25__["default"])(canvasCoordinates, point, [canvasPosEnd[0], point[1]]); intersections.sort(function (index) { return function (a, b) { return a[index] === b[index] ? 0 : a[index] < b[index] ? -1 : 1; }; }(0)); } if (intersections.length && point[0] > intersections[0][0]) { intersections.shift(); intersectionCounter++; } if (intersectionCounter % 2 === 0) { result = false; } return result; }, boundsIJK, returnPoints: this.configuration.storePointData }); } const stats = this.configuration.statsCalculator.getStatistics(); const namedArea = { name: 'area', value: area, unit: areaUnit, type: _enums__WEBPACK_IMPORTED_MODULE_31__.MeasurementType.Area }; const namedPerimeter = { name: 'perimeter', value: perimeter, unit, type: _enums__WEBPACK_IMPORTED_MODULE_31__.MeasurementType.Linear }; cachedStats[targetId] = { Modality: metadata.Modality, area, perimeter, mean: stats.mean?.value, max: stats.max?.value, min: stats.min?.value, stdDev: stats.stdDev?.value, statsArray: [namedArea, namedPerimeter, ...stats.array], pointsInShape: pointsInShape, areaUnit, modalityUnit, unit }; } updateOpenCachedStats({ targetId, metadata, cachedStats, modalityUnit, calibratedScale, imageData, points }) { const { unit } = calibratedScale; const indexPoints = points.map(point => imageData.worldToIndex(point)); const length = PlanarFreehandROITool.calculateLengthInIndex(calibratedScale, indexPoints); const namedLength = { name: 'length', value: length, unit, type: _enums__WEBPACK_IMPORTED_MODULE_31__.MeasurementType.Linear }; cachedStats[targetId] = { Modality: metadata.Modality, length, modalityUnit, unit, statArray: [namedLength] }; } } function defaultGetTextLines(data, targetId) { const cachedVolumeStats = data.cachedStats[targetId]; const { area, mean, stdDev, length, perimeter, max, min, isEmptyArea, unit, areaUnit, modalityUnit } = cachedVolumeStats || {}; const textLines = []; if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__.isNumber(area)) { const areaLine = isEmptyArea ? `Area: Oblique not supported` : `Area: ${_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_8__["default"](area)} ${areaUnit}`; textLines.push(areaLine); } if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__.isNumber(mean)) { textLines.push(`Mean: ${_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_8__["default"](mean)} ${modalityUnit}`); } if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__.isNumber(max)) { textLines.push(`Max: ${_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_8__["default"](max)} ${modalityUnit}`); } if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__.isNumber(min)) { textLines.push(`Min: ${_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_8__["default"](min)} ${modalityUnit}`); } if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__.isNumber(stdDev)) { textLines.push(`Std Dev: ${_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_8__["default"](stdDev)} ${modalityUnit}`); } if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__.isNumber(perimeter)) { textLines.push(`Perimeter: ${_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_8__["default"](perimeter)} ${unit}`); } if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__.isNumber(length)) { textLines.push(`${_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_8__["default"](length)} ${unit}`); } return textLines; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PlanarFreehandROITool); /***/ }, /***/ 40640 /*!********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/annotation/planarFreehandROITool/closedContourEditLoop.js ***! \********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 93067); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../store/state */ 90125); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../enums */ 54870); /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../cursors/elementCursor */ 45180); /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../utilities/math */ 4265); /* harmony import */ var _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../types/ContourAnnotation */ 56307); /* harmony import */ var _utilities_planarFreehandROITool_smoothPoints__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../utilities/planarFreehandROITool/smoothPoints */ 3638); /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../utilities/triggerAnnotationRenderForViewportIds */ 613); /* harmony import */ var _utilities_contours_updateContourPolyline__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../utilities/contours/updateContourPolyline */ 19280); /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../stateManagement/annotation/helpers/state */ 9906); const { getSubPixelSpacingAndXYDirections, addCanvasPointsToArray, getArea } = _utilities_math__WEBPACK_IMPORTED_MODULE_6__; function activateClosedContourEdit(evt, annotation, viewportIdsToRender) { this.isEditingClosed = true; const eventDetail = evt.detail; const { currentPoints, element } = eventDetail; const canvasPos = currentPoints.canvas; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(element); if (!enabledElement) { return; } const { viewport } = enabledElement; const prevCanvasPoints = annotation.data.contour.polyline.map(viewport.worldToCanvas); const { spacing, xDir, yDir } = getSubPixelSpacingAndXYDirections(viewport, this.configuration.subPixelResolution); this.editData = { prevCanvasPoints, editCanvasPoints: [canvasPos], startCrossingIndex: undefined, editIndex: 0, annotation }; this.commonData = { annotation, viewportIdsToRender, spacing, xDir, yDir, movingTextBox: false }; _store_state__WEBPACK_IMPORTED_MODULE_3__.state.isInteractingWithTool = true; element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].MOUSE_UP, this.mouseUpClosedContourEditCallback); element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].MOUSE_DRAG, this.mouseDragClosedContourEditCallback); element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].MOUSE_CLICK, this.mouseUpClosedContourEditCallback); element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].TOUCH_END, this.mouseUpClosedContourEditCallback); element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].TOUCH_DRAG, this.mouseDragClosedContourEditCallback); element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].TOUCH_TAP, this.mouseUpClosedContourEditCallback); (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_5__.hideElementCursor)(element); } function deactivateClosedContourEdit(element) { _store_state__WEBPACK_IMPORTED_MODULE_3__.state.isInteractingWithTool = false; element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].MOUSE_UP, this.mouseUpClosedContourEditCallback); element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].MOUSE_DRAG, this.mouseDragClosedContourEditCallback); element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].MOUSE_CLICK, this.mouseUpClosedContourEditCallback); element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].TOUCH_END, this.mouseUpClosedContourEditCallback); element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].TOUCH_DRAG, this.mouseDragClosedContourEditCallback); element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].TOUCH_TAP, this.mouseUpClosedContourEditCallback); (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_5__.resetElementCursor)(element); } function mouseDragClosedContourEditCallback(evt) { const eventDetail = evt.detail; const { currentPoints, element } = eventDetail; const worldPos = currentPoints.world; const canvasPos = currentPoints.canvas; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(element); const { viewport } = enabledElement; const { viewportIdsToRender, xDir, yDir, spacing } = this.commonData; const { editIndex, editCanvasPoints, startCrossingIndex, annotation } = this.editData; this.createMemo(element, annotation); const lastCanvasPoint = editCanvasPoints[editCanvasPoints.length - 1]; const lastWorldPoint = viewport.canvasToWorld(lastCanvasPoint); const worldPosDiff = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_1__.subtract(worldPosDiff, worldPos, lastWorldPoint); const xDist = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.dot(worldPosDiff, xDir)); const yDist = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.dot(worldPosDiff, yDir)); if (xDist <= spacing[0] && yDist <= spacing[1]) { return; } if (startCrossingIndex !== undefined) { this.checkAndRemoveCrossesOnEditLine(evt); } const numPointsAdded = addCanvasPointsToArray(element, editCanvasPoints, canvasPos, this.commonData); const currentEditIndex = editIndex + numPointsAdded; this.editData.editIndex = currentEditIndex; if (startCrossingIndex === undefined && editCanvasPoints.length > 1) { this.checkForFirstCrossing(evt, true); } this.editData.snapIndex = this.findSnapIndex(); if (this.editData.snapIndex === -1) { this.finishEditAndStartNewEdit(evt); return; } this.editData.fusedCanvasPoints = this.fuseEditPointsWithClosedContour(evt); if (startCrossingIndex !== undefined && this.checkForSecondCrossing(evt, true)) { this.removePointsAfterSecondCrossing(true); this.finishEditAndStartNewEdit(evt); } (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_9__["default"])(viewportIdsToRender); } function finishEditAndStartNewEdit(evt) { const eventDetail = evt.detail; const { element } = eventDetail; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(element); const { viewport, renderingEngine } = enabledElement; const { annotation, viewportIdsToRender } = this.commonData; const { fusedCanvasPoints, editCanvasPoints } = this.editData; (0,_utilities_contours_updateContourPolyline__WEBPACK_IMPORTED_MODULE_10__["default"])(annotation, { points: fusedCanvasPoints, closed: true, targetWindingDirection: _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_7__.ContourWindingDirection.Clockwise }, viewport); if (annotation.autoGenerated) { annotation.autoGenerated = false; } (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_11__.triggerAnnotationModified)(annotation, element); const lastEditCanvasPoint = editCanvasPoints.pop(); this.editData = { prevCanvasPoints: fusedCanvasPoints, editCanvasPoints: [lastEditCanvasPoint], startCrossingIndex: undefined, editIndex: 0, snapIndex: undefined, annotation }; (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_9__["default"])(viewportIdsToRender); } function fuseEditPointsWithClosedContour(evt) { const { prevCanvasPoints, editCanvasPoints, startCrossingIndex, snapIndex } = this.editData; if (startCrossingIndex === undefined || snapIndex === undefined) { return; } const eventDetail = evt.detail; const { element } = eventDetail; const augmentedEditCanvasPoints = [...editCanvasPoints]; addCanvasPointsToArray(element, augmentedEditCanvasPoints, prevCanvasPoints[snapIndex], this.commonData); if (augmentedEditCanvasPoints.length > editCanvasPoints.length) { augmentedEditCanvasPoints.pop(); } let lowIndex; let highIndex; if (startCrossingIndex > snapIndex) { lowIndex = snapIndex; highIndex = startCrossingIndex; } else { lowIndex = startCrossingIndex; highIndex = snapIndex; } const distanceBetweenLowAndFirstPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.distance(prevCanvasPoints[lowIndex], augmentedEditCanvasPoints[0]); const distanceBetweenLowAndLastPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.distance(prevCanvasPoints[lowIndex], augmentedEditCanvasPoints[augmentedEditCanvasPoints.length - 1]); const distanceBetweenHighAndFirstPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.distance(prevCanvasPoints[highIndex], augmentedEditCanvasPoints[0]); const distanceBetweenHighAndLastPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.distance(prevCanvasPoints[highIndex], augmentedEditCanvasPoints[augmentedEditCanvasPoints.length - 1]); const pointSet1 = []; for (let i = 0; i < lowIndex; i++) { const canvasPoint = prevCanvasPoints[i]; pointSet1.push([canvasPoint[0], canvasPoint[1]]); } let inPlaceDistance = distanceBetweenLowAndFirstPoint + distanceBetweenHighAndLastPoint; let reverseDistance = distanceBetweenLowAndLastPoint + distanceBetweenHighAndFirstPoint; if (inPlaceDistance < reverseDistance) { for (let i = 0; i < augmentedEditCanvasPoints.length; i++) { const canvasPoint = augmentedEditCanvasPoints[i]; pointSet1.push([canvasPoint[0], canvasPoint[1]]); } } else { for (let i = augmentedEditCanvasPoints.length - 1; i >= 0; i--) { const canvasPoint = augmentedEditCanvasPoints[i]; pointSet1.push([canvasPoint[0], canvasPoint[1]]); } } for (let i = highIndex; i < prevCanvasPoints.length; i++) { const canvasPoint = prevCanvasPoints[i]; pointSet1.push([canvasPoint[0], canvasPoint[1]]); } const pointSet2 = []; for (let i = lowIndex; i < highIndex; i++) { const canvasPoint = prevCanvasPoints[i]; pointSet2.push([canvasPoint[0], canvasPoint[1]]); } inPlaceDistance = distanceBetweenHighAndFirstPoint + distanceBetweenLowAndLastPoint; reverseDistance = distanceBetweenHighAndLastPoint + distanceBetweenLowAndFirstPoint; if (inPlaceDistance < reverseDistance) { for (let i = 0; i < augmentedEditCanvasPoints.length; i++) { const canvasPoint = augmentedEditCanvasPoints[i]; pointSet2.push([canvasPoint[0], canvasPoint[1]]); } } else { for (let i = augmentedEditCanvasPoints.length - 1; i >= 0; i--) { const canvasPoint = augmentedEditCanvasPoints[i]; pointSet2.push([canvasPoint[0], canvasPoint[1]]); } } const areaPointSet1 = getArea(pointSet1); const areaPointSet2 = getArea(pointSet2); const pointsToRender = areaPointSet1 > areaPointSet2 ? pointSet1 : pointSet2; return pointsToRender; } function mouseUpClosedContourEditCallback(evt) { const eventDetail = evt.detail; const { element } = eventDetail; this.completeClosedContourEdit(element); } function completeClosedContourEdit(element) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(element); const { viewport } = enabledElement; const { annotation, viewportIdsToRender } = this.commonData; this.doneEditMemo(); const { fusedCanvasPoints, prevCanvasPoints } = this.editData; if (fusedCanvasPoints) { const updatedPoints = (0,_utilities_planarFreehandROITool_smoothPoints__WEBPACK_IMPORTED_MODULE_8__.shouldSmooth)(this.configuration, annotation) ? (0,_utilities_planarFreehandROITool_smoothPoints__WEBPACK_IMPORTED_MODULE_8__.getInterpolatedPoints)(this.configuration, fusedCanvasPoints, prevCanvasPoints) : fusedCanvasPoints; const decimateConfig = this.configuration?.decimate || {}; (0,_utilities_contours_updateContourPolyline__WEBPACK_IMPORTED_MODULE_10__["default"])(annotation, { points: updatedPoints, closed: true, targetWindingDirection: _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_7__.ContourWindingDirection.Clockwise }, viewport, { decimate: { enabled: !!decimateConfig.enabled, epsilon: decimateConfig.epsilon } }); if (annotation.autoGenerated) { annotation.autoGenerated = false; } (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_11__.triggerAnnotationModified)(annotation, element); } this.isEditingClosed = false; this.editData = undefined; this.commonData = undefined; (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_9__["default"])(viewportIdsToRender); this.deactivateClosedContourEdit(element); } function cancelClosedContourEdit(element) { this.completeClosedContourEdit(element); } function registerClosedContourEditLoop(toolInstance) { toolInstance.activateClosedContourEdit = activateClosedContourEdit.bind(toolInstance); toolInstance.deactivateClosedContourEdit = deactivateClosedContourEdit.bind(toolInstance); toolInstance.mouseDragClosedContourEditCallback = mouseDragClosedContourEditCallback.bind(toolInstance); toolInstance.mouseUpClosedContourEditCallback = mouseUpClosedContourEditCallback.bind(toolInstance); toolInstance.finishEditAndStartNewEdit = finishEditAndStartNewEdit.bind(toolInstance); toolInstance.fuseEditPointsWithClosedContour = fuseEditPointsWithClosedContour.bind(toolInstance); toolInstance.cancelClosedContourEdit = cancelClosedContourEdit.bind(toolInstance); toolInstance.completeClosedContourEdit = completeClosedContourEdit.bind(toolInstance); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (registerClosedContourEditLoop); /***/ }, /***/ 29602 /*!*******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/annotation/planarFreehandROITool/drawLoop.js ***! \*******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 17137); /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../cursors/elementCursor */ 45180); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../enums */ 54870); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../enums */ 46190); /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../store/state */ 90125); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _utilities_planarFreehandROITool_smoothPoints__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../utilities/planarFreehandROITool/smoothPoints */ 3638); /* harmony import */ var _eventDispatchers_shared_getMouseModifier__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../eventDispatchers/shared/getMouseModifier */ 6501); /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../utilities/triggerAnnotationRenderForViewportIds */ 613); /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../stateManagement/annotation/helpers/state */ 9906); /* harmony import */ var _findOpenUShapedContourVectorToPeak__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./findOpenUShapedContourVectorToPeak */ 62806); /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../utilities/math */ 4265); /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../utilities/math */ 96800); /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../stateManagement/annotation/annotationState */ 24703); /* harmony import */ var _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../types/ContourAnnotation */ 56307); const { addCanvasPointsToArray, pointsAreWithinCloseContourProximity, getFirstLineSegmentIntersectionIndexes, getSubPixelSpacingAndXYDirections } = _utilities_math__WEBPACK_IMPORTED_MODULE_12__; function activateDraw(evt, annotation, viewportIdsToRender) { this.isDrawing = true; const eventDetail = evt.detail; const { currentPoints, element } = eventDetail; const canvasPos = currentPoints.canvas; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element); const { viewport } = enabledElement; const contourHoleProcessingEnabled = (0,_eventDispatchers_shared_getMouseModifier__WEBPACK_IMPORTED_MODULE_8__["default"])(evt.detail.event) === this.configuration.contourHoleAdditionModifierKey; const { spacing, xDir, yDir } = getSubPixelSpacingAndXYDirections(viewport, this.configuration.subPixelResolution) || {}; if (!spacing || !xDir || !yDir) { return; } this.drawData = { canvasPoints: [canvasPos], polylineIndex: 0, contourHoleProcessingEnabled, newAnnotation: true }; this.commonData = { annotation, viewportIdsToRender, spacing, xDir, yDir, movingTextBox: false }; _store_state__WEBPACK_IMPORTED_MODULE_5__.state.isInteractingWithTool = true; element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].MOUSE_UP, this.mouseUpDrawCallback); element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].MOUSE_DRAG, this.mouseDragDrawCallback); element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].MOUSE_CLICK, this.mouseUpDrawCallback); element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].TOUCH_END, this.mouseUpDrawCallback); element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].TOUCH_DRAG, this.mouseDragDrawCallback); element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].TOUCH_TAP, this.mouseUpDrawCallback); (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_2__.hideElementCursor)(element); } function deactivateDraw(element) { _store_state__WEBPACK_IMPORTED_MODULE_5__.state.isInteractingWithTool = false; element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].MOUSE_UP, this.mouseUpDrawCallback); element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].MOUSE_DRAG, this.mouseDragDrawCallback); element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].MOUSE_CLICK, this.mouseUpDrawCallback); element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].TOUCH_END, this.mouseUpDrawCallback); element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].TOUCH_DRAG, this.mouseDragDrawCallback); element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_3__["default"].TOUCH_TAP, this.mouseUpDrawCallback); (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_2__.resetElementCursor)(element); } function mouseDragDrawCallback(evt) { const eventDetail = evt.detail; const { currentPoints, element } = eventDetail; const worldPos = currentPoints.world; const canvasPos = currentPoints.canvas; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element); const { viewport } = enabledElement; const { annotation, viewportIdsToRender, xDir, yDir, spacing, movingTextBox } = this.commonData; const { polylineIndex, canvasPoints, newAnnotation } = this.drawData; this.createMemo(element, annotation, { newAnnotation }); const lastCanvasPoint = canvasPoints[canvasPoints.length - 1]; const lastWorldPoint = viewport.canvasToWorld(lastCanvasPoint); const worldPosDiff = gl_matrix__WEBPACK_IMPORTED_MODULE_6__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_6__.subtract(worldPosDiff, worldPos, lastWorldPoint); const xDist = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_6__.dot(worldPosDiff, xDir)); const yDist = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_6__.dot(worldPosDiff, yDir)); if (xDist <= spacing[0] && yDist <= spacing[1]) { return; } if (movingTextBox) { this.isDrawing = false; const { deltaPoints } = eventDetail; const worldPosDelta = deltaPoints.world; const { textBox } = annotation.data.handles; const { worldPosition } = textBox; worldPosition[0] += worldPosDelta[0]; worldPosition[1] += worldPosDelta[1]; worldPosition[2] += worldPosDelta[2]; textBox.hasMoved = true; } else { const crossingIndex = this.findCrossingIndexDuringCreate(evt); if (crossingIndex !== undefined) { this.applyCreateOnCross(evt, crossingIndex); } else { const numPointsAdded = addCanvasPointsToArray(element, canvasPoints, canvasPos, this.commonData); this.drawData.polylineIndex = polylineIndex + numPointsAdded; } annotation.invalidated = true; } (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_9__["default"])(viewportIdsToRender); if (annotation.invalidated) { (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_10__.triggerAnnotationModified)(annotation, element, _enums__WEBPACK_IMPORTED_MODULE_4__["default"].HandlesUpdated); } } function mouseUpDrawCallback(evt) { const { allowOpenContours } = this.configuration; const { canvasPoints, contourHoleProcessingEnabled } = this.drawData; const firstPoint = canvasPoints[0]; const lastPoint = canvasPoints[canvasPoints.length - 1]; const eventDetail = evt.detail; const { element } = eventDetail; this.doneEditMemo(); this.drawData.newAnnotation = false; if (allowOpenContours && !pointsAreWithinCloseContourProximity(firstPoint, lastPoint, this.configuration.closeContourProximity)) { this.completeDrawOpenContour(element, { contourHoleProcessingEnabled }); } else { this.completeDrawClosedContour(element, { contourHoleProcessingEnabled }); } } function completeDrawClosedContour(element, options) { this.removeCrossedLinesOnCompleteDraw(); const { canvasPoints } = this.drawData; const { contourHoleProcessingEnabled, minPointsToSave } = options ?? {}; if (minPointsToSave && canvasPoints.length < minPointsToSave) { return false; } if (this.haltDrawing(element, canvasPoints)) { return false; } const { annotation, viewportIdsToRender, movingTextBox } = this.commonData; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element); const { viewport } = enabledElement; addCanvasPointsToArray(element, canvasPoints, canvasPoints[0], this.commonData); canvasPoints.pop(); const updatedPoints = (0,_utilities_planarFreehandROITool_smoothPoints__WEBPACK_IMPORTED_MODULE_7__.shouldSmooth)(this.configuration, annotation) ? (0,_utilities_planarFreehandROITool_smoothPoints__WEBPACK_IMPORTED_MODULE_7__.getInterpolatedPoints)(this.configuration, canvasPoints) : canvasPoints; this.updateContourPolyline(annotation, { points: updatedPoints, closed: true, targetWindingDirection: _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_15__.ContourWindingDirection.Clockwise }, viewport); const { textBox } = annotation.data.handles; if (!textBox?.hasMoved && !movingTextBox) { (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_10__.triggerContourAnnotationCompleted)(annotation, contourHoleProcessingEnabled); } this.isDrawing = false; this.drawData = undefined; this.commonData = undefined; (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_9__["default"])(viewportIdsToRender); this.deactivateDraw(element); return true; } function removeCrossedLinesOnCompleteDraw() { const { canvasPoints } = this.drawData; const numPoints = canvasPoints.length; const endToStart = [canvasPoints[0], canvasPoints[numPoints - 1]]; const canvasPointsMinusEnds = canvasPoints.slice(0, -1).slice(1); const lineSegment = getFirstLineSegmentIntersectionIndexes(canvasPointsMinusEnds, endToStart[0], endToStart[1], false); if (lineSegment) { const indexToRemoveUpTo = lineSegment[1]; if (indexToRemoveUpTo === 1) { this.drawData.canvasPoints = canvasPoints.splice(1); } else { this.drawData.canvasPoints = canvasPoints.splice(0, indexToRemoveUpTo); } } } function completeDrawOpenContour(element, options) { const { canvasPoints } = this.drawData; const { contourHoleProcessingEnabled } = options ?? {}; if (this.haltDrawing(element, canvasPoints)) { return false; } const { annotation, viewportIdsToRender, movingTextBox } = this.commonData; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element); const { viewport } = enabledElement; const updatedPoints = (0,_utilities_planarFreehandROITool_smoothPoints__WEBPACK_IMPORTED_MODULE_7__.shouldSmooth)(this.configuration, annotation) ? (0,_utilities_planarFreehandROITool_smoothPoints__WEBPACK_IMPORTED_MODULE_7__.getInterpolatedPoints)(this.configuration, canvasPoints) : canvasPoints; this.updateContourPolyline(annotation, { points: updatedPoints, closed: false }, viewport); const { textBox } = annotation.data.handles; const worldPoints = annotation.data.contour.polyline; annotation.data.handles.points = [worldPoints[0], worldPoints[worldPoints.length - 1]]; if (!annotation.data.isOpenUShapeContour && this.configuration?.openUShapeContour) { annotation.data.isOpenUShapeContour = this.configuration.openUShapeContour; } if (annotation.data.isOpenUShapeContour) { annotation.data.openUShapeContourVectorToPeak = (0,_findOpenUShapedContourVectorToPeak__WEBPACK_IMPORTED_MODULE_11__.resolveVectorToPeak)(canvasPoints, viewport, annotation.data.isOpenUShapeContour); } if (!textBox.hasMoved && !movingTextBox) { (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_10__.triggerContourAnnotationCompleted)(annotation, contourHoleProcessingEnabled); } this.isDrawing = false; this.drawData = undefined; this.commonData = undefined; (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_9__["default"])(viewportIdsToRender); this.deactivateDraw(element); return true; } function findCrossingIndexDuringCreate(evt) { const eventDetail = evt.detail; const { currentPoints, lastPoints } = eventDetail; const canvasPos = currentPoints.canvas; const lastCanvasPoint = lastPoints.canvas; const { canvasPoints } = this.drawData; const pointsLessLastOne = canvasPoints.slice(0, -1); const lineSegment = getFirstLineSegmentIntersectionIndexes(pointsLessLastOne, canvasPos, lastCanvasPoint, false); if (lineSegment === undefined) { return; } const crossingIndex = lineSegment[0]; return crossingIndex; } function applyCreateOnCross(evt, crossingIndex) { const eventDetail = evt.detail; const { element } = eventDetail; const { canvasPoints, contourHoleProcessingEnabled } = this.drawData; const { annotation, viewportIdsToRender } = this.commonData; addCanvasPointsToArray(element, canvasPoints, canvasPoints[crossingIndex], this.commonData); canvasPoints.pop(); const remainingPoints = canvasPoints.slice(crossingIndex); const newArea = _utilities_math__WEBPACK_IMPORTED_MODULE_13__["default"](remainingPoints); if (_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__.isEqual(newArea, 0)) { canvasPoints.splice(crossingIndex + 1); return; } canvasPoints.splice(0, crossingIndex); const options = { contourHoleProcessingEnabled, minPointsToSave: 3 }; if (this.completeDrawClosedContour(element, options)) { this.activateClosedContourEdit(evt, annotation, viewportIdsToRender); } } function cancelDrawing(element) { const { allowOpenContours } = this.configuration; const { canvasPoints, contourHoleProcessingEnabled } = this.drawData; const firstPoint = canvasPoints[0]; const lastPoint = canvasPoints[canvasPoints.length - 1]; if (allowOpenContours && !pointsAreWithinCloseContourProximity(firstPoint, lastPoint, this.configuration.closeContourProximity)) { this.completeDrawOpenContour(element, { contourHoleProcessingEnabled }); } else { this.completeDrawClosedContour(element, { contourHoleProcessingEnabled }); } } function shouldHaltDrawing(canvasPoints, subPixelResolution) { const minPoints = Math.max(subPixelResolution * 3, 3); return canvasPoints.length < minPoints; } function haltDrawing(element, canvasPoints) { const { subPixelResolution } = this.configuration; if (shouldHaltDrawing(canvasPoints, subPixelResolution)) { const { annotation, viewportIdsToRender } = this.commonData; (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_14__.removeAnnotation)(annotation.annotationUID); this.isDrawing = false; this.drawData = undefined; this.commonData = undefined; (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_9__["default"])(viewportIdsToRender); this.deactivateDraw(element); return true; } return false; } function registerDrawLoop(toolInstance) { toolInstance.activateDraw = activateDraw.bind(toolInstance); toolInstance.deactivateDraw = deactivateDraw.bind(toolInstance); toolInstance.applyCreateOnCross = applyCreateOnCross.bind(toolInstance); toolInstance.findCrossingIndexDuringCreate = findCrossingIndexDuringCreate.bind(toolInstance); toolInstance.completeDrawOpenContour = completeDrawOpenContour.bind(toolInstance); toolInstance.removeCrossedLinesOnCompleteDraw = removeCrossedLinesOnCompleteDraw.bind(toolInstance); toolInstance.mouseDragDrawCallback = mouseDragDrawCallback.bind(toolInstance); toolInstance.mouseUpDrawCallback = mouseUpDrawCallback.bind(toolInstance); toolInstance.completeDrawClosedContour = completeDrawClosedContour.bind(toolInstance); toolInstance.cancelDrawing = cancelDrawing.bind(toolInstance); toolInstance.haltDrawing = haltDrawing.bind(toolInstance); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (registerDrawLoop); /***/ }, /***/ 69353 /*!*************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/annotation/planarFreehandROITool/editLoopCommon.js ***! \*************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 93067); /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../utilities/math */ 4265); const { addCanvasPointsToArray, getFirstLineSegmentIntersectionIndexes } = _utilities_math__WEBPACK_IMPORTED_MODULE_1__; function checkForFirstCrossing(evt, isClosedContour) { const eventDetail = evt.detail; const { element, currentPoints, lastPoints } = eventDetail; const canvasPos = currentPoints.canvas; const lastCanvasPoint = lastPoints.canvas; const { editCanvasPoints, prevCanvasPoints } = this.editData; const crossedLineSegment = getFirstLineSegmentIntersectionIndexes(prevCanvasPoints, canvasPos, lastCanvasPoint, isClosedContour); if (crossedLineSegment) { this.editData.startCrossingIndex = crossedLineSegment[0]; this.removePointsUpUntilFirstCrossing(isClosedContour); } else if (prevCanvasPoints.length >= 2) { if (editCanvasPoints.length > this.configuration.checkCanvasEditFallbackProximity) { const firstEditCanvasPoint = editCanvasPoints[0]; const distanceIndexPairs = []; for (let i = 0; i < prevCanvasPoints.length; i++) { const prevCanvasPoint = prevCanvasPoints[i]; const distance = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.distance(prevCanvasPoint, firstEditCanvasPoint); distanceIndexPairs.push({ distance, index: i }); } distanceIndexPairs.sort((a, b) => a.distance - b.distance); const twoClosestDistanceIndexPairs = [distanceIndexPairs[0], distanceIndexPairs[1]]; const lowestIndex = Math.min(twoClosestDistanceIndexPairs[0].index, twoClosestDistanceIndexPairs[1].index); this.editData.startCrossingIndex = lowestIndex; } else { const dir = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.subtract(dir, editCanvasPoints[1], editCanvasPoints[0]); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.normalize(dir, dir); const proximity = 6; const extendedPoint = [editCanvasPoints[0][0] - dir[0] * proximity, editCanvasPoints[0][1] - dir[1] * proximity]; const crossedLineSegmentFromExtendedPoint = getFirstLineSegmentIntersectionIndexes(prevCanvasPoints, extendedPoint, editCanvasPoints[0], isClosedContour); if (crossedLineSegmentFromExtendedPoint) { const pointsToPrepend = [extendedPoint]; addCanvasPointsToArray(element, pointsToPrepend, editCanvasPoints[0], this.commonData); editCanvasPoints.unshift(...pointsToPrepend); this.removePointsUpUntilFirstCrossing(isClosedContour); this.editData.editIndex = editCanvasPoints.length - 1; this.editData.startCrossingIndex = crossedLineSegmentFromExtendedPoint[0]; } } } } function removePointsUpUntilFirstCrossing(isClosedContour) { const { editCanvasPoints, prevCanvasPoints } = this.editData; let numPointsToRemove = 0; for (let i = 0; i < editCanvasPoints.length - 1; i++) { const firstLine = [editCanvasPoints[i], editCanvasPoints[i + 1]]; const didCrossLine = !!getFirstLineSegmentIntersectionIndexes(prevCanvasPoints, firstLine[0], firstLine[1], isClosedContour); numPointsToRemove++; if (didCrossLine) { break; } } editCanvasPoints.splice(0, numPointsToRemove); this.editData.editIndex = editCanvasPoints.length - 1; } function checkForSecondCrossing(evt, isClosedContour) { const eventDetail = evt.detail; const { currentPoints, lastPoints } = eventDetail; const canvasPos = currentPoints.canvas; const lastCanvasPoint = lastPoints.canvas; const { prevCanvasPoints } = this.editData; const crossedLineSegment = getFirstLineSegmentIntersectionIndexes(prevCanvasPoints, canvasPos, lastCanvasPoint, isClosedContour); if (!crossedLineSegment) { return false; } return true; } function removePointsAfterSecondCrossing(isClosedContour) { const { prevCanvasPoints, editCanvasPoints } = this.editData; for (let i = editCanvasPoints.length - 1; i > 0; i--) { const lastLine = [editCanvasPoints[i], editCanvasPoints[i - 1]]; const didCrossLine = !!getFirstLineSegmentIntersectionIndexes(prevCanvasPoints, lastLine[0], lastLine[1], isClosedContour); editCanvasPoints.pop(); if (didCrossLine) { break; } } } function findSnapIndex() { const { editCanvasPoints, prevCanvasPoints, startCrossingIndex } = this.editData; if (startCrossingIndex === undefined) { return; } const lastEditCanvasPoint = editCanvasPoints[editCanvasPoints.length - 1]; const distanceIndexPairs = []; for (let i = 0; i < prevCanvasPoints.length; i++) { const prevCanvasPoint = prevCanvasPoints[i]; const distance = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.distance(prevCanvasPoint, lastEditCanvasPoint); distanceIndexPairs.push({ distance, index: i }); } distanceIndexPairs.sort((a, b) => a.distance - b.distance); const editCanvasPointsLessLastOne = editCanvasPoints.slice(0, -1); for (let i = 0; i < distanceIndexPairs.length; i++) { const { index } = distanceIndexPairs[i]; const snapCanvasPosition = prevCanvasPoints[index]; const lastEditCanvasPoint = editCanvasPoints[editCanvasPoints.length - 1]; const crossedLineSegment = getFirstLineSegmentIntersectionIndexes(editCanvasPointsLessLastOne, snapCanvasPosition, lastEditCanvasPoint, false); if (!crossedLineSegment) { return index; } } return -1; } function checkAndRemoveCrossesOnEditLine(evt) { const eventDetail = evt.detail; const { currentPoints, lastPoints } = eventDetail; const canvasPos = currentPoints.canvas; const lastCanvasPoint = lastPoints.canvas; const { editCanvasPoints } = this.editData; const editCanvasPointsLessLastOne = editCanvasPoints.slice(0, -2); const crossedLineSegment = getFirstLineSegmentIntersectionIndexes(editCanvasPointsLessLastOne, canvasPos, lastCanvasPoint, false); if (!crossedLineSegment) { return; } const editIndexCrossed = crossedLineSegment[0]; const numPointsToRemove = editCanvasPoints.length - editIndexCrossed; for (let i = 0; i < numPointsToRemove; i++) { editCanvasPoints.pop(); } } function registerEditLoopCommon(toolInstance) { toolInstance.checkForFirstCrossing = checkForFirstCrossing.bind(toolInstance); toolInstance.removePointsUpUntilFirstCrossing = removePointsUpUntilFirstCrossing.bind(toolInstance); toolInstance.checkForSecondCrossing = checkForSecondCrossing.bind(toolInstance); toolInstance.findSnapIndex = findSnapIndex.bind(toolInstance); toolInstance.removePointsAfterSecondCrossing = removePointsAfterSecondCrossing.bind(toolInstance); toolInstance.checkAndRemoveCrossesOnEditLine = checkAndRemoveCrossesOnEditLine.bind(toolInstance); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (registerEditLoopCommon); /***/ }, /***/ 62806 /*!*********************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/annotation/planarFreehandROITool/findOpenUShapedContourVectorToPeak.js ***! \*********************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ findOpenUShapedContourVectorToPeak), /* harmony export */ resolveVectorToPeak: () => (/* binding */ resolveVectorToPeak), /* harmony export */ resolveVectorToPeakOnRender: () => (/* binding */ resolveVectorToPeakOnRender) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 93067); function findOpenUShapedContourVectorToPeak(canvasPoints, viewport) { const first = canvasPoints[0]; const last = canvasPoints[canvasPoints.length - 1]; const firstToLastUnitVector = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.set(firstToLastUnitVector, last[0] - first[0], last[1] - first[1]); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.normalize(firstToLastUnitVector, firstToLastUnitVector); const normalVector1 = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); const normalVector2 = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.set(normalVector1, -firstToLastUnitVector[1], firstToLastUnitVector[0]); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.set(normalVector2, firstToLastUnitVector[1], -firstToLastUnitVector[0]); const centerOfFirstToLast = [(first[0] + last[0]) / 2, (first[1] + last[1]) / 2]; const furthest = { dist: 0, index: null }; for (let i = 0; i < canvasPoints.length; i++) { const canvasPoint = canvasPoints[i]; const distance = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dist(canvasPoint, centerOfFirstToLast); if (distance > furthest.dist) { furthest.dist = distance; furthest.index = i; } } const toFurthest = [canvasPoints[furthest.index], centerOfFirstToLast]; const toFurthestWorld = toFurthest.map(viewport.canvasToWorld); return toFurthestWorld; } function resolveVectorToPeak(canvasPoints, viewport, variant) { if (variant === 'orthogonalT') { return findOpenUShapedContourVectorToPeakOrthogonal(canvasPoints, viewport); } if (variant === 'lineSegment') { return null; } if (variant) { return findOpenUShapedContourVectorToPeak(canvasPoints, viewport); } return null; } function resolveVectorToPeakOnRender(enabledElement, annotation) { const { viewport } = enabledElement; const canvasPoints = annotation.data.contour.polyline.map(viewport.worldToCanvas); return resolveVectorToPeak(canvasPoints, viewport, annotation.data.isOpenUShapeContour); } function findOpenUShapedContourVectorToPeakOrthogonal(canvasPoints, viewport) { const first = canvasPoints[0]; const last = canvasPoints[canvasPoints.length - 1]; const firstToLastUnitVector = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.sub(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), last, first); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.normalize(firstToLastUnitVector, firstToLastUnitVector); const chordDir = [firstToLastUnitVector[0], firstToLastUnitVector[1]]; const centerOfFirstToLast = [(first[0] + last[0]) / 2, (first[1] + last[1]) / 2]; const delta = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); let prevDp = null; let prevPoint = null; let orthogonalPoint = null; for (const p of canvasPoints) { gl_matrix__WEBPACK_IMPORTED_MODULE_0__.sub(delta, p, centerOfFirstToLast); const dp = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(chordDir, delta); if (prevDp !== null && prevDp * dp < 0) { const t = Math.abs(prevDp) / (Math.abs(prevDp) + Math.abs(dp)); orthogonalPoint = [prevPoint[0] + t * (p[0] - prevPoint[0]), prevPoint[1] + t * (p[1] - prevPoint[1])]; break; } if (Math.abs(dp) < 1e-10) { orthogonalPoint = p; break; } prevDp = dp; prevPoint = p; } if (!orthogonalPoint) { console.warn('No orthogonal intersection found for open U-shaped contour'); return null; } const toOrthogonal = [orthogonalPoint, centerOfFirstToLast]; const toOrthogonalWorld = toOrthogonal.map(viewport.canvasToWorld); return toOrthogonalWorld; } /***/ }, /***/ 59220 /*!******************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/annotation/planarFreehandROITool/openContourEditLoop.js ***! \******************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 93067); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../store/state */ 90125); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../enums */ 54870); /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../cursors/elementCursor */ 45180); /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../utilities/math */ 4265); /* harmony import */ var _utilities_planarFreehandROITool_smoothPoints__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../utilities/planarFreehandROITool/smoothPoints */ 3638); /* harmony import */ var _utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../utilities/triggerAnnotationRenderForViewportIds */ 613); /* harmony import */ var _utilities_contours_updateContourPolyline__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../utilities/contours/updateContourPolyline */ 19280); /* harmony import */ var _findOpenUShapedContourVectorToPeak__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./findOpenUShapedContourVectorToPeak */ 62806); /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../stateManagement/annotation/helpers/state */ 9906); const { addCanvasPointsToArray, getSubPixelSpacingAndXYDirections } = _utilities_math__WEBPACK_IMPORTED_MODULE_6__; function activateOpenContourEdit(evt, annotation, viewportIdsToRender) { this.isEditingOpen = true; const eventDetail = evt.detail; const { currentPoints, element } = eventDetail; const canvasPos = currentPoints.canvas; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(element); const { viewport } = enabledElement; this.doneEditMemo(); const prevCanvasPoints = annotation.data.contour.polyline.map(viewport.worldToCanvas); const { spacing, xDir, yDir } = getSubPixelSpacingAndXYDirections(viewport, this.configuration.subPixelResolution); this.editData = { prevCanvasPoints, editCanvasPoints: [canvasPos], startCrossingIndex: undefined, editIndex: 0 }; this.commonData = { annotation, viewportIdsToRender, spacing, xDir, yDir, movingTextBox: false }; _store_state__WEBPACK_IMPORTED_MODULE_3__.state.isInteractingWithTool = true; element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].MOUSE_UP, this.mouseUpOpenContourEditCallback); element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].MOUSE_DRAG, this.mouseDragOpenContourEditCallback); element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].MOUSE_CLICK, this.mouseUpOpenContourEditCallback); element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].TOUCH_END, this.mouseUpOpenContourEditCallback); element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].TOUCH_DRAG, this.mouseDragOpenContourEditCallback); element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].TOUCH_TAP, this.mouseUpOpenContourEditCallback); (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_5__.hideElementCursor)(element); } function deactivateOpenContourEdit(element) { _store_state__WEBPACK_IMPORTED_MODULE_3__.state.isInteractingWithTool = false; element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].MOUSE_UP, this.mouseUpOpenContourEditCallback); element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].MOUSE_DRAG, this.mouseDragOpenContourEditCallback); element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].MOUSE_CLICK, this.mouseUpOpenContourEditCallback); element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].TOUCH_END, this.mouseUpOpenContourEditCallback); element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].TOUCH_DRAG, this.mouseDragOpenContourEditCallback); element.removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_4__["default"].TOUCH_TAP, this.mouseUpOpenContourEditCallback); (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_5__.resetElementCursor)(element); } function mouseDragOpenContourEditCallback(evt) { const eventDetail = evt.detail; const { currentPoints, element } = eventDetail; const worldPos = currentPoints.world; const canvasPos = currentPoints.canvas; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(element); const { viewport } = enabledElement; const { viewportIdsToRender, xDir, yDir, spacing } = this.commonData; const { editIndex, editCanvasPoints, startCrossingIndex } = this.editData; const lastCanvasPoint = editCanvasPoints[editCanvasPoints.length - 1]; const lastWorldPoint = viewport.canvasToWorld(lastCanvasPoint); const worldPosDiff = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(); this.createMemo(element, this.commonData.annotation); gl_matrix__WEBPACK_IMPORTED_MODULE_1__.subtract(worldPosDiff, worldPos, lastWorldPoint); const xDist = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.dot(worldPosDiff, xDir)); const yDist = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.dot(worldPosDiff, yDir)); if (xDist <= spacing[0] && yDist <= spacing[1]) { return; } if (startCrossingIndex !== undefined) { this.checkAndRemoveCrossesOnEditLine(evt); } const numPointsAdded = addCanvasPointsToArray(element, editCanvasPoints, canvasPos, this.commonData); const currentEditIndex = editIndex + numPointsAdded; this.editData.editIndex = currentEditIndex; if (startCrossingIndex === undefined && editCanvasPoints.length > 1) { this.checkForFirstCrossing(evt, false); } this.editData.snapIndex = this.findSnapIndex(); this.editData.fusedCanvasPoints = this.fuseEditPointsWithOpenContour(evt); if (startCrossingIndex !== undefined && this.checkForSecondCrossing(evt, false)) { this.removePointsAfterSecondCrossing(false); this.finishEditOpenOnSecondCrossing(evt); } else if (this.checkIfShouldOverwriteAnEnd(evt)) { this.openContourEditOverwriteEnd(evt); } (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__["default"])(viewportIdsToRender); } function openContourEditOverwriteEnd(evt) { const eventDetail = evt.detail; const { element } = eventDetail; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(element); const { viewport } = enabledElement; const { annotation, viewportIdsToRender } = this.commonData; const fusedCanvasPoints = this.fuseEditPointsForOpenContourEndEdit(); (0,_utilities_contours_updateContourPolyline__WEBPACK_IMPORTED_MODULE_9__["default"])(annotation, { points: fusedCanvasPoints, closed: false }, viewport); const worldPoints = annotation.data.contour.polyline; annotation.data.handles.points = [worldPoints[0], worldPoints[worldPoints.length - 1]]; annotation.data.handles.activeHandleIndex = 1; (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_11__.triggerAnnotationModified)(annotation, element); this.isEditingOpen = false; this.editData = undefined; this.commonData = undefined; this.doneEditMemo(); this.deactivateOpenContourEdit(element); this.activateOpenContourEndEdit(evt, annotation, viewportIdsToRender, null); } function checkIfShouldOverwriteAnEnd(evt) { const eventDetail = evt.detail; const { currentPoints, lastPoints } = eventDetail; const canvasPos = currentPoints.canvas; const lastCanvasPos = lastPoints.canvas; const { snapIndex, prevCanvasPoints, startCrossingIndex } = this.editData; if (startCrossingIndex === undefined || snapIndex === undefined) { return false; } if (snapIndex === -1) { return true; } if (snapIndex !== 0 && snapIndex !== prevCanvasPoints.length - 1) { return false; } const p1 = canvasPos; const p2 = lastCanvasPos; const p3 = prevCanvasPoints[snapIndex]; const a = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); const b = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.set(a, p1[0] - p2[0], p1[1] - p2[1]); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.set(b, p1[0] - p3[0], p1[1] - p3[1]); const aDotb = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(a, b); const magA = Math.sqrt(a[0] * a[0] + a[1] * a[1]); const magB = Math.sqrt(b[0] * b[0] + b[1] * b[1]); const theta = Math.acos(aDotb / (magA * magB)); if (theta < Math.PI / 2) { return true; } return false; } function fuseEditPointsForOpenContourEndEdit() { const { snapIndex, prevCanvasPoints, editCanvasPoints, startCrossingIndex } = this.editData; const newCanvasPoints = []; if (snapIndex === 0) { for (let i = prevCanvasPoints.length - 1; i >= startCrossingIndex; i--) { const canvasPoint = prevCanvasPoints[i]; newCanvasPoints.push([canvasPoint[0], canvasPoint[1]]); } } else { for (let i = 0; i < startCrossingIndex; i++) { const canvasPoint = prevCanvasPoints[i]; newCanvasPoints.push([canvasPoint[0], canvasPoint[1]]); } } const distanceBetweenCrossingIndexAndFirstPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.distance(prevCanvasPoints[startCrossingIndex], editCanvasPoints[0]); const distanceBetweenCrossingIndexAndLastPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.distance(prevCanvasPoints[startCrossingIndex], editCanvasPoints[editCanvasPoints.length - 1]); if (distanceBetweenCrossingIndexAndFirstPoint < distanceBetweenCrossingIndexAndLastPoint) { for (let i = 0; i < editCanvasPoints.length; i++) { const canvasPoint = editCanvasPoints[i]; newCanvasPoints.push([canvasPoint[0], canvasPoint[1]]); } } else { for (let i = editCanvasPoints.length - 1; i >= 0; i--) { const canvasPoint = editCanvasPoints[i]; newCanvasPoints.push([canvasPoint[0], canvasPoint[1]]); } } return newCanvasPoints; } function fuseEditPointsWithOpenContour(evt) { const { prevCanvasPoints, editCanvasPoints, startCrossingIndex, snapIndex } = this.editData; if (startCrossingIndex === undefined || snapIndex === undefined) { return undefined; } const eventDetail = evt.detail; const { element } = eventDetail; const augmentedEditCanvasPoints = [...editCanvasPoints]; addCanvasPointsToArray(element, augmentedEditCanvasPoints, prevCanvasPoints[snapIndex], this.commonData); if (augmentedEditCanvasPoints.length > editCanvasPoints.length) { augmentedEditCanvasPoints.pop(); } let lowIndex; let highIndex; if (startCrossingIndex > snapIndex) { lowIndex = snapIndex; highIndex = startCrossingIndex; } else { lowIndex = startCrossingIndex; highIndex = snapIndex; } const distanceBetweenLowAndFirstPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.distance(prevCanvasPoints[lowIndex], augmentedEditCanvasPoints[0]); const distanceBetweenLowAndLastPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.distance(prevCanvasPoints[lowIndex], augmentedEditCanvasPoints[augmentedEditCanvasPoints.length - 1]); const distanceBetweenHighAndFirstPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.distance(prevCanvasPoints[highIndex], augmentedEditCanvasPoints[0]); const distanceBetweenHighAndLastPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.distance(prevCanvasPoints[highIndex], augmentedEditCanvasPoints[augmentedEditCanvasPoints.length - 1]); const pointsToRender = []; for (let i = 0; i < lowIndex; i++) { const canvasPoint = prevCanvasPoints[i]; pointsToRender.push([canvasPoint[0], canvasPoint[1]]); } const inPlaceDistance = distanceBetweenLowAndFirstPoint + distanceBetweenHighAndLastPoint; const reverseDistance = distanceBetweenLowAndLastPoint + distanceBetweenHighAndFirstPoint; if (inPlaceDistance < reverseDistance) { for (let i = 0; i < augmentedEditCanvasPoints.length; i++) { const canvasPoint = augmentedEditCanvasPoints[i]; pointsToRender.push([canvasPoint[0], canvasPoint[1]]); } } else { for (let i = augmentedEditCanvasPoints.length - 1; i >= 0; i--) { const canvasPoint = augmentedEditCanvasPoints[i]; pointsToRender.push([canvasPoint[0], canvasPoint[1]]); } } for (let i = highIndex; i < prevCanvasPoints.length; i++) { const canvasPoint = prevCanvasPoints[i]; pointsToRender.push([canvasPoint[0], canvasPoint[1]]); } return pointsToRender; } function finishEditOpenOnSecondCrossing(evt) { const eventDetail = evt.detail; const { element } = eventDetail; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(element); const { viewport, renderingEngine } = enabledElement; const { annotation, viewportIdsToRender } = this.commonData; const { fusedCanvasPoints, editCanvasPoints } = this.editData; (0,_utilities_contours_updateContourPolyline__WEBPACK_IMPORTED_MODULE_9__["default"])(annotation, { points: fusedCanvasPoints, closed: false }, viewport); const worldPoints = annotation.data.contour.polyline; annotation.data.handles.points = [worldPoints[0], worldPoints[worldPoints.length - 1]]; (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_11__.triggerAnnotationModified)(annotation, element); const lastEditCanvasPoint = editCanvasPoints.pop(); this.editData = { prevCanvasPoints: fusedCanvasPoints, editCanvasPoints: [lastEditCanvasPoint], startCrossingIndex: undefined, editIndex: 0 }; (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__["default"])(viewportIdsToRender); } function mouseUpOpenContourEditCallback(evt) { const eventDetail = evt.detail; const { element } = eventDetail; this.completeOpenContourEdit(element); } function completeOpenContourEdit(element) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(element); const { viewport } = enabledElement; const { annotation, viewportIdsToRender } = this.commonData; this.doneEditMemo(); const { fusedCanvasPoints, prevCanvasPoints } = this.editData; if (fusedCanvasPoints) { const updatedPoints = (0,_utilities_planarFreehandROITool_smoothPoints__WEBPACK_IMPORTED_MODULE_7__.shouldSmooth)(this.configuration) ? (0,_utilities_planarFreehandROITool_smoothPoints__WEBPACK_IMPORTED_MODULE_7__.getInterpolatedPoints)(this.configuration, fusedCanvasPoints, prevCanvasPoints) : fusedCanvasPoints; const decimateConfig = this.configuration?.decimate || {}; (0,_utilities_contours_updateContourPolyline__WEBPACK_IMPORTED_MODULE_9__["default"])(annotation, { points: updatedPoints, closed: false }, viewport, { decimate: { enabled: !!decimateConfig.enabled, epsilon: decimateConfig.epsilon } }); const worldPoints = annotation.data.contour.polyline; annotation.data.handles.points = [worldPoints[0], worldPoints[worldPoints.length - 1]]; if (annotation.data.isOpenUShapeContour) { annotation.data.openUShapeContourVectorToPeak = (0,_findOpenUShapedContourVectorToPeak__WEBPACK_IMPORTED_MODULE_10__.resolveVectorToPeak)(fusedCanvasPoints, viewport, annotation.data.isOpenUShapeContour); } (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_11__.triggerAnnotationModified)(annotation, element); } this.isEditingOpen = false; this.editData = undefined; this.commonData = undefined; (0,_utilities_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_8__["default"])(viewportIdsToRender); this.deactivateOpenContourEdit(element); } function cancelOpenContourEdit(element) { this.completeOpenContourEdit(element); } function registerOpenContourEditLoop(toolInstance) { toolInstance.activateOpenContourEdit = activateOpenContourEdit.bind(toolInstance); toolInstance.deactivateOpenContourEdit = deactivateOpenContourEdit.bind(toolInstance); toolInstance.mouseDragOpenContourEditCallback = mouseDragOpenContourEditCallback.bind(toolInstance); toolInstance.mouseUpOpenContourEditCallback = mouseUpOpenContourEditCallback.bind(toolInstance); toolInstance.fuseEditPointsWithOpenContour = fuseEditPointsWithOpenContour.bind(toolInstance); toolInstance.finishEditOpenOnSecondCrossing = finishEditOpenOnSecondCrossing.bind(toolInstance); toolInstance.checkIfShouldOverwriteAnEnd = checkIfShouldOverwriteAnEnd.bind(toolInstance); toolInstance.fuseEditPointsForOpenContourEndEdit = fuseEditPointsForOpenContourEndEdit.bind(toolInstance); toolInstance.openContourEditOverwriteEnd = openContourEditOverwriteEnd.bind(toolInstance); toolInstance.cancelOpenContourEdit = cancelOpenContourEdit.bind(toolInstance); toolInstance.completeOpenContourEdit = completeOpenContourEdit.bind(toolInstance); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (registerOpenContourEditLoop); /***/ }, /***/ 48059 /*!*********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/annotation/planarFreehandROITool/openContourEndEditLoop.js ***! \*********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _store_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../store/state */ 90125); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../enums */ 54870); /* harmony import */ var _cursors_elementCursor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../cursors/elementCursor */ 45180); /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../utilities/math */ 4265); const { getSubPixelSpacingAndXYDirections } = _utilities_math__WEBPACK_IMPORTED_MODULE_4__; function activateOpenContourEndEdit(evt, annotation, viewportIdsToRender, handle) { this.isDrawing = true; const eventDetail = evt.detail; const { element } = eventDetail; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element); const { viewport } = enabledElement; const { spacing, xDir, yDir } = getSubPixelSpacingAndXYDirections(viewport, this.configuration.subPixelResolution); const canvasPoints = annotation.data.contour.polyline.map(viewport.worldToCanvas); const handleIndexGrabbed = annotation.data.handles.activeHandleIndex; if (handleIndexGrabbed === 0) { canvasPoints.reverse(); } let movingTextBox = false; if (handle?.worldPosition) { movingTextBox = true; } this.drawData = { canvasPoints: canvasPoints, polylineIndex: canvasPoints.length - 1 }; this.commonData = { annotation, viewportIdsToRender, spacing, xDir, yDir, movingTextBox }; _store_state__WEBPACK_IMPORTED_MODULE_1__.state.isInteractingWithTool = true; element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_2__["default"].MOUSE_UP, this.mouseUpDrawCallback); element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_2__["default"].MOUSE_DRAG, this.mouseDragDrawCallback); element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_2__["default"].MOUSE_CLICK, this.mouseUpDrawCallback); element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_2__["default"].TOUCH_END, this.mouseUpDrawCallback); element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_2__["default"].TOUCH_DRAG, this.mouseDragDrawCallback); element.addEventListener(_enums__WEBPACK_IMPORTED_MODULE_2__["default"].TOUCH_TAP, this.mouseUpDrawCallback); (0,_cursors_elementCursor__WEBPACK_IMPORTED_MODULE_3__.hideElementCursor)(element); } function registerOpenContourEndEditLoop(toolInstance) { toolInstance.activateOpenContourEndEdit = activateOpenContourEndEdit.bind(toolInstance); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (registerOpenContourEndEditLoop); /***/ }, /***/ 22282 /*!************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/annotation/planarFreehandROITool/renderMethods.js ***! \************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../drawingSvg */ 22106); /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../drawingSvg */ 43517); /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../drawingSvg */ 88086); /* harmony import */ var _utilities_math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../utilities/math */ 4265); /* harmony import */ var _findOpenUShapedContourVectorToPeak__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./findOpenUShapedContourVectorToPeak */ 62806); /* harmony import */ var _utilities_contours_getContourHolesDataCanvas__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../utilities/contours/getContourHolesDataCanvas */ 81380); const { pointsAreWithinCloseContourProximity } = _utilities_math__WEBPACK_IMPORTED_MODULE_3__; function _getRenderingOptions(enabledElement, annotation) { const styleSpecifier = { toolGroupId: this.toolGroupId, toolName: this.getToolName(), viewportId: enabledElement.viewport.id, annotationUID: annotation.annotationUID }; const { lineWidth, lineDash, color, fillColor, fillOpacity } = this.getAnnotationStyle({ annotation, styleSpecifier }); const { closed: isClosedContour } = annotation.data.contour; const options = { color, width: lineWidth, lineDash, fillColor, fillOpacity: this.configuration?.fillOpacity !== undefined ? this.configuration.fillOpacity : fillOpacity, closePath: isClosedContour }; return options; } function renderContour(enabledElement, svgDrawingHelper, annotation) { if (!enabledElement?.viewport?.getImageData()) { return; } if (annotation.data.contour.closed) { this.renderClosedContour(enabledElement, svgDrawingHelper, annotation); } else { if (annotation.data.isOpenUShapeContour) { if (annotation.data.isOpenUShapeContour !== 'lineSegment') { calculateUShapeContourVectorToPeakIfNotPresent(enabledElement, annotation); } this.renderOpenUShapedContour(enabledElement, svgDrawingHelper, annotation); } else { this.renderOpenContour(enabledElement, svgDrawingHelper, annotation); } } } function calculateUShapeContourVectorToPeakIfNotPresent(enabledElement, annotation) { if (!annotation.data.openUShapeContourVectorToPeak) { annotation.data.openUShapeContourVectorToPeak = (0,_findOpenUShapedContourVectorToPeak__WEBPACK_IMPORTED_MODULE_4__.resolveVectorToPeakOnRender)(enabledElement, annotation); } } function renderClosedContour(enabledElement, svgDrawingHelper, annotation) { if (annotation.parentAnnotationUID) { return; } const { viewport } = enabledElement; const options = this._getRenderingOptions(enabledElement, annotation); const canvasPolyline = annotation.data.contour.polyline.map(worldPos => viewport.worldToCanvas(worldPos)); const childContours = (0,_utilities_contours_getContourHolesDataCanvas__WEBPACK_IMPORTED_MODULE_5__["default"])(annotation, viewport); const allContours = [canvasPolyline, ...childContours]; const polylineUID = '1'; (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_2__["default"])(svgDrawingHelper, annotation.annotationUID, polylineUID, allContours, options); } function renderOpenContour(enabledElement, svgDrawingHelper, annotation) { const { viewport } = enabledElement; const options = this._getRenderingOptions(enabledElement, annotation); const canvasPoints = annotation.data.contour.polyline.map(worldPos => viewport.worldToCanvas(worldPos)); const polylineUID = '1'; (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_1__["default"])(svgDrawingHelper, annotation.annotationUID, polylineUID, canvasPoints, options); const activeHandleIndex = annotation.data.handles.activeHandleIndex; if (this.configuration.alwaysRenderOpenContourHandles?.enabled === true) { const radius = this.configuration.alwaysRenderOpenContourHandles.radius; const handleGroupUID = '0'; const handlePoints = [canvasPoints[0], canvasPoints[canvasPoints.length - 1]]; if (activeHandleIndex === 0) { handlePoints.shift(); } else if (activeHandleIndex === 1) { handlePoints.pop(); } (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_0__["default"])(svgDrawingHelper, annotation.annotationUID, handleGroupUID, handlePoints, { color: options.color, handleRadius: radius }); } if (activeHandleIndex !== null) { const handleGroupUID = '1'; const indexOfCanvasPoints = activeHandleIndex === 0 ? 0 : canvasPoints.length - 1; const handlePoint = canvasPoints[indexOfCanvasPoints]; (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_0__["default"])(svgDrawingHelper, annotation.annotationUID, handleGroupUID, [handlePoint], { color: options.color }); } } function renderOpenUShapedContour(enabledElement, svgDrawingHelper, annotation) { const { viewport } = enabledElement; const { openUShapeContourVectorToPeak } = annotation.data; const { polyline } = annotation.data.contour; this.renderOpenContour(enabledElement, svgDrawingHelper, annotation); const isLineSegmentOnly = annotation.data.isOpenUShapeContour === 'lineSegment'; if (!isLineSegmentOnly && !openUShapeContourVectorToPeak) { return; } const firstCanvasPoint = viewport.worldToCanvas(polyline[0]); const lastCanvasPoint = viewport.worldToCanvas(polyline[polyline.length - 1]); const options = this._getRenderingOptions(enabledElement, annotation); (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_1__["default"])(svgDrawingHelper, annotation.annotationUID, 'first-to-last', [firstCanvasPoint, lastCanvasPoint], { color: options.color, width: options.width, closePath: false, lineDash: '2,2' }); if (!isLineSegmentOnly) { const openUShapeContourVectorToPeakCanvas = [viewport.worldToCanvas(openUShapeContourVectorToPeak[0]), viewport.worldToCanvas(openUShapeContourVectorToPeak[1])]; (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_1__["default"])(svgDrawingHelper, annotation.annotationUID, 'midpoint-to-open-contour', [openUShapeContourVectorToPeakCanvas[0], openUShapeContourVectorToPeakCanvas[1]], { color: options.color, width: options.width, closePath: false, lineDash: '2,2' }); } if (options.fillOpacity > 0) { const canvasPolyline = polyline.map(worldPos => viewport.worldToCanvas(worldPos)); (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_2__["default"])(svgDrawingHelper, annotation.annotationUID, 'u-shape-fill', [[...canvasPolyline, firstCanvasPoint]], { color: options.fillColor || options.color, fillColor: options.fillColor || options.color, fillOpacity: options.fillOpacity, closePath: true, width: 0 }); } } function renderContourBeingDrawn(enabledElement, svgDrawingHelper, annotation) { const options = this._getRenderingOptions(enabledElement, annotation); const { allowOpenContours } = this.configuration; const { canvasPoints } = this.drawData; options.closePath = false; (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_1__["default"])(svgDrawingHelper, annotation.annotationUID, '1', canvasPoints, options); if (allowOpenContours) { const firstPoint = canvasPoints[0]; const lastPoint = canvasPoints[canvasPoints.length - 1]; if (pointsAreWithinCloseContourProximity(firstPoint, lastPoint, this.configuration.closeContourProximity)) { (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_1__["default"])(svgDrawingHelper, annotation.annotationUID, '2', [lastPoint, firstPoint], options); } else { const handleGroupUID = '0'; (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_0__["default"])(svgDrawingHelper, annotation.annotationUID, handleGroupUID, [firstPoint], { color: options.color, handleRadius: 2 }); } } } function renderClosedContourBeingEdited(enabledElement, svgDrawingHelper, annotation) { const { viewport } = enabledElement; const { fusedCanvasPoints } = this.editData; if (fusedCanvasPoints === undefined) { this.renderClosedContour(enabledElement, svgDrawingHelper, annotation); return; } const childContours = (0,_utilities_contours_getContourHolesDataCanvas__WEBPACK_IMPORTED_MODULE_5__["default"])(annotation, viewport); const allContours = [fusedCanvasPoints, ...childContours]; const options = this._getRenderingOptions(enabledElement, annotation); const polylineUIDToRender = 'preview-1'; if (annotation.parentAnnotationUID && options.fillOpacity) { options.fillOpacity = 0; } (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_2__["default"])(svgDrawingHelper, annotation.annotationUID, polylineUIDToRender, allContours, options); } function renderOpenContourBeingEdited(enabledElement, svgDrawingHelper, annotation) { const { fusedCanvasPoints } = this.editData; if (fusedCanvasPoints === undefined) { this.renderOpenContour(enabledElement, svgDrawingHelper, annotation); return; } const options = this._getRenderingOptions(enabledElement, annotation); const polylineUIDToRender = 'preview-1'; (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_1__["default"])(svgDrawingHelper, annotation.annotationUID, polylineUIDToRender, fusedCanvasPoints, options); } function renderPointContourWithMarker(enabledElement, svgDrawingHelper, annotation) { if (annotation.parentAnnotationUID) { return; } const { viewport } = enabledElement; const options = this._getRenderingOptions(enabledElement, annotation); const canvasPolyline = annotation.data.contour.polyline.map(worldPos => viewport.worldToCanvas(worldPos)); const childContours = (0,_utilities_contours_getContourHolesDataCanvas__WEBPACK_IMPORTED_MODULE_5__["default"])(annotation, viewport); const polylineUID = '1'; const center = canvasPolyline[0]; const radius = 6; const numberOfPoints = 100; const circlePoints = []; for (let i = 0; i < numberOfPoints; i++) { const angle = i / numberOfPoints * 2 * Math.PI; const x = center[0] + radius * Math.cos(angle); const y = center[1] + radius * Math.sin(angle); circlePoints.push([x, y]); } const crosshair = [[center[0] - radius * 2, center[1]], [center[0] + radius * 2, center[1]], [center[0], center[1] - radius * 2], [center[0], center[1] + radius * 2]]; (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_2__["default"])(svgDrawingHelper, annotation.annotationUID, polylineUID + '-crosshair_v', [crosshair[0], crosshair[1]], options); (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_2__["default"])(svgDrawingHelper, annotation.annotationUID, polylineUID + '-crosshair_h', [crosshair[2], crosshair[3]], options); const allContours = [circlePoints, ...childContours]; (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_2__["default"])(svgDrawingHelper, annotation.annotationUID, polylineUID, allContours, options); } function registerRenderMethods(toolInstance) { toolInstance.renderContour = renderContour.bind(toolInstance); toolInstance.renderClosedContour = renderClosedContour.bind(toolInstance); toolInstance.renderOpenContour = renderOpenContour.bind(toolInstance); toolInstance.renderPointContourWithMarker = renderPointContourWithMarker.bind(toolInstance); toolInstance.renderOpenUShapedContour = renderOpenUShapedContour.bind(toolInstance); toolInstance.renderContourBeingDrawn = renderContourBeingDrawn.bind(toolInstance); toolInstance.renderClosedContourBeingEdited = renderClosedContourBeingEdited.bind(toolInstance); toolInstance.renderOpenContourBeingEdited = renderOpenContourBeingEdited.bind(toolInstance); toolInstance._getRenderingOptions = _getRenderingOptions.bind(toolInstance); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (registerRenderMethods); /***/ }, /***/ 99937 /*!****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/base/AnnotationDisplayTool.js ***! \****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 19401); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 38277); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/core */ 40232); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @cornerstonejs/core */ 70391); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @cornerstonejs/core */ 96146); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @cornerstonejs/core */ 61200); /* harmony import */ var _BaseTool__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./BaseTool */ 4003); /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../stateManagement/annotation/annotationState */ 24703); /* harmony import */ var _utilities_triggerAnnotationRender__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utilities/triggerAnnotationRender */ 78928); /* harmony import */ var _utilities_planar_filterAnnotationsForDisplay__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../utilities/planar/filterAnnotationsForDisplay */ 77337); /* harmony import */ var _stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../stateManagement/annotation/config/helpers */ 48421); /* harmony import */ var _stateManagement_annotation_config__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../stateManagement/annotation/config */ 68591); class AnnotationDisplayTool extends _BaseTool__WEBPACK_IMPORTED_MODULE_7__["default"] { constructor() { super(...arguments); this.onImageSpacingCalibrated = evt => { const { element, imageId } = evt.detail; const imageURI = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__["default"](imageId); const annotationManager = (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_8__.getAnnotationManager)(); const framesOfReference = annotationManager.getFramesOfReference(); framesOfReference.forEach(frameOfReference => { const frameOfReferenceSpecificAnnotations = annotationManager.getAnnotations(frameOfReference); const toolSpecificAnnotations = frameOfReferenceSpecificAnnotations[this.getToolName()]; if (!toolSpecificAnnotations || !toolSpecificAnnotations.length) { return; } toolSpecificAnnotations.forEach(annotation => { if (!annotation.metadata?.referencedImageId) { return; } const referencedImageURI = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__["default"](annotation.metadata.referencedImageId); if (referencedImageURI === imageURI) { annotation.invalidated = true; annotation.data.cachedStats = {}; } }); (0,_utilities_triggerAnnotationRender__WEBPACK_IMPORTED_MODULE_9__["default"])(element); }); }; } filterInteractableAnnotationsForElement(element, annotations) { if (!annotations?.length) { return []; } const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(element); const { viewport } = enabledElement; return (0,_utilities_planar_filterAnnotationsForDisplay__WEBPACK_IMPORTED_MODULE_10__["default"])(viewport, annotations); } static createAnnotation(...annotationBaseData) { let annotation = { annotationUID: null, highlighted: true, invalidated: true, isLocked: false, isVisible: true, metadata: { toolName: this.toolName }, data: { handles: { points: new Array(), activeHandleIndex: null, textBox: { hasMoved: false, worldPosition: [0, 0, 0], worldBoundingBox: { topLeft: [0, 0, 0], topRight: [0, 0, 0], bottomLeft: [0, 0, 0], bottomRight: [0, 0, 0] } } }, cachedStats: {}, label: '' } }; for (const baseData of annotationBaseData) { annotation = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__["default"](annotation, baseData); } return annotation; } createAnnotation(evt, points, ...annotationBaseData) { const eventDetail = evt.detail; const { currentPoints, element } = eventDetail; const { world: worldPos } = currentPoints; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(element); const { viewport } = enabledElement; const camera = viewport.getCamera(); const { viewPlaneNormal, viewUp, position: cameraPosition } = camera; const referencedImageId = this.getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp); const viewReference = viewport.getViewReference({ points: [worldPos] }); const annotation = AnnotationDisplayTool.createAnnotation({ metadata: { toolName: this.getToolName(), ...viewReference, referencedImageId, viewUp, cameraPosition }, data: { handles: { points: points || [] } } }, ...annotationBaseData); return annotation; } getReferencedImageId(viewport, worldPos, viewPlaneNormal, viewUp) { const targetId = this.getTargetId(viewport); let referencedImageId = targetId.split(/^[a-zA-Z]+:/)[1]; if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"]) { const volumeId = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__.getVolumeId(targetId); const imageVolume = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].getVolume(volumeId); referencedImageId = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__["default"](imageVolume, worldPos, viewPlaneNormal); } return referencedImageId; } getStyle(property, specifications, annotation) { return (0,_stateManagement_annotation_config_helpers__WEBPACK_IMPORTED_MODULE_11__.getStyleProperty)(property, specifications, (0,_stateManagement_annotation_config__WEBPACK_IMPORTED_MODULE_12__["default"])(annotation), this.mode); } } AnnotationDisplayTool.toolName = 'AnnotationDisplayTool'; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AnnotationDisplayTool); /***/ }, /***/ 50559 /*!*********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/base/AnnotationTool.js ***! \*********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 19401); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 67461); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 38277); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @cornerstonejs/core */ 90161); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @cornerstonejs/core */ 28348); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @cornerstonejs/core */ 96146); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @cornerstonejs/core */ 1120); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! gl-matrix */ 93067); /* harmony import */ var _AnnotationDisplayTool__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./AnnotationDisplayTool */ 99937); /* harmony import */ var _stateManagement_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../stateManagement/annotation/annotationLocking */ 11399); /* harmony import */ var _stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../stateManagement/annotation/annotationVisibility */ 97240); /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../stateManagement/annotation/annotationState */ 24703); /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../stateManagement/annotation/helpers/state */ 9906); /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../drawingSvg */ 57810); /* harmony import */ var _utilities_drawing__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../utilities/drawing */ 31404); /* harmony import */ var _enums_ChangeTypes__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../enums/ChangeTypes */ 46190); /* harmony import */ var _stateManagement_annotation_annotationSelection__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../stateManagement/annotation/annotationSelection */ 1736); /* harmony import */ var _utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../utilities/contourSegmentation */ 420); /* harmony import */ var _utilities_safeStructuredClone__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../utilities/safeStructuredClone */ 51122); const { DefaultHistoryMemo } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__; class AnnotationTool extends _AnnotationDisplayTool__WEBPACK_IMPORTED_MODULE_9__["default"] { static createAnnotationForViewport(viewport, ...annotationBaseData) { return this.createAnnotation({ metadata: viewport.getViewReference() }, ...annotationBaseData); } static createAndAddAnnotation(viewport, ...annotationBaseData) { const annotation = this.createAnnotationForViewport(viewport, ...annotationBaseData); (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_12__.addAnnotation)(annotation, viewport.element); (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_13__.triggerAnnotationModified)(annotation, viewport.element); } constructor(toolProps, defaultToolProps) { super(toolProps, defaultToolProps); this.mouseMoveCallback = (evt, filteredAnnotations) => { if (!filteredAnnotations) { return false; } const { element, currentPoints } = evt.detail; const canvasCoords = currentPoints.canvas; let annotationsNeedToBeRedrawn = false; for (const annotation of filteredAnnotations) { if ((0,_stateManagement_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_10__.isAnnotationLocked)(annotation.annotationUID) || !(0,_stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_11__.isAnnotationVisible)(annotation.annotationUID)) { continue; } const { data } = annotation; const activateHandleIndex = data.handles ? data.handles.activeHandleIndex : undefined; const near = this._imagePointNearToolOrHandle(element, annotation, canvasCoords, 6); const nearToolAndNotMarkedActive = near && !annotation.highlighted; const notNearToolAndMarkedActive = !near && annotation.highlighted; if (nearToolAndNotMarkedActive || notNearToolAndMarkedActive) { annotation.highlighted = !annotation.highlighted; annotationsNeedToBeRedrawn = true; } else if (data.handles && data.handles.activeHandleIndex !== activateHandleIndex) { annotationsNeedToBeRedrawn = true; } } return annotationsNeedToBeRedrawn; }; this.isSuvScaled = AnnotationTool.isSuvScaled; if (toolProps.configuration?.getTextLines) { this.configuration.getTextLines = toolProps.configuration.getTextLines; } if (toolProps.configuration?.statsCalculator) { this.configuration.statsCalculator = toolProps.configuration.statsCalculator; } } getHandleNearImagePoint(element, annotation, canvasCoords, proximity) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__["default"])(element); const { viewport } = enabledElement; const { data } = annotation; const { isCanvasAnnotation } = data; const { points, textBox } = data.handles; if (textBox) { const { worldBoundingBox } = textBox; if (worldBoundingBox) { const canvasBoundingBox = { topLeft: viewport.worldToCanvas(worldBoundingBox.topLeft), topRight: viewport.worldToCanvas(worldBoundingBox.topRight), bottomLeft: viewport.worldToCanvas(worldBoundingBox.bottomLeft), bottomRight: viewport.worldToCanvas(worldBoundingBox.bottomRight) }; if (canvasCoords[0] >= canvasBoundingBox.topLeft[0] && canvasCoords[0] <= canvasBoundingBox.bottomRight[0] && canvasCoords[1] >= canvasBoundingBox.topLeft[1] && canvasCoords[1] <= canvasBoundingBox.bottomRight[1]) { data.handles.activeHandleIndex = null; return textBox; } } } for (let i = 0; i < points?.length; i++) { const point = points[i]; const annotationCanvasCoordinate = isCanvasAnnotation ? point.slice(0, 2) : viewport.worldToCanvas(point); const near = gl_matrix__WEBPACK_IMPORTED_MODULE_8__.distance(canvasCoords, annotationCanvasCoordinate) < proximity; if (near === true) { data.handles.activeHandleIndex = i; return point; } } data.handles.activeHandleIndex = null; } getLinkedTextBoxStyle(specifications, annotation) { return { visibility: this.getStyle('textBoxVisibility', specifications, annotation), fontFamily: this.getStyle('textBoxFontFamily', specifications, annotation), fontSize: this.getStyle('textBoxFontSize', specifications, annotation), color: this.getStyle('textBoxColor', specifications, annotation), shadow: this.getStyle('textBoxShadow', specifications, annotation), background: this.getStyle('textBoxBackground', specifications, annotation), lineWidth: this.getStyle('textBoxLinkLineWidth', specifications, annotation), lineDash: this.getStyle('textBoxLinkLineDash', specifications, annotation), textBoxBorderRadius: this.getStyle('textBoxBorderRadius', specifications, annotation), textBoxMargin: this.getStyle('textBoxMargin', specifications, annotation), textBoxLinkLineColor: this.getStyle('textBoxLinkLineColor', specifications, annotation) }; } renderLinkedTextBoxAnnotation(options) { const { enabledElement, svgDrawingHelper, annotation, styleSpecifier, textLines, canvasCoordinates, textBoxUID = '1', placementPoints } = options; const { viewport } = enabledElement; const { element } = viewport; const { annotationUID, data } = annotation; const styleOptions = this.getLinkedTextBoxStyle(styleSpecifier, annotation); if (!styleOptions.visibility) { data.handles.textBox = { hasMoved: false, worldPosition: [0, 0, 0], worldBoundingBox: { topLeft: [0, 0, 0], topRight: [0, 0, 0], bottomLeft: [0, 0, 0], bottomRight: [0, 0, 0] } }; return false; } if (!data.handles.textBox) { data.handles.textBox = { hasMoved: false, worldPosition: [0, 0, 0], worldBoundingBox: { topLeft: [0, 0, 0], topRight: [0, 0, 0], bottomLeft: [0, 0, 0], bottomRight: [0, 0, 0] } }; } const pointsForPlacement = placementPoints ?? canvasCoordinates; if (!data.handles.textBox.hasMoved) { const canvasTextBoxCoords = (0,_utilities_drawing__WEBPACK_IMPORTED_MODULE_15__["default"])(pointsForPlacement, element, textLines); data.handles.textBox.worldPosition = viewport.canvasToWorld(canvasTextBoxCoords); } const textBoxPosition = viewport.worldToCanvas(data.handles.textBox.worldPosition); const boundingBox = (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_14__["default"])(svgDrawingHelper, annotationUID, textBoxUID, textLines, textBoxPosition, canvasCoordinates, {}, styleOptions); const { x: left, y: top, width, height } = boundingBox; data.handles.textBox.worldBoundingBox = { topLeft: viewport.canvasToWorld([left, top]), topRight: viewport.canvasToWorld([left + width, top]), bottomLeft: viewport.canvasToWorld([left, top + height]), bottomRight: viewport.canvasToWorld([left + width, top + height]) }; return true; } static isSuvScaled(viewport, targetId, imageId) { if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"]) { const volumeId = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__.getVolumeId(targetId); const volume = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"].getVolume(volumeId); return volume?.scaling?.PT !== undefined; } const scalingModule = imageId && _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.get('scalingModule', imageId); return typeof scalingModule?.suvbw === 'number'; } getAnnotationStyle(context) { const { annotation, styleSpecifier } = context; const getStyle = property => this.getStyle(property, styleSpecifier, annotation); const { annotationUID } = annotation; const visibility = (0,_stateManagement_annotation_annotationVisibility__WEBPACK_IMPORTED_MODULE_11__.isAnnotationVisible)(annotationUID); const locked = (0,_stateManagement_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_10__.isAnnotationLocked)(annotationUID); const lineWidth = getStyle('lineWidth'); const lineDash = getStyle('lineDash'); const angleArcLineDash = getStyle('angleArcLineDash'); const color = getStyle('color'); const markerSize = getStyle('markerSize'); const shadow = getStyle('shadow'); const textboxStyle = this.getLinkedTextBoxStyle(styleSpecifier, annotation); return { visibility, locked, color, lineWidth, lineDash, lineOpacity: 1, fillColor: color, fillOpacity: 0, shadow, textbox: textboxStyle, markerSize, angleArcLineDash }; } _imagePointNearToolOrHandle(element, annotation, canvasCoords, proximity) { const handleNearImagePoint = this.getHandleNearImagePoint(element, annotation, canvasCoords, proximity); if (handleNearImagePoint) { return true; } const toolNewImagePoint = this.isPointNearTool(element, annotation, canvasCoords, proximity, 'mouse'); if (toolNewImagePoint) { return true; } } static createAnnotationState(annotation, deleting) { const { data, annotationUID } = annotation; return { annotationUID, data: (0,_utilities_safeStructuredClone__WEBPACK_IMPORTED_MODULE_19__.safeStructuredClone)(data), deleting }; } static createAnnotationMemo(element, annotation, options) { if (!annotation) { return; } const { newAnnotation, deleting = newAnnotation ? false : undefined } = options || {}; const { annotationUID } = annotation; const state = AnnotationTool.createAnnotationState(annotation, deleting); const annotationMemo = { restoreMemo: () => { const newState = AnnotationTool.createAnnotationState(annotation, deleting); const { viewport } = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__["default"])(element) || {}; viewport?.setViewReference(annotation.metadata); if (state.deleting === true) { state.deleting = false; Object.assign(annotation.data, state.data); if (annotation.data.contour) { const annotationData = annotation.data; annotationData.contour.polyline = state.data.contour.pointsManager.points; delete state.data.contour.pointsManager; if (annotationData.segmentation) { (0,_utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_18__.addContourSegmentationAnnotation)(annotation); } } state.data = newState.data; (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_12__.addAnnotation)(annotation, element); (0,_stateManagement_annotation_annotationSelection__WEBPACK_IMPORTED_MODULE_17__.setAnnotationSelected)(annotation.annotationUID, true); viewport?.render(); return; } if (state.deleting === false) { state.deleting = true; state.data = newState.data; (0,_stateManagement_annotation_annotationSelection__WEBPACK_IMPORTED_MODULE_17__.setAnnotationSelected)(annotation.annotationUID); (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_12__.removeAnnotation)(annotation.annotationUID); viewport?.render(); return; } const currentAnnotation = (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_12__.getAnnotation)(annotationUID); if (!currentAnnotation) { console.warn('No current annotation'); return; } Object.assign(currentAnnotation.data, state.data); if (currentAnnotation.data.contour) { currentAnnotation.data.contour.polyline = state.data.contour.pointsManager.points; } state.data = newState.data; currentAnnotation.invalidated = true; if (element) { (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_13__.triggerAnnotationModified)(currentAnnotation, element, _enums_ChangeTypes__WEBPACK_IMPORTED_MODULE_16__["default"].History); } }, id: annotationUID, operationType: 'annotation' }; DefaultHistoryMemo.push(annotationMemo); return annotationMemo; } createMemo(element, annotation, options) { this.memo ||= AnnotationTool.createAnnotationMemo(element, annotation, options); } startGroupRecording() { DefaultHistoryMemo.startGroupRecording(); } endGroupRecording() { DefaultHistoryMemo.endGroupRecording(); } static hydrateBase(ToolClass, enabledElement, points, options = {}) { if (!enabledElement) { return null; } const { viewport } = enabledElement; const FrameOfReferenceUID = viewport.getFrameOfReferenceUID(); const camera = viewport.getCamera(); const viewPlaneNormal = options.viewplaneNormal ?? camera.viewPlaneNormal; const viewUp = options.viewUp ?? camera.viewUp; const instance = options.toolInstance || new ToolClass(); let referencedImageId; let finalViewPlaneNormal = viewPlaneNormal; let finalViewUp = viewUp; if (options.referencedImageId) { referencedImageId = options.referencedImageId; finalViewPlaneNormal = undefined; finalViewUp = undefined; } else { if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"]) { const closestImageIndex = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_7__["default"](points[0], viewport); if (closestImageIndex !== undefined) { referencedImageId = viewport.getImageIds()[closestImageIndex]; } } else if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"]) { referencedImageId = instance.getReferencedImageId(viewport, points[0], viewPlaneNormal, viewUp); } else { throw new Error('Unsupported viewport type'); } } return { FrameOfReferenceUID, referencedImageId, viewPlaneNormal: finalViewPlaneNormal, viewUp: finalViewUp, instance, viewport }; } } AnnotationTool.toolName = 'AnnotationTool'; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AnnotationTool); /***/ }, /***/ 4003 /*!***************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/base/BaseTool.js ***! \***************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 28348); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 70391); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 40232); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/core */ 39367); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @cornerstonejs/core */ 96146); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @cornerstonejs/core */ 47289); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @cornerstonejs/core */ 39672); /* harmony import */ var _enums_ToolModes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../enums/ToolModes */ 92925); const { DefaultHistoryMemo } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__; class BaseTool { get configurationTyped() { return this.configuration; } static { this.defaults = { configuration: { strategies: {}, defaultStrategy: undefined, activeStrategy: undefined, strategyOptions: {} } }; } constructor(toolProps, defaultToolProps) { this.isPrimary = false; const mergedDefaults = BaseTool.mergeDefaultProps(BaseTool.defaults, defaultToolProps); const initialProps = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"](mergedDefaults, toolProps); const { configuration = {}, supportedInteractionTypes, toolGroupId } = initialProps; this.toolGroupId = toolGroupId; this.supportedInteractionTypes = supportedInteractionTypes || []; this.configuration = Object.assign({}, configuration); this.mode = _enums_ToolModes__WEBPACK_IMPORTED_MODULE_7__["default"].Disabled; } static mergeDefaultProps(defaultProps = {}, additionalProps) { if (!additionalProps) { return defaultProps; } return _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"](defaultProps, additionalProps); } static isSpecifiedTargetId(desiredVolumeId) { return (_viewport, { targetId }) => { return targetId.includes(desiredVolumeId); }; } get toolName() { return this.getToolName(); } getToolName() { return this.constructor.toolName; } applyActiveStrategy(enabledElement, operationData) { const { strategies, activeStrategy } = this.configuration; return strategies[activeStrategy]?.call(this, enabledElement, operationData); } applyActiveStrategyCallback(enabledElement, operationData, callbackType, ...extraArgs) { const { strategies, activeStrategy } = this.configuration; if (!strategies[activeStrategy]) { throw new Error(`applyActiveStrategyCallback: active strategy ${activeStrategy} not found, check tool configuration or spellings`); } return strategies[activeStrategy][callbackType]?.call(this, enabledElement, operationData, ...extraArgs); } setConfiguration(newConfiguration) { this.configuration = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"](this.configuration, newConfiguration); } setActiveStrategy(strategyName) { this.setConfiguration({ activeStrategy: strategyName }); } getTargetImageData(targetId) { if (targetId.startsWith('imageId:')) { const imageId = targetId.split('imageId:')[1]; const imageURI = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"](imageId); let viewports = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__["default"](imageURI); if (!viewports || !viewports.length) { return; } viewports = viewports.filter(viewport => { return viewport.getCurrentImageId() === imageId; }); if (!viewports || !viewports.length) { return; } return viewports[0].getImageData(); } else if (targetId.startsWith('volumeId:')) { const volumeId = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.getVolumeId(targetId); const viewports = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__["default"](volumeId); if (!viewports || !viewports.length) { return; } return viewports[0].getImageData(); } else if (targetId.startsWith('videoId:')) { const imageURI = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"](targetId); const viewports = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__["default"](imageURI); if (!viewports || !viewports.length) { return; } return viewports[0].getImageData(); } else { throw new Error('getTargetIdImage: targetId must start with "imageId:" or "volumeId:"'); } } getTargetId(viewport, data) { const { isPreferredTargetId } = this.configurationTyped; if (isPreferredTargetId && data?.cachedStats) { for (const [targetId, cachedStat] of Object.entries(data.cachedStats)) { if (isPreferredTargetId(viewport, { targetId, cachedStat })) { return targetId; } } } const defaultTargetId = viewport.getViewReferenceId?.(); if (defaultTargetId) { return defaultTargetId; } throw new Error('getTargetId: viewport must have a getViewReferenceId method'); } undo() { this.doneEditMemo(); DefaultHistoryMemo.undo(); } redo() { DefaultHistoryMemo.redo(); } static createZoomPanMemo(viewport) { const state = { pan: viewport.getPan(), zoom: viewport.getZoom() }; const zoomPanMemo = { restoreMemo: () => { const currentPan = viewport.getPan(); const currentZoom = viewport.getZoom(); viewport.setZoom(state.zoom); viewport.setPan(state.pan); viewport.render(); state.pan = currentPan; state.zoom = currentZoom; } }; DefaultHistoryMemo.push(zoomPanMemo); return zoomPanMemo; } doneEditMemo() { if (this.memo?.commitMemo?.()) { DefaultHistoryMemo.push(this.memo); } this.memo = null; } static startGroupRecording() { DefaultHistoryMemo.startGroupRecording(); } static endGroupRecording() { DefaultHistoryMemo.endGroupRecording(); } static calculateLengthInIndex(calibrate, indexPoints, closed = false) { const scale = calibrate?.scale || 1; const scaleY = calibrate?.scaleY || scale; const scaleZ = calibrate?.scaleZ || scale; let length = 0; const count = indexPoints.length; const start = closed ? 0 : 1; let lastPoint = closed ? indexPoints[count - 1] : indexPoints[0]; for (let i = start; i < count; i++) { const point = indexPoints[i]; const dx = (point[0] - lastPoint[0]) / scale; const dy = (point[1] - lastPoint[1]) / scaleY; const dz = (point[2] - lastPoint[2]) / scaleZ; length += Math.sqrt(dx * dx + dy * dy + dz * dz); lastPoint = point; } return length; } static isInsideVolume(dimensions, indexPoints) { const { length: count } = indexPoints; for (let i = 0; i < count; i++) { if (!_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__["default"](indexPoints[i], dimensions)) { return false; } } return true; } } BaseTool.toolName = 'BaseTool'; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BaseTool); /***/ }, /***/ 26303 /*!**********************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/base/ContourBaseTool.js ***! \**********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ContourBaseTool: () => (/* binding */ ContourBaseTool), /* harmony export */ "default": () => (/* binding */ ContourBaseTool) /* harmony export */ }); /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stateManagement/annotation/annotationState */ 24703); /* harmony import */ var _drawingSvg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../drawingSvg */ 88086); /* harmony import */ var _AnnotationTool__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AnnotationTool */ 50559); /* harmony import */ var _utilities_contours_updateContourPolyline__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utilities/contours/updateContourPolyline */ 19280); /* harmony import */ var _utilities_contours_getContourHolesDataCanvas__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utilities/contours/getContourHolesDataCanvas */ 81380); class ContourBaseTool extends _AnnotationTool__WEBPACK_IMPORTED_MODULE_2__["default"] { constructor(toolProps, defaultToolProps) { super(toolProps, defaultToolProps); } static getContourSequence(toolData, metadataProvider) { const { data } = toolData; const ContourData = []; for (const point of data.contour.polyline) { for (const v of point) { ContourData.push(v.toFixed(2)); } } const { referencedImageId } = toolData.metadata; const ContourImageSequence = metadataProvider.get('ImageSopInstanceReference', referencedImageId); return { NumberOfContourPoints: ContourData.length / 3, ContourImageSequence, ContourGeometricType: 'CLOSED_PLANAR', ContourData }; } renderAnnotation(enabledElement, svgDrawingHelper) { let renderStatus = false; const { viewport } = enabledElement; const { element } = viewport; if (!viewport.getRenderingEngine()) { console.warn('Rendering Engine has been destroyed'); return renderStatus; } let annotations = (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__.getAnnotations)(this.getToolName(), element); if (!annotations?.length) { return renderStatus; } annotations = this.filterInteractableAnnotationsForElement(element, annotations); if (!annotations?.length) { return renderStatus; } const targetId = this.getTargetId(viewport); const styleSpecifier = { toolGroupId: this.toolGroupId, toolName: this.getToolName(), viewportId: enabledElement.viewport.id }; for (let i = 0; i < annotations.length; i++) { const annotation = annotations[i]; styleSpecifier.annotationUID = annotation.annotationUID; const annotationStyle = this.getAnnotationStyle({ annotation, styleSpecifier }); if (!annotationStyle.visibility) { continue; } const annotationRendered = this.renderAnnotationInstance({ enabledElement, targetId, annotation, annotationStyle, svgDrawingHelper }); renderStatus ||= annotationRendered; annotation.invalidated = false; } return renderStatus; } createAnnotation(evt) { const annotation = super.createAnnotation(evt); Object.assign(annotation.data, { contour: { polyline: [], closed: false } }); Object.assign(annotation, { interpolationUID: '', autoGenerated: false }); return annotation; } addAnnotation(annotation, element) { return (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__.addAnnotation)(annotation, element); } cancelAnnotation(annotation) {} moveAnnotation(annotation, worldPosDelta) { const { points } = annotation.data.handles; for (let i = 0, numPoints = points.length; i < numPoints; i++) { const point = points[i]; point[0] += worldPosDelta[0]; point[1] += worldPosDelta[1]; point[2] += worldPosDelta[2]; } annotation.invalidated = true; (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__.getChildAnnotations)(annotation).forEach(childAnnotation => this.moveAnnotation(childAnnotation, worldPosDelta)); } updateContourPolyline(annotation, polylineData, transforms, options) { const decimateConfig = this.configuration?.decimate || {}; (0,_utilities_contours_updateContourPolyline__WEBPACK_IMPORTED_MODULE_3__["default"])(annotation, polylineData, transforms, { decimate: { enabled: !!decimateConfig.enabled, epsilon: decimateConfig.epsilon }, updateWindingDirection: options?.updateWindingDirection }); } getPolylinePoints(annotation) { return annotation.data.contour?.polyline ?? annotation.data.polyline; } renderAnnotationInstance(renderContext) { const { enabledElement, annotationStyle, svgDrawingHelper } = renderContext; const annotation = renderContext.annotation; if (annotation.parentAnnotationUID) { return; } const { annotationUID } = annotation; const { viewport } = enabledElement; const { worldToCanvas } = viewport; const polylineCanvasPoints = this.getPolylinePoints(annotation).map(point => worldToCanvas(point)); const { lineWidth, lineDash, color, fillColor, fillOpacity } = annotationStyle; const childContours = (0,_utilities_contours_getContourHolesDataCanvas__WEBPACK_IMPORTED_MODULE_4__["default"])(annotation, viewport); const allContours = [polylineCanvasPoints, ...childContours]; (0,_drawingSvg__WEBPACK_IMPORTED_MODULE_1__["default"])(svgDrawingHelper, annotationUID, 'contourPolyline', allContours, { color: color, lineDash: lineDash, lineWidth: Math.max(0.1, lineWidth), fillColor: fillColor, fillOpacity: fillOpacity }); return true; } } /***/ }, /***/ 12329 /*!**********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/base/ContourSegmentationBaseTool.js ***! \**********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ContourSegmentationBaseTool: () => (/* binding */ ContourSegmentationBaseTool), /* harmony export */ "default": () => (/* binding */ ContourSegmentationBaseTool) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 70391); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../enums */ 85543); /* harmony import */ var _ContourBaseTool__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ContourBaseTool */ 26303); /* harmony import */ var _stateManagement_segmentation_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../stateManagement/segmentation/triggerSegmentationEvents */ 82703); /* harmony import */ var _utilities_segmentation_InterpolationManager_InterpolationManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utilities/segmentation/InterpolationManager/InterpolationManager */ 6259); /* harmony import */ var _utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utilities/contourSegmentation */ 420); /* harmony import */ var _utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utilities/contourSegmentation */ 97379); /* harmony import */ var _utilities_triggerAnnotationRenderForToolGroupIds__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utilities/triggerAnnotationRenderForToolGroupIds */ 49796); /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../store/ToolGroupManager */ 43551); /* harmony import */ var _stateManagement_segmentation_getSegmentationRepresentation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../stateManagement/segmentation/getSegmentationRepresentation */ 34625); /* harmony import */ var _stateManagement_segmentation_getActiveSegmentation__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../stateManagement/segmentation/getActiveSegmentation */ 4290); /* harmony import */ var _stateManagement_segmentation_getViewportIdsWithSegmentation__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../stateManagement/segmentation/getViewportIdsWithSegmentation */ 72370); /* harmony import */ var _stateManagement_segmentation_getActiveSegmentIndex__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../stateManagement/segmentation/getActiveSegmentIndex */ 9943); /* harmony import */ var _stateManagement_segmentation_segmentLocking__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../stateManagement/segmentation/segmentLocking */ 7474); /* harmony import */ var _utilities_segmentation_getSVGStyleForSegment__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../utilities/segmentation/getSVGStyleForSegment */ 88852); /* harmony import */ var _stateManagement_segmentation_SegmentationStateManager__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../stateManagement/segmentation/SegmentationStateManager */ 64790); class ContourSegmentationBaseTool extends _ContourBaseTool__WEBPACK_IMPORTED_MODULE_3__["default"] { static { this.PreviewSegmentIndex = 255; } constructor(toolProps, defaultToolProps) { super(toolProps, defaultToolProps); if (this.configuration.interpolation?.enabled) { _utilities_segmentation_InterpolationManager_InterpolationManager__WEBPACK_IMPORTED_MODULE_5__["default"].addTool(this.getToolName()); } } onSetToolConfiguration() { if (this.configuration.interpolation?.enabled) { _utilities_segmentation_InterpolationManager_InterpolationManager__WEBPACK_IMPORTED_MODULE_5__["default"].addTool(this.getToolName()); } else { _utilities_segmentation_InterpolationManager_InterpolationManager__WEBPACK_IMPORTED_MODULE_5__["default"].removeTool(this.getToolName()); } } isContourSegmentationTool() { return true; } createAnnotation(evt) { const eventDetail = evt.detail; const { element } = eventDetail; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element); if (!enabledElement) { return; } const { viewport } = enabledElement; const contourAnnotation = super.createAnnotation(evt); if (!this.isContourSegmentationTool()) { return contourAnnotation; } const activeSeg = (0,_stateManagement_segmentation_getActiveSegmentation__WEBPACK_IMPORTED_MODULE_11__.getActiveSegmentation)(viewport.id); if (!activeSeg) { throw new Error('No active segmentation detected, create one before using scissors tool'); } if (!activeSeg.representationData.Contour) { throw new Error(`A contour segmentation must be active`); } const { segmentationId } = activeSeg; const segmentIndex = (0,_stateManagement_segmentation_getActiveSegmentIndex__WEBPACK_IMPORTED_MODULE_13__.getActiveSegmentIndex)(segmentationId); return _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"](contourAnnotation, { data: { segmentation: { segmentationId, segmentIndex } } }); } addAnnotation(annotation, element) { const annotationUID = super.addAnnotation(annotation, element); if (this.isContourSegmentationTool()) { const contourSegAnnotation = annotation; (0,_utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_6__.addContourSegmentationAnnotation)(contourSegAnnotation); } return annotationUID; } cancelAnnotation(annotation) { if (this.isContourSegmentationTool()) { (0,_utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_7__.removeContourSegmentationAnnotation)(annotation); } super.cancelAnnotation(annotation); } getAnnotationStyle(context) { const annotationStyle = super.getAnnotationStyle(context); if (!this.isContourSegmentationTool()) { return annotationStyle; } const contourSegmentationStyle = this._getContourSegmentationStyle(context); return _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"](annotationStyle, contourSegmentationStyle); } renderAnnotationInstance(renderContext) { const { annotation } = renderContext; const { invalidated } = annotation; const renderResult = super.renderAnnotationInstance(renderContext); if (invalidated && this.isContourSegmentationTool()) { const { segmentationId } = annotation.data.segmentation; (0,_stateManagement_segmentation_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_4__.triggerSegmentationDataModified)(segmentationId); const viewportIds = (0,_stateManagement_segmentation_getViewportIdsWithSegmentation__WEBPACK_IMPORTED_MODULE_12__.getViewportIdsWithSegmentation)(segmentationId); const toolGroupIds = viewportIds.map(viewportId => { const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_9__["default"])(viewportId); return toolGroup?.id; }).filter(toolGroupId => toolGroupId != null); (0,_utilities_triggerAnnotationRenderForToolGroupIds__WEBPACK_IMPORTED_MODULE_8__.triggerAnnotationRenderForToolGroupIds)(toolGroupIds); } return renderResult; } filterInteractableAnnotationsForElement(element, annotations) { if (!annotations || !annotations.length) { return; } const baseFilteredAnnotations = super.filterInteractableAnnotationsForElement(element, annotations); if (!baseFilteredAnnotations || !baseFilteredAnnotations.length) { return; } const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element); const { viewport } = enabledElement; return baseFilteredAnnotations.filter(annotation => { const segmentationId = annotation?.data?.segmentation?.segmentationId; if (!segmentationId) { return true; } return !!_stateManagement_segmentation_SegmentationStateManager__WEBPACK_IMPORTED_MODULE_16__.defaultSegmentationStateManager.getSegmentationRepresentation(viewport.id, { segmentationId, type: _enums__WEBPACK_IMPORTED_MODULE_2__["default"].Contour }); }); } _getContourSegmentationStyle(context) { const annotation = context.annotation; const { segmentationId, segmentIndex } = annotation.data.segmentation; const { viewportId } = context.styleSpecifier; const segmentationRepresentations = (0,_stateManagement_segmentation_getSegmentationRepresentation__WEBPACK_IMPORTED_MODULE_10__.getSegmentationRepresentations)(viewportId, { segmentationId }); if (!segmentationRepresentations?.length) { return {}; } let segmentationRepresentation; if (segmentationRepresentations.length > 1) { segmentationRepresentation = segmentationRepresentations.find(rep => rep.segmentationId === segmentationId && rep.type === _enums__WEBPACK_IMPORTED_MODULE_2__["default"].Contour); } else { segmentationRepresentation = segmentationRepresentations[0]; } const { autoGenerated } = annotation; const segmentsLocked = (0,_stateManagement_segmentation_segmentLocking__WEBPACK_IMPORTED_MODULE_14__.getLockedSegmentIndices)(segmentationId); const annotationLocked = segmentsLocked.includes(segmentIndex); const { color, fillColor, lineWidth, fillOpacity, lineDash, visibility } = (0,_utilities_segmentation_getSVGStyleForSegment__WEBPACK_IMPORTED_MODULE_15__.getSVGStyleForSegment)({ segmentationId, segmentIndex, viewportId, autoGenerated }); return { color, fillColor, lineWidth, fillOpacity, lineDash, textbox: { color }, visibility, locked: annotationLocked }; } } /***/ }, /***/ 57639 /*!************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Contour/contourConfig.js ***! \************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); const defaultContourConfig = { renderOutline: true, outlineWidthAutoGenerated: 3, outlineWidth: 1, outlineWidthInactive: 1, outlineOpacity: 1, outlineOpacityInactive: 0.85, outlineDash: undefined, outlineDashInactive: undefined, outlineDashAutoGenerated: '5,3', activeSegmentOutlineWidthDelta: 0, renderFill: true, fillAlpha: 0.5, fillAlphaInactive: 0.3, fillAlphaAutoGenerated: 0.3 }; function getDefaultContourStyle() { return defaultContourConfig; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getDefaultContourStyle); /***/ }, /***/ 50011 /*!*************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Contour/contourDisplay.js ***! \*************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 15247); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 38277); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @cornerstonejs/core */ 99799); /* harmony import */ var _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../enums/SegmentationRepresentations */ 85543); /* harmony import */ var _contourHandler_handleContourSegmentation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./contourHandler/handleContourSegmentation */ 17872); /* harmony import */ var _stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../stateManagement/segmentation/getSegmentation */ 42952); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../config */ 3690); /* harmony import */ var _utilities_segmentation_computeAndAddRepresentation__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../utilities/segmentation/computeAndAddRepresentation */ 25820); /* harmony import */ var _utilities_segmentation_getUniqueSegmentIndices__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../utilities/segmentation/getUniqueSegmentIndices */ 62481); /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../stateManagement/annotation/annotationState */ 24703); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! gl-matrix */ 87396); const polySegConversionInProgressForViewportId = new Map(); const processedViewportSegmentations = new Map(); function removeRepresentation(viewportId, segmentationId, renderImmediate = false) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__.getEnabledElementByViewportId)(viewportId); if (!enabledElement) { return; } const { viewport } = enabledElement; if (!renderImmediate) { return; } viewport.render(); } function render(_x, _x2) { return _render.apply(this, arguments); } function _render() { _render = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (viewport, contourRepresentation) { const { segmentationId } = contourRepresentation; const segmentation = (0,_stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_7__.getSegmentation)(segmentationId); if (!segmentation) { return; } let contourData = segmentation.representationData[_enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_5__["default"].Contour]; const polySeg = (0,_config__WEBPACK_IMPORTED_MODULE_8__.getPolySeg)(); if (!contourData && (0,_config__WEBPACK_IMPORTED_MODULE_8__.getPolySeg)()?.canComputeRequestedRepresentation(segmentationId, _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_5__["default"].Contour) && !polySegConversionInProgressForViewportId.get(viewport.id)) { polySegConversionInProgressForViewportId.set(viewport.id, true); try { contourData = yield (0,_utilities_segmentation_computeAndAddRepresentation__WEBPACK_IMPORTED_MODULE_9__.computeAndAddRepresentation)(segmentationId, _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_5__["default"].Contour, () => polySeg.computeContourData(segmentationId, { viewport })); } catch (error) { console.warn('Unable to compute contour data for segmentationId', segmentationId, error); } polySegConversionInProgressForViewportId.set(viewport.id, false); } else if (!contourData && !(0,_config__WEBPACK_IMPORTED_MODULE_8__.getPolySeg)()) { console.debug(`No contour data found for segmentationId ${segmentationId} and PolySeg add-on is not configured. Unable to convert from other representations to contour. Please register PolySeg using cornerstoneTools.init({ addons: { polySeg } }) to enable automatic conversion.`); } if (!contourData) { return; } if (!contourData.geometryIds?.length) { return; } let hasContourDataButNotMatchingViewport = false; const viewportNormal = viewport.getCamera().viewPlaneNormal; if (contourData.annotationUIDsMap) { hasContourDataButNotMatchingViewport = !_checkContourNormalsMatchViewport(contourData.annotationUIDsMap, viewportNormal); } if (contourData.geometryIds.length > 0) { hasContourDataButNotMatchingViewport = !_checkContourGeometryMatchViewport(contourData.geometryIds, viewportNormal); } const viewportProcessed = processedViewportSegmentations.get(viewport.id) || new Set(); if (hasContourDataButNotMatchingViewport && !polySegConversionInProgressForViewportId.get(viewport.id) && !viewportProcessed.has(segmentationId) && viewport.viewportStatus === _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].RENDERED) { polySegConversionInProgressForViewportId.set(viewport.id, true); const segmentIndices = (0,_utilities_segmentation_getUniqueSegmentIndices__WEBPACK_IMPORTED_MODULE_10__.getUniqueSegmentIndices)(segmentationId); const surfacesInfo = yield polySeg.computeSurfaceData(segmentationId, { segmentIndices, viewport }); const geometryIds = surfacesInfo.geometryIds; const pointsAndPolys = []; for (const geometryId of geometryIds.values()) { const geometry = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"].getGeometry(geometryId); const data = geometry.data; pointsAndPolys.push({ points: data.points, polys: data.polys, segmentIndex: data.segmentIndex, id: data.segmentIndex }); } const polyDataCache = yield polySeg.clipAndCacheSurfacesForViewport(pointsAndPolys, viewport); const rawResults = polySeg.extractContourData(polyDataCache); const annotationUIDsMap = polySeg.createAndAddContourSegmentationsFromClippedSurfaces(rawResults, viewport, segmentationId); contourData.annotationUIDsMap = new Map([...contourData.annotationUIDsMap, ...annotationUIDsMap]); viewportProcessed.add(segmentationId); processedViewportSegmentations.set(viewport.id, viewportProcessed); polySegConversionInProgressForViewportId.set(viewport.id, false); } (0,_contourHandler_handleContourSegmentation__WEBPACK_IMPORTED_MODULE_6__.handleContourSegmentation)(viewport, contourData.geometryIds, contourData.annotationUIDsMap, contourRepresentation); }); return _render.apply(this, arguments); } function _checkContourGeometryMatchViewport(geometryIds, viewportNormal) { let validGeometry = null; let geometryData = null; for (const geometryId of geometryIds) { const geometry = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"].getGeometry(geometryId); if (!geometry) { continue; } const data = geometry.data; if (data.contours?.[0]?.points?.length >= 3) { validGeometry = geometry; geometryData = data; break; } } if (!validGeometry || !geometryData) { return false; } const contours = geometryData.contours; const { points } = contours[0]; const [point] = points; const delta = gl_matrix__WEBPACK_IMPORTED_MODULE_12__.create(); const { length } = points; const increment = Math.ceil(length / 25); for (let i = 1; i < length; i += increment) { const point2 = points[i]; gl_matrix__WEBPACK_IMPORTED_MODULE_12__.sub(delta, point, point2); gl_matrix__WEBPACK_IMPORTED_MODULE_12__.normalize(delta, delta); if (gl_matrix__WEBPACK_IMPORTED_MODULE_12__.dot(viewportNormal, delta) > 0.1) { return false; } } return true; } function _checkContourNormalsMatchViewport(annotationUIDsMap, viewportNormal) { const annotationUIDs = Array.from(annotationUIDsMap.values()).flat().map(uidSet => Array.from(uidSet)).flat(); const randomAnnotationUIDs = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__.getRandomSampleFromArray(annotationUIDs, 3); for (const annotationUID of randomAnnotationUIDs) { const annotation = (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_11__.getAnnotation)(annotationUID); if (annotation?.metadata) { if (!annotation.metadata.viewPlaneNormal) { continue; } const annotationNormal = annotation.metadata.viewPlaneNormal; const dotProduct = Math.abs(viewportNormal[0] * annotationNormal[0] + viewportNormal[1] * annotationNormal[1] + viewportNormal[2] * annotationNormal[2]); if (Math.abs(dotProduct - 1) > 0.01) { return false; } } } return true; } function getUpdateFunction(viewport) { return null; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ getUpdateFunction, render, removeRepresentation }); /***/ }, /***/ 17872 /*!***************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Contour/contourHandler/handleContourSegmentation.js ***! \***************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ addContourSetsToElement: () => (/* binding */ addContourSetsToElement), /* harmony export */ handleContourSegmentation: () => (/* binding */ handleContourSegmentation) /* harmony export */ }); /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../stateManagement/annotation/annotationState */ 24703); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 38277); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 29760); /* harmony import */ var _utilities_annotationHydration__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../utilities/annotationHydration */ 1316); /* harmony import */ var _utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../utilities/contourSegmentation */ 420); /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ 72955); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../enums */ 85543); /* harmony import */ var _stateManagement_segmentation_SegmentationStyle__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../stateManagement/segmentation/SegmentationStyle */ 21257); function handleContourSegmentation(viewport, geometryIds, annotationUIDsMap, contourRepresentation) { if (annotationUIDsMap.size) { viewport.render(); } else { addContourSetsToElement(viewport, geometryIds, contourRepresentation); } } function addContourSetsToElement(viewport, geometryIds, contourRepresentation) { const { segmentationId } = contourRepresentation; const segmentSpecificMap = new Map(); geometryIds.forEach(geometryId => { const geometry = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].getGeometry(geometryId); if (!geometry) { console.warn(`No geometry found for geometryId ${geometryId}. Skipping render.`); return; } const segmentIndex = geometry.data.segmentIndex; (0,_utils__WEBPACK_IMPORTED_MODULE_5__.validateGeometry)(geometry); const segmentSpecificConfig = _stateManagement_segmentation_SegmentationStyle__WEBPACK_IMPORTED_MODULE_7__.segmentationStyle.getStyle({ viewportId: viewport.id, segmentationId, type: _enums__WEBPACK_IMPORTED_MODULE_6__["default"].Contour, segmentIndex }); const contourSet = geometry.data; const viewPlaneNormal = viewport.getCamera().viewPlaneNormal; contourSet.contours.forEach(contour => { const { points, color, id } = contour; const referencedImageId = (0,_utilities_annotationHydration__WEBPACK_IMPORTED_MODULE_3__.getClosestImageIdForStackViewport)(viewport, points[0], viewPlaneNormal); const contourSegmentationAnnotation = { annotationUID: _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"](), data: { contour: { closed: true, polyline: points }, segmentation: { segmentationId, segmentIndex, color, id }, handles: {} }, handles: {}, highlighted: false, autoGenerated: false, invalidated: false, isLocked: true, isVisible: true, metadata: { referencedImageId, toolName: 'PlanarFreehandContourSegmentationTool', FrameOfReferenceUID: viewport.getFrameOfReferenceUID(), viewPlaneNormal: viewport.getCamera().viewPlaneNormal } }; const annotationGroupSelector = viewport.element; (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__.addAnnotation)(contourSegmentationAnnotation, annotationGroupSelector); (0,_utilities_contourSegmentation__WEBPACK_IMPORTED_MODULE_4__.addContourSegmentationAnnotation)(contourSegmentationAnnotation); }); if (segmentSpecificConfig) { segmentSpecificMap.set(segmentIndex, segmentSpecificConfig); } }); viewport.render(); } /***/ }, /***/ 72955 /*!*******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Contour/contourHandler/utils.js ***! \*******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getPolyData: () => (/* binding */ getPolyData), /* harmony export */ validateGeometry: () => (/* binding */ validateGeometry) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 74387); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 37029); /* harmony import */ var _kitware_vtk_js_Common_Core_CellArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @kitware/vtk.js/Common/Core/CellArray */ 67128); /* harmony import */ var _kitware_vtk_js_Common_Core_Points__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @kitware/vtk.js/Common/Core/Points */ 10254); /* harmony import */ var _kitware_vtk_js_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @kitware/vtk.js/Common/DataModel/PolyData */ 95765); function validateGeometry(geometry) { if (!geometry) { throw new Error(`No contours found for geometryId ${geometry.id}`); } const geometryId = geometry.id; if (geometry.type !== _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].CONTOUR) { throw new Error(`Geometry type ${geometry.type} not supported for rendering.`); } if (!geometry.data) { console.warn(`No contours found for geometryId ${geometryId}. Skipping render.`); return; } } function getPolyData(contourSet) { const pointArray = []; const points = _kitware_vtk_js_Common_Core_Points__WEBPACK_IMPORTED_MODULE_3__["default"].newInstance(); const lines = _kitware_vtk_js_Common_Core_CellArray__WEBPACK_IMPORTED_MODULE_2__["default"].newInstance(); let pointIndex = 0; contourSet.contours.forEach(contour => { const pointList = contour.points; const flatPoints = contour.flatPointsArray; const type = contour.type; const pointIndexes = pointList.map((_, pointListIndex) => pointListIndex + pointIndex); if (type === _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].CLOSED_PLANAR) { pointIndexes.push(pointIndexes[0]); } const linePoints = Float32Array.from(flatPoints); pointArray.push(...linePoints); lines.insertNextCell([...pointIndexes]); pointIndex = pointIndex + pointList.length; }); points.setData(pointArray, 3); const polygon = _kitware_vtk_js_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_4__["default"].newInstance(); polygon.setPoints(points); polygon.setLines(lines); return polygon; } /***/ }, /***/ 83261 /*!********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Labelmap/addLabelmapToElement.js ***! \********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 27426); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 19371); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/core */ 37508); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @cornerstonejs/core */ 19401); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @cornerstonejs/core */ 38277); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @cornerstonejs/core */ 10372); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @cornerstonejs/core */ 80853); /* harmony import */ var _stateManagement_segmentation_getCurrentLabelmapImageIdForViewport__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../stateManagement/segmentation/getCurrentLabelmapImageIdForViewport */ 96340); /* harmony import */ var _stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../stateManagement/segmentation/getSegmentation */ 42952); /* harmony import */ var _stateManagement_segmentation_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../stateManagement/segmentation/triggerSegmentationEvents */ 82703); /* harmony import */ var _stateManagement_segmentation_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../stateManagement/segmentation/triggerSegmentationEvents */ 43815); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../enums */ 85543); /* harmony import */ var _addVolumesAsIndependentComponents__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./addVolumesAsIndependentComponents */ 43211); const { uuidv4 } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_8__; function addLabelmapToElement(_x, _x2, _x3, _x4) { return _addLabelmapToElement.apply(this, arguments); } function _addLabelmapToElement() { _addLabelmapToElement = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (element, labelMapData, segmentationId, config) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__["default"])(element); const { renderingEngine, viewport } = enabledElement; const { id: viewportId } = viewport; const visibility = true; const immediateRender = false; const suppressEvents = true; if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__["default"]) { const volumeLabelMapData = labelMapData; const volumeId = _ensureVolumeHasVolumeId(volumeLabelMapData, segmentationId); if (!_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__["default"].getVolume(volumeId)) { yield _handleMissingVolume(labelMapData); } let blendMode = config?.blendMode ?? _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].MAXIMUM_INTENSITY_BLEND; let useIndependentComponents = blendMode === _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].LABELMAP_EDGE_PROJECTION_BLEND; if (useIndependentComponents) { const referenceVolumeId = viewport.getVolumeId(); const baseVolume = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__["default"].getVolume(referenceVolumeId); const segVolume = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__["default"].getVolume(volumeId); const segDims = segVolume.dimensions; const refDims = baseVolume.dimensions; if (segDims[0] !== refDims[0] || segDims[1] !== refDims[1] || segDims[2] !== refDims[2]) { useIndependentComponents = false; blendMode = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].MAXIMUM_INTENSITY_BLEND; console.debug('Dimensions mismatch - falling back to regular volume addition'); } } const volumeInputs = [{ volumeId, visibility, representationUID: `${segmentationId}-${_enums__WEBPACK_IMPORTED_MODULE_13__["default"].Labelmap}`, useIndependentComponents, blendMode }]; if (!volumeInputs[0].useIndependentComponents) { yield (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(renderingEngine, volumeInputs, [viewportId], immediateRender, suppressEvents); } else { const result = yield (0,_addVolumesAsIndependentComponents__WEBPACK_IMPORTED_MODULE_14__.addVolumesAsIndependentComponents)({ viewport, volumeInputs, segmentationId }); return result; } } else { const segmentationImageIds = (0,_stateManagement_segmentation_getCurrentLabelmapImageIdForViewport__WEBPACK_IMPORTED_MODULE_9__.getCurrentLabelmapImageIdsForViewport)(viewport.id, segmentationId); const stackInputs = segmentationImageIds.map(imageId => ({ imageId, representationUID: `${segmentationId}-${_enums__WEBPACK_IMPORTED_MODULE_13__["default"].Labelmap}-${imageId}` })); (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__["default"])(renderingEngine, stackInputs, [viewportId]); } (0,_stateManagement_segmentation_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_11__.triggerSegmentationDataModified)(segmentationId); }); return _addLabelmapToElement.apply(this, arguments); } function _ensureVolumeHasVolumeId(labelMapData, segmentationId) { let { volumeId } = labelMapData; if (!volumeId) { volumeId = uuidv4(); const segmentation = (0,_stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_10__.getSegmentation)(segmentationId); segmentation.representationData.Labelmap = { ...segmentation.representationData.Labelmap, volumeId }; labelMapData.volumeId = volumeId; (0,_stateManagement_segmentation_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_12__.triggerSegmentationModified)(segmentationId); } return volumeId; } function _handleMissingVolume(_x5) { return _handleMissingVolume2.apply(this, arguments); } function _handleMissingVolume2() { _handleMissingVolume2 = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (labelMapData) { const stackData = labelMapData; const hasImageIds = stackData.imageIds.length > 0; if (!hasImageIds) { throw new Error('cannot create labelmap, no imageIds found for the volume labelmap'); } const volume = yield _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_7__.createAndCacheVolumeFromImages(labelMapData.volumeId || uuidv4(), stackData.imageIds); return volume; }); return _handleMissingVolume2.apply(this, arguments); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (addLabelmapToElement); /***/ }, /***/ 43211 /*!*********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Labelmap/addVolumesAsIndependentComponents.js ***! \*********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ addVolumesAsIndependentComponents: () => (/* binding */ addVolumesAsIndependentComponents) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 27426); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 59766); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/core */ 28699); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @cornerstonejs/core */ 38277); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @cornerstonejs/core */ 10372); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../enums */ 54870); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../enums */ 85543); /* harmony import */ var _stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../stateManagement/segmentation/getSegmentation */ 42952); const internalCache = new Map(); const load = ({ cfun, ofun, actor }) => { actor.getProperty().setRGBTransferFunction(1, cfun); actor.getProperty().setScalarOpacity(1, ofun); }; function addVolumesAsIndependentComponents(_x) { return _addVolumesAsIndependentComponents.apply(this, arguments); } function _addVolumesAsIndependentComponents() { _addVolumesAsIndependentComponents = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* ({ viewport, volumeInputs, segmentationId }) { const defaultActor = viewport.getDefaultActor(); const { actor } = defaultActor; const { uid } = defaultActor; const referenceVolumeId = viewport.getVolumeId(); if (internalCache.get(uid)?.added) { return { uid, actor }; } const volumeInputArray = volumeInputs; const firstImageVolume = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__["default"].getVolume(volumeInputArray[0].volumeId); if (!firstImageVolume) { throw new Error(`imageVolume with id: ${firstImageVolume.volumeId} does not exist`); } const { volumeId } = volumeInputArray[0]; const segImageVolume = yield _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__.loadVolume(volumeId); if (!segImageVolume) { throw new Error(`segImageVolume with id: ${segImageVolume.volumeId} does not exist`); } const segVoxelManager = segImageVolume.voxelManager; const segData = segVoxelManager.getCompleteScalarDataArray(); const { imageData: segImageData } = segImageVolume; const baseVolume = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__["default"].getVolume(referenceVolumeId); const volumeTexture = baseVolume.vtkOpenGLTexture; const hasPendingFrames = volumeTexture.hasUpdatedFrames(); if (hasPendingFrames) { return; } const baseVoxelManager = baseVolume.voxelManager; const baseData = baseVoxelManager.getCompleteScalarDataArray(); const newComp = 2; const cubeData = new Float32Array(newComp * baseVolume.voxelManager.getScalarDataLength()); const dims = segImageData.getDimensions(); for (let z = 0; z < dims[2]; ++z) { for (let y = 0; y < dims[1]; ++y) { for (let x = 0; x < dims[0]; ++x) { const iTuple = x + dims[0] * (y + dims[1] * z); cubeData[iTuple * newComp + 0] = baseData[iTuple]; cubeData[iTuple * newComp + 1] = segData[iTuple]; } } } viewport.removeActors([uid]); const oldMapper = actor.getMapper(); const mapper = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.convertMapperToNotSharedMapper)(oldMapper); actor.setMapper(mapper); mapper.setBlendMode(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].LABELMAP_EDGE_PROJECTION_BLEND); const arrayAgain = mapper.getInputData().getPointData().getArray(0); arrayAgain.setData(cubeData); arrayAgain.setNumberOfComponents(2); const oldColorMixPreset = actor.getProperty().getColorMixPreset(); actor.getProperty().setColorMixPreset(1); const oldForceNearestInterpolation = actor.getProperty().getForceNearestInterpolation(1); actor.getProperty().setForceNearestInterpolation(1, true); const oldIndependentComponents = actor.getProperty().getIndependentComponents(); actor.getProperty().setIndependentComponents(true); viewport.addActor({ ...defaultActor, representationUID: `${segmentationId}-${_enums__WEBPACK_IMPORTED_MODULE_7__["default"].Labelmap}` }); internalCache.set(uid, { added: true, segmentationRepresentationUID: `${segmentationId}`, originalBlendMode: viewport.getBlendMode() }); const oldPreLoad = actor.get('preLoad'); actor.set({ preLoad: load }); function onSegmentationDataModified(evt) { const { segmentationId } = evt.detail; const { representationData } = (0,_stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_8__.getSegmentation)(segmentationId); const { volumeId: segVolumeId } = representationData.Labelmap; if (segVolumeId !== segImageVolume.volumeId) { return; } const segmentationVolume = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__["default"].getVolume(segVolumeId); const segVoxelManager = segmentationVolume.voxelManager; const imageData = mapper.getInputData(); const array = imageData.getPointData().getArray(0); const baseData = array.getData(); const newComp = 2; const dims = segImageData.getDimensions(); const slices = Array.from({ length: dims[2] }, (_, i) => i); for (const z of slices) { for (let y = 0; y < dims[1]; ++y) { for (let x = 0; x < dims[0]; ++x) { const iTuple = x + dims[0] * (y + dims[1] * z); baseData[iTuple * newComp + 1] = segVoxelManager.getAtIndex(iTuple); } } } array.setData(baseData); imageData.modified(); viewport.render(); } _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__["default"].addEventListenerDebounced(_enums__WEBPACK_IMPORTED_MODULE_6__["default"].SEGMENTATION_DATA_MODIFIED, onSegmentationDataModified, 200); function onSegmentationRepresentationRemoved(evt) { if (evt.detail.viewportId !== viewport.id) { return; } _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__["default"].removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_6__["default"].SEGMENTATION_DATA_MODIFIED, onSegmentationDataModified); _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__["default"].removeEventListener(_enums__WEBPACK_IMPORTED_MODULE_6__["default"].SEGMENTATION_REPRESENTATION_REMOVED, onSegmentationRepresentationRemoved); const actorEntry = viewport.getActor(uid); if (actorEntry) { viewport.removeActors([uid]); } internalCache.delete(uid); if (viewport.isDisabled) { return; } actor.setMapper(oldMapper); actor.getProperty().setColorMixPreset(oldColorMixPreset); actor.getProperty().setForceNearestInterpolation(1, oldForceNearestInterpolation); actor.getProperty().setIndependentComponents(oldIndependentComponents); viewport.addActor({ ...defaultActor }); actor.set(oldPreLoad); viewport.render(); } _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__["default"].addEventListener(_enums__WEBPACK_IMPORTED_MODULE_6__["default"].SEGMENTATION_REPRESENTATION_REMOVED, onSegmentationRepresentationRemoved); return { uid, actor }; }); return _addVolumesAsIndependentComponents.apply(this, arguments); } /***/ }, /***/ 17461 /*!**************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Labelmap/labelmapConfig.js ***! \**************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); const defaultLabelmapConfig = { renderOutline: true, renderOutlineInactive: true, outlineWidth: 3, outlineWidthInactive: 2, activeSegmentOutlineWidthDelta: 0, renderFill: true, renderFillInactive: true, fillAlpha: 0.5, fillAlphaInactive: 0.4, outlineOpacity: 1, outlineOpacityInactive: 0.85 }; function getDefaultLabelmapStyle() { return defaultLabelmapConfig; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getDefaultLabelmapStyle); /***/ }, /***/ 86101 /*!***************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Labelmap/labelmapDisplay.js ***! \***************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ MAX_NUMBER_COLORS: () => (/* binding */ MAX_NUMBER_COLORS), /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ removeRepresentation: () => (/* binding */ removeRepresentation), /* harmony export */ render: () => (/* binding */ render) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 93667); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _addLabelmapToElement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./addLabelmapToElement */ 83261); /* harmony import */ var _removeLabelmapFromElement__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./removeLabelmapFromElement */ 31803); /* harmony import */ var _stateManagement_segmentation_activeSegmentation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../stateManagement/segmentation/activeSegmentation */ 19560); /* harmony import */ var _stateManagement_segmentation_getColorLUT__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../stateManagement/segmentation/getColorLUT */ 59922); /* harmony import */ var _stateManagement_segmentation_getCurrentLabelmapImageIdForViewport__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../stateManagement/segmentation/getCurrentLabelmapImageIdForViewport */ 96340); /* harmony import */ var _stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../stateManagement/segmentation/getSegmentation */ 42952); /* harmony import */ var _stateManagement_segmentation_SegmentationStyle__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../stateManagement/segmentation/SegmentationStyle */ 21257); /* harmony import */ var _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../enums/SegmentationRepresentations */ 85543); /* harmony import */ var _stateManagement_segmentation_helpers_internalGetHiddenSegmentIndices__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../stateManagement/segmentation/helpers/internalGetHiddenSegmentIndices */ 8881); /* harmony import */ var _stateManagement_segmentation_getActiveSegmentIndex__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../stateManagement/segmentation/getActiveSegmentIndex */ 9943); /* harmony import */ var _stateManagement_segmentation_helpers_getSegmentationActor__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../stateManagement/segmentation/helpers/getSegmentationActor */ 82165); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../config */ 3690); /* harmony import */ var _utilities_segmentation_computeAndAddRepresentation__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../../../utilities/segmentation/computeAndAddRepresentation */ 25820); /* harmony import */ var _stateManagement_segmentation_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../../stateManagement/segmentation/triggerSegmentationEvents */ 82703); /* harmony import */ var _stateManagement_segmentation_SegmentationStateManager__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../../stateManagement/segmentation/SegmentationStateManager */ 64790); const MAX_NUMBER_COLORS = 255; const labelMapConfigCache = new Map(); let polySegConversionInProgress = false; function removeRepresentation(viewportId, segmentationId, renderImmediate = false) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.getEnabledElementByViewportId)(viewportId); labelMapConfigCache.forEach((value, key) => { if (key.includes(segmentationId)) { labelMapConfigCache.delete(key); } }); if (!enabledElement) { return; } const { viewport } = enabledElement; (0,_removeLabelmapFromElement__WEBPACK_IMPORTED_MODULE_4__["default"])(viewport.element, segmentationId); if (!renderImmediate) { return; } viewport.render(); } function render(_x, _x2) { return _render.apply(this, arguments); } function _render() { _render = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (viewport, representation) { const { segmentationId, config } = representation; const segmentation = (0,_stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_8__.getSegmentation)(segmentationId); if (!segmentation) { console.warn('No segmentation found for segmentationId: ', segmentationId); return; } let labelmapData = segmentation.representationData[_enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_10__["default"].Labelmap]; let labelmapActorEntries = (0,_stateManagement_segmentation_helpers_getSegmentationActor__WEBPACK_IMPORTED_MODULE_13__.getLabelmapActorEntries)(viewport.id, segmentationId); if (!labelmapData && (0,_config__WEBPACK_IMPORTED_MODULE_14__.getPolySeg)()?.canComputeRequestedRepresentation(segmentationId, _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_10__["default"].Labelmap) && !polySegConversionInProgress) { polySegConversionInProgress = true; const polySeg = (0,_config__WEBPACK_IMPORTED_MODULE_14__.getPolySeg)(); labelmapData = yield (0,_utilities_segmentation_computeAndAddRepresentation__WEBPACK_IMPORTED_MODULE_15__.computeAndAddRepresentation)(segmentationId, _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_10__["default"].Labelmap, () => polySeg.computeLabelmapData(segmentationId, { viewport }), () => { _stateManagement_segmentation_SegmentationStateManager__WEBPACK_IMPORTED_MODULE_17__.defaultSegmentationStateManager.processLabelmapRepresentationAddition(viewport.id, segmentationId); setTimeout(() => { (0,_stateManagement_segmentation_triggerSegmentationEvents__WEBPACK_IMPORTED_MODULE_16__.triggerSegmentationDataModified)(segmentationId); }, 0); }); if (!labelmapData) { throw new Error(`No labelmap data found for segmentationId ${segmentationId}.`); } polySegConversionInProgress = false; } else if (!labelmapData && !(0,_config__WEBPACK_IMPORTED_MODULE_14__.getPolySeg)()) { console.debug(`No labelmap data found for segmentationId ${segmentationId} and PolySeg add-on is not configured. Unable to convert from other representations to labelmap. Please register PolySeg using cornerstoneTools.init({ addons: { polySeg } }) to enable automatic conversion.`); } if (!labelmapData) { return; } if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"]) { if (!labelmapActorEntries?.length) { yield _addLabelmapToViewport(viewport, labelmapData, segmentationId, config); } labelmapActorEntries = (0,_stateManagement_segmentation_helpers_getSegmentationActor__WEBPACK_IMPORTED_MODULE_13__.getLabelmapActorEntries)(viewport.id, segmentationId); } else { const labelmapImageIds = (0,_stateManagement_segmentation_getCurrentLabelmapImageIdForViewport__WEBPACK_IMPORTED_MODULE_7__.getCurrentLabelmapImageIdsForViewport)(viewport.id, segmentationId); if (!labelmapImageIds?.length) { return; } if (!labelmapActorEntries) { yield _addLabelmapToViewport(viewport, labelmapData, segmentationId, config); } labelmapActorEntries = (0,_stateManagement_segmentation_helpers_getSegmentationActor__WEBPACK_IMPORTED_MODULE_13__.getLabelmapActorEntries)(viewport.id, segmentationId); } if (!labelmapActorEntries?.length) { return; } for (const labelmapActorEntry of labelmapActorEntries) { _setLabelmapColorAndOpacity(viewport.id, labelmapActorEntry, representation); } }); return _render.apply(this, arguments); } function _setLabelmapColorAndOpacity(viewportId, labelmapActorEntry, segmentationRepresentation) { const { segmentationId } = segmentationRepresentation; const { cfun, ofun } = segmentationRepresentation.config; const { colorLUTIndex } = segmentationRepresentation; const activeSegmentation = (0,_stateManagement_segmentation_activeSegmentation__WEBPACK_IMPORTED_MODULE_5__.getActiveSegmentation)(viewportId); const isActiveLabelmap = activeSegmentation?.segmentationId === segmentationId; const labelmapStyle = _stateManagement_segmentation_SegmentationStyle__WEBPACK_IMPORTED_MODULE_9__.segmentationStyle.getStyle({ viewportId, type: _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_10__["default"].Labelmap, segmentationId }); const renderInactiveSegmentations = _stateManagement_segmentation_SegmentationStyle__WEBPACK_IMPORTED_MODULE_9__.segmentationStyle.getRenderInactiveSegmentations(viewportId); const colorLUT = (0,_stateManagement_segmentation_getColorLUT__WEBPACK_IMPORTED_MODULE_6__.getColorLUT)(colorLUTIndex); const numColors = Math.min(256, colorLUT.length); const { outlineWidth, renderOutline, outlineOpacity, activeSegmentOutlineWidthDelta } = _getLabelmapConfig(labelmapStyle, isActiveLabelmap); const segmentsHidden = (0,_stateManagement_segmentation_helpers_internalGetHiddenSegmentIndices__WEBPACK_IMPORTED_MODULE_11__.internalGetHiddenSegmentIndices)(viewportId, { segmentationId, type: _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_10__["default"].Labelmap }); for (let i = 0; i < numColors; i++) { const segmentIndex = i; const segmentColor = colorLUT[segmentIndex]; const perSegmentStyle = _stateManagement_segmentation_SegmentationStyle__WEBPACK_IMPORTED_MODULE_9__.segmentationStyle.getStyle({ viewportId, type: _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_10__["default"].Labelmap, segmentationId, segmentIndex }); const segmentSpecificLabelmapConfig = perSegmentStyle; const { fillAlpha, outlineWidth, renderFill, renderOutline } = _getLabelmapConfig(labelmapStyle, isActiveLabelmap, segmentSpecificLabelmapConfig); const { forceOpacityUpdate, forceColorUpdate } = _needsTransferFunctionUpdate(viewportId, segmentationId, segmentIndex, { fillAlpha, renderFill, renderOutline, segmentColor, outlineWidth, segmentsHidden: segmentsHidden, cfun, ofun }); if (forceColorUpdate) { cfun.addRGBPoint(segmentIndex, segmentColor[0] / MAX_NUMBER_COLORS, segmentColor[1] / MAX_NUMBER_COLORS, segmentColor[2] / MAX_NUMBER_COLORS); } if (forceOpacityUpdate) { if (renderFill) { const segmentOpacity = segmentsHidden.has(segmentIndex) ? 0 : segmentColor[3] / 255 * fillAlpha; ofun.removePoint(segmentIndex); ofun.addPointLong(segmentIndex, segmentOpacity, 0.5, 1.0); } else { ofun.addPointLong(segmentIndex, 0.01, 0.5, 1.0); } } } ofun.setClamping(false); const labelmapActor = labelmapActorEntry.actor; const { preLoad } = labelmapActor.get?.('preLoad') || { preLoad: null }; if (preLoad) { preLoad({ cfun, ofun, actor: labelmapActor }); } else { labelmapActor.getProperty().setRGBTransferFunction(0, cfun); labelmapActor.getProperty().setScalarOpacity(0, ofun); labelmapActor.getProperty().setInterpolationTypeToNearest(); } if (renderOutline) { labelmapActor.getProperty().setUseLabelOutline(renderOutline); labelmapActor.getProperty().setLabelOutlineOpacity(outlineOpacity); const activeSegmentIndex = (0,_stateManagement_segmentation_getActiveSegmentIndex__WEBPACK_IMPORTED_MODULE_12__.getActiveSegmentIndex)(segmentationRepresentation.segmentationId); const outlineWidths = new Array(numColors - 1); for (let i = 1; i < numColors; i++) { const isHidden = segmentsHidden.has(i); if (isHidden) { outlineWidths[i - 1] = 0; continue; } outlineWidths[i - 1] = i === activeSegmentIndex ? outlineWidth + activeSegmentOutlineWidthDelta : outlineWidth; } labelmapActor.getProperty().setLabelOutlineThickness(outlineWidths); labelmapActor.modified(); labelmapActor.getProperty().modified(); labelmapActor.getMapper().modified(); } else { labelmapActor.getProperty().setLabelOutlineThickness(new Array(numColors - 1).fill(0)); } const visible = isActiveLabelmap || renderInactiveSegmentations; labelmapActor.setVisibility(visible); } function _getLabelmapConfig(labelmapConfig, isActiveLabelmap, segmentsLabelmapConfig) { const segmentLabelmapConfig = segmentsLabelmapConfig || {}; const configToUse = { ...labelmapConfig, ...segmentLabelmapConfig }; const fillAlpha = isActiveLabelmap ? configToUse.fillAlpha : configToUse.fillAlphaInactive; const outlineWidth = isActiveLabelmap ? configToUse.outlineWidth : configToUse.outlineWidthInactive; const renderFill = isActiveLabelmap ? configToUse.renderFill : configToUse.renderFillInactive; const renderOutline = isActiveLabelmap ? configToUse.renderOutline : configToUse.renderOutlineInactive; const outlineOpacity = isActiveLabelmap ? configToUse.outlineOpacity : configToUse.outlineOpacityInactive; const activeSegmentOutlineWidthDelta = configToUse.activeSegmentOutlineWidthDelta; return { fillAlpha, outlineWidth, renderFill, renderOutline, outlineOpacity, activeSegmentOutlineWidthDelta }; } function _needsTransferFunctionUpdate(viewportId, segmentationId, segmentIndex, { fillAlpha, renderFill, renderOutline, segmentColor, outlineWidth, segmentsHidden, cfun, ofun }) { const cacheUID = `${viewportId}-${segmentationId}-${segmentIndex}`; const oldConfig = labelMapConfigCache.get(cacheUID); if (!oldConfig) { labelMapConfigCache.set(cacheUID, { fillAlpha, renderFill, renderOutline, outlineWidth, segmentColor: segmentColor.slice(), segmentsHidden: new Set(segmentsHidden), cfunMTime: cfun.getMTime(), ofunMTime: ofun.getMTime() }); return { forceOpacityUpdate: true, forceColorUpdate: true }; } const { fillAlpha: oldFillAlpha, renderFill: oldRenderFill, renderOutline: oldRenderOutline, outlineWidth: oldOutlineWidth, segmentColor: oldSegmentColor, segmentsHidden: oldSegmentsHidden, cfunMTime: oldCfunMTime, ofunMTime: oldOfunMTime } = oldConfig; const forceColorUpdate = oldSegmentColor[0] !== segmentColor[0] || oldSegmentColor[1] !== segmentColor[1] || oldSegmentColor[2] !== segmentColor[2]; const forceOpacityUpdate = oldSegmentColor[3] !== segmentColor[3] || oldFillAlpha !== fillAlpha || oldRenderFill !== renderFill || oldRenderOutline !== renderOutline || oldOutlineWidth !== outlineWidth || oldSegmentsHidden !== segmentsHidden; if (forceOpacityUpdate || forceColorUpdate) { labelMapConfigCache.set(cacheUID, { fillAlpha, renderFill, renderOutline, outlineWidth, segmentColor: segmentColor.slice(), segmentsHidden: new Set(segmentsHidden), cfunMTime: cfun.getMTime(), ofunMTime: ofun.getMTime() }); } return { forceOpacityUpdate, forceColorUpdate }; } function _addLabelmapToViewport(_x3, _x4, _x5, _x6) { return _addLabelmapToViewport2.apply(this, arguments); } function _addLabelmapToViewport2() { _addLabelmapToViewport2 = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (viewport, labelmapData, segmentationId, config) { const result = yield (0,_addLabelmapToElement__WEBPACK_IMPORTED_MODULE_3__["default"])(viewport.element, labelmapData, segmentationId, config); return result || undefined; }); return _addLabelmapToViewport2.apply(this, arguments); } function getUpdateFunction(viewport) { return; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ getUpdateFunction, render, removeRepresentation }); /***/ }, /***/ 31803 /*!*************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Labelmap/removeLabelmapFromElement.js ***! \*************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _stateManagement_segmentation_helpers_getSegmentationActor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../stateManagement/segmentation/helpers/getSegmentationActor */ 82165); function removeLabelmapFromElement(element, segmentationId) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element); const { viewport } = enabledElement; viewport.removeActors([(0,_stateManagement_segmentation_helpers_getSegmentationActor__WEBPACK_IMPORTED_MODULE_1__.getLabelmapActorUID)(viewport.id, segmentationId)]); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (removeLabelmapFromElement); /***/ }, /***/ 33359 /*!**************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Surface/addOrUpdateSurfaceToElement.js ***! \**************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 29760); /* harmony import */ var _kitware_vtk_js_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/Mapper */ 55857); /* harmony import */ var _kitware_vtk_js_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @kitware/vtk.js/Rendering/Core/Actor */ 77251); /* harmony import */ var _kitware_vtk_js_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @kitware/vtk.js/Common/DataModel/PolyData */ 95765); /* harmony import */ var _kitware_vtk_js_Common_Core_CellArray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @kitware/vtk.js/Common/Core/CellArray */ 67128); /* harmony import */ var _stateManagement_segmentation_helpers_getSegmentationActor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../stateManagement/segmentation/helpers/getSegmentationActor */ 82165); function addOrUpdateSurfaceToElement(viewport, surface, segmentationId) { const surfaceActorEntry = (0,_stateManagement_segmentation_helpers_getSegmentationActor__WEBPACK_IMPORTED_MODULE_5__.getSurfaceActorEntry)(viewport.id, segmentationId, surface.segmentIndex); const surfaceActor = surfaceActorEntry?.actor; const isVisible = surface.visible; if (surfaceActor) { surfaceActor.setVisibility(isVisible); if (!isVisible) { return; } const surfaceMapper = surfaceActor.getMapper(); const currentPolyData = surfaceMapper.getInputData(); const newPoints = surface.points; const newPolys = surface.polys; const currentPoints = currentPolyData.getPoints().getData(); const currentPolys = currentPolyData.getPolys().getData(); if (newPoints.length === currentPoints.length && newPolys.length === currentPolys.length) { return; } const polyData = _kitware_vtk_js_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_3__["default"].newInstance(); polyData.getPoints().setData(newPoints, 3); const triangles = _kitware_vtk_js_Common_Core_CellArray__WEBPACK_IMPORTED_MODULE_4__["default"].newInstance({ values: Float32Array.from(newPolys) }); polyData.setPolys(triangles); surfaceMapper.setInputData(polyData); surfaceMapper.modified(); viewport.getRenderer().resetCameraClippingRange(); return; } const points = surface.points; const polys = surface.polys; const color = surface.color; const surfacePolyData = _kitware_vtk_js_Common_DataModel_PolyData__WEBPACK_IMPORTED_MODULE_3__["default"].newInstance(); surfacePolyData.getPoints().setData(points, 3); const triangles = _kitware_vtk_js_Common_Core_CellArray__WEBPACK_IMPORTED_MODULE_4__["default"].newInstance({ values: Float32Array.from(polys) }); surfacePolyData.setPolys(triangles); const mapper = _kitware_vtk_js_Rendering_Core_Mapper__WEBPACK_IMPORTED_MODULE_1__["default"].newInstance({}); let clippingFilter; mapper.setInputData(surfacePolyData); const actor = _kitware_vtk_js_Rendering_Core_Actor__WEBPACK_IMPORTED_MODULE_2__["default"].newInstance(); actor.setMapper(mapper); actor.getProperty().setColor(color[0] / 255, color[1] / 255, color[2] / 255); actor.getProperty().setLineWidth(2); const representationUID = (0,_stateManagement_segmentation_helpers_getSegmentationActor__WEBPACK_IMPORTED_MODULE_5__.getSurfaceRepresentationUID)(segmentationId, surface.segmentIndex); viewport.addActor({ uid: _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"](), actor: actor, clippingFilter, representationUID }); viewport.resetCamera(); viewport.getRenderer().resetCameraClippingRange(); viewport.render(); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (addOrUpdateSurfaceToElement); /***/ }, /***/ 23249 /*!***********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Surface/removeSurfaceFromElement.js ***! \***********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); function removeSurfaceFromElement(element, segmentationId) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element); const { viewport } = enabledElement; const actorEntries = viewport.getActors(); const filteredSurfaceActors = actorEntries.filter(actor => actor.representationUID && typeof actor.representationUID === 'string' && actor.representationUID.startsWith(segmentationId)); viewport.removeActors(filteredSurfaceActors.map(actor => actor.uid)); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (removeSurfaceFromElement); /***/ }, /***/ 67707 /*!*************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/tools/displayTools/Surface/surfaceDisplay.js ***! \*************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ getUpdateFunction: () => (/* binding */ getUpdateFunction), /* harmony export */ removeRepresentation: () => (/* binding */ removeRepresentation), /* harmony export */ render: () => (/* binding */ render) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 38277); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../enums/SegmentationRepresentations */ 85543); /* harmony import */ var _removeSurfaceFromElement__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./removeSurfaceFromElement */ 23249); /* harmony import */ var _addOrUpdateSurfaceToElement__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./addOrUpdateSurfaceToElement */ 33359); /* harmony import */ var _stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../stateManagement/segmentation/getSegmentation */ 42952); /* harmony import */ var _stateManagement_segmentation_getColorLUT__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../stateManagement/segmentation/getColorLUT */ 59922); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../config */ 3690); /* harmony import */ var _utilities_segmentation_computeAndAddRepresentation__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../utilities/segmentation/computeAndAddRepresentation */ 25820); /* harmony import */ var _stateManagement_segmentation_helpers_internalGetHiddenSegmentIndices__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../stateManagement/segmentation/helpers/internalGetHiddenSegmentIndices */ 8881); function removeRepresentation(viewportId, segmentationId, renderImmediate = false) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.getEnabledElementByViewportId)(viewportId); if (!enabledElement) { return; } const { viewport } = enabledElement; (0,_removeSurfaceFromElement__WEBPACK_IMPORTED_MODULE_4__["default"])(viewport.element, segmentationId); if (!renderImmediate) { return; } viewport.render(); } function render(_x, _x2) { return _render.apply(this, arguments); } function _render() { _render = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (viewport, representation) { const { segmentationId, type } = representation; const segmentation = (0,_stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_6__.getSegmentation)(segmentationId); if (!segmentation) { return; } let SurfaceData = segmentation.representationData[_enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_3__["default"].Surface]; if (!SurfaceData && (0,_config__WEBPACK_IMPORTED_MODULE_8__.getPolySeg)()?.canComputeRequestedRepresentation(segmentationId, _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_3__["default"].Surface)) { const polySeg = (0,_config__WEBPACK_IMPORTED_MODULE_8__.getPolySeg)(); SurfaceData = yield (0,_utilities_segmentation_computeAndAddRepresentation__WEBPACK_IMPORTED_MODULE_9__.computeAndAddRepresentation)(segmentationId, _enums_SegmentationRepresentations__WEBPACK_IMPORTED_MODULE_3__["default"].Surface, () => polySeg.computeSurfaceData(segmentationId, { viewport })); if (!SurfaceData) { throw new Error(`No Surface data found for segmentationId ${segmentationId} even we tried to compute it`); } } else if (!SurfaceData && !(0,_config__WEBPACK_IMPORTED_MODULE_8__.getPolySeg)()) { console.debug(`No surface data found for segmentationId ${segmentationId} and PolySeg add-on is not configured. Unable to convert from other representations to surface. Please register PolySeg using cornerstoneTools.init({ addons: { polySeg } }) to enable automatic conversion.`); } if (!SurfaceData) { console.warn(`No Surface data found for segmentationId ${segmentationId}. Skipping render.`); return; } const { geometryIds } = SurfaceData; if (!geometryIds?.size) { console.warn(`No Surfaces found for segmentationId ${segmentationId}. Skipping render.`); } const { colorLUTIndex } = representation; const colorLUT = (0,_stateManagement_segmentation_getColorLUT__WEBPACK_IMPORTED_MODULE_7__.getColorLUT)(colorLUTIndex); const surfaces = []; geometryIds.forEach(geometryId => { const geometry = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"].getGeometry(geometryId); if (!geometry?.data) { console.warn(`No Surfaces found for geometryId ${geometryId}. Skipping render.`); return; } const { segmentIndex } = geometry.data; const hiddenSegments = (0,_stateManagement_segmentation_helpers_internalGetHiddenSegmentIndices__WEBPACK_IMPORTED_MODULE_10__.internalGetHiddenSegmentIndices)(viewport.id, { segmentationId, type }); const isHidden = hiddenSegments.has(segmentIndex); const surface = geometry.data; const color = colorLUT[segmentIndex]; surface.color = color.slice(0, 3); surface.visible = !isHidden; surfaces.push(surface); (0,_addOrUpdateSurfaceToElement__WEBPACK_IMPORTED_MODULE_5__["default"])(viewport, surface, segmentationId); }); viewport.render(); }); return _render.apply(this, arguments); } function getUpdateFunction(viewport) { const polySeg = (0,_config__WEBPACK_IMPORTED_MODULE_8__.getPolySeg)(); return segmentationId => polySeg.updateSurfaceData(segmentationId, { viewport }); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({ getUpdateFunction, render, removeRepresentation }); /***/ }, /***/ 56307 /*!*******************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/types/ContourAnnotation.js ***! \*******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ContourWindingDirection: () => (/* binding */ ContourWindingDirection) /* harmony export */ }); var ContourWindingDirection; (function (ContourWindingDirection) { ContourWindingDirection[ContourWindingDirection["CounterClockwise"] = -1] = "CounterClockwise"; ContourWindingDirection[ContourWindingDirection["Unknown"] = 0] = "Unknown"; ContourWindingDirection[ContourWindingDirection["Clockwise"] = 1] = "Clockwise"; })(ContourWindingDirection || (ContourWindingDirection = {})); /***/ }, /***/ 1316 /*!*************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/annotationHydration.js ***! \*************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ annotationHydration: () => (/* binding */ annotationHydration), /* harmony export */ getClosestImageIdForStackViewport: () => (/* binding */ getClosestImageIdForStackViewport) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 19401); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 67461); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 38277); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/core */ 90161); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @cornerstonejs/core */ 29760); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @cornerstonejs/core */ 96146); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @cornerstonejs/core */ 61200); /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../stateManagement/annotation/annotationState */ 24703); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! gl-matrix */ 87396); function annotationHydration(viewport, toolName, worldPoints, options) { const viewReference = viewport.getViewReference(); const { viewPlaneNormal, FrameOfReferenceUID } = viewReference; const annotation = { annotationUID: options?.annotationUID || _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_4__["default"](), data: { handles: { points: worldPoints } }, highlighted: false, autoGenerated: false, invalidated: false, isLocked: false, isVisible: true, metadata: { toolName, viewPlaneNormal, FrameOfReferenceUID, referencedImageId: getReferencedImageId(viewport, worldPoints[0], viewPlaneNormal), ...options } }; (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_7__.addAnnotation)(annotation, viewport.element); return annotation; } function getReferencedImageId(viewport, worldPos, viewPlaneNormal) { let referencedImageId; if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"]) { referencedImageId = getClosestImageIdForStackViewport(viewport, worldPos, viewPlaneNormal); } else if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"]) { const targetId = getTargetId(viewport); const volumeId = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_5__.getVolumeId(targetId); const imageVolume = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"].getVolume(volumeId); referencedImageId = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_6__["default"](imageVolume, worldPos, viewPlaneNormal); } else { throw new Error('getReferencedImageId: viewport must be a StackViewport or BaseVolumeViewport'); } return referencedImageId; } function getTargetId(viewport) { const targetId = viewport.getViewReferenceId?.(); if (targetId) { return targetId; } if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"]) { return `volumeId:${getTargetVolumeId(viewport)}`; } throw new Error('getTargetId: viewport must have a getTargetId method'); } function getTargetVolumeId(viewport) { const actorEntries = viewport.getActors(); if (!actorEntries) { return; } return actorEntries.find(actorEntry => actorEntry.actor.getClassName() === 'vtkVolume')?.uid; } function getClosestImageIdForStackViewport(viewport, worldPos, viewPlaneNormal) { const imageIds = viewport.getImageIds(); if (!imageIds || !imageIds.length) { return; } const distanceImagePairs = imageIds.map(imageId => { const { imagePositionPatient } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__.get('imagePlaneModule', imageId); const distance = calculateDistanceToImage(worldPos, imagePositionPatient, viewPlaneNormal); return { imageId, distance }; }); distanceImagePairs.sort((a, b) => a.distance - b.distance); return distanceImagePairs[0].imageId; } function calculateDistanceToImage(worldPos, ImagePositionPatient, viewPlaneNormal) { const dir = gl_matrix__WEBPACK_IMPORTED_MODULE_8__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_8__.sub(dir, worldPos, ImagePositionPatient); const dot = gl_matrix__WEBPACK_IMPORTED_MODULE_8__.dot(dir, viewPlaneNormal); return Math.abs(dot); } /***/ }, /***/ 35602 /*!*******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/boundingBox/getBoundingBoxAroundShape.js ***! \*******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getBoundingBoxAroundShapeIJK: () => (/* binding */ getBoundingBoxAroundShapeIJK), /* harmony export */ getBoundingBoxAroundShapeWorld: () => (/* binding */ getBoundingBoxAroundShapeWorld) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 78220); const { EPSILON } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__; function calculateBoundingBox(points, dimensions, isWorld = false) { let xMin = Infinity; let xMax = isWorld ? -Infinity : 0; let yMin = Infinity; let yMax = isWorld ? -Infinity : 0; let zMin = Infinity; let zMax = isWorld ? -Infinity : 0; const is3D = points[0]?.length === 3; for (let i = 0; i < points.length; i++) { const p = points[i]; xMin = Math.min(p[0], xMin); xMax = Math.max(p[0], xMax); yMin = Math.min(p[1], yMin); yMax = Math.max(p[1], yMax); if (is3D) { zMin = Math.min(p[2] ?? zMin, zMin); zMax = Math.max(p[2] ?? zMax, zMax); } } if (dimensions) { xMin = Math.max(isWorld ? dimensions[0] + EPSILON : 0, xMin); xMax = Math.min(isWorld ? dimensions[0] - EPSILON : dimensions[0] - 1, xMax); yMin = Math.max(isWorld ? dimensions[1] + EPSILON : 0, yMin); yMax = Math.min(isWorld ? dimensions[1] - EPSILON : dimensions[1] - 1, yMax); if (is3D && dimensions.length === 3) { zMin = Math.max(isWorld ? dimensions[2] + EPSILON : 0, zMin); zMax = Math.min(isWorld ? dimensions[2] - EPSILON : dimensions[2] - 1, zMax); } } else if (!isWorld) { xMin = Math.max(0, xMin); xMax = Math.min(Infinity, xMax); yMin = Math.max(0, yMin); yMax = Math.min(Infinity, yMax); if (is3D) { zMin = Math.max(0, zMin); zMax = Math.min(Infinity, zMax); } } return is3D ? [[xMin, xMax], [yMin, yMax], [zMin, zMax]] : [[xMin, xMax], [yMin, yMax], null]; } function getBoundingBoxAroundShapeIJK(points, dimensions) { return calculateBoundingBox(points, dimensions, false); } function getBoundingBoxAroundShapeWorld(points, clipBounds) { return calculateBoundingBox(points, clipBounds, true); } /***/ }, /***/ 420 /*!**********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/contourSegmentation/addContourSegmentationAnnotation.js ***! \**********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ addContourSegmentationAnnotation: () => (/* binding */ addContourSegmentationAnnotation) /* harmony export */ }); /* harmony import */ var _stateManagement_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stateManagement/annotation/annotationLocking */ 11399); /* harmony import */ var _stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../stateManagement/segmentation/getSegmentation */ 42952); function addContourSegmentationAnnotation(annotation) { if (annotation.parentAnnotationUID) { return; } if (!annotation.data.segmentation) { throw new Error('addContourSegmentationAnnotation: annotation does not have a segmentation data'); } const { segmentationId, segmentIndex } = annotation.data.segmentation; const segmentation = (0,_stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_1__.getSegmentation)(segmentationId); if (!segmentation.representationData.Contour) { segmentation.representationData.Contour = { annotationUIDsMap: new Map() }; } let { annotationUIDsMap } = segmentation.representationData.Contour; if (!annotationUIDsMap) { annotationUIDsMap = new Map(); } let annotationsUIDsSet = annotationUIDsMap?.get(segmentIndex); if (!annotationsUIDsSet) { annotationsUIDsSet = new Set(); annotationUIDsMap.set(segmentIndex, annotationsUIDsSet); } if (segmentation.segments[segmentIndex].locked) { (0,_stateManagement_annotation_annotationLocking__WEBPACK_IMPORTED_MODULE_0__.setAnnotationLocked)(annotation.annotationUID, true); } annotationUIDsMap.set(segmentIndex, annotationsUIDsSet.add(annotation.annotationUID)); } /***/ }, /***/ 61057 /*!****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/contourSegmentation/areSameSegment.js ***! \****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ areSameSegment) /* harmony export */ }); function areSameSegment(firstAnnotation, secondAnnotation) { const { segmentation: firstSegmentation } = firstAnnotation.data; const { segmentation: secondSegmentation } = secondAnnotation.data; return firstSegmentation.segmentationId === secondSegmentation.segmentationId && firstSegmentation.segmentIndex === secondSegmentation.segmentIndex; } /***/ }, /***/ 84327 /*!****************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/contourSegmentation/getIntersectingAnnotations.js ***! \****************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ findAllIntersectingContours: () => (/* binding */ findAllIntersectingContours) /* harmony export */ }); /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math */ 85160); /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../math */ 5431); /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../math */ 29040); /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../math */ 92035); function findAllIntersectingContours(viewport, sourcePolyline, contourSegmentationAnnotations) { const intersectingContours = []; const sourceAABB = _math__WEBPACK_IMPORTED_MODULE_1__["default"](sourcePolyline); for (let i = 0; i < contourSegmentationAnnotations.length; i++) { const targetAnnotation = contourSegmentationAnnotations[i]; const targetPolyline = convertContourPolylineToCanvasSpace(targetAnnotation.data.contour.polyline, viewport); const targetAABB = _math__WEBPACK_IMPORTED_MODULE_1__["default"](targetPolyline); const aabbIntersect = _math__WEBPACK_IMPORTED_MODULE_0__["default"](sourceAABB, targetAABB); if (!aabbIntersect) { continue; } const lineSegmentsIntersect = _math__WEBPACK_IMPORTED_MODULE_2__["default"](sourcePolyline, targetPolyline); const isContourHole = !lineSegmentsIntersect && _math__WEBPACK_IMPORTED_MODULE_3__["default"](targetPolyline, sourcePolyline); if (lineSegmentsIntersect || isContourHole) { intersectingContours.push({ targetAnnotation, targetPolyline, isContourHole }); } } return intersectingContours; } function convertContourPolylineToCanvasSpace(polyline, viewport) { const numPoints = polyline.length; const projectedPolyline = new Array(numPoints); for (let i = 0; i < numPoints; i++) { projectedPolyline[i] = viewport.worldToCanvas(polyline[i]); } return projectedPolyline; } /***/ }, /***/ 30323 /*!*********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/contourSegmentation/isContourSegmentationAnnotation.js ***! \*********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ isContourSegmentationAnnotation) /* harmony export */ }); function isContourSegmentationAnnotation(annotation) { return !!annotation.data?.segmentation; } /***/ }, /***/ 21042 /*!**************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/contourSegmentation/mergeMultipleAnnotations.js ***! \**************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ processMultipleIntersections: () => (/* binding */ processMultipleIntersections) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 29760); /* harmony import */ var _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../types/ContourAnnotation */ 56307); /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../math */ 23340); /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../math */ 83620); /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../math */ 36136); /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../math */ 92035); /* harmony import */ var _contours_updateContourPolyline__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../contours/updateContourPolyline */ 19280); /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../stateManagement/annotation/annotationState */ 24703); /* harmony import */ var _addContourSegmentationAnnotation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./addContourSegmentationAnnotation */ 420); /* harmony import */ var _removeContourSegmentationAnnotation__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./removeContourSegmentationAnnotation */ 97379); /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../stateManagement/annotation/helpers/state */ 9906); /* harmony import */ var _triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../triggerAnnotationRenderForViewportIds */ 613); /* harmony import */ var _viewportFilters__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../viewportFilters */ 68348); /* harmony import */ var _store_addTool__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../store/addTool */ 49541); const DEFAULT_CONTOUR_SEG_TOOL_NAME = 'PlanarFreehandContourSegmentationTool'; function processMultipleIntersections(viewport, sourceAnnotation, sourcePolyline, intersectingContours) { const holeOperations = intersectingContours.filter(item => item.isContourHole); const mergeOperations = intersectingContours.filter(item => !item.isContourHole); if (holeOperations.length > 0) { const primaryHoleTarget = holeOperations[0]; createPolylineHole(viewport, primaryHoleTarget.targetAnnotation, sourceAnnotation); updateViewportsForAnnotations(viewport, [sourceAnnotation, primaryHoleTarget.targetAnnotation]); return; } if (mergeOperations.length === 0) { return; } if (!(0,_store_addTool__WEBPACK_IMPORTED_MODULE_13__.hasToolByName)(DEFAULT_CONTOUR_SEG_TOOL_NAME)) { console.warn(`${DEFAULT_CONTOUR_SEG_TOOL_NAME} is not registered in cornerstone. Cannot process multiple intersections.`); return; } processSequentialIntersections(viewport, sourceAnnotation, sourcePolyline, mergeOperations); } function processSequentialIntersections(viewport, sourceAnnotation, sourcePolyline, mergeOperations) { const { element } = viewport; const allAnnotationsToRemove = [sourceAnnotation]; const allResultPolylines = []; const allHoles = []; mergeOperations.forEach(({ targetAnnotation }) => { const holes = getContourHolesData(viewport, targetAnnotation); allHoles.push(...holes); allAnnotationsToRemove.push(targetAnnotation); }); const sourceStartPoint = sourcePolyline[0]; const shouldMerge = mergeOperations.some(({ targetPolyline }) => _math__WEBPACK_IMPORTED_MODULE_2__["default"](targetPolyline, sourceStartPoint)); if (shouldMerge) { let resultPolyline = sourcePolyline; mergeOperations.forEach(({ targetPolyline }) => { resultPolyline = _math__WEBPACK_IMPORTED_MODULE_3__.mergePolylines(resultPolyline, targetPolyline); }); allResultPolylines.push(resultPolyline); } else { mergeOperations.forEach(({ targetPolyline }) => { const subtractedPolylines = _math__WEBPACK_IMPORTED_MODULE_4__["default"](targetPolyline, sourcePolyline); allResultPolylines.push(...subtractedPolylines); }); } allAnnotationsToRemove.forEach(annotation => { (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_7__.removeAnnotation)(annotation.annotationUID); (0,_removeContourSegmentationAnnotation__WEBPACK_IMPORTED_MODULE_9__.removeContourSegmentationAnnotation)(annotation); }); allHoles.forEach(holeData => (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_7__.clearParentAnnotation)(holeData.annotation)); const baseAnnotation = mergeOperations[0].targetAnnotation; const newAnnotations = []; allResultPolylines.forEach(polyline => { if (!polyline || polyline.length < 3) { console.warn('Skipping creation of new annotation due to invalid polyline:', polyline); return; } const newAnnotation = createNewAnnotationFromPolyline(viewport, baseAnnotation, polyline); (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_7__.addAnnotation)(newAnnotation, element); (0,_addContourSegmentationAnnotation__WEBPACK_IMPORTED_MODULE_8__.addContourSegmentationAnnotation)(newAnnotation); (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_10__.triggerAnnotationModified)(newAnnotation, viewport.element); newAnnotations.push(newAnnotation); }); reassignHolesToNewAnnotations(viewport, allHoles, newAnnotations); updateViewportsForAnnotations(viewport, allAnnotationsToRemove); } function createNewAnnotationFromPolyline(viewport, baseAnnotation, polyline) { const startPointWorld = viewport.canvasToWorld(polyline[0]); const endPointWorld = viewport.canvasToWorld(polyline[polyline.length - 1]); const newAnnotation = { metadata: { ...baseAnnotation.metadata, toolName: DEFAULT_CONTOUR_SEG_TOOL_NAME, originalToolName: baseAnnotation.metadata.originalToolName || baseAnnotation.metadata.toolName }, data: { cachedStats: {}, handles: { points: [startPointWorld, endPointWorld], textBox: baseAnnotation.data.handles.textBox ? { ...baseAnnotation.data.handles.textBox } : undefined }, contour: { polyline: [], closed: true }, spline: baseAnnotation.data.spline, segmentation: { ...baseAnnotation.data.segmentation } }, annotationUID: _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"](), highlighted: true, invalidated: true, isLocked: false, isVisible: undefined, interpolationUID: baseAnnotation.interpolationUID, interpolationCompleted: baseAnnotation.interpolationCompleted }; (0,_contours_updateContourPolyline__WEBPACK_IMPORTED_MODULE_6__["default"])(newAnnotation, { points: polyline, closed: true, targetWindingDirection: _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_1__.ContourWindingDirection.Clockwise }, viewport); return newAnnotation; } function reassignHolesToNewAnnotations(viewport, holes, newAnnotations) { holes.forEach(holeData => { const parentAnnotation = newAnnotations.find(annotation => { const parentPolyline = convertContourPolylineToCanvasSpace(annotation.data.contour.polyline, viewport); return _math__WEBPACK_IMPORTED_MODULE_5__["default"](parentPolyline, holeData.polyline); }); if (parentAnnotation) { (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_7__.addChildAnnotation)(parentAnnotation, holeData.annotation); } }); } function getContourHolesData(viewport, annotation) { return (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_7__.getChildAnnotations)(annotation).map(holeAnnotation => { const contourHoleAnnotation = holeAnnotation; const polyline = convertContourPolylineToCanvasSpace(contourHoleAnnotation.data.contour.polyline, viewport); return { annotation: contourHoleAnnotation, polyline }; }); } function createPolylineHole(viewport, targetAnnotation, holeAnnotation) { (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_7__.addChildAnnotation)(targetAnnotation, holeAnnotation); (0,_removeContourSegmentationAnnotation__WEBPACK_IMPORTED_MODULE_9__.removeContourSegmentationAnnotation)(holeAnnotation); const { contour: holeContour } = holeAnnotation.data; const holePolylineCanvas = convertContourPolylineToCanvasSpace(holeContour.polyline, viewport); (0,_contours_updateContourPolyline__WEBPACK_IMPORTED_MODULE_6__["default"])(holeAnnotation, { points: holePolylineCanvas, closed: holeContour.closed, targetWindingDirection: targetAnnotation.data.contour.windingDirection === _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_1__.ContourWindingDirection.Clockwise ? _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_1__.ContourWindingDirection.CounterClockwise : _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_1__.ContourWindingDirection.Clockwise }, viewport); } function convertContourPolylineToCanvasSpace(polyline, viewport) { const numPoints = polyline.length; const projectedPolyline = new Array(numPoints); for (let i = 0; i < numPoints; i++) { projectedPolyline[i] = viewport.worldToCanvas(polyline[i]); } return projectedPolyline; } function updateViewportsForAnnotations(viewport, annotations) { const { element } = viewport; const updatedToolNames = new Set([DEFAULT_CONTOUR_SEG_TOOL_NAME]); annotations.forEach(annotation => { updatedToolNames.add(annotation.metadata.toolName); }); for (const toolName of updatedToolNames.values()) { if ((0,_store_addTool__WEBPACK_IMPORTED_MODULE_13__.hasToolByName)(toolName)) { const viewportIdsToRender = (0,_viewportFilters__WEBPACK_IMPORTED_MODULE_12__["default"])(element, toolName); (0,_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_11__["default"])(viewportIdsToRender); } } } /***/ }, /***/ 97379 /*!*************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/contourSegmentation/removeContourSegmentationAnnotation.js ***! \*************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ removeContourSegmentationAnnotation: () => (/* binding */ removeContourSegmentationAnnotation) /* harmony export */ }); /* harmony import */ var _stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stateManagement/segmentation/getSegmentation */ 42952); function removeContourSegmentationAnnotation(annotation) { if (!annotation.data.segmentation) { throw new Error('removeContourSegmentationAnnotation: annotation does not have a segmentation data'); } const { segmentationId, segmentIndex } = annotation.data.segmentation; const segmentation = (0,_stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_0__.getSegmentation)(segmentationId); const { annotationUIDsMap } = segmentation?.representationData.Contour || {}; const annotationsUIDsSet = annotationUIDsMap?.get(segmentIndex); if (!annotationsUIDsSet) { return; } annotationsUIDsSet.delete(annotation.annotationUID); if (!annotationsUIDsSet.size) { annotationUIDsMap.delete(segmentIndex); } } /***/ }, /***/ 68267 /*!******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/contourSegmentation/sharedOperations.js ***! \******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ checkIntersection: () => (/* binding */ checkIntersection), /* harmony export */ cleanupPolylines: () => (/* binding */ cleanupPolylines), /* harmony export */ combinePolylines: () => (/* binding */ combinePolylines), /* harmony export */ convertContourPolylineToCanvasSpace: () => (/* binding */ convertContourPolylineToCanvasSpace), /* harmony export */ convertContourPolylineToWorld: () => (/* binding */ convertContourPolylineToWorld), /* harmony export */ createNewAnnotationFromPolyline: () => (/* binding */ createNewAnnotationFromPolyline), /* harmony export */ createPolylineHole: () => (/* binding */ createPolylineHole), /* harmony export */ getContourHolesData: () => (/* binding */ getContourHolesData), /* harmony export */ removeDuplicatePoints: () => (/* binding */ removeDuplicatePoints), /* harmony export */ updateViewportsForAnnotations: () => (/* binding */ updateViewportsForAnnotations) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 29760); /* harmony import */ var _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../types/ContourAnnotation */ 56307); /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../math */ 85160); /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../math */ 5431); /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../math */ 29040); /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../math */ 92035); /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../math */ 23340); /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../math */ 83620); /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../math */ 36136); /* harmony import */ var _contours_updateContourPolyline__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../contours/updateContourPolyline */ 19280); /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../stateManagement/annotation/annotationState */ 24703); /* harmony import */ var _addContourSegmentationAnnotation__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./addContourSegmentationAnnotation */ 420); /* harmony import */ var _removeContourSegmentationAnnotation__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./removeContourSegmentationAnnotation */ 97379); /* harmony import */ var _stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../stateManagement/annotation/helpers/state */ 9906); /* harmony import */ var _triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../triggerAnnotationRenderForViewportIds */ 613); /* harmony import */ var _viewportFilters__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../viewportFilters */ 68348); /* harmony import */ var _store_addTool__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../store/addTool */ 49541); const TOLERANCE = 1e-10; const DEFAULT_CONTOUR_SEG_TOOL_NAME = 'PlanarFreehandContourSegmentationTool'; function convertContourPolylineToCanvasSpace(polyline, viewport) { const numPoints = polyline.length; const projectedPolyline = new Array(numPoints); for (let i = 0; i < numPoints; i++) { projectedPolyline[i] = viewport.worldToCanvas(polyline[i]); } return projectedPolyline; } function convertContourPolylineToWorld(polyline, viewport) { const numPoints = polyline.length; const projectedPolyline = new Array(numPoints); for (let i = 0; i < numPoints; i++) { projectedPolyline[i] = viewport.canvasToWorld(polyline[i]); } return projectedPolyline; } function checkIntersection(sourcePolyline, targetPolyline) { const sourceAABB = _math__WEBPACK_IMPORTED_MODULE_3__["default"](sourcePolyline); const targetAABB = _math__WEBPACK_IMPORTED_MODULE_3__["default"](targetPolyline); const aabbIntersect = _math__WEBPACK_IMPORTED_MODULE_2__["default"](sourceAABB, targetAABB); if (!aabbIntersect) { return { hasIntersection: false, isContourHole: false }; } const lineSegmentsIntersect = _math__WEBPACK_IMPORTED_MODULE_4__["default"](sourcePolyline, targetPolyline); const isContourHole = !lineSegmentsIntersect && _math__WEBPACK_IMPORTED_MODULE_5__["default"](targetPolyline, sourcePolyline); const hasIntersection = lineSegmentsIntersect || isContourHole; return { hasIntersection, isContourHole }; } function getContourHolesData(viewport, annotation) { return (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_10__.getChildAnnotations)(annotation).map(holeAnnotation => { const contourHoleAnnotation = holeAnnotation; const polyline = convertContourPolylineToCanvasSpace(contourHoleAnnotation.data.contour.polyline, viewport); return { annotation: contourHoleAnnotation, polyline }; }); } function createPolylineHole(viewport, targetAnnotation, holeAnnotation) { (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_10__.addChildAnnotation)(targetAnnotation, holeAnnotation); (0,_removeContourSegmentationAnnotation__WEBPACK_IMPORTED_MODULE_12__.removeContourSegmentationAnnotation)(holeAnnotation); const { contour: holeContour } = holeAnnotation.data; const holePolylineCanvas = convertContourPolylineToCanvasSpace(holeContour.polyline, viewport); (0,_contours_updateContourPolyline__WEBPACK_IMPORTED_MODULE_9__["default"])(holeAnnotation, { points: holePolylineCanvas, closed: holeContour.closed, targetWindingDirection: targetAnnotation.data.contour.windingDirection === _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_1__.ContourWindingDirection.Clockwise ? _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_1__.ContourWindingDirection.CounterClockwise : _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_1__.ContourWindingDirection.Clockwise }, viewport); const { element } = viewport; updateViewportsForAnnotations(viewport, [targetAnnotation, holeAnnotation]); } function combinePolylines(viewport, targetAnnotation, targetPolyline, sourceAnnotation, sourcePolyline) { if (!(0,_store_addTool__WEBPACK_IMPORTED_MODULE_16__.hasToolByName)(DEFAULT_CONTOUR_SEG_TOOL_NAME)) { console.warn(`${DEFAULT_CONTOUR_SEG_TOOL_NAME} is not registered in cornerstone. Cannot combine polylines.`); return; } const sourceStartPoint = sourcePolyline[0]; const mergePolylines = _math__WEBPACK_IMPORTED_MODULE_6__["default"](targetPolyline, sourceStartPoint); const contourHolesData = getContourHolesData(viewport, targetAnnotation); const unassignedContourHolesSet = new Set(contourHolesData); const reassignedContourHolesMap = new Map(); const assignHoleToPolyline = (parentPolyline, holeData) => { let holes = reassignedContourHolesMap.get(parentPolyline); if (!holes) { holes = []; reassignedContourHolesMap.set(parentPolyline, holes); } holes.push(holeData); unassignedContourHolesSet.delete(holeData); }; const newPolylines = []; if (mergePolylines) { const mergedPolyline = _math__WEBPACK_IMPORTED_MODULE_7__.mergePolylines(targetPolyline, sourcePolyline); newPolylines.push(mergedPolyline); Array.from(unassignedContourHolesSet.keys()).forEach(holeData => assignHoleToPolyline(mergedPolyline, holeData)); } else { const subtractedPolylines = _math__WEBPACK_IMPORTED_MODULE_8__["default"](targetPolyline, sourcePolyline); subtractedPolylines.forEach(newPolyline => { newPolylines.push(newPolyline); Array.from(unassignedContourHolesSet.keys()).forEach(holeData => { const containsHole = _math__WEBPACK_IMPORTED_MODULE_5__["default"](newPolyline, holeData.polyline); if (containsHole) { assignHoleToPolyline(newPolyline, holeData); } }); }); } Array.from(reassignedContourHolesMap.values()).forEach(contourHolesDataArray => contourHolesDataArray.forEach(contourHoleData => (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_10__.clearParentAnnotation)(contourHoleData.annotation))); const { element } = viewport; const { metadata, data } = targetAnnotation; const { handles, segmentation } = data; const { textBox } = handles; (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_10__.removeAnnotation)(sourceAnnotation.annotationUID); (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_10__.removeAnnotation)(targetAnnotation.annotationUID); (0,_removeContourSegmentationAnnotation__WEBPACK_IMPORTED_MODULE_12__.removeContourSegmentationAnnotation)(sourceAnnotation); (0,_removeContourSegmentationAnnotation__WEBPACK_IMPORTED_MODULE_12__.removeContourSegmentationAnnotation)(targetAnnotation); const newAnnotations = []; for (let i = 0; i < newPolylines.length; i++) { const polyline = newPolylines[i]; if (!polyline || polyline.length < 3) { console.warn('Skipping creation of new annotation due to invalid polyline:', polyline); continue; } const newAnnotation = createNewAnnotationFromPolyline(viewport, targetAnnotation, polyline); (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_10__.addAnnotation)(newAnnotation, element); (0,_addContourSegmentationAnnotation__WEBPACK_IMPORTED_MODULE_11__.addContourSegmentationAnnotation)(newAnnotation); (0,_stateManagement_annotation_helpers_state__WEBPACK_IMPORTED_MODULE_13__.triggerAnnotationModified)(newAnnotation, viewport.element); newAnnotations.push(newAnnotation); reassignedContourHolesMap.get(polyline)?.forEach(holeData => (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_10__.addChildAnnotation)(newAnnotation, holeData.annotation)); } updateViewportsForAnnotations(viewport, [targetAnnotation, sourceAnnotation]); } function createNewAnnotationFromPolyline(viewport, templateAnnotation, polyline) { const startPointWorld = viewport.canvasToWorld(polyline[0]); const endPointWorld = viewport.canvasToWorld(polyline[polyline.length - 1]); const newAnnotation = { metadata: { ...templateAnnotation.metadata, toolName: DEFAULT_CONTOUR_SEG_TOOL_NAME, originalToolName: templateAnnotation.metadata.originalToolName || templateAnnotation.metadata.toolName }, data: { cachedStats: {}, handles: { points: [startPointWorld, endPointWorld], textBox: templateAnnotation.data.handles.textBox ? { ...templateAnnotation.data.handles.textBox } : undefined }, contour: { polyline: [], closed: true }, spline: templateAnnotation.data.spline, segmentation: { ...templateAnnotation.data.segmentation } }, annotationUID: _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"](), highlighted: true, invalidated: true, isLocked: false, isVisible: undefined, interpolationUID: templateAnnotation.interpolationUID, interpolationCompleted: templateAnnotation.interpolationCompleted }; (0,_contours_updateContourPolyline__WEBPACK_IMPORTED_MODULE_9__["default"])(newAnnotation, { points: polyline, closed: true, targetWindingDirection: _types_ContourAnnotation__WEBPACK_IMPORTED_MODULE_1__.ContourWindingDirection.Clockwise }, viewport); return newAnnotation; } function updateViewportsForAnnotations(viewport, annotations) { const { element } = viewport; const updatedToolNames = new Set([DEFAULT_CONTOUR_SEG_TOOL_NAME]); annotations.forEach(annotation => { updatedToolNames.add(annotation.metadata.toolName); }); for (const toolName of updatedToolNames.values()) { if ((0,_store_addTool__WEBPACK_IMPORTED_MODULE_16__.hasToolByName)(toolName)) { const viewportIdsToRender = (0,_viewportFilters__WEBPACK_IMPORTED_MODULE_15__["default"])(element, toolName); (0,_triggerAnnotationRenderForViewportIds__WEBPACK_IMPORTED_MODULE_14__["default"])(viewportIdsToRender); } } } function removeDuplicatePoints(polyline) { if (!polyline || polyline.length < 2) { return polyline; } const cleaned = [polyline[0]]; for (let i = 1; i < polyline.length; i++) { const currentPoint = polyline[i]; const lastPoint = cleaned[cleaned.length - 1]; const dx = Math.abs(currentPoint[0] - lastPoint[0]); const dy = Math.abs(currentPoint[1] - lastPoint[1]); if (dx > TOLERANCE || dy > TOLERANCE) { cleaned.push(currentPoint); } } return cleaned; } function cleanupPolylines(polylines) { const validPolylines = []; const seenPolylines = new Set(); for (let polyline of polylines) { if (!polyline || polyline.length < 3) { continue; } polyline = removeDuplicatePoints(polyline); if (polyline.length < 3) { continue; } const sortedPoints = [...polyline].sort((a, b) => { if (a[0] !== b[0]) { return a[0] - b[0]; } return a[1] - b[1]; }); const polylineKey = sortedPoints.map(p => `${p[0].toFixed(6)},${p[1].toFixed(6)}`).join('|'); if (!seenPolylines.has(polylineKey)) { seenPolylines.add(polylineKey); validPolylines.push(polyline); } } return validPolylines; } /***/ }, /***/ 91683 /*!************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/AnnotationToPointData.js ***! \************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _RectangleROIStartEndThreshold__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RectangleROIStartEndThreshold */ 48434); function validateAnnotation(annotation) { if (!annotation?.data) { throw new Error('Tool data is empty'); } if (!annotation.metadata || !annotation.metadata.referencedImageId) { throw new Error('Tool data is not associated with any imageId'); } } class AnnotationToPointData { static { this.TOOL_NAMES = {}; } constructor() {} static convert(annotation, segment, metadataProvider) { validateAnnotation(annotation); const { toolName } = annotation.metadata; const toolClass = AnnotationToPointData.TOOL_NAMES[toolName]; if (!toolClass) { throw new Error(`Unknown tool type: ${toolName}, cannot convert to RTSSReport`); } const contourSequence = toolClass.getContourSequence(annotation, metadataProvider); const color = segment.color?.slice(0, 3) || [Math.floor(Math.random() * 255), Math.floor(Math.random() * 255), Math.floor(Math.random() * 255)]; return { ReferencedROINumber: segment.segmentIndex, ROIDisplayColor: color, ContourSequence: Array.isArray(contourSequence) ? contourSequence : [contourSequence] }; } static register(toolClass) { AnnotationToPointData.TOOL_NAMES[toolClass.toolName] = toolClass; } } AnnotationToPointData.register(_RectangleROIStartEndThreshold__WEBPACK_IMPORTED_MODULE_0__["default"]); /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AnnotationToPointData); /***/ }, /***/ 48434 /*!********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/RectangleROIStartEndThreshold.js ***! \********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); class RectangleROIStartEndThreshold { constructor() {} static getContourSequence(toolData, metadataProvider) { const { data } = toolData; const { projectionPoints, projectionPointsImageIds } = data.cachedStats; return projectionPoints.map((point, index) => { const ContourData = getPointData(point); const ContourImageSequence = getContourImageSequence(projectionPointsImageIds[index], metadataProvider); return { NumberOfContourPoints: ContourData.length / 3, ContourImageSequence, ContourGeometricType: 'CLOSED_PLANAR', ContourData }; }); } } RectangleROIStartEndThreshold.toolName = 'RectangleROIStartEndThreshold'; function getPointData(points) { const orderedPoints = [...points[0], ...points[1], ...points[3], ...points[2]]; const pointsArray = orderedPoints.flat(); const pointsArrayWithPrecision = pointsArray.map(point => { return point.toFixed(2); }); return pointsArrayWithPrecision; } function getContourImageSequence(imageId, metadataProvider) { const sopCommon = metadataProvider.get('sopCommonModule', imageId); return { ReferencedSOPClassUID: sopCommon.sopClassUID, ReferencedSOPInstanceUID: sopCommon.sopInstanceUID }; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RectangleROIStartEndThreshold); /***/ }, /***/ 81380 /*!****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/getContourHolesDataCanvas.js ***! \****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getContourHolesDataCanvas) /* harmony export */ }); /* harmony import */ var _getContourHolesDataWorld__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getContourHolesDataWorld */ 95394); function getContourHolesDataCanvas(annotation, viewport) { const worldHoleContours = (0,_getContourHolesDataWorld__WEBPACK_IMPORTED_MODULE_0__["default"])(annotation); const canvasHoleContours = []; worldHoleContours.forEach(worldHoleContour => { const numPoints = worldHoleContour.length; const canvasHoleContour = new Array(numPoints); for (let i = 0; i < numPoints; i++) { canvasHoleContour[i] = viewport.worldToCanvas(worldHoleContour[i]); } canvasHoleContours.push(canvasHoleContour); }); return canvasHoleContours; } /***/ }, /***/ 95394 /*!***************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/getContourHolesDataWorld.js ***! \***************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getContourHolesDataWorld) /* harmony export */ }); /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../stateManagement/annotation/annotationState */ 24703); function getContourHolesDataWorld(annotation) { const childAnnotationUIDs = annotation.childAnnotationUIDs ?? []; return childAnnotationUIDs.map(uid => (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__.getAnnotation)(uid).data.contour.polyline); } /***/ }, /***/ 40976 /*!***************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/interpolation/createPolylineToolData.js ***! \***************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ createPolylineToolData) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 70391); function createPolylineToolData(polyline, handlePoints, referencedToolData) { const annotation = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"]({ data: {}, metadata: {} }, referencedToolData); Object.assign(annotation, { highlighted: false, invalidated: true, autoGenerated: true, annotationUID: undefined, cachedStats: {}, childAnnotationUIDs: [], parentAnnotationUID: undefined }); Object.assign(annotation.data, { handles: { points: handlePoints.points || handlePoints || [], interpolationSources: handlePoints.sources, activeHandleIndex: null, textBox: { hasMoved: false, worldPosition: [0, 0, 0], worldBoundingBox: { topLeft: [0, 0, 0], topRight: [0, 0, 0], bottomLeft: [0, 0, 0], bottomRight: [0, 0, 0] } } }, contour: { ...referencedToolData.data.contour, polyline } }); return annotation; } /***/ }, /***/ 35455 /*!***********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/interpolation/findAnnotationForInterpolation.js ***! \***********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _getInterpolationData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getInterpolationData */ 24384); function findAnnotationsForInterpolation(toolData, viewportData) { const interpolationData = (0,_getInterpolationData__WEBPACK_IMPORTED_MODULE_0__["default"])(viewportData, [{ key: 'interpolationUID', value: viewportData.interpolationUID }]); const rangeToInterpolate = getRangeToInterpolate(interpolationData); if (!rangeToInterpolate) { console.warn('No annotations found to interpolate', interpolationData); return; } const sliceEdited = _getSlicePositionOfToolData(interpolationData, toolData.annotationUID); const interpolationList = []; for (let i = rangeToInterpolate[0] + 1; i < rangeToInterpolate[1]; i++) { if (_sliceNeedsInterpolating(interpolationData, i)) { const contourPair = _getBoundingPair(i, rangeToInterpolate, interpolationData); if (contourPair?.[0] === sliceEdited || contourPair?.[1] === sliceEdited) { _appendInterpolationList(contourPair, interpolationList, i); } } } return { interpolationData, interpolationList }; } function getRangeToInterpolate(interpolationData) { let first = Infinity; let last = -Infinity; let found = false; for (const [sliceIndex, annotations] of interpolationData.entries()) { if (annotations.length) { first = Math.min(sliceIndex, first); last = Math.max(sliceIndex, last); found = true; } } if (!found) { return; } return [first, last]; } function _getSlicePositionOfToolData(interpolationData, annotationUID) { for (const [sliceIndex, annotations] of interpolationData) { for (let j = 0; j < annotations.length; j++) { if (annotations[j].annotationUID === annotationUID) { return sliceIndex; } } } return; } function _sliceNeedsInterpolating(interpolationData, sliceIndex) { const annotations = interpolationData.get(sliceIndex); return !annotations?.length || annotations.length === 1 && annotations[0].autoGenerated; } function _appendInterpolationList(contourPair, interpolationList, itemIndex) { const [startIndex] = contourPair; interpolationList[startIndex] ||= { pair: contourPair, list: [] }; interpolationList[startIndex].list.push(itemIndex); } function _getBoundingPair(sliceIndex, sliceRange, interpolationData) { const annotationPair = []; let canInterpolate = true; for (let i = sliceIndex - 1; i >= sliceRange[0]; i--) { const annotations = interpolationData.get(i); if (annotations?.length) { if (annotations[0].autoGenerated) { continue; } if (annotations.length > 1) { canInterpolate = false; } annotationPair.push(i); break; } } if (!canInterpolate || !annotationPair.length) { return; } for (let i = sliceIndex + 1; i <= sliceRange[1]; i++) { const annotations = interpolationData.get(i); if (annotations?.length) { if (annotations[0].autoGenerated) { continue; } if (annotations.length > 1) { canInterpolate = false; } annotationPair.push(i); break; } } if (!canInterpolate || annotationPair.length < 2) { return; } return annotationPair; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (findAnnotationsForInterpolation); /***/ }, /***/ 24384 /*!*************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/interpolation/getInterpolationData.js ***! \*************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getInterpolationData) /* harmony export */ }); /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../stateManagement/annotation/annotationState */ 24703); const DEFAULT_CONTOUR_SEG_TOOLNAME = 'PlanarFreehandContourSegmentationTool'; function getInterpolationData(viewportData, filterParams = []) { const { viewport, sliceData, annotation } = viewportData; const interpolationDatas = new Map(); const { toolName, originalToolName } = annotation.metadata; const testToolName = originalToolName || toolName; const annotations = ((0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__.getAnnotations)(testToolName, viewport.element) || []).filter(annotation => !annotation.metadata.originalToolName || annotation.metadata.originalToolName === testToolName); if (testToolName !== DEFAULT_CONTOUR_SEG_TOOLNAME) { const modifiedAnnotations = (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_0__.getAnnotations)(DEFAULT_CONTOUR_SEG_TOOLNAME, viewport.element); if (modifiedAnnotations?.length) { modifiedAnnotations.forEach(annotation => { const { metadata } = annotation; if (metadata.originalToolName === testToolName && metadata.originalToolName !== metadata.toolName) { annotations.push(annotation); } }); } } if (!annotations?.length) { return interpolationDatas; } for (let i = 0; i < sliceData.numberOfSlices; i++) { const imageAnnotations = annotations.filter(x => x.metadata.sliceIndex === i); if (!imageAnnotations?.length) { continue; } const filteredInterpolatedAnnotations = imageAnnotations.filter(imageAnnotation => { return filterParams.every(x => { const parent = x.parentKey ? x.parentKey(imageAnnotation) : imageAnnotation; const value = parent?.[x.key]; if (Array.isArray(value)) { return value.every((item, index) => item === x.value[index]); } return value === x.value; }); }); if (filteredInterpolatedAnnotations.length) { interpolationDatas.set(i, filteredInterpolatedAnnotations); } } return interpolationDatas; } /***/ }, /***/ 63968 /*!***********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/interpolation/getInterpolationDataCollection.js ***! \***********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getInterpolationDataCollection) /* harmony export */ }); /* harmony import */ var _getInterpolationData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getInterpolationData */ 24384); function getInterpolationDataCollection(viewportData, filterParams) { const imageAnnotations = (0,_getInterpolationData__WEBPACK_IMPORTED_MODULE_0__["default"])(viewportData, filterParams); const interpolatedDataCollection = []; if (!imageAnnotations?.size) { return interpolatedDataCollection; } for (const annotations of imageAnnotations.values()) { annotations.forEach(annotation => { interpolatedDataCollection.push(annotation); }); } return interpolatedDataCollection; } /***/ }, /***/ 33995 /*!****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/interpolation/interpolate.js ***! \****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 28699); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 80853); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _createPolylineToolData__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./createPolylineToolData */ 40976); /* harmony import */ var _findAnnotationForInterpolation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./findAnnotationForInterpolation */ 35455); /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../enums/Events */ 54870); /* harmony import */ var _stateManagement_annotation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../stateManagement/annotation */ 38829); /* harmony import */ var _selectHandles__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./selectHandles */ 59171); /* harmony import */ var _updateChildInterpolationUID__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./updateChildInterpolationUID */ 66497); /* harmony import */ var _contourSegmentation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../contourSegmentation */ 68267); const { PointsManager } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__; const dP = 0.2; function interpolate(viewportData) { if (!viewportData.annotation) { return; } const { isInterpolationUpdate, annotation } = viewportData; queueMicrotask(() => { try { if (isInterpolationUpdate) { annotation.isInterpolationUpdate = true; annotation.autoGenerated = false; } startInterpolation(viewportData); } finally { if (isInterpolationUpdate) { annotation.autoGenerated = true; } } }); } function startInterpolation(viewportData) { const { annotation: toolData } = viewportData; (0,_updateChildInterpolationUID__WEBPACK_IMPORTED_MODULE_9__["default"])(toolData); const { interpolationData, interpolationList } = (0,_findAnnotationForInterpolation__WEBPACK_IMPORTED_MODULE_5__["default"])(toolData, viewportData) || {}; if (!interpolationData || !interpolationList) { return; } const eventData = { toolName: toolData.metadata.toolName, toolType: toolData.metadata.toolName, viewport: viewportData.viewport }; for (let i = 0; i < interpolationList.length; i++) { if (interpolationList[i]) { _linearlyInterpolateBetween(interpolationList[i].list, interpolationList[i].pair, interpolationData, eventData); } } const { id, renderingEngineId, element } = viewportData.viewport; const eventDetails = { annotation: toolData, element, viewportId: id, renderingEngineId }; if (interpolationList.length) { (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(viewportData.viewport.element, _enums_Events__WEBPACK_IMPORTED_MODULE_6__["default"].ANNOTATION_INTERPOLATION_PROCESS_COMPLETED, eventDetails); (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"])(_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"], _enums_Events__WEBPACK_IMPORTED_MODULE_6__["default"].ANNOTATION_INTERPOLATION_PROCESS_COMPLETED, eventDetails); } } function _linearlyInterpolateBetween(indices, annotationPair, interpolationData, eventData) { const annotation0 = interpolationData.get(annotationPair[0])[0]; const annotation1 = interpolationData.get(annotationPair[1])[0]; const c1 = _generateClosedContour(annotation0.data.contour.polyline); const c2 = _generateClosedContour(annotation1.data.contour.polyline); console.warn('annotation0=', annotation0); const { c1Interp, c2Interp } = _generateInterpolationContourPair(c1, c2); c1Interp.kIndex = annotationPair[0]; c2Interp.kIndex = annotationPair[1]; indices.forEach(function (index) { _linearlyInterpolateContour(c1Interp, c2Interp, index, annotationPair, interpolationData, c1.x.length > c2.x.length, eventData); }); } function _linearlyInterpolateContour(c1Interp, c2Interp, sliceIndex, annotationPair, interpolationData, c1HasMoreNodes, eventData) { const [startIndex, endIndex] = annotationPair; const zInterp = (sliceIndex - startIndex) / (endIndex - startIndex); const annotation0 = interpolationData.get(startIndex)[0]; const annotation1 = interpolationData.get(endIndex)[0]; const interpolated3DPoints = _generateInterpolatedOpenContour(c1Interp, c2Interp, zInterp, c1HasMoreNodes); const nearestAnnotation = zInterp > 0.5 ? annotation1 : annotation0; const isOpenUShapeContour = nearestAnnotation.data.isOpenUShapeContour; const handlePoints = (0,_selectHandles__WEBPACK_IMPORTED_MODULE_8__["default"])(interpolated3DPoints, { isOpenUShapeContour }); if (interpolationData.has(sliceIndex)) { _editInterpolatedContour(interpolated3DPoints, handlePoints, sliceIndex, nearestAnnotation, eventData); } else { _addInterpolatedContour(interpolated3DPoints, handlePoints, sliceIndex, nearestAnnotation, eventData); } } function _addInterpolatedContour(interpolated3DPoints, handlePoints, sliceIndex, referencedToolData, eventData) { const points = interpolated3DPoints.points; const { viewport } = eventData; const interpolatedAnnotation = (0,_createPolylineToolData__WEBPACK_IMPORTED_MODULE_4__["default"])(points, handlePoints, referencedToolData); const viewRef = viewport.getViewReference({ sliceIndex }); if (!viewRef) { throw new Error(`Can't find slice ${sliceIndex}`); } Object.assign(interpolatedAnnotation.metadata, viewRef); _stateManagement_annotation__WEBPACK_IMPORTED_MODULE_7__.state.addAnnotation(interpolatedAnnotation, viewport.element); referencedToolData.onInterpolationComplete?.(interpolatedAnnotation, referencedToolData); const { parentAnnotationUID } = referencedToolData; if (parentAnnotationUID) { const parentReferenced = _stateManagement_annotation__WEBPACK_IMPORTED_MODULE_7__.state.getAnnotation(parentAnnotationUID); const parentAnnotation = _findExistingAnnotation(parentReferenced, sliceIndex, eventData); (0,_contourSegmentation__WEBPACK_IMPORTED_MODULE_10__.createPolylineHole)(viewport, parentAnnotation, interpolatedAnnotation); } } function _findExistingAnnotation(referencedToolData, sliceIndex, eventData) { const { viewport } = eventData; const annotations = _stateManagement_annotation__WEBPACK_IMPORTED_MODULE_7__.state.getAnnotations(referencedToolData.metadata.toolName, viewport.element); for (let i = 0; i < annotations.length; i++) { const annotation = annotations[i]; if (annotation.interpolationUID === referencedToolData.interpolationUID && annotation.metadata.sliceIndex === sliceIndex) { return annotation; } } } function _editInterpolatedContour(interpolated3DPoints, handlePoints, sliceIndex, referencedToolData, eventData) { const oldAnnotationData = _findExistingAnnotation(referencedToolData, sliceIndex, eventData); const points = interpolated3DPoints.points; const interpolatedAnnotation = (0,_createPolylineToolData__WEBPACK_IMPORTED_MODULE_4__["default"])(points, handlePoints, oldAnnotationData); Object.assign(oldAnnotationData, { metadata: interpolatedAnnotation.metadata, data: interpolatedAnnotation.data }); } function _generateInterpolatedOpenContour(c1ir, c2ir, zInterp, c1HasMoreNodes) { const indices = c1HasMoreNodes ? c1ir.I : c2ir.I; const c1 = PointsManager.fromXYZ(c1ir); const c2 = PointsManager.fromXYZ(c2ir); const { length } = c1; const cInterp = PointsManager.create3(length); const vecSubtract = gl_matrix__WEBPACK_IMPORTED_MODULE_3__.create(); const vecResult = gl_matrix__WEBPACK_IMPORTED_MODULE_3__.create(); const c1Source = PointsManager.create3(length); c1Source.kIndex = c1ir.kIndex; const c2Source = PointsManager.create3(length); c2Source.kIndex = c2ir.kIndex; for (let i = 0; i < c1ir.x.length; i++) { if (indices[i]) { const c1point = c1.getPoint(i); const c2point = c2.getPoint(i); c1Source.push(c1point); c2Source.push(c2point); gl_matrix__WEBPACK_IMPORTED_MODULE_3__.sub(vecSubtract, c2point, c1point); cInterp.push(gl_matrix__WEBPACK_IMPORTED_MODULE_3__.scaleAndAdd(vecResult, c1point, vecSubtract, zInterp)); } } cInterp.sources = [c1Source, c2Source]; return cInterp; } function _generateInterpolationContourPair(c1, c2) { const cumPerim1 = _getCumulativePerimeter(c1); const cumPerim2 = _getCumulativePerimeter(c2); const interpNodes = Math.max(Math.ceil(cumPerim1[cumPerim1.length - 1] / dP), Math.ceil(cumPerim2[cumPerim2.length - 1] / dP)); const cumPerim1Norm = _normalisedCumulativePerimeter(cumPerim1); const cumPerim2Norm = _normalisedCumulativePerimeter(cumPerim2); const numNodes1 = interpNodes + c2.x.length; const numNodes2 = interpNodes + c1.x.length; const perim1Interp = _getInterpolatedPerim(numNodes1, cumPerim1Norm); const perim2Interp = _getInterpolatedPerim(numNodes2, cumPerim2Norm); const perim1Ind = _getIndicatorArray(numNodes1 - 2, c1.x.length); const perim2Ind = _getIndicatorArray(numNodes2 - 2, c2.x.length); const nodesPerSegment1 = _getNodesPerSegment(perim1Interp, perim1Ind); const nodesPerSegment2 = _getNodesPerSegment(perim2Interp, perim2Ind); const c1i = _getSuperSampledContour(c1, nodesPerSegment1); const c2i = _getSuperSampledContour(c2, nodesPerSegment2); _shiftSuperSampledContourInPlace(c1i, c2i); return _reduceContoursToOriginNodes(c1i, c2i); } function _reduceContoursToOriginNodes(c1i, c2i) { const c1Interp = { x: [], y: [], z: [], I: [] }; const c2Interp = { x: [], y: [], z: [], I: [] }; for (let i = 0; i < c1i.x.length; i++) { if (c1i.I[i] || c2i.I[i]) { c1Interp.x.push(c1i.x[i]); c1Interp.y.push(c1i.y[i]); c1Interp.z.push(c1i.z[i]); c1Interp.I.push(c1i.I[i]); c2Interp.x.push(c2i.x[i]); c2Interp.y.push(c2i.y[i]); c2Interp.z.push(c2i.z[i]); c2Interp.I.push(c2i.I[i]); } } return { c1Interp, c2Interp }; } function _shiftSuperSampledContourInPlace(c1i, c2i) { const c1iLength = c1i.x.length; const optimal = { startingNode: 0, totalSquaredXYLengths: Infinity }; for (let startingNode = 0; startingNode < c1iLength; startingNode++) { let node = startingNode; let totalSquaredXYLengths = 0; for (let iteration = 0; iteration < c1iLength; iteration++) { totalSquaredXYLengths += (c1i.x[node] - c2i.x[iteration]) ** 2 + (c1i.y[node] - c2i.y[iteration]) ** 2 + (c1i.z[node] - c2i.z[iteration]) ** 2; node++; if (node === c1iLength) { node = 0; } } if (totalSquaredXYLengths < optimal.totalSquaredXYLengths) { optimal.totalSquaredXYLengths = totalSquaredXYLengths; optimal.startingNode = startingNode; } } const node = optimal.startingNode; _shiftCircularArray(c1i.x, node); _shiftCircularArray(c1i.y, node); _shiftCircularArray(c1i.z, node); _shiftCircularArray(c1i.I, node); } function _shiftCircularArray(arr, count) { count -= arr.length * Math.floor(count / arr.length); const slicedArray = arr.splice(0, count); arr.push(...slicedArray); return arr; } function _getSuperSampledContour(c, nodesPerSegment) { const ci = { x: [], y: [], z: [], I: [] }; for (let n = 0; n < c.x.length - 1; n++) { ci.x.push(c.x[n]); ci.y.push(c.y[n]); ci.z.push(c.z[n]); ci.I.push(true); const xSpacing = (c.x[n + 1] - c.x[n]) / (nodesPerSegment[n] + 1); const ySpacing = (c.y[n + 1] - c.y[n]) / (nodesPerSegment[n] + 1); const zSpacing = (c.z[n + 1] - c.z[n]) / (nodesPerSegment[n] + 1); for (let i = 0; i < nodesPerSegment[n] - 1; i++) { ci.x.push(ci.x[ci.x.length - 1] + xSpacing); ci.y.push(ci.y[ci.y.length - 1] + ySpacing); ci.z.push(ci.z[ci.z.length - 1] + zSpacing); ci.I.push(false); } } return ci; } function _getNodesPerSegment(perimInterp, perimInd) { const idx = []; for (let i = 0; i < perimInterp.length; ++i) { idx[i] = i; } idx.sort(function (a, b) { return perimInterp[a] < perimInterp[b] ? -1 : 1; }); const perimIndSorted = []; for (let i = 0; i < perimInd.length; i++) { perimIndSorted.push(perimInd[idx[i]]); } const indicesOfOriginNodes = perimIndSorted.reduce(function (arr, elementValue, i) { if (elementValue) { arr.push(i); } return arr; }, []); const nodesPerSegment = []; for (let i = 0; i < indicesOfOriginNodes.length - 1; i++) { nodesPerSegment.push(indicesOfOriginNodes[i + 1] - indicesOfOriginNodes[i]); } return nodesPerSegment; } function _getIndicatorArray(numFalse, numTrue) { const perimInd = new Array(numFalse + numTrue); perimInd.fill(false, 0, numFalse); perimInd.fill(true, numFalse, numFalse + numTrue); return perimInd; } function _getInterpolatedPerim(numNodes, cumPerimNorm) { const diff = 1 / (numNodes - 1); const linspace = [diff]; for (let i = 1; i < numNodes - 2; i++) { linspace.push(linspace[linspace.length - 1] + diff); } return linspace.concat(cumPerimNorm); } function _normalisedCumulativePerimeter(cumPerim) { const cumPerimNorm = []; for (let i = 0; i < cumPerim.length; i++) { cumPerimNorm.push(cumPerim[i] / cumPerim[cumPerim.length - 1]); } return cumPerimNorm; } function _getCumulativePerimeter(contour) { const cumulativePerimeter = [0]; for (let i = 1; i < contour.x.length; i++) { const lengthOfSegment = Math.sqrt((contour.x[i] - contour.x[i - 1]) ** 2 + (contour.y[i] - contour.y[i - 1]) ** 2 + (contour.z[i] - contour.z[i - 1]) ** 2); cumulativePerimeter.push(cumulativePerimeter[i - 1] + lengthOfSegment); } return cumulativePerimeter; } function _generateClosedContour(points) { const c = { x: [], y: [], z: [] }; for (let i = 0; i < points.length; i++) { c.x[i] = points[i][0]; c.y[i] = points[i][1]; c.z[i] = points[i][2]; } c.x.push(c.x[0]); c.y.push(c.y[0]); c.z.push(c.z[0]); return c; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (interpolate); /***/ }, /***/ 59171 /*!******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/interpolation/selectHandles.js ***! \******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ addInterval: () => (/* binding */ addInterval), /* harmony export */ createDotValues: () => (/* binding */ createDotValues), /* harmony export */ "default": () => (/* binding */ selectHandles) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 80853); const { PointsManager } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__; function selectHandles(polyline, options = {}) { const { handleCount = 12, isOpenUShapeContour } = options; const handles = PointsManager.create3(handleCount); handles.sources = []; const { sources: destPoints } = handles; const { length, sources: sourcePoints = [] } = polyline; const distance = 5; if (isOpenUShapeContour) { const handles = polyline.subselect(handleCount); handles.push(polyline.getPoint(polyline.length - 1)); return handles; } if (length < distance * 3) { return polyline.subselect(handleCount); } const interval = Math.floor(Math.max(2 * length / handleCount, distance * 2)); sourcePoints.forEach(() => destPoints.push(PointsManager.create3(handleCount))); const dotValues = createDotValues(polyline, distance); const minimumRegions = findMinimumRegions(dotValues, handleCount); const indices = []; if (minimumRegions?.length > 2) { let lastHandle = -1; const thirdInterval = interval / 3; minimumRegions.forEach(region => { const [start,, end] = region; const midIndex = Math.ceil((start + end) / 2); if (end - lastHandle < thirdInterval) { return; } if (midIndex - start > 2 * thirdInterval) { addInterval(indices, lastHandle, start, interval, length); lastHandle = addInterval(indices, start, midIndex, interval, length); } else { lastHandle = addInterval(indices, lastHandle, midIndex, interval, length); } if (end - lastHandle > thirdInterval) { lastHandle = addInterval(indices, lastHandle, end, interval, length); } }); const firstHandle = indices[0]; const lastDistance = indexValue(firstHandle + length - lastHandle, length); if (lastDistance > 2 * thirdInterval) { addInterval(indices, lastHandle, firstHandle - thirdInterval, interval, length); } } else { const interval = Math.floor(length / handleCount); addInterval(indices, -1, length - interval, interval, length); } indices.forEach(index => { const point = polyline.getPointArray(index); handles.push(point); sourcePoints.forEach((source, destSourceIndex) => destPoints[destSourceIndex].push(source.getPoint(index))); }); return handles; } function createDotValues(polyline, distance = 6) { const { length } = polyline; const prevVec3 = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); const nextVec3 = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); const dotValues = new Float32Array(length); for (let i = 0; i < length; i++) { const point = polyline.getPoint(i); const prevPoint = polyline.getPoint(i - distance); const nextPoint = polyline.getPoint((i + distance) % length); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.sub(prevVec3, point, prevPoint); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.sub(nextVec3, nextPoint, point); const dot = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(prevVec3, nextVec3) / (gl_matrix__WEBPACK_IMPORTED_MODULE_0__.len(prevVec3) * gl_matrix__WEBPACK_IMPORTED_MODULE_0__.len(nextVec3)); dotValues[i] = dot; } return dotValues; } function findMinimumRegions(dotValues, handleCount) { const { max, deviation } = getStats(dotValues); const { length } = dotValues; if (deviation < 0.01 || length < handleCount * 3) { return []; } const inflection = []; let pair = null; let minValue; let minIndex = 0; for (let i = 0; i < length; i++) { const dot = dotValues[i]; if (dot < max - deviation) { if (pair) { pair[2] = i; if (dot < minValue) { minValue = dot; minIndex = i; } pair[1] = minIndex; } else { minValue = dot; minIndex = i; pair = [i, i, i]; } } else { if (pair) { inflection.push(pair); pair = null; } } } if (pair) { if (inflection[0][0] === 0) { inflection[0][0] = pair[0]; } else { pair[1] = minIndex; pair[2] = length - 1; inflection.push(pair); } } return inflection; } function addInterval(indices, start, finish, interval, length) { if (finish < start) { finish += length; } const distance = finish - start; const count = Math.ceil(distance / interval); if (count <= 0) { if (indices[indices.length - 1] !== finish) { indices.push(indexValue(finish, length)); } return finish; } for (let i = 1; i <= count; i++) { const index = indexValue(start + i * distance / count, length); indices.push(index); } return indices[indices.length - 1]; } function indexValue(v, length) { return (Math.round(v) + length) % length; } function getStats(dotValues) { const { length } = dotValues; let sum = 0; let min = Infinity; let max = -Infinity; let sumSq = 0; for (let i = 0; i < length; i++) { const dot = dotValues[i]; sum += dot; min = Math.min(min, dot); max = Math.max(max, dot); } const mean = sum / length; for (let i = 0; i < length; i++) { const valueDiff = dotValues[i] - mean; sumSq += valueDiff * valueDiff; } return { mean, max, min, sumSq, deviation: Math.sqrt(sumSq / length) }; } /***/ }, /***/ 66497 /*!********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/interpolation/updateChildInterpolationUID.js ***! \********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ updateChildInterpolationUID) /* harmony export */ }); /* harmony import */ var _stateManagement_annotation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../stateManagement/annotation */ 38829); function updateChildInterpolationUID(annotation) { const { parentAnnotationUID, annotationUID } = annotation; if (!parentAnnotationUID) { return annotation.interpolationUID; } const parentAnnotation = _stateManagement_annotation__WEBPACK_IMPORTED_MODULE_0__.state.getAnnotation(parentAnnotationUID); const { interpolationUID } = parentAnnotation; const index = parentAnnotation.childAnnotationUIDs.indexOf(annotationUID); annotation.interpolationUID = `${interpolationUID}-${index}`; return annotation.interpolationUID; } /***/ }, /***/ 19280 /*!************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/contours/updateContourPolyline.js ***! \************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ updateContourPolyline) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 17137); /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../math */ 10460); /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../math */ 85118); /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../math */ 8531); /* harmony import */ var _stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../stateManagement/annotation/annotationState */ 24703); function updateContourPolyline(annotation, polylineData, transforms, options) { const { canvasToWorld, worldToCanvas } = transforms; const { data } = annotation; const { targetWindingDirection } = polylineData; let { points: polyline } = polylineData; let windingDirection = _math__WEBPACK_IMPORTED_MODULE_2__["default"](polyline); if (options?.decimate?.enabled) { polyline = _math__WEBPACK_IMPORTED_MODULE_3__["default"](polylineData.points, options?.decimate?.epsilon); } let { closed } = polylineData; const numPoints = polyline.length; const polylineWorldPoints = new Array(numPoints); const currentPolylineWindingDirection = _math__WEBPACK_IMPORTED_MODULE_2__["default"](polyline); const parentAnnotation = (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__.getParentAnnotation)(annotation); if (closed === undefined) { let currentClosedState = false; if (polyline.length > 3) { const lastToFirstDist = _math__WEBPACK_IMPORTED_MODULE_1__["default"](polyline[0], polyline[numPoints - 1]); currentClosedState = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.isEqual(0, lastToFirstDist); } closed = currentClosedState; } if (options?.updateWindingDirection !== false) { let updatedWindingDirection = parentAnnotation ? parentAnnotation.data.contour.windingDirection * -1 : targetWindingDirection; if (updatedWindingDirection === undefined) { updatedWindingDirection = windingDirection; } if (updatedWindingDirection !== windingDirection) { polyline.reverse(); } const handlePoints = (data.handles?.points ?? []).map(worldToCanvas); if (handlePoints.length > 2) { const currentHandlesWindingDirection = _math__WEBPACK_IMPORTED_MODULE_2__["default"](handlePoints); if (currentHandlesWindingDirection !== updatedWindingDirection) { data.handles.points.reverse(); } } windingDirection = updatedWindingDirection; } for (let i = 0; i < numPoints; i++) { polylineWorldPoints[i] = canvasToWorld(polyline[i]); } data.contour.polyline = polylineWorldPoints; data.contour.closed = closed; data.contour.windingDirection = windingDirection; (0,_stateManagement_annotation_annotationState__WEBPACK_IMPORTED_MODULE_4__.invalidateAnnotation)(annotation); } /***/ }, /***/ 7154 /*!**************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/debounce.js ***! \**************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _isObject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isObject */ 47866); function debounce(func, wait, options) { let lastArgs, lastThis, maxWait, result, timerId, lastCallTime; let lastInvokeTime = 0; let leading = false; let maxing = false; let trailing = true; const useRAF = !wait && wait !== 0 && typeof window.requestAnimationFrame === 'function'; if (typeof func !== 'function') { throw new TypeError('Expected a function'); } wait = Number(wait) || 0; if ((0,_isObject__WEBPACK_IMPORTED_MODULE_0__["default"])(options)) { leading = Boolean(options.leading); maxing = 'maxWait' in options; maxWait = maxing ? Math.max(Number(options.maxWait) || 0, wait) : maxWait; trailing = 'trailing' in options ? Boolean(options.trailing) : trailing; } function invokeFunc(time) { const args = lastArgs; const thisArg = lastThis; lastArgs = lastThis = undefined; lastInvokeTime = time; result = func.apply(thisArg, args); return result; } function startTimer(pendingFunc, wait) { if (useRAF) { return window.requestAnimationFrame(pendingFunc); } return setTimeout(pendingFunc, wait); } function cancelTimer(id) { if (useRAF) { return window.cancelAnimationFrame(id); } clearTimeout(id); } function leadingEdge(time) { lastInvokeTime = time; timerId = startTimer(timerExpired, wait); return leading ? invokeFunc(time) : result; } function remainingWait(time) { const timeSinceLastCall = time - lastCallTime; const timeSinceLastInvoke = time - lastInvokeTime; const timeWaiting = wait - timeSinceLastCall; return maxing ? Math.min(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; } function shouldInvoke(time) { const timeSinceLastCall = time - lastCallTime; const timeSinceLastInvoke = time - lastInvokeTime; return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait; } function timerExpired() { const time = Date.now(); if (shouldInvoke(time)) { return trailingEdge(time); } timerId = startTimer(timerExpired, remainingWait(time)); } function trailingEdge(time) { timerId = undefined; if (trailing && lastArgs) { return invokeFunc(time); } lastArgs = lastThis = undefined; return result; } function cancel() { if (timerId !== undefined) { cancelTimer(timerId); } lastInvokeTime = 0; lastArgs = lastCallTime = lastThis = timerId = undefined; } function flush() { return timerId === undefined ? result : trailingEdge(Date.now()); } function pending() { return timerId !== undefined; } function debounced(...args) { const time = Date.now(); const isInvoking = shouldInvoke(time); lastArgs = args; lastThis = this; lastCallTime = time; if (isInvoking) { if (timerId === undefined) { return leadingEdge(lastCallTime); } if (maxing) { timerId = startTimer(timerExpired, wait); return invokeFunc(lastCallTime); } } if (timerId === undefined) { timerId = startTimer(timerExpired, wait); } return result; } debounced.cancel = cancel; debounced.flush = flush; debounced.pending = pending; return debounced; } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (debounce); /***/ }, /***/ 31404 /*!************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/drawing/getTextBoxCoordsCanvas.js ***! \************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getTextBoxCoordsCanvas) /* harmony export */ }); /* harmony import */ var _textBoxOverlapRegistry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./textBoxOverlapRegistry */ 44534); /* harmony import */ var _math_aabb_intersectAABB__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../math/aabb/intersectAABB */ 85160); const VIEWPORT_ELEMENT = 'viewport-element'; const TEXT_BOX_GAP = 6; function getTextBoxCoordsCanvas(annotationCanvasPoints, element, textLines = []) { if (!annotationCanvasPoints?.length || !annotationCanvasPoints[0]) { return [0, 0]; } const corners = _determineCorners(annotationCanvasPoints); const centerY = (corners.top[1] + corners.bottom[1]) / 2; const defaultTextBoxCanvas = [corners.right[0], centerY]; if (!element) { return defaultTextBoxCanvas; } const { width: textBoxWidth, height: textBoxHeight } = _estimateTextBoxSize(textLines); const margin = 4; const maxX = element.clientWidth - margin; const maxY = element.clientHeight - margin; let x = corners.right[0]; let y = centerY - textBoxHeight / 2; if (x + textBoxWidth > maxX) { x = corners.left[0] - textBoxWidth; } x = Math.max(margin, Math.min(x, maxX - textBoxWidth)); y = Math.max(margin, Math.min(y, maxY - textBoxHeight)); const svgLayer = _findSvgLayer(element); if (svgLayer) { const existingBoxes = (0,_textBoxOverlapRegistry__WEBPACK_IMPORTED_MODULE_0__.getRegisteredTextBoxes)(svgLayer); if (existingBoxes.length > 0) { const resolved = _resolveOverlap(x, y, textBoxWidth, textBoxHeight, existingBoxes, margin, maxX, maxY); x = resolved[0]; y = resolved[1]; } } return [x, y]; } function _resolveOverlap(x, y, width, height, existingBoxes, margin, maxX, maxY) { if (!_overlapsAny(x, y, width, height, existingBoxes)) { return [x, y]; } let candidateY = y; for (let i = 0; i < 30; i++) { const blocker = _findFirstOverlap(x, candidateY, width, height, existingBoxes); if (!blocker) { break; } candidateY = blocker.y + blocker.height + TEXT_BOX_GAP; if (candidateY + height > maxY) { candidateY = Infinity; break; } } if (candidateY !== Infinity && !_overlapsAny(x, candidateY, width, height, existingBoxes)) { return [x, Math.max(margin, Math.min(candidateY, maxY - height))]; } candidateY = y; for (let i = 0; i < 30; i++) { const blocker = _findFirstOverlap(x, candidateY, width, height, existingBoxes); if (!blocker) { break; } candidateY = blocker.y - height - TEXT_BOX_GAP; if (candidateY < margin) { candidateY = -Infinity; break; } } if (candidateY !== -Infinity && !_overlapsAny(x, candidateY, width, height, existingBoxes)) { return [x, Math.max(margin, Math.min(candidateY, maxY - height))]; } return [x, y]; } function _overlapsAny(x, y, w, h, boxes) { const candidate = _toTextBoxAABB({ x, y, width: w, height: h }); return boxes.some(box => (0,_math_aabb_intersectAABB__WEBPACK_IMPORTED_MODULE_1__["default"])(candidate, _toTextBoxAABB(box, TEXT_BOX_GAP / 2))); } function _findFirstOverlap(x, y, w, h, boxes) { const candidate = _toTextBoxAABB({ x, y, width: w, height: h }); return boxes.find(box => (0,_math_aabb_intersectAABB__WEBPACK_IMPORTED_MODULE_1__["default"])(candidate, _toTextBoxAABB(box, TEXT_BOX_GAP / 2))); } function _toTextBoxAABB(rect, inflate = 0) { return { minX: rect.x - inflate, minY: rect.y - inflate, maxX: rect.x + rect.width + inflate, maxY: rect.y + rect.height + inflate }; } function _findSvgLayer(element) { const internalDiv = element.querySelector(`.${VIEWPORT_ELEMENT}`); return internalDiv?.querySelector(':scope > .svg-layer') || null; } function _determineCorners(canvasPoints) { const p0 = canvasPoints[0]; if (!p0 || canvasPoints.length < 2) { return { left: p0, right: p0, top: p0, bottom: p0 }; } const handlesLeftToRight = [canvasPoints[0], canvasPoints[1]].sort(_compareX); const handlesTopToBottom = [canvasPoints[0], canvasPoints[1]].sort(_compareY); const left = handlesLeftToRight[0]; const right = handlesLeftToRight[handlesLeftToRight.length - 1]; const top = handlesTopToBottom[0]; const bottom = handlesTopToBottom[handlesTopToBottom.length - 1]; return { left, top, bottom, right }; function _compareX(a, b) { return a[0] < b[0] ? -1 : 1; } function _compareY(a, b) { return a[1] < b[1] ? -1 : 1; } } function _estimateTextBoxSize(textLines) { const estimatedPadding = 25; const estimatedCharWidth = 8; const estimatedLineHeight = 17; const longestLineLength = textLines.reduce((max, line) => Math.max(max, line?.length ?? 0), 0); const lineCount = Math.max(textLines.length, 1); const width = longestLineLength * estimatedCharWidth + estimatedPadding * 2; const height = lineCount * estimatedLineHeight + estimatedPadding * 2; return { width, height }; } /***/ }, /***/ 44534 /*!************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/drawing/textBoxOverlapRegistry.js ***! \************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ clearTextBoxRegistry: () => (/* binding */ clearTextBoxRegistry), /* harmony export */ getRegisteredTextBoxes: () => (/* binding */ getRegisteredTextBoxes), /* harmony export */ registerTextBox: () => (/* binding */ registerTextBox) /* harmony export */ }); const registry = new WeakMap(); function clearTextBoxRegistry(svgLayerElement) { registry.set(svgLayerElement, []); } function registerTextBox(svgLayerElement, rect) { let boxes = registry.get(svgLayerElement); if (!boxes) { boxes = []; registry.set(svgLayerElement, boxes); } boxes.push({ x: rect.x, y: rect.y, width: rect.width, height: rect.height }); } function getRegisteredTextBoxes(svgLayerElement) { return registry.get(svgLayerElement) || []; } /***/ }, /***/ 6423 /*!************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/getCalibratedUnits.js ***! \************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getCalibratedAspect: () => (/* binding */ getCalibratedAspect), /* harmony export */ getCalibratedLengthUnitsAndScale: () => (/* binding */ getCalibratedLengthUnitsAndScale), /* harmony export */ getCalibratedProbeUnitsAndValue: () => (/* binding */ getCalibratedProbeUnitsAndValue) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 67855); const { CalibrationTypes } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__; const PIXEL_UNITS = 'px'; const VOXEL_UNITS = 'voxels'; const SUPPORTED_REGION_DATA_TYPES = [1, 2, 3, 4]; const SUPPORTED_PROBE_VARIANT = ['4,3', '4,7', '4,-1']; const UNIT_MAPPING = { 0: 'px', 1: 'percent', 2: 'dB', 3: 'cm', 4: 'seconds', 5: 'hertz', 6: 'dB/seconds', 7: 'cm/sec', 8: 'cm\xb2', 9: 'cm\xb2/s', 0xc: 'degrees', [-1]: 'mV' }; const EPS = 1e-3; const SQUARE = '\xb2'; const types = [CalibrationTypes.ERMF, CalibrationTypes.USER, CalibrationTypes.ERROR, CalibrationTypes.PROJECTION, CalibrationTypes.CALIBRATED, CalibrationTypes.UNKNOWN]; const getCalibratedLengthUnitsAndScale = (image, handles) => { const { calibration, hasPixelSpacing, spacing = [1, 1, 1] } = image; let unit = hasPixelSpacing ? 'mm' : PIXEL_UNITS; const volumeUnit = hasPixelSpacing ? 'mm\xb3' : VOXEL_UNITS; let areaUnit = unit + SQUARE; const baseScale = calibration?.scale || 1; let scale = baseScale / (calibration?.columnPixelSpacing || spacing[0]); let scaleY = baseScale / (calibration?.rowPixelSpacing || spacing[1]); let scaleZ = baseScale / spacing[2]; let calibrationType = ''; if (!calibration || !calibration.type && !calibration.sequenceOfUltrasoundRegions) { return { unit, areaUnit, scale, scaleY, scaleZ, volumeUnit }; } if (types.includes(calibration?.type)) { calibrationType = calibration.type; } if (calibration.type === CalibrationTypes.UNCALIBRATED) { return { unit: PIXEL_UNITS, areaUnit: PIXEL_UNITS + SQUARE, scale, scaleY, scaleZ, volumeUnit: VOXEL_UNITS }; } if (calibration.sequenceOfUltrasoundRegions) { const region = calibration.sequenceOfUltrasoundRegions.find(region => handles.every(handle => handle[0] >= region.regionLocationMinX0 && handle[0] <= region.regionLocationMaxX1 && handle[1] >= region.regionLocationMinY0 && handle[1] <= region.regionLocationMaxY1) && (SUPPORTED_REGION_DATA_TYPES.includes(region.regionDataType) || SUPPORTED_PROBE_VARIANT.includes(`${region.physicalUnitsXDirection},${region.physicalUnitsYDirection}`))); if (region && region.physicalUnitsXDirection === region.physicalUnitsYDirection) { const physicalDeltaX = Math.abs(region.physicalDeltaX); const physicalDeltaY = Math.abs(region.physicalDeltaY); scale = 1 / physicalDeltaX; scaleY = 1 / physicalDeltaY; calibrationType = 'US Region'; unit = UNIT_MAPPING[region.physicalUnitsXDirection] || 'unknown'; areaUnit = unit + SQUARE; } else if (region && region.physicalUnitsYDirection === -1) { const physicalDeltaX = Math.abs(region.physicalDeltaX); const physicalDeltaY = Math.abs(region.physicalDeltaY); scale = 1 / physicalDeltaX; scaleY = 1 / physicalDeltaY; calibrationType = 'ECG Region'; unit = UNIT_MAPPING[region.physicalUnitsXDirection] || UNIT_MAPPING[region.physicalUnitsYDirection] || 'unknown'; areaUnit = (UNIT_MAPPING[region.physicalUnitsYDirection] || 'px') + SQUARE; } } else if (calibration.scale) { scale = calibration.scale; } return { unit: unit + (calibrationType ? ` ${calibrationType}` : ''), areaUnit: areaUnit + (calibrationType ? ` ${calibrationType}` : ''), volumeUnit: volumeUnit + (calibrationType ? ` ${calibrationType}` : ''), scale, scaleY, scaleZ }; }; const getCalibratedProbeUnitsAndValue = (image, handles) => { const [imageIndex] = handles; const { calibration } = image; let units = ['raw']; let values = [null]; let calibrationType = ''; if (!calibration || !calibration.type && !calibration.sequenceOfUltrasoundRegions) { return { units, values }; } if (calibration.sequenceOfUltrasoundRegions) { const supportedRegionsMetadata = calibration.sequenceOfUltrasoundRegions.filter(region => (SUPPORTED_REGION_DATA_TYPES.includes(region.regionDataType) || SUPPORTED_PROBE_VARIANT.includes(`${region.physicalUnitsXDirection},${region.physicalUnitsYDirection}`)) && SUPPORTED_PROBE_VARIANT.includes(`${region.physicalUnitsXDirection},${region.physicalUnitsYDirection}`)); if (!supportedRegionsMetadata?.length) { return { units, values }; } const region = supportedRegionsMetadata.find(region => imageIndex[0] >= region.regionLocationMinX0 && imageIndex[0] <= region.regionLocationMaxX1 && imageIndex[1] >= region.regionLocationMinY0 && imageIndex[1] <= region.regionLocationMaxY1); if (!region) { return { units, values }; } const { referencePixelX0 = 0, referencePixelY0 = 0 } = region; const { physicalDeltaX, physicalDeltaY } = region; const yValue = (imageIndex[1] - region.regionLocationMinY0 - referencePixelY0) * physicalDeltaY; const xValue = (imageIndex[0] - region.regionLocationMinX0 - referencePixelX0) * physicalDeltaX; calibrationType = region.physicalUnitsYDirection === -1 ? 'ECG Region' : 'US Region'; values = [xValue, yValue]; units = [UNIT_MAPPING[region.physicalUnitsXDirection] ?? 'unknown', UNIT_MAPPING[region.physicalUnitsYDirection] ?? 'unknown']; } return { units, values, calibrationType }; }; const getCalibratedAspect = image => image.calibration?.aspect || 1; /***/ }, /***/ 46893 /*!************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/getPixelValueUnits.js ***! \************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getPixelValueUnits: () => (/* binding */ getPixelValueUnits), /* harmony export */ getPixelValueUnitsImageId: () => (/* binding */ getPixelValueUnitsImageId) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 90161); function getPixelValueUnitsImageId(imageId, options) { const generalSeriesModule = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.get('generalSeriesModule', imageId); return getPixelValueUnits(generalSeriesModule.modality, imageId, options); } function getPixelValueUnits(modality, imageId, options) { if (modality === 'CT') { return 'HU'; } else if (modality === 'PT') { return _handlePTModality(imageId, options); } else { return ''; } } function _handlePTModality(imageId, options) { if (!options.isPreScaled) { return 'raw'; } if (options.isSuvScaled) { return 'SUV'; } const generalSeriesModule = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.get('generalSeriesModule', imageId); if (generalSeriesModule?.modality === 'PT') { const petSeriesModule = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.get('petSeriesModule', imageId); return petSeriesModule?.units || 'unitless'; } return 'unknown'; } /***/ }, /***/ 40685 /*!*********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/getToolsWithModesForElement.js ***! \*********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getToolsWithModesForElement) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../store/ToolGroupManager */ 43551); function getToolsWithModesForElement(element, modesFilter) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element); const { renderingEngineId, viewportId } = enabledElement; const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_1__["default"])(viewportId, renderingEngineId); if (!toolGroup) { return []; } const enabledTools = []; const toolGroupToolNames = Object.keys(toolGroup.toolOptions); for (let j = 0; j < toolGroupToolNames.length; j++) { const toolName = toolGroupToolNames[j]; const toolOptions = toolGroup.toolOptions[toolName]; if (!toolOptions) { continue; } if (modesFilter.includes(toolOptions.mode)) { const toolInstance = toolGroup.getToolInstance(toolName); enabledTools.push(toolInstance); } } return enabledTools; } /***/ }, /***/ 29549 /*!******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/getViewportForAnnotation.js ***! \******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getViewportForAnnotation) /* harmony export */ }); /* harmony import */ var _getViewportsForAnnotation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getViewportsForAnnotation */ 7022); function getViewportForAnnotation(annotation) { const viewports = (0,_getViewportsForAnnotation__WEBPACK_IMPORTED_MODULE_0__["default"])(annotation); if (!viewports?.length) { return undefined; } const viewport = viewports.find(viewport => viewport.getImageIds().some(imageId => imageId === annotation.metadata.referencedImageId)); return viewport ?? viewports[0]; } /***/ }, /***/ 7022 /*!*******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/getViewportsForAnnotation.js ***! \*******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getViewportsForAnnotation) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 80853); const { isEqual } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__; function getViewportsForAnnotation(annotation) { const { metadata } = annotation; return (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElements)().filter(enabledElement => { if (enabledElement.FrameOfReferenceUID === metadata.FrameOfReferenceUID) { const viewport = enabledElement.viewport; const { viewPlaneNormal, viewUp } = viewport.getCamera(); return isEqual(viewPlaneNormal, metadata.viewPlaneNormal) && (!metadata.viewUp || isEqual(viewUp, metadata.viewUp)); } return; }).map(enabledElement => enabledElement.viewport); } /***/ }, /***/ 47866 /*!**************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/isObject.js ***! \**************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); function isObject(value) { const type = typeof value; return value !== null && (type === 'object' || type === 'function'); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (isObject); /***/ }, /***/ 85160 /*!*****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/aabb/intersectAABB.js ***! \*****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ intersectAABB) /* harmony export */ }); function intersectAABB(aabb1, aabb2) { return aabb1.minX <= aabb2.maxX && aabb1.maxX >= aabb2.minX && aabb1.minY <= aabb2.maxY && aabb1.maxY >= aabb2.minY; } /***/ }, /***/ 96064 /*!*************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/basic/BasicStatsCalculator.js ***! \*************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ BasicStatsCalculator: () => (/* binding */ BasicStatsCalculator), /* harmony export */ InstanceBasicStatsCalculator: () => (/* binding */ InstanceBasicStatsCalculator) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 80853); /* harmony import */ var _Calculator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Calculator */ 87989); const { PointsManager } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__; function createBasicStatsState(storePointData) { return { max: [-Infinity], min: [Infinity], sum: [0], count: 0, maxIJK: null, maxLPS: null, minIJK: null, minLPS: null, runMean: [0], m2: [0], m3: [0], m4: [0], allValues: [[]], pointsInShape: storePointData ? PointsManager.create3(1024) : null, sumLPS: [0, 0, 0] }; } function basicStatsCallback(state, newValue, pointLPS = null, pointIJK = null) { if (Array.isArray(newValue) && newValue.length > 1 && state.max.length === 1) { state.max.push(state.max[0], state.max[0]); state.min.push(state.min[0], state.min[0]); state.sum.push(state.sum[0], state.sum[0]); state.runMean.push(0, 0); state.m2.push(state.m2[0], state.m2[0]); state.m3.push(state.m3[0], state.m3[0]); state.m4.push(state.m4[0], state.m4[0]); state.allValues.push([], []); } if (state?.pointsInShape && pointLPS) { state.pointsInShape.push(pointLPS); } const newArray = Array.isArray(newValue) ? newValue : [newValue]; state.count += 1; if (pointLPS) { state.sumLPS[0] += pointLPS[0]; state.sumLPS[1] += pointLPS[1]; state.sumLPS[2] += pointLPS[2]; } state.max.forEach((it, idx) => { const value = newArray[idx]; state.allValues[idx].push(value); const n = state.count; const delta = value - state.runMean[idx]; const delta_n = delta / n; const term1 = delta * delta_n * (n - 1); state.sum[idx] += value; state.runMean[idx] += delta_n; state.m4[idx] += term1 * delta_n * delta_n * (n * n - 3 * n + 3) + 6 * delta_n * delta_n * state.m2[idx] - 4 * delta_n * state.m3[idx]; state.m3[idx] += term1 * delta_n * (n - 2) - 3 * delta_n * state.m2[idx]; state.m2[idx] += term1; if (value < state.min[idx]) { state.min[idx] = value; if (idx === 0) { state.minIJK = pointIJK ? [...pointIJK] : null; state.minLPS = pointLPS ? [...pointLPS] : null; } } if (value > state.max[idx]) { state.max[idx] = value; if (idx === 0) { state.maxIJK = pointIJK ? [...pointIJK] : null; state.maxLPS = pointLPS ? [...pointLPS] : null; } } }); } function calculateMedian(values) { if (values.length === 0) { return 0; } const sorted = [...values].sort((a, b) => a - b); const mid = Math.floor(sorted.length / 2); if (sorted.length % 2 === 0) { return (sorted[mid - 1] + sorted[mid]) / 2; } else { return sorted[mid]; } } function basicGetStatistics(state, unit) { const mean = state.sum.map(sum => sum / state.count); const stdDev = state.m2.map(squaredDiffSum => Math.sqrt(squaredDiffSum / state.count)); const center = state.sumLPS.map(sum => sum / state.count); const skewness = state.m3.map((m3, idx) => { const variance = state.m2[idx] / state.count; if (variance === 0) { return 0; } return m3 / (state.count * Math.pow(variance, 1.5)); }); const kurtosis = state.m4.map((m4, idx) => { const variance = state.m2[idx] / state.count; if (variance === 0) { return 0; } return m4 / (state.count * variance * variance) - 3; }); const median = state.allValues.map(values => calculateMedian(values)); const named = { max: { name: 'max', label: 'Max Pixel', value: state.max.length === 1 ? state.max[0] : state.max, unit, pointIJK: state.maxIJK ? [...state.maxIJK] : null, pointLPS: state.maxLPS ? [...state.maxLPS] : null }, min: { name: 'min', label: 'Min Pixel', value: state.min.length === 1 ? state.min[0] : state.min, unit, pointIJK: state.minIJK ? [...state.minIJK] : null, pointLPS: state.minLPS ? [...state.minLPS] : null }, mean: { name: 'mean', label: 'Mean Pixel', value: mean.length === 1 ? mean[0] : mean, unit }, stdDev: { name: 'stdDev', label: 'Standard Deviation', value: stdDev.length === 1 ? stdDev[0] : stdDev, unit }, count: { name: 'count', label: 'Voxel Count', value: state.count, unit: null }, median: { name: 'median', label: 'Median', value: median.length === 1 ? median[0] : median, unit }, skewness: { name: 'skewness', label: 'Skewness', value: skewness.length === 1 ? skewness[0] : skewness, unit: null }, kurtosis: { name: 'kurtosis', label: 'Kurtosis', value: kurtosis.length === 1 ? kurtosis[0] : kurtosis, unit: null }, maxLPS: { name: 'maxLPS', label: 'Max LPS', value: state.maxLPS ? Array.from(state.maxLPS) : null, unit: null }, minLPS: { name: 'minLPS', label: 'Min LPS', value: state.minLPS ? Array.from(state.minLPS) : null, unit: null }, pointsInShape: state.pointsInShape, center: { name: 'center', label: 'Center', value: center ? [...center] : null, unit: null }, array: [] }; named.array.push(named.min, named.max, named.mean, named.stdDev, named.median, named.skewness, named.kurtosis, named.count, named.maxLPS, named.minLPS); if (named.center.value) { named.array.push(named.center); } const store = state.pointsInShape !== null; const freshState = createBasicStatsState(store); state.max = freshState.max; state.min = freshState.min; state.sum = freshState.sum; state.count = freshState.count; state.maxIJK = freshState.maxIJK; state.maxLPS = freshState.maxLPS; state.minIJK = freshState.minIJK; state.minLPS = freshState.minLPS; state.runMean = freshState.runMean; state.m2 = freshState.m2; state.m3 = freshState.m3; state.m4 = freshState.m4; state.allValues = freshState.allValues; state.pointsInShape = freshState.pointsInShape; state.sumLPS = freshState.sumLPS; return named; } class BasicStatsCalculator extends _Calculator__WEBPACK_IMPORTED_MODULE_1__.Calculator { static { this.state = createBasicStatsState(true); } static statsInit(options) { if (!options.storePointData) { this.state.pointsInShape = null; } this.state = createBasicStatsState(options.storePointData); } static { this.statsCallback = ({ value: newValue, pointLPS = null, pointIJK = null }) => { basicStatsCallback(this.state, newValue, pointLPS, pointIJK); }; } static { this.getStatistics = options => { return basicGetStatistics(this.state, options?.unit); }; } } class InstanceBasicStatsCalculator extends _Calculator__WEBPACK_IMPORTED_MODULE_1__.InstanceCalculator { constructor(options) { super(options); this.state = createBasicStatsState(options.storePointData); } statsInit(options) { this.state = createBasicStatsState(options.storePointData); } statsCallback(data) { basicStatsCallback(this.state, data.value, data.pointLPS, data.pointIJK); } getStatistics(options) { return basicGetStatistics(this.state, options?.unit); } } /***/ }, /***/ 87989 /*!***************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/basic/Calculator.js ***! \***************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Calculator: () => (/* binding */ Calculator), /* harmony export */ InstanceCalculator: () => (/* binding */ InstanceCalculator) /* harmony export */ }); class Calculator {} class InstanceCalculator { constructor(options) { this.storePointData = options.storePointData; } getStatistics() { console.debug('InstanceCalculator getStatistics called'); } } /***/ }, /***/ 54414 /*!**************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/line/distanceToPointSquared.js ***! \**************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ distanceToPointSquared) /* harmony export */ }); /* harmony import */ var _distanceToPointSquaredInfo__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./distanceToPointSquaredInfo */ 982); function distanceToPointSquared(lineStart, lineEnd, point) { return (0,_distanceToPointSquaredInfo__WEBPACK_IMPORTED_MODULE_0__["default"])(lineStart, lineEnd, point).distanceSquared; } /***/ }, /***/ 982 /*!******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/line/distanceToPointSquaredInfo.js ***! \******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ distanceToPointSquaredInfo) /* harmony export */ }); /* harmony import */ var _point__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../point */ 10460); function distanceToPointSquaredInfo(lineStart, lineEnd, point) { let closestPoint; const distanceSquared = (0,_point__WEBPACK_IMPORTED_MODULE_0__["default"])(lineStart, lineEnd); if (lineStart[0] === lineEnd[0] && lineStart[1] === lineEnd[1]) { closestPoint = lineStart; } if (!closestPoint) { const dotProduct = ((point[0] - lineStart[0]) * (lineEnd[0] - lineStart[0]) + (point[1] - lineStart[1]) * (lineEnd[1] - lineStart[1])) / distanceSquared; if (dotProduct < 0) { closestPoint = lineStart; } else if (dotProduct > 1) { closestPoint = lineEnd; } else { closestPoint = [lineStart[0] + dotProduct * (lineEnd[0] - lineStart[0]), lineStart[1] + dotProduct * (lineEnd[1] - lineStart[1])]; } } return { point: [...closestPoint], distanceSquared: (0,_point__WEBPACK_IMPORTED_MODULE_0__["default"])(point, closestPoint) }; } /***/ }, /***/ 16781 /*!************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/line/isPointOnLineSegment.js ***! \************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ isPointOnLineSegment) /* harmony export */ }); const ORIENTATION_TOLERANCE = 1e-2; function isPointOnLineSegment(lineStart, lineEnd, point) { const minX = lineStart[0] <= lineEnd[0] ? lineStart[0] : lineEnd[0]; const maxX = lineStart[0] >= lineEnd[0] ? lineStart[0] : lineEnd[0]; const minY = lineStart[1] <= lineEnd[1] ? lineStart[1] : lineEnd[1]; const maxY = lineStart[1] >= lineEnd[1] ? lineStart[1] : lineEnd[1]; const aabbContainsPoint = point[0] >= minX - ORIENTATION_TOLERANCE && point[0] <= maxX + ORIENTATION_TOLERANCE && point[1] >= minY - ORIENTATION_TOLERANCE && point[1] <= maxY + ORIENTATION_TOLERANCE; if (!aabbContainsPoint) { return false; } const orientation = (lineEnd[1] - lineStart[1]) * (point[0] - lineEnd[0]) - (lineEnd[0] - lineStart[0]) * (point[1] - lineEnd[1]); const absOrientation = orientation >= 0 ? orientation : -orientation; return absOrientation <= ORIENTATION_TOLERANCE; } /***/ }, /***/ 69125 /*!********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/point/distanceToPoint.js ***! \********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ distanceToPoint) /* harmony export */ }); /* harmony import */ var _distanceToPointSquared__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./distanceToPointSquared */ 10460); function distanceToPoint(p1, p2) { return Math.sqrt((0,_distanceToPointSquared__WEBPACK_IMPORTED_MODULE_0__["default"])(p1, p2)); } /***/ }, /***/ 10460 /*!***************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/point/distanceToPointSquared.js ***! \***************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ distanceToPointSquared) /* harmony export */ }); function distanceToPointSquared(p1, p2) { if (p1.length !== p2.length) { throw Error('Both points should have the same dimensionality'); } const [x1, y1, z1 = 0] = p1; const [x2, y2, z2 = 0] = p2; const dx = x2 - x1; const dy = y2 - y1; const dz = z2 - z1; return dx * dx + dy * dy + dz * dz; } /***/ }, /***/ 92687 /*!******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/addCanvasPointsToArray.js ***! \******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! gl-matrix */ 93067); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! gl-matrix */ 87396); const addCanvasPointsToArray = (element, canvasPoints, newCanvasPoint, commonData) => { const { xDir, yDir, spacing } = commonData; const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element); const { viewport } = enabledElement; if (!canvasPoints.length) { canvasPoints.push(newCanvasPoint); console.log('>>>>> !canvasPoints. :: RETURN'); return 1; } const lastWorldPos = viewport.canvasToWorld(canvasPoints[canvasPoints.length - 1]); const newWorldPos = viewport.canvasToWorld(newCanvasPoint); const worldPosDiff = gl_matrix__WEBPACK_IMPORTED_MODULE_2__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_2__.subtract(worldPosDiff, newWorldPos, lastWorldPos); const xDist = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_2__.dot(worldPosDiff, xDir)); const yDist = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_2__.dot(worldPosDiff, yDir)); const numPointsToAdd = Math.max(Math.floor(xDist / spacing[0]), Math.floor(yDist / spacing[0])); if (numPointsToAdd > 1) { const lastCanvasPoint = canvasPoints[canvasPoints.length - 1]; const canvasDist = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.dist(lastCanvasPoint, newCanvasPoint); const canvasDir = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_1__.subtract(canvasDir, newCanvasPoint, lastCanvasPoint); gl_matrix__WEBPACK_IMPORTED_MODULE_1__.set(canvasDir, canvasDir[0] / canvasDist, canvasDir[1] / canvasDist); const distPerPoint = canvasDist / numPointsToAdd; for (let i = 1; i <= numPointsToAdd; i++) { canvasPoints.push([lastCanvasPoint[0] + distPerPoint * canvasDir[0] * i, lastCanvasPoint[1] + distPerPoint * canvasDir[1] * i]); } } else { canvasPoints.push(newCanvasPoint); } return numPointsToAdd; }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (addCanvasPointsToArray); /***/ }, /***/ 59260 /*!***********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/areLineSegmentsIntersecting.js ***! \***********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ areLineSegmentsIntersecting) /* harmony export */ }); function areLineSegmentsIntersecting(p1, q1, p2, q2) { let result = false; const line1MinX = p1[0] < q1[0] ? p1[0] : q1[0]; const line1MinY = p1[1] < q1[1] ? p1[1] : q1[1]; const line1MaxX = p1[0] > q1[0] ? p1[0] : q1[0]; const line1MaxY = p1[1] > q1[1] ? p1[1] : q1[1]; const line2MinX = p2[0] < q2[0] ? p2[0] : q2[0]; const line2MinY = p2[1] < q2[1] ? p2[1] : q2[1]; const line2MaxX = p2[0] > q2[0] ? p2[0] : q2[0]; const line2MaxY = p2[1] > q2[1] ? p2[1] : q2[1]; if (line1MinX > line2MaxX || line1MaxX < line2MinX || line1MinY > line2MaxY || line1MaxY < line2MinY) { return false; } const orient = [orientation(p1, q1, p2), orientation(p1, q1, q2), orientation(p2, q2, p1), orientation(p2, q2, q1)]; if (orient[0] !== orient[1] && orient[2] !== orient[3]) { return true; } if (orient[0] === 0 && onSegment(p1, p2, q1)) { result = true; } else if (orient[1] === 0 && onSegment(p1, q2, q1)) { result = true; } else if (orient[2] === 0 && onSegment(p2, p1, q2)) { result = true; } else if (orient[3] === 0 && onSegment(p2, q1, q2)) { result = true; } return result; } function orientation(p, q, r) { const orientationValue = (q[1] - p[1]) * (r[0] - q[0]) - (q[0] - p[0]) * (r[1] - q[1]); if (orientationValue === 0) { return 0; } return orientationValue > 0 ? 1 : 2; } function onSegment(p, q, r) { if (q[0] <= Math.max(p[0], r[0]) && q[0] >= Math.min(p[0], r[0]) && q[1] <= Math.max(p[1], r[1]) && q[1] >= Math.min(p[1], r[1])) { return true; } return false; } /***/ }, /***/ 9195 /*!*****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/arePolylinesIdentical.js ***! \*****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ arePolylinesIdentical) /* harmony export */ }); /* harmony import */ var _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./robustSegmentIntersection */ 28054); function arePolylinesIdentical(poly1, poly2) { if (poly1.length !== poly2.length) { return false; } const len = poly1.length; if (len === 0) { return true; } let identicalForward = true; for (let i = 0; i < len; i++) { if (!(0,_robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_0__.pointsAreEqual)(poly1[i], poly2[i])) { identicalForward = false; break; } } if (identicalForward) { return true; } let identicalReverse = true; for (let i = 0; i < len; i++) { if (!(0,_robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_0__.pointsAreEqual)(poly1[i], poly2[len - 1 - i])) { identicalReverse = false; break; } } if (identicalReverse) { return true; } for (let offset = 1; offset < len; offset++) { let cyclicForward = true; for (let i = 0; i < len; i++) { if (!(0,_robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_0__.pointsAreEqual)(poly1[i], poly2[(i + offset) % len])) { cyclicForward = false; break; } } if (cyclicForward) { return true; } let cyclicReverse = true; for (let i = 0; i < len; i++) { if (!(0,_robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_0__.pointsAreEqual)(poly1[i], poly2[(len - 1 - i + offset) % len])) { cyclicReverse = false; break; } } if (cyclicReverse) { return true; } } return false; } /***/ }, /***/ 83620 /*!***********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/combinePolyline.js ***! \***********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ mergePolylines: () => (/* binding */ mergePolylines) /* harmony export */ }); /* harmony import */ var _point__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../point */ 10460); /* harmony import */ var _getLineSegmentIntersectionsIndexes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getLineSegmentIntersectionsIndexes */ 80948); /* harmony import */ var _containsPoint__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./containsPoint */ 23340); /* harmony import */ var _containsPoints__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./containsPoints */ 92035); /* harmony import */ var _intersectPolyline__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./intersectPolyline */ 29040); /* harmony import */ var _getNormal2__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./getNormal2 */ 19342); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! gl-matrix */ 27182); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _getLinesIntersection__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./getLinesIntersection */ 72679); var PolylinePointType; (function (PolylinePointType) { PolylinePointType[PolylinePointType["Vertex"] = 0] = "Vertex"; PolylinePointType[PolylinePointType["Intersection"] = 1] = "Intersection"; })(PolylinePointType || (PolylinePointType = {})); var PolylinePointPosition; (function (PolylinePointPosition) { PolylinePointPosition[PolylinePointPosition["Outside"] = -1] = "Outside"; PolylinePointPosition[PolylinePointPosition["Edge"] = 0] = "Edge"; PolylinePointPosition[PolylinePointPosition["Inside"] = 1] = "Inside"; })(PolylinePointPosition || (PolylinePointPosition = {})); var PolylinePointDirection; (function (PolylinePointDirection) { PolylinePointDirection[PolylinePointDirection["Exiting"] = -1] = "Exiting"; PolylinePointDirection[PolylinePointDirection["Unknown"] = 0] = "Unknown"; PolylinePointDirection[PolylinePointDirection["Entering"] = 1] = "Entering"; })(PolylinePointDirection || (PolylinePointDirection = {})); function ensuresNextPointers(polylinePoints) { for (let i = 0, len = polylinePoints.length; i < len; i++) { const currentPoint = polylinePoints[i]; if (!currentPoint.next) { currentPoint.next = polylinePoints[i === len - 1 ? 0 : i + 1]; } } } function getSourceAndTargetPointsList(targetPolyline, sourcePolyline) { const targetPolylinePoints = []; const sourcePolylinePoints = []; const sourceIntersectionsCache = new Map(); const isFirstPointInside = (0,_containsPoint__WEBPACK_IMPORTED_MODULE_2__["default"])(sourcePolyline, targetPolyline[0]); let intersectionPointDirection = isFirstPointInside ? PolylinePointDirection.Exiting : PolylinePointDirection.Entering; for (let i = 0, len = targetPolyline.length; i < len; i++) { const p1 = targetPolyline[i]; const pointInside = (0,_containsPoint__WEBPACK_IMPORTED_MODULE_2__["default"])(sourcePolyline, p1); const vertexPoint = { type: PolylinePointType.Vertex, coordinates: p1, position: pointInside ? PolylinePointPosition.Inside : PolylinePointPosition.Outside, visited: false, next: null }; targetPolylinePoints.push(vertexPoint); const q1 = targetPolyline[i === len - 1 ? 0 : i + 1]; const intersectionsInfo = (0,_getLineSegmentIntersectionsIndexes__WEBPACK_IMPORTED_MODULE_1__["default"])(sourcePolyline, p1, q1).map(intersectedLineSegment => { const sourceLineSegmentId = intersectedLineSegment[0]; const p2 = sourcePolyline[intersectedLineSegment[0]]; const q2 = sourcePolyline[intersectedLineSegment[1]]; const intersectionCoordinate = (0,_getLinesIntersection__WEBPACK_IMPORTED_MODULE_8__["default"])(p1, q1, p2, q2); const targetStartPointDistSquared = _point__WEBPACK_IMPORTED_MODULE_0__["default"](p1, intersectionCoordinate); return { sourceLineSegmentId, coordinate: intersectionCoordinate, targetStartPointDistSquared }; }); intersectionsInfo.sort((left, right) => left.targetStartPointDistSquared - right.targetStartPointDistSquared); intersectionsInfo.forEach(intersectionInfo => { const { sourceLineSegmentId, coordinate: intersectionCoordinate } = intersectionInfo; const targetEdgePoint = { type: PolylinePointType.Intersection, coordinates: intersectionCoordinate, position: PolylinePointPosition.Edge, direction: intersectionPointDirection, visited: false, next: null }; const sourceEdgePoint = { ...targetEdgePoint, direction: PolylinePointDirection.Unknown, cloned: true }; if (intersectionPointDirection === PolylinePointDirection.Entering) { targetEdgePoint.next = sourceEdgePoint; } else { sourceEdgePoint.next = targetEdgePoint; } let sourceIntersectionPoints = sourceIntersectionsCache.get(sourceLineSegmentId); if (!sourceIntersectionPoints) { sourceIntersectionPoints = []; sourceIntersectionsCache.set(sourceLineSegmentId, sourceIntersectionPoints); } targetPolylinePoints.push(targetEdgePoint); sourceIntersectionPoints.push(sourceEdgePoint); intersectionPointDirection *= -1; }); } for (let i = 0, len = sourcePolyline.length; i < len; i++) { const lineSegmentId = i; const p1 = sourcePolyline[i]; const vertexPoint = { type: PolylinePointType.Vertex, coordinates: p1, visited: false, next: null }; sourcePolylinePoints.push(vertexPoint); const sourceIntersectionPoints = sourceIntersectionsCache.get(lineSegmentId); if (!sourceIntersectionPoints?.length) { continue; } sourceIntersectionPoints.map(intersectionPoint => ({ intersectionPoint, lineSegStartDistSquared: _point__WEBPACK_IMPORTED_MODULE_0__["default"](p1, intersectionPoint.coordinates) })).sort((left, right) => left.lineSegStartDistSquared - right.lineSegStartDistSquared).map(({ intersectionPoint }) => intersectionPoint).forEach(intersectionPoint => sourcePolylinePoints.push(intersectionPoint)); } ensuresNextPointers(targetPolylinePoints); ensuresNextPointers(sourcePolylinePoints); return { targetPolylinePoints, sourcePolylinePoints }; } function getUnvisitedOutsidePoint(polylinePoints) { for (let i = 0, len = polylinePoints.length; i < len; i++) { const point = polylinePoints[i]; if (!point.visited && point.position === PolylinePointPosition.Outside && point.type === PolylinePointType.Vertex) { return point; } } for (let i = 0, len = polylinePoints.length; i < len; i++) { const point = polylinePoints[i]; if (!point.visited && point.position === PolylinePointPosition.Outside) { return point; } } return undefined; } function mergePolylines(targetPolyline, sourcePolyline) { const targetNormal = (0,_getNormal2__WEBPACK_IMPORTED_MODULE_5__["default"])(targetPolyline); const sourceNormal = (0,_getNormal2__WEBPACK_IMPORTED_MODULE_5__["default"])(sourcePolyline); const dotNormals = gl_matrix__WEBPACK_IMPORTED_MODULE_7__.dot(sourceNormal, targetNormal); if (!gl_matrix__WEBPACK_IMPORTED_MODULE_6__.equals(1, dotNormals)) { sourcePolyline = sourcePolyline.slice().reverse(); } const lineSegmentsIntersect = (0,_intersectPolyline__WEBPACK_IMPORTED_MODULE_4__["default"])(sourcePolyline, targetPolyline); const targetContainedInSource = !lineSegmentsIntersect && (0,_containsPoints__WEBPACK_IMPORTED_MODULE_3__["default"])(sourcePolyline, targetPolyline); if (targetContainedInSource) { return sourcePolyline.slice(); } const { targetPolylinePoints } = getSourceAndTargetPointsList(targetPolyline, sourcePolyline); const startPoint = getUnvisitedOutsidePoint(targetPolylinePoints); if (!startPoint) { return targetPolyline.slice(); } const mergedPolyline = [startPoint.coordinates]; let currentPoint = startPoint.next; let iterationCount = 0; const maxIterations = targetPolyline.length + sourcePolyline.length + 1000; while (currentPoint !== startPoint && iterationCount < maxIterations) { iterationCount++; if (currentPoint.type === PolylinePointType.Intersection && currentPoint.cloned) { currentPoint = currentPoint.next; continue; } mergedPolyline.push(currentPoint.coordinates); currentPoint = currentPoint.next; if (!currentPoint) { console.warn('Broken linked list detected in mergePolylines, breaking loop'); break; } } if (iterationCount >= maxIterations) { console.warn('Maximum iterations reached in mergePolylines, possible infinite loop detected'); } return mergedPolyline; } /***/ }, /***/ 23340 /*!*********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/containsPoint.js ***! \*********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ containsPoint) /* harmony export */ }); /* harmony import */ var _isClosed__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isClosed */ 10749); function containsPoint(polyline, point, options = { closed: undefined }) { if (polyline.length < 3) { return false; } const numPolylinePoints = polyline.length; let numIntersections = 0; const { closed, holes } = options; if (holes?.length) { for (const hole of holes) { if (containsPoint(hole, point)) { return false; } } } const shouldClose = !(closed === undefined ? (0,_isClosed__WEBPACK_IMPORTED_MODULE_0__["default"])(polyline) : closed); const maxSegmentIndex = polyline.length - (shouldClose ? 1 : 2); for (let i = 0; i <= maxSegmentIndex; i++) { const p1 = polyline[i]; const p2Index = i === numPolylinePoints - 1 ? 0 : i + 1; const p2 = polyline[p2Index]; const maxX = p1[0] >= p2[0] ? p1[0] : p2[0]; const maxY = p1[1] >= p2[1] ? p1[1] : p2[1]; const minY = p1[1] <= p2[1] ? p1[1] : p2[1]; const mayIntersectLineSegment = point[0] <= maxX && point[1] >= minY && point[1] < maxY; if (mayIntersectLineSegment) { const isVerticalLine = p1[0] === p2[0]; let intersects = isVerticalLine; if (!intersects) { const xIntersection = (point[1] - p1[1]) * (p2[0] - p1[0]) / (p2[1] - p1[1]) + p1[0]; intersects = point[0] <= xIntersection; } numIntersections += intersects ? 1 : 0; } } return !!(numIntersections % 2); } /***/ }, /***/ 92035 /*!**********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/containsPoints.js ***! \**********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ containsPoints) /* harmony export */ }); /* harmony import */ var _containsPoint__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./containsPoint */ 23340); function containsPoints(polyline, points) { for (let i = 0, numPoint = points.length; i < numPoint; i++) { if (!(0,_containsPoint__WEBPACK_IMPORTED_MODULE_0__["default"])(polyline, points[i])) { return false; } } return true; } /***/ }, /***/ 90297 /*!******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/convexHull.js ***! \******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ convexHull) /* harmony export */ }); function convexHull(pts) { if (pts.length < 3) { return pts.slice(); } const points = pts.map(p => [p[0], p[1]]).sort((a, b) => a[0] === b[0] ? a[1] - b[1] : a[0] - b[0]); function cross(o, a, b) { return (a[0] - o[0]) * (b[1] - o[1]) - (a[1] - o[1]) * (b[0] - o[0]); } const lower = []; for (const p of points) { while (lower.length >= 2 && cross(lower[lower.length - 2], lower[lower.length - 1], p) <= 0) { lower.pop(); } lower.push(p); } const upper = []; for (let i = points.length - 1; i >= 0; i--) { const p = points[i]; while (upper.length >= 2 && cross(upper[upper.length - 2], upper[upper.length - 1], p) <= 0) { upper.pop(); } upper.push(p); } lower.pop(); upper.pop(); return lower.concat(upper); } /***/ }, /***/ 8531 /*!****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/decimate.js ***! \****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ decimate) /* harmony export */ }); /* harmony import */ var _line__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../line */ 54414); const DEFAULT_EPSILON = 0.1; function decimate(polyline, epsilon = DEFAULT_EPSILON) { const numPoints = polyline.length; if (numPoints < 3) { return polyline; } const epsilonSquared = epsilon * epsilon; const partitionQueue = [[0, numPoints - 1]]; const polylinePointFlags = new Array(numPoints).fill(false); let numDecimatedPoints = 2; polylinePointFlags[0] = true; polylinePointFlags[numPoints - 1] = true; while (partitionQueue.length) { const [startIndex, endIndex] = partitionQueue.pop(); if (endIndex - startIndex === 1) { continue; } const startPoint = polyline[startIndex]; const endPoint = polyline[endIndex]; let maxDistSquared = -Infinity; let maxDistIndex = -1; for (let i = startIndex + 1; i < endIndex; i++) { const currentPoint = polyline[i]; const distSquared = _line__WEBPACK_IMPORTED_MODULE_0__["default"](startPoint, endPoint, currentPoint); if (distSquared > maxDistSquared) { maxDistSquared = distSquared; maxDistIndex = i; } } if (maxDistSquared < epsilonSquared) { continue; } polylinePointFlags[maxDistIndex] = true; numDecimatedPoints++; partitionQueue.push([maxDistIndex, endIndex]); partitionQueue.push([startIndex, maxDistIndex]); } const decimatedPolyline = new Array(numDecimatedPoints); for (let srcIndex = 0, dstIndex = 0; srcIndex < numPoints; srcIndex++) { if (polylinePointFlags[srcIndex]) { decimatedPolyline[dstIndex++] = polyline[srcIndex]; } } return decimatedPolyline; } /***/ }, /***/ 5431 /*!***************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/getAABB.js ***! \***************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getAABB) /* harmony export */ }); function getAABB(polyline, options) { let polylineToUse = polyline; const numDimensions = options?.numDimensions || 2; const is3D = numDimensions === 3; if (!Array.isArray(polyline[0])) { const currentPolyline = polyline; const totalPoints = currentPolyline.length / numDimensions; polylineToUse = new Array(currentPolyline.length / numDimensions); for (let i = 0, len = totalPoints; i < len; i++) { polylineToUse[i] = [currentPolyline[i * numDimensions], currentPolyline[i * numDimensions + 1]]; if (is3D) { polylineToUse[i].push(currentPolyline[i * numDimensions + 2]); } } } let minX = Infinity; let minY = Infinity; let maxX = -Infinity; let maxY = -Infinity; let minZ = Infinity; let maxZ = -Infinity; polylineToUse = polylineToUse; for (let i = 0, len = polylineToUse.length; i < len; i++) { const [x, y, z] = polylineToUse[i]; minX = minX < x ? minX : x; minY = minY < y ? minY : y; maxX = maxX > x ? maxX : x; maxY = maxY > y ? maxY : y; if (is3D) { minZ = minZ < z ? minZ : z; maxZ = maxZ > z ? maxZ : z; } } return is3D ? { minX, maxX, minY, maxY, minZ, maxZ } : { minX, maxX, minY, maxY }; } /***/ }, /***/ 96800 /*!***************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/getArea.js ***! \***************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getArea) /* harmony export */ }); function getArea(points) { const n = points.length; let area = 0.0; let j = n - 1; for (let i = 0; i < n; i++) { area += (points[j][0] + points[i][0]) * (points[j][1] - points[i][1]); j = i; } return Math.abs(area / 2.0); } /***/ }, /***/ 29726 /*!*****************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/getClosestLineSegmentIntersection.js ***! \*****************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getClosestLineSegmentIntersection) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 93067); /* harmony import */ var _areLineSegmentsIntersecting__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./areLineSegmentsIntersecting */ 59260); function getClosestLineSegmentIntersection(points, p1, q1, closed = true) { let initialQ2Index; let p2Index; if (closed) { p2Index = points.length - 1; initialQ2Index = 0; } else { p2Index = 0; initialQ2Index = 1; } const intersections = []; for (let q2Index = initialQ2Index; q2Index < points.length; q2Index++) { const p2 = points[p2Index]; const q2 = points[q2Index]; if ((0,_areLineSegmentsIntersecting__WEBPACK_IMPORTED_MODULE_1__["default"])(p1, q1, p2, q2)) { intersections.push([p2Index, q2Index]); } p2Index = q2Index; } if (intersections.length === 0) { return; } const distances = []; intersections.forEach(intersection => { const intersectionPoints = [points[intersection[0]], points[intersection[1]]]; const midpoint = [(intersectionPoints[0][0] + intersectionPoints[1][0]) / 2, (intersectionPoints[0][1] + intersectionPoints[1][1]) / 2]; distances.push(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.distance(midpoint, p1)); }); const minDistance = Math.min(...distances); const indexOfMinDistance = distances.indexOf(minDistance); return { segment: intersections[indexOfMinDistance], distance: minDistance }; } /***/ }, /***/ 82001 /*!**********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/getFirstLineSegmentIntersectionIndexes.js ***! \**********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getFirstLineSegmentIntersectionIndexes) /* harmony export */ }); /* harmony import */ var _areLineSegmentsIntersecting__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./areLineSegmentsIntersecting */ 59260); function getFirstLineSegmentIntersectionIndexes(points, p1, q1, closed = true) { let initialI; let j; if (closed) { j = points.length - 1; initialI = 0; } else { j = 0; initialI = 1; } for (let i = initialI; i < points.length; i++) { const p2 = points[j]; const q2 = points[i]; if ((0,_areLineSegmentsIntersecting__WEBPACK_IMPORTED_MODULE_0__["default"])(p1, q1, p2, q2)) { return [j, i]; } j = i; } } /***/ }, /***/ 81611 /*!**********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/getLineSegmentIntersectionsCoordinates.js ***! \**********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getLineSegmentIntersectionsCoordinates) /* harmony export */ }); /* harmony import */ var _getLineSegmentIntersectionsIndexes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getLineSegmentIntersectionsIndexes */ 80948); /* harmony import */ var _getLinesIntersection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getLinesIntersection */ 72679); function getLineSegmentIntersectionsCoordinates(points, p1, q1, closed = true) { const result = []; const polylineIndexes = (0,_getLineSegmentIntersectionsIndexes__WEBPACK_IMPORTED_MODULE_0__["default"])(points, p1, q1, closed); for (let i = 0; i < polylineIndexes.length; i++) { const p2 = points[polylineIndexes[i][0]]; const q2 = points[polylineIndexes[i][1]]; const intersection = (0,_getLinesIntersection__WEBPACK_IMPORTED_MODULE_1__["default"])(p1, q1, p2, q2); result.push(intersection); } return result; } /***/ }, /***/ 80948 /*!******************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/getLineSegmentIntersectionsIndexes.js ***! \******************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getLineSegmentIntersectionsIndexes) /* harmony export */ }); /* harmony import */ var _areLineSegmentsIntersecting__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./areLineSegmentsIntersecting */ 59260); function getLineSegmentIntersectionsIndexes(polyline, p1, q1, closed = true) { const intersections = []; const numPoints = polyline.length; const maxI = numPoints - (closed ? 1 : 2); for (let i = 0; i <= maxI; i++) { const p2 = polyline[i]; const j = i === numPoints - 1 ? 0 : i + 1; const q2 = polyline[j]; if ((0,_areLineSegmentsIntersecting__WEBPACK_IMPORTED_MODULE_0__["default"])(p1, q1, p2, q2)) { intersections.push([i, j]); } } return intersections; } /***/ }, /***/ 72679 /*!****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/getLinesIntersection.js ***! \****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getLinesIntersection) /* harmony export */ }); /* harmony import */ var _line__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../line */ 16781); const PARALLEL_LINES_TOLERANCE = 1e-2; function getLinesIntersection(p1, q1, p2, q2) { const diffQ1P1 = [q1[0] - p1[0], q1[1] - p1[1]]; const diffQ2P2 = [q2[0] - p2[0], q2[1] - p2[1]]; const denominator = diffQ2P2[1] * diffQ1P1[0] - diffQ2P2[0] * diffQ1P1[1]; const absDenominator = denominator >= 0 ? denominator : -denominator; if (absDenominator < PARALLEL_LINES_TOLERANCE) { const line1AABB = [p1[0] < q1[0] ? p1[0] : q1[0], p1[0] > q1[0] ? p1[0] : q1[0], p1[1] < q1[1] ? p1[1] : q1[1], p1[1] > q1[1] ? p1[1] : q1[1]]; const line2AABB = [p2[0] < q2[0] ? p2[0] : q2[0], p2[0] > q2[0] ? p2[0] : q2[0], p2[1] < q2[1] ? p2[1] : q2[1], p2[1] > q2[1] ? p2[1] : q2[1]]; const aabbIntersects = line1AABB[0] <= line2AABB[1] && line1AABB[1] >= line2AABB[0] && line1AABB[2] <= line2AABB[3] && line1AABB[3] >= line2AABB[2]; if (!aabbIntersects) { return; } const overlap = _line__WEBPACK_IMPORTED_MODULE_0__["default"](p1, q1, p2) || _line__WEBPACK_IMPORTED_MODULE_0__["default"](p1, q1, q2) || _line__WEBPACK_IMPORTED_MODULE_0__["default"](p2, q2, p1); if (!overlap) { return; } const minX = line1AABB[0] > line2AABB[0] ? line1AABB[0] : line2AABB[0]; const maxX = line1AABB[1] < line2AABB[1] ? line1AABB[1] : line2AABB[1]; const minY = line1AABB[2] > line2AABB[2] ? line1AABB[2] : line2AABB[2]; const maxY = line1AABB[3] < line2AABB[3] ? line1AABB[3] : line2AABB[3]; const midX = (minX + maxX) * 0.5; const midY = (minY + maxY) * 0.5; return [midX, midY]; } let a = p1[1] - p2[1]; let b = p1[0] - p2[0]; const numerator1 = diffQ2P2[0] * a - diffQ2P2[1] * b; const numerator2 = diffQ1P1[0] * a - diffQ1P1[1] * b; a = numerator1 / denominator; b = numerator2 / denominator; const resultX = p1[0] + a * diffQ1P1[0]; const resultY = p1[1] + a * diffQ1P1[1]; return [resultX, resultY]; } /***/ }, /***/ 19342 /*!******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/getNormal2.js ***! \******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getNormal2) /* harmony export */ }); /* harmony import */ var _getSignedArea__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getSignedArea */ 72956); function getNormal2(polyline) { const area = (0,_getSignedArea__WEBPACK_IMPORTED_MODULE_0__["default"])(polyline); return [0, 0, area / Math.abs(area)]; } /***/ }, /***/ 68653 /*!******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/getNormal3.js ***! \******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getNormal3) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 87396); function _getAreaVector(polyline) { const vecArea = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); const refPoint = polyline[0]; for (let i = 0, len = polyline.length; i < len; i++) { const p1 = polyline[i]; const p2Index = i === len - 1 ? 0 : i + 1; const p2 = polyline[p2Index]; const aX = p1[0] - refPoint[0]; const aY = p1[1] - refPoint[1]; const aZ = p1[2] - refPoint[2]; const bX = p2[0] - refPoint[0]; const bY = p2[1] - refPoint[1]; const bZ = p2[2] - refPoint[2]; vecArea[0] += aY * bZ - aZ * bY; vecArea[1] += aZ * bX - aX * bZ; vecArea[2] += aX * bY - aY * bX; } gl_matrix__WEBPACK_IMPORTED_MODULE_0__.scale(vecArea, vecArea, 0.5); return vecArea; } function getNormal3(polyline) { const vecArea = _getAreaVector(polyline); return gl_matrix__WEBPACK_IMPORTED_MODULE_0__.normalize(vecArea, vecArea); } /***/ }, /***/ 72956 /*!*********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/getSignedArea.js ***! \*********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getSignedArea) /* harmony export */ }); function getSignedArea(polyline) { if (polyline.length < 3) { return 0; } const refPoint = polyline[0]; let area = 0; for (let i = 0, len = polyline.length; i < len; i++) { const p1 = polyline[i]; const p2Index = i === len - 1 ? 0 : i + 1; const p2 = polyline[p2Index]; const aX = p1[0] - refPoint[0]; const aY = p1[1] - refPoint[1]; const bX = p2[0] - refPoint[0]; const bY = p2[1] - refPoint[1]; area += aX * bY - aY * bX; } area *= 0.5; return area; } /***/ }, /***/ 33980 /*!*****************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/getSubPixelSpacingAndXYDirections.js ***! \*****************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 67461); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! gl-matrix */ 87396); const EPSILON = 1e-3; const getSubPixelSpacingAndXYDirections = (viewport, subPixelResolution) => { let spacing; let xDir; let yDir; if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"]) { const imageData = viewport.getImageData(); if (!imageData) { return; } xDir = imageData.direction.slice(0, 3); yDir = imageData.direction.slice(3, 6); spacing = imageData.spacing; } else { const imageData = viewport.getImageData(); const { direction, spacing: volumeSpacing } = imageData; const { viewPlaneNormal, viewUp } = viewport.getCamera(); const iVector = direction.slice(0, 3); const jVector = direction.slice(3, 6); const kVector = direction.slice(6, 9); const viewRight = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_1__.cross(viewRight, viewUp, viewPlaneNormal); const absViewRightDotI = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.dot(viewRight, iVector)); const absViewRightDotJ = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.dot(viewRight, jVector)); const absViewRightDotK = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.dot(viewRight, kVector)); let xSpacing; if (Math.abs(1 - absViewRightDotI) < EPSILON) { xSpacing = volumeSpacing[0]; xDir = iVector; } else if (Math.abs(1 - absViewRightDotJ) < EPSILON) { xSpacing = volumeSpacing[1]; xDir = jVector; } else if (Math.abs(1 - absViewRightDotK) < EPSILON) { xSpacing = volumeSpacing[2]; xDir = kVector; } else { throw new Error('No support yet for oblique plane planar contours'); } const absViewUpDotI = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.dot(viewUp, iVector)); const absViewUpDotJ = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.dot(viewUp, jVector)); const absViewUpDotK = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.dot(viewUp, kVector)); let ySpacing; if (Math.abs(1 - absViewUpDotI) < EPSILON) { ySpacing = volumeSpacing[0]; yDir = iVector; } else if (Math.abs(1 - absViewUpDotJ) < EPSILON) { ySpacing = volumeSpacing[1]; yDir = jVector; } else if (Math.abs(1 - absViewUpDotK) < EPSILON) { ySpacing = volumeSpacing[2]; yDir = kVector; } else { throw new Error('No support yet for oblique plane planar contours'); } spacing = [xSpacing, ySpacing]; } const subPixelSpacing = [spacing[0] / subPixelResolution, spacing[1] / subPixelResolution]; return { spacing: subPixelSpacing, xDir, yDir }; }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getSubPixelSpacingAndXYDirections); /***/ }, /***/ 85118 /*!***************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/getWindingDirection.js ***! \***************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getWindingDirection) /* harmony export */ }); /* harmony import */ var _getSignedArea__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getSignedArea */ 72956); function getWindingDirection(polyline) { const signedArea = (0,_getSignedArea__WEBPACK_IMPORTED_MODULE_0__["default"])(polyline); return signedArea >= 0 ? 1 : -1; } /***/ }, /***/ 4265 /*!*************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/index.js ***! \*************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ addCanvasPointsToArray: () => (/* reexport safe */ _addCanvasPointsToArray__WEBPACK_IMPORTED_MODULE_20__["default"]), /* harmony export */ arePolylinesIdentical: () => (/* reexport safe */ _arePolylinesIdentical__WEBPACK_IMPORTED_MODULE_25__["default"]), /* harmony export */ containsPoint: () => (/* reexport safe */ _containsPoint__WEBPACK_IMPORTED_MODULE_1__["default"]), /* harmony export */ containsPoints: () => (/* reexport safe */ _containsPoints__WEBPACK_IMPORTED_MODULE_2__["default"]), /* harmony export */ convexHull: () => (/* reexport safe */ _convexHull__WEBPACK_IMPORTED_MODULE_24__["default"]), /* harmony export */ decimate: () => (/* reexport safe */ _decimate__WEBPACK_IMPORTED_MODULE_13__["default"]), /* harmony export */ getAABB: () => (/* reexport safe */ _getAABB__WEBPACK_IMPORTED_MODULE_3__["default"]), /* harmony export */ getArea: () => (/* reexport safe */ _getArea__WEBPACK_IMPORTED_MODULE_4__["default"]), /* harmony export */ getClosestLineSegmentIntersection: () => (/* reexport safe */ _getClosestLineSegmentIntersection__WEBPACK_IMPORTED_MODULE_17__["default"]), /* harmony export */ getFirstLineSegmentIntersectionIndexes: () => (/* reexport safe */ _getFirstLineSegmentIntersectionIndexes__WEBPACK_IMPORTED_MODULE_14__["default"]), /* harmony export */ getLineSegmentIntersectionsCoordinates: () => (/* reexport safe */ _getLineSegmentIntersectionsCoordinates__WEBPACK_IMPORTED_MODULE_16__["default"]), /* harmony export */ getLineSegmentIntersectionsIndexes: () => (/* reexport safe */ _getLineSegmentIntersectionsIndexes__WEBPACK_IMPORTED_MODULE_15__["default"]), /* harmony export */ getNormal2: () => (/* reexport safe */ _getNormal2__WEBPACK_IMPORTED_MODULE_8__["default"]), /* harmony export */ getNormal3: () => (/* reexport safe */ _getNormal3__WEBPACK_IMPORTED_MODULE_7__["default"]), /* harmony export */ getSignedArea: () => (/* reexport safe */ _getSignedArea__WEBPACK_IMPORTED_MODULE_5__["default"]), /* harmony export */ getSubPixelSpacingAndXYDirections: () => (/* reexport safe */ _getSubPixelSpacingAndXYDirections__WEBPACK_IMPORTED_MODULE_18__["default"]), /* harmony export */ getWindingDirection: () => (/* reexport safe */ _getWindingDirection__WEBPACK_IMPORTED_MODULE_6__["default"]), /* harmony export */ intersectPolyline: () => (/* reexport safe */ _intersectPolyline__WEBPACK_IMPORTED_MODULE_12__["default"]), /* harmony export */ intersectPolylines: () => (/* reexport safe */ _intersectPolylines__WEBPACK_IMPORTED_MODULE_10__["default"]), /* harmony export */ isClosed: () => (/* reexport safe */ _isClosed__WEBPACK_IMPORTED_MODULE_0__["default"]), /* harmony export */ isPointInsidePolyline3D: () => (/* reexport safe */ _isPointInsidePolyline3D__WEBPACK_IMPORTED_MODULE_22__.isPointInsidePolyline3D), /* harmony export */ mergePolylines: () => (/* reexport safe */ _combinePolyline__WEBPACK_IMPORTED_MODULE_11__.mergePolylines), /* harmony export */ pointCanProjectOnLine: () => (/* reexport safe */ _pointCanProjectOnLine__WEBPACK_IMPORTED_MODULE_21__["default"]), /* harmony export */ pointsAreWithinCloseContourProximity: () => (/* reexport safe */ _pointsAreWithinCloseContourProximity__WEBPACK_IMPORTED_MODULE_19__["default"]), /* harmony export */ projectTo2D: () => (/* reexport safe */ _projectTo2D__WEBPACK_IMPORTED_MODULE_23__.projectTo2D), /* harmony export */ subtractPolylines: () => (/* reexport safe */ _subtractPolylines__WEBPACK_IMPORTED_MODULE_9__["default"]) /* harmony export */ }); /* harmony import */ var _isClosed__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isClosed */ 10749); /* harmony import */ var _containsPoint__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./containsPoint */ 23340); /* harmony import */ var _containsPoints__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./containsPoints */ 92035); /* harmony import */ var _getAABB__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getAABB */ 5431); /* harmony import */ var _getArea__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getArea */ 96800); /* harmony import */ var _getSignedArea__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./getSignedArea */ 72956); /* harmony import */ var _getWindingDirection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./getWindingDirection */ 85118); /* harmony import */ var _getNormal3__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./getNormal3 */ 68653); /* harmony import */ var _getNormal2__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./getNormal2 */ 19342); /* harmony import */ var _subtractPolylines__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./subtractPolylines */ 36136); /* harmony import */ var _intersectPolylines__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./intersectPolylines */ 32943); /* harmony import */ var _combinePolyline__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./combinePolyline */ 83620); /* harmony import */ var _intersectPolyline__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./intersectPolyline */ 29040); /* harmony import */ var _decimate__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./decimate */ 8531); /* harmony import */ var _getFirstLineSegmentIntersectionIndexes__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./getFirstLineSegmentIntersectionIndexes */ 82001); /* harmony import */ var _getLineSegmentIntersectionsIndexes__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./getLineSegmentIntersectionsIndexes */ 80948); /* harmony import */ var _getLineSegmentIntersectionsCoordinates__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./getLineSegmentIntersectionsCoordinates */ 81611); /* harmony import */ var _getClosestLineSegmentIntersection__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./getClosestLineSegmentIntersection */ 29726); /* harmony import */ var _getSubPixelSpacingAndXYDirections__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./getSubPixelSpacingAndXYDirections */ 33980); /* harmony import */ var _pointsAreWithinCloseContourProximity__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./pointsAreWithinCloseContourProximity */ 62334); /* harmony import */ var _addCanvasPointsToArray__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./addCanvasPointsToArray */ 92687); /* harmony import */ var _pointCanProjectOnLine__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./pointCanProjectOnLine */ 48575); /* harmony import */ var _isPointInsidePolyline3D__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./isPointInsidePolyline3D */ 40236); /* harmony import */ var _projectTo2D__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./projectTo2D */ 78399); /* harmony import */ var _convexHull__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./convexHull */ 90297); /* harmony import */ var _arePolylinesIdentical__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./arePolylinesIdentical */ 9195); /***/ }, /***/ 29040 /*!*************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/intersectPolyline.js ***! \*************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ intersectPolyline) /* harmony export */ }); /* harmony import */ var _getFirstLineSegmentIntersectionIndexes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./getFirstLineSegmentIntersectionIndexes */ 82001); function intersectPolyline(sourcePolyline, targetPolyline) { for (let i = 0, sourceLen = sourcePolyline.length; i < sourceLen; i++) { const sourceP1 = sourcePolyline[i]; const sourceP2Index = i === sourceLen - 1 ? 0 : i + 1; const sourceP2 = sourcePolyline[sourceP2Index]; const intersectionPointIndexes = (0,_getFirstLineSegmentIntersectionIndexes__WEBPACK_IMPORTED_MODULE_0__["default"])(targetPolyline, sourceP1, sourceP2); if (intersectionPointIndexes?.length === 2) { return true; } } return false; } /***/ }, /***/ 32943 /*!**************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/intersectPolylines.js ***! \**************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ intersectPolylines) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 93067); /* harmony import */ var _containsPoint__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./containsPoint */ 23340); /* harmony import */ var _getSignedArea__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./getSignedArea */ 72956); /* harmony import */ var _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./robustSegmentIntersection */ 28054); function intersectPolylines(mainPolyCoords, clipPolyCoordsInput) { if (mainPolyCoords.length < 3 || clipPolyCoordsInput.length < 3) { return []; } let clipPolyCoords = clipPolyCoordsInput.slice(); const mainArea = (0,_getSignedArea__WEBPACK_IMPORTED_MODULE_2__["default"])(mainPolyCoords); const clipArea = (0,_getSignedArea__WEBPACK_IMPORTED_MODULE_2__["default"])(clipPolyCoords); if (Math.abs(mainArea) < _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.EPSILON || Math.abs(clipArea) < _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.EPSILON) { return []; } if (mainArea < 0) { mainPolyCoords = mainPolyCoords.slice().reverse(); } if (clipArea < 0) { clipPolyCoords = clipPolyCoords.slice().reverse(); } const currentClipPolyForPIP = clipPolyCoords; const intersections = []; for (let i = 0; i < mainPolyCoords.length; i++) { const p1 = mainPolyCoords[i]; const p2 = mainPolyCoords[(i + 1) % mainPolyCoords.length]; for (let j = 0; j < clipPolyCoords.length; j++) { const q1 = clipPolyCoords[j]; const q2 = clipPolyCoords[(j + 1) % clipPolyCoords.length]; const intersectPt = (0,_robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.robustSegmentIntersection)(p1, p2, q1, q2); if (intersectPt) { const lenP = Math.sqrt(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.squaredDistance(p1, p2)); const lenQ = Math.sqrt(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.squaredDistance(q1, q2)); intersections.push({ coord: [...intersectPt], seg1Idx: i, seg2Idx: j, alpha1: lenP < _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.EPSILON ? 0 : Math.sqrt(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.squaredDistance(p1, intersectPt)) / lenP, alpha2: lenQ < _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.EPSILON ? 0 : Math.sqrt(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.squaredDistance(q1, intersectPt)) / lenQ }); } } } if (intersections.length === 0) { if ((0,_containsPoint__WEBPACK_IMPORTED_MODULE_1__["default"])(currentClipPolyForPIP, mainPolyCoords[0]) && mainPolyCoords.every(pt => (0,_containsPoint__WEBPACK_IMPORTED_MODULE_1__["default"])(currentClipPolyForPIP, pt))) { return [[...mainPolyCoords.map(p => [...p])]]; } if ((0,_containsPoint__WEBPACK_IMPORTED_MODULE_1__["default"])(mainPolyCoords, clipPolyCoords[0]) && clipPolyCoords.every(pt => (0,_containsPoint__WEBPACK_IMPORTED_MODULE_1__["default"])(mainPolyCoords, pt))) { return [[...clipPolyCoords.map(p => [...p])]]; } return []; } const buildAugmentedList = (polyCoords, polyIndex, allIntersections) => { const augmentedList = []; let nodeIdCounter = 0; for (let i = 0; i < polyCoords.length; i++) { const p1 = polyCoords[i]; augmentedList.push({ id: `${polyIndex}_v${nodeIdCounter++}`, coordinates: [...p1], type: _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.PolylineNodeType.Vertex, originalPolyIndex: polyIndex, originalVertexIndex: i, next: null, prev: null, isIntersection: false, visited: false, processedInPath: false, intersectionDir: _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.IntersectionDirection.Unknown }); const segmentIntersections = allIntersections.filter(isect => (polyIndex === 0 ? isect.seg1Idx : isect.seg2Idx) === i).sort((a, b) => (polyIndex === 0 ? a.alpha1 : a.alpha2) - (polyIndex === 0 ? b.alpha1 : b.alpha2)); for (const isect of segmentIntersections) { if (augmentedList.length > 0 && (0,_robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.pointsAreEqual)(augmentedList[augmentedList.length - 1].coordinates, isect.coord)) { const lastNode = augmentedList[augmentedList.length - 1]; if (!lastNode.isIntersection) { lastNode.isIntersection = true; lastNode.intersectionInfo = isect; lastNode.alpha = polyIndex === 0 ? isect.alpha1 : isect.alpha2; lastNode.type = _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.PolylineNodeType.Intersection; } continue; } augmentedList.push({ id: `${polyIndex}_i${nodeIdCounter++}`, coordinates: [...isect.coord], type: _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.PolylineNodeType.Intersection, originalPolyIndex: polyIndex, next: null, prev: null, isIntersection: true, visited: false, processedInPath: false, alpha: polyIndex === 0 ? isect.alpha1 : isect.alpha2, intersectionInfo: isect, intersectionDir: _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.IntersectionDirection.Unknown }); } } const finalList = []; if (augmentedList.length > 0) { finalList.push(augmentedList[0]); for (let i = 1; i < augmentedList.length; i++) { if (!(0,_robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.pointsAreEqual)(augmentedList[i].coordinates, finalList[finalList.length - 1].coordinates)) { finalList.push(augmentedList[i]); } else { const lastNodeInFinal = finalList[finalList.length - 1]; if (augmentedList[i].isIntersection && augmentedList[i].intersectionInfo) { lastNodeInFinal.isIntersection = true; lastNodeInFinal.intersectionInfo = augmentedList[i].intersectionInfo; lastNodeInFinal.alpha = augmentedList[i].alpha; lastNodeInFinal.type = _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.PolylineNodeType.Intersection; } } } } if (finalList.length > 1 && (0,_robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.pointsAreEqual)(finalList[0].coordinates, finalList[finalList.length - 1].coordinates)) { const firstNode = finalList[0]; const lastNodePopped = finalList.pop(); if (lastNodePopped.isIntersection && !firstNode.isIntersection && lastNodePopped.intersectionInfo) { firstNode.isIntersection = true; firstNode.intersectionInfo = lastNodePopped.intersectionInfo; firstNode.alpha = lastNodePopped.alpha; firstNode.type = _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.PolylineNodeType.Intersection; } } if (finalList.length > 0) { for (let i = 0; i < finalList.length; i++) { finalList[i].next = finalList[(i + 1) % finalList.length]; finalList[i].prev = finalList[(i - 1 + finalList.length) % finalList.length]; } } return finalList; }; const mainAugmented = buildAugmentedList(mainPolyCoords, 0, intersections); const clipAugmented = buildAugmentedList(clipPolyCoords, 1, intersections); if (mainAugmented.length === 0 || clipAugmented.length === 0) { return []; } mainAugmented.forEach(mainNode => { if (mainNode.isIntersection && mainNode.intersectionInfo) { const mainIntersectData = mainNode.intersectionInfo; const partnerNode = clipAugmented.find(clipNode => clipNode.isIntersection && clipNode.intersectionInfo && (0,_robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.pointsAreEqual)(clipNode.coordinates, mainNode.coordinates) && clipNode.intersectionInfo.seg1Idx === mainIntersectData.seg1Idx && clipNode.intersectionInfo.seg2Idx === mainIntersectData.seg2Idx); if (partnerNode) { mainNode.partnerNode = partnerNode; partnerNode.partnerNode = mainNode; const v_arrival_main = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), mainNode.coordinates, mainNode.prev.coordinates); const v_departure_clip = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), partnerNode.next.coordinates, partnerNode.coordinates); const crossZ = v_arrival_main[0] * v_departure_clip[1] - v_arrival_main[1] * v_departure_clip[0]; if (crossZ > _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.EPSILON) { mainNode.intersectionDir = _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.IntersectionDirection.Entering; partnerNode.intersectionDir = _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.IntersectionDirection.Exiting; } else if (crossZ < -_robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.EPSILON) { mainNode.intersectionDir = _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.IntersectionDirection.Exiting; partnerNode.intersectionDir = _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.IntersectionDirection.Entering; } else { const midPrevMainSeg = [(mainNode.prev.coordinates[0] + mainNode.coordinates[0]) / 2, (mainNode.prev.coordinates[1] + mainNode.coordinates[1]) / 2]; if ((0,_containsPoint__WEBPACK_IMPORTED_MODULE_1__["default"])(currentClipPolyForPIP, midPrevMainSeg)) { mainNode.intersectionDir = _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.IntersectionDirection.Exiting; partnerNode.intersectionDir = _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.IntersectionDirection.Entering; } else { mainNode.intersectionDir = _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.IntersectionDirection.Entering; partnerNode.intersectionDir = _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.IntersectionDirection.Exiting; } } } else { mainNode.isIntersection = false; mainNode.intersectionInfo = undefined; } } }); const resultPolygons = []; for (const startCand of mainAugmented) { if (!startCand.isIntersection || startCand.visited || startCand.intersectionDir !== _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.IntersectionDirection.Entering) { continue; } let currentPathCoords = []; let currentNode = startCand; let onMainList = true; const pathStartNode = startCand; let safetyBreak = 0; const maxIter = (mainAugmented.length + clipAugmented.length) * 2; mainAugmented.forEach(n => n.processedInPath = false); clipAugmented.forEach(n => n.processedInPath = false); do { if (safetyBreak++ > maxIter) { console.warn('Intersection: Max iterations in path tracing.', pathStartNode.id, currentNode.id); currentPathCoords = []; break; } if (currentNode.processedInPath && currentNode !== pathStartNode) { console.warn('Intersection: Path processing loop detected, discarding path segment.', pathStartNode.id, currentNode.id); currentPathCoords = []; break; } currentNode.processedInPath = true; currentNode.visited = true; if (currentPathCoords.length === 0 || !(0,_robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.pointsAreEqual)(currentPathCoords[currentPathCoords.length - 1], currentNode.coordinates)) { currentPathCoords.push([...currentNode.coordinates]); } let switchedList = false; if (currentNode.isIntersection && currentNode.partnerNode) { if (onMainList) { currentNode = currentNode.partnerNode; onMainList = false; switchedList = true; } else { currentNode = currentNode.partnerNode; onMainList = true; switchedList = true; } } if (!switchedList) { currentNode = currentNode.next; } else { currentNode = currentNode.next; } } while (currentNode !== pathStartNode || onMainList && currentNode.originalPolyIndex !== 0 || !onMainList && currentNode.originalPolyIndex !== 1); if (safetyBreak > maxIter || currentPathCoords.length === 0) {} else if (currentPathCoords.length > 0 && (0,_robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_3__.pointsAreEqual)(currentPathCoords[0], currentPathCoords[currentPathCoords.length - 1])) { currentPathCoords.pop(); } if (currentPathCoords.length >= 3) { const resultArea = (0,_getSignedArea__WEBPACK_IMPORTED_MODULE_2__["default"])(currentPathCoords); if (mainArea > 0 && resultArea < 0) { currentPathCoords.reverse(); } else if (mainArea < 0 && resultArea > 0) { currentPathCoords.reverse(); } resultPolygons.push(currentPathCoords.map(p => [...p])); } } return resultPolygons; } /***/ }, /***/ 10749 /*!****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/isClosed.js ***! \****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ isClosed) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 27182); /* harmony import */ var _point__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../point */ 10460); function isClosed(polyline) { if (polyline.length < 3) { return false; } const numPolylinePoints = polyline.length; const firstPoint = polyline[0]; const lastPoint = polyline[numPolylinePoints - 1]; const distFirstToLastPoints = (0,_point__WEBPACK_IMPORTED_MODULE_1__["default"])(firstPoint, lastPoint); return gl_matrix__WEBPACK_IMPORTED_MODULE_0__.equals(0, distFirstToLastPoints); } /***/ }, /***/ 40236 /*!*******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/isPointInsidePolyline3D.js ***! \*******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isPointInsidePolyline3D: () => (/* binding */ isPointInsidePolyline3D) /* harmony export */ }); /* harmony import */ var _containsPoint__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./containsPoint */ 23340); /* harmony import */ var _projectTo2D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./projectTo2D */ 78399); function isPointInsidePolyline3D(point, polyline, options = {}) { const { sharedDimensionIndex, projectedPolyline } = (0,_projectTo2D__WEBPACK_IMPORTED_MODULE_1__.projectTo2D)(polyline); const { holes } = options; const projectedHoles = []; if (holes) { for (let i = 0; i < holes.length; i++) { const hole = holes[i]; const hole2D = []; for (let j = 0; j < hole.length; j++) { hole2D.push([hole[j][(sharedDimensionIndex + 1) % 3], hole[j][(sharedDimensionIndex + 2) % 3]]); } projectedHoles.push(hole2D); } } const point2D = [point[(sharedDimensionIndex + 1) % 3], point[(sharedDimensionIndex + 2) % 3]]; return (0,_containsPoint__WEBPACK_IMPORTED_MODULE_0__["default"])(projectedPolyline, point2D, { holes: projectedHoles }); } /***/ }, /***/ 48575 /*!*****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/pointCanProjectOnLine.js ***! \*****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 93067); const pointCanProjectOnLine = (p, p1, p2, proximity) => { const p1p = [p[0] - p1[0], p[1] - p1[1]]; const p1p2 = [p2[0] - p1[0], p2[1] - p1[1]]; const dot = p1p[0] * p1p2[0] + p1p[1] * p1p2[1]; if (dot < 0) { return false; } const p1p2Mag = Math.sqrt(p1p2[0] * p1p2[0] + p1p2[1] * p1p2[1]); if (p1p2Mag === 0) { return false; } const projectionVectorMag = dot / p1p2Mag; const p1p2UnitVector = [p1p2[0] / p1p2Mag, p1p2[1] / p1p2Mag]; const projectionVector = [p1p2UnitVector[0] * projectionVectorMag, p1p2UnitVector[1] * projectionVectorMag]; const projectionPoint = [p1[0] + projectionVector[0], p1[1] + projectionVector[1]]; const distance = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.distance(p, projectionPoint); if (distance > proximity) { return false; } if (gl_matrix__WEBPACK_IMPORTED_MODULE_0__.distance(p1, projectionPoint) > gl_matrix__WEBPACK_IMPORTED_MODULE_0__.distance(p1, p2)) { return false; } return true; }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (pointCanProjectOnLine); /***/ }, /***/ 62334 /*!********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/pointsAreWithinCloseContourProximity.js ***! \********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 93067); const pointsAreWithinCloseContourProximity = (p1, p2, closeContourProximity) => { return gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dist(p1, p2) < closeContourProximity; }; /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (pointsAreWithinCloseContourProximity); /***/ }, /***/ 78399 /*!*******************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/projectTo2D.js ***! \*******************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ projectTo2D: () => (/* binding */ projectTo2D) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 99799); const epsilon = 1e-6; function projectTo2D(polyline) { let sharedDimensionIndex; const testPoints = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getRandomSampleFromArray(polyline, 50); for (let i = 0; i < 3; i++) { if (testPoints.every((point, index, array) => Math.abs(point[i] - array[0][i]) < epsilon)) { sharedDimensionIndex = i; break; } } if (sharedDimensionIndex === undefined) { throw new Error('Cannot find a shared dimension index for polyline, probably oblique plane'); } const points2D = []; const firstDim = (sharedDimensionIndex + 1) % 3; const secondDim = (sharedDimensionIndex + 2) % 3; for (let i = 0; i < polyline.length; i++) { points2D.push([polyline[i][firstDim], polyline[i][secondDim]]); } return { sharedDimensionIndex, projectedPolyline: points2D }; } /***/ }, /***/ 28054 /*!*********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/robustSegmentIntersection.js ***! \*********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ EPSILON: () => (/* binding */ EPSILON), /* harmony export */ IntersectionDirection: () => (/* binding */ IntersectionDirection), /* harmony export */ PolylineNodeType: () => (/* binding */ PolylineNodeType), /* harmony export */ pointsAreEqual: () => (/* binding */ pointsAreEqual), /* harmony export */ robustSegmentIntersection: () => (/* binding */ robustSegmentIntersection), /* harmony export */ vec2CrossZ: () => (/* binding */ vec2CrossZ) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 17137); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! gl-matrix */ 93067); const EPSILON = 1e-7; function vec2CrossZ(a, b) { return a[0] * b[1] - a[1] * b[0]; } function pointsAreEqual(p1, p2) { return _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.isEqual(p1, p2, EPSILON); } function robustSegmentIntersection(p1, p2, q1, q2) { const r = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(), p2, p1); const s = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(), q2, q1); const rxs = vec2CrossZ(r, s); const qmp = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(), q1, p1); const qmpxr = vec2CrossZ(qmp, r); if (Math.abs(rxs) < EPSILON) { if (Math.abs(qmpxr) < EPSILON) { const rDotR = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.dot(r, r); const sDotS = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.dot(s, s); if (rDotR < EPSILON || sDotS < EPSILON) { if (pointsAreEqual(p1, q1) || pointsAreEqual(p1, q2)) { return p1; } if (pointsAreEqual(p2, q1) || pointsAreEqual(p2, q2)) { return p2; } return null; } const t0 = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.dot(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(), q1, p1), r) / rDotR; const t1 = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.dot(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(), q2, p1), r) / rDotR; const u0 = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.dot(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(), p1, q1), s) / sDotS; const u1 = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.dot(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(), p2, q1), s) / sDotS; const isInRange = t => t >= -EPSILON && t <= 1 + EPSILON; if (isInRange(t0)) { const projectedPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.scaleAndAdd(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(), p1, r, t0); if (pointsAreEqual(q1, projectedPoint)) { return q1; } } if (isInRange(t1)) { const projectedPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.scaleAndAdd(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(), p1, r, t1); if (pointsAreEqual(q2, projectedPoint)) { return q2; } } if (isInRange(u0)) { const projectedPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.scaleAndAdd(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(), q1, s, u0); if (pointsAreEqual(p1, projectedPoint)) { return p1; } } if (isInRange(u1)) { const projectedPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_1__.scaleAndAdd(gl_matrix__WEBPACK_IMPORTED_MODULE_1__.create(), q1, s, u1); if (pointsAreEqual(p2, projectedPoint)) { return p2; } } } return null; } const t = vec2CrossZ(qmp, s) / rxs; const u = qmpxr / rxs; if (t >= -EPSILON && t <= 1 + EPSILON && u >= -EPSILON && u <= 1 + EPSILON) { return [p1[0] + t * r[0], p1[1] + t * r[1]]; } return null; } var PolylineNodeType; (function (PolylineNodeType) { PolylineNodeType[PolylineNodeType["Vertex"] = 0] = "Vertex"; PolylineNodeType[PolylineNodeType["Intersection"] = 1] = "Intersection"; })(PolylineNodeType || (PolylineNodeType = {})); var IntersectionDirection; (function (IntersectionDirection) { IntersectionDirection[IntersectionDirection["Entering"] = 0] = "Entering"; IntersectionDirection[IntersectionDirection["Exiting"] = 1] = "Exiting"; IntersectionDirection[IntersectionDirection["Unknown"] = 2] = "Unknown"; })(IntersectionDirection || (IntersectionDirection = {})); /***/ }, /***/ 36136 /*!*************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/polyline/subtractPolylines.js ***! \*************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ subtractPolylines) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 93067); /* harmony import */ var _getSignedArea__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./getSignedArea */ 72956); /* harmony import */ var _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./robustSegmentIntersection */ 28054); /* harmony import */ var _containsPoint__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./containsPoint */ 23340); /* harmony import */ var _arePolylinesIdentical__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./arePolylinesIdentical */ 9195); function subtractPolylines(targetPolylineCoords, sourcePolylineCoordsInput) { if (targetPolylineCoords.length < 3) { return []; } if (sourcePolylineCoordsInput.length < 3) { return [targetPolylineCoords.slice()]; } const sourcePolylineCoords = sourcePolylineCoordsInput.slice(); if ((0,_arePolylinesIdentical__WEBPACK_IMPORTED_MODULE_4__["default"])(targetPolylineCoords, sourcePolylineCoordsInput)) { return []; } const targetArea = (0,_getSignedArea__WEBPACK_IMPORTED_MODULE_1__["default"])(targetPolylineCoords); const sourceArea = (0,_getSignedArea__WEBPACK_IMPORTED_MODULE_1__["default"])(sourcePolylineCoords); if (Math.sign(targetArea) === Math.sign(sourceArea) && Math.abs(sourceArea) > _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_2__.EPSILON) { sourcePolylineCoords.reverse(); } const intersections = []; for (let i = 0; i < targetPolylineCoords.length; i++) { const p1 = targetPolylineCoords[i]; const p2 = targetPolylineCoords[(i + 1) % targetPolylineCoords.length]; for (let j = 0; j < sourcePolylineCoords.length; j++) { const q1 = sourcePolylineCoords[j]; const q2 = sourcePolylineCoords[(j + 1) % sourcePolylineCoords.length]; const intersectPt = (0,_robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_2__.robustSegmentIntersection)(p1, p2, q1, q2); if (intersectPt) { const lenP = Math.sqrt(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.squaredDistance(p1, p2)); const lenQ = Math.sqrt(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.squaredDistance(q1, q2)); intersections.push({ coord: intersectPt, seg1Idx: i, seg2Idx: j, alpha1: lenP < _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_2__.EPSILON ? 0 : Math.sqrt(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.squaredDistance(p1, intersectPt)) / lenP, alpha2: lenQ < _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_2__.EPSILON ? 0 : Math.sqrt(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.squaredDistance(q1, intersectPt)) / lenQ }); } } } const buildAugmentedList = (polyCoords, polyIndex, allIntersections) => { const augmentedList = []; let nodeIdCounter = 0; for (let i = 0; i < polyCoords.length; i++) { const p1 = polyCoords[i]; augmentedList.push({ id: `${polyIndex}_v${nodeIdCounter++}`, coordinates: p1, type: _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_2__.PolylineNodeType.Vertex, originalPolyIndex: polyIndex, originalVertexIndex: i, next: null, prev: null, isIntersection: false, visited: false }); const segmentIntersections = allIntersections.filter(isect => (polyIndex === 0 ? isect.seg1Idx : isect.seg2Idx) === i).sort((a, b) => (polyIndex === 0 ? a.alpha1 : a.alpha2) - (polyIndex === 0 ? b.alpha1 : b.alpha2)); for (const isect of segmentIntersections) { if (augmentedList.length > 0 && (0,_robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_2__.pointsAreEqual)(augmentedList[augmentedList.length - 1].coordinates, isect.coord)) { if (!augmentedList[augmentedList.length - 1].isIntersection) { augmentedList[augmentedList.length - 1].isIntersection = true; augmentedList[augmentedList.length - 1].intersectionInfo = isect; augmentedList[augmentedList.length - 1].alpha = polyIndex === 0 ? isect.alpha1 : isect.alpha2; } continue; } augmentedList.push({ id: `${polyIndex}_i${nodeIdCounter++}`, coordinates: isect.coord, type: _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_2__.PolylineNodeType.Intersection, originalPolyIndex: polyIndex, next: null, prev: null, isIntersection: true, visited: false, alpha: polyIndex === 0 ? isect.alpha1 : isect.alpha2, intersectionInfo: isect }); } } const finalList = []; if (augmentedList.length > 0) { finalList.push(augmentedList[0]); for (let i = 1; i < augmentedList.length; i++) { if (!(0,_robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_2__.pointsAreEqual)(augmentedList[i].coordinates, finalList[finalList.length - 1].coordinates)) { finalList.push(augmentedList[i]); } else { if (augmentedList[i].isIntersection) { finalList[finalList.length - 1].isIntersection = true; finalList[finalList.length - 1].intersectionInfo = augmentedList[i].intersectionInfo; finalList[finalList.length - 1].alpha = augmentedList[i].alpha; } } } } if (finalList.length > 0) { for (let i = 0; i < finalList.length; i++) { finalList[i].next = finalList[(i + 1) % finalList.length]; finalList[i].prev = finalList[(i - 1 + finalList.length) % finalList.length]; } } return finalList; }; const targetAugmented = buildAugmentedList(targetPolylineCoords, 0, intersections); const sourceAugmented = buildAugmentedList(sourcePolylineCoords, 1, intersections); targetAugmented.forEach(tnode => { if (tnode.isIntersection) { const tData = tnode.intersectionInfo; const partner = sourceAugmented.find(snode => snode.isIntersection && (0,_robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_2__.pointsAreEqual)(snode.coordinates, tnode.coordinates) && snode.intersectionInfo.seg1Idx === tData.seg1Idx && snode.intersectionInfo.seg2Idx === tData.seg2Idx); if (partner) { tnode.partnerNode = partner; partner.partnerNode = tnode; const p_prev = tnode.prev.coordinates; const p_curr = tnode.coordinates; const p_next_source = partner.next.coordinates; const v_target_arrival = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), p_curr, p_prev); const v_source_departure = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), p_next_source, p_curr); const midPrevTargetSeg = [(tnode.prev.coordinates[0] + tnode.coordinates[0]) / 2, (tnode.prev.coordinates[1] + tnode.coordinates[1]) / 2]; const prevSegMidpointInsideSource = (0,_containsPoint__WEBPACK_IMPORTED_MODULE_3__["default"])(sourcePolylineCoordsInput, midPrevTargetSeg); if (prevSegMidpointInsideSource) { tnode.intersectionDir = _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_2__.IntersectionDirection.Exiting; } else { tnode.intersectionDir = _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_2__.IntersectionDirection.Entering; } } else { tnode.isIntersection = false; } } }); targetAugmented.forEach(n => delete n.intersectionInfo); sourceAugmented.forEach(n => delete n.intersectionInfo); const resultPolylines = []; for (let i = 0; i < targetAugmented.length; i++) { const startNode = targetAugmented[i]; if (startNode.visited || startNode.isIntersection) { continue; } if ((0,_containsPoint__WEBPACK_IMPORTED_MODULE_3__["default"])(sourcePolylineCoordsInput, startNode.coordinates)) { continue; } const currentPathCoords = []; let currentNode = startNode; let onTargetList = true; let safetyBreak = 0; const maxIter = (targetAugmented.length + sourceAugmented.length) * 2; do { if (safetyBreak++ > maxIter) { console.warn('Subtraction: Max iterations reached, possible infinite loop.'); break; } currentNode.visited = true; if (currentPathCoords.length === 0 || !(0,_robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_2__.pointsAreEqual)(currentPathCoords[currentPathCoords.length - 1], currentNode.coordinates)) { currentPathCoords.push(currentNode.coordinates); } if (currentNode.isIntersection) { if (onTargetList) { if (currentNode.intersectionDir === _robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_2__.IntersectionDirection.Entering && currentNode.partnerNode) { currentNode = currentNode.partnerNode; onTargetList = false; } } else { if (currentNode.partnerNode) { currentNode = currentNode.partnerNode; onTargetList = true; } else { console.warn('Subtraction: Intersection on source without partner.'); } } } currentNode = currentNode.next; } while (currentNode !== startNode || !onTargetList); if (currentPathCoords.length >= 3) { if ((0,_robustSegmentIntersection__WEBPACK_IMPORTED_MODULE_2__.pointsAreEqual)(currentPathCoords[0], currentPathCoords[currentPathCoords.length - 1])) { currentPathCoords.pop(); } if (currentPathCoords.length >= 3) { resultPolylines.push(currentPathCoords); } } } return resultPolylines; } /***/ }, /***/ 84797 /*!********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/math/vec2/findClosestPoint.js ***! \********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ findClosestPoint) /* harmony export */ }); function findClosestPoint(sourcePoints, targetPoint) { let minPoint = [0, 0]; let minDistance = Number.MAX_SAFE_INTEGER; sourcePoints.forEach(function (sourcePoint) { const distance = _distanceBetween(targetPoint, sourcePoint); if (distance < minDistance) { minDistance = distance; minPoint = [...sourcePoint]; } }); return minPoint; } function _distanceBetween(p1, p2) { const [x1, y1] = p1; const [x2, y2] = p2; return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2)); } /***/ }, /***/ 77337 /*!****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/planar/filterAnnotationsForDisplay.js ***! \****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ filterAnnotationsForDisplay) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 93667); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 67461); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 85493); /* harmony import */ var _filterAnnotationsWithinSlice__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./filterAnnotationsWithinSlice */ 93487); function filterAnnotationsForDisplay(viewport, annotations, filterOptions = {}) { if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"]) { const camera = viewport.getCamera(); const { spacingInNormalDirection } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"](viewport, camera); return (0,_filterAnnotationsWithinSlice__WEBPACK_IMPORTED_MODULE_3__["default"])(annotations, camera, spacingInNormalDirection); } if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"]) { const imageId = viewport.getCurrentImageId(); if (!imageId) { return []; } const colonIndex = imageId.indexOf(':'); filterOptions.imageURI = imageId.substring(colonIndex + 1); } return annotations.filter(annotation => { if (!annotation.isVisible) { return false; } if (annotation.data.isCanvasAnnotation) { return true; } return viewport.isReferenceViewable(annotation.metadata, filterOptions); }); } /***/ }, /***/ 93487 /*!*****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/planar/filterAnnotationsWithinSlice.js ***! \*****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ filterAnnotationsWithinSlice) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 87396); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 78220); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 90161); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/core */ 80853); const { isEqual } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__; const { EPSILON } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__; const PARALLEL_THRESHOLD = 1 - EPSILON; function filterAnnotationsWithinSlice(annotations, camera, spacingInNormalDirection) { const { viewPlaneNormal } = camera; const annotationsWithParallelNormals = annotations.filter(td => { const { planeRestriction, referencedImageId } = td.metadata; let { viewPlaneNormal: annotationViewPlaneNormal } = td.metadata; if (planeRestriction) { const { inPlaneVector1, inPlaneVector2 } = planeRestriction; if (inPlaneVector1 && !isEqual(0, gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(viewPlaneNormal, inPlaneVector1))) { return false; } if (inPlaneVector2 && !isEqual(0, gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(viewPlaneNormal, inPlaneVector2))) { return false; } return true; } if (!td.metadata.referencedImageId && !annotationViewPlaneNormal && td.metadata.FrameOfReferenceUID) { for (const point of td.data.handles.points) { const vector = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.sub(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), point, camera.focalPoint); const dotProduct = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(vector, viewPlaneNormal); if (!isEqual(dotProduct, 0)) { return false; } } td.metadata.viewPlaneNormal = viewPlaneNormal; td.metadata.cameraFocalPoint = camera.focalPoint; return true; } if (!annotationViewPlaneNormal && referencedImageId) { const { imageOrientationPatient } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__.get('imagePlaneModule', referencedImageId); const rowCosineVec = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.fromValues(imageOrientationPatient[0], imageOrientationPatient[1], imageOrientationPatient[2]); const colCosineVec = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.fromValues(imageOrientationPatient[3], imageOrientationPatient[4], imageOrientationPatient[5]); annotationViewPlaneNormal = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(); gl_matrix__WEBPACK_IMPORTED_MODULE_0__.cross(annotationViewPlaneNormal, rowCosineVec, colCosineVec); td.metadata.viewPlaneNormal = annotationViewPlaneNormal; } const isParallel = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(viewPlaneNormal, annotationViewPlaneNormal)) > PARALLEL_THRESHOLD; return annotationViewPlaneNormal && isParallel; }); if (!annotationsWithParallelNormals.length) { return []; } const halfSpacingInNormalDirection = spacingInNormalDirection / 2; const { focalPoint } = camera; const annotationsWithinSlice = []; for (const annotation of annotationsWithParallelNormals) { const { data, metadata, isVisible } = annotation; if (!isVisible) { continue; } const point = metadata.planeRestriction?.point || data.handles?.points?.[0] || data.contour?.polyline[0]; if (!point) { annotationsWithinSlice.push(annotation); continue; } const dir = gl_matrix__WEBPACK_IMPORTED_MODULE_0__.sub(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.create(), focalPoint, point); const dot = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(dir, viewPlaneNormal)); if (dot < halfSpacingInNormalDirection) { annotationsWithinSlice.push(annotation); } } return annotationsWithinSlice; } /***/ }, /***/ 65062 /*!************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/planarFreehandROITool/interpolation/algorithms/bspline.js ***! \************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ interpolatePoints: () => (/* binding */ interpolatePoints) /* harmony export */ }); /* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-interpolate */ 60067); /* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-interpolate */ 21850); /* harmony import */ var d3_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! d3-array */ 87368); function isPoints3D(points) { return points[0]?.length === 3; } function interpolatePoints(originalPoints, knotsIndexes) { if (!knotsIndexes || knotsIndexes.length === 0 || knotsIndexes.length === originalPoints.length) { return originalPoints; } const n = knotsIndexes[knotsIndexes.length - 1] - knotsIndexes[0] + 1; const xInterpolator = (0,d3_interpolate__WEBPACK_IMPORTED_MODULE_0__["default"])(knotsIndexes.map(k => originalPoints[k][0])); const yInterpolator = (0,d3_interpolate__WEBPACK_IMPORTED_MODULE_0__["default"])(knotsIndexes.map(k => originalPoints[k][1])); if (isPoints3D(originalPoints)) { const zInterpolator = (0,d3_interpolate__WEBPACK_IMPORTED_MODULE_0__["default"])(knotsIndexes.map(k => originalPoints[k][2])); return (0,d3_array__WEBPACK_IMPORTED_MODULE_2__["default"])((0,d3_interpolate__WEBPACK_IMPORTED_MODULE_1__["default"])(xInterpolator, n), (0,d3_interpolate__WEBPACK_IMPORTED_MODULE_1__["default"])(yInterpolator, n), (0,d3_interpolate__WEBPACK_IMPORTED_MODULE_1__["default"])(zInterpolator, n)); } else { return (0,d3_array__WEBPACK_IMPORTED_MODULE_2__["default"])((0,d3_interpolate__WEBPACK_IMPORTED_MODULE_1__["default"])(xInterpolator, n), (0,d3_interpolate__WEBPACK_IMPORTED_MODULE_1__["default"])(yInterpolator, n)); } } /***/ }, /***/ 73551 /*!******************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/planarFreehandROITool/interpolation/interpolateSegmentPoints.js ***! \******************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ interpolateSegmentPoints) /* harmony export */ }); /* harmony import */ var _algorithms_bspline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./algorithms/bspline */ 65062); function getContinuousUniformDistributionValues(minDistributionDistance, closedInterval) { const result = []; const [intervalIni, intervalEnd] = closedInterval; const intervalSize = intervalEnd - intervalIni + 1; const intensity = Math.floor(intervalSize / minDistributionDistance); let x = 0; let continuosDistributionValue = Math.round((intervalSize - 1) / (intensity - 1) * x) + intervalIni; while (continuosDistributionValue <= intervalEnd) { result.push(continuosDistributionValue); x++; continuosDistributionValue = Math.round((intervalSize - 1) / (intensity - 1) * x) + intervalIni; } return result; } function interpolateSegmentPoints(points, iniIndex, endIndex, knotsRatioPercentage) { const segmentSize = endIndex - iniIndex + 1; const amountOfKnots = Math.floor(knotsRatioPercentage / 100 * segmentSize) ?? 1; const minKnotDistance = Math.floor(segmentSize / amountOfKnots) ?? 1; if (isNaN(segmentSize) || !segmentSize || !minKnotDistance) { return points; } if (segmentSize / minKnotDistance < 2) { return points; } const interpolationIniIndex = Math.max(0, iniIndex); const interpolationEndIndex = Math.min(points.length - 1, endIndex); const segmentPointsUnchangedBeg = points.slice(0, interpolationIniIndex); const segmentPointsUnchangedEnd = points.slice(interpolationEndIndex + 1, points.length); const knotsIndexes = getContinuousUniformDistributionValues(minKnotDistance, [interpolationIniIndex, interpolationEndIndex]); const interpolatedPoints = (0,_algorithms_bspline__WEBPACK_IMPORTED_MODULE_0__.interpolatePoints)(points, knotsIndexes); return [...segmentPointsUnchangedBeg, ...interpolatedPoints, ...segmentPointsUnchangedEnd]; } /***/ }, /***/ 3638 /*!****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/planarFreehandROITool/smoothPoints.js ***! \****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getInterpolatedPoints: () => (/* binding */ getInterpolatedPoints), /* harmony export */ shouldSmooth: () => (/* binding */ shouldSmooth) /* harmony export */ }); /* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../math */ 69125); /* harmony import */ var _interpolation_interpolateSegmentPoints__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./interpolation/interpolateSegmentPoints */ 73551); function shouldSmooth(configuration, annotation) { if (annotation?.autoGenerated) { return false; } const shouldSmooth = configuration?.smoothing?.smoothOnAdd === true || configuration?.smoothing?.smoothOnEdit === true; return shouldSmooth; } function isEqualByProximity(pointA, pointB) { return _math__WEBPACK_IMPORTED_MODULE_0__["default"](pointA, pointB) < 0.001; } function isEqual(pointA, pointB) { return _math__WEBPACK_IMPORTED_MODULE_0__["default"](pointA, pointB) === 0; } function findMatchIndexes(points, otherPoints) { for (let i = 0; i < points.length; i++) { for (let j = 0; j < otherPoints.length; j++) { if (isEqual(points[i], otherPoints[j])) { return [i, j]; } } } } function followingIndex(index, size, direction) { return (index + size + direction) % size; } function circularFindNextIndexBy(listParams, otherListParams, criteria, direction) { const [, indexDelimiter, points] = listParams; const [, otherIndexDelimiter, otherPoints] = otherListParams; const pointsLength = points.length; const otherPointsLength = otherPoints.length; let startIndex = listParams[0]; let otherStartIndex = otherListParams[0]; if (!points[startIndex] || !otherPoints[otherStartIndex] || !points[indexDelimiter] || !otherPoints[otherIndexDelimiter]) { return [undefined, undefined]; } while (startIndex !== indexDelimiter && otherStartIndex !== otherIndexDelimiter) { if (criteria(otherPoints[otherStartIndex], points[startIndex])) { return [startIndex, otherStartIndex]; } startIndex = followingIndex(startIndex, pointsLength, direction); otherStartIndex = followingIndex(otherStartIndex, otherPointsLength, direction); } return [undefined, undefined]; } function findChangedSegment(points, previousPoints) { const [firstMatchIndex, previousFirstMatchIndex] = findMatchIndexes(points, previousPoints) || []; const toBeNotEqualCriteria = (pointA, pointB) => isEqualByProximity(pointA, pointB) === false; const [lowDiffIndex, lowOtherDiffIndex] = circularFindNextIndexBy([followingIndex(firstMatchIndex, points.length, 1), firstMatchIndex, points], [followingIndex(previousFirstMatchIndex, previousPoints.length, 1), previousFirstMatchIndex, previousPoints], toBeNotEqualCriteria, 1); const [highIndex] = circularFindNextIndexBy([followingIndex(lowDiffIndex, points.length, -1), lowDiffIndex, points], [followingIndex(lowOtherDiffIndex, previousPoints.length, -1), lowOtherDiffIndex, previousPoints], toBeNotEqualCriteria, -1); return [lowDiffIndex, highIndex]; } function getInterpolatedPoints(configuration, points, pointsOfReference) { const { interpolation, smoothing } = configuration; const result = points; if (interpolation) { const { knotsRatioPercentageOnAdd, knotsRatioPercentageOnEdit, smoothOnAdd = false, smoothOnEdit = false } = smoothing; const knotsRatioPercentage = pointsOfReference ? knotsRatioPercentageOnEdit : knotsRatioPercentageOnAdd; const isEnabled = pointsOfReference ? smoothOnEdit : smoothOnAdd; if (isEnabled) { const [changedIniIndex, changedEndIndex] = pointsOfReference ? findChangedSegment(points, pointsOfReference) : [0, points.length - 1]; if (!points[changedIniIndex] || !points[changedEndIndex]) { return points; } return (0,_interpolation_interpolateSegmentPoints__WEBPACK_IMPORTED_MODULE_1__["default"])(points, changedIniIndex, changedEndIndex, knotsRatioPercentage); } } return result; } /***/ }, /***/ 51122 /*!*************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/safeStructuredClone.js ***! \*************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ safeStructuredClone: () => (/* binding */ safeStructuredClone) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 80853); const { PointsManager } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__; function cloneContourValue(_key, value) { if (value == null || typeof value !== 'object' || !('polyline' in value)) { return value; } const contour = value; return { ...contour, polyline: null, pointsManager: PointsManager.create3(contour.polyline.length, contour.polyline) }; } const OMIT_KEYS = new Map([['pointsInVolume', null], ['projectionPoints', null], ['contour', cloneContourValue], ['spline', null]]); function omitUncloneableKeys(obj) { const result = {}; for (const [key, value] of Object.entries(obj)) { if (OMIT_KEYS.has(key)) { const handler = OMIT_KEYS.get(key); if (handler) { result[key] = handler(key, value); } continue; } if (value === null || value === undefined || typeof value !== 'object') { result[key] = value; } else if (Array.isArray(value)) { result[key] = value.map(value => safeStructuredClone(value)); } else { result[key] = omitUncloneableKeys(value); } } return result; } function safeStructuredClone(value) { if (value === null || value === undefined) { return value; } if (typeof value !== 'object') { return value; } if (Array.isArray(value)) { return value.map(item => safeStructuredClone(item)); } return omitUncloneableKeys(value); } /***/ }, /***/ 6259 /*!************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/segmentation/InterpolationManager/InterpolationManager.js ***! \************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ InterpolationManager) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 80853); /* harmony import */ var _stateManagement_annotation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../stateManagement/annotation */ 38829); /* harmony import */ var _contours_interpolation_getInterpolationDataCollection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../contours/interpolation/getInterpolationDataCollection */ 63968); /* harmony import */ var _contours_interpolation_interpolate__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../contours/interpolation/interpolate */ 33995); /* harmony import */ var _deleteRelatedAnnotations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./deleteRelatedAnnotations */ 94618); /* harmony import */ var _enums_ChangeTypes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../enums/ChangeTypes */ 46190); /* harmony import */ var _getViewportForAnnotation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../getViewportForAnnotation */ 29549); /* harmony import */ var _contourSegmentation_addContourSegmentationAnnotation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../contourSegmentation/addContourSegmentationAnnotation */ 420); const { uuidv4 } = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__; const ChangeTypesForInterpolation = [_enums_ChangeTypes__WEBPACK_IMPORTED_MODULE_5__["default"].HandlesUpdated, _enums_ChangeTypes__WEBPACK_IMPORTED_MODULE_5__["default"].InterpolationUpdated]; class InterpolationManager { static { this.toolNames = []; } static addTool(toolName) { if (!this.toolNames.includes(toolName)) { this.toolNames.push(toolName); } } static removeTool(toolName) { if (this.toolNames.includes(toolName)) { this.toolNames = this.toolNames.filter(name => name !== toolName); } } static acceptAutoGenerated(annotationGroupSelector, selector = {}) { const { toolNames, segmentationId, segmentIndex, sliceIndex } = selector; for (const toolName of toolNames || InterpolationManager.toolNames) { const annotations = _stateManagement_annotation__WEBPACK_IMPORTED_MODULE_1__.state.getAnnotations(toolName, annotationGroupSelector); if (!annotations?.length) { continue; } for (const annotation of annotations) { const { interpolationUID, data, autoGenerated, metadata } = annotation; if (interpolationUID) { annotation.interpolationCompleted = true; } if (!autoGenerated) { continue; } if (segmentIndex && segmentIndex !== data.segmentation.segmentIndex) { continue; } if (sliceIndex !== undefined && metadata && sliceIndex !== metadata.sliceIndex) { continue; } if (segmentationId && segmentationId !== data.segmentation.segmentationId) { continue; } (0,_contourSegmentation_addContourSegmentationAnnotation__WEBPACK_IMPORTED_MODULE_7__.addContourSegmentationAnnotation)(annotation); annotation.autoGenerated = false; } } } static { this.handleAnnotationCompleted = evt => { const annotation = evt.detail.annotation; if (!annotation?.metadata) { return; } const { toolName, originalToolName } = annotation.metadata; if (!this.toolNames.includes(toolName) && !this.toolNames.includes(originalToolName)) { return; } const viewport = (0,_getViewportForAnnotation__WEBPACK_IMPORTED_MODULE_6__["default"])(annotation); if (!viewport) { console.warn('Unable to find viewport for', annotation); return; } const sliceData = getSliceData(viewport); const viewportData = { viewport, sliceData, annotation, interpolationUID: annotation.interpolationUID }; const hasInterpolationUID = !!annotation.interpolationUID; annotation.autoGenerated = false; if (hasInterpolationUID) { (0,_deleteRelatedAnnotations__WEBPACK_IMPORTED_MODULE_4__["default"])(viewportData); (0,_contours_interpolation_interpolate__WEBPACK_IMPORTED_MODULE_3__["default"])(viewportData); return; } const filterData = [{ key: 'segmentIndex', value: annotation.data.segmentation.segmentIndex, parentKey: annotation => annotation.data.segmentation }, { key: 'viewPlaneNormal', value: annotation.metadata.viewPlaneNormal, parentKey: annotation => annotation.metadata }, { key: 'viewUp', value: annotation.metadata.viewUp, parentKey: annotation => annotation.metadata }]; let interpolationAnnotations = (0,_contours_interpolation_getInterpolationDataCollection__WEBPACK_IMPORTED_MODULE_2__["default"])(viewportData, filterData); const { sliceIndex } = annotation.metadata; const skipUIDs = new Set(); interpolationAnnotations.forEach(interpolationAnnotation => { if (interpolationAnnotation.interpolationCompleted || interpolationAnnotation.metadata.sliceIndex === sliceIndex) { const { interpolationUID } = interpolationAnnotation; skipUIDs.add(interpolationUID); } }); interpolationAnnotations = interpolationAnnotations.filter(interpolationAnnotation => !skipUIDs.has(interpolationAnnotation.interpolationUID)); annotation.interpolationUID = interpolationAnnotations[0]?.interpolationUID || uuidv4(); viewportData.interpolationUID = annotation.interpolationUID; (0,_contours_interpolation_interpolate__WEBPACK_IMPORTED_MODULE_3__["default"])(viewportData); }; } static { this.handleAnnotationUpdate = evt => { const annotation = evt.detail.annotation; const { changeType = _enums_ChangeTypes__WEBPACK_IMPORTED_MODULE_5__["default"].HandlesUpdated } = evt.detail; if (!annotation?.metadata) { return; } const { toolName, originalToolName } = annotation.metadata; if (!this.toolNames.includes(toolName) && !this.toolNames.includes(originalToolName) || !ChangeTypesForInterpolation.includes(changeType)) { return; } const viewport = (0,_getViewportForAnnotation__WEBPACK_IMPORTED_MODULE_6__["default"])(annotation); if (!viewport) { console.warn('Unable to find matching viewport for annotation interpolation', annotation); return; } if (annotation.autoGenerated) { (0,_contourSegmentation_addContourSegmentationAnnotation__WEBPACK_IMPORTED_MODULE_7__.addContourSegmentationAnnotation)(annotation); annotation.autoGenerated = false; } const sliceData = getSliceData(viewport); const viewportData = { viewport, sliceData, annotation, interpolationUID: annotation.interpolationUID, isInterpolationUpdate: changeType === _enums_ChangeTypes__WEBPACK_IMPORTED_MODULE_5__["default"].InterpolationUpdated }; (0,_contours_interpolation_interpolate__WEBPACK_IMPORTED_MODULE_3__["default"])(viewportData); }; } static { this.handleAnnotationDelete = evt => { const annotation = evt.detail.annotation; if (!annotation?.metadata) { return; } const { toolName } = annotation.metadata; if (!this.toolNames.includes(toolName) || annotation.autoGenerated) { return; } const viewport = (0,_getViewportForAnnotation__WEBPACK_IMPORTED_MODULE_6__["default"])(annotation); if (!viewport) { console.warn("No viewport, can't delete interpolated results", annotation); return; } const sliceData = getSliceData(viewport); const viewportData = { viewport, sliceData, annotation, interpolationUID: annotation.interpolationUID }; annotation.autoGenerated = false; (0,_deleteRelatedAnnotations__WEBPACK_IMPORTED_MODULE_4__["default"])(viewportData); }; } } function getSliceData(viewport) { const sliceData = { numberOfSlices: viewport.getNumberOfSlices(), imageIndex: viewport.getCurrentImageIdIndex() }; return sliceData; } /***/ }, /***/ 94618 /*!****************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/segmentation/InterpolationManager/deleteRelatedAnnotations.js ***! \****************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ deleteRelatedAnnotations) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 91133); /* harmony import */ var _stateManagement_annotation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../stateManagement/annotation */ 38829); /* harmony import */ var _contours_interpolation_interpolate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../contours/interpolation/interpolate */ 33995); /* harmony import */ var _contours_interpolation_getInterpolationData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../contours/interpolation/getInterpolationData */ 24384); /* harmony import */ var _enums_Events__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../enums/Events */ 54870); function deleteRelatedAnnotations(viewportData) { const { annotation } = viewportData; const interpolationAnnotations = (0,_contours_interpolation_getInterpolationData__WEBPACK_IMPORTED_MODULE_3__["default"])(viewportData, [{ key: 'interpolationUID', value: viewportData.interpolationUID }]); const referencedSliceIndex = annotation.metadata.sliceIndex; let minInterpolation = -1; let maxInterpolation = viewportData.sliceData.numberOfSlices; for (const [sliceIndex, annotations] of interpolationAnnotations.entries()) { if (sliceIndex === referencedSliceIndex) { continue; } const nonInterpolated = annotations.find(annotation => !annotation.autoGenerated); if (!nonInterpolated) { continue; } if (sliceIndex < referencedSliceIndex) { minInterpolation = Math.max(sliceIndex, minInterpolation); } else { maxInterpolation = Math.min(sliceIndex, maxInterpolation); } } const removedAnnotations = []; for (const [sliceIndex, annotations] of interpolationAnnotations.entries()) { if (sliceIndex <= minInterpolation || sliceIndex >= maxInterpolation || sliceIndex === referencedSliceIndex) { continue; } annotations.forEach(annotationToDelete => { if (annotationToDelete.autoGenerated) { _stateManagement_annotation__WEBPACK_IMPORTED_MODULE_1__.state.removeAnnotation(annotationToDelete.annotationUID); removedAnnotations.push(annotationToDelete); } }); } if (removedAnnotations.length) { const eventDetails = { annotations: removedAnnotations, element: viewportData.viewport.element, viewportId: viewportData.viewport.id, renderingEngineId: viewportData.viewport.getRenderingEngine().id }; (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(viewportData.viewport.element, _enums_Events__WEBPACK_IMPORTED_MODULE_4__["default"].INTERPOLATED_ANNOTATIONS_REMOVED, eventDetails); } if (minInterpolation >= 0 && maxInterpolation < viewportData.sliceData.numberOfSlices) { const nextAnnotation = interpolationAnnotations.get(maxInterpolation)[0]; const viewportNewData = { viewport: viewportData.viewport, sliceData: { numberOfSlices: viewportData.sliceData.numberOfSlices, imageIndex: nextAnnotation.metadata.sliceIndex }, annotation: nextAnnotation, interpolationUID: nextAnnotation.interpolationUID }; (0,_contours_interpolation_interpolate__WEBPACK_IMPORTED_MODULE_2__["default"])(viewportNewData); } } /***/ }, /***/ 25820 /*!**********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/segmentation/computeAndAddRepresentation.js ***! \**********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ computeAndAddRepresentation: () => (/* binding */ computeAndAddRepresentation) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _stateManagement_segmentation_internalAddRepresentationData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../stateManagement/segmentation/internalAddRepresentationData */ 23807); function computeAndAddRepresentation(_x, _x2, _x3, _x4) { return _computeAndAddRepresentation.apply(this, arguments); } function _computeAndAddRepresentation() { _computeAndAddRepresentation = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (segmentationId, type, computeFunction, onComputationComplete) { const data = yield computeFunction(); (0,_stateManagement_segmentation_internalAddRepresentationData__WEBPACK_IMPORTED_MODULE_1__["default"])({ segmentationId, type, data }); onComputationComplete?.(); return data; }); return _computeAndAddRepresentation.apply(this, arguments); } /***/ }, /***/ 88852 /*!****************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/segmentation/getSVGStyleForSegment.js ***! \****************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getSVGStyleForSegment: () => (/* binding */ getSVGStyleForSegment) /* harmony export */ }); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../enums */ 85543); /* harmony import */ var _stateManagement_segmentation_config_segmentationColor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../stateManagement/segmentation/config/segmentationColor */ 87024); /* harmony import */ var _stateManagement_segmentation_getActiveSegmentation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../stateManagement/segmentation/getActiveSegmentation */ 4290); /* harmony import */ var _stateManagement_segmentation_getActiveSegmentIndex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../stateManagement/segmentation/getActiveSegmentIndex */ 9943); /* harmony import */ var _stateManagement_segmentation_getSegmentationRepresentationVisibility__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../stateManagement/segmentation/getSegmentationRepresentationVisibility */ 88169); /* harmony import */ var _stateManagement_segmentation_helpers_internalGetHiddenSegmentIndices__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../stateManagement/segmentation/helpers/internalGetHiddenSegmentIndices */ 8881); /* harmony import */ var _stateManagement_segmentation_SegmentationStyle__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../stateManagement/segmentation/SegmentationStyle */ 21257); function getSVGStyleForSegment({ segmentationId, segmentIndex, viewportId, autoGenerated = false }) { const segmentColor = (0,_stateManagement_segmentation_config_segmentationColor__WEBPACK_IMPORTED_MODULE_1__.getSegmentIndexColor)(viewportId, segmentationId, segmentIndex); const segmentationVisible = (0,_stateManagement_segmentation_getSegmentationRepresentationVisibility__WEBPACK_IMPORTED_MODULE_4__.getSegmentationRepresentationVisibility)(viewportId, { segmentationId, type: _enums__WEBPACK_IMPORTED_MODULE_0__["default"].Contour }); const activeSegmentation = (0,_stateManagement_segmentation_getActiveSegmentation__WEBPACK_IMPORTED_MODULE_2__.getActiveSegmentation)(viewportId); const isActive = activeSegmentation?.segmentationId === segmentationId; const inactiveSegmentationVisibility = _stateManagement_segmentation_SegmentationStyle__WEBPACK_IMPORTED_MODULE_6__.segmentationStyle.getRenderInactiveSegmentations(viewportId); const style = _stateManagement_segmentation_SegmentationStyle__WEBPACK_IMPORTED_MODULE_6__.segmentationStyle.getStyle({ viewportId, segmentationId, type: _enums__WEBPACK_IMPORTED_MODULE_0__["default"].Contour, segmentIndex }); const mergedConfig = style; let lineWidth = 1; let lineDash = undefined; let lineOpacity = 1; let fillOpacity = 0; let renderFill = mergedConfig.renderFill ?? true; let renderOutline = mergedConfig.renderOutline ?? true; if (autoGenerated) { lineWidth = mergedConfig.outlineWidthAutoGenerated ?? lineWidth; lineDash = mergedConfig.outlineDashAutoGenerated ?? lineDash; lineOpacity = mergedConfig.outlineOpacity ?? lineOpacity; fillOpacity = mergedConfig.fillAlphaAutoGenerated ?? fillOpacity; } else if (isActive) { lineWidth = mergedConfig.outlineWidth ?? lineWidth; lineDash = mergedConfig.outlineDash ?? lineDash; lineOpacity = mergedConfig.outlineOpacity ?? lineOpacity; fillOpacity = mergedConfig.fillAlpha ?? fillOpacity; } else { lineWidth = mergedConfig.outlineWidthInactive ?? lineWidth; lineDash = mergedConfig.outlineDashInactive ?? lineDash; lineOpacity = mergedConfig.outlineOpacityInactive ?? lineOpacity; fillOpacity = mergedConfig.fillAlphaInactive ?? fillOpacity; renderFill = mergedConfig.renderFillInactive ?? renderFill; renderOutline = mergedConfig.renderOutlineInactive ?? renderOutline; } if ((0,_stateManagement_segmentation_getActiveSegmentIndex__WEBPACK_IMPORTED_MODULE_3__.getActiveSegmentIndex)(segmentationId) === segmentIndex) { lineWidth += mergedConfig.activeSegmentOutlineWidthDelta; } lineWidth = renderOutline ? lineWidth : 0; fillOpacity = renderFill ? fillOpacity : 0; const color = `rgba(${segmentColor[0]}, ${segmentColor[1]}, ${segmentColor[2]}, ${lineOpacity})`; const fillColor = `rgb(${segmentColor[0]}, ${segmentColor[1]}, ${segmentColor[2]})`; const hiddenSegments = (0,_stateManagement_segmentation_helpers_internalGetHiddenSegmentIndices__WEBPACK_IMPORTED_MODULE_5__.internalGetHiddenSegmentIndices)(viewportId, { segmentationId, type: _enums__WEBPACK_IMPORTED_MODULE_0__["default"].Contour }); const isVisible = !hiddenSegments.has(segmentIndex); return { color, fillColor, lineWidth, fillOpacity, lineDash, textbox: { color }, visibility: isActive ? segmentationVisible && isVisible : inactiveSegmentationVisibility }; } /***/ }, /***/ 62481 /*!******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/segmentation/getUniqueSegmentIndices.js ***! \******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getUniqueSegmentIndices: () => (/* binding */ getUniqueSegmentIndices) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 38277); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../enums */ 85543); /* harmony import */ var _utilities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utilities */ 65048); /* harmony import */ var _stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../stateManagement/segmentation/getSegmentation */ 42952); function getUniqueSegmentIndices(segmentationId) { const cachedResult = (0,_utilities__WEBPACK_IMPORTED_MODULE_2__.getCachedSegmentIndices)(segmentationId); if (cachedResult) { return cachedResult; } const segmentation = (0,_stateManagement_segmentation_getSegmentation__WEBPACK_IMPORTED_MODULE_3__.getSegmentation)(segmentationId); if (!segmentation) { throw new Error(`No segmentation found for segmentationId ${segmentationId}`); } let indices; if (segmentation.representationData.Labelmap) { indices = handleLabelmapSegmentation(segmentation, segmentationId); } else if (segmentation.representationData.Contour) { indices = handleContourSegmentation(segmentation); } else if (segmentation.representationData.Surface) { indices = handleSurfaceSegmentation(segmentation); } else { throw new Error(`Unsupported segmentation type: ${segmentation.representationData}`); } (0,_utilities__WEBPACK_IMPORTED_MODULE_2__.setCachedSegmentIndices)(segmentationId, indices); return indices; } function handleLabelmapSegmentation(segmentation, segmentationId) { const labelmapData = segmentation.representationData[_enums__WEBPACK_IMPORTED_MODULE_1__["default"].Labelmap]; const keySet = new Set(); if (labelmapData.imageIds) { addImageSegmentIndices(keySet, labelmapData.imageIds); } else { addVolumeSegmentIndices(keySet, segmentationId); } return Array.from(keySet).map(Number).sort((a, b) => a - b); } function addVolumeSegmentIndices(keySet, segmentationId) { const volume = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].getVolume(segmentationId); volume.voxelManager.forEach(({ value }) => { if (value !== 0) { keySet.add(value); } }); } function addImageSegmentIndices(keySet, imageIds) { imageIds.forEach(segmentationImageId => { const image = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].getImage(segmentationImageId); const scalarData = image.voxelManager.getScalarData(); scalarData.forEach(segmentIndex => { if (segmentIndex !== 0) { keySet.add(segmentIndex); } }); }); } function handleContourSegmentation(segmentation) { const { annotationUIDsMap, geometryIds } = segmentation.representationData.Contour || {}; if (!geometryIds) { throw new Error(`No geometryIds found for segmentationId ${segmentation.segmentationId}`); } const indices = new Set([...annotationUIDsMap.keys()]); geometryIds.forEach(geometryId => { const geometry = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"].getGeometry(geometryId); indices.add(geometry.data.segmentIndex); }); return Array.from(indices).sort((a, b) => a - b); } function handleSurfaceSegmentation(segmentation) { const geometryIds = segmentation.representationData.Surface?.geometryIds ?? []; return Array.from(geometryIds.keys()).map(Number).sort((a, b) => a - b); } /***/ }, /***/ 65048 /*!****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/segmentation/utilities.js ***! \****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getCachedSegmentIndices: () => (/* binding */ getCachedSegmentIndices), /* harmony export */ getVoxelOverlap: () => (/* binding */ getVoxelOverlap), /* harmony export */ processVolumes: () => (/* binding */ processVolumes), /* harmony export */ setCachedSegmentIndices: () => (/* binding */ setCachedSegmentIndices), /* harmony export */ setSegmentationClean: () => (/* binding */ setSegmentationClean), /* harmony export */ setSegmentationDirty: () => (/* binding */ setSegmentationDirty) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 19598); /* harmony import */ var _boundingBox_getBoundingBoxAroundShape__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../boundingBox/getBoundingBoxAroundShape */ 35602); const equalsCheck = (a, b) => { return JSON.stringify(a) === JSON.stringify(b); }; function getVoxelOverlap(imageData, dimensions, voxelSpacing, voxelCenter) { const halfSpacingX = voxelSpacing[0] / 2; const halfSpacingY = voxelSpacing[1] / 2; const halfSpacingZ = voxelSpacing[2] / 2; const voxelCornersIJK = new Array(8); voxelCornersIJK[0] = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"](imageData, [voxelCenter[0] - halfSpacingX, voxelCenter[1] - halfSpacingY, voxelCenter[2] - halfSpacingZ]); const offsets = [[1, -1, -1], [-1, 1, -1], [1, 1, -1], [-1, -1, 1], [1, -1, 1], [-1, 1, 1], [1, 1, 1]]; for (let i = 0; i < 7; i++) { const [xOff, yOff, zOff] = offsets[i]; voxelCornersIJK[i + 1] = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"](imageData, [voxelCenter[0] + xOff * halfSpacingX, voxelCenter[1] + yOff * halfSpacingY, voxelCenter[2] + zOff * halfSpacingZ]); } return (0,_boundingBox_getBoundingBoxAroundShape__WEBPACK_IMPORTED_MODULE_1__.getBoundingBoxAroundShapeIJK)(voxelCornersIJK, dimensions); } function processVolumes(segmentationVolume, thresholdVolumeInformation) { const { spacing: segmentationSpacing } = segmentationVolume; const scalarDataLength = segmentationVolume.voxelManager.getScalarDataLength(); const volumeInfoList = []; let baseVolumeIdx = 0; for (let i = 0; i < thresholdVolumeInformation.length; i++) { const { imageData, spacing, dimensions, voxelManager } = thresholdVolumeInformation[i].volume; const volumeSize = thresholdVolumeInformation[i].volume.voxelManager.getScalarDataLength(); if (volumeSize === scalarDataLength && equalsCheck(spacing, segmentationSpacing)) { baseVolumeIdx = i; } const lower = thresholdVolumeInformation[i].lower; const upper = thresholdVolumeInformation[i].upper; volumeInfoList.push({ imageData, lower, upper, spacing, dimensions, volumeSize, voxelManager }); } return { volumeInfoList, baseVolumeIdx }; } const segmentIndicesCache = new Map(); const setSegmentationDirty = segmentationId => { const cached = segmentIndicesCache.get(segmentationId); if (cached) { cached.isDirty = true; } }; const setSegmentationClean = segmentationId => { const cached = segmentIndicesCache.get(segmentationId); if (cached) { cached.isDirty = false; } }; const getCachedSegmentIndices = segmentationId => { const cached = segmentIndicesCache.get(segmentationId); if (cached && !cached.isDirty) { return cached.indices; } return null; }; const setCachedSegmentIndices = (segmentationId, indices) => { segmentIndicesCache.set(segmentationId, { indices, isDirty: false }); }; /***/ }, /***/ 79909 /*!**************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/throttle.js ***! \**************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _debounce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./debounce */ 7154); /* harmony import */ var _isObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isObject */ 47866); function throttle(func, wait, options) { let leading = true; let trailing = true; if (typeof func !== 'function') { throw new TypeError('Expected a function'); } if ((0,_isObject__WEBPACK_IMPORTED_MODULE_1__["default"])(options)) { leading = 'leading' in options ? Boolean(options.leading) : leading; trailing = 'trailing' in options ? Boolean(options.trailing) : trailing; } return (0,_debounce__WEBPACK_IMPORTED_MODULE_0__["default"])(func, wait, { leading, trailing, maxWait: wait }); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (throttle); /***/ }, /***/ 11913 /*!*****************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/touch/index.js ***! \*****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ copyPoints: () => (/* binding */ copyPoints), /* harmony export */ copyPointsList: () => (/* binding */ copyPointsList), /* harmony export */ getDeltaDistance: () => (/* binding */ getDeltaDistance), /* harmony export */ getDeltaDistanceBetweenIPoints: () => (/* binding */ getDeltaDistanceBetweenIPoints), /* harmony export */ getDeltaPoints: () => (/* binding */ getDeltaPoints), /* harmony export */ getDeltaRotation: () => (/* binding */ getDeltaRotation), /* harmony export */ getMeanPoints: () => (/* binding */ getMeanPoints), /* harmony export */ getMeanTouchPoints: () => (/* binding */ getMeanTouchPoints) /* harmony export */ }); function getDeltaPoints(currentPoints, lastPoints) { const curr = getMeanPoints(currentPoints); const last = getMeanPoints(lastPoints); return { page: _subtractPoints2D(curr.page, last.page), client: _subtractPoints2D(curr.client, last.client), canvas: _subtractPoints2D(curr.canvas, last.canvas), world: _subtractPoints3D(curr.world, last.world) }; } function getDeltaDistance(currentPoints, lastPoints) { const curr = getMeanPoints(currentPoints); const last = getMeanPoints(lastPoints); return { page: _getDistance2D(curr.page, last.page), client: _getDistance2D(curr.client, last.client), canvas: _getDistance2D(curr.canvas, last.canvas), world: _getDistance3D(curr.world, last.world) }; } function getDeltaRotation(currentPoints, lastPoints) {} function getDeltaDistanceBetweenIPoints(currentPoints, lastPoints) { const currentDistance = _getMeanDistanceBetweenAllIPoints(currentPoints); const lastDistance = _getMeanDistanceBetweenAllIPoints(lastPoints); const deltaDistance = { page: currentDistance.page - lastDistance.page, client: currentDistance.client - lastDistance.client, canvas: currentDistance.canvas - lastDistance.canvas, world: currentDistance.world - lastDistance.world }; return deltaDistance; } function copyPointsList(points) { return JSON.parse(JSON.stringify(points)); } function copyPoints(points) { return JSON.parse(JSON.stringify(points)); } function getMeanPoints(points) { return points.reduce((prev, curr) => { return { page: [prev.page[0] + curr.page[0] / points.length, prev.page[1] + curr.page[1] / points.length], client: [prev.client[0] + curr.client[0] / points.length, prev.client[1] + curr.client[1] / points.length], canvas: [prev.canvas[0] + curr.canvas[0] / points.length, prev.canvas[1] + curr.canvas[1] / points.length], world: [prev.world[0] + curr.world[0] / points.length, prev.world[1] + curr.world[1] / points.length, prev.world[2] + curr.world[2] / points.length] }; }, { page: [0, 0], client: [0, 0], canvas: [0, 0], world: [0, 0, 0] }); } function getMeanTouchPoints(points) { return points.reduce((prev, curr) => { return { page: [prev.page[0] + curr.page[0] / points.length, prev.page[1] + curr.page[1] / points.length], client: [prev.client[0] + curr.client[0] / points.length, prev.client[1] + curr.client[1] / points.length], canvas: [prev.canvas[0] + curr.canvas[0] / points.length, prev.canvas[1] + curr.canvas[1] / points.length], world: [prev.world[0] + curr.world[0] / points.length, prev.world[1] + curr.world[1] / points.length, prev.world[2] + curr.world[2] / points.length], touch: { identifier: null, radiusX: prev.touch.radiusX + curr.touch.radiusX / points.length, radiusY: prev.touch.radiusY + curr.touch.radiusY / points.length, force: prev.touch.force + curr.touch.force / points.length, rotationAngle: prev.touch.rotationAngle + curr.touch.rotationAngle / points.length } }; }, { page: [0, 0], client: [0, 0], canvas: [0, 0], world: [0, 0, 0], touch: { identifier: null, radiusX: 0, radiusY: 0, force: 0, rotationAngle: 0 } }); } function _subtractPoints2D(point0, point1) { return [point0[0] - point1[0], point0[1] - point1[1]]; } function _subtractPoints3D(point0, point1) { return [point0[0] - point1[0], point0[1] - point1[1], point0[2] - point1[2]]; } function _getMeanDistanceBetweenAllIPoints(points) { const pairedDistance = []; for (let i = 0; i < points.length; i++) { for (let j = 0; j < points.length; j++) { if (i < j) { pairedDistance.push({ page: _getDistance2D(points[i].page, points[j].page), client: _getDistance2D(points[i].client, points[j].client), canvas: _getDistance2D(points[i].canvas, points[j].canvas), world: _getDistance3D(points[i].world, points[j].world) }); } } } return pairedDistance.reduce((prev, curr) => { return { page: prev.page + curr.page / pairedDistance.length, client: prev.client + curr.client / pairedDistance.length, canvas: prev.canvas + curr.canvas / pairedDistance.length, world: prev.world + curr.world / pairedDistance.length }; }, { page: 0, client: 0, canvas: 0, world: 0 }); } function _getDistance2D(point0, point1) { return Math.sqrt(Math.pow(point0[0] - point1[0], 2) + Math.pow(point0[1] - point1[1], 2)); } function _getDistance3D(point0, point1) { return Math.sqrt(Math.pow(point0[0] - point1[0], 2) + Math.pow(point0[1] - point1[1], 2) + Math.pow(point0[2] - point1[2], 2)); } /***/ }, /***/ 78928 /*!*****************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/triggerAnnotationRender.js ***! \*****************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) /* harmony export */ }); /* harmony import */ var _stateManagement_annotation_AnnotationRenderingEngine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../stateManagement/annotation/AnnotationRenderingEngine */ 99024); function triggerAnnotationRender(element) { _stateManagement_annotation_AnnotationRenderingEngine__WEBPACK_IMPORTED_MODULE_0__.annotationRenderingEngine.renderViewport(element); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (triggerAnnotationRender); /***/ }, /***/ 49796 /*!********************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/triggerAnnotationRenderForToolGroupIds.js ***! \********************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ triggerAnnotationRenderForToolGroupIds: () => (/* binding */ triggerAnnotationRenderForToolGroupIds) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 77569); /* harmony import */ var _triggerAnnotationRender__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./triggerAnnotationRender */ 78928); /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../store/ToolGroupManager */ 92792); function triggerAnnotationRenderForToolGroupIds(toolGroupIds) { toolGroupIds.forEach(toolGroupId => { const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_2__["default"])(toolGroupId); if (!toolGroup) { console.warn(`ToolGroup not available for ${toolGroupId}`); return; } const viewportsInfo = toolGroup.getViewportsInfo(); viewportsInfo.forEach(viewportInfo => { const { renderingEngineId, viewportId } = viewportInfo; const renderingEngine = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getRenderingEngine)(renderingEngineId); if (!renderingEngine) { console.warn(`RenderingEngine not available for ${renderingEngineId}`); return; } const viewport = renderingEngine.getViewport(viewportId); (0,_triggerAnnotationRender__WEBPACK_IMPORTED_MODULE_1__["default"])(viewport.element); }); }); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (triggerAnnotationRenderForToolGroupIds); /***/ }, /***/ 613 /*!*******************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/triggerAnnotationRenderForViewportIds.js ***! \*******************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ triggerAnnotationRenderForViewportIds: () => (/* binding */ triggerAnnotationRenderForViewportIds) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _triggerAnnotationRender__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./triggerAnnotationRender */ 78928); function triggerAnnotationRenderForViewportIds(viewportIdsToRender) { if (!viewportIdsToRender.length) { return; } viewportIdsToRender.forEach(viewportId => { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__.getEnabledElementByViewportId)(viewportId); if (!enabledElement) { console.warn(`Viewport not available for ${viewportId}`); return; } const { viewport } = enabledElement; if (!viewport) { console.warn(`Viewport not available for ${viewportId}`); return; } const element = viewport.element; (0,_triggerAnnotationRender__WEBPACK_IMPORTED_MODULE_1__["default"])(element); }); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (triggerAnnotationRenderForViewportIds); /***/ }, /***/ 58377 /*!**********************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/viewport/isViewportPreScaled.js ***! \**********************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isViewportPreScaled: () => (/* binding */ isViewportPreScaled) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 19401); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @cornerstonejs/core */ 67461); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @cornerstonejs/core */ 38277); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @cornerstonejs/core */ 96146); function isViewportPreScaled(viewport, targetId) { if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"]) { const volumeId = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_3__.getVolumeId(targetId); const volume = _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_2__["default"].getVolume(volumeId); return !!volume?.scaling && Object.keys(volume.scaling).length > 0; } else if (viewport instanceof _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_1__["default"]) { const { preScale } = viewport.getImageData() || {}; return !!preScale?.scaled; } else { return false; } } /***/ }, /***/ 85577 /*!************************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/viewportFilters/filterViewportsWithFrameOfReferenceUID.js ***! \************************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ filterViewportsWithFrameOfReferenceUID) /* harmony export */ }); function filterViewportsWithFrameOfReferenceUID(viewports, FrameOfReferenceUID) { const numViewports = viewports.length; const viewportsWithFrameOfReferenceUID = []; for (let vp = 0; vp < numViewports; vp++) { const viewport = viewports[vp]; if (viewport.getFrameOfReferenceUID() === FrameOfReferenceUID) { viewportsWithFrameOfReferenceUID.push(viewport); } } return viewportsWithFrameOfReferenceUID; } /***/ }, /***/ 89993 /*!********************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/viewportFilters/filterViewportsWithParallelNormals.js ***! \********************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), /* harmony export */ filterViewportsWithParallelNormals: () => (/* binding */ filterViewportsWithParallelNormals) /* harmony export */ }); /* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ 87396); function filterViewportsWithParallelNormals(viewports, camera, EPS = 0.999) { return viewports.filter(viewport => { const vpCamera = viewport.getCamera(); const isParallel = Math.abs(gl_matrix__WEBPACK_IMPORTED_MODULE_0__.dot(vpCamera.viewPlaneNormal, camera.viewPlaneNormal)) > EPS; return isParallel; }); } /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (filterViewportsWithParallelNormals); /***/ }, /***/ 2099 /*!****************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/viewportFilters/filterViewportsWithToolEnabled.js ***! \****************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ filterViewportsWithToolEnabled) /* harmony export */ }); /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../enums */ 92925); /* harmony import */ var _store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../store/ToolGroupManager */ 43551); const { Active, Passive, Enabled } = _enums__WEBPACK_IMPORTED_MODULE_0__["default"]; function filterViewportsWithToolEnabled(viewports, toolName) { const numViewports = viewports.length; const viewportsWithToolEnabled = []; for (let vp = 0; vp < numViewports; vp++) { const viewport = viewports[vp]; const toolGroup = (0,_store_ToolGroupManager__WEBPACK_IMPORTED_MODULE_1__["default"])(viewport.id, viewport.renderingEngineId); if (!toolGroup) { continue; } const hasTool = _toolGroupHasActiveEnabledOrPassiveTool(toolGroup, toolName); if (hasTool) { viewportsWithToolEnabled.push(viewport); } } return viewportsWithToolEnabled; } function _toolGroupHasActiveEnabledOrPassiveTool(toolGroup, toolName) { const { toolOptions } = toolGroup; const tool = toolOptions[toolName]; if (!tool) { return false; } const toolMode = tool.mode; return toolMode === Active || toolMode === Passive || toolMode === Enabled; } /***/ }, /***/ 68348 /*!****************************************************************************************************************!*\ !*** ./node_modules/@cornerstonejs/tools/dist/esm/utilities/viewportFilters/getViewportIdsWithToolToRender.js ***! \****************************************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ getViewportIdsWithToolToRender) /* harmony export */ }); /* harmony import */ var _cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @cornerstonejs/core */ 98361); /* harmony import */ var _filterViewportsWithFrameOfReferenceUID__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filterViewportsWithFrameOfReferenceUID */ 85577); /* harmony import */ var _filterViewportsWithToolEnabled__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./filterViewportsWithToolEnabled */ 2099); /* harmony import */ var _filterViewportsWithParallelNormals__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./filterViewportsWithParallelNormals */ 89993); function getViewportIdsWithToolToRender(element, toolName, requireParallelNormals = true) { const enabledElement = (0,_cornerstonejs_core__WEBPACK_IMPORTED_MODULE_0__["default"])(element); const { renderingEngine, FrameOfReferenceUID } = enabledElement; let viewports = renderingEngine.getViewports(); viewports = (0,_filterViewportsWithFrameOfReferenceUID__WEBPACK_IMPORTED_MODULE_1__["default"])(viewports, FrameOfReferenceUID); viewports = (0,_filterViewportsWithToolEnabled__WEBPACK_IMPORTED_MODULE_2__["default"])(viewports, toolName); const viewport = renderingEngine.getViewport(enabledElement.viewportId); if (requireParallelNormals) { viewports = (0,_filterViewportsWithParallelNormals__WEBPACK_IMPORTED_MODULE_3__["default"])(viewports, viewport.getCamera()); } const viewportIds = viewports.map(vp => vp.id); return viewportIds; } /***/ }, /***/ 2559 /*!**************************************************!*\ !*** ./node_modules/ajv-formats/dist/formats.js ***! \**************************************************/ (__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.formatNames = exports.fastFormats = exports.fullFormats = void 0; function fmtDef(validate, compare) { return { validate, compare }; } exports.fullFormats = { // date: http://tools.ietf.org/html/rfc3339#section-5.6 date: fmtDef(date, compareDate), // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 time: fmtDef(getTime(true), compareTime), "date-time": fmtDef(getDateTime(true), compareDateTime), "iso-time": fmtDef(getTime(), compareIsoTime), "iso-date-time": fmtDef(getDateTime(), compareIsoDateTime), // duration: https://tools.ietf.org/html/rfc3339#appendix-A duration: /^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/, uri, "uri-reference": /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i, // uri-template: https://tools.ietf.org/html/rfc6570 "uri-template": /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i, // For the source: https://gist.github.com/dperini/729294 // For test cases: https://mathiasbynens.be/demo/url-regex url: /^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu, email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, hostname: /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i, // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html ipv4: /^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/, ipv6: /^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i, regex, // uuid: http://tools.ietf.org/html/rfc4122 uuid: /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i, // JSON-pointer: https://tools.ietf.org/html/rfc6901 // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A "json-pointer": /^(?:\/(?:[^~/]|~0|~1)*)*$/, "json-pointer-uri-fragment": /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i, // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 "relative-json-pointer": /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/, // the following formats are used by the openapi specification: https://spec.openapis.org/oas/v3.0.0#data-types // byte: https://github.com/miguelmota/is-base64 byte, // signed 32 bit integer int32: { type: "number", validate: validateInt32 }, // signed 64 bit integer int64: { type: "number", validate: validateInt64 }, // C-type float float: { type: "number", validate: validateNumber }, // C-type double double: { type: "number", validate: validateNumber }, // hint to the UI to hide input strings password: true, // unchecked string payload binary: true }; exports.fastFormats = { ...exports.fullFormats, date: fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d$/, compareDate), time: fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareTime), "date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i, compareDateTime), "iso-time": fmtDef(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoTime), "iso-date-time": fmtDef(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i, compareIsoDateTime), // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i, "uri-reference": /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i, // email (sources from jsen validator): // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'wilful violation') email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i }; exports.formatNames = Object.keys(exports.fullFormats); function isLeapYear(year) { // https://tools.ietf.org/html/rfc3339#appendix-C return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0); } const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/; const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]; function date(str) { // full-date from http://tools.ietf.org/html/rfc3339#section-5.6 const matches = DATE.exec(str); if (!matches) return false; const year = +matches[1]; const month = +matches[2]; const day = +matches[3]; return month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && isLeapYear(year) ? 29 : DAYS[month]); } function compareDate(d1, d2) { if (!(d1 && d2)) return undefined; if (d1 > d2) return 1; if (d1 < d2) return -1; return 0; } const TIME = /^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i; function getTime(strictTimeZone) { return function time(str) { const matches = TIME.exec(str); if (!matches) return false; const hr = +matches[1]; const min = +matches[2]; const sec = +matches[3]; const tz = matches[4]; const tzSign = matches[5] === "-" ? -1 : 1; const tzH = +(matches[6] || 0); const tzM = +(matches[7] || 0); if (tzH > 23 || tzM > 59 || strictTimeZone && !tz) return false; if (hr <= 23 && min <= 59 && sec < 60) return true; // leap second const utcMin = min - tzM * tzSign; const utcHr = hr - tzH * tzSign - (utcMin < 0 ? 1 : 0); return (utcHr === 23 || utcHr === -1) && (utcMin === 59 || utcMin === -1) && sec < 61; }; } function compareTime(s1, s2) { if (!(s1 && s2)) return undefined; const t1 = new Date("2020-01-01T" + s1).valueOf(); const t2 = new Date("2020-01-01T" + s2).valueOf(); if (!(t1 && t2)) return undefined; return t1 - t2; } function compareIsoTime(t1, t2) { if (!(t1 && t2)) return undefined; const a1 = TIME.exec(t1); const a2 = TIME.exec(t2); if (!(a1 && a2)) return undefined; t1 = a1[1] + a1[2] + a1[3]; t2 = a2[1] + a2[2] + a2[3]; if (t1 > t2) return 1; if (t1 < t2) return -1; return 0; } const DATE_TIME_SEPARATOR = /t|\s/i; function getDateTime(strictTimeZone) { const time = getTime(strictTimeZone); return function date_time(str) { // http://tools.ietf.org/html/rfc3339#section-5.6 const dateTime = str.split(DATE_TIME_SEPARATOR); return dateTime.length === 2 && date(dateTime[0]) && time(dateTime[1]); }; } function compareDateTime(dt1, dt2) { if (!(dt1 && dt2)) return undefined; const d1 = new Date(dt1).valueOf(); const d2 = new Date(dt2).valueOf(); if (!(d1 && d2)) return undefined; return d1 - d2; } function compareIsoDateTime(dt1, dt2) { if (!(dt1 && dt2)) return undefined; const [d1, t1] = dt1.split(DATE_TIME_SEPARATOR); const [d2, t2] = dt2.split(DATE_TIME_SEPARATOR); const res = compareDate(d1, d2); if (res === undefined) return undefined; return res || compareTime(t1, t2); } const NOT_URI_FRAGMENT = /\/|:/; const URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; function uri(str) { // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "." return NOT_URI_FRAGMENT.test(str) && URI.test(str); } const BYTE = /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm; function byte(str) { BYTE.lastIndex = 0; return BYTE.test(str); } const MIN_INT32 = -(2 ** 31); const MAX_INT32 = 2 ** 31 - 1; function validateInt32(value) { return Number.isInteger(value) && value <= MAX_INT32 && value >= MIN_INT32; } function validateInt64(value) { // JSON and javascript max Int is 2**53, so any int that passes isInteger is valid for Int64 return Number.isInteger(value); } function validateNumber() { return true; } const Z_ANCHOR = /[^\\]\\Z/; function regex(str) { if (Z_ANCHOR.test(str)) return false; try { new RegExp(str); return true; } catch (e) { return false; } } /***/ }, /***/ 41979 /*!************************************************!*\ !*** ./node_modules/ajv-formats/dist/index.js ***! \************************************************/ (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const formats_1 = __webpack_require__(/*! ./formats */ 2559); const limit_1 = __webpack_require__(/*! ./limit */ 28256); const codegen_1 = __webpack_require__(/*! ajv/dist/compile/codegen */ 34320); const fullName = new codegen_1.Name("fullFormats"); const fastName = new codegen_1.Name("fastFormats"); const formatsPlugin = (ajv, opts = { keywords: true }) => { if (Array.isArray(opts)) { addFormats(ajv, opts, formats_1.fullFormats, fullName); return ajv; } const [formats, exportName] = opts.mode === "fast" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName]; const list = opts.formats || formats_1.formatNames; addFormats(ajv, list, formats, exportName); if (opts.keywords) (0, limit_1.default)(ajv); return ajv; }; formatsPlugin.get = (name, mode = "full") => { const formats = mode === "fast" ? formats_1.fastFormats : formats_1.fullFormats; const f = formats[name]; if (!f) throw new Error(`Unknown format "${name}"`); return f; }; function addFormats(ajv, list, fs, exportName) { var _a; var _b; (_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`; for (const f of list) ajv.addFormat(f, fs[f]); } module.exports = exports = formatsPlugin; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = formatsPlugin; /***/ }, /***/ 28256 /*!************************************************!*\ !*** ./node_modules/ajv-formats/dist/limit.js ***! \************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.formatLimitDefinition = void 0; const ajv_1 = __webpack_require__(/*! ajv */ 71955); const codegen_1 = __webpack_require__(/*! ajv/dist/compile/codegen */ 34320); const ops = codegen_1.operators; const KWDs = { formatMaximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT }, formatMinimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT }, formatExclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, formatExclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE } }; const error = { message: ({ keyword, schemaCode }) => (0, codegen_1.str)`should be ${KWDs[keyword].okStr} ${schemaCode}`, params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}` }; exports.formatLimitDefinition = { keyword: Object.keys(KWDs), type: "string", schemaType: "string", $data: true, error, code(cxt) { const { gen, data, schemaCode, keyword, it } = cxt; const { opts, self } = it; if (!opts.validateFormats) return; const fCxt = new ajv_1.KeywordCxt(it, self.RULES.all.format.definition, "format"); if (fCxt.$data) validate$DataFormat();else validateFormat(); function validate$DataFormat() { const fmts = gen.scopeValue("formats", { ref: self.formats, code: opts.code.formats }); const fmt = gen.const("fmt", (0, codegen_1._)`${fmts}[${fCxt.schemaCode}]`); cxt.fail$data((0, codegen_1.or)((0, codegen_1._)`typeof ${fmt} != "object"`, (0, codegen_1._)`${fmt} instanceof RegExp`, (0, codegen_1._)`typeof ${fmt}.compare != "function"`, compareCode(fmt))); } function validateFormat() { const format = fCxt.schema; const fmtDef = self.formats[format]; if (!fmtDef || fmtDef === true) return; if (typeof fmtDef != "object" || fmtDef instanceof RegExp || typeof fmtDef.compare != "function") { throw new Error(`"${keyword}": format "${format}" does not define "compare" function`); } const fmt = gen.scopeValue("formats", { key: format, ref: fmtDef, code: opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(format)}` : undefined }); cxt.fail$data(compareCode(fmt)); } function compareCode(fmt) { return (0, codegen_1._)`${fmt}.compare(${data}, ${schemaCode}) ${KWDs[keyword].fail} 0`; } }, dependencies: ["format"] }; const formatLimitPlugin = ajv => { ajv.addKeyword(exports.formatLimitDefinition); return ajv; }; exports["default"] = formatLimitPlugin; /***/ }, /***/ 71955 /*!**************************************!*\ !*** ./node_modules/ajv/dist/ajv.js ***! \**************************************/ (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0; const core_1 = __webpack_require__(/*! ./core */ 37961); const draft7_1 = __webpack_require__(/*! ./vocabularies/draft7 */ 82497); const discriminator_1 = __webpack_require__(/*! ./vocabularies/discriminator */ 6082); const draft7MetaSchema = __webpack_require__(/*! ./refs/json-schema-draft-07.json */ 72079); const META_SUPPORT_DATA = ["/properties"]; const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema"; class Ajv extends core_1.default { _addVocabularies() { super._addVocabularies(); draft7_1.default.forEach(v => this.addVocabulary(v)); if (this.opts.discriminator) this.addKeyword(discriminator_1.default); } _addDefaultMetaSchema() { super._addDefaultMetaSchema(); if (!this.opts.meta) return; const metaSchema = this.opts.$data ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) : draft7MetaSchema; this.addMetaSchema(metaSchema, META_SCHEMA_ID, false); this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; } defaultMeta() { return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined); } } exports.Ajv = Ajv; module.exports = exports = Ajv; module.exports.Ajv = Ajv; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = Ajv; var validate_1 = __webpack_require__(/*! ./compile/validate */ 16381); Object.defineProperty(exports, "KeywordCxt", ({ enumerable: true, get: function () { return validate_1.KeywordCxt; } })); var codegen_1 = __webpack_require__(/*! ./compile/codegen */ 34320); Object.defineProperty(exports, "_", ({ enumerable: true, get: function () { return codegen_1._; } })); Object.defineProperty(exports, "str", ({ enumerable: true, get: function () { return codegen_1.str; } })); Object.defineProperty(exports, "stringify", ({ enumerable: true, get: function () { return codegen_1.stringify; } })); Object.defineProperty(exports, "nil", ({ enumerable: true, get: function () { return codegen_1.nil; } })); Object.defineProperty(exports, "Name", ({ enumerable: true, get: function () { return codegen_1.Name; } })); Object.defineProperty(exports, "CodeGen", ({ enumerable: true, get: function () { return codegen_1.CodeGen; } })); var validation_error_1 = __webpack_require__(/*! ./runtime/validation_error */ 22409); Object.defineProperty(exports, "ValidationError", ({ enumerable: true, get: function () { return validation_error_1.default; } })); var ref_error_1 = __webpack_require__(/*! ./compile/ref_error */ 55654); Object.defineProperty(exports, "MissingRefError", ({ enumerable: true, get: function () { return ref_error_1.default; } })); /***/ }, /***/ 77971 /*!*******************************************************!*\ !*** ./node_modules/ajv/dist/compile/codegen/code.js ***! \*******************************************************/ (__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0; // eslint-disable-next-line @typescript-eslint/no-extraneous-class class _CodeOrName {} exports._CodeOrName = _CodeOrName; exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; class Name extends _CodeOrName { constructor(s) { super(); if (!exports.IDENTIFIER.test(s)) throw new Error("CodeGen: name must be a valid identifier"); this.str = s; } toString() { return this.str; } emptyStr() { return false; } get names() { return { [this.str]: 1 }; } } exports.Name = Name; class _Code extends _CodeOrName { constructor(code) { super(); this._items = typeof code === "string" ? [code] : code; } toString() { return this.str; } emptyStr() { if (this._items.length > 1) return false; const item = this._items[0]; return item === "" || item === '""'; } get str() { var _a; return (_a = this._str) !== null && _a !== void 0 ? _a : this._str = this._items.reduce((s, c) => `${s}${c}`, ""); } get names() { var _a; return (_a = this._names) !== null && _a !== void 0 ? _a : this._names = this._items.reduce((names, c) => { if (c instanceof Name) names[c.str] = (names[c.str] || 0) + 1; return names; }, {}); } } exports._Code = _Code; exports.nil = new _Code(""); function _(strs, ...args) { const code = [strs[0]]; let i = 0; while (i < args.length) { addCodeArg(code, args[i]); code.push(strs[++i]); } return new _Code(code); } exports._ = _; const plus = new _Code("+"); function str(strs, ...args) { const expr = [safeStringify(strs[0])]; let i = 0; while (i < args.length) { expr.push(plus); addCodeArg(expr, args[i]); expr.push(plus, safeStringify(strs[++i])); } optimize(expr); return new _Code(expr); } exports.str = str; function addCodeArg(code, arg) { if (arg instanceof _Code) code.push(...arg._items);else if (arg instanceof Name) code.push(arg);else code.push(interpolate(arg)); } exports.addCodeArg = addCodeArg; function optimize(expr) { let i = 1; while (i < expr.length - 1) { if (expr[i] === plus) { const res = mergeExprItems(expr[i - 1], expr[i + 1]); if (res !== undefined) { expr.splice(i - 1, 3, res); continue; } expr[i++] = "+"; } i++; } } function mergeExprItems(a, b) { if (b === '""') return a; if (a === '""') return b; if (typeof a == "string") { if (b instanceof Name || a[a.length - 1] !== '"') return; if (typeof b != "string") return `${a.slice(0, -1)}${b}"`; if (b[0] === '"') return a.slice(0, -1) + b.slice(1); return; } if (typeof b == "string" && b[0] === '"' && !(a instanceof Name)) return `"${a}${b.slice(1)}`; return; } function strConcat(c1, c2) { return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`; } exports.strConcat = strConcat; // TODO do not allow arrays here function interpolate(x) { return typeof x == "number" || typeof x == "boolean" || x === null ? x : safeStringify(Array.isArray(x) ? x.join(",") : x); } function stringify(x) { return new _Code(safeStringify(x)); } exports.stringify = stringify; function safeStringify(x) { return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"); } exports.safeStringify = safeStringify; function getProperty(key) { return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`; } exports.getProperty = getProperty; //Does best effort to format the name properly function getEsmExportName(key) { if (typeof key == "string" && exports.IDENTIFIER.test(key)) { return new _Code(`${key}`); } throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`); } exports.getEsmExportName = getEsmExportName; function regexpCode(rx) { return new _Code(rx.toString()); } exports.regexpCode = regexpCode; /***/ }, /***/ 34320 /*!********************************************************!*\ !*** ./node_modules/ajv/dist/compile/codegen/index.js ***! \********************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0; const code_1 = __webpack_require__(/*! ./code */ 77971); const scope_1 = __webpack_require__(/*! ./scope */ 82440); var code_2 = __webpack_require__(/*! ./code */ 77971); Object.defineProperty(exports, "_", ({ enumerable: true, get: function () { return code_2._; } })); Object.defineProperty(exports, "str", ({ enumerable: true, get: function () { return code_2.str; } })); Object.defineProperty(exports, "strConcat", ({ enumerable: true, get: function () { return code_2.strConcat; } })); Object.defineProperty(exports, "nil", ({ enumerable: true, get: function () { return code_2.nil; } })); Object.defineProperty(exports, "getProperty", ({ enumerable: true, get: function () { return code_2.getProperty; } })); Object.defineProperty(exports, "stringify", ({ enumerable: true, get: function () { return code_2.stringify; } })); Object.defineProperty(exports, "regexpCode", ({ enumerable: true, get: function () { return code_2.regexpCode; } })); Object.defineProperty(exports, "Name", ({ enumerable: true, get: function () { return code_2.Name; } })); var scope_2 = __webpack_require__(/*! ./scope */ 82440); Object.defineProperty(exports, "Scope", ({ enumerable: true, get: function () { return scope_2.Scope; } })); Object.defineProperty(exports, "ValueScope", ({ enumerable: true, get: function () { return scope_2.ValueScope; } })); Object.defineProperty(exports, "ValueScopeName", ({ enumerable: true, get: function () { return scope_2.ValueScopeName; } })); Object.defineProperty(exports, "varKinds", ({ enumerable: true, get: function () { return scope_2.varKinds; } })); exports.operators = { GT: new code_1._Code(">"), GTE: new code_1._Code(">="), LT: new code_1._Code("<"), LTE: new code_1._Code("<="), EQ: new code_1._Code("==="), NEQ: new code_1._Code("!=="), NOT: new code_1._Code("!"), OR: new code_1._Code("||"), AND: new code_1._Code("&&"), ADD: new code_1._Code("+") }; class Node { optimizeNodes() { return this; } optimizeNames(_names, _constants) { return this; } } class Def extends Node { constructor(varKind, name, rhs) { super(); this.varKind = varKind; this.name = name; this.rhs = rhs; } render({ es5, _n }) { const varKind = es5 ? scope_1.varKinds.var : this.varKind; const rhs = this.rhs === undefined ? "" : ` = ${this.rhs}`; return `${varKind} ${this.name}${rhs};` + _n; } optimizeNames(names, constants) { if (!names[this.name.str]) return; if (this.rhs) this.rhs = optimizeExpr(this.rhs, names, constants); return this; } get names() { return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {}; } } class Assign extends Node { constructor(lhs, rhs, sideEffects) { super(); this.lhs = lhs; this.rhs = rhs; this.sideEffects = sideEffects; } render({ _n }) { return `${this.lhs} = ${this.rhs};` + _n; } optimizeNames(names, constants) { if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects) return; this.rhs = optimizeExpr(this.rhs, names, constants); return this; } get names() { const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names }; return addExprNames(names, this.rhs); } } class AssignOp extends Assign { constructor(lhs, op, rhs, sideEffects) { super(lhs, rhs, sideEffects); this.op = op; } render({ _n }) { return `${this.lhs} ${this.op}= ${this.rhs};` + _n; } } class Label extends Node { constructor(label) { super(); this.label = label; this.names = {}; } render({ _n }) { return `${this.label}:` + _n; } } class Break extends Node { constructor(label) { super(); this.label = label; this.names = {}; } render({ _n }) { const label = this.label ? ` ${this.label}` : ""; return `break${label};` + _n; } } class Throw extends Node { constructor(error) { super(); this.error = error; } render({ _n }) { return `throw ${this.error};` + _n; } get names() { return this.error.names; } } class AnyCode extends Node { constructor(code) { super(); this.code = code; } render({ _n }) { return `${this.code};` + _n; } optimizeNodes() { return `${this.code}` ? this : undefined; } optimizeNames(names, constants) { this.code = optimizeExpr(this.code, names, constants); return this; } get names() { return this.code instanceof code_1._CodeOrName ? this.code.names : {}; } } class ParentNode extends Node { constructor(nodes = []) { super(); this.nodes = nodes; } render(opts) { return this.nodes.reduce((code, n) => code + n.render(opts), ""); } optimizeNodes() { const { nodes } = this; let i = nodes.length; while (i--) { const n = nodes[i].optimizeNodes(); if (Array.isArray(n)) nodes.splice(i, 1, ...n);else if (n) nodes[i] = n;else nodes.splice(i, 1); } return nodes.length > 0 ? this : undefined; } optimizeNames(names, constants) { const { nodes } = this; let i = nodes.length; while (i--) { // iterating backwards improves 1-pass optimization const n = nodes[i]; if (n.optimizeNames(names, constants)) continue; subtractNames(names, n.names); nodes.splice(i, 1); } return nodes.length > 0 ? this : undefined; } get names() { return this.nodes.reduce((names, n) => addNames(names, n.names), {}); } } class BlockNode extends ParentNode { render(opts) { return "{" + opts._n + super.render(opts) + "}" + opts._n; } } class Root extends ParentNode {} class Else extends BlockNode {} Else.kind = "else"; class If extends BlockNode { constructor(condition, nodes) { super(nodes); this.condition = condition; } render(opts) { let code = `if(${this.condition})` + super.render(opts); if (this.else) code += "else " + this.else.render(opts); return code; } optimizeNodes() { super.optimizeNodes(); const cond = this.condition; if (cond === true) return this.nodes; // else is ignored here let e = this.else; if (e) { const ns = e.optimizeNodes(); e = this.else = Array.isArray(ns) ? new Else(ns) : ns; } if (e) { if (cond === false) return e instanceof If ? e : e.nodes; if (this.nodes.length) return this; return new If(not(cond), e instanceof If ? [e] : e.nodes); } if (cond === false || !this.nodes.length) return undefined; return this; } optimizeNames(names, constants) { var _a; this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants); if (!(super.optimizeNames(names, constants) || this.else)) return; this.condition = optimizeExpr(this.condition, names, constants); return this; } get names() { const names = super.names; addExprNames(names, this.condition); if (this.else) addNames(names, this.else.names); return names; } } If.kind = "if"; class For extends BlockNode {} For.kind = "for"; class ForLoop extends For { constructor(iteration) { super(); this.iteration = iteration; } render(opts) { return `for(${this.iteration})` + super.render(opts); } optimizeNames(names, constants) { if (!super.optimizeNames(names, constants)) return; this.iteration = optimizeExpr(this.iteration, names, constants); return this; } get names() { return addNames(super.names, this.iteration.names); } } class ForRange extends For { constructor(varKind, name, from, to) { super(); this.varKind = varKind; this.name = name; this.from = from; this.to = to; } render(opts) { const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind; const { name, from, to } = this; return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts); } get names() { const names = addExprNames(super.names, this.from); return addExprNames(names, this.to); } } class ForIter extends For { constructor(loop, varKind, name, iterable) { super(); this.loop = loop; this.varKind = varKind; this.name = name; this.iterable = iterable; } render(opts) { return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts); } optimizeNames(names, constants) { if (!super.optimizeNames(names, constants)) return; this.iterable = optimizeExpr(this.iterable, names, constants); return this; } get names() { return addNames(super.names, this.iterable.names); } } class Func extends BlockNode { constructor(name, args, async) { super(); this.name = name; this.args = args; this.async = async; } render(opts) { const _async = this.async ? "async " : ""; return `${_async}function ${this.name}(${this.args})` + super.render(opts); } } Func.kind = "func"; class Return extends ParentNode { render(opts) { return "return " + super.render(opts); } } Return.kind = "return"; class Try extends BlockNode { render(opts) { let code = "try" + super.render(opts); if (this.catch) code += this.catch.render(opts); if (this.finally) code += this.finally.render(opts); return code; } optimizeNodes() { var _a, _b; super.optimizeNodes(); (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNodes(); (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes(); return this; } optimizeNames(names, constants) { var _a, _b; super.optimizeNames(names, constants); (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants); (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants); return this; } get names() { const names = super.names; if (this.catch) addNames(names, this.catch.names); if (this.finally) addNames(names, this.finally.names); return names; } } class Catch extends BlockNode { constructor(error) { super(); this.error = error; } render(opts) { return `catch(${this.error})` + super.render(opts); } } Catch.kind = "catch"; class Finally extends BlockNode { render(opts) { return "finally" + super.render(opts); } } Finally.kind = "finally"; class CodeGen { constructor(extScope, opts = {}) { this._values = {}; this._blockStarts = []; this._constants = {}; this.opts = { ...opts, _n: opts.lines ? "\n" : "" }; this._extScope = extScope; this._scope = new scope_1.Scope({ parent: extScope }); this._nodes = [new Root()]; } toString() { return this._root.render(this.opts); } // returns unique name in the internal scope name(prefix) { return this._scope.name(prefix); } // reserves unique name in the external scope scopeName(prefix) { return this._extScope.name(prefix); } // reserves unique name in the external scope and assigns value to it scopeValue(prefixOrName, value) { const name = this._extScope.value(prefixOrName, value); const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set()); vs.add(name); return name; } getScopeValue(prefix, keyOrRef) { return this._extScope.getValue(prefix, keyOrRef); } // return code that assigns values in the external scope to the names that are used internally // (same names that were returned by gen.scopeName or gen.scopeValue) scopeRefs(scopeName) { return this._extScope.scopeRefs(scopeName, this._values); } scopeCode() { return this._extScope.scopeCode(this._values); } _def(varKind, nameOrPrefix, rhs, constant) { const name = this._scope.toName(nameOrPrefix); if (rhs !== undefined && constant) this._constants[name.str] = rhs; this._leafNode(new Def(varKind, name, rhs)); return name; } // `const` declaration (`var` in es5 mode) const(nameOrPrefix, rhs, _constant) { return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant); } // `let` declaration with optional assignment (`var` in es5 mode) let(nameOrPrefix, rhs, _constant) { return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant); } // `var` declaration with optional assignment var(nameOrPrefix, rhs, _constant) { return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant); } // assignment code assign(lhs, rhs, sideEffects) { return this._leafNode(new Assign(lhs, rhs, sideEffects)); } // `+=` code add(lhs, rhs) { return this._leafNode(new AssignOp(lhs, exports.operators.ADD, rhs)); } // appends passed SafeExpr to code or executes Block code(c) { if (typeof c == "function") c();else if (c !== code_1.nil) this._leafNode(new AnyCode(c)); return this; } // returns code for object literal for the passed argument list of key-value pairs object(...keyValues) { const code = ["{"]; for (const [key, value] of keyValues) { if (code.length > 1) code.push(","); code.push(key); if (key !== value || this.opts.es5) { code.push(":"); (0, code_1.addCodeArg)(code, value); } } code.push("}"); return new code_1._Code(code); } // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed) if(condition, thenBody, elseBody) { this._blockNode(new If(condition)); if (thenBody && elseBody) { this.code(thenBody).else().code(elseBody).endIf(); } else if (thenBody) { this.code(thenBody).endIf(); } else if (elseBody) { throw new Error('CodeGen: "else" body without "then" body'); } return this; } // `else if` clause - invalid without `if` or after `else` clauses elseIf(condition) { return this._elseNode(new If(condition)); } // `else` clause - only valid after `if` or `else if` clauses else() { return this._elseNode(new Else()); } // end `if` statement (needed if gen.if was used only with condition) endIf() { return this._endBlockNode(If, Else); } _for(node, forBody) { this._blockNode(node); if (forBody) this.code(forBody).endFor(); return this; } // a generic `for` clause (or statement if `forBody` is passed) for(iteration, forBody) { return this._for(new ForLoop(iteration), forBody); } // `for` statement for a range of values forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) { const name = this._scope.toName(nameOrPrefix); return this._for(new ForRange(varKind, name, from, to), () => forBody(name)); } // `for-of` statement (in es5 mode replace with a normal for loop) forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) { const name = this._scope.toName(nameOrPrefix); if (this.opts.es5) { const arr = iterable instanceof code_1.Name ? iterable : this.var("_arr", iterable); return this.forRange("_i", 0, (0, code_1._)`${arr}.length`, i => { this.var(name, (0, code_1._)`${arr}[${i}]`); forBody(name); }); } return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name)); } // `for-in` statement. // With option `ownProperties` replaced with a `for-of` loop for object keys forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) { if (this.opts.ownProperties) { return this.forOf(nameOrPrefix, (0, code_1._)`Object.keys(${obj})`, forBody); } const name = this._scope.toName(nameOrPrefix); return this._for(new ForIter("in", varKind, name, obj), () => forBody(name)); } // end `for` loop endFor() { return this._endBlockNode(For); } // `label` statement label(label) { return this._leafNode(new Label(label)); } // `break` statement break(label) { return this._leafNode(new Break(label)); } // `return` statement return(value) { const node = new Return(); this._blockNode(node); this.code(value); if (node.nodes.length !== 1) throw new Error('CodeGen: "return" should have one node'); return this._endBlockNode(Return); } // `try` statement try(tryBody, catchCode, finallyCode) { if (!catchCode && !finallyCode) throw new Error('CodeGen: "try" without "catch" and "finally"'); const node = new Try(); this._blockNode(node); this.code(tryBody); if (catchCode) { const error = this.name("e"); this._currNode = node.catch = new Catch(error); catchCode(error); } if (finallyCode) { this._currNode = node.finally = new Finally(); this.code(finallyCode); } return this._endBlockNode(Catch, Finally); } // `throw` statement throw(error) { return this._leafNode(new Throw(error)); } // start self-balancing block block(body, nodeCount) { this._blockStarts.push(this._nodes.length); if (body) this.code(body).endBlock(nodeCount); return this; } // end the current self-balancing block endBlock(nodeCount) { const len = this._blockStarts.pop(); if (len === undefined) throw new Error("CodeGen: not in self-balancing block"); const toClose = this._nodes.length - len; if (toClose < 0 || nodeCount !== undefined && toClose !== nodeCount) { throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`); } this._nodes.length = len; return this; } // `function` heading (or definition if funcBody is passed) func(name, args = code_1.nil, async, funcBody) { this._blockNode(new Func(name, args, async)); if (funcBody) this.code(funcBody).endFunc(); return this; } // end function definition endFunc() { return this._endBlockNode(Func); } optimize(n = 1) { while (n-- > 0) { this._root.optimizeNodes(); this._root.optimizeNames(this._root.names, this._constants); } } _leafNode(node) { this._currNode.nodes.push(node); return this; } _blockNode(node) { this._currNode.nodes.push(node); this._nodes.push(node); } _endBlockNode(N1, N2) { const n = this._currNode; if (n instanceof N1 || N2 && n instanceof N2) { this._nodes.pop(); return this; } throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`); } _elseNode(node) { const n = this._currNode; if (!(n instanceof If)) { throw new Error('CodeGen: "else" without "if"'); } this._currNode = n.else = node; return this; } get _root() { return this._nodes[0]; } get _currNode() { const ns = this._nodes; return ns[ns.length - 1]; } set _currNode(node) { const ns = this._nodes; ns[ns.length - 1] = node; } } exports.CodeGen = CodeGen; function addNames(names, from) { for (const n in from) names[n] = (names[n] || 0) + (from[n] || 0); return names; } function addExprNames(names, from) { return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names; } function optimizeExpr(expr, names, constants) { if (expr instanceof code_1.Name) return replaceName(expr); if (!canOptimize(expr)) return expr; return new code_1._Code(expr._items.reduce((items, c) => { if (c instanceof code_1.Name) c = replaceName(c); if (c instanceof code_1._Code) items.push(...c._items);else items.push(c); return items; }, [])); function replaceName(n) { const c = constants[n.str]; if (c === undefined || names[n.str] !== 1) return n; delete names[n.str]; return c; } function canOptimize(e) { return e instanceof code_1._Code && e._items.some(c => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== undefined); } } function subtractNames(names, from) { for (const n in from) names[n] = (names[n] || 0) - (from[n] || 0); } function not(x) { return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._)`!${par(x)}`; } exports.not = not; const andCode = mappend(exports.operators.AND); // boolean AND (&&) expression with the passed arguments function and(...args) { return args.reduce(andCode); } exports.and = and; const orCode = mappend(exports.operators.OR); // boolean OR (||) expression with the passed arguments function or(...args) { return args.reduce(orCode); } exports.or = or; function mappend(op) { return (x, y) => x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._)`${par(x)} ${op} ${par(y)}`; } function par(x) { return x instanceof code_1.Name ? x : (0, code_1._)`(${x})`; } /***/ }, /***/ 82440 /*!********************************************************!*\ !*** ./node_modules/ajv/dist/compile/codegen/scope.js ***! \********************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0; const code_1 = __webpack_require__(/*! ./code */ 77971); class ValueError extends Error { constructor(name) { super(`CodeGen: "code" for ${name} not defined`); this.value = name.value; } } var UsedValueState; (function (UsedValueState) { UsedValueState[UsedValueState["Started"] = 0] = "Started"; UsedValueState[UsedValueState["Completed"] = 1] = "Completed"; })(UsedValueState || (exports.UsedValueState = UsedValueState = {})); exports.varKinds = { const: new code_1.Name("const"), let: new code_1.Name("let"), var: new code_1.Name("var") }; class Scope { constructor({ prefixes, parent } = {}) { this._names = {}; this._prefixes = prefixes; this._parent = parent; } toName(nameOrPrefix) { return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix); } name(prefix) { return new code_1.Name(this._newName(prefix)); } _newName(prefix) { const ng = this._names[prefix] || this._nameGroup(prefix); return `${prefix}${ng.index++}`; } _nameGroup(prefix) { var _a, _b; if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || this._prefixes && !this._prefixes.has(prefix)) { throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`); } return this._names[prefix] = { prefix, index: 0 }; } } exports.Scope = Scope; class ValueScopeName extends code_1.Name { constructor(prefix, nameStr) { super(nameStr); this.prefix = prefix; } setValue(value, { property, itemIndex }) { this.value = value; this.scopePath = (0, code_1._)`.${new code_1.Name(property)}[${itemIndex}]`; } } exports.ValueScopeName = ValueScopeName; const line = (0, code_1._)`\n`; class ValueScope extends Scope { constructor(opts) { super(opts); this._values = {}; this._scope = opts.scope; this.opts = { ...opts, _n: opts.lines ? line : code_1.nil }; } get() { return this._scope; } name(prefix) { return new ValueScopeName(prefix, this._newName(prefix)); } value(nameOrPrefix, value) { var _a; if (value.ref === undefined) throw new Error("CodeGen: ref must be passed in value"); const name = this.toName(nameOrPrefix); const { prefix } = name; const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref; let vs = this._values[prefix]; if (vs) { const _name = vs.get(valueKey); if (_name) return _name; } else { vs = this._values[prefix] = new Map(); } vs.set(valueKey, name); const s = this._scope[prefix] || (this._scope[prefix] = []); const itemIndex = s.length; s[itemIndex] = value.ref; name.setValue(value, { property: prefix, itemIndex }); return name; } getValue(prefix, keyOrRef) { const vs = this._values[prefix]; if (!vs) return; return vs.get(keyOrRef); } scopeRefs(scopeName, values = this._values) { return this._reduceValues(values, name => { if (name.scopePath === undefined) throw new Error(`CodeGen: name "${name}" has no value`); return (0, code_1._)`${scopeName}${name.scopePath}`; }); } scopeCode(values = this._values, usedValues, getCode) { return this._reduceValues(values, name => { if (name.value === undefined) throw new Error(`CodeGen: name "${name}" has no value`); return name.value.code; }, usedValues, getCode); } _reduceValues(values, valueCode, usedValues = {}, getCode) { let code = code_1.nil; for (const prefix in values) { const vs = values[prefix]; if (!vs) continue; const nameSet = usedValues[prefix] = usedValues[prefix] || new Map(); vs.forEach(name => { if (nameSet.has(name)) return; nameSet.set(name, UsedValueState.Started); let c = valueCode(name); if (c) { const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const; code = (0, code_1._)`${code}${def} ${name} = ${c};${this.opts._n}`; } else if (c = getCode === null || getCode === void 0 ? void 0 : getCode(name)) { code = (0, code_1._)`${code}${c}${this.opts._n}`; } else { throw new ValueError(name); } nameSet.set(name, UsedValueState.Completed); }); } return code; } } exports.ValueScope = ValueScope; /***/ }, /***/ 12703 /*!*************************************************!*\ !*** ./node_modules/ajv/dist/compile/errors.js ***! \*************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0; const codegen_1 = __webpack_require__(/*! ./codegen */ 34320); const util_1 = __webpack_require__(/*! ./util */ 5156); const names_1 = __webpack_require__(/*! ./names */ 45986); exports.keywordError = { message: ({ keyword }) => (0, codegen_1.str)`must pass "${keyword}" keyword validation` }; exports.keyword$DataError = { message: ({ keyword, schemaType }) => schemaType ? (0, codegen_1.str)`"${keyword}" keyword must be ${schemaType} ($data)` : (0, codegen_1.str)`"${keyword}" keyword is invalid ($data)` }; function reportError(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) { const { it } = cxt; const { gen, compositeRule, allErrors } = it; const errObj = errorObjectCode(cxt, error, errorPaths); if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : compositeRule || allErrors) { addError(gen, errObj); } else { returnErrors(it, (0, codegen_1._)`[${errObj}]`); } } exports.reportError = reportError; function reportExtraError(cxt, error = exports.keywordError, errorPaths) { const { it } = cxt; const { gen, compositeRule, allErrors } = it; const errObj = errorObjectCode(cxt, error, errorPaths); addError(gen, errObj); if (!(compositeRule || allErrors)) { returnErrors(it, names_1.default.vErrors); } } exports.reportExtraError = reportExtraError; function resetErrorsCount(gen, errsCount) { gen.assign(names_1.default.errors, errsCount); gen.if((0, codegen_1._)`${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._)`${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null))); } exports.resetErrorsCount = resetErrorsCount; function extendErrors({ gen, keyword, schemaValue, data, errsCount, it }) { /* istanbul ignore if */ if (errsCount === undefined) throw new Error("ajv implementation error"); const err = gen.name("err"); gen.forRange("i", errsCount, names_1.default.errors, i => { gen.const(err, (0, codegen_1._)`${names_1.default.vErrors}[${i}]`); gen.if((0, codegen_1._)`${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._)`${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath))); gen.assign((0, codegen_1._)`${err}.schemaPath`, (0, codegen_1.str)`${it.errSchemaPath}/${keyword}`); if (it.opts.verbose) { gen.assign((0, codegen_1._)`${err}.schema`, schemaValue); gen.assign((0, codegen_1._)`${err}.data`, data); } }); } exports.extendErrors = extendErrors; function addError(gen, errObj) { const err = gen.const("err", errObj); gen.if((0, codegen_1._)`${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._)`[${err}]`), (0, codegen_1._)`${names_1.default.vErrors}.push(${err})`); gen.code((0, codegen_1._)`${names_1.default.errors}++`); } function returnErrors(it, errs) { const { gen, validateName, schemaEnv } = it; if (schemaEnv.$async) { gen.throw((0, codegen_1._)`new ${it.ValidationError}(${errs})`); } else { gen.assign((0, codegen_1._)`${validateName}.errors`, errs); gen.return(false); } } const E = { keyword: new codegen_1.Name("keyword"), schemaPath: new codegen_1.Name("schemaPath"), // also used in JTD errors params: new codegen_1.Name("params"), propertyName: new codegen_1.Name("propertyName"), message: new codegen_1.Name("message"), schema: new codegen_1.Name("schema"), parentSchema: new codegen_1.Name("parentSchema") }; function errorObjectCode(cxt, error, errorPaths) { const { createErrors } = cxt.it; if (createErrors === false) return (0, codegen_1._)`{}`; return errorObject(cxt, error, errorPaths); } function errorObject(cxt, error, errorPaths = {}) { const { gen, it } = cxt; const keyValues = [errorInstancePath(it, errorPaths), errorSchemaPath(cxt, errorPaths)]; extraErrorProps(cxt, error, keyValues); return gen.object(...keyValues); } function errorInstancePath({ errorPath }, { instancePath }) { const instPath = instancePath ? (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}` : errorPath; return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)]; } function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) { let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str)`${errSchemaPath}/${keyword}`; if (schemaPath) { schPath = (0, codegen_1.str)`${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`; } return [E.schemaPath, schPath]; } function extraErrorProps(cxt, { params, message }, keyValues) { const { keyword, data, schemaValue, it } = cxt; const { opts, propertyName, topSchemaRef, schemaPath } = it; keyValues.push([E.keyword, keyword], [E.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._)`{}`]); if (opts.messages) { keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]); } if (opts.verbose) { keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._)`${topSchemaRef}${schemaPath}`], [names_1.default.data, data]); } if (propertyName) keyValues.push([E.propertyName, propertyName]); } /***/ }, /***/ 8218 /*!************************************************!*\ !*** ./node_modules/ajv/dist/compile/index.js ***! \************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0; const codegen_1 = __webpack_require__(/*! ./codegen */ 34320); const validation_error_1 = __webpack_require__(/*! ../runtime/validation_error */ 22409); const names_1 = __webpack_require__(/*! ./names */ 45986); const resolve_1 = __webpack_require__(/*! ./resolve */ 37302); const util_1 = __webpack_require__(/*! ./util */ 5156); const validate_1 = __webpack_require__(/*! ./validate */ 16381); class SchemaEnv { constructor(env) { var _a; this.refs = {}; this.dynamicAnchors = {}; let schema; if (typeof env.schema == "object") schema = env.schema; this.schema = env.schema; this.schemaId = env.schemaId; this.root = env.root || this; this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || "$id"]); this.schemaPath = env.schemaPath; this.localRefs = env.localRefs; this.meta = env.meta; this.$async = schema === null || schema === void 0 ? void 0 : schema.$async; this.refs = {}; } } exports.SchemaEnv = SchemaEnv; // let codeSize = 0 // let nodeCount = 0 // Compiles schema in SchemaEnv function compileSchema(sch) { // TODO refactor - remove compilations const _sch = getCompilingSchema.call(this, sch); if (_sch) return _sch; const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId); // TODO if getFullPath removed 1 tests fails const { es5, lines } = this.opts.code; const { ownProperties } = this.opts; const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); let _ValidationError; if (sch.$async) { _ValidationError = gen.scopeValue("Error", { ref: validation_error_1.default, code: (0, codegen_1._)`require("ajv/dist/runtime/validation_error").default` }); } const validateName = gen.scopeName("validate"); sch.validateName = validateName; const schemaCxt = { gen, allErrors: this.opts.allErrors, data: names_1.default.data, parentData: names_1.default.parentData, parentDataProperty: names_1.default.parentDataProperty, dataNames: [names_1.default.data], dataPathArr: [codegen_1.nil], // TODO can its length be used as dataLevel if nil is removed? dataLevel: 0, dataTypes: [], definedProperties: new Set(), topSchemaRef: gen.scopeValue("schema", this.opts.code.source === true ? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) } : { ref: sch.schema }), validateName, ValidationError: _ValidationError, schema: sch.schema, schemaEnv: sch, rootId, baseId: sch.baseId || rootId, schemaPath: codegen_1.nil, errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"), errorPath: (0, codegen_1._)`""`, opts: this.opts, self: this }; let sourceCode; try { this._compilations.add(sch); (0, validate_1.validateFunctionCode)(schemaCxt); gen.optimize(this.opts.code.optimize); // gen.optimize(1) const validateCode = gen.toString(); sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`; // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount)) if (this.opts.code.process) sourceCode = this.opts.code.process(sourceCode, sch); // console.log("\n\n\n *** \n", sourceCode) const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode); const validate = makeValidate(this, this.scope.get()); this.scope.value(validateName, { ref: validate }); validate.errors = null; validate.schema = sch.schema; validate.schemaEnv = sch; if (sch.$async) validate.$async = true; if (this.opts.code.source === true) { validate.source = { validateName, validateCode, scopeValues: gen._values }; } if (this.opts.unevaluated) { const { props, items } = schemaCxt; validate.evaluated = { props: props instanceof codegen_1.Name ? undefined : props, items: items instanceof codegen_1.Name ? undefined : items, dynamicProps: props instanceof codegen_1.Name, dynamicItems: items instanceof codegen_1.Name }; if (validate.source) validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated); } sch.validate = validate; return sch; } catch (e) { delete sch.validate; delete sch.validateName; if (sourceCode) this.logger.error("Error compiling schema, function code:", sourceCode); // console.log("\n\n\n *** \n", sourceCode, this.opts) throw e; } finally { this._compilations.delete(sch); } } exports.compileSchema = compileSchema; function resolveRef(root, baseId, ref) { var _a; ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref); const schOrFunc = root.refs[ref]; if (schOrFunc) return schOrFunc; let _sch = resolve.call(this, root, ref); if (_sch === undefined) { const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; // TODO maybe localRefs should hold SchemaEnv const { schemaId } = this.opts; if (schema) _sch = new SchemaEnv({ schema, schemaId, root, baseId }); } if (_sch === undefined) return; return root.refs[ref] = inlineOrCompile.call(this, _sch); } exports.resolveRef = resolveRef; function inlineOrCompile(sch) { if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs)) return sch.schema; return sch.validate ? sch : compileSchema.call(this, sch); } // Index of schema compilation in the currently compiled list function getCompilingSchema(schEnv) { for (const sch of this._compilations) { if (sameSchemaEnv(sch, schEnv)) return sch; } } exports.getCompilingSchema = getCompilingSchema; function sameSchemaEnv(s1, s2) { return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId; } // resolve and compile the references ($ref) // TODO returns AnySchemaObject (if the schema can be inlined) or validation function function resolve(root, // information about the root schema for the current schema ref // reference to resolve ) { let sch; while (typeof (sch = this.refs[ref]) == "string") ref = sch; return sch || this.schemas[ref] || resolveSchema.call(this, root, ref); } // Resolve schema, its root and baseId function resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it ref // reference to resolve ) { const p = this.opts.uriResolver.parse(ref); const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p); let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, undefined); // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests if (Object.keys(root.schema).length > 0 && refPath === baseId) { return getJsonPointer.call(this, p, root); } const id = (0, resolve_1.normalizeId)(refPath); const schOrRef = this.refs[id] || this.schemas[id]; if (typeof schOrRef == "string") { const sch = resolveSchema.call(this, root, schOrRef); if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object") return; return getJsonPointer.call(this, p, sch); } if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object") return; if (!schOrRef.validate) compileSchema.call(this, schOrRef); if (id === (0, resolve_1.normalizeId)(ref)) { const { schema } = schOrRef; const { schemaId } = this.opts; const schId = schema[schemaId]; if (schId) baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); return new SchemaEnv({ schema, schemaId, root, baseId }); } return getJsonPointer.call(this, p, schOrRef); } exports.resolveSchema = resolveSchema; const PREVENT_SCOPE_CHANGE = new Set(["properties", "patternProperties", "enum", "dependencies", "definitions"]); function getJsonPointer(parsedRef, { baseId, schema, root }) { var _a; if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== "/") return; for (const part of parsedRef.fragment.slice(1).split("/")) { if (typeof schema === "boolean") return; const partSchema = schema[(0, util_1.unescapeFragment)(part)]; if (partSchema === undefined) return; schema = partSchema; // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def? const schId = typeof schema === "object" && schema[this.opts.schemaId]; if (!PREVENT_SCOPE_CHANGE.has(part) && schId) { baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); } } let env; if (typeof schema != "boolean" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) { const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref); env = resolveSchema.call(this, root, $ref); } // even though resolution failed we need to return SchemaEnv to throw exception // so that compileAsync loads missing schema. const { schemaId } = this.opts; env = env || new SchemaEnv({ schema, schemaId, root, baseId }); if (env.schema !== env.root.schema) return env; return undefined; } /***/ }, /***/ 45986 /*!************************************************!*\ !*** ./node_modules/ajv/dist/compile/names.js ***! \************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ./codegen */ 34320); const names = { // validation function arguments data: new codegen_1.Name("data"), // data passed to validation function // args passed from referencing schema valCxt: new codegen_1.Name("valCxt"), // validation/data context - should not be used directly, it is destructured to the names below instancePath: new codegen_1.Name("instancePath"), parentData: new codegen_1.Name("parentData"), parentDataProperty: new codegen_1.Name("parentDataProperty"), rootData: new codegen_1.Name("rootData"), // root data - same as the data passed to the first/top validation function dynamicAnchors: new codegen_1.Name("dynamicAnchors"), // used to support recursiveRef and dynamicRef // function scoped variables vErrors: new codegen_1.Name("vErrors"), // null or array of validation errors errors: new codegen_1.Name("errors"), // counter of validation errors this: new codegen_1.Name("this"), // "globals" self: new codegen_1.Name("self"), scope: new codegen_1.Name("scope"), // JTD serialize/parse name for JSON string and position json: new codegen_1.Name("json"), jsonPos: new codegen_1.Name("jsonPos"), jsonLen: new codegen_1.Name("jsonLen"), jsonPart: new codegen_1.Name("jsonPart") }; exports["default"] = names; /***/ }, /***/ 55654 /*!****************************************************!*\ !*** ./node_modules/ajv/dist/compile/ref_error.js ***! \****************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const resolve_1 = __webpack_require__(/*! ./resolve */ 37302); class MissingRefError extends Error { constructor(resolver, baseId, ref, msg) { super(msg || `can't resolve reference ${ref} from id ${baseId}`); this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref); this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef)); } } exports["default"] = MissingRefError; /***/ }, /***/ 37302 /*!**************************************************!*\ !*** ./node_modules/ajv/dist/compile/resolve.js ***! \**************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0; const util_1 = __webpack_require__(/*! ./util */ 5156); const equal = __webpack_require__(/*! fast-deep-equal */ 33778); const traverse = __webpack_require__(/*! json-schema-traverse */ 17603); // TODO refactor to use keyword definitions const SIMPLE_INLINED = new Set(["type", "format", "pattern", "maxLength", "minLength", "maxProperties", "minProperties", "maxItems", "minItems", "maximum", "minimum", "uniqueItems", "multipleOf", "required", "enum", "const"]); function inlineRef(schema, limit = true) { if (typeof schema == "boolean") return true; if (limit === true) return !hasRef(schema); if (!limit) return false; return countKeys(schema) <= limit; } exports.inlineRef = inlineRef; const REF_KEYWORDS = new Set(["$ref", "$recursiveRef", "$recursiveAnchor", "$dynamicRef", "$dynamicAnchor"]); function hasRef(schema) { for (const key in schema) { if (REF_KEYWORDS.has(key)) return true; const sch = schema[key]; if (Array.isArray(sch) && sch.some(hasRef)) return true; if (typeof sch == "object" && hasRef(sch)) return true; } return false; } function countKeys(schema) { let count = 0; for (const key in schema) { if (key === "$ref") return Infinity; count++; if (SIMPLE_INLINED.has(key)) continue; if (typeof schema[key] == "object") { (0, util_1.eachItem)(schema[key], sch => count += countKeys(sch)); } if (count === Infinity) return Infinity; } return count; } function getFullPath(resolver, id = "", normalize) { if (normalize !== false) id = normalizeId(id); const p = resolver.parse(id); return _getFullPath(resolver, p); } exports.getFullPath = getFullPath; function _getFullPath(resolver, p) { const serialized = resolver.serialize(p); return serialized.split("#")[0] + "#"; } exports._getFullPath = _getFullPath; const TRAILING_SLASH_HASH = /#\/?$/; function normalizeId(id) { return id ? id.replace(TRAILING_SLASH_HASH, "") : ""; } exports.normalizeId = normalizeId; function resolveUrl(resolver, baseId, id) { id = normalizeId(id); return resolver.resolve(baseId, id); } exports.resolveUrl = resolveUrl; const ANCHOR = /^[a-z_][-a-z0-9._]*$/i; function getSchemaRefs(schema, baseId) { if (typeof schema == "boolean") return {}; const { schemaId, uriResolver } = this.opts; const schId = normalizeId(schema[schemaId] || baseId); const baseIds = { "": schId }; const pathPrefix = getFullPath(uriResolver, schId, false); const localRefs = {}; const schemaRefs = new Set(); traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => { if (parentJsonPtr === undefined) return; const fullPath = pathPrefix + jsonPtr; let innerBaseId = baseIds[parentJsonPtr]; if (typeof sch[schemaId] == "string") innerBaseId = addRef.call(this, sch[schemaId]); addAnchor.call(this, sch.$anchor); addAnchor.call(this, sch.$dynamicAnchor); baseIds[jsonPtr] = innerBaseId; function addRef(ref) { // eslint-disable-next-line @typescript-eslint/unbound-method const _resolve = this.opts.uriResolver.resolve; ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref); if (schemaRefs.has(ref)) throw ambiguos(ref); schemaRefs.add(ref); let schOrRef = this.refs[ref]; if (typeof schOrRef == "string") schOrRef = this.refs[schOrRef]; if (typeof schOrRef == "object") { checkAmbiguosRef(sch, schOrRef.schema, ref); } else if (ref !== normalizeId(fullPath)) { if (ref[0] === "#") { checkAmbiguosRef(sch, localRefs[ref], ref); localRefs[ref] = sch; } else { this.refs[ref] = fullPath; } } return ref; } function addAnchor(anchor) { if (typeof anchor == "string") { if (!ANCHOR.test(anchor)) throw new Error(`invalid anchor "${anchor}"`); addRef.call(this, `#${anchor}`); } } }); return localRefs; function checkAmbiguosRef(sch1, sch2, ref) { if (sch2 !== undefined && !equal(sch1, sch2)) throw ambiguos(ref); } function ambiguos(ref) { return new Error(`reference "${ref}" resolves to more than one schema`); } } exports.getSchemaRefs = getSchemaRefs; /***/ }, /***/ 22133 /*!************************************************!*\ !*** ./node_modules/ajv/dist/compile/rules.js ***! \************************************************/ (__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getRules = exports.isJSONType = void 0; const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"]; const jsonTypes = new Set(_jsonTypes); function isJSONType(x) { return typeof x == "string" && jsonTypes.has(x); } exports.isJSONType = isJSONType; function getRules() { const groups = { number: { type: "number", rules: [] }, string: { type: "string", rules: [] }, array: { type: "array", rules: [] }, object: { type: "object", rules: [] } }; return { types: { ...groups, integer: true, boolean: true, null: true }, rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object], post: { rules: [] }, all: {}, keywords: {} }; } exports.getRules = getRules; /***/ }, /***/ 5156 /*!***********************************************!*\ !*** ./node_modules/ajv/dist/compile/util.js ***! \***********************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0; const codegen_1 = __webpack_require__(/*! ./codegen */ 34320); const code_1 = __webpack_require__(/*! ./codegen/code */ 77971); // TODO refactor to use Set function toHash(arr) { const hash = {}; for (const item of arr) hash[item] = true; return hash; } exports.toHash = toHash; function alwaysValidSchema(it, schema) { if (typeof schema == "boolean") return schema; if (Object.keys(schema).length === 0) return true; checkUnknownRules(it, schema); return !schemaHasRules(schema, it.self.RULES.all); } exports.alwaysValidSchema = alwaysValidSchema; function checkUnknownRules(it, schema = it.schema) { const { opts, self } = it; if (!opts.strictSchema) return; if (typeof schema === "boolean") return; const rules = self.RULES.keywords; for (const key in schema) { if (!rules[key]) checkStrictMode(it, `unknown keyword: "${key}"`); } } exports.checkUnknownRules = checkUnknownRules; function schemaHasRules(schema, rules) { if (typeof schema == "boolean") return !schema; for (const key in schema) if (rules[key]) return true; return false; } exports.schemaHasRules = schemaHasRules; function schemaHasRulesButRef(schema, RULES) { if (typeof schema == "boolean") return !schema; for (const key in schema) if (key !== "$ref" && RULES.all[key]) return true; return false; } exports.schemaHasRulesButRef = schemaHasRulesButRef; function schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) { if (!$data) { if (typeof schema == "number" || typeof schema == "boolean") return schema; if (typeof schema == "string") return (0, codegen_1._)`${schema}`; } return (0, codegen_1._)`${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`; } exports.schemaRefOrVal = schemaRefOrVal; function unescapeFragment(str) { return unescapeJsonPointer(decodeURIComponent(str)); } exports.unescapeFragment = unescapeFragment; function escapeFragment(str) { return encodeURIComponent(escapeJsonPointer(str)); } exports.escapeFragment = escapeFragment; function escapeJsonPointer(str) { if (typeof str == "number") return `${str}`; return str.replace(/~/g, "~0").replace(/\//g, "~1"); } exports.escapeJsonPointer = escapeJsonPointer; function unescapeJsonPointer(str) { return str.replace(/~1/g, "/").replace(/~0/g, "~"); } exports.unescapeJsonPointer = unescapeJsonPointer; function eachItem(xs, f) { if (Array.isArray(xs)) { for (const x of xs) f(x); } else { f(xs); } } exports.eachItem = eachItem; function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName }) { return (gen, from, to, toName) => { const res = to === undefined ? from : to instanceof codegen_1.Name ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) : from instanceof codegen_1.Name ? (mergeToName(gen, to, from), from) : mergeValues(from, to); return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res; }; } exports.mergeEvaluated = { props: makeMergeEvaluated({ mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => { gen.if((0, codegen_1._)`${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._)`${to} || {}`).code((0, codegen_1._)`Object.assign(${to}, ${from})`)); }), mergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => { if (from === true) { gen.assign(to, true); } else { gen.assign(to, (0, codegen_1._)`${to} || {}`); setEvaluated(gen, to, from); } }), mergeValues: (from, to) => from === true ? true : { ...from, ...to }, resultToName: evaluatedPropsToName }), items: makeMergeEvaluated({ mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._)`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)), mergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._)`${to} > ${from} ? ${to} : ${from}`)), mergeValues: (from, to) => from === true ? true : Math.max(from, to), resultToName: (gen, items) => gen.var("items", items) }) }; function evaluatedPropsToName(gen, ps) { if (ps === true) return gen.var("props", true); const props = gen.var("props", (0, codegen_1._)`{}`); if (ps !== undefined) setEvaluated(gen, props, ps); return props; } exports.evaluatedPropsToName = evaluatedPropsToName; function setEvaluated(gen, props, ps) { Object.keys(ps).forEach(p => gen.assign((0, codegen_1._)`${props}${(0, codegen_1.getProperty)(p)}`, true)); } exports.setEvaluated = setEvaluated; const snippets = {}; function useFunc(gen, f) { return gen.scopeValue("func", { ref: f, code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code)) }); } exports.useFunc = useFunc; var Type; (function (Type) { Type[Type["Num"] = 0] = "Num"; Type[Type["Str"] = 1] = "Str"; })(Type || (exports.Type = Type = {})); function getErrorPath(dataProp, dataPropType, jsPropertySyntax) { // let path if (dataProp instanceof codegen_1.Name) { const isNumber = dataPropType === Type.Num; return jsPropertySyntax ? isNumber ? (0, codegen_1._)`"[" + ${dataProp} + "]"` : (0, codegen_1._)`"['" + ${dataProp} + "']"` : isNumber ? (0, codegen_1._)`"/" + ${dataProp}` : (0, codegen_1._)`"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; // TODO maybe use global escapePointer } return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp); } exports.getErrorPath = getErrorPath; function checkStrictMode(it, msg, mode = it.opts.strictSchema) { if (!mode) return; msg = `strict mode: ${msg}`; if (mode === true) throw new Error(msg); it.self.logger.warn(msg); } exports.checkStrictMode = checkStrictMode; /***/ }, /***/ 65536 /*!*****************************************************************!*\ !*** ./node_modules/ajv/dist/compile/validate/applicability.js ***! \*****************************************************************/ (__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0; function schemaHasRulesForType({ schema, self }, type) { const group = self.RULES.types[type]; return group && group !== true && shouldUseGroup(schema, group); } exports.schemaHasRulesForType = schemaHasRulesForType; function shouldUseGroup(schema, group) { return group.rules.some(rule => shouldUseRule(schema, rule)); } exports.shouldUseGroup = shouldUseGroup; function shouldUseRule(schema, rule) { var _a; return schema[rule.keyword] !== undefined || ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some(kwd => schema[kwd] !== undefined)); } exports.shouldUseRule = shouldUseRule; /***/ }, /***/ 29150 /*!**************************************************************!*\ !*** ./node_modules/ajv/dist/compile/validate/boolSchema.js ***! \**************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0; const errors_1 = __webpack_require__(/*! ../errors */ 12703); const codegen_1 = __webpack_require__(/*! ../codegen */ 34320); const names_1 = __webpack_require__(/*! ../names */ 45986); const boolError = { message: "boolean schema is false" }; function topBoolOrEmptySchema(it) { const { gen, schema, validateName } = it; if (schema === false) { falseSchemaError(it, false); } else if (typeof schema == "object" && schema.$async === true) { gen.return(names_1.default.data); } else { gen.assign((0, codegen_1._)`${validateName}.errors`, null); gen.return(true); } } exports.topBoolOrEmptySchema = topBoolOrEmptySchema; function boolOrEmptySchema(it, valid) { const { gen, schema } = it; if (schema === false) { gen.var(valid, false); // TODO var falseSchemaError(it); } else { gen.var(valid, true); // TODO var } } exports.boolOrEmptySchema = boolOrEmptySchema; function falseSchemaError(it, overrideAllErrors) { const { gen, data } = it; // TODO maybe some other interface should be used for non-keyword validation errors... const cxt = { gen, keyword: "false schema", data, schema: false, schemaCode: false, schemaValue: false, params: {}, it }; (0, errors_1.reportError)(cxt, boolError, undefined, overrideAllErrors); } /***/ }, /***/ 4545 /*!************************************************************!*\ !*** ./node_modules/ajv/dist/compile/validate/dataType.js ***! \************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0; const rules_1 = __webpack_require__(/*! ../rules */ 22133); const applicability_1 = __webpack_require__(/*! ./applicability */ 65536); const errors_1 = __webpack_require__(/*! ../errors */ 12703); const codegen_1 = __webpack_require__(/*! ../codegen */ 34320); const util_1 = __webpack_require__(/*! ../util */ 5156); var DataType; (function (DataType) { DataType[DataType["Correct"] = 0] = "Correct"; DataType[DataType["Wrong"] = 1] = "Wrong"; })(DataType || (exports.DataType = DataType = {})); function getSchemaTypes(schema) { const types = getJSONTypes(schema.type); const hasNull = types.includes("null"); if (hasNull) { if (schema.nullable === false) throw new Error("type: null contradicts nullable: false"); } else { if (!types.length && schema.nullable !== undefined) { throw new Error('"nullable" cannot be used without "type"'); } if (schema.nullable === true) types.push("null"); } return types; } exports.getSchemaTypes = getSchemaTypes; // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents function getJSONTypes(ts) { const types = Array.isArray(ts) ? ts : ts ? [ts] : []; if (types.every(rules_1.isJSONType)) return types; throw new Error("type must be JSONType or JSONType[]: " + types.join(",")); } exports.getJSONTypes = getJSONTypes; function coerceAndCheckDataType(it, types) { const { gen, data, opts } = it; const coerceTo = coerceToTypes(types, opts.coerceTypes); const checkTypes = types.length > 0 && !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0])); if (checkTypes) { const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong); gen.if(wrongType, () => { if (coerceTo.length) coerceData(it, types, coerceTo);else reportTypeError(it); }); } return checkTypes; } exports.coerceAndCheckDataType = coerceAndCheckDataType; const COERCIBLE = new Set(["string", "number", "integer", "boolean", "null"]); function coerceToTypes(types, coerceTypes) { return coerceTypes ? types.filter(t => COERCIBLE.has(t) || coerceTypes === "array" && t === "array") : []; } function coerceData(it, types, coerceTo) { const { gen, data, opts } = it; const dataType = gen.let("dataType", (0, codegen_1._)`typeof ${data}`); const coerced = gen.let("coerced", (0, codegen_1._)`undefined`); if (opts.coerceTypes === "array") { gen.if((0, codegen_1._)`${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen.assign(data, (0, codegen_1._)`${data}[0]`).assign(dataType, (0, codegen_1._)`typeof ${data}`).if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data))); } gen.if((0, codegen_1._)`${coerced} !== undefined`); for (const t of coerceTo) { if (COERCIBLE.has(t) || t === "array" && opts.coerceTypes === "array") { coerceSpecificType(t); } } gen.else(); reportTypeError(it); gen.endIf(); gen.if((0, codegen_1._)`${coerced} !== undefined`, () => { gen.assign(data, coerced); assignParentData(it, coerced); }); function coerceSpecificType(t) { switch (t) { case "string": gen.elseIf((0, codegen_1._)`${dataType} == "number" || ${dataType} == "boolean"`).assign(coerced, (0, codegen_1._)`"" + ${data}`).elseIf((0, codegen_1._)`${data} === null`).assign(coerced, (0, codegen_1._)`""`); return; case "number": gen.elseIf((0, codegen_1._)`${dataType} == "boolean" || ${data} === null || (${dataType} == "string" && ${data} && ${data} == +${data})`).assign(coerced, (0, codegen_1._)`+${data}`); return; case "integer": gen.elseIf((0, codegen_1._)`${dataType} === "boolean" || ${data} === null || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`).assign(coerced, (0, codegen_1._)`+${data}`); return; case "boolean": gen.elseIf((0, codegen_1._)`${data} === "false" || ${data} === 0 || ${data} === null`).assign(coerced, false).elseIf((0, codegen_1._)`${data} === "true" || ${data} === 1`).assign(coerced, true); return; case "null": gen.elseIf((0, codegen_1._)`${data} === "" || ${data} === 0 || ${data} === false`); gen.assign(coerced, null); return; case "array": gen.elseIf((0, codegen_1._)`${dataType} === "string" || ${dataType} === "number" || ${dataType} === "boolean" || ${data} === null`).assign(coerced, (0, codegen_1._)`[${data}]`); } } } function assignParentData({ gen, parentData, parentDataProperty }, expr) { // TODO use gen.property gen.if((0, codegen_1._)`${parentData} !== undefined`, () => gen.assign((0, codegen_1._)`${parentData}[${parentDataProperty}]`, expr)); } function checkDataType(dataType, data, strictNums, correct = DataType.Correct) { const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ; let cond; switch (dataType) { case "null": return (0, codegen_1._)`${data} ${EQ} null`; case "array": cond = (0, codegen_1._)`Array.isArray(${data})`; break; case "object": cond = (0, codegen_1._)`${data} && typeof ${data} == "object" && !Array.isArray(${data})`; break; case "integer": cond = numCond((0, codegen_1._)`!(${data} % 1) && !isNaN(${data})`); break; case "number": cond = numCond(); break; default: return (0, codegen_1._)`typeof ${data} ${EQ} ${dataType}`; } return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond); function numCond(_cond = codegen_1.nil) { return (0, codegen_1.and)((0, codegen_1._)`typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1._)`isFinite(${data})` : codegen_1.nil); } } exports.checkDataType = checkDataType; function checkDataTypes(dataTypes, data, strictNums, correct) { if (dataTypes.length === 1) { return checkDataType(dataTypes[0], data, strictNums, correct); } let cond; const types = (0, util_1.toHash)(dataTypes); if (types.array && types.object) { const notObj = (0, codegen_1._)`typeof ${data} != "object"`; cond = types.null ? notObj : (0, codegen_1._)`!${data} || ${notObj}`; delete types.null; delete types.array; delete types.object; } else { cond = codegen_1.nil; } if (types.number) delete types.integer; for (const t in types) cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct)); return cond; } exports.checkDataTypes = checkDataTypes; const typeError = { message: ({ schema }) => `must be ${schema}`, params: ({ schema, schemaValue }) => typeof schema == "string" ? (0, codegen_1._)`{type: ${schema}}` : (0, codegen_1._)`{type: ${schemaValue}}` }; function reportTypeError(it) { const cxt = getTypeErrorContext(it); (0, errors_1.reportError)(cxt, typeError); } exports.reportTypeError = reportTypeError; function getTypeErrorContext(it) { const { gen, data, schema } = it; const schemaCode = (0, util_1.schemaRefOrVal)(it, schema, "type"); return { gen, keyword: "type", data, schema: schema.type, schemaCode, schemaValue: schemaCode, parentSchema: schema, params: {}, it }; } /***/ }, /***/ 43639 /*!************************************************************!*\ !*** ./node_modules/ajv/dist/compile/validate/defaults.js ***! \************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.assignDefaults = void 0; const codegen_1 = __webpack_require__(/*! ../codegen */ 34320); const util_1 = __webpack_require__(/*! ../util */ 5156); function assignDefaults(it, ty) { const { properties, items } = it.schema; if (ty === "object" && properties) { for (const key in properties) { assignDefault(it, key, properties[key].default); } } else if (ty === "array" && Array.isArray(items)) { items.forEach((sch, i) => assignDefault(it, i, sch.default)); } } exports.assignDefaults = assignDefaults; function assignDefault(it, prop, defaultValue) { const { gen, compositeRule, data, opts } = it; if (defaultValue === undefined) return; const childData = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(prop)}`; if (compositeRule) { (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`); return; } let condition = (0, codegen_1._)`${childData} === undefined`; if (opts.useDefaults === "empty") { condition = (0, codegen_1._)`${condition} || ${childData} === null || ${childData} === ""`; } // `${childData} === undefined` + // (opts.useDefaults === "empty" ? ` || ${childData} === null || ${childData} === ""` : "") gen.if(condition, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`); } /***/ }, /***/ 16381 /*!*********************************************************!*\ !*** ./node_modules/ajv/dist/compile/validate/index.js ***! \*********************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0; const boolSchema_1 = __webpack_require__(/*! ./boolSchema */ 29150); const dataType_1 = __webpack_require__(/*! ./dataType */ 4545); const applicability_1 = __webpack_require__(/*! ./applicability */ 65536); const dataType_2 = __webpack_require__(/*! ./dataType */ 4545); const defaults_1 = __webpack_require__(/*! ./defaults */ 43639); const keyword_1 = __webpack_require__(/*! ./keyword */ 46414); const subschema_1 = __webpack_require__(/*! ./subschema */ 5900); const codegen_1 = __webpack_require__(/*! ../codegen */ 34320); const names_1 = __webpack_require__(/*! ../names */ 45986); const resolve_1 = __webpack_require__(/*! ../resolve */ 37302); const util_1 = __webpack_require__(/*! ../util */ 5156); const errors_1 = __webpack_require__(/*! ../errors */ 12703); // schema compilation - generates validation function, subschemaCode (below) is used for subschemas function validateFunctionCode(it) { if (isSchemaObj(it)) { checkKeywords(it); if (schemaCxtHasRules(it)) { topSchemaObjCode(it); return; } } validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it)); } exports.validateFunctionCode = validateFunctionCode; function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) { if (opts.code.es5) { gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => { gen.code((0, codegen_1._)`"use strict"; ${funcSourceUrl(schema, opts)}`); destructureValCxtES5(gen, opts); gen.code(body); }); } else { gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body)); } } function destructureValCxt(opts) { return (0, codegen_1._)`{${names_1.default.instancePath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._)`, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`; } function destructureValCxtES5(gen, opts) { gen.if(names_1.default.valCxt, () => { gen.var(names_1.default.instancePath, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.instancePath}`); gen.var(names_1.default.parentData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentData}`); gen.var(names_1.default.parentDataProperty, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentDataProperty}`); gen.var(names_1.default.rootData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.rootData}`); if (opts.dynamicRef) gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`); }, () => { gen.var(names_1.default.instancePath, (0, codegen_1._)`""`); gen.var(names_1.default.parentData, (0, codegen_1._)`undefined`); gen.var(names_1.default.parentDataProperty, (0, codegen_1._)`undefined`); gen.var(names_1.default.rootData, names_1.default.data); if (opts.dynamicRef) gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`{}`); }); } function topSchemaObjCode(it) { const { schema, opts, gen } = it; validateFunction(it, () => { if (opts.$comment && schema.$comment) commentKeyword(it); checkNoDefault(it); gen.let(names_1.default.vErrors, null); gen.let(names_1.default.errors, 0); if (opts.unevaluated) resetEvaluated(it); typeAndKeywords(it); returnResults(it); }); return; } function resetEvaluated(it) { // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated const { gen, validateName } = it; it.evaluated = gen.const("evaluated", (0, codegen_1._)`${validateName}.evaluated`); gen.if((0, codegen_1._)`${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._)`${it.evaluated}.props`, (0, codegen_1._)`undefined`)); gen.if((0, codegen_1._)`${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._)`${it.evaluated}.items`, (0, codegen_1._)`undefined`)); } function funcSourceUrl(schema, opts) { const schId = typeof schema == "object" && schema[opts.schemaId]; return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._)`/*# sourceURL=${schId} */` : codegen_1.nil; } // schema compilation - this function is used recursively to generate code for sub-schemas function subschemaCode(it, valid) { if (isSchemaObj(it)) { checkKeywords(it); if (schemaCxtHasRules(it)) { subSchemaObjCode(it, valid); return; } } (0, boolSchema_1.boolOrEmptySchema)(it, valid); } function schemaCxtHasRules({ schema, self }) { if (typeof schema == "boolean") return !schema; for (const key in schema) if (self.RULES.all[key]) return true; return false; } function isSchemaObj(it) { return typeof it.schema != "boolean"; } function subSchemaObjCode(it, valid) { const { schema, gen, opts } = it; if (opts.$comment && schema.$comment) commentKeyword(it); updateContext(it); checkAsyncSchema(it); const errsCount = gen.const("_errs", names_1.default.errors); typeAndKeywords(it, errsCount); // TODO var gen.var(valid, (0, codegen_1._)`${errsCount} === ${names_1.default.errors}`); } function checkKeywords(it) { (0, util_1.checkUnknownRules)(it); checkRefsAndKeywords(it); } function typeAndKeywords(it, errsCount) { if (it.opts.jtd) return schemaKeywords(it, [], false, errsCount); const types = (0, dataType_1.getSchemaTypes)(it.schema); const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types); schemaKeywords(it, types, !checkedTypes, errsCount); } function checkRefsAndKeywords(it) { const { schema, errSchemaPath, opts, self } = it; if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self.RULES)) { self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`); } } function checkNoDefault(it) { const { schema, opts } = it; if (schema.default !== undefined && opts.useDefaults && opts.strictSchema) { (0, util_1.checkStrictMode)(it, "default is ignored in the schema root"); } } function updateContext(it) { const schId = it.schema[it.opts.schemaId]; if (schId) it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId); } function checkAsyncSchema(it) { if (it.schema.$async && !it.schemaEnv.$async) throw new Error("async schema in sync schema"); } function commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) { const msg = schema.$comment; if (opts.$comment === true) { gen.code((0, codegen_1._)`${names_1.default.self}.logger.log(${msg})`); } else if (typeof opts.$comment == "function") { const schemaPath = (0, codegen_1.str)`${errSchemaPath}/$comment`; const rootName = gen.scopeValue("root", { ref: schemaEnv.root }); gen.code((0, codegen_1._)`${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`); } } function returnResults(it) { const { gen, schemaEnv, validateName, ValidationError, opts } = it; if (schemaEnv.$async) { // TODO assign unevaluated gen.if((0, codegen_1._)`${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._)`new ${ValidationError}(${names_1.default.vErrors})`)); } else { gen.assign((0, codegen_1._)`${validateName}.errors`, names_1.default.vErrors); if (opts.unevaluated) assignEvaluated(it); gen.return((0, codegen_1._)`${names_1.default.errors} === 0`); } } function assignEvaluated({ gen, evaluated, props, items }) { if (props instanceof codegen_1.Name) gen.assign((0, codegen_1._)`${evaluated}.props`, props); if (items instanceof codegen_1.Name) gen.assign((0, codegen_1._)`${evaluated}.items`, items); } function schemaKeywords(it, types, typeErrors, errsCount) { const { gen, schema, data, allErrors, opts, self } = it; const { RULES } = self; if (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) { gen.block(() => keywordCode(it, "$ref", RULES.all.$ref.definition)); // TODO typecast return; } if (!opts.jtd) checkStrictTypes(it, types); gen.block(() => { for (const group of RULES.rules) groupKeywords(group); groupKeywords(RULES.post); }); function groupKeywords(group) { if (!(0, applicability_1.shouldUseGroup)(schema, group)) return; if (group.type) { gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers)); iterateKeywords(it, group); if (types.length === 1 && types[0] === group.type && typeErrors) { gen.else(); (0, dataType_2.reportTypeError)(it); } gen.endIf(); } else { iterateKeywords(it, group); } // TODO make it "ok" call? if (!allErrors) gen.if((0, codegen_1._)`${names_1.default.errors} === ${errsCount || 0}`); } } function iterateKeywords(it, group) { const { gen, schema, opts: { useDefaults } } = it; if (useDefaults) (0, defaults_1.assignDefaults)(it, group.type); gen.block(() => { for (const rule of group.rules) { if ((0, applicability_1.shouldUseRule)(schema, rule)) { keywordCode(it, rule.keyword, rule.definition, group.type); } } }); } function checkStrictTypes(it, types) { if (it.schemaEnv.meta || !it.opts.strictTypes) return; checkContextTypes(it, types); if (!it.opts.allowUnionTypes) checkMultipleTypes(it, types); checkKeywordTypes(it, it.dataTypes); } function checkContextTypes(it, types) { if (!types.length) return; if (!it.dataTypes.length) { it.dataTypes = types; return; } types.forEach(t => { if (!includesType(it.dataTypes, t)) { strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`); } }); narrowSchemaTypes(it, types); } function checkMultipleTypes(it, ts) { if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) { strictTypesError(it, "use allowUnionTypes to allow union type keyword"); } } function checkKeywordTypes(it, ts) { const rules = it.self.RULES.all; for (const keyword in rules) { const rule = rules[keyword]; if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) { const { type } = rule.definition; if (type.length && !type.some(t => hasApplicableType(ts, t))) { strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`); } } } } function hasApplicableType(schTs, kwdT) { return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer"); } function includesType(ts, t) { return ts.includes(t) || t === "integer" && ts.includes("number"); } function narrowSchemaTypes(it, withTypes) { const ts = []; for (const t of it.dataTypes) { if (includesType(withTypes, t)) ts.push(t);else if (withTypes.includes("integer") && t === "number") ts.push("integer"); } it.dataTypes = ts; } function strictTypesError(it, msg) { const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; msg += ` at "${schemaPath}" (strictTypes)`; (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes); } class KeywordCxt { constructor(it, def, keyword) { (0, keyword_1.validateKeywordUsage)(it, def, keyword); this.gen = it.gen; this.allErrors = it.allErrors; this.keyword = keyword; this.data = it.data; this.schema = it.schema[keyword]; this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data; this.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data); this.schemaType = def.schemaType; this.parentSchema = it.schema; this.params = {}; this.it = it; this.def = def; if (this.$data) { this.schemaCode = it.gen.const("vSchema", getData(this.$data, it)); } else { this.schemaCode = this.schemaValue; if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) { throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`); } } if ("code" in def ? def.trackErrors : def.errors !== false) { this.errsCount = it.gen.const("_errs", names_1.default.errors); } } result(condition, successAction, failAction) { this.failResult((0, codegen_1.not)(condition), successAction, failAction); } failResult(condition, successAction, failAction) { this.gen.if(condition); if (failAction) failAction();else this.error(); if (successAction) { this.gen.else(); successAction(); if (this.allErrors) this.gen.endIf(); } else { if (this.allErrors) this.gen.endIf();else this.gen.else(); } } pass(condition, failAction) { this.failResult((0, codegen_1.not)(condition), undefined, failAction); } fail(condition) { if (condition === undefined) { this.error(); if (!this.allErrors) this.gen.if(false); // this branch will be removed by gen.optimize return; } this.gen.if(condition); this.error(); if (this.allErrors) this.gen.endIf();else this.gen.else(); } fail$data(condition) { if (!this.$data) return this.fail(condition); const { schemaCode } = this; this.fail((0, codegen_1._)`${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`); } error(append, errorParams, errorPaths) { if (errorParams) { this.setParams(errorParams); this._error(append, errorPaths); this.setParams({}); return; } this._error(append, errorPaths); } _error(append, errorPaths) { ; (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths); } $dataError() { (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError); } reset() { if (this.errsCount === undefined) throw new Error('add "trackErrors" to keyword definition'); (0, errors_1.resetErrorsCount)(this.gen, this.errsCount); } ok(cond) { if (!this.allErrors) this.gen.if(cond); } setParams(obj, assign) { if (assign) Object.assign(this.params, obj);else this.params = obj; } block$data(valid, codeBlock, $dataValid = codegen_1.nil) { this.gen.block(() => { this.check$data(valid, $dataValid); codeBlock(); }); } check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) { if (!this.$data) return; const { gen, schemaCode, schemaType, def } = this; gen.if((0, codegen_1.or)((0, codegen_1._)`${schemaCode} === undefined`, $dataValid)); if (valid !== codegen_1.nil) gen.assign(valid, true); if (schemaType.length || def.validateSchema) { gen.elseIf(this.invalid$data()); this.$dataError(); if (valid !== codegen_1.nil) gen.assign(valid, false); } gen.else(); } invalid$data() { const { gen, schemaCode, schemaType, def, it } = this; return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema()); function wrong$DataType() { if (schemaType.length) { /* istanbul ignore if */ if (!(schemaCode instanceof codegen_1.Name)) throw new Error("ajv implementation error"); const st = Array.isArray(schemaType) ? schemaType : [schemaType]; return (0, codegen_1._)`${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`; } return codegen_1.nil; } function invalid$DataSchema() { if (def.validateSchema) { const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema }); // TODO value.code for standalone return (0, codegen_1._)`!${validateSchemaRef}(${schemaCode})`; } return codegen_1.nil; } } subschema(appl, valid) { const subschema = (0, subschema_1.getSubschema)(this.it, appl); (0, subschema_1.extendSubschemaData)(subschema, this.it, appl); (0, subschema_1.extendSubschemaMode)(subschema, appl); const nextContext = { ...this.it, ...subschema, items: undefined, props: undefined }; subschemaCode(nextContext, valid); return nextContext; } mergeEvaluated(schemaCxt, toName) { const { it, gen } = this; if (!it.opts.unevaluated) return; if (it.props !== true && schemaCxt.props !== undefined) { it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName); } if (it.items !== true && schemaCxt.items !== undefined) { it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName); } } mergeValidEvaluated(schemaCxt, valid) { const { it, gen } = this; if (it.opts.unevaluated && (it.props !== true || it.items !== true)) { gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name)); return true; } } } exports.KeywordCxt = KeywordCxt; function keywordCode(it, keyword, def, ruleType) { const cxt = new KeywordCxt(it, def, keyword); if ("code" in def) { def.code(cxt, ruleType); } else if (cxt.$data && def.validate) { (0, keyword_1.funcKeywordCode)(cxt, def); } else if ("macro" in def) { (0, keyword_1.macroKeywordCode)(cxt, def); } else if (def.compile || def.validate) { (0, keyword_1.funcKeywordCode)(cxt, def); } } const JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/; const RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; function getData($data, { dataLevel, dataNames, dataPathArr }) { let jsonPointer; let data; if ($data === "") return names_1.default.rootData; if ($data[0] === "/") { if (!JSON_POINTER.test($data)) throw new Error(`Invalid JSON-pointer: ${$data}`); jsonPointer = $data; data = names_1.default.rootData; } else { const matches = RELATIVE_JSON_POINTER.exec($data); if (!matches) throw new Error(`Invalid JSON-pointer: ${$data}`); const up = +matches[1]; jsonPointer = matches[2]; if (jsonPointer === "#") { if (up >= dataLevel) throw new Error(errorMsg("property/index", up)); return dataPathArr[dataLevel - up]; } if (up > dataLevel) throw new Error(errorMsg("data", up)); data = dataNames[dataLevel - up]; if (!jsonPointer) return data; } let expr = data; const segments = jsonPointer.split("/"); for (const segment of segments) { if (segment) { data = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`; expr = (0, codegen_1._)`${expr} && ${data}`; } } return expr; function errorMsg(pointerType, up) { return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`; } } exports.getData = getData; /***/ }, /***/ 46414 /*!***********************************************************!*\ !*** ./node_modules/ajv/dist/compile/validate/keyword.js ***! \***********************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0; const codegen_1 = __webpack_require__(/*! ../codegen */ 34320); const names_1 = __webpack_require__(/*! ../names */ 45986); const code_1 = __webpack_require__(/*! ../../vocabularies/code */ 26312); const errors_1 = __webpack_require__(/*! ../errors */ 12703); function macroKeywordCode(cxt, def) { const { gen, keyword, schema, parentSchema, it } = cxt; const macroSchema = def.macro.call(it.self, schema, parentSchema, it); const schemaRef = useKeyword(gen, keyword, macroSchema); if (it.opts.validateSchema !== false) it.self.validateSchema(macroSchema, true); const valid = gen.name("valid"); cxt.subschema({ schema: macroSchema, schemaPath: codegen_1.nil, errSchemaPath: `${it.errSchemaPath}/${keyword}`, topSchemaRef: schemaRef, compositeRule: true }, valid); cxt.pass(valid, () => cxt.error(true)); } exports.macroKeywordCode = macroKeywordCode; function funcKeywordCode(cxt, def) { var _a; const { gen, keyword, schema, parentSchema, $data, it } = cxt; checkAsyncKeyword(it, def); const validate = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate; const validateRef = useKeyword(gen, keyword, validate); const valid = gen.let("valid"); cxt.block$data(valid, validateKeyword); cxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid); function validateKeyword() { if (def.errors === false) { assignValid(); if (def.modifying) modifyData(cxt); reportErrs(() => cxt.error()); } else { const ruleErrs = def.async ? validateAsync() : validateSync(); if (def.modifying) modifyData(cxt); reportErrs(() => addErrs(cxt, ruleErrs)); } } function validateAsync() { const ruleErrs = gen.let("ruleErrs", null); gen.try(() => assignValid((0, codegen_1._)`await `), e => gen.assign(valid, false).if((0, codegen_1._)`${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._)`${e}.errors`), () => gen.throw(e))); return ruleErrs; } function validateSync() { const validateErrs = (0, codegen_1._)`${validateRef}.errors`; gen.assign(validateErrs, null); assignValid(codegen_1.nil); return validateErrs; } function assignValid(_await = def.async ? (0, codegen_1._)`await ` : codegen_1.nil) { const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self; const passSchema = !("compile" in def && !$data || def.schema === false); gen.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying); } function reportErrs(errors) { var _a; gen.if((0, codegen_1.not)((_a = def.valid) !== null && _a !== void 0 ? _a : valid), errors); } } exports.funcKeywordCode = funcKeywordCode; function modifyData(cxt) { const { gen, data, it } = cxt; gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._)`${it.parentData}[${it.parentDataProperty}]`)); } function addErrs(cxt, errs) { const { gen } = cxt; gen.if((0, codegen_1._)`Array.isArray(${errs})`, () => { gen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`).assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`); (0, errors_1.extendErrors)(cxt); }, () => cxt.error()); } function checkAsyncKeyword({ schemaEnv }, def) { if (def.async && !schemaEnv.$async) throw new Error("async keyword in sync schema"); } function useKeyword(gen, keyword, result) { if (result === undefined) throw new Error(`keyword "${keyword}" failed to compile`); return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) }); } function validSchemaType(schema, schemaType, allowUndefined = false) { // TODO add tests return !schemaType.length || schemaType.some(st => st === "array" ? Array.isArray(schema) : st === "object" ? schema && typeof schema == "object" && !Array.isArray(schema) : typeof schema == st || allowUndefined && typeof schema == "undefined"); } exports.validSchemaType = validSchemaType; function validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) { /* istanbul ignore if */ if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) { throw new Error("ajv implementation error"); } const deps = def.dependencies; if (deps === null || deps === void 0 ? void 0 : deps.some(kwd => !Object.prototype.hasOwnProperty.call(schema, kwd))) { throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`); } if (def.validateSchema) { const valid = def.validateSchema(schema[keyword]); if (!valid) { const msg = `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` + self.errorsText(def.validateSchema.errors); if (opts.validateSchema === "log") self.logger.error(msg);else throw new Error(msg); } } } exports.validateKeywordUsage = validateKeywordUsage; /***/ }, /***/ 5900 /*!*************************************************************!*\ !*** ./node_modules/ajv/dist/compile/validate/subschema.js ***! \*************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0; const codegen_1 = __webpack_require__(/*! ../codegen */ 34320); const util_1 = __webpack_require__(/*! ../util */ 5156); function getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) { if (keyword !== undefined && schema !== undefined) { throw new Error('both "keyword" and "schema" passed, only one allowed'); } if (keyword !== undefined) { const sch = it.schema[keyword]; return schemaProp === undefined ? { schema: sch, schemaPath: (0, codegen_1._)`${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`, errSchemaPath: `${it.errSchemaPath}/${keyword}` } : { schema: sch[schemaProp], schemaPath: (0, codegen_1._)`${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`, errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}` }; } if (schema !== undefined) { if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) { throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"'); } return { schema, schemaPath, topSchemaRef, errSchemaPath }; } throw new Error('either "keyword" or "schema" must be passed'); } exports.getSubschema = getSubschema; function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) { if (data !== undefined && dataProp !== undefined) { throw new Error('both "data" and "dataProp" passed, only one allowed'); } const { gen } = it; if (dataProp !== undefined) { const { errorPath, dataPathArr, opts } = it; const nextData = gen.let("data", (0, codegen_1._)`${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true); dataContextProps(nextData); subschema.errorPath = (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`; subschema.parentDataProperty = (0, codegen_1._)`${dataProp}`; subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty]; } if (data !== undefined) { const nextData = data instanceof codegen_1.Name ? data : gen.let("data", data, true); // replaceable if used once? dataContextProps(nextData); if (propertyName !== undefined) subschema.propertyName = propertyName; // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr } if (dataTypes) subschema.dataTypes = dataTypes; function dataContextProps(_nextData) { subschema.data = _nextData; subschema.dataLevel = it.dataLevel + 1; subschema.dataTypes = []; it.definedProperties = new Set(); subschema.parentData = it.data; subschema.dataNames = [...it.dataNames, _nextData]; } } exports.extendSubschemaData = extendSubschemaData; function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) { if (compositeRule !== undefined) subschema.compositeRule = compositeRule; if (createErrors !== undefined) subschema.createErrors = createErrors; if (allErrors !== undefined) subschema.allErrors = allErrors; subschema.jtdDiscriminator = jtdDiscriminator; // not inherited subschema.jtdMetadata = jtdMetadata; // not inherited } exports.extendSubschemaMode = extendSubschemaMode; /***/ }, /***/ 37961 /*!***************************************!*\ !*** ./node_modules/ajv/dist/core.js ***! \***************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; var _asyncToGenerator = (__webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/asyncToGenerator.js */ 87687)["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; var validate_1 = __webpack_require__(/*! ./compile/validate */ 16381); Object.defineProperty(exports, "KeywordCxt", ({ enumerable: true, get: function () { return validate_1.KeywordCxt; } })); var codegen_1 = __webpack_require__(/*! ./compile/codegen */ 34320); Object.defineProperty(exports, "_", ({ enumerable: true, get: function () { return codegen_1._; } })); Object.defineProperty(exports, "str", ({ enumerable: true, get: function () { return codegen_1.str; } })); Object.defineProperty(exports, "stringify", ({ enumerable: true, get: function () { return codegen_1.stringify; } })); Object.defineProperty(exports, "nil", ({ enumerable: true, get: function () { return codegen_1.nil; } })); Object.defineProperty(exports, "Name", ({ enumerable: true, get: function () { return codegen_1.Name; } })); Object.defineProperty(exports, "CodeGen", ({ enumerable: true, get: function () { return codegen_1.CodeGen; } })); const validation_error_1 = __webpack_require__(/*! ./runtime/validation_error */ 22409); const ref_error_1 = __webpack_require__(/*! ./compile/ref_error */ 55654); const rules_1 = __webpack_require__(/*! ./compile/rules */ 22133); const compile_1 = __webpack_require__(/*! ./compile */ 8218); const codegen_2 = __webpack_require__(/*! ./compile/codegen */ 34320); const resolve_1 = __webpack_require__(/*! ./compile/resolve */ 37302); const dataType_1 = __webpack_require__(/*! ./compile/validate/dataType */ 4545); const util_1 = __webpack_require__(/*! ./compile/util */ 5156); const $dataRefSchema = __webpack_require__(/*! ./refs/data.json */ 63837); const uri_1 = __webpack_require__(/*! ./runtime/uri */ 64593); const defaultRegExp = (str, flags) => new RegExp(str, flags); defaultRegExp.code = "new RegExp"; const META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"]; const EXT_SCOPE_NAMES = new Set(["validate", "serialize", "parse", "wrapper", "root", "schema", "keyword", "pattern", "formats", "validate$data", "func", "obj", "Error"]); const removedOptions = { errorDataPath: "", format: "`validateFormats: false` can be used instead.", nullable: '"nullable" keyword is supported by default.', jsonPointers: "Deprecated jsPropertySyntax can be used instead.", extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", sourceCode: "Use option `code: {source: true}`", strictDefaults: "It is default now, see option `strict`.", strictKeywords: "It is default now, see option `strict`.", uniqueItems: '"uniqueItems" keyword is always validated.', unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", cache: "Map is used as cache, schema object as key.", serialize: "Map is used as cache, schema object as key.", ajvErrors: "It is default now." }; const deprecatedOptions = { ignoreKeywordsWithRef: "", jsPropertySyntax: "", unicode: '"minLength"/"maxLength" account for unicode characters by default.' }; const MAX_EXPRESSION = 200; // eslint-disable-next-line complexity function requiredOptions(o) { var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0; const s = o.strict; const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize; const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0; const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp; const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default; return { strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true, strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true, strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : "log", strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : "log", strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false, code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp }, loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION, loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION, meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true, messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true, inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true, schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : "$id", addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true, validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true, validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true, unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true, int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true, uriResolver: uriResolver }; } class Ajv { constructor(opts = {}) { this.schemas = {}; this.refs = {}; this.formats = {}; this._compilations = new Set(); this._loading = {}; this._cache = new Map(); opts = this.opts = { ...opts, ...requiredOptions(opts) }; const { es5, lines } = this.opts.code; this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines }); this.logger = getLogger(opts.logger); const formatOpt = opts.validateFormats; opts.validateFormats = false; this.RULES = (0, rules_1.getRules)(); checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED"); checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn"); this._metaOpts = getMetaSchemaOptions.call(this); if (opts.formats) addInitialFormats.call(this); this._addVocabularies(); this._addDefaultMetaSchema(); if (opts.keywords) addInitialKeywords.call(this, opts.keywords); if (typeof opts.meta == "object") this.addMetaSchema(opts.meta); addInitialSchemas.call(this); opts.validateFormats = formatOpt; } _addVocabularies() { this.addKeyword("$async"); } _addDefaultMetaSchema() { const { $data, meta, schemaId } = this.opts; let _dataRefSchema = $dataRefSchema; if (schemaId === "id") { _dataRefSchema = { ...$dataRefSchema }; _dataRefSchema.id = _dataRefSchema.$id; delete _dataRefSchema.$id; } if (meta && $data) this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false); } defaultMeta() { const { meta, schemaId } = this.opts; return this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : undefined; } validate(schemaKeyRef, // key, ref or schema object // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents data // to be validated ) { let v; if (typeof schemaKeyRef == "string") { v = this.getSchema(schemaKeyRef); if (!v) throw new Error(`no schema with key or ref "${schemaKeyRef}"`); } else { v = this.compile(schemaKeyRef); } const valid = v(data); if (!("$async" in v)) this.errors = v.errors; return valid; } compile(schema, _meta) { const sch = this._addSchema(schema, _meta); return sch.validate || this._compileSchemaEnv(sch); } compileAsync(schema, meta) { if (typeof this.opts.loadSchema != "function") { throw new Error("options.loadSchema should be a function"); } const { loadSchema } = this.opts; return runCompileAsync.call(this, schema, meta); function runCompileAsync(_x2, _x3) { return _runCompileAsync.apply(this, arguments); } function _runCompileAsync() { _runCompileAsync = _asyncToGenerator(function* (_schema, _meta) { yield loadMetaSchema.call(this, _schema.$schema); const sch = this._addSchema(_schema, _meta); return sch.validate || _compileAsync.call(this, sch); }); return _runCompileAsync.apply(this, arguments); } function loadMetaSchema(_x4) { return _loadMetaSchema.apply(this, arguments); } function _loadMetaSchema() { _loadMetaSchema = _asyncToGenerator(function* ($ref) { if ($ref && !this.getSchema($ref)) { yield runCompileAsync.call(this, { $ref }, true); } }); return _loadMetaSchema.apply(this, arguments); } function _compileAsync(_x5) { return _compileAsync2.apply(this, arguments); } function _compileAsync2() { _compileAsync2 = _asyncToGenerator(function* (sch) { try { return this._compileSchemaEnv(sch); } catch (e) { if (!(e instanceof ref_error_1.default)) throw e; checkLoaded.call(this, e); yield loadMissingSchema.call(this, e.missingSchema); return _compileAsync.call(this, sch); } }); return _compileAsync2.apply(this, arguments); } function checkLoaded({ missingSchema: ref, missingRef }) { if (this.refs[ref]) { throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`); } } function loadMissingSchema(_x6) { return _loadMissingSchema.apply(this, arguments); } function _loadMissingSchema() { _loadMissingSchema = _asyncToGenerator(function* (ref) { const _schema = yield _loadSchema.call(this, ref); if (!this.refs[ref]) yield loadMetaSchema.call(this, _schema.$schema); if (!this.refs[ref]) this.addSchema(_schema, ref, meta); }); return _loadMissingSchema.apply(this, arguments); } function _loadSchema(_x7) { return _loadSchema2.apply(this, arguments); } function _loadSchema2() { _loadSchema2 = _asyncToGenerator(function* (ref) { const p = this._loading[ref]; if (p) return p; try { return yield this._loading[ref] = loadSchema(ref); } finally { delete this._loading[ref]; } }); return _loadSchema2.apply(this, arguments); } } // Adds schema to the instance addSchema(schema, // If array is passed, `key` will be ignored key, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. _meta, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead. ) { if (Array.isArray(schema)) { for (const sch of schema) this.addSchema(sch, undefined, _meta, _validateSchema); return this; } let id; if (typeof schema === "object") { const { schemaId } = this.opts; id = schema[schemaId]; if (id !== undefined && typeof id != "string") { throw new Error(`schema ${schemaId} must be string`); } } key = (0, resolve_1.normalizeId)(key || id); this._checkUnique(key); this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true); return this; } // Add schema that will be used to validate other schemas // options in META_IGNORE_OPTIONS are alway set to false addMetaSchema(schema, key, // schema key _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema ) { this.addSchema(schema, key, true, _validateSchema); return this; } // Validate schema against its meta-schema validateSchema(schema, throwOrLogError) { if (typeof schema == "boolean") return true; let $schema; $schema = schema.$schema; if ($schema !== undefined && typeof $schema != "string") { throw new Error("$schema must be a string"); } $schema = $schema || this.opts.defaultMeta || this.defaultMeta(); if (!$schema) { this.logger.warn("meta-schema not available"); this.errors = null; return true; } const valid = this.validate($schema, schema); if (!valid && throwOrLogError) { const message = "schema is invalid: " + this.errorsText(); if (this.opts.validateSchema === "log") this.logger.error(message);else throw new Error(message); } return valid; } // Get compiled schema by `key` or `ref`. // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id) getSchema(keyRef) { let sch; while (typeof (sch = getSchEnv.call(this, keyRef)) == "string") keyRef = sch; if (sch === undefined) { const { schemaId } = this.opts; const root = new compile_1.SchemaEnv({ schema: {}, schemaId }); sch = compile_1.resolveSchema.call(this, root, keyRef); if (!sch) return; this.refs[keyRef] = sch; } return sch.validate || this._compileSchemaEnv(sch); } // Remove cached schema(s). // If no parameter is passed all schemas but meta-schemas are removed. // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. // Even if schema is referenced by other schemas it still can be removed as other schemas have local references. removeSchema(schemaKeyRef) { if (schemaKeyRef instanceof RegExp) { this._removeAllSchemas(this.schemas, schemaKeyRef); this._removeAllSchemas(this.refs, schemaKeyRef); return this; } switch (typeof schemaKeyRef) { case "undefined": this._removeAllSchemas(this.schemas); this._removeAllSchemas(this.refs); this._cache.clear(); return this; case "string": { const sch = getSchEnv.call(this, schemaKeyRef); if (typeof sch == "object") this._cache.delete(sch.schema); delete this.schemas[schemaKeyRef]; delete this.refs[schemaKeyRef]; return this; } case "object": { const cacheKey = schemaKeyRef; this._cache.delete(cacheKey); let id = schemaKeyRef[this.opts.schemaId]; if (id) { id = (0, resolve_1.normalizeId)(id); delete this.schemas[id]; delete this.refs[id]; } return this; } default: throw new Error("ajv.removeSchema: invalid parameter"); } } // add "vocabulary" - a collection of keywords addVocabulary(definitions) { for (const def of definitions) this.addKeyword(def); return this; } addKeyword(kwdOrDef, def // deprecated ) { let keyword; if (typeof kwdOrDef == "string") { keyword = kwdOrDef; if (typeof def == "object") { this.logger.warn("these parameters are deprecated, see docs for addKeyword"); def.keyword = keyword; } } else if (typeof kwdOrDef == "object" && def === undefined) { def = kwdOrDef; keyword = def.keyword; if (Array.isArray(keyword) && !keyword.length) { throw new Error("addKeywords: keyword must be string or non-empty array"); } } else { throw new Error("invalid addKeywords parameters"); } checkKeyword.call(this, keyword, def); if (!def) { (0, util_1.eachItem)(keyword, kwd => addRule.call(this, kwd)); return this; } keywordMetaschema.call(this, def); const definition = { ...def, type: (0, dataType_1.getJSONTypes)(def.type), schemaType: (0, dataType_1.getJSONTypes)(def.schemaType) }; (0, util_1.eachItem)(keyword, definition.type.length === 0 ? k => addRule.call(this, k, definition) : k => definition.type.forEach(t => addRule.call(this, k, definition, t))); return this; } getKeyword(keyword) { const rule = this.RULES.all[keyword]; return typeof rule == "object" ? rule.definition : !!rule; } // Remove keyword removeKeyword(keyword) { // TODO return type should be Ajv const { RULES } = this; delete RULES.keywords[keyword]; delete RULES.all[keyword]; for (const group of RULES.rules) { const i = group.rules.findIndex(rule => rule.keyword === keyword); if (i >= 0) group.rules.splice(i, 1); } return this; } // Add format addFormat(name, format) { if (typeof format == "string") format = new RegExp(format); this.formats[name] = format; return this; } errorsText(errors = this.errors, // optional array of validation errors { separator = ", ", dataVar = "data" } = {} // optional options with properties `separator` and `dataVar` ) { if (!errors || errors.length === 0) return "No errors"; return errors.map(e => `${dataVar}${e.instancePath} ${e.message}`).reduce((text, msg) => text + separator + msg); } $dataMetaSchema(metaSchema, keywordsJsonPointers) { const rules = this.RULES.all; metaSchema = JSON.parse(JSON.stringify(metaSchema)); for (const jsonPointer of keywordsJsonPointers) { const segments = jsonPointer.split("/").slice(1); // first segment is an empty string let keywords = metaSchema; for (const seg of segments) keywords = keywords[seg]; for (const key in rules) { const rule = rules[key]; if (typeof rule != "object") continue; const { $data } = rule.definition; const schema = keywords[key]; if ($data && schema) keywords[key] = schemaOrData(schema); } } return metaSchema; } _removeAllSchemas(schemas, regex) { for (const keyRef in schemas) { const sch = schemas[keyRef]; if (!regex || regex.test(keyRef)) { if (typeof sch == "string") { delete schemas[keyRef]; } else if (sch && !sch.meta) { this._cache.delete(sch.schema); delete schemas[keyRef]; } } } } _addSchema(schema, meta, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) { let id; const { schemaId } = this.opts; if (typeof schema == "object") { id = schema[schemaId]; } else { if (this.opts.jtd) throw new Error("schema must be object");else if (typeof schema != "boolean") throw new Error("schema must be object or boolean"); } let sch = this._cache.get(schema); if (sch !== undefined) return sch; baseId = (0, resolve_1.normalizeId)(id || baseId); const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId); sch = new compile_1.SchemaEnv({ schema, schemaId, meta, baseId, localRefs }); this._cache.set(sch.schema, sch); if (addSchema && !baseId.startsWith("#")) { // TODO atm it is allowed to overwrite schemas without id (instead of not adding them) if (baseId) this._checkUnique(baseId); this.refs[baseId] = sch; } if (validateSchema) this.validateSchema(schema, true); return sch; } _checkUnique(id) { if (this.schemas[id] || this.refs[id]) { throw new Error(`schema with key or id "${id}" already exists`); } } _compileSchemaEnv(sch) { if (sch.meta) this._compileMetaSchema(sch);else compile_1.compileSchema.call(this, sch); /* istanbul ignore if */ if (!sch.validate) throw new Error("ajv implementation error"); return sch.validate; } _compileMetaSchema(sch) { const currentOpts = this.opts; this.opts = this._metaOpts; try { compile_1.compileSchema.call(this, sch); } finally { this.opts = currentOpts; } } } Ajv.ValidationError = validation_error_1.default; Ajv.MissingRefError = ref_error_1.default; exports["default"] = Ajv; function checkOptions(checkOpts, options, msg, log = "error") { for (const key in checkOpts) { const opt = key; if (opt in options) this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`); } } function getSchEnv(keyRef) { keyRef = (0, resolve_1.normalizeId)(keyRef); // TODO tests fail without this line return this.schemas[keyRef] || this.refs[keyRef]; } function addInitialSchemas() { const optsSchemas = this.opts.schemas; if (!optsSchemas) return; if (Array.isArray(optsSchemas)) this.addSchema(optsSchemas);else for (const key in optsSchemas) this.addSchema(optsSchemas[key], key); } function addInitialFormats() { for (const name in this.opts.formats) { const format = this.opts.formats[name]; if (format) this.addFormat(name, format); } } function addInitialKeywords(defs) { if (Array.isArray(defs)) { this.addVocabulary(defs); return; } this.logger.warn("keywords option as map is deprecated, pass array"); for (const keyword in defs) { const def = defs[keyword]; if (!def.keyword) def.keyword = keyword; this.addKeyword(def); } } function getMetaSchemaOptions() { const metaOpts = { ...this.opts }; for (const opt of META_IGNORE_OPTIONS) delete metaOpts[opt]; return metaOpts; } const noLogs = { log() {}, warn() {}, error() {} }; function getLogger(logger) { if (logger === false) return noLogs; if (logger === undefined) return console; if (logger.log && logger.warn && logger.error) return logger; throw new Error("logger must implement log, warn and error methods"); } const KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i; function checkKeyword(keyword, def) { const { RULES } = this; (0, util_1.eachItem)(keyword, kwd => { if (RULES.keywords[kwd]) throw new Error(`Keyword ${kwd} is already defined`); if (!KEYWORD_NAME.test(kwd)) throw new Error(`Keyword ${kwd} has invalid name`); }); if (!def) return; if (def.$data && !("code" in def || "validate" in def)) { throw new Error('$data keyword must have "code" or "validate" function'); } } function addRule(keyword, definition, dataType) { var _a; const post = definition === null || definition === void 0 ? void 0 : definition.post; if (dataType && post) throw new Error('keyword with "post" flag cannot have "type"'); const { RULES } = this; let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType); if (!ruleGroup) { ruleGroup = { type: dataType, rules: [] }; RULES.rules.push(ruleGroup); } RULES.keywords[keyword] = true; if (!definition) return; const rule = { keyword, definition: { ...definition, type: (0, dataType_1.getJSONTypes)(definition.type), schemaType: (0, dataType_1.getJSONTypes)(definition.schemaType) } }; if (definition.before) addBeforeRule.call(this, ruleGroup, rule, definition.before);else ruleGroup.rules.push(rule); RULES.all[keyword] = rule; (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach(kwd => this.addKeyword(kwd)); } function addBeforeRule(ruleGroup, rule, before) { const i = ruleGroup.rules.findIndex(_rule => _rule.keyword === before); if (i >= 0) { ruleGroup.rules.splice(i, 0, rule); } else { ruleGroup.rules.push(rule); this.logger.warn(`rule ${before} is not defined`); } } function keywordMetaschema(def) { let { metaSchema } = def; if (metaSchema === undefined) return; if (def.$data && this.opts.$data) metaSchema = schemaOrData(metaSchema); def.validateSchema = this.compile(metaSchema, true); } const $dataRef = { $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#" }; function schemaOrData(schema) { return { anyOf: [schema, $dataRef] }; } /***/ }, /***/ 64747 /*!************************************************!*\ !*** ./node_modules/ajv/dist/runtime/equal.js ***! \************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); // https://github.com/ajv-validator/ajv/issues/889 const equal = __webpack_require__(/*! fast-deep-equal */ 33778); equal.code = 'require("ajv/dist/runtime/equal").default'; exports["default"] = equal; /***/ }, /***/ 68554 /*!*****************************************************!*\ !*** ./node_modules/ajv/dist/runtime/ucs2length.js ***! \*****************************************************/ (__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); // https://mathiasbynens.be/notes/javascript-encoding // https://github.com/bestiejs/punycode.js - punycode.ucs2.decode function ucs2length(str) { const len = str.length; let length = 0; let pos = 0; let value; while (pos < len) { length++; value = str.charCodeAt(pos++); if (value >= 0xd800 && value <= 0xdbff && pos < len) { // high surrogate, and there is a next character value = str.charCodeAt(pos); if ((value & 0xfc00) === 0xdc00) pos++; // low surrogate } } return length; } exports["default"] = ucs2length; ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default'; /***/ }, /***/ 64593 /*!**********************************************!*\ !*** ./node_modules/ajv/dist/runtime/uri.js ***! \**********************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const uri = __webpack_require__(/*! fast-uri */ 12692); uri.code = 'require("ajv/dist/runtime/uri").default'; exports["default"] = uri; /***/ }, /***/ 22409 /*!***********************************************************!*\ !*** ./node_modules/ajv/dist/runtime/validation_error.js ***! \***********************************************************/ (__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); class ValidationError extends Error { constructor(errors) { super("validation failed"); this.errors = errors; this.ajv = this.validation = true; } } exports["default"] = ValidationError; /***/ }, /***/ 8092 /*!**************************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/applicator/additionalItems.js ***! \**************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.validateAdditionalItems = void 0; const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const error = { message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`, params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}` }; const def = { keyword: "additionalItems", type: "array", schemaType: ["boolean", "object"], before: "uniqueItems", error, code(cxt) { const { parentSchema, it } = cxt; const { items } = parentSchema; if (!Array.isArray(items)) { (0, util_1.checkStrictMode)(it, '"additionalItems" is ignored when "items" is not an array of schemas'); return; } validateAdditionalItems(cxt, items); } }; function validateAdditionalItems(cxt, items) { const { gen, schema, data, keyword, it } = cxt; it.items = true; const len = gen.const("len", (0, codegen_1._)`${data}.length`); if (schema === false) { cxt.setParams({ len: items.length }); cxt.pass((0, codegen_1._)`${len} <= ${items.length}`); } else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) { const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items.length}`); // TODO var gen.if((0, codegen_1.not)(valid), () => validateItems(valid)); cxt.ok(valid); } function validateItems(valid) { gen.forRange("i", items.length, len, i => { cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid); if (!it.allErrors) gen.if((0, codegen_1.not)(valid), () => gen.break()); }); } } exports.validateAdditionalItems = validateAdditionalItems; exports["default"] = def; /***/ }, /***/ 81043 /*!*******************************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js ***! \*******************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const code_1 = __webpack_require__(/*! ../code */ 26312); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const names_1 = __webpack_require__(/*! ../../compile/names */ 45986); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const error = { message: "must NOT have additional properties", params: ({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}` }; const def = { keyword: "additionalProperties", type: ["object"], schemaType: ["boolean", "object"], allowUndefined: true, trackErrors: true, error, code(cxt) { const { gen, schema, parentSchema, data, errsCount, it } = cxt; /* istanbul ignore if */ if (!errsCount) throw new Error("ajv implementation error"); const { allErrors, opts } = it; it.props = true; if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it, schema)) return; const props = (0, code_1.allSchemaProperties)(parentSchema.properties); const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties); checkAdditionalProperties(); cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`); function checkAdditionalProperties() { gen.forIn("key", data, key => { if (!props.length && !patProps.length) additionalPropertyCode(key);else gen.if(isAdditional(key), () => additionalPropertyCode(key)); }); } function isAdditional(key) { let definedProp; if (props.length > 8) { // TODO maybe an option instead of hard-coded 8? const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties"); definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key); } else if (props.length) { definedProp = (0, codegen_1.or)(...props.map(p => (0, codegen_1._)`${key} === ${p}`)); } else { definedProp = codegen_1.nil; } if (patProps.length) { definedProp = (0, codegen_1.or)(definedProp, ...patProps.map(p => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${key})`)); } return (0, codegen_1.not)(definedProp); } function deleteAdditional(key) { gen.code((0, codegen_1._)`delete ${data}[${key}]`); } function additionalPropertyCode(key) { if (opts.removeAdditional === "all" || opts.removeAdditional && schema === false) { deleteAdditional(key); return; } if (schema === false) { cxt.setParams({ additionalProperty: key }); cxt.error(); if (!allErrors) gen.break(); return; } if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) { const valid = gen.name("valid"); if (opts.removeAdditional === "failing") { applyAdditionalSchema(key, valid, false); gen.if((0, codegen_1.not)(valid), () => { cxt.reset(); deleteAdditional(key); }); } else { applyAdditionalSchema(key, valid); if (!allErrors) gen.if((0, codegen_1.not)(valid), () => gen.break()); } } } function applyAdditionalSchema(key, valid, errors) { const subschema = { keyword: "additionalProperties", dataProp: key, dataPropType: util_1.Type.Str }; if (errors === false) { Object.assign(subschema, { compositeRule: true, createErrors: false, allErrors: false }); } cxt.subschema(subschema, valid); } } }; exports["default"] = def; /***/ }, /***/ 88081 /*!****************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/applicator/allOf.js ***! \****************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const def = { keyword: "allOf", schemaType: "array", code(cxt) { const { gen, schema, it } = cxt; /* istanbul ignore if */ if (!Array.isArray(schema)) throw new Error("ajv implementation error"); const valid = gen.name("valid"); schema.forEach((sch, i) => { if ((0, util_1.alwaysValidSchema)(it, sch)) return; const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid); cxt.ok(valid); cxt.mergeEvaluated(schCxt); }); } }; exports["default"] = def; /***/ }, /***/ 11448 /*!****************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/applicator/anyOf.js ***! \****************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const code_1 = __webpack_require__(/*! ../code */ 26312); const def = { keyword: "anyOf", schemaType: "array", trackErrors: true, code: code_1.validateUnion, error: { message: "must match a schema in anyOf" } }; exports["default"] = def; /***/ }, /***/ 20362 /*!*******************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/applicator/contains.js ***! \*******************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const error = { message: ({ params: { min, max } }) => max === undefined ? (0, codegen_1.str)`must contain at least ${min} valid item(s)` : (0, codegen_1.str)`must contain at least ${min} and no more than ${max} valid item(s)`, params: ({ params: { min, max } }) => max === undefined ? (0, codegen_1._)`{minContains: ${min}}` : (0, codegen_1._)`{minContains: ${min}, maxContains: ${max}}` }; const def = { keyword: "contains", type: "array", schemaType: ["object", "boolean"], before: "uniqueItems", trackErrors: true, error, code(cxt) { const { gen, schema, parentSchema, data, it } = cxt; let min; let max; const { minContains, maxContains } = parentSchema; if (it.opts.next) { min = minContains === undefined ? 1 : minContains; max = maxContains; } else { min = 1; } const len = gen.const("len", (0, codegen_1._)`${data}.length`); cxt.setParams({ min, max }); if (max === undefined && min === 0) { (0, util_1.checkStrictMode)(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`); return; } if (max !== undefined && min > max) { (0, util_1.checkStrictMode)(it, `"minContains" > "maxContains" is always invalid`); cxt.fail(); return; } if ((0, util_1.alwaysValidSchema)(it, schema)) { let cond = (0, codegen_1._)`${len} >= ${min}`; if (max !== undefined) cond = (0, codegen_1._)`${cond} && ${len} <= ${max}`; cxt.pass(cond); return; } it.items = true; const valid = gen.name("valid"); if (max === undefined && min === 1) { validateItems(valid, () => gen.if(valid, () => gen.break())); } else if (min === 0) { gen.let(valid, true); if (max !== undefined) gen.if((0, codegen_1._)`${data}.length > 0`, validateItemsWithCount); } else { gen.let(valid, false); validateItemsWithCount(); } cxt.result(valid, () => cxt.reset()); function validateItemsWithCount() { const schValid = gen.name("_valid"); const count = gen.let("count", 0); validateItems(schValid, () => gen.if(schValid, () => checkLimits(count))); } function validateItems(_valid, block) { gen.forRange("i", 0, len, i => { cxt.subschema({ keyword: "contains", dataProp: i, dataPropType: util_1.Type.Num, compositeRule: true }, _valid); block(); }); } function checkLimits(count) { gen.code((0, codegen_1._)`${count}++`); if (max === undefined) { gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true).break()); } else { gen.if((0, codegen_1._)`${count} > ${max}`, () => gen.assign(valid, false).break()); if (min === 1) gen.assign(valid, true);else gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true)); } } } }; exports["default"] = def; /***/ }, /***/ 42486 /*!***********************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/applicator/dependencies.js ***! \***********************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0; const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const code_1 = __webpack_require__(/*! ../code */ 26312); exports.error = { message: ({ params: { property, depsCount, deps } }) => { const property_ies = depsCount === 1 ? "property" : "properties"; return (0, codegen_1.str)`must have ${property_ies} ${deps} when property ${property} is present`; }, params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._)`{property: ${property}, missingProperty: ${missingProperty}, depsCount: ${depsCount}, deps: ${deps}}` // TODO change to reference }; const def = { keyword: "dependencies", type: "object", schemaType: "object", error: exports.error, code(cxt) { const [propDeps, schDeps] = splitDependencies(cxt); validatePropertyDeps(cxt, propDeps); validateSchemaDeps(cxt, schDeps); } }; function splitDependencies({ schema }) { const propertyDeps = {}; const schemaDeps = {}; for (const key in schema) { if (key === "__proto__") continue; const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps; deps[key] = schema[key]; } return [propertyDeps, schemaDeps]; } function validatePropertyDeps(cxt, propertyDeps = cxt.schema) { const { gen, data, it } = cxt; if (Object.keys(propertyDeps).length === 0) return; const missing = gen.let("missing"); for (const prop in propertyDeps) { const deps = propertyDeps[prop]; if (deps.length === 0) continue; const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties); cxt.setParams({ property: prop, depsCount: deps.length, deps: deps.join(", ") }); if (it.allErrors) { gen.if(hasProperty, () => { for (const depProp of deps) { (0, code_1.checkReportMissingProp)(cxt, depProp); } }); } else { gen.if((0, codegen_1._)`${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`); (0, code_1.reportMissingProp)(cxt, missing); gen.else(); } } } exports.validatePropertyDeps = validatePropertyDeps; function validateSchemaDeps(cxt, schemaDeps = cxt.schema) { const { gen, data, keyword, it } = cxt; const valid = gen.name("valid"); for (const prop in schemaDeps) { if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop])) continue; gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => { const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid); cxt.mergeValidEvaluated(schCxt, valid); }, () => gen.var(valid, true) // TODO var ); cxt.ok(valid); } } exports.validateSchemaDeps = validateSchemaDeps; exports["default"] = def; /***/ }, /***/ 23236 /*!*************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/applicator/if.js ***! \*************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const error = { message: ({ params }) => (0, codegen_1.str)`must match "${params.ifClause}" schema`, params: ({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}` }; const def = { keyword: "if", schemaType: ["object", "boolean"], trackErrors: true, error, code(cxt) { const { gen, parentSchema, it } = cxt; if (parentSchema.then === undefined && parentSchema.else === undefined) { (0, util_1.checkStrictMode)(it, '"if" without "then" and "else" is ignored'); } const hasThen = hasSchema(it, "then"); const hasElse = hasSchema(it, "else"); if (!hasThen && !hasElse) return; const valid = gen.let("valid", true); const schValid = gen.name("_valid"); validateIf(); cxt.reset(); if (hasThen && hasElse) { const ifClause = gen.let("ifClause"); cxt.setParams({ ifClause }); gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause)); } else if (hasThen) { gen.if(schValid, validateClause("then")); } else { gen.if((0, codegen_1.not)(schValid), validateClause("else")); } cxt.pass(valid, () => cxt.error(true)); function validateIf() { const schCxt = cxt.subschema({ keyword: "if", compositeRule: true, createErrors: false, allErrors: false }, schValid); cxt.mergeEvaluated(schCxt); } function validateClause(keyword, ifClause) { return () => { const schCxt = cxt.subschema({ keyword }, schValid); gen.assign(valid, schValid); cxt.mergeValidEvaluated(schCxt, valid); if (ifClause) gen.assign(ifClause, (0, codegen_1._)`${keyword}`);else cxt.setParams({ ifClause: keyword }); }; } } }; function hasSchema(it, keyword) { const schema = it.schema[keyword]; return schema !== undefined && !(0, util_1.alwaysValidSchema)(it, schema); } exports["default"] = def; /***/ }, /***/ 95995 /*!****************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/applicator/index.js ***! \****************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const additionalItems_1 = __webpack_require__(/*! ./additionalItems */ 8092); const prefixItems_1 = __webpack_require__(/*! ./prefixItems */ 89703); const items_1 = __webpack_require__(/*! ./items */ 11795); const items2020_1 = __webpack_require__(/*! ./items2020 */ 41283); const contains_1 = __webpack_require__(/*! ./contains */ 20362); const dependencies_1 = __webpack_require__(/*! ./dependencies */ 42486); const propertyNames_1 = __webpack_require__(/*! ./propertyNames */ 360); const additionalProperties_1 = __webpack_require__(/*! ./additionalProperties */ 81043); const properties_1 = __webpack_require__(/*! ./properties */ 48590); const patternProperties_1 = __webpack_require__(/*! ./patternProperties */ 61975); const not_1 = __webpack_require__(/*! ./not */ 35554); const anyOf_1 = __webpack_require__(/*! ./anyOf */ 11448); const oneOf_1 = __webpack_require__(/*! ./oneOf */ 31566); const allOf_1 = __webpack_require__(/*! ./allOf */ 88081); const if_1 = __webpack_require__(/*! ./if */ 23236); const thenElse_1 = __webpack_require__(/*! ./thenElse */ 98849); function getApplicator(draft2020 = false) { const applicator = [ // any not_1.default, anyOf_1.default, oneOf_1.default, allOf_1.default, if_1.default, thenElse_1.default, // object propertyNames_1.default, additionalProperties_1.default, dependencies_1.default, properties_1.default, patternProperties_1.default]; // array if (draft2020) applicator.push(prefixItems_1.default, items2020_1.default);else applicator.push(additionalItems_1.default, items_1.default); applicator.push(contains_1.default); return applicator; } exports["default"] = getApplicator; /***/ }, /***/ 11795 /*!****************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/applicator/items.js ***! \****************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.validateTuple = void 0; const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const code_1 = __webpack_require__(/*! ../code */ 26312); const def = { keyword: "items", type: "array", schemaType: ["object", "array", "boolean"], before: "uniqueItems", code(cxt) { const { schema, it } = cxt; if (Array.isArray(schema)) return validateTuple(cxt, "additionalItems", schema); it.items = true; if ((0, util_1.alwaysValidSchema)(it, schema)) return; cxt.ok((0, code_1.validateArray)(cxt)); } }; function validateTuple(cxt, extraItems, schArr = cxt.schema) { const { gen, parentSchema, data, keyword, it } = cxt; checkStrictTuple(parentSchema); if (it.opts.unevaluated && schArr.length && it.items !== true) { it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items); } const valid = gen.name("valid"); const len = gen.const("len", (0, codegen_1._)`${data}.length`); schArr.forEach((sch, i) => { if ((0, util_1.alwaysValidSchema)(it, sch)) return; gen.if((0, codegen_1._)`${len} > ${i}`, () => cxt.subschema({ keyword, schemaProp: i, dataProp: i }, valid)); cxt.ok(valid); }); function checkStrictTuple(sch) { const { opts, errSchemaPath } = it; const l = schArr.length; const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false); if (opts.strictTuples && !fullTuple) { const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`; (0, util_1.checkStrictMode)(it, msg, opts.strictTuples); } } } exports.validateTuple = validateTuple; exports["default"] = def; /***/ }, /***/ 41283 /*!********************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/applicator/items2020.js ***! \********************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const code_1 = __webpack_require__(/*! ../code */ 26312); const additionalItems_1 = __webpack_require__(/*! ./additionalItems */ 8092); const error = { message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`, params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}` }; const def = { keyword: "items", type: "array", schemaType: ["object", "boolean"], before: "uniqueItems", error, code(cxt) { const { schema, parentSchema, it } = cxt; const { prefixItems } = parentSchema; it.items = true; if ((0, util_1.alwaysValidSchema)(it, schema)) return; if (prefixItems) (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems);else cxt.ok((0, code_1.validateArray)(cxt)); } }; exports["default"] = def; /***/ }, /***/ 35554 /*!**************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/applicator/not.js ***! \**************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const def = { keyword: "not", schemaType: ["object", "boolean"], trackErrors: true, code(cxt) { const { gen, schema, it } = cxt; if ((0, util_1.alwaysValidSchema)(it, schema)) { cxt.fail(); return; } const valid = gen.name("valid"); cxt.subschema({ keyword: "not", compositeRule: true, createErrors: false, allErrors: false }, valid); cxt.failResult(valid, () => cxt.reset(), () => cxt.error()); }, error: { message: "must NOT be valid" } }; exports["default"] = def; /***/ }, /***/ 31566 /*!****************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/applicator/oneOf.js ***! \****************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const error = { message: "must match exactly one schema in oneOf", params: ({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}` }; const def = { keyword: "oneOf", schemaType: "array", trackErrors: true, error, code(cxt) { const { gen, schema, parentSchema, it } = cxt; /* istanbul ignore if */ if (!Array.isArray(schema)) throw new Error("ajv implementation error"); if (it.opts.discriminator && parentSchema.discriminator) return; const schArr = schema; const valid = gen.let("valid", false); const passing = gen.let("passing", null); const schValid = gen.name("_valid"); cxt.setParams({ passing }); // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas gen.block(validateOneOf); cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); function validateOneOf() { schArr.forEach((sch, i) => { let schCxt; if ((0, util_1.alwaysValidSchema)(it, sch)) { gen.var(schValid, true); } else { schCxt = cxt.subschema({ keyword: "oneOf", schemaProp: i, compositeRule: true }, schValid); } if (i > 0) { gen.if((0, codegen_1._)`${schValid} && ${valid}`).assign(valid, false).assign(passing, (0, codegen_1._)`[${passing}, ${i}]`).else(); } gen.if(schValid, () => { gen.assign(valid, true); gen.assign(passing, i); if (schCxt) cxt.mergeEvaluated(schCxt, codegen_1.Name); }); }); } } }; exports["default"] = def; /***/ }, /***/ 61975 /*!****************************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/applicator/patternProperties.js ***! \****************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const code_1 = __webpack_require__(/*! ../code */ 26312); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const util_2 = __webpack_require__(/*! ../../compile/util */ 5156); const def = { keyword: "patternProperties", type: "object", schemaType: "object", code(cxt) { const { gen, schema, data, parentSchema, it } = cxt; const { opts } = it; const patterns = (0, code_1.allSchemaProperties)(schema); const alwaysValidPatterns = patterns.filter(p => (0, util_1.alwaysValidSchema)(it, schema[p])); if (patterns.length === 0 || alwaysValidPatterns.length === patterns.length && (!it.opts.unevaluated || it.props === true)) { return; } const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties; const valid = gen.name("valid"); if (it.props !== true && !(it.props instanceof codegen_1.Name)) { it.props = (0, util_2.evaluatedPropsToName)(gen, it.props); } const { props } = it; validatePatternProperties(); function validatePatternProperties() { for (const pat of patterns) { if (checkProperties) checkMatchingProperties(pat); if (it.allErrors) { validateProperties(pat); } else { gen.var(valid, true); // TODO var validateProperties(pat); gen.if(valid); } } } function checkMatchingProperties(pat) { for (const prop in checkProperties) { if (new RegExp(pat).test(prop)) { (0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`); } } } function validateProperties(pat) { gen.forIn("key", data, key => { gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => { const alwaysValid = alwaysValidPatterns.includes(pat); if (!alwaysValid) { cxt.subschema({ keyword: "patternProperties", schemaProp: pat, dataProp: key, dataPropType: util_2.Type.Str }, valid); } if (it.opts.unevaluated && props !== true) { gen.assign((0, codegen_1._)`${props}[${key}]`, true); } else if (!alwaysValid && !it.allErrors) { // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false) // or if all properties were evaluated (props === true) gen.if((0, codegen_1.not)(valid), () => gen.break()); } }); }); } } }; exports["default"] = def; /***/ }, /***/ 89703 /*!**********************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/applicator/prefixItems.js ***! \**********************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const items_1 = __webpack_require__(/*! ./items */ 11795); const def = { keyword: "prefixItems", type: "array", schemaType: ["array"], before: "uniqueItems", code: cxt => (0, items_1.validateTuple)(cxt, "items") }; exports["default"] = def; /***/ }, /***/ 48590 /*!*********************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/applicator/properties.js ***! \*********************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const validate_1 = __webpack_require__(/*! ../../compile/validate */ 16381); const code_1 = __webpack_require__(/*! ../code */ 26312); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const additionalProperties_1 = __webpack_require__(/*! ./additionalProperties */ 81043); const def = { keyword: "properties", type: "object", schemaType: "object", code(cxt) { const { gen, schema, parentSchema, data, it } = cxt; if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === undefined) { additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, "additionalProperties")); } const allProps = (0, code_1.allSchemaProperties)(schema); for (const prop of allProps) { it.definedProperties.add(prop); } if (it.opts.unevaluated && allProps.length && it.props !== true) { it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props); } const properties = allProps.filter(p => !(0, util_1.alwaysValidSchema)(it, schema[p])); if (properties.length === 0) return; const valid = gen.name("valid"); for (const prop of properties) { if (hasDefault(prop)) { applyPropertySchema(prop); } else { gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties)); applyPropertySchema(prop); if (!it.allErrors) gen.else().var(valid, true); gen.endIf(); } cxt.it.definedProperties.add(prop); cxt.ok(valid); } function hasDefault(prop) { return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined; } function applyPropertySchema(prop) { cxt.subschema({ keyword: "properties", schemaProp: prop, dataProp: prop }, valid); } } }; exports["default"] = def; /***/ }, /***/ 360 /*!************************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/applicator/propertyNames.js ***! \************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const error = { message: "property name must be valid", params: ({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}` }; const def = { keyword: "propertyNames", type: "object", schemaType: ["object", "boolean"], error, code(cxt) { const { gen, schema, data, it } = cxt; if ((0, util_1.alwaysValidSchema)(it, schema)) return; const valid = gen.name("valid"); gen.forIn("key", data, key => { cxt.setParams({ propertyName: key }); cxt.subschema({ keyword: "propertyNames", data: key, dataTypes: ["string"], propertyName: key, compositeRule: true }, valid); gen.if((0, codegen_1.not)(valid), () => { cxt.error(true); if (!it.allErrors) gen.break(); }); }); cxt.ok(valid); } }; exports["default"] = def; /***/ }, /***/ 98849 /*!*******************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/applicator/thenElse.js ***! \*******************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const def = { keyword: ["then", "else"], schemaType: ["object", "boolean"], code({ keyword, parentSchema, it }) { if (parentSchema.if === undefined) (0, util_1.checkStrictMode)(it, `"${keyword}" without "if" is ignored`); } }; exports["default"] = def; /***/ }, /***/ 26312 /*!****************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/code.js ***! \****************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0; const codegen_1 = __webpack_require__(/*! ../compile/codegen */ 34320); const util_1 = __webpack_require__(/*! ../compile/util */ 5156); const names_1 = __webpack_require__(/*! ../compile/names */ 45986); const util_2 = __webpack_require__(/*! ../compile/util */ 5156); function checkReportMissingProp(cxt, prop) { const { gen, data, it } = cxt; gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => { cxt.setParams({ missingProperty: (0, codegen_1._)`${prop}` }, true); cxt.error(); }); } exports.checkReportMissingProp = checkReportMissingProp; function checkMissingProp({ gen, data, it: { opts } }, properties, missing) { return (0, codegen_1.or)(...properties.map(prop => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._)`${missing} = ${prop}`))); } exports.checkMissingProp = checkMissingProp; function reportMissingProp(cxt, missing) { cxt.setParams({ missingProperty: missing }, true); cxt.error(); } exports.reportMissingProp = reportMissingProp; function hasPropFunc(gen) { return gen.scopeValue("func", { // eslint-disable-next-line @typescript-eslint/unbound-method ref: Object.prototype.hasOwnProperty, code: (0, codegen_1._)`Object.prototype.hasOwnProperty` }); } exports.hasPropFunc = hasPropFunc; function isOwnProperty(gen, data, property) { return (0, codegen_1._)`${hasPropFunc(gen)}.call(${data}, ${property})`; } exports.isOwnProperty = isOwnProperty; function propertyInData(gen, data, property, ownProperties) { const cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} !== undefined`; return ownProperties ? (0, codegen_1._)`${cond} && ${isOwnProperty(gen, data, property)}` : cond; } exports.propertyInData = propertyInData; function noPropertyInData(gen, data, property, ownProperties) { const cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} === undefined`; return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond; } exports.noPropertyInData = noPropertyInData; function allSchemaProperties(schemaMap) { return schemaMap ? Object.keys(schemaMap).filter(p => p !== "__proto__") : []; } exports.allSchemaProperties = allSchemaProperties; function schemaProperties(it, schemaMap) { return allSchemaProperties(schemaMap).filter(p => !(0, util_1.alwaysValidSchema)(it, schemaMap[p])); } exports.schemaProperties = schemaProperties; function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) { const dataAndSchema = passSchema ? (0, codegen_1._)`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data; const valCxt = [[names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)], [names_1.default.parentData, it.parentData], [names_1.default.parentDataProperty, it.parentDataProperty], [names_1.default.rootData, names_1.default.rootData]]; if (it.opts.dynamicRef) valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]); const args = (0, codegen_1._)`${dataAndSchema}, ${gen.object(...valCxt)}`; return context !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context}, ${args})` : (0, codegen_1._)`${func}(${args})`; } exports.callValidateCode = callValidateCode; const newRegExp = (0, codegen_1._)`new RegExp`; function usePattern({ gen, it: { opts } }, pattern) { const u = opts.unicodeRegExp ? "u" : ""; const { regExp } = opts.code; const rx = regExp(pattern, u); return gen.scopeValue("pattern", { key: rx.toString(), ref: rx, code: (0, codegen_1._)`${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})` }); } exports.usePattern = usePattern; function validateArray(cxt) { const { gen, data, keyword, it } = cxt; const valid = gen.name("valid"); if (it.allErrors) { const validArr = gen.let("valid", true); validateItems(() => gen.assign(validArr, false)); return validArr; } gen.var(valid, true); validateItems(() => gen.break()); return valid; function validateItems(notValid) { const len = gen.const("len", (0, codegen_1._)`${data}.length`); gen.forRange("i", 0, len, i => { cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid); gen.if((0, codegen_1.not)(valid), notValid); }); } } exports.validateArray = validateArray; function validateUnion(cxt) { const { gen, schema, keyword, it } = cxt; /* istanbul ignore if */ if (!Array.isArray(schema)) throw new Error("ajv implementation error"); const alwaysValid = schema.some(sch => (0, util_1.alwaysValidSchema)(it, sch)); if (alwaysValid && !it.opts.unevaluated) return; const valid = gen.let("valid", false); const schValid = gen.name("_valid"); gen.block(() => schema.forEach((_sch, i) => { const schCxt = cxt.subschema({ keyword, schemaProp: i, compositeRule: true }, schValid); gen.assign(valid, (0, codegen_1._)`${valid} || ${schValid}`); const merged = cxt.mergeValidEvaluated(schCxt, schValid); // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true) // or if all properties and items were evaluated (it.props === true && it.items === true) if (!merged) gen.if((0, codegen_1.not)(valid)); })); cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); } exports.validateUnion = validateUnion; /***/ }, /***/ 53700 /*!*******************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/core/id.js ***! \*******************************************************/ (__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const def = { keyword: "id", code() { throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID'); } }; exports["default"] = def; /***/ }, /***/ 88849 /*!**********************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/core/index.js ***! \**********************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const id_1 = __webpack_require__(/*! ./id */ 53700); const ref_1 = __webpack_require__(/*! ./ref */ 41080); const core = ["$schema", "$id", "$defs", "$vocabulary", { keyword: "$comment" }, "definitions", id_1.default, ref_1.default]; exports["default"] = core; /***/ }, /***/ 41080 /*!********************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/core/ref.js ***! \********************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.callRef = exports.getValidate = void 0; const ref_error_1 = __webpack_require__(/*! ../../compile/ref_error */ 55654); const code_1 = __webpack_require__(/*! ../code */ 26312); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const names_1 = __webpack_require__(/*! ../../compile/names */ 45986); const compile_1 = __webpack_require__(/*! ../../compile */ 8218); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const def = { keyword: "$ref", schemaType: "string", code(cxt) { const { gen, schema: $ref, it } = cxt; const { baseId, schemaEnv: env, validateName, opts, self } = it; const { root } = env; if (($ref === "#" || $ref === "#/") && baseId === root.baseId) return callRootRef(); const schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref); if (schOrEnv === undefined) throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref); if (schOrEnv instanceof compile_1.SchemaEnv) return callValidate(schOrEnv); return inlineRefSchema(schOrEnv); function callRootRef() { if (env === root) return callRef(cxt, validateName, env, env.$async); const rootName = gen.scopeValue("root", { ref: root }); return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root, root.$async); } function callValidate(sch) { const v = getValidate(cxt, sch); callRef(cxt, v, sch, sch.$async); } function inlineRefSchema(sch) { const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch }); const valid = gen.name("valid"); const schCxt = cxt.subschema({ schema: sch, dataTypes: [], schemaPath: codegen_1.nil, topSchemaRef: schName, errSchemaPath: $ref }, valid); cxt.mergeEvaluated(schCxt); cxt.ok(valid); } } }; function getValidate(cxt, sch) { const { gen } = cxt; return sch.validate ? gen.scopeValue("validate", { ref: sch.validate }) : (0, codegen_1._)`${gen.scopeValue("wrapper", { ref: sch })}.validate`; } exports.getValidate = getValidate; function callRef(cxt, v, sch, $async) { const { gen, it } = cxt; const { allErrors, schemaEnv: env, opts } = it; const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil; if ($async) callAsyncRef();else callSyncRef(); function callAsyncRef() { if (!env.$async) throw new Error("async schema referenced by sync schema"); const valid = gen.let("valid"); gen.try(() => { gen.code((0, codegen_1._)`await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`); addEvaluatedFrom(v); // TODO will not work with async, it has to be returned with the result if (!allErrors) gen.assign(valid, true); }, e => { gen.if((0, codegen_1._)`!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e)); addErrorsFrom(e); if (!allErrors) gen.assign(valid, false); }); cxt.ok(valid); } function callSyncRef() { cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v)); } function addErrorsFrom(source) { const errs = (0, codegen_1._)`${source}.errors`; gen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`); // TODO tagged gen.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`); } function addEvaluatedFrom(source) { var _a; if (!it.opts.unevaluated) return; const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated; // TODO refactor if (it.props !== true) { if (schEvaluated && !schEvaluated.dynamicProps) { if (schEvaluated.props !== undefined) { it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props); } } else { const props = gen.var("props", (0, codegen_1._)`${source}.evaluated.props`); it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name); } } if (it.items !== true) { if (schEvaluated && !schEvaluated.dynamicItems) { if (schEvaluated.items !== undefined) { it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items); } } else { const items = gen.var("items", (0, codegen_1._)`${source}.evaluated.items`); it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name); } } } } exports.callRef = callRef; exports["default"] = def; /***/ }, /***/ 6082 /*!*******************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/discriminator/index.js ***! \*******************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const types_1 = __webpack_require__(/*! ../discriminator/types */ 80575); const compile_1 = __webpack_require__(/*! ../../compile */ 8218); const ref_error_1 = __webpack_require__(/*! ../../compile/ref_error */ 55654); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const error = { message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`, params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}` }; const def = { keyword: "discriminator", type: "object", schemaType: "object", error, code(cxt) { const { gen, data, schema, parentSchema, it } = cxt; const { oneOf } = parentSchema; if (!it.opts.discriminator) { throw new Error("discriminator: requires discriminator option"); } const tagName = schema.propertyName; if (typeof tagName != "string") throw new Error("discriminator: requires propertyName"); if (schema.mapping) throw new Error("discriminator: mapping is not supported"); if (!oneOf) throw new Error("discriminator: requires oneOf keyword"); const valid = gen.let("valid", false); const tag = gen.const("tag", (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(tagName)}`); gen.if((0, codegen_1._)`typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName })); cxt.ok(valid); function validateMapping() { const mapping = getMapping(); gen.if(false); for (const tagValue in mapping) { gen.elseIf((0, codegen_1._)`${tag} === ${tagValue}`); gen.assign(valid, applyTagSchema(mapping[tagValue])); } gen.else(); cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName }); gen.endIf(); } function applyTagSchema(schemaProp) { const _valid = gen.name("valid"); const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid); cxt.mergeEvaluated(schCxt, codegen_1.Name); return _valid; } function getMapping() { var _a; const oneOfMapping = {}; const topRequired = hasRequired(parentSchema); let tagRequired = true; for (let i = 0; i < oneOf.length; i++) { let sch = oneOf[i]; if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) { const ref = sch.$ref; sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref); if (sch instanceof compile_1.SchemaEnv) sch = sch.schema; if (sch === undefined) throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref); } const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName]; if (typeof propSch != "object") { throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`); } tagRequired = tagRequired && (topRequired || hasRequired(sch)); addMappings(propSch, i); } if (!tagRequired) throw new Error(`discriminator: "${tagName}" must be required`); return oneOfMapping; function hasRequired({ required }) { return Array.isArray(required) && required.includes(tagName); } function addMappings(sch, i) { if (sch.const) { addMapping(sch.const, i); } else if (sch.enum) { for (const tagValue of sch.enum) { addMapping(tagValue, i); } } else { throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`); } } function addMapping(tagValue, i) { if (typeof tagValue != "string" || tagValue in oneOfMapping) { throw new Error(`discriminator: "${tagName}" values must be unique strings`); } oneOfMapping[tagValue] = i; } } } }; exports["default"] = def; /***/ }, /***/ 80575 /*!*******************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/discriminator/types.js ***! \*******************************************************************/ (__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DiscrError = void 0; var DiscrError; (function (DiscrError) { DiscrError["Tag"] = "tag"; DiscrError["Mapping"] = "mapping"; })(DiscrError || (exports.DiscrError = DiscrError = {})); /***/ }, /***/ 82497 /*!******************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/draft7.js ***! \******************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const core_1 = __webpack_require__(/*! ./core */ 88849); const validation_1 = __webpack_require__(/*! ./validation */ 58357); const applicator_1 = __webpack_require__(/*! ./applicator */ 95995); const format_1 = __webpack_require__(/*! ./format */ 83525); const metadata_1 = __webpack_require__(/*! ./metadata */ 19792); const draft7Vocabularies = [core_1.default, validation_1.default, (0, applicator_1.default)(), format_1.default, metadata_1.metadataVocabulary, metadata_1.contentVocabulary]; exports["default"] = draft7Vocabularies; /***/ }, /***/ 27870 /*!*************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/format/format.js ***! \*************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const error = { message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`, params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}` }; const def = { keyword: "format", type: ["number", "string"], schemaType: "string", $data: true, error, code(cxt, ruleType) { const { gen, data, $data, schema, schemaCode, it } = cxt; const { opts, errSchemaPath, schemaEnv, self } = it; if (!opts.validateFormats) return; if ($data) validate$DataFormat();else validateFormat(); function validate$DataFormat() { const fmts = gen.scopeValue("formats", { ref: self.formats, code: opts.code.formats }); const fDef = gen.const("fDef", (0, codegen_1._)`${fmts}[${schemaCode}]`); const fType = gen.let("fType"); const format = gen.let("format"); // TODO simplify gen.if((0, codegen_1._)`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._)`${fDef}.type || "string"`).assign(format, (0, codegen_1._)`${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._)`"string"`).assign(format, fDef)); cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt())); function unknownFmt() { if (opts.strictSchema === false) return codegen_1.nil; return (0, codegen_1._)`${schemaCode} && !${format}`; } function invalidFmt() { const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` : (0, codegen_1._)`${format}(${data})`; const validData = (0, codegen_1._)`(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`; return (0, codegen_1._)`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`; } } function validateFormat() { const formatDef = self.formats[schema]; if (!formatDef) { unknownFormat(); return; } if (formatDef === true) return; const [fmtType, format, fmtRef] = getFormat(formatDef); if (fmtType === ruleType) cxt.pass(validCondition()); function unknownFormat() { if (opts.strictSchema === false) { self.logger.warn(unknownMsg()); return; } throw new Error(unknownMsg()); function unknownMsg() { return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`; } } function getFormat(fmtDef) { const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : undefined; const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code }); if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) { return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._)`${fmt}.validate`]; } return ["string", fmtDef, fmt]; } function validCondition() { if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) { if (!schemaEnv.$async) throw new Error("async format in sync schema"); return (0, codegen_1._)`await ${fmtRef}(${data})`; } return typeof format == "function" ? (0, codegen_1._)`${fmtRef}(${data})` : (0, codegen_1._)`${fmtRef}.test(${data})`; } } } }; exports["default"] = def; /***/ }, /***/ 83525 /*!************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/format/index.js ***! \************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const format_1 = __webpack_require__(/*! ./format */ 27870); const format = [format_1.default]; exports["default"] = format; /***/ }, /***/ 19792 /*!********************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/metadata.js ***! \********************************************************/ (__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.contentVocabulary = exports.metadataVocabulary = void 0; exports.metadataVocabulary = ["title", "description", "default", "deprecated", "readOnly", "writeOnly", "examples"]; exports.contentVocabulary = ["contentMediaType", "contentEncoding", "contentSchema"]; /***/ }, /***/ 98662 /*!****************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/validation/const.js ***! \****************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const equal_1 = __webpack_require__(/*! ../../runtime/equal */ 64747); const error = { message: "must be equal to constant", params: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}` }; const def = { keyword: "const", $data: true, error, code(cxt) { const { gen, data, $data, schemaCode, schema } = cxt; if ($data || schema && typeof schema == "object") { cxt.fail$data((0, codegen_1._)`!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`); } else { cxt.fail((0, codegen_1._)`${schema} !== ${data}`); } } }; exports["default"] = def; /***/ }, /***/ 18460 /*!***************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/validation/enum.js ***! \***************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const equal_1 = __webpack_require__(/*! ../../runtime/equal */ 64747); const error = { message: "must be equal to one of the allowed values", params: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}` }; const def = { keyword: "enum", schemaType: "array", $data: true, error, code(cxt) { const { gen, data, $data, schema, schemaCode, it } = cxt; if (!$data && schema.length === 0) throw new Error("enum must have non-empty array"); const useLoop = schema.length >= it.opts.loopEnum; let eql; const getEql = () => eql !== null && eql !== void 0 ? eql : eql = (0, util_1.useFunc)(gen, equal_1.default); let valid; if (useLoop || $data) { valid = gen.let("valid"); cxt.block$data(valid, loopEnum); } else { /* istanbul ignore if */ if (!Array.isArray(schema)) throw new Error("ajv implementation error"); const vSchema = gen.const("vSchema", schemaCode); valid = (0, codegen_1.or)(...schema.map((_x, i) => equalCode(vSchema, i))); } cxt.pass(valid); function loopEnum() { gen.assign(valid, false); gen.forOf("v", schemaCode, v => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break())); } function equalCode(vSchema, i) { const sch = schema[i]; return typeof sch === "object" && sch !== null ? (0, codegen_1._)`${getEql()}(${data}, ${vSchema}[${i}])` : (0, codegen_1._)`${data} === ${sch}`; } } }; exports["default"] = def; /***/ }, /***/ 58357 /*!****************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/validation/index.js ***! \****************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const limitNumber_1 = __webpack_require__(/*! ./limitNumber */ 8183); const multipleOf_1 = __webpack_require__(/*! ./multipleOf */ 38544); const limitLength_1 = __webpack_require__(/*! ./limitLength */ 91558); const pattern_1 = __webpack_require__(/*! ./pattern */ 85995); const limitProperties_1 = __webpack_require__(/*! ./limitProperties */ 27611); const required_1 = __webpack_require__(/*! ./required */ 61428); const limitItems_1 = __webpack_require__(/*! ./limitItems */ 22740); const uniqueItems_1 = __webpack_require__(/*! ./uniqueItems */ 85576); const const_1 = __webpack_require__(/*! ./const */ 98662); const enum_1 = __webpack_require__(/*! ./enum */ 18460); const validation = [ // number limitNumber_1.default, multipleOf_1.default, // string limitLength_1.default, pattern_1.default, // object limitProperties_1.default, required_1.default, // array limitItems_1.default, uniqueItems_1.default, // any { keyword: "type", schemaType: ["string", "array"] }, { keyword: "nullable", schemaType: "boolean" }, const_1.default, enum_1.default]; exports["default"] = validation; /***/ }, /***/ 22740 /*!*********************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/validation/limitItems.js ***! \*********************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const error = { message({ keyword, schemaCode }) { const comp = keyword === "maxItems" ? "more" : "fewer"; return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} items`; }, params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}` }; const def = { keyword: ["maxItems", "minItems"], type: "array", schemaType: "number", $data: true, error, code(cxt) { const { keyword, data, schemaCode } = cxt; const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT; cxt.fail$data((0, codegen_1._)`${data}.length ${op} ${schemaCode}`); } }; exports["default"] = def; /***/ }, /***/ 91558 /*!**********************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/validation/limitLength.js ***! \**********************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const ucs2length_1 = __webpack_require__(/*! ../../runtime/ucs2length */ 68554); const error = { message({ keyword, schemaCode }) { const comp = keyword === "maxLength" ? "more" : "fewer"; return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} characters`; }, params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}` }; const def = { keyword: ["maxLength", "minLength"], type: "string", schemaType: "number", $data: true, error, code(cxt) { const { keyword, data, schemaCode, it } = cxt; const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT; const len = it.opts.unicode === false ? (0, codegen_1._)`${data}.length` : (0, codegen_1._)`${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`; cxt.fail$data((0, codegen_1._)`${len} ${op} ${schemaCode}`); } }; exports["default"] = def; /***/ }, /***/ 8183 /*!**********************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/validation/limitNumber.js ***! \**********************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const ops = codegen_1.operators; const KWDs = { maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT }, minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT }, exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE } }; const error = { message: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`, params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}` }; const def = { keyword: Object.keys(KWDs), type: "number", schemaType: "number", $data: true, error, code(cxt) { const { keyword, data, schemaCode } = cxt; cxt.fail$data((0, codegen_1._)`${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`); } }; exports["default"] = def; /***/ }, /***/ 27611 /*!**************************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/validation/limitProperties.js ***! \**************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const error = { message({ keyword, schemaCode }) { const comp = keyword === "maxProperties" ? "more" : "fewer"; return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} properties`; }, params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}` }; const def = { keyword: ["maxProperties", "minProperties"], type: "object", schemaType: "number", $data: true, error, code(cxt) { const { keyword, data, schemaCode } = cxt; const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT; cxt.fail$data((0, codegen_1._)`Object.keys(${data}).length ${op} ${schemaCode}`); } }; exports["default"] = def; /***/ }, /***/ 38544 /*!*********************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/validation/multipleOf.js ***! \*********************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const error = { message: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`, params: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}` }; const def = { keyword: "multipleOf", type: "number", schemaType: "number", $data: true, error, code(cxt) { const { gen, data, schemaCode, it } = cxt; // const bdt = bad$DataType(schemaCode, def.schemaType, $data) const prec = it.opts.multipleOfPrecision; const res = gen.let("res"); const invalid = prec ? (0, codegen_1._)`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` : (0, codegen_1._)`${res} !== parseInt(${res})`; cxt.fail$data((0, codegen_1._)`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`); } }; exports["default"] = def; /***/ }, /***/ 85995 /*!******************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/validation/pattern.js ***! \******************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const code_1 = __webpack_require__(/*! ../code */ 26312); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const error = { message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`, params: ({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}` }; const def = { keyword: "pattern", type: "string", schemaType: "string", $data: true, error, code(cxt) { const { data, $data, schema, schemaCode, it } = cxt; // TODO regexp should be wrapped in try/catchs const u = it.opts.unicodeRegExp ? "u" : ""; const regExp = $data ? (0, codegen_1._)`(new RegExp(${schemaCode}, ${u}))` : (0, code_1.usePattern)(cxt, schema); cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`); } }; exports["default"] = def; /***/ }, /***/ 61428 /*!*******************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/validation/required.js ***! \*******************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const code_1 = __webpack_require__(/*! ../code */ 26312); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const error = { message: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`, params: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}` }; const def = { keyword: "required", type: "object", schemaType: "array", $data: true, error, code(cxt) { const { gen, schema, schemaCode, data, $data, it } = cxt; const { opts } = it; if (!$data && schema.length === 0) return; const useLoop = schema.length >= opts.loopRequired; if (it.allErrors) allErrorsMode();else exitOnErrorMode(); if (opts.strictRequired) { const props = cxt.parentSchema.properties; const { definedProperties } = cxt.it; for (const requiredKey of schema) { if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === undefined && !definedProperties.has(requiredKey)) { const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`; (0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired); } } } function allErrorsMode() { if (useLoop || $data) { cxt.block$data(codegen_1.nil, loopAllRequired); } else { for (const prop of schema) { (0, code_1.checkReportMissingProp)(cxt, prop); } } } function exitOnErrorMode() { const missing = gen.let("missing"); if (useLoop || $data) { const valid = gen.let("valid", true); cxt.block$data(valid, () => loopUntilMissing(missing, valid)); cxt.ok(valid); } else { gen.if((0, code_1.checkMissingProp)(cxt, schema, missing)); (0, code_1.reportMissingProp)(cxt, missing); gen.else(); } } function loopAllRequired() { gen.forOf("prop", schemaCode, prop => { cxt.setParams({ missingProperty: prop }); gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error()); }); } function loopUntilMissing(missing, valid) { cxt.setParams({ missingProperty: missing }); gen.forOf(missing, schemaCode, () => { gen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties)); gen.if((0, codegen_1.not)(valid), () => { cxt.error(); gen.break(); }); }, codegen_1.nil); } } }; exports["default"] = def; /***/ }, /***/ 85576 /*!**********************************************************************!*\ !*** ./node_modules/ajv/dist/vocabularies/validation/uniqueItems.js ***! \**********************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const dataType_1 = __webpack_require__(/*! ../../compile/validate/dataType */ 4545); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 34320); const util_1 = __webpack_require__(/*! ../../compile/util */ 5156); const equal_1 = __webpack_require__(/*! ../../runtime/equal */ 64747); const error = { message: ({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i} are identical)`, params: ({ params: { i, j } }) => (0, codegen_1._)`{i: ${i}, j: ${j}}` }; const def = { keyword: "uniqueItems", type: "array", schemaType: "boolean", $data: true, error, code(cxt) { const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt; if (!$data && !schema) return; const valid = gen.let("valid"); const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : []; cxt.block$data(valid, validateUniqueItems, (0, codegen_1._)`${schemaCode} === false`); cxt.ok(valid); function validateUniqueItems() { const i = gen.let("i", (0, codegen_1._)`${data}.length`); const j = gen.let("j"); cxt.setParams({ i, j }); gen.assign(valid, true); gen.if((0, codegen_1._)`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j)); } function canOptimize() { return itemTypes.length > 0 && !itemTypes.some(t => t === "object" || t === "array"); } function loopN(i, j) { const item = gen.name("item"); const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong); const indices = gen.const("indices", (0, codegen_1._)`{}`); gen.for((0, codegen_1._)`;${i}--;`, () => { gen.let(item, (0, codegen_1._)`${data}[${i}]`); gen.if(wrongType, (0, codegen_1._)`continue`); if (itemTypes.length > 1) gen.if((0, codegen_1._)`typeof ${item} == "string"`, (0, codegen_1._)`${item} += "_"`); gen.if((0, codegen_1._)`typeof ${indices}[${item}] == "number"`, () => { gen.assign(j, (0, codegen_1._)`${indices}[${item}]`); cxt.error(); gen.assign(valid, false).break(); }).code((0, codegen_1._)`${indices}[${item}] = ${i}`); }); } function loopN2(i, j) { const eql = (0, util_1.useFunc)(gen, equal_1.default); const outer = gen.name("outer"); gen.label(outer).for((0, codegen_1._)`;${i}--;`, () => gen.for((0, codegen_1._)`${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._)`${eql}(${data}[${i}], ${data}[${j}])`, () => { cxt.error(); gen.assign(valid, false).break(outer); }))); } } }; exports["default"] = def; /***/ }, /***/ 74844 /*!*********************************************************!*\ !*** ./node_modules/custom-idle-queue/dist/es/index.js ***! \*********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ IdleQueue: () => (/* binding */ IdleQueue) /* harmony export */ }); /** * Creates a new Idle-Queue * @constructor * @param {number} [parallels=1] amount of parrallel runs of the limited-ressource */ var IdleQueue = function IdleQueue() { var parallels = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1; this._parallels = parallels || 1; /** * _queueCounter * each lock() increased this number * each unlock() decreases this number * If _qC==0, the state is in idle * @type {Number} */ this._qC = 0; /** * _idleCalls * contains all promises that where added via requestIdlePromise() * and not have been resolved * @type {Set} _iC with oldest promise first */ this._iC = new Set(); /** * _lastHandleNumber * @type {Number} */ this._lHN = 0; /** * _handlePromiseMap * Contains the handleNumber on the left * And the assigned promise on the right. * This is stored so you can use cancelIdleCallback(handleNumber) * to stop executing the callback. * @type {Map} */ this._hPM = new Map(); this._pHM = new Map(); // _promiseHandleMap }; IdleQueue.prototype = { isIdle: function isIdle() { return this._qC < this._parallels; }, /** * creates a lock in the queue * and returns an unlock-function to remove the lock from the queue * @return {function} unlock function than must be called afterwards */ lock: function lock() { this._qC++; }, unlock: function unlock() { this._qC--; _tryIdleCall(this); }, /** * wraps a function with lock/unlock and runs it * @performance is really important here because * it is often used in hot paths. * @param {function} fun * @return {Promise | any} */ wrapCall: function wrapCall(fun) { var _this = this; this._qC++; var result; try { result = fun(); } catch (err) { this._qC--; _tryIdleCall(this); throw err; } if (result && typeof result.then === 'function') { return result.then(function (ret) { _this._qC--; _tryIdleCall(_this); return ret; }, function (err) { _this._qC--; _tryIdleCall(_this); throw err; }); } this._qC--; _tryIdleCall(this); return result; }, /** * does the same as requestIdleCallback() but uses promises instead of the callback * @param {{timeout?: number}} options like timeout * @return {Promise} promise that resolves when the database is in idle-mode */ requestIdlePromise: function requestIdlePromise(options) { var _this2 = this; options = options || {}; var resolve; var prom = new Promise(function (res) { return resolve = res; }); var resolveFromOutside = function resolveFromOutside() { _removeIdlePromise(_this2, prom); resolve(); }; prom._manRes = resolveFromOutside; if (options.timeout) { // if timeout has passed, resolve promise even if not idle var timeoutObj = setTimeout(function () { prom._manRes(); }, options.timeout); prom._timeoutObj = timeoutObj; } this._iC.add(prom); _tryIdleCall(this); return prom; }, /** * remove the promise so it will never be resolved * @param {Promise} promise from requestIdlePromise() * @return {void} */ cancelIdlePromise: function cancelIdlePromise(promise) { _removeIdlePromise(this, promise); }, /** * api equal to * @link https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback * @param {Function} callback * @param {options} options [description] * @return {number} handle which can be used with cancelIdleCallback() */ requestIdleCallback: function requestIdleCallback(callback, options) { var handle = this._lHN++; var promise = this.requestIdlePromise(options); this._hPM.set(handle, promise); this._pHM.set(promise, handle); promise.then(function () { return callback(); }); return handle; }, /** * API equal to * @link https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelIdleCallback * @param {number} handle returned from requestIdleCallback() * @return {void} */ cancelIdleCallback: function cancelIdleCallback(handle) { var promise = this._hPM.get(handle); this.cancelIdlePromise(promise); }, /** * clears and resets everything * @return {void} */ clear: function clear() { var _this3 = this; // remove all non-cleared this._iC.forEach(function (promise) { return _removeIdlePromise(_this3, promise); }); this._qC = 0; this._iC.clear(); this._hPM = new Map(); this._pHM = new Map(); } }; /** * processes the oldest call of the idleCalls-queue * @return {Promise} */ function _resolveOneIdleCall(idleQueue) { if (idleQueue._iC.size === 0) return; var iterator = idleQueue._iC.values(); var oldestPromise = iterator.next().value; oldestPromise._manRes(); // try to call the next tick setTimeout(function () { return _tryIdleCall(idleQueue); }, 0); } /** * removes the promise from the queue and maps and also its corresponding handle-number * @param {Promise} promise from requestIdlePromise() * @return {void} */ function _removeIdlePromise(idleQueue, promise) { if (!promise) return; // remove timeout if exists if (promise._timeoutObj) clearTimeout(promise._timeoutObj); // remove handle-nr if exists if (idleQueue._pHM.has(promise)) { var handle = idleQueue._pHM.get(promise); idleQueue._hPM["delete"](handle); idleQueue._pHM["delete"](promise); } // remove from queue idleQueue._iC["delete"](promise); } /** * resolves the last entry of this._iC * but only if the queue is empty * @return {Promise} */ function _tryIdleCall(idleQueue) { // console.log('_tryIdleCall:'); // console.dir({ // try: idleQueue._tryIR, // size: idleQueue._iC.size // }); // ensure this does not run in parallel if (idleQueue._tryIR || idleQueue._iC.size === 0) return; idleQueue._tryIR = true; // w8 one tick setTimeout(function () { // check if queue empty if (!idleQueue.isIdle()) { idleQueue._tryIR = false; return; } /** * wait 1 tick here * because many functions do IO->CPU->IO * which means the queue is empty for a short time * but the ressource is not idle */ setTimeout(function () { // check if queue still empty if (!idleQueue.isIdle()) { idleQueue._tryIR = false; return; } // ressource is idle _resolveOneIdleCall(idleQueue); idleQueue._tryIR = false; }, 0); }, 0); } /***/ }, /***/ 78018 /*!*******************************************!*\ !*** ./node_modules/debug/src/browser.js ***! \*******************************************/ (module, exports, __webpack_require__) { /* eslint-env browser */ /** * This is the web browser implementation of `debug()`. */ exports.formatArgs = formatArgs; exports.save = save; exports.load = load; exports.useColors = useColors; exports.storage = localstorage(); exports.destroy = (() => { let warned = false; return () => { if (!warned) { warned = true; console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); } }; })(); /** * Colors. */ exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33']; /** * Currently only WebKit-based Web Inspectors, Firefox >= v31, * and the Firebug extension (any Firefox version) are known * to support "%c" CSS customizations. * * TODO: add a `localStorage` variable to explicitly enable/disable colors */ // eslint-disable-next-line complexity function useColors() { // NB: In an Electron preload script, document will be defined but not fully // initialized. Since we know we're in Chrome, we'll just detect this case // explicitly if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { return true; } // Internet Explorer and Edge do not support colors. if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { return false; } let m; // Is webkit? http://stackoverflow.com/a/16459606/376773 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 // eslint-disable-next-line no-return-assign return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773 typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31? // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/); } /** * Colorize log arguments if enabled. * * @api public */ function formatArgs(args) { args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff); if (!this.useColors) { return; } const c = 'color: ' + this.color; args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other // arguments passed either before or after the %c, so we need to // figure out the correct index to insert the CSS into let index = 0; let lastC = 0; args[0].replace(/%[a-zA-Z%]/g, match => { if (match === '%%') { return; } index++; if (match === '%c') { // We only are interested in the *last* %c // (the user may have provided their own) lastC = index; } }); args.splice(lastC, 0, c); } /** * Invokes `console.debug()` when available. * No-op when `console.debug` is not a "function". * If `console.debug` is not available, falls back * to `console.log`. * * @api public */ exports.log = console.debug || console.log || (() => {}); /** * Save `namespaces`. * * @param {String} namespaces * @api private */ function save(namespaces) { try { if (namespaces) { exports.storage.setItem('debug', namespaces); } else { exports.storage.removeItem('debug'); } } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } /** * Load `namespaces`. * * @return {String} returns the previously persisted debug modes * @api private */ function load() { let r; try { r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG'); } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } // If debug isn't set in LS, and we're in Electron, try to load $DEBUG if (!r && typeof process !== 'undefined' && 'env' in process) { r = process.env.DEBUG; } return r; } /** * Localstorage attempts to return the localstorage. * * This is necessary because safari throws * when a user disables cookies/localstorage * and you attempt to access it. * * @return {LocalStorage} * @api private */ function localstorage() { try { // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context // The Browser also has localStorage in the global context. return localStorage; } catch (error) { // Swallow // XXX (@Qix-) should we be logging these? } } module.exports = __webpack_require__(/*! ./common */ 89229)(exports); const { formatters } = module.exports; /** * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. */ formatters.j = function (v) { try { return JSON.stringify(v); } catch (error) { return '[UnexpectedJSONParseError]: ' + error.message; } }; /***/ }, /***/ 89229 /*!******************************************!*\ !*** ./node_modules/debug/src/common.js ***! \******************************************/ (module, __unused_webpack_exports, __webpack_require__) { /** * This is the common logic for both the Node.js and web browser * implementations of `debug()`. */ function setup(env) { createDebug.debug = createDebug; createDebug.default = createDebug; createDebug.coerce = coerce; createDebug.disable = disable; createDebug.enable = enable; createDebug.enabled = enabled; createDebug.humanize = __webpack_require__(/*! ms */ 9124); createDebug.destroy = destroy; Object.keys(env).forEach(key => { createDebug[key] = env[key]; }); /** * The currently active debug mode names, and names to skip. */ createDebug.names = []; createDebug.skips = []; /** * Map of special "%n" handling functions, for the debug "format" argument. * * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". */ createDebug.formatters = {}; /** * Selects a color for a debug namespace * @param {String} namespace The namespace string for the debug instance to be colored * @return {Number|String} An ANSI color code for the given namespace * @api private */ function selectColor(namespace) { let hash = 0; for (let i = 0; i < namespace.length; i++) { hash = (hash << 5) - hash + namespace.charCodeAt(i); hash |= 0; // Convert to 32bit integer } return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; } createDebug.selectColor = selectColor; /** * Create a debugger with the given `namespace`. * * @param {String} namespace * @return {Function} * @api public */ function createDebug(namespace) { let prevTime; let enableOverride = null; let namespacesCache; let enabledCache; function debug(...args) { // Disabled? if (!debug.enabled) { return; } const self = debug; // Set `diff` timestamp const curr = Number(new Date()); const ms = curr - (prevTime || curr); self.diff = ms; self.prev = prevTime; self.curr = curr; prevTime = curr; args[0] = createDebug.coerce(args[0]); if (typeof args[0] !== 'string') { // Anything else let's inspect with %O args.unshift('%O'); } // Apply any `formatters` transformations let index = 0; args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { // If we encounter an escaped % then don't increase the array index if (match === '%%') { return '%'; } index++; const formatter = createDebug.formatters[format]; if (typeof formatter === 'function') { const val = args[index]; match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format` args.splice(index, 1); index--; } return match; }); // Apply env-specific formatting (colors, etc.) createDebug.formatArgs.call(self, args); const logFn = self.log || createDebug.log; logFn.apply(self, args); } debug.namespace = namespace; debug.useColors = createDebug.useColors(); debug.color = createDebug.selectColor(namespace); debug.extend = extend; debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. Object.defineProperty(debug, 'enabled', { enumerable: true, configurable: false, get: () => { if (enableOverride !== null) { return enableOverride; } if (namespacesCache !== createDebug.namespaces) { namespacesCache = createDebug.namespaces; enabledCache = createDebug.enabled(namespace); } return enabledCache; }, set: v => { enableOverride = v; } }); // Env-specific initialization logic for debug instances if (typeof createDebug.init === 'function') { createDebug.init(debug); } return debug; } function extend(namespace, delimiter) { const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); newDebug.log = this.log; return newDebug; } /** * Enables a debug mode by namespaces. This can include modes * separated by a colon and wildcards. * * @param {String} namespaces * @api public */ function enable(namespaces) { createDebug.save(namespaces); createDebug.namespaces = namespaces; createDebug.names = []; createDebug.skips = []; const split = (typeof namespaces === 'string' ? namespaces : '').trim().replace(/\s+/g, ',').split(',').filter(Boolean); for (const ns of split) { if (ns[0] === '-') { createDebug.skips.push(ns.slice(1)); } else { createDebug.names.push(ns); } } } /** * Checks if the given string matches a namespace template, honoring * asterisks as wildcards. * * @param {String} search * @param {String} template * @return {Boolean} */ function matchesTemplate(search, template) { let searchIndex = 0; let templateIndex = 0; let starIndex = -1; let matchIndex = 0; while (searchIndex < search.length) { if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) { // Match character or proceed with wildcard if (template[templateIndex] === '*') { starIndex = templateIndex; matchIndex = searchIndex; templateIndex++; // Skip the '*' } else { searchIndex++; templateIndex++; } } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition // Backtrack to the last '*' and try to match more characters templateIndex = starIndex + 1; matchIndex++; searchIndex = matchIndex; } else { return false; // No match } } // Handle trailing '*' in template while (templateIndex < template.length && template[templateIndex] === '*') { templateIndex++; } return templateIndex === template.length; } /** * Disable debug output. * * @return {String} namespaces * @api public */ function disable() { const namespaces = [...createDebug.names, ...createDebug.skips.map(namespace => '-' + namespace)].join(','); createDebug.enable(''); return namespaces; } /** * Returns true if the given mode name is enabled, false otherwise. * * @param {String} name * @return {Boolean} * @api public */ function enabled(name) { for (const skip of createDebug.skips) { if (matchesTemplate(name, skip)) { return false; } } for (const ns of createDebug.names) { if (matchesTemplate(name, ns)) { return true; } } return false; } /** * Coerce `val`. * * @param {Mixed} val * @return {Mixed} * @api private */ function coerce(val) { if (val instanceof Error) { return val.stack || val.message; } return val; } /** * XXX DO NOT USE. This is a temporary stub function. * XXX It WILL be removed in the next major release. */ function destroy() { console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); } createDebug.enable(createDebug.load()); return createDebug; } module.exports = setup; /***/ }, /***/ 73672 /*!****************************************************!*\ !*** ./node_modules/define-data-property/index.js ***! \****************************************************/ (module, __unused_webpack_exports, __webpack_require__) { "use strict"; var $defineProperty = __webpack_require__(/*! es-define-property */ 29186); var $SyntaxError = __webpack_require__(/*! es-errors/syntax */ 69685); var $TypeError = __webpack_require__(/*! es-errors/type */ 30510); var gopd = __webpack_require__(/*! gopd */ 50510); /** @type {import('.')} */ module.exports = function defineDataProperty(obj, property, value) { if (!obj || typeof obj !== 'object' && typeof obj !== 'function') { throw new $TypeError('`obj` must be an object or a function`'); } if (typeof property !== 'string' && typeof property !== 'symbol') { throw new $TypeError('`property` must be a string or a symbol`'); } if (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) { throw new $TypeError('`nonEnumerable`, if provided, must be a boolean or null'); } if (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) { throw new $TypeError('`nonWritable`, if provided, must be a boolean or null'); } if (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) { throw new $TypeError('`nonConfigurable`, if provided, must be a boolean or null'); } if (arguments.length > 6 && typeof arguments[6] !== 'boolean') { throw new $TypeError('`loose`, if provided, must be a boolean'); } var nonEnumerable = arguments.length > 3 ? arguments[3] : null; var nonWritable = arguments.length > 4 ? arguments[4] : null; var nonConfigurable = arguments.length > 5 ? arguments[5] : null; var loose = arguments.length > 6 ? arguments[6] : false; /* @type {false | TypedPropertyDescriptor} */ var desc = !!gopd && gopd(obj, property); if ($defineProperty) { $defineProperty(obj, property, { configurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable, enumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable, value: value, writable: nonWritable === null && desc ? desc.writable : !nonWritable }); } else if (loose || !nonEnumerable && !nonWritable && !nonConfigurable) { // must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable obj[property] = value; // eslint-disable-line no-param-reassign } else { throw new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.'); } }; /***/ }, /***/ 19771 /*!*************************************************!*\ !*** ./node_modules/define-properties/index.js ***! \*************************************************/ (module, __unused_webpack_exports, __webpack_require__) { "use strict"; var keys = __webpack_require__(/*! object-keys */ 47758); var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol'; var toStr = Object.prototype.toString; var concat = Array.prototype.concat; var defineDataProperty = __webpack_require__(/*! define-data-property */ 73672); var isFunction = function (fn) { return typeof fn === 'function' && toStr.call(fn) === '[object Function]'; }; var supportsDescriptors = __webpack_require__(/*! has-property-descriptors */ 59629)(); var defineProperty = function (object, name, value, predicate) { if (name in object) { if (predicate === true) { if (object[name] === value) { return; } } else if (!isFunction(predicate) || !predicate()) { return; } } if (supportsDescriptors) { defineDataProperty(object, name, value, true); } else { defineDataProperty(object, name, value); } }; var defineProperties = function (object, map) { var predicates = arguments.length > 2 ? arguments[2] : {}; var props = keys(map); if (hasSymbols) { props = concat.call(props, Object.getOwnPropertySymbols(map)); } for (var i = 0; i < props.length; i += 1) { defineProperty(object, props[i], map[props[i]], predicates[props[i]]); } }; defineProperties.supportsDescriptors = !!supportsDescriptors; module.exports = defineProperties; /***/ }, /***/ 99564 /*!***********************************************************!*\ !*** ./node_modules/dicom-parser/dist/dicomParser.min.js ***! \***********************************************************/ (module, __unused_webpack_exports, __webpack_require__) { /*! dicom-parser - 1.8.12 - 2023-02-20 | (c) 2017 Chris Hafey | https://github.com/cornerstonejs/dicomParser */ !function (e, t) { true ? module.exports = t(__webpack_require__(/*! zlib */ 56559)) : 0; }(this, function (r) { return a = [function (e, t) { e.exports = r; }, function (e, t, s) { "use strict"; s.r(t), s.d(t, "isStringVr", function () { return d; }), s.d(t, "isPrivateTag", function () { return f; }), s.d(t, "parsePN", function () { return a; }), s.d(t, "parseTM", function () { return n; }), s.d(t, "parseDA", function () { return o; }), s.d(t, "explicitElementToString", function () { return l; }), s.d(t, "explicitDataSetToJS", function () { return u; }), s.d(t, "createJPEGBasicOffsetTable", function () { return p; }), s.d(t, "parseDicomDataSetExplicit", function () { return q; }), s.d(t, "parseDicomDataSetImplicit", function () { return T; }), s.d(t, "readFixedString", function () { return b; }), s.d(t, "alloc", function () { return k; }), s.d(t, "version", function () { return L; }), s.d(t, "bigEndianByteArrayParser", function () { return N; }), s.d(t, "ByteStream", function () { return J; }), s.d(t, "sharedCopy", function () { return j; }), s.d(t, "DataSet", function () { return w; }), s.d(t, "findAndSetUNElementLength", function () { return y; }), s.d(t, "findEndOfEncapsulatedElement", function () { return g; }), s.d(t, "findItemDelimitationItemAndSetElementLength", function () { return x; }), s.d(t, "littleEndianByteArrayParser", function () { return M; }), s.d(t, "parseDicom", function () { return V; }), s.d(t, "readDicomElementExplicit", function () { return B; }), s.d(t, "readDicomElementImplicit", function () { return A; }), s.d(t, "readEncapsulatedImageFrame", function () { return W; }), s.d(t, "readEncapsulatedPixelData", function () { return K; }), s.d(t, "readEncapsulatedPixelDataFromFragments", function () { return _; }), s.d(t, "readPart10Header", function () { return G; }), s.d(t, "readSequenceItemsExplicit", function () { return I; }), s.d(t, "readSequenceItemsImplicit", function () { return F; }), s.d(t, "readSequenceItem", function () { return S; }), s.d(t, "readTag", function () { return h; }); var r = { AE: !0, AS: !0, AT: !1, CS: !0, DA: !0, DS: !0, DT: !0, FL: !1, FD: !1, IS: !0, LO: !0, LT: !0, OB: !1, OD: !1, OF: !1, OW: !1, PN: !0, SH: !0, SL: !1, SQ: !1, SS: !1, ST: !0, TM: !0, UI: !0, UL: !1, UN: void 0, UR: !0, US: !1, UT: !0 }, d = function (e) { return r[e]; }, f = function (e) { e = parseInt(e[4], 16); if (isNaN(e)) throw "dicomParser.isPrivateTag: cannot parse last character of group"; return e % 2 == 1; }, a = function (e) { if (void 0 !== e) { e = e.split("^"); return { familyName: e[0], givenName: e[1], middleName: e[2], prefix: e[3], suffix: e[4] }; } }; function n(e, t) { if (2 <= e.length) { var r = parseInt(e.substring(0, 2), 10), a = 4 <= e.length ? parseInt(e.substring(2, 4), 10) : void 0, n = 6 <= e.length ? parseInt(e.substring(4, 6), 10) : void 0, i = 8 <= e.length ? e.substring(7, 13) : void 0, i = i ? parseInt(i, 10) * Math.pow(10, 6 - i.length) : void 0; if (t && (isNaN(r) || void 0 !== a && isNaN(a) || void 0 !== n && isNaN(n) || void 0 !== i && isNaN(i) || r < 0 || 23 < r || a && (a < 0 || 59 < a) || n && (n < 0 || 59 < n) || i && (i < 0 || 999999 < i))) throw "invalid TM '".concat(e, "'"); return { hours: r, minutes: a, seconds: n, fractionalSeconds: i }; } if (t) throw "invalid TM '".concat(e, "'"); } function i(e, t, r) { return !isNaN(r) && 0 < t && t <= 12 && 0 < e && e <= function (e, t) { switch (e) { case 2: return t % 4 == 0 && t % 100 || t % 400 == 0 ? 29 : 28; case 9: case 4: case 6: case 11: return 30; default: return 31; } }(t, r); } function o(e, t) { if (e && 8 === e.length) { var r = parseInt(e.substring(0, 4), 10), a = parseInt(e.substring(4, 6), 10), n = parseInt(e.substring(6, 8), 10); if (t && !0 !== i(n, a, r)) throw "invalid DA '".concat(e, "'"); return { year: r, month: a, day: n }; } if (t) throw "invalid DA '".concat(e, "'"); } function l(n, e) { if (void 0 === n || void 0 === e) throw "dicomParser.explicitElementToString: missing required parameters"; if (void 0 === e.vr) throw "dicomParser.explicitElementToString: cannot convert implicit element to string"; var t, r = e.vr, i = e.tag; function a(e, t) { for (var r = "", a = 0; a < e; a++) 0 !== a && (r += "/"), r += t.call(n, i, a).toString(); return r; } if (!0 === d(r)) t = n.string(i);else { if ("AT" === r) { var o = n.uint32(i); return void 0 === o ? void 0 : "x".concat((o = o < 0 ? 4294967295 + o + 1 : o).toString(16).toUpperCase()); } "US" === r ? t = a(e.length / 2, n.uint16) : "SS" === r ? t = a(e.length / 2, n.int16) : "UL" === r ? t = a(e.length / 4, n.uint32) : "SL" === r ? t = a(e.length / 4, n.int32) : "FD" === r ? t = a(e.length / 8, n.double) : "FL" === r && (t = a(e.length / 4, n.float)); } return t; } function u(e, t) { if (void 0 === e) throw "dicomParser.explicitDataSetToJS: missing required parameter dataSet"; t = t || { omitPrivateAttibutes: !0, maxElementLength: 128 }; var r, a = {}; for (r in e.elements) { var n = e.elements[r]; if (!0 !== t.omitPrivateAttibutes || !f(r)) if (n.items) { for (var i = [], o = 0; o < n.items.length; o++) i.push(u(n.items[o].dataSet, t)); a[r] = i; } else { var s = void 0; n.length < t.maxElementLength && (s = l(e, n)), a[r] = void 0 !== s ? s : { dataOffset: n.dataOffset, length: n.length }; } } return a; } function c(e, t) { return 255 === e.byteArray[t] && 217 === e.byteArray[t + 1]; } function m(e, t, r) { for (var a, n, i = r; i < t.fragments.length; i++) if (a = e, n = i, n = t.fragments[n], !(!c(a, n.position + n.length - 2) && !c(a, n.position + n.length - 3))) return i; } function p(e, t, r) { if (void 0 === e) throw "dicomParser.createJPEGBasicOffsetTable: missing required parameter dataSet"; if (void 0 === t) throw "dicomParser.createJPEGBasicOffsetTable: missing required parameter pixelDataElement"; if ("x7fe00010" !== t.tag) throw "dicomParser.createJPEGBasicOffsetTable: parameter 'pixelDataElement' refers to non pixel data tag (expected tag = x7fe00010'"; if (!0 !== t.encapsulatedPixelData) throw "dicomParser.createJPEGBasicOffsetTable: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data"; if (!0 !== t.hadUndefinedLength) throw "dicomParser.createJPEGBasicOffsetTable: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data"; if (void 0 === t.basicOffsetTable) throw "dicomParser.createJPEGBasicOffsetTable: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data"; if (void 0 === t.fragments) throw "dicomParser.createJPEGBasicOffsetTable: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data"; if (t.fragments.length <= 0) throw "dicomParser.createJPEGBasicOffsetTable: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data"; if (r && r.length <= 0) throw "dicomParser.createJPEGBasicOffsetTable: parameter 'fragments' must not be zero length"; r = r || t.fragments; for (var a = [], n = 0;;) { a.push(t.fragments[n].offset); var i = m(e, t, n); if (void 0 === i || i === t.fragments.length - 1) return a; n = i + 1; } } function h(e) { if (void 0 === e) throw "dicomParser.readTag: missing required parameter 'byteStream'"; var t = 256 * e.readUint16() * 256, e = e.readUint16(); return "x".concat("00000000".concat((t + e).toString(16)).substr(-8)); } function g(e, t, r) { if (void 0 === e) throw "dicomParser.findEndOfEncapsulatedElement: missing required parameter 'byteStream'"; if (void 0 === t) throw "dicomParser.findEndOfEncapsulatedElement: missing required parameter 'element'"; if (t.encapsulatedPixelData = !0, t.basicOffsetTable = [], t.fragments = [], "xfffee000" !== h(e)) throw "dicomParser.findEndOfEncapsulatedElement: basic offset table not found"; for (var a = e.readUint32() / 4, n = 0; n < a; n++) { var i = e.readUint32(); t.basicOffsetTable.push(i); } for (var o = e.position; e.position < e.byteArray.length;) { var s = h(e), d = e.readUint32(); if ("xfffee0dd" === s) return e.seek(d), void (t.length = e.position - t.dataOffset); if ("xfffee000" !== s) return r && r.push("unexpected tag ".concat(s, " while searching for end of pixel data element with undefined length")), d > e.byteArray.length - e.position && (d = e.byteArray.length - e.position), t.fragments.push({ offset: e.position - o - 8, position: e.position, length: d }), e.seek(d), void (t.length = e.position - t.dataOffset); t.fragments.push({ offset: e.position - o - 8, position: e.position, length: d }), e.seek(d); } r && r.push("pixel data element ".concat(t.tag, " missing sequence delimiter tag xfffee0dd")); } function y(e, t) { if (void 0 === e) throw "dicomParser.findAndSetUNElementLength: missing required parameter 'byteStream'"; for (var r = e.byteArray.length - 8; e.position <= r;) if (65534 === e.readUint16()) { var a = e.readUint16(); if (57565 === a) return 0 !== e.readUint32() && e.warnings("encountered non zero length following item delimiter at position ".concat(e.position - 4, " while reading element of undefined length with tag ").concat(t.tag)), void (t.length = e.position - t.dataOffset); } t.length = e.byteArray.length - t.dataOffset, e.seek(e.byteArray.length - e.position); } function b(e, t, r) { if (r < 0) throw "dicomParser.readFixedString - length cannot be less than 0"; if (t + r > e.length) throw "dicomParser.readFixedString: attempt to read past end of buffer"; for (var a, n = "", i = 0; i < r; i++) { if (0 === (a = e[t + i])) return t += r, n; n += String.fromCharCode(a); } return n; } function v(e, t) { for (var r = 0; r < t.length; r++) { var a = t[r]; a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a); } } function P(e, t) { return void 0 !== e.parser ? e.parser : t; } var w = function () { function a(e, t, r) { !function (e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); }(this, a), this.byteArrayParser = e, this.byteArray = t, this.elements = r; } var e, t, r; return e = a, (t = [{ key: "uint16", value: function (e, t) { e = this.elements[e]; if (t = void 0 !== t ? t : 0, e && 0 !== e.length) return P(e, this.byteArrayParser).readUint16(this.byteArray, e.dataOffset + 2 * t); } }, { key: "int16", value: function (e, t) { e = this.elements[e]; if (t = void 0 !== t ? t : 0, e && 0 !== e.length) return P(e, this.byteArrayParser).readInt16(this.byteArray, e.dataOffset + 2 * t); } }, { key: "uint32", value: function (e, t) { e = this.elements[e]; if (t = void 0 !== t ? t : 0, e && 0 !== e.length) return P(e, this.byteArrayParser).readUint32(this.byteArray, e.dataOffset + 4 * t); } }, { key: "int32", value: function (e, t) { e = this.elements[e]; if (t = void 0 !== t ? t : 0, e && 0 !== e.length) return P(e, this.byteArrayParser).readInt32(this.byteArray, e.dataOffset + 4 * t); } }, { key: "float", value: function (e, t) { e = this.elements[e]; if (t = void 0 !== t ? t : 0, e && 0 !== e.length) return P(e, this.byteArrayParser).readFloat(this.byteArray, e.dataOffset + 4 * t); } }, { key: "double", value: function (e, t) { e = this.elements[e]; if (t = void 0 !== t ? t : 0, e && 0 !== e.length) return P(e, this.byteArrayParser).readDouble(this.byteArray, e.dataOffset + 8 * t); } }, { key: "numStringValues", value: function (e) { e = this.elements[e]; if (e && 0 < e.length) { e = b(this.byteArray, e.dataOffset, e.length).match(/\\/g); return null === e ? 1 : e.length + 1; } } }, { key: "string", value: function (e, t) { e = this.elements[e]; if (e && e.Value) return e.Value; if (e && 0 < e.length) { e = b(this.byteArray, e.dataOffset, e.length); return 0 <= t ? e.split("\\")[t].trim() : e.trim(); } } }, { key: "text", value: function (e, t) { e = this.elements[e]; if (e && 0 < e.length) { e = b(this.byteArray, e.dataOffset, e.length); return 0 <= t ? e.split("\\")[t].replace(/ +$/, "") : e.replace(/ +$/, ""); } } }, { key: "floatString", value: function (e, t) { var r = this.elements[e]; if (r && 0 < r.length) { t = this.string(e, t = void 0 !== t ? t : 0); if (void 0 !== t) return parseFloat(t); } } }, { key: "intString", value: function (e, t) { var r = this.elements[e]; if (r && 0 < r.length) { t = this.string(e, t = void 0 !== t ? t : 0); if (void 0 !== t) return parseInt(t); } } }, { key: "attributeTag", value: function (e) { var t = this.elements[e]; if (t && 4 === t.length) { var r = P(t, this.byteArrayParser).readUint16, e = this.byteArray, t = t.dataOffset; return "x".concat("00000000".concat((256 * r(e, t) * 256 + r(e, t + 2)).toString(16)).substr(-8)); } } }]) && v(e.prototype, t), r && v(e, r), Object.defineProperty(e, "prototype", { writable: !1 }), a; }(); function x(e, t) { if (void 0 === e) throw "dicomParser.readDicomElementImplicit: missing required parameter 'byteStream'"; for (var r = e.byteArray.length - 8; e.position <= r;) if (65534 === e.readUint16()) { var a = e.readUint16(); if (57357 === a) return 0 !== e.readUint32() && e.warnings("encountered non zero length following item delimiter at position ".concat(e.position - 4, " while reading element of undefined length with tag ").concat(t.tag)), void (t.length = e.position - t.dataOffset); } t.length = e.byteArray.length - t.dataOffset, e.seek(e.byteArray.length - e.position); } var E = function (e, t) { if (void 0 !== e.vr) return "SQ" === e.vr; if (t.position + 4 <= t.byteArray.length) { e = h(t); return t.seek(-4), "xfffee000" === e || "xfffee0dd" === e; } return t.warnings.push("eof encountered before finding sequence item tag or sequence delimiter tag in peeking to determine VR"), !1; }; function A(e, t, r) { if (void 0 === e) throw "dicomParser.readDicomElementImplicit: missing required parameter 'byteStream'"; var a = h(e), a = { tag: a, vr: void 0 !== r ? r(a) : void 0, length: e.readUint32(), dataOffset: e.position }; return 4294967295 === a.length && (a.hadUndefinedLength = !0), a.tag === t || (!E(a, e) || f(a.tag) && !a.hadUndefinedLength ? a.hadUndefinedLength ? x(e, a) : e.seek(a.length) : (F(e, a, r), f(a.tag) && (a.items = void 0))), a; } function S(e) { if (void 0 === e) throw "dicomParser.readSequenceItem: missing required parameter 'byteStream'"; var t = { tag: h(e), length: e.readUint32(), dataOffset: e.position }; if ("xfffee000" !== t.tag) throw "dicomParser.readSequenceItem: item tag (FFFE,E000) not found at offset ".concat(e.position); return t; } function D(e, t) { var r = S(e); return 4294967295 === r.length ? (r.hadUndefinedLength = !0, r.dataSet = function (e, t) { for (var r = {}; e.position < e.byteArray.length;) { var a = A(e, void 0, t); if ("xfffee00d" === (r[a.tag] = a).tag) return new w(e.byteArrayParser, e.byteArray, r); } return e.warnings.push("eof encountered before finding sequence item delimiter in sequence item of undefined length"), new w(e.byteArrayParser, e.byteArray, r); }(e, t), r.length = e.position - r.dataOffset) : (r.dataSet = new w(e.byteArrayParser, e.byteArray, {}), T(r.dataSet, e, e.position + r.length, { vrCallback: t })), r; } function F(e, t, r) { if (void 0 === e) throw "dicomParser.readSequenceItemsImplicit: missing required parameter 'byteStream'"; if (void 0 === t) throw "dicomParser.readSequenceItemsImplicit: missing required parameter 'element'"; t.items = [], (4294967295 === t.length ? function (e, t, r) { for (; e.position + 4 <= e.byteArray.length;) { var a = h(e); if (e.seek(-4), "xfffee0dd" === a) return t.length = e.position - t.dataOffset, e.seek(8); a = D(e, r); t.items.push(a); } e.warnings.push("eof encountered before finding sequence delimiter in sequence of undefined length"), t.length = e.byteArray.length - t.dataOffset; } : function (e, t, r) { for (var a = t.dataOffset + t.length; e.position < a;) { var n = D(e, r); t.items.push(n); } })(e, t, r); } function O(e, t) { var r = S(e); return 4294967295 === r.length ? (r.hadUndefinedLength = !0, r.dataSet = function (e, t) { for (var r = {}; e.position < e.byteArray.length;) { var a = B(e, t); if ("xfffee00d" === (r[a.tag] = a).tag) return new w(e.byteArrayParser, e.byteArray, r); } return t.push("eof encountered before finding item delimiter tag while reading sequence item of undefined length"), new w(e.byteArrayParser, e.byteArray, r); }(e, t), r.length = e.position - r.dataOffset) : (r.dataSet = new w(e.byteArrayParser, e.byteArray, {}), q(r.dataSet, e, e.position + r.length)), r; } function I(e, t, r) { if (void 0 === e) throw "dicomParser.readSequenceItemsExplicit: missing required parameter 'byteStream'"; if (void 0 === t) throw "dicomParser.readSequenceItemsExplicit: missing required parameter 'element'"; t.items = [], (4294967295 === t.length ? function (e, t, r) { for (; e.position + 4 <= e.byteArray.length;) { var a = h(e); if (e.seek(-4), "xfffee0dd" === a) return t.length = e.position - t.dataOffset, e.seek(8); a = O(e, r); t.items.push(a); } r.push("eof encountered before finding sequence delimitation tag while reading sequence of undefined length"), t.length = e.position - t.dataOffset; } : function (e, t, r) { for (var a = t.dataOffset + t.length; e.position < a;) { var n = O(e, r); t.items.push(n); } })(e, t, r); } var U = function (e) { return "OB" === e || "OD" === e || "OL" === e || "OW" === e || "SQ" === e || "OF" === e || "UC" === e || "UR" === e || "UT" === e || "UN" === e ? 4 : 2; }; function B(e, t, r) { if (void 0 === e) throw "dicomParser.readDicomElementExplicit: missing required parameter 'byteStream'"; var a = { tag: h(e), vr: e.readFixedString(2) }; return 2 === U(a.vr) ? a.length = e.readUint16() : (e.seek(2), a.length = e.readUint32()), a.dataOffset = e.position, 4294967295 === a.length && (a.hadUndefinedLength = !0), a.tag === r || ("SQ" === a.vr ? I(e, a, t) : 4294967295 === a.length ? "x7fe00010" === a.tag ? g(e, a, t) : ("UN" === a.vr ? F : x)(e, a) : e.seek(a.length)), a; } function q(e, t, r) { var a = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : {}; if (r = void 0 === r ? t.byteArray.length : r, void 0 === t) throw "dicomParser.parseDicomDataSetExplicit: missing required parameter 'byteStream'"; if (r < t.position || r > t.byteArray.length) throw "dicomParser.parseDicomDataSetExplicit: invalid value for parameter 'maxP osition'"; for (var n = e.elements; t.position < r;) { var i = B(t, e.warnings, a.untilTag); if ((n[i.tag] = i).tag === a.untilTag) return; } if (t.position > r) throw "dicomParser:parseDicomDataSetExplicit: buffer overrun"; } function T(e, t, r) { var a = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : {}; if (r = void 0 === r ? e.byteArray.length : r, void 0 === t) throw "dicomParser.parseDicomDataSetImplicit: missing required parameter 'byteStream'"; if (r < t.position || r > t.byteArray.length) throw "dicomParser.parseDicomDataSetImplicit: invalid value for parameter 'maxPosition'"; for (var n = e.elements; t.position < r;) { var i = A(t, a.untilTag, a.vrCallback); if ((n[i.tag] = i).tag === a.untilTag) return; } } function k(e, t) { if ("undefined" != typeof Buffer && e instanceof Buffer) return Buffer.alloc(t); if (e instanceof Uint8Array) return new Uint8Array(t); throw "dicomParser.alloc: unknown type for byteArray"; } var L = "1.8.12", N = { readUint16: function (e, t) { if (t < 0) throw "bigEndianByteArrayParser.readUint16: position cannot be less than 0"; if (t + 2 > e.length) throw "bigEndianByteArrayParser.readUint16: attempt to read past end of buffer"; return (e[t] << 8) + e[t + 1]; }, readInt16: function (e, t) { if (t < 0) throw "bigEndianByteArrayParser.readInt16: position cannot be less than 0"; if (t + 2 > e.length) throw "bigEndianByteArrayParser.readInt16: attempt to read past end of buffer"; t = (e[t] << 8) + e[t + 1]; return t = 32768 & t ? t - 65535 - 1 : t; }, readUint32: function (e, t) { if (t < 0) throw "bigEndianByteArrayParser.readUint32: position cannot be less than 0"; if (t + 4 > e.length) throw "bigEndianByteArrayParser.readUint32: attempt to read past end of buffer"; return 256 * (256 * (256 * e[t] + e[t + 1]) + e[t + 2]) + e[t + 3]; }, readInt32: function (e, t) { if (t < 0) throw "bigEndianByteArrayParser.readInt32: position cannot be less than 0"; if (t + 4 > e.length) throw "bigEndianByteArrayParser.readInt32: attempt to read past end of buffer"; return (e[t] << 24) + (e[t + 1] << 16) + (e[t + 2] << 8) + e[t + 3]; }, readFloat: function (e, t) { if (t < 0) throw "bigEndianByteArrayParser.readFloat: position cannot be less than 0"; if (t + 4 > e.length) throw "bigEndianByteArrayParser.readFloat: attempt to read past end of buffer"; var r = new Uint8Array(4); return r[3] = e[t], r[2] = e[t + 1], r[1] = e[t + 2], r[0] = e[t + 3], new Float32Array(r.buffer)[0]; }, readDouble: function (e, t) { if (t < 0) throw "bigEndianByteArrayParser.readDouble: position cannot be less than 0"; if (t + 8 > e.length) throw "bigEndianByteArrayParser.readDouble: attempt to read past end of buffer"; var r = new Uint8Array(8); return r[7] = e[t], r[6] = e[t + 1], r[5] = e[t + 2], r[4] = e[t + 3], r[3] = e[t + 4], r[2] = e[t + 5], r[1] = e[t + 6], r[0] = e[t + 7], new Float64Array(r.buffer)[0]; } }; function j(e, t, r) { if ("undefined" != typeof Buffer && e instanceof Buffer) return e.slice(t, t + r); if (e instanceof Uint8Array) return new Uint8Array(e.buffer, e.byteOffset + t, r); throw "dicomParser.from: unknown type for byteArray"; } function C(e, t) { for (var r = 0; r < t.length; r++) { var a = t[r]; a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(e, a.key, a); } } var J = function () { function a(e, t, r) { if (!function (e, t) { if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function"); }(this, a), void 0 === e) throw "dicomParser.ByteStream: missing required parameter 'byteArrayParser'"; if (void 0 === t) throw "dicomParser.ByteStream: missing required parameter 'byteArray'"; if (t instanceof Uint8Array == !1 && ("undefined" == typeof Buffer || t instanceof Buffer == !1)) throw "dicomParser.ByteStream: parameter byteArray is not of type Uint8Array or Buffer"; if (r < 0) throw "dicomParser.ByteStream: parameter 'position' cannot be less than 0"; if (r >= t.length) throw "dicomParser.ByteStream: parameter 'position' cannot be greater than or equal to 'byteArray' length"; this.byteArrayParser = e, this.byteArray = t, this.position = r || 0, this.warnings = []; } var e, t, r; return e = a, (t = [{ key: "seek", value: function (e) { if (this.position + e < 0) throw "dicomParser.ByteStream.prototype.seek: cannot seek to position < 0"; this.position += e; } }, { key: "readByteStream", value: function (e) { if (this.position + e > this.byteArray.length) throw "dicomParser.ByteStream.prototype.readByteStream: readByteStream - buffer overread"; var t = j(this.byteArray, this.position, e); return this.position += e, new a(this.byteArrayParser, t); } }, { key: "getSize", value: function () { return this.byteArray.length; } }, { key: "readUint16", value: function () { var e = this.byteArrayParser.readUint16(this.byteArray, this.position); return this.position += 2, e; } }, { key: "readUint32", value: function () { var e = this.byteArrayParser.readUint32(this.byteArray, this.position); return this.position += 4, e; } }, { key: "readFixedString", value: function (e) { var t = b(this.byteArray, this.position, e); return this.position += e, t; } }]) && C(e.prototype, t), r && C(e, r), Object.defineProperty(e, "prototype", { writable: !1 }), a; }(), M = { readUint16: function (e, t) { if (t < 0) throw "littleEndianByteArrayParser.readUint16: position cannot be less than 0"; if (t + 2 > e.length) throw "littleEndianByteArrayParser.readUint16: attempt to read past end of buffer"; return e[t] + 256 * e[t + 1]; }, readInt16: function (e, t) { if (t < 0) throw "littleEndianByteArrayParser.readInt16: position cannot be less than 0"; if (t + 2 > e.length) throw "littleEndianByteArrayParser.readInt16: attempt to read past end of buffer"; t = e[t] + (e[t + 1] << 8); return t = 32768 & t ? t - 65535 - 1 : t; }, readUint32: function (e, t) { if (t < 0) throw "littleEndianByteArrayParser.readUint32: position cannot be less than 0"; if (t + 4 > e.length) throw "littleEndianByteArrayParser.readUint32: attempt to read past end of buffer"; return e[t] + 256 * e[t + 1] + 256 * e[t + 2] * 256 + 256 * e[t + 3] * 256 * 256; }, readInt32: function (e, t) { if (t < 0) throw "littleEndianByteArrayParser.readInt32: position cannot be less than 0"; if (t + 4 > e.length) throw "littleEndianByteArrayParser.readInt32: attempt to read past end of buffer"; return e[t] + (e[t + 1] << 8) + (e[t + 2] << 16) + (e[t + 3] << 24); }, readFloat: function (e, t) { if (t < 0) throw "littleEndianByteArrayParser.readFloat: position cannot be less than 0"; if (t + 4 > e.length) throw "littleEndianByteArrayParser.readFloat: attempt to read past end of buffer"; var r = new Uint8Array(4); return r[0] = e[t], r[1] = e[t + 1], r[2] = e[t + 2], r[3] = e[t + 3], new Float32Array(r.buffer)[0]; }, readDouble: function (e, t) { if (t < 0) throw "littleEndianByteArrayParser.readDouble: position cannot be less than 0"; if (t + 8 > e.length) throw "littleEndianByteArrayParser.readDouble: attempt to read past end of buffer"; var r = new Uint8Array(8); return r[0] = e[t], r[1] = e[t + 1], r[2] = e[t + 2], r[3] = e[t + 3], r[4] = e[t + 4], r[5] = e[t + 5], r[6] = e[t + 6], r[7] = e[t + 7], new Float64Array(r.buffer)[0]; } }; function G(e) { var i = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; if (void 0 === e) throw "dicomParser.readPart10Header: missing required parameter 'byteArray'"; var o = i.TransferSyntaxUID, s = new J(M, e); return function () { var e = function () { if (s.getSize() <= 132 && o) return !1; if (s.seek(128), "DICM" === s.readFixedString(4)) return !0; if (!(i || {}).TransferSyntaxUID) throw "dicomParser.readPart10Header: DICM prefix not found at location 132 - this is not a valid DICOM P10 file."; return s.seek(0), !1; }(), t = [], r = {}; if (!e) return s.position = 0, { elements: { x00020010: { tag: "x00020010", vr: "UI", Value: o } }, warnings: t }; for (; s.position < s.byteArray.length;) { var a = s.position, n = B(s, t); if ("x0002ffff" < n.tag) { s.position = a; break; } n.parser = M, r[n.tag] = n; } return (e = new w(s.byteArrayParser, s.byteArray, r)).warnings = s.warnings, e.position = s.position, e; }(); } var z = "1.2.840.10008.1.2.2"; function V(i) { var o = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : {}; if (void 0 === i) throw new Error("dicomParser.parseDicom: missing required parameter 'byteArray'"); var e, a = function (e) { if (void 0 === e.elements.x00020010) throw new Error("dicomParser.parseDicom: missing required meta header attribute 0002,0010"); e = e.elements.x00020010; return e && e.Value || b(i, e.dataOffset, e.length); }; function t(t) { var e = a(t), r = "1.2.840.10008.1.2" !== e, e = function (e, t) { var r = "[object process]" === Object.prototype.toString.call("undefined" != typeof process ? process : 0); if ("1.2.840.10008.1.2.1.99" !== e) return new J(e === z ? N : M, i, t); if (o && o.inflater) { e = o.inflater(i, t); return new J(M, e, 0); } if (!0 == r) { var a = s(0), n = j(i, t, i.length - t), a = a.inflateRawSync(n), n = k(i, a.length + t); return i.copy(n, 0, 0, t), a.copy(n, t), new J(M, n, 0); } if ("undefined" == typeof pako) throw "dicomParser.parseDicom: no inflater available to handle deflate transfer syntax"; return a = i.slice(t), n = pako.inflateRaw(a), (a = k(i, n.length + t)).set(i.slice(0, t), 0), a.set(n, t), new J(M, a, 0); }(e, t.position), t = new w(e.byteArrayParser, e.byteArray, {}); t.warnings = e.warnings; try { (r ? q : T)(t, e, e.byteArray.length, o); } catch (e) { throw { exception: e, dataSet: t }; } return t; } return function (e, t) { for (var r in e.elements) e.elements.hasOwnProperty(r) && (t.elements[r] = e.elements[r]); return void 0 !== e.warnings && (t.warnings = e.warnings.concat(t.warnings)), t; }(e = G(i, o), t(e)); } var R = function (e, t, r) { for (var a = 0, n = t; n < t + r; n++) a += e[n].length; return a; }; function _(e, t, r, a, n) { if (n = n || t.fragments, void 0 === e) throw "dicomParser.readEncapsulatedPixelDataFromFragments: missing required parameter 'dataSet'"; if (void 0 === t) throw "dicomParser.readEncapsulatedPixelDataFromFragments: missing required parameter 'pixelDataElement'"; if (void 0 === r) throw "dicomParser.readEncapsulatedPixelDataFromFragments: missing required parameter 'startFragmentIndex'"; if (void 0 === (a = a || 1)) throw "dicomParser.readEncapsulatedPixelDataFromFragments: missing required parameter 'numFragments'"; if ("x7fe00010" !== t.tag) throw "dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'pixelDataElement' refers to non pixel data tag (expected tag = x7fe00010"; if (!0 !== t.encapsulatedPixelData) throw "dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data"; if (!0 !== t.hadUndefinedLength) throw "dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data"; if (void 0 === t.basicOffsetTable) throw "dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data"; if (void 0 === t.fragments) throw "dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data"; if (t.fragments.length <= 0) throw "dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data"; if (r < 0) throw "dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'startFragmentIndex' must be >= 0"; if (r >= t.fragments.length) throw "dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'startFragmentIndex' must be < number of fragments"; if (a < 1) throw "dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'numFragments' must be > 0"; if (r + a > t.fragments.length) throw "dicomParser.readEncapsulatedPixelDataFromFragments: parameter 'startFragment' + 'numFragments' < number of fragments"; var i = new J(e.byteArrayParser, e.byteArray, t.dataOffset), t = S(i); if ("xfffee000" !== t.tag) throw "dicomParser.readEncapsulatedPixelData: missing basic offset table xfffee000"; i.seek(t.length); var o = i.position; if (1 === a) return j(i.byteArray, o + n[r].offset + 8, n[r].length); for (var t = R(n, r, a), s = k(i.byteArray, t), d = 0, f = r; f < r + a; f++) for (var l = o + n[f].offset + 8, u = 0; u < n[f].length; u++) s[d++] = i.byteArray[l++]; return s; } var H = function (e, t) { for (var r = 0; r < e.length; r++) if (e[r].offset === t) return r; }, Q = function (e, t, r, a) { if (e === t.length - 1) return r.length - a; for (var n = t[e + 1], i = a + 1; i < r.length; i++) if (r[i].offset === n) return i - a; throw "dicomParser.calculateNumberOfFragmentsForFrame: could not find fragment with offset matching basic offset table"; }; function W(e, t, r, a, n) { if (a = a || t.basicOffsetTable, n = n || t.fragments, void 0 === e) throw "dicomParser.readEncapsulatedImageFrame: missing required parameter 'dataSet'"; if (void 0 === t) throw "dicomParser.readEncapsulatedImageFrame: missing required parameter 'pixelDataElement'"; if (void 0 === r) throw "dicomParser.readEncapsulatedImageFrame: missing required parameter 'frameIndex'"; if (void 0 === a) throw "dicomParser.readEncapsulatedImageFrame: parameter 'pixelDataElement' does not have basicOffsetTable"; if ("x7fe00010" !== t.tag) throw "dicomParser.readEncapsulatedImageFrame: parameter 'pixelDataElement' refers to non pixel data tag (expected tag = x7fe00010)"; if (!0 !== t.encapsulatedPixelData) throw "dicomParser.readEncapsulatedImageFrame: parameter 'pixelDataElement' refers to pixel data element that does not have encapsulated pixel data"; if (!0 !== t.hadUndefinedLength) throw "dicomParser.readEncapsulatedImageFrame: parameter 'pixelDataElement' refers to pixel data element that does not have undefined length"; if (void 0 === t.fragments) throw "dicomParser.readEncapsulatedImageFrame: parameter 'pixelDataElement' refers to pixel data element that does not have fragments"; if (0 === a.length) throw "dicomParser.readEncapsulatedImageFrame: basicOffsetTable has zero entries"; if (r < 0) throw "dicomParser.readEncapsulatedImageFrame: parameter 'frameIndex' must be >= 0"; if (r >= a.length) throw "dicomParser.readEncapsulatedImageFrame: parameter 'frameIndex' must be < basicOffsetTable.length"; var i = a[r], i = H(n, i); if (void 0 === i) throw "dicomParser.readEncapsulatedImageFrame: unable to find fragment that matches basic offset table entry"; return _(e, t, i, Q(r, a, n, i), n); } var $ = !1; function K(e, t, r) { if ($ || ($ = !0, console && console.log && console.log("WARNING: dicomParser.readEncapsulatedPixelData() has been deprecated")), void 0 === e) throw "dicomParser.readEncapsulatedPixelData: missing required parameter 'dataSet'"; if (void 0 === t) throw "dicomParser.readEncapsulatedPixelData: missing required parameter 'element'"; if (void 0 === r) throw "dicomParser.readEncapsulatedPixelData: missing required parameter 'frame'"; if ("x7fe00010" !== t.tag) throw "dicomParser.readEncapsulatedPixelData: parameter 'element' refers to non pixel data tag (expected tag = x7fe00010)"; if (!0 !== t.encapsulatedPixelData) throw "dicomParser.readEncapsulatedPixelData: parameter 'element' refers to pixel data element that does not have encapsulated pixel data"; if (!0 !== t.hadUndefinedLength) throw "dicomParser.readEncapsulatedPixelData: parameter 'element' refers to pixel data element that does not have encapsulated pixel data"; if (void 0 === t.basicOffsetTable) throw "dicomParser.readEncapsulatedPixelData: parameter 'element' refers to pixel data element that does not have encapsulated pixel data"; if (void 0 === t.fragments) throw "dicomParser.readEncapsulatedPixelData: parameter 'element' refers to pixel data element that does not have encapsulated pixel data"; if (r < 0) throw "dicomParser.readEncapsulatedPixelData: parameter 'frame' must be >= 0"; return 0 !== t.basicOffsetTable.length ? W(e, t, r) : _(e, t, 0, t.fragments.length); } t.default = { isStringVr: d, isPrivateTag: f, parsePN: a, parseTM: n, parseDA: o, explicitElementToString: l, explicitDataSetToJS: u, createJPEGBasicOffsetTable: p, parseDicomDataSetExplicit: q, parseDicomDataSetImplicit: T, readFixedString: b, alloc: k, version: L, bigEndianByteArrayParser: N, ByteStream: J, sharedCopy: j, DataSet: w, findAndSetUNElementLength: y, findEndOfEncapsulatedElement: g, findItemDelimitationItemAndSetElementLength: x, littleEndianByteArrayParser: M, parseDicom: V, readDicomElementExplicit: B, readDicomElementImplicit: A, readEncapsulatedImageFrame: W, readEncapsulatedPixelData: K, readEncapsulatedPixelDataFromFragments: _, readPart10Header: G, readSequenceItemsExplicit: I, readSequenceItemsImplicit: F, readSequenceItem: S, readTag: h, LEI: "1.2.840.10008.1.2", LEE: "1.2.840.10008.1.2.1" }; }], i = {}, n.m = a, n.c = i, n.d = function (e, t, r) { n.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: r }); }, n.r = function (e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }); }, n.t = function (t, e) { if (1 & e && (t = n(t)), 8 & e) return t; if (4 & e && "object" == typeof t && t && t.__esModule) return t; var r = Object.create(null); if (n.r(r), Object.defineProperty(r, "default", { enumerable: !0, value: t }), 2 & e && "string" != typeof t) for (var a in t) n.d(r, a, function (e) { return t[e]; }.bind(null, a)); return r; }, n.n = function (e) { var t = e && e.__esModule ? function () { return e.default; } : function () { return e; }; return n.d(t, "a", t), t; }, n.o = function (e, t) { return Object.prototype.hasOwnProperty.call(e, t); }, n.p = "", n(n.s = 1); function n(e) { if (i[e]) return i[e].exports; var t = i[e] = { i: e, l: !1, exports: {} }; return a[e].call(t.exports, t, t.exports, n), t.l = !0, t.exports; } // removed by dead control flow var a, i; }); /***/ }, /***/ 29186 /*!**************************************************!*\ !*** ./node_modules/es-define-property/index.js ***! \**************************************************/ (module) { "use strict"; /** @type {import('.')} */ var $defineProperty = Object.defineProperty || false; if ($defineProperty) { try { $defineProperty({}, 'a', { value: 1 }); } catch (e) { // IE 8 has a broken defineProperty $defineProperty = false; } } module.exports = $defineProperty; /***/ }, /***/ 69685 /*!******************************************!*\ !*** ./node_modules/es-errors/syntax.js ***! \******************************************/ (module) { "use strict"; /** @type {import('./syntax')} */ module.exports = SyntaxError; /***/ }, /***/ 30510 /*!****************************************!*\ !*** ./node_modules/es-errors/type.js ***! \****************************************/ (module) { "use strict"; /** @type {import('./type')} */ module.exports = TypeError; /***/ }, /***/ 33778 /*!***********************************************!*\ !*** ./node_modules/fast-deep-equal/index.js ***! \***********************************************/ (module) { "use strict"; // do not edit .js files directly - edit src/index.jst module.exports = function equal(a, b) { if (a === b) return true; if (a && b && typeof a == 'object' && typeof b == 'object') { if (a.constructor !== b.constructor) return false; var length, i, keys; if (Array.isArray(a)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false; return true; } if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags; if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf(); if (a.toString !== Object.prototype.toString) return a.toString() === b.toString(); keys = Object.keys(a); length = keys.length; if (length !== Object.keys(b).length) return false; for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; for (i = length; i-- !== 0;) { var key = keys[i]; if (!equal(a[key], b[key])) return false; } return true; } // true if both NaN, false otherwise return a !== a && b !== b; }; /***/ }, /***/ 19689 /*!************************************************!*\ !*** ./node_modules/get-plane-normal/index.js ***! \************************************************/ (module, __unused_webpack_exports, __webpack_require__) { var normalize = __webpack_require__(/*! gl-vec3/normalize */ 82986); var sub = __webpack_require__(/*! gl-vec3/subtract */ 67585); var cross = __webpack_require__(/*! gl-vec3/cross */ 81741); var tmp = [0, 0, 0]; module.exports = planeNormal; function planeNormal(out, point1, point2, point3) { sub(out, point1, point2); sub(tmp, point2, point3); cross(out, out, tmp); return normalize(out, out); } /***/ }, /***/ 8133 /*!*********************************************************!*\ !*** ./node_modules/gl-mat4/fromRotationTranslation.js ***! \*********************************************************/ (module) { module.exports = fromRotationTranslation; /** * Creates a matrix from a quaternion rotation and vector translation * This is equivalent to (but much faster than): * * mat4.identity(dest); * mat4.translate(dest, vec); * var quatMat = mat4.create(); * quat4.toMat4(quat, quatMat); * mat4.multiply(dest, quatMat); * * @param {mat4} out mat4 receiving operation result * @param {quat4} q Rotation quaternion * @param {vec3} v Translation vector * @returns {mat4} out */ function fromRotationTranslation(out, q, v) { // Quaternion math var x = q[0], y = q[1], z = q[2], w = q[3], x2 = x + x, y2 = y + y, z2 = z + z, xx = x * x2, xy = x * y2, xz = x * z2, yy = y * y2, yz = y * z2, zz = z * z2, wx = w * x2, wy = w * y2, wz = w * z2; out[0] = 1 - (yy + zz); out[1] = xy + wz; out[2] = xz - wy; out[3] = 0; out[4] = xy - wz; out[5] = 1 - (xx + zz); out[6] = yz + wx; out[7] = 0; out[8] = xz + wy; out[9] = yz - wx; out[10] = 1 - (xx + yy); out[11] = 0; out[12] = v[0]; out[13] = v[1]; out[14] = v[2]; out[15] = 1; return out; } ; /***/ }, /***/ 27182 /*!**********************************************!*\ !*** ./node_modules/gl-matrix/esm/common.js ***! \**********************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ARRAY_TYPE: () => (/* binding */ ARRAY_TYPE), /* harmony export */ EPSILON: () => (/* binding */ EPSILON), /* harmony export */ RANDOM: () => (/* binding */ RANDOM), /* harmony export */ equals: () => (/* binding */ equals), /* harmony export */ setMatrixArrayType: () => (/* binding */ setMatrixArrayType), /* harmony export */ toRadian: () => (/* binding */ toRadian) /* harmony export */ }); /** * Common utilities * @module glMatrix */ // Configuration Constants var EPSILON = 0.000001; var ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array; var RANDOM = Math.random; /** * Sets the type of array used when creating new vectors and matrices * * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array */ function setMatrixArrayType(type) { ARRAY_TYPE = type; } var degree = Math.PI / 180; /** * Convert Degree To Radian * * @param {Number} a Angle in Degrees */ function toRadian(a) { return a * degree; } /** * Tests whether or not the arguments have approximately the same value, within an absolute * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less * than or equal to 1.0, and a relative tolerance is used for larger values) * * @param {Number} a The first number to test. * @param {Number} b The second number to test. * @returns {Boolean} True if the numbers are approximately equal, false otherwise. */ function equals(a, b) { return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b)); } if (!Math.hypot) Math.hypot = function () { var y = 0, i = arguments.length; while (i--) { y += arguments[i] * arguments[i]; } return Math.sqrt(y); }; /***/ }, /***/ 97339 /*!********************************************!*\ !*** ./node_modules/gl-matrix/esm/mat2.js ***! \********************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LDU: () => (/* binding */ LDU), /* harmony export */ add: () => (/* binding */ add), /* harmony export */ adjoint: () => (/* binding */ adjoint), /* harmony export */ clone: () => (/* binding */ clone), /* harmony export */ copy: () => (/* binding */ copy), /* harmony export */ create: () => (/* binding */ create), /* harmony export */ determinant: () => (/* binding */ determinant), /* harmony export */ equals: () => (/* binding */ equals), /* harmony export */ exactEquals: () => (/* binding */ exactEquals), /* harmony export */ frob: () => (/* binding */ frob), /* harmony export */ fromRotation: () => (/* binding */ fromRotation), /* harmony export */ fromScaling: () => (/* binding */ fromScaling), /* harmony export */ fromValues: () => (/* binding */ fromValues), /* harmony export */ identity: () => (/* binding */ identity), /* harmony export */ invert: () => (/* binding */ invert), /* harmony export */ mul: () => (/* binding */ mul), /* harmony export */ multiply: () => (/* binding */ multiply), /* harmony export */ multiplyScalar: () => (/* binding */ multiplyScalar), /* harmony export */ multiplyScalarAndAdd: () => (/* binding */ multiplyScalarAndAdd), /* harmony export */ rotate: () => (/* binding */ rotate), /* harmony export */ scale: () => (/* binding */ scale), /* harmony export */ set: () => (/* binding */ set), /* harmony export */ str: () => (/* binding */ str), /* harmony export */ sub: () => (/* binding */ sub), /* harmony export */ subtract: () => (/* binding */ subtract), /* harmony export */ transpose: () => (/* binding */ transpose) /* harmony export */ }); /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ 27182); /** * 2x2 Matrix * @module mat2 */ /** * Creates a new identity mat2 * * @returns {mat2} a new 2x2 matrix */ function create() { var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { out[1] = 0; out[2] = 0; } out[0] = 1; out[3] = 1; return out; } /** * Creates a new mat2 initialized with values from an existing matrix * * @param {ReadonlyMat2} a matrix to clone * @returns {mat2} a new 2x2 matrix */ function clone(a) { var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; out[3] = a[3]; return out; } /** * Copy the values from one mat2 to another * * @param {mat2} out the receiving matrix * @param {ReadonlyMat2} a the source matrix * @returns {mat2} out */ function copy(out, a) { out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; out[3] = a[3]; return out; } /** * Set a mat2 to the identity matrix * * @param {mat2} out the receiving matrix * @returns {mat2} out */ function identity(out) { out[0] = 1; out[1] = 0; out[2] = 0; out[3] = 1; return out; } /** * Create a new mat2 with the given values * * @param {Number} m00 Component in column 0, row 0 position (index 0) * @param {Number} m01 Component in column 0, row 1 position (index 1) * @param {Number} m10 Component in column 1, row 0 position (index 2) * @param {Number} m11 Component in column 1, row 1 position (index 3) * @returns {mat2} out A new 2x2 matrix */ function fromValues(m00, m01, m10, m11) { var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); out[0] = m00; out[1] = m01; out[2] = m10; out[3] = m11; return out; } /** * Set the components of a mat2 to the given values * * @param {mat2} out the receiving matrix * @param {Number} m00 Component in column 0, row 0 position (index 0) * @param {Number} m01 Component in column 0, row 1 position (index 1) * @param {Number} m10 Component in column 1, row 0 position (index 2) * @param {Number} m11 Component in column 1, row 1 position (index 3) * @returns {mat2} out */ function set(out, m00, m01, m10, m11) { out[0] = m00; out[1] = m01; out[2] = m10; out[3] = m11; return out; } /** * Transpose the values of a mat2 * * @param {mat2} out the receiving matrix * @param {ReadonlyMat2} a the source matrix * @returns {mat2} out */ function transpose(out, a) { // If we are transposing ourselves we can skip a few steps but have to cache // some values if (out === a) { var a1 = a[1]; out[1] = a[2]; out[2] = a1; } else { out[0] = a[0]; out[1] = a[2]; out[2] = a[1]; out[3] = a[3]; } return out; } /** * Inverts a mat2 * * @param {mat2} out the receiving matrix * @param {ReadonlyMat2} a the source matrix * @returns {mat2} out */ function invert(out, a) { var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3]; // Calculate the determinant var det = a0 * a3 - a2 * a1; if (!det) { return null; } det = 1.0 / det; out[0] = a3 * det; out[1] = -a1 * det; out[2] = -a2 * det; out[3] = a0 * det; return out; } /** * Calculates the adjugate of a mat2 * * @param {mat2} out the receiving matrix * @param {ReadonlyMat2} a the source matrix * @returns {mat2} out */ function adjoint(out, a) { // Caching this value is nessecary if out == a var a0 = a[0]; out[0] = a[3]; out[1] = -a[1]; out[2] = -a[2]; out[3] = a0; return out; } /** * Calculates the determinant of a mat2 * * @param {ReadonlyMat2} a the source matrix * @returns {Number} determinant of a */ function determinant(a) { return a[0] * a[3] - a[2] * a[1]; } /** * Multiplies two mat2's * * @param {mat2} out the receiving matrix * @param {ReadonlyMat2} a the first operand * @param {ReadonlyMat2} b the second operand * @returns {mat2} out */ function multiply(out, a, b) { var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3]; var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3]; out[0] = a0 * b0 + a2 * b1; out[1] = a1 * b0 + a3 * b1; out[2] = a0 * b2 + a2 * b3; out[3] = a1 * b2 + a3 * b3; return out; } /** * Rotates a mat2 by the given angle * * @param {mat2} out the receiving matrix * @param {ReadonlyMat2} a the matrix to rotate * @param {Number} rad the angle to rotate the matrix by * @returns {mat2} out */ function rotate(out, a, rad) { var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3]; var s = Math.sin(rad); var c = Math.cos(rad); out[0] = a0 * c + a2 * s; out[1] = a1 * c + a3 * s; out[2] = a0 * -s + a2 * c; out[3] = a1 * -s + a3 * c; return out; } /** * Scales the mat2 by the dimensions in the given vec2 * * @param {mat2} out the receiving matrix * @param {ReadonlyMat2} a the matrix to rotate * @param {ReadonlyVec2} v the vec2 to scale the matrix by * @returns {mat2} out **/ function scale(out, a, v) { var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3]; var v0 = v[0], v1 = v[1]; out[0] = a0 * v0; out[1] = a1 * v0; out[2] = a2 * v1; out[3] = a3 * v1; return out; } /** * Creates a matrix from a given angle * This is equivalent to (but much faster than): * * mat2.identity(dest); * mat2.rotate(dest, dest, rad); * * @param {mat2} out mat2 receiving operation result * @param {Number} rad the angle to rotate the matrix by * @returns {mat2} out */ function fromRotation(out, rad) { var s = Math.sin(rad); var c = Math.cos(rad); out[0] = c; out[1] = s; out[2] = -s; out[3] = c; return out; } /** * Creates a matrix from a vector scaling * This is equivalent to (but much faster than): * * mat2.identity(dest); * mat2.scale(dest, dest, vec); * * @param {mat2} out mat2 receiving operation result * @param {ReadonlyVec2} v Scaling vector * @returns {mat2} out */ function fromScaling(out, v) { out[0] = v[0]; out[1] = 0; out[2] = 0; out[3] = v[1]; return out; } /** * Returns a string representation of a mat2 * * @param {ReadonlyMat2} a matrix to represent as a string * @returns {String} string representation of the matrix */ function str(a) { return "mat2(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; } /** * Returns Frobenius norm of a mat2 * * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of * @returns {Number} Frobenius norm */ function frob(a) { return Math.hypot(a[0], a[1], a[2], a[3]); } /** * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix * @param {ReadonlyMat2} L the lower triangular matrix * @param {ReadonlyMat2} D the diagonal matrix * @param {ReadonlyMat2} U the upper triangular matrix * @param {ReadonlyMat2} a the input matrix to factorize */ function LDU(L, D, U, a) { L[2] = a[2] / a[0]; U[0] = a[0]; U[1] = a[1]; U[3] = a[3] - L[2] * U[1]; return [L, D, U]; } /** * Adds two mat2's * * @param {mat2} out the receiving matrix * @param {ReadonlyMat2} a the first operand * @param {ReadonlyMat2} b the second operand * @returns {mat2} out */ function add(out, a, b) { out[0] = a[0] + b[0]; out[1] = a[1] + b[1]; out[2] = a[2] + b[2]; out[3] = a[3] + b[3]; return out; } /** * Subtracts matrix b from matrix a * * @param {mat2} out the receiving matrix * @param {ReadonlyMat2} a the first operand * @param {ReadonlyMat2} b the second operand * @returns {mat2} out */ function subtract(out, a, b) { out[0] = a[0] - b[0]; out[1] = a[1] - b[1]; out[2] = a[2] - b[2]; out[3] = a[3] - b[3]; return out; } /** * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) * * @param {ReadonlyMat2} a The first matrix. * @param {ReadonlyMat2} b The second matrix. * @returns {Boolean} True if the matrices are equal, false otherwise. */ function exactEquals(a, b) { return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; } /** * Returns whether or not the matrices have approximately the same elements in the same position. * * @param {ReadonlyMat2} a The first matrix. * @param {ReadonlyMat2} b The second matrix. * @returns {Boolean} True if the matrices are equal, false otherwise. */ function equals(a, b) { var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3]; var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3]; return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)); } /** * Multiply each element of the matrix by a scalar. * * @param {mat2} out the receiving matrix * @param {ReadonlyMat2} a the matrix to scale * @param {Number} b amount to scale the matrix's elements by * @returns {mat2} out */ function multiplyScalar(out, a, b) { out[0] = a[0] * b; out[1] = a[1] * b; out[2] = a[2] * b; out[3] = a[3] * b; return out; } /** * Adds two mat2's after multiplying each element of the second operand by a scalar value. * * @param {mat2} out the receiving vector * @param {ReadonlyMat2} a the first operand * @param {ReadonlyMat2} b the second operand * @param {Number} scale the amount to scale b's elements by before adding * @returns {mat2} out */ function multiplyScalarAndAdd(out, a, b, scale) { out[0] = a[0] + b[0] * scale; out[1] = a[1] + b[1] * scale; out[2] = a[2] + b[2] * scale; out[3] = a[3] + b[3] * scale; return out; } /** * Alias for {@link mat2.multiply} * @function */ var mul = multiply; /** * Alias for {@link mat2.subtract} * @function */ var sub = subtract; /***/ }, /***/ 23988 /*!********************************************!*\ !*** ./node_modules/gl-matrix/esm/mat3.js ***! \********************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ add: () => (/* binding */ add), /* harmony export */ adjoint: () => (/* binding */ adjoint), /* harmony export */ clone: () => (/* binding */ clone), /* harmony export */ copy: () => (/* binding */ copy), /* harmony export */ create: () => (/* binding */ create), /* harmony export */ determinant: () => (/* binding */ determinant), /* harmony export */ equals: () => (/* binding */ equals), /* harmony export */ exactEquals: () => (/* binding */ exactEquals), /* harmony export */ frob: () => (/* binding */ frob), /* harmony export */ fromMat2d: () => (/* binding */ fromMat2d), /* harmony export */ fromMat4: () => (/* binding */ fromMat4), /* harmony export */ fromQuat: () => (/* binding */ fromQuat), /* harmony export */ fromRotation: () => (/* binding */ fromRotation), /* harmony export */ fromScaling: () => (/* binding */ fromScaling), /* harmony export */ fromTranslation: () => (/* binding */ fromTranslation), /* harmony export */ fromValues: () => (/* binding */ fromValues), /* harmony export */ identity: () => (/* binding */ identity), /* harmony export */ invert: () => (/* binding */ invert), /* harmony export */ mul: () => (/* binding */ mul), /* harmony export */ multiply: () => (/* binding */ multiply), /* harmony export */ multiplyScalar: () => (/* binding */ multiplyScalar), /* harmony export */ multiplyScalarAndAdd: () => (/* binding */ multiplyScalarAndAdd), /* harmony export */ normalFromMat4: () => (/* binding */ normalFromMat4), /* harmony export */ projection: () => (/* binding */ projection), /* harmony export */ rotate: () => (/* binding */ rotate), /* harmony export */ scale: () => (/* binding */ scale), /* harmony export */ set: () => (/* binding */ set), /* harmony export */ str: () => (/* binding */ str), /* harmony export */ sub: () => (/* binding */ sub), /* harmony export */ subtract: () => (/* binding */ subtract), /* harmony export */ translate: () => (/* binding */ translate), /* harmony export */ transpose: () => (/* binding */ transpose) /* harmony export */ }); /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ 27182); /** * 3x3 Matrix * @module mat3 */ /** * Creates a new identity mat3 * * @returns {mat3} a new 3x3 matrix */ function create() { var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { out[1] = 0; out[2] = 0; out[3] = 0; out[5] = 0; out[6] = 0; out[7] = 0; } out[0] = 1; out[4] = 1; out[8] = 1; return out; } /** * Copies the upper-left 3x3 values into the given mat3. * * @param {mat3} out the receiving 3x3 matrix * @param {ReadonlyMat4} a the source 4x4 matrix * @returns {mat3} out */ function fromMat4(out, a) { out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; out[3] = a[4]; out[4] = a[5]; out[5] = a[6]; out[6] = a[8]; out[7] = a[9]; out[8] = a[10]; return out; } /** * Creates a new mat3 initialized with values from an existing matrix * * @param {ReadonlyMat3} a matrix to clone * @returns {mat3} a new 3x3 matrix */ function clone(a) { var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; out[3] = a[3]; out[4] = a[4]; out[5] = a[5]; out[6] = a[6]; out[7] = a[7]; out[8] = a[8]; return out; } /** * Copy the values from one mat3 to another * * @param {mat3} out the receiving matrix * @param {ReadonlyMat3} a the source matrix * @returns {mat3} out */ function copy(out, a) { out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; out[3] = a[3]; out[4] = a[4]; out[5] = a[5]; out[6] = a[6]; out[7] = a[7]; out[8] = a[8]; return out; } /** * Create a new mat3 with the given values * * @param {Number} m00 Component in column 0, row 0 position (index 0) * @param {Number} m01 Component in column 0, row 1 position (index 1) * @param {Number} m02 Component in column 0, row 2 position (index 2) * @param {Number} m10 Component in column 1, row 0 position (index 3) * @param {Number} m11 Component in column 1, row 1 position (index 4) * @param {Number} m12 Component in column 1, row 2 position (index 5) * @param {Number} m20 Component in column 2, row 0 position (index 6) * @param {Number} m21 Component in column 2, row 1 position (index 7) * @param {Number} m22 Component in column 2, row 2 position (index 8) * @returns {mat3} A new mat3 */ function fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) { var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(9); out[0] = m00; out[1] = m01; out[2] = m02; out[3] = m10; out[4] = m11; out[5] = m12; out[6] = m20; out[7] = m21; out[8] = m22; return out; } /** * Set the components of a mat3 to the given values * * @param {mat3} out the receiving matrix * @param {Number} m00 Component in column 0, row 0 position (index 0) * @param {Number} m01 Component in column 0, row 1 position (index 1) * @param {Number} m02 Component in column 0, row 2 position (index 2) * @param {Number} m10 Component in column 1, row 0 position (index 3) * @param {Number} m11 Component in column 1, row 1 position (index 4) * @param {Number} m12 Component in column 1, row 2 position (index 5) * @param {Number} m20 Component in column 2, row 0 position (index 6) * @param {Number} m21 Component in column 2, row 1 position (index 7) * @param {Number} m22 Component in column 2, row 2 position (index 8) * @returns {mat3} out */ function set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) { out[0] = m00; out[1] = m01; out[2] = m02; out[3] = m10; out[4] = m11; out[5] = m12; out[6] = m20; out[7] = m21; out[8] = m22; return out; } /** * Set a mat3 to the identity matrix * * @param {mat3} out the receiving matrix * @returns {mat3} out */ function identity(out) { out[0] = 1; out[1] = 0; out[2] = 0; out[3] = 0; out[4] = 1; out[5] = 0; out[6] = 0; out[7] = 0; out[8] = 1; return out; } /** * Transpose the values of a mat3 * * @param {mat3} out the receiving matrix * @param {ReadonlyMat3} a the source matrix * @returns {mat3} out */ function transpose(out, a) { // If we are transposing ourselves we can skip a few steps but have to cache some values if (out === a) { var a01 = a[1], a02 = a[2], a12 = a[5]; out[1] = a[3]; out[2] = a[6]; out[3] = a01; out[5] = a[7]; out[6] = a02; out[7] = a12; } else { out[0] = a[0]; out[1] = a[3]; out[2] = a[6]; out[3] = a[1]; out[4] = a[4]; out[5] = a[7]; out[6] = a[2]; out[7] = a[5]; out[8] = a[8]; } return out; } /** * Inverts a mat3 * * @param {mat3} out the receiving matrix * @param {ReadonlyMat3} a the source matrix * @returns {mat3} out */ function invert(out, a) { var a00 = a[0], a01 = a[1], a02 = a[2]; var a10 = a[3], a11 = a[4], a12 = a[5]; var a20 = a[6], a21 = a[7], a22 = a[8]; var b01 = a22 * a11 - a12 * a21; var b11 = -a22 * a10 + a12 * a20; var b21 = a21 * a10 - a11 * a20; // Calculate the determinant var det = a00 * b01 + a01 * b11 + a02 * b21; if (!det) { return null; } det = 1.0 / det; out[0] = b01 * det; out[1] = (-a22 * a01 + a02 * a21) * det; out[2] = (a12 * a01 - a02 * a11) * det; out[3] = b11 * det; out[4] = (a22 * a00 - a02 * a20) * det; out[5] = (-a12 * a00 + a02 * a10) * det; out[6] = b21 * det; out[7] = (-a21 * a00 + a01 * a20) * det; out[8] = (a11 * a00 - a01 * a10) * det; return out; } /** * Calculates the adjugate of a mat3 * * @param {mat3} out the receiving matrix * @param {ReadonlyMat3} a the source matrix * @returns {mat3} out */ function adjoint(out, a) { var a00 = a[0], a01 = a[1], a02 = a[2]; var a10 = a[3], a11 = a[4], a12 = a[5]; var a20 = a[6], a21 = a[7], a22 = a[8]; out[0] = a11 * a22 - a12 * a21; out[1] = a02 * a21 - a01 * a22; out[2] = a01 * a12 - a02 * a11; out[3] = a12 * a20 - a10 * a22; out[4] = a00 * a22 - a02 * a20; out[5] = a02 * a10 - a00 * a12; out[6] = a10 * a21 - a11 * a20; out[7] = a01 * a20 - a00 * a21; out[8] = a00 * a11 - a01 * a10; return out; } /** * Calculates the determinant of a mat3 * * @param {ReadonlyMat3} a the source matrix * @returns {Number} determinant of a */ function determinant(a) { var a00 = a[0], a01 = a[1], a02 = a[2]; var a10 = a[3], a11 = a[4], a12 = a[5]; var a20 = a[6], a21 = a[7], a22 = a[8]; return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20); } /** * Multiplies two mat3's * * @param {mat3} out the receiving matrix * @param {ReadonlyMat3} a the first operand * @param {ReadonlyMat3} b the second operand * @returns {mat3} out */ function multiply(out, a, b) { var a00 = a[0], a01 = a[1], a02 = a[2]; var a10 = a[3], a11 = a[4], a12 = a[5]; var a20 = a[6], a21 = a[7], a22 = a[8]; var b00 = b[0], b01 = b[1], b02 = b[2]; var b10 = b[3], b11 = b[4], b12 = b[5]; var b20 = b[6], b21 = b[7], b22 = b[8]; out[0] = b00 * a00 + b01 * a10 + b02 * a20; out[1] = b00 * a01 + b01 * a11 + b02 * a21; out[2] = b00 * a02 + b01 * a12 + b02 * a22; out[3] = b10 * a00 + b11 * a10 + b12 * a20; out[4] = b10 * a01 + b11 * a11 + b12 * a21; out[5] = b10 * a02 + b11 * a12 + b12 * a22; out[6] = b20 * a00 + b21 * a10 + b22 * a20; out[7] = b20 * a01 + b21 * a11 + b22 * a21; out[8] = b20 * a02 + b21 * a12 + b22 * a22; return out; } /** * Translate a mat3 by the given vector * * @param {mat3} out the receiving matrix * @param {ReadonlyMat3} a the matrix to translate * @param {ReadonlyVec2} v vector to translate by * @returns {mat3} out */ function translate(out, a, v) { var a00 = a[0], a01 = a[1], a02 = a[2], a10 = a[3], a11 = a[4], a12 = a[5], a20 = a[6], a21 = a[7], a22 = a[8], x = v[0], y = v[1]; out[0] = a00; out[1] = a01; out[2] = a02; out[3] = a10; out[4] = a11; out[5] = a12; out[6] = x * a00 + y * a10 + a20; out[7] = x * a01 + y * a11 + a21; out[8] = x * a02 + y * a12 + a22; return out; } /** * Rotates a mat3 by the given angle * * @param {mat3} out the receiving matrix * @param {ReadonlyMat3} a the matrix to rotate * @param {Number} rad the angle to rotate the matrix by * @returns {mat3} out */ function rotate(out, a, rad) { var a00 = a[0], a01 = a[1], a02 = a[2], a10 = a[3], a11 = a[4], a12 = a[5], a20 = a[6], a21 = a[7], a22 = a[8], s = Math.sin(rad), c = Math.cos(rad); out[0] = c * a00 + s * a10; out[1] = c * a01 + s * a11; out[2] = c * a02 + s * a12; out[3] = c * a10 - s * a00; out[4] = c * a11 - s * a01; out[5] = c * a12 - s * a02; out[6] = a20; out[7] = a21; out[8] = a22; return out; } /** * Scales the mat3 by the dimensions in the given vec2 * * @param {mat3} out the receiving matrix * @param {ReadonlyMat3} a the matrix to rotate * @param {ReadonlyVec2} v the vec2 to scale the matrix by * @returns {mat3} out **/ function scale(out, a, v) { var x = v[0], y = v[1]; out[0] = x * a[0]; out[1] = x * a[1]; out[2] = x * a[2]; out[3] = y * a[3]; out[4] = y * a[4]; out[5] = y * a[5]; out[6] = a[6]; out[7] = a[7]; out[8] = a[8]; return out; } /** * Creates a matrix from a vector translation * This is equivalent to (but much faster than): * * mat3.identity(dest); * mat3.translate(dest, dest, vec); * * @param {mat3} out mat3 receiving operation result * @param {ReadonlyVec2} v Translation vector * @returns {mat3} out */ function fromTranslation(out, v) { out[0] = 1; out[1] = 0; out[2] = 0; out[3] = 0; out[4] = 1; out[5] = 0; out[6] = v[0]; out[7] = v[1]; out[8] = 1; return out; } /** * Creates a matrix from a given angle * This is equivalent to (but much faster than): * * mat3.identity(dest); * mat3.rotate(dest, dest, rad); * * @param {mat3} out mat3 receiving operation result * @param {Number} rad the angle to rotate the matrix by * @returns {mat3} out */ function fromRotation(out, rad) { var s = Math.sin(rad), c = Math.cos(rad); out[0] = c; out[1] = s; out[2] = 0; out[3] = -s; out[4] = c; out[5] = 0; out[6] = 0; out[7] = 0; out[8] = 1; return out; } /** * Creates a matrix from a vector scaling * This is equivalent to (but much faster than): * * mat3.identity(dest); * mat3.scale(dest, dest, vec); * * @param {mat3} out mat3 receiving operation result * @param {ReadonlyVec2} v Scaling vector * @returns {mat3} out */ function fromScaling(out, v) { out[0] = v[0]; out[1] = 0; out[2] = 0; out[3] = 0; out[4] = v[1]; out[5] = 0; out[6] = 0; out[7] = 0; out[8] = 1; return out; } /** * Copies the values from a mat2d into a mat3 * * @param {mat3} out the receiving matrix * @param {ReadonlyMat2d} a the matrix to copy * @returns {mat3} out **/ function fromMat2d(out, a) { out[0] = a[0]; out[1] = a[1]; out[2] = 0; out[3] = a[2]; out[4] = a[3]; out[5] = 0; out[6] = a[4]; out[7] = a[5]; out[8] = 1; return out; } /** * Calculates a 3x3 matrix from the given quaternion * * @param {mat3} out mat3 receiving operation result * @param {ReadonlyQuat} q Quaternion to create matrix from * * @returns {mat3} out */ function fromQuat(out, q) { var x = q[0], y = q[1], z = q[2], w = q[3]; var x2 = x + x; var y2 = y + y; var z2 = z + z; var xx = x * x2; var yx = y * x2; var yy = y * y2; var zx = z * x2; var zy = z * y2; var zz = z * z2; var wx = w * x2; var wy = w * y2; var wz = w * z2; out[0] = 1 - yy - zz; out[3] = yx - wz; out[6] = zx + wy; out[1] = yx + wz; out[4] = 1 - xx - zz; out[7] = zy - wx; out[2] = zx - wy; out[5] = zy + wx; out[8] = 1 - xx - yy; return out; } /** * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix * * @param {mat3} out mat3 receiving operation result * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from * * @returns {mat3} out */ function normalFromMat4(out, a) { var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; var a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; var a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; var a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; var b00 = a00 * a11 - a01 * a10; var b01 = a00 * a12 - a02 * a10; var b02 = a00 * a13 - a03 * a10; var b03 = a01 * a12 - a02 * a11; var b04 = a01 * a13 - a03 * a11; var b05 = a02 * a13 - a03 * a12; var b06 = a20 * a31 - a21 * a30; var b07 = a20 * a32 - a22 * a30; var b08 = a20 * a33 - a23 * a30; var b09 = a21 * a32 - a22 * a31; var b10 = a21 * a33 - a23 * a31; var b11 = a22 * a33 - a23 * a32; // Calculate the determinant var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; if (!det) { return null; } det = 1.0 / det; out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det; out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det; out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det; out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det; out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det; out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det; out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det; out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det; return out; } /** * Generates a 2D projection matrix with the given bounds * * @param {mat3} out mat3 frustum matrix will be written into * @param {number} width Width of your gl context * @param {number} height Height of gl context * @returns {mat3} out */ function projection(out, width, height) { out[0] = 2 / width; out[1] = 0; out[2] = 0; out[3] = 0; out[4] = -2 / height; out[5] = 0; out[6] = -1; out[7] = 1; out[8] = 1; return out; } /** * Returns a string representation of a mat3 * * @param {ReadonlyMat3} a matrix to represent as a string * @returns {String} string representation of the matrix */ function str(a) { return "mat3(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ")"; } /** * Returns Frobenius norm of a mat3 * * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of * @returns {Number} Frobenius norm */ function frob(a) { return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]); } /** * Adds two mat3's * * @param {mat3} out the receiving matrix * @param {ReadonlyMat3} a the first operand * @param {ReadonlyMat3} b the second operand * @returns {mat3} out */ function add(out, a, b) { out[0] = a[0] + b[0]; out[1] = a[1] + b[1]; out[2] = a[2] + b[2]; out[3] = a[3] + b[3]; out[4] = a[4] + b[4]; out[5] = a[5] + b[5]; out[6] = a[6] + b[6]; out[7] = a[7] + b[7]; out[8] = a[8] + b[8]; return out; } /** * Subtracts matrix b from matrix a * * @param {mat3} out the receiving matrix * @param {ReadonlyMat3} a the first operand * @param {ReadonlyMat3} b the second operand * @returns {mat3} out */ function subtract(out, a, b) { out[0] = a[0] - b[0]; out[1] = a[1] - b[1]; out[2] = a[2] - b[2]; out[3] = a[3] - b[3]; out[4] = a[4] - b[4]; out[5] = a[5] - b[5]; out[6] = a[6] - b[6]; out[7] = a[7] - b[7]; out[8] = a[8] - b[8]; return out; } /** * Multiply each element of the matrix by a scalar. * * @param {mat3} out the receiving matrix * @param {ReadonlyMat3} a the matrix to scale * @param {Number} b amount to scale the matrix's elements by * @returns {mat3} out */ function multiplyScalar(out, a, b) { out[0] = a[0] * b; out[1] = a[1] * b; out[2] = a[2] * b; out[3] = a[3] * b; out[4] = a[4] * b; out[5] = a[5] * b; out[6] = a[6] * b; out[7] = a[7] * b; out[8] = a[8] * b; return out; } /** * Adds two mat3's after multiplying each element of the second operand by a scalar value. * * @param {mat3} out the receiving vector * @param {ReadonlyMat3} a the first operand * @param {ReadonlyMat3} b the second operand * @param {Number} scale the amount to scale b's elements by before adding * @returns {mat3} out */ function multiplyScalarAndAdd(out, a, b, scale) { out[0] = a[0] + b[0] * scale; out[1] = a[1] + b[1] * scale; out[2] = a[2] + b[2] * scale; out[3] = a[3] + b[3] * scale; out[4] = a[4] + b[4] * scale; out[5] = a[5] + b[5] * scale; out[6] = a[6] + b[6] * scale; out[7] = a[7] + b[7] * scale; out[8] = a[8] + b[8] * scale; return out; } /** * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) * * @param {ReadonlyMat3} a The first matrix. * @param {ReadonlyMat3} b The second matrix. * @returns {Boolean} True if the matrices are equal, false otherwise. */ function exactEquals(a, b) { return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8]; } /** * Returns whether or not the matrices have approximately the same elements in the same position. * * @param {ReadonlyMat3} a The first matrix. * @param {ReadonlyMat3} b The second matrix. * @returns {Boolean} True if the matrices are equal, false otherwise. */ function equals(a, b) { var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3], a4 = a[4], a5 = a[5], a6 = a[6], a7 = a[7], a8 = a[8]; var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3], b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7], b8 = b[8]; return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)); } /** * Alias for {@link mat3.multiply} * @function */ var mul = multiply; /** * Alias for {@link mat3.subtract} * @function */ var sub = subtract; /***/ }, /***/ 95329 /*!********************************************!*\ !*** ./node_modules/gl-matrix/esm/mat4.js ***! \********************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ add: () => (/* binding */ add), /* harmony export */ adjoint: () => (/* binding */ adjoint), /* harmony export */ clone: () => (/* binding */ clone), /* harmony export */ copy: () => (/* binding */ copy), /* harmony export */ create: () => (/* binding */ create), /* harmony export */ determinant: () => (/* binding */ determinant), /* harmony export */ equals: () => (/* binding */ equals), /* harmony export */ exactEquals: () => (/* binding */ exactEquals), /* harmony export */ frob: () => (/* binding */ frob), /* harmony export */ fromQuat: () => (/* binding */ fromQuat), /* harmony export */ fromQuat2: () => (/* binding */ fromQuat2), /* harmony export */ fromRotation: () => (/* binding */ fromRotation), /* harmony export */ fromRotationTranslation: () => (/* binding */ fromRotationTranslation), /* harmony export */ fromRotationTranslationScale: () => (/* binding */ fromRotationTranslationScale), /* harmony export */ fromRotationTranslationScaleOrigin: () => (/* binding */ fromRotationTranslationScaleOrigin), /* harmony export */ fromScaling: () => (/* binding */ fromScaling), /* harmony export */ fromTranslation: () => (/* binding */ fromTranslation), /* harmony export */ fromValues: () => (/* binding */ fromValues), /* harmony export */ fromXRotation: () => (/* binding */ fromXRotation), /* harmony export */ fromYRotation: () => (/* binding */ fromYRotation), /* harmony export */ fromZRotation: () => (/* binding */ fromZRotation), /* harmony export */ frustum: () => (/* binding */ frustum), /* harmony export */ getRotation: () => (/* binding */ getRotation), /* harmony export */ getScaling: () => (/* binding */ getScaling), /* harmony export */ getTranslation: () => (/* binding */ getTranslation), /* harmony export */ identity: () => (/* binding */ identity), /* harmony export */ invert: () => (/* binding */ invert), /* harmony export */ lookAt: () => (/* binding */ lookAt), /* harmony export */ mul: () => (/* binding */ mul), /* harmony export */ multiply: () => (/* binding */ multiply), /* harmony export */ multiplyScalar: () => (/* binding */ multiplyScalar), /* harmony export */ multiplyScalarAndAdd: () => (/* binding */ multiplyScalarAndAdd), /* harmony export */ ortho: () => (/* binding */ ortho), /* harmony export */ orthoNO: () => (/* binding */ orthoNO), /* harmony export */ orthoZO: () => (/* binding */ orthoZO), /* harmony export */ perspective: () => (/* binding */ perspective), /* harmony export */ perspectiveFromFieldOfView: () => (/* binding */ perspectiveFromFieldOfView), /* harmony export */ perspectiveNO: () => (/* binding */ perspectiveNO), /* harmony export */ perspectiveZO: () => (/* binding */ perspectiveZO), /* harmony export */ rotate: () => (/* binding */ rotate), /* harmony export */ rotateX: () => (/* binding */ rotateX), /* harmony export */ rotateY: () => (/* binding */ rotateY), /* harmony export */ rotateZ: () => (/* binding */ rotateZ), /* harmony export */ scale: () => (/* binding */ scale), /* harmony export */ set: () => (/* binding */ set), /* harmony export */ str: () => (/* binding */ str), /* harmony export */ sub: () => (/* binding */ sub), /* harmony export */ subtract: () => (/* binding */ subtract), /* harmony export */ targetTo: () => (/* binding */ targetTo), /* harmony export */ translate: () => (/* binding */ translate), /* harmony export */ transpose: () => (/* binding */ transpose) /* harmony export */ }); /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ 27182); /** * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied. * @module mat4 */ /** * Creates a new identity mat4 * * @returns {mat4} a new 4x4 matrix */ function create() { var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { out[1] = 0; out[2] = 0; out[3] = 0; out[4] = 0; out[6] = 0; out[7] = 0; out[8] = 0; out[9] = 0; out[11] = 0; out[12] = 0; out[13] = 0; out[14] = 0; } out[0] = 1; out[5] = 1; out[10] = 1; out[15] = 1; return out; } /** * Creates a new mat4 initialized with values from an existing matrix * * @param {ReadonlyMat4} a matrix to clone * @returns {mat4} a new 4x4 matrix */ function clone(a) { var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; out[3] = a[3]; out[4] = a[4]; out[5] = a[5]; out[6] = a[6]; out[7] = a[7]; out[8] = a[8]; out[9] = a[9]; out[10] = a[10]; out[11] = a[11]; out[12] = a[12]; out[13] = a[13]; out[14] = a[14]; out[15] = a[15]; return out; } /** * Copy the values from one mat4 to another * * @param {mat4} out the receiving matrix * @param {ReadonlyMat4} a the source matrix * @returns {mat4} out */ function copy(out, a) { out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; out[3] = a[3]; out[4] = a[4]; out[5] = a[5]; out[6] = a[6]; out[7] = a[7]; out[8] = a[8]; out[9] = a[9]; out[10] = a[10]; out[11] = a[11]; out[12] = a[12]; out[13] = a[13]; out[14] = a[14]; out[15] = a[15]; return out; } /** * Create a new mat4 with the given values * * @param {Number} m00 Component in column 0, row 0 position (index 0) * @param {Number} m01 Component in column 0, row 1 position (index 1) * @param {Number} m02 Component in column 0, row 2 position (index 2) * @param {Number} m03 Component in column 0, row 3 position (index 3) * @param {Number} m10 Component in column 1, row 0 position (index 4) * @param {Number} m11 Component in column 1, row 1 position (index 5) * @param {Number} m12 Component in column 1, row 2 position (index 6) * @param {Number} m13 Component in column 1, row 3 position (index 7) * @param {Number} m20 Component in column 2, row 0 position (index 8) * @param {Number} m21 Component in column 2, row 1 position (index 9) * @param {Number} m22 Component in column 2, row 2 position (index 10) * @param {Number} m23 Component in column 2, row 3 position (index 11) * @param {Number} m30 Component in column 3, row 0 position (index 12) * @param {Number} m31 Component in column 3, row 1 position (index 13) * @param {Number} m32 Component in column 3, row 2 position (index 14) * @param {Number} m33 Component in column 3, row 3 position (index 15) * @returns {mat4} A new mat4 */ function fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(16); out[0] = m00; out[1] = m01; out[2] = m02; out[3] = m03; out[4] = m10; out[5] = m11; out[6] = m12; out[7] = m13; out[8] = m20; out[9] = m21; out[10] = m22; out[11] = m23; out[12] = m30; out[13] = m31; out[14] = m32; out[15] = m33; return out; } /** * Set the components of a mat4 to the given values * * @param {mat4} out the receiving matrix * @param {Number} m00 Component in column 0, row 0 position (index 0) * @param {Number} m01 Component in column 0, row 1 position (index 1) * @param {Number} m02 Component in column 0, row 2 position (index 2) * @param {Number} m03 Component in column 0, row 3 position (index 3) * @param {Number} m10 Component in column 1, row 0 position (index 4) * @param {Number} m11 Component in column 1, row 1 position (index 5) * @param {Number} m12 Component in column 1, row 2 position (index 6) * @param {Number} m13 Component in column 1, row 3 position (index 7) * @param {Number} m20 Component in column 2, row 0 position (index 8) * @param {Number} m21 Component in column 2, row 1 position (index 9) * @param {Number} m22 Component in column 2, row 2 position (index 10) * @param {Number} m23 Component in column 2, row 3 position (index 11) * @param {Number} m30 Component in column 3, row 0 position (index 12) * @param {Number} m31 Component in column 3, row 1 position (index 13) * @param {Number} m32 Component in column 3, row 2 position (index 14) * @param {Number} m33 Component in column 3, row 3 position (index 15) * @returns {mat4} out */ function set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) { out[0] = m00; out[1] = m01; out[2] = m02; out[3] = m03; out[4] = m10; out[5] = m11; out[6] = m12; out[7] = m13; out[8] = m20; out[9] = m21; out[10] = m22; out[11] = m23; out[12] = m30; out[13] = m31; out[14] = m32; out[15] = m33; return out; } /** * Set a mat4 to the identity matrix * * @param {mat4} out the receiving matrix * @returns {mat4} out */ function identity(out) { out[0] = 1; out[1] = 0; out[2] = 0; out[3] = 0; out[4] = 0; out[5] = 1; out[6] = 0; out[7] = 0; out[8] = 0; out[9] = 0; out[10] = 1; out[11] = 0; out[12] = 0; out[13] = 0; out[14] = 0; out[15] = 1; return out; } /** * Transpose the values of a mat4 * * @param {mat4} out the receiving matrix * @param {ReadonlyMat4} a the source matrix * @returns {mat4} out */ function transpose(out, a) { // If we are transposing ourselves we can skip a few steps but have to cache some values if (out === a) { var a01 = a[1], a02 = a[2], a03 = a[3]; var a12 = a[6], a13 = a[7]; var a23 = a[11]; out[1] = a[4]; out[2] = a[8]; out[3] = a[12]; out[4] = a01; out[6] = a[9]; out[7] = a[13]; out[8] = a02; out[9] = a12; out[11] = a[14]; out[12] = a03; out[13] = a13; out[14] = a23; } else { out[0] = a[0]; out[1] = a[4]; out[2] = a[8]; out[3] = a[12]; out[4] = a[1]; out[5] = a[5]; out[6] = a[9]; out[7] = a[13]; out[8] = a[2]; out[9] = a[6]; out[10] = a[10]; out[11] = a[14]; out[12] = a[3]; out[13] = a[7]; out[14] = a[11]; out[15] = a[15]; } return out; } /** * Inverts a mat4 * * @param {mat4} out the receiving matrix * @param {ReadonlyMat4} a the source matrix * @returns {mat4} out */ function invert(out, a) { var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; var a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; var a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; var a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; var b00 = a00 * a11 - a01 * a10; var b01 = a00 * a12 - a02 * a10; var b02 = a00 * a13 - a03 * a10; var b03 = a01 * a12 - a02 * a11; var b04 = a01 * a13 - a03 * a11; var b05 = a02 * a13 - a03 * a12; var b06 = a20 * a31 - a21 * a30; var b07 = a20 * a32 - a22 * a30; var b08 = a20 * a33 - a23 * a30; var b09 = a21 * a32 - a22 * a31; var b10 = a21 * a33 - a23 * a31; var b11 = a22 * a33 - a23 * a32; // Calculate the determinant var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; if (!det) { return null; } det = 1.0 / det; out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det; out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det; out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det; out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det; out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det; out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det; out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det; out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det; out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det; out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det; out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det; out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det; out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det; out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det; out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det; out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det; return out; } /** * Calculates the adjugate of a mat4 * * @param {mat4} out the receiving matrix * @param {ReadonlyMat4} a the source matrix * @returns {mat4} out */ function adjoint(out, a) { var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; var a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; var a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; var a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22); out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22)); out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12); out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12)); out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22)); out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22); out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12)); out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12); out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21); out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21)); out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11); out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11)); out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21)); out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21); out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11)); out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11); return out; } /** * Calculates the determinant of a mat4 * * @param {ReadonlyMat4} a the source matrix * @returns {Number} determinant of a */ function determinant(a) { var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; var a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; var a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; var a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; var b00 = a00 * a11 - a01 * a10; var b01 = a00 * a12 - a02 * a10; var b02 = a00 * a13 - a03 * a10; var b03 = a01 * a12 - a02 * a11; var b04 = a01 * a13 - a03 * a11; var b05 = a02 * a13 - a03 * a12; var b06 = a20 * a31 - a21 * a30; var b07 = a20 * a32 - a22 * a30; var b08 = a20 * a33 - a23 * a30; var b09 = a21 * a32 - a22 * a31; var b10 = a21 * a33 - a23 * a31; var b11 = a22 * a33 - a23 * a32; // Calculate the determinant return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; } /** * Multiplies two mat4s * * @param {mat4} out the receiving matrix * @param {ReadonlyMat4} a the first operand * @param {ReadonlyMat4} b the second operand * @returns {mat4} out */ function multiply(out, a, b) { var a00 = a[0], a01 = a[1], a02 = a[2], a03 = a[3]; var a10 = a[4], a11 = a[5], a12 = a[6], a13 = a[7]; var a20 = a[8], a21 = a[9], a22 = a[10], a23 = a[11]; var a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; // Cache only the current line of the second matrix var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3]; out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; b0 = b[4]; b1 = b[5]; b2 = b[6]; b3 = b[7]; out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; b0 = b[8]; b1 = b[9]; b2 = b[10]; b3 = b[11]; out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; b0 = b[12]; b1 = b[13]; b2 = b[14]; b3 = b[15]; out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30; out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31; out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32; out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33; return out; } /** * Translate a mat4 by the given vector * * @param {mat4} out the receiving matrix * @param {ReadonlyMat4} a the matrix to translate * @param {ReadonlyVec3} v vector to translate by * @returns {mat4} out */ function translate(out, a, v) { var x = v[0], y = v[1], z = v[2]; var a00, a01, a02, a03; var a10, a11, a12, a13; var a20, a21, a22, a23; if (a === out) { out[12] = a[0] * x + a[4] * y + a[8] * z + a[12]; out[13] = a[1] * x + a[5] * y + a[9] * z + a[13]; out[14] = a[2] * x + a[6] * y + a[10] * z + a[14]; out[15] = a[3] * x + a[7] * y + a[11] * z + a[15]; } else { a00 = a[0]; a01 = a[1]; a02 = a[2]; a03 = a[3]; a10 = a[4]; a11 = a[5]; a12 = a[6]; a13 = a[7]; a20 = a[8]; a21 = a[9]; a22 = a[10]; a23 = a[11]; out[0] = a00; out[1] = a01; out[2] = a02; out[3] = a03; out[4] = a10; out[5] = a11; out[6] = a12; out[7] = a13; out[8] = a20; out[9] = a21; out[10] = a22; out[11] = a23; out[12] = a00 * x + a10 * y + a20 * z + a[12]; out[13] = a01 * x + a11 * y + a21 * z + a[13]; out[14] = a02 * x + a12 * y + a22 * z + a[14]; out[15] = a03 * x + a13 * y + a23 * z + a[15]; } return out; } /** * Scales the mat4 by the dimensions in the given vec3 not using vectorization * * @param {mat4} out the receiving matrix * @param {ReadonlyMat4} a the matrix to scale * @param {ReadonlyVec3} v the vec3 to scale the matrix by * @returns {mat4} out **/ function scale(out, a, v) { var x = v[0], y = v[1], z = v[2]; out[0] = a[0] * x; out[1] = a[1] * x; out[2] = a[2] * x; out[3] = a[3] * x; out[4] = a[4] * y; out[5] = a[5] * y; out[6] = a[6] * y; out[7] = a[7] * y; out[8] = a[8] * z; out[9] = a[9] * z; out[10] = a[10] * z; out[11] = a[11] * z; out[12] = a[12]; out[13] = a[13]; out[14] = a[14]; out[15] = a[15]; return out; } /** * Rotates a mat4 by the given angle around the given axis * * @param {mat4} out the receiving matrix * @param {ReadonlyMat4} a the matrix to rotate * @param {Number} rad the angle to rotate the matrix by * @param {ReadonlyVec3} axis the axis to rotate around * @returns {mat4} out */ function rotate(out, a, rad, axis) { var x = axis[0], y = axis[1], z = axis[2]; var len = Math.hypot(x, y, z); var s, c, t; var a00, a01, a02, a03; var a10, a11, a12, a13; var a20, a21, a22, a23; var b00, b01, b02; var b10, b11, b12; var b20, b21, b22; if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { return null; } len = 1 / len; x *= len; y *= len; z *= len; s = Math.sin(rad); c = Math.cos(rad); t = 1 - c; a00 = a[0]; a01 = a[1]; a02 = a[2]; a03 = a[3]; a10 = a[4]; a11 = a[5]; a12 = a[6]; a13 = a[7]; a20 = a[8]; a21 = a[9]; a22 = a[10]; a23 = a[11]; // Construct the elements of the rotation matrix b00 = x * x * t + c; b01 = y * x * t + z * s; b02 = z * x * t - y * s; b10 = x * y * t - z * s; b11 = y * y * t + c; b12 = z * y * t + x * s; b20 = x * z * t + y * s; b21 = y * z * t - x * s; b22 = z * z * t + c; // Perform rotation-specific matrix multiplication out[0] = a00 * b00 + a10 * b01 + a20 * b02; out[1] = a01 * b00 + a11 * b01 + a21 * b02; out[2] = a02 * b00 + a12 * b01 + a22 * b02; out[3] = a03 * b00 + a13 * b01 + a23 * b02; out[4] = a00 * b10 + a10 * b11 + a20 * b12; out[5] = a01 * b10 + a11 * b11 + a21 * b12; out[6] = a02 * b10 + a12 * b11 + a22 * b12; out[7] = a03 * b10 + a13 * b11 + a23 * b12; out[8] = a00 * b20 + a10 * b21 + a20 * b22; out[9] = a01 * b20 + a11 * b21 + a21 * b22; out[10] = a02 * b20 + a12 * b21 + a22 * b22; out[11] = a03 * b20 + a13 * b21 + a23 * b22; if (a !== out) { // If the source and destination differ, copy the unchanged last row out[12] = a[12]; out[13] = a[13]; out[14] = a[14]; out[15] = a[15]; } return out; } /** * Rotates a matrix by the given angle around the X axis * * @param {mat4} out the receiving matrix * @param {ReadonlyMat4} a the matrix to rotate * @param {Number} rad the angle to rotate the matrix by * @returns {mat4} out */ function rotateX(out, a, rad) { var s = Math.sin(rad); var c = Math.cos(rad); var a10 = a[4]; var a11 = a[5]; var a12 = a[6]; var a13 = a[7]; var a20 = a[8]; var a21 = a[9]; var a22 = a[10]; var a23 = a[11]; if (a !== out) { // If the source and destination differ, copy the unchanged rows out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; out[3] = a[3]; out[12] = a[12]; out[13] = a[13]; out[14] = a[14]; out[15] = a[15]; } // Perform axis-specific matrix multiplication out[4] = a10 * c + a20 * s; out[5] = a11 * c + a21 * s; out[6] = a12 * c + a22 * s; out[7] = a13 * c + a23 * s; out[8] = a20 * c - a10 * s; out[9] = a21 * c - a11 * s; out[10] = a22 * c - a12 * s; out[11] = a23 * c - a13 * s; return out; } /** * Rotates a matrix by the given angle around the Y axis * * @param {mat4} out the receiving matrix * @param {ReadonlyMat4} a the matrix to rotate * @param {Number} rad the angle to rotate the matrix by * @returns {mat4} out */ function rotateY(out, a, rad) { var s = Math.sin(rad); var c = Math.cos(rad); var a00 = a[0]; var a01 = a[1]; var a02 = a[2]; var a03 = a[3]; var a20 = a[8]; var a21 = a[9]; var a22 = a[10]; var a23 = a[11]; if (a !== out) { // If the source and destination differ, copy the unchanged rows out[4] = a[4]; out[5] = a[5]; out[6] = a[6]; out[7] = a[7]; out[12] = a[12]; out[13] = a[13]; out[14] = a[14]; out[15] = a[15]; } // Perform axis-specific matrix multiplication out[0] = a00 * c - a20 * s; out[1] = a01 * c - a21 * s; out[2] = a02 * c - a22 * s; out[3] = a03 * c - a23 * s; out[8] = a00 * s + a20 * c; out[9] = a01 * s + a21 * c; out[10] = a02 * s + a22 * c; out[11] = a03 * s + a23 * c; return out; } /** * Rotates a matrix by the given angle around the Z axis * * @param {mat4} out the receiving matrix * @param {ReadonlyMat4} a the matrix to rotate * @param {Number} rad the angle to rotate the matrix by * @returns {mat4} out */ function rotateZ(out, a, rad) { var s = Math.sin(rad); var c = Math.cos(rad); var a00 = a[0]; var a01 = a[1]; var a02 = a[2]; var a03 = a[3]; var a10 = a[4]; var a11 = a[5]; var a12 = a[6]; var a13 = a[7]; if (a !== out) { // If the source and destination differ, copy the unchanged last row out[8] = a[8]; out[9] = a[9]; out[10] = a[10]; out[11] = a[11]; out[12] = a[12]; out[13] = a[13]; out[14] = a[14]; out[15] = a[15]; } // Perform axis-specific matrix multiplication out[0] = a00 * c + a10 * s; out[1] = a01 * c + a11 * s; out[2] = a02 * c + a12 * s; out[3] = a03 * c + a13 * s; out[4] = a10 * c - a00 * s; out[5] = a11 * c - a01 * s; out[6] = a12 * c - a02 * s; out[7] = a13 * c - a03 * s; return out; } /** * Creates a matrix from a vector translation * This is equivalent to (but much faster than): * * mat4.identity(dest); * mat4.translate(dest, dest, vec); * * @param {mat4} out mat4 receiving operation result * @param {ReadonlyVec3} v Translation vector * @returns {mat4} out */ function fromTranslation(out, v) { out[0] = 1; out[1] = 0; out[2] = 0; out[3] = 0; out[4] = 0; out[5] = 1; out[6] = 0; out[7] = 0; out[8] = 0; out[9] = 0; out[10] = 1; out[11] = 0; out[12] = v[0]; out[13] = v[1]; out[14] = v[2]; out[15] = 1; return out; } /** * Creates a matrix from a vector scaling * This is equivalent to (but much faster than): * * mat4.identity(dest); * mat4.scale(dest, dest, vec); * * @param {mat4} out mat4 receiving operation result * @param {ReadonlyVec3} v Scaling vector * @returns {mat4} out */ function fromScaling(out, v) { out[0] = v[0]; out[1] = 0; out[2] = 0; out[3] = 0; out[4] = 0; out[5] = v[1]; out[6] = 0; out[7] = 0; out[8] = 0; out[9] = 0; out[10] = v[2]; out[11] = 0; out[12] = 0; out[13] = 0; out[14] = 0; out[15] = 1; return out; } /** * Creates a matrix from a given angle around a given axis * This is equivalent to (but much faster than): * * mat4.identity(dest); * mat4.rotate(dest, dest, rad, axis); * * @param {mat4} out mat4 receiving operation result * @param {Number} rad the angle to rotate the matrix by * @param {ReadonlyVec3} axis the axis to rotate around * @returns {mat4} out */ function fromRotation(out, rad, axis) { var x = axis[0], y = axis[1], z = axis[2]; var len = Math.hypot(x, y, z); var s, c, t; if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { return null; } len = 1 / len; x *= len; y *= len; z *= len; s = Math.sin(rad); c = Math.cos(rad); t = 1 - c; // Perform rotation-specific matrix multiplication out[0] = x * x * t + c; out[1] = y * x * t + z * s; out[2] = z * x * t - y * s; out[3] = 0; out[4] = x * y * t - z * s; out[5] = y * y * t + c; out[6] = z * y * t + x * s; out[7] = 0; out[8] = x * z * t + y * s; out[9] = y * z * t - x * s; out[10] = z * z * t + c; out[11] = 0; out[12] = 0; out[13] = 0; out[14] = 0; out[15] = 1; return out; } /** * Creates a matrix from the given angle around the X axis * This is equivalent to (but much faster than): * * mat4.identity(dest); * mat4.rotateX(dest, dest, rad); * * @param {mat4} out mat4 receiving operation result * @param {Number} rad the angle to rotate the matrix by * @returns {mat4} out */ function fromXRotation(out, rad) { var s = Math.sin(rad); var c = Math.cos(rad); // Perform axis-specific matrix multiplication out[0] = 1; out[1] = 0; out[2] = 0; out[3] = 0; out[4] = 0; out[5] = c; out[6] = s; out[7] = 0; out[8] = 0; out[9] = -s; out[10] = c; out[11] = 0; out[12] = 0; out[13] = 0; out[14] = 0; out[15] = 1; return out; } /** * Creates a matrix from the given angle around the Y axis * This is equivalent to (but much faster than): * * mat4.identity(dest); * mat4.rotateY(dest, dest, rad); * * @param {mat4} out mat4 receiving operation result * @param {Number} rad the angle to rotate the matrix by * @returns {mat4} out */ function fromYRotation(out, rad) { var s = Math.sin(rad); var c = Math.cos(rad); // Perform axis-specific matrix multiplication out[0] = c; out[1] = 0; out[2] = -s; out[3] = 0; out[4] = 0; out[5] = 1; out[6] = 0; out[7] = 0; out[8] = s; out[9] = 0; out[10] = c; out[11] = 0; out[12] = 0; out[13] = 0; out[14] = 0; out[15] = 1; return out; } /** * Creates a matrix from the given angle around the Z axis * This is equivalent to (but much faster than): * * mat4.identity(dest); * mat4.rotateZ(dest, dest, rad); * * @param {mat4} out mat4 receiving operation result * @param {Number} rad the angle to rotate the matrix by * @returns {mat4} out */ function fromZRotation(out, rad) { var s = Math.sin(rad); var c = Math.cos(rad); // Perform axis-specific matrix multiplication out[0] = c; out[1] = s; out[2] = 0; out[3] = 0; out[4] = -s; out[5] = c; out[6] = 0; out[7] = 0; out[8] = 0; out[9] = 0; out[10] = 1; out[11] = 0; out[12] = 0; out[13] = 0; out[14] = 0; out[15] = 1; return out; } /** * Creates a matrix from a quaternion rotation and vector translation * This is equivalent to (but much faster than): * * mat4.identity(dest); * mat4.translate(dest, vec); * let quatMat = mat4.create(); * quat4.toMat4(quat, quatMat); * mat4.multiply(dest, quatMat); * * @param {mat4} out mat4 receiving operation result * @param {quat4} q Rotation quaternion * @param {ReadonlyVec3} v Translation vector * @returns {mat4} out */ function fromRotationTranslation(out, q, v) { // Quaternion math var x = q[0], y = q[1], z = q[2], w = q[3]; var x2 = x + x; var y2 = y + y; var z2 = z + z; var xx = x * x2; var xy = x * y2; var xz = x * z2; var yy = y * y2; var yz = y * z2; var zz = z * z2; var wx = w * x2; var wy = w * y2; var wz = w * z2; out[0] = 1 - (yy + zz); out[1] = xy + wz; out[2] = xz - wy; out[3] = 0; out[4] = xy - wz; out[5] = 1 - (xx + zz); out[6] = yz + wx; out[7] = 0; out[8] = xz + wy; out[9] = yz - wx; out[10] = 1 - (xx + yy); out[11] = 0; out[12] = v[0]; out[13] = v[1]; out[14] = v[2]; out[15] = 1; return out; } /** * Creates a new mat4 from a dual quat. * * @param {mat4} out Matrix * @param {ReadonlyQuat2} a Dual Quaternion * @returns {mat4} mat4 receiving operation result */ function fromQuat2(out, a) { var translation = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); var bx = -a[0], by = -a[1], bz = -a[2], bw = a[3], ax = a[4], ay = a[5], az = a[6], aw = a[7]; var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense if (magnitude > 0) { translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude; translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude; translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude; } else { translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2; translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2; translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2; } fromRotationTranslation(out, a, translation); return out; } /** * Returns the translation vector component of a transformation * matrix. If a matrix is built with fromRotationTranslation, * the returned vector will be the same as the translation vector * originally supplied. * @param {vec3} out Vector to receive translation component * @param {ReadonlyMat4} mat Matrix to be decomposed (input) * @return {vec3} out */ function getTranslation(out, mat) { out[0] = mat[12]; out[1] = mat[13]; out[2] = mat[14]; return out; } /** * Returns the scaling factor component of a transformation * matrix. If a matrix is built with fromRotationTranslationScale * with a normalized Quaternion paramter, the returned vector will be * the same as the scaling vector * originally supplied. * @param {vec3} out Vector to receive scaling factor component * @param {ReadonlyMat4} mat Matrix to be decomposed (input) * @return {vec3} out */ function getScaling(out, mat) { var m11 = mat[0]; var m12 = mat[1]; var m13 = mat[2]; var m21 = mat[4]; var m22 = mat[5]; var m23 = mat[6]; var m31 = mat[8]; var m32 = mat[9]; var m33 = mat[10]; out[0] = Math.hypot(m11, m12, m13); out[1] = Math.hypot(m21, m22, m23); out[2] = Math.hypot(m31, m32, m33); return out; } /** * Returns a quaternion representing the rotational component * of a transformation matrix. If a matrix is built with * fromRotationTranslation, the returned quaternion will be the * same as the quaternion originally supplied. * @param {quat} out Quaternion to receive the rotation component * @param {ReadonlyMat4} mat Matrix to be decomposed (input) * @return {quat} out */ function getRotation(out, mat) { var scaling = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); getScaling(scaling, mat); var is1 = 1 / scaling[0]; var is2 = 1 / scaling[1]; var is3 = 1 / scaling[2]; var sm11 = mat[0] * is1; var sm12 = mat[1] * is2; var sm13 = mat[2] * is3; var sm21 = mat[4] * is1; var sm22 = mat[5] * is2; var sm23 = mat[6] * is3; var sm31 = mat[8] * is1; var sm32 = mat[9] * is2; var sm33 = mat[10] * is3; var trace = sm11 + sm22 + sm33; var S = 0; if (trace > 0) { S = Math.sqrt(trace + 1.0) * 2; out[3] = 0.25 * S; out[0] = (sm23 - sm32) / S; out[1] = (sm31 - sm13) / S; out[2] = (sm12 - sm21) / S; } else if (sm11 > sm22 && sm11 > sm33) { S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2; out[3] = (sm23 - sm32) / S; out[0] = 0.25 * S; out[1] = (sm12 + sm21) / S; out[2] = (sm31 + sm13) / S; } else if (sm22 > sm33) { S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2; out[3] = (sm31 - sm13) / S; out[0] = (sm12 + sm21) / S; out[1] = 0.25 * S; out[2] = (sm23 + sm32) / S; } else { S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2; out[3] = (sm12 - sm21) / S; out[0] = (sm31 + sm13) / S; out[1] = (sm23 + sm32) / S; out[2] = 0.25 * S; } return out; } /** * Creates a matrix from a quaternion rotation, vector translation and vector scale * This is equivalent to (but much faster than): * * mat4.identity(dest); * mat4.translate(dest, vec); * let quatMat = mat4.create(); * quat4.toMat4(quat, quatMat); * mat4.multiply(dest, quatMat); * mat4.scale(dest, scale) * * @param {mat4} out mat4 receiving operation result * @param {quat4} q Rotation quaternion * @param {ReadonlyVec3} v Translation vector * @param {ReadonlyVec3} s Scaling vector * @returns {mat4} out */ function fromRotationTranslationScale(out, q, v, s) { // Quaternion math var x = q[0], y = q[1], z = q[2], w = q[3]; var x2 = x + x; var y2 = y + y; var z2 = z + z; var xx = x * x2; var xy = x * y2; var xz = x * z2; var yy = y * y2; var yz = y * z2; var zz = z * z2; var wx = w * x2; var wy = w * y2; var wz = w * z2; var sx = s[0]; var sy = s[1]; var sz = s[2]; out[0] = (1 - (yy + zz)) * sx; out[1] = (xy + wz) * sx; out[2] = (xz - wy) * sx; out[3] = 0; out[4] = (xy - wz) * sy; out[5] = (1 - (xx + zz)) * sy; out[6] = (yz + wx) * sy; out[7] = 0; out[8] = (xz + wy) * sz; out[9] = (yz - wx) * sz; out[10] = (1 - (xx + yy)) * sz; out[11] = 0; out[12] = v[0]; out[13] = v[1]; out[14] = v[2]; out[15] = 1; return out; } /** * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin * This is equivalent to (but much faster than): * * mat4.identity(dest); * mat4.translate(dest, vec); * mat4.translate(dest, origin); * let quatMat = mat4.create(); * quat4.toMat4(quat, quatMat); * mat4.multiply(dest, quatMat); * mat4.scale(dest, scale) * mat4.translate(dest, negativeOrigin); * * @param {mat4} out mat4 receiving operation result * @param {quat4} q Rotation quaternion * @param {ReadonlyVec3} v Translation vector * @param {ReadonlyVec3} s Scaling vector * @param {ReadonlyVec3} o The origin vector around which to scale and rotate * @returns {mat4} out */ function fromRotationTranslationScaleOrigin(out, q, v, s, o) { // Quaternion math var x = q[0], y = q[1], z = q[2], w = q[3]; var x2 = x + x; var y2 = y + y; var z2 = z + z; var xx = x * x2; var xy = x * y2; var xz = x * z2; var yy = y * y2; var yz = y * z2; var zz = z * z2; var wx = w * x2; var wy = w * y2; var wz = w * z2; var sx = s[0]; var sy = s[1]; var sz = s[2]; var ox = o[0]; var oy = o[1]; var oz = o[2]; var out0 = (1 - (yy + zz)) * sx; var out1 = (xy + wz) * sx; var out2 = (xz - wy) * sx; var out4 = (xy - wz) * sy; var out5 = (1 - (xx + zz)) * sy; var out6 = (yz + wx) * sy; var out8 = (xz + wy) * sz; var out9 = (yz - wx) * sz; var out10 = (1 - (xx + yy)) * sz; out[0] = out0; out[1] = out1; out[2] = out2; out[3] = 0; out[4] = out4; out[5] = out5; out[6] = out6; out[7] = 0; out[8] = out8; out[9] = out9; out[10] = out10; out[11] = 0; out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz); out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz); out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz); out[15] = 1; return out; } /** * Calculates a 4x4 matrix from the given quaternion * * @param {mat4} out mat4 receiving operation result * @param {ReadonlyQuat} q Quaternion to create matrix from * * @returns {mat4} out */ function fromQuat(out, q) { var x = q[0], y = q[1], z = q[2], w = q[3]; var x2 = x + x; var y2 = y + y; var z2 = z + z; var xx = x * x2; var yx = y * x2; var yy = y * y2; var zx = z * x2; var zy = z * y2; var zz = z * z2; var wx = w * x2; var wy = w * y2; var wz = w * z2; out[0] = 1 - yy - zz; out[1] = yx + wz; out[2] = zx - wy; out[3] = 0; out[4] = yx - wz; out[5] = 1 - xx - zz; out[6] = zy + wx; out[7] = 0; out[8] = zx + wy; out[9] = zy - wx; out[10] = 1 - xx - yy; out[11] = 0; out[12] = 0; out[13] = 0; out[14] = 0; out[15] = 1; return out; } /** * Generates a frustum matrix with the given bounds * * @param {mat4} out mat4 frustum matrix will be written into * @param {Number} left Left bound of the frustum * @param {Number} right Right bound of the frustum * @param {Number} bottom Bottom bound of the frustum * @param {Number} top Top bound of the frustum * @param {Number} near Near bound of the frustum * @param {Number} far Far bound of the frustum * @returns {mat4} out */ function frustum(out, left, right, bottom, top, near, far) { var rl = 1 / (right - left); var tb = 1 / (top - bottom); var nf = 1 / (near - far); out[0] = near * 2 * rl; out[1] = 0; out[2] = 0; out[3] = 0; out[4] = 0; out[5] = near * 2 * tb; out[6] = 0; out[7] = 0; out[8] = (right + left) * rl; out[9] = (top + bottom) * tb; out[10] = (far + near) * nf; out[11] = -1; out[12] = 0; out[13] = 0; out[14] = far * near * 2 * nf; out[15] = 0; return out; } /** * Generates a perspective projection matrix with the given bounds. * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], * which matches WebGL/OpenGL's clip volume. * Passing null/undefined/no value for far will generate infinite projection matrix. * * @param {mat4} out mat4 frustum matrix will be written into * @param {number} fovy Vertical field of view in radians * @param {number} aspect Aspect ratio. typically viewport width/height * @param {number} near Near bound of the frustum * @param {number} far Far bound of the frustum, can be null or Infinity * @returns {mat4} out */ function perspectiveNO(out, fovy, aspect, near, far) { var f = 1.0 / Math.tan(fovy / 2), nf; out[0] = f / aspect; out[1] = 0; out[2] = 0; out[3] = 0; out[4] = 0; out[5] = f; out[6] = 0; out[7] = 0; out[8] = 0; out[9] = 0; out[11] = -1; out[12] = 0; out[13] = 0; out[15] = 0; if (far != null && far !== Infinity) { nf = 1 / (near - far); out[10] = (far + near) * nf; out[14] = 2 * far * near * nf; } else { out[10] = -1; out[14] = -2 * near; } return out; } /** * Alias for {@link mat4.perspectiveNO} * @function */ var perspective = perspectiveNO; /** * Generates a perspective projection matrix suitable for WebGPU with the given bounds. * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. * Passing null/undefined/no value for far will generate infinite projection matrix. * * @param {mat4} out mat4 frustum matrix will be written into * @param {number} fovy Vertical field of view in radians * @param {number} aspect Aspect ratio. typically viewport width/height * @param {number} near Near bound of the frustum * @param {number} far Far bound of the frustum, can be null or Infinity * @returns {mat4} out */ function perspectiveZO(out, fovy, aspect, near, far) { var f = 1.0 / Math.tan(fovy / 2), nf; out[0] = f / aspect; out[1] = 0; out[2] = 0; out[3] = 0; out[4] = 0; out[5] = f; out[6] = 0; out[7] = 0; out[8] = 0; out[9] = 0; out[11] = -1; out[12] = 0; out[13] = 0; out[15] = 0; if (far != null && far !== Infinity) { nf = 1 / (near - far); out[10] = far * nf; out[14] = far * near * nf; } else { out[10] = -1; out[14] = -near; } return out; } /** * Generates a perspective projection matrix with the given field of view. * This is primarily useful for generating projection matrices to be used * with the still experiemental WebVR API. * * @param {mat4} out mat4 frustum matrix will be written into * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees * @param {number} near Near bound of the frustum * @param {number} far Far bound of the frustum * @returns {mat4} out */ function perspectiveFromFieldOfView(out, fov, near, far) { var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0); var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0); var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0); var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0); var xScale = 2.0 / (leftTan + rightTan); var yScale = 2.0 / (upTan + downTan); out[0] = xScale; out[1] = 0.0; out[2] = 0.0; out[3] = 0.0; out[4] = 0.0; out[5] = yScale; out[6] = 0.0; out[7] = 0.0; out[8] = -((leftTan - rightTan) * xScale * 0.5); out[9] = (upTan - downTan) * yScale * 0.5; out[10] = far / (near - far); out[11] = -1.0; out[12] = 0.0; out[13] = 0.0; out[14] = far * near / (near - far); out[15] = 0.0; return out; } /** * Generates a orthogonal projection matrix with the given bounds. * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1], * which matches WebGL/OpenGL's clip volume. * * @param {mat4} out mat4 frustum matrix will be written into * @param {number} left Left bound of the frustum * @param {number} right Right bound of the frustum * @param {number} bottom Bottom bound of the frustum * @param {number} top Top bound of the frustum * @param {number} near Near bound of the frustum * @param {number} far Far bound of the frustum * @returns {mat4} out */ function orthoNO(out, left, right, bottom, top, near, far) { var lr = 1 / (left - right); var bt = 1 / (bottom - top); var nf = 1 / (near - far); out[0] = -2 * lr; out[1] = 0; out[2] = 0; out[3] = 0; out[4] = 0; out[5] = -2 * bt; out[6] = 0; out[7] = 0; out[8] = 0; out[9] = 0; out[10] = 2 * nf; out[11] = 0; out[12] = (left + right) * lr; out[13] = (top + bottom) * bt; out[14] = (far + near) * nf; out[15] = 1; return out; } /** * Alias for {@link mat4.orthoNO} * @function */ var ortho = orthoNO; /** * Generates a orthogonal projection matrix with the given bounds. * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1], * which matches WebGPU/Vulkan/DirectX/Metal's clip volume. * * @param {mat4} out mat4 frustum matrix will be written into * @param {number} left Left bound of the frustum * @param {number} right Right bound of the frustum * @param {number} bottom Bottom bound of the frustum * @param {number} top Top bound of the frustum * @param {number} near Near bound of the frustum * @param {number} far Far bound of the frustum * @returns {mat4} out */ function orthoZO(out, left, right, bottom, top, near, far) { var lr = 1 / (left - right); var bt = 1 / (bottom - top); var nf = 1 / (near - far); out[0] = -2 * lr; out[1] = 0; out[2] = 0; out[3] = 0; out[4] = 0; out[5] = -2 * bt; out[6] = 0; out[7] = 0; out[8] = 0; out[9] = 0; out[10] = nf; out[11] = 0; out[12] = (left + right) * lr; out[13] = (top + bottom) * bt; out[14] = near * nf; out[15] = 1; return out; } /** * Generates a look-at matrix with the given eye position, focal point, and up axis. * If you want a matrix that actually makes an object look at another object, you should use targetTo instead. * * @param {mat4} out mat4 frustum matrix will be written into * @param {ReadonlyVec3} eye Position of the viewer * @param {ReadonlyVec3} center Point the viewer is looking at * @param {ReadonlyVec3} up vec3 pointing up * @returns {mat4} out */ function lookAt(out, eye, center, up) { var x0, x1, x2, y0, y1, y2, z0, z1, z2, len; var eyex = eye[0]; var eyey = eye[1]; var eyez = eye[2]; var upx = up[0]; var upy = up[1]; var upz = up[2]; var centerx = center[0]; var centery = center[1]; var centerz = center[2]; if (Math.abs(eyex - centerx) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON && Math.abs(eyey - centery) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON && Math.abs(eyez - centerz) < _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { return identity(out); } z0 = eyex - centerx; z1 = eyey - centery; z2 = eyez - centerz; len = 1 / Math.hypot(z0, z1, z2); z0 *= len; z1 *= len; z2 *= len; x0 = upy * z2 - upz * z1; x1 = upz * z0 - upx * z2; x2 = upx * z1 - upy * z0; len = Math.hypot(x0, x1, x2); if (!len) { x0 = 0; x1 = 0; x2 = 0; } else { len = 1 / len; x0 *= len; x1 *= len; x2 *= len; } y0 = z1 * x2 - z2 * x1; y1 = z2 * x0 - z0 * x2; y2 = z0 * x1 - z1 * x0; len = Math.hypot(y0, y1, y2); if (!len) { y0 = 0; y1 = 0; y2 = 0; } else { len = 1 / len; y0 *= len; y1 *= len; y2 *= len; } out[0] = x0; out[1] = y0; out[2] = z0; out[3] = 0; out[4] = x1; out[5] = y1; out[6] = z1; out[7] = 0; out[8] = x2; out[9] = y2; out[10] = z2; out[11] = 0; out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez); out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez); out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez); out[15] = 1; return out; } /** * Generates a matrix that makes something look at something else. * * @param {mat4} out mat4 frustum matrix will be written into * @param {ReadonlyVec3} eye Position of the viewer * @param {ReadonlyVec3} center Point the viewer is looking at * @param {ReadonlyVec3} up vec3 pointing up * @returns {mat4} out */ function targetTo(out, eye, target, up) { var eyex = eye[0], eyey = eye[1], eyez = eye[2], upx = up[0], upy = up[1], upz = up[2]; var z0 = eyex - target[0], z1 = eyey - target[1], z2 = eyez - target[2]; var len = z0 * z0 + z1 * z1 + z2 * z2; if (len > 0) { len = 1 / Math.sqrt(len); z0 *= len; z1 *= len; z2 *= len; } var x0 = upy * z2 - upz * z1, x1 = upz * z0 - upx * z2, x2 = upx * z1 - upy * z0; len = x0 * x0 + x1 * x1 + x2 * x2; if (len > 0) { len = 1 / Math.sqrt(len); x0 *= len; x1 *= len; x2 *= len; } out[0] = x0; out[1] = x1; out[2] = x2; out[3] = 0; out[4] = z1 * x2 - z2 * x1; out[5] = z2 * x0 - z0 * x2; out[6] = z0 * x1 - z1 * x0; out[7] = 0; out[8] = z0; out[9] = z1; out[10] = z2; out[11] = 0; out[12] = eyex; out[13] = eyey; out[14] = eyez; out[15] = 1; return out; } /** * Returns a string representation of a mat4 * * @param {ReadonlyMat4} a matrix to represent as a string * @returns {String} string representation of the matrix */ function str(a) { return "mat4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ", " + a[4] + ", " + a[5] + ", " + a[6] + ", " + a[7] + ", " + a[8] + ", " + a[9] + ", " + a[10] + ", " + a[11] + ", " + a[12] + ", " + a[13] + ", " + a[14] + ", " + a[15] + ")"; } /** * Returns Frobenius norm of a mat4 * * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of * @returns {Number} Frobenius norm */ function frob(a) { return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]); } /** * Adds two mat4's * * @param {mat4} out the receiving matrix * @param {ReadonlyMat4} a the first operand * @param {ReadonlyMat4} b the second operand * @returns {mat4} out */ function add(out, a, b) { out[0] = a[0] + b[0]; out[1] = a[1] + b[1]; out[2] = a[2] + b[2]; out[3] = a[3] + b[3]; out[4] = a[4] + b[4]; out[5] = a[5] + b[5]; out[6] = a[6] + b[6]; out[7] = a[7] + b[7]; out[8] = a[8] + b[8]; out[9] = a[9] + b[9]; out[10] = a[10] + b[10]; out[11] = a[11] + b[11]; out[12] = a[12] + b[12]; out[13] = a[13] + b[13]; out[14] = a[14] + b[14]; out[15] = a[15] + b[15]; return out; } /** * Subtracts matrix b from matrix a * * @param {mat4} out the receiving matrix * @param {ReadonlyMat4} a the first operand * @param {ReadonlyMat4} b the second operand * @returns {mat4} out */ function subtract(out, a, b) { out[0] = a[0] - b[0]; out[1] = a[1] - b[1]; out[2] = a[2] - b[2]; out[3] = a[3] - b[3]; out[4] = a[4] - b[4]; out[5] = a[5] - b[5]; out[6] = a[6] - b[6]; out[7] = a[7] - b[7]; out[8] = a[8] - b[8]; out[9] = a[9] - b[9]; out[10] = a[10] - b[10]; out[11] = a[11] - b[11]; out[12] = a[12] - b[12]; out[13] = a[13] - b[13]; out[14] = a[14] - b[14]; out[15] = a[15] - b[15]; return out; } /** * Multiply each element of the matrix by a scalar. * * @param {mat4} out the receiving matrix * @param {ReadonlyMat4} a the matrix to scale * @param {Number} b amount to scale the matrix's elements by * @returns {mat4} out */ function multiplyScalar(out, a, b) { out[0] = a[0] * b; out[1] = a[1] * b; out[2] = a[2] * b; out[3] = a[3] * b; out[4] = a[4] * b; out[5] = a[5] * b; out[6] = a[6] * b; out[7] = a[7] * b; out[8] = a[8] * b; out[9] = a[9] * b; out[10] = a[10] * b; out[11] = a[11] * b; out[12] = a[12] * b; out[13] = a[13] * b; out[14] = a[14] * b; out[15] = a[15] * b; return out; } /** * Adds two mat4's after multiplying each element of the second operand by a scalar value. * * @param {mat4} out the receiving vector * @param {ReadonlyMat4} a the first operand * @param {ReadonlyMat4} b the second operand * @param {Number} scale the amount to scale b's elements by before adding * @returns {mat4} out */ function multiplyScalarAndAdd(out, a, b, scale) { out[0] = a[0] + b[0] * scale; out[1] = a[1] + b[1] * scale; out[2] = a[2] + b[2] * scale; out[3] = a[3] + b[3] * scale; out[4] = a[4] + b[4] * scale; out[5] = a[5] + b[5] * scale; out[6] = a[6] + b[6] * scale; out[7] = a[7] + b[7] * scale; out[8] = a[8] + b[8] * scale; out[9] = a[9] + b[9] * scale; out[10] = a[10] + b[10] * scale; out[11] = a[11] + b[11] * scale; out[12] = a[12] + b[12] * scale; out[13] = a[13] + b[13] * scale; out[14] = a[14] + b[14] * scale; out[15] = a[15] + b[15] * scale; return out; } /** * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===) * * @param {ReadonlyMat4} a The first matrix. * @param {ReadonlyMat4} b The second matrix. * @returns {Boolean} True if the matrices are equal, false otherwise. */ function exactEquals(a, b) { return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15]; } /** * Returns whether or not the matrices have approximately the same elements in the same position. * * @param {ReadonlyMat4} a The first matrix. * @param {ReadonlyMat4} b The second matrix. * @returns {Boolean} True if the matrices are equal, false otherwise. */ function equals(a, b) { var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3]; var a4 = a[4], a5 = a[5], a6 = a[6], a7 = a[7]; var a8 = a[8], a9 = a[9], a10 = a[10], a11 = a[11]; var a12 = a[12], a13 = a[13], a14 = a[14], a15 = a[15]; var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3]; var b4 = b[4], b5 = b[5], b6 = b[6], b7 = b[7]; var b8 = b[8], b9 = b[9], b10 = b[10], b11 = b[11]; var b12 = b[12], b13 = b[13], b14 = b[14], b15 = b[15]; return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a15), Math.abs(b15)); } /** * Alias for {@link mat4.multiply} * @function */ var mul = multiply; /** * Alias for {@link mat4.subtract} * @function */ var sub = subtract; /***/ }, /***/ 85648 /*!********************************************!*\ !*** ./node_modules/gl-matrix/esm/quat.js ***! \********************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ add: () => (/* binding */ add), /* harmony export */ calculateW: () => (/* binding */ calculateW), /* harmony export */ clone: () => (/* binding */ clone), /* harmony export */ conjugate: () => (/* binding */ conjugate), /* harmony export */ copy: () => (/* binding */ copy), /* harmony export */ create: () => (/* binding */ create), /* harmony export */ dot: () => (/* binding */ dot), /* harmony export */ equals: () => (/* binding */ equals), /* harmony export */ exactEquals: () => (/* binding */ exactEquals), /* harmony export */ exp: () => (/* binding */ exp), /* harmony export */ fromEuler: () => (/* binding */ fromEuler), /* harmony export */ fromMat3: () => (/* binding */ fromMat3), /* harmony export */ fromValues: () => (/* binding */ fromValues), /* harmony export */ getAngle: () => (/* binding */ getAngle), /* harmony export */ getAxisAngle: () => (/* binding */ getAxisAngle), /* harmony export */ identity: () => (/* binding */ identity), /* harmony export */ invert: () => (/* binding */ invert), /* harmony export */ len: () => (/* binding */ len), /* harmony export */ length: () => (/* binding */ length), /* harmony export */ lerp: () => (/* binding */ lerp), /* harmony export */ ln: () => (/* binding */ ln), /* harmony export */ mul: () => (/* binding */ mul), /* harmony export */ multiply: () => (/* binding */ multiply), /* harmony export */ normalize: () => (/* binding */ normalize), /* harmony export */ pow: () => (/* binding */ pow), /* harmony export */ random: () => (/* binding */ random), /* harmony export */ rotateX: () => (/* binding */ rotateX), /* harmony export */ rotateY: () => (/* binding */ rotateY), /* harmony export */ rotateZ: () => (/* binding */ rotateZ), /* harmony export */ rotationTo: () => (/* binding */ rotationTo), /* harmony export */ scale: () => (/* binding */ scale), /* harmony export */ set: () => (/* binding */ set), /* harmony export */ setAxes: () => (/* binding */ setAxes), /* harmony export */ setAxisAngle: () => (/* binding */ setAxisAngle), /* harmony export */ slerp: () => (/* binding */ slerp), /* harmony export */ sqlerp: () => (/* binding */ sqlerp), /* harmony export */ sqrLen: () => (/* binding */ sqrLen), /* harmony export */ squaredLength: () => (/* binding */ squaredLength), /* harmony export */ str: () => (/* binding */ str) /* harmony export */ }); /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ 27182); /* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mat3.js */ 23988); /* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./vec3.js */ 87396); /* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./vec4.js */ 17521); /** * Quaternion * @module quat */ /** * Creates a new identity quat * * @returns {quat} a new quaternion */ function create() { var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { out[0] = 0; out[1] = 0; out[2] = 0; } out[3] = 1; return out; } /** * Set a quat to the identity quaternion * * @param {quat} out the receiving quaternion * @returns {quat} out */ function identity(out) { out[0] = 0; out[1] = 0; out[2] = 0; out[3] = 1; return out; } /** * Sets a quat from the given angle and rotation axis, * then returns it. * * @param {quat} out the receiving quaternion * @param {ReadonlyVec3} axis the axis around which to rotate * @param {Number} rad the angle in radians * @returns {quat} out **/ function setAxisAngle(out, axis, rad) { rad = rad * 0.5; var s = Math.sin(rad); out[0] = s * axis[0]; out[1] = s * axis[1]; out[2] = s * axis[2]; out[3] = Math.cos(rad); return out; } /** * Gets the rotation axis and angle for a given * quaternion. If a quaternion is created with * setAxisAngle, this method will return the same * values as providied in the original parameter list * OR functionally equivalent values. * Example: The quaternion formed by axis [0, 0, 1] and * angle -90 is the same as the quaternion formed by * [0, 0, 1] and 270. This method favors the latter. * @param {vec3} out_axis Vector receiving the axis of rotation * @param {ReadonlyQuat} q Quaternion to be decomposed * @return {Number} Angle, in radians, of the rotation */ function getAxisAngle(out_axis, q) { var rad = Math.acos(q[3]) * 2.0; var s = Math.sin(rad / 2.0); if (s > _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { out_axis[0] = q[0] / s; out_axis[1] = q[1] / s; out_axis[2] = q[2] / s; } else { // If s is zero, return any axis (no rotation - axis does not matter) out_axis[0] = 1; out_axis[1] = 0; out_axis[2] = 0; } return rad; } /** * Gets the angular distance between two unit quaternions * * @param {ReadonlyQuat} a Origin unit quaternion * @param {ReadonlyQuat} b Destination unit quaternion * @return {Number} Angle, in radians, between the two quaternions */ function getAngle(a, b) { var dotproduct = dot(a, b); return Math.acos(2 * dotproduct * dotproduct - 1); } /** * Multiplies two quat's * * @param {quat} out the receiving quaternion * @param {ReadonlyQuat} a the first operand * @param {ReadonlyQuat} b the second operand * @returns {quat} out */ function multiply(out, a, b) { var ax = a[0], ay = a[1], az = a[2], aw = a[3]; var bx = b[0], by = b[1], bz = b[2], bw = b[3]; out[0] = ax * bw + aw * bx + ay * bz - az * by; out[1] = ay * bw + aw * by + az * bx - ax * bz; out[2] = az * bw + aw * bz + ax * by - ay * bx; out[3] = aw * bw - ax * bx - ay * by - az * bz; return out; } /** * Rotates a quaternion by the given angle about the X axis * * @param {quat} out quat receiving operation result * @param {ReadonlyQuat} a quat to rotate * @param {number} rad angle (in radians) to rotate * @returns {quat} out */ function rotateX(out, a, rad) { rad *= 0.5; var ax = a[0], ay = a[1], az = a[2], aw = a[3]; var bx = Math.sin(rad), bw = Math.cos(rad); out[0] = ax * bw + aw * bx; out[1] = ay * bw + az * bx; out[2] = az * bw - ay * bx; out[3] = aw * bw - ax * bx; return out; } /** * Rotates a quaternion by the given angle about the Y axis * * @param {quat} out quat receiving operation result * @param {ReadonlyQuat} a quat to rotate * @param {number} rad angle (in radians) to rotate * @returns {quat} out */ function rotateY(out, a, rad) { rad *= 0.5; var ax = a[0], ay = a[1], az = a[2], aw = a[3]; var by = Math.sin(rad), bw = Math.cos(rad); out[0] = ax * bw - az * by; out[1] = ay * bw + aw * by; out[2] = az * bw + ax * by; out[3] = aw * bw - ay * by; return out; } /** * Rotates a quaternion by the given angle about the Z axis * * @param {quat} out quat receiving operation result * @param {ReadonlyQuat} a quat to rotate * @param {number} rad angle (in radians) to rotate * @returns {quat} out */ function rotateZ(out, a, rad) { rad *= 0.5; var ax = a[0], ay = a[1], az = a[2], aw = a[3]; var bz = Math.sin(rad), bw = Math.cos(rad); out[0] = ax * bw + ay * bz; out[1] = ay * bw - ax * bz; out[2] = az * bw + aw * bz; out[3] = aw * bw - az * bz; return out; } /** * Calculates the W component of a quat from the X, Y, and Z components. * Assumes that quaternion is 1 unit in length. * Any existing W component will be ignored. * * @param {quat} out the receiving quaternion * @param {ReadonlyQuat} a quat to calculate W component of * @returns {quat} out */ function calculateW(out, a) { var x = a[0], y = a[1], z = a[2]; out[0] = x; out[1] = y; out[2] = z; out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z)); return out; } /** * Calculate the exponential of a unit quaternion. * * @param {quat} out the receiving quaternion * @param {ReadonlyQuat} a quat to calculate the exponential of * @returns {quat} out */ function exp(out, a) { var x = a[0], y = a[1], z = a[2], w = a[3]; var r = Math.sqrt(x * x + y * y + z * z); var et = Math.exp(w); var s = r > 0 ? et * Math.sin(r) / r : 0; out[0] = x * s; out[1] = y * s; out[2] = z * s; out[3] = et * Math.cos(r); return out; } /** * Calculate the natural logarithm of a unit quaternion. * * @param {quat} out the receiving quaternion * @param {ReadonlyQuat} a quat to calculate the exponential of * @returns {quat} out */ function ln(out, a) { var x = a[0], y = a[1], z = a[2], w = a[3]; var r = Math.sqrt(x * x + y * y + z * z); var t = r > 0 ? Math.atan2(r, w) / r : 0; out[0] = x * t; out[1] = y * t; out[2] = z * t; out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w); return out; } /** * Calculate the scalar power of a unit quaternion. * * @param {quat} out the receiving quaternion * @param {ReadonlyQuat} a quat to calculate the exponential of * @param {Number} b amount to scale the quaternion by * @returns {quat} out */ function pow(out, a, b) { ln(out, a); scale(out, out, b); exp(out, out); return out; } /** * Performs a spherical linear interpolation between two quat * * @param {quat} out the receiving quaternion * @param {ReadonlyQuat} a the first operand * @param {ReadonlyQuat} b the second operand * @param {Number} t interpolation amount, in the range [0-1], between the two inputs * @returns {quat} out */ function slerp(out, a, b, t) { // benchmarks: // http://jsperf.com/quaternion-slerp-implementations var ax = a[0], ay = a[1], az = a[2], aw = a[3]; var bx = b[0], by = b[1], bz = b[2], bw = b[3]; var omega, cosom, sinom, scale0, scale1; // calc cosine cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary) if (cosom < 0.0) { cosom = -cosom; bx = -bx; by = -by; bz = -bz; bw = -bw; } // calculate coefficients if (1.0 - cosom > _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON) { // standard case (slerp) omega = Math.acos(cosom); sinom = Math.sin(omega); scale0 = Math.sin((1.0 - t) * omega) / sinom; scale1 = Math.sin(t * omega) / sinom; } else { // "from" and "to" quaternions are very close // ... so we can do a linear interpolation scale0 = 1.0 - t; scale1 = t; } // calculate final values out[0] = scale0 * ax + scale1 * bx; out[1] = scale0 * ay + scale1 * by; out[2] = scale0 * az + scale1 * bz; out[3] = scale0 * aw + scale1 * bw; return out; } /** * Generates a random unit quaternion * * @param {quat} out the receiving quaternion * @returns {quat} out */ function random(out) { // Implementation of http://planning.cs.uiuc.edu/node198.html // TODO: Calling random 3 times is probably not the fastest solution var u1 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); var u2 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); var u3 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM(); var sqrt1MinusU1 = Math.sqrt(1 - u1); var sqrtU1 = Math.sqrt(u1); out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2); out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2); out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3); out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3); return out; } /** * Calculates the inverse of a quat * * @param {quat} out the receiving quaternion * @param {ReadonlyQuat} a quat to calculate inverse of * @returns {quat} out */ function invert(out, a) { var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3]; var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3; var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0 out[0] = -a0 * invDot; out[1] = -a1 * invDot; out[2] = -a2 * invDot; out[3] = a3 * invDot; return out; } /** * Calculates the conjugate of a quat * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result. * * @param {quat} out the receiving quaternion * @param {ReadonlyQuat} a quat to calculate conjugate of * @returns {quat} out */ function conjugate(out, a) { out[0] = -a[0]; out[1] = -a[1]; out[2] = -a[2]; out[3] = a[3]; return out; } /** * Creates a quaternion from the given 3x3 rotation matrix. * * NOTE: The resultant quaternion is not normalized, so you should be sure * to renormalize the quaternion yourself where necessary. * * @param {quat} out the receiving quaternion * @param {ReadonlyMat3} m rotation matrix * @returns {quat} out * @function */ function fromMat3(out, m) { // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes // article "Quaternion Calculus and Fast Animation". var fTrace = m[0] + m[4] + m[8]; var fRoot; if (fTrace > 0.0) { // |w| > 1/2, may as well choose w > 1/2 fRoot = Math.sqrt(fTrace + 1.0); // 2w out[3] = 0.5 * fRoot; fRoot = 0.5 / fRoot; // 1/(4w) out[0] = (m[5] - m[7]) * fRoot; out[1] = (m[6] - m[2]) * fRoot; out[2] = (m[1] - m[3]) * fRoot; } else { // |w| <= 1/2 var i = 0; if (m[4] > m[0]) i = 1; if (m[8] > m[i * 3 + i]) i = 2; var j = (i + 1) % 3; var k = (i + 2) % 3; fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0); out[i] = 0.5 * fRoot; fRoot = 0.5 / fRoot; out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot; out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot; out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot; } return out; } /** * Creates a quaternion from the given euler angle x, y, z. * * @param {quat} out the receiving quaternion * @param {x} Angle to rotate around X axis in degrees. * @param {y} Angle to rotate around Y axis in degrees. * @param {z} Angle to rotate around Z axis in degrees. * @returns {quat} out * @function */ function fromEuler(out, x, y, z) { var halfToRad = 0.5 * Math.PI / 180.0; x *= halfToRad; y *= halfToRad; z *= halfToRad; var sx = Math.sin(x); var cx = Math.cos(x); var sy = Math.sin(y); var cy = Math.cos(y); var sz = Math.sin(z); var cz = Math.cos(z); out[0] = sx * cy * cz - cx * sy * sz; out[1] = cx * sy * cz + sx * cy * sz; out[2] = cx * cy * sz - sx * sy * cz; out[3] = cx * cy * cz + sx * sy * sz; return out; } /** * Returns a string representation of a quatenion * * @param {ReadonlyQuat} a vector to represent as a string * @returns {String} string representation of the vector */ function str(a) { return "quat(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; } /** * Creates a new quat initialized with values from an existing quaternion * * @param {ReadonlyQuat} a quaternion to clone * @returns {quat} a new quaternion * @function */ var clone = _vec4_js__WEBPACK_IMPORTED_MODULE_3__.clone; /** * Creates a new quat initialized with the given values * * @param {Number} x X component * @param {Number} y Y component * @param {Number} z Z component * @param {Number} w W component * @returns {quat} a new quaternion * @function */ var fromValues = _vec4_js__WEBPACK_IMPORTED_MODULE_3__.fromValues; /** * Copy the values from one quat to another * * @param {quat} out the receiving quaternion * @param {ReadonlyQuat} a the source quaternion * @returns {quat} out * @function */ var copy = _vec4_js__WEBPACK_IMPORTED_MODULE_3__.copy; /** * Set the components of a quat to the given values * * @param {quat} out the receiving quaternion * @param {Number} x X component * @param {Number} y Y component * @param {Number} z Z component * @param {Number} w W component * @returns {quat} out * @function */ var set = _vec4_js__WEBPACK_IMPORTED_MODULE_3__.set; /** * Adds two quat's * * @param {quat} out the receiving quaternion * @param {ReadonlyQuat} a the first operand * @param {ReadonlyQuat} b the second operand * @returns {quat} out * @function */ var add = _vec4_js__WEBPACK_IMPORTED_MODULE_3__.add; /** * Alias for {@link quat.multiply} * @function */ var mul = multiply; /** * Scales a quat by a scalar number * * @param {quat} out the receiving vector * @param {ReadonlyQuat} a the vector to scale * @param {Number} b amount to scale the vector by * @returns {quat} out * @function */ var scale = _vec4_js__WEBPACK_IMPORTED_MODULE_3__.scale; /** * Calculates the dot product of two quat's * * @param {ReadonlyQuat} a the first operand * @param {ReadonlyQuat} b the second operand * @returns {Number} dot product of a and b * @function */ var dot = _vec4_js__WEBPACK_IMPORTED_MODULE_3__.dot; /** * Performs a linear interpolation between two quat's * * @param {quat} out the receiving quaternion * @param {ReadonlyQuat} a the first operand * @param {ReadonlyQuat} b the second operand * @param {Number} t interpolation amount, in the range [0-1], between the two inputs * @returns {quat} out * @function */ var lerp = _vec4_js__WEBPACK_IMPORTED_MODULE_3__.lerp; /** * Calculates the length of a quat * * @param {ReadonlyQuat} a vector to calculate length of * @returns {Number} length of a */ var length = _vec4_js__WEBPACK_IMPORTED_MODULE_3__.length; /** * Alias for {@link quat.length} * @function */ var len = length; /** * Calculates the squared length of a quat * * @param {ReadonlyQuat} a vector to calculate squared length of * @returns {Number} squared length of a * @function */ var squaredLength = _vec4_js__WEBPACK_IMPORTED_MODULE_3__.squaredLength; /** * Alias for {@link quat.squaredLength} * @function */ var sqrLen = squaredLength; /** * Normalize a quat * * @param {quat} out the receiving quaternion * @param {ReadonlyQuat} a quaternion to normalize * @returns {quat} out * @function */ var normalize = _vec4_js__WEBPACK_IMPORTED_MODULE_3__.normalize; /** * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===) * * @param {ReadonlyQuat} a The first quaternion. * @param {ReadonlyQuat} b The second quaternion. * @returns {Boolean} True if the vectors are equal, false otherwise. */ var exactEquals = _vec4_js__WEBPACK_IMPORTED_MODULE_3__.exactEquals; /** * Returns whether or not the quaternions have approximately the same elements in the same position. * * @param {ReadonlyQuat} a The first vector. * @param {ReadonlyQuat} b The second vector. * @returns {Boolean} True if the vectors are equal, false otherwise. */ var equals = _vec4_js__WEBPACK_IMPORTED_MODULE_3__.equals; /** * Sets a quaternion to represent the shortest rotation from one * vector to another. * * Both vectors are assumed to be unit length. * * @param {quat} out the receiving quaternion. * @param {ReadonlyVec3} a the initial vector * @param {ReadonlyVec3} b the destination vector * @returns {quat} out */ var rotationTo = function () { var tmpvec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.create(); var xUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.fromValues(1, 0, 0); var yUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.fromValues(0, 1, 0); return function (out, a, b) { var dot = _vec3_js__WEBPACK_IMPORTED_MODULE_2__.dot(a, b); if (dot < -0.999999) { _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, xUnitVec3, a); if (_vec3_js__WEBPACK_IMPORTED_MODULE_2__.len(tmpvec3) < 0.000001) _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, yUnitVec3, a); _vec3_js__WEBPACK_IMPORTED_MODULE_2__.normalize(tmpvec3, tmpvec3); setAxisAngle(out, tmpvec3, Math.PI); return out; } else if (dot > 0.999999) { out[0] = 0; out[1] = 0; out[2] = 0; out[3] = 1; return out; } else { _vec3_js__WEBPACK_IMPORTED_MODULE_2__.cross(tmpvec3, a, b); out[0] = tmpvec3[0]; out[1] = tmpvec3[1]; out[2] = tmpvec3[2]; out[3] = 1 + dot; return normalize(out, out); } }; }(); /** * Performs a spherical linear interpolation with two control points * * @param {quat} out the receiving quaternion * @param {ReadonlyQuat} a the first operand * @param {ReadonlyQuat} b the second operand * @param {ReadonlyQuat} c the third operand * @param {ReadonlyQuat} d the fourth operand * @param {Number} t interpolation amount, in the range [0-1], between the two inputs * @returns {quat} out */ var sqlerp = function () { var temp1 = create(); var temp2 = create(); return function (out, a, b, c, d, t) { slerp(temp1, a, d, t); slerp(temp2, b, c, t); slerp(out, temp1, temp2, 2 * t * (1 - t)); return out; }; }(); /** * Sets the specified quaternion with values corresponding to the given * axes. Each axis is a vec3 and is expected to be unit length and * perpendicular to all other specified axes. * * @param {ReadonlyVec3} view the vector representing the viewing direction * @param {ReadonlyVec3} right the vector representing the local "right" direction * @param {ReadonlyVec3} up the vector representing the local "up" direction * @returns {quat} out */ var setAxes = function () { var matr = _mat3_js__WEBPACK_IMPORTED_MODULE_1__.create(); return function (out, view, right, up) { matr[0] = right[0]; matr[3] = right[1]; matr[6] = right[2]; matr[1] = up[0]; matr[4] = up[1]; matr[7] = up[2]; matr[2] = -view[0]; matr[5] = -view[1]; matr[8] = -view[2]; return normalize(out, fromMat3(out, matr)); }; }(); /***/ }, /***/ 93067 /*!********************************************!*\ !*** ./node_modules/gl-matrix/esm/vec2.js ***! \********************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ add: () => (/* binding */ add), /* harmony export */ angle: () => (/* binding */ angle), /* harmony export */ ceil: () => (/* binding */ ceil), /* harmony export */ clone: () => (/* binding */ clone), /* harmony export */ copy: () => (/* binding */ copy), /* harmony export */ create: () => (/* binding */ create), /* harmony export */ cross: () => (/* binding */ cross), /* harmony export */ dist: () => (/* binding */ dist), /* harmony export */ distance: () => (/* binding */ distance), /* harmony export */ div: () => (/* binding */ div), /* harmony export */ divide: () => (/* binding */ divide), /* harmony export */ dot: () => (/* binding */ dot), /* harmony export */ equals: () => (/* binding */ equals), /* harmony export */ exactEquals: () => (/* binding */ exactEquals), /* harmony export */ floor: () => (/* binding */ floor), /* harmony export */ forEach: () => (/* binding */ forEach), /* harmony export */ fromValues: () => (/* binding */ fromValues), /* harmony export */ inverse: () => (/* binding */ inverse), /* harmony export */ len: () => (/* binding */ len), /* harmony export */ length: () => (/* binding */ length), /* harmony export */ lerp: () => (/* binding */ lerp), /* harmony export */ max: () => (/* binding */ max), /* harmony export */ min: () => (/* binding */ min), /* harmony export */ mul: () => (/* binding */ mul), /* harmony export */ multiply: () => (/* binding */ multiply), /* harmony export */ negate: () => (/* binding */ negate), /* harmony export */ normalize: () => (/* binding */ normalize), /* harmony export */ random: () => (/* binding */ random), /* harmony export */ rotate: () => (/* binding */ rotate), /* harmony export */ round: () => (/* binding */ round), /* harmony export */ scale: () => (/* binding */ scale), /* harmony export */ scaleAndAdd: () => (/* binding */ scaleAndAdd), /* harmony export */ set: () => (/* binding */ set), /* harmony export */ sqrDist: () => (/* binding */ sqrDist), /* harmony export */ sqrLen: () => (/* binding */ sqrLen), /* harmony export */ squaredDistance: () => (/* binding */ squaredDistance), /* harmony export */ squaredLength: () => (/* binding */ squaredLength), /* harmony export */ str: () => (/* binding */ str), /* harmony export */ sub: () => (/* binding */ sub), /* harmony export */ subtract: () => (/* binding */ subtract), /* harmony export */ transformMat2: () => (/* binding */ transformMat2), /* harmony export */ transformMat2d: () => (/* binding */ transformMat2d), /* harmony export */ transformMat3: () => (/* binding */ transformMat3), /* harmony export */ transformMat4: () => (/* binding */ transformMat4), /* harmony export */ zero: () => (/* binding */ zero) /* harmony export */ }); /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ 27182); /** * 2 Dimensional Vector * @module vec2 */ /** * Creates a new, empty vec2 * * @returns {vec2} a new 2D vector */ function create() { var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { out[0] = 0; out[1] = 0; } return out; } /** * Creates a new vec2 initialized with values from an existing vector * * @param {ReadonlyVec2} a vector to clone * @returns {vec2} a new 2D vector */ function clone(a) { var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); out[0] = a[0]; out[1] = a[1]; return out; } /** * Creates a new vec2 initialized with the given values * * @param {Number} x X component * @param {Number} y Y component * @returns {vec2} a new 2D vector */ function fromValues(x, y) { var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(2); out[0] = x; out[1] = y; return out; } /** * Copy the values from one vec2 to another * * @param {vec2} out the receiving vector * @param {ReadonlyVec2} a the source vector * @returns {vec2} out */ function copy(out, a) { out[0] = a[0]; out[1] = a[1]; return out; } /** * Set the components of a vec2 to the given values * * @param {vec2} out the receiving vector * @param {Number} x X component * @param {Number} y Y component * @returns {vec2} out */ function set(out, x, y) { out[0] = x; out[1] = y; return out; } /** * Adds two vec2's * * @param {vec2} out the receiving vector * @param {ReadonlyVec2} a the first operand * @param {ReadonlyVec2} b the second operand * @returns {vec2} out */ function add(out, a, b) { out[0] = a[0] + b[0]; out[1] = a[1] + b[1]; return out; } /** * Subtracts vector b from vector a * * @param {vec2} out the receiving vector * @param {ReadonlyVec2} a the first operand * @param {ReadonlyVec2} b the second operand * @returns {vec2} out */ function subtract(out, a, b) { out[0] = a[0] - b[0]; out[1] = a[1] - b[1]; return out; } /** * Multiplies two vec2's * * @param {vec2} out the receiving vector * @param {ReadonlyVec2} a the first operand * @param {ReadonlyVec2} b the second operand * @returns {vec2} out */ function multiply(out, a, b) { out[0] = a[0] * b[0]; out[1] = a[1] * b[1]; return out; } /** * Divides two vec2's * * @param {vec2} out the receiving vector * @param {ReadonlyVec2} a the first operand * @param {ReadonlyVec2} b the second operand * @returns {vec2} out */ function divide(out, a, b) { out[0] = a[0] / b[0]; out[1] = a[1] / b[1]; return out; } /** * Math.ceil the components of a vec2 * * @param {vec2} out the receiving vector * @param {ReadonlyVec2} a vector to ceil * @returns {vec2} out */ function ceil(out, a) { out[0] = Math.ceil(a[0]); out[1] = Math.ceil(a[1]); return out; } /** * Math.floor the components of a vec2 * * @param {vec2} out the receiving vector * @param {ReadonlyVec2} a vector to floor * @returns {vec2} out */ function floor(out, a) { out[0] = Math.floor(a[0]); out[1] = Math.floor(a[1]); return out; } /** * Returns the minimum of two vec2's * * @param {vec2} out the receiving vector * @param {ReadonlyVec2} a the first operand * @param {ReadonlyVec2} b the second operand * @returns {vec2} out */ function min(out, a, b) { out[0] = Math.min(a[0], b[0]); out[1] = Math.min(a[1], b[1]); return out; } /** * Returns the maximum of two vec2's * * @param {vec2} out the receiving vector * @param {ReadonlyVec2} a the first operand * @param {ReadonlyVec2} b the second operand * @returns {vec2} out */ function max(out, a, b) { out[0] = Math.max(a[0], b[0]); out[1] = Math.max(a[1], b[1]); return out; } /** * Math.round the components of a vec2 * * @param {vec2} out the receiving vector * @param {ReadonlyVec2} a vector to round * @returns {vec2} out */ function round(out, a) { out[0] = Math.round(a[0]); out[1] = Math.round(a[1]); return out; } /** * Scales a vec2 by a scalar number * * @param {vec2} out the receiving vector * @param {ReadonlyVec2} a the vector to scale * @param {Number} b amount to scale the vector by * @returns {vec2} out */ function scale(out, a, b) { out[0] = a[0] * b; out[1] = a[1] * b; return out; } /** * Adds two vec2's after scaling the second operand by a scalar value * * @param {vec2} out the receiving vector * @param {ReadonlyVec2} a the first operand * @param {ReadonlyVec2} b the second operand * @param {Number} scale the amount to scale b by before adding * @returns {vec2} out */ function scaleAndAdd(out, a, b, scale) { out[0] = a[0] + b[0] * scale; out[1] = a[1] + b[1] * scale; return out; } /** * Calculates the euclidian distance between two vec2's * * @param {ReadonlyVec2} a the first operand * @param {ReadonlyVec2} b the second operand * @returns {Number} distance between a and b */ function distance(a, b) { var x = b[0] - a[0], y = b[1] - a[1]; return Math.hypot(x, y); } /** * Calculates the squared euclidian distance between two vec2's * * @param {ReadonlyVec2} a the first operand * @param {ReadonlyVec2} b the second operand * @returns {Number} squared distance between a and b */ function squaredDistance(a, b) { var x = b[0] - a[0], y = b[1] - a[1]; return x * x + y * y; } /** * Calculates the length of a vec2 * * @param {ReadonlyVec2} a vector to calculate length of * @returns {Number} length of a */ function length(a) { var x = a[0], y = a[1]; return Math.hypot(x, y); } /** * Calculates the squared length of a vec2 * * @param {ReadonlyVec2} a vector to calculate squared length of * @returns {Number} squared length of a */ function squaredLength(a) { var x = a[0], y = a[1]; return x * x + y * y; } /** * Negates the components of a vec2 * * @param {vec2} out the receiving vector * @param {ReadonlyVec2} a vector to negate * @returns {vec2} out */ function negate(out, a) { out[0] = -a[0]; out[1] = -a[1]; return out; } /** * Returns the inverse of the components of a vec2 * * @param {vec2} out the receiving vector * @param {ReadonlyVec2} a vector to invert * @returns {vec2} out */ function inverse(out, a) { out[0] = 1.0 / a[0]; out[1] = 1.0 / a[1]; return out; } /** * Normalize a vec2 * * @param {vec2} out the receiving vector * @param {ReadonlyVec2} a vector to normalize * @returns {vec2} out */ function normalize(out, a) { var x = a[0], y = a[1]; var len = x * x + y * y; if (len > 0) { //TODO: evaluate use of glm_invsqrt here? len = 1 / Math.sqrt(len); } out[0] = a[0] * len; out[1] = a[1] * len; return out; } /** * Calculates the dot product of two vec2's * * @param {ReadonlyVec2} a the first operand * @param {ReadonlyVec2} b the second operand * @returns {Number} dot product of a and b */ function dot(a, b) { return a[0] * b[0] + a[1] * b[1]; } /** * Computes the cross product of two vec2's * Note that the cross product must by definition produce a 3D vector * * @param {vec3} out the receiving vector * @param {ReadonlyVec2} a the first operand * @param {ReadonlyVec2} b the second operand * @returns {vec3} out */ function cross(out, a, b) { var z = a[0] * b[1] - a[1] * b[0]; out[0] = out[1] = 0; out[2] = z; return out; } /** * Performs a linear interpolation between two vec2's * * @param {vec2} out the receiving vector * @param {ReadonlyVec2} a the first operand * @param {ReadonlyVec2} b the second operand * @param {Number} t interpolation amount, in the range [0-1], between the two inputs * @returns {vec2} out */ function lerp(out, a, b, t) { var ax = a[0], ay = a[1]; out[0] = ax + t * (b[0] - ax); out[1] = ay + t * (b[1] - ay); return out; } /** * Generates a random vector with the given scale * * @param {vec2} out the receiving vector * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned * @returns {vec2} out */ function random(out, scale) { scale = scale || 1.0; var r = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 * Math.PI; out[0] = Math.cos(r) * scale; out[1] = Math.sin(r) * scale; return out; } /** * Transforms the vec2 with a mat2 * * @param {vec2} out the receiving vector * @param {ReadonlyVec2} a the vector to transform * @param {ReadonlyMat2} m matrix to transform with * @returns {vec2} out */ function transformMat2(out, a, m) { var x = a[0], y = a[1]; out[0] = m[0] * x + m[2] * y; out[1] = m[1] * x + m[3] * y; return out; } /** * Transforms the vec2 with a mat2d * * @param {vec2} out the receiving vector * @param {ReadonlyVec2} a the vector to transform * @param {ReadonlyMat2d} m matrix to transform with * @returns {vec2} out */ function transformMat2d(out, a, m) { var x = a[0], y = a[1]; out[0] = m[0] * x + m[2] * y + m[4]; out[1] = m[1] * x + m[3] * y + m[5]; return out; } /** * Transforms the vec2 with a mat3 * 3rd vector component is implicitly '1' * * @param {vec2} out the receiving vector * @param {ReadonlyVec2} a the vector to transform * @param {ReadonlyMat3} m matrix to transform with * @returns {vec2} out */ function transformMat3(out, a, m) { var x = a[0], y = a[1]; out[0] = m[0] * x + m[3] * y + m[6]; out[1] = m[1] * x + m[4] * y + m[7]; return out; } /** * Transforms the vec2 with a mat4 * 3rd vector component is implicitly '0' * 4th vector component is implicitly '1' * * @param {vec2} out the receiving vector * @param {ReadonlyVec2} a the vector to transform * @param {ReadonlyMat4} m matrix to transform with * @returns {vec2} out */ function transformMat4(out, a, m) { var x = a[0]; var y = a[1]; out[0] = m[0] * x + m[4] * y + m[12]; out[1] = m[1] * x + m[5] * y + m[13]; return out; } /** * Rotate a 2D vector * @param {vec2} out The receiving vec2 * @param {ReadonlyVec2} a The vec2 point to rotate * @param {ReadonlyVec2} b The origin of the rotation * @param {Number} rad The angle of rotation in radians * @returns {vec2} out */ function rotate(out, a, b, rad) { //Translate point to the origin var p0 = a[0] - b[0], p1 = a[1] - b[1], sinC = Math.sin(rad), cosC = Math.cos(rad); //perform rotation and translate to correct position out[0] = p0 * cosC - p1 * sinC + b[0]; out[1] = p0 * sinC + p1 * cosC + b[1]; return out; } /** * Get the angle between two 2D vectors * @param {ReadonlyVec2} a The first operand * @param {ReadonlyVec2} b The second operand * @returns {Number} The angle in radians */ function angle(a, b) { var x1 = a[0], y1 = a[1], x2 = b[0], y2 = b[1], // mag is the product of the magnitudes of a and b mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2), // mag &&.. short circuits if mag == 0 cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1 return Math.acos(Math.min(Math.max(cosine, -1), 1)); } /** * Set the components of a vec2 to zero * * @param {vec2} out the receiving vector * @returns {vec2} out */ function zero(out) { out[0] = 0.0; out[1] = 0.0; return out; } /** * Returns a string representation of a vector * * @param {ReadonlyVec2} a vector to represent as a string * @returns {String} string representation of the vector */ function str(a) { return "vec2(" + a[0] + ", " + a[1] + ")"; } /** * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===) * * @param {ReadonlyVec2} a The first vector. * @param {ReadonlyVec2} b The second vector. * @returns {Boolean} True if the vectors are equal, false otherwise. */ function exactEquals(a, b) { return a[0] === b[0] && a[1] === b[1]; } /** * Returns whether or not the vectors have approximately the same elements in the same position. * * @param {ReadonlyVec2} a The first vector. * @param {ReadonlyVec2} b The second vector. * @returns {Boolean} True if the vectors are equal, false otherwise. */ function equals(a, b) { var a0 = a[0], a1 = a[1]; var b0 = b[0], b1 = b[1]; return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)); } /** * Alias for {@link vec2.length} * @function */ var len = length; /** * Alias for {@link vec2.subtract} * @function */ var sub = subtract; /** * Alias for {@link vec2.multiply} * @function */ var mul = multiply; /** * Alias for {@link vec2.divide} * @function */ var div = divide; /** * Alias for {@link vec2.distance} * @function */ var dist = distance; /** * Alias for {@link vec2.squaredDistance} * @function */ var sqrDist = squaredDistance; /** * Alias for {@link vec2.squaredLength} * @function */ var sqrLen = squaredLength; /** * Perform some operation over an array of vec2s. * * @param {Array} a the array of vectors to iterate over * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed * @param {Number} offset Number of elements to skip at the beginning of the array * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array * @param {Function} fn Function to call for each vector in the array * @param {Object} [arg] additional argument to pass to fn * @returns {Array} a * @function */ var forEach = function () { var vec = create(); return function (a, stride, offset, count, fn, arg) { var i, l; if (!stride) { stride = 2; } if (!offset) { offset = 0; } if (count) { l = Math.min(count * stride + offset, a.length); } else { l = a.length; } for (i = offset; i < l; i += stride) { vec[0] = a[i]; vec[1] = a[i + 1]; fn(vec, vec, arg); a[i] = vec[0]; a[i + 1] = vec[1]; } return a; }; }(); /***/ }, /***/ 87396 /*!********************************************!*\ !*** ./node_modules/gl-matrix/esm/vec3.js ***! \********************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ add: () => (/* binding */ add), /* harmony export */ angle: () => (/* binding */ angle), /* harmony export */ bezier: () => (/* binding */ bezier), /* harmony export */ ceil: () => (/* binding */ ceil), /* harmony export */ clone: () => (/* binding */ clone), /* harmony export */ copy: () => (/* binding */ copy), /* harmony export */ create: () => (/* binding */ create), /* harmony export */ cross: () => (/* binding */ cross), /* harmony export */ dist: () => (/* binding */ dist), /* harmony export */ distance: () => (/* binding */ distance), /* harmony export */ div: () => (/* binding */ div), /* harmony export */ divide: () => (/* binding */ divide), /* harmony export */ dot: () => (/* binding */ dot), /* harmony export */ equals: () => (/* binding */ equals), /* harmony export */ exactEquals: () => (/* binding */ exactEquals), /* harmony export */ floor: () => (/* binding */ floor), /* harmony export */ forEach: () => (/* binding */ forEach), /* harmony export */ fromValues: () => (/* binding */ fromValues), /* harmony export */ hermite: () => (/* binding */ hermite), /* harmony export */ inverse: () => (/* binding */ inverse), /* harmony export */ len: () => (/* binding */ len), /* harmony export */ length: () => (/* binding */ length), /* harmony export */ lerp: () => (/* binding */ lerp), /* harmony export */ max: () => (/* binding */ max), /* harmony export */ min: () => (/* binding */ min), /* harmony export */ mul: () => (/* binding */ mul), /* harmony export */ multiply: () => (/* binding */ multiply), /* harmony export */ negate: () => (/* binding */ negate), /* harmony export */ normalize: () => (/* binding */ normalize), /* harmony export */ random: () => (/* binding */ random), /* harmony export */ rotateX: () => (/* binding */ rotateX), /* harmony export */ rotateY: () => (/* binding */ rotateY), /* harmony export */ rotateZ: () => (/* binding */ rotateZ), /* harmony export */ round: () => (/* binding */ round), /* harmony export */ scale: () => (/* binding */ scale), /* harmony export */ scaleAndAdd: () => (/* binding */ scaleAndAdd), /* harmony export */ set: () => (/* binding */ set), /* harmony export */ sqrDist: () => (/* binding */ sqrDist), /* harmony export */ sqrLen: () => (/* binding */ sqrLen), /* harmony export */ squaredDistance: () => (/* binding */ squaredDistance), /* harmony export */ squaredLength: () => (/* binding */ squaredLength), /* harmony export */ str: () => (/* binding */ str), /* harmony export */ sub: () => (/* binding */ sub), /* harmony export */ subtract: () => (/* binding */ subtract), /* harmony export */ transformMat3: () => (/* binding */ transformMat3), /* harmony export */ transformMat4: () => (/* binding */ transformMat4), /* harmony export */ transformQuat: () => (/* binding */ transformQuat), /* harmony export */ zero: () => (/* binding */ zero) /* harmony export */ }); /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ 27182); /** * 3 Dimensional Vector * @module vec3 */ /** * Creates a new, empty vec3 * * @returns {vec3} a new 3D vector */ function create() { var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { out[0] = 0; out[1] = 0; out[2] = 0; } return out; } /** * Creates a new vec3 initialized with values from an existing vector * * @param {ReadonlyVec3} a vector to clone * @returns {vec3} a new 3D vector */ function clone(a) { var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; return out; } /** * Calculates the length of a vec3 * * @param {ReadonlyVec3} a vector to calculate length of * @returns {Number} length of a */ function length(a) { var x = a[0]; var y = a[1]; var z = a[2]; return Math.hypot(x, y, z); } /** * Creates a new vec3 initialized with the given values * * @param {Number} x X component * @param {Number} y Y component * @param {Number} z Z component * @returns {vec3} a new 3D vector */ function fromValues(x, y, z) { var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(3); out[0] = x; out[1] = y; out[2] = z; return out; } /** * Copy the values from one vec3 to another * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a the source vector * @returns {vec3} out */ function copy(out, a) { out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; return out; } /** * Set the components of a vec3 to the given values * * @param {vec3} out the receiving vector * @param {Number} x X component * @param {Number} y Y component * @param {Number} z Z component * @returns {vec3} out */ function set(out, x, y, z) { out[0] = x; out[1] = y; out[2] = z; return out; } /** * Adds two vec3's * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a the first operand * @param {ReadonlyVec3} b the second operand * @returns {vec3} out */ function add(out, a, b) { out[0] = a[0] + b[0]; out[1] = a[1] + b[1]; out[2] = a[2] + b[2]; return out; } /** * Subtracts vector b from vector a * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a the first operand * @param {ReadonlyVec3} b the second operand * @returns {vec3} out */ function subtract(out, a, b) { out[0] = a[0] - b[0]; out[1] = a[1] - b[1]; out[2] = a[2] - b[2]; return out; } /** * Multiplies two vec3's * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a the first operand * @param {ReadonlyVec3} b the second operand * @returns {vec3} out */ function multiply(out, a, b) { out[0] = a[0] * b[0]; out[1] = a[1] * b[1]; out[2] = a[2] * b[2]; return out; } /** * Divides two vec3's * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a the first operand * @param {ReadonlyVec3} b the second operand * @returns {vec3} out */ function divide(out, a, b) { out[0] = a[0] / b[0]; out[1] = a[1] / b[1]; out[2] = a[2] / b[2]; return out; } /** * Math.ceil the components of a vec3 * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a vector to ceil * @returns {vec3} out */ function ceil(out, a) { out[0] = Math.ceil(a[0]); out[1] = Math.ceil(a[1]); out[2] = Math.ceil(a[2]); return out; } /** * Math.floor the components of a vec3 * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a vector to floor * @returns {vec3} out */ function floor(out, a) { out[0] = Math.floor(a[0]); out[1] = Math.floor(a[1]); out[2] = Math.floor(a[2]); return out; } /** * Returns the minimum of two vec3's * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a the first operand * @param {ReadonlyVec3} b the second operand * @returns {vec3} out */ function min(out, a, b) { out[0] = Math.min(a[0], b[0]); out[1] = Math.min(a[1], b[1]); out[2] = Math.min(a[2], b[2]); return out; } /** * Returns the maximum of two vec3's * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a the first operand * @param {ReadonlyVec3} b the second operand * @returns {vec3} out */ function max(out, a, b) { out[0] = Math.max(a[0], b[0]); out[1] = Math.max(a[1], b[1]); out[2] = Math.max(a[2], b[2]); return out; } /** * Math.round the components of a vec3 * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a vector to round * @returns {vec3} out */ function round(out, a) { out[0] = Math.round(a[0]); out[1] = Math.round(a[1]); out[2] = Math.round(a[2]); return out; } /** * Scales a vec3 by a scalar number * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a the vector to scale * @param {Number} b amount to scale the vector by * @returns {vec3} out */ function scale(out, a, b) { out[0] = a[0] * b; out[1] = a[1] * b; out[2] = a[2] * b; return out; } /** * Adds two vec3's after scaling the second operand by a scalar value * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a the first operand * @param {ReadonlyVec3} b the second operand * @param {Number} scale the amount to scale b by before adding * @returns {vec3} out */ function scaleAndAdd(out, a, b, scale) { out[0] = a[0] + b[0] * scale; out[1] = a[1] + b[1] * scale; out[2] = a[2] + b[2] * scale; return out; } /** * Calculates the euclidian distance between two vec3's * * @param {ReadonlyVec3} a the first operand * @param {ReadonlyVec3} b the second operand * @returns {Number} distance between a and b */ function distance(a, b) { var x = b[0] - a[0]; var y = b[1] - a[1]; var z = b[2] - a[2]; return Math.hypot(x, y, z); } /** * Calculates the squared euclidian distance between two vec3's * * @param {ReadonlyVec3} a the first operand * @param {ReadonlyVec3} b the second operand * @returns {Number} squared distance between a and b */ function squaredDistance(a, b) { var x = b[0] - a[0]; var y = b[1] - a[1]; var z = b[2] - a[2]; return x * x + y * y + z * z; } /** * Calculates the squared length of a vec3 * * @param {ReadonlyVec3} a vector to calculate squared length of * @returns {Number} squared length of a */ function squaredLength(a) { var x = a[0]; var y = a[1]; var z = a[2]; return x * x + y * y + z * z; } /** * Negates the components of a vec3 * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a vector to negate * @returns {vec3} out */ function negate(out, a) { out[0] = -a[0]; out[1] = -a[1]; out[2] = -a[2]; return out; } /** * Returns the inverse of the components of a vec3 * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a vector to invert * @returns {vec3} out */ function inverse(out, a) { out[0] = 1.0 / a[0]; out[1] = 1.0 / a[1]; out[2] = 1.0 / a[2]; return out; } /** * Normalize a vec3 * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a vector to normalize * @returns {vec3} out */ function normalize(out, a) { var x = a[0]; var y = a[1]; var z = a[2]; var len = x * x + y * y + z * z; if (len > 0) { //TODO: evaluate use of glm_invsqrt here? len = 1 / Math.sqrt(len); } out[0] = a[0] * len; out[1] = a[1] * len; out[2] = a[2] * len; return out; } /** * Calculates the dot product of two vec3's * * @param {ReadonlyVec3} a the first operand * @param {ReadonlyVec3} b the second operand * @returns {Number} dot product of a and b */ function dot(a, b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; } /** * Computes the cross product of two vec3's * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a the first operand * @param {ReadonlyVec3} b the second operand * @returns {vec3} out */ function cross(out, a, b) { var ax = a[0], ay = a[1], az = a[2]; var bx = b[0], by = b[1], bz = b[2]; out[0] = ay * bz - az * by; out[1] = az * bx - ax * bz; out[2] = ax * by - ay * bx; return out; } /** * Performs a linear interpolation between two vec3's * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a the first operand * @param {ReadonlyVec3} b the second operand * @param {Number} t interpolation amount, in the range [0-1], between the two inputs * @returns {vec3} out */ function lerp(out, a, b, t) { var ax = a[0]; var ay = a[1]; var az = a[2]; out[0] = ax + t * (b[0] - ax); out[1] = ay + t * (b[1] - ay); out[2] = az + t * (b[2] - az); return out; } /** * Performs a hermite interpolation with two control points * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a the first operand * @param {ReadonlyVec3} b the second operand * @param {ReadonlyVec3} c the third operand * @param {ReadonlyVec3} d the fourth operand * @param {Number} t interpolation amount, in the range [0-1], between the two inputs * @returns {vec3} out */ function hermite(out, a, b, c, d, t) { var factorTimes2 = t * t; var factor1 = factorTimes2 * (2 * t - 3) + 1; var factor2 = factorTimes2 * (t - 2) + t; var factor3 = factorTimes2 * (t - 1); var factor4 = factorTimes2 * (3 - 2 * t); out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; return out; } /** * Performs a bezier interpolation with two control points * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a the first operand * @param {ReadonlyVec3} b the second operand * @param {ReadonlyVec3} c the third operand * @param {ReadonlyVec3} d the fourth operand * @param {Number} t interpolation amount, in the range [0-1], between the two inputs * @returns {vec3} out */ function bezier(out, a, b, c, d, t) { var inverseFactor = 1 - t; var inverseFactorTimesTwo = inverseFactor * inverseFactor; var factorTimes2 = t * t; var factor1 = inverseFactorTimesTwo * inverseFactor; var factor2 = 3 * t * inverseFactorTimesTwo; var factor3 = 3 * factorTimes2 * inverseFactor; var factor4 = factorTimes2 * t; out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4; out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4; out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4; return out; } /** * Generates a random vector with the given scale * * @param {vec3} out the receiving vector * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned * @returns {vec3} out */ function random(out, scale) { scale = scale || 1.0; var r = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 * Math.PI; var z = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2.0 - 1.0; var zScale = Math.sqrt(1.0 - z * z) * scale; out[0] = Math.cos(r) * zScale; out[1] = Math.sin(r) * zScale; out[2] = z * scale; return out; } /** * Transforms the vec3 with a mat4. * 4th vector component is implicitly '1' * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a the vector to transform * @param {ReadonlyMat4} m matrix to transform with * @returns {vec3} out */ function transformMat4(out, a, m) { var x = a[0], y = a[1], z = a[2]; var w = m[3] * x + m[7] * y + m[11] * z + m[15]; w = w || 1.0; out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w; out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w; out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w; return out; } /** * Transforms the vec3 with a mat3. * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a the vector to transform * @param {ReadonlyMat3} m the 3x3 matrix to transform with * @returns {vec3} out */ function transformMat3(out, a, m) { var x = a[0], y = a[1], z = a[2]; out[0] = x * m[0] + y * m[3] + z * m[6]; out[1] = x * m[1] + y * m[4] + z * m[7]; out[2] = x * m[2] + y * m[5] + z * m[8]; return out; } /** * Transforms the vec3 with a quat * Can also be used for dual quaternions. (Multiply it with the real part) * * @param {vec3} out the receiving vector * @param {ReadonlyVec3} a the vector to transform * @param {ReadonlyQuat} q quaternion to transform with * @returns {vec3} out */ function transformQuat(out, a, q) { // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed var qx = q[0], qy = q[1], qz = q[2], qw = q[3]; var x = a[0], y = a[1], z = a[2]; // var qvec = [qx, qy, qz]; // var uv = vec3.cross([], qvec, a); var uvx = qy * z - qz * y, uvy = qz * x - qx * z, uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv); var uuvx = qy * uvz - qz * uvy, uuvy = qz * uvx - qx * uvz, uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w); var w2 = qw * 2; uvx *= w2; uvy *= w2; uvz *= w2; // vec3.scale(uuv, uuv, 2); uuvx *= 2; uuvy *= 2; uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv)); out[0] = x + uvx + uuvx; out[1] = y + uvy + uuvy; out[2] = z + uvz + uuvz; return out; } /** * Rotate a 3D vector around the x-axis * @param {vec3} out The receiving vec3 * @param {ReadonlyVec3} a The vec3 point to rotate * @param {ReadonlyVec3} b The origin of the rotation * @param {Number} rad The angle of rotation in radians * @returns {vec3} out */ function rotateX(out, a, b, rad) { var p = [], r = []; //Translate point to the origin p[0] = a[0] - b[0]; p[1] = a[1] - b[1]; p[2] = a[2] - b[2]; //perform rotation r[0] = p[0]; r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad); r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position out[0] = r[0] + b[0]; out[1] = r[1] + b[1]; out[2] = r[2] + b[2]; return out; } /** * Rotate a 3D vector around the y-axis * @param {vec3} out The receiving vec3 * @param {ReadonlyVec3} a The vec3 point to rotate * @param {ReadonlyVec3} b The origin of the rotation * @param {Number} rad The angle of rotation in radians * @returns {vec3} out */ function rotateY(out, a, b, rad) { var p = [], r = []; //Translate point to the origin p[0] = a[0] - b[0]; p[1] = a[1] - b[1]; p[2] = a[2] - b[2]; //perform rotation r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad); r[1] = p[1]; r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position out[0] = r[0] + b[0]; out[1] = r[1] + b[1]; out[2] = r[2] + b[2]; return out; } /** * Rotate a 3D vector around the z-axis * @param {vec3} out The receiving vec3 * @param {ReadonlyVec3} a The vec3 point to rotate * @param {ReadonlyVec3} b The origin of the rotation * @param {Number} rad The angle of rotation in radians * @returns {vec3} out */ function rotateZ(out, a, b, rad) { var p = [], r = []; //Translate point to the origin p[0] = a[0] - b[0]; p[1] = a[1] - b[1]; p[2] = a[2] - b[2]; //perform rotation r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad); r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad); r[2] = p[2]; //translate to correct position out[0] = r[0] + b[0]; out[1] = r[1] + b[1]; out[2] = r[2] + b[2]; return out; } /** * Get the angle between two 3D vectors * @param {ReadonlyVec3} a The first operand * @param {ReadonlyVec3} b The second operand * @returns {Number} The angle in radians */ function angle(a, b) { var ax = a[0], ay = a[1], az = a[2], bx = b[0], by = b[1], bz = b[2], mag1 = Math.sqrt(ax * ax + ay * ay + az * az), mag2 = Math.sqrt(bx * bx + by * by + bz * bz), mag = mag1 * mag2, cosine = mag && dot(a, b) / mag; return Math.acos(Math.min(Math.max(cosine, -1), 1)); } /** * Set the components of a vec3 to zero * * @param {vec3} out the receiving vector * @returns {vec3} out */ function zero(out) { out[0] = 0.0; out[1] = 0.0; out[2] = 0.0; return out; } /** * Returns a string representation of a vector * * @param {ReadonlyVec3} a vector to represent as a string * @returns {String} string representation of the vector */ function str(a) { return "vec3(" + a[0] + ", " + a[1] + ", " + a[2] + ")"; } /** * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) * * @param {ReadonlyVec3} a The first vector. * @param {ReadonlyVec3} b The second vector. * @returns {Boolean} True if the vectors are equal, false otherwise. */ function exactEquals(a, b) { return a[0] === b[0] && a[1] === b[1] && a[2] === b[2]; } /** * Returns whether or not the vectors have approximately the same elements in the same position. * * @param {ReadonlyVec3} a The first vector. * @param {ReadonlyVec3} b The second vector. * @returns {Boolean} True if the vectors are equal, false otherwise. */ function equals(a, b) { var a0 = a[0], a1 = a[1], a2 = a[2]; var b0 = b[0], b1 = b[1], b2 = b[2]; return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)); } /** * Alias for {@link vec3.subtract} * @function */ var sub = subtract; /** * Alias for {@link vec3.multiply} * @function */ var mul = multiply; /** * Alias for {@link vec3.divide} * @function */ var div = divide; /** * Alias for {@link vec3.distance} * @function */ var dist = distance; /** * Alias for {@link vec3.squaredDistance} * @function */ var sqrDist = squaredDistance; /** * Alias for {@link vec3.length} * @function */ var len = length; /** * Alias for {@link vec3.squaredLength} * @function */ var sqrLen = squaredLength; /** * Perform some operation over an array of vec3s. * * @param {Array} a the array of vectors to iterate over * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed * @param {Number} offset Number of elements to skip at the beginning of the array * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array * @param {Function} fn Function to call for each vector in the array * @param {Object} [arg] additional argument to pass to fn * @returns {Array} a * @function */ var forEach = function () { var vec = create(); return function (a, stride, offset, count, fn, arg) { var i, l; if (!stride) { stride = 3; } if (!offset) { offset = 0; } if (count) { l = Math.min(count * stride + offset, a.length); } else { l = a.length; } for (i = offset; i < l; i += stride) { vec[0] = a[i]; vec[1] = a[i + 1]; vec[2] = a[i + 2]; fn(vec, vec, arg); a[i] = vec[0]; a[i + 1] = vec[1]; a[i + 2] = vec[2]; } return a; }; }(); /***/ }, /***/ 17521 /*!********************************************!*\ !*** ./node_modules/gl-matrix/esm/vec4.js ***! \********************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ add: () => (/* binding */ add), /* harmony export */ ceil: () => (/* binding */ ceil), /* harmony export */ clone: () => (/* binding */ clone), /* harmony export */ copy: () => (/* binding */ copy), /* harmony export */ create: () => (/* binding */ create), /* harmony export */ cross: () => (/* binding */ cross), /* harmony export */ dist: () => (/* binding */ dist), /* harmony export */ distance: () => (/* binding */ distance), /* harmony export */ div: () => (/* binding */ div), /* harmony export */ divide: () => (/* binding */ divide), /* harmony export */ dot: () => (/* binding */ dot), /* harmony export */ equals: () => (/* binding */ equals), /* harmony export */ exactEquals: () => (/* binding */ exactEquals), /* harmony export */ floor: () => (/* binding */ floor), /* harmony export */ forEach: () => (/* binding */ forEach), /* harmony export */ fromValues: () => (/* binding */ fromValues), /* harmony export */ inverse: () => (/* binding */ inverse), /* harmony export */ len: () => (/* binding */ len), /* harmony export */ length: () => (/* binding */ length), /* harmony export */ lerp: () => (/* binding */ lerp), /* harmony export */ max: () => (/* binding */ max), /* harmony export */ min: () => (/* binding */ min), /* harmony export */ mul: () => (/* binding */ mul), /* harmony export */ multiply: () => (/* binding */ multiply), /* harmony export */ negate: () => (/* binding */ negate), /* harmony export */ normalize: () => (/* binding */ normalize), /* harmony export */ random: () => (/* binding */ random), /* harmony export */ round: () => (/* binding */ round), /* harmony export */ scale: () => (/* binding */ scale), /* harmony export */ scaleAndAdd: () => (/* binding */ scaleAndAdd), /* harmony export */ set: () => (/* binding */ set), /* harmony export */ sqrDist: () => (/* binding */ sqrDist), /* harmony export */ sqrLen: () => (/* binding */ sqrLen), /* harmony export */ squaredDistance: () => (/* binding */ squaredDistance), /* harmony export */ squaredLength: () => (/* binding */ squaredLength), /* harmony export */ str: () => (/* binding */ str), /* harmony export */ sub: () => (/* binding */ sub), /* harmony export */ subtract: () => (/* binding */ subtract), /* harmony export */ transformMat4: () => (/* binding */ transformMat4), /* harmony export */ transformQuat: () => (/* binding */ transformQuat), /* harmony export */ zero: () => (/* binding */ zero) /* harmony export */ }); /* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ 27182); /** * 4 Dimensional Vector * @module vec4 */ /** * Creates a new, empty vec4 * * @returns {vec4} a new 4D vector */ function create() { var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); if (_common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE != Float32Array) { out[0] = 0; out[1] = 0; out[2] = 0; out[3] = 0; } return out; } /** * Creates a new vec4 initialized with values from an existing vector * * @param {ReadonlyVec4} a vector to clone * @returns {vec4} a new 4D vector */ function clone(a) { var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; out[3] = a[3]; return out; } /** * Creates a new vec4 initialized with the given values * * @param {Number} x X component * @param {Number} y Y component * @param {Number} z Z component * @param {Number} w W component * @returns {vec4} a new 4D vector */ function fromValues(x, y, z, w) { var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__.ARRAY_TYPE(4); out[0] = x; out[1] = y; out[2] = z; out[3] = w; return out; } /** * Copy the values from one vec4 to another * * @param {vec4} out the receiving vector * @param {ReadonlyVec4} a the source vector * @returns {vec4} out */ function copy(out, a) { out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; out[3] = a[3]; return out; } /** * Set the components of a vec4 to the given values * * @param {vec4} out the receiving vector * @param {Number} x X component * @param {Number} y Y component * @param {Number} z Z component * @param {Number} w W component * @returns {vec4} out */ function set(out, x, y, z, w) { out[0] = x; out[1] = y; out[2] = z; out[3] = w; return out; } /** * Adds two vec4's * * @param {vec4} out the receiving vector * @param {ReadonlyVec4} a the first operand * @param {ReadonlyVec4} b the second operand * @returns {vec4} out */ function add(out, a, b) { out[0] = a[0] + b[0]; out[1] = a[1] + b[1]; out[2] = a[2] + b[2]; out[3] = a[3] + b[3]; return out; } /** * Subtracts vector b from vector a * * @param {vec4} out the receiving vector * @param {ReadonlyVec4} a the first operand * @param {ReadonlyVec4} b the second operand * @returns {vec4} out */ function subtract(out, a, b) { out[0] = a[0] - b[0]; out[1] = a[1] - b[1]; out[2] = a[2] - b[2]; out[3] = a[3] - b[3]; return out; } /** * Multiplies two vec4's * * @param {vec4} out the receiving vector * @param {ReadonlyVec4} a the first operand * @param {ReadonlyVec4} b the second operand * @returns {vec4} out */ function multiply(out, a, b) { out[0] = a[0] * b[0]; out[1] = a[1] * b[1]; out[2] = a[2] * b[2]; out[3] = a[3] * b[3]; return out; } /** * Divides two vec4's * * @param {vec4} out the receiving vector * @param {ReadonlyVec4} a the first operand * @param {ReadonlyVec4} b the second operand * @returns {vec4} out */ function divide(out, a, b) { out[0] = a[0] / b[0]; out[1] = a[1] / b[1]; out[2] = a[2] / b[2]; out[3] = a[3] / b[3]; return out; } /** * Math.ceil the components of a vec4 * * @param {vec4} out the receiving vector * @param {ReadonlyVec4} a vector to ceil * @returns {vec4} out */ function ceil(out, a) { out[0] = Math.ceil(a[0]); out[1] = Math.ceil(a[1]); out[2] = Math.ceil(a[2]); out[3] = Math.ceil(a[3]); return out; } /** * Math.floor the components of a vec4 * * @param {vec4} out the receiving vector * @param {ReadonlyVec4} a vector to floor * @returns {vec4} out */ function floor(out, a) { out[0] = Math.floor(a[0]); out[1] = Math.floor(a[1]); out[2] = Math.floor(a[2]); out[3] = Math.floor(a[3]); return out; } /** * Returns the minimum of two vec4's * * @param {vec4} out the receiving vector * @param {ReadonlyVec4} a the first operand * @param {ReadonlyVec4} b the second operand * @returns {vec4} out */ function min(out, a, b) { out[0] = Math.min(a[0], b[0]); out[1] = Math.min(a[1], b[1]); out[2] = Math.min(a[2], b[2]); out[3] = Math.min(a[3], b[3]); return out; } /** * Returns the maximum of two vec4's * * @param {vec4} out the receiving vector * @param {ReadonlyVec4} a the first operand * @param {ReadonlyVec4} b the second operand * @returns {vec4} out */ function max(out, a, b) { out[0] = Math.max(a[0], b[0]); out[1] = Math.max(a[1], b[1]); out[2] = Math.max(a[2], b[2]); out[3] = Math.max(a[3], b[3]); return out; } /** * Math.round the components of a vec4 * * @param {vec4} out the receiving vector * @param {ReadonlyVec4} a vector to round * @returns {vec4} out */ function round(out, a) { out[0] = Math.round(a[0]); out[1] = Math.round(a[1]); out[2] = Math.round(a[2]); out[3] = Math.round(a[3]); return out; } /** * Scales a vec4 by a scalar number * * @param {vec4} out the receiving vector * @param {ReadonlyVec4} a the vector to scale * @param {Number} b amount to scale the vector by * @returns {vec4} out */ function scale(out, a, b) { out[0] = a[0] * b; out[1] = a[1] * b; out[2] = a[2] * b; out[3] = a[3] * b; return out; } /** * Adds two vec4's after scaling the second operand by a scalar value * * @param {vec4} out the receiving vector * @param {ReadonlyVec4} a the first operand * @param {ReadonlyVec4} b the second operand * @param {Number} scale the amount to scale b by before adding * @returns {vec4} out */ function scaleAndAdd(out, a, b, scale) { out[0] = a[0] + b[0] * scale; out[1] = a[1] + b[1] * scale; out[2] = a[2] + b[2] * scale; out[3] = a[3] + b[3] * scale; return out; } /** * Calculates the euclidian distance between two vec4's * * @param {ReadonlyVec4} a the first operand * @param {ReadonlyVec4} b the second operand * @returns {Number} distance between a and b */ function distance(a, b) { var x = b[0] - a[0]; var y = b[1] - a[1]; var z = b[2] - a[2]; var w = b[3] - a[3]; return Math.hypot(x, y, z, w); } /** * Calculates the squared euclidian distance between two vec4's * * @param {ReadonlyVec4} a the first operand * @param {ReadonlyVec4} b the second operand * @returns {Number} squared distance between a and b */ function squaredDistance(a, b) { var x = b[0] - a[0]; var y = b[1] - a[1]; var z = b[2] - a[2]; var w = b[3] - a[3]; return x * x + y * y + z * z + w * w; } /** * Calculates the length of a vec4 * * @param {ReadonlyVec4} a vector to calculate length of * @returns {Number} length of a */ function length(a) { var x = a[0]; var y = a[1]; var z = a[2]; var w = a[3]; return Math.hypot(x, y, z, w); } /** * Calculates the squared length of a vec4 * * @param {ReadonlyVec4} a vector to calculate squared length of * @returns {Number} squared length of a */ function squaredLength(a) { var x = a[0]; var y = a[1]; var z = a[2]; var w = a[3]; return x * x + y * y + z * z + w * w; } /** * Negates the components of a vec4 * * @param {vec4} out the receiving vector * @param {ReadonlyVec4} a vector to negate * @returns {vec4} out */ function negate(out, a) { out[0] = -a[0]; out[1] = -a[1]; out[2] = -a[2]; out[3] = -a[3]; return out; } /** * Returns the inverse of the components of a vec4 * * @param {vec4} out the receiving vector * @param {ReadonlyVec4} a vector to invert * @returns {vec4} out */ function inverse(out, a) { out[0] = 1.0 / a[0]; out[1] = 1.0 / a[1]; out[2] = 1.0 / a[2]; out[3] = 1.0 / a[3]; return out; } /** * Normalize a vec4 * * @param {vec4} out the receiving vector * @param {ReadonlyVec4} a vector to normalize * @returns {vec4} out */ function normalize(out, a) { var x = a[0]; var y = a[1]; var z = a[2]; var w = a[3]; var len = x * x + y * y + z * z + w * w; if (len > 0) { len = 1 / Math.sqrt(len); } out[0] = x * len; out[1] = y * len; out[2] = z * len; out[3] = w * len; return out; } /** * Calculates the dot product of two vec4's * * @param {ReadonlyVec4} a the first operand * @param {ReadonlyVec4} b the second operand * @returns {Number} dot product of a and b */ function dot(a, b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3]; } /** * Returns the cross-product of three vectors in a 4-dimensional space * * @param {ReadonlyVec4} result the receiving vector * @param {ReadonlyVec4} U the first vector * @param {ReadonlyVec4} V the second vector * @param {ReadonlyVec4} W the third vector * @returns {vec4} result */ function cross(out, u, v, w) { var A = v[0] * w[1] - v[1] * w[0], B = v[0] * w[2] - v[2] * w[0], C = v[0] * w[3] - v[3] * w[0], D = v[1] * w[2] - v[2] * w[1], E = v[1] * w[3] - v[3] * w[1], F = v[2] * w[3] - v[3] * w[2]; var G = u[0]; var H = u[1]; var I = u[2]; var J = u[3]; out[0] = H * F - I * E + J * D; out[1] = -(G * F) + I * C - J * B; out[2] = G * E - H * C + J * A; out[3] = -(G * D) + H * B - I * A; return out; } /** * Performs a linear interpolation between two vec4's * * @param {vec4} out the receiving vector * @param {ReadonlyVec4} a the first operand * @param {ReadonlyVec4} b the second operand * @param {Number} t interpolation amount, in the range [0-1], between the two inputs * @returns {vec4} out */ function lerp(out, a, b, t) { var ax = a[0]; var ay = a[1]; var az = a[2]; var aw = a[3]; out[0] = ax + t * (b[0] - ax); out[1] = ay + t * (b[1] - ay); out[2] = az + t * (b[2] - az); out[3] = aw + t * (b[3] - aw); return out; } /** * Generates a random vector with the given scale * * @param {vec4} out the receiving vector * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned * @returns {vec4} out */ function random(out, scale) { scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646. // http://projecteuclid.org/euclid.aoms/1177692644; var v1, v2, v3, v4; var s1, s2; do { v1 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; v2 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; s1 = v1 * v1 + v2 * v2; } while (s1 >= 1); do { v3 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; v4 = _common_js__WEBPACK_IMPORTED_MODULE_0__.RANDOM() * 2 - 1; s2 = v3 * v3 + v4 * v4; } while (s2 >= 1); var d = Math.sqrt((1 - s1) / s2); out[0] = scale * v1; out[1] = scale * v2; out[2] = scale * v3 * d; out[3] = scale * v4 * d; return out; } /** * Transforms the vec4 with a mat4. * * @param {vec4} out the receiving vector * @param {ReadonlyVec4} a the vector to transform * @param {ReadonlyMat4} m matrix to transform with * @returns {vec4} out */ function transformMat4(out, a, m) { var x = a[0], y = a[1], z = a[2], w = a[3]; out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; return out; } /** * Transforms the vec4 with a quat * * @param {vec4} out the receiving vector * @param {ReadonlyVec4} a the vector to transform * @param {ReadonlyQuat} q quaternion to transform with * @returns {vec4} out */ function transformQuat(out, a, q) { var x = a[0], y = a[1], z = a[2]; var qx = q[0], qy = q[1], qz = q[2], qw = q[3]; // calculate quat * vec var ix = qw * x + qy * z - qz * y; var iy = qw * y + qz * x - qx * z; var iz = qw * z + qx * y - qy * x; var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy; out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz; out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx; out[3] = a[3]; return out; } /** * Set the components of a vec4 to zero * * @param {vec4} out the receiving vector * @returns {vec4} out */ function zero(out) { out[0] = 0.0; out[1] = 0.0; out[2] = 0.0; out[3] = 0.0; return out; } /** * Returns a string representation of a vector * * @param {ReadonlyVec4} a vector to represent as a string * @returns {String} string representation of the vector */ function str(a) { return "vec4(" + a[0] + ", " + a[1] + ", " + a[2] + ", " + a[3] + ")"; } /** * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===) * * @param {ReadonlyVec4} a The first vector. * @param {ReadonlyVec4} b The second vector. * @returns {Boolean} True if the vectors are equal, false otherwise. */ function exactEquals(a, b) { return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3]; } /** * Returns whether or not the vectors have approximately the same elements in the same position. * * @param {ReadonlyVec4} a The first vector. * @param {ReadonlyVec4} b The second vector. * @returns {Boolean} True if the vectors are equal, false otherwise. */ function equals(a, b) { var a0 = a[0], a1 = a[1], a2 = a[2], a3 = a[3]; var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3]; return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__.EPSILON * Math.max(1.0, Math.abs(a3), Math.abs(b3)); } /** * Alias for {@link vec4.subtract} * @function */ var sub = subtract; /** * Alias for {@link vec4.multiply} * @function */ var mul = multiply; /** * Alias for {@link vec4.divide} * @function */ var div = divide; /** * Alias for {@link vec4.distance} * @function */ var dist = distance; /** * Alias for {@link vec4.squaredDistance} * @function */ var sqrDist = squaredDistance; /** * Alias for {@link vec4.length} * @function */ var len = length; /** * Alias for {@link vec4.squaredLength} * @function */ var sqrLen = squaredLength; /** * Perform some operation over an array of vec4s. * * @param {Array} a the array of vectors to iterate over * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed * @param {Number} offset Number of elements to skip at the beginning of the array * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array * @param {Function} fn Function to call for each vector in the array * @param {Object} [arg] additional argument to pass to fn * @returns {Array} a * @function */ var forEach = function () { var vec = create(); return function (a, stride, offset, count, fn, arg) { var i, l; if (!stride) { stride = 4; } if (!offset) { offset = 0; } if (count) { l = Math.min(count * stride + offset, a.length); } else { l = a.length; } for (i = offset; i < l; i += stride) { vec[0] = a[i]; vec[1] = a[i + 1]; vec[2] = a[i + 2]; vec[3] = a[i + 3]; fn(vec, vec, arg); a[i] = vec[0]; a[i + 1] = vec[1]; a[i + 2] = vec[2]; a[i + 3] = vec[3]; } return a; }; }(); /***/ }, /***/ 31002 /*!*******************************************!*\ !*** ./node_modules/gl-quat/normalize.js ***! \*******************************************/ (module, __unused_webpack_exports, __webpack_require__) { /** * Normalize a quat * * @param {quat} out the receiving quaternion * @param {quat} a quaternion to normalize * @returns {quat} out * @function */ module.exports = __webpack_require__(/*! gl-vec4/normalize */ 16479); /***/ }, /***/ 48706 /*!********************************************!*\ !*** ./node_modules/gl-quat/rotationTo.js ***! \********************************************/ (module, __unused_webpack_exports, __webpack_require__) { var vecDot = __webpack_require__(/*! gl-vec3/dot */ 90778); var vecCross = __webpack_require__(/*! gl-vec3/cross */ 81741); var vecLength = __webpack_require__(/*! gl-vec3/length */ 83329); var vecNormalize = __webpack_require__(/*! gl-vec3/normalize */ 82986); var quatNormalize = __webpack_require__(/*! ./normalize */ 31002); var quatAxisAngle = __webpack_require__(/*! ./setAxisAngle */ 5009); module.exports = rotationTo; var tmpvec3 = [0, 0, 0]; var xUnitVec3 = [1, 0, 0]; var yUnitVec3 = [0, 1, 0]; /** * Sets a quaternion to represent the shortest rotation from one * vector to another. * * Both vectors are assumed to be unit length. * * @param {quat} out the receiving quaternion. * @param {vec3} a the initial vector * @param {vec3} b the destination vector * @returns {quat} out */ function rotationTo(out, a, b) { var dot = vecDot(a, b); if (dot < -0.999999) { vecCross(tmpvec3, xUnitVec3, a); if (vecLength(tmpvec3) < 0.000001) { vecCross(tmpvec3, yUnitVec3, a); } vecNormalize(tmpvec3, tmpvec3); quatAxisAngle(out, tmpvec3, Math.PI); return out; } else if (dot > 0.999999) { out[0] = 0; out[1] = 0; out[2] = 0; out[3] = 1; return out; } else { vecCross(tmpvec3, a, b); out[0] = tmpvec3[0]; out[1] = tmpvec3[1]; out[2] = tmpvec3[2]; out[3] = 1 + dot; return quatNormalize(out, out); } } /***/ }, /***/ 5009 /*!**********************************************!*\ !*** ./node_modules/gl-quat/setAxisAngle.js ***! \**********************************************/ (module) { module.exports = setAxisAngle; /** * Sets a quat from the given angle and rotation axis, * then returns it. * * @param {quat} out the receiving quaternion * @param {vec3} axis the axis around which to rotate * @param {Number} rad the angle in radians * @returns {quat} out **/ function setAxisAngle(out, axis, rad) { rad = rad * 0.5; var s = Math.sin(rad); out[0] = s * axis[0]; out[1] = s * axis[1]; out[2] = s * axis[2]; out[3] = Math.cos(rad); return out; } /***/ }, /***/ 33154 /*!*************************************!*\ !*** ./node_modules/gl-vec3/add.js ***! \*************************************/ (module) { module.exports = add; /** * Adds two vec3's * * @param {vec3} out the receiving vector * @param {vec3} a the first operand * @param {vec3} b the second operand * @returns {vec3} out */ function add(out, a, b) { out[0] = a[0] + b[0]; out[1] = a[1] + b[1]; out[2] = a[2] + b[2]; return out; } /***/ }, /***/ 67388 /*!**************************************!*\ !*** ./node_modules/gl-vec3/copy.js ***! \**************************************/ (module) { module.exports = copy; /** * Copy the values from one vec3 to another * * @param {vec3} out the receiving vector * @param {vec3} a the source vector * @returns {vec3} out */ function copy(out, a) { out[0] = a[0]; out[1] = a[1]; out[2] = a[2]; return out; } /***/ }, /***/ 81741 /*!***************************************!*\ !*** ./node_modules/gl-vec3/cross.js ***! \***************************************/ (module) { module.exports = cross; /** * Computes the cross product of two vec3's * * @param {vec3} out the receiving vector * @param {vec3} a the first operand * @param {vec3} b the second operand * @returns {vec3} out */ function cross(out, a, b) { var ax = a[0], ay = a[1], az = a[2], bx = b[0], by = b[1], bz = b[2]; out[0] = ay * bz - az * by; out[1] = az * bx - ax * bz; out[2] = ax * by - ay * bx; return out; } /***/ }, /***/ 12730 /*!******************************************!*\ !*** ./node_modules/gl-vec3/distance.js ***! \******************************************/ (module) { module.exports = distance; /** * Calculates the euclidian distance between two vec3's * * @param {vec3} a the first operand * @param {vec3} b the second operand * @returns {Number} distance between a and b */ function distance(a, b) { var x = b[0] - a[0], y = b[1] - a[1], z = b[2] - a[2]; return Math.sqrt(x * x + y * y + z * z); } /***/ }, /***/ 90778 /*!*************************************!*\ !*** ./node_modules/gl-vec3/dot.js ***! \*************************************/ (module) { module.exports = dot; /** * Calculates the dot product of two vec3's * * @param {vec3} a the first operand * @param {vec3} b the second operand * @returns {Number} dot product of a and b */ function dot(a, b) { return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; } /***/ }, /***/ 83329 /*!****************************************!*\ !*** ./node_modules/gl-vec3/length.js ***! \****************************************/ (module) { module.exports = length; /** * Calculates the length of a vec3 * * @param {vec3} a vector to calculate length of * @returns {Number} length of a */ function length(a) { var x = a[0], y = a[1], z = a[2]; return Math.sqrt(x * x + y * y + z * z); } /***/ }, /***/ 82986 /*!*******************************************!*\ !*** ./node_modules/gl-vec3/normalize.js ***! \*******************************************/ (module) { module.exports = normalize; /** * Normalize a vec3 * * @param {vec3} out the receiving vector * @param {vec3} a vector to normalize * @returns {vec3} out */ function normalize(out, a) { var x = a[0], y = a[1], z = a[2]; var len = x * x + y * y + z * z; if (len > 0) { //TODO: evaluate use of glm_invsqrt here? len = 1 / Math.sqrt(len); out[0] = a[0] * len; out[1] = a[1] * len; out[2] = a[2] * len; } return out; } /***/ }, /***/ 96311 /*!***************************************!*\ !*** ./node_modules/gl-vec3/scale.js ***! \***************************************/ (module) { module.exports = scale; /** * Scales a vec3 by a scalar number * * @param {vec3} out the receiving vector * @param {vec3} a the vector to scale * @param {Number} b amount to scale the vector by * @returns {vec3} out */ function scale(out, a, b) { out[0] = a[0] * b; out[1] = a[1] * b; out[2] = a[2] * b; return out; } /***/ }, /***/ 90919 /*!*********************************************!*\ !*** ./node_modules/gl-vec3/scaleAndAdd.js ***! \*********************************************/ (module) { module.exports = scaleAndAdd; /** * Adds two vec3's after scaling the second operand by a scalar value * * @param {vec3} out the receiving vector * @param {vec3} a the first operand * @param {vec3} b the second operand * @param {Number} scale the amount to scale b by before adding * @returns {vec3} out */ function scaleAndAdd(out, a, b, scale) { out[0] = a[0] + b[0] * scale; out[1] = a[1] + b[1] * scale; out[2] = a[2] + b[2] * scale; return out; } /***/ }, /***/ 58703 /*!*************************************************!*\ !*** ./node_modules/gl-vec3/squaredDistance.js ***! \*************************************************/ (module) { module.exports = squaredDistance; /** * Calculates the squared euclidian distance between two vec3's * * @param {vec3} a the first operand * @param {vec3} b the second operand * @returns {Number} squared distance between a and b */ function squaredDistance(a, b) { var x = b[0] - a[0], y = b[1] - a[1], z = b[2] - a[2]; return x * x + y * y + z * z; } /***/ }, /***/ 70700 /*!***********************************************!*\ !*** ./node_modules/gl-vec3/squaredLength.js ***! \***********************************************/ (module) { module.exports = squaredLength; /** * Calculates the squared length of a vec3 * * @param {vec3} a vector to calculate squared length of * @returns {Number} squared length of a */ function squaredLength(a) { var x = a[0], y = a[1], z = a[2]; return x * x + y * y + z * z; } /***/ }, /***/ 67585 /*!******************************************!*\ !*** ./node_modules/gl-vec3/subtract.js ***! \******************************************/ (module) { module.exports = subtract; /** * Subtracts vector b from vector a * * @param {vec3} out the receiving vector * @param {vec3} a the first operand * @param {vec3} b the second operand * @returns {vec3} out */ function subtract(out, a, b) { out[0] = a[0] - b[0]; out[1] = a[1] - b[1]; out[2] = a[2] - b[2]; return out; } /***/ }, /***/ 65196 /*!********************************************!*\ !*** ./node_modules/gl-vec4/fromValues.js ***! \********************************************/ (module) { module.exports = fromValues; /** * Creates a new vec4 initialized with the given values * * @param {Number} x X component * @param {Number} y Y component * @param {Number} z Z component * @param {Number} w W component * @returns {vec4} a new 4D vector */ function fromValues(x, y, z, w) { var out = new Float32Array(4); out[0] = x; out[1] = y; out[2] = z; out[3] = w; return out; } /***/ }, /***/ 16479 /*!*******************************************!*\ !*** ./node_modules/gl-vec4/normalize.js ***! \*******************************************/ (module) { module.exports = normalize; /** * Normalize a vec4 * * @param {vec4} out the receiving vector * @param {vec4} a vector to normalize * @returns {vec4} out */ function normalize(out, a) { var x = a[0], y = a[1], z = a[2], w = a[3]; var len = x * x + y * y + z * z + w * w; if (len > 0) { len = 1 / Math.sqrt(len); out[0] = x * len; out[1] = y * len; out[2] = z * len; out[3] = w * len; } return out; } /***/ }, /***/ 82462 /*!***********************************************!*\ !*** ./node_modules/gl-vec4/transformMat4.js ***! \***********************************************/ (module) { module.exports = transformMat4; /** * Transforms the vec4 with a mat4. * * @param {vec4} out the receiving vector * @param {vec4} a the vector to transform * @param {mat4} m matrix to transform with * @returns {vec4} out */ function transformMat4(out, a, m) { var x = a[0], y = a[1], z = a[2], w = a[3]; out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w; out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w; out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w; out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w; return out; } /***/ }, /***/ 25891 /*!***********************************************************!*\ !*** ./node_modules/globalthis/implementation.browser.js ***! \***********************************************************/ (module) { "use strict"; /* eslint no-negated-condition: 0, no-new-func: 0 */ if (typeof self !== 'undefined') { module.exports = self; } else if (typeof window !== 'undefined') { module.exports = window; } else { module.exports = Function('return this')(); } /***/ }, /***/ 61139 /*!******************************************!*\ !*** ./node_modules/globalthis/index.js ***! \******************************************/ (module, __unused_webpack_exports, __webpack_require__) { "use strict"; var defineProperties = __webpack_require__(/*! define-properties */ 19771); var implementation = __webpack_require__(/*! ./implementation */ 25891); var getPolyfill = __webpack_require__(/*! ./polyfill */ 1168); var shim = __webpack_require__(/*! ./shim */ 21690); var polyfill = getPolyfill(); var getGlobal = function () { return polyfill; }; defineProperties(getGlobal, { getPolyfill: getPolyfill, implementation: implementation, shim: shim }); module.exports = getGlobal; /***/ }, /***/ 1168 /*!*********************************************!*\ !*** ./node_modules/globalthis/polyfill.js ***! \*********************************************/ (module, __unused_webpack_exports, __webpack_require__) { "use strict"; var implementation = __webpack_require__(/*! ./implementation */ 25891); module.exports = function getPolyfill() { if (typeof global !== 'object' || !global || global.Math !== Math || global.Array !== Array) { return implementation; } return global; }; /***/ }, /***/ 21690 /*!*****************************************!*\ !*** ./node_modules/globalthis/shim.js ***! \*****************************************/ (module, __unused_webpack_exports, __webpack_require__) { "use strict"; var define = __webpack_require__(/*! define-properties */ 19771); var getPolyfill = __webpack_require__(/*! ./polyfill */ 1168); module.exports = function shimGlobal() { var polyfill = getPolyfill(); if (define.supportsDescriptors) { var descriptor = Object.getOwnPropertyDescriptor(polyfill, 'globalThis'); if (!descriptor || descriptor.configurable && (descriptor.enumerable || !descriptor.writable || globalThis !== polyfill)) { // eslint-disable-line max-len Object.defineProperty(polyfill, 'globalThis', { configurable: true, enumerable: false, value: polyfill, writable: true }); } } else if (typeof globalThis !== 'object' || globalThis !== polyfill) { polyfill.globalThis = polyfill; } return polyfill; }; /***/ }, /***/ 88090 /*!***********************************!*\ !*** ./node_modules/gopd/gOPD.js ***! \***********************************/ (module) { "use strict"; /** @type {import('./gOPD')} */ module.exports = Object.getOwnPropertyDescriptor; /***/ }, /***/ 50510 /*!************************************!*\ !*** ./node_modules/gopd/index.js ***! \************************************/ (module, __unused_webpack_exports, __webpack_require__) { "use strict"; /** @type {import('.')} */ var $gOPD = __webpack_require__(/*! ./gOPD */ 88090); if ($gOPD) { try { $gOPD([], 'length'); } catch (e) { // IE 8 has a broken gOPD $gOPD = null; } } module.exports = $gOPD; /***/ }, /***/ 59629 /*!********************************************************!*\ !*** ./node_modules/has-property-descriptors/index.js ***! \********************************************************/ (module, __unused_webpack_exports, __webpack_require__) { "use strict"; var $defineProperty = __webpack_require__(/*! es-define-property */ 29186); var hasPropertyDescriptors = function hasPropertyDescriptors() { return !!$defineProperty; }; hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() { // node v0.6 has a bug where array lengths can be Set but not Defined if (!$defineProperty) { return null; } try { return $defineProperty([], 'length', { value: 1 }).length !== 1; } catch (e) { // In Firefox 4-22, defining length on an array throws an exception. return true; } }; module.exports = hasPropertyDescriptors; /***/ }, /***/ 17603 /*!****************************************************!*\ !*** ./node_modules/json-schema-traverse/index.js ***! \****************************************************/ (module) { "use strict"; var traverse = module.exports = function (schema, opts, cb) { // Legacy support for v0.3.1 and earlier. if (typeof opts == 'function') { cb = opts; opts = {}; } cb = opts.cb || cb; var pre = typeof cb == 'function' ? cb : cb.pre || function () {}; var post = cb.post || function () {}; _traverse(opts, pre, post, schema, '', schema); }; traverse.keywords = { additionalItems: true, items: true, contains: true, additionalProperties: true, propertyNames: true, not: true, if: true, then: true, else: true }; traverse.arrayKeywords = { items: true, allOf: true, anyOf: true, oneOf: true }; traverse.propsKeywords = { $defs: true, definitions: true, properties: true, patternProperties: true, dependencies: true }; traverse.skipKeywords = { default: true, enum: true, const: true, required: true, maximum: true, minimum: true, exclusiveMaximum: true, exclusiveMinimum: true, multipleOf: true, maxLength: true, minLength: true, pattern: true, format: true, maxItems: true, minItems: true, uniqueItems: true, maxProperties: true, minProperties: true }; function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { if (schema && typeof schema == 'object' && !Array.isArray(schema)) { pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); for (var key in schema) { var sch = schema[key]; if (Array.isArray(sch)) { if (key in traverse.arrayKeywords) { for (var i = 0; i < sch.length; i++) _traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i); } } else if (key in traverse.propsKeywords) { if (sch && typeof sch == 'object') { for (var prop in sch) _traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop); } } else if (key in traverse.keywords || opts.allKeys && !(key in traverse.skipKeywords)) { _traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema); } } post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); } } function escapeJsonPtr(str) { return str.replace(/~/g, '~0').replace(/\//g, '~1'); } /***/ }, /***/ 34999 /*!**********************************************!*\ !*** ./node_modules/jszip/dist/jszip.min.js ***! \**********************************************/ (module) { /*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files (c) 2009-2016 Stuart Knightley Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. JSZip uses the library pako released under the MIT license : https://github.com/nodeca/pako/blob/main/LICENSE */ !function (e) { if (true) module.exports = e();else // removed by dead control flow {} }(function () { return function s(a, o, h) { function u(r, e) { if (!o[r]) { if (!a[r]) { var t = undefined; if (!e && t) return require(r, !0); if (l) return l(r, !0); var n = new Error("Cannot find module '" + r + "'"); throw n.code = "MODULE_NOT_FOUND", n; } var i = o[r] = { exports: {} }; a[r][0].call(i.exports, function (e) { var t = a[r][1][e]; return u(t || e); }, i, i.exports, s, a, o, h); } return o[r].exports; } for (var l = undefined, e = 0; e < h.length; e++) u(h[e]); return u; }({ 1: [function (e, t, r) { "use strict"; var d = e("./utils"), c = e("./support"), p = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; r.encode = function (e) { for (var t, r, n, i, s, a, o, h = [], u = 0, l = e.length, f = l, c = "string" !== d.getTypeOf(e); u < e.length;) f = l - u, n = c ? (t = e[u++], r = u < l ? e[u++] : 0, u < l ? e[u++] : 0) : (t = e.charCodeAt(u++), r = u < l ? e.charCodeAt(u++) : 0, u < l ? e.charCodeAt(u++) : 0), i = t >> 2, s = (3 & t) << 4 | r >> 4, a = 1 < f ? (15 & r) << 2 | n >> 6 : 64, o = 2 < f ? 63 & n : 64, h.push(p.charAt(i) + p.charAt(s) + p.charAt(a) + p.charAt(o)); return h.join(""); }, r.decode = function (e) { var t, r, n, i, s, a, o = 0, h = 0, u = "data:"; if (e.substr(0, u.length) === u) throw new Error("Invalid base64 input, it looks like a data url."); var l, f = 3 * (e = e.replace(/[^A-Za-z0-9+/=]/g, "")).length / 4; if (e.charAt(e.length - 1) === p.charAt(64) && f--, e.charAt(e.length - 2) === p.charAt(64) && f--, f % 1 != 0) throw new Error("Invalid base64 input, bad content length."); for (l = c.uint8array ? new Uint8Array(0 | f) : new Array(0 | f); o < e.length;) t = p.indexOf(e.charAt(o++)) << 2 | (i = p.indexOf(e.charAt(o++))) >> 4, r = (15 & i) << 4 | (s = p.indexOf(e.charAt(o++))) >> 2, n = (3 & s) << 6 | (a = p.indexOf(e.charAt(o++))), l[h++] = t, 64 !== s && (l[h++] = r), 64 !== a && (l[h++] = n); return l; }; }, { "./support": 30, "./utils": 32 }], 2: [function (e, t, r) { "use strict"; var n = e("./external"), i = e("./stream/DataWorker"), s = e("./stream/Crc32Probe"), a = e("./stream/DataLengthProbe"); function o(e, t, r, n, i) { this.compressedSize = e, this.uncompressedSize = t, this.crc32 = r, this.compression = n, this.compressedContent = i; } o.prototype = { getContentWorker: function () { var e = new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")), t = this; return e.on("end", function () { if (this.streamInfo.data_length !== t.uncompressedSize) throw new Error("Bug : uncompressed data size mismatch"); }), e; }, getCompressedWorker: function () { return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize", this.compressedSize).withStreamInfo("uncompressedSize", this.uncompressedSize).withStreamInfo("crc32", this.crc32).withStreamInfo("compression", this.compression); } }, o.createWorkerFrom = function (e, t, r) { return e.pipe(new s()).pipe(new a("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new a("compressedSize")).withStreamInfo("compression", t); }, t.exports = o; }, { "./external": 6, "./stream/Crc32Probe": 25, "./stream/DataLengthProbe": 26, "./stream/DataWorker": 27 }], 3: [function (e, t, r) { "use strict"; var n = e("./stream/GenericWorker"); r.STORE = { magic: "\0\0", compressWorker: function () { return new n("STORE compression"); }, uncompressWorker: function () { return new n("STORE decompression"); } }, r.DEFLATE = e("./flate"); }, { "./flate": 7, "./stream/GenericWorker": 28 }], 4: [function (e, t, r) { "use strict"; var n = e("./utils"); var o = function () { for (var e, t = [], r = 0; r < 256; r++) { e = r; for (var n = 0; n < 8; n++) e = 1 & e ? 3988292384 ^ e >>> 1 : e >>> 1; t[r] = e; } return t; }(); t.exports = function (e, t) { return void 0 !== e && e.length ? "string" !== n.getTypeOf(e) ? function (e, t, r, n) { var i = o, s = n + r; e ^= -1; for (var a = n; a < s; a++) e = e >>> 8 ^ i[255 & (e ^ t[a])]; return -1 ^ e; }(0 | t, e, e.length, 0) : function (e, t, r, n) { var i = o, s = n + r; e ^= -1; for (var a = n; a < s; a++) e = e >>> 8 ^ i[255 & (e ^ t.charCodeAt(a))]; return -1 ^ e; }(0 | t, e, e.length, 0) : 0; }; }, { "./utils": 32 }], 5: [function (e, t, r) { "use strict"; r.base64 = !1, r.binary = !1, r.dir = !1, r.createFolders = !0, r.date = null, r.compression = null, r.compressionOptions = null, r.comment = null, r.unixPermissions = null, r.dosPermissions = null; }, {}], 6: [function (e, t, r) { "use strict"; var n = null; n = "undefined" != typeof Promise ? Promise : e("lie"), t.exports = { Promise: n }; }, { lie: 37 }], 7: [function (e, t, r) { "use strict"; var n = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Uint32Array, i = e("pako"), s = e("./utils"), a = e("./stream/GenericWorker"), o = n ? "uint8array" : "array"; function h(e, t) { a.call(this, "FlateWorker/" + e), this._pako = null, this._pakoAction = e, this._pakoOptions = t, this.meta = {}; } r.magic = "\b\0", s.inherits(h, a), h.prototype.processChunk = function (e) { this.meta = e.meta, null === this._pako && this._createPako(), this._pako.push(s.transformTo(o, e.data), !1); }, h.prototype.flush = function () { a.prototype.flush.call(this), null === this._pako && this._createPako(), this._pako.push([], !0); }, h.prototype.cleanUp = function () { a.prototype.cleanUp.call(this), this._pako = null; }, h.prototype._createPako = function () { this._pako = new i[this._pakoAction]({ raw: !0, level: this._pakoOptions.level || -1 }); var t = this; this._pako.onData = function (e) { t.push({ data: e, meta: t.meta }); }; }, r.compressWorker = function (e) { return new h("Deflate", e); }, r.uncompressWorker = function () { return new h("Inflate", {}); }; }, { "./stream/GenericWorker": 28, "./utils": 32, pako: 38 }], 8: [function (e, t, r) { "use strict"; function A(e, t) { var r, n = ""; for (r = 0; r < t; r++) n += String.fromCharCode(255 & e), e >>>= 8; return n; } function n(e, t, r, n, i, s) { var a, o, h = e.file, u = e.compression, l = s !== O.utf8encode, f = I.transformTo("string", s(h.name)), c = I.transformTo("string", O.utf8encode(h.name)), d = h.comment, p = I.transformTo("string", s(d)), m = I.transformTo("string", O.utf8encode(d)), _ = c.length !== h.name.length, g = m.length !== d.length, b = "", v = "", y = "", w = h.dir, k = h.date, x = { crc32: 0, compressedSize: 0, uncompressedSize: 0 }; t && !r || (x.crc32 = e.crc32, x.compressedSize = e.compressedSize, x.uncompressedSize = e.uncompressedSize); var S = 0; t && (S |= 8), l || !_ && !g || (S |= 2048); var z = 0, C = 0; w && (z |= 16), "UNIX" === i ? (C = 798, z |= function (e, t) { var r = e; return e || (r = t ? 16893 : 33204), (65535 & r) << 16; }(h.unixPermissions, w)) : (C = 20, z |= function (e) { return 63 & (e || 0); }(h.dosPermissions)), a = k.getUTCHours(), a <<= 6, a |= k.getUTCMinutes(), a <<= 5, a |= k.getUTCSeconds() / 2, o = k.getUTCFullYear() - 1980, o <<= 4, o |= k.getUTCMonth() + 1, o <<= 5, o |= k.getUTCDate(), _ && (v = A(1, 1) + A(B(f), 4) + c, b += "up" + A(v.length, 2) + v), g && (y = A(1, 1) + A(B(p), 4) + m, b += "uc" + A(y.length, 2) + y); var E = ""; return E += "\n\0", E += A(S, 2), E += u.magic, E += A(a, 2), E += A(o, 2), E += A(x.crc32, 4), E += A(x.compressedSize, 4), E += A(x.uncompressedSize, 4), E += A(f.length, 2), E += A(b.length, 2), { fileRecord: R.LOCAL_FILE_HEADER + E + f + b, dirRecord: R.CENTRAL_FILE_HEADER + A(C, 2) + E + A(p.length, 2) + "\0\0\0\0" + A(z, 4) + A(n, 4) + f + b + p }; } var I = e("../utils"), i = e("../stream/GenericWorker"), O = e("../utf8"), B = e("../crc32"), R = e("../signature"); function s(e, t, r, n) { i.call(this, "ZipFileWorker"), this.bytesWritten = 0, this.zipComment = t, this.zipPlatform = r, this.encodeFileName = n, this.streamFiles = e, this.accumulate = !1, this.contentBuffer = [], this.dirRecords = [], this.currentSourceOffset = 0, this.entriesCount = 0, this.currentFile = null, this._sources = []; } I.inherits(s, i), s.prototype.push = function (e) { var t = e.meta.percent || 0, r = this.entriesCount, n = this._sources.length; this.accumulate ? this.contentBuffer.push(e) : (this.bytesWritten += e.data.length, i.prototype.push.call(this, { data: e.data, meta: { currentFile: this.currentFile, percent: r ? (t + 100 * (r - n - 1)) / r : 100 } })); }, s.prototype.openedSource = function (e) { this.currentSourceOffset = this.bytesWritten, this.currentFile = e.file.name; var t = this.streamFiles && !e.file.dir; if (t) { var r = n(e, t, !1, this.currentSourceOffset, this.zipPlatform, this.encodeFileName); this.push({ data: r.fileRecord, meta: { percent: 0 } }); } else this.accumulate = !0; }, s.prototype.closedSource = function (e) { this.accumulate = !1; var t = this.streamFiles && !e.file.dir, r = n(e, t, !0, this.currentSourceOffset, this.zipPlatform, this.encodeFileName); if (this.dirRecords.push(r.dirRecord), t) this.push({ data: function (e) { return R.DATA_DESCRIPTOR + A(e.crc32, 4) + A(e.compressedSize, 4) + A(e.uncompressedSize, 4); }(e), meta: { percent: 100 } });else for (this.push({ data: r.fileRecord, meta: { percent: 0 } }); this.contentBuffer.length;) this.push(this.contentBuffer.shift()); this.currentFile = null; }, s.prototype.flush = function () { for (var e = this.bytesWritten, t = 0; t < this.dirRecords.length; t++) this.push({ data: this.dirRecords[t], meta: { percent: 100 } }); var r = this.bytesWritten - e, n = function (e, t, r, n, i) { var s = I.transformTo("string", i(n)); return R.CENTRAL_DIRECTORY_END + "\0\0\0\0" + A(e, 2) + A(e, 2) + A(t, 4) + A(r, 4) + A(s.length, 2) + s; }(this.dirRecords.length, r, e, this.zipComment, this.encodeFileName); this.push({ data: n, meta: { percent: 100 } }); }, s.prototype.prepareNextSource = function () { this.previous = this._sources.shift(), this.openedSource(this.previous.streamInfo), this.isPaused ? this.previous.pause() : this.previous.resume(); }, s.prototype.registerPrevious = function (e) { this._sources.push(e); var t = this; return e.on("data", function (e) { t.processChunk(e); }), e.on("end", function () { t.closedSource(t.previous.streamInfo), t._sources.length ? t.prepareNextSource() : t.end(); }), e.on("error", function (e) { t.error(e); }), this; }, s.prototype.resume = function () { return !!i.prototype.resume.call(this) && (!this.previous && this._sources.length ? (this.prepareNextSource(), !0) : this.previous || this._sources.length || this.generatedError ? void 0 : (this.end(), !0)); }, s.prototype.error = function (e) { var t = this._sources; if (!i.prototype.error.call(this, e)) return !1; for (var r = 0; r < t.length; r++) try { t[r].error(e); } catch (e) {} return !0; }, s.prototype.lock = function () { i.prototype.lock.call(this); for (var e = this._sources, t = 0; t < e.length; t++) e[t].lock(); }, t.exports = s; }, { "../crc32": 4, "../signature": 23, "../stream/GenericWorker": 28, "../utf8": 31, "../utils": 32 }], 9: [function (e, t, r) { "use strict"; var u = e("../compressions"), n = e("./ZipFileWorker"); r.generateWorker = function (e, a, t) { var o = new n(a.streamFiles, t, a.platform, a.encodeFileName), h = 0; try { e.forEach(function (e, t) { h++; var r = function (e, t) { var r = e || t, n = u[r]; if (!n) throw new Error(r + " is not a valid compression method !"); return n; }(t.options.compression, a.compression), n = t.options.compressionOptions || a.compressionOptions || {}, i = t.dir, s = t.date; t._compressWorker(r, n).withStreamInfo("file", { name: e, dir: i, date: s, comment: t.comment || "", unixPermissions: t.unixPermissions, dosPermissions: t.dosPermissions }).pipe(o); }), o.entriesCount = h; } catch (e) { o.error(e); } return o; }; }, { "../compressions": 3, "./ZipFileWorker": 8 }], 10: [function (e, t, r) { "use strict"; function n() { if (!(this instanceof n)) return new n(); if (arguments.length) throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide."); this.files = Object.create(null), this.comment = null, this.root = "", this.clone = function () { var e = new n(); for (var t in this) "function" != typeof this[t] && (e[t] = this[t]); return e; }; } (n.prototype = e("./object")).loadAsync = e("./load"), n.support = e("./support"), n.defaults = e("./defaults"), n.version = "3.10.1", n.loadAsync = function (e, t) { return new n().loadAsync(e, t); }, n.external = e("./external"), t.exports = n; }, { "./defaults": 5, "./external": 6, "./load": 11, "./object": 15, "./support": 30 }], 11: [function (e, t, r) { "use strict"; var u = e("./utils"), i = e("./external"), n = e("./utf8"), s = e("./zipEntries"), a = e("./stream/Crc32Probe"), l = e("./nodejsUtils"); function f(n) { return new i.Promise(function (e, t) { var r = n.decompressed.getContentWorker().pipe(new a()); r.on("error", function (e) { t(e); }).on("end", function () { r.streamInfo.crc32 !== n.decompressed.crc32 ? t(new Error("Corrupted zip : CRC32 mismatch")) : e(); }).resume(); }); } t.exports = function (e, o) { var h = this; return o = u.extend(o || {}, { base64: !1, checkCRC32: !1, optimizedBinaryString: !1, createFolders: !1, decodeFileName: n.utf8decode }), l.isNode && l.isStream(e) ? i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")) : u.prepareContent("the loaded zip file", e, !0, o.optimizedBinaryString, o.base64).then(function (e) { var t = new s(o); return t.load(e), t; }).then(function (e) { var t = [i.Promise.resolve(e)], r = e.files; if (o.checkCRC32) for (var n = 0; n < r.length; n++) t.push(f(r[n])); return i.Promise.all(t); }).then(function (e) { for (var t = e.shift(), r = t.files, n = 0; n < r.length; n++) { var i = r[n], s = i.fileNameStr, a = u.resolve(i.fileNameStr); h.file(a, i.decompressed, { binary: !0, optimizedBinaryString: !0, date: i.date, dir: i.dir, comment: i.fileCommentStr.length ? i.fileCommentStr : null, unixPermissions: i.unixPermissions, dosPermissions: i.dosPermissions, createFolders: o.createFolders }), i.dir || (h.file(a).unsafeOriginalName = s); } return t.zipComment.length && (h.comment = t.zipComment), h; }); }; }, { "./external": 6, "./nodejsUtils": 14, "./stream/Crc32Probe": 25, "./utf8": 31, "./utils": 32, "./zipEntries": 33 }], 12: [function (e, t, r) { "use strict"; var n = e("../utils"), i = e("../stream/GenericWorker"); function s(e, t) { i.call(this, "Nodejs stream input adapter for " + e), this._upstreamEnded = !1, this._bindStream(t); } n.inherits(s, i), s.prototype._bindStream = function (e) { var t = this; (this._stream = e).pause(), e.on("data", function (e) { t.push({ data: e, meta: { percent: 0 } }); }).on("error", function (e) { t.isPaused ? this.generatedError = e : t.error(e); }).on("end", function () { t.isPaused ? t._upstreamEnded = !0 : t.end(); }); }, s.prototype.pause = function () { return !!i.prototype.pause.call(this) && (this._stream.pause(), !0); }, s.prototype.resume = function () { return !!i.prototype.resume.call(this) && (this._upstreamEnded ? this.end() : this._stream.resume(), !0); }, t.exports = s; }, { "../stream/GenericWorker": 28, "../utils": 32 }], 13: [function (e, t, r) { "use strict"; var i = e("readable-stream").Readable; function n(e, t, r) { i.call(this, t), this._helper = e; var n = this; e.on("data", function (e, t) { n.push(e) || n._helper.pause(), r && r(t); }).on("error", function (e) { n.emit("error", e); }).on("end", function () { n.push(null); }); } e("../utils").inherits(n, i), n.prototype._read = function () { this._helper.resume(); }, t.exports = n; }, { "../utils": 32, "readable-stream": 16 }], 14: [function (e, t, r) { "use strict"; t.exports = { isNode: "undefined" != typeof Buffer, newBufferFrom: function (e, t) { if (Buffer.from && Buffer.from !== Uint8Array.from) return Buffer.from(e, t); if ("number" == typeof e) throw new Error('The "data" argument must not be a number'); return new Buffer(e, t); }, allocBuffer: function (e) { if (Buffer.alloc) return Buffer.alloc(e); var t = new Buffer(e); return t.fill(0), t; }, isBuffer: function (e) { return Buffer.isBuffer(e); }, isStream: function (e) { return e && "function" == typeof e.on && "function" == typeof e.pause && "function" == typeof e.resume; } }; }, {}], 15: [function (e, t, r) { "use strict"; function s(e, t, r) { var n, i = u.getTypeOf(t), s = u.extend(r || {}, f); s.date = s.date || new Date(), null !== s.compression && (s.compression = s.compression.toUpperCase()), "string" == typeof s.unixPermissions && (s.unixPermissions = parseInt(s.unixPermissions, 8)), s.unixPermissions && 16384 & s.unixPermissions && (s.dir = !0), s.dosPermissions && 16 & s.dosPermissions && (s.dir = !0), s.dir && (e = g(e)), s.createFolders && (n = _(e)) && b.call(this, n, !0); var a = "string" === i && !1 === s.binary && !1 === s.base64; r && void 0 !== r.binary || (s.binary = !a), (t instanceof c && 0 === t.uncompressedSize || s.dir || !t || 0 === t.length) && (s.base64 = !1, s.binary = !0, t = "", s.compression = "STORE", i = "string"); var o = null; o = t instanceof c || t instanceof l ? t : p.isNode && p.isStream(t) ? new m(e, t) : u.prepareContent(e, t, s.binary, s.optimizedBinaryString, s.base64); var h = new d(e, o, s); this.files[e] = h; } var i = e("./utf8"), u = e("./utils"), l = e("./stream/GenericWorker"), a = e("./stream/StreamHelper"), f = e("./defaults"), c = e("./compressedObject"), d = e("./zipObject"), o = e("./generate"), p = e("./nodejsUtils"), m = e("./nodejs/NodejsStreamInputAdapter"), _ = function (e) { "/" === e.slice(-1) && (e = e.substring(0, e.length - 1)); var t = e.lastIndexOf("/"); return 0 < t ? e.substring(0, t) : ""; }, g = function (e) { return "/" !== e.slice(-1) && (e += "/"), e; }, b = function (e, t) { return t = void 0 !== t ? t : f.createFolders, e = g(e), this.files[e] || s.call(this, e, null, { dir: !0, createFolders: t }), this.files[e]; }; function h(e) { return "[object RegExp]" === Object.prototype.toString.call(e); } var n = { load: function () { throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide."); }, forEach: function (e) { var t, r, n; for (t in this.files) n = this.files[t], (r = t.slice(this.root.length, t.length)) && t.slice(0, this.root.length) === this.root && e(r, n); }, filter: function (r) { var n = []; return this.forEach(function (e, t) { r(e, t) && n.push(t); }), n; }, file: function (e, t, r) { if (1 !== arguments.length) return e = this.root + e, s.call(this, e, t, r), this; if (h(e)) { var n = e; return this.filter(function (e, t) { return !t.dir && n.test(e); }); } var i = this.files[this.root + e]; return i && !i.dir ? i : null; }, folder: function (r) { if (!r) return this; if (h(r)) return this.filter(function (e, t) { return t.dir && r.test(e); }); var e = this.root + r, t = b.call(this, e), n = this.clone(); return n.root = t.name, n; }, remove: function (r) { r = this.root + r; var e = this.files[r]; if (e || ("/" !== r.slice(-1) && (r += "/"), e = this.files[r]), e && !e.dir) delete this.files[r];else for (var t = this.filter(function (e, t) { return t.name.slice(0, r.length) === r; }), n = 0; n < t.length; n++) delete this.files[t[n].name]; return this; }, generate: function () { throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide."); }, generateInternalStream: function (e) { var t, r = {}; try { if ((r = u.extend(e || {}, { streamFiles: !1, compression: "STORE", compressionOptions: null, type: "", platform: "DOS", comment: null, mimeType: "application/zip", encodeFileName: i.utf8encode })).type = r.type.toLowerCase(), r.compression = r.compression.toUpperCase(), "binarystring" === r.type && (r.type = "string"), !r.type) throw new Error("No output type specified."); u.checkSupport(r.type), "darwin" !== r.platform && "freebsd" !== r.platform && "linux" !== r.platform && "sunos" !== r.platform || (r.platform = "UNIX"), "win32" === r.platform && (r.platform = "DOS"); var n = r.comment || this.comment || ""; t = o.generateWorker(this, r, n); } catch (e) { (t = new l("error")).error(e); } return new a(t, r.type || "string", r.mimeType); }, generateAsync: function (e, t) { return this.generateInternalStream(e).accumulate(t); }, generateNodeStream: function (e, t) { return (e = e || {}).type || (e.type = "nodebuffer"), this.generateInternalStream(e).toNodejsStream(t); } }; t.exports = n; }, { "./compressedObject": 2, "./defaults": 5, "./generate": 9, "./nodejs/NodejsStreamInputAdapter": 12, "./nodejsUtils": 14, "./stream/GenericWorker": 28, "./stream/StreamHelper": 29, "./utf8": 31, "./utils": 32, "./zipObject": 35 }], 16: [function (e, t, r) { "use strict"; t.exports = e("stream"); }, { stream: void 0 }], 17: [function (e, t, r) { "use strict"; var n = e("./DataReader"); function i(e) { n.call(this, e); for (var t = 0; t < this.data.length; t++) e[t] = 255 & e[t]; } e("../utils").inherits(i, n), i.prototype.byteAt = function (e) { return this.data[this.zero + e]; }, i.prototype.lastIndexOfSignature = function (e) { for (var t = e.charCodeAt(0), r = e.charCodeAt(1), n = e.charCodeAt(2), i = e.charCodeAt(3), s = this.length - 4; 0 <= s; --s) if (this.data[s] === t && this.data[s + 1] === r && this.data[s + 2] === n && this.data[s + 3] === i) return s - this.zero; return -1; }, i.prototype.readAndCheckSignature = function (e) { var t = e.charCodeAt(0), r = e.charCodeAt(1), n = e.charCodeAt(2), i = e.charCodeAt(3), s = this.readData(4); return t === s[0] && r === s[1] && n === s[2] && i === s[3]; }, i.prototype.readData = function (e) { if (this.checkOffset(e), 0 === e) return []; var t = this.data.slice(this.zero + this.index, this.zero + this.index + e); return this.index += e, t; }, t.exports = i; }, { "../utils": 32, "./DataReader": 18 }], 18: [function (e, t, r) { "use strict"; var n = e("../utils"); function i(e) { this.data = e, this.length = e.length, this.index = 0, this.zero = 0; } i.prototype = { checkOffset: function (e) { this.checkIndex(this.index + e); }, checkIndex: function (e) { if (this.length < this.zero + e || e < 0) throw new Error("End of data reached (data length = " + this.length + ", asked index = " + e + "). Corrupted zip ?"); }, setIndex: function (e) { this.checkIndex(e), this.index = e; }, skip: function (e) { this.setIndex(this.index + e); }, byteAt: function () {}, readInt: function (e) { var t, r = 0; for (this.checkOffset(e), t = this.index + e - 1; t >= this.index; t--) r = (r << 8) + this.byteAt(t); return this.index += e, r; }, readString: function (e) { return n.transformTo("string", this.readData(e)); }, readData: function () {}, lastIndexOfSignature: function () {}, readAndCheckSignature: function () {}, readDate: function () { var e = this.readInt(4); return new Date(Date.UTC(1980 + (e >> 25 & 127), (e >> 21 & 15) - 1, e >> 16 & 31, e >> 11 & 31, e >> 5 & 63, (31 & e) << 1)); } }, t.exports = i; }, { "../utils": 32 }], 19: [function (e, t, r) { "use strict"; var n = e("./Uint8ArrayReader"); function i(e) { n.call(this, e); } e("../utils").inherits(i, n), i.prototype.readData = function (e) { this.checkOffset(e); var t = this.data.slice(this.zero + this.index, this.zero + this.index + e); return this.index += e, t; }, t.exports = i; }, { "../utils": 32, "./Uint8ArrayReader": 21 }], 20: [function (e, t, r) { "use strict"; var n = e("./DataReader"); function i(e) { n.call(this, e); } e("../utils").inherits(i, n), i.prototype.byteAt = function (e) { return this.data.charCodeAt(this.zero + e); }, i.prototype.lastIndexOfSignature = function (e) { return this.data.lastIndexOf(e) - this.zero; }, i.prototype.readAndCheckSignature = function (e) { return e === this.readData(4); }, i.prototype.readData = function (e) { this.checkOffset(e); var t = this.data.slice(this.zero + this.index, this.zero + this.index + e); return this.index += e, t; }, t.exports = i; }, { "../utils": 32, "./DataReader": 18 }], 21: [function (e, t, r) { "use strict"; var n = e("./ArrayReader"); function i(e) { n.call(this, e); } e("../utils").inherits(i, n), i.prototype.readData = function (e) { if (this.checkOffset(e), 0 === e) return new Uint8Array(0); var t = this.data.subarray(this.zero + this.index, this.zero + this.index + e); return this.index += e, t; }, t.exports = i; }, { "../utils": 32, "./ArrayReader": 17 }], 22: [function (e, t, r) { "use strict"; var n = e("../utils"), i = e("../support"), s = e("./ArrayReader"), a = e("./StringReader"), o = e("./NodeBufferReader"), h = e("./Uint8ArrayReader"); t.exports = function (e) { var t = n.getTypeOf(e); return n.checkSupport(t), "string" !== t || i.uint8array ? "nodebuffer" === t ? new o(e) : i.uint8array ? new h(n.transformTo("uint8array", e)) : new s(n.transformTo("array", e)) : new a(e); }; }, { "../support": 30, "../utils": 32, "./ArrayReader": 17, "./NodeBufferReader": 19, "./StringReader": 20, "./Uint8ArrayReader": 21 }], 23: [function (e, t, r) { "use strict"; r.LOCAL_FILE_HEADER = "PK", r.CENTRAL_FILE_HEADER = "PK", r.CENTRAL_DIRECTORY_END = "PK", r.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK", r.ZIP64_CENTRAL_DIRECTORY_END = "PK", r.DATA_DESCRIPTOR = "PK\b"; }, {}], 24: [function (e, t, r) { "use strict"; var n = e("./GenericWorker"), i = e("../utils"); function s(e) { n.call(this, "ConvertWorker to " + e), this.destType = e; } i.inherits(s, n), s.prototype.processChunk = function (e) { this.push({ data: i.transformTo(this.destType, e.data), meta: e.meta }); }, t.exports = s; }, { "../utils": 32, "./GenericWorker": 28 }], 25: [function (e, t, r) { "use strict"; var n = e("./GenericWorker"), i = e("../crc32"); function s() { n.call(this, "Crc32Probe"), this.withStreamInfo("crc32", 0); } e("../utils").inherits(s, n), s.prototype.processChunk = function (e) { this.streamInfo.crc32 = i(e.data, this.streamInfo.crc32 || 0), this.push(e); }, t.exports = s; }, { "../crc32": 4, "../utils": 32, "./GenericWorker": 28 }], 26: [function (e, t, r) { "use strict"; var n = e("../utils"), i = e("./GenericWorker"); function s(e) { i.call(this, "DataLengthProbe for " + e), this.propName = e, this.withStreamInfo(e, 0); } n.inherits(s, i), s.prototype.processChunk = function (e) { if (e) { var t = this.streamInfo[this.propName] || 0; this.streamInfo[this.propName] = t + e.data.length; } i.prototype.processChunk.call(this, e); }, t.exports = s; }, { "../utils": 32, "./GenericWorker": 28 }], 27: [function (e, t, r) { "use strict"; var n = e("../utils"), i = e("./GenericWorker"); function s(e) { i.call(this, "DataWorker"); var t = this; this.dataIsReady = !1, this.index = 0, this.max = 0, this.data = null, this.type = "", this._tickScheduled = !1, e.then(function (e) { t.dataIsReady = !0, t.data = e, t.max = e && e.length || 0, t.type = n.getTypeOf(e), t.isPaused || t._tickAndRepeat(); }, function (e) { t.error(e); }); } n.inherits(s, i), s.prototype.cleanUp = function () { i.prototype.cleanUp.call(this), this.data = null; }, s.prototype.resume = function () { return !!i.prototype.resume.call(this) && (!this._tickScheduled && this.dataIsReady && (this._tickScheduled = !0, n.delay(this._tickAndRepeat, [], this)), !0); }, s.prototype._tickAndRepeat = function () { this._tickScheduled = !1, this.isPaused || this.isFinished || (this._tick(), this.isFinished || (n.delay(this._tickAndRepeat, [], this), this._tickScheduled = !0)); }, s.prototype._tick = function () { if (this.isPaused || this.isFinished) return !1; var e = null, t = Math.min(this.max, this.index + 16384); if (this.index >= this.max) return this.end(); switch (this.type) { case "string": e = this.data.substring(this.index, t); break; case "uint8array": e = this.data.subarray(this.index, t); break; case "array": case "nodebuffer": e = this.data.slice(this.index, t); } return this.index = t, this.push({ data: e, meta: { percent: this.max ? this.index / this.max * 100 : 0 } }); }, t.exports = s; }, { "../utils": 32, "./GenericWorker": 28 }], 28: [function (e, t, r) { "use strict"; function n(e) { this.name = e || "default", this.streamInfo = {}, this.generatedError = null, this.extraStreamInfo = {}, this.isPaused = !0, this.isFinished = !1, this.isLocked = !1, this._listeners = { data: [], end: [], error: [] }, this.previous = null; } n.prototype = { push: function (e) { this.emit("data", e); }, end: function () { if (this.isFinished) return !1; this.flush(); try { this.emit("end"), this.cleanUp(), this.isFinished = !0; } catch (e) { this.emit("error", e); } return !0; }, error: function (e) { return !this.isFinished && (this.isPaused ? this.generatedError = e : (this.isFinished = !0, this.emit("error", e), this.previous && this.previous.error(e), this.cleanUp()), !0); }, on: function (e, t) { return this._listeners[e].push(t), this; }, cleanUp: function () { this.streamInfo = this.generatedError = this.extraStreamInfo = null, this._listeners = []; }, emit: function (e, t) { if (this._listeners[e]) for (var r = 0; r < this._listeners[e].length; r++) this._listeners[e][r].call(this, t); }, pipe: function (e) { return e.registerPrevious(this); }, registerPrevious: function (e) { if (this.isLocked) throw new Error("The stream '" + this + "' has already been used."); this.streamInfo = e.streamInfo, this.mergeStreamInfo(), this.previous = e; var t = this; return e.on("data", function (e) { t.processChunk(e); }), e.on("end", function () { t.end(); }), e.on("error", function (e) { t.error(e); }), this; }, pause: function () { return !this.isPaused && !this.isFinished && (this.isPaused = !0, this.previous && this.previous.pause(), !0); }, resume: function () { if (!this.isPaused || this.isFinished) return !1; var e = this.isPaused = !1; return this.generatedError && (this.error(this.generatedError), e = !0), this.previous && this.previous.resume(), !e; }, flush: function () {}, processChunk: function (e) { this.push(e); }, withStreamInfo: function (e, t) { return this.extraStreamInfo[e] = t, this.mergeStreamInfo(), this; }, mergeStreamInfo: function () { for (var e in this.extraStreamInfo) Object.prototype.hasOwnProperty.call(this.extraStreamInfo, e) && (this.streamInfo[e] = this.extraStreamInfo[e]); }, lock: function () { if (this.isLocked) throw new Error("The stream '" + this + "' has already been used."); this.isLocked = !0, this.previous && this.previous.lock(); }, toString: function () { var e = "Worker " + this.name; return this.previous ? this.previous + " -> " + e : e; } }, t.exports = n; }, {}], 29: [function (e, t, r) { "use strict"; var h = e("../utils"), i = e("./ConvertWorker"), s = e("./GenericWorker"), u = e("../base64"), n = e("../support"), a = e("../external"), o = null; if (n.nodestream) try { o = e("../nodejs/NodejsStreamOutputAdapter"); } catch (e) {} function l(e, o) { return new a.Promise(function (t, r) { var n = [], i = e._internalType, s = e._outputType, a = e._mimeType; e.on("data", function (e, t) { n.push(e), o && o(t); }).on("error", function (e) { n = [], r(e); }).on("end", function () { try { var e = function (e, t, r) { switch (e) { case "blob": return h.newBlob(h.transformTo("arraybuffer", t), r); case "base64": return u.encode(t); default: return h.transformTo(e, t); } }(s, function (e, t) { var r, n = 0, i = null, s = 0; for (r = 0; r < t.length; r++) s += t[r].length; switch (e) { case "string": return t.join(""); case "array": return Array.prototype.concat.apply([], t); case "uint8array": for (i = new Uint8Array(s), r = 0; r < t.length; r++) i.set(t[r], n), n += t[r].length; return i; case "nodebuffer": return Buffer.concat(t); default: throw new Error("concat : unsupported type '" + e + "'"); } }(i, n), a); t(e); } catch (e) { r(e); } n = []; }).resume(); }); } function f(e, t, r) { var n = t; switch (t) { case "blob": case "arraybuffer": n = "uint8array"; break; case "base64": n = "string"; } try { this._internalType = n, this._outputType = t, this._mimeType = r, h.checkSupport(n), this._worker = e.pipe(new i(n)), e.lock(); } catch (e) { this._worker = new s("error"), this._worker.error(e); } } f.prototype = { accumulate: function (e) { return l(this, e); }, on: function (e, t) { var r = this; return "data" === e ? this._worker.on(e, function (e) { t.call(r, e.data, e.meta); }) : this._worker.on(e, function () { h.delay(t, arguments, r); }), this; }, resume: function () { return h.delay(this._worker.resume, [], this._worker), this; }, pause: function () { return this._worker.pause(), this; }, toNodejsStream: function (e) { if (h.checkSupport("nodestream"), "nodebuffer" !== this._outputType) throw new Error(this._outputType + " is not supported by this method"); return new o(this, { objectMode: "nodebuffer" !== this._outputType }, e); } }, t.exports = f; }, { "../base64": 1, "../external": 6, "../nodejs/NodejsStreamOutputAdapter": 13, "../support": 30, "../utils": 32, "./ConvertWorker": 24, "./GenericWorker": 28 }], 30: [function (e, t, r) { "use strict"; if (r.base64 = !0, r.array = !0, r.string = !0, r.arraybuffer = "undefined" != typeof ArrayBuffer && "undefined" != typeof Uint8Array, r.nodebuffer = "undefined" != typeof Buffer, r.uint8array = "undefined" != typeof Uint8Array, "undefined" == typeof ArrayBuffer) r.blob = !1;else { var n = new ArrayBuffer(0); try { r.blob = 0 === new Blob([n], { type: "application/zip" }).size; } catch (e) { try { var i = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)(); i.append(n), r.blob = 0 === i.getBlob("application/zip").size; } catch (e) { r.blob = !1; } } } try { r.nodestream = !!e("readable-stream").Readable; } catch (e) { r.nodestream = !1; } }, { "readable-stream": 16 }], 31: [function (e, t, s) { "use strict"; for (var o = e("./utils"), h = e("./support"), r = e("./nodejsUtils"), n = e("./stream/GenericWorker"), u = new Array(256), i = 0; i < 256; i++) u[i] = 252 <= i ? 6 : 248 <= i ? 5 : 240 <= i ? 4 : 224 <= i ? 3 : 192 <= i ? 2 : 1; u[254] = u[254] = 1; function a() { n.call(this, "utf-8 decode"), this.leftOver = null; } function l() { n.call(this, "utf-8 encode"); } s.utf8encode = function (e) { return h.nodebuffer ? r.newBufferFrom(e, "utf-8") : function (e) { var t, r, n, i, s, a = e.length, o = 0; for (i = 0; i < a; i++) 55296 == (64512 & (r = e.charCodeAt(i))) && i + 1 < a && 56320 == (64512 & (n = e.charCodeAt(i + 1))) && (r = 65536 + (r - 55296 << 10) + (n - 56320), i++), o += r < 128 ? 1 : r < 2048 ? 2 : r < 65536 ? 3 : 4; for (t = h.uint8array ? new Uint8Array(o) : new Array(o), i = s = 0; s < o; i++) 55296 == (64512 & (r = e.charCodeAt(i))) && i + 1 < a && 56320 == (64512 & (n = e.charCodeAt(i + 1))) && (r = 65536 + (r - 55296 << 10) + (n - 56320), i++), r < 128 ? t[s++] = r : (r < 2048 ? t[s++] = 192 | r >>> 6 : (r < 65536 ? t[s++] = 224 | r >>> 12 : (t[s++] = 240 | r >>> 18, t[s++] = 128 | r >>> 12 & 63), t[s++] = 128 | r >>> 6 & 63), t[s++] = 128 | 63 & r); return t; }(e); }, s.utf8decode = function (e) { return h.nodebuffer ? o.transformTo("nodebuffer", e).toString("utf-8") : function (e) { var t, r, n, i, s = e.length, a = new Array(2 * s); for (t = r = 0; t < s;) if ((n = e[t++]) < 128) a[r++] = n;else if (4 < (i = u[n])) a[r++] = 65533, t += i - 1;else { for (n &= 2 === i ? 31 : 3 === i ? 15 : 7; 1 < i && t < s;) n = n << 6 | 63 & e[t++], i--; 1 < i ? a[r++] = 65533 : n < 65536 ? a[r++] = n : (n -= 65536, a[r++] = 55296 | n >> 10 & 1023, a[r++] = 56320 | 1023 & n); } return a.length !== r && (a.subarray ? a = a.subarray(0, r) : a.length = r), o.applyFromCharCode(a); }(e = o.transformTo(h.uint8array ? "uint8array" : "array", e)); }, o.inherits(a, n), a.prototype.processChunk = function (e) { var t = o.transformTo(h.uint8array ? "uint8array" : "array", e.data); if (this.leftOver && this.leftOver.length) { if (h.uint8array) { var r = t; (t = new Uint8Array(r.length + this.leftOver.length)).set(this.leftOver, 0), t.set(r, this.leftOver.length); } else t = this.leftOver.concat(t); this.leftOver = null; } var n = function (e, t) { var r; for ((t = t || e.length) > e.length && (t = e.length), r = t - 1; 0 <= r && 128 == (192 & e[r]);) r--; return r < 0 ? t : 0 === r ? t : r + u[e[r]] > t ? r : t; }(t), i = t; n !== t.length && (h.uint8array ? (i = t.subarray(0, n), this.leftOver = t.subarray(n, t.length)) : (i = t.slice(0, n), this.leftOver = t.slice(n, t.length))), this.push({ data: s.utf8decode(i), meta: e.meta }); }, a.prototype.flush = function () { this.leftOver && this.leftOver.length && (this.push({ data: s.utf8decode(this.leftOver), meta: {} }), this.leftOver = null); }, s.Utf8DecodeWorker = a, o.inherits(l, n), l.prototype.processChunk = function (e) { this.push({ data: s.utf8encode(e.data), meta: e.meta }); }, s.Utf8EncodeWorker = l; }, { "./nodejsUtils": 14, "./stream/GenericWorker": 28, "./support": 30, "./utils": 32 }], 32: [function (e, t, a) { "use strict"; var o = e("./support"), h = e("./base64"), r = e("./nodejsUtils"), u = e("./external"); function n(e) { return e; } function l(e, t) { for (var r = 0; r < e.length; ++r) t[r] = 255 & e.charCodeAt(r); return t; } e("setimmediate"), a.newBlob = function (t, r) { a.checkSupport("blob"); try { return new Blob([t], { type: r }); } catch (e) { try { var n = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)(); return n.append(t), n.getBlob(r); } catch (e) { throw new Error("Bug : can't construct the Blob."); } } }; var i = { stringifyByChunk: function (e, t, r) { var n = [], i = 0, s = e.length; if (s <= r) return String.fromCharCode.apply(null, e); for (; i < s;) "array" === t || "nodebuffer" === t ? n.push(String.fromCharCode.apply(null, e.slice(i, Math.min(i + r, s)))) : n.push(String.fromCharCode.apply(null, e.subarray(i, Math.min(i + r, s)))), i += r; return n.join(""); }, stringifyByChar: function (e) { for (var t = "", r = 0; r < e.length; r++) t += String.fromCharCode(e[r]); return t; }, applyCanBeUsed: { uint8array: function () { try { return o.uint8array && 1 === String.fromCharCode.apply(null, new Uint8Array(1)).length; } catch (e) { return !1; } }(), nodebuffer: function () { try { return o.nodebuffer && 1 === String.fromCharCode.apply(null, r.allocBuffer(1)).length; } catch (e) { return !1; } }() } }; function s(e) { var t = 65536, r = a.getTypeOf(e), n = !0; if ("uint8array" === r ? n = i.applyCanBeUsed.uint8array : "nodebuffer" === r && (n = i.applyCanBeUsed.nodebuffer), n) for (; 1 < t;) try { return i.stringifyByChunk(e, r, t); } catch (e) { t = Math.floor(t / 2); } return i.stringifyByChar(e); } function f(e, t) { for (var r = 0; r < e.length; r++) t[r] = e[r]; return t; } a.applyFromCharCode = s; var c = {}; c.string = { string: n, array: function (e) { return l(e, new Array(e.length)); }, arraybuffer: function (e) { return c.string.uint8array(e).buffer; }, uint8array: function (e) { return l(e, new Uint8Array(e.length)); }, nodebuffer: function (e) { return l(e, r.allocBuffer(e.length)); } }, c.array = { string: s, array: n, arraybuffer: function (e) { return new Uint8Array(e).buffer; }, uint8array: function (e) { return new Uint8Array(e); }, nodebuffer: function (e) { return r.newBufferFrom(e); } }, c.arraybuffer = { string: function (e) { return s(new Uint8Array(e)); }, array: function (e) { return f(new Uint8Array(e), new Array(e.byteLength)); }, arraybuffer: n, uint8array: function (e) { return new Uint8Array(e); }, nodebuffer: function (e) { return r.newBufferFrom(new Uint8Array(e)); } }, c.uint8array = { string: s, array: function (e) { return f(e, new Array(e.length)); }, arraybuffer: function (e) { return e.buffer; }, uint8array: n, nodebuffer: function (e) { return r.newBufferFrom(e); } }, c.nodebuffer = { string: s, array: function (e) { return f(e, new Array(e.length)); }, arraybuffer: function (e) { return c.nodebuffer.uint8array(e).buffer; }, uint8array: function (e) { return f(e, new Uint8Array(e.length)); }, nodebuffer: n }, a.transformTo = function (e, t) { if (t = t || "", !e) return t; a.checkSupport(e); var r = a.getTypeOf(t); return c[r][e](t); }, a.resolve = function (e) { for (var t = e.split("/"), r = [], n = 0; n < t.length; n++) { var i = t[n]; "." === i || "" === i && 0 !== n && n !== t.length - 1 || (".." === i ? r.pop() : r.push(i)); } return r.join("/"); }, a.getTypeOf = function (e) { return "string" == typeof e ? "string" : "[object Array]" === Object.prototype.toString.call(e) ? "array" : o.nodebuffer && r.isBuffer(e) ? "nodebuffer" : o.uint8array && e instanceof Uint8Array ? "uint8array" : o.arraybuffer && e instanceof ArrayBuffer ? "arraybuffer" : void 0; }, a.checkSupport = function (e) { if (!o[e.toLowerCase()]) throw new Error(e + " is not supported by this platform"); }, a.MAX_VALUE_16BITS = 65535, a.MAX_VALUE_32BITS = -1, a.pretty = function (e) { var t, r, n = ""; for (r = 0; r < (e || "").length; r++) n += "\\x" + ((t = e.charCodeAt(r)) < 16 ? "0" : "") + t.toString(16).toUpperCase(); return n; }, a.delay = function (e, t, r) { setImmediate(function () { e.apply(r || null, t || []); }); }, a.inherits = function (e, t) { function r() {} r.prototype = t.prototype, e.prototype = new r(); }, a.extend = function () { var e, t, r = {}; for (e = 0; e < arguments.length; e++) for (t in arguments[e]) Object.prototype.hasOwnProperty.call(arguments[e], t) && void 0 === r[t] && (r[t] = arguments[e][t]); return r; }, a.prepareContent = function (r, e, n, i, s) { return u.Promise.resolve(e).then(function (n) { return o.blob && (n instanceof Blob || -1 !== ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(n))) && "undefined" != typeof FileReader ? new u.Promise(function (t, r) { var e = new FileReader(); e.onload = function (e) { t(e.target.result); }, e.onerror = function (e) { r(e.target.error); }, e.readAsArrayBuffer(n); }) : n; }).then(function (e) { var t = a.getTypeOf(e); return t ? ("arraybuffer" === t ? e = a.transformTo("uint8array", e) : "string" === t && (s ? e = h.decode(e) : n && !0 !== i && (e = function (e) { return l(e, o.uint8array ? new Uint8Array(e.length) : new Array(e.length)); }(e))), e) : u.Promise.reject(new Error("Can't read the data of '" + r + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?")); }); }; }, { "./base64": 1, "./external": 6, "./nodejsUtils": 14, "./support": 30, setimmediate: 54 }], 33: [function (e, t, r) { "use strict"; var n = e("./reader/readerFor"), i = e("./utils"), s = e("./signature"), a = e("./zipEntry"), o = e("./support"); function h(e) { this.files = [], this.loadOptions = e; } h.prototype = { checkSignature: function (e) { if (!this.reader.readAndCheckSignature(e)) { this.reader.index -= 4; var t = this.reader.readString(4); throw new Error("Corrupted zip or bug: unexpected signature (" + i.pretty(t) + ", expected " + i.pretty(e) + ")"); } }, isSignature: function (e, t) { var r = this.reader.index; this.reader.setIndex(e); var n = this.reader.readString(4) === t; return this.reader.setIndex(r), n; }, readBlockEndOfCentral: function () { this.diskNumber = this.reader.readInt(2), this.diskWithCentralDirStart = this.reader.readInt(2), this.centralDirRecordsOnThisDisk = this.reader.readInt(2), this.centralDirRecords = this.reader.readInt(2), this.centralDirSize = this.reader.readInt(4), this.centralDirOffset = this.reader.readInt(4), this.zipCommentLength = this.reader.readInt(2); var e = this.reader.readData(this.zipCommentLength), t = o.uint8array ? "uint8array" : "array", r = i.transformTo(t, e); this.zipComment = this.loadOptions.decodeFileName(r); }, readBlockZip64EndOfCentral: function () { this.zip64EndOfCentralSize = this.reader.readInt(8), this.reader.skip(4), this.diskNumber = this.reader.readInt(4), this.diskWithCentralDirStart = this.reader.readInt(4), this.centralDirRecordsOnThisDisk = this.reader.readInt(8), this.centralDirRecords = this.reader.readInt(8), this.centralDirSize = this.reader.readInt(8), this.centralDirOffset = this.reader.readInt(8), this.zip64ExtensibleData = {}; for (var e, t, r, n = this.zip64EndOfCentralSize - 44; 0 < n;) e = this.reader.readInt(2), t = this.reader.readInt(4), r = this.reader.readData(t), this.zip64ExtensibleData[e] = { id: e, length: t, value: r }; }, readBlockZip64EndOfCentralLocator: function () { if (this.diskWithZip64CentralDirStart = this.reader.readInt(4), this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8), this.disksCount = this.reader.readInt(4), 1 < this.disksCount) throw new Error("Multi-volumes zip are not supported"); }, readLocalFiles: function () { var e, t; for (e = 0; e < this.files.length; e++) t = this.files[e], this.reader.setIndex(t.localHeaderOffset), this.checkSignature(s.LOCAL_FILE_HEADER), t.readLocalPart(this.reader), t.handleUTF8(), t.processAttributes(); }, readCentralDir: function () { var e; for (this.reader.setIndex(this.centralDirOffset); this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);) (e = new a({ zip64: this.zip64 }, this.loadOptions)).readCentralPart(this.reader), this.files.push(e); if (this.centralDirRecords !== this.files.length && 0 !== this.centralDirRecords && 0 === this.files.length) throw new Error("Corrupted zip or bug: expected " + this.centralDirRecords + " records in central dir, got " + this.files.length); }, readEndOfCentral: function () { var e = this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END); if (e < 0) throw !this.isSignature(0, s.LOCAL_FILE_HEADER) ? new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html") : new Error("Corrupted zip: can't find end of central directory"); this.reader.setIndex(e); var t = e; if (this.checkSignature(s.CENTRAL_DIRECTORY_END), this.readBlockEndOfCentral(), this.diskNumber === i.MAX_VALUE_16BITS || this.diskWithCentralDirStart === i.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === i.MAX_VALUE_16BITS || this.centralDirRecords === i.MAX_VALUE_16BITS || this.centralDirSize === i.MAX_VALUE_32BITS || this.centralDirOffset === i.MAX_VALUE_32BITS) { if (this.zip64 = !0, (e = this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR)) < 0) throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator"); if (this.reader.setIndex(e), this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR), this.readBlockZip64EndOfCentralLocator(), !this.isSignature(this.relativeOffsetEndOfZip64CentralDir, s.ZIP64_CENTRAL_DIRECTORY_END) && (this.relativeOffsetEndOfZip64CentralDir = this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END), this.relativeOffsetEndOfZip64CentralDir < 0)) throw new Error("Corrupted zip: can't find the ZIP64 end of central directory"); this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir), this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END), this.readBlockZip64EndOfCentral(); } var r = this.centralDirOffset + this.centralDirSize; this.zip64 && (r += 20, r += 12 + this.zip64EndOfCentralSize); var n = t - r; if (0 < n) this.isSignature(t, s.CENTRAL_FILE_HEADER) || (this.reader.zero = n);else if (n < 0) throw new Error("Corrupted zip: missing " + Math.abs(n) + " bytes."); }, prepareReader: function (e) { this.reader = n(e); }, load: function (e) { this.prepareReader(e), this.readEndOfCentral(), this.readCentralDir(), this.readLocalFiles(); } }, t.exports = h; }, { "./reader/readerFor": 22, "./signature": 23, "./support": 30, "./utils": 32, "./zipEntry": 34 }], 34: [function (e, t, r) { "use strict"; var n = e("./reader/readerFor"), s = e("./utils"), i = e("./compressedObject"), a = e("./crc32"), o = e("./utf8"), h = e("./compressions"), u = e("./support"); function l(e, t) { this.options = e, this.loadOptions = t; } l.prototype = { isEncrypted: function () { return 1 == (1 & this.bitFlag); }, useUTF8: function () { return 2048 == (2048 & this.bitFlag); }, readLocalPart: function (e) { var t, r; if (e.skip(22), this.fileNameLength = e.readInt(2), r = e.readInt(2), this.fileName = e.readData(this.fileNameLength), e.skip(r), -1 === this.compressedSize || -1 === this.uncompressedSize) throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)"); if (null === (t = function (e) { for (var t in h) if (Object.prototype.hasOwnProperty.call(h, t) && h[t].magic === e) return h[t]; return null; }(this.compressionMethod))) throw new Error("Corrupted zip : compression " + s.pretty(this.compressionMethod) + " unknown (inner file : " + s.transformTo("string", this.fileName) + ")"); this.decompressed = new i(this.compressedSize, this.uncompressedSize, this.crc32, t, e.readData(this.compressedSize)); }, readCentralPart: function (e) { this.versionMadeBy = e.readInt(2), e.skip(2), this.bitFlag = e.readInt(2), this.compressionMethod = e.readString(2), this.date = e.readDate(), this.crc32 = e.readInt(4), this.compressedSize = e.readInt(4), this.uncompressedSize = e.readInt(4); var t = e.readInt(2); if (this.extraFieldsLength = e.readInt(2), this.fileCommentLength = e.readInt(2), this.diskNumberStart = e.readInt(2), this.internalFileAttributes = e.readInt(2), this.externalFileAttributes = e.readInt(4), this.localHeaderOffset = e.readInt(4), this.isEncrypted()) throw new Error("Encrypted zip are not supported"); e.skip(t), this.readExtraFields(e), this.parseZIP64ExtraField(e), this.fileComment = e.readData(this.fileCommentLength); }, processAttributes: function () { this.unixPermissions = null, this.dosPermissions = null; var e = this.versionMadeBy >> 8; this.dir = !!(16 & this.externalFileAttributes), 0 == e && (this.dosPermissions = 63 & this.externalFileAttributes), 3 == e && (this.unixPermissions = this.externalFileAttributes >> 16 & 65535), this.dir || "/" !== this.fileNameStr.slice(-1) || (this.dir = !0); }, parseZIP64ExtraField: function () { if (this.extraFields[1]) { var e = n(this.extraFields[1].value); this.uncompressedSize === s.MAX_VALUE_32BITS && (this.uncompressedSize = e.readInt(8)), this.compressedSize === s.MAX_VALUE_32BITS && (this.compressedSize = e.readInt(8)), this.localHeaderOffset === s.MAX_VALUE_32BITS && (this.localHeaderOffset = e.readInt(8)), this.diskNumberStart === s.MAX_VALUE_32BITS && (this.diskNumberStart = e.readInt(4)); } }, readExtraFields: function (e) { var t, r, n, i = e.index + this.extraFieldsLength; for (this.extraFields || (this.extraFields = {}); e.index + 4 < i;) t = e.readInt(2), r = e.readInt(2), n = e.readData(r), this.extraFields[t] = { id: t, length: r, value: n }; e.setIndex(i); }, handleUTF8: function () { var e = u.uint8array ? "uint8array" : "array"; if (this.useUTF8()) this.fileNameStr = o.utf8decode(this.fileName), this.fileCommentStr = o.utf8decode(this.fileComment);else { var t = this.findExtraFieldUnicodePath(); if (null !== t) this.fileNameStr = t;else { var r = s.transformTo(e, this.fileName); this.fileNameStr = this.loadOptions.decodeFileName(r); } var n = this.findExtraFieldUnicodeComment(); if (null !== n) this.fileCommentStr = n;else { var i = s.transformTo(e, this.fileComment); this.fileCommentStr = this.loadOptions.decodeFileName(i); } } }, findExtraFieldUnicodePath: function () { var e = this.extraFields[28789]; if (e) { var t = n(e.value); return 1 !== t.readInt(1) ? null : a(this.fileName) !== t.readInt(4) ? null : o.utf8decode(t.readData(e.length - 5)); } return null; }, findExtraFieldUnicodeComment: function () { var e = this.extraFields[25461]; if (e) { var t = n(e.value); return 1 !== t.readInt(1) ? null : a(this.fileComment) !== t.readInt(4) ? null : o.utf8decode(t.readData(e.length - 5)); } return null; } }, t.exports = l; }, { "./compressedObject": 2, "./compressions": 3, "./crc32": 4, "./reader/readerFor": 22, "./support": 30, "./utf8": 31, "./utils": 32 }], 35: [function (e, t, r) { "use strict"; function n(e, t, r) { this.name = e, this.dir = r.dir, this.date = r.date, this.comment = r.comment, this.unixPermissions = r.unixPermissions, this.dosPermissions = r.dosPermissions, this._data = t, this._dataBinary = r.binary, this.options = { compression: r.compression, compressionOptions: r.compressionOptions }; } var s = e("./stream/StreamHelper"), i = e("./stream/DataWorker"), a = e("./utf8"), o = e("./compressedObject"), h = e("./stream/GenericWorker"); n.prototype = { internalStream: function (e) { var t = null, r = "string"; try { if (!e) throw new Error("No output type specified."); var n = "string" === (r = e.toLowerCase()) || "text" === r; "binarystring" !== r && "text" !== r || (r = "string"), t = this._decompressWorker(); var i = !this._dataBinary; i && !n && (t = t.pipe(new a.Utf8EncodeWorker())), !i && n && (t = t.pipe(new a.Utf8DecodeWorker())); } catch (e) { (t = new h("error")).error(e); } return new s(t, r, ""); }, async: function (e, t) { return this.internalStream(e).accumulate(t); }, nodeStream: function (e, t) { return this.internalStream(e || "nodebuffer").toNodejsStream(t); }, _compressWorker: function (e, t) { if (this._data instanceof o && this._data.compression.magic === e.magic) return this._data.getCompressedWorker(); var r = this._decompressWorker(); return this._dataBinary || (r = r.pipe(new a.Utf8EncodeWorker())), o.createWorkerFrom(r, e, t); }, _decompressWorker: function () { return this._data instanceof o ? this._data.getContentWorker() : this._data instanceof h ? this._data : new i(this._data); } }; for (var u = ["asText", "asBinary", "asNodeBuffer", "asUint8Array", "asArrayBuffer"], l = function () { throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide."); }, f = 0; f < u.length; f++) n.prototype[u[f]] = l; t.exports = n; }, { "./compressedObject": 2, "./stream/DataWorker": 27, "./stream/GenericWorker": 28, "./stream/StreamHelper": 29, "./utf8": 31 }], 36: [function (e, l, t) { (function (t) { "use strict"; var r, n, e = t.MutationObserver || t.WebKitMutationObserver; if (e) { var i = 0, s = new e(u), a = t.document.createTextNode(""); s.observe(a, { characterData: !0 }), r = function () { a.data = i = ++i % 2; }; } else if (t.setImmediate || void 0 === t.MessageChannel) r = "document" in t && "onreadystatechange" in t.document.createElement("script") ? function () { var e = t.document.createElement("script"); e.onreadystatechange = function () { u(), e.onreadystatechange = null, e.parentNode.removeChild(e), e = null; }, t.document.documentElement.appendChild(e); } : function () { setTimeout(u, 0); };else { var o = new t.MessageChannel(); o.port1.onmessage = u, r = function () { o.port2.postMessage(0); }; } var h = []; function u() { var e, t; n = !0; for (var r = h.length; r;) { for (t = h, h = [], e = -1; ++e < r;) t[e](); r = h.length; } n = !1; } l.exports = function (e) { 1 !== h.push(e) || n || r(); }; }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}); }, {}], 37: [function (e, t, r) { "use strict"; var i = e("immediate"); function u() {} var l = {}, s = ["REJECTED"], a = ["FULFILLED"], n = ["PENDING"]; function o(e) { if ("function" != typeof e) throw new TypeError("resolver must be a function"); this.state = n, this.queue = [], this.outcome = void 0, e !== u && d(this, e); } function h(e, t, r) { this.promise = e, "function" == typeof t && (this.onFulfilled = t, this.callFulfilled = this.otherCallFulfilled), "function" == typeof r && (this.onRejected = r, this.callRejected = this.otherCallRejected); } function f(t, r, n) { i(function () { var e; try { e = r(n); } catch (e) { return l.reject(t, e); } e === t ? l.reject(t, new TypeError("Cannot resolve promise with itself")) : l.resolve(t, e); }); } function c(e) { var t = e && e.then; if (e && ("object" == typeof e || "function" == typeof e) && "function" == typeof t) return function () { t.apply(e, arguments); }; } function d(t, e) { var r = !1; function n(e) { r || (r = !0, l.reject(t, e)); } function i(e) { r || (r = !0, l.resolve(t, e)); } var s = p(function () { e(i, n); }); "error" === s.status && n(s.value); } function p(e, t) { var r = {}; try { r.value = e(t), r.status = "success"; } catch (e) { r.status = "error", r.value = e; } return r; } (t.exports = o).prototype.finally = function (t) { if ("function" != typeof t) return this; var r = this.constructor; return this.then(function (e) { return r.resolve(t()).then(function () { return e; }); }, function (e) { return r.resolve(t()).then(function () { throw e; }); }); }, o.prototype.catch = function (e) { return this.then(null, e); }, o.prototype.then = function (e, t) { if ("function" != typeof e && this.state === a || "function" != typeof t && this.state === s) return this; var r = new this.constructor(u); this.state !== n ? f(r, this.state === a ? e : t, this.outcome) : this.queue.push(new h(r, e, t)); return r; }, h.prototype.callFulfilled = function (e) { l.resolve(this.promise, e); }, h.prototype.otherCallFulfilled = function (e) { f(this.promise, this.onFulfilled, e); }, h.prototype.callRejected = function (e) { l.reject(this.promise, e); }, h.prototype.otherCallRejected = function (e) { f(this.promise, this.onRejected, e); }, l.resolve = function (e, t) { var r = p(c, t); if ("error" === r.status) return l.reject(e, r.value); var n = r.value; if (n) d(e, n);else { e.state = a, e.outcome = t; for (var i = -1, s = e.queue.length; ++i < s;) e.queue[i].callFulfilled(t); } return e; }, l.reject = function (e, t) { e.state = s, e.outcome = t; for (var r = -1, n = e.queue.length; ++r < n;) e.queue[r].callRejected(t); return e; }, o.resolve = function (e) { if (e instanceof this) return e; return l.resolve(new this(u), e); }, o.reject = function (e) { var t = new this(u); return l.reject(t, e); }, o.all = function (e) { var r = this; if ("[object Array]" !== Object.prototype.toString.call(e)) return this.reject(new TypeError("must be an array")); var n = e.length, i = !1; if (!n) return this.resolve([]); var s = new Array(n), a = 0, t = -1, o = new this(u); for (; ++t < n;) h(e[t], t); return o; function h(e, t) { r.resolve(e).then(function (e) { s[t] = e, ++a !== n || i || (i = !0, l.resolve(o, s)); }, function (e) { i || (i = !0, l.reject(o, e)); }); } }, o.race = function (e) { var t = this; if ("[object Array]" !== Object.prototype.toString.call(e)) return this.reject(new TypeError("must be an array")); var r = e.length, n = !1; if (!r) return this.resolve([]); var i = -1, s = new this(u); for (; ++i < r;) a = e[i], t.resolve(a).then(function (e) { n || (n = !0, l.resolve(s, e)); }, function (e) { n || (n = !0, l.reject(s, e)); }); var a; return s; }; }, { immediate: 36 }], 38: [function (e, t, r) { "use strict"; var n = {}; (0, e("./lib/utils/common").assign)(n, e("./lib/deflate"), e("./lib/inflate"), e("./lib/zlib/constants")), t.exports = n; }, { "./lib/deflate": 39, "./lib/inflate": 40, "./lib/utils/common": 41, "./lib/zlib/constants": 44 }], 39: [function (e, t, r) { "use strict"; var a = e("./zlib/deflate"), o = e("./utils/common"), h = e("./utils/strings"), i = e("./zlib/messages"), s = e("./zlib/zstream"), u = Object.prototype.toString, l = 0, f = -1, c = 0, d = 8; function p(e) { if (!(this instanceof p)) return new p(e); this.options = o.assign({ level: f, method: d, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: c, to: "" }, e || {}); var t = this.options; t.raw && 0 < t.windowBits ? t.windowBits = -t.windowBits : t.gzip && 0 < t.windowBits && t.windowBits < 16 && (t.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new s(), this.strm.avail_out = 0; var r = a.deflateInit2(this.strm, t.level, t.method, t.windowBits, t.memLevel, t.strategy); if (r !== l) throw new Error(i[r]); if (t.header && a.deflateSetHeader(this.strm, t.header), t.dictionary) { var n; if (n = "string" == typeof t.dictionary ? h.string2buf(t.dictionary) : "[object ArrayBuffer]" === u.call(t.dictionary) ? new Uint8Array(t.dictionary) : t.dictionary, (r = a.deflateSetDictionary(this.strm, n)) !== l) throw new Error(i[r]); this._dict_set = !0; } } function n(e, t) { var r = new p(t); if (r.push(e, !0), r.err) throw r.msg || i[r.err]; return r.result; } p.prototype.push = function (e, t) { var r, n, i = this.strm, s = this.options.chunkSize; if (this.ended) return !1; n = t === ~~t ? t : !0 === t ? 4 : 0, "string" == typeof e ? i.input = h.string2buf(e) : "[object ArrayBuffer]" === u.call(e) ? i.input = new Uint8Array(e) : i.input = e, i.next_in = 0, i.avail_in = i.input.length; do { if (0 === i.avail_out && (i.output = new o.Buf8(s), i.next_out = 0, i.avail_out = s), 1 !== (r = a.deflate(i, n)) && r !== l) return this.onEnd(r), !(this.ended = !0); 0 !== i.avail_out && (0 !== i.avail_in || 4 !== n && 2 !== n) || ("string" === this.options.to ? this.onData(h.buf2binstring(o.shrinkBuf(i.output, i.next_out))) : this.onData(o.shrinkBuf(i.output, i.next_out))); } while ((0 < i.avail_in || 0 === i.avail_out) && 1 !== r); return 4 === n ? (r = a.deflateEnd(this.strm), this.onEnd(r), this.ended = !0, r === l) : 2 !== n || (this.onEnd(l), !(i.avail_out = 0)); }, p.prototype.onData = function (e) { this.chunks.push(e); }, p.prototype.onEnd = function (e) { e === l && ("string" === this.options.to ? this.result = this.chunks.join("") : this.result = o.flattenChunks(this.chunks)), this.chunks = [], this.err = e, this.msg = this.strm.msg; }, r.Deflate = p, r.deflate = n, r.deflateRaw = function (e, t) { return (t = t || {}).raw = !0, n(e, t); }, r.gzip = function (e, t) { return (t = t || {}).gzip = !0, n(e, t); }; }, { "./utils/common": 41, "./utils/strings": 42, "./zlib/deflate": 46, "./zlib/messages": 51, "./zlib/zstream": 53 }], 40: [function (e, t, r) { "use strict"; var c = e("./zlib/inflate"), d = e("./utils/common"), p = e("./utils/strings"), m = e("./zlib/constants"), n = e("./zlib/messages"), i = e("./zlib/zstream"), s = e("./zlib/gzheader"), _ = Object.prototype.toString; function a(e) { if (!(this instanceof a)) return new a(e); this.options = d.assign({ chunkSize: 16384, windowBits: 0, to: "" }, e || {}); var t = this.options; t.raw && 0 <= t.windowBits && t.windowBits < 16 && (t.windowBits = -t.windowBits, 0 === t.windowBits && (t.windowBits = -15)), !(0 <= t.windowBits && t.windowBits < 16) || e && e.windowBits || (t.windowBits += 32), 15 < t.windowBits && t.windowBits < 48 && 0 == (15 & t.windowBits) && (t.windowBits |= 15), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new i(), this.strm.avail_out = 0; var r = c.inflateInit2(this.strm, t.windowBits); if (r !== m.Z_OK) throw new Error(n[r]); this.header = new s(), c.inflateGetHeader(this.strm, this.header); } function o(e, t) { var r = new a(t); if (r.push(e, !0), r.err) throw r.msg || n[r.err]; return r.result; } a.prototype.push = function (e, t) { var r, n, i, s, a, o, h = this.strm, u = this.options.chunkSize, l = this.options.dictionary, f = !1; if (this.ended) return !1; n = t === ~~t ? t : !0 === t ? m.Z_FINISH : m.Z_NO_FLUSH, "string" == typeof e ? h.input = p.binstring2buf(e) : "[object ArrayBuffer]" === _.call(e) ? h.input = new Uint8Array(e) : h.input = e, h.next_in = 0, h.avail_in = h.input.length; do { if (0 === h.avail_out && (h.output = new d.Buf8(u), h.next_out = 0, h.avail_out = u), (r = c.inflate(h, m.Z_NO_FLUSH)) === m.Z_NEED_DICT && l && (o = "string" == typeof l ? p.string2buf(l) : "[object ArrayBuffer]" === _.call(l) ? new Uint8Array(l) : l, r = c.inflateSetDictionary(this.strm, o)), r === m.Z_BUF_ERROR && !0 === f && (r = m.Z_OK, f = !1), r !== m.Z_STREAM_END && r !== m.Z_OK) return this.onEnd(r), !(this.ended = !0); h.next_out && (0 !== h.avail_out && r !== m.Z_STREAM_END && (0 !== h.avail_in || n !== m.Z_FINISH && n !== m.Z_SYNC_FLUSH) || ("string" === this.options.to ? (i = p.utf8border(h.output, h.next_out), s = h.next_out - i, a = p.buf2string(h.output, i), h.next_out = s, h.avail_out = u - s, s && d.arraySet(h.output, h.output, i, s, 0), this.onData(a)) : this.onData(d.shrinkBuf(h.output, h.next_out)))), 0 === h.avail_in && 0 === h.avail_out && (f = !0); } while ((0 < h.avail_in || 0 === h.avail_out) && r !== m.Z_STREAM_END); return r === m.Z_STREAM_END && (n = m.Z_FINISH), n === m.Z_FINISH ? (r = c.inflateEnd(this.strm), this.onEnd(r), this.ended = !0, r === m.Z_OK) : n !== m.Z_SYNC_FLUSH || (this.onEnd(m.Z_OK), !(h.avail_out = 0)); }, a.prototype.onData = function (e) { this.chunks.push(e); }, a.prototype.onEnd = function (e) { e === m.Z_OK && ("string" === this.options.to ? this.result = this.chunks.join("") : this.result = d.flattenChunks(this.chunks)), this.chunks = [], this.err = e, this.msg = this.strm.msg; }, r.Inflate = a, r.inflate = o, r.inflateRaw = function (e, t) { return (t = t || {}).raw = !0, o(e, t); }, r.ungzip = o; }, { "./utils/common": 41, "./utils/strings": 42, "./zlib/constants": 44, "./zlib/gzheader": 47, "./zlib/inflate": 49, "./zlib/messages": 51, "./zlib/zstream": 53 }], 41: [function (e, t, r) { "use strict"; var n = "undefined" != typeof Uint8Array && "undefined" != typeof Uint16Array && "undefined" != typeof Int32Array; r.assign = function (e) { for (var t = Array.prototype.slice.call(arguments, 1); t.length;) { var r = t.shift(); if (r) { if ("object" != typeof r) throw new TypeError(r + "must be non-object"); for (var n in r) r.hasOwnProperty(n) && (e[n] = r[n]); } } return e; }, r.shrinkBuf = function (e, t) { return e.length === t ? e : e.subarray ? e.subarray(0, t) : (e.length = t, e); }; var i = { arraySet: function (e, t, r, n, i) { if (t.subarray && e.subarray) e.set(t.subarray(r, r + n), i);else for (var s = 0; s < n; s++) e[i + s] = t[r + s]; }, flattenChunks: function (e) { var t, r, n, i, s, a; for (t = n = 0, r = e.length; t < r; t++) n += e[t].length; for (a = new Uint8Array(n), t = i = 0, r = e.length; t < r; t++) s = e[t], a.set(s, i), i += s.length; return a; } }, s = { arraySet: function (e, t, r, n, i) { for (var s = 0; s < n; s++) e[i + s] = t[r + s]; }, flattenChunks: function (e) { return [].concat.apply([], e); } }; r.setTyped = function (e) { e ? (r.Buf8 = Uint8Array, r.Buf16 = Uint16Array, r.Buf32 = Int32Array, r.assign(r, i)) : (r.Buf8 = Array, r.Buf16 = Array, r.Buf32 = Array, r.assign(r, s)); }, r.setTyped(n); }, {}], 42: [function (e, t, r) { "use strict"; var h = e("./common"), i = !0, s = !0; try { String.fromCharCode.apply(null, [0]); } catch (e) { i = !1; } try { String.fromCharCode.apply(null, new Uint8Array(1)); } catch (e) { s = !1; } for (var u = new h.Buf8(256), n = 0; n < 256; n++) u[n] = 252 <= n ? 6 : 248 <= n ? 5 : 240 <= n ? 4 : 224 <= n ? 3 : 192 <= n ? 2 : 1; function l(e, t) { if (t < 65537 && (e.subarray && s || !e.subarray && i)) return String.fromCharCode.apply(null, h.shrinkBuf(e, t)); for (var r = "", n = 0; n < t; n++) r += String.fromCharCode(e[n]); return r; } u[254] = u[254] = 1, r.string2buf = function (e) { var t, r, n, i, s, a = e.length, o = 0; for (i = 0; i < a; i++) 55296 == (64512 & (r = e.charCodeAt(i))) && i + 1 < a && 56320 == (64512 & (n = e.charCodeAt(i + 1))) && (r = 65536 + (r - 55296 << 10) + (n - 56320), i++), o += r < 128 ? 1 : r < 2048 ? 2 : r < 65536 ? 3 : 4; for (t = new h.Buf8(o), i = s = 0; s < o; i++) 55296 == (64512 & (r = e.charCodeAt(i))) && i + 1 < a && 56320 == (64512 & (n = e.charCodeAt(i + 1))) && (r = 65536 + (r - 55296 << 10) + (n - 56320), i++), r < 128 ? t[s++] = r : (r < 2048 ? t[s++] = 192 | r >>> 6 : (r < 65536 ? t[s++] = 224 | r >>> 12 : (t[s++] = 240 | r >>> 18, t[s++] = 128 | r >>> 12 & 63), t[s++] = 128 | r >>> 6 & 63), t[s++] = 128 | 63 & r); return t; }, r.buf2binstring = function (e) { return l(e, e.length); }, r.binstring2buf = function (e) { for (var t = new h.Buf8(e.length), r = 0, n = t.length; r < n; r++) t[r] = e.charCodeAt(r); return t; }, r.buf2string = function (e, t) { var r, n, i, s, a = t || e.length, o = new Array(2 * a); for (r = n = 0; r < a;) if ((i = e[r++]) < 128) o[n++] = i;else if (4 < (s = u[i])) o[n++] = 65533, r += s - 1;else { for (i &= 2 === s ? 31 : 3 === s ? 15 : 7; 1 < s && r < a;) i = i << 6 | 63 & e[r++], s--; 1 < s ? o[n++] = 65533 : i < 65536 ? o[n++] = i : (i -= 65536, o[n++] = 55296 | i >> 10 & 1023, o[n++] = 56320 | 1023 & i); } return l(o, n); }, r.utf8border = function (e, t) { var r; for ((t = t || e.length) > e.length && (t = e.length), r = t - 1; 0 <= r && 128 == (192 & e[r]);) r--; return r < 0 ? t : 0 === r ? t : r + u[e[r]] > t ? r : t; }; }, { "./common": 41 }], 43: [function (e, t, r) { "use strict"; t.exports = function (e, t, r, n) { for (var i = 65535 & e | 0, s = e >>> 16 & 65535 | 0, a = 0; 0 !== r;) { for (r -= a = 2e3 < r ? 2e3 : r; s = s + (i = i + t[n++] | 0) | 0, --a;); i %= 65521, s %= 65521; } return i | s << 16 | 0; }; }, {}], 44: [function (e, t, r) { "use strict"; t.exports = { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_BUF_ERROR: -5, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, Z_BINARY: 0, Z_TEXT: 1, Z_UNKNOWN: 2, Z_DEFLATED: 8 }; }, {}], 45: [function (e, t, r) { "use strict"; var o = function () { for (var e, t = [], r = 0; r < 256; r++) { e = r; for (var n = 0; n < 8; n++) e = 1 & e ? 3988292384 ^ e >>> 1 : e >>> 1; t[r] = e; } return t; }(); t.exports = function (e, t, r, n) { var i = o, s = n + r; e ^= -1; for (var a = n; a < s; a++) e = e >>> 8 ^ i[255 & (e ^ t[a])]; return -1 ^ e; }; }, {}], 46: [function (e, t, r) { "use strict"; var h, c = e("../utils/common"), u = e("./trees"), d = e("./adler32"), p = e("./crc32"), n = e("./messages"), l = 0, f = 4, m = 0, _ = -2, g = -1, b = 4, i = 2, v = 8, y = 9, s = 286, a = 30, o = 19, w = 2 * s + 1, k = 15, x = 3, S = 258, z = S + x + 1, C = 42, E = 113, A = 1, I = 2, O = 3, B = 4; function R(e, t) { return e.msg = n[t], t; } function T(e) { return (e << 1) - (4 < e ? 9 : 0); } function D(e) { for (var t = e.length; 0 <= --t;) e[t] = 0; } function F(e) { var t = e.state, r = t.pending; r > e.avail_out && (r = e.avail_out), 0 !== r && (c.arraySet(e.output, t.pending_buf, t.pending_out, r, e.next_out), e.next_out += r, t.pending_out += r, e.total_out += r, e.avail_out -= r, t.pending -= r, 0 === t.pending && (t.pending_out = 0)); } function N(e, t) { u._tr_flush_block(e, 0 <= e.block_start ? e.block_start : -1, e.strstart - e.block_start, t), e.block_start = e.strstart, F(e.strm); } function U(e, t) { e.pending_buf[e.pending++] = t; } function P(e, t) { e.pending_buf[e.pending++] = t >>> 8 & 255, e.pending_buf[e.pending++] = 255 & t; } function L(e, t) { var r, n, i = e.max_chain_length, s = e.strstart, a = e.prev_length, o = e.nice_match, h = e.strstart > e.w_size - z ? e.strstart - (e.w_size - z) : 0, u = e.window, l = e.w_mask, f = e.prev, c = e.strstart + S, d = u[s + a - 1], p = u[s + a]; e.prev_length >= e.good_match && (i >>= 2), o > e.lookahead && (o = e.lookahead); do { if (u[(r = t) + a] === p && u[r + a - 1] === d && u[r] === u[s] && u[++r] === u[s + 1]) { s += 2, r++; do {} while (u[++s] === u[++r] && u[++s] === u[++r] && u[++s] === u[++r] && u[++s] === u[++r] && u[++s] === u[++r] && u[++s] === u[++r] && u[++s] === u[++r] && u[++s] === u[++r] && s < c); if (n = S - (c - s), s = c - S, a < n) { if (e.match_start = t, o <= (a = n)) break; d = u[s + a - 1], p = u[s + a]; } } } while ((t = f[t & l]) > h && 0 != --i); return a <= e.lookahead ? a : e.lookahead; } function j(e) { var t, r, n, i, s, a, o, h, u, l, f = e.w_size; do { if (i = e.window_size - e.lookahead - e.strstart, e.strstart >= f + (f - z)) { for (c.arraySet(e.window, e.window, f, f, 0), e.match_start -= f, e.strstart -= f, e.block_start -= f, t = r = e.hash_size; n = e.head[--t], e.head[t] = f <= n ? n - f : 0, --r;); for (t = r = f; n = e.prev[--t], e.prev[t] = f <= n ? n - f : 0, --r;); i += f; } if (0 === e.strm.avail_in) break; if (a = e.strm, o = e.window, h = e.strstart + e.lookahead, u = i, l = void 0, l = a.avail_in, u < l && (l = u), r = 0 === l ? 0 : (a.avail_in -= l, c.arraySet(o, a.input, a.next_in, l, h), 1 === a.state.wrap ? a.adler = d(a.adler, o, l, h) : 2 === a.state.wrap && (a.adler = p(a.adler, o, l, h)), a.next_in += l, a.total_in += l, l), e.lookahead += r, e.lookahead + e.insert >= x) for (s = e.strstart - e.insert, e.ins_h = e.window[s], e.ins_h = (e.ins_h << e.hash_shift ^ e.window[s + 1]) & e.hash_mask; e.insert && (e.ins_h = (e.ins_h << e.hash_shift ^ e.window[s + x - 1]) & e.hash_mask, e.prev[s & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = s, s++, e.insert--, !(e.lookahead + e.insert < x));); } while (e.lookahead < z && 0 !== e.strm.avail_in); } function Z(e, t) { for (var r, n;;) { if (e.lookahead < z) { if (j(e), e.lookahead < z && t === l) return A; if (0 === e.lookahead) break; } if (r = 0, e.lookahead >= x && (e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + x - 1]) & e.hash_mask, r = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart), 0 !== r && e.strstart - r <= e.w_size - z && (e.match_length = L(e, r)), e.match_length >= x) { if (n = u._tr_tally(e, e.strstart - e.match_start, e.match_length - x), e.lookahead -= e.match_length, e.match_length <= e.max_lazy_match && e.lookahead >= x) { for (e.match_length--; e.strstart++, e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + x - 1]) & e.hash_mask, r = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart, 0 != --e.match_length;); e.strstart++; } else e.strstart += e.match_length, e.match_length = 0, e.ins_h = e.window[e.strstart], e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + 1]) & e.hash_mask; } else n = u._tr_tally(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++; if (n && (N(e, !1), 0 === e.strm.avail_out)) return A; } return e.insert = e.strstart < x - 1 ? e.strstart : x - 1, t === f ? (N(e, !0), 0 === e.strm.avail_out ? O : B) : e.last_lit && (N(e, !1), 0 === e.strm.avail_out) ? A : I; } function W(e, t) { for (var r, n, i;;) { if (e.lookahead < z) { if (j(e), e.lookahead < z && t === l) return A; if (0 === e.lookahead) break; } if (r = 0, e.lookahead >= x && (e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + x - 1]) & e.hash_mask, r = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart), e.prev_length = e.match_length, e.prev_match = e.match_start, e.match_length = x - 1, 0 !== r && e.prev_length < e.max_lazy_match && e.strstart - r <= e.w_size - z && (e.match_length = L(e, r), e.match_length <= 5 && (1 === e.strategy || e.match_length === x && 4096 < e.strstart - e.match_start) && (e.match_length = x - 1)), e.prev_length >= x && e.match_length <= e.prev_length) { for (i = e.strstart + e.lookahead - x, n = u._tr_tally(e, e.strstart - 1 - e.prev_match, e.prev_length - x), e.lookahead -= e.prev_length - 1, e.prev_length -= 2; ++e.strstart <= i && (e.ins_h = (e.ins_h << e.hash_shift ^ e.window[e.strstart + x - 1]) & e.hash_mask, r = e.prev[e.strstart & e.w_mask] = e.head[e.ins_h], e.head[e.ins_h] = e.strstart), 0 != --e.prev_length;); if (e.match_available = 0, e.match_length = x - 1, e.strstart++, n && (N(e, !1), 0 === e.strm.avail_out)) return A; } else if (e.match_available) { if ((n = u._tr_tally(e, 0, e.window[e.strstart - 1])) && N(e, !1), e.strstart++, e.lookahead--, 0 === e.strm.avail_out) return A; } else e.match_available = 1, e.strstart++, e.lookahead--; } return e.match_available && (n = u._tr_tally(e, 0, e.window[e.strstart - 1]), e.match_available = 0), e.insert = e.strstart < x - 1 ? e.strstart : x - 1, t === f ? (N(e, !0), 0 === e.strm.avail_out ? O : B) : e.last_lit && (N(e, !1), 0 === e.strm.avail_out) ? A : I; } function M(e, t, r, n, i) { this.good_length = e, this.max_lazy = t, this.nice_length = r, this.max_chain = n, this.func = i; } function H() { this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = v, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new c.Buf16(2 * w), this.dyn_dtree = new c.Buf16(2 * (2 * a + 1)), this.bl_tree = new c.Buf16(2 * (2 * o + 1)), D(this.dyn_ltree), D(this.dyn_dtree), D(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new c.Buf16(k + 1), this.heap = new c.Buf16(2 * s + 1), D(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new c.Buf16(2 * s + 1), D(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0; } function G(e) { var t; return e && e.state ? (e.total_in = e.total_out = 0, e.data_type = i, (t = e.state).pending = 0, t.pending_out = 0, t.wrap < 0 && (t.wrap = -t.wrap), t.status = t.wrap ? C : E, e.adler = 2 === t.wrap ? 0 : 1, t.last_flush = l, u._tr_init(t), m) : R(e, _); } function K(e) { var t = G(e); return t === m && function (e) { e.window_size = 2 * e.w_size, D(e.head), e.max_lazy_match = h[e.level].max_lazy, e.good_match = h[e.level].good_length, e.nice_match = h[e.level].nice_length, e.max_chain_length = h[e.level].max_chain, e.strstart = 0, e.block_start = 0, e.lookahead = 0, e.insert = 0, e.match_length = e.prev_length = x - 1, e.match_available = 0, e.ins_h = 0; }(e.state), t; } function Y(e, t, r, n, i, s) { if (!e) return _; var a = 1; if (t === g && (t = 6), n < 0 ? (a = 0, n = -n) : 15 < n && (a = 2, n -= 16), i < 1 || y < i || r !== v || n < 8 || 15 < n || t < 0 || 9 < t || s < 0 || b < s) return R(e, _); 8 === n && (n = 9); var o = new H(); return (e.state = o).strm = e, o.wrap = a, o.gzhead = null, o.w_bits = n, o.w_size = 1 << o.w_bits, o.w_mask = o.w_size - 1, o.hash_bits = i + 7, o.hash_size = 1 << o.hash_bits, o.hash_mask = o.hash_size - 1, o.hash_shift = ~~((o.hash_bits + x - 1) / x), o.window = new c.Buf8(2 * o.w_size), o.head = new c.Buf16(o.hash_size), o.prev = new c.Buf16(o.w_size), o.lit_bufsize = 1 << i + 6, o.pending_buf_size = 4 * o.lit_bufsize, o.pending_buf = new c.Buf8(o.pending_buf_size), o.d_buf = 1 * o.lit_bufsize, o.l_buf = 3 * o.lit_bufsize, o.level = t, o.strategy = s, o.method = r, K(e); } h = [new M(0, 0, 0, 0, function (e, t) { var r = 65535; for (r > e.pending_buf_size - 5 && (r = e.pending_buf_size - 5);;) { if (e.lookahead <= 1) { if (j(e), 0 === e.lookahead && t === l) return A; if (0 === e.lookahead) break; } e.strstart += e.lookahead, e.lookahead = 0; var n = e.block_start + r; if ((0 === e.strstart || e.strstart >= n) && (e.lookahead = e.strstart - n, e.strstart = n, N(e, !1), 0 === e.strm.avail_out)) return A; if (e.strstart - e.block_start >= e.w_size - z && (N(e, !1), 0 === e.strm.avail_out)) return A; } return e.insert = 0, t === f ? (N(e, !0), 0 === e.strm.avail_out ? O : B) : (e.strstart > e.block_start && (N(e, !1), e.strm.avail_out), A); }), new M(4, 4, 8, 4, Z), new M(4, 5, 16, 8, Z), new M(4, 6, 32, 32, Z), new M(4, 4, 16, 16, W), new M(8, 16, 32, 32, W), new M(8, 16, 128, 128, W), new M(8, 32, 128, 256, W), new M(32, 128, 258, 1024, W), new M(32, 258, 258, 4096, W)], r.deflateInit = function (e, t) { return Y(e, t, v, 15, 8, 0); }, r.deflateInit2 = Y, r.deflateReset = K, r.deflateResetKeep = G, r.deflateSetHeader = function (e, t) { return e && e.state ? 2 !== e.state.wrap ? _ : (e.state.gzhead = t, m) : _; }, r.deflate = function (e, t) { var r, n, i, s; if (!e || !e.state || 5 < t || t < 0) return e ? R(e, _) : _; if (n = e.state, !e.output || !e.input && 0 !== e.avail_in || 666 === n.status && t !== f) return R(e, 0 === e.avail_out ? -5 : _); if (n.strm = e, r = n.last_flush, n.last_flush = t, n.status === C) if (2 === n.wrap) e.adler = 0, U(n, 31), U(n, 139), U(n, 8), n.gzhead ? (U(n, (n.gzhead.text ? 1 : 0) + (n.gzhead.hcrc ? 2 : 0) + (n.gzhead.extra ? 4 : 0) + (n.gzhead.name ? 8 : 0) + (n.gzhead.comment ? 16 : 0)), U(n, 255 & n.gzhead.time), U(n, n.gzhead.time >> 8 & 255), U(n, n.gzhead.time >> 16 & 255), U(n, n.gzhead.time >> 24 & 255), U(n, 9 === n.level ? 2 : 2 <= n.strategy || n.level < 2 ? 4 : 0), U(n, 255 & n.gzhead.os), n.gzhead.extra && n.gzhead.extra.length && (U(n, 255 & n.gzhead.extra.length), U(n, n.gzhead.extra.length >> 8 & 255)), n.gzhead.hcrc && (e.adler = p(e.adler, n.pending_buf, n.pending, 0)), n.gzindex = 0, n.status = 69) : (U(n, 0), U(n, 0), U(n, 0), U(n, 0), U(n, 0), U(n, 9 === n.level ? 2 : 2 <= n.strategy || n.level < 2 ? 4 : 0), U(n, 3), n.status = E);else { var a = v + (n.w_bits - 8 << 4) << 8; a |= (2 <= n.strategy || n.level < 2 ? 0 : n.level < 6 ? 1 : 6 === n.level ? 2 : 3) << 6, 0 !== n.strstart && (a |= 32), a += 31 - a % 31, n.status = E, P(n, a), 0 !== n.strstart && (P(n, e.adler >>> 16), P(n, 65535 & e.adler)), e.adler = 1; } if (69 === n.status) if (n.gzhead.extra) { for (i = n.pending; n.gzindex < (65535 & n.gzhead.extra.length) && (n.pending !== n.pending_buf_size || (n.gzhead.hcrc && n.pending > i && (e.adler = p(e.adler, n.pending_buf, n.pending - i, i)), F(e), i = n.pending, n.pending !== n.pending_buf_size));) U(n, 255 & n.gzhead.extra[n.gzindex]), n.gzindex++; n.gzhead.hcrc && n.pending > i && (e.adler = p(e.adler, n.pending_buf, n.pending - i, i)), n.gzindex === n.gzhead.extra.length && (n.gzindex = 0, n.status = 73); } else n.status = 73; if (73 === n.status) if (n.gzhead.name) { i = n.pending; do { if (n.pending === n.pending_buf_size && (n.gzhead.hcrc && n.pending > i && (e.adler = p(e.adler, n.pending_buf, n.pending - i, i)), F(e), i = n.pending, n.pending === n.pending_buf_size)) { s = 1; break; } s = n.gzindex < n.gzhead.name.length ? 255 & n.gzhead.name.charCodeAt(n.gzindex++) : 0, U(n, s); } while (0 !== s); n.gzhead.hcrc && n.pending > i && (e.adler = p(e.adler, n.pending_buf, n.pending - i, i)), 0 === s && (n.gzindex = 0, n.status = 91); } else n.status = 91; if (91 === n.status) if (n.gzhead.comment) { i = n.pending; do { if (n.pending === n.pending_buf_size && (n.gzhead.hcrc && n.pending > i && (e.adler = p(e.adler, n.pending_buf, n.pending - i, i)), F(e), i = n.pending, n.pending === n.pending_buf_size)) { s = 1; break; } s = n.gzindex < n.gzhead.comment.length ? 255 & n.gzhead.comment.charCodeAt(n.gzindex++) : 0, U(n, s); } while (0 !== s); n.gzhead.hcrc && n.pending > i && (e.adler = p(e.adler, n.pending_buf, n.pending - i, i)), 0 === s && (n.status = 103); } else n.status = 103; if (103 === n.status && (n.gzhead.hcrc ? (n.pending + 2 > n.pending_buf_size && F(e), n.pending + 2 <= n.pending_buf_size && (U(n, 255 & e.adler), U(n, e.adler >> 8 & 255), e.adler = 0, n.status = E)) : n.status = E), 0 !== n.pending) { if (F(e), 0 === e.avail_out) return n.last_flush = -1, m; } else if (0 === e.avail_in && T(t) <= T(r) && t !== f) return R(e, -5); if (666 === n.status && 0 !== e.avail_in) return R(e, -5); if (0 !== e.avail_in || 0 !== n.lookahead || t !== l && 666 !== n.status) { var o = 2 === n.strategy ? function (e, t) { for (var r;;) { if (0 === e.lookahead && (j(e), 0 === e.lookahead)) { if (t === l) return A; break; } if (e.match_length = 0, r = u._tr_tally(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++, r && (N(e, !1), 0 === e.strm.avail_out)) return A; } return e.insert = 0, t === f ? (N(e, !0), 0 === e.strm.avail_out ? O : B) : e.last_lit && (N(e, !1), 0 === e.strm.avail_out) ? A : I; }(n, t) : 3 === n.strategy ? function (e, t) { for (var r, n, i, s, a = e.window;;) { if (e.lookahead <= S) { if (j(e), e.lookahead <= S && t === l) return A; if (0 === e.lookahead) break; } if (e.match_length = 0, e.lookahead >= x && 0 < e.strstart && (n = a[i = e.strstart - 1]) === a[++i] && n === a[++i] && n === a[++i]) { s = e.strstart + S; do {} while (n === a[++i] && n === a[++i] && n === a[++i] && n === a[++i] && n === a[++i] && n === a[++i] && n === a[++i] && n === a[++i] && i < s); e.match_length = S - (s - i), e.match_length > e.lookahead && (e.match_length = e.lookahead); } if (e.match_length >= x ? (r = u._tr_tally(e, 1, e.match_length - x), e.lookahead -= e.match_length, e.strstart += e.match_length, e.match_length = 0) : (r = u._tr_tally(e, 0, e.window[e.strstart]), e.lookahead--, e.strstart++), r && (N(e, !1), 0 === e.strm.avail_out)) return A; } return e.insert = 0, t === f ? (N(e, !0), 0 === e.strm.avail_out ? O : B) : e.last_lit && (N(e, !1), 0 === e.strm.avail_out) ? A : I; }(n, t) : h[n.level].func(n, t); if (o !== O && o !== B || (n.status = 666), o === A || o === O) return 0 === e.avail_out && (n.last_flush = -1), m; if (o === I && (1 === t ? u._tr_align(n) : 5 !== t && (u._tr_stored_block(n, 0, 0, !1), 3 === t && (D(n.head), 0 === n.lookahead && (n.strstart = 0, n.block_start = 0, n.insert = 0))), F(e), 0 === e.avail_out)) return n.last_flush = -1, m; } return t !== f ? m : n.wrap <= 0 ? 1 : (2 === n.wrap ? (U(n, 255 & e.adler), U(n, e.adler >> 8 & 255), U(n, e.adler >> 16 & 255), U(n, e.adler >> 24 & 255), U(n, 255 & e.total_in), U(n, e.total_in >> 8 & 255), U(n, e.total_in >> 16 & 255), U(n, e.total_in >> 24 & 255)) : (P(n, e.adler >>> 16), P(n, 65535 & e.adler)), F(e), 0 < n.wrap && (n.wrap = -n.wrap), 0 !== n.pending ? m : 1); }, r.deflateEnd = function (e) { var t; return e && e.state ? (t = e.state.status) !== C && 69 !== t && 73 !== t && 91 !== t && 103 !== t && t !== E && 666 !== t ? R(e, _) : (e.state = null, t === E ? R(e, -3) : m) : _; }, r.deflateSetDictionary = function (e, t) { var r, n, i, s, a, o, h, u, l = t.length; if (!e || !e.state) return _; if (2 === (s = (r = e.state).wrap) || 1 === s && r.status !== C || r.lookahead) return _; for (1 === s && (e.adler = d(e.adler, t, l, 0)), r.wrap = 0, l >= r.w_size && (0 === s && (D(r.head), r.strstart = 0, r.block_start = 0, r.insert = 0), u = new c.Buf8(r.w_size), c.arraySet(u, t, l - r.w_size, r.w_size, 0), t = u, l = r.w_size), a = e.avail_in, o = e.next_in, h = e.input, e.avail_in = l, e.next_in = 0, e.input = t, j(r); r.lookahead >= x;) { for (n = r.strstart, i = r.lookahead - (x - 1); r.ins_h = (r.ins_h << r.hash_shift ^ r.window[n + x - 1]) & r.hash_mask, r.prev[n & r.w_mask] = r.head[r.ins_h], r.head[r.ins_h] = n, n++, --i;); r.strstart = n, r.lookahead = x - 1, j(r); } return r.strstart += r.lookahead, r.block_start = r.strstart, r.insert = r.lookahead, r.lookahead = 0, r.match_length = r.prev_length = x - 1, r.match_available = 0, e.next_in = o, e.input = h, e.avail_in = a, r.wrap = s, m; }, r.deflateInfo = "pako deflate (from Nodeca project)"; }, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./messages": 51, "./trees": 52 }], 47: [function (e, t, r) { "use strict"; t.exports = function () { this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = !1; }; }, {}], 48: [function (e, t, r) { "use strict"; t.exports = function (e, t) { var r, n, i, s, a, o, h, u, l, f, c, d, p, m, _, g, b, v, y, w, k, x, S, z, C; r = e.state, n = e.next_in, z = e.input, i = n + (e.avail_in - 5), s = e.next_out, C = e.output, a = s - (t - e.avail_out), o = s + (e.avail_out - 257), h = r.dmax, u = r.wsize, l = r.whave, f = r.wnext, c = r.window, d = r.hold, p = r.bits, m = r.lencode, _ = r.distcode, g = (1 << r.lenbits) - 1, b = (1 << r.distbits) - 1; e: do { p < 15 && (d += z[n++] << p, p += 8, d += z[n++] << p, p += 8), v = m[d & g]; t: for (;;) { if (d >>>= y = v >>> 24, p -= y, 0 === (y = v >>> 16 & 255)) C[s++] = 65535 & v;else { if (!(16 & y)) { if (0 == (64 & y)) { v = m[(65535 & v) + (d & (1 << y) - 1)]; continue t; } if (32 & y) { r.mode = 12; break e; } e.msg = "invalid literal/length code", r.mode = 30; break e; } w = 65535 & v, (y &= 15) && (p < y && (d += z[n++] << p, p += 8), w += d & (1 << y) - 1, d >>>= y, p -= y), p < 15 && (d += z[n++] << p, p += 8, d += z[n++] << p, p += 8), v = _[d & b]; r: for (;;) { if (d >>>= y = v >>> 24, p -= y, !(16 & (y = v >>> 16 & 255))) { if (0 == (64 & y)) { v = _[(65535 & v) + (d & (1 << y) - 1)]; continue r; } e.msg = "invalid distance code", r.mode = 30; break e; } if (k = 65535 & v, p < (y &= 15) && (d += z[n++] << p, (p += 8) < y && (d += z[n++] << p, p += 8)), h < (k += d & (1 << y) - 1)) { e.msg = "invalid distance too far back", r.mode = 30; break e; } if (d >>>= y, p -= y, (y = s - a) < k) { if (l < (y = k - y) && r.sane) { e.msg = "invalid distance too far back", r.mode = 30; break e; } if (S = c, (x = 0) === f) { if (x += u - y, y < w) { for (w -= y; C[s++] = c[x++], --y;); x = s - k, S = C; } } else if (f < y) { if (x += u + f - y, (y -= f) < w) { for (w -= y; C[s++] = c[x++], --y;); if (x = 0, f < w) { for (w -= y = f; C[s++] = c[x++], --y;); x = s - k, S = C; } } } else if (x += f - y, y < w) { for (w -= y; C[s++] = c[x++], --y;); x = s - k, S = C; } for (; 2 < w;) C[s++] = S[x++], C[s++] = S[x++], C[s++] = S[x++], w -= 3; w && (C[s++] = S[x++], 1 < w && (C[s++] = S[x++])); } else { for (x = s - k; C[s++] = C[x++], C[s++] = C[x++], C[s++] = C[x++], 2 < (w -= 3);); w && (C[s++] = C[x++], 1 < w && (C[s++] = C[x++])); } break; } } break; } } while (n < i && s < o); n -= w = p >> 3, d &= (1 << (p -= w << 3)) - 1, e.next_in = n, e.next_out = s, e.avail_in = n < i ? i - n + 5 : 5 - (n - i), e.avail_out = s < o ? o - s + 257 : 257 - (s - o), r.hold = d, r.bits = p; }; }, {}], 49: [function (e, t, r) { "use strict"; var I = e("../utils/common"), O = e("./adler32"), B = e("./crc32"), R = e("./inffast"), T = e("./inftrees"), D = 1, F = 2, N = 0, U = -2, P = 1, n = 852, i = 592; function L(e) { return (e >>> 24 & 255) + (e >>> 8 & 65280) + ((65280 & e) << 8) + ((255 & e) << 24); } function s() { this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new I.Buf16(320), this.work = new I.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0; } function a(e) { var t; return e && e.state ? (t = e.state, e.total_in = e.total_out = t.total = 0, e.msg = "", t.wrap && (e.adler = 1 & t.wrap), t.mode = P, t.last = 0, t.havedict = 0, t.dmax = 32768, t.head = null, t.hold = 0, t.bits = 0, t.lencode = t.lendyn = new I.Buf32(n), t.distcode = t.distdyn = new I.Buf32(i), t.sane = 1, t.back = -1, N) : U; } function o(e) { var t; return e && e.state ? ((t = e.state).wsize = 0, t.whave = 0, t.wnext = 0, a(e)) : U; } function h(e, t) { var r, n; return e && e.state ? (n = e.state, t < 0 ? (r = 0, t = -t) : (r = 1 + (t >> 4), t < 48 && (t &= 15)), t && (t < 8 || 15 < t) ? U : (null !== n.window && n.wbits !== t && (n.window = null), n.wrap = r, n.wbits = t, o(e))) : U; } function u(e, t) { var r, n; return e ? (n = new s(), (e.state = n).window = null, (r = h(e, t)) !== N && (e.state = null), r) : U; } var l, f, c = !0; function j(e) { if (c) { var t; for (l = new I.Buf32(512), f = new I.Buf32(32), t = 0; t < 144;) e.lens[t++] = 8; for (; t < 256;) e.lens[t++] = 9; for (; t < 280;) e.lens[t++] = 7; for (; t < 288;) e.lens[t++] = 8; for (T(D, e.lens, 0, 288, l, 0, e.work, { bits: 9 }), t = 0; t < 32;) e.lens[t++] = 5; T(F, e.lens, 0, 32, f, 0, e.work, { bits: 5 }), c = !1; } e.lencode = l, e.lenbits = 9, e.distcode = f, e.distbits = 5; } function Z(e, t, r, n) { var i, s = e.state; return null === s.window && (s.wsize = 1 << s.wbits, s.wnext = 0, s.whave = 0, s.window = new I.Buf8(s.wsize)), n >= s.wsize ? (I.arraySet(s.window, t, r - s.wsize, s.wsize, 0), s.wnext = 0, s.whave = s.wsize) : (n < (i = s.wsize - s.wnext) && (i = n), I.arraySet(s.window, t, r - n, i, s.wnext), (n -= i) ? (I.arraySet(s.window, t, r - n, n, 0), s.wnext = n, s.whave = s.wsize) : (s.wnext += i, s.wnext === s.wsize && (s.wnext = 0), s.whave < s.wsize && (s.whave += i))), 0; } r.inflateReset = o, r.inflateReset2 = h, r.inflateResetKeep = a, r.inflateInit = function (e) { return u(e, 15); }, r.inflateInit2 = u, r.inflate = function (e, t) { var r, n, i, s, a, o, h, u, l, f, c, d, p, m, _, g, b, v, y, w, k, x, S, z, C = 0, E = new I.Buf8(4), A = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]; if (!e || !e.state || !e.output || !e.input && 0 !== e.avail_in) return U; 12 === (r = e.state).mode && (r.mode = 13), a = e.next_out, i = e.output, h = e.avail_out, s = e.next_in, n = e.input, o = e.avail_in, u = r.hold, l = r.bits, f = o, c = h, x = N; e: for (;;) switch (r.mode) { case P: if (0 === r.wrap) { r.mode = 13; break; } for (; l < 16;) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } if (2 & r.wrap && 35615 === u) { E[r.check = 0] = 255 & u, E[1] = u >>> 8 & 255, r.check = B(r.check, E, 2, 0), l = u = 0, r.mode = 2; break; } if (r.flags = 0, r.head && (r.head.done = !1), !(1 & r.wrap) || (((255 & u) << 8) + (u >> 8)) % 31) { e.msg = "incorrect header check", r.mode = 30; break; } if (8 != (15 & u)) { e.msg = "unknown compression method", r.mode = 30; break; } if (l -= 4, k = 8 + (15 & (u >>>= 4)), 0 === r.wbits) r.wbits = k;else if (k > r.wbits) { e.msg = "invalid window size", r.mode = 30; break; } r.dmax = 1 << k, e.adler = r.check = 1, r.mode = 512 & u ? 10 : 12, l = u = 0; break; case 2: for (; l < 16;) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } if (r.flags = u, 8 != (255 & r.flags)) { e.msg = "unknown compression method", r.mode = 30; break; } if (57344 & r.flags) { e.msg = "unknown header flags set", r.mode = 30; break; } r.head && (r.head.text = u >> 8 & 1), 512 & r.flags && (E[0] = 255 & u, E[1] = u >>> 8 & 255, r.check = B(r.check, E, 2, 0)), l = u = 0, r.mode = 3; case 3: for (; l < 32;) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } r.head && (r.head.time = u), 512 & r.flags && (E[0] = 255 & u, E[1] = u >>> 8 & 255, E[2] = u >>> 16 & 255, E[3] = u >>> 24 & 255, r.check = B(r.check, E, 4, 0)), l = u = 0, r.mode = 4; case 4: for (; l < 16;) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } r.head && (r.head.xflags = 255 & u, r.head.os = u >> 8), 512 & r.flags && (E[0] = 255 & u, E[1] = u >>> 8 & 255, r.check = B(r.check, E, 2, 0)), l = u = 0, r.mode = 5; case 5: if (1024 & r.flags) { for (; l < 16;) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } r.length = u, r.head && (r.head.extra_len = u), 512 & r.flags && (E[0] = 255 & u, E[1] = u >>> 8 & 255, r.check = B(r.check, E, 2, 0)), l = u = 0; } else r.head && (r.head.extra = null); r.mode = 6; case 6: if (1024 & r.flags && (o < (d = r.length) && (d = o), d && (r.head && (k = r.head.extra_len - r.length, r.head.extra || (r.head.extra = new Array(r.head.extra_len)), I.arraySet(r.head.extra, n, s, d, k)), 512 & r.flags && (r.check = B(r.check, n, d, s)), o -= d, s += d, r.length -= d), r.length)) break e; r.length = 0, r.mode = 7; case 7: if (2048 & r.flags) { if (0 === o) break e; for (d = 0; k = n[s + d++], r.head && k && r.length < 65536 && (r.head.name += String.fromCharCode(k)), k && d < o;); if (512 & r.flags && (r.check = B(r.check, n, d, s)), o -= d, s += d, k) break e; } else r.head && (r.head.name = null); r.length = 0, r.mode = 8; case 8: if (4096 & r.flags) { if (0 === o) break e; for (d = 0; k = n[s + d++], r.head && k && r.length < 65536 && (r.head.comment += String.fromCharCode(k)), k && d < o;); if (512 & r.flags && (r.check = B(r.check, n, d, s)), o -= d, s += d, k) break e; } else r.head && (r.head.comment = null); r.mode = 9; case 9: if (512 & r.flags) { for (; l < 16;) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } if (u !== (65535 & r.check)) { e.msg = "header crc mismatch", r.mode = 30; break; } l = u = 0; } r.head && (r.head.hcrc = r.flags >> 9 & 1, r.head.done = !0), e.adler = r.check = 0, r.mode = 12; break; case 10: for (; l < 32;) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } e.adler = r.check = L(u), l = u = 0, r.mode = 11; case 11: if (0 === r.havedict) return e.next_out = a, e.avail_out = h, e.next_in = s, e.avail_in = o, r.hold = u, r.bits = l, 2; e.adler = r.check = 1, r.mode = 12; case 12: if (5 === t || 6 === t) break e; case 13: if (r.last) { u >>>= 7 & l, l -= 7 & l, r.mode = 27; break; } for (; l < 3;) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } switch (r.last = 1 & u, l -= 1, 3 & (u >>>= 1)) { case 0: r.mode = 14; break; case 1: if (j(r), r.mode = 20, 6 !== t) break; u >>>= 2, l -= 2; break e; case 2: r.mode = 17; break; case 3: e.msg = "invalid block type", r.mode = 30; } u >>>= 2, l -= 2; break; case 14: for (u >>>= 7 & l, l -= 7 & l; l < 32;) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } if ((65535 & u) != (u >>> 16 ^ 65535)) { e.msg = "invalid stored block lengths", r.mode = 30; break; } if (r.length = 65535 & u, l = u = 0, r.mode = 15, 6 === t) break e; case 15: r.mode = 16; case 16: if (d = r.length) { if (o < d && (d = o), h < d && (d = h), 0 === d) break e; I.arraySet(i, n, s, d, a), o -= d, s += d, h -= d, a += d, r.length -= d; break; } r.mode = 12; break; case 17: for (; l < 14;) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } if (r.nlen = 257 + (31 & u), u >>>= 5, l -= 5, r.ndist = 1 + (31 & u), u >>>= 5, l -= 5, r.ncode = 4 + (15 & u), u >>>= 4, l -= 4, 286 < r.nlen || 30 < r.ndist) { e.msg = "too many length or distance symbols", r.mode = 30; break; } r.have = 0, r.mode = 18; case 18: for (; r.have < r.ncode;) { for (; l < 3;) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } r.lens[A[r.have++]] = 7 & u, u >>>= 3, l -= 3; } for (; r.have < 19;) r.lens[A[r.have++]] = 0; if (r.lencode = r.lendyn, r.lenbits = 7, S = { bits: r.lenbits }, x = T(0, r.lens, 0, 19, r.lencode, 0, r.work, S), r.lenbits = S.bits, x) { e.msg = "invalid code lengths set", r.mode = 30; break; } r.have = 0, r.mode = 19; case 19: for (; r.have < r.nlen + r.ndist;) { for (; g = (C = r.lencode[u & (1 << r.lenbits) - 1]) >>> 16 & 255, b = 65535 & C, !((_ = C >>> 24) <= l);) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } if (b < 16) u >>>= _, l -= _, r.lens[r.have++] = b;else { if (16 === b) { for (z = _ + 2; l < z;) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } if (u >>>= _, l -= _, 0 === r.have) { e.msg = "invalid bit length repeat", r.mode = 30; break; } k = r.lens[r.have - 1], d = 3 + (3 & u), u >>>= 2, l -= 2; } else if (17 === b) { for (z = _ + 3; l < z;) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } l -= _, k = 0, d = 3 + (7 & (u >>>= _)), u >>>= 3, l -= 3; } else { for (z = _ + 7; l < z;) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } l -= _, k = 0, d = 11 + (127 & (u >>>= _)), u >>>= 7, l -= 7; } if (r.have + d > r.nlen + r.ndist) { e.msg = "invalid bit length repeat", r.mode = 30; break; } for (; d--;) r.lens[r.have++] = k; } } if (30 === r.mode) break; if (0 === r.lens[256]) { e.msg = "invalid code -- missing end-of-block", r.mode = 30; break; } if (r.lenbits = 9, S = { bits: r.lenbits }, x = T(D, r.lens, 0, r.nlen, r.lencode, 0, r.work, S), r.lenbits = S.bits, x) { e.msg = "invalid literal/lengths set", r.mode = 30; break; } if (r.distbits = 6, r.distcode = r.distdyn, S = { bits: r.distbits }, x = T(F, r.lens, r.nlen, r.ndist, r.distcode, 0, r.work, S), r.distbits = S.bits, x) { e.msg = "invalid distances set", r.mode = 30; break; } if (r.mode = 20, 6 === t) break e; case 20: r.mode = 21; case 21: if (6 <= o && 258 <= h) { e.next_out = a, e.avail_out = h, e.next_in = s, e.avail_in = o, r.hold = u, r.bits = l, R(e, c), a = e.next_out, i = e.output, h = e.avail_out, s = e.next_in, n = e.input, o = e.avail_in, u = r.hold, l = r.bits, 12 === r.mode && (r.back = -1); break; } for (r.back = 0; g = (C = r.lencode[u & (1 << r.lenbits) - 1]) >>> 16 & 255, b = 65535 & C, !((_ = C >>> 24) <= l);) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } if (g && 0 == (240 & g)) { for (v = _, y = g, w = b; g = (C = r.lencode[w + ((u & (1 << v + y) - 1) >> v)]) >>> 16 & 255, b = 65535 & C, !(v + (_ = C >>> 24) <= l);) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } u >>>= v, l -= v, r.back += v; } if (u >>>= _, l -= _, r.back += _, r.length = b, 0 === g) { r.mode = 26; break; } if (32 & g) { r.back = -1, r.mode = 12; break; } if (64 & g) { e.msg = "invalid literal/length code", r.mode = 30; break; } r.extra = 15 & g, r.mode = 22; case 22: if (r.extra) { for (z = r.extra; l < z;) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } r.length += u & (1 << r.extra) - 1, u >>>= r.extra, l -= r.extra, r.back += r.extra; } r.was = r.length, r.mode = 23; case 23: for (; g = (C = r.distcode[u & (1 << r.distbits) - 1]) >>> 16 & 255, b = 65535 & C, !((_ = C >>> 24) <= l);) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } if (0 == (240 & g)) { for (v = _, y = g, w = b; g = (C = r.distcode[w + ((u & (1 << v + y) - 1) >> v)]) >>> 16 & 255, b = 65535 & C, !(v + (_ = C >>> 24) <= l);) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } u >>>= v, l -= v, r.back += v; } if (u >>>= _, l -= _, r.back += _, 64 & g) { e.msg = "invalid distance code", r.mode = 30; break; } r.offset = b, r.extra = 15 & g, r.mode = 24; case 24: if (r.extra) { for (z = r.extra; l < z;) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } r.offset += u & (1 << r.extra) - 1, u >>>= r.extra, l -= r.extra, r.back += r.extra; } if (r.offset > r.dmax) { e.msg = "invalid distance too far back", r.mode = 30; break; } r.mode = 25; case 25: if (0 === h) break e; if (d = c - h, r.offset > d) { if ((d = r.offset - d) > r.whave && r.sane) { e.msg = "invalid distance too far back", r.mode = 30; break; } p = d > r.wnext ? (d -= r.wnext, r.wsize - d) : r.wnext - d, d > r.length && (d = r.length), m = r.window; } else m = i, p = a - r.offset, d = r.length; for (h < d && (d = h), h -= d, r.length -= d; i[a++] = m[p++], --d;); 0 === r.length && (r.mode = 21); break; case 26: if (0 === h) break e; i[a++] = r.length, h--, r.mode = 21; break; case 27: if (r.wrap) { for (; l < 32;) { if (0 === o) break e; o--, u |= n[s++] << l, l += 8; } if (c -= h, e.total_out += c, r.total += c, c && (e.adler = r.check = r.flags ? B(r.check, i, c, a - c) : O(r.check, i, c, a - c)), c = h, (r.flags ? u : L(u)) !== r.check) { e.msg = "incorrect data check", r.mode = 30; break; } l = u = 0; } r.mode = 28; case 28: if (r.wrap && r.flags) { for (; l < 32;) { if (0 === o) break e; o--, u += n[s++] << l, l += 8; } if (u !== (4294967295 & r.total)) { e.msg = "incorrect length check", r.mode = 30; break; } l = u = 0; } r.mode = 29; case 29: x = 1; break e; case 30: x = -3; break e; case 31: return -4; case 32: default: return U; } return e.next_out = a, e.avail_out = h, e.next_in = s, e.avail_in = o, r.hold = u, r.bits = l, (r.wsize || c !== e.avail_out && r.mode < 30 && (r.mode < 27 || 4 !== t)) && Z(e, e.output, e.next_out, c - e.avail_out) ? (r.mode = 31, -4) : (f -= e.avail_in, c -= e.avail_out, e.total_in += f, e.total_out += c, r.total += c, r.wrap && c && (e.adler = r.check = r.flags ? B(r.check, i, c, e.next_out - c) : O(r.check, i, c, e.next_out - c)), e.data_type = r.bits + (r.last ? 64 : 0) + (12 === r.mode ? 128 : 0) + (20 === r.mode || 15 === r.mode ? 256 : 0), (0 == f && 0 === c || 4 === t) && x === N && (x = -5), x); }, r.inflateEnd = function (e) { if (!e || !e.state) return U; var t = e.state; return t.window && (t.window = null), e.state = null, N; }, r.inflateGetHeader = function (e, t) { var r; return e && e.state ? 0 == (2 & (r = e.state).wrap) ? U : ((r.head = t).done = !1, N) : U; }, r.inflateSetDictionary = function (e, t) { var r, n = t.length; return e && e.state ? 0 !== (r = e.state).wrap && 11 !== r.mode ? U : 11 === r.mode && O(1, t, n, 0) !== r.check ? -3 : Z(e, t, n, n) ? (r.mode = 31, -4) : (r.havedict = 1, N) : U; }, r.inflateInfo = "pako inflate (from Nodeca project)"; }, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./inffast": 48, "./inftrees": 50 }], 50: [function (e, t, r) { "use strict"; var D = e("../utils/common"), F = [3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0], N = [16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 72, 78], U = [1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0], P = [16, 16, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 64, 64]; t.exports = function (e, t, r, n, i, s, a, o) { var h, u, l, f, c, d, p, m, _, g = o.bits, b = 0, v = 0, y = 0, w = 0, k = 0, x = 0, S = 0, z = 0, C = 0, E = 0, A = null, I = 0, O = new D.Buf16(16), B = new D.Buf16(16), R = null, T = 0; for (b = 0; b <= 15; b++) O[b] = 0; for (v = 0; v < n; v++) O[t[r + v]]++; for (k = g, w = 15; 1 <= w && 0 === O[w]; w--); if (w < k && (k = w), 0 === w) return i[s++] = 20971520, i[s++] = 20971520, o.bits = 1, 0; for (y = 1; y < w && 0 === O[y]; y++); for (k < y && (k = y), b = z = 1; b <= 15; b++) if (z <<= 1, (z -= O[b]) < 0) return -1; if (0 < z && (0 === e || 1 !== w)) return -1; for (B[1] = 0, b = 1; b < 15; b++) B[b + 1] = B[b] + O[b]; for (v = 0; v < n; v++) 0 !== t[r + v] && (a[B[t[r + v]]++] = v); if (d = 0 === e ? (A = R = a, 19) : 1 === e ? (A = F, I -= 257, R = N, T -= 257, 256) : (A = U, R = P, -1), b = y, c = s, S = v = E = 0, l = -1, f = (C = 1 << (x = k)) - 1, 1 === e && 852 < C || 2 === e && 592 < C) return 1; for (;;) { for (p = b - S, _ = a[v] < d ? (m = 0, a[v]) : a[v] > d ? (m = R[T + a[v]], A[I + a[v]]) : (m = 96, 0), h = 1 << b - S, y = u = 1 << x; i[c + (E >> S) + (u -= h)] = p << 24 | m << 16 | _ | 0, 0 !== u;); for (h = 1 << b - 1; E & h;) h >>= 1; if (0 !== h ? (E &= h - 1, E += h) : E = 0, v++, 0 == --O[b]) { if (b === w) break; b = t[r + a[v]]; } if (k < b && (E & f) !== l) { for (0 === S && (S = k), c += y, z = 1 << (x = b - S); x + S < w && !((z -= O[x + S]) <= 0);) x++, z <<= 1; if (C += 1 << x, 1 === e && 852 < C || 2 === e && 592 < C) return 1; i[l = E & f] = k << 24 | x << 16 | c - s | 0; } } return 0 !== E && (i[c + E] = b - S << 24 | 64 << 16 | 0), o.bits = k, 0; }; }, { "../utils/common": 41 }], 51: [function (e, t, r) { "use strict"; t.exports = { 2: "need dictionary", 1: "stream end", 0: "", "-1": "file error", "-2": "stream error", "-3": "data error", "-4": "insufficient memory", "-5": "buffer error", "-6": "incompatible version" }; }, {}], 52: [function (e, t, r) { "use strict"; var i = e("../utils/common"), o = 0, h = 1; function n(e) { for (var t = e.length; 0 <= --t;) e[t] = 0; } var s = 0, a = 29, u = 256, l = u + 1 + a, f = 30, c = 19, _ = 2 * l + 1, g = 15, d = 16, p = 7, m = 256, b = 16, v = 17, y = 18, w = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], k = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13], x = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], S = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], z = new Array(2 * (l + 2)); n(z); var C = new Array(2 * f); n(C); var E = new Array(512); n(E); var A = new Array(256); n(A); var I = new Array(a); n(I); var O, B, R, T = new Array(f); function D(e, t, r, n, i) { this.static_tree = e, this.extra_bits = t, this.extra_base = r, this.elems = n, this.max_length = i, this.has_stree = e && e.length; } function F(e, t) { this.dyn_tree = e, this.max_code = 0, this.stat_desc = t; } function N(e) { return e < 256 ? E[e] : E[256 + (e >>> 7)]; } function U(e, t) { e.pending_buf[e.pending++] = 255 & t, e.pending_buf[e.pending++] = t >>> 8 & 255; } function P(e, t, r) { e.bi_valid > d - r ? (e.bi_buf |= t << e.bi_valid & 65535, U(e, e.bi_buf), e.bi_buf = t >> d - e.bi_valid, e.bi_valid += r - d) : (e.bi_buf |= t << e.bi_valid & 65535, e.bi_valid += r); } function L(e, t, r) { P(e, r[2 * t], r[2 * t + 1]); } function j(e, t) { for (var r = 0; r |= 1 & e, e >>>= 1, r <<= 1, 0 < --t;); return r >>> 1; } function Z(e, t, r) { var n, i, s = new Array(g + 1), a = 0; for (n = 1; n <= g; n++) s[n] = a = a + r[n - 1] << 1; for (i = 0; i <= t; i++) { var o = e[2 * i + 1]; 0 !== o && (e[2 * i] = j(s[o]++, o)); } } function W(e) { var t; for (t = 0; t < l; t++) e.dyn_ltree[2 * t] = 0; for (t = 0; t < f; t++) e.dyn_dtree[2 * t] = 0; for (t = 0; t < c; t++) e.bl_tree[2 * t] = 0; e.dyn_ltree[2 * m] = 1, e.opt_len = e.static_len = 0, e.last_lit = e.matches = 0; } function M(e) { 8 < e.bi_valid ? U(e, e.bi_buf) : 0 < e.bi_valid && (e.pending_buf[e.pending++] = e.bi_buf), e.bi_buf = 0, e.bi_valid = 0; } function H(e, t, r, n) { var i = 2 * t, s = 2 * r; return e[i] < e[s] || e[i] === e[s] && n[t] <= n[r]; } function G(e, t, r) { for (var n = e.heap[r], i = r << 1; i <= e.heap_len && (i < e.heap_len && H(t, e.heap[i + 1], e.heap[i], e.depth) && i++, !H(t, n, e.heap[i], e.depth));) e.heap[r] = e.heap[i], r = i, i <<= 1; e.heap[r] = n; } function K(e, t, r) { var n, i, s, a, o = 0; if (0 !== e.last_lit) for (; n = e.pending_buf[e.d_buf + 2 * o] << 8 | e.pending_buf[e.d_buf + 2 * o + 1], i = e.pending_buf[e.l_buf + o], o++, 0 === n ? L(e, i, t) : (L(e, (s = A[i]) + u + 1, t), 0 !== (a = w[s]) && P(e, i -= I[s], a), L(e, s = N(--n), r), 0 !== (a = k[s]) && P(e, n -= T[s], a)), o < e.last_lit;); L(e, m, t); } function Y(e, t) { var r, n, i, s = t.dyn_tree, a = t.stat_desc.static_tree, o = t.stat_desc.has_stree, h = t.stat_desc.elems, u = -1; for (e.heap_len = 0, e.heap_max = _, r = 0; r < h; r++) 0 !== s[2 * r] ? (e.heap[++e.heap_len] = u = r, e.depth[r] = 0) : s[2 * r + 1] = 0; for (; e.heap_len < 2;) s[2 * (i = e.heap[++e.heap_len] = u < 2 ? ++u : 0)] = 1, e.depth[i] = 0, e.opt_len--, o && (e.static_len -= a[2 * i + 1]); for (t.max_code = u, r = e.heap_len >> 1; 1 <= r; r--) G(e, s, r); for (i = h; r = e.heap[1], e.heap[1] = e.heap[e.heap_len--], G(e, s, 1), n = e.heap[1], e.heap[--e.heap_max] = r, e.heap[--e.heap_max] = n, s[2 * i] = s[2 * r] + s[2 * n], e.depth[i] = (e.depth[r] >= e.depth[n] ? e.depth[r] : e.depth[n]) + 1, s[2 * r + 1] = s[2 * n + 1] = i, e.heap[1] = i++, G(e, s, 1), 2 <= e.heap_len;); e.heap[--e.heap_max] = e.heap[1], function (e, t) { var r, n, i, s, a, o, h = t.dyn_tree, u = t.max_code, l = t.stat_desc.static_tree, f = t.stat_desc.has_stree, c = t.stat_desc.extra_bits, d = t.stat_desc.extra_base, p = t.stat_desc.max_length, m = 0; for (s = 0; s <= g; s++) e.bl_count[s] = 0; for (h[2 * e.heap[e.heap_max] + 1] = 0, r = e.heap_max + 1; r < _; r++) p < (s = h[2 * h[2 * (n = e.heap[r]) + 1] + 1] + 1) && (s = p, m++), h[2 * n + 1] = s, u < n || (e.bl_count[s]++, a = 0, d <= n && (a = c[n - d]), o = h[2 * n], e.opt_len += o * (s + a), f && (e.static_len += o * (l[2 * n + 1] + a))); if (0 !== m) { do { for (s = p - 1; 0 === e.bl_count[s];) s--; e.bl_count[s]--, e.bl_count[s + 1] += 2, e.bl_count[p]--, m -= 2; } while (0 < m); for (s = p; 0 !== s; s--) for (n = e.bl_count[s]; 0 !== n;) u < (i = e.heap[--r]) || (h[2 * i + 1] !== s && (e.opt_len += (s - h[2 * i + 1]) * h[2 * i], h[2 * i + 1] = s), n--); } }(e, t), Z(s, u, e.bl_count); } function X(e, t, r) { var n, i, s = -1, a = t[1], o = 0, h = 7, u = 4; for (0 === a && (h = 138, u = 3), t[2 * (r + 1) + 1] = 65535, n = 0; n <= r; n++) i = a, a = t[2 * (n + 1) + 1], ++o < h && i === a || (o < u ? e.bl_tree[2 * i] += o : 0 !== i ? (i !== s && e.bl_tree[2 * i]++, e.bl_tree[2 * b]++) : o <= 10 ? e.bl_tree[2 * v]++ : e.bl_tree[2 * y]++, s = i, u = (o = 0) === a ? (h = 138, 3) : i === a ? (h = 6, 3) : (h = 7, 4)); } function V(e, t, r) { var n, i, s = -1, a = t[1], o = 0, h = 7, u = 4; for (0 === a && (h = 138, u = 3), n = 0; n <= r; n++) if (i = a, a = t[2 * (n + 1) + 1], !(++o < h && i === a)) { if (o < u) for (; L(e, i, e.bl_tree), 0 != --o;);else 0 !== i ? (i !== s && (L(e, i, e.bl_tree), o--), L(e, b, e.bl_tree), P(e, o - 3, 2)) : o <= 10 ? (L(e, v, e.bl_tree), P(e, o - 3, 3)) : (L(e, y, e.bl_tree), P(e, o - 11, 7)); s = i, u = (o = 0) === a ? (h = 138, 3) : i === a ? (h = 6, 3) : (h = 7, 4); } } n(T); var q = !1; function J(e, t, r, n) { P(e, (s << 1) + (n ? 1 : 0), 3), function (e, t, r, n) { M(e), n && (U(e, r), U(e, ~r)), i.arraySet(e.pending_buf, e.window, t, r, e.pending), e.pending += r; }(e, t, r, !0); } r._tr_init = function (e) { q || (function () { var e, t, r, n, i, s = new Array(g + 1); for (n = r = 0; n < a - 1; n++) for (I[n] = r, e = 0; e < 1 << w[n]; e++) A[r++] = n; for (A[r - 1] = n, n = i = 0; n < 16; n++) for (T[n] = i, e = 0; e < 1 << k[n]; e++) E[i++] = n; for (i >>= 7; n < f; n++) for (T[n] = i << 7, e = 0; e < 1 << k[n] - 7; e++) E[256 + i++] = n; for (t = 0; t <= g; t++) s[t] = 0; for (e = 0; e <= 143;) z[2 * e + 1] = 8, e++, s[8]++; for (; e <= 255;) z[2 * e + 1] = 9, e++, s[9]++; for (; e <= 279;) z[2 * e + 1] = 7, e++, s[7]++; for (; e <= 287;) z[2 * e + 1] = 8, e++, s[8]++; for (Z(z, l + 1, s), e = 0; e < f; e++) C[2 * e + 1] = 5, C[2 * e] = j(e, 5); O = new D(z, w, u + 1, l, g), B = new D(C, k, 0, f, g), R = new D(new Array(0), x, 0, c, p); }(), q = !0), e.l_desc = new F(e.dyn_ltree, O), e.d_desc = new F(e.dyn_dtree, B), e.bl_desc = new F(e.bl_tree, R), e.bi_buf = 0, e.bi_valid = 0, W(e); }, r._tr_stored_block = J, r._tr_flush_block = function (e, t, r, n) { var i, s, a = 0; 0 < e.level ? (2 === e.strm.data_type && (e.strm.data_type = function (e) { var t, r = 4093624447; for (t = 0; t <= 31; t++, r >>>= 1) if (1 & r && 0 !== e.dyn_ltree[2 * t]) return o; if (0 !== e.dyn_ltree[18] || 0 !== e.dyn_ltree[20] || 0 !== e.dyn_ltree[26]) return h; for (t = 32; t < u; t++) if (0 !== e.dyn_ltree[2 * t]) return h; return o; }(e)), Y(e, e.l_desc), Y(e, e.d_desc), a = function (e) { var t; for (X(e, e.dyn_ltree, e.l_desc.max_code), X(e, e.dyn_dtree, e.d_desc.max_code), Y(e, e.bl_desc), t = c - 1; 3 <= t && 0 === e.bl_tree[2 * S[t] + 1]; t--); return e.opt_len += 3 * (t + 1) + 5 + 5 + 4, t; }(e), i = e.opt_len + 3 + 7 >>> 3, (s = e.static_len + 3 + 7 >>> 3) <= i && (i = s)) : i = s = r + 5, r + 4 <= i && -1 !== t ? J(e, t, r, n) : 4 === e.strategy || s === i ? (P(e, 2 + (n ? 1 : 0), 3), K(e, z, C)) : (P(e, 4 + (n ? 1 : 0), 3), function (e, t, r, n) { var i; for (P(e, t - 257, 5), P(e, r - 1, 5), P(e, n - 4, 4), i = 0; i < n; i++) P(e, e.bl_tree[2 * S[i] + 1], 3); V(e, e.dyn_ltree, t - 1), V(e, e.dyn_dtree, r - 1); }(e, e.l_desc.max_code + 1, e.d_desc.max_code + 1, a + 1), K(e, e.dyn_ltree, e.dyn_dtree)), W(e), n && M(e); }, r._tr_tally = function (e, t, r) { return e.pending_buf[e.d_buf + 2 * e.last_lit] = t >>> 8 & 255, e.pending_buf[e.d_buf + 2 * e.last_lit + 1] = 255 & t, e.pending_buf[e.l_buf + e.last_lit] = 255 & r, e.last_lit++, 0 === t ? e.dyn_ltree[2 * r]++ : (e.matches++, t--, e.dyn_ltree[2 * (A[r] + u + 1)]++, e.dyn_dtree[2 * N(t)]++), e.last_lit === e.lit_bufsize - 1; }, r._tr_align = function (e) { P(e, 2, 3), L(e, m, z), function (e) { 16 === e.bi_valid ? (U(e, e.bi_buf), e.bi_buf = 0, e.bi_valid = 0) : 8 <= e.bi_valid && (e.pending_buf[e.pending++] = 255 & e.bi_buf, e.bi_buf >>= 8, e.bi_valid -= 8); }(e); }; }, { "../utils/common": 41 }], 53: [function (e, t, r) { "use strict"; t.exports = function () { this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0; }; }, {}], 54: [function (e, t, r) { (function (e) { !function (r, n) { "use strict"; if (!r.setImmediate) { var i, s, t, a, o = 1, h = {}, u = !1, l = r.document, e = Object.getPrototypeOf && Object.getPrototypeOf(r); e = e && e.setTimeout ? e : r, i = "[object process]" === {}.toString.call(r.process) ? function (e) { process.nextTick(function () { c(e); }); } : function () { if (r.postMessage && !r.importScripts) { var e = !0, t = r.onmessage; return r.onmessage = function () { e = !1; }, r.postMessage("", "*"), r.onmessage = t, e; } }() ? (a = "setImmediate$" + Math.random() + "$", r.addEventListener ? r.addEventListener("message", d, !1) : r.attachEvent("onmessage", d), function (e) { r.postMessage(a + e, "*"); }) : r.MessageChannel ? ((t = new MessageChannel()).port1.onmessage = function (e) { c(e.data); }, function (e) { t.port2.postMessage(e); }) : l && "onreadystatechange" in l.createElement("script") ? (s = l.documentElement, function (e) { var t = l.createElement("script"); t.onreadystatechange = function () { c(e), t.onreadystatechange = null, s.removeChild(t), t = null; }, s.appendChild(t); }) : function (e) { setTimeout(c, 0, e); }, e.setImmediate = function (e) { "function" != typeof e && (e = new Function("" + e)); for (var t = new Array(arguments.length - 1), r = 0; r < t.length; r++) t[r] = arguments[r + 1]; var n = { callback: e, args: t }; return h[o] = n, i(o), o++; }, e.clearImmediate = f; } function f(e) { delete h[e]; } function c(e) { if (u) setTimeout(c, 0, e);else { var t = h[e]; if (t) { u = !0; try { !function (e) { var t = e.callback, r = e.args; switch (r.length) { case 0: t(); break; case 1: t(r[0]); break; case 2: t(r[0], r[1]); break; case 3: t(r[0], r[1], r[2]); break; default: t.apply(n, r); } }(t); } finally { f(e), u = !1; } } } } function d(e) { e.source === r && "string" == typeof e.data && 0 === e.data.indexOf(a) && c(+e.data.slice(a.length)); } }("undefined" == typeof self ? void 0 === e ? this : e : self); }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}); }, {}] }, {}, [10])(10); }); /***/ }, /***/ 42211 /*!******************************************!*\ !*** ./node_modules/lodash.get/index.js ***! \******************************************/ (module) { /** * lodash (Custom Build) * Build: `lodash modularize exports="npm" -o ./` * Copyright jQuery Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ /** Used as the `TypeError` message for "Functions" methods. */ var FUNC_ERROR_TEXT = 'Expected a function'; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used as references for various `Number` constants. */ var INFINITY = 1 / 0; /** `Object#toString` result references. */ var funcTag = '[object Function]', genTag = '[object GeneratorFunction]', symbolTag = '[object Symbol]'; /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, reLeadingDot = /^\./, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** * Used to match `RegExp` * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; /** Used to detect host constructors (Safari). */ var reIsHostCtor = /^\[object .+?Constructor\]$/; /** Detect free variable `global` from Node.js. */ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; /** Detect free variable `self`. */ var freeSelf = typeof self == 'object' && self && self.Object === Object && self; /** Used as a reference to the global object. */ var root = freeGlobal || freeSelf || Function('return this')(); /** * Gets the value at `key` of `object`. * * @private * @param {Object} [object] The object to query. * @param {string} key The key of the property to get. * @returns {*} Returns the property value. */ function getValue(object, key) { return object == null ? undefined : object[key]; } /** * Checks if `value` is a host object in IE < 9. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a host object, else `false`. */ function isHostObject(value) { // Many host objects are `Object` objects that can coerce to strings // despite having improperly defined `toString` methods. var result = false; if (value != null && typeof value.toString != 'function') { try { result = !!(value + ''); } catch (e) {} } return result; } /** Used for built-in method references. */ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype; /** Used to detect overreaching core-js shims. */ var coreJsData = root['__core-js_shared__']; /** Used to detect methods masquerading as native. */ var maskSrcKey = function () { var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); return uid ? 'Symbol(src)_1.' + uid : ''; }(); /** Used to resolve the decompiled source of functions. */ var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; /** Used to detect if a method is native. */ var reIsNative = RegExp('^' + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); /** Built-in value references. */ var Symbol = root.Symbol, splice = arrayProto.splice; /* Built-in method references that are verified to be native. */ var Map = getNative(root, 'Map'), nativeCreate = getNative(Object, 'create'); /** Used to convert symbols to primitives and strings. */ var symbolProto = Symbol ? Symbol.prototype : undefined, symbolToString = symbolProto ? symbolProto.toString : undefined; /** * Creates a hash object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function Hash(entries) { var index = -1, length = entries ? entries.length : 0; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the hash. * * @private * @name clear * @memberOf Hash */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; } /** * Removes `key` and its value from the hash. * * @private * @name delete * @memberOf Hash * @param {Object} hash The hash to modify. * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { return this.has(key) && delete this.__data__[key]; } /** * Gets the hash value for `key`. * * @private * @name get * @memberOf Hash * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function hashGet(key) { var data = this.__data__; if (nativeCreate) { var result = data[key]; return result === HASH_UNDEFINED ? undefined : result; } return hasOwnProperty.call(data, key) ? data[key] : undefined; } /** * Checks if a hash value for `key` exists. * * @private * @name has * @memberOf Hash * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function hashHas(key) { var data = this.__data__; return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); } /** * Sets the hash `key` to `value`. * * @private * @name set * @memberOf Hash * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the hash instance. */ function hashSet(key, value) { var data = this.__data__; data[key] = nativeCreate && value === undefined ? HASH_UNDEFINED : value; return this; } // Add methods to `Hash`. Hash.prototype.clear = hashClear; Hash.prototype['delete'] = hashDelete; Hash.prototype.get = hashGet; Hash.prototype.has = hashHas; Hash.prototype.set = hashSet; /** * Creates an list cache object. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function ListCache(entries) { var index = -1, length = entries ? entries.length : 0; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the list cache. * * @private * @name clear * @memberOf ListCache */ function listCacheClear() { this.__data__ = []; } /** * Removes `key` and its value from the list cache. * * @private * @name delete * @memberOf ListCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function listCacheDelete(key) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { return false; } var lastIndex = data.length - 1; if (index == lastIndex) { data.pop(); } else { splice.call(data, index, 1); } return true; } /** * Gets the list cache value for `key`. * * @private * @name get * @memberOf ListCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function listCacheGet(key) { var data = this.__data__, index = assocIndexOf(data, key); return index < 0 ? undefined : data[index][1]; } /** * Checks if a list cache value for `key` exists. * * @private * @name has * @memberOf ListCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function listCacheHas(key) { return assocIndexOf(this.__data__, key) > -1; } /** * Sets the list cache `key` to `value`. * * @private * @name set * @memberOf ListCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the list cache instance. */ function listCacheSet(key, value) { var data = this.__data__, index = assocIndexOf(data, key); if (index < 0) { data.push([key, value]); } else { data[index][1] = value; } return this; } // Add methods to `ListCache`. ListCache.prototype.clear = listCacheClear; ListCache.prototype['delete'] = listCacheDelete; ListCache.prototype.get = listCacheGet; ListCache.prototype.has = listCacheHas; ListCache.prototype.set = listCacheSet; /** * Creates a map cache object to store key-value pairs. * * @private * @constructor * @param {Array} [entries] The key-value pairs to cache. */ function MapCache(entries) { var index = -1, length = entries ? entries.length : 0; this.clear(); while (++index < length) { var entry = entries[index]; this.set(entry[0], entry[1]); } } /** * Removes all key-value entries from the map. * * @private * @name clear * @memberOf MapCache */ function mapCacheClear() { this.__data__ = { 'hash': new Hash(), 'map': new (Map || ListCache)(), 'string': new Hash() }; } /** * Removes `key` and its value from the map. * * @private * @name delete * @memberOf MapCache * @param {string} key The key of the value to remove. * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { return getMapData(this, key)['delete'](key); } /** * Gets the map value for `key`. * * @private * @name get * @memberOf MapCache * @param {string} key The key of the value to get. * @returns {*} Returns the entry value. */ function mapCacheGet(key) { return getMapData(this, key).get(key); } /** * Checks if a map value for `key` exists. * * @private * @name has * @memberOf MapCache * @param {string} key The key of the entry to check. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. */ function mapCacheHas(key) { return getMapData(this, key).has(key); } /** * Sets the map `key` to `value`. * * @private * @name set * @memberOf MapCache * @param {string} key The key of the value to set. * @param {*} value The value to set. * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { getMapData(this, key).set(key, value); return this; } // Add methods to `MapCache`. MapCache.prototype.clear = mapCacheClear; MapCache.prototype['delete'] = mapCacheDelete; MapCache.prototype.get = mapCacheGet; MapCache.prototype.has = mapCacheHas; MapCache.prototype.set = mapCacheSet; /** * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ function assocIndexOf(array, key) { var length = array.length; while (length--) { if (eq(array[length][0], key)) { return length; } } return -1; } /** * The base implementation of `_.get` without support for default values. * * @private * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @returns {*} Returns the resolved value. */ function baseGet(object, path) { path = isKey(path, object) ? [path] : castPath(path); var index = 0, length = path.length; while (object != null && index < length) { object = object[toKey(path[index++])]; } return index && index == length ? object : undefined; } /** * The base implementation of `_.isNative` without bad shim checks. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a native function, * else `false`. */ function baseIsNative(value) { if (!isObject(value) || isMasked(value)) { return false; } var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } /** * The base implementation of `_.toString` which doesn't convert nullish * values to empty strings. * * @private * @param {*} value The value to process. * @returns {string} Returns the string. */ function baseToString(value) { // Exit early for strings to avoid a performance hit in some environments. if (typeof value == 'string') { return value; } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } var result = value + ''; return result == '0' && 1 / value == -INFINITY ? '-0' : result; } /** * Casts `value` to a path array if it's not one. * * @private * @param {*} value The value to inspect. * @returns {Array} Returns the cast property path array. */ function castPath(value) { return isArray(value) ? value : stringToPath(value); } /** * Gets the data for `map`. * * @private * @param {Object} map The map to query. * @param {string} key The reference key. * @returns {*} Returns the map data. */ function getMapData(map, key) { var data = map.__data__; return isKeyable(key) ? data[typeof key == 'string' ? 'string' : 'hash'] : data.map; } /** * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. * @param {string} key The key of the method to get. * @returns {*} Returns the function if it's native, else `undefined`. */ function getNative(object, key) { var value = getValue(object, key); return baseIsNative(value) ? value : undefined; } /** * Checks if `value` is a property name and not a property path. * * @private * @param {*} value The value to check. * @param {Object} [object] The object to query keys on. * @returns {boolean} Returns `true` if `value` is a property name, else `false`. */ function isKey(value, object) { if (isArray(value)) { return false; } var type = typeof value; if (type == 'number' || type == 'symbol' || type == 'boolean' || value == null || isSymbol(value)) { return true; } return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object); } /** * Checks if `value` is suitable for use as unique object key. * * @private * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is suitable, else `false`. */ function isKeyable(value) { var type = typeof value; return type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean' ? value !== '__proto__' : value === null; } /** * Checks if `func` has its source masked. * * @private * @param {Function} func The function to check. * @returns {boolean} Returns `true` if `func` is masked, else `false`. */ function isMasked(func) { return !!maskSrcKey && maskSrcKey in func; } /** * Converts `string` to a property path array. * * @private * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ var stringToPath = memoize(function (string) { string = toString(string); var result = []; if (reLeadingDot.test(string)) { result.push(''); } string.replace(rePropName, function (match, number, quote, string) { result.push(quote ? string.replace(reEscapeChar, '$1') : number || match); }); return result; }); /** * Converts `value` to a string key if it's not a string or symbol. * * @private * @param {*} value The value to inspect. * @returns {string|symbol} Returns the key. */ function toKey(value) { if (typeof value == 'string' || isSymbol(value)) { return value; } var result = value + ''; return result == '0' && 1 / value == -INFINITY ? '-0' : result; } /** * Converts `func` to its source code. * * @private * @param {Function} func The function to process. * @returns {string} Returns the source code. */ function toSource(func) { if (func != null) { try { return funcToString.call(func); } catch (e) {} try { return func + ''; } catch (e) {} } return ''; } /** * Creates a function that memoizes the result of `func`. If `resolver` is * provided, it determines the cache key for storing the result based on the * arguments provided to the memoized function. By default, the first argument * provided to the memoized function is used as the map cache key. The `func` * is invoked with the `this` binding of the memoized function. * * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `delete`, `get`, `has`, and `set`. * * @static * @memberOf _ * @since 0.1.0 * @category Function * @param {Function} func The function to have its output memoized. * @param {Function} [resolver] The function to resolve the cache key. * @returns {Function} Returns the new memoized function. * @example * * var object = { 'a': 1, 'b': 2 }; * var other = { 'c': 3, 'd': 4 }; * * var values = _.memoize(_.values); * values(object); * // => [1, 2] * * values(other); * // => [3, 4] * * object.a = 2; * values(object); * // => [1, 2] * * // Modify the result cache. * values.cache.set(object, ['a', 'b']); * values(object); * // => ['a', 'b'] * * // Replace `_.memoize.Cache`. * _.memoize.Cache = WeakMap; */ function memoize(func, resolver) { if (typeof func != 'function' || resolver && typeof resolver != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } var memoized = function () { var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; if (cache.has(key)) { return cache.get(key); } var result = func.apply(this, args); memoized.cache = cache.set(key, result); return result; }; memoized.cache = new (memoize.Cache || MapCache)(); return memoized; } // Assign cache to `_.memoize`. memoize.Cache = MapCache; /** * Performs a * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * var object = { 'a': 1 }; * var other = { 'a': 1 }; * * _.eq(object, object); * // => true * * _.eq(object, other); * // => false * * _.eq('a', 'a'); * // => true * * _.eq('a', Object('a')); * // => false * * _.eq(NaN, NaN); * // => true */ function eq(value, other) { return value === other || value !== value && other !== other; } /** * Checks if `value` is classified as an `Array` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); * // => true * * _.isArray(document.body.children); * // => false * * _.isArray('abc'); * // => false * * _.isArray(_.noop); * // => false */ var isArray = Array.isArray; /** * Checks if `value` is classified as a `Function` object. * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); * // => true * * _.isFunction(/abc/); * // => false */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator // in Safari 8-9 which returns 'object' for typed array and other constructors. var tag = isObject(value) ? objectToString.call(value) : ''; return tag == funcTag || tag == genTag; } /** * Checks if `value` is the * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static * @memberOf _ * @since 0.1.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is an object, else `false`. * @example * * _.isObject({}); * // => true * * _.isObject([1, 2, 3]); * // => true * * _.isObject(_.noop); * // => true * * _.isObject(null); * // => false */ function isObject(value) { var type = typeof value; return !!value && (type == 'object' || type == 'function'); } /** * Checks if `value` is object-like. A value is object-like if it's not `null` * and has a `typeof` result of "object". * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is object-like, else `false`. * @example * * _.isObjectLike({}); * // => true * * _.isObjectLike([1, 2, 3]); * // => true * * _.isObjectLike(_.noop); * // => false * * _.isObjectLike(null); * // => false */ function isObjectLike(value) { return !!value && typeof value == 'object'; } /** * Checks if `value` is classified as a `Symbol` primitive or object. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); * // => true * * _.isSymbol('abc'); * // => false */ function isSymbol(value) { return typeof value == 'symbol' || isObjectLike(value) && objectToString.call(value) == symbolTag; } /** * Converts `value` to a string. An empty string is returned for `null` * and `undefined` values. The sign of `-0` is preserved. * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to process. * @returns {string} Returns the string. * @example * * _.toString(null); * // => '' * * _.toString(-0); * // => '-0' * * _.toString([1, 2, 3]); * // => '1,2,3' */ function toString(value) { return value == null ? '' : baseToString(value); } /** * Gets the value at `path` of `object`. If the resolved value is * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ * @since 3.7.0 * @category Object * @param {Object} object The object to query. * @param {Array|string} path The path of the property to get. * @param {*} [defaultValue] The value returned for `undefined` resolved values. * @returns {*} Returns the resolved value. * @example * * var object = { 'a': [{ 'b': { 'c': 3 } }] }; * * _.get(object, 'a[0].b.c'); * // => 3 * * _.get(object, ['a', '0', 'b', 'c']); * // => 3 * * _.get(object, 'a.b.c', 'default'); * // => 'default' */ function get(object, path, defaultValue) { var result = object == null ? undefined : baseGet(object, path); return result === undefined ? defaultValue : result; } module.exports = get; /***/ }, /***/ 79526 /*!***********************************************!*\ !*** ./node_modules/loglevel/lib/loglevel.js ***! \***********************************************/ (module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/* * loglevel - https://github.com/pimterry/loglevel * * Copyright (c) 2013 Tim Perry * Licensed under the MIT license. */ (function (root, definition) { "use strict"; if (true) { !(__WEBPACK_AMD_DEFINE_FACTORY__ = (definition), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else // removed by dead control flow {} })(this, function () { "use strict"; // Slightly dubious tricks to cut down minimized file size var noop = function () {}; var undefinedType = "undefined"; var isIE = typeof window !== undefinedType && typeof window.navigator !== undefinedType && /Trident\/|MSIE /.test(window.navigator.userAgent); var logMethods = ["trace", "debug", "info", "warn", "error"]; var _loggersByName = {}; var defaultLogger = null; // Cross-browser bind equivalent that works at least back to IE6 function bindMethod(obj, methodName) { var method = obj[methodName]; if (typeof method.bind === 'function') { return method.bind(obj); } else { try { return Function.prototype.bind.call(method, obj); } catch (e) { // Missing bind shim or IE8 + Modernizr, fallback to wrapping return function () { return Function.prototype.apply.apply(method, [obj, arguments]); }; } } } // Trace() doesn't print the message in IE, so for that case we need to wrap it function traceForIE() { if (console.log) { if (console.log.apply) { console.log.apply(console, arguments); } else { // In old IE, native console methods themselves don't have apply(). Function.prototype.apply.apply(console.log, [console, arguments]); } } if (console.trace) console.trace(); } // Build the best logging method possible for this env // Wherever possible we want to bind, not wrap, to preserve stack traces function realMethod(methodName) { if (methodName === 'debug') { methodName = 'log'; } if (typeof console === undefinedType) { return false; // No method possible, for now - fixed later by enableLoggingWhenConsoleArrives } else if (methodName === 'trace' && isIE) { return traceForIE; } else if (console[methodName] !== undefined) { return bindMethod(console, methodName); } else if (console.log !== undefined) { return bindMethod(console, 'log'); } else { return noop; } } // These private functions always need `this` to be set properly function replaceLoggingMethods() { /*jshint validthis:true */ var level = this.getLevel(); // Replace the actual methods. for (var i = 0; i < logMethods.length; i++) { var methodName = logMethods[i]; this[methodName] = i < level ? noop : this.methodFactory(methodName, level, this.name); } // Define log.log as an alias for log.debug this.log = this.debug; // Return any important warnings. if (typeof console === undefinedType && level < this.levels.SILENT) { return "No console available for logging"; } } // In old IE versions, the console isn't present until you first open it. // We build realMethod() replacements here that regenerate logging methods function enableLoggingWhenConsoleArrives(methodName) { return function () { if (typeof console !== undefinedType) { replaceLoggingMethods.call(this); this[methodName].apply(this, arguments); } }; } // By default, we use closely bound real methods wherever possible, and // otherwise we wait for a console to appear, and then try again. function defaultMethodFactory(methodName, _level, _loggerName) { /*jshint validthis:true */ return realMethod(methodName) || enableLoggingWhenConsoleArrives.apply(this, arguments); } function Logger(name, factory) { // Private instance variables. var self = this; /** * The level inherited from a parent logger (or a global default). We * cache this here rather than delegating to the parent so that it stays * in sync with the actual logging methods that we have installed (the * parent could change levels but we might not have rebuilt the loggers * in this child yet). * @type {number} */ var inheritedLevel; /** * The default level for this logger, if any. If set, this overrides * `inheritedLevel`. * @type {number|null} */ var defaultLevel; /** * A user-specific level for this logger. If set, this overrides * `defaultLevel`. * @type {number|null} */ var userLevel; var storageKey = "loglevel"; if (typeof name === "string") { storageKey += ":" + name; } else if (typeof name === "symbol") { storageKey = undefined; } function persistLevelIfPossible(levelNum) { var levelName = (logMethods[levelNum] || 'silent').toUpperCase(); if (typeof window === undefinedType || !storageKey) return; // Use localStorage if available try { window.localStorage[storageKey] = levelName; return; } catch (ignore) {} // Use session cookie as fallback try { window.document.cookie = encodeURIComponent(storageKey) + "=" + levelName + ";"; } catch (ignore) {} } function getPersistedLevel() { var storedLevel; if (typeof window === undefinedType || !storageKey) return; try { storedLevel = window.localStorage[storageKey]; } catch (ignore) {} // Fallback to cookies if local storage gives us nothing if (typeof storedLevel === undefinedType) { try { var cookie = window.document.cookie; var cookieName = encodeURIComponent(storageKey); var location = cookie.indexOf(cookieName + "="); if (location !== -1) { storedLevel = /^([^;]+)/.exec(cookie.slice(location + cookieName.length + 1))[1]; } } catch (ignore) {} } // If the stored level is not valid, treat it as if nothing was stored. if (self.levels[storedLevel] === undefined) { storedLevel = undefined; } return storedLevel; } function clearPersistedLevel() { if (typeof window === undefinedType || !storageKey) return; // Use localStorage if available try { window.localStorage.removeItem(storageKey); } catch (ignore) {} // Use session cookie as fallback try { window.document.cookie = encodeURIComponent(storageKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC"; } catch (ignore) {} } function normalizeLevel(input) { var level = input; if (typeof level === "string" && self.levels[level.toUpperCase()] !== undefined) { level = self.levels[level.toUpperCase()]; } if (typeof level === "number" && level >= 0 && level <= self.levels.SILENT) { return level; } else { throw new TypeError("log.setLevel() called with invalid level: " + input); } } /* * * Public logger API - see https://github.com/pimterry/loglevel for details * */ self.name = name; self.levels = { "TRACE": 0, "DEBUG": 1, "INFO": 2, "WARN": 3, "ERROR": 4, "SILENT": 5 }; self.methodFactory = factory || defaultMethodFactory; self.getLevel = function () { if (userLevel != null) { return userLevel; } else if (defaultLevel != null) { return defaultLevel; } else { return inheritedLevel; } }; self.setLevel = function (level, persist) { userLevel = normalizeLevel(level); if (persist !== false) { // defaults to true persistLevelIfPossible(userLevel); } // NOTE: in v2, this should call rebuild(), which updates children. return replaceLoggingMethods.call(self); }; self.setDefaultLevel = function (level) { defaultLevel = normalizeLevel(level); if (!getPersistedLevel()) { self.setLevel(level, false); } }; self.resetLevel = function () { userLevel = null; clearPersistedLevel(); replaceLoggingMethods.call(self); }; self.enableAll = function (persist) { self.setLevel(self.levels.TRACE, persist); }; self.disableAll = function (persist) { self.setLevel(self.levels.SILENT, persist); }; self.rebuild = function () { if (defaultLogger !== self) { inheritedLevel = normalizeLevel(defaultLogger.getLevel()); } replaceLoggingMethods.call(self); if (defaultLogger === self) { for (var childName in _loggersByName) { _loggersByName[childName].rebuild(); } } }; // Initialize all the internal levels. inheritedLevel = normalizeLevel(defaultLogger ? defaultLogger.getLevel() : "WARN"); var initialLevel = getPersistedLevel(); if (initialLevel != null) { userLevel = normalizeLevel(initialLevel); } replaceLoggingMethods.call(self); } /* * * Top-level API * */ defaultLogger = new Logger(); defaultLogger.getLogger = function getLogger(name) { if (typeof name !== "symbol" && typeof name !== "string" || name === "") { throw new TypeError("You must supply a name when creating a logger."); } var logger = _loggersByName[name]; if (!logger) { logger = _loggersByName[name] = new Logger(name, defaultLogger.methodFactory); } return logger; }; // Grab the current global log variable in case of overwrite var _log = typeof window !== undefinedType ? window.log : undefined; defaultLogger.noConflict = function () { if (typeof window !== undefinedType && window.log === defaultLogger) { window.log = _log; } return defaultLogger; }; defaultLogger.getLoggers = function getLoggers() { return _loggersByName; }; // ES6 default export, for compatibility defaultLogger['default'] = defaultLogger; return defaultLogger; }); /***/ }, /***/ 96720 /*!**************************************************!*\ !*** ./node_modules/mingo/esm/core/_internal.js ***! \**************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ComputeOptions: () => (/* binding */ ComputeOptions), /* harmony export */ Context: () => (/* binding */ Context), /* harmony export */ OpType: () => (/* binding */ OpType), /* harmony export */ ProcessingMode: () => (/* binding */ ProcessingMode), /* harmony export */ computeValue: () => (/* binding */ computeValue), /* harmony export */ evalExpr: () => (/* binding */ evalExpr) /* harmony export */ }); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ 74591); var ProcessingMode = /* @__PURE__ */(ProcessingMode2 => { ProcessingMode2[ProcessingMode2["CLONE_OFF"] = 0] = "CLONE_OFF"; ProcessingMode2[ProcessingMode2["CLONE_INPUT"] = 1] = "CLONE_INPUT"; ProcessingMode2[ProcessingMode2["CLONE_OUTPUT"] = 2] = "CLONE_OUTPUT"; ProcessingMode2[ProcessingMode2["CLONE_ALL"] = 3] = "CLONE_ALL"; return ProcessingMode2; })(ProcessingMode || {}); class ComputeOptions { constructor(options, locals) { this.options = options; this.#locals = locals ? { ...locals } : {}; } #locals; /** * Initializes a new instance of the `ComputeOptions` class with the provided options. * * @param options - A partial set of options to configure the `ComputeOptions` instance. * If an instance of `ComputeOptions` is provided, its internal options and locals are used. * @returns A new `ComputeOptions` instance configured with the provided options and root. */ static init(options) { return options instanceof ComputeOptions ? new ComputeOptions(options.options, options.#locals) : new ComputeOptions({ idKey: "_id", scriptEnabled: true, useStrictMode: true, failOnError: true, processingMode: 0 /* CLONE_OFF */, ...options, context: options?.context ? Context.from(options?.context) : Context.init() }); } update(locals) { Object.assign(this.#locals, locals, { // DO NOT override timestamp timestamp: this.#locals.timestamp, // merge variables. variables: { ...this.#locals?.variables, ...locals?.variables } }); return this; } get local() { return this.#locals; } get now() { let timestamp = this.#locals.timestamp ?? 0; if (!timestamp) { timestamp = Date.now(); Object.assign(this.#locals, { timestamp }); } return new Date(timestamp); } get idKey() { return this.options.idKey; } get collation() { return this.options?.collation; } get processingMode() { return this.options?.processingMode; } get useStrictMode() { return this.options?.useStrictMode; } get scriptEnabled() { return this.options?.scriptEnabled; } get failOnError() { return this.options?.failOnError; } get collectionResolver() { return this.options?.collectionResolver; } get jsonSchemaValidator() { return this.options?.jsonSchemaValidator; } get variables() { return this.options?.variables; } get context() { return this.options?.context; } } var OpType = /* @__PURE__ */(OpType2 => { OpType2["ACCUMULATOR"] = "accumulator"; OpType2["EXPRESSION"] = "expression"; OpType2["PIPELINE"] = "pipeline"; OpType2["PROJECTION"] = "projection"; OpType2["QUERY"] = "query"; OpType2["WINDOW"] = "window"; return OpType2; })(OpType || {}); class Context { #operators; constructor() { this.#operators = { ["accumulator" /* ACCUMULATOR */]: {}, ["expression" /* EXPRESSION */]: {}, ["pipeline" /* PIPELINE */]: {}, ["projection" /* PROJECTION */]: {}, ["query" /* QUERY */]: {}, ["window" /* WINDOW */]: {} }; } static init(ops = {}) { const ctx = new Context(); for (const type of Object.keys(ops)) { ctx.#operators[type] = { ...ops[type] }; } return ctx; } /** Returns a new context with the operators from the provided contexts merged left to right. */ static from(...ctx) { if (ctx.length === 1) return Context.init(ctx[0].#operators); const newCtx = new Context(); for (const context of ctx) { for (const type of Object.values(OpType)) { newCtx.addOps(type, context.#operators[type]); } } return newCtx; } addOps(type, operators) { this.#operators[type] = Object.assign({}, operators, this.#operators[type]); return this; } getOperator(type, name) { return this.#operators[type][name] ?? null; } addAccumulatorOps(ops) { return this.addOps("accumulator" /* ACCUMULATOR */, ops); } addExpressionOps(ops) { return this.addOps("expression" /* EXPRESSION */, ops); } addQueryOps(ops) { return this.addOps("query" /* QUERY */, ops); } addPipelineOps(ops) { return this.addOps("pipeline" /* PIPELINE */, ops); } addProjectionOps(ops) { return this.addOps("projection" /* PROJECTION */, ops); } addWindowOps(ops) { return this.addOps("window" /* WINDOW */, ops); } } function computeValue(obj, expr, operator, options) { return evalExpr(obj, { [operator]: expr }, options); } function evalExpr(obj, expr, options) { const copts = !(options instanceof ComputeOptions) || (0,_util__WEBPACK_IMPORTED_MODULE_0__.isNil)(options.local.root) ? ComputeOptions.init(options).update({ root: obj }) : options; return computeExpression(obj, expr, copts); } const SYSTEM_VARS = /* @__PURE__ */new Set(["$$ROOT", "$$CURRENT", "$$REMOVE", "$$NOW"]); function computeExpression(obj, expr, options) { if ((0,_util__WEBPACK_IMPORTED_MODULE_0__.isString)(expr) && expr.length > 0 && expr[0] === "$") { if (expr === "$$KEEP" || expr === "$$PRUNE" || expr === "$$DESCEND") return expr; let ctx = options.local.root; const dot = expr.indexOf("."); const prefix = dot === -1 ? expr : expr.substring(0, dot); if (SYSTEM_VARS.has(prefix)) { switch (prefix) { case "$$ROOT": break; case "$$CURRENT": ctx = obj; break; case "$$REMOVE": ctx = void 0; break; case "$$NOW": ctx = new Date(options.now); break; } expr = dot === -1 ? "" : expr.substring(dot + 1); } else if (prefix.length >= 2 && prefix[1] === "$") { ctx = Object.assign({}, // global vars options.variables, // current item is added before local variables because the binding may be changed. { this: obj }, // local vars options?.local?.variables); const name = prefix.substring(2); (0,_util__WEBPACK_IMPORTED_MODULE_0__.assert)((0,_util__WEBPACK_IMPORTED_MODULE_0__.has)(ctx, name), `Use of undefined variable: ${name}`); expr = expr.substring(2); } else { expr = expr.substring(1); } return expr === "" ? ctx : (0,_util__WEBPACK_IMPORTED_MODULE_0__.resolve)(ctx, expr); } if ((0,_util__WEBPACK_IMPORTED_MODULE_0__.isArray)(expr)) { const result = new Array(expr.length); for (let i = 0; i < expr.length; i++) { result[i] = computeExpression(obj, expr[i], options); } return result; } if ((0,_util__WEBPACK_IMPORTED_MODULE_0__.isObject)(expr)) { const keys = Object.keys(expr); if ((0,_util__WEBPACK_IMPORTED_MODULE_0__.isOperator)(keys[0])) { (0,_util__WEBPACK_IMPORTED_MODULE_0__.assert)(keys.length === 1, "Expression must contain a single operator."); return computeOperator(obj, expr[keys[0]], keys[0], options); } const result = {}; for (let i = 0; i < keys.length; i++) { result[keys[i]] = computeExpression(obj, expr[keys[i]], options); } return result; } return expr; } function computeOperator(obj, expr, operator, options) { const context = options.context; const fn = context.getOperator("expression" /* EXPRESSION */, operator); if (fn) return fn(obj, expr, options); const accFn = context.getOperator("accumulator" /* ACCUMULATOR */, operator); (0,_util__WEBPACK_IMPORTED_MODULE_0__.assert)(!!accFn, `accumulator '${operator}' is not registered.`); if (!(0,_util__WEBPACK_IMPORTED_MODULE_0__.isArray)(obj)) { obj = computeExpression(obj, expr, options); expr = null; } (0,_util__WEBPACK_IMPORTED_MODULE_0__.assert)((0,_util__WEBPACK_IMPORTED_MODULE_0__.isArray)(obj), `arguments must resolve to array for ${operator}.`); return accFn(obj, expr, options); } /***/ }, /***/ 35066 /*!******************************************!*\ !*** ./node_modules/mingo/esm/cursor.js ***! \******************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Cursor: () => (/* binding */ Cursor) /* harmony export */ }); /* harmony import */ var _core_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/_internal */ 96720); /* harmony import */ var _lazy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lazy */ 45578); /* harmony import */ var _operators_pipeline_limit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./operators/pipeline/limit */ 85476); /* harmony import */ var _operators_pipeline_project__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./operators/pipeline/project */ 30322); /* harmony import */ var _operators_pipeline_skip__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./operators/pipeline/skip */ 83968); /* harmony import */ var _operators_pipeline_sort__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./operators/pipeline/sort */ 24079); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util */ 74591); const OPERATORS = { $sort: _operators_pipeline_sort__WEBPACK_IMPORTED_MODULE_5__.$sort, $skip: _operators_pipeline_skip__WEBPACK_IMPORTED_MODULE_4__.$skip, $limit: _operators_pipeline_limit__WEBPACK_IMPORTED_MODULE_2__.$limit }; class Cursor { #source; #predicate; #projection; #options; #operators = {}; #result = null; #buffer = []; /** * Creates an instance of the Cursor class. * * @param source - The source of data to be iterated over. * @param predicate - A function or condition to filter the data. * @param projection - An object specifying the fields to include or exclude in the result. * @param options - Optional settings to customize the behavior of the cursor. */ constructor(source, predicate, projection, options) { this.#source = source; this.#predicate = predicate; this.#projection = projection; this.#options = options; } /** Returns the iterator from running the query */ fetch() { if (this.#result) return this.#result; this.#result = (0,_lazy__WEBPACK_IMPORTED_MODULE_1__.Lazy)(this.#source).filter(this.#predicate); const mode = this.#options.processingMode; if (mode & _core_internal__WEBPACK_IMPORTED_MODULE_0__.ProcessingMode.CLONE_INPUT) this.#result.map(o => (0,_util__WEBPACK_IMPORTED_MODULE_6__.cloneDeep)(o)); for (const op of Object.keys(OPERATORS)) { if ((0,_util__WEBPACK_IMPORTED_MODULE_6__.has)(this.#operators, op)) { const f = OPERATORS[op]; this.#result = f(this.#result, this.#operators[op], this.#options); } } if (Object.keys(this.#projection).length) { this.#result = (0,_operators_pipeline_project__WEBPACK_IMPORTED_MODULE_3__.$project)(this.#result, this.#projection, this.#options); } if (mode & _core_internal__WEBPACK_IMPORTED_MODULE_0__.ProcessingMode.CLONE_OUTPUT) this.#result.map(o => (0,_util__WEBPACK_IMPORTED_MODULE_6__.cloneDeep)(o)); return this.#result; } /** Returns an iterator with the buffered data included */ fetchAll() { const buffered = (0,_lazy__WEBPACK_IMPORTED_MODULE_1__.Lazy)(Array.from(this.#buffer)); this.#buffer.length = 0; return (0,_lazy__WEBPACK_IMPORTED_MODULE_1__.concat)(buffered, this.fetch()); } /** * Return remaining objects in the cursor as an array. This method exhausts the cursor * @returns {Array} */ all() { return this.fetchAll().collect(); } /** * Returns a cursor that begins returning results only after passing or skipping a number of documents. * @param {Number} n the number of results to skip. * @return {Cursor} Returns the cursor, so you can chain this call. */ skip(n) { this.#operators["$skip"] = n; return this; } /** * Limits the number of items returned by the cursor. * * @param n - The maximum number of items to return. * @returns The current cursor instance for chaining. */ limit(n) { this.#operators["$limit"] = n; return this; } /** * Returns results ordered according to a sort specification. * @param {AnyObject} modifier an object of key and values specifying the sort order. 1 for ascending and -1 for descending * @return {Cursor} Returns the cursor, so you can chain this call. */ sort(modifier) { this.#operators["$sort"] = modifier; return this; } /** * Sets the collation options for the cursor. * Collation allows users to specify language-specific rules for string comparison, * such as case sensitivity and accent marks. * * @param spec - The collation specification to apply. * @returns The current cursor instance for chaining. */ collation(spec) { this.#options = { ...this.#options, collation: spec }; return this; } /** * Retrieves the next item in the cursor. */ next() { if (this.#buffer.length > 0) { return this.#buffer.pop(); } const o = this.fetch().next(); if (o.done) return void 0; return o.value; } /** * Determines if there are more elements available in the cursor. * * @returns {boolean} `true` if there are more elements to iterate over, otherwise `false`. */ hasNext() { if (this.#buffer.length > 0) return true; const o = this.fetch().next(); if (o.done) return false; this.#buffer.push(o.value); return true; } /** * Returns an iterator for the cursor, allowing it to be used in `for...of` loops. * The iterator fetches all the results from the cursor. * * @returns {Iterator} An iterator over the fetched results. */ [Symbol.iterator]() { return this.fetchAll(); } } /***/ }, /***/ 45578 /*!****************************************!*\ !*** ./node_modules/mingo/esm/lazy.js ***! \****************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Iterator: () => (/* binding */ Iterator), /* harmony export */ Lazy: () => (/* binding */ Lazy), /* harmony export */ concat: () => (/* binding */ concat) /* harmony export */ }); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ 74591); function Lazy(source) { return new Iterator(source); } function concat(...iterators) { let index = 0; return Lazy(() => { while (index < iterators.length) { const o = iterators[index].next(); if (!o.done) return o; index++; } return { done: true, value: void 0 }; }); } function isGenerator(o) { return !!o && typeof o === "object" && typeof o?.next === "function"; } function isIterable(o) { return !!o && (typeof o === "object" || typeof o === "function") && typeof o[Symbol.iterator] === "function"; } class Iterator { #iteratees = []; #buffer = []; #getNext; #done = false; constructor(source) { let iter; if (isIterable(source)) iter = source[Symbol.iterator]();else if (isGenerator(source)) iter = source;else if (typeof source === "function") iter = { next: source };else (0,_util__WEBPACK_IMPORTED_MODULE_0__.assert)(0, "mingo: iterator requires an iterable, generator or function"); let index = -1; this.#getNext = () => { while (true) { let { value, done } = iter.next(); if (done) return { done }; let ok = true; index++; for (let i = 0; i < this.#iteratees.length; i++) { const { op, fn } = this.#iteratees[i]; const res = fn(value, index); if (op === "map") { value = res; } else if (!res) { ok = false; break; } } if (ok) return { value, done }; } }; } /** * Add an iteratee to this lazy sequence */ push(op, fn) { this.#iteratees.push({ op, fn }); return this; } next() { return this.#getNext(); } // Iteratees methods /** * Transform each item in the sequence to a new value * @param {Function} f */ map(f) { return this.push("map", f); } /** * Select only items matching the given predicate * @param {Function} f */ filter(f) { return this.push("filter", f); } /** * Take given numbe for values from sequence * @param {Number} n A number greater than 0 */ take(n) { (0,_util__WEBPACK_IMPORTED_MODULE_0__.assert)(n >= 0, "value must be a non-negative integer"); return this.filter(_ => n-- > 0); } /** * Drop a number of values from the sequence * @param {Number} n Number of items to drop greater than 0 */ drop(n) { (0,_util__WEBPACK_IMPORTED_MODULE_0__.assert)(n >= 0, "value must be a non-negative integer"); return this.filter(_ => n-- <= 0); } // Transformations /** * Returns a new lazy object with results of the transformation * The entire sequence is realized. * * @param {Callback} f Tranform function of type (Array) => (Any) */ transform(f) { const self = this; let iter; return Lazy(() => { if (!iter) iter = f(self.collect()); return iter.next(); }); } /** * Retrieves all remaining values from the lazy evaluation and returns them as an array. * This method processes the underlying iterator until it is exhausted, storing the results * in an internal buffer to ensure subsequent calls return the same data. */ collect() { while (!this.#done) { const { done, value } = this.#getNext(); if (!done) this.#buffer.push(value); this.#done = done; } return this.#buffer; } /** * Execute the callback for each value. * @param f The callback function. */ each(f) { for (let o = this.next(); o.done !== true; o = this.next()) f(o.value); } /** * Returns the reduction of sequence according the reducing function * * @param f The reducing function * @param initialValue The initial value */ reduce(f, initialValue) { let o = this.next(); if (initialValue === void 0 && !o.done) { initialValue = o.value; o = this.next(); } while (!o.done) { initialValue = f(initialValue, o.value); o = this.next(); } return initialValue; } /** * Returns the number of matched items in the sequence. * The stream is realized and buffered for later retrieval with {@link collect}. */ size() { return this.collect().length; } [Symbol.iterator]() { return this; } } /***/ }, /***/ 74063 /*!*********************************************************!*\ !*** ./node_modules/mingo/esm/operators/_predicates.js ***! \*********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $all: () => (/* binding */ $all), /* harmony export */ $elemMatch: () => (/* binding */ $elemMatch), /* harmony export */ $eq: () => (/* binding */ $eq), /* harmony export */ $gt: () => (/* binding */ $gt), /* harmony export */ $gte: () => (/* binding */ $gte), /* harmony export */ $in: () => (/* binding */ $in), /* harmony export */ $lt: () => (/* binding */ $lt), /* harmony export */ $lte: () => (/* binding */ $lte), /* harmony export */ $mod: () => (/* binding */ $mod), /* harmony export */ $ne: () => (/* binding */ $ne), /* harmony export */ $nin: () => (/* binding */ $nin), /* harmony export */ $regex: () => (/* binding */ $regex), /* harmony export */ $size: () => (/* binding */ $size), /* harmony export */ $type: () => (/* binding */ $type), /* harmony export */ processExpression: () => (/* binding */ processExpression), /* harmony export */ processQuery: () => (/* binding */ processQuery) /* harmony export */ }); /* harmony import */ var _core_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../core/_internal */ 96720); /* harmony import */ var _query__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../query */ 59554); /* harmony import */ var _util_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/_internal */ 74591); function elemMatchPredicate(criteria, options) { let format = x => x; let wrap = true; for (const k of Object.keys(criteria)) { wrap &&= (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.isOperator)(k) && "$and" !== k && "$or" !== k && "$nor" !== k; if (!wrap) break; } if (wrap) { criteria = { field: criteria }; format = x => ({ field: x }); } const q = new _query__WEBPACK_IMPORTED_MODULE_1__.Query(criteria, options); return v => q.test(format(v)); } function processQuery(selector, value, options, predicate) { let [begin, depth] = [-1, 0]; while ((begin = selector.indexOf(".", begin + 1)) !== -1) depth++; const copts = _core_internal__WEBPACK_IMPORTED_MODULE_0__.ComputeOptions.init(options).update({ depth }); const opts = { unwrapArray: true }; if (predicate === $elemMatch) { value = elemMatchPredicate(value, options); } return o => { const lhs = (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.resolve)(o, selector, opts); return predicate(lhs, value, copts); }; } function processExpression(obj, expr, options, predicate) { (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.assert)((0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.isArray)(expr) && expr.length === 2, `${predicate.name} expects array(2)`); const [lhs, rhs] = (0,_core_internal__WEBPACK_IMPORTED_MODULE_0__.evalExpr)(obj, expr, options); return predicate(lhs, rhs, options); } function $eq(a, b, options) { if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.isEqual)(a, b)) return true; if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.isNil)(a) && (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.isNil)(b)) return true; if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.isArray)(a)) { const depth = options?.local?.depth ?? 1; return a.some(v => (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.isEqual)(v, b)) || (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.flatten)(a, depth).some(v => (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.isEqual)(v, b)); } return false; } function $ne(a, b, options) { return !$eq(a, b, options); } function $in(a, b, _options) { if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.isNil)(a)) return b.some(v => v === null); return (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.intersection)([(0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.ensureArray)(a), b]).length > 0; } function $nin(a, b, options) { return !$in(a, b, options); } function $lt(a, b, _options) { return compare(a, b, (x, y) => (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.compare)(x, y) < 0); } function $lte(a, b, _options) { return compare(a, b, (x, y) => (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.compare)(x, y) <= 0); } function $gt(a, b, _options) { return compare(a, b, (x, y) => (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.compare)(x, y) > 0); } function $gte(a, b, _options) { return compare(a, b, (x, y) => (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.compare)(x, y) >= 0); } function $mod(a, b, _options) { return (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.ensureArray)(a).some(x => b.length === 2 && x % b[0] === b[1]); } function $regex(a, b, options) { const lhs = (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.ensureArray)(a); const match = x => (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.isString)(x) && (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.truthy)(b.exec(x), options?.useStrictMode); return lhs.some(match) || (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.flatten)(lhs, 1).some(match); } function $all(values, rhs, options) { if (!(0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.isArray)(values) || !(0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.isArray)(rhs) || !values.length || !rhs.length) { return false; } let matched = true; for (const expr of rhs) { if (!matched) break; if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.isObject)(expr) && Object.keys(expr)[0] === "$elemMatch") { const criteria = expr["$elemMatch"]; const pred = elemMatchPredicate(criteria, options); matched = $elemMatch(values, pred, options); } else if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.isRegExp)(expr)) { matched = values.some(s => (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.isString)(s) && expr.test(s)); } else { matched = values.some(v => (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.isEqual)(expr, v)); } } return matched; } function $size(a, b, _options) { return Array.isArray(a) && a.length === b; } function $elemMatch(a, b, _options) { if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.isArray)(a) && !(0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.isEmpty)(a)) { for (let i = 0, len = a.length; i < len; i++) if (b(a[i])) return true; } return false; } const isNull = a => a === null; const compareFuncs = { array: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isArray, boolean: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isBoolean, bool: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isBoolean, date: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isDate, number: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isNumber, int: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isNumber, long: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isNumber, double: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isNumber, decimal: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isNumber, null: isNull, object: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isObject, regexp: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isRegExp, regex: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isRegExp, string: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isString, // added for completeness undefined: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isNil, // deprecated // Mongo identifiers 1: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isNumber, //double 2: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isString, 3: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isObject, 4: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isArray, 6: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isNil, // deprecated 8: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isBoolean, 9: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isDate, 10: isNull, 11: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isRegExp, 16: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isNumber, //int 18: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isNumber, //long 19: _util_internal__WEBPACK_IMPORTED_MODULE_2__.isNumber //decimal }; function compareType(a, b, _) { const f = compareFuncs[b]; return f ? f(a) : false; } function $type(a, b, options) { return (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.isArray)(b) ? b.findIndex(t => compareType(a, t, options)) >= 0 : compareType(a, b, options); } function compare(a, b, f) { for (const v of (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.ensureArray)(a)) { if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.typeOf)(v) === (0,_util_internal__WEBPACK_IMPORTED_MODULE_2__.typeOf)(b) && f(v, b)) return true; } return false; } /***/ }, /***/ 19339 /*!******************************************************************!*\ !*** ./node_modules/mingo/esm/operators/expression/_internal.js ***! \******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ARR_OPTS: () => (/* binding */ ARR_OPTS), /* harmony export */ INT_OPTS: () => (/* binding */ INT_OPTS), /* harmony export */ errExpectArray: () => (/* binding */ errExpectArray), /* harmony export */ errExpectNumber: () => (/* binding */ errExpectNumber), /* harmony export */ errExpectObject: () => (/* binding */ errExpectObject), /* harmony export */ errExpectString: () => (/* binding */ errExpectString), /* harmony export */ errInvalidArgs: () => (/* binding */ errInvalidArgs) /* harmony export */ }); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util */ 74591); const INT_OPTS = { int: { int: true }, // (-∞, ∞) pos: { min: 1, int: true }, // [1, ∞] index: { min: 0, int: true }, // [0, ∞] nzero: { min: 0, max: 0, int: true } // non-zero }; const ARR_OPTS = { int: { type: "integers" }, obj: { type: "objects" } }; function errInvalidArgs(failOnError, message) { (0,_util__WEBPACK_IMPORTED_MODULE_0__.assert)(!failOnError, message); return null; } function errExpectObject(failOnError, prefix) { const msg = `${prefix} expression must resolve to object`; (0,_util__WEBPACK_IMPORTED_MODULE_0__.assert)(!failOnError, msg); return null; } function errExpectString(failOnError, prefix) { const msg = `${prefix} expression must resolve to string`; (0,_util__WEBPACK_IMPORTED_MODULE_0__.assert)(!failOnError, msg); return null; } function errExpectNumber(failOnError, name, opts) { const type = opts?.int ? "integer" : "number"; const min = opts?.min ?? -Infinity; const max = opts?.max ?? Infinity; let msg; if (min === 0 && max === 0) { msg = `${name} expression must resolve to non-zero ${type}`; } else if (min === 0 && max === Infinity) { msg = `${name} expression must resolve to non-negative ${type}`; } else if (min !== -Infinity && max !== Infinity) { msg = `${name} expression must resolve to ${type} in range [${min}, ${max}]`; } else if (min > 0) { msg = `${name} expression must resolve to positive ${type}`; } else { msg = `${name} expression must resolve to ${type}`; } (0,_util__WEBPACK_IMPORTED_MODULE_0__.assert)(!failOnError, msg); return null; } function errExpectArray(failOnError, prefix, opts) { let suffix = "array"; if (!(0,_util__WEBPACK_IMPORTED_MODULE_0__.isNil)(opts?.size) && opts?.size >= 0) suffix = opts.size === 0 ? "non-zero array" : `array(${opts.size})`; if (opts?.type) suffix = `array of ${opts.type}`; const msg = `${prefix} expression must resolve to ${suffix}`; (0,_util__WEBPACK_IMPORTED_MODULE_0__.assert)(!failOnError, msg); return null; } /***/ }, /***/ 49273 /*!********************************************************************!*\ !*** ./node_modules/mingo/esm/operators/expression/boolean/and.js ***! \********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $and: () => (/* binding */ $and) /* harmony export */ }); /* harmony import */ var _core_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../core/_internal */ 96720); /* harmony import */ var _util_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../util/_internal */ 74591); const $and = (obj, expr, options) => { (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.assert)((0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.isArray)(expr), "$and expects array"); const mode = options.useStrictMode; return expr.every(e => (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.truthy)((0,_core_internal__WEBPACK_IMPORTED_MODULE_0__.evalExpr)(obj, e, options), mode)); }; /***/ }, /***/ 89888 /*!**********************************************************************!*\ !*** ./node_modules/mingo/esm/operators/expression/boolean/index.js ***! \**********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $and: () => (/* reexport safe */ _and__WEBPACK_IMPORTED_MODULE_0__.$and), /* harmony export */ $not: () => (/* reexport safe */ _not__WEBPACK_IMPORTED_MODULE_1__.$not), /* harmony export */ $or: () => (/* reexport safe */ _or__WEBPACK_IMPORTED_MODULE_2__.$or) /* harmony export */ }); /* harmony import */ var _and__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./and */ 49273); /* harmony import */ var _not__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./not */ 82109); /* harmony import */ var _or__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./or */ 42275); /***/ }, /***/ 82109 /*!********************************************************************!*\ !*** ./node_modules/mingo/esm/operators/expression/boolean/not.js ***! \********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $not: () => (/* binding */ $not) /* harmony export */ }); /* harmony import */ var _core_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../core/_internal */ 96720); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../util */ 74591); /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../_internal */ 19339); const $not = (obj, expr, options) => { const booleanExpr = (0,_util__WEBPACK_IMPORTED_MODULE_1__.ensureArray)(expr); if (booleanExpr.length === 0) return false; if (booleanExpr.length > 1) return (0,_internal__WEBPACK_IMPORTED_MODULE_2__.errExpectArray)(options.failOnError, "$not", { size: 1 }); return !(0,_core_internal__WEBPACK_IMPORTED_MODULE_0__.evalExpr)(obj, booleanExpr[0], options); }; /***/ }, /***/ 42275 /*!*******************************************************************!*\ !*** ./node_modules/mingo/esm/operators/expression/boolean/or.js ***! \*******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $or: () => (/* binding */ $or) /* harmony export */ }); /* harmony import */ var _core_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../core/_internal */ 96720); /* harmony import */ var _util_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../util/_internal */ 74591); const $or = (obj, expr, options) => { (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.assert)((0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.isArray)(expr), "$or expects array of expressions"); const strict = options.useStrictMode; for (const v of expr) if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.truthy)((0,_core_internal__WEBPACK_IMPORTED_MODULE_0__.evalExpr)(obj, v, options), strict)) return true; return false; }; /***/ }, /***/ 83861 /*!***********************************************************************!*\ !*** ./node_modules/mingo/esm/operators/expression/comparison/cmp.js ***! \***********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $cmp: () => (/* binding */ $cmp) /* harmony export */ }); /* harmony import */ var _core_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../core/_internal */ 96720); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../util */ 74591); const $cmp = (obj, expr, options) => { (0,_util__WEBPACK_IMPORTED_MODULE_1__.assert)((0,_util__WEBPACK_IMPORTED_MODULE_1__.isArray)(expr) && expr.length === 2, "$cmp expects array(2)"); const [a, b] = (0,_core_internal__WEBPACK_IMPORTED_MODULE_0__.evalExpr)(obj, expr, options); return (0,_util__WEBPACK_IMPORTED_MODULE_1__.compare)(a, b); }; /***/ }, /***/ 50575 /*!**********************************************************************!*\ !*** ./node_modules/mingo/esm/operators/expression/comparison/eq.js ***! \**********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $eq: () => (/* binding */ $eq) /* harmony export */ }); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_predicates */ 74063); const $eq = (obj, expr, options) => (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.processExpression)(obj, expr, options, _predicates__WEBPACK_IMPORTED_MODULE_0__.$eq); /***/ }, /***/ 81686 /*!**********************************************************************!*\ !*** ./node_modules/mingo/esm/operators/expression/comparison/gt.js ***! \**********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $gt: () => (/* binding */ $gt) /* harmony export */ }); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_predicates */ 74063); const $gt = (obj, expr, options) => (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.processExpression)(obj, expr, options, _predicates__WEBPACK_IMPORTED_MODULE_0__.$gt); /***/ }, /***/ 38255 /*!***********************************************************************!*\ !*** ./node_modules/mingo/esm/operators/expression/comparison/gte.js ***! \***********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $gte: () => (/* binding */ $gte) /* harmony export */ }); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_predicates */ 74063); const $gte = (obj, expr, options) => (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.processExpression)(obj, expr, options, _predicates__WEBPACK_IMPORTED_MODULE_0__.$gte); /***/ }, /***/ 56525 /*!*************************************************************************!*\ !*** ./node_modules/mingo/esm/operators/expression/comparison/index.js ***! \*************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $cmp: () => (/* reexport safe */ _cmp__WEBPACK_IMPORTED_MODULE_0__.$cmp), /* harmony export */ $eq: () => (/* reexport safe */ _eq__WEBPACK_IMPORTED_MODULE_1__.$eq), /* harmony export */ $gt: () => (/* reexport safe */ _gt__WEBPACK_IMPORTED_MODULE_2__.$gt), /* harmony export */ $gte: () => (/* reexport safe */ _gte__WEBPACK_IMPORTED_MODULE_3__.$gte), /* harmony export */ $lt: () => (/* reexport safe */ _lt__WEBPACK_IMPORTED_MODULE_4__.$lt), /* harmony export */ $lte: () => (/* reexport safe */ _lte__WEBPACK_IMPORTED_MODULE_5__.$lte), /* harmony export */ $ne: () => (/* reexport safe */ _ne__WEBPACK_IMPORTED_MODULE_6__.$ne) /* harmony export */ }); /* harmony import */ var _cmp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cmp */ 83861); /* harmony import */ var _eq__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./eq */ 50575); /* harmony import */ var _gt__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./gt */ 81686); /* harmony import */ var _gte__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./gte */ 38255); /* harmony import */ var _lt__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lt */ 17033); /* harmony import */ var _lte__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lte */ 3482); /* harmony import */ var _ne__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ne */ 66676); /***/ }, /***/ 17033 /*!**********************************************************************!*\ !*** ./node_modules/mingo/esm/operators/expression/comparison/lt.js ***! \**********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $lt: () => (/* binding */ $lt) /* harmony export */ }); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_predicates */ 74063); const $lt = (obj, expr, options) => (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.processExpression)(obj, expr, options, _predicates__WEBPACK_IMPORTED_MODULE_0__.$lt); /***/ }, /***/ 3482 /*!***********************************************************************!*\ !*** ./node_modules/mingo/esm/operators/expression/comparison/lte.js ***! \***********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $lte: () => (/* binding */ $lte) /* harmony export */ }); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_predicates */ 74063); const $lte = (obj, expr, options) => (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.processExpression)(obj, expr, options, _predicates__WEBPACK_IMPORTED_MODULE_0__.$lte); /***/ }, /***/ 66676 /*!**********************************************************************!*\ !*** ./node_modules/mingo/esm/operators/expression/comparison/ne.js ***! \**********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $ne: () => (/* binding */ $ne) /* harmony export */ }); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_predicates */ 74063); const $ne = (obj, expr, options) => (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.processExpression)(obj, expr, options, _predicates__WEBPACK_IMPORTED_MODULE_0__.$ne); /***/ }, /***/ 55491 /*!****************************************************************!*\ !*** ./node_modules/mingo/esm/operators/pipeline/_internal.js ***! \****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ filterDocumentsStage: () => (/* binding */ filterDocumentsStage), /* harmony export */ resolveCollection: () => (/* binding */ resolveCollection), /* harmony export */ validateProjection: () => (/* binding */ validateProjection) /* harmony export */ }); /* harmony import */ var _lazy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../lazy */ 45578); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/_internal */ 74591); /* harmony import */ var _documents__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./documents */ 58021); const EMPTY = (0,_lazy__WEBPACK_IMPORTED_MODULE_0__.Lazy)([]); function filterDocumentsStage(pipeline, options) { if (!pipeline) return {}; const docs = pipeline[0]?.$documents; if (!docs) return { pipeline }; return { documents: (0,_documents__WEBPACK_IMPORTED_MODULE_2__.$documents)(EMPTY, docs, options).collect(), pipeline: pipeline.slice(1) }; } function validateProjection(expr, options, isRoot = true) { const res = { exclusions: [], inclusions: [], positional: 0 }; const keys = Object.keys(expr); (0,_util__WEBPACK_IMPORTED_MODULE_1__.assert)(keys.length, "Invalid empty sub-projection"); const idKey = options?.idKey; let idKeyExcluded = false; for (const k of keys) { if (k.startsWith("$")) { (0,_util__WEBPACK_IMPORTED_MODULE_1__.assert)(!isRoot && keys.length === 1, `FieldPath field names may not start with '$', given '${k}'.`); return res; } if (k.endsWith(".$")) res.positional++; const v = expr[k]; if (v === false || (0,_util__WEBPACK_IMPORTED_MODULE_1__.isNumber)(v) && v === 0) { if (k === idKey) { idKeyExcluded = true; } else res.exclusions.push(k); } else if (!(0,_util__WEBPACK_IMPORTED_MODULE_1__.isObject)(v)) { res.inclusions.push(k); } else { const meta = validateProjection(v, options, false); if (!meta.inclusions.length && !meta.exclusions.length) { if (!res.inclusions.includes(k)) res.inclusions.push(k); } else { for (const n of meta.exclusions) res.exclusions.push(`${k}.${n}`); for (const n of meta.inclusions) res.inclusions.push(`${k}.${n}`); } res.positional += meta.positional; } (0,_util__WEBPACK_IMPORTED_MODULE_1__.assert)(!(res.exclusions.length && res.inclusions.length), "Cannot do exclusion and inclusion in projection."); (0,_util__WEBPACK_IMPORTED_MODULE_1__.assert)(res.positional <= 1, "Cannot specify more than one positional projection."); } if (idKeyExcluded) { res.exclusions.push(idKey); } if (isRoot) { const p = new _util__WEBPACK_IMPORTED_MODULE_1__.PathValidator(); for (const k of res.exclusions) (0,_util__WEBPACK_IMPORTED_MODULE_1__.assert)(p.add(k), `Path collision at ${k}.`); for (const k of res.inclusions) (0,_util__WEBPACK_IMPORTED_MODULE_1__.assert)(p.add(k), `Path collision at ${k}.`); res.exclusions.sort(); res.inclusions.sort(); } return res; } function resolveCollection(op, expr, options) { if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isString)(expr)) { (0,_util__WEBPACK_IMPORTED_MODULE_1__.assert)(options.collectionResolver, `${op} requires 'collectionResolver' option to resolve named collection`); } const coll = (0,_util__WEBPACK_IMPORTED_MODULE_1__.isString)(expr) ? options.collectionResolver(expr) : expr; (0,_util__WEBPACK_IMPORTED_MODULE_1__.assert)((0,_util__WEBPACK_IMPORTED_MODULE_1__.isArray)(coll), `${op} could not resolve input collection`); return coll; } /***/ }, /***/ 34521 /*!****************************************************************!*\ !*** ./node_modules/mingo/esm/operators/pipeline/addFields.js ***! \****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $addFields: () => (/* binding */ $addFields) /* harmony export */ }); /* harmony import */ var _core_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/_internal */ 96720); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util */ 74591); function $addFields(coll, expr, options) { const newFields = Object.keys(expr); if (newFields.length === 0) return coll; return coll.map(obj => { const newObj = { ...obj }; for (const field of newFields) { const newValue = (0,_core_internal__WEBPACK_IMPORTED_MODULE_0__.evalExpr)(obj, expr[field], options); if (newValue !== void 0) { (0,_util__WEBPACK_IMPORTED_MODULE_1__.setValue)(newObj, field, newValue); } else { (0,_util__WEBPACK_IMPORTED_MODULE_1__.removeValue)(newObj, field); } } return newObj; }); } /***/ }, /***/ 58021 /*!****************************************************************!*\ !*** ./node_modules/mingo/esm/operators/pipeline/documents.js ***! \****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $documents: () => (/* binding */ $documents) /* harmony export */ }); /* harmony import */ var _core_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/_internal */ 96720); /* harmony import */ var _lazy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../lazy */ 45578); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util */ 74591); function $documents(_, expr, options) { const docs = (0,_core_internal__WEBPACK_IMPORTED_MODULE_0__.evalExpr)(null, expr, options); (0,_util__WEBPACK_IMPORTED_MODULE_2__.assert)((0,_util__WEBPACK_IMPORTED_MODULE_2__.isArray)(docs), "$documents expression must resolve to an array."); return (0,_lazy__WEBPACK_IMPORTED_MODULE_1__.Lazy)(docs).map(o => (0,_util__WEBPACK_IMPORTED_MODULE_2__.cloneDeep)(o)); } /***/ }, /***/ 85476 /*!************************************************************!*\ !*** ./node_modules/mingo/esm/operators/pipeline/limit.js ***! \************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $limit: () => (/* binding */ $limit) /* harmony export */ }); function $limit(coll, expr, _options) { return coll.take(expr); } /***/ }, /***/ 30322 /*!**************************************************************!*\ !*** ./node_modules/mingo/esm/operators/pipeline/project.js ***! \**************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $project: () => (/* binding */ $project) /* harmony export */ }); /* harmony import */ var _core_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/_internal */ 96720); /* harmony import */ var _util_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util/_internal */ 74591); /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_internal */ 55491); const OP = "$project"; function $project(coll, expr, options) { if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.isEmpty)(expr)) return coll; const meta = (0,_internal__WEBPACK_IMPORTED_MODULE_2__.validateProjection)(expr, options); const handler = createHandler(expr, _core_internal__WEBPACK_IMPORTED_MODULE_0__.ComputeOptions.init(options), meta); return coll.map(handler); } function createHandler(expr, options, meta) { const idKey = options.idKey; const { exclusions, inclusions } = meta; const handlers = {}; const resolveOpts = { preserveMissing: true }; for (const k of exclusions) { handlers[k] = (t, _) => { (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.removeValue)(t, k, { descendArray: true }); }; } for (const selector of inclusions) { const v = (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.resolve)(expr, selector) ?? expr[selector]; if (selector.endsWith(".$") && v === 1) { const cond = options?.local?.condition ?? {}; (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.assert)(cond, `${OP}: positional operator '.$' requires array condition.`); const field = selector.slice(0, -2); handlers[field] = getPositionalFilter(field, cond, options); continue; } if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.isArray)(v)) { handlers[selector] = (t, o) => { options.update({ root: o }); const newVal = v.map(e => (0,_core_internal__WEBPACK_IMPORTED_MODULE_0__.evalExpr)(o, e, options) ?? null); (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.setValue)(t, selector, newVal); }; } else if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.isNumber)(v) || v === true) { handlers[selector] = (t, o) => { options.update({ root: o }); const extractedVal = (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.resolveGraph)(o, selector, resolveOpts); mergeInto(t, extractedVal); }; } else if (!(0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.isObject)(v)) { handlers[selector] = (t, o) => { options.update({ root: o }); const newVal = (0,_core_internal__WEBPACK_IMPORTED_MODULE_0__.evalExpr)(o, v, options); (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.setValue)(t, selector, newVal); }; } else { const opKeys = Object.keys(v); (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.assert)(opKeys.length === 1 && (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.isOperator)(opKeys[0]), "Not a valid operator"); const operator = opKeys[0]; const opExpr = v[operator]; const fn = options.context.getOperator(_core_internal__WEBPACK_IMPORTED_MODULE_0__.OpType.PROJECTION, operator); const foundSlice = operator === "$slice"; if (!fn || foundSlice && !(0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.ensureArray)(opExpr).every(_util_internal__WEBPACK_IMPORTED_MODULE_1__.isNumber)) { handlers[selector] = (t, o) => { options.update({ root: o }); const newval = (0,_core_internal__WEBPACK_IMPORTED_MODULE_0__.evalExpr)(o, v, options); (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.setValue)(t, selector, newval); }; } else { handlers[selector] = (t, o) => { options.update({ root: o }); const newval = fn(o, opExpr, selector, options); (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.setValue)(t, selector, newval); }; } } } const onlyIdKeyExcluded = exclusions.length === 1 && exclusions.includes(idKey); const noIdKeyExcluded = !exclusions.includes(idKey); const noInclusions = !inclusions.length; const allKeysIncluded = noInclusions && onlyIdKeyExcluded || noInclusions && exclusions.length && !onlyIdKeyExcluded; return o => { const newObj = {}; if (allKeysIncluded) Object.assign(newObj, o); for (const k in handlers) { handlers[k](newObj, o); } if (!noInclusions) (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.filterMissing)(newObj); if (noIdKeyExcluded && !(0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.has)(newObj, idKey) && (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.has)(o, idKey)) { newObj[idKey] = (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.resolve)(o, idKey); } return newObj; }; } const findMatches = (o, key, leaf, pred) => { let arr = (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.resolve)(o, key); if (!(0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.isArray)(arr)) arr = (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.resolve)(arr, leaf); (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.assert)((0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.isArray)(arr), `${OP}: field '${key}' must resolve to array`); const matches = []; for (let i = 0; i < arr.length; i++) { if (pred({ [leaf]: [arr[i]] })) matches.push(i); } return matches; }; const complement = p => e => !p(e); const COMPOUND_OPS = { $and: 1, $or: 1, $nor: 1 }; function getPositionalFilter(field, condition, options) { const stack = Object.entries(condition).slice(); const selectors = { $and: [], $or: [] }; for (let i = 0; i < stack.length; i++) { const [key, val, op] = stack[i]; if (key === field || key.startsWith(field + ".")) { const normalizedExpr = (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.normalize)(val); const operator = Object.keys(normalizedExpr)[0]; const expr = normalizedExpr[operator]; const fn = options.context.getOperator(_core_internal__WEBPACK_IMPORTED_MODULE_0__.OpType.QUERY, operator); const leaf2 = key.substring(key.lastIndexOf(".") + 1); const pred = fn(leaf2, expr, options); if (!op || op === "$and") { selectors.$and.push([key, pred, leaf2]); } else if (op === "$nor") { selectors.$and.push([key, complement(pred), leaf2]); } else if (op === "$or") { selectors.$or.push([key, pred, leaf2]); } } else if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.isOperator)(key)) { (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.assert)(!!COMPOUND_OPS[key], `${OP}: '${key}' is not allowed in this context`); for (const item of val) { for (const k of Object.keys(item)) stack.push([k, item[k], key]); } } } const sep = field.lastIndexOf("."); const parent = field.substring(0, sep) || field; const leaf = field.substring(sep + 1); return (t, o) => { const matches = []; for (const [key, pred, leaf2] of selectors.$and) { matches.push(findMatches(o, key, leaf2, pred)); } if (selectors.$or.length) { const orMatches = []; for (const [key, pred, leaf2] of selectors.$or) { orMatches.push(...findMatches(o, key, leaf2, pred)); } matches.push((0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.unique)(orMatches)); } const i = (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.intersection)(matches).sort()[0]; let first = (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.resolve)(o, field)[i]; if (parent != leaf && !(0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.isObject)(first)) { first = { [leaf]: first }; } (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.setValue)(t, parent, [first]); }; } function mergeInto(target, input) { if (target === _util_internal__WEBPACK_IMPORTED_MODULE_1__.MISSING || (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.isNil)(target)) return input; if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.isNil)(input)) return target; const out = target; const src = input; for (const k of Object.keys(input)) { out[k] = mergeInto(out[k], src[k]); } return out; } /***/ }, /***/ 20043 /*!******************************************************************!*\ !*** ./node_modules/mingo/esm/operators/pipeline/replaceRoot.js ***! \******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $replaceRoot: () => (/* binding */ $replaceRoot) /* harmony export */ }); /* harmony import */ var _core_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/_internal */ 96720); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util */ 74591); function $replaceRoot(coll, expr, options) { return coll.map(obj => { obj = (0,_core_internal__WEBPACK_IMPORTED_MODULE_0__.evalExpr)(obj, expr.newRoot, options); (0,_util__WEBPACK_IMPORTED_MODULE_1__.assert)((0,_util__WEBPACK_IMPORTED_MODULE_1__.isObject)(obj), "$replaceRoot expression must return an object"); return obj; }); } /***/ }, /***/ 25099 /*!******************************************************************!*\ !*** ./node_modules/mingo/esm/operators/pipeline/replaceWith.js ***! \******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $replaceWith: () => (/* binding */ $replaceWith) /* harmony export */ }); /* harmony import */ var _core_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/_internal */ 96720); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util */ 74591); function $replaceWith(coll, expr, options) { return coll.map(obj => { obj = (0,_core_internal__WEBPACK_IMPORTED_MODULE_0__.evalExpr)(obj, expr, options); (0,_util__WEBPACK_IMPORTED_MODULE_1__.assert)((0,_util__WEBPACK_IMPORTED_MODULE_1__.isObject)(obj), "$replaceWith expression must return an object"); return obj; }); } /***/ }, /***/ 35307 /*!**********************************************************!*\ !*** ./node_modules/mingo/esm/operators/pipeline/set.js ***! \**********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $set: () => (/* binding */ $set) /* harmony export */ }); /* harmony import */ var _addFields__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./addFields */ 34521); const $set = _addFields__WEBPACK_IMPORTED_MODULE_0__.$addFields; /***/ }, /***/ 83968 /*!***********************************************************!*\ !*** ./node_modules/mingo/esm/operators/pipeline/skip.js ***! \***********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $skip: () => (/* binding */ $skip) /* harmony export */ }); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util */ 74591); function $skip(coll, expr, _options) { (0,_util__WEBPACK_IMPORTED_MODULE_0__.assert)(expr >= 0, "$skip value must be a non-negative integer"); return coll.drop(expr); } /***/ }, /***/ 24079 /*!***********************************************************!*\ !*** ./node_modules/mingo/esm/operators/pipeline/sort.js ***! \***********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $sort: () => (/* binding */ $sort) /* harmony export */ }); /* harmony import */ var _lazy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../lazy */ 45578); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util */ 74591); function $sort(coll, sortKeys, options) { (0,_util__WEBPACK_IMPORTED_MODULE_1__.assert)((0,_util__WEBPACK_IMPORTED_MODULE_1__.isObject)(sortKeys) && Object.keys(sortKeys).length > 0, "$sort specification is invalid"); let cmp = _util__WEBPACK_IMPORTED_MODULE_1__.compare; const collationSpec = options.collation; if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isObject)(collationSpec) && (0,_util__WEBPACK_IMPORTED_MODULE_1__.isString)(collationSpec.locale)) { cmp = collationComparator(collationSpec); } return coll.transform(coll2 => { const modifiers = Object.keys(sortKeys); for (const key of modifiers.reverse()) { const groups = (0,_util__WEBPACK_IMPORTED_MODULE_1__.groupBy)(coll2, obj => (0,_util__WEBPACK_IMPORTED_MODULE_1__.resolve)(obj, key)); const sortedKeys = Array.from(groups.keys()); let nativeSorted = false; if (cmp === _util__WEBPACK_IMPORTED_MODULE_1__.compare) { let t_str = true; let t_num = true; for (const v of sortedKeys) { t_str &&= (0,_util__WEBPACK_IMPORTED_MODULE_1__.isString)(v); t_num &&= (0,_util__WEBPACK_IMPORTED_MODULE_1__.isNumber)(v); if (!t_str && !t_num) break; } nativeSorted = t_str || t_num; if (t_str) sortedKeys.sort();else if (t_num) { const numbers = new Float64Array(sortedKeys).sort(); for (let i2 = 0; i2 < numbers.length; i2++) { sortedKeys[i2] = numbers[i2]; } } } if (!nativeSorted) sortedKeys.sort(cmp); if (sortKeys[key] === -1) sortedKeys.reverse(); let i = 0; for (const k of sortedKeys) for (const v of groups.get(k)) coll2[i++] = v; (0,_util__WEBPACK_IMPORTED_MODULE_1__.assert)(i == coll2.length, "bug: counter must match collection size."); } return (0,_lazy__WEBPACK_IMPORTED_MODULE_0__.Lazy)(coll2); }); } const COLLATION_STRENGTH = { // Only strings that differ in base letters compare as unequal. Examples: a ≠ b, a = á, a = A. 1: "base", // Only strings that differ in base letters or accents and other diacritic marks compare as unequal. // Examples: a ≠ b, a ≠ á, a = A. 2: "accent", // Strings that differ in base letters, accents and other diacritic marks, or case compare as unequal. // Other differences may also be taken into consideration. Examples: a ≠ b, a ≠ á, a ≠ A 3: "variant" // case - Only strings that differ in base letters or case compare as unequal. Examples: a ≠ b, a = á, a ≠ A. }; function collationComparator(spec) { const localeOpt = { sensitivity: COLLATION_STRENGTH[spec.strength || 3], caseFirst: spec.caseFirst === "off" ? "false" : spec.caseFirst, numeric: spec.numericOrdering || false, ignorePunctuation: spec.alternate === "shifted" }; if (spec.caseLevel === true) { if (localeOpt.sensitivity === "base") localeOpt.sensitivity = "case"; if (localeOpt.sensitivity === "accent") localeOpt.sensitivity = "variant"; } const collator = new Intl.Collator(spec.locale, localeOpt); return (a, b) => (0,_util__WEBPACK_IMPORTED_MODULE_1__.isString)(a) && (0,_util__WEBPACK_IMPORTED_MODULE_1__.isString)(b) ? collator.compare(a, b) : (0,_util__WEBPACK_IMPORTED_MODULE_1__.compare)(a, b); } /***/ }, /***/ 37206 /*!************************************************************!*\ !*** ./node_modules/mingo/esm/operators/pipeline/unset.js ***! \************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $unset: () => (/* binding */ $unset) /* harmony export */ }); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util */ 74591); /* harmony import */ var _project__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./project */ 30322); function $unset(coll, expr, options) { expr = (0,_util__WEBPACK_IMPORTED_MODULE_0__.ensureArray)(expr); const doc = {}; for (const k of expr) doc[k] = 0; return (0,_project__WEBPACK_IMPORTED_MODULE_1__.$project)(coll, doc, options); } /***/ }, /***/ 87885 /*!*************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/array/all.js ***! \*************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $all: () => (/* binding */ $all) /* harmony export */ }); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_predicates */ 74063); const $all = (selector, value, options) => (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.processQuery)(selector, value, options, _predicates__WEBPACK_IMPORTED_MODULE_0__.$all); /***/ }, /***/ 36649 /*!*******************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/array/elemMatch.js ***! \*******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $elemMatch: () => (/* binding */ $elemMatch) /* harmony export */ }); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_predicates */ 74063); const $elemMatch = (selector, value, options) => (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.processQuery)(selector, value, options, _predicates__WEBPACK_IMPORTED_MODULE_0__.$elemMatch); /***/ }, /***/ 68529 /*!***************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/array/index.js ***! \***************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $all: () => (/* reexport safe */ _all__WEBPACK_IMPORTED_MODULE_0__.$all), /* harmony export */ $elemMatch: () => (/* reexport safe */ _elemMatch__WEBPACK_IMPORTED_MODULE_1__.$elemMatch), /* harmony export */ $size: () => (/* reexport safe */ _size__WEBPACK_IMPORTED_MODULE_2__.$size) /* harmony export */ }); /* harmony import */ var _all__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./all */ 87885); /* harmony import */ var _elemMatch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./elemMatch */ 36649); /* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./size */ 93000); /***/ }, /***/ 93000 /*!**************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/array/size.js ***! \**************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $size: () => (/* binding */ $size) /* harmony export */ }); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_predicates */ 74063); const $size = (selector, value, options) => (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.processQuery)(selector, value, options, _predicates__WEBPACK_IMPORTED_MODULE_0__.$size); /***/ }, /***/ 15303 /*!*********************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/bitwise/_internal.js ***! \*********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ processBitwiseQuery: () => (/* binding */ processBitwiseQuery) /* harmony export */ }); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../util */ 74591); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../_predicates */ 74063); const processBitwiseQuery = (selector, value, predicate) => { return (0,_predicates__WEBPACK_IMPORTED_MODULE_1__.processQuery)(selector, value, null, (value2, mask) => { let b = 0; if ((0,_util__WEBPACK_IMPORTED_MODULE_0__.isArray)(mask)) { for (const n of mask) b = b | 1 << n; } else { b = mask; } return predicate(value2 & b, b); }); }; /***/ }, /***/ 90763 /*!************************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/bitwise/bitsAllClear.js ***! \************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $bitsAllClear: () => (/* binding */ $bitsAllClear) /* harmony export */ }); /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_internal */ 15303); const $bitsAllClear = (selector, value, _options) => (0,_internal__WEBPACK_IMPORTED_MODULE_0__.processBitwiseQuery)(selector, value, (result, _) => result == 0); /***/ }, /***/ 16754 /*!**********************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/bitwise/bitsAllSet.js ***! \**********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $bitsAllSet: () => (/* binding */ $bitsAllSet) /* harmony export */ }); /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_internal */ 15303); const $bitsAllSet = (selector, value, _options) => (0,_internal__WEBPACK_IMPORTED_MODULE_0__.processBitwiseQuery)(selector, value, (result, mask) => result == mask); /***/ }, /***/ 8552 /*!************************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/bitwise/bitsAnyClear.js ***! \************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $bitsAnyClear: () => (/* binding */ $bitsAnyClear) /* harmony export */ }); /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_internal */ 15303); const $bitsAnyClear = (selector, value, _options) => (0,_internal__WEBPACK_IMPORTED_MODULE_0__.processBitwiseQuery)(selector, value, (result, mask) => result < mask); /***/ }, /***/ 27821 /*!**********************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/bitwise/bitsAnySet.js ***! \**********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $bitsAnySet: () => (/* binding */ $bitsAnySet) /* harmony export */ }); /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_internal */ 15303); const $bitsAnySet = (selector, value, _options) => (0,_internal__WEBPACK_IMPORTED_MODULE_0__.processBitwiseQuery)(selector, value, (result, _) => result > 0); /***/ }, /***/ 70155 /*!*****************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/bitwise/index.js ***! \*****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $bitsAllClear: () => (/* reexport safe */ _bitsAllClear__WEBPACK_IMPORTED_MODULE_0__.$bitsAllClear), /* harmony export */ $bitsAllSet: () => (/* reexport safe */ _bitsAllSet__WEBPACK_IMPORTED_MODULE_1__.$bitsAllSet), /* harmony export */ $bitsAnyClear: () => (/* reexport safe */ _bitsAnyClear__WEBPACK_IMPORTED_MODULE_2__.$bitsAnyClear), /* harmony export */ $bitsAnySet: () => (/* reexport safe */ _bitsAnySet__WEBPACK_IMPORTED_MODULE_3__.$bitsAnySet) /* harmony export */ }); /* harmony import */ var _bitsAllClear__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./bitsAllClear */ 90763); /* harmony import */ var _bitsAllSet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bitsAllSet */ 16754); /* harmony import */ var _bitsAnyClear__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bitsAnyClear */ 8552); /* harmony import */ var _bitsAnySet__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bitsAnySet */ 27821); /***/ }, /***/ 3727 /*!*****************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/comparison/eq.js ***! \*****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $eq: () => (/* binding */ $eq) /* harmony export */ }); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_predicates */ 74063); const $eq = (selector, value, options) => (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.processQuery)(selector, value, options, _predicates__WEBPACK_IMPORTED_MODULE_0__.$eq); /***/ }, /***/ 97142 /*!*****************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/comparison/gt.js ***! \*****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $gt: () => (/* binding */ $gt) /* harmony export */ }); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_predicates */ 74063); const $gt = (selector, value, options) => (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.processQuery)(selector, value, options, _predicates__WEBPACK_IMPORTED_MODULE_0__.$gt); /***/ }, /***/ 76623 /*!******************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/comparison/gte.js ***! \******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $gte: () => (/* binding */ $gte) /* harmony export */ }); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_predicates */ 74063); const $gte = (selector, value, options) => (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.processQuery)(selector, value, options, _predicates__WEBPACK_IMPORTED_MODULE_0__.$gte); /***/ }, /***/ 16602 /*!*****************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/comparison/in.js ***! \*****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $in: () => (/* binding */ $in) /* harmony export */ }); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_predicates */ 74063); const $in = (selector, value, options) => (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.processQuery)(selector, value, options, _predicates__WEBPACK_IMPORTED_MODULE_0__.$in); /***/ }, /***/ 28845 /*!********************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/comparison/index.js ***! \********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $eq: () => (/* reexport safe */ _eq__WEBPACK_IMPORTED_MODULE_0__.$eq), /* harmony export */ $gt: () => (/* reexport safe */ _gt__WEBPACK_IMPORTED_MODULE_1__.$gt), /* harmony export */ $gte: () => (/* reexport safe */ _gte__WEBPACK_IMPORTED_MODULE_2__.$gte), /* harmony export */ $in: () => (/* reexport safe */ _in__WEBPACK_IMPORTED_MODULE_3__.$in), /* harmony export */ $lt: () => (/* reexport safe */ _lt__WEBPACK_IMPORTED_MODULE_4__.$lt), /* harmony export */ $lte: () => (/* reexport safe */ _lte__WEBPACK_IMPORTED_MODULE_5__.$lte), /* harmony export */ $ne: () => (/* reexport safe */ _ne__WEBPACK_IMPORTED_MODULE_6__.$ne), /* harmony export */ $nin: () => (/* reexport safe */ _nin__WEBPACK_IMPORTED_MODULE_7__.$nin) /* harmony export */ }); /* harmony import */ var _eq__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./eq */ 3727); /* harmony import */ var _gt__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./gt */ 97142); /* harmony import */ var _gte__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./gte */ 76623); /* harmony import */ var _in__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./in */ 16602); /* harmony import */ var _lt__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lt */ 12713); /* harmony import */ var _lte__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./lte */ 79642); /* harmony import */ var _ne__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ne */ 39060); /* harmony import */ var _nin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./nin */ 99228); /***/ }, /***/ 12713 /*!*****************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/comparison/lt.js ***! \*****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $lt: () => (/* binding */ $lt) /* harmony export */ }); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_predicates */ 74063); const $lt = (selector, value, options) => (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.processQuery)(selector, value, options, _predicates__WEBPACK_IMPORTED_MODULE_0__.$lt); /***/ }, /***/ 79642 /*!******************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/comparison/lte.js ***! \******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $lte: () => (/* binding */ $lte) /* harmony export */ }); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_predicates */ 74063); const $lte = (selector, value, options) => (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.processQuery)(selector, value, options, _predicates__WEBPACK_IMPORTED_MODULE_0__.$lte); /***/ }, /***/ 39060 /*!*****************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/comparison/ne.js ***! \*****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $ne: () => (/* binding */ $ne) /* harmony export */ }); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_predicates */ 74063); const $ne = (selector, value, options) => (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.processQuery)(selector, value, options, _predicates__WEBPACK_IMPORTED_MODULE_0__.$ne); /***/ }, /***/ 99228 /*!******************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/comparison/nin.js ***! \******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $nin: () => (/* binding */ $nin) /* harmony export */ }); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_predicates */ 74063); const $nin = (selector, value, options) => (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.processQuery)(selector, value, options, _predicates__WEBPACK_IMPORTED_MODULE_0__.$nin); /***/ }, /***/ 54738 /*!******************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/element/exists.js ***! \******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $exists: () => (/* binding */ $exists) /* harmony export */ }); /* harmony import */ var _util_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../util/_internal */ 74591); const $exists = (selector, value, _options) => { const nested = selector.includes("."); const b = !!value; if (!nested || selector.match(/\.\d+$/)) { return o => (0,_util_internal__WEBPACK_IMPORTED_MODULE_0__.resolve)(o, selector) !== void 0 === b; } const parentSelector = selector.substring(0, selector.lastIndexOf(".")); const opts = { preserveIndex: true }; return o => { const path = (0,_util_internal__WEBPACK_IMPORTED_MODULE_0__.resolveGraph)(o, selector, opts); const val = (0,_util_internal__WEBPACK_IMPORTED_MODULE_0__.resolve)(path, parentSelector); return (0,_util_internal__WEBPACK_IMPORTED_MODULE_0__.isArray)(val) ? val.some(v => v !== void 0) === b : val !== void 0 === b; }; }; /***/ }, /***/ 47540 /*!*****************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/element/index.js ***! \*****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $exists: () => (/* reexport safe */ _exists__WEBPACK_IMPORTED_MODULE_0__.$exists), /* harmony export */ $type: () => (/* reexport safe */ _type__WEBPACK_IMPORTED_MODULE_1__.$type) /* harmony export */ }); /* harmony import */ var _exists__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./exists */ 54738); /* harmony import */ var _type__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./type */ 66386); /***/ }, /***/ 66386 /*!****************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/element/type.js ***! \****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $type: () => (/* binding */ $type) /* harmony export */ }); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_predicates */ 74063); const $type = (selector, value, options) => (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.processQuery)(selector, value, options, _predicates__WEBPACK_IMPORTED_MODULE_0__.$type); /***/ }, /***/ 55775 /*!*******************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/evaluation/expr.js ***! \*******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $expr: () => (/* binding */ $expr) /* harmony export */ }); /* harmony import */ var _core_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../core/_internal */ 96720); /* harmony import */ var _util_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../util/_internal */ 74591); function $expr(_, expr, options) { return obj => (0,_util_internal__WEBPACK_IMPORTED_MODULE_1__.truthy)((0,_core_internal__WEBPACK_IMPORTED_MODULE_0__.evalExpr)(obj, expr, options), options.useStrictMode); } /***/ }, /***/ 59378 /*!********************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/evaluation/index.js ***! \********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $expr: () => (/* reexport safe */ _expr__WEBPACK_IMPORTED_MODULE_0__.$expr), /* harmony export */ $jsonSchema: () => (/* reexport safe */ _jsonSchema__WEBPACK_IMPORTED_MODULE_1__.$jsonSchema), /* harmony export */ $mod: () => (/* reexport safe */ _mod__WEBPACK_IMPORTED_MODULE_2__.$mod), /* harmony export */ $regex: () => (/* reexport safe */ _regex__WEBPACK_IMPORTED_MODULE_3__.$regex), /* harmony export */ $where: () => (/* reexport safe */ _where__WEBPACK_IMPORTED_MODULE_4__.$where) /* harmony export */ }); /* harmony import */ var _expr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./expr */ 55775); /* harmony import */ var _jsonSchema__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jsonSchema */ 14341); /* harmony import */ var _mod__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mod */ 41658); /* harmony import */ var _regex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./regex */ 24053); /* harmony import */ var _where__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./where */ 5373); /***/ }, /***/ 14341 /*!*************************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/evaluation/jsonSchema.js ***! \*************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $jsonSchema: () => (/* binding */ $jsonSchema) /* harmony export */ }); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../util */ 74591); function $jsonSchema(_, schema, options) { (0,_util__WEBPACK_IMPORTED_MODULE_0__.assert)(!!options?.jsonSchemaValidator, "$jsonSchema requires 'jsonSchemaValidator' option to be defined."); const validate = options.jsonSchemaValidator(schema); return obj => validate(obj); } /***/ }, /***/ 41658 /*!******************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/evaluation/mod.js ***! \******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $mod: () => (/* binding */ $mod) /* harmony export */ }); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_predicates */ 74063); const $mod = (selector, value, options) => (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.processQuery)(selector, value, options, _predicates__WEBPACK_IMPORTED_MODULE_0__.$mod); /***/ }, /***/ 24053 /*!********************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/evaluation/regex.js ***! \********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $regex: () => (/* binding */ $regex) /* harmony export */ }); /* harmony import */ var _predicates__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../_predicates */ 74063); const $regex = (selector, value, options) => (0,_predicates__WEBPACK_IMPORTED_MODULE_0__.processQuery)(selector, value, options, _predicates__WEBPACK_IMPORTED_MODULE_0__.$regex); /***/ }, /***/ 5373 /*!********************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/evaluation/where.js ***! \********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $where: () => (/* binding */ $where) /* harmony export */ }); /* harmony import */ var _util_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../util/_internal */ 74591); function $where(_, rhs, opts) { (0,_util_internal__WEBPACK_IMPORTED_MODULE_0__.assert)(opts.scriptEnabled, "$where requires 'scriptEnabled' option to be true"); const f = rhs; (0,_util_internal__WEBPACK_IMPORTED_MODULE_0__.assert)((0,_util_internal__WEBPACK_IMPORTED_MODULE_0__.isFunction)(f), "$where only accepts a Function objects"); return obj => (0,_util_internal__WEBPACK_IMPORTED_MODULE_0__.truthy)(f.call(obj), opts?.useStrictMode); } /***/ }, /***/ 70295 /*!*********************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/index.js ***! \*********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $all: () => (/* reexport safe */ _array__WEBPACK_IMPORTED_MODULE_0__.$all), /* harmony export */ $and: () => (/* reexport safe */ _logical__WEBPACK_IMPORTED_MODULE_5__.$and), /* harmony export */ $bitsAllClear: () => (/* reexport safe */ _bitwise__WEBPACK_IMPORTED_MODULE_1__.$bitsAllClear), /* harmony export */ $bitsAllSet: () => (/* reexport safe */ _bitwise__WEBPACK_IMPORTED_MODULE_1__.$bitsAllSet), /* harmony export */ $bitsAnyClear: () => (/* reexport safe */ _bitwise__WEBPACK_IMPORTED_MODULE_1__.$bitsAnyClear), /* harmony export */ $bitsAnySet: () => (/* reexport safe */ _bitwise__WEBPACK_IMPORTED_MODULE_1__.$bitsAnySet), /* harmony export */ $elemMatch: () => (/* reexport safe */ _array__WEBPACK_IMPORTED_MODULE_0__.$elemMatch), /* harmony export */ $eq: () => (/* reexport safe */ _comparison__WEBPACK_IMPORTED_MODULE_2__.$eq), /* harmony export */ $exists: () => (/* reexport safe */ _element__WEBPACK_IMPORTED_MODULE_3__.$exists), /* harmony export */ $expr: () => (/* reexport safe */ _evaluation__WEBPACK_IMPORTED_MODULE_4__.$expr), /* harmony export */ $gt: () => (/* reexport safe */ _comparison__WEBPACK_IMPORTED_MODULE_2__.$gt), /* harmony export */ $gte: () => (/* reexport safe */ _comparison__WEBPACK_IMPORTED_MODULE_2__.$gte), /* harmony export */ $in: () => (/* reexport safe */ _comparison__WEBPACK_IMPORTED_MODULE_2__.$in), /* harmony export */ $jsonSchema: () => (/* reexport safe */ _evaluation__WEBPACK_IMPORTED_MODULE_4__.$jsonSchema), /* harmony export */ $lt: () => (/* reexport safe */ _comparison__WEBPACK_IMPORTED_MODULE_2__.$lt), /* harmony export */ $lte: () => (/* reexport safe */ _comparison__WEBPACK_IMPORTED_MODULE_2__.$lte), /* harmony export */ $mod: () => (/* reexport safe */ _evaluation__WEBPACK_IMPORTED_MODULE_4__.$mod), /* harmony export */ $ne: () => (/* reexport safe */ _comparison__WEBPACK_IMPORTED_MODULE_2__.$ne), /* harmony export */ $nin: () => (/* reexport safe */ _comparison__WEBPACK_IMPORTED_MODULE_2__.$nin), /* harmony export */ $nor: () => (/* reexport safe */ _logical__WEBPACK_IMPORTED_MODULE_5__.$nor), /* harmony export */ $not: () => (/* reexport safe */ _logical__WEBPACK_IMPORTED_MODULE_5__.$not), /* harmony export */ $or: () => (/* reexport safe */ _logical__WEBPACK_IMPORTED_MODULE_5__.$or), /* harmony export */ $regex: () => (/* reexport safe */ _evaluation__WEBPACK_IMPORTED_MODULE_4__.$regex), /* harmony export */ $size: () => (/* reexport safe */ _array__WEBPACK_IMPORTED_MODULE_0__.$size), /* harmony export */ $type: () => (/* reexport safe */ _element__WEBPACK_IMPORTED_MODULE_3__.$type), /* harmony export */ $where: () => (/* reexport safe */ _evaluation__WEBPACK_IMPORTED_MODULE_4__.$where) /* harmony export */ }); /* harmony import */ var _array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./array */ 68529); /* harmony import */ var _bitwise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bitwise */ 70155); /* harmony import */ var _comparison__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./comparison */ 28845); /* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./element */ 47540); /* harmony import */ var _evaluation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./evaluation */ 59378); /* harmony import */ var _logical__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./logical */ 33483); /***/ }, /***/ 68770 /*!***************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/logical/and.js ***! \***************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $and: () => (/* binding */ $and) /* harmony export */ }); /* harmony import */ var _query__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../query */ 59554); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../util */ 74591); const $and = (_, rhs, options) => { (0,_util__WEBPACK_IMPORTED_MODULE_1__.assert)((0,_util__WEBPACK_IMPORTED_MODULE_1__.isArray)(rhs), "$and expects value to be an Array."); const queries = rhs.map(expr => new _query__WEBPACK_IMPORTED_MODULE_0__.Query(expr, options)); return obj => queries.every(q => q.test(obj)); }; /***/ }, /***/ 33483 /*!*****************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/logical/index.js ***! \*****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $and: () => (/* reexport safe */ _and__WEBPACK_IMPORTED_MODULE_0__.$and), /* harmony export */ $nor: () => (/* reexport safe */ _nor__WEBPACK_IMPORTED_MODULE_1__.$nor), /* harmony export */ $not: () => (/* reexport safe */ _not__WEBPACK_IMPORTED_MODULE_2__.$not), /* harmony export */ $or: () => (/* reexport safe */ _or__WEBPACK_IMPORTED_MODULE_3__.$or) /* harmony export */ }); /* harmony import */ var _and__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./and */ 68770); /* harmony import */ var _nor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./nor */ 49652); /* harmony import */ var _not__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./not */ 86322); /* harmony import */ var _or__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./or */ 20174); /***/ }, /***/ 49652 /*!***************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/logical/nor.js ***! \***************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $nor: () => (/* binding */ $nor) /* harmony export */ }); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../util */ 74591); /* harmony import */ var _or__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./or */ 20174); function $nor(_, rhs, options) { (0,_util__WEBPACK_IMPORTED_MODULE_0__.assert)((0,_util__WEBPACK_IMPORTED_MODULE_0__.isArray)(rhs), "Invalid expression. $nor expects value to be an array."); const f = (0,_or__WEBPACK_IMPORTED_MODULE_1__.$or)("$or", rhs, options); return obj => !f(obj); } /***/ }, /***/ 86322 /*!***************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/logical/not.js ***! \***************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $not: () => (/* binding */ $not) /* harmony export */ }); /* harmony import */ var _query__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../query */ 59554); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../util */ 74591); function $not(selector, rhs, options) { const criteria = {}; criteria[selector] = (0,_util__WEBPACK_IMPORTED_MODULE_1__.normalize)(rhs); const query = new _query__WEBPACK_IMPORTED_MODULE_0__.Query(criteria, options); return obj => !query.test(obj); } /***/ }, /***/ 20174 /*!**************************************************************!*\ !*** ./node_modules/mingo/esm/operators/query/logical/or.js ***! \**************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $or: () => (/* binding */ $or) /* harmony export */ }); /* harmony import */ var _query__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../query */ 59554); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../util */ 74591); function $or(_, rhs, options) { (0,_util__WEBPACK_IMPORTED_MODULE_1__.assert)((0,_util__WEBPACK_IMPORTED_MODULE_1__.isArray)(rhs), "Invalid expression. $or expects value to be an Array"); const queries = rhs.map(expr => new _query__WEBPACK_IMPORTED_MODULE_0__.Query(expr, options)); return obj => queries.some(q => q.test(obj)); } /***/ }, /***/ 88284 /*!**************************************************************!*\ !*** ./node_modules/mingo/esm/operators/update/_internal.js ***! \**************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ DEFAULT_OPTIONS: () => (/* binding */ DEFAULT_OPTIONS), /* harmony export */ applyUpdate: () => (/* binding */ applyUpdate), /* harmony export */ buildParams: () => (/* binding */ buildParams), /* harmony export */ clone: () => (/* binding */ clone), /* harmony export */ walkExpression: () => (/* binding */ walkExpression) /* harmony export */ }); /* harmony import */ var _core_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../core/_internal */ 96720); /* harmony import */ var _operators_expression_boolean__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../operators/expression/boolean */ 89888); /* harmony import */ var _operators_expression_comparison__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../operators/expression/comparison */ 56525); /* harmony import */ var _operators_query__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../operators/query */ 70295); /* harmony import */ var _query__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../query */ 59554); /* harmony import */ var _util_internal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/_internal */ 74591); const DEFAULT_OPTIONS = _core_internal__WEBPACK_IMPORTED_MODULE_0__.ComputeOptions.init({ context: _core_internal__WEBPACK_IMPORTED_MODULE_0__.Context.init().addQueryOps(_operators_query__WEBPACK_IMPORTED_MODULE_3__).addExpressionOps(_operators_expression_boolean__WEBPACK_IMPORTED_MODULE_1__).addExpressionOps(_operators_expression_comparison__WEBPACK_IMPORTED_MODULE_2__) }).update({ updateConfig: { cloneMode: "copy" } }); const clone = (val, opts) => { const mode = opts?.local?.updateConfig?.cloneMode; switch (mode) { case "deep": return (0,_util_internal__WEBPACK_IMPORTED_MODULE_5__.cloneDeep)(val); case "copy": { if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_5__.isDate)(val)) return new Date(val); if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_5__.isArray)(val)) return val.slice(); if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_5__.isObject)(val)) return Object.assign({}, val); if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_5__.isRegExp)(val)) return new RegExp(val); return val; } } return val; }; const FIRST_ONLY = "$"; const ARRAY_WIDE = "$[]"; const applyUpdate = (o, n, q, f, opts) => { const { selector, position: c, next } = n; if (!c) { let b = false; const g = (u, k) => b = Boolean(f(u, k)) || b; (0,_util_internal__WEBPACK_IMPORTED_MODULE_5__.walk)(o, selector, g, opts); return b; } const arr = (0,_util_internal__WEBPACK_IMPORTED_MODULE_5__.resolve)(o, selector); if (!(0,_util_internal__WEBPACK_IMPORTED_MODULE_5__.isArray)(arr) || !arr.length) return false; if (c === FIRST_ONLY) { const i = arr.findIndex(e => q[selector].test({ [selector]: [e] })); (0,_util_internal__WEBPACK_IMPORTED_MODULE_5__.assert)(i > -1, "BUG: positional operator found no match for " + selector); return next ? applyUpdate(arr[i], next, q, f, opts) : f(arr, i); } let status = false; for (let i = 0; i < arr.length; i++) { const e = arr[i]; if (c !== ARRAY_WIDE && q[c] && !q[c].test({ [c]: [e] })) continue; status = next ? applyUpdate(e, next, q, f, opts) || status : f(arr, i) || status; } return status; }; const ERR_MISSING_FIELD = "You must include the array field for '.$' as part of the query document."; const ERR_IMMUTABLE_FIELD = (path, idKey) => `Performing an update on the path '${path}' would modify the immutable field '${idKey}'.`; function walkExpression(expr, arrayFilters, options, callback) { const opts = options; const params = opts.local.updateParams ?? buildParams([expr], arrayFilters, opts); const modified = []; for (const key of Object.keys(expr)) { const { node, queries } = params[key]; if (callback(expr[key], node, queries)) modified.push(node.selector); } return modified.sort(); } function buildParams(exprList, arrayFilters, options) { const params = {}; arrayFilters ||= []; const filterIndexMap = arrayFilters.reduce((res, filter) => { for (const k of Object.keys(filter)) { const parent = k.substring(0, k.indexOf(".")) || k; if (res[parent]) { res[parent][k] = filter[k]; } else { res[parent] = { [k]: filter[k] }; } } return res; }, {}); let { condition } = options.local; condition = condition ?? {}; const queryKeys = Object.keys(condition); const conflictDetector = new _util_internal__WEBPACK_IMPORTED_MODULE_5__.PathValidator(); for (const expr of exprList) { for (const selector of Object.keys(expr)) { (0,_util_internal__WEBPACK_IMPORTED_MODULE_5__.assertNoProto)(selector); (0,_util_internal__WEBPACK_IMPORTED_MODULE_5__.assert)(!selector.startsWith("$"), `Dollar ($) prefixed field paths is not allowed in update operations: '${selector}'.`); const identifiers = []; const node = selector.includes("$") ? { selector: "" } : { selector }; if (!node.selector) { selector.split(".").reduce((n, v) => { if (v === FIRST_ONLY || v === ARRAY_WIDE) { n.position = v; } else if (v.startsWith("$[") && v.endsWith("]")) { const id = v.slice(2, -1); (0,_util_internal__WEBPACK_IMPORTED_MODULE_5__.assert)(/^[a-z]+\w*$/.test(id), `The filter must begin with a lowercase letter and contain only alphanumeric characters. '${v}' is invalid.`); identifiers.push(id); n.position = id; } else if (!n.selector) { n.selector = v; } else if (!n.position) { n.selector += "." + v; } else { n.next = { selector: v }; return n.next; } return n; }, node); } const queries = {}; if (identifiers.length) { const filters = {}; for (const v of identifiers) filters[v] = filterIndexMap[v]; for (const k of Object.keys(filters)) { queries[k] = new _query__WEBPACK_IMPORTED_MODULE_4__.Query(filters[k], options); } } if (node.position === FIRST_ONLY) { const field = node.selector; (0,_util_internal__WEBPACK_IMPORTED_MODULE_5__.assert)(queryKeys && queryKeys.length, ERR_MISSING_FIELD); const matches = queryKeys.filter(k2 => k2 === field || k2.startsWith(field + ".")); (0,_util_internal__WEBPACK_IMPORTED_MODULE_5__.assert)(matches.length === 1, ERR_MISSING_FIELD); const k = matches[0]; queries[field] = new _query__WEBPACK_IMPORTED_MODULE_4__.Query({ [k]: condition[k] }, options); } const idKey = options.idKey; (0,_util_internal__WEBPACK_IMPORTED_MODULE_5__.assert)(node.selector !== idKey && !node.selector.startsWith(`${idKey}.`), ERR_IMMUTABLE_FIELD(node.selector, idKey)); (0,_util_internal__WEBPACK_IMPORTED_MODULE_5__.assert)(conflictDetector.add(node.selector), `updating the path '${node.selector}' would create a conflict at '${node.selector}'`); params[selector] = { node, queries }; } } return params; } /***/ }, /***/ 33556 /*!*************************************************************!*\ !*** ./node_modules/mingo/esm/operators/update/addToSet.js ***! \*************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $addToSet: () => (/* binding */ $addToSet) /* harmony export */ }); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util */ 74591); /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_internal */ 88284); function $addToSet(expr, arrayFilters = [], options = _internal__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_OPTIONS) { return obj => { return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.walkExpression)(expr, arrayFilters, options, (val, node, queries) => { const args = { $each: [val] }; if ((0,_util__WEBPACK_IMPORTED_MODULE_0__.isObject)(val) && (0,_util__WEBPACK_IMPORTED_MODULE_0__.has)(val, "$each")) { Object.assign(args, val); } return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.applyUpdate)(obj, node, queries, (o, k) => { const prev = o[k]; if ((0,_util__WEBPACK_IMPORTED_MODULE_0__.isArray)(prev)) { const set = (0,_util__WEBPACK_IMPORTED_MODULE_0__.unique)(prev.concat(args.$each)); if (set.length === prev.length) return false; o[k] = (0,_internal__WEBPACK_IMPORTED_MODULE_1__.clone)(set, options); } else if (prev === void 0) { o[k] = (0,_internal__WEBPACK_IMPORTED_MODULE_1__.clone)(args.$each, options); } else { return false; } return true; }, { buildGraph: true }); }); }; } /***/ }, /***/ 23715 /*!********************************************************!*\ !*** ./node_modules/mingo/esm/operators/update/bit.js ***! \********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $bit: () => (/* binding */ $bit) /* harmony export */ }); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util */ 74591); /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_internal */ 88284); const BIT_OPS = ["and", "or", "xor"]; function $bit(expr, arrayFilters = [], options = _internal__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_OPTIONS) { for (const vals of Object.values(expr)) { (0,_util__WEBPACK_IMPORTED_MODULE_0__.assert)((0,_util__WEBPACK_IMPORTED_MODULE_0__.isObject)(vals), `$bit operator expression must be an object.`); const op = Object.keys(vals); (0,_util__WEBPACK_IMPORTED_MODULE_0__.assert)(op.length === 1 && BIT_OPS.includes(op[0]), `$bit spec is invalid '${op[0]}'. Must be one of 'and', 'or', or 'xor'.`); (0,_util__WEBPACK_IMPORTED_MODULE_0__.assert)((0,_util__WEBPACK_IMPORTED_MODULE_0__.isNumber)(vals[op[0]]), `$bit expression value must be a number. Got ${typeof vals[op[0]]}`); } return obj => { return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.walkExpression)(expr, arrayFilters, options, (val, node, queries) => { const op = Object.keys(val); return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.applyUpdate)(obj, node, queries, (o, k) => { let n = o[k]; const v = val[op[0]]; if (n !== void 0 && !((0,_util__WEBPACK_IMPORTED_MODULE_0__.isNumber)(n) && (0,_util__WEBPACK_IMPORTED_MODULE_0__.isNumber)(v))) return false; n = n || 0; switch (op[0]) { case "and": return (o[k] = n & v) !== n; case "or": return (o[k] = n | v) !== n; case "xor": return (o[k] = n ^ v) !== n; } }, { buildGraph: true }); }); }; } /***/ }, /***/ 93933 /*!****************************************************************!*\ !*** ./node_modules/mingo/esm/operators/update/currentDate.js ***! \****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $currentDate: () => (/* binding */ $currentDate) /* harmony export */ }); /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_internal */ 88284); function $currentDate(expr, arrayFilters = [], options = _internal__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_OPTIONS) { return obj => { return (0,_internal__WEBPACK_IMPORTED_MODULE_0__.walkExpression)(expr, arrayFilters, options, (val, node, queries) => { return (0,_internal__WEBPACK_IMPORTED_MODULE_0__.applyUpdate)(obj, node, queries, (o, k) => { o[k] = val === true || val.$type === "date" ? options.now : options.now.getTime(); return true; }, { buildGraph: true }); }); }; } /***/ }, /***/ 51288 /*!********************************************************!*\ !*** ./node_modules/mingo/esm/operators/update/inc.js ***! \********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $inc: () => (/* binding */ $inc) /* harmony export */ }); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util */ 74591); /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_internal */ 88284); function $inc(expr, arrayFilters = [], options = _internal__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_OPTIONS) { return obj => { return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.walkExpression)(expr, arrayFilters, options, (val, node, queries) => { return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.applyUpdate)(obj, node, queries, (o, k) => { if ((0,_util__WEBPACK_IMPORTED_MODULE_0__.isNumber)(o[k]) || o[k] === void 0) { o[k] ||= 0; o[k] += val; return true; } return false; }, { buildGraph: true }); }); }; } /***/ }, /***/ 64644 /*!**********************************************************!*\ !*** ./node_modules/mingo/esm/operators/update/index.js ***! \**********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $addToSet: () => (/* reexport safe */ _addToSet__WEBPACK_IMPORTED_MODULE_0__.$addToSet), /* harmony export */ $bit: () => (/* reexport safe */ _bit__WEBPACK_IMPORTED_MODULE_1__.$bit), /* harmony export */ $currentDate: () => (/* reexport safe */ _currentDate__WEBPACK_IMPORTED_MODULE_2__.$currentDate), /* harmony export */ $inc: () => (/* reexport safe */ _inc__WEBPACK_IMPORTED_MODULE_3__.$inc), /* harmony export */ $max: () => (/* reexport safe */ _max__WEBPACK_IMPORTED_MODULE_4__.$max), /* harmony export */ $min: () => (/* reexport safe */ _min__WEBPACK_IMPORTED_MODULE_5__.$min), /* harmony export */ $mul: () => (/* reexport safe */ _mul__WEBPACK_IMPORTED_MODULE_6__.$mul), /* harmony export */ $pop: () => (/* reexport safe */ _pop__WEBPACK_IMPORTED_MODULE_7__.$pop), /* harmony export */ $pull: () => (/* reexport safe */ _pull__WEBPACK_IMPORTED_MODULE_8__.$pull), /* harmony export */ $pullAll: () => (/* reexport safe */ _pullAll__WEBPACK_IMPORTED_MODULE_9__.$pullAll), /* harmony export */ $push: () => (/* reexport safe */ _push__WEBPACK_IMPORTED_MODULE_10__.$push), /* harmony export */ $rename: () => (/* reexport safe */ _rename__WEBPACK_IMPORTED_MODULE_11__.$rename), /* harmony export */ $set: () => (/* reexport safe */ _set__WEBPACK_IMPORTED_MODULE_12__.$set), /* harmony export */ $unset: () => (/* reexport safe */ _unset__WEBPACK_IMPORTED_MODULE_13__.$unset) /* harmony export */ }); /* harmony import */ var _addToSet__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./addToSet */ 33556); /* harmony import */ var _bit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bit */ 23715); /* harmony import */ var _currentDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./currentDate */ 93933); /* harmony import */ var _inc__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./inc */ 51288); /* harmony import */ var _max__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./max */ 34886); /* harmony import */ var _min__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./min */ 63960); /* harmony import */ var _mul__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./mul */ 52206); /* harmony import */ var _pop__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./pop */ 76387); /* harmony import */ var _pull__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./pull */ 53357); /* harmony import */ var _pullAll__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./pullAll */ 17858); /* harmony import */ var _push__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./push */ 51890); /* harmony import */ var _rename__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./rename */ 76652); /* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./set */ 27756); /* harmony import */ var _unset__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./unset */ 11329); /***/ }, /***/ 34886 /*!********************************************************!*\ !*** ./node_modules/mingo/esm/operators/update/max.js ***! \********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $max: () => (/* binding */ $max) /* harmony export */ }); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util */ 74591); /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_internal */ 88284); function $max(expr, arrayFilters = [], options = _internal__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_OPTIONS) { return obj => { return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.walkExpression)(expr, arrayFilters, options, (val, node, queries) => { return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.applyUpdate)(obj, node, queries, (o, k) => { if ((0,_util__WEBPACK_IMPORTED_MODULE_0__.compare)(o[k], val) > -1) return false; o[k] = val; return true; }, { buildGraph: true }); }); }; } /***/ }, /***/ 63960 /*!********************************************************!*\ !*** ./node_modules/mingo/esm/operators/update/min.js ***! \********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $min: () => (/* binding */ $min) /* harmony export */ }); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util */ 74591); /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_internal */ 88284); function $min(expr, arrayFilters = [], options = _internal__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_OPTIONS) { return obj => { return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.walkExpression)(expr, arrayFilters, options, (val, node, queries) => { return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.applyUpdate)(obj, node, queries, (o, k) => { if ((0,_util__WEBPACK_IMPORTED_MODULE_0__.compare)(o[k], val) < 1) return false; o[k] = val; return true; }, { buildGraph: true }); }); }; } /***/ }, /***/ 52206 /*!********************************************************!*\ !*** ./node_modules/mingo/esm/operators/update/mul.js ***! \********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $mul: () => (/* binding */ $mul) /* harmony export */ }); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util */ 74591); /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_internal */ 88284); function $mul(expr, arrayFilters = [], options = _internal__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_OPTIONS) { return obj => { return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.walkExpression)(expr, arrayFilters, options, (val, node, queries) => { return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.applyUpdate)(obj, node, queries, (o, k) => { const prev = o[k]; if ((0,_util__WEBPACK_IMPORTED_MODULE_0__.isNumber)(o[k])) o[k] = o[k] * val;else if (o[k] === void 0) o[k] = 0; return o[k] !== prev; }, { buildGraph: true }); }); }; } /***/ }, /***/ 76387 /*!********************************************************!*\ !*** ./node_modules/mingo/esm/operators/update/pop.js ***! \********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $pop: () => (/* binding */ $pop) /* harmony export */ }); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util */ 74591); /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_internal */ 88284); function $pop(expr, arrayFilters = [], options = _internal__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_OPTIONS) { return obj => { return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.walkExpression)(expr, arrayFilters, options, (val, node, queries) => { return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.applyUpdate)(obj, node, queries, (o, k) => { const arr = o[k]; if (!(0,_util__WEBPACK_IMPORTED_MODULE_0__.isArray)(arr) || !arr.length) return false; if (val === -1) arr.splice(0, 1);else arr.pop(); return true; }); }); }; } /***/ }, /***/ 53357 /*!*********************************************************!*\ !*** ./node_modules/mingo/esm/operators/update/pull.js ***! \*********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $pull: () => (/* binding */ $pull) /* harmony export */ }); /* harmony import */ var _query__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../query */ 59554); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../util */ 74591); /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_internal */ 88284); function $pull(expr, arrayFilters = [], options = _internal__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_OPTIONS) { return obj => { return (0,_internal__WEBPACK_IMPORTED_MODULE_2__.walkExpression)(expr, arrayFilters, options, (val, node, queries) => { const wrap = !(0,_util__WEBPACK_IMPORTED_MODULE_1__.isObject)(val) || Object.keys(val).some(_util__WEBPACK_IMPORTED_MODULE_1__.isOperator); const query = new _query__WEBPACK_IMPORTED_MODULE_0__.Query(wrap ? { k: val } : val, options); const pred = wrap ? v => query.test({ k: v }) : v => query.test(v); return (0,_internal__WEBPACK_IMPORTED_MODULE_2__.applyUpdate)(obj, node, queries, (o, k) => { const prev = o[k]; if (!(0,_util__WEBPACK_IMPORTED_MODULE_1__.isArray)(prev) || !prev.length) return false; const curr = new Array(); let ok = false; for (const v of prev) { const b = pred(v); if (!b) curr.push(v); ok ||= b; } if (!ok) return false; o[k] = curr; return true; }); }); }; } /***/ }, /***/ 17858 /*!************************************************************!*\ !*** ./node_modules/mingo/esm/operators/update/pullAll.js ***! \************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $pullAll: () => (/* binding */ $pullAll) /* harmony export */ }); /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_internal */ 88284); /* harmony import */ var _pull__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pull */ 53357); function $pullAll(expr, arrayFilters = [], options = _internal__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_OPTIONS) { const pullExpr = {}; for (const k of Object.keys(expr)) { pullExpr[k] = { $in: expr[k] }; } return (0,_pull__WEBPACK_IMPORTED_MODULE_1__.$pull)(pullExpr, arrayFilters, options); } /***/ }, /***/ 51890 /*!*********************************************************!*\ !*** ./node_modules/mingo/esm/operators/update/push.js ***! \*********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $push: () => (/* binding */ $push) /* harmony export */ }); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util */ 74591); /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_internal */ 88284); const MODIFIERS = ["$each", "$slice", "$sort", "$position"]; function $push(expr, arrayFilters = [], options = _internal__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_OPTIONS) { return obj => { return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.walkExpression)(expr, arrayFilters, options, (val, node, queries) => { const args = { $each: [val] }; if ((0,_util__WEBPACK_IMPORTED_MODULE_0__.isObject)(val) && MODIFIERS.some(m => (0,_util__WEBPACK_IMPORTED_MODULE_0__.has)(val, m))) { Object.assign(args, val); } return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.applyUpdate)(obj, node, queries, (o, k) => { const arr = o[k]; if (!(0,_util__WEBPACK_IMPORTED_MODULE_0__.isArray)(arr)) { if (arr === void 0) { o[k] = (0,_internal__WEBPACK_IMPORTED_MODULE_1__.clone)(args.$each, options); return true; } return false; } const prev = arr.slice(0, args.$slice || arr.length); const oldsize = arr.length; const pos = (0,_util__WEBPACK_IMPORTED_MODULE_0__.isNumber)(args.$position) ? args.$position : arr.length; arr.splice(pos, 0, ...(0,_internal__WEBPACK_IMPORTED_MODULE_1__.clone)(args.$each, options)); if (args.$sort) { const sortKey = (0,_util__WEBPACK_IMPORTED_MODULE_0__.isObject)(args.$sort) ? Object.keys(args.$sort)[0] : ""; const order = !sortKey ? args.$sort : args.$sort[sortKey]; const f = !sortKey ? a => a : a => (0,_util__WEBPACK_IMPORTED_MODULE_0__.resolve)(a, sortKey); arr.sort((a, b) => order * (0,_util__WEBPACK_IMPORTED_MODULE_0__.compare)(f(a), f(b))); } if ((0,_util__WEBPACK_IMPORTED_MODULE_0__.isNumber)(args.$slice)) { if (args.$slice < 0) arr.splice(0, arr.length + args.$slice);else arr.splice(args.$slice); } return oldsize != arr.length || !(0,_util__WEBPACK_IMPORTED_MODULE_0__.isEqual)(prev, arr); }, { descendArray: true, buildGraph: true }); }); }; } /***/ }, /***/ 76652 /*!***********************************************************!*\ !*** ./node_modules/mingo/esm/operators/update/rename.js ***! \***********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $rename: () => (/* binding */ $rename) /* harmony export */ }); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util */ 74591); /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_internal */ 88284); /* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./set */ 27756); const isIdPath = (path, idKey) => path === idKey || path.startsWith(`${idKey}.`); function $rename(expr, arrayFilters = [], options = _internal__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_OPTIONS) { const idKey = options.idKey; for (const target of Object.values(expr)) { (0,_util__WEBPACK_IMPORTED_MODULE_0__.assert)(!isIdPath(target, idKey), `Performing an update on the path '${target}' would modify the immutable field '${idKey}'.`); } return obj => { const res = []; const changed = (0,_internal__WEBPACK_IMPORTED_MODULE_1__.walkExpression)(expr, arrayFilters, options, (val, node, queries) => { return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.applyUpdate)(obj, node, queries, (o, k) => { if (!(0,_util__WEBPACK_IMPORTED_MODULE_0__.has)(o, k)) return false; Array.prototype.push.apply(res, (0,_set__WEBPACK_IMPORTED_MODULE_2__.$set)({ [val]: o[k] }, arrayFilters, options)(obj)); delete o[k]; return true; }); }); return Array.from(new Set(changed.concat(res))); }; } /***/ }, /***/ 27756 /*!********************************************************!*\ !*** ./node_modules/mingo/esm/operators/update/set.js ***! \********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $set: () => (/* binding */ $set) /* harmony export */ }); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util */ 74591); /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_internal */ 88284); function $set(expr, arrayFilters = [], options = _internal__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_OPTIONS) { return obj => { return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.walkExpression)(expr, arrayFilters, options, (val, node, queries) => { return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.applyUpdate)(obj, node, queries, (o, k) => { if ((0,_util__WEBPACK_IMPORTED_MODULE_0__.isEqual)(o[k], val)) return false; o[k] = (0,_internal__WEBPACK_IMPORTED_MODULE_1__.clone)(val, options); return true; }, { buildGraph: true }); }); }; } /***/ }, /***/ 11329 /*!**********************************************************!*\ !*** ./node_modules/mingo/esm/operators/update/unset.js ***! \**********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $unset: () => (/* binding */ $unset) /* harmony export */ }); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util */ 74591); /* harmony import */ var _internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_internal */ 88284); function $unset(expr, arrayFilters = [], options = _internal__WEBPACK_IMPORTED_MODULE_1__.DEFAULT_OPTIONS) { return obj => { return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.walkExpression)(expr, arrayFilters, options, (_, node, queries) => { return (0,_internal__WEBPACK_IMPORTED_MODULE_1__.applyUpdate)(obj, node, queries, (o, k) => { if (!(0,_util__WEBPACK_IMPORTED_MODULE_0__.has)(o, k)) return false; const prev = o[k]; if ((0,_util__WEBPACK_IMPORTED_MODULE_0__.isArray)(o)) o[k] = null;else delete o[k]; return !(0,_util__WEBPACK_IMPORTED_MODULE_0__.isEqual)(prev, o[k]); }); }); }; } /***/ }, /***/ 59554 /*!*****************************************!*\ !*** ./node_modules/mingo/esm/query.js ***! \*****************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Query: () => (/* binding */ Query) /* harmony export */ }); /* harmony import */ var _core_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/_internal */ 96720); /* harmony import */ var _cursor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cursor */ 35066); /* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ 74591); const TOP_LEVEL_OPS = /* @__PURE__ */new Set(["$and", "$or", "$nor", "$expr", "$jsonSchema"]); class Query { #compiled; #condition; #options; /** * Creates an instance of the query with the specified condition and options. * This object is preloaded with all query and projection operators. * * @param condition - The query condition object used to define the criteria for matching documents. * @param options - Optional configuration settings to customize the query behavior. */ constructor(condition, options) { this.#condition = (0,_util__WEBPACK_IMPORTED_MODULE_2__.cloneDeep)(condition); this.#options = _core_internal__WEBPACK_IMPORTED_MODULE_0__.ComputeOptions.init(options).update({ condition }); this.#compiled = []; this.compile(); } compile() { (0,_util__WEBPACK_IMPORTED_MODULE_2__.assert)((0,_util__WEBPACK_IMPORTED_MODULE_2__.isObject)(this.#condition), `query criteria must be an object: ${JSON.stringify(this.#condition)}`); const whereOperator = {}; for (const field of Object.keys(this.#condition)) { const expr = this.#condition[field]; if ("$where" === field) { (0,_util__WEBPACK_IMPORTED_MODULE_2__.assert)(this.#options.scriptEnabled, "$where operator requires 'scriptEnabled' option to be true."); Object.assign(whereOperator, { field, expr }); } else if (TOP_LEVEL_OPS.has(field)) { this.processOperator(field, field, expr); } else { (0,_util__WEBPACK_IMPORTED_MODULE_2__.assert)(!(0,_util__WEBPACK_IMPORTED_MODULE_2__.isOperator)(field), `unknown top level operator: ${field}`); const normalizedExpr = (0,_util__WEBPACK_IMPORTED_MODULE_2__.normalize)(expr); for (const operator of Object.keys(normalizedExpr)) { this.processOperator(field, operator, normalizedExpr[operator]); } } if (whereOperator.field) { this.processOperator(whereOperator.field, whereOperator.field, whereOperator.expr); } } } processOperator(field, operator, value) { const fn = this.#options.context.getOperator(_core_internal__WEBPACK_IMPORTED_MODULE_0__.OpType.QUERY, operator); (0,_util__WEBPACK_IMPORTED_MODULE_2__.assert)(!!fn, `unknown query operator ${operator}`); this.#compiled.push(fn(field, value, this.#options)); } /** * Tests whether the given object satisfies all compiled predicates. * * @template T - The type of the object to test. * @param obj - The object to be tested against the compiled predicates. * @returns `true` if the object satisfies all predicates, otherwise `false`. */ test(obj) { return this.#compiled.every(p => p(obj)); } /** * Returns a cursor for iterating over the items in the given collection that match the query criteria. * * @typeParam T - The type of the items in the resulting cursor. * @param collection - The source collection to search through. * @param projection - An optional object specifying fields to include or exclude * in the returned items. * @returns A `Cursor` instance for iterating over the matching items. */ find(collection, projection) { return new _cursor__WEBPACK_IMPORTED_MODULE_1__.Cursor(collection, o => this.test(o), projection || {}, this.#options); } } /***/ }, /***/ 40887 /*!*******************************************!*\ !*** ./node_modules/mingo/esm/updater.js ***! \*******************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ update: () => (/* binding */ update), /* harmony export */ updateMany: () => (/* binding */ updateMany), /* harmony export */ updateOne: () => (/* binding */ updateOne) /* harmony export */ }); /* harmony import */ var _core_internal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./core/_internal */ 96720); /* harmony import */ var _lazy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lazy */ 45578); /* harmony import */ var _operators_expression_boolean__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./operators/expression/boolean */ 89888); /* harmony import */ var _operators_expression_comparison__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./operators/expression/comparison */ 56525); /* harmony import */ var _operators_pipeline_addFields__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./operators/pipeline/addFields */ 34521); /* harmony import */ var _operators_pipeline_project__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./operators/pipeline/project */ 30322); /* harmony import */ var _operators_pipeline_replaceRoot__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./operators/pipeline/replaceRoot */ 20043); /* harmony import */ var _operators_pipeline_replaceWith__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./operators/pipeline/replaceWith */ 25099); /* harmony import */ var _operators_pipeline_set__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./operators/pipeline/set */ 35307); /* harmony import */ var _operators_pipeline_sort__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./operators/pipeline/sort */ 24079); /* harmony import */ var _operators_pipeline_unset__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./operators/pipeline/unset */ 37206); /* harmony import */ var _operators_query__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./operators/query */ 70295); /* harmony import */ var _operators_update__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./operators/update */ 64644); /* harmony import */ var _operators_update_internal__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./operators/update/_internal */ 88284); /* harmony import */ var _query__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./query */ 59554); /* harmony import */ var _util_internal__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./util/_internal */ 74591); /* harmony import */ var _util_internal__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./util/_internal */ 91234); const UPDATE_OPERATORS = _operators_update__WEBPACK_IMPORTED_MODULE_12__; const PIPELINE_OPERATORS = { $addFields: _operators_pipeline_addFields__WEBPACK_IMPORTED_MODULE_4__.$addFields, $set: _operators_pipeline_set__WEBPACK_IMPORTED_MODULE_8__.$set, $project: _operators_pipeline_project__WEBPACK_IMPORTED_MODULE_5__.$project, $unset: _operators_pipeline_unset__WEBPACK_IMPORTED_MODULE_10__.$unset, $replaceRoot: _operators_pipeline_replaceRoot__WEBPACK_IMPORTED_MODULE_6__.$replaceRoot, $replaceWith: _operators_pipeline_replaceWith__WEBPACK_IMPORTED_MODULE_7__.$replaceWith }; function update(obj, modifier, arrayFilters, condition, options) { const docs = [obj]; const res = updateOne(docs, condition || {}, modifier, { arrayFilters, cloneMode: options?.cloneMode ?? "copy" }, options?.queryOptions); return res.modifiedFields ?? []; } function updateMany(documents, condition, modifier, updateConfig = {}, options) { const { modifiedCount, matchedCount } = updateDocuments(documents, condition, modifier, updateConfig, options); return { modifiedCount, matchedCount }; } function updateOne(documents, condition, modifier, updateConfig = {}, options) { return updateDocuments(documents, condition, modifier, updateConfig, { ...options, firstOnly: true }); } function updateDocuments(documents, condition, modifier, updateConfig = {}, options) { options ||= {}; const firstOnly = options?.firstOnly ?? false; const opts = _core_internal__WEBPACK_IMPORTED_MODULE_0__.ComputeOptions.init({ ...options, collation: Object.assign({}, options?.collation, updateConfig?.collation) }).update({ condition, updateConfig: { cloneMode: "copy", ...updateConfig }, variables: updateConfig.let, updateParams: {} }); opts.context.addExpressionOps(_operators_expression_boolean__WEBPACK_IMPORTED_MODULE_2__).addExpressionOps(_operators_expression_comparison__WEBPACK_IMPORTED_MODULE_3__).addQueryOps(_operators_query__WEBPACK_IMPORTED_MODULE_11__).addPipelineOps(PIPELINE_OPERATORS); const filterExists = Object.keys(condition).length > 0; const matchedDocs = /* @__PURE__ */new Map(); let docsIter = (0,_lazy__WEBPACK_IMPORTED_MODULE_1__.Lazy)(documents); if (filterExists) { const query = new _query__WEBPACK_IMPORTED_MODULE_14__.Query(condition, opts); docsIter = docsIter.filter((o, i) => { if (query.test(o)) { matchedDocs.set(o, i); return true; } return false; }); } let modifiedIndex = -1; if (firstOnly) { const indexes = /* @__PURE__ */new Map(); if (updateConfig.sort) { if (!filterExists) { docsIter = docsIter.map((o, i) => { indexes.set(o, i); return o; }); } docsIter = (0,_operators_pipeline_sort__WEBPACK_IMPORTED_MODULE_9__.$sort)(docsIter, updateConfig.sort, opts); } docsIter = docsIter.take(1); const firstDoc = docsIter.collect()[0]; modifiedIndex = matchedDocs.get(firstDoc) ?? indexes.get(firstDoc) ?? 0; } const foundDocs = docsIter.collect(); if (foundDocs.length === 0) return { matchedCount: 0, modifiedCount: 0 }; if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_15__.isArray)(modifier)) { const indexes = firstOnly ? [modifiedIndex] : Array.from(matchedDocs.values()); const hashes = indexes.length ? indexes.map(i => (0,_util_internal__WEBPACK_IMPORTED_MODULE_16__.hashCode)(documents[i])) : foundDocs.map(o => (0,_util_internal__WEBPACK_IMPORTED_MODULE_16__.hashCode)(o)); const output2 = { matchedCount: hashes.length, modifiedCount: 0 }; const oldFirstDoc = firstOnly ? (0,_util_internal__WEBPACK_IMPORTED_MODULE_15__.cloneDeep)(documents[indexes[0]]) : void 0; let updateIter = (0,_lazy__WEBPACK_IMPORTED_MODULE_1__.Lazy)(foundDocs); for (const stage of modifier) { const [op, expr] = Object.entries(stage)[0]; const pipelineOp = PIPELINE_OPERATORS[op]; (0,_util_internal__WEBPACK_IMPORTED_MODULE_15__.assert)(pipelineOp, `Unknown pipeline operator: '${op}'.`); updateIter = pipelineOp(updateIter, expr, opts); } const matches = updateIter.collect(); if (indexes.length) { (0,_util_internal__WEBPACK_IMPORTED_MODULE_15__.assert)(indexes.length === matches.length, "bug: indexes and result size must match."); for (let i = 0; i < indexes.length; i++) { if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_16__.hashCode)(matches[i]) !== hashes[i]) { documents[indexes[i]] = matches[i]; output2.modifiedCount++; } } } else { for (let i = 0; i < documents.length; i++) { if ((0,_util_internal__WEBPACK_IMPORTED_MODULE_16__.hashCode)(matches[i]) !== hashes[i]) { documents[i] = matches[i]; output2.modifiedCount++; } } } if (firstOnly && output2.modifiedCount && oldFirstDoc) { const newDoc = documents[indexes[0]]; const modifiedFields2 = getModifiedFields(modifier, oldFirstDoc, newDoc); (0,_util_internal__WEBPACK_IMPORTED_MODULE_15__.assert)(modifiedFields2.length, "bug: failed to retrieve modified fields"); Object.assign(output2, { modifiedFields: modifiedFields2, modifiedIndex }); } return output2; } const unknownOp = Object.keys(modifier).find(op => !UPDATE_OPERATORS[op]); (0,_util_internal__WEBPACK_IMPORTED_MODULE_15__.assert)(!unknownOp, `Unknown update operator: '${unknownOp}'.`); const arrayFilters = updateConfig?.arrayFilters ?? []; opts.update({ updateParams: (0,_operators_update_internal__WEBPACK_IMPORTED_MODULE_13__.buildParams)(Object.values(modifier), arrayFilters, opts) }); const matchedCount = foundDocs.length; const output = { matchedCount, modifiedCount: 0 }; const modifiedFields = []; const fns = []; for (const op of Object.keys(modifier)) { const fn = UPDATE_OPERATORS[op]; const expr = modifier[op]; fns.push(fn(expr, arrayFilters, opts)); } for (const doc of foundDocs) { let modified = false; for (const mutate of fns) { const fields = mutate(doc); if (fields.length) { modified = true; if (firstOnly) Array.prototype.push.apply(modifiedFields, fields); } } output.modifiedCount += +modified; } if (firstOnly && modifiedFields.length) { modifiedFields.sort(); Object.assign(output, { modifiedFields, modifiedIndex }); } return output; } function getModifiedFields(pipeline, oldDoc, newDoc) { const stageFields = []; for (const stage of pipeline) { const op = Object.keys(stage)[0]; const expr = stage[op]; switch (op) { case "$addFields": case "$set": case "$project": case "$replaceWith": stageFields.push(...Object.keys(expr)); break; case "$unset": stageFields.push(...(0,_util_internal__WEBPACK_IMPORTED_MODULE_15__.ensureArray)(expr)); break; case "$replaceRoot": stageFields.length = 0; stageFields.push(...Object.keys(expr?.newRoot)); break; } } const stageFieldsSet = new Set(stageFields.sort()); const pathValidator = new _util_internal__WEBPACK_IMPORTED_MODULE_15__.PathValidator(); const modifiedFields = []; for (const key of stageFieldsSet) { if (pathValidator.add(key) && !(0,_util_internal__WEBPACK_IMPORTED_MODULE_15__.isEqual)((0,_util_internal__WEBPACK_IMPORTED_MODULE_15__.resolve)(newDoc, key), (0,_util_internal__WEBPACK_IMPORTED_MODULE_15__.resolve)(oldDoc, key))) { modifiedFields.push(key); } } for (const key of Object.keys(oldDoc)) { if (stageFieldsSet.has(key)) continue; if (!pathValidator.add(key) || !(0,_util_internal__WEBPACK_IMPORTED_MODULE_15__.isEqual)(newDoc[key], oldDoc[key])) { modifiedFields.push(key); } } const topLevelValidator = new _util_internal__WEBPACK_IMPORTED_MODULE_15__.PathValidator(); return modifiedFields.sort().filter(key => topLevelValidator.add(key)); } /***/ }, /***/ 91234 /*!**********************************************!*\ !*** ./node_modules/mingo/esm/util/_hash.js ***! \**********************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ hashCode: () => (/* binding */ hashCode) /* harmony export */ }); const MULTIPLIER = 16777619; function mix(h, x) { return h * MULTIPLIER ^ x >>> 0; } function hashNumber(n) { if (Number.isNaN(n)) return 2143289344; if (!Number.isFinite(n)) return n > 0 ? 2139095040 : 4286578688; const intPart = Math.trunc(n); const frac = n - intPart; let h = intPart | 0; if (frac !== 0) { const scaled = Math.floor(frac * 4294967296); h = mix(h, scaled | 0); } return h >>> 0; } function hashString(str) { let h = 0; for (let i = 0; i < str.length; i++) { h = mix(h, str.charCodeAt(i)); } return h >>> 0; } function hashBigInt(b) { let h = 0; const isNegative = b < 0n; let x = isNegative ? -b : b; if (x === 0n) { h = mix(h, 0); } else { while (x > 0n) { const byte = Number(x & 0xffn); h = mix(h, byte); x >>= 8n; } } return mix(h, +isNegative) >>> 0; } function hashFunction(fn) { let h = hashString((fn.name || "") + fn.toString()); h = mix(h, fn.length); return h >>> 0; } function hashBytes(bytes) { let h = 0; for (let i = 0; i < bytes.length; i++) { h = mix(h, bytes[i]); } return h >>> 0; } function hashTypedArray(view) { let h = hashString(view.constructor.name); const bytes = new Uint8Array(view.buffer, view.byteOffset, view.byteLength); h = mix(h, hashBytes(bytes)); return h >>> 0; } function hashArray(arr, seen) { if (seen.has(arr)) return 13 /* Cycle */; seen.add(arr); let h = 1; for (let i = 0; i < arr.length; i++) { h = mix(h, internalHash(arr[i], seen)); } seen.delete(arr); return h >>> 0; } function hashObject(obj, seen) { if (seen.has(obj)) return 13 /* Cycle */; seen.add(obj); const keys = Object.keys(obj).sort(); let h = hashString(obj?.constructor?.name); for (const k of keys) { h = mix(h, hashString(k)); h = mix(h, internalHash(obj[k], seen)); } seen.delete(obj); return h >>> 0; } const BOOLEAN_HASH = [3735928559, 305441741].map(b => mix(3 /* Boolean */, b)); const NULL_HASH = mix(1 /* Null */, 0); const UNDEF_HASH = mix(2 /* Undefined */, 0); function internalHash(value, seen) { if (value === null) return NULL_HASH; const t = typeof value; switch (t) { case "undefined": return UNDEF_HASH; case "boolean": return BOOLEAN_HASH[+value]; case "number": return mix(4 /* Number */, hashNumber(value)); case "string": return mix(5 /* String */, hashString(value)); case "bigint": return mix(6 /* BigInt */, hashBigInt(value)); case "function": return mix(7 /* Function */, hashFunction(value)); default: { if (ArrayBuffer.isView(value) && !(value instanceof DataView)) return mix(12 /* TypedArray */, hashTypedArray(value)); if (value instanceof Date) return mix(10 /* Date */, hashNumber(value.getTime())); if (value instanceof RegExp) { const h = hashString(value.source); return mix(11 /* RegExp */, mix(h, hashString(value.flags))); } if (Array.isArray(value)) return mix(8 /* Array */, hashArray(value, seen)); return mix(9 /* Object */, hashObject(value, seen)); } } } function hashCode(value) { return internalHash(value, /* @__PURE__ */new WeakSet()) >>> 0; } /***/ }, /***/ 74591 /*!**************************************************!*\ !*** ./node_modules/mingo/esm/util/_internal.js ***! \**************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ HashMap: () => (/* binding */ HashMap), /* harmony export */ MISSING: () => (/* binding */ MISSING), /* harmony export */ MingoError: () => (/* binding */ MingoError), /* harmony export */ OBJECT_PROTO_PROPS: () => (/* binding */ OBJECT_PROTO_PROPS), /* harmony export */ PathValidator: () => (/* binding */ PathValidator), /* harmony export */ assert: () => (/* binding */ assert), /* harmony export */ assertNoProto: () => (/* binding */ assertNoProto), /* harmony export */ cloneDeep: () => (/* binding */ cloneDeep), /* harmony export */ compare: () => (/* binding */ compare), /* harmony export */ ensureArray: () => (/* binding */ ensureArray), /* harmony export */ filterMissing: () => (/* binding */ filterMissing), /* harmony export */ findInsertIndex: () => (/* binding */ findInsertIndex), /* harmony export */ flatten: () => (/* binding */ flatten), /* harmony export */ groupBy: () => (/* binding */ groupBy), /* harmony export */ has: () => (/* binding */ has), /* harmony export */ hashCode: () => (/* reexport safe */ _hash__WEBPACK_IMPORTED_MODULE_0__.hashCode), /* harmony export */ intersection: () => (/* binding */ intersection), /* harmony export */ isArray: () => (/* binding */ isArray), /* harmony export */ isBoolean: () => (/* binding */ isBoolean), /* harmony export */ isDate: () => (/* binding */ isDate), /* harmony export */ isEmpty: () => (/* binding */ isEmpty), /* harmony export */ isEqual: () => (/* binding */ isEqual), /* harmony export */ isFunction: () => (/* binding */ isFunction), /* harmony export */ isInteger: () => (/* binding */ isInteger), /* harmony export */ isNil: () => (/* binding */ isNil), /* harmony export */ isNumber: () => (/* binding */ isNumber), /* harmony export */ isObject: () => (/* binding */ isObject), /* harmony export */ isObjectLike: () => (/* binding */ isObjectLike), /* harmony export */ isOperator: () => (/* binding */ isOperator), /* harmony export */ isPrimitive: () => (/* binding */ isPrimitive), /* harmony export */ isRegExp: () => (/* binding */ isRegExp), /* harmony export */ isString: () => (/* binding */ isString), /* harmony export */ isSymbol: () => (/* binding */ isSymbol), /* harmony export */ normalize: () => (/* binding */ normalize), /* harmony export */ removeValue: () => (/* binding */ removeValue), /* harmony export */ resolve: () => (/* binding */ resolve), /* harmony export */ resolveGraph: () => (/* binding */ resolveGraph), /* harmony export */ setValue: () => (/* binding */ setValue), /* harmony export */ simpleCmp: () => (/* binding */ simpleCmp), /* harmony export */ truthy: () => (/* binding */ truthy), /* harmony export */ typeOf: () => (/* binding */ typeOf), /* harmony export */ unique: () => (/* binding */ unique), /* harmony export */ walk: () => (/* binding */ walk) /* harmony export */ }); /* harmony import */ var _hash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_hash */ 91234); class MingoError extends Error {} const MISSING = /* @__PURE__ */Symbol("missing"); const ERR_CYCLE_FOUND = "mingo: cycle detected while processing object/array"; const isPrimitive = v => typeof v !== "object" && typeof v !== "function" || v === null; const isScalar = v => isPrimitive(v) || isDate(v) || isRegExp(v); const SORT_ORDER = { undefined: 1, null: 2, number: 3, string: 4, symbol: 5, object: 6, array: 7, arraybuffer: 8, boolean: 9, date: 10, regexp: 11, function: 12 }; const simpleCmp = (a, b) => a < b ? -1 : a > b ? 1 : 0; const typedArraysCmp = (a, b) => { const bytesA = new Uint8Array(a.buffer, a.byteOffset, a.byteLength); const bytesB = new Uint8Array(b.buffer, b.byteOffset, b.byteLength); const size = Math.min(bytesA.length, bytesB.length); for (let i = 0; i < size; i++) { const order = simpleCmp(bytesA[i], bytesB[i]); if (order !== 0) return order; } return simpleCmp(bytesA.length, bytesB.length); }; function mingoCmp(a, b, descendArray = false) { if (a === MISSING) a = void 0; if (b === MISSING) b = void 0; if (a === b || Object.is(a, b)) return 0; const typeA = typeOf(a); const typeB = typeOf(b); let neq = 0; if (typeA === typeB) { switch (typeA) { case "number": case "string": case "boolean": return simpleCmp(a, b); case "date": return simpleCmp(+a, +b); case "regexp": if (neq = simpleCmp(a.source, b.source)) return neq; return simpleCmp(a.flags, b.flags); case "arraybuffer": return typedArraysCmp(a, b); case "array": { const xs = a.slice().sort(mingoCmp); const ys = b.slice().sort(mingoCmp); const size = Math.min(xs.length, ys.length); for (let i = 0; i < size; i++) if (neq = mingoCmp(xs[i], ys[i])) return neq; return simpleCmp(xs.length, ys.length); } default: { if (typeA !== "object") { if (a?.constructor === b?.constructor && hasCustomString(a)) return simpleCmp(a.toString(), b.toString()); } const keysA = Object.keys(a).sort(); const keysB = Object.keys(b).sort(); if (neq = mingoCmp(keysA, keysB)) return neq; for (const k of keysA) if (neq = mingoCmp(a[k], b[k])) return neq; return 0; } } } if (typeA == "undefined") return -1; if (typeB == "undefined") return 1; if (descendArray) { if (typeA == "array") { const xs = a; if (!xs.length) return -1; const sorted = xs.slice().sort(mingoCmp); neq = 1; for (const v of sorted) if ((neq = Math.min(neq, mingoCmp(v, b))) < 0) return neq; return neq; } if (typeB == "array") { const ys = b; if (!ys.length) return 1; const sorted = ys.slice().sort(mingoCmp); neq = -1; for (const v of sorted) if ((neq = Math.max(neq, mingoCmp(a, v))) > 0) return neq; return neq; } } const orderA = SORT_ORDER[typeA] ?? Number.MAX_VALUE; const orderB = SORT_ORDER[typeB] ?? Number.MAX_VALUE; return orderA !== orderB ? simpleCmp(orderA, orderB) : simpleCmp(typeA, typeB); } const compare = (a, b) => mingoCmp(a, b, true); const hasCustomString = o => o !== null && o !== void 0 && o["toString"] !== Object.prototype.toString; function isEqual(a, b) { if (a === b || Object.is(a, b)) return true; if (a === null || b === null) return false; if (typeof a !== typeof b) return false; if (typeof a !== "object") return false; if (a.constructor !== b?.constructor) return false; if (isDate(a)) return isDate(b) && +a === +b; if (isRegExp(a)) return isRegExp(b) && a.source === b.source && a.flags === b.flags; if (isArray(a) && isArray(b)) { return a.length === b.length && a.every((v, i) => isEqual(v, b[i])); } if (a?.constructor !== Object && hasCustomString(a)) { return a?.toString() === b?.toString(); } const objA = a; const objB = b; const keysA = Object.keys(objA); const keysB = Object.keys(objB); if (keysA.length !== keysB.length) return false; return keysA.every(k => has(objB, k) && isEqual(objA[k], objB[k])); } class HashMap extends Map { // maps the hashcode to key set #keyMap = /* @__PURE__ */new Map(); // returns a tuple of [, ]. Expects an object key. #unpack = key => { const hash = (0,_hash__WEBPACK_IMPORTED_MODULE_0__.hashCode)(key); const items = this.#keyMap.get(hash) ?? []; return [items.find(k => isEqual(k, key)), hash]; }; constructor() { super(); } /** * Returns a new {@link HashMap} object. * @param fn An optional custom hash function */ static init() { return new HashMap(); } clear() { super.clear(); this.#keyMap.clear(); } delete(key) { if (isPrimitive(key)) return super.delete(key); const [masterKey, hash] = this.#unpack(key); if (!super.delete(masterKey)) return false; this.#keyMap.set(hash, this.#keyMap.get(hash).filter(k => !isEqual(k, masterKey))); return true; } get(key) { if (isPrimitive(key)) return super.get(key); const [masterKey, _] = this.#unpack(key); return super.get(masterKey); } has(key) { if (isPrimitive(key)) return super.has(key); const [masterKey, _] = this.#unpack(key); return super.has(masterKey); } set(key, value) { if (isPrimitive(key)) return super.set(key, value); const [masterKey, hash] = this.#unpack(key); if (super.has(masterKey)) { super.set(masterKey, value); } else { super.set(key, value); const keys = this.#keyMap.get(hash) || []; keys.push(key); this.#keyMap.set(hash, keys); } return this; } /** * @returns the number of elements in the Map. */ get size() { return super.size; } } function assert(condition, msg) { if (!condition) throw new MingoError(msg); } const assertNoProto = s => { if (s === "__proto__" || s.startsWith("__proto__.") || s.endsWith(".__proto__") || s.includes(".__proto__.")) { throw new MingoError(`Accessing __proto__ is not allowed in selector: '${s}'.`); } }; function typeOf(v) { const t = typeof v; switch (t) { case "number": case "string": case "boolean": case "undefined": case "function": case "symbol": return t; } if (v === null) return "null"; if (isArray(v)) return "array"; if (isDate(v)) return "date"; if (isRegExp(v)) return "regexp"; if (isTypedArray(v)) return "arraybuffer"; if (v?.constructor === Object) return "object"; return v?.constructor?.name?.toLowerCase() ?? "object"; } const isBoolean = v => typeof v === "boolean"; const isString = v => typeof v === "string"; const isSymbol = v => typeof v === "symbol"; const isNumber = v => !Number.isNaN(v) && typeof v === "number"; const isInteger = Number.isInteger; const isArray = Array.isArray; const isObject = v => typeOf(v) === "object"; const isObjectLike = v => !isPrimitive(v); const isDate = v => v instanceof Date; const isRegExp = v => v instanceof RegExp; const isFunction = v => typeof v === "function"; const isNil = v => v === null || v === void 0; const truthy = (arg, strict = true) => !!arg || strict && arg === ""; const isEmpty = x => isNil(x) || isString(x) && !x || isArray(x) && x.length === 0 || isObject(x) && Object.keys(x).length === 0; const ensureArray = x => isArray(x) ? x : [x]; const has = (obj, key1, key2 = "", key3 = "") => !!(obj && Object.prototype.hasOwnProperty.call(obj, key1) && (key2 === "" || Object.prototype.hasOwnProperty.call(obj, key2)) && (key3 === "" || Object.prototype.hasOwnProperty.call(obj, key3))); const isTypedArray = v => typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView(v); const isDigits = s => { for (let i = 0; i < s.length; i++) if (s.charCodeAt(i) < 48 || s.charCodeAt(i) > 57) return false; return true; }; const cloneDeep = (v, refs) => { if (isPrimitive(v)) return v; if (isDate(v)) return new Date(v); if (isRegExp(v)) return new RegExp(v); if (isTypedArray(v)) { const ctor = v.constructor; return new ctor(v); } if (!(refs instanceof WeakSet)) refs = /* @__PURE__ */new WeakSet(); if (refs.has(v)) throw new Error(ERR_CYCLE_FOUND); refs.add(v); try { if (isArray(v)) { const arr = new Array(v.length); for (let i = 0; i < v.length; i++) arr[i] = cloneDeep(v[i], refs); return arr; } if (isObject(v)) { const obj = {}; for (const k of Object.keys(v)) obj[k] = cloneDeep(v[k], refs); return obj; } } finally { refs.delete(v); } return v; }; function intersection(input) { if (input.length === 0) return []; if (input.length === 1) return input[0].slice(); for (const arr of input) if (arr.length === 0) return []; const maps = [HashMap.init(), HashMap.init()]; let index = 0; for (const v of input[input.length - 1]) maps[0].set(v, true); for (let i = input.length - 2; i >= 0; i--) { for (let j = 0; j < input[i].length; j++) { const v = input[i][j]; if (maps[index].has(v)) maps[index ^ 1].set(v, true); } if (maps[index ^ 1].size === 0) return []; maps[index].clear(); index = index ^ 1; } return Array.from(maps[index].keys()); } function flatten(xs, depth = 1) { const arr = new Array(); function flatten2(ys, n) { for (let i = 0, len = ys.length; i < len; i++) { if (isArray(ys[i]) && (n > 0 || n < 0)) { flatten2(ys[i], Math.max(-1, n - 1)); } else { arr.push(ys[i]); } } } flatten2(xs, depth); return arr; } function unique(input) { const m = HashMap.init(); for (const v of input) m.set(v, true); return Array.from(m.keys()); } function groupBy(collection, keyFunc) { if (collection.length < 1) return /* @__PURE__ */new Map(); const result = HashMap.init(); for (let i = 0; i < collection.length; i++) { const obj = collection[i]; const key = keyFunc(obj, i) ?? null; let a = result.get(key); if (!a) { a = [obj]; result.set(key, a); } else { a.push(obj); } } return result; } const OBJECT_PROTO_PROPS = new Set(Object.getOwnPropertyNames(Object.prototype).find(s => s !== "__proto__")); function getValue(obj, key) { if (isPrimitive(obj) || Number.isNaN(key)) return void 0; if (isArray(obj)) return obj[typeof key === "number" ? key : Number(key)]; return !OBJECT_PROTO_PROPS.has(key) || has(obj, key) ? obj[key] : void 0; } function unwrap(arr, depth) { if (depth < 1) return arr; while (depth-- && arr.length === 1 && isArray(arr[0])) arr = arr[0]; return arr; } function resolve(obj, selector, options) { assertNoProto(selector); if (isScalar(obj)) return obj; if (!selector.includes(".") && !isArray(obj)) { return getValue(obj, selector); } let depth = 0; function resolvePath(o, path) { let value = o; let begin = 0; let dot = 0; while (dot !== -1) { dot = path.indexOf(".", begin); const field = dot === -1 ? path.substring(begin) : path.substring(begin, dot); const isIndex = isDigits(field); if (!isIndex && isArray(value)) { if (begin === 0 && depth > 0) break; depth += 1; const subpath = path.substring(begin); value = value.reduce((acc, item) => { const v = resolvePath(item, subpath); if (v !== void 0) acc.push(v); return acc; }, []); break; } else { value = getValue(value, field); } if (value === void 0) break; begin += field.length + 1; } return value; } const res = resolvePath(obj, selector); return isArray(res) && options?.unwrapArray ? unwrap(res, depth) : res; } function resolveGraph(obj, selector, options) { if (options?.ignoreProto !== true) { assertNoProto(selector); options = { ...options, ignoreProto: true }; } const sep = selector.indexOf("."); const key = sep == -1 ? selector : selector.substring(0, sep); const next = selector.substring(sep + 1); const hasNext = sep != -1; if (isArray(obj)) { const isIndex = isDigits(key); const arr = isIndex && options?.preserveIndex ? obj.slice() : []; if (isIndex) { const index = Number(key); let value2 = getValue(obj, key); if (hasNext) { value2 = resolveGraph(value2, next, options); } if (options?.preserveIndex) { arr[index] = value2; } else { arr.push(value2); } } else { for (const item of obj) { const value2 = resolveGraph(item, selector, options); if (options?.preserveMissing) { arr.push(value2 == void 0 ? MISSING : value2); } else if (value2 != void 0 || options?.preserveIndex) { arr.push(value2); } } } return arr; } const res = options?.preserveKeys ? { ...obj } : {}; let value = getValue(obj, key); if (hasNext) { value = resolveGraph(value, next, options); } if (value === void 0) return void 0; res[key] = value; return res; } function filterMissing(obj) { if (isArray(obj)) { for (let i = obj.length - 1; i >= 0; i--) { if (obj[i] === MISSING) { obj.splice(i, 1); } else { filterMissing(obj[i]); } } } else if (isObject(obj)) { for (const k of Object.keys(obj)) { if (has(obj, k)) { filterMissing(obj[k]); } } } } function walk(obj, selector, fn, options) { if (options?.ignoreProto !== true) { assertNoProto(selector); options = { ...options, ignoreProto: true }; } const dotIndex = selector.indexOf("."); const key = dotIndex === -1 ? selector : selector.substring(0, dotIndex); const next = selector.substring(key.length + 1); if (next.length === 0) { if (isObject(obj) || isArray(obj) && isDigits(key)) fn(obj, key); } else { if (options?.buildGraph && isNil(obj[key])) obj[key] = {}; const item = obj[key]; if (!item) return; const nextDotIndex = next.indexOf("."); const nextKey = nextDotIndex === -1 ? next : next.substring(0, nextDotIndex); const isNextArrayIndex = isDigits(nextKey); if (isArray(item) && options?.descendArray && !isNextArrayIndex) { item.forEach(e => walk(e, next, fn, options)); } else { walk(item, next, fn, options); } } } function setValue(obj, selector, value) { walk(obj, selector, (item, key) => item[key] = value, { buildGraph: true }); } function removeValue(obj, selector, options) { walk(obj, selector, (item, key) => { if (isArray(item)) { item.splice(Number(key), 1); } else if (isObject(item)) { delete item[key]; } }, options); } const isOperator = name => !!name && name[0] === "$" && /^\$[a-zA-Z0-9_]+$/.test(name); function normalize(expr) { if (isScalar(expr)) { return isRegExp(expr) ? { $regex: expr } : { $eq: expr }; } if (isObjectLike(expr)) { if (!Object.keys(expr).some(isOperator)) return { $eq: expr }; if (isObject(expr) && has(expr, "$regex")) { const newExpr = { ...expr }; newExpr["$regex"] = new RegExp(expr["$regex"], expr["$options"]); delete newExpr["$options"]; return newExpr; } } return expr; } function findInsertIndex(sorted, item, comparator = compare) { let lo = 0; let hi = sorted.length - 1; while (lo <= hi) { const mid = Math.round(lo + (hi - lo) / 2); if (comparator(item, sorted[mid]) < 0) { hi = mid - 1; } else if (comparator(item, sorted[mid]) > 0) { lo = mid + 1; } else { return mid; } } return lo; } class PathValidator { constructor() { this.root = { children: /* @__PURE__ */new Map(), isTerminal: false }; } add(selector) { const parts = selector.split("."); let current = this.root; for (const part of parts) { if (current.isTerminal) return false; if (!current.children.has(part)) { current.children.set(part, { children: /* @__PURE__ */new Map(), isTerminal: false }); } current = current.children.get(part); } if (current.isTerminal || current.children.size) return false; return current.isTerminal = true; } } /***/ }, /***/ 20160 /*!*******************************************************!*\ !*** ./node_modules/monotone-convex-hull-2d/index.js ***! \*******************************************************/ (module, __unused_webpack_exports, __webpack_require__) { "use strict"; module.exports = monotoneConvexHull2D; var orient = (__webpack_require__(/*! robust-orientation */ 67600)[3]); function monotoneConvexHull2D(points) { var n = points.length; if (n < 3) { var result = new Array(n); for (var i = 0; i < n; ++i) { result[i] = i; } if (n === 2 && points[0][0] === points[1][0] && points[0][1] === points[1][1]) { return [0]; } return result; } //Sort point indices along x-axis var sorted = new Array(n); for (var i = 0; i < n; ++i) { sorted[i] = i; } sorted.sort(function (a, b) { var d = points[a][0] - points[b][0]; if (d) { return d; } return points[a][1] - points[b][1]; }); //Construct upper and lower hulls var lower = [sorted[0], sorted[1]]; var upper = [sorted[0], sorted[1]]; for (var i = 2; i < n; ++i) { var idx = sorted[i]; var p = points[idx]; //Insert into lower list var m = lower.length; while (m > 1 && orient(points[lower[m - 2]], points[lower[m - 1]], p) <= 0) { m -= 1; lower.pop(); } lower.push(idx); //Insert into upper list m = upper.length; while (m > 1 && orient(points[upper[m - 2]], points[upper[m - 1]], p) >= 0) { m -= 1; upper.pop(); } upper.push(idx); } //Merge lists together var result = new Array(upper.length + lower.length - 2); var ptr = 0; for (var i = 0, nl = lower.length; i < nl; ++i) { result[ptr++] = lower[i]; } for (var j = upper.length - 2; j > 0; --j) { result[ptr++] = upper[j]; } //Return result return result; } /***/ }, /***/ 9124 /*!**********************************!*\ !*** ./node_modules/ms/index.js ***! \**********************************/ (module) { /** * Helpers. */ var s = 1000; var m = s * 60; var h = m * 60; var d = h * 24; var w = d * 7; var y = d * 365.25; /** * Parse or format the given `val`. * * Options: * * - `long` verbose formatting [false] * * @param {String|Number} val * @param {Object} [options] * @throws {Error} throw an error if val is not a non-empty string or a number * @return {String|Number} * @api public */ module.exports = function (val, options) { options = options || {}; var type = typeof val; if (type === 'string' && val.length > 0) { return parse(val); } else if (type === 'number' && isFinite(val)) { return options.long ? fmtLong(val) : fmtShort(val); } throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val)); }; /** * Parse the given `str` and return milliseconds. * * @param {String} str * @return {Number} * @api private */ function parse(str) { str = String(str); if (str.length > 100) { return; } var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str); if (!match) { return; } var n = parseFloat(match[1]); var type = (match[2] || 'ms').toLowerCase(); switch (type) { case 'years': case 'year': case 'yrs': case 'yr': case 'y': return n * y; case 'weeks': case 'week': case 'w': return n * w; case 'days': case 'day': case 'd': return n * d; case 'hours': case 'hour': case 'hrs': case 'hr': case 'h': return n * h; case 'minutes': case 'minute': case 'mins': case 'min': case 'm': return n * m; case 'seconds': case 'second': case 'secs': case 'sec': case 's': return n * s; case 'milliseconds': case 'millisecond': case 'msecs': case 'msec': case 'ms': return n; default: return undefined; } } /** * Short format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtShort(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return Math.round(ms / d) + 'd'; } if (msAbs >= h) { return Math.round(ms / h) + 'h'; } if (msAbs >= m) { return Math.round(ms / m) + 'm'; } if (msAbs >= s) { return Math.round(ms / s) + 's'; } return ms + 'ms'; } /** * Long format for `ms`. * * @param {Number} ms * @return {String} * @api private */ function fmtLong(ms) { var msAbs = Math.abs(ms); if (msAbs >= d) { return plural(ms, msAbs, d, 'day'); } if (msAbs >= h) { return plural(ms, msAbs, h, 'hour'); } if (msAbs >= m) { return plural(ms, msAbs, m, 'minute'); } if (msAbs >= s) { return plural(ms, msAbs, s, 'second'); } return ms + ' ms'; } /** * Pluralization helper. */ function plural(ms, msAbs, n, name) { var isPlural = msAbs >= n * 1.5; return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); } /***/ }, /***/ 56294 /*!****************************************************!*\ !*** ./node_modules/object-keys/implementation.js ***! \****************************************************/ (module, __unused_webpack_exports, __webpack_require__) { "use strict"; var keysShim; if (!Object.keys) { // modified from https://github.com/es-shims/es5-shim var has = Object.prototype.hasOwnProperty; var toStr = Object.prototype.toString; var isArgs = __webpack_require__(/*! ./isArguments */ 24866); // eslint-disable-line global-require var isEnumerable = Object.prototype.propertyIsEnumerable; var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString'); var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype'); var dontEnums = ['toString', 'toLocaleString', 'valueOf', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor']; var equalsConstructorPrototype = function (o) { var ctor = o.constructor; return ctor && ctor.prototype === o; }; var excludedKeys = { $applicationCache: true, $console: true, $external: true, $frame: true, $frameElement: true, $frames: true, $innerHeight: true, $innerWidth: true, $onmozfullscreenchange: true, $onmozfullscreenerror: true, $outerHeight: true, $outerWidth: true, $pageXOffset: true, $pageYOffset: true, $parent: true, $scrollLeft: true, $scrollTop: true, $scrollX: true, $scrollY: true, $self: true, $webkitIndexedDB: true, $webkitStorageInfo: true, $window: true }; var hasAutomationEqualityBug = function () { /* global window */ if (typeof window === 'undefined') { return false; } for (var k in window) { try { if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') { try { equalsConstructorPrototype(window[k]); } catch (e) { return true; } } } catch (e) { return true; } } return false; }(); var equalsConstructorPrototypeIfNotBuggy = function (o) { /* global window */ if (typeof window === 'undefined' || !hasAutomationEqualityBug) { return equalsConstructorPrototype(o); } try { return equalsConstructorPrototype(o); } catch (e) { return false; } }; keysShim = function keys(object) { var isObject = object !== null && typeof object === 'object'; var isFunction = toStr.call(object) === '[object Function]'; var isArguments = isArgs(object); var isString = isObject && toStr.call(object) === '[object String]'; var theKeys = []; if (!isObject && !isFunction && !isArguments) { throw new TypeError('Object.keys called on a non-object'); } var skipProto = hasProtoEnumBug && isFunction; if (isString && object.length > 0 && !has.call(object, 0)) { for (var i = 0; i < object.length; ++i) { theKeys.push(String(i)); } } if (isArguments && object.length > 0) { for (var j = 0; j < object.length; ++j) { theKeys.push(String(j)); } } else { for (var name in object) { if (!(skipProto && name === 'prototype') && has.call(object, name)) { theKeys.push(String(name)); } } } if (hasDontEnumBug) { var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object); for (var k = 0; k < dontEnums.length; ++k) { if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) { theKeys.push(dontEnums[k]); } } } return theKeys; }; } module.exports = keysShim; /***/ }, /***/ 47758 /*!*******************************************!*\ !*** ./node_modules/object-keys/index.js ***! \*******************************************/ (module, __unused_webpack_exports, __webpack_require__) { "use strict"; var slice = Array.prototype.slice; var isArgs = __webpack_require__(/*! ./isArguments */ 24866); var origKeys = Object.keys; var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __webpack_require__(/*! ./implementation */ 56294); var originalKeys = Object.keys; keysShim.shim = function shimObjectKeys() { if (Object.keys) { var keysWorksWithArguments = function () { // Safari 5.0 bug var args = Object.keys(arguments); return args && args.length === arguments.length; }(1, 2); if (!keysWorksWithArguments) { Object.keys = function keys(object) { // eslint-disable-line func-name-matching if (isArgs(object)) { return originalKeys(slice.call(object)); } return originalKeys(object); }; } } else { Object.keys = keysShim; } return Object.keys || keysShim; }; module.exports = keysShim; /***/ }, /***/ 24866 /*!*************************************************!*\ !*** ./node_modules/object-keys/isArguments.js ***! \*************************************************/ (module) { "use strict"; var toStr = Object.prototype.toString; module.exports = function isArguments(value) { var str = toStr.call(value); var isArgs = str === '[object Arguments]'; if (!isArgs) { isArgs = str !== '[object Array]' && value !== null && typeof value === 'object' && typeof value.length === 'number' && value.length >= 0 && toStr.call(value.callee) === '[object Function]'; } return isArgs; }; /***/ }, /***/ 7696 /*!*********************************************************************!*\ !*** ./node_modules/path/node_modules/inherits/inherits_browser.js ***! \*********************************************************************/ (module) { if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor; ctor.prototype = Object.create(superCtor.prototype, { constructor: { value: ctor, enumerable: false, writable: true, configurable: true } }); }; } else { // old school shim for old browsers module.exports = function inherits(ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function () {}; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; }; } /***/ }, /***/ 3065 /*!************************************************************************!*\ !*** ./node_modules/path/node_modules/util/support/isBufferBrowser.js ***! \************************************************************************/ (module) { module.exports = function isBuffer(arg) { return arg && typeof arg === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function'; }; /***/ }, /***/ 77483 /*!*****************************************************!*\ !*** ./node_modules/path/node_modules/util/util.js ***! \*****************************************************/ (__unused_webpack_module, exports, __webpack_require__) { // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var formatRegExp = /%[sdj%]/g; exports.format = function (f) { if (!isString(f)) { var objects = []; for (var i = 0; i < arguments.length; i++) { objects.push(inspect(arguments[i])); } return objects.join(' '); } var i = 1; var args = arguments; var len = args.length; var str = String(f).replace(formatRegExp, function (x) { if (x === '%%') return '%'; if (i >= len) return x; switch (x) { case '%s': return String(args[i++]); case '%d': return Number(args[i++]); case '%j': try { return JSON.stringify(args[i++]); } catch (_) { return '[Circular]'; } default: return x; } }); for (var x = args[i]; i < len; x = args[++i]) { if (isNull(x) || !isObject(x)) { str += ' ' + x; } else { str += ' ' + inspect(x); } } return str; }; // Mark that a method should not be used. // Returns a modified function which warns once by default. // If --no-deprecation is set, then it is a no-op. exports.deprecate = function (fn, msg) { // Allow for deprecating things in the process of starting up. if (isUndefined(global.process)) { return function () { return exports.deprecate(fn, msg).apply(this, arguments); }; } if (process.noDeprecation === true) { return fn; } var warned = false; function deprecated() { if (!warned) { if (process.throwDeprecation) { throw new Error(msg); } else if (process.traceDeprecation) { console.trace(msg); } else { console.error(msg); } warned = true; } return fn.apply(this, arguments); } return deprecated; }; var debugs = {}; var debugEnviron; exports.debuglog = function (set) { if (isUndefined(debugEnviron)) debugEnviron = process.env.NODE_DEBUG || ''; set = set.toUpperCase(); if (!debugs[set]) { if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { var pid = process.pid; debugs[set] = function () { var msg = exports.format.apply(exports, arguments); console.error('%s %d: %s', set, pid, msg); }; } else { debugs[set] = function () {}; } } return debugs[set]; }; /** * Echos the value of a value. Trys to print the value out * in the best way possible given the different types. * * @param {Object} obj The object to print out. * @param {Object} opts Optional options object that alters the output. */ /* legacy: obj, showHidden, depth, colors*/ function inspect(obj, opts) { // default options var ctx = { seen: [], stylize: stylizeNoColor }; // legacy... if (arguments.length >= 3) ctx.depth = arguments[2]; if (arguments.length >= 4) ctx.colors = arguments[3]; if (isBoolean(opts)) { // legacy... ctx.showHidden = opts; } else if (opts) { // got an "options" object exports._extend(ctx, opts); } // set default options if (isUndefined(ctx.showHidden)) ctx.showHidden = false; if (isUndefined(ctx.depth)) ctx.depth = 2; if (isUndefined(ctx.colors)) ctx.colors = false; if (isUndefined(ctx.customInspect)) ctx.customInspect = true; if (ctx.colors) ctx.stylize = stylizeWithColor; return formatValue(ctx, obj, ctx.depth); } exports.inspect = inspect; // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics inspect.colors = { 'bold': [1, 22], 'italic': [3, 23], 'underline': [4, 24], 'inverse': [7, 27], 'white': [37, 39], 'grey': [90, 39], 'black': [30, 39], 'blue': [34, 39], 'cyan': [36, 39], 'green': [32, 39], 'magenta': [35, 39], 'red': [31, 39], 'yellow': [33, 39] }; // Don't use 'blue' not visible on cmd.exe inspect.styles = { 'special': 'cyan', 'number': 'yellow', 'boolean': 'yellow', 'undefined': 'grey', 'null': 'bold', 'string': 'green', 'date': 'magenta', // "name": intentionally not styling 'regexp': 'red' }; function stylizeWithColor(str, styleType) { var style = inspect.styles[styleType]; if (style) { return '\u001b[' + inspect.colors[style][0] + 'm' + str + '\u001b[' + inspect.colors[style][1] + 'm'; } else { return str; } } function stylizeNoColor(str, styleType) { return str; } function arrayToHash(array) { var hash = {}; array.forEach(function (val, idx) { hash[val] = true; }); return hash; } function formatValue(ctx, value, recurseTimes) { // Provide a hook for user-specified inspect functions. // Check that value is an object with an inspect function on it if (ctx.customInspect && value && isFunction(value.inspect) && // Filter out the util module, it's inspect function is special value.inspect !== exports.inspect && // Also filter out any prototype objects using the circular check. !(value.constructor && value.constructor.prototype === value)) { var ret = value.inspect(recurseTimes, ctx); if (!isString(ret)) { ret = formatValue(ctx, ret, recurseTimes); } return ret; } // Primitive types cannot have properties var primitive = formatPrimitive(ctx, value); if (primitive) { return primitive; } // Look up the keys of the object. var keys = Object.keys(value); var visibleKeys = arrayToHash(keys); if (ctx.showHidden) { keys = Object.getOwnPropertyNames(value); } // IE doesn't make error fields non-enumerable // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx if (isError(value) && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { return formatError(value); } // Some type of object without properties can be shortcutted. if (keys.length === 0) { if (isFunction(value)) { var name = value.name ? ': ' + value.name : ''; return ctx.stylize('[Function' + name + ']', 'special'); } if (isRegExp(value)) { return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); } if (isDate(value)) { return ctx.stylize(Date.prototype.toString.call(value), 'date'); } if (isError(value)) { return formatError(value); } } var base = '', array = false, braces = ['{', '}']; // Make Array say that they are Array if (isArray(value)) { array = true; braces = ['[', ']']; } // Make functions say that they are functions if (isFunction(value)) { var n = value.name ? ': ' + value.name : ''; base = ' [Function' + n + ']'; } // Make RegExps say that they are RegExps if (isRegExp(value)) { base = ' ' + RegExp.prototype.toString.call(value); } // Make dates with properties first say the date if (isDate(value)) { base = ' ' + Date.prototype.toUTCString.call(value); } // Make error with message first say the error if (isError(value)) { base = ' ' + formatError(value); } if (keys.length === 0 && (!array || value.length == 0)) { return braces[0] + base + braces[1]; } if (recurseTimes < 0) { if (isRegExp(value)) { return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); } else { return ctx.stylize('[Object]', 'special'); } } ctx.seen.push(value); var output; if (array) { output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); } else { output = keys.map(function (key) { return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); }); } ctx.seen.pop(); return reduceToSingleString(output, base, braces); } function formatPrimitive(ctx, value) { if (isUndefined(value)) return ctx.stylize('undefined', 'undefined'); if (isString(value)) { var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '').replace(/'/g, "\\'").replace(/\\"/g, '"') + '\''; return ctx.stylize(simple, 'string'); } if (isNumber(value)) return ctx.stylize('' + value, 'number'); if (isBoolean(value)) return ctx.stylize('' + value, 'boolean'); // For some reason typeof null is "object", so special case here. if (isNull(value)) return ctx.stylize('null', 'null'); } function formatError(value) { return '[' + Error.prototype.toString.call(value) + ']'; } function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { var output = []; for (var i = 0, l = value.length; i < l; ++i) { if (hasOwnProperty(value, String(i))) { output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true)); } else { output.push(''); } } keys.forEach(function (key) { if (!key.match(/^\d+$/)) { output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true)); } }); return output; } function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { var name, str, desc; desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; if (desc.get) { if (desc.set) { str = ctx.stylize('[Getter/Setter]', 'special'); } else { str = ctx.stylize('[Getter]', 'special'); } } else { if (desc.set) { str = ctx.stylize('[Setter]', 'special'); } } if (!hasOwnProperty(visibleKeys, key)) { name = '[' + key + ']'; } if (!str) { if (ctx.seen.indexOf(desc.value) < 0) { if (isNull(recurseTimes)) { str = formatValue(ctx, desc.value, null); } else { str = formatValue(ctx, desc.value, recurseTimes - 1); } if (str.indexOf('\n') > -1) { if (array) { str = str.split('\n').map(function (line) { return ' ' + line; }).join('\n').substr(2); } else { str = '\n' + str.split('\n').map(function (line) { return ' ' + line; }).join('\n'); } } } else { str = ctx.stylize('[Circular]', 'special'); } } if (isUndefined(name)) { if (array && key.match(/^\d+$/)) { return str; } name = JSON.stringify('' + key); if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { name = name.substr(1, name.length - 2); name = ctx.stylize(name, 'name'); } else { name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"); name = ctx.stylize(name, 'string'); } } return name + ': ' + str; } function reduceToSingleString(output, base, braces) { var numLinesEst = 0; var length = output.reduce(function (prev, cur) { numLinesEst++; if (cur.indexOf('\n') >= 0) numLinesEst++; return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; }, 0); if (length > 60) { return braces[0] + (base === '' ? '' : base + '\n ') + ' ' + output.join(',\n ') + ' ' + braces[1]; } return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; } // NOTE: These type checking functions intentionally don't use `instanceof` // because it is fragile and can be easily faked with `Object.create()`. function isArray(ar) { return Array.isArray(ar); } exports.isArray = isArray; function isBoolean(arg) { return typeof arg === 'boolean'; } exports.isBoolean = isBoolean; function isNull(arg) { return arg === null; } exports.isNull = isNull; function isNullOrUndefined(arg) { return arg == null; } exports.isNullOrUndefined = isNullOrUndefined; function isNumber(arg) { return typeof arg === 'number'; } exports.isNumber = isNumber; function isString(arg) { return typeof arg === 'string'; } exports.isString = isString; function isSymbol(arg) { return typeof arg === 'symbol'; } exports.isSymbol = isSymbol; function isUndefined(arg) { return arg === void 0; } exports.isUndefined = isUndefined; function isRegExp(re) { return isObject(re) && objectToString(re) === '[object RegExp]'; } exports.isRegExp = isRegExp; function isObject(arg) { return typeof arg === 'object' && arg !== null; } exports.isObject = isObject; function isDate(d) { return isObject(d) && objectToString(d) === '[object Date]'; } exports.isDate = isDate; function isError(e) { return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error); } exports.isError = isError; function isFunction(arg) { return typeof arg === 'function'; } exports.isFunction = isFunction; function isPrimitive(arg) { return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || typeof arg === 'symbol' || // ES6 symbol typeof arg === 'undefined'; } exports.isPrimitive = isPrimitive; exports.isBuffer = __webpack_require__(/*! ./support/isBuffer */ 3065); function objectToString(o) { return Object.prototype.toString.call(o); } function pad(n) { return n < 10 ? '0' + n.toString(10) : n.toString(10); } var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; // 26 Feb 16:19:34 function timestamp() { var d = new Date(); var time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(':'); return [d.getDate(), months[d.getMonth()], time].join(' '); } // log is just a thin wrapper to console.log that prepends a timestamp exports.log = function () { console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); }; /** * Inherit the prototype methods from one constructor into another. * * The Function.prototype.inherits from lang.js rewritten as a standalone * function (not on Function.prototype). NOTE: If this file is to be loaded * during bootstrapping this function needs to be rewritten using some native * functions as prototype setup using normal JavaScript does not work as * expected during bootstrapping (see mirror.js in r114903). * * @param {function} ctor Constructor function which needs to inherit the * prototype. * @param {function} superCtor Constructor function to inherit prototype from. */ exports.inherits = __webpack_require__(/*! inherits */ 7696); exports._extend = function (origin, add) { // Don't do anything if add isn't an object if (!add || !isObject(add)) return origin; var keys = Object.keys(add); var i = keys.length; while (i--) { origin[keys[i]] = add[keys[i]]; } return origin; }; function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } /***/ }, /***/ 53548 /*!***********************************!*\ !*** ./node_modules/path/path.js ***! \***********************************/ (module, __unused_webpack_exports, __webpack_require__) { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var isWindows = process.platform === 'win32'; var util = __webpack_require__(/*! util */ 77483); // resolves . and .. elements in a path array with directory names there // must be no slashes or device names (c:\) in the array // (so also no leading and trailing slashes - it does not distinguish // relative and absolute paths) function normalizeArray(parts, allowAboveRoot) { var res = []; for (var i = 0; i < parts.length; i++) { var p = parts[i]; // ignore empty parts if (!p || p === '.') continue; if (p === '..') { if (res.length && res[res.length - 1] !== '..') { res.pop(); } else if (allowAboveRoot) { res.push('..'); } } else { res.push(p); } } return res; } // returns an array with empty elements removed from either end of the input // array or the original array if no elements need to be removed function trimArray(arr) { var lastIndex = arr.length - 1; var start = 0; for (; start <= lastIndex; start++) { if (arr[start]) break; } var end = lastIndex; for (; end >= 0; end--) { if (arr[end]) break; } if (start === 0 && end === lastIndex) return arr; if (start > end) return []; return arr.slice(start, end + 1); } // Regex to split a windows path into three parts: [*, device, slash, // tail] windows-only var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; // Regex to split the tail part of the above into [*, dir, basename, ext] var splitTailRe = /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/; var win32 = {}; // Function to split a filename into [root, dir, basename, ext] function win32SplitPath(filename) { // Separate device+slash from tail var result = splitDeviceRe.exec(filename), device = (result[1] || '') + (result[2] || ''), tail = result[3] || ''; // Split the tail into dir, basename and extension var result2 = splitTailRe.exec(tail), dir = result2[1], basename = result2[2], ext = result2[3]; return [device, dir, basename, ext]; } function win32StatPath(path) { var result = splitDeviceRe.exec(path), device = result[1] || '', isUnc = !!device && device[1] !== ':'; return { device: device, isUnc: isUnc, isAbsolute: isUnc || !!result[2], // UNC paths are always absolute tail: result[3] }; } function normalizeUNCRoot(device) { return '\\\\' + device.replace(/^[\\\/]+/, '').replace(/[\\\/]+/g, '\\'); } // path.resolve([from ...], to) win32.resolve = function () { var resolvedDevice = '', resolvedTail = '', resolvedAbsolute = false; for (var i = arguments.length - 1; i >= -1; i--) { var path; if (i >= 0) { path = arguments[i]; } else if (!resolvedDevice) { path = process.cwd(); } else { // Windows has the concept of drive-specific current working // directories. If we've resolved a drive letter but not yet an // absolute path, get cwd for that drive. We're sure the device is not // an unc path at this points, because unc paths are always absolute. path = process.env['=' + resolvedDevice]; // Verify that a drive-local cwd was found and that it actually points // to our drive. If not, default to the drive's root. if (!path || path.substr(0, 3).toLowerCase() !== resolvedDevice.toLowerCase() + '\\') { path = resolvedDevice + '\\'; } } // Skip empty and invalid entries if (!util.isString(path)) { throw new TypeError('Arguments to path.resolve must be strings'); } else if (!path) { continue; } var result = win32StatPath(path), device = result.device, isUnc = result.isUnc, isAbsolute = result.isAbsolute, tail = result.tail; if (device && resolvedDevice && device.toLowerCase() !== resolvedDevice.toLowerCase()) { // This path points to another device so it is not applicable continue; } if (!resolvedDevice) { resolvedDevice = device; } if (!resolvedAbsolute) { resolvedTail = tail + '\\' + resolvedTail; resolvedAbsolute = isAbsolute; } if (resolvedDevice && resolvedAbsolute) { break; } } // Convert slashes to backslashes when `resolvedDevice` points to an UNC // root. Also squash multiple slashes into a single one where appropriate. if (isUnc) { resolvedDevice = normalizeUNCRoot(resolvedDevice); } // At this point the path should be resolved to a full absolute path, // but handle relative paths to be safe (might happen when process.cwd() // fails) // Normalize the tail path resolvedTail = normalizeArray(resolvedTail.split(/[\\\/]+/), !resolvedAbsolute).join('\\'); return resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail || '.'; }; win32.normalize = function (path) { var result = win32StatPath(path), device = result.device, isUnc = result.isUnc, isAbsolute = result.isAbsolute, tail = result.tail, trailingSlash = /[\\\/]$/.test(tail); // Normalize the tail path tail = normalizeArray(tail.split(/[\\\/]+/), !isAbsolute).join('\\'); if (!tail && !isAbsolute) { tail = '.'; } if (tail && trailingSlash) { tail += '\\'; } // Convert slashes to backslashes when `device` points to an UNC root. // Also squash multiple slashes into a single one where appropriate. if (isUnc) { device = normalizeUNCRoot(device); } return device + (isAbsolute ? '\\' : '') + tail; }; win32.isAbsolute = function (path) { return win32StatPath(path).isAbsolute; }; win32.join = function () { var paths = []; for (var i = 0; i < arguments.length; i++) { var arg = arguments[i]; if (!util.isString(arg)) { throw new TypeError('Arguments to path.join must be strings'); } if (arg) { paths.push(arg); } } var joined = paths.join('\\'); // Make sure that the joined path doesn't start with two slashes, because // normalize() will mistake it for an UNC path then. // // This step is skipped when it is very clear that the user actually // intended to point at an UNC path. This is assumed when the first // non-empty string arguments starts with exactly two slashes followed by // at least one more non-slash character. // // Note that for normalize() to treat a path as an UNC path it needs to // have at least 2 components, so we don't filter for that here. // This means that the user can use join to construct UNC paths from // a server name and a share name; for example: // path.join('//server', 'share') -> '\\\\server\\share\') if (!/^[\\\/]{2}[^\\\/]/.test(paths[0])) { joined = joined.replace(/^[\\\/]{2,}/, '\\'); } return win32.normalize(joined); }; // path.relative(from, to) // it will solve the relative path from 'from' to 'to', for instance: // from = 'C:\\orandea\\test\\aaa' // to = 'C:\\orandea\\impl\\bbb' // The output of the function should be: '..\\..\\impl\\bbb' win32.relative = function (from, to) { from = win32.resolve(from); to = win32.resolve(to); // windows is not case sensitive var lowerFrom = from.toLowerCase(); var lowerTo = to.toLowerCase(); var toParts = trimArray(to.split('\\')); var lowerFromParts = trimArray(lowerFrom.split('\\')); var lowerToParts = trimArray(lowerTo.split('\\')); var length = Math.min(lowerFromParts.length, lowerToParts.length); var samePartsLength = length; for (var i = 0; i < length; i++) { if (lowerFromParts[i] !== lowerToParts[i]) { samePartsLength = i; break; } } if (samePartsLength == 0) { return to; } var outputParts = []; for (var i = samePartsLength; i < lowerFromParts.length; i++) { outputParts.push('..'); } outputParts = outputParts.concat(toParts.slice(samePartsLength)); return outputParts.join('\\'); }; win32._makeLong = function (path) { // Note: this will *probably* throw somewhere. if (!util.isString(path)) return path; if (!path) { return ''; } var resolvedPath = win32.resolve(path); if (/^[a-zA-Z]\:\\/.test(resolvedPath)) { // path is local filesystem path, which needs to be converted // to long UNC path. return '\\\\?\\' + resolvedPath; } else if (/^\\\\[^?.]/.test(resolvedPath)) { // path is network UNC path, which needs to be converted // to long UNC path. return '\\\\?\\UNC\\' + resolvedPath.substring(2); } return path; }; win32.dirname = function (path) { var result = win32SplitPath(path), root = result[0], dir = result[1]; if (!root && !dir) { // No dirname whatsoever return '.'; } if (dir) { // It has a dirname, strip trailing slash dir = dir.substr(0, dir.length - 1); } return root + dir; }; win32.basename = function (path, ext) { var f = win32SplitPath(path)[2]; // TODO: make this comparison case-insensitive on windows? if (ext && f.substr(-1 * ext.length) === ext) { f = f.substr(0, f.length - ext.length); } return f; }; win32.extname = function (path) { return win32SplitPath(path)[3]; }; win32.format = function (pathObject) { if (!util.isObject(pathObject)) { throw new TypeError("Parameter 'pathObject' must be an object, not " + typeof pathObject); } var root = pathObject.root || ''; if (!util.isString(root)) { throw new TypeError("'pathObject.root' must be a string or undefined, not " + typeof pathObject.root); } var dir = pathObject.dir; var base = pathObject.base || ''; if (!dir) { return base; } if (dir[dir.length - 1] === win32.sep) { return dir + base; } return dir + win32.sep + base; }; win32.parse = function (pathString) { if (!util.isString(pathString)) { throw new TypeError("Parameter 'pathString' must be a string, not " + typeof pathString); } var allParts = win32SplitPath(pathString); if (!allParts || allParts.length !== 4) { throw new TypeError("Invalid path '" + pathString + "'"); } return { root: allParts[0], dir: allParts[0] + allParts[1].slice(0, -1), base: allParts[2], ext: allParts[3], name: allParts[2].slice(0, allParts[2].length - allParts[3].length) }; }; win32.sep = '\\'; win32.delimiter = ';'; // Split a filename into [root, dir, basename, ext], unix version // 'root' is just a slash, or nothing. var splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/; var posix = {}; function posixSplitPath(filename) { return splitPathRe.exec(filename).slice(1); } // path.resolve([from ...], to) // posix version posix.resolve = function () { var resolvedPath = '', resolvedAbsolute = false; for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) { var path = i >= 0 ? arguments[i] : process.cwd(); // Skip empty and invalid entries if (!util.isString(path)) { throw new TypeError('Arguments to path.resolve must be strings'); } else if (!path) { continue; } resolvedPath = path + '/' + resolvedPath; resolvedAbsolute = path[0] === '/'; } // At this point the path should be resolved to a full absolute path, but // handle relative paths to be safe (might happen when process.cwd() fails) // Normalize the path resolvedPath = normalizeArray(resolvedPath.split('/'), !resolvedAbsolute).join('/'); return (resolvedAbsolute ? '/' : '') + resolvedPath || '.'; }; // path.normalize(path) // posix version posix.normalize = function (path) { var isAbsolute = posix.isAbsolute(path), trailingSlash = path && path[path.length - 1] === '/'; // Normalize the path path = normalizeArray(path.split('/'), !isAbsolute).join('/'); if (!path && !isAbsolute) { path = '.'; } if (path && trailingSlash) { path += '/'; } return (isAbsolute ? '/' : '') + path; }; // posix version posix.isAbsolute = function (path) { return path.charAt(0) === '/'; }; // posix version posix.join = function () { var path = ''; for (var i = 0; i < arguments.length; i++) { var segment = arguments[i]; if (!util.isString(segment)) { throw new TypeError('Arguments to path.join must be strings'); } if (segment) { if (!path) { path += segment; } else { path += '/' + segment; } } } return posix.normalize(path); }; // path.relative(from, to) // posix version posix.relative = function (from, to) { from = posix.resolve(from).substr(1); to = posix.resolve(to).substr(1); var fromParts = trimArray(from.split('/')); var toParts = trimArray(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('/'); }; posix._makeLong = function (path) { return path; }; posix.dirname = function (path) { var result = posixSplitPath(path), root = result[0], dir = result[1]; if (!root && !dir) { // No dirname whatsoever return '.'; } if (dir) { // It has a dirname, strip trailing slash dir = dir.substr(0, dir.length - 1); } return root + dir; }; posix.basename = function (path, ext) { var f = posixSplitPath(path)[2]; // TODO: make this comparison case-insensitive on windows? if (ext && f.substr(-1 * ext.length) === ext) { f = f.substr(0, f.length - ext.length); } return f; }; posix.extname = function (path) { return posixSplitPath(path)[3]; }; posix.format = function (pathObject) { if (!util.isObject(pathObject)) { throw new TypeError("Parameter 'pathObject' must be an object, not " + typeof pathObject); } var root = pathObject.root || ''; if (!util.isString(root)) { throw new TypeError("'pathObject.root' must be a string or undefined, not " + typeof pathObject.root); } var dir = pathObject.dir ? pathObject.dir + posix.sep : ''; var base = pathObject.base || ''; return dir + base; }; posix.parse = function (pathString) { if (!util.isString(pathString)) { throw new TypeError("Parameter 'pathString' must be a string, not " + typeof pathString); } var allParts = posixSplitPath(pathString); if (!allParts || allParts.length !== 4) { throw new TypeError("Invalid path '" + pathString + "'"); } allParts[1] = allParts[1] || ''; allParts[2] = allParts[2] || ''; allParts[3] = allParts[3] || ''; return { root: allParts[0], dir: allParts[0] + allParts[1].slice(0, -1), base: allParts[2], ext: allParts[3], name: allParts[2].slice(0, allParts[2].length - allParts[3].length) }; }; posix.sep = '/'; posix.delimiter = ':'; if (isWindows) module.exports = win32;else /* posix */ module.exports = posix; module.exports.posix = posix; module.exports.win32 = win32; /***/ }, /***/ 15929 /*!***************************************************!*\ !*** ./node_modules/point-line-distance/index.js ***! \***************************************************/ (module, __unused_webpack_exports, __webpack_require__) { "use strict"; /* * point-line-distance * * Copyright (c) 2015 Mauricio Poppe * Licensed under the MIT license. */ var distanceSquared = __webpack_require__(/*! ./squared */ 91236); module.exports = function (point, a, b) { return Math.sqrt(distanceSquared(point, a, b)); }; /***/ }, /***/ 91236 /*!*****************************************************!*\ !*** ./node_modules/point-line-distance/squared.js ***! \*****************************************************/ (module, __unused_webpack_exports, __webpack_require__) { var subtract = __webpack_require__(/*! gl-vec3/subtract */ 67585); var cross = __webpack_require__(/*! gl-vec3/cross */ 81741); var squaredLength = __webpack_require__(/*! gl-vec3/squaredLength */ 70700); var ab = []; var ap = []; var cr = []; module.exports = function (p, a, b) { // // == vector solution // var normalize = require('gl-vec3/normalize') // var scaleAndAdd = require('gl-vec3/scaleAndAdd') // var dot = require('gl-vec3/dot') // var squaredDistance = require('gl-vec3/squaredDistance') // // n = vector `ab` normalized // var n = [] // // projection = projection of `point` on `n` // var projection = [] // normalize(n, subtract(n, a, b)) // scaleAndAdd(projection, a, n, dot(n, p)) // return squaredDistance(projection, p) // == parallelogram solution // // s // __a________b__ // / | / // / h| / // /_____|__/ // p // // s = b - a // area = s * h // |ap x s| = s * h // h = |ap x s| / s // subtract(ab, b, a); subtract(ap, p, a); var area = squaredLength(cross(cr, ap, ab)); var s = squaredLength(ab); if (s === 0) { throw Error('a and b are the same point'); } return area / s; }; /***/ }, /***/ 67600 /*!********************************************************!*\ !*** ./node_modules/robust-orientation/orientation.js ***! \********************************************************/ (module, __unused_webpack_exports, __webpack_require__) { "use strict"; var twoProduct = __webpack_require__(/*! two-product */ 53660); var robustSum = __webpack_require__(/*! robust-sum */ 75012); var robustScale = __webpack_require__(/*! robust-scale */ 20494); var robustSubtract = __webpack_require__(/*! robust-subtract */ 34523); var NUM_EXPAND = 5; var EPSILON = 1.1102230246251565e-16; var ERRBOUND3 = (3.0 + 16.0 * EPSILON) * EPSILON; var ERRBOUND4 = (7.0 + 56.0 * EPSILON) * EPSILON; function orientation_3(sum, prod, scale, sub) { return function orientation3Exact(m0, m1, m2) { var p = sum(sum(prod(m1[1], m2[0]), prod(-m2[1], m1[0])), sum(prod(m0[1], m1[0]), prod(-m1[1], m0[0]))); var n = sum(prod(m0[1], m2[0]), prod(-m2[1], m0[0])); var d = sub(p, n); return d[d.length - 1]; }; } function orientation_4(sum, prod, scale, sub) { return function orientation4Exact(m0, m1, m2, m3) { var p = sum(sum(scale(sum(prod(m2[1], m3[0]), prod(-m3[1], m2[0])), m1[2]), sum(scale(sum(prod(m1[1], m3[0]), prod(-m3[1], m1[0])), -m2[2]), scale(sum(prod(m1[1], m2[0]), prod(-m2[1], m1[0])), m3[2]))), sum(scale(sum(prod(m1[1], m3[0]), prod(-m3[1], m1[0])), m0[2]), sum(scale(sum(prod(m0[1], m3[0]), prod(-m3[1], m0[0])), -m1[2]), scale(sum(prod(m0[1], m1[0]), prod(-m1[1], m0[0])), m3[2])))); var n = sum(sum(scale(sum(prod(m2[1], m3[0]), prod(-m3[1], m2[0])), m0[2]), sum(scale(sum(prod(m0[1], m3[0]), prod(-m3[1], m0[0])), -m2[2]), scale(sum(prod(m0[1], m2[0]), prod(-m2[1], m0[0])), m3[2]))), sum(scale(sum(prod(m1[1], m2[0]), prod(-m2[1], m1[0])), m0[2]), sum(scale(sum(prod(m0[1], m2[0]), prod(-m2[1], m0[0])), -m1[2]), scale(sum(prod(m0[1], m1[0]), prod(-m1[1], m0[0])), m2[2])))); var d = sub(p, n); return d[d.length - 1]; }; } function orientation_5(sum, prod, scale, sub) { return function orientation5Exact(m0, m1, m2, m3, m4) { var p = sum(sum(sum(scale(sum(scale(sum(prod(m3[1], m4[0]), prod(-m4[1], m3[0])), m2[2]), sum(scale(sum(prod(m2[1], m4[0]), prod(-m4[1], m2[0])), -m3[2]), scale(sum(prod(m2[1], m3[0]), prod(-m3[1], m2[0])), m4[2]))), m1[3]), sum(scale(sum(scale(sum(prod(m3[1], m4[0]), prod(-m4[1], m3[0])), m1[2]), sum(scale(sum(prod(m1[1], m4[0]), prod(-m4[1], m1[0])), -m3[2]), scale(sum(prod(m1[1], m3[0]), prod(-m3[1], m1[0])), m4[2]))), -m2[3]), scale(sum(scale(sum(prod(m2[1], m4[0]), prod(-m4[1], m2[0])), m1[2]), sum(scale(sum(prod(m1[1], m4[0]), prod(-m4[1], m1[0])), -m2[2]), scale(sum(prod(m1[1], m2[0]), prod(-m2[1], m1[0])), m4[2]))), m3[3]))), sum(scale(sum(scale(sum(prod(m2[1], m3[0]), prod(-m3[1], m2[0])), m1[2]), sum(scale(sum(prod(m1[1], m3[0]), prod(-m3[1], m1[0])), -m2[2]), scale(sum(prod(m1[1], m2[0]), prod(-m2[1], m1[0])), m3[2]))), -m4[3]), sum(scale(sum(scale(sum(prod(m3[1], m4[0]), prod(-m4[1], m3[0])), m1[2]), sum(scale(sum(prod(m1[1], m4[0]), prod(-m4[1], m1[0])), -m3[2]), scale(sum(prod(m1[1], m3[0]), prod(-m3[1], m1[0])), m4[2]))), m0[3]), scale(sum(scale(sum(prod(m3[1], m4[0]), prod(-m4[1], m3[0])), m0[2]), sum(scale(sum(prod(m0[1], m4[0]), prod(-m4[1], m0[0])), -m3[2]), scale(sum(prod(m0[1], m3[0]), prod(-m3[1], m0[0])), m4[2]))), -m1[3])))), sum(sum(scale(sum(scale(sum(prod(m1[1], m4[0]), prod(-m4[1], m1[0])), m0[2]), sum(scale(sum(prod(m0[1], m4[0]), prod(-m4[1], m0[0])), -m1[2]), scale(sum(prod(m0[1], m1[0]), prod(-m1[1], m0[0])), m4[2]))), m3[3]), sum(scale(sum(scale(sum(prod(m1[1], m3[0]), prod(-m3[1], m1[0])), m0[2]), sum(scale(sum(prod(m0[1], m3[0]), prod(-m3[1], m0[0])), -m1[2]), scale(sum(prod(m0[1], m1[0]), prod(-m1[1], m0[0])), m3[2]))), -m4[3]), scale(sum(scale(sum(prod(m2[1], m3[0]), prod(-m3[1], m2[0])), m1[2]), sum(scale(sum(prod(m1[1], m3[0]), prod(-m3[1], m1[0])), -m2[2]), scale(sum(prod(m1[1], m2[0]), prod(-m2[1], m1[0])), m3[2]))), m0[3]))), sum(scale(sum(scale(sum(prod(m2[1], m3[0]), prod(-m3[1], m2[0])), m0[2]), sum(scale(sum(prod(m0[1], m3[0]), prod(-m3[1], m0[0])), -m2[2]), scale(sum(prod(m0[1], m2[0]), prod(-m2[1], m0[0])), m3[2]))), -m1[3]), sum(scale(sum(scale(sum(prod(m1[1], m3[0]), prod(-m3[1], m1[0])), m0[2]), sum(scale(sum(prod(m0[1], m3[0]), prod(-m3[1], m0[0])), -m1[2]), scale(sum(prod(m0[1], m1[0]), prod(-m1[1], m0[0])), m3[2]))), m2[3]), scale(sum(scale(sum(prod(m1[1], m2[0]), prod(-m2[1], m1[0])), m0[2]), sum(scale(sum(prod(m0[1], m2[0]), prod(-m2[1], m0[0])), -m1[2]), scale(sum(prod(m0[1], m1[0]), prod(-m1[1], m0[0])), m2[2]))), -m3[3]))))); var n = sum(sum(sum(scale(sum(scale(sum(prod(m3[1], m4[0]), prod(-m4[1], m3[0])), m2[2]), sum(scale(sum(prod(m2[1], m4[0]), prod(-m4[1], m2[0])), -m3[2]), scale(sum(prod(m2[1], m3[0]), prod(-m3[1], m2[0])), m4[2]))), m0[3]), scale(sum(scale(sum(prod(m3[1], m4[0]), prod(-m4[1], m3[0])), m0[2]), sum(scale(sum(prod(m0[1], m4[0]), prod(-m4[1], m0[0])), -m3[2]), scale(sum(prod(m0[1], m3[0]), prod(-m3[1], m0[0])), m4[2]))), -m2[3])), sum(scale(sum(scale(sum(prod(m2[1], m4[0]), prod(-m4[1], m2[0])), m0[2]), sum(scale(sum(prod(m0[1], m4[0]), prod(-m4[1], m0[0])), -m2[2]), scale(sum(prod(m0[1], m2[0]), prod(-m2[1], m0[0])), m4[2]))), m3[3]), scale(sum(scale(sum(prod(m2[1], m3[0]), prod(-m3[1], m2[0])), m0[2]), sum(scale(sum(prod(m0[1], m3[0]), prod(-m3[1], m0[0])), -m2[2]), scale(sum(prod(m0[1], m2[0]), prod(-m2[1], m0[0])), m3[2]))), -m4[3]))), sum(sum(scale(sum(scale(sum(prod(m2[1], m4[0]), prod(-m4[1], m2[0])), m1[2]), sum(scale(sum(prod(m1[1], m4[0]), prod(-m4[1], m1[0])), -m2[2]), scale(sum(prod(m1[1], m2[0]), prod(-m2[1], m1[0])), m4[2]))), m0[3]), scale(sum(scale(sum(prod(m2[1], m4[0]), prod(-m4[1], m2[0])), m0[2]), sum(scale(sum(prod(m0[1], m4[0]), prod(-m4[1], m0[0])), -m2[2]), scale(sum(prod(m0[1], m2[0]), prod(-m2[1], m0[0])), m4[2]))), -m1[3])), sum(scale(sum(scale(sum(prod(m1[1], m4[0]), prod(-m4[1], m1[0])), m0[2]), sum(scale(sum(prod(m0[1], m4[0]), prod(-m4[1], m0[0])), -m1[2]), scale(sum(prod(m0[1], m1[0]), prod(-m1[1], m0[0])), m4[2]))), m2[3]), scale(sum(scale(sum(prod(m1[1], m2[0]), prod(-m2[1], m1[0])), m0[2]), sum(scale(sum(prod(m0[1], m2[0]), prod(-m2[1], m0[0])), -m1[2]), scale(sum(prod(m0[1], m1[0]), prod(-m1[1], m0[0])), m2[2]))), -m4[3])))); var d = sub(p, n); return d[d.length - 1]; }; } function orientation(n) { var fn = n === 3 ? orientation_3 : n === 4 ? orientation_4 : orientation_5; return fn(robustSum, twoProduct, robustScale, robustSubtract); } var orientation3Exact = orientation(3); var orientation4Exact = orientation(4); var CACHED = [function orientation0() { return 0; }, function orientation1() { return 0; }, function orientation2(a, b) { return b[0] - a[0]; }, function orientation3(a, b, c) { var l = (a[1] - c[1]) * (b[0] - c[0]); var r = (a[0] - c[0]) * (b[1] - c[1]); var det = l - r; var s; if (l > 0) { if (r <= 0) { return det; } else { s = l + r; } } else if (l < 0) { if (r >= 0) { return det; } else { s = -(l + r); } } else { return det; } var tol = ERRBOUND3 * s; if (det >= tol || det <= -tol) { return det; } return orientation3Exact(a, b, c); }, function orientation4(a, b, c, d) { var adx = a[0] - d[0]; var bdx = b[0] - d[0]; var cdx = c[0] - d[0]; var ady = a[1] - d[1]; var bdy = b[1] - d[1]; var cdy = c[1] - d[1]; var adz = a[2] - d[2]; var bdz = b[2] - d[2]; var cdz = c[2] - d[2]; var bdxcdy = bdx * cdy; var cdxbdy = cdx * bdy; var cdxady = cdx * ady; var adxcdy = adx * cdy; var adxbdy = adx * bdy; var bdxady = bdx * ady; var det = adz * (bdxcdy - cdxbdy) + bdz * (cdxady - adxcdy) + cdz * (adxbdy - bdxady); var permanent = (Math.abs(bdxcdy) + Math.abs(cdxbdy)) * Math.abs(adz) + (Math.abs(cdxady) + Math.abs(adxcdy)) * Math.abs(bdz) + (Math.abs(adxbdy) + Math.abs(bdxady)) * Math.abs(cdz); var tol = ERRBOUND4 * permanent; if (det > tol || -det > tol) { return det; } return orientation4Exact(a, b, c, d); }]; function slowOrient(args) { var proc = CACHED[args.length]; if (!proc) { proc = CACHED[args.length] = orientation(args.length); } return proc.apply(undefined, args); } function proc(slow, o0, o1, o2, o3, o4, o5) { return function getOrientation(a0, a1, a2, a3, a4) { switch (arguments.length) { case 0: case 1: return 0; case 2: return o2(a0, a1); case 3: return o3(a0, a1, a2); case 4: return o4(a0, a1, a2, a3); case 5: return o5(a0, a1, a2, a3, a4); } var s = new Array(arguments.length); for (var i = 0; i < arguments.length; ++i) { s[i] = arguments[i]; } return slow(s); }; } function generateOrientationProc() { while (CACHED.length <= NUM_EXPAND) { CACHED.push(orientation(CACHED.length)); } module.exports = proc.apply(undefined, [slowOrient].concat(CACHED)); for (var i = 0; i <= NUM_EXPAND; ++i) { module.exports[i] = CACHED[i]; } } generateOrientationProc(); /***/ }, /***/ 20494 /*!***************************************************!*\ !*** ./node_modules/robust-scale/robust-scale.js ***! \***************************************************/ (module, __unused_webpack_exports, __webpack_require__) { "use strict"; var twoProduct = __webpack_require__(/*! two-product */ 53660); var twoSum = __webpack_require__(/*! two-sum */ 95628); module.exports = scaleLinearExpansion; function scaleLinearExpansion(e, scale) { var n = e.length; if (n === 1) { var ts = twoProduct(e[0], scale); if (ts[0]) { return ts; } return [ts[1]]; } var g = new Array(2 * n); var q = [0.1, 0.1]; var t = [0.1, 0.1]; var count = 0; twoProduct(e[0], scale, q); if (q[0]) { g[count++] = q[0]; } for (var i = 1; i < n; ++i) { twoProduct(e[i], scale, t); var pq = q[1]; twoSum(pq, t[0], q); if (q[0]) { g[count++] = q[0]; } var a = t[1]; var b = q[1]; var x = a + b; var bv = x - a; var y = b - bv; q[1] = x; if (y) { g[count++] = y; } } if (q[1]) { g[count++] = q[1]; } if (count === 0) { g[count++] = 0.0; } g.length = count; return g; } /***/ }, /***/ 34523 /*!*****************************************************!*\ !*** ./node_modules/robust-subtract/robust-diff.js ***! \*****************************************************/ (module) { "use strict"; module.exports = robustSubtract; //Easy case: Add two scalars function scalarScalar(a, b) { var x = a + b; var bv = x - a; var av = x - bv; var br = b - bv; var ar = a - av; var y = ar + br; if (y) { return [y, x]; } return [x]; } function robustSubtract(e, f) { var ne = e.length | 0; var nf = f.length | 0; if (ne === 1 && nf === 1) { return scalarScalar(e[0], -f[0]); } var n = ne + nf; var g = new Array(n); var count = 0; var eptr = 0; var fptr = 0; var abs = Math.abs; var ei = e[eptr]; var ea = abs(ei); var fi = -f[fptr]; var fa = abs(fi); var a, b; if (ea < fa) { b = ei; eptr += 1; if (eptr < ne) { ei = e[eptr]; ea = abs(ei); } } else { b = fi; fptr += 1; if (fptr < nf) { fi = -f[fptr]; fa = abs(fi); } } if (eptr < ne && ea < fa || fptr >= nf) { a = ei; eptr += 1; if (eptr < ne) { ei = e[eptr]; ea = abs(ei); } } else { a = fi; fptr += 1; if (fptr < nf) { fi = -f[fptr]; fa = abs(fi); } } var x = a + b; var bv = x - a; var y = b - bv; var q0 = y; var q1 = x; var _x, _bv, _av, _br, _ar; while (eptr < ne && fptr < nf) { if (ea < fa) { a = ei; eptr += 1; if (eptr < ne) { ei = e[eptr]; ea = abs(ei); } } else { a = fi; fptr += 1; if (fptr < nf) { fi = -f[fptr]; fa = abs(fi); } } b = q0; x = a + b; bv = x - a; y = b - bv; if (y) { g[count++] = y; } _x = q1 + x; _bv = _x - q1; _av = _x - _bv; _br = x - _bv; _ar = q1 - _av; q0 = _ar + _br; q1 = _x; } while (eptr < ne) { a = ei; b = q0; x = a + b; bv = x - a; y = b - bv; if (y) { g[count++] = y; } _x = q1 + x; _bv = _x - q1; _av = _x - _bv; _br = x - _bv; _ar = q1 - _av; q0 = _ar + _br; q1 = _x; eptr += 1; if (eptr < ne) { ei = e[eptr]; } } while (fptr < nf) { a = fi; b = q0; x = a + b; bv = x - a; y = b - bv; if (y) { g[count++] = y; } _x = q1 + x; _bv = _x - q1; _av = _x - _bv; _br = x - _bv; _ar = q1 - _av; q0 = _ar + _br; q1 = _x; fptr += 1; if (fptr < nf) { fi = -f[fptr]; } } if (q0) { g[count++] = q0; } if (q1) { g[count++] = q1; } if (!count) { g[count++] = 0.0; } g.length = count; return g; } /***/ }, /***/ 75012 /*!***********************************************!*\ !*** ./node_modules/robust-sum/robust-sum.js ***! \***********************************************/ (module) { "use strict"; module.exports = linearExpansionSum; //Easy case: Add two scalars function scalarScalar(a, b) { var x = a + b; var bv = x - a; var av = x - bv; var br = b - bv; var ar = a - av; var y = ar + br; if (y) { return [y, x]; } return [x]; } function linearExpansionSum(e, f) { var ne = e.length | 0; var nf = f.length | 0; if (ne === 1 && nf === 1) { return scalarScalar(e[0], f[0]); } var n = ne + nf; var g = new Array(n); var count = 0; var eptr = 0; var fptr = 0; var abs = Math.abs; var ei = e[eptr]; var ea = abs(ei); var fi = f[fptr]; var fa = abs(fi); var a, b; if (ea < fa) { b = ei; eptr += 1; if (eptr < ne) { ei = e[eptr]; ea = abs(ei); } } else { b = fi; fptr += 1; if (fptr < nf) { fi = f[fptr]; fa = abs(fi); } } if (eptr < ne && ea < fa || fptr >= nf) { a = ei; eptr += 1; if (eptr < ne) { ei = e[eptr]; ea = abs(ei); } } else { a = fi; fptr += 1; if (fptr < nf) { fi = f[fptr]; fa = abs(fi); } } var x = a + b; var bv = x - a; var y = b - bv; var q0 = y; var q1 = x; var _x, _bv, _av, _br, _ar; while (eptr < ne && fptr < nf) { if (ea < fa) { a = ei; eptr += 1; if (eptr < ne) { ei = e[eptr]; ea = abs(ei); } } else { a = fi; fptr += 1; if (fptr < nf) { fi = f[fptr]; fa = abs(fi); } } b = q0; x = a + b; bv = x - a; y = b - bv; if (y) { g[count++] = y; } _x = q1 + x; _bv = _x - q1; _av = _x - _bv; _br = x - _bv; _ar = q1 - _av; q0 = _ar + _br; q1 = _x; } while (eptr < ne) { a = ei; b = q0; x = a + b; bv = x - a; y = b - bv; if (y) { g[count++] = y; } _x = q1 + x; _bv = _x - q1; _av = _x - _bv; _br = x - _bv; _ar = q1 - _av; q0 = _ar + _br; q1 = _x; eptr += 1; if (eptr < ne) { ei = e[eptr]; } } while (fptr < nf) { a = fi; b = q0; x = a + b; bv = x - a; y = b - bv; if (y) { g[count++] = y; } _x = q1 + x; _bv = _x - q1; _av = _x - _bv; _br = x - _bv; _ar = q1 - _av; q0 = _ar + _br; q1 = _x; fptr += 1; if (fptr < nf) { fi = f[fptr]; } } if (q0) { g[count++] = q0; } if (q1) { g[count++] = q1; } if (!count) { g[count++] = 0.0; } g.length = count; return g; } /***/ }, /***/ 10271 /*!********************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/ajv.js ***! \********************************************************/ (module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.MissingRefError = exports.ValidationError = exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = exports.Ajv = void 0; const core_1 = __webpack_require__(/*! ./core */ 63125); const draft7_1 = __webpack_require__(/*! ./vocabularies/draft7 */ 53765); const discriminator_1 = __webpack_require__(/*! ./vocabularies/discriminator */ 31190); const draft7MetaSchema = __webpack_require__(/*! ./refs/json-schema-draft-07.json */ 27011); const META_SUPPORT_DATA = ["/properties"]; const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema"; class Ajv extends core_1.default { _addVocabularies() { super._addVocabularies(); draft7_1.default.forEach(v => this.addVocabulary(v)); if (this.opts.discriminator) this.addKeyword(discriminator_1.default); } _addDefaultMetaSchema() { super._addDefaultMetaSchema(); if (!this.opts.meta) return; const metaSchema = this.opts.$data ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA) : draft7MetaSchema; this.addMetaSchema(metaSchema, META_SCHEMA_ID, false); this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID; } defaultMeta() { return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined); } } exports.Ajv = Ajv; module.exports = exports = Ajv; module.exports.Ajv = Ajv; Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = Ajv; var validate_1 = __webpack_require__(/*! ./compile/validate */ 80137); Object.defineProperty(exports, "KeywordCxt", ({ enumerable: true, get: function () { return validate_1.KeywordCxt; } })); var codegen_1 = __webpack_require__(/*! ./compile/codegen */ 59164); Object.defineProperty(exports, "_", ({ enumerable: true, get: function () { return codegen_1._; } })); Object.defineProperty(exports, "str", ({ enumerable: true, get: function () { return codegen_1.str; } })); Object.defineProperty(exports, "stringify", ({ enumerable: true, get: function () { return codegen_1.stringify; } })); Object.defineProperty(exports, "nil", ({ enumerable: true, get: function () { return codegen_1.nil; } })); Object.defineProperty(exports, "Name", ({ enumerable: true, get: function () { return codegen_1.Name; } })); Object.defineProperty(exports, "CodeGen", ({ enumerable: true, get: function () { return codegen_1.CodeGen; } })); var validation_error_1 = __webpack_require__(/*! ./runtime/validation_error */ 32669); Object.defineProperty(exports, "ValidationError", ({ enumerable: true, get: function () { return validation_error_1.default; } })); var ref_error_1 = __webpack_require__(/*! ./compile/ref_error */ 82602); Object.defineProperty(exports, "MissingRefError", ({ enumerable: true, get: function () { return ref_error_1.default; } })); /***/ }, /***/ 48887 /*!*************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/compile/codegen/code.js ***! \*************************************************************************/ (__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.regexpCode = exports.getEsmExportName = exports.getProperty = exports.safeStringify = exports.stringify = exports.strConcat = exports.addCodeArg = exports.str = exports._ = exports.nil = exports._Code = exports.Name = exports.IDENTIFIER = exports._CodeOrName = void 0; // eslint-disable-next-line @typescript-eslint/no-extraneous-class class _CodeOrName {} exports._CodeOrName = _CodeOrName; exports.IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i; class Name extends _CodeOrName { constructor(s) { super(); if (!exports.IDENTIFIER.test(s)) throw new Error("CodeGen: name must be a valid identifier"); this.str = s; } toString() { return this.str; } emptyStr() { return false; } get names() { return { [this.str]: 1 }; } } exports.Name = Name; class _Code extends _CodeOrName { constructor(code) { super(); this._items = typeof code === "string" ? [code] : code; } toString() { return this.str; } emptyStr() { if (this._items.length > 1) return false; const item = this._items[0]; return item === "" || item === '""'; } get str() { var _a; return (_a = this._str) !== null && _a !== void 0 ? _a : this._str = this._items.reduce((s, c) => `${s}${c}`, ""); } get names() { var _a; return (_a = this._names) !== null && _a !== void 0 ? _a : this._names = this._items.reduce((names, c) => { if (c instanceof Name) names[c.str] = (names[c.str] || 0) + 1; return names; }, {}); } } exports._Code = _Code; exports.nil = new _Code(""); function _(strs, ...args) { const code = [strs[0]]; let i = 0; while (i < args.length) { addCodeArg(code, args[i]); code.push(strs[++i]); } return new _Code(code); } exports._ = _; const plus = new _Code("+"); function str(strs, ...args) { const expr = [safeStringify(strs[0])]; let i = 0; while (i < args.length) { expr.push(plus); addCodeArg(expr, args[i]); expr.push(plus, safeStringify(strs[++i])); } optimize(expr); return new _Code(expr); } exports.str = str; function addCodeArg(code, arg) { if (arg instanceof _Code) code.push(...arg._items);else if (arg instanceof Name) code.push(arg);else code.push(interpolate(arg)); } exports.addCodeArg = addCodeArg; function optimize(expr) { let i = 1; while (i < expr.length - 1) { if (expr[i] === plus) { const res = mergeExprItems(expr[i - 1], expr[i + 1]); if (res !== undefined) { expr.splice(i - 1, 3, res); continue; } expr[i++] = "+"; } i++; } } function mergeExprItems(a, b) { if (b === '""') return a; if (a === '""') return b; if (typeof a == "string") { if (b instanceof Name || a[a.length - 1] !== '"') return; if (typeof b != "string") return `${a.slice(0, -1)}${b}"`; if (b[0] === '"') return a.slice(0, -1) + b.slice(1); return; } if (typeof b == "string" && b[0] === '"' && !(a instanceof Name)) return `"${a}${b.slice(1)}`; return; } function strConcat(c1, c2) { return c2.emptyStr() ? c1 : c1.emptyStr() ? c2 : str`${c1}${c2}`; } exports.strConcat = strConcat; // TODO do not allow arrays here function interpolate(x) { return typeof x == "number" || typeof x == "boolean" || x === null ? x : safeStringify(Array.isArray(x) ? x.join(",") : x); } function stringify(x) { return new _Code(safeStringify(x)); } exports.stringify = stringify; function safeStringify(x) { return JSON.stringify(x).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029"); } exports.safeStringify = safeStringify; function getProperty(key) { return typeof key == "string" && exports.IDENTIFIER.test(key) ? new _Code(`.${key}`) : _`[${key}]`; } exports.getProperty = getProperty; //Does best effort to format the name properly function getEsmExportName(key) { if (typeof key == "string" && exports.IDENTIFIER.test(key)) { return new _Code(`${key}`); } throw new Error(`CodeGen: invalid export name: ${key}, use explicit $id name mapping`); } exports.getEsmExportName = getEsmExportName; function regexpCode(rx) { return new _Code(rx.toString()); } exports.regexpCode = regexpCode; /***/ }, /***/ 59164 /*!**************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/compile/codegen/index.js ***! \**************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.or = exports.and = exports.not = exports.CodeGen = exports.operators = exports.varKinds = exports.ValueScopeName = exports.ValueScope = exports.Scope = exports.Name = exports.regexpCode = exports.stringify = exports.getProperty = exports.nil = exports.strConcat = exports.str = exports._ = void 0; const code_1 = __webpack_require__(/*! ./code */ 48887); const scope_1 = __webpack_require__(/*! ./scope */ 59036); var code_2 = __webpack_require__(/*! ./code */ 48887); Object.defineProperty(exports, "_", ({ enumerable: true, get: function () { return code_2._; } })); Object.defineProperty(exports, "str", ({ enumerable: true, get: function () { return code_2.str; } })); Object.defineProperty(exports, "strConcat", ({ enumerable: true, get: function () { return code_2.strConcat; } })); Object.defineProperty(exports, "nil", ({ enumerable: true, get: function () { return code_2.nil; } })); Object.defineProperty(exports, "getProperty", ({ enumerable: true, get: function () { return code_2.getProperty; } })); Object.defineProperty(exports, "stringify", ({ enumerable: true, get: function () { return code_2.stringify; } })); Object.defineProperty(exports, "regexpCode", ({ enumerable: true, get: function () { return code_2.regexpCode; } })); Object.defineProperty(exports, "Name", ({ enumerable: true, get: function () { return code_2.Name; } })); var scope_2 = __webpack_require__(/*! ./scope */ 59036); Object.defineProperty(exports, "Scope", ({ enumerable: true, get: function () { return scope_2.Scope; } })); Object.defineProperty(exports, "ValueScope", ({ enumerable: true, get: function () { return scope_2.ValueScope; } })); Object.defineProperty(exports, "ValueScopeName", ({ enumerable: true, get: function () { return scope_2.ValueScopeName; } })); Object.defineProperty(exports, "varKinds", ({ enumerable: true, get: function () { return scope_2.varKinds; } })); exports.operators = { GT: new code_1._Code(">"), GTE: new code_1._Code(">="), LT: new code_1._Code("<"), LTE: new code_1._Code("<="), EQ: new code_1._Code("==="), NEQ: new code_1._Code("!=="), NOT: new code_1._Code("!"), OR: new code_1._Code("||"), AND: new code_1._Code("&&"), ADD: new code_1._Code("+") }; class Node { optimizeNodes() { return this; } optimizeNames(_names, _constants) { return this; } } class Def extends Node { constructor(varKind, name, rhs) { super(); this.varKind = varKind; this.name = name; this.rhs = rhs; } render({ es5, _n }) { const varKind = es5 ? scope_1.varKinds.var : this.varKind; const rhs = this.rhs === undefined ? "" : ` = ${this.rhs}`; return `${varKind} ${this.name}${rhs};` + _n; } optimizeNames(names, constants) { if (!names[this.name.str]) return; if (this.rhs) this.rhs = optimizeExpr(this.rhs, names, constants); return this; } get names() { return this.rhs instanceof code_1._CodeOrName ? this.rhs.names : {}; } } class Assign extends Node { constructor(lhs, rhs, sideEffects) { super(); this.lhs = lhs; this.rhs = rhs; this.sideEffects = sideEffects; } render({ _n }) { return `${this.lhs} = ${this.rhs};` + _n; } optimizeNames(names, constants) { if (this.lhs instanceof code_1.Name && !names[this.lhs.str] && !this.sideEffects) return; this.rhs = optimizeExpr(this.rhs, names, constants); return this; } get names() { const names = this.lhs instanceof code_1.Name ? {} : { ...this.lhs.names }; return addExprNames(names, this.rhs); } } class AssignOp extends Assign { constructor(lhs, op, rhs, sideEffects) { super(lhs, rhs, sideEffects); this.op = op; } render({ _n }) { return `${this.lhs} ${this.op}= ${this.rhs};` + _n; } } class Label extends Node { constructor(label) { super(); this.label = label; this.names = {}; } render({ _n }) { return `${this.label}:` + _n; } } class Break extends Node { constructor(label) { super(); this.label = label; this.names = {}; } render({ _n }) { const label = this.label ? ` ${this.label}` : ""; return `break${label};` + _n; } } class Throw extends Node { constructor(error) { super(); this.error = error; } render({ _n }) { return `throw ${this.error};` + _n; } get names() { return this.error.names; } } class AnyCode extends Node { constructor(code) { super(); this.code = code; } render({ _n }) { return `${this.code};` + _n; } optimizeNodes() { return `${this.code}` ? this : undefined; } optimizeNames(names, constants) { this.code = optimizeExpr(this.code, names, constants); return this; } get names() { return this.code instanceof code_1._CodeOrName ? this.code.names : {}; } } class ParentNode extends Node { constructor(nodes = []) { super(); this.nodes = nodes; } render(opts) { return this.nodes.reduce((code, n) => code + n.render(opts), ""); } optimizeNodes() { const { nodes } = this; let i = nodes.length; while (i--) { const n = nodes[i].optimizeNodes(); if (Array.isArray(n)) nodes.splice(i, 1, ...n);else if (n) nodes[i] = n;else nodes.splice(i, 1); } return nodes.length > 0 ? this : undefined; } optimizeNames(names, constants) { const { nodes } = this; let i = nodes.length; while (i--) { // iterating backwards improves 1-pass optimization const n = nodes[i]; if (n.optimizeNames(names, constants)) continue; subtractNames(names, n.names); nodes.splice(i, 1); } return nodes.length > 0 ? this : undefined; } get names() { return this.nodes.reduce((names, n) => addNames(names, n.names), {}); } } class BlockNode extends ParentNode { render(opts) { return "{" + opts._n + super.render(opts) + "}" + opts._n; } } class Root extends ParentNode {} class Else extends BlockNode {} Else.kind = "else"; class If extends BlockNode { constructor(condition, nodes) { super(nodes); this.condition = condition; } render(opts) { let code = `if(${this.condition})` + super.render(opts); if (this.else) code += "else " + this.else.render(opts); return code; } optimizeNodes() { super.optimizeNodes(); const cond = this.condition; if (cond === true) return this.nodes; // else is ignored here let e = this.else; if (e) { const ns = e.optimizeNodes(); e = this.else = Array.isArray(ns) ? new Else(ns) : ns; } if (e) { if (cond === false) return e instanceof If ? e : e.nodes; if (this.nodes.length) return this; return new If(not(cond), e instanceof If ? [e] : e.nodes); } if (cond === false || !this.nodes.length) return undefined; return this; } optimizeNames(names, constants) { var _a; this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants); if (!(super.optimizeNames(names, constants) || this.else)) return; this.condition = optimizeExpr(this.condition, names, constants); return this; } get names() { const names = super.names; addExprNames(names, this.condition); if (this.else) addNames(names, this.else.names); return names; } } If.kind = "if"; class For extends BlockNode {} For.kind = "for"; class ForLoop extends For { constructor(iteration) { super(); this.iteration = iteration; } render(opts) { return `for(${this.iteration})` + super.render(opts); } optimizeNames(names, constants) { if (!super.optimizeNames(names, constants)) return; this.iteration = optimizeExpr(this.iteration, names, constants); return this; } get names() { return addNames(super.names, this.iteration.names); } } class ForRange extends For { constructor(varKind, name, from, to) { super(); this.varKind = varKind; this.name = name; this.from = from; this.to = to; } render(opts) { const varKind = opts.es5 ? scope_1.varKinds.var : this.varKind; const { name, from, to } = this; return `for(${varKind} ${name}=${from}; ${name}<${to}; ${name}++)` + super.render(opts); } get names() { const names = addExprNames(super.names, this.from); return addExprNames(names, this.to); } } class ForIter extends For { constructor(loop, varKind, name, iterable) { super(); this.loop = loop; this.varKind = varKind; this.name = name; this.iterable = iterable; } render(opts) { return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})` + super.render(opts); } optimizeNames(names, constants) { if (!super.optimizeNames(names, constants)) return; this.iterable = optimizeExpr(this.iterable, names, constants); return this; } get names() { return addNames(super.names, this.iterable.names); } } class Func extends BlockNode { constructor(name, args, async) { super(); this.name = name; this.args = args; this.async = async; } render(opts) { const _async = this.async ? "async " : ""; return `${_async}function ${this.name}(${this.args})` + super.render(opts); } } Func.kind = "func"; class Return extends ParentNode { render(opts) { return "return " + super.render(opts); } } Return.kind = "return"; class Try extends BlockNode { render(opts) { let code = "try" + super.render(opts); if (this.catch) code += this.catch.render(opts); if (this.finally) code += this.finally.render(opts); return code; } optimizeNodes() { var _a, _b; super.optimizeNodes(); (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNodes(); (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes(); return this; } optimizeNames(names, constants) { var _a, _b; super.optimizeNames(names, constants); (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants); (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants); return this; } get names() { const names = super.names; if (this.catch) addNames(names, this.catch.names); if (this.finally) addNames(names, this.finally.names); return names; } } class Catch extends BlockNode { constructor(error) { super(); this.error = error; } render(opts) { return `catch(${this.error})` + super.render(opts); } } Catch.kind = "catch"; class Finally extends BlockNode { render(opts) { return "finally" + super.render(opts); } } Finally.kind = "finally"; class CodeGen { constructor(extScope, opts = {}) { this._values = {}; this._blockStarts = []; this._constants = {}; this.opts = { ...opts, _n: opts.lines ? "\n" : "" }; this._extScope = extScope; this._scope = new scope_1.Scope({ parent: extScope }); this._nodes = [new Root()]; } toString() { return this._root.render(this.opts); } // returns unique name in the internal scope name(prefix) { return this._scope.name(prefix); } // reserves unique name in the external scope scopeName(prefix) { return this._extScope.name(prefix); } // reserves unique name in the external scope and assigns value to it scopeValue(prefixOrName, value) { const name = this._extScope.value(prefixOrName, value); const vs = this._values[name.prefix] || (this._values[name.prefix] = new Set()); vs.add(name); return name; } getScopeValue(prefix, keyOrRef) { return this._extScope.getValue(prefix, keyOrRef); } // return code that assigns values in the external scope to the names that are used internally // (same names that were returned by gen.scopeName or gen.scopeValue) scopeRefs(scopeName) { return this._extScope.scopeRefs(scopeName, this._values); } scopeCode() { return this._extScope.scopeCode(this._values); } _def(varKind, nameOrPrefix, rhs, constant) { const name = this._scope.toName(nameOrPrefix); if (rhs !== undefined && constant) this._constants[name.str] = rhs; this._leafNode(new Def(varKind, name, rhs)); return name; } // `const` declaration (`var` in es5 mode) const(nameOrPrefix, rhs, _constant) { return this._def(scope_1.varKinds.const, nameOrPrefix, rhs, _constant); } // `let` declaration with optional assignment (`var` in es5 mode) let(nameOrPrefix, rhs, _constant) { return this._def(scope_1.varKinds.let, nameOrPrefix, rhs, _constant); } // `var` declaration with optional assignment var(nameOrPrefix, rhs, _constant) { return this._def(scope_1.varKinds.var, nameOrPrefix, rhs, _constant); } // assignment code assign(lhs, rhs, sideEffects) { return this._leafNode(new Assign(lhs, rhs, sideEffects)); } // `+=` code add(lhs, rhs) { return this._leafNode(new AssignOp(lhs, exports.operators.ADD, rhs)); } // appends passed SafeExpr to code or executes Block code(c) { if (typeof c == "function") c();else if (c !== code_1.nil) this._leafNode(new AnyCode(c)); return this; } // returns code for object literal for the passed argument list of key-value pairs object(...keyValues) { const code = ["{"]; for (const [key, value] of keyValues) { if (code.length > 1) code.push(","); code.push(key); if (key !== value || this.opts.es5) { code.push(":"); (0, code_1.addCodeArg)(code, value); } } code.push("}"); return new code_1._Code(code); } // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed) if(condition, thenBody, elseBody) { this._blockNode(new If(condition)); if (thenBody && elseBody) { this.code(thenBody).else().code(elseBody).endIf(); } else if (thenBody) { this.code(thenBody).endIf(); } else if (elseBody) { throw new Error('CodeGen: "else" body without "then" body'); } return this; } // `else if` clause - invalid without `if` or after `else` clauses elseIf(condition) { return this._elseNode(new If(condition)); } // `else` clause - only valid after `if` or `else if` clauses else() { return this._elseNode(new Else()); } // end `if` statement (needed if gen.if was used only with condition) endIf() { return this._endBlockNode(If, Else); } _for(node, forBody) { this._blockNode(node); if (forBody) this.code(forBody).endFor(); return this; } // a generic `for` clause (or statement if `forBody` is passed) for(iteration, forBody) { return this._for(new ForLoop(iteration), forBody); } // `for` statement for a range of values forRange(nameOrPrefix, from, to, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.let) { const name = this._scope.toName(nameOrPrefix); return this._for(new ForRange(varKind, name, from, to), () => forBody(name)); } // `for-of` statement (in es5 mode replace with a normal for loop) forOf(nameOrPrefix, iterable, forBody, varKind = scope_1.varKinds.const) { const name = this._scope.toName(nameOrPrefix); if (this.opts.es5) { const arr = iterable instanceof code_1.Name ? iterable : this.var("_arr", iterable); return this.forRange("_i", 0, (0, code_1._)`${arr}.length`, i => { this.var(name, (0, code_1._)`${arr}[${i}]`); forBody(name); }); } return this._for(new ForIter("of", varKind, name, iterable), () => forBody(name)); } // `for-in` statement. // With option `ownProperties` replaced with a `for-of` loop for object keys forIn(nameOrPrefix, obj, forBody, varKind = this.opts.es5 ? scope_1.varKinds.var : scope_1.varKinds.const) { if (this.opts.ownProperties) { return this.forOf(nameOrPrefix, (0, code_1._)`Object.keys(${obj})`, forBody); } const name = this._scope.toName(nameOrPrefix); return this._for(new ForIter("in", varKind, name, obj), () => forBody(name)); } // end `for` loop endFor() { return this._endBlockNode(For); } // `label` statement label(label) { return this._leafNode(new Label(label)); } // `break` statement break(label) { return this._leafNode(new Break(label)); } // `return` statement return(value) { const node = new Return(); this._blockNode(node); this.code(value); if (node.nodes.length !== 1) throw new Error('CodeGen: "return" should have one node'); return this._endBlockNode(Return); } // `try` statement try(tryBody, catchCode, finallyCode) { if (!catchCode && !finallyCode) throw new Error('CodeGen: "try" without "catch" and "finally"'); const node = new Try(); this._blockNode(node); this.code(tryBody); if (catchCode) { const error = this.name("e"); this._currNode = node.catch = new Catch(error); catchCode(error); } if (finallyCode) { this._currNode = node.finally = new Finally(); this.code(finallyCode); } return this._endBlockNode(Catch, Finally); } // `throw` statement throw(error) { return this._leafNode(new Throw(error)); } // start self-balancing block block(body, nodeCount) { this._blockStarts.push(this._nodes.length); if (body) this.code(body).endBlock(nodeCount); return this; } // end the current self-balancing block endBlock(nodeCount) { const len = this._blockStarts.pop(); if (len === undefined) throw new Error("CodeGen: not in self-balancing block"); const toClose = this._nodes.length - len; if (toClose < 0 || nodeCount !== undefined && toClose !== nodeCount) { throw new Error(`CodeGen: wrong number of nodes: ${toClose} vs ${nodeCount} expected`); } this._nodes.length = len; return this; } // `function` heading (or definition if funcBody is passed) func(name, args = code_1.nil, async, funcBody) { this._blockNode(new Func(name, args, async)); if (funcBody) this.code(funcBody).endFunc(); return this; } // end function definition endFunc() { return this._endBlockNode(Func); } optimize(n = 1) { while (n-- > 0) { this._root.optimizeNodes(); this._root.optimizeNames(this._root.names, this._constants); } } _leafNode(node) { this._currNode.nodes.push(node); return this; } _blockNode(node) { this._currNode.nodes.push(node); this._nodes.push(node); } _endBlockNode(N1, N2) { const n = this._currNode; if (n instanceof N1 || N2 && n instanceof N2) { this._nodes.pop(); return this; } throw new Error(`CodeGen: not in block "${N2 ? `${N1.kind}/${N2.kind}` : N1.kind}"`); } _elseNode(node) { const n = this._currNode; if (!(n instanceof If)) { throw new Error('CodeGen: "else" without "if"'); } this._currNode = n.else = node; return this; } get _root() { return this._nodes[0]; } get _currNode() { const ns = this._nodes; return ns[ns.length - 1]; } set _currNode(node) { const ns = this._nodes; ns[ns.length - 1] = node; } } exports.CodeGen = CodeGen; function addNames(names, from) { for (const n in from) names[n] = (names[n] || 0) + (from[n] || 0); return names; } function addExprNames(names, from) { return from instanceof code_1._CodeOrName ? addNames(names, from.names) : names; } function optimizeExpr(expr, names, constants) { if (expr instanceof code_1.Name) return replaceName(expr); if (!canOptimize(expr)) return expr; return new code_1._Code(expr._items.reduce((items, c) => { if (c instanceof code_1.Name) c = replaceName(c); if (c instanceof code_1._Code) items.push(...c._items);else items.push(c); return items; }, [])); function replaceName(n) { const c = constants[n.str]; if (c === undefined || names[n.str] !== 1) return n; delete names[n.str]; return c; } function canOptimize(e) { return e instanceof code_1._Code && e._items.some(c => c instanceof code_1.Name && names[c.str] === 1 && constants[c.str] !== undefined); } } function subtractNames(names, from) { for (const n in from) names[n] = (names[n] || 0) - (from[n] || 0); } function not(x) { return typeof x == "boolean" || typeof x == "number" || x === null ? !x : (0, code_1._)`!${par(x)}`; } exports.not = not; const andCode = mappend(exports.operators.AND); // boolean AND (&&) expression with the passed arguments function and(...args) { return args.reduce(andCode); } exports.and = and; const orCode = mappend(exports.operators.OR); // boolean OR (||) expression with the passed arguments function or(...args) { return args.reduce(orCode); } exports.or = or; function mappend(op) { return (x, y) => x === code_1.nil ? y : y === code_1.nil ? x : (0, code_1._)`${par(x)} ${op} ${par(y)}`; } function par(x) { return x instanceof code_1.Name ? x : (0, code_1._)`(${x})`; } /***/ }, /***/ 59036 /*!**************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/compile/codegen/scope.js ***! \**************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ValueScope = exports.ValueScopeName = exports.Scope = exports.varKinds = exports.UsedValueState = void 0; const code_1 = __webpack_require__(/*! ./code */ 48887); class ValueError extends Error { constructor(name) { super(`CodeGen: "code" for ${name} not defined`); this.value = name.value; } } var UsedValueState; (function (UsedValueState) { UsedValueState[UsedValueState["Started"] = 0] = "Started"; UsedValueState[UsedValueState["Completed"] = 1] = "Completed"; })(UsedValueState || (exports.UsedValueState = UsedValueState = {})); exports.varKinds = { const: new code_1.Name("const"), let: new code_1.Name("let"), var: new code_1.Name("var") }; class Scope { constructor({ prefixes, parent } = {}) { this._names = {}; this._prefixes = prefixes; this._parent = parent; } toName(nameOrPrefix) { return nameOrPrefix instanceof code_1.Name ? nameOrPrefix : this.name(nameOrPrefix); } name(prefix) { return new code_1.Name(this._newName(prefix)); } _newName(prefix) { const ng = this._names[prefix] || this._nameGroup(prefix); return `${prefix}${ng.index++}`; } _nameGroup(prefix) { var _a, _b; if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || this._prefixes && !this._prefixes.has(prefix)) { throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`); } return this._names[prefix] = { prefix, index: 0 }; } } exports.Scope = Scope; class ValueScopeName extends code_1.Name { constructor(prefix, nameStr) { super(nameStr); this.prefix = prefix; } setValue(value, { property, itemIndex }) { this.value = value; this.scopePath = (0, code_1._)`.${new code_1.Name(property)}[${itemIndex}]`; } } exports.ValueScopeName = ValueScopeName; const line = (0, code_1._)`\n`; class ValueScope extends Scope { constructor(opts) { super(opts); this._values = {}; this._scope = opts.scope; this.opts = { ...opts, _n: opts.lines ? line : code_1.nil }; } get() { return this._scope; } name(prefix) { return new ValueScopeName(prefix, this._newName(prefix)); } value(nameOrPrefix, value) { var _a; if (value.ref === undefined) throw new Error("CodeGen: ref must be passed in value"); const name = this.toName(nameOrPrefix); const { prefix } = name; const valueKey = (_a = value.key) !== null && _a !== void 0 ? _a : value.ref; let vs = this._values[prefix]; if (vs) { const _name = vs.get(valueKey); if (_name) return _name; } else { vs = this._values[prefix] = new Map(); } vs.set(valueKey, name); const s = this._scope[prefix] || (this._scope[prefix] = []); const itemIndex = s.length; s[itemIndex] = value.ref; name.setValue(value, { property: prefix, itemIndex }); return name; } getValue(prefix, keyOrRef) { const vs = this._values[prefix]; if (!vs) return; return vs.get(keyOrRef); } scopeRefs(scopeName, values = this._values) { return this._reduceValues(values, name => { if (name.scopePath === undefined) throw new Error(`CodeGen: name "${name}" has no value`); return (0, code_1._)`${scopeName}${name.scopePath}`; }); } scopeCode(values = this._values, usedValues, getCode) { return this._reduceValues(values, name => { if (name.value === undefined) throw new Error(`CodeGen: name "${name}" has no value`); return name.value.code; }, usedValues, getCode); } _reduceValues(values, valueCode, usedValues = {}, getCode) { let code = code_1.nil; for (const prefix in values) { const vs = values[prefix]; if (!vs) continue; const nameSet = usedValues[prefix] = usedValues[prefix] || new Map(); vs.forEach(name => { if (nameSet.has(name)) return; nameSet.set(name, UsedValueState.Started); let c = valueCode(name); if (c) { const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const; code = (0, code_1._)`${code}${def} ${name} = ${c};${this.opts._n}`; } else if (c = getCode === null || getCode === void 0 ? void 0 : getCode(name)) { code = (0, code_1._)`${code}${c}${this.opts._n}`; } else { throw new ValueError(name); } nameSet.set(name, UsedValueState.Completed); }); } return code; } } exports.ValueScope = ValueScope; /***/ }, /***/ 80003 /*!*******************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/compile/errors.js ***! \*******************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.extendErrors = exports.resetErrorsCount = exports.reportExtraError = exports.reportError = exports.keyword$DataError = exports.keywordError = void 0; const codegen_1 = __webpack_require__(/*! ./codegen */ 59164); const util_1 = __webpack_require__(/*! ./util */ 1776); const names_1 = __webpack_require__(/*! ./names */ 17862); exports.keywordError = { message: ({ keyword }) => (0, codegen_1.str)`must pass "${keyword}" keyword validation` }; exports.keyword$DataError = { message: ({ keyword, schemaType }) => schemaType ? (0, codegen_1.str)`"${keyword}" keyword must be ${schemaType} ($data)` : (0, codegen_1.str)`"${keyword}" keyword is invalid ($data)` }; function reportError(cxt, error = exports.keywordError, errorPaths, overrideAllErrors) { const { it } = cxt; const { gen, compositeRule, allErrors } = it; const errObj = errorObjectCode(cxt, error, errorPaths); if (overrideAllErrors !== null && overrideAllErrors !== void 0 ? overrideAllErrors : compositeRule || allErrors) { addError(gen, errObj); } else { returnErrors(it, (0, codegen_1._)`[${errObj}]`); } } exports.reportError = reportError; function reportExtraError(cxt, error = exports.keywordError, errorPaths) { const { it } = cxt; const { gen, compositeRule, allErrors } = it; const errObj = errorObjectCode(cxt, error, errorPaths); addError(gen, errObj); if (!(compositeRule || allErrors)) { returnErrors(it, names_1.default.vErrors); } } exports.reportExtraError = reportExtraError; function resetErrorsCount(gen, errsCount) { gen.assign(names_1.default.errors, errsCount); gen.if((0, codegen_1._)`${names_1.default.vErrors} !== null`, () => gen.if(errsCount, () => gen.assign((0, codegen_1._)`${names_1.default.vErrors}.length`, errsCount), () => gen.assign(names_1.default.vErrors, null))); } exports.resetErrorsCount = resetErrorsCount; function extendErrors({ gen, keyword, schemaValue, data, errsCount, it }) { /* istanbul ignore if */ if (errsCount === undefined) throw new Error("ajv implementation error"); const err = gen.name("err"); gen.forRange("i", errsCount, names_1.default.errors, i => { gen.const(err, (0, codegen_1._)`${names_1.default.vErrors}[${i}]`); gen.if((0, codegen_1._)`${err}.instancePath === undefined`, () => gen.assign((0, codegen_1._)`${err}.instancePath`, (0, codegen_1.strConcat)(names_1.default.instancePath, it.errorPath))); gen.assign((0, codegen_1._)`${err}.schemaPath`, (0, codegen_1.str)`${it.errSchemaPath}/${keyword}`); if (it.opts.verbose) { gen.assign((0, codegen_1._)`${err}.schema`, schemaValue); gen.assign((0, codegen_1._)`${err}.data`, data); } }); } exports.extendErrors = extendErrors; function addError(gen, errObj) { const err = gen.const("err", errObj); gen.if((0, codegen_1._)`${names_1.default.vErrors} === null`, () => gen.assign(names_1.default.vErrors, (0, codegen_1._)`[${err}]`), (0, codegen_1._)`${names_1.default.vErrors}.push(${err})`); gen.code((0, codegen_1._)`${names_1.default.errors}++`); } function returnErrors(it, errs) { const { gen, validateName, schemaEnv } = it; if (schemaEnv.$async) { gen.throw((0, codegen_1._)`new ${it.ValidationError}(${errs})`); } else { gen.assign((0, codegen_1._)`${validateName}.errors`, errs); gen.return(false); } } const E = { keyword: new codegen_1.Name("keyword"), schemaPath: new codegen_1.Name("schemaPath"), // also used in JTD errors params: new codegen_1.Name("params"), propertyName: new codegen_1.Name("propertyName"), message: new codegen_1.Name("message"), schema: new codegen_1.Name("schema"), parentSchema: new codegen_1.Name("parentSchema") }; function errorObjectCode(cxt, error, errorPaths) { const { createErrors } = cxt.it; if (createErrors === false) return (0, codegen_1._)`{}`; return errorObject(cxt, error, errorPaths); } function errorObject(cxt, error, errorPaths = {}) { const { gen, it } = cxt; const keyValues = [errorInstancePath(it, errorPaths), errorSchemaPath(cxt, errorPaths)]; extraErrorProps(cxt, error, keyValues); return gen.object(...keyValues); } function errorInstancePath({ errorPath }, { instancePath }) { const instPath = instancePath ? (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(instancePath, util_1.Type.Str)}` : errorPath; return [names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, instPath)]; } function errorSchemaPath({ keyword, it: { errSchemaPath } }, { schemaPath, parentSchema }) { let schPath = parentSchema ? errSchemaPath : (0, codegen_1.str)`${errSchemaPath}/${keyword}`; if (schemaPath) { schPath = (0, codegen_1.str)`${schPath}${(0, util_1.getErrorPath)(schemaPath, util_1.Type.Str)}`; } return [E.schemaPath, schPath]; } function extraErrorProps(cxt, { params, message }, keyValues) { const { keyword, data, schemaValue, it } = cxt; const { opts, propertyName, topSchemaRef, schemaPath } = it; keyValues.push([E.keyword, keyword], [E.params, typeof params == "function" ? params(cxt) : params || (0, codegen_1._)`{}`]); if (opts.messages) { keyValues.push([E.message, typeof message == "function" ? message(cxt) : message]); } if (opts.verbose) { keyValues.push([E.schema, schemaValue], [E.parentSchema, (0, codegen_1._)`${topSchemaRef}${schemaPath}`], [names_1.default.data, data]); } if (propertyName) keyValues.push([E.propertyName, propertyName]); } /***/ }, /***/ 93406 /*!******************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/compile/index.js ***! \******************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.resolveSchema = exports.getCompilingSchema = exports.resolveRef = exports.compileSchema = exports.SchemaEnv = void 0; const codegen_1 = __webpack_require__(/*! ./codegen */ 59164); const validation_error_1 = __webpack_require__(/*! ../runtime/validation_error */ 32669); const names_1 = __webpack_require__(/*! ./names */ 17862); const resolve_1 = __webpack_require__(/*! ./resolve */ 90170); const util_1 = __webpack_require__(/*! ./util */ 1776); const validate_1 = __webpack_require__(/*! ./validate */ 80137); class SchemaEnv { constructor(env) { var _a; this.refs = {}; this.dynamicAnchors = {}; let schema; if (typeof env.schema == "object") schema = env.schema; this.schema = env.schema; this.schemaId = env.schemaId; this.root = env.root || this; this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema === null || schema === void 0 ? void 0 : schema[env.schemaId || "$id"]); this.schemaPath = env.schemaPath; this.localRefs = env.localRefs; this.meta = env.meta; this.$async = schema === null || schema === void 0 ? void 0 : schema.$async; this.refs = {}; } } exports.SchemaEnv = SchemaEnv; // let codeSize = 0 // let nodeCount = 0 // Compiles schema in SchemaEnv function compileSchema(sch) { // TODO refactor - remove compilations const _sch = getCompilingSchema.call(this, sch); if (_sch) return _sch; const rootId = (0, resolve_1.getFullPath)(this.opts.uriResolver, sch.root.baseId); // TODO if getFullPath removed 1 tests fails const { es5, lines } = this.opts.code; const { ownProperties } = this.opts; const gen = new codegen_1.CodeGen(this.scope, { es5, lines, ownProperties }); let _ValidationError; if (sch.$async) { _ValidationError = gen.scopeValue("Error", { ref: validation_error_1.default, code: (0, codegen_1._)`require("ajv/dist/runtime/validation_error").default` }); } const validateName = gen.scopeName("validate"); sch.validateName = validateName; const schemaCxt = { gen, allErrors: this.opts.allErrors, data: names_1.default.data, parentData: names_1.default.parentData, parentDataProperty: names_1.default.parentDataProperty, dataNames: [names_1.default.data], dataPathArr: [codegen_1.nil], // TODO can its length be used as dataLevel if nil is removed? dataLevel: 0, dataTypes: [], definedProperties: new Set(), topSchemaRef: gen.scopeValue("schema", this.opts.code.source === true ? { ref: sch.schema, code: (0, codegen_1.stringify)(sch.schema) } : { ref: sch.schema }), validateName, ValidationError: _ValidationError, schema: sch.schema, schemaEnv: sch, rootId, baseId: sch.baseId || rootId, schemaPath: codegen_1.nil, errSchemaPath: sch.schemaPath || (this.opts.jtd ? "" : "#"), errorPath: (0, codegen_1._)`""`, opts: this.opts, self: this }; let sourceCode; try { this._compilations.add(sch); (0, validate_1.validateFunctionCode)(schemaCxt); gen.optimize(this.opts.code.optimize); // gen.optimize(1) const validateCode = gen.toString(); sourceCode = `${gen.scopeRefs(names_1.default.scope)}return ${validateCode}`; // console.log((codeSize += sourceCode.length), (nodeCount += gen.nodeCount)) if (this.opts.code.process) sourceCode = this.opts.code.process(sourceCode, sch); // console.log("\n\n\n *** \n", sourceCode) const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode); const validate = makeValidate(this, this.scope.get()); this.scope.value(validateName, { ref: validate }); validate.errors = null; validate.schema = sch.schema; validate.schemaEnv = sch; if (sch.$async) validate.$async = true; if (this.opts.code.source === true) { validate.source = { validateName, validateCode, scopeValues: gen._values }; } if (this.opts.unevaluated) { const { props, items } = schemaCxt; validate.evaluated = { props: props instanceof codegen_1.Name ? undefined : props, items: items instanceof codegen_1.Name ? undefined : items, dynamicProps: props instanceof codegen_1.Name, dynamicItems: items instanceof codegen_1.Name }; if (validate.source) validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated); } sch.validate = validate; return sch; } catch (e) { delete sch.validate; delete sch.validateName; if (sourceCode) this.logger.error("Error compiling schema, function code:", sourceCode); // console.log("\n\n\n *** \n", sourceCode, this.opts) throw e; } finally { this._compilations.delete(sch); } } exports.compileSchema = compileSchema; function resolveRef(root, baseId, ref) { var _a; ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref); const schOrFunc = root.refs[ref]; if (schOrFunc) return schOrFunc; let _sch = resolve.call(this, root, ref); if (_sch === undefined) { const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref]; // TODO maybe localRefs should hold SchemaEnv const { schemaId } = this.opts; if (schema) _sch = new SchemaEnv({ schema, schemaId, root, baseId }); } if (_sch === undefined) return; return root.refs[ref] = inlineOrCompile.call(this, _sch); } exports.resolveRef = resolveRef; function inlineOrCompile(sch) { if ((0, resolve_1.inlineRef)(sch.schema, this.opts.inlineRefs)) return sch.schema; return sch.validate ? sch : compileSchema.call(this, sch); } // Index of schema compilation in the currently compiled list function getCompilingSchema(schEnv) { for (const sch of this._compilations) { if (sameSchemaEnv(sch, schEnv)) return sch; } } exports.getCompilingSchema = getCompilingSchema; function sameSchemaEnv(s1, s2) { return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId; } // resolve and compile the references ($ref) // TODO returns AnySchemaObject (if the schema can be inlined) or validation function function resolve(root, // information about the root schema for the current schema ref // reference to resolve ) { let sch; while (typeof (sch = this.refs[ref]) == "string") ref = sch; return sch || this.schemas[ref] || resolveSchema.call(this, root, ref); } // Resolve schema, its root and baseId function resolveSchema(root, // root object with properties schema, refs TODO below SchemaEnv is assigned to it ref // reference to resolve ) { const p = this.opts.uriResolver.parse(ref); const refPath = (0, resolve_1._getFullPath)(this.opts.uriResolver, p); let baseId = (0, resolve_1.getFullPath)(this.opts.uriResolver, root.baseId, undefined); // TODO `Object.keys(root.schema).length > 0` should not be needed - but removing breaks 2 tests if (Object.keys(root.schema).length > 0 && refPath === baseId) { return getJsonPointer.call(this, p, root); } const id = (0, resolve_1.normalizeId)(refPath); const schOrRef = this.refs[id] || this.schemas[id]; if (typeof schOrRef == "string") { const sch = resolveSchema.call(this, root, schOrRef); if (typeof (sch === null || sch === void 0 ? void 0 : sch.schema) !== "object") return; return getJsonPointer.call(this, p, sch); } if (typeof (schOrRef === null || schOrRef === void 0 ? void 0 : schOrRef.schema) !== "object") return; if (!schOrRef.validate) compileSchema.call(this, schOrRef); if (id === (0, resolve_1.normalizeId)(ref)) { const { schema } = schOrRef; const { schemaId } = this.opts; const schId = schema[schemaId]; if (schId) baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); return new SchemaEnv({ schema, schemaId, root, baseId }); } return getJsonPointer.call(this, p, schOrRef); } exports.resolveSchema = resolveSchema; const PREVENT_SCOPE_CHANGE = new Set(["properties", "patternProperties", "enum", "dependencies", "definitions"]); function getJsonPointer(parsedRef, { baseId, schema, root }) { var _a; if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== "/") return; for (const part of parsedRef.fragment.slice(1).split("/")) { if (typeof schema === "boolean") return; const partSchema = schema[(0, util_1.unescapeFragment)(part)]; if (partSchema === undefined) return; schema = partSchema; // TODO PREVENT_SCOPE_CHANGE could be defined in keyword def? const schId = typeof schema === "object" && schema[this.opts.schemaId]; if (!PREVENT_SCOPE_CHANGE.has(part) && schId) { baseId = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schId); } } let env; if (typeof schema != "boolean" && schema.$ref && !(0, util_1.schemaHasRulesButRef)(schema, this.RULES)) { const $ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, schema.$ref); env = resolveSchema.call(this, root, $ref); } // even though resolution failed we need to return SchemaEnv to throw exception // so that compileAsync loads missing schema. const { schemaId } = this.opts; env = env || new SchemaEnv({ schema, schemaId, root, baseId }); if (env.schema !== env.root.schema) return env; return undefined; } /***/ }, /***/ 17862 /*!******************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/compile/names.js ***! \******************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ./codegen */ 59164); const names = { // validation function arguments data: new codegen_1.Name("data"), // data passed to validation function // args passed from referencing schema valCxt: new codegen_1.Name("valCxt"), // validation/data context - should not be used directly, it is destructured to the names below instancePath: new codegen_1.Name("instancePath"), parentData: new codegen_1.Name("parentData"), parentDataProperty: new codegen_1.Name("parentDataProperty"), rootData: new codegen_1.Name("rootData"), // root data - same as the data passed to the first/top validation function dynamicAnchors: new codegen_1.Name("dynamicAnchors"), // used to support recursiveRef and dynamicRef // function scoped variables vErrors: new codegen_1.Name("vErrors"), // null or array of validation errors errors: new codegen_1.Name("errors"), // counter of validation errors this: new codegen_1.Name("this"), // "globals" self: new codegen_1.Name("self"), scope: new codegen_1.Name("scope"), // JTD serialize/parse name for JSON string and position json: new codegen_1.Name("json"), jsonPos: new codegen_1.Name("jsonPos"), jsonLen: new codegen_1.Name("jsonLen"), jsonPart: new codegen_1.Name("jsonPart") }; exports["default"] = names; /***/ }, /***/ 82602 /*!**********************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/compile/ref_error.js ***! \**********************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const resolve_1 = __webpack_require__(/*! ./resolve */ 90170); class MissingRefError extends Error { constructor(resolver, baseId, ref, msg) { super(msg || `can't resolve reference ${ref} from id ${baseId}`); this.missingRef = (0, resolve_1.resolveUrl)(resolver, baseId, ref); this.missingSchema = (0, resolve_1.normalizeId)((0, resolve_1.getFullPath)(resolver, this.missingRef)); } } exports["default"] = MissingRefError; /***/ }, /***/ 90170 /*!********************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/compile/resolve.js ***! \********************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getSchemaRefs = exports.resolveUrl = exports.normalizeId = exports._getFullPath = exports.getFullPath = exports.inlineRef = void 0; const util_1 = __webpack_require__(/*! ./util */ 1776); const equal = __webpack_require__(/*! fast-deep-equal */ 33778); const traverse = __webpack_require__(/*! json-schema-traverse */ 17603); // TODO refactor to use keyword definitions const SIMPLE_INLINED = new Set(["type", "format", "pattern", "maxLength", "minLength", "maxProperties", "minProperties", "maxItems", "minItems", "maximum", "minimum", "uniqueItems", "multipleOf", "required", "enum", "const"]); function inlineRef(schema, limit = true) { if (typeof schema == "boolean") return true; if (limit === true) return !hasRef(schema); if (!limit) return false; return countKeys(schema) <= limit; } exports.inlineRef = inlineRef; const REF_KEYWORDS = new Set(["$ref", "$recursiveRef", "$recursiveAnchor", "$dynamicRef", "$dynamicAnchor"]); function hasRef(schema) { for (const key in schema) { if (REF_KEYWORDS.has(key)) return true; const sch = schema[key]; if (Array.isArray(sch) && sch.some(hasRef)) return true; if (typeof sch == "object" && hasRef(sch)) return true; } return false; } function countKeys(schema) { let count = 0; for (const key in schema) { if (key === "$ref") return Infinity; count++; if (SIMPLE_INLINED.has(key)) continue; if (typeof schema[key] == "object") { (0, util_1.eachItem)(schema[key], sch => count += countKeys(sch)); } if (count === Infinity) return Infinity; } return count; } function getFullPath(resolver, id = "", normalize) { if (normalize !== false) id = normalizeId(id); const p = resolver.parse(id); return _getFullPath(resolver, p); } exports.getFullPath = getFullPath; function _getFullPath(resolver, p) { const serialized = resolver.serialize(p); return serialized.split("#")[0] + "#"; } exports._getFullPath = _getFullPath; const TRAILING_SLASH_HASH = /#\/?$/; function normalizeId(id) { return id ? id.replace(TRAILING_SLASH_HASH, "") : ""; } exports.normalizeId = normalizeId; function resolveUrl(resolver, baseId, id) { id = normalizeId(id); return resolver.resolve(baseId, id); } exports.resolveUrl = resolveUrl; const ANCHOR = /^[a-z_][-a-z0-9._]*$/i; function getSchemaRefs(schema, baseId) { if (typeof schema == "boolean") return {}; const { schemaId, uriResolver } = this.opts; const schId = normalizeId(schema[schemaId] || baseId); const baseIds = { "": schId }; const pathPrefix = getFullPath(uriResolver, schId, false); const localRefs = {}; const schemaRefs = new Set(); traverse(schema, { allKeys: true }, (sch, jsonPtr, _, parentJsonPtr) => { if (parentJsonPtr === undefined) return; const fullPath = pathPrefix + jsonPtr; let innerBaseId = baseIds[parentJsonPtr]; if (typeof sch[schemaId] == "string") innerBaseId = addRef.call(this, sch[schemaId]); addAnchor.call(this, sch.$anchor); addAnchor.call(this, sch.$dynamicAnchor); baseIds[jsonPtr] = innerBaseId; function addRef(ref) { // eslint-disable-next-line @typescript-eslint/unbound-method const _resolve = this.opts.uriResolver.resolve; ref = normalizeId(innerBaseId ? _resolve(innerBaseId, ref) : ref); if (schemaRefs.has(ref)) throw ambiguos(ref); schemaRefs.add(ref); let schOrRef = this.refs[ref]; if (typeof schOrRef == "string") schOrRef = this.refs[schOrRef]; if (typeof schOrRef == "object") { checkAmbiguosRef(sch, schOrRef.schema, ref); } else if (ref !== normalizeId(fullPath)) { if (ref[0] === "#") { checkAmbiguosRef(sch, localRefs[ref], ref); localRefs[ref] = sch; } else { this.refs[ref] = fullPath; } } return ref; } function addAnchor(anchor) { if (typeof anchor == "string") { if (!ANCHOR.test(anchor)) throw new Error(`invalid anchor "${anchor}"`); addRef.call(this, `#${anchor}`); } } }); return localRefs; function checkAmbiguosRef(sch1, sch2, ref) { if (sch2 !== undefined && !equal(sch1, sch2)) throw ambiguos(ref); } function ambiguos(ref) { return new Error(`reference "${ref}" resolves to more than one schema`); } } exports.getSchemaRefs = getSchemaRefs; /***/ }, /***/ 98873 /*!******************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/compile/rules.js ***! \******************************************************************/ (__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getRules = exports.isJSONType = void 0; const _jsonTypes = ["string", "number", "integer", "boolean", "null", "object", "array"]; const jsonTypes = new Set(_jsonTypes); function isJSONType(x) { return typeof x == "string" && jsonTypes.has(x); } exports.isJSONType = isJSONType; function getRules() { const groups = { number: { type: "number", rules: [] }, string: { type: "string", rules: [] }, array: { type: "array", rules: [] }, object: { type: "object", rules: [] } }; return { types: { ...groups, integer: true, boolean: true, null: true }, rules: [{ rules: [] }, groups.number, groups.string, groups.array, groups.object], post: { rules: [] }, all: {}, keywords: {} }; } exports.getRules = getRules; /***/ }, /***/ 1776 /*!*****************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/compile/util.js ***! \*****************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.checkStrictMode = exports.getErrorPath = exports.Type = exports.useFunc = exports.setEvaluated = exports.evaluatedPropsToName = exports.mergeEvaluated = exports.eachItem = exports.unescapeJsonPointer = exports.escapeJsonPointer = exports.escapeFragment = exports.unescapeFragment = exports.schemaRefOrVal = exports.schemaHasRulesButRef = exports.schemaHasRules = exports.checkUnknownRules = exports.alwaysValidSchema = exports.toHash = void 0; const codegen_1 = __webpack_require__(/*! ./codegen */ 59164); const code_1 = __webpack_require__(/*! ./codegen/code */ 48887); // TODO refactor to use Set function toHash(arr) { const hash = {}; for (const item of arr) hash[item] = true; return hash; } exports.toHash = toHash; function alwaysValidSchema(it, schema) { if (typeof schema == "boolean") return schema; if (Object.keys(schema).length === 0) return true; checkUnknownRules(it, schema); return !schemaHasRules(schema, it.self.RULES.all); } exports.alwaysValidSchema = alwaysValidSchema; function checkUnknownRules(it, schema = it.schema) { const { opts, self } = it; if (!opts.strictSchema) return; if (typeof schema === "boolean") return; const rules = self.RULES.keywords; for (const key in schema) { if (!rules[key]) checkStrictMode(it, `unknown keyword: "${key}"`); } } exports.checkUnknownRules = checkUnknownRules; function schemaHasRules(schema, rules) { if (typeof schema == "boolean") return !schema; for (const key in schema) if (rules[key]) return true; return false; } exports.schemaHasRules = schemaHasRules; function schemaHasRulesButRef(schema, RULES) { if (typeof schema == "boolean") return !schema; for (const key in schema) if (key !== "$ref" && RULES.all[key]) return true; return false; } exports.schemaHasRulesButRef = schemaHasRulesButRef; function schemaRefOrVal({ topSchemaRef, schemaPath }, schema, keyword, $data) { if (!$data) { if (typeof schema == "number" || typeof schema == "boolean") return schema; if (typeof schema == "string") return (0, codegen_1._)`${schema}`; } return (0, codegen_1._)`${topSchemaRef}${schemaPath}${(0, codegen_1.getProperty)(keyword)}`; } exports.schemaRefOrVal = schemaRefOrVal; function unescapeFragment(str) { return unescapeJsonPointer(decodeURIComponent(str)); } exports.unescapeFragment = unescapeFragment; function escapeFragment(str) { return encodeURIComponent(escapeJsonPointer(str)); } exports.escapeFragment = escapeFragment; function escapeJsonPointer(str) { if (typeof str == "number") return `${str}`; return str.replace(/~/g, "~0").replace(/\//g, "~1"); } exports.escapeJsonPointer = escapeJsonPointer; function unescapeJsonPointer(str) { return str.replace(/~1/g, "/").replace(/~0/g, "~"); } exports.unescapeJsonPointer = unescapeJsonPointer; function eachItem(xs, f) { if (Array.isArray(xs)) { for (const x of xs) f(x); } else { f(xs); } } exports.eachItem = eachItem; function makeMergeEvaluated({ mergeNames, mergeToName, mergeValues, resultToName }) { return (gen, from, to, toName) => { const res = to === undefined ? from : to instanceof codegen_1.Name ? (from instanceof codegen_1.Name ? mergeNames(gen, from, to) : mergeToName(gen, from, to), to) : from instanceof codegen_1.Name ? (mergeToName(gen, to, from), from) : mergeValues(from, to); return toName === codegen_1.Name && !(res instanceof codegen_1.Name) ? resultToName(gen, res) : res; }; } exports.mergeEvaluated = { props: makeMergeEvaluated({ mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => { gen.if((0, codegen_1._)`${from} === true`, () => gen.assign(to, true), () => gen.assign(to, (0, codegen_1._)`${to} || {}`).code((0, codegen_1._)`Object.assign(${to}, ${from})`)); }), mergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => { if (from === true) { gen.assign(to, true); } else { gen.assign(to, (0, codegen_1._)`${to} || {}`); setEvaluated(gen, to, from); } }), mergeValues: (from, to) => from === true ? true : { ...from, ...to }, resultToName: evaluatedPropsToName }), items: makeMergeEvaluated({ mergeNames: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true && ${from} !== undefined`, () => gen.assign(to, (0, codegen_1._)`${from} === true ? true : ${to} > ${from} ? ${to} : ${from}`)), mergeToName: (gen, from, to) => gen.if((0, codegen_1._)`${to} !== true`, () => gen.assign(to, from === true ? true : (0, codegen_1._)`${to} > ${from} ? ${to} : ${from}`)), mergeValues: (from, to) => from === true ? true : Math.max(from, to), resultToName: (gen, items) => gen.var("items", items) }) }; function evaluatedPropsToName(gen, ps) { if (ps === true) return gen.var("props", true); const props = gen.var("props", (0, codegen_1._)`{}`); if (ps !== undefined) setEvaluated(gen, props, ps); return props; } exports.evaluatedPropsToName = evaluatedPropsToName; function setEvaluated(gen, props, ps) { Object.keys(ps).forEach(p => gen.assign((0, codegen_1._)`${props}${(0, codegen_1.getProperty)(p)}`, true)); } exports.setEvaluated = setEvaluated; const snippets = {}; function useFunc(gen, f) { return gen.scopeValue("func", { ref: f, code: snippets[f.code] || (snippets[f.code] = new code_1._Code(f.code)) }); } exports.useFunc = useFunc; var Type; (function (Type) { Type[Type["Num"] = 0] = "Num"; Type[Type["Str"] = 1] = "Str"; })(Type || (exports.Type = Type = {})); function getErrorPath(dataProp, dataPropType, jsPropertySyntax) { // let path if (dataProp instanceof codegen_1.Name) { const isNumber = dataPropType === Type.Num; return jsPropertySyntax ? isNumber ? (0, codegen_1._)`"[" + ${dataProp} + "]"` : (0, codegen_1._)`"['" + ${dataProp} + "']"` : isNumber ? (0, codegen_1._)`"/" + ${dataProp}` : (0, codegen_1._)`"/" + ${dataProp}.replace(/~/g, "~0").replace(/\\//g, "~1")`; // TODO maybe use global escapePointer } return jsPropertySyntax ? (0, codegen_1.getProperty)(dataProp).toString() : "/" + escapeJsonPointer(dataProp); } exports.getErrorPath = getErrorPath; function checkStrictMode(it, msg, mode = it.opts.strictSchema) { if (!mode) return; msg = `strict mode: ${msg}`; if (mode === true) throw new Error(msg); it.self.logger.warn(msg); } exports.checkStrictMode = checkStrictMode; /***/ }, /***/ 8540 /*!***********************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/compile/validate/applicability.js ***! \***********************************************************************************/ (__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0; function schemaHasRulesForType({ schema, self }, type) { const group = self.RULES.types[type]; return group && group !== true && shouldUseGroup(schema, group); } exports.schemaHasRulesForType = schemaHasRulesForType; function shouldUseGroup(schema, group) { return group.rules.some(rule => shouldUseRule(schema, rule)); } exports.shouldUseGroup = shouldUseGroup; function shouldUseRule(schema, rule) { var _a; return schema[rule.keyword] !== undefined || ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some(kwd => schema[kwd] !== undefined)); } exports.shouldUseRule = shouldUseRule; /***/ }, /***/ 2450 /*!********************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/compile/validate/boolSchema.js ***! \********************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.boolOrEmptySchema = exports.topBoolOrEmptySchema = void 0; const errors_1 = __webpack_require__(/*! ../errors */ 80003); const codegen_1 = __webpack_require__(/*! ../codegen */ 59164); const names_1 = __webpack_require__(/*! ../names */ 17862); const boolError = { message: "boolean schema is false" }; function topBoolOrEmptySchema(it) { const { gen, schema, validateName } = it; if (schema === false) { falseSchemaError(it, false); } else if (typeof schema == "object" && schema.$async === true) { gen.return(names_1.default.data); } else { gen.assign((0, codegen_1._)`${validateName}.errors`, null); gen.return(true); } } exports.topBoolOrEmptySchema = topBoolOrEmptySchema; function boolOrEmptySchema(it, valid) { const { gen, schema } = it; if (schema === false) { gen.var(valid, false); // TODO var falseSchemaError(it); } else { gen.var(valid, true); // TODO var } } exports.boolOrEmptySchema = boolOrEmptySchema; function falseSchemaError(it, overrideAllErrors) { const { gen, data } = it; // TODO maybe some other interface should be used for non-keyword validation errors... const cxt = { gen, keyword: "false schema", data, schema: false, schemaCode: false, schemaValue: false, params: {}, it }; (0, errors_1.reportError)(cxt, boolError, undefined, overrideAllErrors); } /***/ }, /***/ 68541 /*!******************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/compile/validate/dataType.js ***! \******************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.reportTypeError = exports.checkDataTypes = exports.checkDataType = exports.coerceAndCheckDataType = exports.getJSONTypes = exports.getSchemaTypes = exports.DataType = void 0; const rules_1 = __webpack_require__(/*! ../rules */ 98873); const applicability_1 = __webpack_require__(/*! ./applicability */ 8540); const errors_1 = __webpack_require__(/*! ../errors */ 80003); const codegen_1 = __webpack_require__(/*! ../codegen */ 59164); const util_1 = __webpack_require__(/*! ../util */ 1776); var DataType; (function (DataType) { DataType[DataType["Correct"] = 0] = "Correct"; DataType[DataType["Wrong"] = 1] = "Wrong"; })(DataType || (exports.DataType = DataType = {})); function getSchemaTypes(schema) { const types = getJSONTypes(schema.type); const hasNull = types.includes("null"); if (hasNull) { if (schema.nullable === false) throw new Error("type: null contradicts nullable: false"); } else { if (!types.length && schema.nullable !== undefined) { throw new Error('"nullable" cannot be used without "type"'); } if (schema.nullable === true) types.push("null"); } return types; } exports.getSchemaTypes = getSchemaTypes; // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents function getJSONTypes(ts) { const types = Array.isArray(ts) ? ts : ts ? [ts] : []; if (types.every(rules_1.isJSONType)) return types; throw new Error("type must be JSONType or JSONType[]: " + types.join(",")); } exports.getJSONTypes = getJSONTypes; function coerceAndCheckDataType(it, types) { const { gen, data, opts } = it; const coerceTo = coerceToTypes(types, opts.coerceTypes); const checkTypes = types.length > 0 && !(coerceTo.length === 0 && types.length === 1 && (0, applicability_1.schemaHasRulesForType)(it, types[0])); if (checkTypes) { const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong); gen.if(wrongType, () => { if (coerceTo.length) coerceData(it, types, coerceTo);else reportTypeError(it); }); } return checkTypes; } exports.coerceAndCheckDataType = coerceAndCheckDataType; const COERCIBLE = new Set(["string", "number", "integer", "boolean", "null"]); function coerceToTypes(types, coerceTypes) { return coerceTypes ? types.filter(t => COERCIBLE.has(t) || coerceTypes === "array" && t === "array") : []; } function coerceData(it, types, coerceTo) { const { gen, data, opts } = it; const dataType = gen.let("dataType", (0, codegen_1._)`typeof ${data}`); const coerced = gen.let("coerced", (0, codegen_1._)`undefined`); if (opts.coerceTypes === "array") { gen.if((0, codegen_1._)`${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () => gen.assign(data, (0, codegen_1._)`${data}[0]`).assign(dataType, (0, codegen_1._)`typeof ${data}`).if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data))); } gen.if((0, codegen_1._)`${coerced} !== undefined`); for (const t of coerceTo) { if (COERCIBLE.has(t) || t === "array" && opts.coerceTypes === "array") { coerceSpecificType(t); } } gen.else(); reportTypeError(it); gen.endIf(); gen.if((0, codegen_1._)`${coerced} !== undefined`, () => { gen.assign(data, coerced); assignParentData(it, coerced); }); function coerceSpecificType(t) { switch (t) { case "string": gen.elseIf((0, codegen_1._)`${dataType} == "number" || ${dataType} == "boolean"`).assign(coerced, (0, codegen_1._)`"" + ${data}`).elseIf((0, codegen_1._)`${data} === null`).assign(coerced, (0, codegen_1._)`""`); return; case "number": gen.elseIf((0, codegen_1._)`${dataType} == "boolean" || ${data} === null || (${dataType} == "string" && ${data} && ${data} == +${data})`).assign(coerced, (0, codegen_1._)`+${data}`); return; case "integer": gen.elseIf((0, codegen_1._)`${dataType} === "boolean" || ${data} === null || (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`).assign(coerced, (0, codegen_1._)`+${data}`); return; case "boolean": gen.elseIf((0, codegen_1._)`${data} === "false" || ${data} === 0 || ${data} === null`).assign(coerced, false).elseIf((0, codegen_1._)`${data} === "true" || ${data} === 1`).assign(coerced, true); return; case "null": gen.elseIf((0, codegen_1._)`${data} === "" || ${data} === 0 || ${data} === false`); gen.assign(coerced, null); return; case "array": gen.elseIf((0, codegen_1._)`${dataType} === "string" || ${dataType} === "number" || ${dataType} === "boolean" || ${data} === null`).assign(coerced, (0, codegen_1._)`[${data}]`); } } } function assignParentData({ gen, parentData, parentDataProperty }, expr) { // TODO use gen.property gen.if((0, codegen_1._)`${parentData} !== undefined`, () => gen.assign((0, codegen_1._)`${parentData}[${parentDataProperty}]`, expr)); } function checkDataType(dataType, data, strictNums, correct = DataType.Correct) { const EQ = correct === DataType.Correct ? codegen_1.operators.EQ : codegen_1.operators.NEQ; let cond; switch (dataType) { case "null": return (0, codegen_1._)`${data} ${EQ} null`; case "array": cond = (0, codegen_1._)`Array.isArray(${data})`; break; case "object": cond = (0, codegen_1._)`${data} && typeof ${data} == "object" && !Array.isArray(${data})`; break; case "integer": cond = numCond((0, codegen_1._)`!(${data} % 1) && !isNaN(${data})`); break; case "number": cond = numCond(); break; default: return (0, codegen_1._)`typeof ${data} ${EQ} ${dataType}`; } return correct === DataType.Correct ? cond : (0, codegen_1.not)(cond); function numCond(_cond = codegen_1.nil) { return (0, codegen_1.and)((0, codegen_1._)`typeof ${data} == "number"`, _cond, strictNums ? (0, codegen_1._)`isFinite(${data})` : codegen_1.nil); } } exports.checkDataType = checkDataType; function checkDataTypes(dataTypes, data, strictNums, correct) { if (dataTypes.length === 1) { return checkDataType(dataTypes[0], data, strictNums, correct); } let cond; const types = (0, util_1.toHash)(dataTypes); if (types.array && types.object) { const notObj = (0, codegen_1._)`typeof ${data} != "object"`; cond = types.null ? notObj : (0, codegen_1._)`!${data} || ${notObj}`; delete types.null; delete types.array; delete types.object; } else { cond = codegen_1.nil; } if (types.number) delete types.integer; for (const t in types) cond = (0, codegen_1.and)(cond, checkDataType(t, data, strictNums, correct)); return cond; } exports.checkDataTypes = checkDataTypes; const typeError = { message: ({ schema }) => `must be ${schema}`, params: ({ schema, schemaValue }) => typeof schema == "string" ? (0, codegen_1._)`{type: ${schema}}` : (0, codegen_1._)`{type: ${schemaValue}}` }; function reportTypeError(it) { const cxt = getTypeErrorContext(it); (0, errors_1.reportError)(cxt, typeError); } exports.reportTypeError = reportTypeError; function getTypeErrorContext(it) { const { gen, data, schema } = it; const schemaCode = (0, util_1.schemaRefOrVal)(it, schema, "type"); return { gen, keyword: "type", data, schema: schema.type, schemaCode, schemaValue: schemaCode, parentSchema: schema, params: {}, it }; } /***/ }, /***/ 51571 /*!******************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/compile/validate/defaults.js ***! \******************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.assignDefaults = void 0; const codegen_1 = __webpack_require__(/*! ../codegen */ 59164); const util_1 = __webpack_require__(/*! ../util */ 1776); function assignDefaults(it, ty) { const { properties, items } = it.schema; if (ty === "object" && properties) { for (const key in properties) { assignDefault(it, key, properties[key].default); } } else if (ty === "array" && Array.isArray(items)) { items.forEach((sch, i) => assignDefault(it, i, sch.default)); } } exports.assignDefaults = assignDefaults; function assignDefault(it, prop, defaultValue) { const { gen, compositeRule, data, opts } = it; if (defaultValue === undefined) return; const childData = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(prop)}`; if (compositeRule) { (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`); return; } let condition = (0, codegen_1._)`${childData} === undefined`; if (opts.useDefaults === "empty") { condition = (0, codegen_1._)`${condition} || ${childData} === null || ${childData} === ""`; } // `${childData} === undefined` + // (opts.useDefaults === "empty" ? ` || ${childData} === null || ${childData} === ""` : "") gen.if(condition, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`); } /***/ }, /***/ 80137 /*!***************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/compile/validate/index.js ***! \***************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getData = exports.KeywordCxt = exports.validateFunctionCode = void 0; const boolSchema_1 = __webpack_require__(/*! ./boolSchema */ 2450); const dataType_1 = __webpack_require__(/*! ./dataType */ 68541); const applicability_1 = __webpack_require__(/*! ./applicability */ 8540); const dataType_2 = __webpack_require__(/*! ./dataType */ 68541); const defaults_1 = __webpack_require__(/*! ./defaults */ 51571); const keyword_1 = __webpack_require__(/*! ./keyword */ 7906); const subschema_1 = __webpack_require__(/*! ./subschema */ 12056); const codegen_1 = __webpack_require__(/*! ../codegen */ 59164); const names_1 = __webpack_require__(/*! ../names */ 17862); const resolve_1 = __webpack_require__(/*! ../resolve */ 90170); const util_1 = __webpack_require__(/*! ../util */ 1776); const errors_1 = __webpack_require__(/*! ../errors */ 80003); // schema compilation - generates validation function, subschemaCode (below) is used for subschemas function validateFunctionCode(it) { if (isSchemaObj(it)) { checkKeywords(it); if (schemaCxtHasRules(it)) { topSchemaObjCode(it); return; } } validateFunction(it, () => (0, boolSchema_1.topBoolOrEmptySchema)(it)); } exports.validateFunctionCode = validateFunctionCode; function validateFunction({ gen, validateName, schema, schemaEnv, opts }, body) { if (opts.code.es5) { gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${names_1.default.valCxt}`, schemaEnv.$async, () => { gen.code((0, codegen_1._)`"use strict"; ${funcSourceUrl(schema, opts)}`); destructureValCxtES5(gen, opts); gen.code(body); }); } else { gen.func(validateName, (0, codegen_1._)`${names_1.default.data}, ${destructureValCxt(opts)}`, schemaEnv.$async, () => gen.code(funcSourceUrl(schema, opts)).code(body)); } } function destructureValCxt(opts) { return (0, codegen_1._)`{${names_1.default.instancePath}="", ${names_1.default.parentData}, ${names_1.default.parentDataProperty}, ${names_1.default.rootData}=${names_1.default.data}${opts.dynamicRef ? (0, codegen_1._)`, ${names_1.default.dynamicAnchors}={}` : codegen_1.nil}}={}`; } function destructureValCxtES5(gen, opts) { gen.if(names_1.default.valCxt, () => { gen.var(names_1.default.instancePath, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.instancePath}`); gen.var(names_1.default.parentData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentData}`); gen.var(names_1.default.parentDataProperty, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.parentDataProperty}`); gen.var(names_1.default.rootData, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.rootData}`); if (opts.dynamicRef) gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`${names_1.default.valCxt}.${names_1.default.dynamicAnchors}`); }, () => { gen.var(names_1.default.instancePath, (0, codegen_1._)`""`); gen.var(names_1.default.parentData, (0, codegen_1._)`undefined`); gen.var(names_1.default.parentDataProperty, (0, codegen_1._)`undefined`); gen.var(names_1.default.rootData, names_1.default.data); if (opts.dynamicRef) gen.var(names_1.default.dynamicAnchors, (0, codegen_1._)`{}`); }); } function topSchemaObjCode(it) { const { schema, opts, gen } = it; validateFunction(it, () => { if (opts.$comment && schema.$comment) commentKeyword(it); checkNoDefault(it); gen.let(names_1.default.vErrors, null); gen.let(names_1.default.errors, 0); if (opts.unevaluated) resetEvaluated(it); typeAndKeywords(it); returnResults(it); }); return; } function resetEvaluated(it) { // TODO maybe some hook to execute it in the end to check whether props/items are Name, as in assignEvaluated const { gen, validateName } = it; it.evaluated = gen.const("evaluated", (0, codegen_1._)`${validateName}.evaluated`); gen.if((0, codegen_1._)`${it.evaluated}.dynamicProps`, () => gen.assign((0, codegen_1._)`${it.evaluated}.props`, (0, codegen_1._)`undefined`)); gen.if((0, codegen_1._)`${it.evaluated}.dynamicItems`, () => gen.assign((0, codegen_1._)`${it.evaluated}.items`, (0, codegen_1._)`undefined`)); } function funcSourceUrl(schema, opts) { const schId = typeof schema == "object" && schema[opts.schemaId]; return schId && (opts.code.source || opts.code.process) ? (0, codegen_1._)`/*# sourceURL=${schId} */` : codegen_1.nil; } // schema compilation - this function is used recursively to generate code for sub-schemas function subschemaCode(it, valid) { if (isSchemaObj(it)) { checkKeywords(it); if (schemaCxtHasRules(it)) { subSchemaObjCode(it, valid); return; } } (0, boolSchema_1.boolOrEmptySchema)(it, valid); } function schemaCxtHasRules({ schema, self }) { if (typeof schema == "boolean") return !schema; for (const key in schema) if (self.RULES.all[key]) return true; return false; } function isSchemaObj(it) { return typeof it.schema != "boolean"; } function subSchemaObjCode(it, valid) { const { schema, gen, opts } = it; if (opts.$comment && schema.$comment) commentKeyword(it); updateContext(it); checkAsyncSchema(it); const errsCount = gen.const("_errs", names_1.default.errors); typeAndKeywords(it, errsCount); // TODO var gen.var(valid, (0, codegen_1._)`${errsCount} === ${names_1.default.errors}`); } function checkKeywords(it) { (0, util_1.checkUnknownRules)(it); checkRefsAndKeywords(it); } function typeAndKeywords(it, errsCount) { if (it.opts.jtd) return schemaKeywords(it, [], false, errsCount); const types = (0, dataType_1.getSchemaTypes)(it.schema); const checkedTypes = (0, dataType_1.coerceAndCheckDataType)(it, types); schemaKeywords(it, types, !checkedTypes, errsCount); } function checkRefsAndKeywords(it) { const { schema, errSchemaPath, opts, self } = it; if (schema.$ref && opts.ignoreKeywordsWithRef && (0, util_1.schemaHasRulesButRef)(schema, self.RULES)) { self.logger.warn(`$ref: keywords ignored in schema at path "${errSchemaPath}"`); } } function checkNoDefault(it) { const { schema, opts } = it; if (schema.default !== undefined && opts.useDefaults && opts.strictSchema) { (0, util_1.checkStrictMode)(it, "default is ignored in the schema root"); } } function updateContext(it) { const schId = it.schema[it.opts.schemaId]; if (schId) it.baseId = (0, resolve_1.resolveUrl)(it.opts.uriResolver, it.baseId, schId); } function checkAsyncSchema(it) { if (it.schema.$async && !it.schemaEnv.$async) throw new Error("async schema in sync schema"); } function commentKeyword({ gen, schemaEnv, schema, errSchemaPath, opts }) { const msg = schema.$comment; if (opts.$comment === true) { gen.code((0, codegen_1._)`${names_1.default.self}.logger.log(${msg})`); } else if (typeof opts.$comment == "function") { const schemaPath = (0, codegen_1.str)`${errSchemaPath}/$comment`; const rootName = gen.scopeValue("root", { ref: schemaEnv.root }); gen.code((0, codegen_1._)`${names_1.default.self}.opts.$comment(${msg}, ${schemaPath}, ${rootName}.schema)`); } } function returnResults(it) { const { gen, schemaEnv, validateName, ValidationError, opts } = it; if (schemaEnv.$async) { // TODO assign unevaluated gen.if((0, codegen_1._)`${names_1.default.errors} === 0`, () => gen.return(names_1.default.data), () => gen.throw((0, codegen_1._)`new ${ValidationError}(${names_1.default.vErrors})`)); } else { gen.assign((0, codegen_1._)`${validateName}.errors`, names_1.default.vErrors); if (opts.unevaluated) assignEvaluated(it); gen.return((0, codegen_1._)`${names_1.default.errors} === 0`); } } function assignEvaluated({ gen, evaluated, props, items }) { if (props instanceof codegen_1.Name) gen.assign((0, codegen_1._)`${evaluated}.props`, props); if (items instanceof codegen_1.Name) gen.assign((0, codegen_1._)`${evaluated}.items`, items); } function schemaKeywords(it, types, typeErrors, errsCount) { const { gen, schema, data, allErrors, opts, self } = it; const { RULES } = self; if (schema.$ref && (opts.ignoreKeywordsWithRef || !(0, util_1.schemaHasRulesButRef)(schema, RULES))) { gen.block(() => keywordCode(it, "$ref", RULES.all.$ref.definition)); // TODO typecast return; } if (!opts.jtd) checkStrictTypes(it, types); gen.block(() => { for (const group of RULES.rules) groupKeywords(group); groupKeywords(RULES.post); }); function groupKeywords(group) { if (!(0, applicability_1.shouldUseGroup)(schema, group)) return; if (group.type) { gen.if((0, dataType_2.checkDataType)(group.type, data, opts.strictNumbers)); iterateKeywords(it, group); if (types.length === 1 && types[0] === group.type && typeErrors) { gen.else(); (0, dataType_2.reportTypeError)(it); } gen.endIf(); } else { iterateKeywords(it, group); } // TODO make it "ok" call? if (!allErrors) gen.if((0, codegen_1._)`${names_1.default.errors} === ${errsCount || 0}`); } } function iterateKeywords(it, group) { const { gen, schema, opts: { useDefaults } } = it; if (useDefaults) (0, defaults_1.assignDefaults)(it, group.type); gen.block(() => { for (const rule of group.rules) { if ((0, applicability_1.shouldUseRule)(schema, rule)) { keywordCode(it, rule.keyword, rule.definition, group.type); } } }); } function checkStrictTypes(it, types) { if (it.schemaEnv.meta || !it.opts.strictTypes) return; checkContextTypes(it, types); if (!it.opts.allowUnionTypes) checkMultipleTypes(it, types); checkKeywordTypes(it, it.dataTypes); } function checkContextTypes(it, types) { if (!types.length) return; if (!it.dataTypes.length) { it.dataTypes = types; return; } types.forEach(t => { if (!includesType(it.dataTypes, t)) { strictTypesError(it, `type "${t}" not allowed by context "${it.dataTypes.join(",")}"`); } }); narrowSchemaTypes(it, types); } function checkMultipleTypes(it, ts) { if (ts.length > 1 && !(ts.length === 2 && ts.includes("null"))) { strictTypesError(it, "use allowUnionTypes to allow union type keyword"); } } function checkKeywordTypes(it, ts) { const rules = it.self.RULES.all; for (const keyword in rules) { const rule = rules[keyword]; if (typeof rule == "object" && (0, applicability_1.shouldUseRule)(it.schema, rule)) { const { type } = rule.definition; if (type.length && !type.some(t => hasApplicableType(ts, t))) { strictTypesError(it, `missing type "${type.join(",")}" for keyword "${keyword}"`); } } } } function hasApplicableType(schTs, kwdT) { return schTs.includes(kwdT) || kwdT === "number" && schTs.includes("integer"); } function includesType(ts, t) { return ts.includes(t) || t === "integer" && ts.includes("number"); } function narrowSchemaTypes(it, withTypes) { const ts = []; for (const t of it.dataTypes) { if (includesType(withTypes, t)) ts.push(t);else if (withTypes.includes("integer") && t === "number") ts.push("integer"); } it.dataTypes = ts; } function strictTypesError(it, msg) { const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; msg += ` at "${schemaPath}" (strictTypes)`; (0, util_1.checkStrictMode)(it, msg, it.opts.strictTypes); } class KeywordCxt { constructor(it, def, keyword) { (0, keyword_1.validateKeywordUsage)(it, def, keyword); this.gen = it.gen; this.allErrors = it.allErrors; this.keyword = keyword; this.data = it.data; this.schema = it.schema[keyword]; this.$data = def.$data && it.opts.$data && this.schema && this.schema.$data; this.schemaValue = (0, util_1.schemaRefOrVal)(it, this.schema, keyword, this.$data); this.schemaType = def.schemaType; this.parentSchema = it.schema; this.params = {}; this.it = it; this.def = def; if (this.$data) { this.schemaCode = it.gen.const("vSchema", getData(this.$data, it)); } else { this.schemaCode = this.schemaValue; if (!(0, keyword_1.validSchemaType)(this.schema, def.schemaType, def.allowUndefined)) { throw new Error(`${keyword} value must be ${JSON.stringify(def.schemaType)}`); } } if ("code" in def ? def.trackErrors : def.errors !== false) { this.errsCount = it.gen.const("_errs", names_1.default.errors); } } result(condition, successAction, failAction) { this.failResult((0, codegen_1.not)(condition), successAction, failAction); } failResult(condition, successAction, failAction) { this.gen.if(condition); if (failAction) failAction();else this.error(); if (successAction) { this.gen.else(); successAction(); if (this.allErrors) this.gen.endIf(); } else { if (this.allErrors) this.gen.endIf();else this.gen.else(); } } pass(condition, failAction) { this.failResult((0, codegen_1.not)(condition), undefined, failAction); } fail(condition) { if (condition === undefined) { this.error(); if (!this.allErrors) this.gen.if(false); // this branch will be removed by gen.optimize return; } this.gen.if(condition); this.error(); if (this.allErrors) this.gen.endIf();else this.gen.else(); } fail$data(condition) { if (!this.$data) return this.fail(condition); const { schemaCode } = this; this.fail((0, codegen_1._)`${schemaCode} !== undefined && (${(0, codegen_1.or)(this.invalid$data(), condition)})`); } error(append, errorParams, errorPaths) { if (errorParams) { this.setParams(errorParams); this._error(append, errorPaths); this.setParams({}); return; } this._error(append, errorPaths); } _error(append, errorPaths) { ; (append ? errors_1.reportExtraError : errors_1.reportError)(this, this.def.error, errorPaths); } $dataError() { (0, errors_1.reportError)(this, this.def.$dataError || errors_1.keyword$DataError); } reset() { if (this.errsCount === undefined) throw new Error('add "trackErrors" to keyword definition'); (0, errors_1.resetErrorsCount)(this.gen, this.errsCount); } ok(cond) { if (!this.allErrors) this.gen.if(cond); } setParams(obj, assign) { if (assign) Object.assign(this.params, obj);else this.params = obj; } block$data(valid, codeBlock, $dataValid = codegen_1.nil) { this.gen.block(() => { this.check$data(valid, $dataValid); codeBlock(); }); } check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) { if (!this.$data) return; const { gen, schemaCode, schemaType, def } = this; gen.if((0, codegen_1.or)((0, codegen_1._)`${schemaCode} === undefined`, $dataValid)); if (valid !== codegen_1.nil) gen.assign(valid, true); if (schemaType.length || def.validateSchema) { gen.elseIf(this.invalid$data()); this.$dataError(); if (valid !== codegen_1.nil) gen.assign(valid, false); } gen.else(); } invalid$data() { const { gen, schemaCode, schemaType, def, it } = this; return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema()); function wrong$DataType() { if (schemaType.length) { /* istanbul ignore if */ if (!(schemaCode instanceof codegen_1.Name)) throw new Error("ajv implementation error"); const st = Array.isArray(schemaType) ? schemaType : [schemaType]; return (0, codegen_1._)`${(0, dataType_2.checkDataTypes)(st, schemaCode, it.opts.strictNumbers, dataType_2.DataType.Wrong)}`; } return codegen_1.nil; } function invalid$DataSchema() { if (def.validateSchema) { const validateSchemaRef = gen.scopeValue("validate$data", { ref: def.validateSchema }); // TODO value.code for standalone return (0, codegen_1._)`!${validateSchemaRef}(${schemaCode})`; } return codegen_1.nil; } } subschema(appl, valid) { const subschema = (0, subschema_1.getSubschema)(this.it, appl); (0, subschema_1.extendSubschemaData)(subschema, this.it, appl); (0, subschema_1.extendSubschemaMode)(subschema, appl); const nextContext = { ...this.it, ...subschema, items: undefined, props: undefined }; subschemaCode(nextContext, valid); return nextContext; } mergeEvaluated(schemaCxt, toName) { const { it, gen } = this; if (!it.opts.unevaluated) return; if (it.props !== true && schemaCxt.props !== undefined) { it.props = util_1.mergeEvaluated.props(gen, schemaCxt.props, it.props, toName); } if (it.items !== true && schemaCxt.items !== undefined) { it.items = util_1.mergeEvaluated.items(gen, schemaCxt.items, it.items, toName); } } mergeValidEvaluated(schemaCxt, valid) { const { it, gen } = this; if (it.opts.unevaluated && (it.props !== true || it.items !== true)) { gen.if(valid, () => this.mergeEvaluated(schemaCxt, codegen_1.Name)); return true; } } } exports.KeywordCxt = KeywordCxt; function keywordCode(it, keyword, def, ruleType) { const cxt = new KeywordCxt(it, def, keyword); if ("code" in def) { def.code(cxt, ruleType); } else if (cxt.$data && def.validate) { (0, keyword_1.funcKeywordCode)(cxt, def); } else if ("macro" in def) { (0, keyword_1.macroKeywordCode)(cxt, def); } else if (def.compile || def.validate) { (0, keyword_1.funcKeywordCode)(cxt, def); } } const JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/; const RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/; function getData($data, { dataLevel, dataNames, dataPathArr }) { let jsonPointer; let data; if ($data === "") return names_1.default.rootData; if ($data[0] === "/") { if (!JSON_POINTER.test($data)) throw new Error(`Invalid JSON-pointer: ${$data}`); jsonPointer = $data; data = names_1.default.rootData; } else { const matches = RELATIVE_JSON_POINTER.exec($data); if (!matches) throw new Error(`Invalid JSON-pointer: ${$data}`); const up = +matches[1]; jsonPointer = matches[2]; if (jsonPointer === "#") { if (up >= dataLevel) throw new Error(errorMsg("property/index", up)); return dataPathArr[dataLevel - up]; } if (up > dataLevel) throw new Error(errorMsg("data", up)); data = dataNames[dataLevel - up]; if (!jsonPointer) return data; } let expr = data; const segments = jsonPointer.split("/"); for (const segment of segments) { if (segment) { data = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)((0, util_1.unescapeJsonPointer)(segment))}`; expr = (0, codegen_1._)`${expr} && ${data}`; } } return expr; function errorMsg(pointerType, up) { return `Cannot access ${pointerType} ${up} levels up, current level is ${dataLevel}`; } } exports.getData = getData; /***/ }, /***/ 7906 /*!*****************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/compile/validate/keyword.js ***! \*****************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.validateKeywordUsage = exports.validSchemaType = exports.funcKeywordCode = exports.macroKeywordCode = void 0; const codegen_1 = __webpack_require__(/*! ../codegen */ 59164); const names_1 = __webpack_require__(/*! ../names */ 17862); const code_1 = __webpack_require__(/*! ../../vocabularies/code */ 57572); const errors_1 = __webpack_require__(/*! ../errors */ 80003); function macroKeywordCode(cxt, def) { const { gen, keyword, schema, parentSchema, it } = cxt; const macroSchema = def.macro.call(it.self, schema, parentSchema, it); const schemaRef = useKeyword(gen, keyword, macroSchema); if (it.opts.validateSchema !== false) it.self.validateSchema(macroSchema, true); const valid = gen.name("valid"); cxt.subschema({ schema: macroSchema, schemaPath: codegen_1.nil, errSchemaPath: `${it.errSchemaPath}/${keyword}`, topSchemaRef: schemaRef, compositeRule: true }, valid); cxt.pass(valid, () => cxt.error(true)); } exports.macroKeywordCode = macroKeywordCode; function funcKeywordCode(cxt, def) { var _a; const { gen, keyword, schema, parentSchema, $data, it } = cxt; checkAsyncKeyword(it, def); const validate = !$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate; const validateRef = useKeyword(gen, keyword, validate); const valid = gen.let("valid"); cxt.block$data(valid, validateKeyword); cxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid); function validateKeyword() { if (def.errors === false) { assignValid(); if (def.modifying) modifyData(cxt); reportErrs(() => cxt.error()); } else { const ruleErrs = def.async ? validateAsync() : validateSync(); if (def.modifying) modifyData(cxt); reportErrs(() => addErrs(cxt, ruleErrs)); } } function validateAsync() { const ruleErrs = gen.let("ruleErrs", null); gen.try(() => assignValid((0, codegen_1._)`await `), e => gen.assign(valid, false).if((0, codegen_1._)`${e} instanceof ${it.ValidationError}`, () => gen.assign(ruleErrs, (0, codegen_1._)`${e}.errors`), () => gen.throw(e))); return ruleErrs; } function validateSync() { const validateErrs = (0, codegen_1._)`${validateRef}.errors`; gen.assign(validateErrs, null); assignValid(codegen_1.nil); return validateErrs; } function assignValid(_await = def.async ? (0, codegen_1._)`await ` : codegen_1.nil) { const passCxt = it.opts.passContext ? names_1.default.this : names_1.default.self; const passSchema = !("compile" in def && !$data || def.schema === false); gen.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying); } function reportErrs(errors) { var _a; gen.if((0, codegen_1.not)((_a = def.valid) !== null && _a !== void 0 ? _a : valid), errors); } } exports.funcKeywordCode = funcKeywordCode; function modifyData(cxt) { const { gen, data, it } = cxt; gen.if(it.parentData, () => gen.assign(data, (0, codegen_1._)`${it.parentData}[${it.parentDataProperty}]`)); } function addErrs(cxt, errs) { const { gen } = cxt; gen.if((0, codegen_1._)`Array.isArray(${errs})`, () => { gen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`).assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`); (0, errors_1.extendErrors)(cxt); }, () => cxt.error()); } function checkAsyncKeyword({ schemaEnv }, def) { if (def.async && !schemaEnv.$async) throw new Error("async keyword in sync schema"); } function useKeyword(gen, keyword, result) { if (result === undefined) throw new Error(`keyword "${keyword}" failed to compile`); return gen.scopeValue("keyword", typeof result == "function" ? { ref: result } : { ref: result, code: (0, codegen_1.stringify)(result) }); } function validSchemaType(schema, schemaType, allowUndefined = false) { // TODO add tests return !schemaType.length || schemaType.some(st => st === "array" ? Array.isArray(schema) : st === "object" ? schema && typeof schema == "object" && !Array.isArray(schema) : typeof schema == st || allowUndefined && typeof schema == "undefined"); } exports.validSchemaType = validSchemaType; function validateKeywordUsage({ schema, opts, self, errSchemaPath }, def, keyword) { /* istanbul ignore if */ if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) { throw new Error("ajv implementation error"); } const deps = def.dependencies; if (deps === null || deps === void 0 ? void 0 : deps.some(kwd => !Object.prototype.hasOwnProperty.call(schema, kwd))) { throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`); } if (def.validateSchema) { const valid = def.validateSchema(schema[keyword]); if (!valid) { const msg = `keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` + self.errorsText(def.validateSchema.errors); if (opts.validateSchema === "log") self.logger.error(msg);else throw new Error(msg); } } } exports.validateKeywordUsage = validateKeywordUsage; /***/ }, /***/ 12056 /*!*******************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/compile/validate/subschema.js ***! \*******************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.extendSubschemaMode = exports.extendSubschemaData = exports.getSubschema = void 0; const codegen_1 = __webpack_require__(/*! ../codegen */ 59164); const util_1 = __webpack_require__(/*! ../util */ 1776); function getSubschema(it, { keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef }) { if (keyword !== undefined && schema !== undefined) { throw new Error('both "keyword" and "schema" passed, only one allowed'); } if (keyword !== undefined) { const sch = it.schema[keyword]; return schemaProp === undefined ? { schema: sch, schemaPath: (0, codegen_1._)`${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}`, errSchemaPath: `${it.errSchemaPath}/${keyword}` } : { schema: sch[schemaProp], schemaPath: (0, codegen_1._)`${it.schemaPath}${(0, codegen_1.getProperty)(keyword)}${(0, codegen_1.getProperty)(schemaProp)}`, errSchemaPath: `${it.errSchemaPath}/${keyword}/${(0, util_1.escapeFragment)(schemaProp)}` }; } if (schema !== undefined) { if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) { throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"'); } return { schema, schemaPath, topSchemaRef, errSchemaPath }; } throw new Error('either "keyword" or "schema" must be passed'); } exports.getSubschema = getSubschema; function extendSubschemaData(subschema, it, { dataProp, dataPropType: dpType, data, dataTypes, propertyName }) { if (data !== undefined && dataProp !== undefined) { throw new Error('both "data" and "dataProp" passed, only one allowed'); } const { gen } = it; if (dataProp !== undefined) { const { errorPath, dataPathArr, opts } = it; const nextData = gen.let("data", (0, codegen_1._)`${it.data}${(0, codegen_1.getProperty)(dataProp)}`, true); dataContextProps(nextData); subschema.errorPath = (0, codegen_1.str)`${errorPath}${(0, util_1.getErrorPath)(dataProp, dpType, opts.jsPropertySyntax)}`; subschema.parentDataProperty = (0, codegen_1._)`${dataProp}`; subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty]; } if (data !== undefined) { const nextData = data instanceof codegen_1.Name ? data : gen.let("data", data, true); // replaceable if used once? dataContextProps(nextData); if (propertyName !== undefined) subschema.propertyName = propertyName; // TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr } if (dataTypes) subschema.dataTypes = dataTypes; function dataContextProps(_nextData) { subschema.data = _nextData; subschema.dataLevel = it.dataLevel + 1; subschema.dataTypes = []; it.definedProperties = new Set(); subschema.parentData = it.data; subschema.dataNames = [...it.dataNames, _nextData]; } } exports.extendSubschemaData = extendSubschemaData; function extendSubschemaMode(subschema, { jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors }) { if (compositeRule !== undefined) subschema.compositeRule = compositeRule; if (createErrors !== undefined) subschema.createErrors = createErrors; if (allErrors !== undefined) subschema.allErrors = allErrors; subschema.jtdDiscriminator = jtdDiscriminator; // not inherited subschema.jtdMetadata = jtdMetadata; // not inherited } exports.extendSubschemaMode = extendSubschemaMode; /***/ }, /***/ 63125 /*!*********************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/core.js ***! \*********************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; var _asyncToGenerator = (__webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/asyncToGenerator.js */ 87687)["default"]); Object.defineProperty(exports, "__esModule", ({ value: true })); exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0; var validate_1 = __webpack_require__(/*! ./compile/validate */ 80137); Object.defineProperty(exports, "KeywordCxt", ({ enumerable: true, get: function () { return validate_1.KeywordCxt; } })); var codegen_1 = __webpack_require__(/*! ./compile/codegen */ 59164); Object.defineProperty(exports, "_", ({ enumerable: true, get: function () { return codegen_1._; } })); Object.defineProperty(exports, "str", ({ enumerable: true, get: function () { return codegen_1.str; } })); Object.defineProperty(exports, "stringify", ({ enumerable: true, get: function () { return codegen_1.stringify; } })); Object.defineProperty(exports, "nil", ({ enumerable: true, get: function () { return codegen_1.nil; } })); Object.defineProperty(exports, "Name", ({ enumerable: true, get: function () { return codegen_1.Name; } })); Object.defineProperty(exports, "CodeGen", ({ enumerable: true, get: function () { return codegen_1.CodeGen; } })); const validation_error_1 = __webpack_require__(/*! ./runtime/validation_error */ 32669); const ref_error_1 = __webpack_require__(/*! ./compile/ref_error */ 82602); const rules_1 = __webpack_require__(/*! ./compile/rules */ 98873); const compile_1 = __webpack_require__(/*! ./compile */ 93406); const codegen_2 = __webpack_require__(/*! ./compile/codegen */ 59164); const resolve_1 = __webpack_require__(/*! ./compile/resolve */ 90170); const dataType_1 = __webpack_require__(/*! ./compile/validate/dataType */ 68541); const util_1 = __webpack_require__(/*! ./compile/util */ 1776); const $dataRefSchema = __webpack_require__(/*! ./refs/data.json */ 78985); const uri_1 = __webpack_require__(/*! ./runtime/uri */ 97437); const defaultRegExp = (str, flags) => new RegExp(str, flags); defaultRegExp.code = "new RegExp"; const META_IGNORE_OPTIONS = ["removeAdditional", "useDefaults", "coerceTypes"]; const EXT_SCOPE_NAMES = new Set(["validate", "serialize", "parse", "wrapper", "root", "schema", "keyword", "pattern", "formats", "validate$data", "func", "obj", "Error"]); const removedOptions = { errorDataPath: "", format: "`validateFormats: false` can be used instead.", nullable: '"nullable" keyword is supported by default.', jsonPointers: "Deprecated jsPropertySyntax can be used instead.", extendRefs: "Deprecated ignoreKeywordsWithRef can be used instead.", missingRefs: "Pass empty schema with $id that should be ignored to ajv.addSchema.", processCode: "Use option `code: {process: (code, schemaEnv: object) => string}`", sourceCode: "Use option `code: {source: true}`", strictDefaults: "It is default now, see option `strict`.", strictKeywords: "It is default now, see option `strict`.", uniqueItems: '"uniqueItems" keyword is always validated.', unknownFormats: "Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).", cache: "Map is used as cache, schema object as key.", serialize: "Map is used as cache, schema object as key.", ajvErrors: "It is default now." }; const deprecatedOptions = { ignoreKeywordsWithRef: "", jsPropertySyntax: "", unicode: '"minLength"/"maxLength" account for unicode characters by default.' }; const MAX_EXPRESSION = 200; // eslint-disable-next-line complexity function requiredOptions(o) { var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0; const s = o.strict; const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize; const optimize = _optz === true || _optz === undefined ? 1 : _optz || 0; const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp; const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default; return { strictSchema: (_f = (_e = o.strictSchema) !== null && _e !== void 0 ? _e : s) !== null && _f !== void 0 ? _f : true, strictNumbers: (_h = (_g = o.strictNumbers) !== null && _g !== void 0 ? _g : s) !== null && _h !== void 0 ? _h : true, strictTypes: (_k = (_j = o.strictTypes) !== null && _j !== void 0 ? _j : s) !== null && _k !== void 0 ? _k : "log", strictTuples: (_m = (_l = o.strictTuples) !== null && _l !== void 0 ? _l : s) !== null && _m !== void 0 ? _m : "log", strictRequired: (_p = (_o = o.strictRequired) !== null && _o !== void 0 ? _o : s) !== null && _p !== void 0 ? _p : false, code: o.code ? { ...o.code, optimize, regExp } : { optimize, regExp }, loopRequired: (_q = o.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION, loopEnum: (_r = o.loopEnum) !== null && _r !== void 0 ? _r : MAX_EXPRESSION, meta: (_s = o.meta) !== null && _s !== void 0 ? _s : true, messages: (_t = o.messages) !== null && _t !== void 0 ? _t : true, inlineRefs: (_u = o.inlineRefs) !== null && _u !== void 0 ? _u : true, schemaId: (_v = o.schemaId) !== null && _v !== void 0 ? _v : "$id", addUsedSchema: (_w = o.addUsedSchema) !== null && _w !== void 0 ? _w : true, validateSchema: (_x = o.validateSchema) !== null && _x !== void 0 ? _x : true, validateFormats: (_y = o.validateFormats) !== null && _y !== void 0 ? _y : true, unicodeRegExp: (_z = o.unicodeRegExp) !== null && _z !== void 0 ? _z : true, int32range: (_0 = o.int32range) !== null && _0 !== void 0 ? _0 : true, uriResolver: uriResolver }; } class Ajv { constructor(opts = {}) { this.schemas = {}; this.refs = {}; this.formats = Object.create(null); this._compilations = new Set(); this._loading = {}; this._cache = new Map(); opts = this.opts = { ...opts, ...requiredOptions(opts) }; const { es5, lines } = this.opts.code; this.scope = new codegen_2.ValueScope({ scope: {}, prefixes: EXT_SCOPE_NAMES, es5, lines }); this.logger = getLogger(opts.logger); const formatOpt = opts.validateFormats; opts.validateFormats = false; this.RULES = (0, rules_1.getRules)(); checkOptions.call(this, removedOptions, opts, "NOT SUPPORTED"); checkOptions.call(this, deprecatedOptions, opts, "DEPRECATED", "warn"); this._metaOpts = getMetaSchemaOptions.call(this); if (opts.formats) addInitialFormats.call(this); this._addVocabularies(); this._addDefaultMetaSchema(); if (opts.keywords) addInitialKeywords.call(this, opts.keywords); if (typeof opts.meta == "object") this.addMetaSchema(opts.meta); addInitialSchemas.call(this); opts.validateFormats = formatOpt; } _addVocabularies() { this.addKeyword("$async"); } _addDefaultMetaSchema() { const { $data, meta, schemaId } = this.opts; let _dataRefSchema = $dataRefSchema; if (schemaId === "id") { _dataRefSchema = { ...$dataRefSchema }; _dataRefSchema.id = _dataRefSchema.$id; delete _dataRefSchema.$id; } if (meta && $data) this.addMetaSchema(_dataRefSchema, _dataRefSchema[schemaId], false); } defaultMeta() { const { meta, schemaId } = this.opts; return this.opts.defaultMeta = typeof meta == "object" ? meta[schemaId] || meta : undefined; } validate(schemaKeyRef, // key, ref or schema object // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents data // to be validated ) { let v; if (typeof schemaKeyRef == "string") { v = this.getSchema(schemaKeyRef); if (!v) throw new Error(`no schema with key or ref "${schemaKeyRef}"`); } else { v = this.compile(schemaKeyRef); } const valid = v(data); if (!("$async" in v)) this.errors = v.errors; return valid; } compile(schema, _meta) { const sch = this._addSchema(schema, _meta); return sch.validate || this._compileSchemaEnv(sch); } compileAsync(schema, meta) { if (typeof this.opts.loadSchema != "function") { throw new Error("options.loadSchema should be a function"); } const { loadSchema } = this.opts; return runCompileAsync.call(this, schema, meta); function runCompileAsync(_x2, _x3) { return _runCompileAsync.apply(this, arguments); } function _runCompileAsync() { _runCompileAsync = _asyncToGenerator(function* (_schema, _meta) { yield loadMetaSchema.call(this, _schema.$schema); const sch = this._addSchema(_schema, _meta); return sch.validate || _compileAsync.call(this, sch); }); return _runCompileAsync.apply(this, arguments); } function loadMetaSchema(_x4) { return _loadMetaSchema.apply(this, arguments); } function _loadMetaSchema() { _loadMetaSchema = _asyncToGenerator(function* ($ref) { if ($ref && !this.getSchema($ref)) { yield runCompileAsync.call(this, { $ref }, true); } }); return _loadMetaSchema.apply(this, arguments); } function _compileAsync(_x5) { return _compileAsync2.apply(this, arguments); } function _compileAsync2() { _compileAsync2 = _asyncToGenerator(function* (sch) { try { return this._compileSchemaEnv(sch); } catch (e) { if (!(e instanceof ref_error_1.default)) throw e; checkLoaded.call(this, e); yield loadMissingSchema.call(this, e.missingSchema); return _compileAsync.call(this, sch); } }); return _compileAsync2.apply(this, arguments); } function checkLoaded({ missingSchema: ref, missingRef }) { if (this.refs[ref]) { throw new Error(`AnySchema ${ref} is loaded but ${missingRef} cannot be resolved`); } } function loadMissingSchema(_x6) { return _loadMissingSchema.apply(this, arguments); } function _loadMissingSchema() { _loadMissingSchema = _asyncToGenerator(function* (ref) { const _schema = yield _loadSchema.call(this, ref); if (!this.refs[ref]) yield loadMetaSchema.call(this, _schema.$schema); if (!this.refs[ref]) this.addSchema(_schema, ref, meta); }); return _loadMissingSchema.apply(this, arguments); } function _loadSchema(_x7) { return _loadSchema2.apply(this, arguments); } function _loadSchema2() { _loadSchema2 = _asyncToGenerator(function* (ref) { const p = this._loading[ref]; if (p) return p; try { return yield this._loading[ref] = loadSchema(ref); } finally { delete this._loading[ref]; } }); return _loadSchema2.apply(this, arguments); } } // Adds schema to the instance addSchema(schema, // If array is passed, `key` will be ignored key, // Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. _meta, // true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. _validateSchema = this.opts.validateSchema // false to skip schema validation. Used internally, option validateSchema should be used instead. ) { if (Array.isArray(schema)) { for (const sch of schema) this.addSchema(sch, undefined, _meta, _validateSchema); return this; } let id; if (typeof schema === "object") { const { schemaId } = this.opts; id = schema[schemaId]; if (id !== undefined && typeof id != "string") { throw new Error(`schema ${schemaId} must be string`); } } key = (0, resolve_1.normalizeId)(key || id); this._checkUnique(key); this.schemas[key] = this._addSchema(schema, _meta, key, _validateSchema, true); return this; } // Add schema that will be used to validate other schemas // options in META_IGNORE_OPTIONS are alway set to false addMetaSchema(schema, key, // schema key _validateSchema = this.opts.validateSchema // false to skip schema validation, can be used to override validateSchema option for meta-schema ) { this.addSchema(schema, key, true, _validateSchema); return this; } // Validate schema against its meta-schema validateSchema(schema, throwOrLogError) { if (typeof schema == "boolean") return true; let $schema; $schema = schema.$schema; if ($schema !== undefined && typeof $schema != "string") { throw new Error("$schema must be a string"); } $schema = $schema || this.opts.defaultMeta || this.defaultMeta(); if (!$schema) { this.logger.warn("meta-schema not available"); this.errors = null; return true; } const valid = this.validate($schema, schema); if (!valid && throwOrLogError) { const message = "schema is invalid: " + this.errorsText(); if (this.opts.validateSchema === "log") this.logger.error(message);else throw new Error(message); } return valid; } // Get compiled schema by `key` or `ref`. // (`key` that was passed to `addSchema` or full schema reference - `schema.$id` or resolved id) getSchema(keyRef) { let sch; while (typeof (sch = getSchEnv.call(this, keyRef)) == "string") keyRef = sch; if (sch === undefined) { const { schemaId } = this.opts; const root = new compile_1.SchemaEnv({ schema: {}, schemaId }); sch = compile_1.resolveSchema.call(this, root, keyRef); if (!sch) return; this.refs[keyRef] = sch; } return sch.validate || this._compileSchemaEnv(sch); } // Remove cached schema(s). // If no parameter is passed all schemas but meta-schemas are removed. // If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. // Even if schema is referenced by other schemas it still can be removed as other schemas have local references. removeSchema(schemaKeyRef) { if (schemaKeyRef instanceof RegExp) { this._removeAllSchemas(this.schemas, schemaKeyRef); this._removeAllSchemas(this.refs, schemaKeyRef); return this; } switch (typeof schemaKeyRef) { case "undefined": this._removeAllSchemas(this.schemas); this._removeAllSchemas(this.refs); this._cache.clear(); return this; case "string": { const sch = getSchEnv.call(this, schemaKeyRef); if (typeof sch == "object") this._cache.delete(sch.schema); delete this.schemas[schemaKeyRef]; delete this.refs[schemaKeyRef]; return this; } case "object": { const cacheKey = schemaKeyRef; this._cache.delete(cacheKey); let id = schemaKeyRef[this.opts.schemaId]; if (id) { id = (0, resolve_1.normalizeId)(id); delete this.schemas[id]; delete this.refs[id]; } return this; } default: throw new Error("ajv.removeSchema: invalid parameter"); } } // add "vocabulary" - a collection of keywords addVocabulary(definitions) { for (const def of definitions) this.addKeyword(def); return this; } addKeyword(kwdOrDef, def // deprecated ) { let keyword; if (typeof kwdOrDef == "string") { keyword = kwdOrDef; if (typeof def == "object") { this.logger.warn("these parameters are deprecated, see docs for addKeyword"); def.keyword = keyword; } } else if (typeof kwdOrDef == "object" && def === undefined) { def = kwdOrDef; keyword = def.keyword; if (Array.isArray(keyword) && !keyword.length) { throw new Error("addKeywords: keyword must be string or non-empty array"); } } else { throw new Error("invalid addKeywords parameters"); } checkKeyword.call(this, keyword, def); if (!def) { (0, util_1.eachItem)(keyword, kwd => addRule.call(this, kwd)); return this; } keywordMetaschema.call(this, def); const definition = { ...def, type: (0, dataType_1.getJSONTypes)(def.type), schemaType: (0, dataType_1.getJSONTypes)(def.schemaType) }; (0, util_1.eachItem)(keyword, definition.type.length === 0 ? k => addRule.call(this, k, definition) : k => definition.type.forEach(t => addRule.call(this, k, definition, t))); return this; } getKeyword(keyword) { const rule = this.RULES.all[keyword]; return typeof rule == "object" ? rule.definition : !!rule; } // Remove keyword removeKeyword(keyword) { // TODO return type should be Ajv const { RULES } = this; delete RULES.keywords[keyword]; delete RULES.all[keyword]; for (const group of RULES.rules) { const i = group.rules.findIndex(rule => rule.keyword === keyword); if (i >= 0) group.rules.splice(i, 1); } return this; } // Add format addFormat(name, format) { if (typeof format == "string") format = new RegExp(format); this.formats[name] = format; return this; } errorsText(errors = this.errors, // optional array of validation errors { separator = ", ", dataVar = "data" } = {} // optional options with properties `separator` and `dataVar` ) { if (!errors || errors.length === 0) return "No errors"; return errors.map(e => `${dataVar}${e.instancePath} ${e.message}`).reduce((text, msg) => text + separator + msg); } $dataMetaSchema(metaSchema, keywordsJsonPointers) { const rules = this.RULES.all; metaSchema = JSON.parse(JSON.stringify(metaSchema)); for (const jsonPointer of keywordsJsonPointers) { const segments = jsonPointer.split("/").slice(1); // first segment is an empty string let keywords = metaSchema; for (const seg of segments) keywords = keywords[seg]; for (const key in rules) { const rule = rules[key]; if (typeof rule != "object") continue; const { $data } = rule.definition; const schema = keywords[key]; if ($data && schema) keywords[key] = schemaOrData(schema); } } return metaSchema; } _removeAllSchemas(schemas, regex) { for (const keyRef in schemas) { const sch = schemas[keyRef]; if (!regex || regex.test(keyRef)) { if (typeof sch == "string") { delete schemas[keyRef]; } else if (sch && !sch.meta) { this._cache.delete(sch.schema); delete schemas[keyRef]; } } } } _addSchema(schema, meta, baseId, validateSchema = this.opts.validateSchema, addSchema = this.opts.addUsedSchema) { let id; const { schemaId } = this.opts; if (typeof schema == "object") { id = schema[schemaId]; } else { if (this.opts.jtd) throw new Error("schema must be object");else if (typeof schema != "boolean") throw new Error("schema must be object or boolean"); } let sch = this._cache.get(schema); if (sch !== undefined) return sch; baseId = (0, resolve_1.normalizeId)(id || baseId); const localRefs = resolve_1.getSchemaRefs.call(this, schema, baseId); sch = new compile_1.SchemaEnv({ schema, schemaId, meta, baseId, localRefs }); this._cache.set(sch.schema, sch); if (addSchema && !baseId.startsWith("#")) { // TODO atm it is allowed to overwrite schemas without id (instead of not adding them) if (baseId) this._checkUnique(baseId); this.refs[baseId] = sch; } if (validateSchema) this.validateSchema(schema, true); return sch; } _checkUnique(id) { if (this.schemas[id] || this.refs[id]) { throw new Error(`schema with key or id "${id}" already exists`); } } _compileSchemaEnv(sch) { if (sch.meta) this._compileMetaSchema(sch);else compile_1.compileSchema.call(this, sch); /* istanbul ignore if */ if (!sch.validate) throw new Error("ajv implementation error"); return sch.validate; } _compileMetaSchema(sch) { const currentOpts = this.opts; this.opts = this._metaOpts; try { compile_1.compileSchema.call(this, sch); } finally { this.opts = currentOpts; } } } Ajv.ValidationError = validation_error_1.default; Ajv.MissingRefError = ref_error_1.default; exports["default"] = Ajv; function checkOptions(checkOpts, options, msg, log = "error") { for (const key in checkOpts) { const opt = key; if (opt in options) this.logger[log](`${msg}: option ${key}. ${checkOpts[opt]}`); } } function getSchEnv(keyRef) { keyRef = (0, resolve_1.normalizeId)(keyRef); // TODO tests fail without this line return this.schemas[keyRef] || this.refs[keyRef]; } function addInitialSchemas() { const optsSchemas = this.opts.schemas; if (!optsSchemas) return; if (Array.isArray(optsSchemas)) this.addSchema(optsSchemas);else for (const key in optsSchemas) this.addSchema(optsSchemas[key], key); } function addInitialFormats() { for (const name in this.opts.formats) { const format = this.opts.formats[name]; if (format) this.addFormat(name, format); } } function addInitialKeywords(defs) { if (Array.isArray(defs)) { this.addVocabulary(defs); return; } this.logger.warn("keywords option as map is deprecated, pass array"); for (const keyword in defs) { const def = defs[keyword]; if (!def.keyword) def.keyword = keyword; this.addKeyword(def); } } function getMetaSchemaOptions() { const metaOpts = { ...this.opts }; for (const opt of META_IGNORE_OPTIONS) delete metaOpts[opt]; return metaOpts; } const noLogs = { log() {}, warn() {}, error() {} }; function getLogger(logger) { if (logger === false) return noLogs; if (logger === undefined) return console; if (logger.log && logger.warn && logger.error) return logger; throw new Error("logger must implement log, warn and error methods"); } const KEYWORD_NAME = /^[a-z_$][a-z0-9_$:-]*$/i; function checkKeyword(keyword, def) { const { RULES } = this; (0, util_1.eachItem)(keyword, kwd => { if (RULES.keywords[kwd]) throw new Error(`Keyword ${kwd} is already defined`); if (!KEYWORD_NAME.test(kwd)) throw new Error(`Keyword ${kwd} has invalid name`); }); if (!def) return; if (def.$data && !("code" in def || "validate" in def)) { throw new Error('$data keyword must have "code" or "validate" function'); } } function addRule(keyword, definition, dataType) { var _a; const post = definition === null || definition === void 0 ? void 0 : definition.post; if (dataType && post) throw new Error('keyword with "post" flag cannot have "type"'); const { RULES } = this; let ruleGroup = post ? RULES.post : RULES.rules.find(({ type: t }) => t === dataType); if (!ruleGroup) { ruleGroup = { type: dataType, rules: [] }; RULES.rules.push(ruleGroup); } RULES.keywords[keyword] = true; if (!definition) return; const rule = { keyword, definition: { ...definition, type: (0, dataType_1.getJSONTypes)(definition.type), schemaType: (0, dataType_1.getJSONTypes)(definition.schemaType) } }; if (definition.before) addBeforeRule.call(this, ruleGroup, rule, definition.before);else ruleGroup.rules.push(rule); RULES.all[keyword] = rule; (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach(kwd => this.addKeyword(kwd)); } function addBeforeRule(ruleGroup, rule, before) { const i = ruleGroup.rules.findIndex(_rule => _rule.keyword === before); if (i >= 0) { ruleGroup.rules.splice(i, 0, rule); } else { ruleGroup.rules.push(rule); this.logger.warn(`rule ${before} is not defined`); } } function keywordMetaschema(def) { let { metaSchema } = def; if (metaSchema === undefined) return; if (def.$data && this.opts.$data) metaSchema = schemaOrData(metaSchema); def.validateSchema = this.compile(metaSchema, true); } const $dataRef = { $ref: "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#" }; function schemaOrData(schema) { return { anyOf: [schema, $dataRef] }; } /***/ }, /***/ 12599 /*!******************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/runtime/equal.js ***! \******************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); // https://github.com/ajv-validator/ajv/issues/889 const equal = __webpack_require__(/*! fast-deep-equal */ 33778); equal.code = 'require("ajv/dist/runtime/equal").default'; exports["default"] = equal; /***/ }, /***/ 5174 /*!***********************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/runtime/ucs2length.js ***! \***********************************************************************/ (__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); // https://mathiasbynens.be/notes/javascript-encoding // https://github.com/bestiejs/punycode.js - punycode.ucs2.decode function ucs2length(str) { const len = str.length; let length = 0; let pos = 0; let value; while (pos < len) { length++; value = str.charCodeAt(pos++); if (value >= 0xd800 && value <= 0xdbff && pos < len) { // high surrogate, and there is a next character value = str.charCodeAt(pos); if ((value & 0xfc00) === 0xdc00) pos++; // low surrogate } } return length; } exports["default"] = ucs2length; ucs2length.code = 'require("ajv/dist/runtime/ucs2length").default'; /***/ }, /***/ 97437 /*!****************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/runtime/uri.js ***! \****************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const uri = __webpack_require__(/*! fast-uri */ 12692); uri.code = 'require("ajv/dist/runtime/uri").default'; exports["default"] = uri; /***/ }, /***/ 32669 /*!*****************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/runtime/validation_error.js ***! \*****************************************************************************/ (__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); class ValidationError extends Error { constructor(errors) { super("validation failed"); this.errors = errors; this.ajv = this.validation = true; } } exports["default"] = ValidationError; /***/ }, /***/ 83400 /*!********************************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js ***! \********************************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.validateAdditionalItems = void 0; const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const error = { message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`, params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}` }; const def = { keyword: "additionalItems", type: "array", schemaType: ["boolean", "object"], before: "uniqueItems", error, code(cxt) { const { parentSchema, it } = cxt; const { items } = parentSchema; if (!Array.isArray(items)) { (0, util_1.checkStrictMode)(it, '"additionalItems" is ignored when "items" is not an array of schemas'); return; } validateAdditionalItems(cxt, items); } }; function validateAdditionalItems(cxt, items) { const { gen, schema, data, keyword, it } = cxt; it.items = true; const len = gen.const("len", (0, codegen_1._)`${data}.length`); if (schema === false) { cxt.setParams({ len: items.length }); cxt.pass((0, codegen_1._)`${len} <= ${items.length}`); } else if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) { const valid = gen.var("valid", (0, codegen_1._)`${len} <= ${items.length}`); // TODO var gen.if((0, codegen_1.not)(valid), () => validateItems(valid)); cxt.ok(valid); } function validateItems(valid) { gen.forRange("i", items.length, len, i => { cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid); if (!it.allErrors) gen.if((0, codegen_1.not)(valid), () => gen.break()); }); } } exports.validateAdditionalItems = validateAdditionalItems; exports["default"] = def; /***/ }, /***/ 7935 /*!*************************************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js ***! \*************************************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const code_1 = __webpack_require__(/*! ../code */ 57572); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const names_1 = __webpack_require__(/*! ../../compile/names */ 17862); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const error = { message: "must NOT have additional properties", params: ({ params }) => (0, codegen_1._)`{additionalProperty: ${params.additionalProperty}}` }; const def = { keyword: "additionalProperties", type: ["object"], schemaType: ["boolean", "object"], allowUndefined: true, trackErrors: true, error, code(cxt) { const { gen, schema, parentSchema, data, errsCount, it } = cxt; /* istanbul ignore if */ if (!errsCount) throw new Error("ajv implementation error"); const { allErrors, opts } = it; it.props = true; if (opts.removeAdditional !== "all" && (0, util_1.alwaysValidSchema)(it, schema)) return; const props = (0, code_1.allSchemaProperties)(parentSchema.properties); const patProps = (0, code_1.allSchemaProperties)(parentSchema.patternProperties); checkAdditionalProperties(); cxt.ok((0, codegen_1._)`${errsCount} === ${names_1.default.errors}`); function checkAdditionalProperties() { gen.forIn("key", data, key => { if (!props.length && !patProps.length) additionalPropertyCode(key);else gen.if(isAdditional(key), () => additionalPropertyCode(key)); }); } function isAdditional(key) { let definedProp; if (props.length > 8) { // TODO maybe an option instead of hard-coded 8? const propsSchema = (0, util_1.schemaRefOrVal)(it, parentSchema.properties, "properties"); definedProp = (0, code_1.isOwnProperty)(gen, propsSchema, key); } else if (props.length) { definedProp = (0, codegen_1.or)(...props.map(p => (0, codegen_1._)`${key} === ${p}`)); } else { definedProp = codegen_1.nil; } if (patProps.length) { definedProp = (0, codegen_1.or)(definedProp, ...patProps.map(p => (0, codegen_1._)`${(0, code_1.usePattern)(cxt, p)}.test(${key})`)); } return (0, codegen_1.not)(definedProp); } function deleteAdditional(key) { gen.code((0, codegen_1._)`delete ${data}[${key}]`); } function additionalPropertyCode(key) { if (opts.removeAdditional === "all" || opts.removeAdditional && schema === false) { deleteAdditional(key); return; } if (schema === false) { cxt.setParams({ additionalProperty: key }); cxt.error(); if (!allErrors) gen.break(); return; } if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) { const valid = gen.name("valid"); if (opts.removeAdditional === "failing") { applyAdditionalSchema(key, valid, false); gen.if((0, codegen_1.not)(valid), () => { cxt.reset(); deleteAdditional(key); }); } else { applyAdditionalSchema(key, valid); if (!allErrors) gen.if((0, codegen_1.not)(valid), () => gen.break()); } } } function applyAdditionalSchema(key, valid, errors) { const subschema = { keyword: "additionalProperties", dataProp: key, dataPropType: util_1.Type.Str }; if (errors === false) { Object.assign(subschema, { compositeRule: true, createErrors: false, allErrors: false }); } cxt.subschema(subschema, valid); } } }; exports["default"] = def; /***/ }, /***/ 58117 /*!**********************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/applicator/allOf.js ***! \**********************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const def = { keyword: "allOf", schemaType: "array", code(cxt) { const { gen, schema, it } = cxt; /* istanbul ignore if */ if (!Array.isArray(schema)) throw new Error("ajv implementation error"); const valid = gen.name("valid"); schema.forEach((sch, i) => { if ((0, util_1.alwaysValidSchema)(it, sch)) return; const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid); cxt.ok(valid); cxt.mergeEvaluated(schCxt); }); } }; exports["default"] = def; /***/ }, /***/ 18852 /*!**********************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/applicator/anyOf.js ***! \**********************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const code_1 = __webpack_require__(/*! ../code */ 57572); const def = { keyword: "anyOf", schemaType: "array", trackErrors: true, code: code_1.validateUnion, error: { message: "must match a schema in anyOf" } }; exports["default"] = def; /***/ }, /***/ 41782 /*!*************************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/applicator/contains.js ***! \*************************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const error = { message: ({ params: { min, max } }) => max === undefined ? (0, codegen_1.str)`must contain at least ${min} valid item(s)` : (0, codegen_1.str)`must contain at least ${min} and no more than ${max} valid item(s)`, params: ({ params: { min, max } }) => max === undefined ? (0, codegen_1._)`{minContains: ${min}}` : (0, codegen_1._)`{minContains: ${min}, maxContains: ${max}}` }; const def = { keyword: "contains", type: "array", schemaType: ["object", "boolean"], before: "uniqueItems", trackErrors: true, error, code(cxt) { const { gen, schema, parentSchema, data, it } = cxt; let min; let max; const { minContains, maxContains } = parentSchema; if (it.opts.next) { min = minContains === undefined ? 1 : minContains; max = maxContains; } else { min = 1; } const len = gen.const("len", (0, codegen_1._)`${data}.length`); cxt.setParams({ min, max }); if (max === undefined && min === 0) { (0, util_1.checkStrictMode)(it, `"minContains" == 0 without "maxContains": "contains" keyword ignored`); return; } if (max !== undefined && min > max) { (0, util_1.checkStrictMode)(it, `"minContains" > "maxContains" is always invalid`); cxt.fail(); return; } if ((0, util_1.alwaysValidSchema)(it, schema)) { let cond = (0, codegen_1._)`${len} >= ${min}`; if (max !== undefined) cond = (0, codegen_1._)`${cond} && ${len} <= ${max}`; cxt.pass(cond); return; } it.items = true; const valid = gen.name("valid"); if (max === undefined && min === 1) { validateItems(valid, () => gen.if(valid, () => gen.break())); } else if (min === 0) { gen.let(valid, true); if (max !== undefined) gen.if((0, codegen_1._)`${data}.length > 0`, validateItemsWithCount); } else { gen.let(valid, false); validateItemsWithCount(); } cxt.result(valid, () => cxt.reset()); function validateItemsWithCount() { const schValid = gen.name("_valid"); const count = gen.let("count", 0); validateItems(schValid, () => gen.if(schValid, () => checkLimits(count))); } function validateItems(_valid, block) { gen.forRange("i", 0, len, i => { cxt.subschema({ keyword: "contains", dataProp: i, dataPropType: util_1.Type.Num, compositeRule: true }, _valid); block(); }); } function checkLimits(count) { gen.code((0, codegen_1._)`${count}++`); if (max === undefined) { gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true).break()); } else { gen.if((0, codegen_1._)`${count} > ${max}`, () => gen.assign(valid, false).break()); if (min === 1) gen.assign(valid, true);else gen.if((0, codegen_1._)`${count} >= ${min}`, () => gen.assign(valid, true)); } } } }; exports["default"] = def; /***/ }, /***/ 9394 /*!*****************************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/applicator/dependencies.js ***! \*****************************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.validateSchemaDeps = exports.validatePropertyDeps = exports.error = void 0; const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const code_1 = __webpack_require__(/*! ../code */ 57572); exports.error = { message: ({ params: { property, depsCount, deps } }) => { const property_ies = depsCount === 1 ? "property" : "properties"; return (0, codegen_1.str)`must have ${property_ies} ${deps} when property ${property} is present`; }, params: ({ params: { property, depsCount, deps, missingProperty } }) => (0, codegen_1._)`{property: ${property}, missingProperty: ${missingProperty}, depsCount: ${depsCount}, deps: ${deps}}` // TODO change to reference }; const def = { keyword: "dependencies", type: "object", schemaType: "object", error: exports.error, code(cxt) { const [propDeps, schDeps] = splitDependencies(cxt); validatePropertyDeps(cxt, propDeps); validateSchemaDeps(cxt, schDeps); } }; function splitDependencies({ schema }) { const propertyDeps = {}; const schemaDeps = {}; for (const key in schema) { if (key === "__proto__") continue; const deps = Array.isArray(schema[key]) ? propertyDeps : schemaDeps; deps[key] = schema[key]; } return [propertyDeps, schemaDeps]; } function validatePropertyDeps(cxt, propertyDeps = cxt.schema) { const { gen, data, it } = cxt; if (Object.keys(propertyDeps).length === 0) return; const missing = gen.let("missing"); for (const prop in propertyDeps) { const deps = propertyDeps[prop]; if (deps.length === 0) continue; const hasProperty = (0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties); cxt.setParams({ property: prop, depsCount: deps.length, deps: deps.join(", ") }); if (it.allErrors) { gen.if(hasProperty, () => { for (const depProp of deps) { (0, code_1.checkReportMissingProp)(cxt, depProp); } }); } else { gen.if((0, codegen_1._)`${hasProperty} && (${(0, code_1.checkMissingProp)(cxt, deps, missing)})`); (0, code_1.reportMissingProp)(cxt, missing); gen.else(); } } } exports.validatePropertyDeps = validatePropertyDeps; function validateSchemaDeps(cxt, schemaDeps = cxt.schema) { const { gen, data, keyword, it } = cxt; const valid = gen.name("valid"); for (const prop in schemaDeps) { if ((0, util_1.alwaysValidSchema)(it, schemaDeps[prop])) continue; gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties), () => { const schCxt = cxt.subschema({ keyword, schemaProp: prop }, valid); cxt.mergeValidEvaluated(schCxt, valid); }, () => gen.var(valid, true) // TODO var ); cxt.ok(valid); } } exports.validateSchemaDeps = validateSchemaDeps; exports["default"] = def; /***/ }, /***/ 76968 /*!*******************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/applicator/if.js ***! \*******************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const error = { message: ({ params }) => (0, codegen_1.str)`must match "${params.ifClause}" schema`, params: ({ params }) => (0, codegen_1._)`{failingKeyword: ${params.ifClause}}` }; const def = { keyword: "if", schemaType: ["object", "boolean"], trackErrors: true, error, code(cxt) { const { gen, parentSchema, it } = cxt; if (parentSchema.then === undefined && parentSchema.else === undefined) { (0, util_1.checkStrictMode)(it, '"if" without "then" and "else" is ignored'); } const hasThen = hasSchema(it, "then"); const hasElse = hasSchema(it, "else"); if (!hasThen && !hasElse) return; const valid = gen.let("valid", true); const schValid = gen.name("_valid"); validateIf(); cxt.reset(); if (hasThen && hasElse) { const ifClause = gen.let("ifClause"); cxt.setParams({ ifClause }); gen.if(schValid, validateClause("then", ifClause), validateClause("else", ifClause)); } else if (hasThen) { gen.if(schValid, validateClause("then")); } else { gen.if((0, codegen_1.not)(schValid), validateClause("else")); } cxt.pass(valid, () => cxt.error(true)); function validateIf() { const schCxt = cxt.subschema({ keyword: "if", compositeRule: true, createErrors: false, allErrors: false }, schValid); cxt.mergeEvaluated(schCxt); } function validateClause(keyword, ifClause) { return () => { const schCxt = cxt.subschema({ keyword }, schValid); gen.assign(valid, schValid); cxt.mergeValidEvaluated(schCxt, valid); if (ifClause) gen.assign(ifClause, (0, codegen_1._)`${keyword}`);else cxt.setParams({ ifClause: keyword }); }; } } }; function hasSchema(it, keyword) { const schema = it.schema[keyword]; return schema !== undefined && !(0, util_1.alwaysValidSchema)(it, schema); } exports["default"] = def; /***/ }, /***/ 39911 /*!**********************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/applicator/index.js ***! \**********************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const additionalItems_1 = __webpack_require__(/*! ./additionalItems */ 83400); const prefixItems_1 = __webpack_require__(/*! ./prefixItems */ 24259); const items_1 = __webpack_require__(/*! ./items */ 21615); const items2020_1 = __webpack_require__(/*! ./items2020 */ 8959); const contains_1 = __webpack_require__(/*! ./contains */ 41782); const dependencies_1 = __webpack_require__(/*! ./dependencies */ 9394); const propertyNames_1 = __webpack_require__(/*! ./propertyNames */ 95692); const additionalProperties_1 = __webpack_require__(/*! ./additionalProperties */ 7935); const properties_1 = __webpack_require__(/*! ./properties */ 34346); const patternProperties_1 = __webpack_require__(/*! ./patternProperties */ 4872); const not_1 = __webpack_require__(/*! ./not */ 85790); const anyOf_1 = __webpack_require__(/*! ./anyOf */ 18852); const oneOf_1 = __webpack_require__(/*! ./oneOf */ 61882); const allOf_1 = __webpack_require__(/*! ./allOf */ 58117); const if_1 = __webpack_require__(/*! ./if */ 76968); const thenElse_1 = __webpack_require__(/*! ./thenElse */ 3085); function getApplicator(draft2020 = false) { const applicator = [ // any not_1.default, anyOf_1.default, oneOf_1.default, allOf_1.default, if_1.default, thenElse_1.default, // object propertyNames_1.default, additionalProperties_1.default, dependencies_1.default, properties_1.default, patternProperties_1.default]; // array if (draft2020) applicator.push(prefixItems_1.default, items2020_1.default);else applicator.push(additionalItems_1.default, items_1.default); applicator.push(contains_1.default); return applicator; } exports["default"] = getApplicator; /***/ }, /***/ 21615 /*!**********************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/applicator/items.js ***! \**********************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.validateTuple = void 0; const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const code_1 = __webpack_require__(/*! ../code */ 57572); const def = { keyword: "items", type: "array", schemaType: ["object", "array", "boolean"], before: "uniqueItems", code(cxt) { const { schema, it } = cxt; if (Array.isArray(schema)) return validateTuple(cxt, "additionalItems", schema); it.items = true; if ((0, util_1.alwaysValidSchema)(it, schema)) return; cxt.ok((0, code_1.validateArray)(cxt)); } }; function validateTuple(cxt, extraItems, schArr = cxt.schema) { const { gen, parentSchema, data, keyword, it } = cxt; checkStrictTuple(parentSchema); if (it.opts.unevaluated && schArr.length && it.items !== true) { it.items = util_1.mergeEvaluated.items(gen, schArr.length, it.items); } const valid = gen.name("valid"); const len = gen.const("len", (0, codegen_1._)`${data}.length`); schArr.forEach((sch, i) => { if ((0, util_1.alwaysValidSchema)(it, sch)) return; gen.if((0, codegen_1._)`${len} > ${i}`, () => cxt.subschema({ keyword, schemaProp: i, dataProp: i }, valid)); cxt.ok(valid); }); function checkStrictTuple(sch) { const { opts, errSchemaPath } = it; const l = schArr.length; const fullTuple = l === sch.minItems && (l === sch.maxItems || sch[extraItems] === false); if (opts.strictTuples && !fullTuple) { const msg = `"${keyword}" is ${l}-tuple, but minItems or maxItems/${extraItems} are not specified or different at path "${errSchemaPath}"`; (0, util_1.checkStrictMode)(it, msg, opts.strictTuples); } } } exports.validateTuple = validateTuple; exports["default"] = def; /***/ }, /***/ 8959 /*!**************************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/applicator/items2020.js ***! \**************************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const code_1 = __webpack_require__(/*! ../code */ 57572); const additionalItems_1 = __webpack_require__(/*! ./additionalItems */ 83400); const error = { message: ({ params: { len } }) => (0, codegen_1.str)`must NOT have more than ${len} items`, params: ({ params: { len } }) => (0, codegen_1._)`{limit: ${len}}` }; const def = { keyword: "items", type: "array", schemaType: ["object", "boolean"], before: "uniqueItems", error, code(cxt) { const { schema, parentSchema, it } = cxt; const { prefixItems } = parentSchema; it.items = true; if ((0, util_1.alwaysValidSchema)(it, schema)) return; if (prefixItems) (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems);else cxt.ok((0, code_1.validateArray)(cxt)); } }; exports["default"] = def; /***/ }, /***/ 85790 /*!********************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/applicator/not.js ***! \********************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const def = { keyword: "not", schemaType: ["object", "boolean"], trackErrors: true, code(cxt) { const { gen, schema, it } = cxt; if ((0, util_1.alwaysValidSchema)(it, schema)) { cxt.fail(); return; } const valid = gen.name("valid"); cxt.subschema({ keyword: "not", compositeRule: true, createErrors: false, allErrors: false }, valid); cxt.failResult(valid, () => cxt.reset(), () => cxt.error()); }, error: { message: "must NOT be valid" } }; exports["default"] = def; /***/ }, /***/ 61882 /*!**********************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/applicator/oneOf.js ***! \**********************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const error = { message: "must match exactly one schema in oneOf", params: ({ params }) => (0, codegen_1._)`{passingSchemas: ${params.passing}}` }; const def = { keyword: "oneOf", schemaType: "array", trackErrors: true, error, code(cxt) { const { gen, schema, parentSchema, it } = cxt; /* istanbul ignore if */ if (!Array.isArray(schema)) throw new Error("ajv implementation error"); if (it.opts.discriminator && parentSchema.discriminator) return; const schArr = schema; const valid = gen.let("valid", false); const passing = gen.let("passing", null); const schValid = gen.name("_valid"); cxt.setParams({ passing }); // TODO possibly fail straight away (with warning or exception) if there are two empty always valid schemas gen.block(validateOneOf); cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); function validateOneOf() { schArr.forEach((sch, i) => { let schCxt; if ((0, util_1.alwaysValidSchema)(it, sch)) { gen.var(schValid, true); } else { schCxt = cxt.subschema({ keyword: "oneOf", schemaProp: i, compositeRule: true }, schValid); } if (i > 0) { gen.if((0, codegen_1._)`${schValid} && ${valid}`).assign(valid, false).assign(passing, (0, codegen_1._)`[${passing}, ${i}]`).else(); } gen.if(schValid, () => { gen.assign(valid, true); gen.assign(passing, i); if (schCxt) cxt.mergeEvaluated(schCxt, codegen_1.Name); }); }); } } }; exports["default"] = def; /***/ }, /***/ 4872 /*!**********************************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js ***! \**********************************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const code_1 = __webpack_require__(/*! ../code */ 57572); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const util_2 = __webpack_require__(/*! ../../compile/util */ 1776); const def = { keyword: "patternProperties", type: "object", schemaType: "object", code(cxt) { const { gen, schema, data, parentSchema, it } = cxt; const { opts } = it; const patterns = (0, code_1.allSchemaProperties)(schema); const alwaysValidPatterns = patterns.filter(p => (0, util_1.alwaysValidSchema)(it, schema[p])); if (patterns.length === 0 || alwaysValidPatterns.length === patterns.length && (!it.opts.unevaluated || it.props === true)) { return; } const checkProperties = opts.strictSchema && !opts.allowMatchingProperties && parentSchema.properties; const valid = gen.name("valid"); if (it.props !== true && !(it.props instanceof codegen_1.Name)) { it.props = (0, util_2.evaluatedPropsToName)(gen, it.props); } const { props } = it; validatePatternProperties(); function validatePatternProperties() { for (const pat of patterns) { if (checkProperties) checkMatchingProperties(pat); if (it.allErrors) { validateProperties(pat); } else { gen.var(valid, true); // TODO var validateProperties(pat); gen.if(valid); } } } function checkMatchingProperties(pat) { for (const prop in checkProperties) { if (new RegExp(pat).test(prop)) { (0, util_1.checkStrictMode)(it, `property ${prop} matches pattern ${pat} (use allowMatchingProperties)`); } } } function validateProperties(pat) { gen.forIn("key", data, key => { gen.if((0, codegen_1._)`${(0, code_1.usePattern)(cxt, pat)}.test(${key})`, () => { const alwaysValid = alwaysValidPatterns.includes(pat); if (!alwaysValid) { cxt.subschema({ keyword: "patternProperties", schemaProp: pat, dataProp: key, dataPropType: util_2.Type.Str }, valid); } if (it.opts.unevaluated && props !== true) { gen.assign((0, codegen_1._)`${props}[${key}]`, true); } else if (!alwaysValid && !it.allErrors) { // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false) // or if all properties were evaluated (props === true) gen.if((0, codegen_1.not)(valid), () => gen.break()); } }); }); } } }; exports["default"] = def; /***/ }, /***/ 24259 /*!****************************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js ***! \****************************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const items_1 = __webpack_require__(/*! ./items */ 21615); const def = { keyword: "prefixItems", type: "array", schemaType: ["array"], before: "uniqueItems", code: cxt => (0, items_1.validateTuple)(cxt, "items") }; exports["default"] = def; /***/ }, /***/ 34346 /*!***************************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/applicator/properties.js ***! \***************************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const validate_1 = __webpack_require__(/*! ../../compile/validate */ 80137); const code_1 = __webpack_require__(/*! ../code */ 57572); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const additionalProperties_1 = __webpack_require__(/*! ./additionalProperties */ 7935); const def = { keyword: "properties", type: "object", schemaType: "object", code(cxt) { const { gen, schema, parentSchema, data, it } = cxt; if (it.opts.removeAdditional === "all" && parentSchema.additionalProperties === undefined) { additionalProperties_1.default.code(new validate_1.KeywordCxt(it, additionalProperties_1.default, "additionalProperties")); } const allProps = (0, code_1.allSchemaProperties)(schema); for (const prop of allProps) { it.definedProperties.add(prop); } if (it.opts.unevaluated && allProps.length && it.props !== true) { it.props = util_1.mergeEvaluated.props(gen, (0, util_1.toHash)(allProps), it.props); } const properties = allProps.filter(p => !(0, util_1.alwaysValidSchema)(it, schema[p])); if (properties.length === 0) return; const valid = gen.name("valid"); for (const prop of properties) { if (hasDefault(prop)) { applyPropertySchema(prop); } else { gen.if((0, code_1.propertyInData)(gen, data, prop, it.opts.ownProperties)); applyPropertySchema(prop); if (!it.allErrors) gen.else().var(valid, true); gen.endIf(); } cxt.it.definedProperties.add(prop); cxt.ok(valid); } function hasDefault(prop) { return it.opts.useDefaults && !it.compositeRule && schema[prop].default !== undefined; } function applyPropertySchema(prop) { cxt.subschema({ keyword: "properties", schemaProp: prop, dataProp: prop }, valid); } } }; exports["default"] = def; /***/ }, /***/ 95692 /*!******************************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js ***! \******************************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const error = { message: "property name must be valid", params: ({ params }) => (0, codegen_1._)`{propertyName: ${params.propertyName}}` }; const def = { keyword: "propertyNames", type: "object", schemaType: ["object", "boolean"], error, code(cxt) { const { gen, schema, data, it } = cxt; if ((0, util_1.alwaysValidSchema)(it, schema)) return; const valid = gen.name("valid"); gen.forIn("key", data, key => { cxt.setParams({ propertyName: key }); cxt.subschema({ keyword: "propertyNames", data: key, dataTypes: ["string"], propertyName: key, compositeRule: true }, valid); gen.if((0, codegen_1.not)(valid), () => { cxt.error(true); if (!it.allErrors) gen.break(); }); }); cxt.ok(valid); } }; exports["default"] = def; /***/ }, /***/ 3085 /*!*************************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/applicator/thenElse.js ***! \*************************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const def = { keyword: ["then", "else"], schemaType: ["object", "boolean"], code({ keyword, parentSchema, it }) { if (parentSchema.if === undefined) (0, util_1.checkStrictMode)(it, `"${keyword}" without "if" is ignored`); } }; exports["default"] = def; /***/ }, /***/ 57572 /*!**********************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/code.js ***! \**********************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.validateUnion = exports.validateArray = exports.usePattern = exports.callValidateCode = exports.schemaProperties = exports.allSchemaProperties = exports.noPropertyInData = exports.propertyInData = exports.isOwnProperty = exports.hasPropFunc = exports.reportMissingProp = exports.checkMissingProp = exports.checkReportMissingProp = void 0; const codegen_1 = __webpack_require__(/*! ../compile/codegen */ 59164); const util_1 = __webpack_require__(/*! ../compile/util */ 1776); const names_1 = __webpack_require__(/*! ../compile/names */ 17862); const util_2 = __webpack_require__(/*! ../compile/util */ 1776); function checkReportMissingProp(cxt, prop) { const { gen, data, it } = cxt; gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => { cxt.setParams({ missingProperty: (0, codegen_1._)`${prop}` }, true); cxt.error(); }); } exports.checkReportMissingProp = checkReportMissingProp; function checkMissingProp({ gen, data, it: { opts } }, properties, missing) { return (0, codegen_1.or)(...properties.map(prop => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._)`${missing} = ${prop}`))); } exports.checkMissingProp = checkMissingProp; function reportMissingProp(cxt, missing) { cxt.setParams({ missingProperty: missing }, true); cxt.error(); } exports.reportMissingProp = reportMissingProp; function hasPropFunc(gen) { return gen.scopeValue("func", { // eslint-disable-next-line @typescript-eslint/unbound-method ref: Object.prototype.hasOwnProperty, code: (0, codegen_1._)`Object.prototype.hasOwnProperty` }); } exports.hasPropFunc = hasPropFunc; function isOwnProperty(gen, data, property) { return (0, codegen_1._)`${hasPropFunc(gen)}.call(${data}, ${property})`; } exports.isOwnProperty = isOwnProperty; function propertyInData(gen, data, property, ownProperties) { const cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} !== undefined`; return ownProperties ? (0, codegen_1._)`${cond} && ${isOwnProperty(gen, data, property)}` : cond; } exports.propertyInData = propertyInData; function noPropertyInData(gen, data, property, ownProperties) { const cond = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(property)} === undefined`; return ownProperties ? (0, codegen_1.or)(cond, (0, codegen_1.not)(isOwnProperty(gen, data, property))) : cond; } exports.noPropertyInData = noPropertyInData; function allSchemaProperties(schemaMap) { return schemaMap ? Object.keys(schemaMap).filter(p => p !== "__proto__") : []; } exports.allSchemaProperties = allSchemaProperties; function schemaProperties(it, schemaMap) { return allSchemaProperties(schemaMap).filter(p => !(0, util_1.alwaysValidSchema)(it, schemaMap[p])); } exports.schemaProperties = schemaProperties; function callValidateCode({ schemaCode, data, it: { gen, topSchemaRef, schemaPath, errorPath }, it }, func, context, passSchema) { const dataAndSchema = passSchema ? (0, codegen_1._)`${schemaCode}, ${data}, ${topSchemaRef}${schemaPath}` : data; const valCxt = [[names_1.default.instancePath, (0, codegen_1.strConcat)(names_1.default.instancePath, errorPath)], [names_1.default.parentData, it.parentData], [names_1.default.parentDataProperty, it.parentDataProperty], [names_1.default.rootData, names_1.default.rootData]]; if (it.opts.dynamicRef) valCxt.push([names_1.default.dynamicAnchors, names_1.default.dynamicAnchors]); const args = (0, codegen_1._)`${dataAndSchema}, ${gen.object(...valCxt)}`; return context !== codegen_1.nil ? (0, codegen_1._)`${func}.call(${context}, ${args})` : (0, codegen_1._)`${func}(${args})`; } exports.callValidateCode = callValidateCode; const newRegExp = (0, codegen_1._)`new RegExp`; function usePattern({ gen, it: { opts } }, pattern) { const u = opts.unicodeRegExp ? "u" : ""; const { regExp } = opts.code; const rx = regExp(pattern, u); return gen.scopeValue("pattern", { key: rx.toString(), ref: rx, code: (0, codegen_1._)`${regExp.code === "new RegExp" ? newRegExp : (0, util_2.useFunc)(gen, regExp)}(${pattern}, ${u})` }); } exports.usePattern = usePattern; function validateArray(cxt) { const { gen, data, keyword, it } = cxt; const valid = gen.name("valid"); if (it.allErrors) { const validArr = gen.let("valid", true); validateItems(() => gen.assign(validArr, false)); return validArr; } gen.var(valid, true); validateItems(() => gen.break()); return valid; function validateItems(notValid) { const len = gen.const("len", (0, codegen_1._)`${data}.length`); gen.forRange("i", 0, len, i => { cxt.subschema({ keyword, dataProp: i, dataPropType: util_1.Type.Num }, valid); gen.if((0, codegen_1.not)(valid), notValid); }); } } exports.validateArray = validateArray; function validateUnion(cxt) { const { gen, schema, keyword, it } = cxt; /* istanbul ignore if */ if (!Array.isArray(schema)) throw new Error("ajv implementation error"); const alwaysValid = schema.some(sch => (0, util_1.alwaysValidSchema)(it, sch)); if (alwaysValid && !it.opts.unevaluated) return; const valid = gen.let("valid", false); const schValid = gen.name("_valid"); gen.block(() => schema.forEach((_sch, i) => { const schCxt = cxt.subschema({ keyword, schemaProp: i, compositeRule: true }, schValid); gen.assign(valid, (0, codegen_1._)`${valid} || ${schValid}`); const merged = cxt.mergeValidEvaluated(schCxt, schValid); // can short-circuit if `unevaluatedProperties/Items` not supported (opts.unevaluated !== true) // or if all properties and items were evaluated (it.props === true && it.items === true) if (!merged) gen.if((0, codegen_1.not)(valid)); })); cxt.result(valid, () => cxt.reset(), () => cxt.error(true)); } exports.validateUnion = validateUnion; /***/ }, /***/ 15216 /*!*************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/core/id.js ***! \*************************************************************************/ (__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const def = { keyword: "id", code() { throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID'); } }; exports["default"] = def; /***/ }, /***/ 37525 /*!****************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/core/index.js ***! \****************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const id_1 = __webpack_require__(/*! ./id */ 15216); const ref_1 = __webpack_require__(/*! ./ref */ 88420); const core = ["$schema", "$id", "$defs", "$vocabulary", { keyword: "$comment" }, "definitions", id_1.default, ref_1.default]; exports["default"] = core; /***/ }, /***/ 88420 /*!**************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/core/ref.js ***! \**************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.callRef = exports.getValidate = void 0; const ref_error_1 = __webpack_require__(/*! ../../compile/ref_error */ 82602); const code_1 = __webpack_require__(/*! ../code */ 57572); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const names_1 = __webpack_require__(/*! ../../compile/names */ 17862); const compile_1 = __webpack_require__(/*! ../../compile */ 93406); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const def = { keyword: "$ref", schemaType: "string", code(cxt) { const { gen, schema: $ref, it } = cxt; const { baseId, schemaEnv: env, validateName, opts, self } = it; const { root } = env; if (($ref === "#" || $ref === "#/") && baseId === root.baseId) return callRootRef(); const schOrEnv = compile_1.resolveRef.call(self, root, baseId, $ref); if (schOrEnv === undefined) throw new ref_error_1.default(it.opts.uriResolver, baseId, $ref); if (schOrEnv instanceof compile_1.SchemaEnv) return callValidate(schOrEnv); return inlineRefSchema(schOrEnv); function callRootRef() { if (env === root) return callRef(cxt, validateName, env, env.$async); const rootName = gen.scopeValue("root", { ref: root }); return callRef(cxt, (0, codegen_1._)`${rootName}.validate`, root, root.$async); } function callValidate(sch) { const v = getValidate(cxt, sch); callRef(cxt, v, sch, sch.$async); } function inlineRefSchema(sch) { const schName = gen.scopeValue("schema", opts.code.source === true ? { ref: sch, code: (0, codegen_1.stringify)(sch) } : { ref: sch }); const valid = gen.name("valid"); const schCxt = cxt.subschema({ schema: sch, dataTypes: [], schemaPath: codegen_1.nil, topSchemaRef: schName, errSchemaPath: $ref }, valid); cxt.mergeEvaluated(schCxt); cxt.ok(valid); } } }; function getValidate(cxt, sch) { const { gen } = cxt; return sch.validate ? gen.scopeValue("validate", { ref: sch.validate }) : (0, codegen_1._)`${gen.scopeValue("wrapper", { ref: sch })}.validate`; } exports.getValidate = getValidate; function callRef(cxt, v, sch, $async) { const { gen, it } = cxt; const { allErrors, schemaEnv: env, opts } = it; const passCxt = opts.passContext ? names_1.default.this : codegen_1.nil; if ($async) callAsyncRef();else callSyncRef(); function callAsyncRef() { if (!env.$async) throw new Error("async schema referenced by sync schema"); const valid = gen.let("valid"); gen.try(() => { gen.code((0, codegen_1._)`await ${(0, code_1.callValidateCode)(cxt, v, passCxt)}`); addEvaluatedFrom(v); // TODO will not work with async, it has to be returned with the result if (!allErrors) gen.assign(valid, true); }, e => { gen.if((0, codegen_1._)`!(${e} instanceof ${it.ValidationError})`, () => gen.throw(e)); addErrorsFrom(e); if (!allErrors) gen.assign(valid, false); }); cxt.ok(valid); } function callSyncRef() { cxt.result((0, code_1.callValidateCode)(cxt, v, passCxt), () => addEvaluatedFrom(v), () => addErrorsFrom(v)); } function addErrorsFrom(source) { const errs = (0, codegen_1._)`${source}.errors`; gen.assign(names_1.default.vErrors, (0, codegen_1._)`${names_1.default.vErrors} === null ? ${errs} : ${names_1.default.vErrors}.concat(${errs})`); // TODO tagged gen.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`); } function addEvaluatedFrom(source) { var _a; if (!it.opts.unevaluated) return; const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated; // TODO refactor if (it.props !== true) { if (schEvaluated && !schEvaluated.dynamicProps) { if (schEvaluated.props !== undefined) { it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props); } } else { const props = gen.var("props", (0, codegen_1._)`${source}.evaluated.props`); it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name); } } if (it.items !== true) { if (schEvaluated && !schEvaluated.dynamicItems) { if (schEvaluated.items !== undefined) { it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items); } } else { const items = gen.var("items", (0, codegen_1._)`${source}.evaluated.items`); it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name); } } } } exports.callRef = callRef; exports["default"] = def; /***/ }, /***/ 31190 /*!*************************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/discriminator/index.js ***! \*************************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const types_1 = __webpack_require__(/*! ../discriminator/types */ 91819); const compile_1 = __webpack_require__(/*! ../../compile */ 93406); const ref_error_1 = __webpack_require__(/*! ../../compile/ref_error */ 82602); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const error = { message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag ? `tag "${tagName}" must be string` : `value of tag "${tagName}" must be in oneOf`, params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._)`{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}` }; const def = { keyword: "discriminator", type: "object", schemaType: "object", error, code(cxt) { const { gen, data, schema, parentSchema, it } = cxt; const { oneOf } = parentSchema; if (!it.opts.discriminator) { throw new Error("discriminator: requires discriminator option"); } const tagName = schema.propertyName; if (typeof tagName != "string") throw new Error("discriminator: requires propertyName"); if (schema.mapping) throw new Error("discriminator: mapping is not supported"); if (!oneOf) throw new Error("discriminator: requires oneOf keyword"); const valid = gen.let("valid", false); const tag = gen.const("tag", (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(tagName)}`); gen.if((0, codegen_1._)`typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName })); cxt.ok(valid); function validateMapping() { const mapping = getMapping(); gen.if(false); for (const tagValue in mapping) { gen.elseIf((0, codegen_1._)`${tag} === ${tagValue}`); gen.assign(valid, applyTagSchema(mapping[tagValue])); } gen.else(); cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName }); gen.endIf(); } function applyTagSchema(schemaProp) { const _valid = gen.name("valid"); const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid); cxt.mergeEvaluated(schCxt, codegen_1.Name); return _valid; } function getMapping() { var _a; const oneOfMapping = {}; const topRequired = hasRequired(parentSchema); let tagRequired = true; for (let i = 0; i < oneOf.length; i++) { let sch = oneOf[i]; if ((sch === null || sch === void 0 ? void 0 : sch.$ref) && !(0, util_1.schemaHasRulesButRef)(sch, it.self.RULES)) { const ref = sch.$ref; sch = compile_1.resolveRef.call(it.self, it.schemaEnv.root, it.baseId, ref); if (sch instanceof compile_1.SchemaEnv) sch = sch.schema; if (sch === undefined) throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref); } const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName]; if (typeof propSch != "object") { throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`); } tagRequired = tagRequired && (topRequired || hasRequired(sch)); addMappings(propSch, i); } if (!tagRequired) throw new Error(`discriminator: "${tagName}" must be required`); return oneOfMapping; function hasRequired({ required }) { return Array.isArray(required) && required.includes(tagName); } function addMappings(sch, i) { if (sch.const) { addMapping(sch.const, i); } else if (sch.enum) { for (const tagValue of sch.enum) { addMapping(tagValue, i); } } else { throw new Error(`discriminator: "properties/${tagName}" must have "const" or "enum"`); } } function addMapping(tagValue, i) { if (typeof tagValue != "string" || tagValue in oneOfMapping) { throw new Error(`discriminator: "${tagName}" values must be unique strings`); } oneOfMapping[tagValue] = i; } } } }; exports["default"] = def; /***/ }, /***/ 91819 /*!*************************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/discriminator/types.js ***! \*************************************************************************************/ (__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.DiscrError = void 0; var DiscrError; (function (DiscrError) { DiscrError["Tag"] = "tag"; DiscrError["Mapping"] = "mapping"; })(DiscrError || (exports.DiscrError = DiscrError = {})); /***/ }, /***/ 53765 /*!************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/draft7.js ***! \************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const core_1 = __webpack_require__(/*! ./core */ 37525); const validation_1 = __webpack_require__(/*! ./validation */ 95881); const applicator_1 = __webpack_require__(/*! ./applicator */ 39911); const format_1 = __webpack_require__(/*! ./format */ 62169); const metadata_1 = __webpack_require__(/*! ./metadata */ 21420); const draft7Vocabularies = [core_1.default, validation_1.default, (0, applicator_1.default)(), format_1.default, metadata_1.metadataVocabulary, metadata_1.contentVocabulary]; exports["default"] = draft7Vocabularies; /***/ }, /***/ 28162 /*!*******************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/format/format.js ***! \*******************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const error = { message: ({ schemaCode }) => (0, codegen_1.str)`must match format "${schemaCode}"`, params: ({ schemaCode }) => (0, codegen_1._)`{format: ${schemaCode}}` }; const def = { keyword: "format", type: ["number", "string"], schemaType: "string", $data: true, error, code(cxt, ruleType) { const { gen, data, $data, schema, schemaCode, it } = cxt; const { opts, errSchemaPath, schemaEnv, self } = it; if (!opts.validateFormats) return; if ($data) validate$DataFormat();else validateFormat(); function validate$DataFormat() { const fmts = gen.scopeValue("formats", { ref: self.formats, code: opts.code.formats }); const fDef = gen.const("fDef", (0, codegen_1._)`${fmts}[${schemaCode}]`); const fType = gen.let("fType"); const format = gen.let("format"); // TODO simplify gen.if((0, codegen_1._)`typeof ${fDef} == "object" && !(${fDef} instanceof RegExp)`, () => gen.assign(fType, (0, codegen_1._)`${fDef}.type || "string"`).assign(format, (0, codegen_1._)`${fDef}.validate`), () => gen.assign(fType, (0, codegen_1._)`"string"`).assign(format, fDef)); cxt.fail$data((0, codegen_1.or)(unknownFmt(), invalidFmt())); function unknownFmt() { if (opts.strictSchema === false) return codegen_1.nil; return (0, codegen_1._)`${schemaCode} && !${format}`; } function invalidFmt() { const callFormat = schemaEnv.$async ? (0, codegen_1._)`(${fDef}.async ? await ${format}(${data}) : ${format}(${data}))` : (0, codegen_1._)`${format}(${data})`; const validData = (0, codegen_1._)`(typeof ${format} == "function" ? ${callFormat} : ${format}.test(${data}))`; return (0, codegen_1._)`${format} && ${format} !== true && ${fType} === ${ruleType} && !${validData}`; } } function validateFormat() { const formatDef = self.formats[schema]; if (!formatDef) { unknownFormat(); return; } if (formatDef === true) return; const [fmtType, format, fmtRef] = getFormat(formatDef); if (fmtType === ruleType) cxt.pass(validCondition()); function unknownFormat() { if (opts.strictSchema === false) { self.logger.warn(unknownMsg()); return; } throw new Error(unknownMsg()); function unknownMsg() { return `unknown format "${schema}" ignored in schema at path "${errSchemaPath}"`; } } function getFormat(fmtDef) { const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : undefined; const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code }); if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) { return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._)`${fmt}.validate`]; } return ["string", fmtDef, fmt]; } function validCondition() { if (typeof formatDef == "object" && !(formatDef instanceof RegExp) && formatDef.async) { if (!schemaEnv.$async) throw new Error("async format in sync schema"); return (0, codegen_1._)`await ${fmtRef}(${data})`; } return typeof format == "function" ? (0, codegen_1._)`${fmtRef}(${data})` : (0, codegen_1._)`${fmtRef}.test(${data})`; } } } }; exports["default"] = def; /***/ }, /***/ 62169 /*!******************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/format/index.js ***! \******************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const format_1 = __webpack_require__(/*! ./format */ 28162); const format = [format_1.default]; exports["default"] = format; /***/ }, /***/ 21420 /*!**************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/metadata.js ***! \**************************************************************************/ (__unused_webpack_module, exports) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.contentVocabulary = exports.metadataVocabulary = void 0; exports.metadataVocabulary = ["title", "description", "default", "deprecated", "readOnly", "writeOnly", "examples"]; exports.contentVocabulary = ["contentMediaType", "contentEncoding", "contentSchema"]; /***/ }, /***/ 19338 /*!**********************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/validation/const.js ***! \**********************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const equal_1 = __webpack_require__(/*! ../../runtime/equal */ 12599); const error = { message: "must be equal to constant", params: ({ schemaCode }) => (0, codegen_1._)`{allowedValue: ${schemaCode}}` }; const def = { keyword: "const", $data: true, error, code(cxt) { const { gen, data, $data, schemaCode, schema } = cxt; if ($data || schema && typeof schema == "object") { cxt.fail$data((0, codegen_1._)`!${(0, util_1.useFunc)(gen, equal_1.default)}(${data}, ${schemaCode})`); } else { cxt.fail((0, codegen_1._)`${schema} !== ${data}`); } } }; exports["default"] = def; /***/ }, /***/ 54096 /*!*********************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/validation/enum.js ***! \*********************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const equal_1 = __webpack_require__(/*! ../../runtime/equal */ 12599); const error = { message: "must be equal to one of the allowed values", params: ({ schemaCode }) => (0, codegen_1._)`{allowedValues: ${schemaCode}}` }; const def = { keyword: "enum", schemaType: "array", $data: true, error, code(cxt) { const { gen, data, $data, schema, schemaCode, it } = cxt; if (!$data && schema.length === 0) throw new Error("enum must have non-empty array"); const useLoop = schema.length >= it.opts.loopEnum; let eql; const getEql = () => eql !== null && eql !== void 0 ? eql : eql = (0, util_1.useFunc)(gen, equal_1.default); let valid; if (useLoop || $data) { valid = gen.let("valid"); cxt.block$data(valid, loopEnum); } else { /* istanbul ignore if */ if (!Array.isArray(schema)) throw new Error("ajv implementation error"); const vSchema = gen.const("vSchema", schemaCode); valid = (0, codegen_1.or)(...schema.map((_x, i) => equalCode(vSchema, i))); } cxt.pass(valid); function loopEnum() { gen.assign(valid, false); gen.forOf("v", schemaCode, v => gen.if((0, codegen_1._)`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break())); } function equalCode(vSchema, i) { const sch = schema[i]; return typeof sch === "object" && sch !== null ? (0, codegen_1._)`${getEql()}(${data}, ${vSchema}[${i}])` : (0, codegen_1._)`${data} === ${sch}`; } } }; exports["default"] = def; /***/ }, /***/ 95881 /*!**********************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/validation/index.js ***! \**********************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const limitNumber_1 = __webpack_require__(/*! ./limitNumber */ 25835); const multipleOf_1 = __webpack_require__(/*! ./multipleOf */ 65524); const limitLength_1 = __webpack_require__(/*! ./limitLength */ 56210); const pattern_1 = __webpack_require__(/*! ./pattern */ 24055); const limitProperties_1 = __webpack_require__(/*! ./limitProperties */ 35039); const required_1 = __webpack_require__(/*! ./required */ 91208); const limitItems_1 = __webpack_require__(/*! ./limitItems */ 95496); const uniqueItems_1 = __webpack_require__(/*! ./uniqueItems */ 85772); const const_1 = __webpack_require__(/*! ./const */ 19338); const enum_1 = __webpack_require__(/*! ./enum */ 54096); const validation = [ // number limitNumber_1.default, multipleOf_1.default, // string limitLength_1.default, pattern_1.default, // object limitProperties_1.default, required_1.default, // array limitItems_1.default, uniqueItems_1.default, // any { keyword: "type", schemaType: ["string", "array"] }, { keyword: "nullable", schemaType: "boolean" }, const_1.default, enum_1.default]; exports["default"] = validation; /***/ }, /***/ 95496 /*!***************************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/validation/limitItems.js ***! \***************************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const error = { message({ keyword, schemaCode }) { const comp = keyword === "maxItems" ? "more" : "fewer"; return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} items`; }, params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}` }; const def = { keyword: ["maxItems", "minItems"], type: "array", schemaType: "number", $data: true, error, code(cxt) { const { keyword, data, schemaCode } = cxt; const op = keyword === "maxItems" ? codegen_1.operators.GT : codegen_1.operators.LT; cxt.fail$data((0, codegen_1._)`${data}.length ${op} ${schemaCode}`); } }; exports["default"] = def; /***/ }, /***/ 56210 /*!****************************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/validation/limitLength.js ***! \****************************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const ucs2length_1 = __webpack_require__(/*! ../../runtime/ucs2length */ 5174); const error = { message({ keyword, schemaCode }) { const comp = keyword === "maxLength" ? "more" : "fewer"; return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} characters`; }, params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}` }; const def = { keyword: ["maxLength", "minLength"], type: "string", schemaType: "number", $data: true, error, code(cxt) { const { keyword, data, schemaCode, it } = cxt; const op = keyword === "maxLength" ? codegen_1.operators.GT : codegen_1.operators.LT; const len = it.opts.unicode === false ? (0, codegen_1._)`${data}.length` : (0, codegen_1._)`${(0, util_1.useFunc)(cxt.gen, ucs2length_1.default)}(${data})`; cxt.fail$data((0, codegen_1._)`${len} ${op} ${schemaCode}`); } }; exports["default"] = def; /***/ }, /***/ 25835 /*!****************************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/validation/limitNumber.js ***! \****************************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const ops = codegen_1.operators; const KWDs = { maximum: { okStr: "<=", ok: ops.LTE, fail: ops.GT }, minimum: { okStr: ">=", ok: ops.GTE, fail: ops.LT }, exclusiveMaximum: { okStr: "<", ok: ops.LT, fail: ops.GTE }, exclusiveMinimum: { okStr: ">", ok: ops.GT, fail: ops.LTE } }; const error = { message: ({ keyword, schemaCode }) => (0, codegen_1.str)`must be ${KWDs[keyword].okStr} ${schemaCode}`, params: ({ keyword, schemaCode }) => (0, codegen_1._)`{comparison: ${KWDs[keyword].okStr}, limit: ${schemaCode}}` }; const def = { keyword: Object.keys(KWDs), type: "number", schemaType: "number", $data: true, error, code(cxt) { const { keyword, data, schemaCode } = cxt; cxt.fail$data((0, codegen_1._)`${data} ${KWDs[keyword].fail} ${schemaCode} || isNaN(${data})`); } }; exports["default"] = def; /***/ }, /***/ 35039 /*!********************************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/validation/limitProperties.js ***! \********************************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const error = { message({ keyword, schemaCode }) { const comp = keyword === "maxProperties" ? "more" : "fewer"; return (0, codegen_1.str)`must NOT have ${comp} than ${schemaCode} properties`; }, params: ({ schemaCode }) => (0, codegen_1._)`{limit: ${schemaCode}}` }; const def = { keyword: ["maxProperties", "minProperties"], type: "object", schemaType: "number", $data: true, error, code(cxt) { const { keyword, data, schemaCode } = cxt; const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT; cxt.fail$data((0, codegen_1._)`Object.keys(${data}).length ${op} ${schemaCode}`); } }; exports["default"] = def; /***/ }, /***/ 65524 /*!***************************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/validation/multipleOf.js ***! \***************************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const error = { message: ({ schemaCode }) => (0, codegen_1.str)`must be multiple of ${schemaCode}`, params: ({ schemaCode }) => (0, codegen_1._)`{multipleOf: ${schemaCode}}` }; const def = { keyword: "multipleOf", type: "number", schemaType: "number", $data: true, error, code(cxt) { const { gen, data, schemaCode, it } = cxt; // const bdt = bad$DataType(schemaCode, def.schemaType, $data) const prec = it.opts.multipleOfPrecision; const res = gen.let("res"); const invalid = prec ? (0, codegen_1._)`Math.abs(Math.round(${res}) - ${res}) > 1e-${prec}` : (0, codegen_1._)`${res} !== parseInt(${res})`; cxt.fail$data((0, codegen_1._)`(${schemaCode} === 0 || (${res} = ${data}/${schemaCode}, ${invalid}))`); } }; exports["default"] = def; /***/ }, /***/ 24055 /*!************************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/validation/pattern.js ***! \************************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const code_1 = __webpack_require__(/*! ../code */ 57572); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const error = { message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`, params: ({ schemaCode }) => (0, codegen_1._)`{pattern: ${schemaCode}}` }; const def = { keyword: "pattern", type: "string", schemaType: "string", $data: true, error, code(cxt) { const { gen, data, $data, schema, schemaCode, it } = cxt; const u = it.opts.unicodeRegExp ? "u" : ""; if ($data) { const { regExp } = it.opts.code; const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp); const valid = gen.let("valid"); gen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false)); cxt.fail$data((0, codegen_1._)`!${valid}`); } else { const regExp = (0, code_1.usePattern)(cxt, schema); cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`); } } }; exports["default"] = def; /***/ }, /***/ 91208 /*!*************************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/validation/required.js ***! \*************************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const code_1 = __webpack_require__(/*! ../code */ 57572); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const error = { message: ({ params: { missingProperty } }) => (0, codegen_1.str)`must have required property '${missingProperty}'`, params: ({ params: { missingProperty } }) => (0, codegen_1._)`{missingProperty: ${missingProperty}}` }; const def = { keyword: "required", type: "object", schemaType: "array", $data: true, error, code(cxt) { const { gen, schema, schemaCode, data, $data, it } = cxt; const { opts } = it; if (!$data && schema.length === 0) return; const useLoop = schema.length >= opts.loopRequired; if (it.allErrors) allErrorsMode();else exitOnErrorMode(); if (opts.strictRequired) { const props = cxt.parentSchema.properties; const { definedProperties } = cxt.it; for (const requiredKey of schema) { if ((props === null || props === void 0 ? void 0 : props[requiredKey]) === undefined && !definedProperties.has(requiredKey)) { const schemaPath = it.schemaEnv.baseId + it.errSchemaPath; const msg = `required property "${requiredKey}" is not defined at "${schemaPath}" (strictRequired)`; (0, util_1.checkStrictMode)(it, msg, it.opts.strictRequired); } } } function allErrorsMode() { if (useLoop || $data) { cxt.block$data(codegen_1.nil, loopAllRequired); } else { for (const prop of schema) { (0, code_1.checkReportMissingProp)(cxt, prop); } } } function exitOnErrorMode() { const missing = gen.let("missing"); if (useLoop || $data) { const valid = gen.let("valid", true); cxt.block$data(valid, () => loopUntilMissing(missing, valid)); cxt.ok(valid); } else { gen.if((0, code_1.checkMissingProp)(cxt, schema, missing)); (0, code_1.reportMissingProp)(cxt, missing); gen.else(); } } function loopAllRequired() { gen.forOf("prop", schemaCode, prop => { cxt.setParams({ missingProperty: prop }); gen.if((0, code_1.noPropertyInData)(gen, data, prop, opts.ownProperties), () => cxt.error()); }); } function loopUntilMissing(missing, valid) { cxt.setParams({ missingProperty: missing }); gen.forOf(missing, schemaCode, () => { gen.assign(valid, (0, code_1.propertyInData)(gen, data, missing, opts.ownProperties)); gen.if((0, codegen_1.not)(valid), () => { cxt.error(); gen.break(); }); }, codegen_1.nil); } } }; exports["default"] = def; /***/ }, /***/ 85772 /*!****************************************************************************************!*\ !*** ./node_modules/rxdb/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js ***! \****************************************************************************************/ (__unused_webpack_module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); const dataType_1 = __webpack_require__(/*! ../../compile/validate/dataType */ 68541); const codegen_1 = __webpack_require__(/*! ../../compile/codegen */ 59164); const util_1 = __webpack_require__(/*! ../../compile/util */ 1776); const equal_1 = __webpack_require__(/*! ../../runtime/equal */ 12599); const error = { message: ({ params: { i, j } }) => (0, codegen_1.str)`must NOT have duplicate items (items ## ${j} and ${i} are identical)`, params: ({ params: { i, j } }) => (0, codegen_1._)`{i: ${i}, j: ${j}}` }; const def = { keyword: "uniqueItems", type: "array", schemaType: "boolean", $data: true, error, code(cxt) { const { gen, data, $data, schema, parentSchema, schemaCode, it } = cxt; if (!$data && !schema) return; const valid = gen.let("valid"); const itemTypes = parentSchema.items ? (0, dataType_1.getSchemaTypes)(parentSchema.items) : []; cxt.block$data(valid, validateUniqueItems, (0, codegen_1._)`${schemaCode} === false`); cxt.ok(valid); function validateUniqueItems() { const i = gen.let("i", (0, codegen_1._)`${data}.length`); const j = gen.let("j"); cxt.setParams({ i, j }); gen.assign(valid, true); gen.if((0, codegen_1._)`${i} > 1`, () => (canOptimize() ? loopN : loopN2)(i, j)); } function canOptimize() { return itemTypes.length > 0 && !itemTypes.some(t => t === "object" || t === "array"); } function loopN(i, j) { const item = gen.name("item"); const wrongType = (0, dataType_1.checkDataTypes)(itemTypes, item, it.opts.strictNumbers, dataType_1.DataType.Wrong); const indices = gen.const("indices", (0, codegen_1._)`{}`); gen.for((0, codegen_1._)`;${i}--;`, () => { gen.let(item, (0, codegen_1._)`${data}[${i}]`); gen.if(wrongType, (0, codegen_1._)`continue`); if (itemTypes.length > 1) gen.if((0, codegen_1._)`typeof ${item} == "string"`, (0, codegen_1._)`${item} += "_"`); gen.if((0, codegen_1._)`typeof ${indices}[${item}] == "number"`, () => { gen.assign(j, (0, codegen_1._)`${indices}[${item}]`); cxt.error(); gen.assign(valid, false).break(); }).code((0, codegen_1._)`${indices}[${item}] = ${i}`); }); } function loopN2(i, j) { const eql = (0, util_1.useFunc)(gen, equal_1.default); const outer = gen.name("outer"); gen.label(outer).for((0, codegen_1._)`;${i}--;`, () => gen.for((0, codegen_1._)`${j} = ${i}; ${j}--;`, () => gen.if((0, codegen_1._)`${eql}(${data}[${i}], ${data}[${j}])`, () => { cxt.error(); gen.assign(valid, false).break(outer); }))); } } }; exports["default"] = def; /***/ }, /***/ 78916 /*!****************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/BehaviorSubject.js ***! \****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ BehaviorSubject: () => (/* binding */ BehaviorSubject) /* harmony export */ }); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subject */ 33242); class BehaviorSubject extends _Subject__WEBPACK_IMPORTED_MODULE_0__.Subject { constructor(_value) { super(); this._value = _value; } get value() { return this.getValue(); } _subscribe(subscriber) { const subscription = super._subscribe(subscriber); !subscription.closed && subscriber.next(this._value); return subscription; } getValue() { const { hasError, thrownError, _value } = this; if (hasError) { throw thrownError; } this._throwIfClosed(); return _value; } next(value) { super.next(this._value = value); } } /***/ }, /***/ 20061 /*!**********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/NotificationFactories.js ***! \**********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ COMPLETE_NOTIFICATION: () => (/* binding */ COMPLETE_NOTIFICATION), /* harmony export */ createNotification: () => (/* binding */ createNotification), /* harmony export */ errorNotification: () => (/* binding */ errorNotification), /* harmony export */ nextNotification: () => (/* binding */ nextNotification) /* harmony export */ }); const COMPLETE_NOTIFICATION = (() => createNotification('C', undefined, undefined))(); function errorNotification(error) { return createNotification('E', undefined, error); } function nextNotification(value) { return createNotification('N', value, undefined); } function createNotification(kind, value, error) { return { kind, value, error }; } /***/ }, /***/ 57417 /*!***********************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/Observable.js ***! \***********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Observable: () => (/* binding */ Observable) /* harmony export */ }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subscriber */ 55518); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Subscription */ 72737); /* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./symbol/observable */ 54110); /* harmony import */ var _util_pipe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/pipe */ 86283); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./config */ 34666); /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util/isFunction */ 41407); /* harmony import */ var _util_errorContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./util/errorContext */ 90674); class Observable { constructor(subscribe) { if (subscribe) { this._subscribe = subscribe; } } lift(operator) { const observable = new Observable(); observable.source = this; observable.operator = operator; return observable; } subscribe(observerOrNext, error, complete) { const subscriber = isSubscriber(observerOrNext) ? observerOrNext : new _Subscriber__WEBPACK_IMPORTED_MODULE_0__.SafeSubscriber(observerOrNext, error, complete); (0,_util_errorContext__WEBPACK_IMPORTED_MODULE_6__.errorContext)(() => { const { operator, source } = this; subscriber.add(operator ? operator.call(subscriber, source) : source ? this._subscribe(subscriber) : this._trySubscribe(subscriber)); }); return subscriber; } _trySubscribe(sink) { try { return this._subscribe(sink); } catch (err) { sink.error(err); } } forEach(next, promiseCtor) { promiseCtor = getPromiseCtor(promiseCtor); return new promiseCtor((resolve, reject) => { const subscriber = new _Subscriber__WEBPACK_IMPORTED_MODULE_0__.SafeSubscriber({ next: value => { try { next(value); } catch (err) { reject(err); subscriber.unsubscribe(); } }, error: reject, complete: resolve }); this.subscribe(subscriber); }); } _subscribe(subscriber) { var _a; return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber); } [_symbol_observable__WEBPACK_IMPORTED_MODULE_2__.observable]() { return this; } pipe(...operations) { return (0,_util_pipe__WEBPACK_IMPORTED_MODULE_3__.pipeFromArray)(operations)(this); } toPromise(promiseCtor) { promiseCtor = getPromiseCtor(promiseCtor); return new promiseCtor((resolve, reject) => { let value; this.subscribe(x => value = x, err => reject(err), () => resolve(value)); }); } } Observable.create = subscribe => { return new Observable(subscribe); }; function getPromiseCtor(promiseCtor) { var _a; return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : _config__WEBPACK_IMPORTED_MODULE_4__.config.Promise) !== null && _a !== void 0 ? _a : Promise; } function isObserver(value) { return value && (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_5__.isFunction)(value.next) && (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_5__.isFunction)(value.error) && (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_5__.isFunction)(value.complete); } function isSubscriber(value) { return value && value instanceof _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber || isObserver(value) && (0,_Subscription__WEBPACK_IMPORTED_MODULE_1__.isSubscription)(value); } /***/ }, /***/ 87675 /*!**************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/ReplaySubject.js ***! \**************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ReplaySubject: () => (/* binding */ ReplaySubject) /* harmony export */ }); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Subject */ 33242); /* harmony import */ var _scheduler_dateTimestampProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./scheduler/dateTimestampProvider */ 64921); class ReplaySubject extends _Subject__WEBPACK_IMPORTED_MODULE_0__.Subject { constructor(_bufferSize = Infinity, _windowTime = Infinity, _timestampProvider = _scheduler_dateTimestampProvider__WEBPACK_IMPORTED_MODULE_1__.dateTimestampProvider) { super(); this._bufferSize = _bufferSize; this._windowTime = _windowTime; this._timestampProvider = _timestampProvider; this._buffer = []; this._infiniteTimeWindow = true; this._infiniteTimeWindow = _windowTime === Infinity; this._bufferSize = Math.max(1, _bufferSize); this._windowTime = Math.max(1, _windowTime); } next(value) { const { isStopped, _buffer, _infiniteTimeWindow, _timestampProvider, _windowTime } = this; if (!isStopped) { _buffer.push(value); !_infiniteTimeWindow && _buffer.push(_timestampProvider.now() + _windowTime); } this._trimBuffer(); super.next(value); } _subscribe(subscriber) { this._throwIfClosed(); this._trimBuffer(); const subscription = this._innerSubscribe(subscriber); const { _infiniteTimeWindow, _buffer } = this; const copy = _buffer.slice(); for (let i = 0; i < copy.length && !subscriber.closed; i += _infiniteTimeWindow ? 1 : 2) { subscriber.next(copy[i]); } this._checkFinalizedStatuses(subscriber); return subscription; } _trimBuffer() { const { _bufferSize, _timestampProvider, _buffer, _infiniteTimeWindow } = this; const adjustedBufferSize = (_infiniteTimeWindow ? 1 : 2) * _bufferSize; _bufferSize < Infinity && adjustedBufferSize < _buffer.length && _buffer.splice(0, _buffer.length - adjustedBufferSize); if (!_infiniteTimeWindow) { const now = _timestampProvider.now(); let last = 0; for (let i = 1; i < _buffer.length && _buffer[i] <= now; i += 2) { last = i; } last && _buffer.splice(0, last + 1); } } } /***/ }, /***/ 50407 /*!**********************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/Scheduler.js ***! \**********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Scheduler: () => (/* binding */ Scheduler) /* harmony export */ }); /* harmony import */ var _scheduler_dateTimestampProvider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scheduler/dateTimestampProvider */ 64921); class Scheduler { constructor(schedulerActionCtor, now = Scheduler.now) { this.schedulerActionCtor = schedulerActionCtor; this.now = now; } schedule(work, delay = 0, state) { return new this.schedulerActionCtor(this, work).schedule(state, delay); } } Scheduler.now = _scheduler_dateTimestampProvider__WEBPACK_IMPORTED_MODULE_0__.dateTimestampProvider.now; /***/ }, /***/ 33242 /*!********************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/Subject.js ***! \********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AnonymousSubject: () => (/* binding */ AnonymousSubject), /* harmony export */ Subject: () => (/* binding */ Subject) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Observable */ 57417); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Subscription */ 72737); /* harmony import */ var _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/ObjectUnsubscribedError */ 40053); /* harmony import */ var _util_arrRemove__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/arrRemove */ 78812); /* harmony import */ var _util_errorContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util/errorContext */ 90674); class Subject extends _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable { constructor() { super(); this.closed = false; this.currentObservers = null; this.observers = []; this.isStopped = false; this.hasError = false; this.thrownError = null; } lift(operator) { const subject = new AnonymousSubject(this, this); subject.operator = operator; return subject; } _throwIfClosed() { if (this.closed) { throw new _util_ObjectUnsubscribedError__WEBPACK_IMPORTED_MODULE_2__.ObjectUnsubscribedError(); } } next(value) { (0,_util_errorContext__WEBPACK_IMPORTED_MODULE_4__.errorContext)(() => { this._throwIfClosed(); if (!this.isStopped) { if (!this.currentObservers) { this.currentObservers = Array.from(this.observers); } for (const observer of this.currentObservers) { observer.next(value); } } }); } error(err) { (0,_util_errorContext__WEBPACK_IMPORTED_MODULE_4__.errorContext)(() => { this._throwIfClosed(); if (!this.isStopped) { this.hasError = this.isStopped = true; this.thrownError = err; const { observers } = this; while (observers.length) { observers.shift().error(err); } } }); } complete() { (0,_util_errorContext__WEBPACK_IMPORTED_MODULE_4__.errorContext)(() => { this._throwIfClosed(); if (!this.isStopped) { this.isStopped = true; const { observers } = this; while (observers.length) { observers.shift().complete(); } } }); } unsubscribe() { this.isStopped = this.closed = true; this.observers = this.currentObservers = null; } get observed() { var _a; return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0; } _trySubscribe(subscriber) { this._throwIfClosed(); return super._trySubscribe(subscriber); } _subscribe(subscriber) { this._throwIfClosed(); this._checkFinalizedStatuses(subscriber); return this._innerSubscribe(subscriber); } _innerSubscribe(subscriber) { const { hasError, isStopped, observers } = this; if (hasError || isStopped) { return _Subscription__WEBPACK_IMPORTED_MODULE_1__.EMPTY_SUBSCRIPTION; } this.currentObservers = null; observers.push(subscriber); return new _Subscription__WEBPACK_IMPORTED_MODULE_1__.Subscription(() => { this.currentObservers = null; (0,_util_arrRemove__WEBPACK_IMPORTED_MODULE_3__.arrRemove)(observers, subscriber); }); } _checkFinalizedStatuses(subscriber) { const { hasError, thrownError, isStopped } = this; if (hasError) { subscriber.error(thrownError); } else if (isStopped) { subscriber.complete(); } } asObservable() { const observable = new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(); observable.source = this; return observable; } } Subject.create = (destination, source) => { return new AnonymousSubject(destination, source); }; class AnonymousSubject extends Subject { constructor(destination, source) { super(); this.destination = destination; this.source = source; } next(value) { var _a, _b; (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value); } error(err) { var _a, _b; (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err); } complete() { var _a, _b; (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a); } _subscribe(subscriber) { var _a, _b; return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : _Subscription__WEBPACK_IMPORTED_MODULE_1__.EMPTY_SUBSCRIPTION; } } /***/ }, /***/ 55518 /*!***********************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/Subscriber.js ***! \***********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ EMPTY_OBSERVER: () => (/* binding */ EMPTY_OBSERVER), /* harmony export */ SafeSubscriber: () => (/* binding */ SafeSubscriber), /* harmony export */ Subscriber: () => (/* binding */ Subscriber) /* harmony export */ }); /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/isFunction */ 41407); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Subscription */ 72737); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./config */ 34666); /* harmony import */ var _util_reportUnhandledError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util/reportUnhandledError */ 58510); /* harmony import */ var _util_noop__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util/noop */ 30695); /* harmony import */ var _NotificationFactories__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./NotificationFactories */ 20061); /* harmony import */ var _scheduler_timeoutProvider__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./scheduler/timeoutProvider */ 20046); /* harmony import */ var _util_errorContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./util/errorContext */ 90674); class Subscriber extends _Subscription__WEBPACK_IMPORTED_MODULE_1__.Subscription { constructor(destination) { super(); this.isStopped = false; if (destination) { this.destination = destination; if ((0,_Subscription__WEBPACK_IMPORTED_MODULE_1__.isSubscription)(destination)) { destination.add(this); } } else { this.destination = EMPTY_OBSERVER; } } static create(next, error, complete) { return new SafeSubscriber(next, error, complete); } next(value) { if (this.isStopped) { handleStoppedNotification((0,_NotificationFactories__WEBPACK_IMPORTED_MODULE_5__.nextNotification)(value), this); } else { this._next(value); } } error(err) { if (this.isStopped) { handleStoppedNotification((0,_NotificationFactories__WEBPACK_IMPORTED_MODULE_5__.errorNotification)(err), this); } else { this.isStopped = true; this._error(err); } } complete() { if (this.isStopped) { handleStoppedNotification(_NotificationFactories__WEBPACK_IMPORTED_MODULE_5__.COMPLETE_NOTIFICATION, this); } else { this.isStopped = true; this._complete(); } } unsubscribe() { if (!this.closed) { this.isStopped = true; super.unsubscribe(); this.destination = null; } } _next(value) { this.destination.next(value); } _error(err) { try { this.destination.error(err); } finally { this.unsubscribe(); } } _complete() { try { this.destination.complete(); } finally { this.unsubscribe(); } } } const _bind = Function.prototype.bind; function bind(fn, thisArg) { return _bind.call(fn, thisArg); } class ConsumerObserver { constructor(partialObserver) { this.partialObserver = partialObserver; } next(value) { const { partialObserver } = this; if (partialObserver.next) { try { partialObserver.next(value); } catch (error) { handleUnhandledError(error); } } } error(err) { const { partialObserver } = this; if (partialObserver.error) { try { partialObserver.error(err); } catch (error) { handleUnhandledError(error); } } else { handleUnhandledError(err); } } complete() { const { partialObserver } = this; if (partialObserver.complete) { try { partialObserver.complete(); } catch (error) { handleUnhandledError(error); } } } } class SafeSubscriber extends Subscriber { constructor(observerOrNext, error, complete) { super(); let partialObserver; if ((0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(observerOrNext) || !observerOrNext) { partialObserver = { next: observerOrNext !== null && observerOrNext !== void 0 ? observerOrNext : undefined, error: error !== null && error !== void 0 ? error : undefined, complete: complete !== null && complete !== void 0 ? complete : undefined }; } else { let context; if (this && _config__WEBPACK_IMPORTED_MODULE_2__.config.useDeprecatedNextContext) { context = Object.create(observerOrNext); context.unsubscribe = () => this.unsubscribe(); partialObserver = { next: observerOrNext.next && bind(observerOrNext.next, context), error: observerOrNext.error && bind(observerOrNext.error, context), complete: observerOrNext.complete && bind(observerOrNext.complete, context) }; } else { partialObserver = observerOrNext; } } this.destination = new ConsumerObserver(partialObserver); } } function handleUnhandledError(error) { if (_config__WEBPACK_IMPORTED_MODULE_2__.config.useDeprecatedSynchronousErrorHandling) { (0,_util_errorContext__WEBPACK_IMPORTED_MODULE_7__.captureError)(error); } else { (0,_util_reportUnhandledError__WEBPACK_IMPORTED_MODULE_3__.reportUnhandledError)(error); } } function defaultErrorHandler(err) { throw err; } function handleStoppedNotification(notification, subscriber) { const { onStoppedNotification } = _config__WEBPACK_IMPORTED_MODULE_2__.config; onStoppedNotification && _scheduler_timeoutProvider__WEBPACK_IMPORTED_MODULE_6__.timeoutProvider.setTimeout(() => onStoppedNotification(notification, subscriber)); } const EMPTY_OBSERVER = { closed: true, next: _util_noop__WEBPACK_IMPORTED_MODULE_4__.noop, error: defaultErrorHandler, complete: _util_noop__WEBPACK_IMPORTED_MODULE_4__.noop }; /***/ }, /***/ 72737 /*!*************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/Subscription.js ***! \*************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ EMPTY_SUBSCRIPTION: () => (/* binding */ EMPTY_SUBSCRIPTION), /* harmony export */ Subscription: () => (/* binding */ Subscription), /* harmony export */ isSubscription: () => (/* binding */ isSubscription) /* harmony export */ }); /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/isFunction */ 41407); /* harmony import */ var _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util/UnsubscriptionError */ 40551); /* harmony import */ var _util_arrRemove__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util/arrRemove */ 78812); class Subscription { constructor(initialTeardown) { this.initialTeardown = initialTeardown; this.closed = false; this._parentage = null; this._finalizers = null; } unsubscribe() { let errors; if (!this.closed) { this.closed = true; const { _parentage } = this; if (_parentage) { this._parentage = null; if (Array.isArray(_parentage)) { for (const parent of _parentage) { parent.remove(this); } } else { _parentage.remove(this); } } const { initialTeardown: initialFinalizer } = this; if ((0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(initialFinalizer)) { try { initialFinalizer(); } catch (e) { errors = e instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_1__.UnsubscriptionError ? e.errors : [e]; } } const { _finalizers } = this; if (_finalizers) { this._finalizers = null; for (const finalizer of _finalizers) { try { execFinalizer(finalizer); } catch (err) { errors = errors !== null && errors !== void 0 ? errors : []; if (err instanceof _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_1__.UnsubscriptionError) { errors = [...errors, ...err.errors]; } else { errors.push(err); } } } } if (errors) { throw new _util_UnsubscriptionError__WEBPACK_IMPORTED_MODULE_1__.UnsubscriptionError(errors); } } } add(teardown) { var _a; if (teardown && teardown !== this) { if (this.closed) { execFinalizer(teardown); } else { if (teardown instanceof Subscription) { if (teardown.closed || teardown._hasParent(this)) { return; } teardown._addParent(this); } (this._finalizers = (_a = this._finalizers) !== null && _a !== void 0 ? _a : []).push(teardown); } } } _hasParent(parent) { const { _parentage } = this; return _parentage === parent || Array.isArray(_parentage) && _parentage.includes(parent); } _addParent(parent) { const { _parentage } = this; this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent; } _removeParent(parent) { const { _parentage } = this; if (_parentage === parent) { this._parentage = null; } else if (Array.isArray(_parentage)) { (0,_util_arrRemove__WEBPACK_IMPORTED_MODULE_2__.arrRemove)(_parentage, parent); } } remove(teardown) { const { _finalizers } = this; _finalizers && (0,_util_arrRemove__WEBPACK_IMPORTED_MODULE_2__.arrRemove)(_finalizers, teardown); if (teardown instanceof Subscription) { teardown._removeParent(this); } } } Subscription.EMPTY = (() => { const empty = new Subscription(); empty.closed = true; return empty; })(); const EMPTY_SUBSCRIPTION = Subscription.EMPTY; function isSubscription(value) { return value instanceof Subscription || value && 'closed' in value && (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(value.remove) && (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(value.add) && (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(value.unsubscribe); } function execFinalizer(finalizer) { if ((0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(finalizer)) { finalizer(); } else { finalizer.unsubscribe(); } } /***/ }, /***/ 34666 /*!*******************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/config.js ***! \*******************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ config: () => (/* binding */ config) /* harmony export */ }); const config = { onUnhandledError: null, onStoppedNotification: null, Promise: undefined, useDeprecatedSynchronousErrorHandling: false, useDeprecatedNextContext: false }; /***/ }, /***/ 56435 /*!***************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/firstValueFrom.js ***! \***************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ firstValueFrom: () => (/* binding */ firstValueFrom) /* harmony export */ }); /* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/EmptyError */ 77294); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Subscriber */ 55518); function firstValueFrom(source, config) { const hasConfig = typeof config === 'object'; return new Promise((resolve, reject) => { const subscriber = new _Subscriber__WEBPACK_IMPORTED_MODULE_1__.SafeSubscriber({ next: value => { resolve(value); subscriber.unsubscribe(); }, error: reject, complete: () => { if (hasConfig) { resolve(config.defaultValue); } else { reject(new _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__.EmptyError()); } } }); source.subscribe(subscriber); }); } /***/ }, /***/ 24745 /*!*********************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/observable/ConnectableObservable.js ***! \*********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ConnectableObservable: () => (/* binding */ ConnectableObservable) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 57417); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subscription */ 72737); /* harmony import */ var _operators_refCount__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operators/refCount */ 29922); /* harmony import */ var _operators_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../operators/OperatorSubscriber */ 33776); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/lift */ 8638); class ConnectableObservable extends _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable { constructor(source, subjectFactory) { super(); this.source = source; this.subjectFactory = subjectFactory; this._subject = null; this._refCount = 0; this._connection = null; if ((0,_util_lift__WEBPACK_IMPORTED_MODULE_4__.hasLift)(source)) { this.lift = source.lift; } } _subscribe(subscriber) { return this.getSubject().subscribe(subscriber); } getSubject() { const subject = this._subject; if (!subject || subject.isStopped) { this._subject = this.subjectFactory(); } return this._subject; } _teardown() { this._refCount = 0; const { _connection } = this; this._subject = this._connection = null; _connection === null || _connection === void 0 ? void 0 : _connection.unsubscribe(); } connect() { let connection = this._connection; if (!connection) { connection = this._connection = new _Subscription__WEBPACK_IMPORTED_MODULE_1__.Subscription(); const subject = this.getSubject(); connection.add(this.source.subscribe((0,_operators_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_3__.createOperatorSubscriber)(subject, undefined, () => { this._teardown(); subject.complete(); }, err => { this._teardown(); subject.error(err); }, () => this._teardown()))); if (connection.closed) { this._connection = null; connection = _Subscription__WEBPACK_IMPORTED_MODULE_1__.Subscription.EMPTY; } } return connection; } refCount() { return (0,_operators_refCount__WEBPACK_IMPORTED_MODULE_2__.refCount)()(this); } } /***/ }, /***/ 90100 /*!*************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/observable/combineLatest.js ***! \*************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ combineLatest: () => (/* binding */ combineLatest), /* harmony export */ combineLatestInit: () => (/* binding */ combineLatestInit) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 57417); /* harmony import */ var _util_argsArgArrayOrObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/argsArgArrayOrObject */ 74793); /* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./from */ 84356); /* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/identity */ 4701); /* harmony import */ var _util_mapOneOrManyArgs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/mapOneOrManyArgs */ 40762); /* harmony import */ var _util_args__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/args */ 97030); /* harmony import */ var _util_createObject__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../util/createObject */ 83288); /* harmony import */ var _operators_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../operators/OperatorSubscriber */ 33776); /* harmony import */ var _util_executeSchedule__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../util/executeSchedule */ 83521); function combineLatest(...args) { const scheduler = (0,_util_args__WEBPACK_IMPORTED_MODULE_5__.popScheduler)(args); const resultSelector = (0,_util_args__WEBPACK_IMPORTED_MODULE_5__.popResultSelector)(args); const { args: observables, keys } = (0,_util_argsArgArrayOrObject__WEBPACK_IMPORTED_MODULE_1__.argsArgArrayOrObject)(args); if (observables.length === 0) { return (0,_from__WEBPACK_IMPORTED_MODULE_2__.from)([], scheduler); } const result = new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(combineLatestInit(observables, scheduler, keys ? values => (0,_util_createObject__WEBPACK_IMPORTED_MODULE_6__.createObject)(keys, values) : _util_identity__WEBPACK_IMPORTED_MODULE_3__.identity)); return resultSelector ? result.pipe((0,_util_mapOneOrManyArgs__WEBPACK_IMPORTED_MODULE_4__.mapOneOrManyArgs)(resultSelector)) : result; } function combineLatestInit(observables, scheduler, valueTransform = _util_identity__WEBPACK_IMPORTED_MODULE_3__.identity) { return subscriber => { maybeSchedule(scheduler, () => { const { length } = observables; const values = new Array(length); let active = length; let remainingFirstValues = length; for (let i = 0; i < length; i++) { maybeSchedule(scheduler, () => { const source = (0,_from__WEBPACK_IMPORTED_MODULE_2__.from)(observables[i], scheduler); let hasFirstValue = false; source.subscribe((0,_operators_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_7__.createOperatorSubscriber)(subscriber, value => { values[i] = value; if (!hasFirstValue) { hasFirstValue = true; remainingFirstValues--; } if (!remainingFirstValues) { subscriber.next(valueTransform(values.slice())); } }, () => { if (! --active) { subscriber.complete(); } })); }, subscriber); } }, subscriber); }; } function maybeSchedule(scheduler, execute, subscription) { if (scheduler) { (0,_util_executeSchedule__WEBPACK_IMPORTED_MODULE_8__.executeSchedule)(subscription, scheduler, execute); } else { execute(); } } /***/ }, /***/ 13096 /*!******************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/observable/concat.js ***! \******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ concat: () => (/* binding */ concat) /* harmony export */ }); /* harmony import */ var _operators_concatAll__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../operators/concatAll */ 23283); /* harmony import */ var _util_args__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/args */ 97030); /* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./from */ 84356); function concat(...args) { return (0,_operators_concatAll__WEBPACK_IMPORTED_MODULE_0__.concatAll)()((0,_from__WEBPACK_IMPORTED_MODULE_2__.from)(args, (0,_util_args__WEBPACK_IMPORTED_MODULE_1__.popScheduler)(args))); } /***/ }, /***/ 46046 /*!*****************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/observable/defer.js ***! \*****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ defer: () => (/* binding */ defer) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 57417); /* harmony import */ var _innerFrom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./innerFrom */ 16822); function defer(observableFactory) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => { (0,_innerFrom__WEBPACK_IMPORTED_MODULE_1__.innerFrom)(observableFactory()).subscribe(subscriber); }); } /***/ }, /***/ 90015 /*!*****************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/observable/empty.js ***! \*****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ EMPTY: () => (/* binding */ EMPTY), /* harmony export */ empty: () => (/* binding */ empty) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 57417); const EMPTY = new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => subscriber.complete()); function empty(scheduler) { return scheduler ? emptyScheduled(scheduler) : EMPTY; } function emptyScheduled(scheduler) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => scheduler.schedule(() => subscriber.complete())); } /***/ }, /***/ 62276 /*!********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/observable/forkJoin.js ***! \********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ forkJoin: () => (/* binding */ forkJoin) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 57417); /* harmony import */ var _util_argsArgArrayOrObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/argsArgArrayOrObject */ 74793); /* harmony import */ var _innerFrom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./innerFrom */ 16822); /* harmony import */ var _util_args__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/args */ 97030); /* harmony import */ var _operators_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../operators/OperatorSubscriber */ 33776); /* harmony import */ var _util_mapOneOrManyArgs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/mapOneOrManyArgs */ 40762); /* harmony import */ var _util_createObject__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../util/createObject */ 83288); function forkJoin(...args) { const resultSelector = (0,_util_args__WEBPACK_IMPORTED_MODULE_3__.popResultSelector)(args); const { args: sources, keys } = (0,_util_argsArgArrayOrObject__WEBPACK_IMPORTED_MODULE_1__.argsArgArrayOrObject)(args); const result = new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => { const { length } = sources; if (!length) { subscriber.complete(); return; } const values = new Array(length); let remainingCompletions = length; let remainingEmissions = length; for (let sourceIndex = 0; sourceIndex < length; sourceIndex++) { let hasValue = false; (0,_innerFrom__WEBPACK_IMPORTED_MODULE_2__.innerFrom)(sources[sourceIndex]).subscribe((0,_operators_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_4__.createOperatorSubscriber)(subscriber, value => { if (!hasValue) { hasValue = true; remainingEmissions--; } values[sourceIndex] = value; }, () => remainingCompletions--, undefined, () => { if (!remainingCompletions || !hasValue) { if (!remainingEmissions) { subscriber.next(keys ? (0,_util_createObject__WEBPACK_IMPORTED_MODULE_6__.createObject)(keys, values) : values); } subscriber.complete(); } })); } }); return resultSelector ? result.pipe((0,_util_mapOneOrManyArgs__WEBPACK_IMPORTED_MODULE_5__.mapOneOrManyArgs)(resultSelector)) : result; } /***/ }, /***/ 84356 /*!****************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/observable/from.js ***! \****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ from: () => (/* binding */ from) /* harmony export */ }); /* harmony import */ var _scheduled_scheduled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduled/scheduled */ 48217); /* harmony import */ var _innerFrom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./innerFrom */ 16822); function from(input, scheduler) { return scheduler ? (0,_scheduled_scheduled__WEBPACK_IMPORTED_MODULE_0__.scheduled)(input, scheduler) : (0,_innerFrom__WEBPACK_IMPORTED_MODULE_1__.innerFrom)(input); } /***/ }, /***/ 87510 /*!*********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/observable/fromEvent.js ***! \*********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ fromEvent: () => (/* binding */ fromEvent) /* harmony export */ }); /* harmony import */ var _observable_innerFrom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/innerFrom */ 16822); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Observable */ 57417); /* harmony import */ var _operators_mergeMap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operators/mergeMap */ 91532); /* harmony import */ var _util_isArrayLike__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/isArrayLike */ 36745); /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/isFunction */ 41407); /* harmony import */ var _util_mapOneOrManyArgs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/mapOneOrManyArgs */ 40762); const nodeEventEmitterMethods = ['addListener', 'removeListener']; const eventTargetMethods = ['addEventListener', 'removeEventListener']; const jqueryMethods = ['on', 'off']; function fromEvent(target, eventName, options, resultSelector) { if ((0,_util_isFunction__WEBPACK_IMPORTED_MODULE_4__.isFunction)(options)) { resultSelector = options; options = undefined; } if (resultSelector) { return fromEvent(target, eventName, options).pipe((0,_util_mapOneOrManyArgs__WEBPACK_IMPORTED_MODULE_5__.mapOneOrManyArgs)(resultSelector)); } const [add, remove] = isEventTarget(target) ? eventTargetMethods.map(methodName => handler => target[methodName](eventName, handler, options)) : isNodeStyleEventEmitter(target) ? nodeEventEmitterMethods.map(toCommonHandlerRegistry(target, eventName)) : isJQueryStyleEventEmitter(target) ? jqueryMethods.map(toCommonHandlerRegistry(target, eventName)) : []; if (!add) { if ((0,_util_isArrayLike__WEBPACK_IMPORTED_MODULE_3__.isArrayLike)(target)) { return (0,_operators_mergeMap__WEBPACK_IMPORTED_MODULE_2__.mergeMap)(subTarget => fromEvent(subTarget, eventName, options))((0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_0__.innerFrom)(target)); } } if (!add) { throw new TypeError('Invalid event target'); } return new _Observable__WEBPACK_IMPORTED_MODULE_1__.Observable(subscriber => { const handler = (...args) => subscriber.next(1 < args.length ? args : args[0]); add(handler); return () => remove(handler); }); } function toCommonHandlerRegistry(target, eventName) { return methodName => handler => target[methodName](eventName, handler); } function isNodeStyleEventEmitter(target) { return (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_4__.isFunction)(target.addListener) && (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_4__.isFunction)(target.removeListener); } function isJQueryStyleEventEmitter(target) { return (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_4__.isFunction)(target.on) && (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_4__.isFunction)(target.off); } function isEventTarget(target) { return (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_4__.isFunction)(target.addEventListener) && (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_4__.isFunction)(target.removeEventListener); } /***/ }, /***/ 16822 /*!*********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/observable/innerFrom.js ***! \*********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ fromArrayLike: () => (/* binding */ fromArrayLike), /* harmony export */ fromAsyncIterable: () => (/* binding */ fromAsyncIterable), /* harmony export */ fromInteropObservable: () => (/* binding */ fromInteropObservable), /* harmony export */ fromIterable: () => (/* binding */ fromIterable), /* harmony export */ fromPromise: () => (/* binding */ fromPromise), /* harmony export */ fromReadableStreamLike: () => (/* binding */ fromReadableStreamLike), /* harmony export */ innerFrom: () => (/* binding */ innerFrom) /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ 27824); /* harmony import */ var _util_isArrayLike__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isArrayLike */ 36745); /* harmony import */ var _util_isPromise__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isPromise */ 89466); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Observable */ 57417); /* harmony import */ var _util_isInteropObservable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/isInteropObservable */ 77111); /* harmony import */ var _util_isAsyncIterable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/isAsyncIterable */ 61401); /* harmony import */ var _util_throwUnobservableError__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../util/throwUnobservableError */ 28727); /* harmony import */ var _util_isIterable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../util/isIterable */ 91997); /* harmony import */ var _util_isReadableStreamLike__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../util/isReadableStreamLike */ 11732); /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../util/isFunction */ 41407); /* harmony import */ var _util_reportUnhandledError__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../util/reportUnhandledError */ 58510); /* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../symbol/observable */ 54110); function innerFrom(input) { if (input instanceof _Observable__WEBPACK_IMPORTED_MODULE_3__.Observable) { return input; } if (input != null) { if ((0,_util_isInteropObservable__WEBPACK_IMPORTED_MODULE_4__.isInteropObservable)(input)) { return fromInteropObservable(input); } if ((0,_util_isArrayLike__WEBPACK_IMPORTED_MODULE_1__.isArrayLike)(input)) { return fromArrayLike(input); } if ((0,_util_isPromise__WEBPACK_IMPORTED_MODULE_2__.isPromise)(input)) { return fromPromise(input); } if ((0,_util_isAsyncIterable__WEBPACK_IMPORTED_MODULE_5__.isAsyncIterable)(input)) { return fromAsyncIterable(input); } if ((0,_util_isIterable__WEBPACK_IMPORTED_MODULE_7__.isIterable)(input)) { return fromIterable(input); } if ((0,_util_isReadableStreamLike__WEBPACK_IMPORTED_MODULE_8__.isReadableStreamLike)(input)) { return fromReadableStreamLike(input); } } throw (0,_util_throwUnobservableError__WEBPACK_IMPORTED_MODULE_6__.createInvalidObservableTypeError)(input); } function fromInteropObservable(obj) { return new _Observable__WEBPACK_IMPORTED_MODULE_3__.Observable(subscriber => { const obs = obj[_symbol_observable__WEBPACK_IMPORTED_MODULE_11__.observable](); if ((0,_util_isFunction__WEBPACK_IMPORTED_MODULE_9__.isFunction)(obs.subscribe)) { return obs.subscribe(subscriber); } throw new TypeError('Provided object does not correctly implement Symbol.observable'); }); } function fromArrayLike(array) { return new _Observable__WEBPACK_IMPORTED_MODULE_3__.Observable(subscriber => { for (let i = 0; i < array.length && !subscriber.closed; i++) { subscriber.next(array[i]); } subscriber.complete(); }); } function fromPromise(promise) { return new _Observable__WEBPACK_IMPORTED_MODULE_3__.Observable(subscriber => { promise.then(value => { if (!subscriber.closed) { subscriber.next(value); subscriber.complete(); } }, err => subscriber.error(err)).then(null, _util_reportUnhandledError__WEBPACK_IMPORTED_MODULE_10__.reportUnhandledError); }); } function fromIterable(iterable) { return new _Observable__WEBPACK_IMPORTED_MODULE_3__.Observable(subscriber => { for (const value of iterable) { subscriber.next(value); if (subscriber.closed) { return; } } subscriber.complete(); }); } function fromAsyncIterable(asyncIterable) { return new _Observable__WEBPACK_IMPORTED_MODULE_3__.Observable(subscriber => { process(asyncIterable, subscriber).catch(err => subscriber.error(err)); }); } function fromReadableStreamLike(readableStream) { return fromAsyncIterable((0,_util_isReadableStreamLike__WEBPACK_IMPORTED_MODULE_8__.readableStreamLikeToAsyncGenerator)(readableStream)); } function process(asyncIterable, subscriber) { var asyncIterable_1, asyncIterable_1_1; var e_1, _a; return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function* () { try { for (asyncIterable_1 = (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__asyncValues)(asyncIterable); asyncIterable_1_1 = yield asyncIterable_1.next(), !asyncIterable_1_1.done;) { const value = asyncIterable_1_1.value; subscriber.next(value); if (subscriber.closed) { return; } } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (asyncIterable_1_1 && !asyncIterable_1_1.done && (_a = asyncIterable_1.return)) yield _a.call(asyncIterable_1); } finally { if (e_1) throw e_1.error; } } subscriber.complete(); }); } /***/ }, /***/ 5637 /*!********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/observable/interval.js ***! \********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ interval: () => (/* binding */ interval) /* harmony export */ }); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ 32348); /* harmony import */ var _timer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./timer */ 38647); function interval(period = 0, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__.asyncScheduler) { if (period < 0) { period = 0; } return (0,_timer__WEBPACK_IMPORTED_MODULE_1__.timer)(period, period, scheduler); } /***/ }, /***/ 69042 /*!*****************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/observable/merge.js ***! \*****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ merge: () => (/* binding */ merge) /* harmony export */ }); /* harmony import */ var _operators_mergeAll__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../operators/mergeAll */ 62549); /* harmony import */ var _innerFrom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./innerFrom */ 16822); /* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./empty */ 90015); /* harmony import */ var _util_args__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/args */ 97030); /* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./from */ 84356); function merge(...args) { const scheduler = (0,_util_args__WEBPACK_IMPORTED_MODULE_3__.popScheduler)(args); const concurrent = (0,_util_args__WEBPACK_IMPORTED_MODULE_3__.popNumber)(args, Infinity); const sources = args; return !sources.length ? _empty__WEBPACK_IMPORTED_MODULE_2__.EMPTY : sources.length === 1 ? (0,_innerFrom__WEBPACK_IMPORTED_MODULE_1__.innerFrom)(sources[0]) : (0,_operators_mergeAll__WEBPACK_IMPORTED_MODULE_0__.mergeAll)(concurrent)((0,_from__WEBPACK_IMPORTED_MODULE_4__.from)(sources, scheduler)); } /***/ }, /***/ 98241 /*!**************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/observable/of.js ***! \**************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ of: () => (/* binding */ of) /* harmony export */ }); /* harmony import */ var _util_args__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/args */ 97030); /* harmony import */ var _from__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./from */ 84356); function of(...args) { const scheduler = (0,_util_args__WEBPACK_IMPORTED_MODULE_0__.popScheduler)(args); return (0,_from__WEBPACK_IMPORTED_MODULE_1__.from)(args, scheduler); } /***/ }, /***/ 162 /*!**********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/observable/throwError.js ***! \**********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ throwError: () => (/* binding */ throwError) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 57417); /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isFunction */ 41407); function throwError(errorOrErrorFactory, scheduler) { const errorFactory = (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_1__.isFunction)(errorOrErrorFactory) ? errorOrErrorFactory : () => errorOrErrorFactory; const init = subscriber => subscriber.error(errorFactory()); return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(scheduler ? subscriber => scheduler.schedule(init, 0, subscriber) : init); } /***/ }, /***/ 38647 /*!*****************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/observable/timer.js ***! \*****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ timer: () => (/* binding */ timer) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 57417); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/async */ 32348); /* harmony import */ var _util_isScheduler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isScheduler */ 69126); /* harmony import */ var _util_isDate__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/isDate */ 96411); function timer(dueTime = 0, intervalOrScheduler, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_1__.async) { let intervalDuration = -1; if (intervalOrScheduler != null) { if ((0,_util_isScheduler__WEBPACK_IMPORTED_MODULE_2__.isScheduler)(intervalOrScheduler)) { scheduler = intervalOrScheduler; } else { intervalDuration = intervalOrScheduler; } } return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => { let due = (0,_util_isDate__WEBPACK_IMPORTED_MODULE_3__.isValidDate)(dueTime) ? +dueTime - scheduler.now() : dueTime; if (due < 0) { due = 0; } let n = 0; return scheduler.schedule(function () { if (!subscriber.closed) { subscriber.next(n++); if (0 <= intervalDuration) { this.schedule(undefined, intervalDuration); } else { subscriber.complete(); } } }, due); }); } /***/ }, /***/ 33776 /*!*****************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/OperatorSubscriber.js ***! \*****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ OperatorSubscriber: () => (/* binding */ OperatorSubscriber), /* harmony export */ createOperatorSubscriber: () => (/* binding */ createOperatorSubscriber) /* harmony export */ }); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscriber */ 55518); function createOperatorSubscriber(destination, onNext, onComplete, onError, onFinalize) { return new OperatorSubscriber(destination, onNext, onComplete, onError, onFinalize); } class OperatorSubscriber extends _Subscriber__WEBPACK_IMPORTED_MODULE_0__.Subscriber { constructor(destination, onNext, onComplete, onError, onFinalize, shouldUnsubscribe) { super(destination); this.onFinalize = onFinalize; this.shouldUnsubscribe = shouldUnsubscribe; this._next = onNext ? function (value) { try { onNext(value); } catch (err) { destination.error(err); } } : super._next; this._error = onError ? function (err) { try { onError(err); } catch (err) { destination.error(err); } finally { this.unsubscribe(); } } : super._error; this._complete = onComplete ? function () { try { onComplete(); } catch (err) { destination.error(err); } finally { this.unsubscribe(); } } : super._complete; } unsubscribe() { var _a; if (!this.shouldUnsubscribe || this.shouldUnsubscribe()) { const { closed } = this; super.unsubscribe(); !closed && ((_a = this.onFinalize) === null || _a === void 0 ? void 0 : _a.call(this)); } } } /***/ }, /***/ 51815 /*!****************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/audit.js ***! \****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ audit: () => (/* binding */ audit) /* harmony export */ }); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/lift */ 8638); /* harmony import */ var _observable_innerFrom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/innerFrom */ 16822); /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OperatorSubscriber */ 33776); function audit(durationSelector) { return (0,_util_lift__WEBPACK_IMPORTED_MODULE_0__.operate)((source, subscriber) => { let hasValue = false; let lastValue = null; let durationSubscriber = null; let isComplete = false; const endDuration = () => { durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe(); durationSubscriber = null; if (hasValue) { hasValue = false; const value = lastValue; lastValue = null; subscriber.next(value); } isComplete && subscriber.complete(); }; const cleanupDuration = () => { durationSubscriber = null; isComplete && subscriber.complete(); }; source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, value => { hasValue = true; lastValue = value; if (!durationSubscriber) { (0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_1__.innerFrom)(durationSelector(value)).subscribe(durationSubscriber = (0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, endDuration, cleanupDuration)); } }, () => { isComplete = true; (!hasValue || !durationSubscriber || durationSubscriber.closed) && subscriber.complete(); })); }); } /***/ }, /***/ 16802 /*!********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/auditTime.js ***! \********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ auditTime: () => (/* binding */ auditTime) /* harmony export */ }); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ 32348); /* harmony import */ var _audit__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./audit */ 51815); /* harmony import */ var _observable_timer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../observable/timer */ 38647); function auditTime(duration, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__.asyncScheduler) { return (0,_audit__WEBPACK_IMPORTED_MODULE_1__.audit)(() => (0,_observable_timer__WEBPACK_IMPORTED_MODULE_2__.timer)(duration, scheduler)); } /***/ }, /***/ 84917 /*!*********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/catchError.js ***! \*********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ catchError: () => (/* binding */ catchError) /* harmony export */ }); /* harmony import */ var _observable_innerFrom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/innerFrom */ 16822); /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./OperatorSubscriber */ 33776); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/lift */ 8638); function catchError(selector) { return (0,_util_lift__WEBPACK_IMPORTED_MODULE_2__.operate)((source, subscriber) => { let innerSub = null; let syncUnsub = false; let handledResult; innerSub = source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__.createOperatorSubscriber)(subscriber, undefined, undefined, err => { handledResult = (0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_0__.innerFrom)(selector(err, catchError(selector)(source))); if (innerSub) { innerSub.unsubscribe(); innerSub = null; handledResult.subscribe(subscriber); } else { syncUnsub = true; } })); if (syncUnsub) { innerSub.unsubscribe(); innerSub = null; handledResult.subscribe(subscriber); } }); } /***/ }, /***/ 23283 /*!********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/concatAll.js ***! \********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ concatAll: () => (/* binding */ concatAll) /* harmony export */ }); /* harmony import */ var _mergeAll__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mergeAll */ 62549); function concatAll() { return (0,_mergeAll__WEBPACK_IMPORTED_MODULE_0__.mergeAll)(1); } /***/ }, /***/ 31050 /*!********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/concatMap.js ***! \********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ concatMap: () => (/* binding */ concatMap) /* harmony export */ }); /* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mergeMap */ 91532); /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isFunction */ 41407); function concatMap(project, resultSelector) { return (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_1__.isFunction)(resultSelector) ? (0,_mergeMap__WEBPACK_IMPORTED_MODULE_0__.mergeMap)(project, resultSelector, 1) : (0,_mergeMap__WEBPACK_IMPORTED_MODULE_0__.mergeMap)(project, 1); } /***/ }, /***/ 57168 /*!***********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/debounceTime.js ***! \***********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ debounceTime: () => (/* binding */ debounceTime) /* harmony export */ }); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ 32348); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/lift */ 8638); /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OperatorSubscriber */ 33776); function debounceTime(dueTime, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__.asyncScheduler) { return (0,_util_lift__WEBPACK_IMPORTED_MODULE_1__.operate)((source, subscriber) => { let activeTask = null; let lastValue = null; let lastTime = null; const emit = () => { if (activeTask) { activeTask.unsubscribe(); activeTask = null; const value = lastValue; lastValue = null; subscriber.next(value); } }; function emitWhenIdle() { const targetTime = lastTime + dueTime; const now = scheduler.now(); if (now < targetTime) { activeTask = this.schedule(undefined, targetTime - now); subscriber.add(activeTask); return; } emit(); } source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, value => { lastValue = value; lastTime = scheduler.now(); if (!activeTask) { activeTask = scheduler.schedule(emitWhenIdle, dueTime); subscriber.add(activeTask); } }, () => { emit(); subscriber.complete(); }, undefined, () => { lastValue = activeTask = null; })); }); } /***/ }, /***/ 31749 /*!*************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/defaultIfEmpty.js ***! \*************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ defaultIfEmpty: () => (/* binding */ defaultIfEmpty) /* harmony export */ }); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/lift */ 8638); /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./OperatorSubscriber */ 33776); function defaultIfEmpty(defaultValue) { return (0,_util_lift__WEBPACK_IMPORTED_MODULE_0__.operate)((source, subscriber) => { let hasValue = false; source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__.createOperatorSubscriber)(subscriber, value => { hasValue = true; subscriber.next(value); }, () => { if (!hasValue) { subscriber.next(defaultValue); } subscriber.complete(); })); }); } /***/ }, /***/ 8102 /*!*******************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/distinctUntilChanged.js ***! \*******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ distinctUntilChanged: () => (/* binding */ distinctUntilChanged) /* harmony export */ }); /* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/identity */ 4701); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/lift */ 8638); /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OperatorSubscriber */ 33776); function distinctUntilChanged(comparator, keySelector = _util_identity__WEBPACK_IMPORTED_MODULE_0__.identity) { comparator = comparator !== null && comparator !== void 0 ? comparator : defaultCompare; return (0,_util_lift__WEBPACK_IMPORTED_MODULE_1__.operate)((source, subscriber) => { let previousKey; let first = true; source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, value => { const currentKey = keySelector(value); if (first || !comparator(previousKey, currentKey)) { first = false; previousKey = currentKey; subscriber.next(value); } })); }); } function defaultCompare(a, b) { return a === b; } /***/ }, /***/ 12045 /*!**********************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/distinctUntilKeyChanged.js ***! \**********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ distinctUntilKeyChanged: () => (/* binding */ distinctUntilKeyChanged) /* harmony export */ }); /* harmony import */ var _distinctUntilChanged__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./distinctUntilChanged */ 8102); function distinctUntilKeyChanged(key, compare) { return (0,_distinctUntilChanged__WEBPACK_IMPORTED_MODULE_0__.distinctUntilChanged)((x, y) => compare ? compare(x[key], y[key]) : x[key] === y[key]); } /***/ }, /***/ 59380 /*!*****************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/filter.js ***! \*****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ filter: () => (/* binding */ filter) /* harmony export */ }); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/lift */ 8638); /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./OperatorSubscriber */ 33776); function filter(predicate, thisArg) { return (0,_util_lift__WEBPACK_IMPORTED_MODULE_0__.operate)((source, subscriber) => { let index = 0; source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__.createOperatorSubscriber)(subscriber, value => predicate.call(thisArg, value, index++) && subscriber.next(value))); }); } /***/ }, /***/ 88412 /*!*******************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/finalize.js ***! \*******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ finalize: () => (/* binding */ finalize) /* harmony export */ }); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/lift */ 8638); function finalize(callback) { return (0,_util_lift__WEBPACK_IMPORTED_MODULE_0__.operate)((source, subscriber) => { try { source.subscribe(subscriber); } finally { subscriber.add(callback); } }); } /***/ }, /***/ 30242 /*!****************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/first.js ***! \****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ first: () => (/* binding */ first) /* harmony export */ }); /* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/EmptyError */ 77294); /* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./filter */ 59380); /* harmony import */ var _take__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./take */ 13329); /* harmony import */ var _defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./defaultIfEmpty */ 31749); /* harmony import */ var _throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./throwIfEmpty */ 36582); /* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/identity */ 4701); function first(predicate, defaultValue) { const hasDefaultValue = arguments.length >= 2; return source => source.pipe(predicate ? (0,_filter__WEBPACK_IMPORTED_MODULE_1__.filter)((v, i) => predicate(v, i, source)) : _util_identity__WEBPACK_IMPORTED_MODULE_5__.identity, (0,_take__WEBPACK_IMPORTED_MODULE_2__.take)(1), hasDefaultValue ? (0,_defaultIfEmpty__WEBPACK_IMPORTED_MODULE_3__.defaultIfEmpty)(defaultValue) : (0,_throwIfEmpty__WEBPACK_IMPORTED_MODULE_4__.throwIfEmpty)(() => new _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__.EmptyError())); } /***/ }, /***/ 38442 /*!**************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/map.js ***! \**************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ map: () => (/* binding */ map) /* harmony export */ }); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/lift */ 8638); /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./OperatorSubscriber */ 33776); function map(project, thisArg) { return (0,_util_lift__WEBPACK_IMPORTED_MODULE_0__.operate)((source, subscriber) => { let index = 0; source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__.createOperatorSubscriber)(subscriber, value => { subscriber.next(project.call(thisArg, value, index++)); })); }); } /***/ }, /***/ 79420 /*!****************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/merge.js ***! \****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ merge: () => (/* binding */ merge) /* harmony export */ }); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/lift */ 8638); /* harmony import */ var _mergeAll__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mergeAll */ 62549); /* harmony import */ var _util_args__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/args */ 97030); /* harmony import */ var _observable_from__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../observable/from */ 84356); function merge(...args) { const scheduler = (0,_util_args__WEBPACK_IMPORTED_MODULE_2__.popScheduler)(args); const concurrent = (0,_util_args__WEBPACK_IMPORTED_MODULE_2__.popNumber)(args, Infinity); return (0,_util_lift__WEBPACK_IMPORTED_MODULE_0__.operate)((source, subscriber) => { (0,_mergeAll__WEBPACK_IMPORTED_MODULE_1__.mergeAll)(concurrent)((0,_observable_from__WEBPACK_IMPORTED_MODULE_3__.from)([source, ...args], scheduler)).subscribe(subscriber); }); } /***/ }, /***/ 62549 /*!*******************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/mergeAll.js ***! \*******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ mergeAll: () => (/* binding */ mergeAll) /* harmony export */ }); /* harmony import */ var _mergeMap__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mergeMap */ 91532); /* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/identity */ 4701); function mergeAll(concurrent = Infinity) { return (0,_mergeMap__WEBPACK_IMPORTED_MODULE_0__.mergeMap)(_util_identity__WEBPACK_IMPORTED_MODULE_1__.identity, concurrent); } /***/ }, /***/ 6524 /*!*************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/mergeInternals.js ***! \*************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ mergeInternals: () => (/* binding */ mergeInternals) /* harmony export */ }); /* harmony import */ var _observable_innerFrom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/innerFrom */ 16822); /* harmony import */ var _util_executeSchedule__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/executeSchedule */ 83521); /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OperatorSubscriber */ 33776); function mergeInternals(source, subscriber, project, concurrent, onBeforeNext, expand, innerSubScheduler, additionalFinalizer) { const buffer = []; let active = 0; let index = 0; let isComplete = false; const checkComplete = () => { if (isComplete && !buffer.length && !active) { subscriber.complete(); } }; const outerNext = value => active < concurrent ? doInnerSub(value) : buffer.push(value); const doInnerSub = value => { expand && subscriber.next(value); active++; let innerComplete = false; (0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_0__.innerFrom)(project(value, index++)).subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, innerValue => { onBeforeNext === null || onBeforeNext === void 0 ? void 0 : onBeforeNext(innerValue); if (expand) { outerNext(innerValue); } else { subscriber.next(innerValue); } }, () => { innerComplete = true; }, undefined, () => { if (innerComplete) { try { active--; while (buffer.length && active < concurrent) { const bufferedValue = buffer.shift(); if (innerSubScheduler) { (0,_util_executeSchedule__WEBPACK_IMPORTED_MODULE_1__.executeSchedule)(subscriber, innerSubScheduler, () => doInnerSub(bufferedValue)); } else { doInnerSub(bufferedValue); } } checkComplete(); } catch (err) { subscriber.error(err); } } })); }; source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, outerNext, () => { isComplete = true; checkComplete(); })); return () => { additionalFinalizer === null || additionalFinalizer === void 0 ? void 0 : additionalFinalizer(); }; } /***/ }, /***/ 91532 /*!*******************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/mergeMap.js ***! \*******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ mergeMap: () => (/* binding */ mergeMap) /* harmony export */ }); /* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./map */ 38442); /* harmony import */ var _observable_innerFrom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../observable/innerFrom */ 16822); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/lift */ 8638); /* harmony import */ var _mergeInternals__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mergeInternals */ 6524); /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/isFunction */ 41407); function mergeMap(project, resultSelector, concurrent = Infinity) { if ((0,_util_isFunction__WEBPACK_IMPORTED_MODULE_4__.isFunction)(resultSelector)) { return mergeMap((a, i) => (0,_map__WEBPACK_IMPORTED_MODULE_0__.map)((b, ii) => resultSelector(a, b, i, ii))((0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_1__.innerFrom)(project(a, i))), concurrent); } else if (typeof resultSelector === 'number') { concurrent = resultSelector; } return (0,_util_lift__WEBPACK_IMPORTED_MODULE_2__.operate)((source, subscriber) => (0,_mergeInternals__WEBPACK_IMPORTED_MODULE_3__.mergeInternals)(source, subscriber, project, concurrent)); } /***/ }, /***/ 22020 /*!********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/mergeWith.js ***! \********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ mergeWith: () => (/* binding */ mergeWith) /* harmony export */ }); /* harmony import */ var _merge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./merge */ 79420); function mergeWith(...otherSources) { return (0,_merge__WEBPACK_IMPORTED_MODULE_0__.merge)(...otherSources); } /***/ }, /***/ 53493 /*!********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/observeOn.js ***! \********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ observeOn: () => (/* binding */ observeOn) /* harmony export */ }); /* harmony import */ var _util_executeSchedule__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/executeSchedule */ 83521); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/lift */ 8638); /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OperatorSubscriber */ 33776); function observeOn(scheduler, delay = 0) { return (0,_util_lift__WEBPACK_IMPORTED_MODULE_1__.operate)((source, subscriber) => { source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, value => (0,_util_executeSchedule__WEBPACK_IMPORTED_MODULE_0__.executeSchedule)(subscriber, scheduler, () => subscriber.next(value), delay), () => (0,_util_executeSchedule__WEBPACK_IMPORTED_MODULE_0__.executeSchedule)(subscriber, scheduler, () => subscriber.complete(), delay), err => (0,_util_executeSchedule__WEBPACK_IMPORTED_MODULE_0__.executeSchedule)(subscriber, scheduler, () => subscriber.error(err), delay))); }); } /***/ }, /***/ 90242 /*!*******************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/pairwise.js ***! \*******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ pairwise: () => (/* binding */ pairwise) /* harmony export */ }); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/lift */ 8638); /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./OperatorSubscriber */ 33776); function pairwise() { return (0,_util_lift__WEBPACK_IMPORTED_MODULE_0__.operate)((source, subscriber) => { let prev; let hasPrev = false; source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__.createOperatorSubscriber)(subscriber, value => { const p = prev; prev = value; hasPrev && subscriber.next([p, value]); hasPrev = true; })); }); } /***/ }, /***/ 29922 /*!*******************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/refCount.js ***! \*******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ refCount: () => (/* binding */ refCount) /* harmony export */ }); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/lift */ 8638); /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./OperatorSubscriber */ 33776); function refCount() { return (0,_util_lift__WEBPACK_IMPORTED_MODULE_0__.operate)((source, subscriber) => { let connection = null; source._refCount++; const refCounter = (0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__.createOperatorSubscriber)(subscriber, undefined, undefined, undefined, () => { if (!source || source._refCount <= 0 || 0 < --source._refCount) { connection = null; return; } const sharedConnection = source._connection; const conn = connection; connection = null; if (sharedConnection && (!conn || sharedConnection === conn)) { sharedConnection.unsubscribe(); } subscriber.unsubscribe(); }); source.subscribe(refCounter); if (!refCounter.closed) { connection = source.connect(); } }); } /***/ }, /***/ 41434 /*!****************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/retry.js ***! \****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ retry: () => (/* binding */ retry) /* harmony export */ }); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/lift */ 8638); /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./OperatorSubscriber */ 33776); /* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/identity */ 4701); /* harmony import */ var _observable_timer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../observable/timer */ 38647); /* harmony import */ var _observable_innerFrom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../observable/innerFrom */ 16822); function retry(configOrCount = Infinity) { let config; if (configOrCount && typeof configOrCount === 'object') { config = configOrCount; } else { config = { count: configOrCount }; } const { count = Infinity, delay, resetOnSuccess = false } = config; return count <= 0 ? _util_identity__WEBPACK_IMPORTED_MODULE_2__.identity : (0,_util_lift__WEBPACK_IMPORTED_MODULE_0__.operate)((source, subscriber) => { let soFar = 0; let innerSub; const subscribeForRetry = () => { let syncUnsub = false; innerSub = source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__.createOperatorSubscriber)(subscriber, value => { if (resetOnSuccess) { soFar = 0; } subscriber.next(value); }, undefined, err => { if (soFar++ < count) { const resub = () => { if (innerSub) { innerSub.unsubscribe(); innerSub = null; subscribeForRetry(); } else { syncUnsub = true; } }; if (delay != null) { const notifier = typeof delay === 'number' ? (0,_observable_timer__WEBPACK_IMPORTED_MODULE_3__.timer)(delay) : (0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_4__.innerFrom)(delay(err, soFar)); const notifierSubscriber = (0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__.createOperatorSubscriber)(subscriber, () => { notifierSubscriber.unsubscribe(); resub(); }, () => { subscriber.complete(); }); notifier.subscribe(notifierSubscriber); } else { resub(); } } else { subscriber.error(err); } })); if (syncUnsub) { innerSub.unsubscribe(); innerSub = null; subscribeForRetry(); } }; subscribeForRetry(); }); } /***/ }, /***/ 6103 /*!****************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/share.js ***! \****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ share: () => (/* binding */ share) /* harmony export */ }); /* harmony import */ var _observable_innerFrom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/innerFrom */ 16822); /* harmony import */ var _Subject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Subject */ 33242); /* harmony import */ var _Subscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Subscriber */ 55518); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/lift */ 8638); function share(options = {}) { const { connector = () => new _Subject__WEBPACK_IMPORTED_MODULE_1__.Subject(), resetOnError = true, resetOnComplete = true, resetOnRefCountZero = true } = options; return wrapperSource => { let connection; let resetConnection; let subject; let refCount = 0; let hasCompleted = false; let hasErrored = false; const cancelReset = () => { resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe(); resetConnection = undefined; }; const reset = () => { cancelReset(); connection = subject = undefined; hasCompleted = hasErrored = false; }; const resetAndUnsubscribe = () => { const conn = connection; reset(); conn === null || conn === void 0 ? void 0 : conn.unsubscribe(); }; return (0,_util_lift__WEBPACK_IMPORTED_MODULE_3__.operate)((source, subscriber) => { refCount++; if (!hasErrored && !hasCompleted) { cancelReset(); } const dest = subject = subject !== null && subject !== void 0 ? subject : connector(); subscriber.add(() => { refCount--; if (refCount === 0 && !hasErrored && !hasCompleted) { resetConnection = handleReset(resetAndUnsubscribe, resetOnRefCountZero); } }); dest.subscribe(subscriber); if (!connection && refCount > 0) { connection = new _Subscriber__WEBPACK_IMPORTED_MODULE_2__.SafeSubscriber({ next: value => dest.next(value), error: err => { hasErrored = true; cancelReset(); resetConnection = handleReset(reset, resetOnError, err); dest.error(err); }, complete: () => { hasCompleted = true; cancelReset(); resetConnection = handleReset(reset, resetOnComplete); dest.complete(); } }); (0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_0__.innerFrom)(source).subscribe(connection); } })(wrapperSource); }; } function handleReset(reset, on, ...args) { if (on === true) { reset(); return; } if (on === false) { return; } const onSubscriber = new _Subscriber__WEBPACK_IMPORTED_MODULE_2__.SafeSubscriber({ next: () => { onSubscriber.unsubscribe(); reset(); } }); return (0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_0__.innerFrom)(on(...args)).subscribe(onSubscriber); } /***/ }, /***/ 27588 /*!**********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/shareReplay.js ***! \**********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ shareReplay: () => (/* binding */ shareReplay) /* harmony export */ }); /* harmony import */ var _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ReplaySubject */ 87675); /* harmony import */ var _share__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./share */ 6103); function shareReplay(configOrBufferSize, windowTime, scheduler) { let bufferSize; let refCount = false; if (configOrBufferSize && typeof configOrBufferSize === 'object') { ({ bufferSize = Infinity, windowTime = Infinity, refCount = false, scheduler } = configOrBufferSize); } else { bufferSize = configOrBufferSize !== null && configOrBufferSize !== void 0 ? configOrBufferSize : Infinity; } return (0,_share__WEBPACK_IMPORTED_MODULE_1__.share)({ connector: () => new _ReplaySubject__WEBPACK_IMPORTED_MODULE_0__.ReplaySubject(bufferSize, windowTime, scheduler), resetOnError: true, resetOnComplete: false, resetOnRefCountZero: refCount }); } /***/ }, /***/ 9588 /*!********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/skipWhile.js ***! \********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ skipWhile: () => (/* binding */ skipWhile) /* harmony export */ }); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/lift */ 8638); /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./OperatorSubscriber */ 33776); function skipWhile(predicate) { return (0,_util_lift__WEBPACK_IMPORTED_MODULE_0__.operate)((source, subscriber) => { let taking = false; let index = 0; source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__.createOperatorSubscriber)(subscriber, value => (taking || (taking = !predicate(value, index++))) && subscriber.next(value))); }); } /***/ }, /***/ 9276 /*!********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/startWith.js ***! \********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ startWith: () => (/* binding */ startWith) /* harmony export */ }); /* harmony import */ var _observable_concat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/concat */ 13096); /* harmony import */ var _util_args__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/args */ 97030); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/lift */ 8638); function startWith(...values) { const scheduler = (0,_util_args__WEBPACK_IMPORTED_MODULE_1__.popScheduler)(values); return (0,_util_lift__WEBPACK_IMPORTED_MODULE_2__.operate)((source, subscriber) => { (scheduler ? (0,_observable_concat__WEBPACK_IMPORTED_MODULE_0__.concat)(values, source, scheduler) : (0,_observable_concat__WEBPACK_IMPORTED_MODULE_0__.concat)(values, source)).subscribe(subscriber); }); } /***/ }, /***/ 51409 /*!**********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/subscribeOn.js ***! \**********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ subscribeOn: () => (/* binding */ subscribeOn) /* harmony export */ }); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/lift */ 8638); function subscribeOn(scheduler, delay = 0) { return (0,_util_lift__WEBPACK_IMPORTED_MODULE_0__.operate)((source, subscriber) => { subscriber.add(scheduler.schedule(() => source.subscribe(subscriber), delay)); }); } /***/ }, /***/ 86110 /*!********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/switchMap.js ***! \********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ switchMap: () => (/* binding */ switchMap) /* harmony export */ }); /* harmony import */ var _observable_innerFrom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/innerFrom */ 16822); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/lift */ 8638); /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OperatorSubscriber */ 33776); function switchMap(project, resultSelector) { return (0,_util_lift__WEBPACK_IMPORTED_MODULE_1__.operate)((source, subscriber) => { let innerSubscriber = null; let index = 0; let isComplete = false; const checkComplete = () => isComplete && !innerSubscriber && subscriber.complete(); source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, value => { innerSubscriber === null || innerSubscriber === void 0 ? void 0 : innerSubscriber.unsubscribe(); let innerIndex = 0; const outerIndex = index++; (0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_0__.innerFrom)(project(value, outerIndex)).subscribe(innerSubscriber = (0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, innerValue => subscriber.next(resultSelector ? resultSelector(value, innerValue, outerIndex, innerIndex++) : innerValue), () => { innerSubscriber = null; checkComplete(); })); }, () => { isComplete = true; checkComplete(); })); }); } /***/ }, /***/ 13329 /*!***************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/take.js ***! \***************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ take: () => (/* binding */ take) /* harmony export */ }); /* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/empty */ 90015); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/lift */ 8638); /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OperatorSubscriber */ 33776); function take(count) { return count <= 0 ? () => _observable_empty__WEBPACK_IMPORTED_MODULE_0__.EMPTY : (0,_util_lift__WEBPACK_IMPORTED_MODULE_1__.operate)((source, subscriber) => { let seen = 0; source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, value => { if (++seen <= count) { subscriber.next(value); if (count <= seen) { subscriber.complete(); } } })); }); } /***/ }, /***/ 83885 /*!*******************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/takeLast.js ***! \*******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ takeLast: () => (/* binding */ takeLast) /* harmony export */ }); /* harmony import */ var _observable_empty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/empty */ 90015); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/lift */ 8638); /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OperatorSubscriber */ 33776); function takeLast(count) { return count <= 0 ? () => _observable_empty__WEBPACK_IMPORTED_MODULE_0__.EMPTY : (0,_util_lift__WEBPACK_IMPORTED_MODULE_1__.operate)((source, subscriber) => { let buffer = []; source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, value => { buffer.push(value); count < buffer.length && buffer.shift(); }, () => { for (const value of buffer) { subscriber.next(value); } subscriber.complete(); }, undefined, () => { buffer = null; })); }); } /***/ }, /***/ 53897 /*!********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/takeUntil.js ***! \********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ takeUntil: () => (/* binding */ takeUntil) /* harmony export */ }); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/lift */ 8638); /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./OperatorSubscriber */ 33776); /* harmony import */ var _observable_innerFrom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../observable/innerFrom */ 16822); /* harmony import */ var _util_noop__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/noop */ 30695); function takeUntil(notifier) { return (0,_util_lift__WEBPACK_IMPORTED_MODULE_0__.operate)((source, subscriber) => { (0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_2__.innerFrom)(notifier).subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__.createOperatorSubscriber)(subscriber, () => subscriber.complete(), _util_noop__WEBPACK_IMPORTED_MODULE_3__.noop)); !subscriber.closed && source.subscribe(subscriber); }); } /***/ }, /***/ 45541 /*!**************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/tap.js ***! \**************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ tap: () => (/* binding */ tap) /* harmony export */ }); /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/isFunction */ 41407); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/lift */ 8638); /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OperatorSubscriber */ 33776); /* harmony import */ var _util_identity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/identity */ 4701); function tap(observerOrNext, error, complete) { const tapObserver = (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(observerOrNext) || error || complete ? { next: observerOrNext, error, complete } : observerOrNext; return tapObserver ? (0,_util_lift__WEBPACK_IMPORTED_MODULE_1__.operate)((source, subscriber) => { var _a; (_a = tapObserver.subscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver); let isUnsub = true; source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, value => { var _a; (_a = tapObserver.next) === null || _a === void 0 ? void 0 : _a.call(tapObserver, value); subscriber.next(value); }, () => { var _a; isUnsub = false; (_a = tapObserver.complete) === null || _a === void 0 ? void 0 : _a.call(tapObserver); subscriber.complete(); }, err => { var _a; isUnsub = false; (_a = tapObserver.error) === null || _a === void 0 ? void 0 : _a.call(tapObserver, err); subscriber.error(err); }, () => { var _a, _b; if (isUnsub) { (_a = tapObserver.unsubscribe) === null || _a === void 0 ? void 0 : _a.call(tapObserver); } (_b = tapObserver.finalize) === null || _b === void 0 ? void 0 : _b.call(tapObserver); })); }) : _util_identity__WEBPACK_IMPORTED_MODULE_3__.identity; } /***/ }, /***/ 80830 /*!*******************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/throttle.js ***! \*******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ throttle: () => (/* binding */ throttle) /* harmony export */ }); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/lift */ 8638); /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./OperatorSubscriber */ 33776); /* harmony import */ var _observable_innerFrom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../observable/innerFrom */ 16822); function throttle(durationSelector, config) { return (0,_util_lift__WEBPACK_IMPORTED_MODULE_0__.operate)((source, subscriber) => { const { leading = true, trailing = false } = config !== null && config !== void 0 ? config : {}; let hasValue = false; let sendValue = null; let throttled = null; let isComplete = false; const endThrottling = () => { throttled === null || throttled === void 0 ? void 0 : throttled.unsubscribe(); throttled = null; if (trailing) { send(); isComplete && subscriber.complete(); } }; const cleanupThrottling = () => { throttled = null; isComplete && subscriber.complete(); }; const startThrottle = value => throttled = (0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_2__.innerFrom)(durationSelector(value)).subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__.createOperatorSubscriber)(subscriber, endThrottling, cleanupThrottling)); const send = () => { if (hasValue) { hasValue = false; const value = sendValue; sendValue = null; subscriber.next(value); !isComplete && startThrottle(value); } }; source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_1__.createOperatorSubscriber)(subscriber, value => { hasValue = true; sendValue = value; !(throttled && !throttled.closed) && (leading ? send() : startThrottle(value)); }, () => { isComplete = true; !(trailing && hasValue && throttled && !throttled.closed) && subscriber.complete(); })); }); } /***/ }, /***/ 53291 /*!***********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/throttleTime.js ***! \***********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ throttleTime: () => (/* binding */ throttleTime) /* harmony export */ }); /* harmony import */ var _scheduler_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../scheduler/async */ 32348); /* harmony import */ var _throttle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./throttle */ 80830); /* harmony import */ var _observable_timer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../observable/timer */ 38647); function throttleTime(duration, scheduler = _scheduler_async__WEBPACK_IMPORTED_MODULE_0__.asyncScheduler, config) { const duration$ = (0,_observable_timer__WEBPACK_IMPORTED_MODULE_2__.timer)(duration, scheduler); return (0,_throttle__WEBPACK_IMPORTED_MODULE_1__.throttle)(() => duration$, config); } /***/ }, /***/ 36582 /*!***********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/operators/throwIfEmpty.js ***! \***********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ throwIfEmpty: () => (/* binding */ throwIfEmpty) /* harmony export */ }); /* harmony import */ var _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/EmptyError */ 77294); /* harmony import */ var _util_lift__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/lift */ 8638); /* harmony import */ var _OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OperatorSubscriber */ 33776); function throwIfEmpty(errorFactory = defaultErrorFactory) { return (0,_util_lift__WEBPACK_IMPORTED_MODULE_1__.operate)((source, subscriber) => { let hasValue = false; source.subscribe((0,_OperatorSubscriber__WEBPACK_IMPORTED_MODULE_2__.createOperatorSubscriber)(subscriber, value => { hasValue = true; subscriber.next(value); }, () => hasValue ? subscriber.complete() : subscriber.error(errorFactory()))); }); } function defaultErrorFactory() { return new _util_EmptyError__WEBPACK_IMPORTED_MODULE_0__.EmptyError(); } /***/ }, /***/ 13804 /*!************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduled/scheduleArray.js ***! \************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ scheduleArray: () => (/* binding */ scheduleArray) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 57417); function scheduleArray(input, scheduler) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => { let i = 0; return scheduler.schedule(function () { if (i === input.length) { subscriber.complete(); } else { subscriber.next(input[i++]); if (!subscriber.closed) { this.schedule(); } } }); }); } /***/ }, /***/ 22019 /*!********************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduled/scheduleAsyncIterable.js ***! \********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ scheduleAsyncIterable: () => (/* binding */ scheduleAsyncIterable) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 57417); /* harmony import */ var _util_executeSchedule__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/executeSchedule */ 83521); function scheduleAsyncIterable(input, scheduler) { if (!input) { throw new Error('Iterable cannot be null'); } return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => { (0,_util_executeSchedule__WEBPACK_IMPORTED_MODULE_1__.executeSchedule)(subscriber, scheduler, () => { const iterator = input[Symbol.asyncIterator](); (0,_util_executeSchedule__WEBPACK_IMPORTED_MODULE_1__.executeSchedule)(subscriber, scheduler, () => { iterator.next().then(result => { if (result.done) { subscriber.complete(); } else { subscriber.next(result.value); } }); }, 0, true); }); }); } /***/ }, /***/ 52615 /*!***************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduled/scheduleIterable.js ***! \***************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ scheduleIterable: () => (/* binding */ scheduleIterable) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 57417); /* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../symbol/iterator */ 67793); /* harmony import */ var _util_isFunction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/isFunction */ 41407); /* harmony import */ var _util_executeSchedule__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/executeSchedule */ 83521); function scheduleIterable(input, scheduler) { return new _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => { let iterator; (0,_util_executeSchedule__WEBPACK_IMPORTED_MODULE_3__.executeSchedule)(subscriber, scheduler, () => { iterator = input[_symbol_iterator__WEBPACK_IMPORTED_MODULE_1__.iterator](); (0,_util_executeSchedule__WEBPACK_IMPORTED_MODULE_3__.executeSchedule)(subscriber, scheduler, () => { let value; let done; try { ({ value, done } = iterator.next()); } catch (err) { subscriber.error(err); return; } if (done) { subscriber.complete(); } else { subscriber.next(value); } }, 0, true); }); return () => (0,_util_isFunction__WEBPACK_IMPORTED_MODULE_2__.isFunction)(iterator === null || iterator === void 0 ? void 0 : iterator.return) && iterator.return(); }); } /***/ }, /***/ 50212 /*!*****************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduled/scheduleObservable.js ***! \*****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ scheduleObservable: () => (/* binding */ scheduleObservable) /* harmony export */ }); /* harmony import */ var _observable_innerFrom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/innerFrom */ 16822); /* harmony import */ var _operators_observeOn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../operators/observeOn */ 53493); /* harmony import */ var _operators_subscribeOn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operators/subscribeOn */ 51409); function scheduleObservable(input, scheduler) { return (0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_0__.innerFrom)(input).pipe((0,_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_2__.subscribeOn)(scheduler), (0,_operators_observeOn__WEBPACK_IMPORTED_MODULE_1__.observeOn)(scheduler)); } /***/ }, /***/ 11948 /*!**************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduled/schedulePromise.js ***! \**************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ schedulePromise: () => (/* binding */ schedulePromise) /* harmony export */ }); /* harmony import */ var _observable_innerFrom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../observable/innerFrom */ 16822); /* harmony import */ var _operators_observeOn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../operators/observeOn */ 53493); /* harmony import */ var _operators_subscribeOn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../operators/subscribeOn */ 51409); function schedulePromise(input, scheduler) { return (0,_observable_innerFrom__WEBPACK_IMPORTED_MODULE_0__.innerFrom)(input).pipe((0,_operators_subscribeOn__WEBPACK_IMPORTED_MODULE_2__.subscribeOn)(scheduler), (0,_operators_observeOn__WEBPACK_IMPORTED_MODULE_1__.observeOn)(scheduler)); } /***/ }, /***/ 61386 /*!*************************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduled/scheduleReadableStreamLike.js ***! \*************************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ scheduleReadableStreamLike: () => (/* binding */ scheduleReadableStreamLike) /* harmony export */ }); /* harmony import */ var _scheduleAsyncIterable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scheduleAsyncIterable */ 22019); /* harmony import */ var _util_isReadableStreamLike__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/isReadableStreamLike */ 11732); function scheduleReadableStreamLike(input, scheduler) { return (0,_scheduleAsyncIterable__WEBPACK_IMPORTED_MODULE_0__.scheduleAsyncIterable)((0,_util_isReadableStreamLike__WEBPACK_IMPORTED_MODULE_1__.readableStreamLikeToAsyncGenerator)(input), scheduler); } /***/ }, /***/ 48217 /*!********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduled/scheduled.js ***! \********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ scheduled: () => (/* binding */ scheduled) /* harmony export */ }); /* harmony import */ var _scheduleObservable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./scheduleObservable */ 50212); /* harmony import */ var _schedulePromise__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./schedulePromise */ 11948); /* harmony import */ var _scheduleArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./scheduleArray */ 13804); /* harmony import */ var _scheduleIterable__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./scheduleIterable */ 52615); /* harmony import */ var _scheduleAsyncIterable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./scheduleAsyncIterable */ 22019); /* harmony import */ var _util_isInteropObservable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/isInteropObservable */ 77111); /* harmony import */ var _util_isPromise__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../util/isPromise */ 89466); /* harmony import */ var _util_isArrayLike__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../util/isArrayLike */ 36745); /* harmony import */ var _util_isIterable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../util/isIterable */ 91997); /* harmony import */ var _util_isAsyncIterable__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../util/isAsyncIterable */ 61401); /* harmony import */ var _util_throwUnobservableError__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../util/throwUnobservableError */ 28727); /* harmony import */ var _util_isReadableStreamLike__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../util/isReadableStreamLike */ 11732); /* harmony import */ var _scheduleReadableStreamLike__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./scheduleReadableStreamLike */ 61386); function scheduled(input, scheduler) { if (input != null) { if ((0,_util_isInteropObservable__WEBPACK_IMPORTED_MODULE_5__.isInteropObservable)(input)) { return (0,_scheduleObservable__WEBPACK_IMPORTED_MODULE_0__.scheduleObservable)(input, scheduler); } if ((0,_util_isArrayLike__WEBPACK_IMPORTED_MODULE_7__.isArrayLike)(input)) { return (0,_scheduleArray__WEBPACK_IMPORTED_MODULE_2__.scheduleArray)(input, scheduler); } if ((0,_util_isPromise__WEBPACK_IMPORTED_MODULE_6__.isPromise)(input)) { return (0,_schedulePromise__WEBPACK_IMPORTED_MODULE_1__.schedulePromise)(input, scheduler); } if ((0,_util_isAsyncIterable__WEBPACK_IMPORTED_MODULE_9__.isAsyncIterable)(input)) { return (0,_scheduleAsyncIterable__WEBPACK_IMPORTED_MODULE_4__.scheduleAsyncIterable)(input, scheduler); } if ((0,_util_isIterable__WEBPACK_IMPORTED_MODULE_8__.isIterable)(input)) { return (0,_scheduleIterable__WEBPACK_IMPORTED_MODULE_3__.scheduleIterable)(input, scheduler); } if ((0,_util_isReadableStreamLike__WEBPACK_IMPORTED_MODULE_11__.isReadableStreamLike)(input)) { return (0,_scheduleReadableStreamLike__WEBPACK_IMPORTED_MODULE_12__.scheduleReadableStreamLike)(input, scheduler); } } throw (0,_util_throwUnobservableError__WEBPACK_IMPORTED_MODULE_10__.createInvalidObservableTypeError)(input); } /***/ }, /***/ 90772 /*!*****************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduler/Action.js ***! \*****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Action: () => (/* binding */ Action) /* harmony export */ }); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscription */ 72737); class Action extends _Subscription__WEBPACK_IMPORTED_MODULE_0__.Subscription { constructor(scheduler, work) { super(); } schedule(state, delay = 0) { return this; } } /***/ }, /***/ 5139 /*!*******************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduler/AnimationFrameAction.js ***! \*******************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AnimationFrameAction: () => (/* binding */ AnimationFrameAction) /* harmony export */ }); /* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsyncAction */ 70782); /* harmony import */ var _animationFrameProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./animationFrameProvider */ 77312); class AnimationFrameAction extends _AsyncAction__WEBPACK_IMPORTED_MODULE_0__.AsyncAction { constructor(scheduler, work) { super(scheduler, work); this.scheduler = scheduler; this.work = work; } requestAsyncId(scheduler, id, delay = 0) { if (delay !== null && delay > 0) { return super.requestAsyncId(scheduler, id, delay); } scheduler.actions.push(this); return scheduler._scheduled || (scheduler._scheduled = _animationFrameProvider__WEBPACK_IMPORTED_MODULE_1__.animationFrameProvider.requestAnimationFrame(() => scheduler.flush(undefined))); } recycleAsyncId(scheduler, id, delay = 0) { var _a; if (delay != null ? delay > 0 : this.delay > 0) { return super.recycleAsyncId(scheduler, id, delay); } const { actions } = scheduler; if (id != null && id === scheduler._scheduled && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) { _animationFrameProvider__WEBPACK_IMPORTED_MODULE_1__.animationFrameProvider.cancelAnimationFrame(id); scheduler._scheduled = undefined; } return undefined; } } /***/ }, /***/ 832 /*!**********************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduler/AnimationFrameScheduler.js ***! \**********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AnimationFrameScheduler: () => (/* binding */ AnimationFrameScheduler) /* harmony export */ }); /* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsyncScheduler */ 26955); class AnimationFrameScheduler extends _AsyncScheduler__WEBPACK_IMPORTED_MODULE_0__.AsyncScheduler { flush(action) { this._active = true; let flushId; if (action) { flushId = action.id; } else { flushId = this._scheduled; this._scheduled = undefined; } const { actions } = this; let error; action = action || actions.shift(); do { if (error = action.execute(action.state, action.delay)) { break; } } while ((action = actions[0]) && action.id === flushId && actions.shift()); this._active = false; if (error) { while ((action = actions[0]) && action.id === flushId && actions.shift()) { action.unsubscribe(); } throw error; } } } /***/ }, /***/ 18481 /*!*********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduler/AsapAction.js ***! \*********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AsapAction: () => (/* binding */ AsapAction) /* harmony export */ }); /* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsyncAction */ 70782); /* harmony import */ var _immediateProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./immediateProvider */ 12460); class AsapAction extends _AsyncAction__WEBPACK_IMPORTED_MODULE_0__.AsyncAction { constructor(scheduler, work) { super(scheduler, work); this.scheduler = scheduler; this.work = work; } requestAsyncId(scheduler, id, delay = 0) { if (delay !== null && delay > 0) { return super.requestAsyncId(scheduler, id, delay); } scheduler.actions.push(this); return scheduler._scheduled || (scheduler._scheduled = _immediateProvider__WEBPACK_IMPORTED_MODULE_1__.immediateProvider.setImmediate(scheduler.flush.bind(scheduler, undefined))); } recycleAsyncId(scheduler, id, delay = 0) { var _a; if (delay != null ? delay > 0 : this.delay > 0) { return super.recycleAsyncId(scheduler, id, delay); } const { actions } = scheduler; if (id != null && ((_a = actions[actions.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) { _immediateProvider__WEBPACK_IMPORTED_MODULE_1__.immediateProvider.clearImmediate(id); if (scheduler._scheduled === id) { scheduler._scheduled = undefined; } } return undefined; } } /***/ }, /***/ 61282 /*!************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduler/AsapScheduler.js ***! \************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AsapScheduler: () => (/* binding */ AsapScheduler) /* harmony export */ }); /* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsyncScheduler */ 26955); class AsapScheduler extends _AsyncScheduler__WEBPACK_IMPORTED_MODULE_0__.AsyncScheduler { flush(action) { this._active = true; const flushId = this._scheduled; this._scheduled = undefined; const { actions } = this; let error; action = action || actions.shift(); do { if (error = action.execute(action.state, action.delay)) { break; } } while ((action = actions[0]) && action.id === flushId && actions.shift()); this._active = false; if (error) { while ((action = actions[0]) && action.id === flushId && actions.shift()) { action.unsubscribe(); } throw error; } } } /***/ }, /***/ 70782 /*!**********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduler/AsyncAction.js ***! \**********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AsyncAction: () => (/* binding */ AsyncAction) /* harmony export */ }); /* harmony import */ var _Action__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Action */ 90772); /* harmony import */ var _intervalProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./intervalProvider */ 83614); /* harmony import */ var _util_arrRemove__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/arrRemove */ 78812); class AsyncAction extends _Action__WEBPACK_IMPORTED_MODULE_0__.Action { constructor(scheduler, work) { super(scheduler, work); this.scheduler = scheduler; this.work = work; this.pending = false; } schedule(state, delay = 0) { var _a; if (this.closed) { return this; } this.state = state; const id = this.id; const scheduler = this.scheduler; if (id != null) { this.id = this.recycleAsyncId(scheduler, id, delay); } this.pending = true; this.delay = delay; this.id = (_a = this.id) !== null && _a !== void 0 ? _a : this.requestAsyncId(scheduler, this.id, delay); return this; } requestAsyncId(scheduler, _id, delay = 0) { return _intervalProvider__WEBPACK_IMPORTED_MODULE_1__.intervalProvider.setInterval(scheduler.flush.bind(scheduler, this), delay); } recycleAsyncId(_scheduler, id, delay = 0) { if (delay != null && this.delay === delay && this.pending === false) { return id; } if (id != null) { _intervalProvider__WEBPACK_IMPORTED_MODULE_1__.intervalProvider.clearInterval(id); } return undefined; } execute(state, delay) { if (this.closed) { return new Error('executing a cancelled action'); } this.pending = false; const error = this._execute(state, delay); if (error) { return error; } else if (this.pending === false && this.id != null) { this.id = this.recycleAsyncId(this.scheduler, this.id, null); } } _execute(state, _delay) { let errored = false; let errorValue; try { this.work(state); } catch (e) { errored = true; errorValue = e ? e : new Error('Scheduled action threw falsy error'); } if (errored) { this.unsubscribe(); return errorValue; } } unsubscribe() { if (!this.closed) { const { id, scheduler } = this; const { actions } = scheduler; this.work = this.state = this.scheduler = null; this.pending = false; (0,_util_arrRemove__WEBPACK_IMPORTED_MODULE_2__.arrRemove)(actions, this); if (id != null) { this.id = this.recycleAsyncId(scheduler, id, null); } this.delay = null; super.unsubscribe(); } } } /***/ }, /***/ 26955 /*!*************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduler/AsyncScheduler.js ***! \*************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AsyncScheduler: () => (/* binding */ AsyncScheduler) /* harmony export */ }); /* harmony import */ var _Scheduler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Scheduler */ 50407); class AsyncScheduler extends _Scheduler__WEBPACK_IMPORTED_MODULE_0__.Scheduler { constructor(SchedulerAction, now = _Scheduler__WEBPACK_IMPORTED_MODULE_0__.Scheduler.now) { super(SchedulerAction, now); this.actions = []; this._active = false; } flush(action) { const { actions } = this; if (this._active) { actions.push(action); return; } let error; this._active = true; do { if (error = action.execute(action.state, action.delay)) { break; } } while (action = actions.shift()); this._active = false; if (error) { while (action = actions.shift()) { action.unsubscribe(); } throw error; } } } /***/ }, /***/ 92809 /*!*************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduler/animationFrame.js ***! \*************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ animationFrame: () => (/* binding */ animationFrame), /* harmony export */ animationFrameScheduler: () => (/* binding */ animationFrameScheduler) /* harmony export */ }); /* harmony import */ var _AnimationFrameAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AnimationFrameAction */ 5139); /* harmony import */ var _AnimationFrameScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AnimationFrameScheduler */ 832); const animationFrameScheduler = new _AnimationFrameScheduler__WEBPACK_IMPORTED_MODULE_1__.AnimationFrameScheduler(_AnimationFrameAction__WEBPACK_IMPORTED_MODULE_0__.AnimationFrameAction); const animationFrame = animationFrameScheduler; /***/ }, /***/ 77312 /*!*********************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduler/animationFrameProvider.js ***! \*********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ animationFrameProvider: () => (/* binding */ animationFrameProvider) /* harmony export */ }); /* harmony import */ var _Subscription__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Subscription */ 72737); const animationFrameProvider = { schedule(callback) { let request = requestAnimationFrame; let cancel = cancelAnimationFrame; const { delegate } = animationFrameProvider; if (delegate) { request = delegate.requestAnimationFrame; cancel = delegate.cancelAnimationFrame; } const handle = request(timestamp => { cancel = undefined; callback(timestamp); }); return new _Subscription__WEBPACK_IMPORTED_MODULE_0__.Subscription(() => cancel === null || cancel === void 0 ? void 0 : cancel(handle)); }, requestAnimationFrame(...args) { const { delegate } = animationFrameProvider; return ((delegate === null || delegate === void 0 ? void 0 : delegate.requestAnimationFrame) || requestAnimationFrame)(...args); }, cancelAnimationFrame(...args) { const { delegate } = animationFrameProvider; return ((delegate === null || delegate === void 0 ? void 0 : delegate.cancelAnimationFrame) || cancelAnimationFrame)(...args); }, delegate: undefined }; /***/ }, /***/ 57811 /*!***************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduler/asap.js ***! \***************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ asap: () => (/* binding */ asap), /* harmony export */ asapScheduler: () => (/* binding */ asapScheduler) /* harmony export */ }); /* harmony import */ var _AsapAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsapAction */ 18481); /* harmony import */ var _AsapScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AsapScheduler */ 61282); const asapScheduler = new _AsapScheduler__WEBPACK_IMPORTED_MODULE_1__.AsapScheduler(_AsapAction__WEBPACK_IMPORTED_MODULE_0__.AsapAction); const asap = asapScheduler; /***/ }, /***/ 32348 /*!****************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduler/async.js ***! \****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ async: () => (/* binding */ async), /* harmony export */ asyncScheduler: () => (/* binding */ asyncScheduler) /* harmony export */ }); /* harmony import */ var _AsyncAction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AsyncAction */ 70782); /* harmony import */ var _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AsyncScheduler */ 26955); const asyncScheduler = new _AsyncScheduler__WEBPACK_IMPORTED_MODULE_1__.AsyncScheduler(_AsyncAction__WEBPACK_IMPORTED_MODULE_0__.AsyncAction); const async = asyncScheduler; /***/ }, /***/ 64921 /*!********************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduler/dateTimestampProvider.js ***! \********************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ dateTimestampProvider: () => (/* binding */ dateTimestampProvider) /* harmony export */ }); const dateTimestampProvider = { now() { return (dateTimestampProvider.delegate || Date).now(); }, delegate: undefined }; /***/ }, /***/ 12460 /*!****************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduler/immediateProvider.js ***! \****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ immediateProvider: () => (/* binding */ immediateProvider) /* harmony export */ }); /* harmony import */ var _util_Immediate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/Immediate */ 59182); const { setImmediate, clearImmediate } = _util_Immediate__WEBPACK_IMPORTED_MODULE_0__.Immediate; const immediateProvider = { setImmediate(...args) { const { delegate } = immediateProvider; return ((delegate === null || delegate === void 0 ? void 0 : delegate.setImmediate) || setImmediate)(...args); }, clearImmediate(handle) { const { delegate } = immediateProvider; return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearImmediate) || clearImmediate)(handle); }, delegate: undefined }; /***/ }, /***/ 83614 /*!***************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduler/intervalProvider.js ***! \***************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ intervalProvider: () => (/* binding */ intervalProvider) /* harmony export */ }); const intervalProvider = { setInterval(handler, timeout, ...args) { const { delegate } = intervalProvider; if (delegate === null || delegate === void 0 ? void 0 : delegate.setInterval) { return delegate.setInterval(handler, timeout, ...args); } return setInterval(handler, timeout, ...args); }, clearInterval(handle) { const { delegate } = intervalProvider; return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearInterval) || clearInterval)(handle); }, delegate: undefined }; /***/ }, /***/ 20046 /*!**************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/scheduler/timeoutProvider.js ***! \**************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ timeoutProvider: () => (/* binding */ timeoutProvider) /* harmony export */ }); const timeoutProvider = { setTimeout(handler, timeout, ...args) { const { delegate } = timeoutProvider; if (delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) { return delegate.setTimeout(handler, timeout, ...args); } return setTimeout(handler, timeout, ...args); }, clearTimeout(handle) { const { delegate } = timeoutProvider; return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle); }, delegate: undefined }; /***/ }, /***/ 67793 /*!****************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/symbol/iterator.js ***! \****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ getSymbolIterator: () => (/* binding */ getSymbolIterator), /* harmony export */ iterator: () => (/* binding */ iterator) /* harmony export */ }); function getSymbolIterator() { if (typeof Symbol !== 'function' || !Symbol.iterator) { return '@@iterator'; } return Symbol.iterator; } const iterator = getSymbolIterator(); /***/ }, /***/ 54110 /*!******************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/symbol/observable.js ***! \******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ observable: () => (/* binding */ observable) /* harmony export */ }); const observable = (() => typeof Symbol === 'function' && Symbol.observable || '@@observable')(); /***/ }, /***/ 77294 /*!****************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/EmptyError.js ***! \****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ EmptyError: () => (/* binding */ EmptyError) /* harmony export */ }); /* harmony import */ var _createErrorClass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createErrorClass */ 35637); const EmptyError = (0,_createErrorClass__WEBPACK_IMPORTED_MODULE_0__.createErrorClass)(_super => function EmptyErrorImpl() { _super(this); this.name = 'EmptyError'; this.message = 'no elements in sequence'; }); /***/ }, /***/ 59182 /*!***************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/Immediate.js ***! \***************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Immediate: () => (/* binding */ Immediate), /* harmony export */ TestTools: () => (/* binding */ TestTools) /* harmony export */ }); let nextHandle = 1; let resolved; const activeHandles = {}; function findAndClearHandle(handle) { if (handle in activeHandles) { delete activeHandles[handle]; return true; } return false; } const Immediate = { setImmediate(cb) { const handle = nextHandle++; activeHandles[handle] = true; if (!resolved) { resolved = Promise.resolve(); } resolved.then(() => findAndClearHandle(handle) && cb()); return handle; }, clearImmediate(handle) { findAndClearHandle(handle); } }; const TestTools = { pending() { return Object.keys(activeHandles).length; } }; /***/ }, /***/ 40053 /*!*****************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/ObjectUnsubscribedError.js ***! \*****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ObjectUnsubscribedError: () => (/* binding */ ObjectUnsubscribedError) /* harmony export */ }); /* harmony import */ var _createErrorClass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createErrorClass */ 35637); const ObjectUnsubscribedError = (0,_createErrorClass__WEBPACK_IMPORTED_MODULE_0__.createErrorClass)(_super => function ObjectUnsubscribedErrorImpl() { _super(this); this.name = 'ObjectUnsubscribedError'; this.message = 'object unsubscribed'; }); /***/ }, /***/ 40551 /*!*************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/UnsubscriptionError.js ***! \*************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ UnsubscriptionError: () => (/* binding */ UnsubscriptionError) /* harmony export */ }); /* harmony import */ var _createErrorClass__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createErrorClass */ 35637); const UnsubscriptionError = (0,_createErrorClass__WEBPACK_IMPORTED_MODULE_0__.createErrorClass)(_super => function UnsubscriptionErrorImpl(errors) { _super(this); this.message = errors ? `${errors.length} errors occurred during unsubscription: ${errors.map((err, i) => `${i + 1}) ${err.toString()}`).join('\n ')}` : ''; this.name = 'UnsubscriptionError'; this.errors = errors; }); /***/ }, /***/ 97030 /*!**********************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/args.js ***! \**********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ popNumber: () => (/* binding */ popNumber), /* harmony export */ popResultSelector: () => (/* binding */ popResultSelector), /* harmony export */ popScheduler: () => (/* binding */ popScheduler) /* harmony export */ }); /* harmony import */ var _isFunction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isFunction */ 41407); /* harmony import */ var _isScheduler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isScheduler */ 69126); function last(arr) { return arr[arr.length - 1]; } function popResultSelector(args) { return (0,_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(last(args)) ? args.pop() : undefined; } function popScheduler(args) { return (0,_isScheduler__WEBPACK_IMPORTED_MODULE_1__.isScheduler)(last(args)) ? args.pop() : undefined; } function popNumber(args, defaultValue) { return typeof last(args) === 'number' ? args.pop() : defaultValue; } /***/ }, /***/ 74793 /*!**************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/argsArgArrayOrObject.js ***! \**************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ argsArgArrayOrObject: () => (/* binding */ argsArgArrayOrObject) /* harmony export */ }); const { isArray } = Array; const { getPrototypeOf, prototype: objectProto, keys: getKeys } = Object; function argsArgArrayOrObject(args) { if (args.length === 1) { const first = args[0]; if (isArray(first)) { return { args: first, keys: null }; } if (isPOJO(first)) { const keys = getKeys(first); return { args: keys.map(key => first[key]), keys }; } } return { args: args, keys: null }; } function isPOJO(obj) { return obj && typeof obj === 'object' && getPrototypeOf(obj) === objectProto; } /***/ }, /***/ 78812 /*!***************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/arrRemove.js ***! \***************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ arrRemove: () => (/* binding */ arrRemove) /* harmony export */ }); function arrRemove(arr, item) { if (arr) { const index = arr.indexOf(item); 0 <= index && arr.splice(index, 1); } } /***/ }, /***/ 35637 /*!**********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/createErrorClass.js ***! \**********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ createErrorClass: () => (/* binding */ createErrorClass) /* harmony export */ }); function createErrorClass(createImpl) { const _super = instance => { Error.call(instance); instance.stack = new Error().stack; }; const ctorFunc = createImpl(_super); ctorFunc.prototype = Object.create(Error.prototype); ctorFunc.prototype.constructor = ctorFunc; return ctorFunc; } /***/ }, /***/ 83288 /*!******************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/createObject.js ***! \******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ createObject: () => (/* binding */ createObject) /* harmony export */ }); function createObject(keys, values) { return keys.reduce((result, key, i) => (result[key] = values[i], result), {}); } /***/ }, /***/ 90674 /*!******************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/errorContext.js ***! \******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ captureError: () => (/* binding */ captureError), /* harmony export */ errorContext: () => (/* binding */ errorContext) /* harmony export */ }); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../config */ 34666); let context = null; function errorContext(cb) { if (_config__WEBPACK_IMPORTED_MODULE_0__.config.useDeprecatedSynchronousErrorHandling) { const isRoot = !context; if (isRoot) { context = { errorThrown: false, error: null }; } cb(); if (isRoot) { const { errorThrown, error } = context; context = null; if (errorThrown) { throw error; } } } else { cb(); } } function captureError(err) { if (_config__WEBPACK_IMPORTED_MODULE_0__.config.useDeprecatedSynchronousErrorHandling && context) { context.errorThrown = true; context.error = err; } } /***/ }, /***/ 83521 /*!*********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/executeSchedule.js ***! \*********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ executeSchedule: () => (/* binding */ executeSchedule) /* harmony export */ }); function executeSchedule(parentSubscription, scheduler, work, delay = 0, repeat = false) { const scheduleSubscription = scheduler.schedule(function () { work(); if (repeat) { parentSubscription.add(this.schedule(null, delay)); } else { this.unsubscribe(); } }, delay); parentSubscription.add(scheduleSubscription); if (!repeat) { return scheduleSubscription; } } /***/ }, /***/ 4701 /*!**************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/identity.js ***! \**************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ identity: () => (/* binding */ identity) /* harmony export */ }); function identity(x) { return x; } /***/ }, /***/ 36745 /*!*****************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/isArrayLike.js ***! \*****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isArrayLike: () => (/* binding */ isArrayLike) /* harmony export */ }); const isArrayLike = x => x && typeof x.length === 'number' && typeof x !== 'function'; /***/ }, /***/ 61401 /*!*********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/isAsyncIterable.js ***! \*********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isAsyncIterable: () => (/* binding */ isAsyncIterable) /* harmony export */ }); /* harmony import */ var _isFunction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isFunction */ 41407); function isAsyncIterable(obj) { return Symbol.asyncIterator && (0,_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]); } /***/ }, /***/ 96411 /*!************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/isDate.js ***! \************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isValidDate: () => (/* binding */ isValidDate) /* harmony export */ }); function isValidDate(value) { return value instanceof Date && !isNaN(value); } /***/ }, /***/ 41407 /*!****************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/isFunction.js ***! \****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isFunction: () => (/* binding */ isFunction) /* harmony export */ }); function isFunction(value) { return typeof value === 'function'; } /***/ }, /***/ 77111 /*!*************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/isInteropObservable.js ***! \*************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isInteropObservable: () => (/* binding */ isInteropObservable) /* harmony export */ }); /* harmony import */ var _symbol_observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../symbol/observable */ 54110); /* harmony import */ var _isFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction */ 41407); function isInteropObservable(input) { return (0,_isFunction__WEBPACK_IMPORTED_MODULE_1__.isFunction)(input[_symbol_observable__WEBPACK_IMPORTED_MODULE_0__.observable]); } /***/ }, /***/ 91997 /*!****************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/isIterable.js ***! \****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isIterable: () => (/* binding */ isIterable) /* harmony export */ }); /* harmony import */ var _symbol_iterator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../symbol/iterator */ 67793); /* harmony import */ var _isFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction */ 41407); function isIterable(input) { return (0,_isFunction__WEBPACK_IMPORTED_MODULE_1__.isFunction)(input === null || input === void 0 ? void 0 : input[_symbol_iterator__WEBPACK_IMPORTED_MODULE_0__.iterator]); } /***/ }, /***/ 87946 /*!******************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/isObservable.js ***! \******************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isObservable: () => (/* binding */ isObservable) /* harmony export */ }); /* harmony import */ var _Observable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Observable */ 57417); /* harmony import */ var _isFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction */ 41407); function isObservable(obj) { return !!obj && (obj instanceof _Observable__WEBPACK_IMPORTED_MODULE_0__.Observable || (0,_isFunction__WEBPACK_IMPORTED_MODULE_1__.isFunction)(obj.lift) && (0,_isFunction__WEBPACK_IMPORTED_MODULE_1__.isFunction)(obj.subscribe)); } /***/ }, /***/ 89466 /*!***************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/isPromise.js ***! \***************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isPromise: () => (/* binding */ isPromise) /* harmony export */ }); /* harmony import */ var _isFunction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isFunction */ 41407); function isPromise(value) { return (0,_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(value === null || value === void 0 ? void 0 : value.then); } /***/ }, /***/ 11732 /*!**************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/isReadableStreamLike.js ***! \**************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isReadableStreamLike: () => (/* binding */ isReadableStreamLike), /* harmony export */ readableStreamLikeToAsyncGenerator: () => (/* binding */ readableStreamLikeToAsyncGenerator) /* harmony export */ }); /* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ 27824); /* harmony import */ var _isFunction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./isFunction */ 41407); function readableStreamLikeToAsyncGenerator(readableStream) { return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__asyncGenerator)(this, arguments, function* readableStreamLikeToAsyncGenerator_1() { const reader = readableStream.getReader(); try { while (true) { const { value, done } = yield (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__await)(reader.read()); if (done) { return yield (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__await)(void 0); } yield yield (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__await)(value); } } finally { reader.releaseLock(); } }); } function isReadableStreamLike(obj) { return (0,_isFunction__WEBPACK_IMPORTED_MODULE_1__.isFunction)(obj === null || obj === void 0 ? void 0 : obj.getReader); } /***/ }, /***/ 69126 /*!*****************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/isScheduler.js ***! \*****************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isScheduler: () => (/* binding */ isScheduler) /* harmony export */ }); /* harmony import */ var _isFunction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isFunction */ 41407); function isScheduler(value) { return value && (0,_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(value.schedule); } /***/ }, /***/ 8638 /*!**********************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/lift.js ***! \**********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ hasLift: () => (/* binding */ hasLift), /* harmony export */ operate: () => (/* binding */ operate) /* harmony export */ }); /* harmony import */ var _isFunction__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./isFunction */ 41407); function hasLift(source) { return (0,_isFunction__WEBPACK_IMPORTED_MODULE_0__.isFunction)(source === null || source === void 0 ? void 0 : source.lift); } function operate(init) { return source => { if (hasLift(source)) { return source.lift(function (liftedSource) { try { return init(liftedSource, this); } catch (err) { this.error(err); } }); } throw new TypeError('Unable to lift unknown Observable type'); }; } /***/ }, /***/ 40762 /*!**********************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/mapOneOrManyArgs.js ***! \**********************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ mapOneOrManyArgs: () => (/* binding */ mapOneOrManyArgs) /* harmony export */ }); /* harmony import */ var _operators_map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../operators/map */ 38442); const { isArray } = Array; function callOrApply(fn, args) { return isArray(args) ? fn(...args) : fn(args); } function mapOneOrManyArgs(fn) { return (0,_operators_map__WEBPACK_IMPORTED_MODULE_0__.map)(args => callOrApply(fn, args)); } /***/ }, /***/ 30695 /*!**********************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/noop.js ***! \**********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ noop: () => (/* binding */ noop) /* harmony export */ }); function noop() {} /***/ }, /***/ 86283 /*!**********************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/pipe.js ***! \**********************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ pipe: () => (/* binding */ pipe), /* harmony export */ pipeFromArray: () => (/* binding */ pipeFromArray) /* harmony export */ }); /* harmony import */ var _identity__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./identity */ 4701); function pipe(...fns) { return pipeFromArray(fns); } function pipeFromArray(fns) { if (fns.length === 0) { return _identity__WEBPACK_IMPORTED_MODULE_0__.identity; } if (fns.length === 1) { return fns[0]; } return function piped(input) { return fns.reduce((prev, fn) => fn(prev), input); }; } /***/ }, /***/ 58510 /*!**************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/reportUnhandledError.js ***! \**************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ reportUnhandledError: () => (/* binding */ reportUnhandledError) /* harmony export */ }); /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../config */ 34666); /* harmony import */ var _scheduler_timeoutProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../scheduler/timeoutProvider */ 20046); function reportUnhandledError(err) { _scheduler_timeoutProvider__WEBPACK_IMPORTED_MODULE_1__.timeoutProvider.setTimeout(() => { const { onUnhandledError } = _config__WEBPACK_IMPORTED_MODULE_0__.config; if (onUnhandledError) { onUnhandledError(err); } else { throw err; } }); } /***/ }, /***/ 28727 /*!****************************************************************************!*\ !*** ./node_modules/rxjs/dist/esm/internal/util/throwUnobservableError.js ***! \****************************************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ createInvalidObservableTypeError: () => (/* binding */ createInvalidObservableTypeError) /* harmony export */ }); function createInvalidObservableTypeError(input) { return new TypeError(`You provided ${input !== null && typeof input === 'object' ? 'an invalid object' : `'${input}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`); } /***/ }, /***/ 59718 /*!******************************************!*\ !*** ./node_modules/seedrandom/index.js ***! \******************************************/ (module, __unused_webpack_exports, __webpack_require__) { // A library of seedable RNGs implemented in Javascript. // // Usage: // // var seedrandom = require('seedrandom'); // var random = seedrandom(1); // or any seed. // var x = random(); // 0 <= x < 1. Every bit is random. // var x = random.quick(); // 0 <= x < 1. 32 bits of randomness. // alea, a 53-bit multiply-with-carry generator by Johannes Baagøe. // Period: ~2^116 // Reported to pass all BigCrush tests. var alea = __webpack_require__(/*! ./lib/alea */ 93047); // xor128, a pure xor-shift generator by George Marsaglia. // Period: 2^128-1. // Reported to fail: MatrixRank and LinearComp. var xor128 = __webpack_require__(/*! ./lib/xor128 */ 51026); // xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl. // Period: 2^192-2^32 // Reported to fail: CollisionOver, SimpPoker, and LinearComp. var xorwow = __webpack_require__(/*! ./lib/xorwow */ 81536); // xorshift7, by François Panneton and Pierre L'ecuyer, takes // a different approach: it adds robustness by allowing more shifts // than Marsaglia's original three. It is a 7-shift generator // with 256 bits, that passes BigCrush with no systmatic failures. // Period 2^256-1. // No systematic BigCrush failures reported. var xorshift7 = __webpack_require__(/*! ./lib/xorshift7 */ 62954); // xor4096, by Richard Brent, is a 4096-bit xor-shift with a // very long period that also adds a Weyl generator. It also passes // BigCrush with no systematic failures. Its long period may // be useful if you have many generators and need to avoid // collisions. // Period: 2^4128-2^32. // No systematic BigCrush failures reported. var xor4096 = __webpack_require__(/*! ./lib/xor4096 */ 8808); // Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random // number generator derived from ChaCha, a modern stream cipher. // https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf // Period: ~2^127 // No systematic BigCrush failures reported. var tychei = __webpack_require__(/*! ./lib/tychei */ 6294); // The original ARC4-based prng included in this library. // Period: ~2^1600 var sr = __webpack_require__(/*! ./seedrandom */ 82614); sr.alea = alea; sr.xor128 = xor128; sr.xorwow = xorwow; sr.xorshift7 = xorshift7; sr.xor4096 = xor4096; sr.tychei = tychei; module.exports = sr; /***/ }, /***/ 93047 /*!*********************************************!*\ !*** ./node_modules/seedrandom/lib/alea.js ***! \*********************************************/ (module, exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); var __WEBPACK_AMD_DEFINE_RESULT__;// A port of an algorithm by Johannes Baagøe , 2010 // http://baagoe.com/en/RandomMusings/javascript/ // https://github.com/nquinlan/better-random-numbers-for-javascript-mirror // Original work is under MIT license - // Copyright (C) 2010 by Johannes Baagøe // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. (function (global, module, define) { function Alea(seed) { var me = this, mash = Mash(); me.next = function () { var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32 me.s0 = me.s1; me.s1 = me.s2; return me.s2 = t - (me.c = t | 0); }; // Apply the seeding algorithm from Baagoe. me.c = 1; me.s0 = mash(' '); me.s1 = mash(' '); me.s2 = mash(' '); me.s0 -= mash(seed); if (me.s0 < 0) { me.s0 += 1; } me.s1 -= mash(seed); if (me.s1 < 0) { me.s1 += 1; } me.s2 -= mash(seed); if (me.s2 < 0) { me.s2 += 1; } mash = null; } function copy(f, t) { t.c = f.c; t.s0 = f.s0; t.s1 = f.s1; t.s2 = f.s2; return t; } function impl(seed, opts) { var xg = new Alea(seed), state = opts && opts.state, prng = xg.next; prng.int32 = function () { return xg.next() * 0x100000000 | 0; }; prng.double = function () { return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53 }; prng.quick = prng; if (state) { if (typeof state == 'object') copy(state, xg); prng.state = function () { return copy(xg, {}); }; } return prng; } function Mash() { var n = 0xefc8249d; var mash = function (data) { data = String(data); for (var i = 0; i < data.length; i++) { n += data.charCodeAt(i); var h = 0.02519603282416938 * n; n = h >>> 0; h -= n; h *= n; n = h >>> 0; h -= n; n += h * 0x100000000; // 2^32 } return (n >>> 0) * 2.3283064365386963e-10; // 2^-32 }; return mash; } if (module && module.exports) { module.exports = impl; } else if (__webpack_require__.amdD && __webpack_require__.amdO) { !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { return impl; }).call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else { this.alea = impl; } })(this, true && module, // present in node.js __webpack_require__.amdD // present with an AMD loader ); /***/ }, /***/ 6294 /*!***********************************************!*\ !*** ./node_modules/seedrandom/lib/tychei.js ***! \***********************************************/ (module, exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of the "Tyche-i" prng algorithm by // Samuel Neves and Filipe Araujo. // See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf (function (global, module, define) { function XorGen(seed) { var me = this, strseed = ''; // Set up generator function. me.next = function () { var b = me.b, c = me.c, d = me.d, a = me.a; b = b << 25 ^ b >>> 7 ^ c; c = c - d | 0; d = d << 24 ^ d >>> 8 ^ a; a = a - b | 0; me.b = b = b << 20 ^ b >>> 12 ^ c; me.c = c = c - d | 0; me.d = d << 16 ^ c >>> 16 ^ a; return me.a = a - b | 0; }; /* The following is non-inverted tyche, which has better internal * bit diffusion, but which is about 25% slower than tyche-i in JS. me.next = function() { var a = me.a, b = me.b, c = me.c, d = me.d; a = (me.a + me.b | 0) >>> 0; d = me.d ^ a; d = d << 16 ^ d >>> 16; c = me.c + d | 0; b = me.b ^ c; b = b << 12 ^ d >>> 20; me.a = a = a + b | 0; d = d ^ a; me.d = d = d << 8 ^ d >>> 24; me.c = c = c + d | 0; b = b ^ c; return me.b = (b << 7 ^ b >>> 25); } */ me.a = 0; me.b = 0; me.c = 2654435769 | 0; me.d = 1367130551; if (seed === Math.floor(seed)) { // Integer seed. me.a = seed / 0x100000000 | 0; me.b = seed | 0; } else { // String seed. strseed += seed; } // Mix in string seed, then discard an initial batch of 64 values. for (var k = 0; k < strseed.length + 20; k++) { me.b ^= strseed.charCodeAt(k) | 0; me.next(); } } function copy(f, t) { t.a = f.a; t.b = f.b; t.c = f.c; t.d = f.d; return t; } ; function impl(seed, opts) { var xg = new XorGen(seed), state = opts && opts.state, prng = function () { return (xg.next() >>> 0) / 0x100000000; }; prng.double = function () { do { var top = xg.next() >>> 11, bot = (xg.next() >>> 0) / 0x100000000, result = (top + bot) / (1 << 21); } while (result === 0); return result; }; prng.int32 = xg.next; prng.quick = prng; if (state) { if (typeof state == 'object') copy(state, xg); prng.state = function () { return copy(xg, {}); }; } return prng; } if (module && module.exports) { module.exports = impl; } else if (__webpack_require__.amdD && __webpack_require__.amdO) { !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { return impl; }).call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else { this.tychei = impl; } })(this, true && module, // present in node.js __webpack_require__.amdD // present with an AMD loader ); /***/ }, /***/ 51026 /*!***********************************************!*\ !*** ./node_modules/seedrandom/lib/xor128.js ***! \***********************************************/ (module, exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of the "xor128" prng algorithm by // George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper (function (global, module, define) { function XorGen(seed) { var me = this, strseed = ''; me.x = 0; me.y = 0; me.z = 0; me.w = 0; // Set up generator function. me.next = function () { var t = me.x ^ me.x << 11; me.x = me.y; me.y = me.z; me.z = me.w; return me.w ^= me.w >>> 19 ^ t ^ t >>> 8; }; if (seed === (seed | 0)) { // Integer seed. me.x = seed; } else { // String seed. strseed += seed; } // Mix in string seed, then discard an initial batch of 64 values. for (var k = 0; k < strseed.length + 64; k++) { me.x ^= strseed.charCodeAt(k) | 0; me.next(); } } function copy(f, t) { t.x = f.x; t.y = f.y; t.z = f.z; t.w = f.w; return t; } function impl(seed, opts) { var xg = new XorGen(seed), state = opts && opts.state, prng = function () { return (xg.next() >>> 0) / 0x100000000; }; prng.double = function () { do { var top = xg.next() >>> 11, bot = (xg.next() >>> 0) / 0x100000000, result = (top + bot) / (1 << 21); } while (result === 0); return result; }; prng.int32 = xg.next; prng.quick = prng; if (state) { if (typeof state == 'object') copy(state, xg); prng.state = function () { return copy(xg, {}); }; } return prng; } if (module && module.exports) { module.exports = impl; } else if (__webpack_require__.amdD && __webpack_require__.amdO) { !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { return impl; }).call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else { this.xor128 = impl; } })(this, true && module, // present in node.js __webpack_require__.amdD // present with an AMD loader ); /***/ }, /***/ 8808 /*!************************************************!*\ !*** ./node_modules/seedrandom/lib/xor4096.js ***! \************************************************/ (module, exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm. // // This fast non-cryptographic random number generator is designed for // use in Monte-Carlo algorithms. It combines a long-period xorshift // generator with a Weyl generator, and it passes all common batteries // of stasticial tests for randomness while consuming only a few nanoseconds // for each prng generated. For background on the generator, see Brent's // paper: "Some long-period random number generators using shifts and xors." // http://arxiv.org/pdf/1004.3115v1.pdf // // Usage: // // var xor4096 = require('xor4096'); // random = xor4096(1); // Seed with int32 or string. // assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits. // assert.equal(random.int32(), 1806534897); // signed int32, 32 bits. // // For nonzero numeric keys, this impelementation provides a sequence // identical to that by Brent's xorgens 3 implementaion in C. This // implementation also provides for initalizing the generator with // string seeds, or for saving and restoring the state of the generator. // // On Chrome, this prng benchmarks about 2.1 times slower than // Javascript's built-in Math.random(). (function (global, module, define) { function XorGen(seed) { var me = this; // Set up generator function. me.next = function () { var w = me.w, X = me.X, i = me.i, t, v; // Update Weyl generator. me.w = w = w + 0x61c88647 | 0; // Update xor generator. v = X[i + 34 & 127]; t = X[i = i + 1 & 127]; v ^= v << 13; t ^= t << 17; v ^= v >>> 15; t ^= t >>> 12; // Update Xor generator array state. v = X[i] = v ^ t; me.i = i; // Result is the combination. return v + (w ^ w >>> 16) | 0; }; function init(me, seed) { var t, v, i, j, w, X = [], limit = 128; if (seed === (seed | 0)) { // Numeric seeds initialize v, which is used to generates X. v = seed; seed = null; } else { // String seeds are mixed into v and X one character at a time. seed = seed + '\0'; v = 0; limit = Math.max(limit, seed.length); } // Initialize circular array and weyl value. for (i = 0, j = -32; j < limit; ++j) { // Put the unicode characters into the array, and shuffle them. if (seed) v ^= seed.charCodeAt((j + 32) % seed.length); // After 32 shuffles, take v as the starting w value. if (j === 0) w = v; v ^= v << 10; v ^= v >>> 15; v ^= v << 4; v ^= v >>> 13; if (j >= 0) { w = w + 0x61c88647 | 0; // Weyl. t = X[j & 127] ^= v + w; // Combine xor and weyl to init array. i = 0 == t ? i + 1 : 0; // Count zeroes. } } // We have detected all zeroes; make the key nonzero. if (i >= 128) { X[(seed && seed.length || 0) & 127] = -1; } // Run the generator 512 times to further mix the state before using it. // Factoring this as a function slows the main generator, so it is just // unrolled here. The weyl generator is not advanced while warming up. i = 127; for (j = 4 * 128; j > 0; --j) { v = X[i + 34 & 127]; t = X[i = i + 1 & 127]; v ^= v << 13; t ^= t << 17; v ^= v >>> 15; t ^= t >>> 12; X[i] = v ^ t; } // Storing state as object members is faster than using closure variables. me.w = w; me.X = X; me.i = i; } init(me, seed); } function copy(f, t) { t.i = f.i; t.w = f.w; t.X = f.X.slice(); return t; } ; function impl(seed, opts) { if (seed == null) seed = +new Date(); var xg = new XorGen(seed), state = opts && opts.state, prng = function () { return (xg.next() >>> 0) / 0x100000000; }; prng.double = function () { do { var top = xg.next() >>> 11, bot = (xg.next() >>> 0) / 0x100000000, result = (top + bot) / (1 << 21); } while (result === 0); return result; }; prng.int32 = xg.next; prng.quick = prng; if (state) { if (state.X) copy(state, xg); prng.state = function () { return copy(xg, {}); }; } return prng; } if (module && module.exports) { module.exports = impl; } else if (__webpack_require__.amdD && __webpack_require__.amdO) { !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { return impl; }).call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else { this.xor4096 = impl; } })(this, // window object or global true && module, // present in node.js __webpack_require__.amdD // present with an AMD loader ); /***/ }, /***/ 62954 /*!**************************************************!*\ !*** ./node_modules/seedrandom/lib/xorshift7.js ***! \**************************************************/ (module, exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of the "xorshift7" algorithm by // François Panneton and Pierre L'ecuyer: // "On the Xorgshift Random Number Generators" // http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf (function (global, module, define) { function XorGen(seed) { var me = this; // Set up generator function. me.next = function () { // Update xor generator. var X = me.x, i = me.i, t, v, w; t = X[i]; t ^= t >>> 7; v = t ^ t << 24; t = X[i + 1 & 7]; v ^= t ^ t >>> 10; t = X[i + 3 & 7]; v ^= t ^ t >>> 3; t = X[i + 4 & 7]; v ^= t ^ t << 7; t = X[i + 7 & 7]; t = t ^ t << 13; v ^= t ^ t << 9; X[i] = v; me.i = i + 1 & 7; return v; }; function init(me, seed) { var j, w, X = []; if (seed === (seed | 0)) { // Seed state array using a 32-bit integer. w = X[0] = seed; } else { // Seed state using a string. seed = '' + seed; for (j = 0; j < seed.length; ++j) { X[j & 7] = X[j & 7] << 15 ^ seed.charCodeAt(j) + X[j + 1 & 7] << 13; } } // Enforce an array length of 8, not all zeroes. while (X.length < 8) X.push(0); for (j = 0; j < 8 && X[j] === 0; ++j); if (j == 8) w = X[7] = -1;else w = X[j]; me.x = X; me.i = 0; // Discard an initial 256 values. for (j = 256; j > 0; --j) { me.next(); } } init(me, seed); } function copy(f, t) { t.x = f.x.slice(); t.i = f.i; return t; } function impl(seed, opts) { if (seed == null) seed = +new Date(); var xg = new XorGen(seed), state = opts && opts.state, prng = function () { return (xg.next() >>> 0) / 0x100000000; }; prng.double = function () { do { var top = xg.next() >>> 11, bot = (xg.next() >>> 0) / 0x100000000, result = (top + bot) / (1 << 21); } while (result === 0); return result; }; prng.int32 = xg.next; prng.quick = prng; if (state) { if (state.x) copy(state, xg); prng.state = function () { return copy(xg, {}); }; } return prng; } if (module && module.exports) { module.exports = impl; } else if (__webpack_require__.amdD && __webpack_require__.amdO) { !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { return impl; }).call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else { this.xorshift7 = impl; } })(this, true && module, // present in node.js __webpack_require__.amdD // present with an AMD loader ); /***/ }, /***/ 81536 /*!***********************************************!*\ !*** ./node_modules/seedrandom/lib/xorwow.js ***! \***********************************************/ (module, exports, __webpack_require__) { /* module decorator */ module = __webpack_require__.nmd(module); var __WEBPACK_AMD_DEFINE_RESULT__;// A Javascript implementaion of the "xorwow" prng algorithm by // George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper (function (global, module, define) { function XorGen(seed) { var me = this, strseed = ''; // Set up generator function. me.next = function () { var t = me.x ^ me.x >>> 2; me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v; return (me.d = me.d + 362437 | 0) + (me.v = me.v ^ me.v << 4 ^ (t ^ t << 1)) | 0; }; me.x = 0; me.y = 0; me.z = 0; me.w = 0; me.v = 0; if (seed === (seed | 0)) { // Integer seed. me.x = seed; } else { // String seed. strseed += seed; } // Mix in string seed, then discard an initial batch of 64 values. for (var k = 0; k < strseed.length + 64; k++) { me.x ^= strseed.charCodeAt(k) | 0; if (k == strseed.length) { me.d = me.x << 10 ^ me.x >>> 4; } me.next(); } } function copy(f, t) { t.x = f.x; t.y = f.y; t.z = f.z; t.w = f.w; t.v = f.v; t.d = f.d; return t; } function impl(seed, opts) { var xg = new XorGen(seed), state = opts && opts.state, prng = function () { return (xg.next() >>> 0) / 0x100000000; }; prng.double = function () { do { var top = xg.next() >>> 11, bot = (xg.next() >>> 0) / 0x100000000, result = (top + bot) / (1 << 21); } while (result === 0); return result; }; prng.int32 = xg.next; prng.quick = prng; if (state) { if (typeof state == 'object') copy(state, xg); prng.state = function () { return copy(xg, {}); }; } return prng; } if (module && module.exports) { module.exports = impl; } else if (__webpack_require__.amdD && __webpack_require__.amdO) { !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { return impl; }).call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else { this.xorwow = impl; } })(this, true && module, // present in node.js __webpack_require__.amdD // present with an AMD loader ); /***/ }, /***/ 82614 /*!***********************************************!*\ !*** ./node_modules/seedrandom/seedrandom.js ***! \***********************************************/ (module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_RESULT__;/* Copyright 2019 David Bau. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ (function (global, pool, math) { // // The following constants are related to IEEE 754 limits. // var width = 256, // each RC4 output is 0 <= x < 256 chunks = 6, // at least six RC4 outputs for each double digits = 52, // there are 52 significant digits in a double rngname = 'random', // rngname: name for Math.random and Math.seedrandom startdenom = math.pow(width, chunks), significance = math.pow(2, digits), overflow = significance * 2, mask = width - 1, nodecrypto; // node.js crypto module, initialized at the bottom. // // seedrandom() // This is the seedrandom function described above. // function seedrandom(seed, options, callback) { var key = []; options = options == true ? { entropy: true } : options || {}; // Flatten the seed string or build one from local entropy if needed. var shortseed = mixkey(flatten(options.entropy ? [seed, tostring(pool)] : seed == null ? autoseed() : seed, 3), key); // Use the seed to initialize an ARC4 generator. var arc4 = new ARC4(key); // This function returns a random double in [0, 1) that contains // randomness in every bit of the mantissa of the IEEE 754 value. var prng = function () { var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48 d = startdenom, // and denominator d = 2 ^ 48. x = 0; // and no 'extra last byte'. while (n < significance) { // Fill up all significant digits by n = (n + x) * width; // shifting numerator and d *= width; // denominator and generating a x = arc4.g(1); // new least-significant-byte. } while (n >= overflow) { // To avoid rounding up, before adding n /= 2; // last byte, shift everything d /= 2; // right using integer math until x >>>= 1; // we have exactly the desired bits. } return (n + x) / d; // Form the number within [0, 1). }; prng.int32 = function () { return arc4.g(4) | 0; }; prng.quick = function () { return arc4.g(4) / 0x100000000; }; prng.double = prng; // Mix the randomness into accumulated entropy. mixkey(tostring(arc4.S), pool); // Calling convention: what to return as a function of prng, seed, is_math. return (options.pass || callback || function (prng, seed, is_math_call, state) { if (state) { // Load the arc4 state from the given state if it has an S array. if (state.S) { copy(state, arc4); } // Only provide the .state method if requested via options.state. prng.state = function () { return copy(arc4, {}); }; } // If called as a method of Math (Math.seedrandom()), mutate // Math.random because that is how seedrandom.js has worked since v1.0. if (is_math_call) { math[rngname] = prng; return seed; } // Otherwise, it is a newer calling convention, so return the // prng directly. else return prng; })(prng, shortseed, 'global' in options ? options.global : this == math, options.state); } // // ARC4 // // An ARC4 implementation. The constructor takes a key in the form of // an array of at most (width) integers that should be 0 <= x < (width). // // The g(count) method returns a pseudorandom integer that concatenates // the next (count) outputs from ARC4. Its return value is a number x // that is in the range 0 <= x < (width ^ count). // function ARC4(key) { var t, keylen = key.length, me = this, i = 0, j = me.i = me.j = 0, s = me.S = []; // The empty key [] is treated as [0]. if (!keylen) { key = [keylen++]; } // Set up S using the standard key scheduling algorithm. while (i < width) { s[i] = i++; } for (i = 0; i < width; i++) { s[i] = s[j = mask & j + key[i % keylen] + (t = s[i])]; s[j] = t; } // The "g" method returns the next (count) outputs as one number. (me.g = function (count) { // Using instance members instead of closure state nearly doubles speed. var t, r = 0, i = me.i, j = me.j, s = me.S; while (count--) { t = s[i = mask & i + 1]; r = r * width + s[mask & (s[i] = s[j = mask & j + t]) + (s[j] = t)]; } me.i = i; me.j = j; return r; // For robust unpredictability, the function call below automatically // discards an initial batch of values. This is called RC4-drop[256]. // See http://google.com/search?q=rsa+fluhrer+response&btnI })(width); } // // copy() // Copies internal state of ARC4 to or from a plain object. // function copy(f, t) { t.i = f.i; t.j = f.j; t.S = f.S.slice(); return t; } ; // // flatten() // Converts an object tree to nested arrays of strings. // function flatten(obj, depth) { var result = [], typ = typeof obj, prop; if (depth && typ == 'object') { for (prop in obj) { try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {} } } return result.length ? result : typ == 'string' ? obj : obj + '\0'; } // // mixkey() // Mixes a string seed into a key that is an array of integers, and // returns a shortened string seed that is equivalent to the result key. // function mixkey(seed, key) { var stringseed = seed + '', smear, j = 0; while (j < stringseed.length) { key[mask & j] = mask & (smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++); } return tostring(key); } // // autoseed() // Returns an object for autoseeding, using window.crypto and Node crypto // module if available. // function autoseed() { try { var out; if (nodecrypto && (out = nodecrypto.randomBytes)) { // The use of 'out' to remember randomBytes makes tight minified code. out = out(width); } else { out = new Uint8Array(width); (global.crypto || global.msCrypto).getRandomValues(out); } return tostring(out); } catch (e) { var browser = global.navigator, plugins = browser && browser.plugins; return [+new Date(), global, plugins, global.screen, tostring(pool)]; } } // // tostring() // Converts an array of charcodes to a string // function tostring(a) { return String.fromCharCode.apply(0, a); } // // When seedrandom.js is loaded, we immediately mix a few bits // from the built-in RNG into the entropy pool. Because we do // not want to interfere with deterministic PRNG state later, // seedrandom will not call math.random on its own again after // initialization. // mixkey(math.random(), pool); // // Nodejs and AMD support: export the implementation as a module using // either convention. // if ( true && module.exports) { module.exports = seedrandom; // When in node.js, try using crypto package for autoseeding. try { nodecrypto = __webpack_require__(/*! crypto */ 41234); } catch (ex) {} } else if (true) { !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () { return seedrandom; }).call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } else // removed by dead control flow {} // End anonymous scope, and pass initial values. })( // global: `self` in browsers (including strict mode and web workers), // otherwise `this` in Node and other environments typeof self !== 'undefined' ? self : this, [], // pool: entropy pool starts empty Math // math: package containing random, pow, and seedrandom ); /***/ }, /***/ 81556 /*!*********************************************!*\ !*** ./node_modules/spark-md5/spark-md5.js ***! \*********************************************/ (module) { (function (factory) { if (true) { // Node/CommonJS module.exports = factory(); } else // removed by dead control flow { var glob; } })(function (undefined) { 'use strict'; /* * Fastest md5 implementation around (JKM md5). * Credits: Joseph Myers * * @see http://www.myersdaily.org/joseph/javascript/md5-text.html * @see http://jsperf.com/md5-shootout/7 */ /* this function is much faster, so if possible we use it. Some IEs are the only ones I know of that need the idiotic second function, generated by an if clause. */ var add32 = function (a, b) { return a + b & 0xFFFFFFFF; }, hex_chr = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']; function cmn(q, a, b, x, s, t) { a = add32(add32(a, q), add32(x, t)); return add32(a << s | a >>> 32 - s, b); } function md5cycle(x, k) { var a = x[0], b = x[1], c = x[2], d = x[3]; a += (b & c | ~b & d) + k[0] - 680876936 | 0; a = (a << 7 | a >>> 25) + b | 0; d += (a & b | ~a & c) + k[1] - 389564586 | 0; d = (d << 12 | d >>> 20) + a | 0; c += (d & a | ~d & b) + k[2] + 606105819 | 0; c = (c << 17 | c >>> 15) + d | 0; b += (c & d | ~c & a) + k[3] - 1044525330 | 0; b = (b << 22 | b >>> 10) + c | 0; a += (b & c | ~b & d) + k[4] - 176418897 | 0; a = (a << 7 | a >>> 25) + b | 0; d += (a & b | ~a & c) + k[5] + 1200080426 | 0; d = (d << 12 | d >>> 20) + a | 0; c += (d & a | ~d & b) + k[6] - 1473231341 | 0; c = (c << 17 | c >>> 15) + d | 0; b += (c & d | ~c & a) + k[7] - 45705983 | 0; b = (b << 22 | b >>> 10) + c | 0; a += (b & c | ~b & d) + k[8] + 1770035416 | 0; a = (a << 7 | a >>> 25) + b | 0; d += (a & b | ~a & c) + k[9] - 1958414417 | 0; d = (d << 12 | d >>> 20) + a | 0; c += (d & a | ~d & b) + k[10] - 42063 | 0; c = (c << 17 | c >>> 15) + d | 0; b += (c & d | ~c & a) + k[11] - 1990404162 | 0; b = (b << 22 | b >>> 10) + c | 0; a += (b & c | ~b & d) + k[12] + 1804603682 | 0; a = (a << 7 | a >>> 25) + b | 0; d += (a & b | ~a & c) + k[13] - 40341101 | 0; d = (d << 12 | d >>> 20) + a | 0; c += (d & a | ~d & b) + k[14] - 1502002290 | 0; c = (c << 17 | c >>> 15) + d | 0; b += (c & d | ~c & a) + k[15] + 1236535329 | 0; b = (b << 22 | b >>> 10) + c | 0; a += (b & d | c & ~d) + k[1] - 165796510 | 0; a = (a << 5 | a >>> 27) + b | 0; d += (a & c | b & ~c) + k[6] - 1069501632 | 0; d = (d << 9 | d >>> 23) + a | 0; c += (d & b | a & ~b) + k[11] + 643717713 | 0; c = (c << 14 | c >>> 18) + d | 0; b += (c & a | d & ~a) + k[0] - 373897302 | 0; b = (b << 20 | b >>> 12) + c | 0; a += (b & d | c & ~d) + k[5] - 701558691 | 0; a = (a << 5 | a >>> 27) + b | 0; d += (a & c | b & ~c) + k[10] + 38016083 | 0; d = (d << 9 | d >>> 23) + a | 0; c += (d & b | a & ~b) + k[15] - 660478335 | 0; c = (c << 14 | c >>> 18) + d | 0; b += (c & a | d & ~a) + k[4] - 405537848 | 0; b = (b << 20 | b >>> 12) + c | 0; a += (b & d | c & ~d) + k[9] + 568446438 | 0; a = (a << 5 | a >>> 27) + b | 0; d += (a & c | b & ~c) + k[14] - 1019803690 | 0; d = (d << 9 | d >>> 23) + a | 0; c += (d & b | a & ~b) + k[3] - 187363961 | 0; c = (c << 14 | c >>> 18) + d | 0; b += (c & a | d & ~a) + k[8] + 1163531501 | 0; b = (b << 20 | b >>> 12) + c | 0; a += (b & d | c & ~d) + k[13] - 1444681467 | 0; a = (a << 5 | a >>> 27) + b | 0; d += (a & c | b & ~c) + k[2] - 51403784 | 0; d = (d << 9 | d >>> 23) + a | 0; c += (d & b | a & ~b) + k[7] + 1735328473 | 0; c = (c << 14 | c >>> 18) + d | 0; b += (c & a | d & ~a) + k[12] - 1926607734 | 0; b = (b << 20 | b >>> 12) + c | 0; a += (b ^ c ^ d) + k[5] - 378558 | 0; a = (a << 4 | a >>> 28) + b | 0; d += (a ^ b ^ c) + k[8] - 2022574463 | 0; d = (d << 11 | d >>> 21) + a | 0; c += (d ^ a ^ b) + k[11] + 1839030562 | 0; c = (c << 16 | c >>> 16) + d | 0; b += (c ^ d ^ a) + k[14] - 35309556 | 0; b = (b << 23 | b >>> 9) + c | 0; a += (b ^ c ^ d) + k[1] - 1530992060 | 0; a = (a << 4 | a >>> 28) + b | 0; d += (a ^ b ^ c) + k[4] + 1272893353 | 0; d = (d << 11 | d >>> 21) + a | 0; c += (d ^ a ^ b) + k[7] - 155497632 | 0; c = (c << 16 | c >>> 16) + d | 0; b += (c ^ d ^ a) + k[10] - 1094730640 | 0; b = (b << 23 | b >>> 9) + c | 0; a += (b ^ c ^ d) + k[13] + 681279174 | 0; a = (a << 4 | a >>> 28) + b | 0; d += (a ^ b ^ c) + k[0] - 358537222 | 0; d = (d << 11 | d >>> 21) + a | 0; c += (d ^ a ^ b) + k[3] - 722521979 | 0; c = (c << 16 | c >>> 16) + d | 0; b += (c ^ d ^ a) + k[6] + 76029189 | 0; b = (b << 23 | b >>> 9) + c | 0; a += (b ^ c ^ d) + k[9] - 640364487 | 0; a = (a << 4 | a >>> 28) + b | 0; d += (a ^ b ^ c) + k[12] - 421815835 | 0; d = (d << 11 | d >>> 21) + a | 0; c += (d ^ a ^ b) + k[15] + 530742520 | 0; c = (c << 16 | c >>> 16) + d | 0; b += (c ^ d ^ a) + k[2] - 995338651 | 0; b = (b << 23 | b >>> 9) + c | 0; a += (c ^ (b | ~d)) + k[0] - 198630844 | 0; a = (a << 6 | a >>> 26) + b | 0; d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0; d = (d << 10 | d >>> 22) + a | 0; c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0; c = (c << 15 | c >>> 17) + d | 0; b += (d ^ (c | ~a)) + k[5] - 57434055 | 0; b = (b << 21 | b >>> 11) + c | 0; a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0; a = (a << 6 | a >>> 26) + b | 0; d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0; d = (d << 10 | d >>> 22) + a | 0; c += (a ^ (d | ~b)) + k[10] - 1051523 | 0; c = (c << 15 | c >>> 17) + d | 0; b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0; b = (b << 21 | b >>> 11) + c | 0; a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0; a = (a << 6 | a >>> 26) + b | 0; d += (b ^ (a | ~c)) + k[15] - 30611744 | 0; d = (d << 10 | d >>> 22) + a | 0; c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0; c = (c << 15 | c >>> 17) + d | 0; b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0; b = (b << 21 | b >>> 11) + c | 0; a += (c ^ (b | ~d)) + k[4] - 145523070 | 0; a = (a << 6 | a >>> 26) + b | 0; d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0; d = (d << 10 | d >>> 22) + a | 0; c += (a ^ (d | ~b)) + k[2] + 718787259 | 0; c = (c << 15 | c >>> 17) + d | 0; b += (d ^ (c | ~a)) + k[9] - 343485551 | 0; b = (b << 21 | b >>> 11) + c | 0; x[0] = a + x[0] | 0; x[1] = b + x[1] | 0; x[2] = c + x[2] | 0; x[3] = d + x[3] | 0; } function md5blk(s) { var md5blks = [], i; /* Andy King said do it this way. */ for (i = 0; i < 64; i += 4) { md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24); } return md5blks; } function md5blk_array(a) { var md5blks = [], i; /* Andy King said do it this way. */ for (i = 0; i < 64; i += 4) { md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24); } return md5blks; } function md51(s) { var n = s.length, state = [1732584193, -271733879, -1732584194, 271733878], i, length, tail, tmp, lo, hi; for (i = 64; i <= n; i += 64) { md5cycle(state, md5blk(s.substring(i - 64, i))); } s = s.substring(i - 64); length = s.length; tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; for (i = 0; i < length; i += 1) { tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3); } tail[i >> 2] |= 0x80 << (i % 4 << 3); if (i > 55) { md5cycle(state, tail); for (i = 0; i < 16; i += 1) { tail[i] = 0; } } // Beware that the final length might not fit in 32 bits so we take care of that tmp = n * 8; tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/); lo = parseInt(tmp[2], 16); hi = parseInt(tmp[1], 16) || 0; tail[14] = lo; tail[15] = hi; md5cycle(state, tail); return state; } function md51_array(a) { var n = a.length, state = [1732584193, -271733879, -1732584194, 271733878], i, length, tail, tmp, lo, hi; for (i = 64; i <= n; i += 64) { md5cycle(state, md5blk_array(a.subarray(i - 64, i))); } // Not sure if it is a bug, however IE10 will always produce a sub array of length 1 // containing the last element of the parent array if the sub array specified starts // beyond the length of the parent array - weird. // https://connect.microsoft.com/IE/feedback/details/771452/typed-array-subarray-issue a = i - 64 < n ? a.subarray(i - 64) : new Uint8Array(0); length = a.length; tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; for (i = 0; i < length; i += 1) { tail[i >> 2] |= a[i] << (i % 4 << 3); } tail[i >> 2] |= 0x80 << (i % 4 << 3); if (i > 55) { md5cycle(state, tail); for (i = 0; i < 16; i += 1) { tail[i] = 0; } } // Beware that the final length might not fit in 32 bits so we take care of that tmp = n * 8; tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/); lo = parseInt(tmp[2], 16); hi = parseInt(tmp[1], 16) || 0; tail[14] = lo; tail[15] = hi; md5cycle(state, tail); return state; } function rhex(n) { var s = '', j; for (j = 0; j < 4; j += 1) { s += hex_chr[n >> j * 8 + 4 & 0x0F] + hex_chr[n >> j * 8 & 0x0F]; } return s; } function hex(x) { var i; for (i = 0; i < x.length; i += 1) { x[i] = rhex(x[i]); } return x.join(''); } // In some cases the fast add32 function cannot be used.. if (hex(md51('hello')) !== '5d41402abc4b2a76b9719d911017c592') { add32 = function (x, y) { var lsw = (x & 0xFFFF) + (y & 0xFFFF), msw = (x >> 16) + (y >> 16) + (lsw >> 16); return msw << 16 | lsw & 0xFFFF; }; } // --------------------------------------------------- /** * ArrayBuffer slice polyfill. * * @see https://github.com/ttaubert/node-arraybuffer-slice */ if (typeof ArrayBuffer !== 'undefined' && !ArrayBuffer.prototype.slice) { (function () { function clamp(val, length) { val = val | 0 || 0; if (val < 0) { return Math.max(val + length, 0); } return Math.min(val, length); } ArrayBuffer.prototype.slice = function (from, to) { var length = this.byteLength, begin = clamp(from, length), end = length, num, target, targetArray, sourceArray; if (to !== undefined) { end = clamp(to, length); } if (begin > end) { return new ArrayBuffer(0); } num = end - begin; target = new ArrayBuffer(num); targetArray = new Uint8Array(target); sourceArray = new Uint8Array(this, begin, num); targetArray.set(sourceArray); return target; }; })(); } // --------------------------------------------------- /** * Helpers. */ function toUtf8(str) { if (/[\u0080-\uFFFF]/.test(str)) { str = unescape(encodeURIComponent(str)); } return str; } function utf8Str2ArrayBuffer(str, returnUInt8Array) { var length = str.length, buff = new ArrayBuffer(length), arr = new Uint8Array(buff), i; for (i = 0; i < length; i += 1) { arr[i] = str.charCodeAt(i); } return returnUInt8Array ? arr : buff; } function arrayBuffer2Utf8Str(buff) { return String.fromCharCode.apply(null, new Uint8Array(buff)); } function concatenateArrayBuffers(first, second, returnUInt8Array) { var result = new Uint8Array(first.byteLength + second.byteLength); result.set(new Uint8Array(first)); result.set(new Uint8Array(second), first.byteLength); return returnUInt8Array ? result : result.buffer; } function hexToBinaryString(hex) { var bytes = [], length = hex.length, x; for (x = 0; x < length - 1; x += 2) { bytes.push(parseInt(hex.substr(x, 2), 16)); } return String.fromCharCode.apply(String, bytes); } // --------------------------------------------------- /** * SparkMD5 OOP implementation. * * Use this class to perform an incremental md5, otherwise use the * static methods instead. */ function SparkMD5() { // call reset to init the instance this.reset(); } /** * Appends a string. * A conversion will be applied if an utf8 string is detected. * * @param {String} str The string to be appended * * @return {SparkMD5} The instance itself */ SparkMD5.prototype.append = function (str) { // Converts the string to utf8 bytes if necessary // Then append as binary this.appendBinary(toUtf8(str)); return this; }; /** * Appends a binary string. * * @param {String} contents The binary string to be appended * * @return {SparkMD5} The instance itself */ SparkMD5.prototype.appendBinary = function (contents) { this._buff += contents; this._length += contents.length; var length = this._buff.length, i; for (i = 64; i <= length; i += 64) { md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i))); } this._buff = this._buff.substring(i - 64); return this; }; /** * Finishes the incremental computation, reseting the internal state and * returning the result. * * @param {Boolean} raw True to get the raw string, false to get the hex string * * @return {String} The result */ SparkMD5.prototype.end = function (raw) { var buff = this._buff, length = buff.length, i, tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ret; for (i = 0; i < length; i += 1) { tail[i >> 2] |= buff.charCodeAt(i) << (i % 4 << 3); } this._finish(tail, length); ret = hex(this._hash); if (raw) { ret = hexToBinaryString(ret); } this.reset(); return ret; }; /** * Resets the internal state of the computation. * * @return {SparkMD5} The instance itself */ SparkMD5.prototype.reset = function () { this._buff = ''; this._length = 0; this._hash = [1732584193, -271733879, -1732584194, 271733878]; return this; }; /** * Gets the internal state of the computation. * * @return {Object} The state */ SparkMD5.prototype.getState = function () { return { buff: this._buff, length: this._length, hash: this._hash.slice() }; }; /** * Gets the internal state of the computation. * * @param {Object} state The state * * @return {SparkMD5} The instance itself */ SparkMD5.prototype.setState = function (state) { this._buff = state.buff; this._length = state.length; this._hash = state.hash; return this; }; /** * Releases memory used by the incremental buffer and other additional * resources. If you plan to use the instance again, use reset instead. */ SparkMD5.prototype.destroy = function () { delete this._hash; delete this._buff; delete this._length; }; /** * Finish the final calculation based on the tail. * * @param {Array} tail The tail (will be modified) * @param {Number} length The length of the remaining buffer */ SparkMD5.prototype._finish = function (tail, length) { var i = length, tmp, lo, hi; tail[i >> 2] |= 0x80 << (i % 4 << 3); if (i > 55) { md5cycle(this._hash, tail); for (i = 0; i < 16; i += 1) { tail[i] = 0; } } // Do the final computation based on the tail and length // Beware that the final length may not fit in 32 bits so we take care of that tmp = this._length * 8; tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/); lo = parseInt(tmp[2], 16); hi = parseInt(tmp[1], 16) || 0; tail[14] = lo; tail[15] = hi; md5cycle(this._hash, tail); }; /** * Performs the md5 hash on a string. * A conversion will be applied if utf8 string is detected. * * @param {String} str The string * @param {Boolean} [raw] True to get the raw string, false to get the hex string * * @return {String} The result */ SparkMD5.hash = function (str, raw) { // Converts the string to utf8 bytes if necessary // Then compute it using the binary function return SparkMD5.hashBinary(toUtf8(str), raw); }; /** * Performs the md5 hash on a binary string. * * @param {String} content The binary string * @param {Boolean} [raw] True to get the raw string, false to get the hex string * * @return {String} The result */ SparkMD5.hashBinary = function (content, raw) { var hash = md51(content), ret = hex(hash); return raw ? hexToBinaryString(ret) : ret; }; // --------------------------------------------------- /** * SparkMD5 OOP implementation for array buffers. * * Use this class to perform an incremental md5 ONLY for array buffers. */ SparkMD5.ArrayBuffer = function () { // call reset to init the instance this.reset(); }; /** * Appends an array buffer. * * @param {ArrayBuffer} arr The array to be appended * * @return {SparkMD5.ArrayBuffer} The instance itself */ SparkMD5.ArrayBuffer.prototype.append = function (arr) { var buff = concatenateArrayBuffers(this._buff.buffer, arr, true), length = buff.length, i; this._length += arr.byteLength; for (i = 64; i <= length; i += 64) { md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i))); } this._buff = i - 64 < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0); return this; }; /** * Finishes the incremental computation, reseting the internal state and * returning the result. * * @param {Boolean} raw True to get the raw string, false to get the hex string * * @return {String} The result */ SparkMD5.ArrayBuffer.prototype.end = function (raw) { var buff = this._buff, length = buff.length, tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], i, ret; for (i = 0; i < length; i += 1) { tail[i >> 2] |= buff[i] << (i % 4 << 3); } this._finish(tail, length); ret = hex(this._hash); if (raw) { ret = hexToBinaryString(ret); } this.reset(); return ret; }; /** * Resets the internal state of the computation. * * @return {SparkMD5.ArrayBuffer} The instance itself */ SparkMD5.ArrayBuffer.prototype.reset = function () { this._buff = new Uint8Array(0); this._length = 0; this._hash = [1732584193, -271733879, -1732584194, 271733878]; return this; }; /** * Gets the internal state of the computation. * * @return {Object} The state */ SparkMD5.ArrayBuffer.prototype.getState = function () { var state = SparkMD5.prototype.getState.call(this); // Convert buffer to a string state.buff = arrayBuffer2Utf8Str(state.buff); return state; }; /** * Gets the internal state of the computation. * * @param {Object} state The state * * @return {SparkMD5.ArrayBuffer} The instance itself */ SparkMD5.ArrayBuffer.prototype.setState = function (state) { // Convert string to buffer state.buff = utf8Str2ArrayBuffer(state.buff, true); return SparkMD5.prototype.setState.call(this, state); }; SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy; SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish; /** * Performs the md5 hash on an array buffer. * * @param {ArrayBuffer} arr The array buffer * @param {Boolean} [raw] True to get the raw string, false to get the hex one * * @return {String} The result */ SparkMD5.ArrayBuffer.hash = function (arr, raw) { var hash = md51_array(new Uint8Array(arr)), ret = hex(hash); return raw ? hexToBinaryString(ret) : ret; }; return SparkMD5; }); /***/ }, /***/ 17826 /*!*****************************************************!*\ !*** ./node_modules/svd-js/build-umd/svd-js.min.js ***! \*****************************************************/ (__unused_webpack_module, exports) { !function (r, f) { true ? f(exports) : 0; }(this, function (r) { "use strict"; r.SVD = function (r, f, o, e, t) { if (f = void 0 === f || f, o = void 0 === o || o, t = 1e-64 / (e = e || Math.pow(2, -52)), !r) throw new TypeError("Matrix a is not defined"); var i, a, n, s, h, l, M, d, p, b, u, w, y = r[0].length, q = r.length; if (q < y) throw new TypeError("Invalid matrix: m < n"); for (var v = [], c = [], x = [], g = "f" === f ? q : y, m = b = M = 0; m < q; m++) c[m] = new Array(g).fill(0); for (m = 0; m < y; m++) x[m] = new Array(y).fill(0); var S, T = new Array(y).fill(0); for (m = 0; m < q; m++) for (i = 0; i < y; i++) c[m][i] = r[m][i]; for (m = 0; m < y; m++) { for (v[m] = M, p = 0, n = m + 1, i = m; i < q; i++) p += Math.pow(c[i][m], 2); if (p < t) M = 0;else for (d = (l = c[m][m]) * (M = l < 0 ? Math.sqrt(p) : -Math.sqrt(p)) - p, c[m][m] = l - M, i = n; i < y; i++) { for (p = 0, a = m; a < q; a++) p += c[a][m] * c[a][i]; for (l = p / d, a = m; a < q; a++) c[a][i] = c[a][i] + l * c[a][m]; } for (T[m] = M, p = 0, i = n; i < y; i++) p += Math.pow(c[m][i], 2); if (p < t) M = 0;else { for (d = (l = c[m][m + 1]) * (M = l < 0 ? Math.sqrt(p) : -Math.sqrt(p)) - p, c[m][m + 1] = l - M, i = n; i < y; i++) v[i] = c[m][i] / d; for (i = n; i < q; i++) { for (p = 0, a = n; a < y; a++) p += c[i][a] * c[m][a]; for (a = n; a < y; a++) c[i][a] = c[i][a] + p * v[a]; } } b < (u = Math.abs(T[m]) + Math.abs(v[m])) && (b = u); } if (o) for (m = y - 1; 0 <= m; m--) { if (0 !== M) { for (d = c[m][m + 1] * M, i = n; i < y; i++) x[i][m] = c[m][i] / d; for (i = n; i < y; i++) { for (p = 0, a = n; a < y; a++) p += c[m][a] * x[a][i]; for (a = n; a < y; a++) x[a][i] = x[a][i] + p * x[a][m]; } } for (i = n; i < y; i++) x[m][i] = 0, x[i][m] = 0; x[m][m] = 1, M = v[m], n = m; } if (f) { if ("f" === f) for (m = y; m < q; m++) { for (i = y; i < q; i++) c[m][i] = 0; c[m][m] = 1; } for (m = y - 1; 0 <= m; m--) { for (n = m + 1, M = T[m], i = n; i < g; i++) c[m][i] = 0; if (0 !== M) { for (d = c[m][m] * M, i = n; i < g; i++) { for (p = 0, a = n; a < q; a++) p += c[a][m] * c[a][i]; for (l = p / d, a = m; a < q; a++) c[a][i] = c[a][i] + l * c[a][m]; } for (i = m; i < q; i++) c[i][m] = c[i][m] / M; } else for (i = m; i < q; i++) c[i][m] = 0; c[m][m] = c[m][m] + 1; } } for (e *= b, a = y - 1; 0 <= a; a--) for (var k = 0; k < 50; k++) { for (S = !1, n = a; 0 <= n; n--) { if (Math.abs(v[n]) <= e) { S = !0; break; } if (Math.abs(T[n - 1]) <= e) break; } if (!S) for (h = 0, s = n - (p = 1), m = n; m < a + 1 && (l = p * v[m], v[m] = h * v[m], !(Math.abs(l) <= e)); m++) if (M = T[m], T[m] = Math.sqrt(l * l + M * M), h = M / (d = T[m]), p = -l / d, f) for (i = 0; i < q; i++) u = c[i][s], w = c[i][m], c[i][s] = u * h + w * p, c[i][m] = -u * p + w * h; if (w = T[a], n === a) { if (w < 0 && (T[a] = -w, o)) for (i = 0; i < y; i++) x[i][a] = -x[i][a]; break; } for (b = T[n], l = (((u = T[a - 1]) - w) * (u + w) + ((M = v[a - 1]) - (d = v[a])) * (M + d)) / (2 * d * u), M = Math.sqrt(l * l + 1), l = ((b - w) * (b + w) + d * (u / (l < 0 ? l - M : l + M) - d)) / b, m = n + (p = h = 1); m < a + 1; m++) { if (M = v[m], u = T[m], d = p * M, M *= h, w = Math.sqrt(l * l + d * d), l = b * (h = l / (v[m - 1] = w)) + M * (p = d / w), M = -b * p + M * h, d = u * p, u *= h, o) for (i = 0; i < y; i++) b = x[i][m - 1], w = x[i][m], x[i][m - 1] = b * h + w * p, x[i][m] = -b * p + w * h; if (w = Math.sqrt(l * l + d * d), l = (h = l / (T[m - 1] = w)) * M + (p = d / w) * u, b = -p * M + h * u, f) for (i = 0; i < q; i++) u = c[i][m - 1], w = c[i][m], c[i][m - 1] = u * h + w * p, c[i][m] = -u * p + w * h; } v[n] = 0, v[a] = l, T[a] = b; } for (m = 0; m < y; m++) T[m] < e && (T[m] = 0); return { u: c, q: T, v: x }; }, r.VERSION = "1.1.1", Object.defineProperty(r, "__esModule", { value: !0 }); }); /***/ }, /***/ 53660 /*!*************************************************!*\ !*** ./node_modules/two-product/two-product.js ***! \*************************************************/ (module) { "use strict"; module.exports = twoProduct; var SPLITTER = +(Math.pow(2, 27) + 1.0); function twoProduct(a, b, result) { var x = a * b; var c = SPLITTER * a; var abig = c - a; var ahi = c - abig; var alo = a - ahi; var d = SPLITTER * b; var bbig = d - b; var bhi = d - bbig; var blo = b - bhi; var err1 = x - ahi * bhi; var err2 = err1 - alo * bhi; var err3 = err2 - ahi * blo; var y = alo * blo - err3; if (result) { result[0] = y; result[1] = x; return result; } return [y, x]; } /***/ }, /***/ 95628 /*!*****************************************!*\ !*** ./node_modules/two-sum/two-sum.js ***! \*****************************************/ (module) { "use strict"; module.exports = fastTwoSum; function fastTwoSum(a, b, result) { var x = a + b; var bv = x - a; var av = x - bv; var br = b - bv; var ar = a - av; if (result) { result[0] = ar + br; result[1] = x; return result; } return [ar + br, x]; } /***/ }, /***/ 96893 /*!************************************************!*\ !*** ./node_modules/unload/dist/es/browser.js ***! \************************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ addBrowser: () => (/* binding */ addBrowser) /* harmony export */ }); /* global WorkerGlobalScope */ function addBrowser(fn) { if (typeof WorkerGlobalScope === 'function' && self instanceof WorkerGlobalScope) { /** * Because killing a worker does directly stop the excution * of the code, our only chance is to overwrite the close function * which could work some times. * @link https://stackoverflow.com/q/72903255/3443137 */ var oldClose = self.close.bind(self); self.close = function () { fn(); return oldClose(); }; } else { /** * if we are on react-native, there is no window.addEventListener * @link https://github.com/pubkey/unload/issues/6 */ if (typeof window.addEventListener !== 'function') { return; } /** * for normal browser-windows, we use the beforeunload-event */ window.addEventListener('beforeunload', function () { fn(); }, true); /** * for iframes, we have to use the unload-event * @link https://stackoverflow.com/q/47533670/3443137 */ window.addEventListener('unload', function () { fn(); }, true); } /** * TODO add fallback for safari-mobile * @link https://stackoverflow.com/a/26193516/3443137 */ } /***/ }, /***/ 67245 /*!**********************************************!*\ !*** ./node_modules/unload/dist/es/index.js ***! \**********************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ add: () => (/* binding */ add), /* harmony export */ getSize: () => (/* binding */ getSize), /* harmony export */ removeAll: () => (/* binding */ removeAll), /* harmony export */ runAll: () => (/* binding */ runAll) /* harmony export */ }); /* harmony import */ var _browser_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./browser.js */ 96893); /* harmony import */ var _node_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node.js */ 12405); /** * Use the code directly to prevent import problems * with the detect-node package. * @link https://github.com/iliakan/detect-node/blob/master/index.js */ var isNode = Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'; var USE_METHOD = isNode ? _node_js__WEBPACK_IMPORTED_MODULE_1__.addNode : _browser_js__WEBPACK_IMPORTED_MODULE_0__.addBrowser; var LISTENERS = new Set(); var startedListening = false; function startListening() { if (startedListening) { return; } startedListening = true; USE_METHOD(runAll); } function add(fn) { startListening(); if (typeof fn !== 'function') { throw new Error('Listener is no function'); } LISTENERS.add(fn); var addReturn = { remove: function remove() { return LISTENERS["delete"](fn); }, run: function run() { LISTENERS["delete"](fn); return fn(); } }; return addReturn; } function runAll() { var promises = []; LISTENERS.forEach(function (fn) { promises.push(fn()); LISTENERS["delete"](fn); }); return Promise.all(promises); } function removeAll() { LISTENERS.clear(); } function getSize() { return LISTENERS.size; } /***/ }, /***/ 12405 /*!*********************************************!*\ !*** ./node_modules/unload/dist/es/node.js ***! \*********************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ addNode: () => (/* binding */ addNode) /* harmony export */ }); function addNode(fn) { process.on('exit', function () { return fn(); }); /** * on the following events, * the process will not end if there are * event-handlers attached, * therefore we have to call process.exit() */ process.on('beforeExit', function () { return fn().then(function () { return process.exit(); }); }); // catches ctrl+c event process.on('SIGINT', function () { return fn().then(function () { return process.exit(); }); }); // catches uncaught exceptions process.on('uncaughtException', function (err) { return fn().then(function () { console.trace(err); process.exit(101); }); }); } /***/ }, /***/ 27824 /*!*****************************************!*\ !*** ./node_modules/tslib/tslib.es6.js ***! \*****************************************/ (__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ __assign: () => (/* binding */ __assign), /* harmony export */ __asyncDelegator: () => (/* binding */ __asyncDelegator), /* harmony export */ __asyncGenerator: () => (/* binding */ __asyncGenerator), /* harmony export */ __asyncValues: () => (/* binding */ __asyncValues), /* harmony export */ __await: () => (/* binding */ __await), /* harmony export */ __awaiter: () => (/* binding */ __awaiter), /* harmony export */ __classPrivateFieldGet: () => (/* binding */ __classPrivateFieldGet), /* harmony export */ __classPrivateFieldSet: () => (/* binding */ __classPrivateFieldSet), /* harmony export */ __createBinding: () => (/* binding */ __createBinding), /* harmony export */ __decorate: () => (/* binding */ __decorate), /* harmony export */ __exportStar: () => (/* binding */ __exportStar), /* harmony export */ __extends: () => (/* binding */ __extends), /* harmony export */ __generator: () => (/* binding */ __generator), /* harmony export */ __importDefault: () => (/* binding */ __importDefault), /* harmony export */ __importStar: () => (/* binding */ __importStar), /* harmony export */ __makeTemplateObject: () => (/* binding */ __makeTemplateObject), /* harmony export */ __metadata: () => (/* binding */ __metadata), /* harmony export */ __param: () => (/* binding */ __param), /* harmony export */ __read: () => (/* binding */ __read), /* harmony export */ __rest: () => (/* binding */ __rest), /* harmony export */ __spread: () => (/* binding */ __spread), /* harmony export */ __spreadArray: () => (/* binding */ __spreadArray), /* harmony export */ __spreadArrays: () => (/* binding */ __spreadArrays), /* harmony export */ __values: () => (/* binding */ __values) /* harmony export */ }); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; } return __assign.apply(this, arguments); } function __rest(s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; } function __decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } function __param(paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } } function __metadata(metadataKey, metadataValue) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); } function __awaiter(thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); } function __generator(thisArg, body) { var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; function verb(n) { return function (v) { return step([n, v]); }; } function step(op) { if (f) throw new TypeError("Generator is already executing."); while (_) try { if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; if (y = 0, t) op = [op[0] & 2, t.value]; switch (op[0]) { case 0: case 1: t = op; break; case 4: _.label++; return { value: op[1], done: false }; case 5: _.label++; y = op[1]; op = [0]; continue; case 7: op = _.ops.pop(); _.trys.pop(); continue; default: if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } if (t[2]) _.ops.pop(); _.trys.pop(); continue; } op = body.call(thisArg, _); } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; } } var __createBinding = Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); function __exportStar(m, o) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); } function __values(o) { var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; if (m) return m.call(o); if (o && typeof o.length === "number") return { next: function () { if (o && i >= o.length) o = void 0; return { value: o && o[i++], done: !o }; } }; throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); } function __read(o, n) { var m = typeof Symbol === "function" && o[Symbol.iterator]; if (!m) return o; var i = m.call(o), r, ar = [], e; try { while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); } catch (error) { e = { error: error }; } finally { try { if (r && !r.done && (m = i["return"])) m.call(i); } finally { if (e) throw e.error; } } return ar; } /** @deprecated */ function __spread() { for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i])); return ar; } /** @deprecated */ function __spreadArrays() { for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j]; return r; } function __spreadArray(to, from, pack) { if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { if (ar || !(i in from)) { if (!ar) ar = Array.prototype.slice.call(from, 0, i); ar[i] = from[i]; } } return to.concat(ar || from); } function __await(v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } function __asyncGenerator(thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } } function __asyncDelegator(o) { var i, p; return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } } function __asyncValues(o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } } function __makeTemplateObject(cooked, raw) { if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } return cooked; }; var __setModuleDefault = Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }; function __importStar(mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; } function __importDefault(mod) { return (mod && mod.__esModule) ? mod : { default: mod }; } function __classPrivateFieldGet(receiver, state, kind, f) { if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); } function __classPrivateFieldSet(receiver, state, value, kind, f) { if (kind === "m") throw new TypeError("Private method is not writable"); if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; } /***/ }, /***/ 12692 /*!****************************************!*\ !*** ./node_modules/fast-uri/index.js ***! \****************************************/ (module, __unused_webpack_exports, __webpack_require__) { "use strict"; const { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = __webpack_require__(/*! ./lib/utils */ 26665); const { SCHEMES, getSchemeHandler } = __webpack_require__(/*! ./lib/schemes */ 88472); /** * @template {import('./types/index').URIComponent|string} T * @param {T} uri * @param {import('./types/index').Options} [options] * @returns {T} */ function normalize(uri, options) { if (typeof uri === 'string') { uri = /** @type {T} */normalizeString(uri, options); } else if (typeof uri === 'object') { uri = /** @type {T} */parse(serialize(uri, options), options); } return uri; } /** * @param {string} baseURI * @param {string} relativeURI * @param {import('./types/index').Options} [options] * @returns {string} */ function resolve(baseURI, relativeURI, options) { const schemelessOptions = options ? Object.assign({ scheme: 'null' }, options) : { scheme: 'null' }; const { parsed: baseParsed, malformedAuthorityOrPort: baseMalformed } = parseWithStatus(baseURI, schemelessOptions); const { parsed: relativeParsed, malformedAuthorityOrPort: relativeMalformed } = parseWithStatus(relativeURI, schemelessOptions); if (baseMalformed || relativeMalformed) { throw new Error(baseParsed.error || relativeParsed.error || 'URI is malformed.'); } const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true); schemelessOptions.skipEscape = true; return serialize(resolved, schemelessOptions); } /** * @param {import ('./types/index').URIComponent} base * @param {import ('./types/index').URIComponent} relative * @param {import('./types/index').Options} [options] * @param {boolean} [skipNormalization=false] * @returns {import ('./types/index').URIComponent} */ function resolveComponent(base, relative, options, skipNormalization) { /** @type {import('./types/index').URIComponent} */ const target = {}; if (!skipNormalization) { base = parse(serialize(base, options), options); // normalize base component relative = parse(serialize(relative, options), options); // normalize relative component } options = options || {}; if (!options.tolerant && relative.scheme) { target.scheme = relative.scheme; // target.authority = relative.authority; target.userinfo = relative.userinfo; target.host = relative.host; target.port = relative.port; target.path = removeDotSegments(relative.path || ''); target.query = relative.query; } else { if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { // target.authority = relative.authority; target.userinfo = relative.userinfo; target.host = relative.host; target.port = relative.port; target.path = removeDotSegments(relative.path || ''); target.query = relative.query; } else { if (!relative.path) { target.path = base.path; if (relative.query !== undefined) { target.query = relative.query; } else { target.query = base.query; } } else { if (relative.path[0] === '/') { target.path = removeDotSegments(relative.path); } else { if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { target.path = '/' + relative.path; } else if (!base.path) { target.path = relative.path; } else { target.path = base.path.slice(0, base.path.lastIndexOf('/') + 1) + relative.path; } target.path = removeDotSegments(target.path); } target.query = relative.query; } // target.authority = base.authority; target.userinfo = base.userinfo; target.host = base.host; target.port = base.port; } target.scheme = base.scheme; } target.fragment = relative.fragment; return target; } /** * @param {import ('./types/index').URIComponent|string} uriA * @param {import ('./types/index').URIComponent|string} uriB * @param {import ('./types/index').Options} options * @returns {boolean} */ function equal(uriA, uriB, options) { const normalizedA = normalizeComparableURI(uriA, options); const normalizedB = normalizeComparableURI(uriB, options); return normalizedA !== undefined && normalizedB !== undefined && normalizedA.toLowerCase() === normalizedB.toLowerCase(); } /** * @param {Readonly} cmpts * @param {import('./types/index').Options} [opts] * @returns {string} */ function serialize(cmpts, opts) { const component = { host: cmpts.host, scheme: cmpts.scheme, userinfo: cmpts.userinfo, port: cmpts.port, path: cmpts.path, query: cmpts.query, nid: cmpts.nid, nss: cmpts.nss, uuid: cmpts.uuid, fragment: cmpts.fragment, reference: cmpts.reference, resourceName: cmpts.resourceName, secure: cmpts.secure, error: '' }; const options = Object.assign({}, opts); const uriTokens = []; // find scheme handler const schemeHandler = getSchemeHandler(options.scheme || component.scheme); // perform scheme specific serialization if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options); if (component.path !== undefined) { if (!options.skipEscape) { component.path = escapePreservingEscapes(component.path); if (component.scheme !== undefined) { component.path = component.path.split('%3A').join(':'); } } else { component.path = normalizePercentEncoding(component.path); } } if (options.reference !== 'suffix' && component.scheme) { uriTokens.push(component.scheme, ':'); } const authority = recomposeAuthority(component); if (authority !== undefined) { if (options.reference !== 'suffix') { uriTokens.push('//'); } uriTokens.push(authority); if (component.path && component.path[0] !== '/') { uriTokens.push('/'); } } if (component.path !== undefined) { let s = component.path; if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { s = removeDotSegments(s); } if (authority === undefined && s[0] === '/' && s[1] === '/') { // don't allow the path to start with "//" s = '/%2F' + s.slice(2); } uriTokens.push(s); } if (component.query !== undefined) { uriTokens.push('?', component.query); } if (component.fragment !== undefined) { uriTokens.push('#', component.fragment); } return uriTokens.join(''); } const URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u; // Captures the authority component (between "//" and the next "/", "?" or "#"), // with or without a scheme prefix, for the literal-backslash rejection below. const AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/; // Captures the leading authority-introducer region after an optional scheme: a // run of forward slashes, backslashes, and the characters the WHATWG URL parser // removes before parsing (TAB U+0009, LF U+000A, CR U+000D). A valid introducer // is exactly "//". Node treats "\" as "/" on special schemes and strips those // characters first, so forms like "\\", "/\", "\/", "//", or a leading // "//" reach an authority in Node while fast-uri's URI_PARSE folds them into // the path group (host confusion / SSRF / redirect bypass). const AUTHORITY_INTRODUCER_REGION = /^(?:[^#/:?]+:)?([/\\\t\n\r]*)/; /** * @param {import('./types/index').URIComponent} parsed * @param {RegExpMatchArray} matches * @returns {string|undefined} */ function getParseError(parsed, matches) { if (matches[2] !== undefined && parsed.path && parsed.path[0] !== '/') { return 'URI path must start with "/" when authority is present.'; } if (typeof parsed.port === 'number' && (parsed.port < 0 || parsed.port > 65535)) { return 'URI port is malformed.'; } return undefined; } /** * @param {string} uri * @param {import('./types/index').Options} [opts] * @returns {{ parsed: import('./types/index').URIComponent, malformedAuthorityOrPort: boolean }} */ function parseWithStatus(uri, opts) { const options = Object.assign({}, opts); /** @type {import('./types/index').URIComponent} */ const parsed = { scheme: undefined, userinfo: undefined, host: '', port: undefined, path: '', query: undefined, fragment: undefined }; let malformedAuthorityOrPort = false; let isIP = false; if (options.reference === 'suffix') { if (options.scheme) { uri = options.scheme + ':' + uri; } else { uri = '//' + uri; } } // A literal backslash (U+005C) is not a valid RFC 3986 URI character and is // not an authority delimiter. Reject it in the authority rather than // rewriting it: normalizing "\" -> "/" (WHATWG error recovery) could silently // change the resource identified by an otherwise-invalid input, and lets "\" // act as a host delimiter here while Node's native URL parses a different // host (SSRF / redirect / origin-allowlist bypass). Percent-encoded %5C is // untouched and remains valid encoded data. const authorityMatch = uri.match(AUTHORITY_PREFIX); if (authorityMatch !== null && authorityMatch[1].indexOf('\\') !== -1) { parsed.error = 'URI authority must not contain a literal backslash.'; malformedAuthorityOrPort = true; } // Reject a malformed or whitespace-smuggled authority introducer. fast-uri // only recognizes a literal "//"; anything else in the leading separator run // (a backslash, or a "//" that appears only after removing the TAB/LF/CR that // Node strips) means the authority fast-uri parses differs from the one Node's // URL resolves. Reject rather than rewrite, mirroring the literal-backslash // guard above. Percent-encoded forms (%5C, %09) are untouched, valid data. const introducerMatch = uri.match(AUTHORITY_INTRODUCER_REGION); if (introducerMatch !== null) { const region = introducerMatch[1]; const normalizedRegion = region.replace(/[\t\n\r]/g, ''); // Two or more leading separators introduce an authority. if (normalizedRegion.length >= 2) { if (normalizedRegion.slice(0, 2) !== '//') { parsed.error = parsed.error || 'URI authority must not contain a literal backslash.'; malformedAuthorityOrPort = true; } else if (region.length !== normalizedRegion.length) { parsed.error = parsed.error || 'URI authority introducer must not contain whitespace.'; malformedAuthorityOrPort = true; } } } const matches = uri.match(URI_PARSE); if (matches) { // store each component parsed.scheme = matches[1]; parsed.userinfo = matches[3]; parsed.host = matches[4]; parsed.port = parseInt(matches[5], 10); parsed.path = matches[6] || ''; parsed.query = matches[7]; parsed.fragment = matches[8]; // fix port number if (isNaN(parsed.port)) { parsed.port = matches[5]; } const parseError = getParseError(parsed, matches); if (parseError !== undefined) { parsed.error = parsed.error || parseError; malformedAuthorityOrPort = true; } if (parsed.host) { const ipv4result = isIPv4(parsed.host); if (ipv4result === false) { const ipv6result = normalizeIPv6(parsed.host); parsed.host = ipv6result.host.toLowerCase(); isIP = ipv6result.isIPV6; } else { isIP = true; } } if (parsed.scheme === undefined && parsed.userinfo === undefined && parsed.host === undefined && parsed.port === undefined && parsed.query === undefined && !parsed.path) { parsed.reference = 'same-document'; } else if (parsed.scheme === undefined) { parsed.reference = 'relative'; } else if (parsed.fragment === undefined) { parsed.reference = 'absolute'; } else { parsed.reference = 'uri'; } // check for reference errors if (options.reference && options.reference !== 'suffix' && options.reference !== parsed.reference) { parsed.error = parsed.error || 'URI is not a ' + options.reference + ' reference.'; } // find scheme handler const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme); // check if scheme can't handle IRIs if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { // if host component is a domain name if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) { // convert Unicode IDN -> ASCII IDN try { parsed.host = new URL('http://' + parsed.host).hostname; } catch (e) { parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e; } } // convert IRI -> URI } if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) { if (uri.indexOf('%') !== -1) { if (parsed.scheme !== undefined) { parsed.scheme = unescape(parsed.scheme); } if (parsed.host !== undefined) { parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP); } } if (parsed.path) { parsed.path = normalizePathEncoding(parsed.path); } if (parsed.fragment) { try { parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment)); } catch { parsed.error = parsed.error || 'URI malformed'; } } } // perform scheme specific parsing if (schemeHandler && schemeHandler.parse) { schemeHandler.parse(parsed, options); } } else { parsed.error = parsed.error || 'URI can not be parsed.'; } return { parsed, malformedAuthorityOrPort }; } /** * @param {string} uri * @param {import('./types/index').Options} [opts] * @returns */ function parse(uri, opts) { return parseWithStatus(uri, opts).parsed; } /** * @param {string} uri * @param {import('./types/index').Options} [opts] * @returns {string} */ function normalizeString(uri, opts) { return normalizeStringWithStatus(uri, opts).normalized; } /** * @param {string} uri * @param {import('./types/index').Options} [opts] * @returns {{ normalized: string, malformedAuthorityOrPort: boolean }} */ function normalizeStringWithStatus(uri, opts) { const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts); return { normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts), malformedAuthorityOrPort }; } /** * @param {import ('./types/index').URIComponent|string} uri * @param {import('./types/index').Options} [opts] * @returns {string|undefined} */ function normalizeComparableURI(uri, opts) { if (typeof uri === 'string') { const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts); return malformedAuthorityOrPort ? undefined : normalized; } if (typeof uri === 'object') { return serialize(uri, opts); } } const fastUri = { SCHEMES, normalize, resolve, resolveComponent, equal, serialize, parse }; module.exports = fastUri; module.exports["default"] = fastUri; module.exports.fastUri = fastUri; /***/ }, /***/ 88472 /*!**********************************************!*\ !*** ./node_modules/fast-uri/lib/schemes.js ***! \**********************************************/ (module, __unused_webpack_exports, __webpack_require__) { "use strict"; const { isUUID } = __webpack_require__(/*! ./utils */ 26665); const URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu; const supportedSchemeNames = /** @type {const} */['http', 'https', 'ws', 'wss', 'urn', 'urn:uuid']; /** @typedef {supportedSchemeNames[number]} SchemeName */ /** * @param {string} name * @returns {name is SchemeName} */ function isValidSchemeName(name) { return supportedSchemeNames.indexOf(/** @type {*} */name) !== -1; } /** * @callback SchemeFn * @param {import('../types/index').URIComponent} component * @param {import('../types/index').Options} options * @returns {import('../types/index').URIComponent} */ /** * @typedef {Object} SchemeHandler * @property {SchemeName} scheme - The scheme name. * @property {boolean} [domainHost] - Indicates if the scheme supports domain hosts. * @property {SchemeFn} parse - Function to parse the URI component for this scheme. * @property {SchemeFn} serialize - Function to serialize the URI component for this scheme. * @property {boolean} [skipNormalize] - Indicates if normalization should be skipped for this scheme. * @property {boolean} [absolutePath] - Indicates if the scheme uses absolute paths. * @property {boolean} [unicodeSupport] - Indicates if the scheme supports Unicode. */ /** * @param {import('../types/index').URIComponent} wsComponent * @returns {boolean} */ function wsIsSecure(wsComponent) { if (wsComponent.secure === true) { return true; } else if (wsComponent.secure === false) { return false; } else if (wsComponent.scheme) { return wsComponent.scheme.length === 3 && (wsComponent.scheme[0] === 'w' || wsComponent.scheme[0] === 'W') && (wsComponent.scheme[1] === 's' || wsComponent.scheme[1] === 'S') && (wsComponent.scheme[2] === 's' || wsComponent.scheme[2] === 'S'); } else { return false; } } /** @type {SchemeFn} */ function httpParse(component) { if (!component.host) { component.error = component.error || 'HTTP URIs must have a host.'; } return component; } /** @type {SchemeFn} */ function httpSerialize(component) { const secure = String(component.scheme).toLowerCase() === 'https'; // normalize the default port if (component.port === (secure ? 443 : 80) || component.port === '') { component.port = undefined; } // normalize the empty path if (!component.path) { component.path = '/'; } // NOTE: We do not parse query strings for HTTP URIs // as WWW Form Url Encoded query strings are part of the HTML4+ spec, // and not the HTTP spec. return component; } /** @type {SchemeFn} */ function wsParse(wsComponent) { // indicate if the secure flag is set wsComponent.secure = wsIsSecure(wsComponent); // construct resouce name wsComponent.resourceName = (wsComponent.path || '/') + (wsComponent.query ? '?' + wsComponent.query : ''); wsComponent.path = undefined; wsComponent.query = undefined; return wsComponent; } /** @type {SchemeFn} */ function wsSerialize(wsComponent) { // normalize the default port if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === '') { wsComponent.port = undefined; } // ensure scheme matches secure flag if (typeof wsComponent.secure === 'boolean') { wsComponent.scheme = wsComponent.secure ? 'wss' : 'ws'; wsComponent.secure = undefined; } // reconstruct path from resource name if (wsComponent.resourceName) { const [path, query] = wsComponent.resourceName.split('?'); wsComponent.path = path && path !== '/' ? path : undefined; wsComponent.query = query; wsComponent.resourceName = undefined; } // forbid fragment component wsComponent.fragment = undefined; return wsComponent; } /** @type {SchemeFn} */ function urnParse(urnComponent, options) { if (!urnComponent.path) { urnComponent.error = 'URN can not be parsed'; return urnComponent; } const matches = urnComponent.path.match(URN_REG); if (matches) { const scheme = options.scheme || urnComponent.scheme || 'urn'; urnComponent.nid = matches[1].toLowerCase(); urnComponent.nss = matches[2]; const urnScheme = `${scheme}:${options.nid || urnComponent.nid}`; const schemeHandler = getSchemeHandler(urnScheme); urnComponent.path = undefined; if (schemeHandler) { urnComponent = schemeHandler.parse(urnComponent, options); } } else { urnComponent.error = urnComponent.error || 'URN can not be parsed.'; } return urnComponent; } /** @type {SchemeFn} */ function urnSerialize(urnComponent, options) { if (urnComponent.nid === undefined) { throw new Error('URN without nid cannot be serialized'); } const scheme = options.scheme || urnComponent.scheme || 'urn'; const nid = urnComponent.nid.toLowerCase(); const urnScheme = `${scheme}:${options.nid || nid}`; const schemeHandler = getSchemeHandler(urnScheme); if (schemeHandler) { urnComponent = schemeHandler.serialize(urnComponent, options); } const uriComponent = urnComponent; const nss = urnComponent.nss; uriComponent.path = `${nid || options.nid}:${nss}`; options.skipEscape = true; return uriComponent; } /** @type {SchemeFn} */ function urnuuidParse(urnComponent, options) { const uuidComponent = urnComponent; uuidComponent.uuid = uuidComponent.nss; uuidComponent.nss = undefined; if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) { uuidComponent.error = uuidComponent.error || 'UUID is not valid.'; } return uuidComponent; } /** @type {SchemeFn} */ function urnuuidSerialize(uuidComponent) { const urnComponent = uuidComponent; // normalize UUID urnComponent.nss = (uuidComponent.uuid || '').toLowerCase(); return urnComponent; } const http = /** @type {SchemeHandler} */{ scheme: 'http', domainHost: true, parse: httpParse, serialize: httpSerialize }; const https = /** @type {SchemeHandler} */{ scheme: 'https', domainHost: http.domainHost, parse: httpParse, serialize: httpSerialize }; const ws = /** @type {SchemeHandler} */{ scheme: 'ws', domainHost: true, parse: wsParse, serialize: wsSerialize }; const wss = /** @type {SchemeHandler} */{ scheme: 'wss', domainHost: ws.domainHost, parse: ws.parse, serialize: ws.serialize }; const urn = /** @type {SchemeHandler} */{ scheme: 'urn', parse: urnParse, serialize: urnSerialize, skipNormalize: true }; const urnuuid = /** @type {SchemeHandler} */{ scheme: 'urn:uuid', parse: urnuuidParse, serialize: urnuuidSerialize, skipNormalize: true }; const SCHEMES = /** @type {Record} */{ http, https, ws, wss, urn, 'urn:uuid': urnuuid }; Object.setPrototypeOf(SCHEMES, null); /** * @param {string|undefined} scheme * @returns {SchemeHandler|undefined} */ function getSchemeHandler(scheme) { return scheme && (SCHEMES[(/** @type {SchemeName} */scheme)] || SCHEMES[(/** @type {SchemeName} */scheme.toLowerCase())]) || undefined; } module.exports = { wsIsSecure, SCHEMES, isValidSchemeName, getSchemeHandler }; /***/ }, /***/ 26665 /*!********************************************!*\ !*** ./node_modules/fast-uri/lib/utils.js ***! \********************************************/ (module) { "use strict"; /** @type {(value: string) => boolean} */ const isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu); /** @type {(value: string) => boolean} */ const isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u); /** @type {(value: string) => boolean} */ const isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu); /** @type {(value: string) => boolean} */ const isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu); /** @type {(value: string) => boolean} */ const isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu); /** * @param {Array} input * @returns {string} */ function stringArrayToHexStripped(input) { let acc = ''; let code = 0; let i = 0; for (i = 0; i < input.length; i++) { code = input[i].charCodeAt(0); if (code === 48) { continue; } if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) { return ''; } acc += input[i]; break; } for (i += 1; i < input.length; i++) { code = input[i].charCodeAt(0); if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) { return ''; } acc += input[i]; } return acc; } /** * @typedef {Object} GetIPV6Result * @property {boolean} error - Indicates if there was an error parsing the IPv6 address. * @property {string} address - The parsed IPv6 address. * @property {string} [zone] - The zone identifier, if present. */ /** * @param {string} value * @returns {boolean} */ const nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u); /** * @param {Array} buffer * @returns {boolean} */ function consumeIsZone(buffer) { buffer.length = 0; return true; } /** * @param {Array} buffer * @param {Array} address * @param {GetIPV6Result} output * @returns {boolean} */ function consumeHextets(buffer, address, output) { if (buffer.length) { const hex = stringArrayToHexStripped(buffer); if (hex !== '') { address.push(hex); } else { output.error = true; return false; } buffer.length = 0; } return true; } /** * @param {string} input * @returns {GetIPV6Result} */ function getIPV6(input) { let tokenCount = 0; const output = { error: false, address: '', zone: '' }; /** @type {Array} */ const address = []; /** @type {Array} */ const buffer = []; let endipv6Encountered = false; let endIpv6 = false; let consume = consumeHextets; for (let i = 0; i < input.length; i++) { const cursor = input[i]; if (cursor === '[' || cursor === ']') { continue; } if (cursor === ':') { if (endipv6Encountered === true) { endIpv6 = true; } if (!consume(buffer, address, output)) { break; } if (++tokenCount > 7) { // not valid output.error = true; break; } if (i > 0 && input[i - 1] === ':') { endipv6Encountered = true; } address.push(':'); continue; } else if (cursor === '%') { if (!consume(buffer, address, output)) { break; } // switch to zone detection consume = consumeIsZone; } else { buffer.push(cursor); continue; } } if (buffer.length) { if (consume === consumeIsZone) { output.zone = buffer.join(''); } else if (endIpv6) { address.push(buffer.join('')); } else { address.push(stringArrayToHexStripped(buffer)); } } output.address = address.join(''); return output; } /** * @typedef {Object} NormalizeIPv6Result * @property {string} host - The normalized host. * @property {string} [escapedHost] - The escaped host. * @property {boolean} isIPV6 - Indicates if the host is an IPv6 address. */ /** * @param {string} host * @returns {NormalizeIPv6Result} */ function normalizeIPv6(host) { if (findToken(host, ':') < 2) { return { host, isIPV6: false }; } const ipv6 = getIPV6(host); if (!ipv6.error) { let newHost = ipv6.address; let escapedHost = ipv6.address; if (ipv6.zone) { newHost += '%' + ipv6.zone; escapedHost += '%25' + ipv6.zone; } return { host: newHost, isIPV6: true, escapedHost }; } else { return { host, isIPV6: false }; } } /** * @param {string} str * @param {string} token * @returns {number} */ function findToken(str, token) { let ind = 0; for (let i = 0; i < str.length; i++) { if (str[i] === token) ind++; } return ind; } /** * @param {string} path * @returns {string} * * @see https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.4 */ function removeDotSegments(path) { let input = path; const output = []; let nextSlash = -1; let len = 0; // eslint-disable-next-line no-cond-assign while (len = input.length) { if (len === 1) { if (input === '.') { break; } else if (input === '/') { output.push('/'); break; } else { output.push(input); break; } } else if (len === 2) { if (input[0] === '.') { if (input[1] === '.') { break; } else if (input[1] === '/') { input = input.slice(2); continue; } } else if (input[0] === '/') { if (input[1] === '.' || input[1] === '/') { output.push('/'); break; } } } else if (len === 3) { if (input === '/..') { if (output.length !== 0) { output.pop(); } output.push('/'); break; } } if (input[0] === '.') { if (input[1] === '.') { if (input[2] === '/') { input = input.slice(3); continue; } } else if (input[1] === '/') { input = input.slice(2); continue; } } else if (input[0] === '/') { if (input[1] === '.') { if (input[2] === '/') { input = input.slice(2); continue; } else if (input[2] === '.') { if (input[3] === '/') { input = input.slice(3); if (output.length !== 0) { output.pop(); } continue; } } } } // Rule 2E: Move normal path segment to output if ((nextSlash = input.indexOf('/', 1)) === -1) { output.push(input); break; } else { output.push(input.slice(0, nextSlash)); input = input.slice(nextSlash); } } return output.join(''); } /** * Re-escape RFC 3986 gen-delims that must not appear literally in the host. * After the URI regex parses, these characters cannot be literal in the host * field, so any that appear after decoding came from percent-encoding and * must be restored to prevent authority structure changes. * * @param {string} host * @param {boolean} isIP - true for IPv4/IPv6 hosts (skip colon re-escaping) * @returns {string} */ const HOST_DELIMS = { '@': '%40', '/': '%2F', '?': '%3F', '#': '%23', ':': '%3A' }; const HOST_DELIM_RE = /[@/?#:]/g; const HOST_DELIM_NO_COLON_RE = /[@/?#]/g; function reescapeHostDelimiters(host, isIP) { const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE; re.lastIndex = 0; return host.replace(re, ch => HOST_DELIMS[ch]); } /** * Normalizes percent escapes and optionally decodes only unreserved ASCII bytes. * Reserved delimiters such as `%2F` and `%2E` stay escaped. * * @param {string} input * @param {boolean} [decodeUnreserved=false] * @returns {string} */ function normalizePercentEncoding(input, decodeUnreserved = false) { if (input.indexOf('%') === -1) { return input; } let output = ''; for (let i = 0; i < input.length; i++) { if (input[i] === '%' && i + 2 < input.length) { const hex = input.slice(i + 1, i + 3); if (isHexPair(hex)) { const normalizedHex = hex.toUpperCase(); const decoded = String.fromCharCode(parseInt(normalizedHex, 16)); if (decodeUnreserved && isUnreserved(decoded)) { output += decoded; } else { output += '%' + normalizedHex; } i += 2; continue; } } output += input[i]; } return output; } /** * Normalizes path data without turning reserved escapes into live path syntax. * Valid escapes are uppercased, raw unsafe characters are escaped, and only * unreserved bytes that are not `.` are decoded. * * @param {string} input * @returns {string} */ function normalizePathEncoding(input) { let output = ''; for (let i = 0; i < input.length; i++) { if (input[i] === '%' && i + 2 < input.length) { const hex = input.slice(i + 1, i + 3); if (isHexPair(hex)) { const normalizedHex = hex.toUpperCase(); const decoded = String.fromCharCode(parseInt(normalizedHex, 16)); if (decoded !== '.' && isUnreserved(decoded)) { output += decoded; } else { output += '%' + normalizedHex; } i += 2; continue; } } if (isPathCharacter(input[i])) { output += input[i]; } else { output += escape(input[i]); } } return output; } /** * Escapes a component while preserving existing valid percent escapes. * * @param {string} input * @returns {string} */ function escapePreservingEscapes(input) { let output = ''; for (let i = 0; i < input.length; i++) { if (input[i] === '%' && i + 2 < input.length) { const hex = input.slice(i + 1, i + 3); if (isHexPair(hex)) { output += '%' + hex.toUpperCase(); i += 2; continue; } } output += escape(input[i]); } return output; } /** * @param {import('../types/index').URIComponent} component * @returns {string|undefined} */ function recomposeAuthority(component) { const uriTokens = []; if (component.userinfo !== undefined) { uriTokens.push(component.userinfo); uriTokens.push('@'); } if (component.host !== undefined) { let host = unescape(component.host); if (!isIPv4(host)) { const ipV6res = normalizeIPv6(host); if (ipV6res.isIPV6 === true) { host = `[${ipV6res.escapedHost}]`; } else { host = reescapeHostDelimiters(host, false); } } uriTokens.push(host); } if (typeof component.port === 'number' || typeof component.port === 'string') { uriTokens.push(':'); uriTokens.push(String(component.port)); } return uriTokens.length ? uriTokens.join('') : undefined; } ; module.exports = { nonSimpleDomain, recomposeAuthority, reescapeHostDelimiters, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, removeDotSegments, isIPv4, isUUID, normalizeIPv6, stringArrayToHexStripped }; /***/ }, /***/ 87687 /*!***************************************************************************************************************!*\ !*** ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/asyncToGenerator.js ***! \***************************************************************************************************************/ (module) { function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }, /***/ 3799 /*!*************************************************************!*\ !*** ./node_modules/@angular/cdk/fesm2022/_array-chunk.mjs ***! \*************************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ coerceArray: () => (/* binding */ coerceArray) /* harmony export */ }); function coerceArray(value) { return Array.isArray(value) ? value : [value]; } /***/ }, /***/ 782 /*!*******************************************************************!*\ !*** ./node_modules/@angular/cdk/fesm2022/_data-source-chunk.mjs ***! \*******************************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ DataSource: () => (/* binding */ DataSource), /* harmony export */ isDataSource: () => (/* binding */ isDataSource) /* harmony export */ }); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ 24745); class DataSource {} function isDataSource(value) { return value && typeof value.connect === 'function' && !(value instanceof rxjs__WEBPACK_IMPORTED_MODULE_0__.ConnectableObservable); } /***/ }, /***/ 63500 /*!**********************************************************************!*\ !*** ./node_modules/@angular/cdk/fesm2022/_directionality-chunk.mjs ***! \**********************************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ DIR_DOCUMENT: () => (/* binding */ DIR_DOCUMENT), /* harmony export */ Directionality: () => (/* binding */ Directionality), /* harmony export */ _resolveDirectionality: () => (/* binding */ _resolveDirectionality) /* harmony export */ }); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 40072); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 14975); const DIR_DOCUMENT = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('cdk-dir-doc', { providedIn: 'root', factory: () => (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT) }); const RTL_LOCALE_PATTERN = /^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i; function _resolveDirectionality(rawValue) { const value = rawValue?.toLowerCase() || ''; if (value === 'auto' && typeof navigator !== 'undefined' && navigator?.language) { return RTL_LOCALE_PATTERN.test(navigator.language) ? 'rtl' : 'ltr'; } return value === 'rtl' ? 'rtl' : 'ltr'; } class Directionality { get value() { return this.valueSignal(); } valueSignal = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.signal)('ltr', ...(ngDevMode ? [{ debugName: "valueSignal" }] : [])); change = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); constructor() { const _document = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(DIR_DOCUMENT, { optional: true }); if (_document) { const bodyDir = _document.body ? _document.body.dir : null; const htmlDir = _document.documentElement ? _document.documentElement.dir : null; this.valueSignal.set(_resolveDirectionality(bodyDir || htmlDir || 'ltr')); } } ngOnDestroy() { this.change.complete(); } static ɵfac = function Directionality_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Directionality)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: Directionality, factory: Directionality.ɵfac, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(Directionality, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable, args: [{ providedIn: 'root' }] }], () => [], null); })(); /***/ }, /***/ 53012 /*!***************************************************************!*\ !*** ./node_modules/@angular/cdk/fesm2022/_element-chunk.mjs ***! \***************************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ _isNumberValue: () => (/* binding */ _isNumberValue), /* harmony export */ coerceElement: () => (/* binding */ coerceElement), /* harmony export */ coerceNumberProperty: () => (/* binding */ coerceNumberProperty) /* harmony export */ }); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 14975); function coerceNumberProperty(value, fallbackValue = 0) { if (_isNumberValue(value)) { return Number(value); } return arguments.length === 2 ? fallbackValue : 0; } function _isNumberValue(value) { return !isNaN(parseFloat(value)) && !isNaN(Number(value)); } function coerceElement(elementOrRef) { return elementOrRef instanceof _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef ? elementOrRef.nativeElement : elementOrRef; } /***/ }, /***/ 23326 /*!****************************************************************************!*\ !*** ./node_modules/@angular/cdk/fesm2022/_fake-event-detection-chunk.mjs ***! \****************************************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ isFakeMousedownFromScreenReader: () => (/* binding */ isFakeMousedownFromScreenReader), /* harmony export */ isFakeTouchstartFromScreenReader: () => (/* binding */ isFakeTouchstartFromScreenReader) /* harmony export */ }); function isFakeMousedownFromScreenReader(event) { return event.buttons === 0 || event.detail === 0; } function isFakeTouchstartFromScreenReader(event) { const touch = event.touches && event.touches[0] || event.changedTouches && event.changedTouches[0]; return !!touch && touch.identifier === -1 && (touch.radiusX == null || touch.radiusX === 1) && (touch.radiusY == null || touch.radiusY === 1); } /***/ }, /***/ 39815 /*!********************************************************************!*\ !*** ./node_modules/@angular/cdk/fesm2022/_id-generator-chunk.mjs ***! \********************************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ _IdGenerator: () => (/* binding */ _IdGenerator) /* harmony export */ }); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 40072); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 14975); const counters = {}; class _IdGenerator { _appId = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.APP_ID); static _infix = `a${Math.floor(Math.random() * 100000).toString()}`; getId(prefix, randomize = false) { if (this._appId !== 'ng') { prefix += this._appId; } if (!counters.hasOwnProperty(prefix)) { counters[prefix] = 0; } return `${prefix}${randomize ? _IdGenerator._infix + '-' : ''}${counters[prefix]++}`; } static ɵfac = function _IdGenerator_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || _IdGenerator)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: _IdGenerator, factory: _IdGenerator.ɵfac, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(_IdGenerator, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable, args: [{ providedIn: 'root' }] }], null, null); })(); /***/ }, /***/ 44689 /*!****************************************************************!*\ !*** ./node_modules/@angular/cdk/fesm2022/_platform-chunk.mjs ***! \****************************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Platform: () => (/* binding */ Platform) /* harmony export */ }); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 40072); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 14975); /* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ 13333); let hasV8BreakIterator; try { hasV8BreakIterator = typeof Intl !== 'undefined' && Intl.v8BreakIterator; } catch { hasV8BreakIterator = false; } class Platform { _platformId = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.PLATFORM_ID); isBrowser = this._platformId ? (0,_angular_common__WEBPACK_IMPORTED_MODULE_2__.isPlatformBrowser)(this._platformId) : typeof document === 'object' && !!document; EDGE = this.isBrowser && /(edge)/i.test(navigator.userAgent); TRIDENT = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent); BLINK = this.isBrowser && !!(window.chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT; WEBKIT = this.isBrowser && /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT; IOS = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window); FIREFOX = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent); ANDROID = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT; SAFARI = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT; constructor() {} static ɵfac = function Platform_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Platform)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: Platform, factory: Platform.ɵfac, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(Platform, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable, args: [{ providedIn: 'root' }] }], () => [], null); })(); /***/ }, /***/ 52978 /*!**************************************************************************************!*\ !*** ./node_modules/@angular/cdk/fesm2022/_recycle-view-repeater-strategy-chunk.mjs ***! \**************************************************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ArrayDataSource: () => (/* binding */ ArrayDataSource), /* harmony export */ _RecycleViewRepeaterStrategy: () => (/* binding */ _RecycleViewRepeaterStrategy), /* harmony export */ _ViewRepeaterOperation: () => (/* binding */ _ViewRepeaterOperation) /* harmony export */ }); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ 87946); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ 98241); /* harmony import */ var _data_source_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./_data-source-chunk.mjs */ 782); class ArrayDataSource extends _data_source_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.DataSource { _data; constructor(_data) { super(); this._data = _data; } connect() { return (0,rxjs__WEBPACK_IMPORTED_MODULE_0__.isObservable)(this._data) ? this._data : (0,rxjs__WEBPACK_IMPORTED_MODULE_1__.of)(this._data); } disconnect() {} } var _ViewRepeaterOperation; (function (_ViewRepeaterOperation) { _ViewRepeaterOperation[_ViewRepeaterOperation["REPLACED"] = 0] = "REPLACED"; _ViewRepeaterOperation[_ViewRepeaterOperation["INSERTED"] = 1] = "INSERTED"; _ViewRepeaterOperation[_ViewRepeaterOperation["MOVED"] = 2] = "MOVED"; _ViewRepeaterOperation[_ViewRepeaterOperation["REMOVED"] = 3] = "REMOVED"; })(_ViewRepeaterOperation || (_ViewRepeaterOperation = {})); class _RecycleViewRepeaterStrategy { viewCacheSize = 20; _viewCache = []; applyChanges(changes, viewContainerRef, itemContextFactory, itemValueResolver, itemViewChanged) { changes.forEachOperation((record, adjustedPreviousIndex, currentIndex) => { let view; let operation; if (record.previousIndex == null) { const viewArgsFactory = () => itemContextFactory(record, adjustedPreviousIndex, currentIndex); view = this._insertView(viewArgsFactory, currentIndex, viewContainerRef, itemValueResolver(record)); operation = view ? _ViewRepeaterOperation.INSERTED : _ViewRepeaterOperation.REPLACED; } else if (currentIndex == null) { this._detachAndCacheView(adjustedPreviousIndex, viewContainerRef); operation = _ViewRepeaterOperation.REMOVED; } else { view = this._moveView(adjustedPreviousIndex, currentIndex, viewContainerRef, itemValueResolver(record)); operation = _ViewRepeaterOperation.MOVED; } if (itemViewChanged) { itemViewChanged({ context: view?.context, operation, record }); } }); } detach() { for (const view of this._viewCache) { view.destroy(); } this._viewCache = []; } _insertView(viewArgsFactory, currentIndex, viewContainerRef, value) { const cachedView = this._insertViewFromCache(currentIndex, viewContainerRef); if (cachedView) { cachedView.context.$implicit = value; return undefined; } const viewArgs = viewArgsFactory(); return viewContainerRef.createEmbeddedView(viewArgs.templateRef, viewArgs.context, viewArgs.index); } _detachAndCacheView(index, viewContainerRef) { const detachedView = viewContainerRef.detach(index); this._maybeCacheView(detachedView, viewContainerRef); } _moveView(adjustedPreviousIndex, currentIndex, viewContainerRef, value) { const view = viewContainerRef.get(adjustedPreviousIndex); viewContainerRef.move(view, currentIndex); view.context.$implicit = value; return view; } _maybeCacheView(view, viewContainerRef) { if (this._viewCache.length < this.viewCacheSize) { this._viewCache.push(view); } else { const index = viewContainerRef.indexOf(view); if (index === -1) { view.destroy(); } else { viewContainerRef.remove(index); } } } _insertViewFromCache(index, viewContainerRef) { const cachedView = this._viewCache.pop(); if (cachedView) { viewContainerRef.insert(cachedView, index); } return cachedView || null; } } /***/ }, /***/ 81981 /*!*****************************************************************!*\ !*** ./node_modules/@angular/cdk/fesm2022/_scrolling-chunk.mjs ***! \*****************************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ RtlScrollAxisType: () => (/* binding */ RtlScrollAxisType), /* harmony export */ getRtlScrollAxisType: () => (/* binding */ getRtlScrollAxisType), /* harmony export */ supportsScrollBehavior: () => (/* binding */ supportsScrollBehavior) /* harmony export */ }); var RtlScrollAxisType; (function (RtlScrollAxisType) { RtlScrollAxisType[RtlScrollAxisType["NORMAL"] = 0] = "NORMAL"; RtlScrollAxisType[RtlScrollAxisType["NEGATED"] = 1] = "NEGATED"; RtlScrollAxisType[RtlScrollAxisType["INVERTED"] = 2] = "INVERTED"; })(RtlScrollAxisType || (RtlScrollAxisType = {})); let rtlScrollAxisType; let scrollBehaviorSupported; function supportsScrollBehavior() { if (scrollBehaviorSupported == null) { if (typeof document !== 'object' || !document || typeof Element !== 'function' || !Element) { scrollBehaviorSupported = false; return scrollBehaviorSupported; } if (document.documentElement?.style && 'scrollBehavior' in document.documentElement.style) { scrollBehaviorSupported = true; } else { const scrollToFunction = Element.prototype.scrollTo; if (scrollToFunction) { scrollBehaviorSupported = !/\{\s*\[native code\]\s*\}/.test(scrollToFunction.toString()); } else { scrollBehaviorSupported = false; } } } return scrollBehaviorSupported; } function getRtlScrollAxisType() { if (typeof document !== 'object' || !document) { return RtlScrollAxisType.NORMAL; } if (rtlScrollAxisType == null) { const scrollContainer = document.createElement('div'); const containerStyle = scrollContainer.style; scrollContainer.dir = 'rtl'; containerStyle.width = '1px'; containerStyle.overflow = 'auto'; containerStyle.visibility = 'hidden'; containerStyle.pointerEvents = 'none'; containerStyle.position = 'absolute'; const content = document.createElement('div'); const contentStyle = content.style; contentStyle.width = '2px'; contentStyle.height = '1px'; scrollContainer.appendChild(content); document.body.appendChild(scrollContainer); rtlScrollAxisType = RtlScrollAxisType.NORMAL; if (scrollContainer.scrollLeft === 0) { scrollContainer.scrollLeft = 1; rtlScrollAxisType = scrollContainer.scrollLeft === 0 ? RtlScrollAxisType.NEGATED : RtlScrollAxisType.INVERTED; } scrollContainer.remove(); } return rtlScrollAxisType; } /***/ }, /***/ 73439 /*!******************************************************************!*\ !*** ./node_modules/@angular/cdk/fesm2022/_shadow-dom-chunk.mjs ***! \******************************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ _getEventTarget: () => (/* binding */ _getEventTarget), /* harmony export */ _getFocusedElementPierceShadowDom: () => (/* binding */ _getFocusedElementPierceShadowDom), /* harmony export */ _getShadowRoot: () => (/* binding */ _getShadowRoot), /* harmony export */ _supportsShadowDom: () => (/* binding */ _supportsShadowDom) /* harmony export */ }); let shadowDomIsSupported; function _supportsShadowDom() { if (shadowDomIsSupported == null) { const head = typeof document !== 'undefined' ? document.head : null; shadowDomIsSupported = !!(head && (head.createShadowRoot || head.attachShadow)); } return shadowDomIsSupported; } function _getShadowRoot(element) { if (_supportsShadowDom()) { const rootNode = element.getRootNode ? element.getRootNode() : null; if (typeof ShadowRoot !== 'undefined' && ShadowRoot && rootNode instanceof ShadowRoot) { return rootNode; } } return null; } function _getFocusedElementPierceShadowDom() { let activeElement = typeof document !== 'undefined' && document ? document.activeElement : null; while (activeElement && activeElement.shadowRoot) { const newActiveElement = activeElement.shadowRoot.activeElement; if (newActiveElement === activeElement) { break; } else { activeElement = newActiveElement; } } return activeElement; } function _getEventTarget(event) { return event.composedPath ? event.composedPath()[0] : event.target; } /***/ }, /***/ 63177 /*!********************************************************************!*\ !*** ./node_modules/@angular/cdk/fesm2022/_style-loader-chunk.mjs ***! \********************************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ _CdkPrivateStyleLoader: () => (/* binding */ _CdkPrivateStyleLoader) /* harmony export */ }); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 40072); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 14975); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 36973); const appsWithLoaders = new WeakMap(); class _CdkPrivateStyleLoader { _appRef; _injector = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.Injector); _environmentInjector = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.EnvironmentInjector); load(loader) { const appRef = this._appRef = this._appRef || this._injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__.ApplicationRef); let data = appsWithLoaders.get(appRef); if (!data) { data = { loaders: new Set(), refs: [] }; appsWithLoaders.set(appRef, data); appRef.onDestroy(() => { appsWithLoaders.get(appRef)?.refs.forEach(ref => ref.destroy()); appsWithLoaders.delete(appRef); }); } if (!data.loaders.has(loader)) { data.loaders.add(loader); data.refs.push((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.createComponent)(loader, { environmentInjector: this._environmentInjector })); } } static ɵfac = function _CdkPrivateStyleLoader_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || _CdkPrivateStyleLoader)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: _CdkPrivateStyleLoader, factory: _CdkPrivateStyleLoader.ɵfac, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(_CdkPrivateStyleLoader, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable, args: [{ providedIn: 'root' }] }], null, null); })(); /***/ }, /***/ 25863 /*!*****************************************************!*\ !*** ./node_modules/@angular/cdk/fesm2022/bidi.mjs ***! \*****************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ BidiModule: () => (/* binding */ BidiModule), /* harmony export */ DIR_DOCUMENT: () => (/* reexport safe */ _directionality_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.DIR_DOCUMENT), /* harmony export */ Dir: () => (/* binding */ Dir), /* harmony export */ Directionality: () => (/* reexport safe */ _directionality_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.Directionality) /* harmony export */ }); /* harmony import */ var _directionality_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_directionality-chunk.mjs */ 63500); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 40072); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 14975); class Dir { _isInitialized = false; _rawDir = ''; change = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.EventEmitter(); get dir() { return this.valueSignal(); } set dir(value) { const previousValue = this.valueSignal(); this.valueSignal.set((0,_directionality_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__._resolveDirectionality)(value)); this._rawDir = value; if (previousValue !== this.valueSignal() && this._isInitialized) { this.change.emit(this.valueSignal()); } } get value() { return this.dir; } valueSignal = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.signal)('ltr', ...(ngDevMode ? [{ debugName: "valueSignal" }] : [])); ngAfterContentInit() { this._isInitialized = true; } ngOnDestroy() { this.change.complete(); } static ɵfac = function Dir_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Dir)(); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({ type: Dir, selectors: [["", "dir", ""]], hostVars: 1, hostBindings: function Dir_HostBindings(rf, ctx) { if (rf & 2) { _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵattribute"]("dir", ctx._rawDir); } }, inputs: { dir: "dir" }, outputs: { change: "dirChange" }, exportAs: ["dir"], features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([{ provide: _directionality_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.Directionality, useExisting: Dir }])] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(Dir, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive, args: [{ selector: '[dir]', providers: [{ provide: _directionality_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.Directionality, useExisting: Dir }], host: { '[attr.dir]': '_rawDir' }, exportAs: 'dir' }] }], null, { change: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Output, args: ['dirChange'] }], dir: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input }] }); })(); class BidiModule { static ɵfac = function BidiModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || BidiModule)(); }; static ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineNgModule"]({ type: BidiModule }); static ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({}); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(BidiModule, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.NgModule, args: [{ imports: [Dir], exports: [Dir] }] }], null, null); })(); /***/ }, /***/ 94355 /*!**********************************************************!*\ !*** ./node_modules/@angular/cdk/fesm2022/drag-drop.mjs ***! \**********************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CDK_DRAG_CONFIG: () => (/* binding */ CDK_DRAG_CONFIG), /* harmony export */ CDK_DRAG_HANDLE: () => (/* binding */ CDK_DRAG_HANDLE), /* harmony export */ CDK_DRAG_PARENT: () => (/* binding */ CDK_DRAG_PARENT), /* harmony export */ CDK_DRAG_PLACEHOLDER: () => (/* binding */ CDK_DRAG_PLACEHOLDER), /* harmony export */ CDK_DRAG_PREVIEW: () => (/* binding */ CDK_DRAG_PREVIEW), /* harmony export */ CDK_DROP_LIST: () => (/* binding */ CDK_DROP_LIST), /* harmony export */ CDK_DROP_LIST_GROUP: () => (/* binding */ CDK_DROP_LIST_GROUP), /* harmony export */ CdkDrag: () => (/* binding */ CdkDrag), /* harmony export */ CdkDragHandle: () => (/* binding */ CdkDragHandle), /* harmony export */ CdkDragPlaceholder: () => (/* binding */ CdkDragPlaceholder), /* harmony export */ CdkDragPreview: () => (/* binding */ CdkDragPreview), /* harmony export */ CdkDropList: () => (/* binding */ CdkDropList), /* harmony export */ CdkDropListGroup: () => (/* binding */ CdkDropListGroup), /* harmony export */ DragDrop: () => (/* binding */ DragDrop), /* harmony export */ DragDropModule: () => (/* binding */ DragDropModule), /* harmony export */ DragDropRegistry: () => (/* binding */ DragDropRegistry), /* harmony export */ DragRef: () => (/* binding */ DragRef), /* harmony export */ DropListRef: () => (/* binding */ DropListRef), /* harmony export */ copyArrayItem: () => (/* binding */ copyArrayItem), /* harmony export */ createDragRef: () => (/* binding */ createDragRef), /* harmony export */ createDropListRef: () => (/* binding */ createDropListRef), /* harmony export */ moveItemInArray: () => (/* binding */ moveItemInArray), /* harmony export */ transferArrayItem: () => (/* binding */ transferArrayItem), /* harmony export */ "ɵɵCdkScrollable": () => (/* reexport safe */ _scrolling_mjs__WEBPACK_IMPORTED_MODULE_13__.CdkScrollable) /* harmony export */ }); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 40072); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 14975); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 36973); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 57417); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ 33242); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs */ 78916); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ 92809); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs */ 72737); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs */ 5637); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs */ 69042); /* harmony import */ var _shadow_dom_chunk_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./_shadow-dom-chunk.mjs */ 73439); /* harmony import */ var _style_loader_chunk_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./_style-loader-chunk.mjs */ 63177); /* harmony import */ var _fake_event_detection_chunk_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./_fake-event-detection-chunk.mjs */ 23326); /* harmony import */ var _scrolling_mjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./scrolling.mjs */ 67658); /* harmony import */ var _element_chunk_mjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./_element-chunk.mjs */ 53012); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! rxjs/operators */ 38442); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! rxjs/operators */ 9276); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! rxjs/operators */ 86110); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! rxjs/operators */ 13329); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! rxjs/operators */ 53897); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! rxjs/operators */ 45541); /* harmony import */ var _directionality_chunk_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./_directionality-chunk.mjs */ 63500); /* harmony import */ var _id_generator_chunk_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./_id-generator-chunk.mjs */ 39815); /* harmony import */ var _array_chunk_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./_array-chunk.mjs */ 3799); function deepCloneNode(node) { const clone = node.cloneNode(true); const descendantsWithId = clone.querySelectorAll('[id]'); const nodeName = node.nodeName.toLowerCase(); clone.removeAttribute('id'); for (let i = 0; i < descendantsWithId.length; i++) { descendantsWithId[i].removeAttribute('id'); } if (nodeName === 'canvas') { transferCanvasData(node, clone); } else if (nodeName === 'input' || nodeName === 'select' || nodeName === 'textarea') { transferInputData(node, clone); } transferData('canvas', node, clone, transferCanvasData); transferData('input, textarea, select', node, clone, transferInputData); return clone; } function transferData(selector, node, clone, callback) { const descendantElements = node.querySelectorAll(selector); if (descendantElements.length) { const cloneElements = clone.querySelectorAll(selector); for (let i = 0; i < descendantElements.length; i++) { callback(descendantElements[i], cloneElements[i]); } } } let cloneUniqueId = 0; function transferInputData(source, clone) { if (clone.type !== 'file') { clone.value = source.value; } if (clone.type === 'radio' && clone.name) { clone.name = `mat-clone-${clone.name}-${cloneUniqueId++}`; } } function transferCanvasData(source, clone) { const context = clone.getContext('2d'); if (context) { try { context.drawImage(source, 0, 0); } catch {} } } function getMutableClientRect(element) { const rect = element.getBoundingClientRect(); return { top: rect.top, right: rect.right, bottom: rect.bottom, left: rect.left, width: rect.width, height: rect.height, x: rect.x, y: rect.y }; } function isInsideClientRect(clientRect, x, y) { const { top, bottom, left, right } = clientRect; return y >= top && y <= bottom && x >= left && x <= right; } function isOverflowingParent(parentRect, childRect) { const isLeftOverflowing = childRect.left < parentRect.left; const isRightOverflowing = childRect.left + childRect.width > parentRect.right; const isTopOverflowing = childRect.top < parentRect.top; const isBottomOverflowing = childRect.top + childRect.height > parentRect.bottom; return isLeftOverflowing || isRightOverflowing || isTopOverflowing || isBottomOverflowing; } function adjustDomRect(domRect, top, left) { domRect.top += top; domRect.bottom = domRect.top + domRect.height; domRect.left += left; domRect.right = domRect.left + domRect.width; } function isPointerNearDomRect(rect, threshold, pointerX, pointerY) { const { top, right, bottom, left, width, height } = rect; const xThreshold = width * threshold; const yThreshold = height * threshold; return pointerY > top - yThreshold && pointerY < bottom + yThreshold && pointerX > left - xThreshold && pointerX < right + xThreshold; } class ParentPositionTracker { _document; positions = new Map(); constructor(_document) { this._document = _document; } clear() { this.positions.clear(); } cache(elements) { this.clear(); this.positions.set(this._document, { scrollPosition: this.getViewportScrollPosition() }); elements.forEach(element => { this.positions.set(element, { scrollPosition: { top: element.scrollTop, left: element.scrollLeft }, clientRect: getMutableClientRect(element) }); }); } handleScroll(event) { const target = (0,_shadow_dom_chunk_mjs__WEBPACK_IMPORTED_MODULE_10__._getEventTarget)(event); const cachedPosition = this.positions.get(target); if (!cachedPosition) { return null; } const scrollPosition = cachedPosition.scrollPosition; let newTop; let newLeft; if (target === this._document) { const viewportScrollPosition = this.getViewportScrollPosition(); newTop = viewportScrollPosition.top; newLeft = viewportScrollPosition.left; } else { newTop = target.scrollTop; newLeft = target.scrollLeft; } const topDifference = scrollPosition.top - newTop; const leftDifference = scrollPosition.left - newLeft; this.positions.forEach((position, node) => { if (position.clientRect && target !== node && target.contains(node)) { adjustDomRect(position.clientRect, topDifference, leftDifference); } }); scrollPosition.top = newTop; scrollPosition.left = newLeft; return { top: topDifference, left: leftDifference }; } getViewportScrollPosition() { return { top: window.scrollY, left: window.scrollX }; } } function getRootNode(viewRef, _document) { const rootNodes = viewRef.rootNodes; if (rootNodes.length === 1 && rootNodes[0].nodeType === _document.ELEMENT_NODE) { return rootNodes[0]; } const wrapper = _document.createElement('div'); rootNodes.forEach(node => wrapper.appendChild(node)); return wrapper; } function extendStyles(dest, source, importantProperties) { for (let key in source) { if (source.hasOwnProperty(key)) { const value = source[key]; if (value) { dest.setProperty(key, value, importantProperties?.has(key) ? 'important' : ''); } else { dest.removeProperty(key); } } } return dest; } function toggleNativeDragInteractions(element, enable) { const userSelect = enable ? '' : 'none'; extendStyles(element.style, { 'touch-action': enable ? '' : 'none', '-webkit-user-drag': enable ? '' : 'none', '-webkit-tap-highlight-color': enable ? '' : 'transparent', 'user-select': userSelect, '-ms-user-select': userSelect, '-webkit-user-select': userSelect, '-moz-user-select': userSelect }); } function toggleVisibility(element, enable, importantProperties) { extendStyles(element.style, { position: enable ? '' : 'fixed', top: enable ? '' : '0', opacity: enable ? '' : '0', left: enable ? '' : '-999em' }, importantProperties); } function combineTransforms(transform, initialTransform) { return initialTransform && initialTransform != 'none' ? transform + ' ' + initialTransform : transform; } function matchElementSize(target, sourceRect) { target.style.width = `${sourceRect.width}px`; target.style.height = `${sourceRect.height}px`; target.style.transform = getTransform(sourceRect.left, sourceRect.top); } function getTransform(x, y) { return `translate3d(${Math.round(x)}px, ${Math.round(y)}px, 0)`; } const capturingEventOptions = { capture: true }; const activeCapturingEventOptions$1 = { passive: false, capture: true }; class _ResetsLoader { static ɵfac = function _ResetsLoader_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || _ResetsLoader)(); }; static ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ type: _ResetsLoader, selectors: [["ng-component"]], hostAttrs: ["cdk-drag-resets-container", ""], decls: 0, vars: 0, template: function _ResetsLoader_Template(rf, ctx) {}, styles: ["@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit;inset:auto}}.cdk-drag-placeholder *,.cdk-drag-preview *{pointer-events:none !important}\n"], encapsulation: 2, changeDetection: 0 }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(_ResetsLoader, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Component, args: [{ encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ViewEncapsulation.None, template: '', changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ChangeDetectionStrategy.OnPush, host: { 'cdk-drag-resets-container': '' }, styles: ["@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit;inset:auto}}.cdk-drag-placeholder *,.cdk-drag-preview *{pointer-events:none !important}\n"] }] }], null, null); })(); class DragDropRegistry { _ngZone = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone); _document = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT); _styleLoader = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_style_loader_chunk_mjs__WEBPACK_IMPORTED_MODULE_11__._CdkPrivateStyleLoader); _renderer = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.RendererFactory2).createRenderer(null, null); _cleanupDocumentTouchmove; _scroll = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); _dropInstances = new Set(); _dragInstances = new Set(); _activeDragInstances = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.signal)([], ...(ngDevMode ? [{ debugName: "_activeDragInstances" }] : [])); _globalListeners; _draggingPredicate = item => item.isDragging(); _domNodesToDirectives = null; pointerMove = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); pointerUp = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); constructor() {} registerDropContainer(drop) { if (!this._dropInstances.has(drop)) { this._dropInstances.add(drop); } } registerDragItem(drag) { this._dragInstances.add(drag); if (this._dragInstances.size === 1) { this._ngZone.runOutsideAngular(() => { this._cleanupDocumentTouchmove?.(); this._cleanupDocumentTouchmove = this._renderer.listen(this._document, 'touchmove', this._persistentTouchmoveListener, activeCapturingEventOptions$1); }); } } removeDropContainer(drop) { this._dropInstances.delete(drop); } removeDragItem(drag) { this._dragInstances.delete(drag); this.stopDragging(drag); if (this._dragInstances.size === 0) { this._cleanupDocumentTouchmove?.(); } } startDragging(drag, event) { if (this._activeDragInstances().indexOf(drag) > -1) { return; } this._styleLoader.load(_ResetsLoader); this._activeDragInstances.update(instances => [...instances, drag]); if (this._activeDragInstances().length === 1) { const isTouchEvent = event.type.startsWith('touch'); const endEventHandler = e => this.pointerUp.next(e); const toBind = [['scroll', e => this._scroll.next(e), capturingEventOptions], ['selectstart', this._preventDefaultWhileDragging, activeCapturingEventOptions$1]]; if (isTouchEvent) { toBind.push(['touchend', endEventHandler, capturingEventOptions], ['touchcancel', endEventHandler, capturingEventOptions]); } else { toBind.push(['mouseup', endEventHandler, capturingEventOptions]); } if (!isTouchEvent) { toBind.push(['mousemove', e => this.pointerMove.next(e), activeCapturingEventOptions$1]); } this._ngZone.runOutsideAngular(() => { this._globalListeners = toBind.map(([name, handler, options]) => this._renderer.listen(this._document, name, handler, options)); }); } } stopDragging(drag) { this._activeDragInstances.update(instances => { const index = instances.indexOf(drag); if (index > -1) { instances.splice(index, 1); return [...instances]; } return instances; }); if (this._activeDragInstances().length === 0) { this._clearGlobalListeners(); } } isDragging(drag) { return this._activeDragInstances().indexOf(drag) > -1; } scrolled(shadowRoot) { const streams = [this._scroll]; if (shadowRoot && shadowRoot !== this._document) { streams.push(new rxjs__WEBPACK_IMPORTED_MODULE_3__.Observable(observer => { return this._ngZone.runOutsideAngular(() => { const cleanup = this._renderer.listen(shadowRoot, 'scroll', event => { if (this._activeDragInstances().length) { observer.next(event); } }, capturingEventOptions); return () => { cleanup(); }; }); })); } return (0,rxjs__WEBPACK_IMPORTED_MODULE_9__.merge)(...streams); } registerDirectiveNode(node, dragRef) { this._domNodesToDirectives ??= new WeakMap(); this._domNodesToDirectives.set(node, dragRef); } removeDirectiveNode(node) { this._domNodesToDirectives?.delete(node); } getDragDirectiveForNode(node) { return this._domNodesToDirectives?.get(node) || null; } ngOnDestroy() { this._dragInstances.forEach(instance => this.removeDragItem(instance)); this._dropInstances.forEach(instance => this.removeDropContainer(instance)); this._domNodesToDirectives = null; this._clearGlobalListeners(); this.pointerMove.complete(); this.pointerUp.complete(); } _preventDefaultWhileDragging = event => { if (this._activeDragInstances().length > 0) { event.preventDefault(); } }; _persistentTouchmoveListener = event => { if (this._activeDragInstances().length > 0) { if (this._activeDragInstances().some(this._draggingPredicate)) { event.preventDefault(); } this.pointerMove.next(event); } }; _clearGlobalListeners() { this._globalListeners?.forEach(cleanup => cleanup()); this._globalListeners = undefined; } static ɵfac = function DragDropRegistry_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DragDropRegistry)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: DragDropRegistry, factory: DragDropRegistry.ɵfac, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(DragDropRegistry, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable, args: [{ providedIn: 'root' }] }], () => [], null); })(); function parseCssTimeUnitsToMs(value) { const multiplier = value.toLowerCase().indexOf('ms') > -1 ? 1 : 1000; return parseFloat(value) * multiplier; } function getTransformTransitionDurationInMs(element) { const computedStyle = getComputedStyle(element); const transitionedProperties = parseCssPropertyValue(computedStyle, 'transition-property'); const property = transitionedProperties.find(prop => prop === 'transform' || prop === 'all'); if (!property) { return 0; } const propertyIndex = transitionedProperties.indexOf(property); const rawDurations = parseCssPropertyValue(computedStyle, 'transition-duration'); const rawDelays = parseCssPropertyValue(computedStyle, 'transition-delay'); return parseCssTimeUnitsToMs(rawDurations[propertyIndex]) + parseCssTimeUnitsToMs(rawDelays[propertyIndex]); } function parseCssPropertyValue(computedStyle, name) { const value = computedStyle.getPropertyValue(name); return value.split(',').map(part => part.trim()); } const importantProperties = new Set(['position']); class PreviewRef { _document; _rootElement; _direction; _initialDomRect; _previewTemplate; _previewClass; _pickupPositionOnPage; _initialTransform; _zIndex; _renderer; _previewEmbeddedView = null; _preview; get element() { return this._preview; } constructor(_document, _rootElement, _direction, _initialDomRect, _previewTemplate, _previewClass, _pickupPositionOnPage, _initialTransform, _zIndex, _renderer) { this._document = _document; this._rootElement = _rootElement; this._direction = _direction; this._initialDomRect = _initialDomRect; this._previewTemplate = _previewTemplate; this._previewClass = _previewClass; this._pickupPositionOnPage = _pickupPositionOnPage; this._initialTransform = _initialTransform; this._zIndex = _zIndex; this._renderer = _renderer; } attach(parent) { this._preview = this._createPreview(); parent.appendChild(this._preview); if (supportsPopover(this._preview)) { this._preview['showPopover'](); } } destroy() { this._preview.remove(); this._previewEmbeddedView?.destroy(); this._preview = this._previewEmbeddedView = null; } setTransform(value) { this._preview.style.transform = value; } getBoundingClientRect() { return this._preview.getBoundingClientRect(); } addClass(className) { this._preview.classList.add(className); } getTransitionDuration() { return getTransformTransitionDurationInMs(this._preview); } addEventListener(name, handler) { return this._renderer.listen(this._preview, name, handler); } _createPreview() { const previewConfig = this._previewTemplate; const previewClass = this._previewClass; const previewTemplate = previewConfig ? previewConfig.template : null; let preview; if (previewTemplate && previewConfig) { const rootRect = previewConfig.matchSize ? this._initialDomRect : null; const viewRef = previewConfig.viewContainer.createEmbeddedView(previewTemplate, previewConfig.context); viewRef.detectChanges(); preview = getRootNode(viewRef, this._document); this._previewEmbeddedView = viewRef; if (previewConfig.matchSize) { matchElementSize(preview, rootRect); } else { preview.style.transform = getTransform(this._pickupPositionOnPage.x, this._pickupPositionOnPage.y); } } else { preview = deepCloneNode(this._rootElement); matchElementSize(preview, this._initialDomRect); if (this._initialTransform) { preview.style.transform = this._initialTransform; } } extendStyles(preview.style, { 'pointer-events': 'none', 'margin': supportsPopover(preview) ? '0 auto 0 0' : '0', 'position': 'fixed', 'top': '0', 'left': '0', 'z-index': this._zIndex + '' }, importantProperties); toggleNativeDragInteractions(preview, false); preview.classList.add('cdk-drag-preview'); preview.setAttribute('popover', 'manual'); preview.setAttribute('dir', this._direction); if (previewClass) { if (Array.isArray(previewClass)) { previewClass.forEach(className => preview.classList.add(className)); } else { preview.classList.add(previewClass); } } return preview; } } function supportsPopover(element) { return 'showPopover' in element; } const passiveEventListenerOptions = { passive: true }; const activeEventListenerOptions = { passive: false }; const activeCapturingEventOptions = { passive: false, capture: true }; const MOUSE_EVENT_IGNORE_TIME = 800; const PLACEHOLDER_CLASS = 'cdk-drag-placeholder'; const dragImportantProperties = new Set(['position']); function createDragRef(injector, element, config = { dragStartThreshold: 5, pointerDirectionChangeThreshold: 5 }) { const renderer = injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__.Renderer2, null, { optional: true }) || injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__.RendererFactory2).createRenderer(null, null); return new DragRef(element, config, injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT), injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone), injector.get(_scrolling_mjs__WEBPACK_IMPORTED_MODULE_13__.ViewportRuler), injector.get(DragDropRegistry), renderer); } class DragRef { _config; _document; _ngZone; _viewportRuler; _dragDropRegistry; _renderer; _rootElementCleanups; _cleanupShadowRootSelectStart; _preview = null; _previewContainer; _placeholderRef = null; _placeholder; _pickupPositionInElement; _pickupPositionOnPage; _marker; _anchor = null; _passiveTransform = { x: 0, y: 0 }; _activeTransform = { x: 0, y: 0 }; _initialTransform; _hasStartedDragging = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.signal)(false, ...(ngDevMode ? [{ debugName: "_hasStartedDragging" }] : [])); _hasMoved = false; _initialContainer; _initialIndex; _parentPositions; _moveEvents = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); _pointerDirectionDelta; _pointerPositionAtLastDirectionChange; _lastKnownPointerPosition; _rootElement; _ownerSVGElement = null; _rootElementTapHighlight; _pointerMoveSubscription = rxjs__WEBPACK_IMPORTED_MODULE_7__.Subscription.EMPTY; _pointerUpSubscription = rxjs__WEBPACK_IMPORTED_MODULE_7__.Subscription.EMPTY; _scrollSubscription = rxjs__WEBPACK_IMPORTED_MODULE_7__.Subscription.EMPTY; _resizeSubscription = rxjs__WEBPACK_IMPORTED_MODULE_7__.Subscription.EMPTY; _lastTouchEventTime; _dragStartTime; _boundaryElement = null; _nativeInteractionsEnabled = true; _initialDomRect; _previewRect; _boundaryRect; _previewTemplate; _placeholderTemplate; _handles = []; _disabledHandles = new Set(); _dropContainer; _direction = 'ltr'; _parentDragRef = null; _cachedShadowRoot; lockAxis = null; dragStartDelay = 0; previewClass; scale = 1; get disabled() { return this._disabled || !!(this._dropContainer && this._dropContainer.disabled); } set disabled(value) { if (value !== this._disabled) { this._disabled = value; this._toggleNativeDragInteractions(); this._handles.forEach(handle => toggleNativeDragInteractions(handle, value)); } } _disabled = false; beforeStarted = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); started = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); released = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); ended = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); entered = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); exited = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); dropped = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); moved = this._moveEvents; data; constrainPosition; constructor(element, _config, _document, _ngZone, _viewportRuler, _dragDropRegistry, _renderer) { this._config = _config; this._document = _document; this._ngZone = _ngZone; this._viewportRuler = _viewportRuler; this._dragDropRegistry = _dragDropRegistry; this._renderer = _renderer; this.withRootElement(element).withParent(_config.parentDragRef || null); this._parentPositions = new ParentPositionTracker(_document); _dragDropRegistry.registerDragItem(this); } getPlaceholderElement() { return this._placeholder; } getRootElement() { return this._rootElement; } getVisibleElement() { return this.isDragging() ? this.getPlaceholderElement() : this.getRootElement(); } withHandles(handles) { this._handles = handles.map(handle => (0,_element_chunk_mjs__WEBPACK_IMPORTED_MODULE_14__.coerceElement)(handle)); this._handles.forEach(handle => toggleNativeDragInteractions(handle, this.disabled)); this._toggleNativeDragInteractions(); const disabledHandles = new Set(); this._disabledHandles.forEach(handle => { if (this._handles.indexOf(handle) > -1) { disabledHandles.add(handle); } }); this._disabledHandles = disabledHandles; return this; } withPreviewTemplate(template) { this._previewTemplate = template; return this; } withPlaceholderTemplate(template) { this._placeholderTemplate = template; return this; } withRootElement(rootElement) { const element = (0,_element_chunk_mjs__WEBPACK_IMPORTED_MODULE_14__.coerceElement)(rootElement); if (element !== this._rootElement) { this._removeRootElementListeners(); const renderer = this._renderer; this._rootElementCleanups = this._ngZone.runOutsideAngular(() => [renderer.listen(element, 'mousedown', this._pointerDown, activeEventListenerOptions), renderer.listen(element, 'touchstart', this._pointerDown, passiveEventListenerOptions), renderer.listen(element, 'dragstart', this._nativeDragStart, activeEventListenerOptions)]); this._initialTransform = undefined; this._rootElement = element; } if (typeof SVGElement !== 'undefined' && this._rootElement instanceof SVGElement) { this._ownerSVGElement = this._rootElement.ownerSVGElement; } return this; } withBoundaryElement(boundaryElement) { this._boundaryElement = boundaryElement ? (0,_element_chunk_mjs__WEBPACK_IMPORTED_MODULE_14__.coerceElement)(boundaryElement) : null; this._resizeSubscription.unsubscribe(); if (boundaryElement) { this._resizeSubscription = this._viewportRuler.change(10).subscribe(() => this._containInsideBoundaryOnResize()); } return this; } withParent(parent) { this._parentDragRef = parent; return this; } dispose() { this._removeRootElementListeners(); if (this.isDragging()) { this._rootElement?.remove(); } this._marker?.remove(); this._destroyPreview(); this._destroyPlaceholder(); this._dragDropRegistry.removeDragItem(this); this._removeListeners(); this.beforeStarted.complete(); this.started.complete(); this.released.complete(); this.ended.complete(); this.entered.complete(); this.exited.complete(); this.dropped.complete(); this._moveEvents.complete(); this._handles = []; this._disabledHandles.clear(); this._dropContainer = undefined; this._resizeSubscription.unsubscribe(); this._parentPositions.clear(); this._boundaryElement = this._rootElement = this._ownerSVGElement = this._placeholderTemplate = this._previewTemplate = this._marker = this._parentDragRef = null; } isDragging() { return this._hasStartedDragging() && this._dragDropRegistry.isDragging(this); } reset() { this._rootElement.style.transform = this._initialTransform || ''; this._activeTransform = { x: 0, y: 0 }; this._passiveTransform = { x: 0, y: 0 }; } resetToBoundary() { if (this._boundaryElement && this._rootElement && isOverflowingParent(this._boundaryElement.getBoundingClientRect(), this._rootElement.getBoundingClientRect())) { const parentRect = this._boundaryElement.getBoundingClientRect(); const childRect = this._rootElement.getBoundingClientRect(); let offsetX = 0; let offsetY = 0; if (childRect.left < parentRect.left) { offsetX = parentRect.left - childRect.left; } else if (childRect.right > parentRect.right) { offsetX = parentRect.right - childRect.right; } if (childRect.top < parentRect.top) { offsetY = parentRect.top - childRect.top; } else if (childRect.bottom > parentRect.bottom) { offsetY = parentRect.bottom - childRect.bottom; } const currentLeft = this._activeTransform.x; const currentTop = this._activeTransform.y; let x = currentLeft + offsetX, y = currentTop + offsetY; this._rootElement.style.transform = getTransform(x, y); this._activeTransform = { x, y }; this._passiveTransform = { x, y }; } } disableHandle(handle) { if (!this._disabledHandles.has(handle) && this._handles.indexOf(handle) > -1) { this._disabledHandles.add(handle); toggleNativeDragInteractions(handle, true); } } enableHandle(handle) { if (this._disabledHandles.has(handle)) { this._disabledHandles.delete(handle); toggleNativeDragInteractions(handle, this.disabled); } } withDirection(direction) { this._direction = direction; return this; } _withDropContainer(container) { this._dropContainer = container; } getFreeDragPosition() { const position = this.isDragging() ? this._activeTransform : this._passiveTransform; return { x: position.x, y: position.y }; } setFreeDragPosition(value) { this._activeTransform = { x: 0, y: 0 }; this._passiveTransform.x = value.x; this._passiveTransform.y = value.y; if (!this._dropContainer) { this._applyRootElementTransform(value.x, value.y); } return this; } withPreviewContainer(value) { this._previewContainer = value; return this; } _sortFromLastPointerPosition() { const position = this._lastKnownPointerPosition; if (position && this._dropContainer) { this._updateActiveDropContainer(this._getConstrainedPointerPosition(position), position); } } _removeListeners() { this._pointerMoveSubscription.unsubscribe(); this._pointerUpSubscription.unsubscribe(); this._scrollSubscription.unsubscribe(); this._cleanupShadowRootSelectStart?.(); this._cleanupShadowRootSelectStart = undefined; } _destroyPreview() { this._preview?.destroy(); this._preview = null; } _destroyPlaceholder() { this._anchor?.remove(); this._placeholder?.remove(); this._placeholderRef?.destroy(); this._placeholder = this._anchor = this._placeholderRef = null; } _pointerDown = event => { this.beforeStarted.next(); if (this._handles.length) { const targetHandle = this._getTargetHandle(event); if (targetHandle && !this._disabledHandles.has(targetHandle) && !this.disabled) { this._initializeDragSequence(targetHandle, event); } } else if (!this.disabled) { this._initializeDragSequence(this._rootElement, event); } }; _pointerMove = event => { const pointerPosition = this._getPointerPositionOnPage(event); if (!this._hasStartedDragging()) { const distanceX = Math.abs(pointerPosition.x - this._pickupPositionOnPage.x); const distanceY = Math.abs(pointerPosition.y - this._pickupPositionOnPage.y); const isOverThreshold = distanceX + distanceY >= this._config.dragStartThreshold; if (isOverThreshold) { const isDelayElapsed = Date.now() >= this._dragStartTime + this._getDragStartDelay(event); const container = this._dropContainer; if (!isDelayElapsed) { this._endDragSequence(event); return; } if (!container || !container.isDragging() && !container.isReceiving()) { if (event.cancelable) { event.preventDefault(); } this._hasStartedDragging.set(true); this._ngZone.run(() => this._startDragSequence(event)); } } return; } if (event.cancelable) { event.preventDefault(); } const constrainedPointerPosition = this._getConstrainedPointerPosition(pointerPosition); this._hasMoved = true; this._lastKnownPointerPosition = pointerPosition; this._updatePointerDirectionDelta(constrainedPointerPosition); if (this._dropContainer) { this._updateActiveDropContainer(constrainedPointerPosition, pointerPosition); } else { const offset = this.constrainPosition ? this._initialDomRect : this._pickupPositionOnPage; const activeTransform = this._activeTransform; activeTransform.x = constrainedPointerPosition.x - offset.x + this._passiveTransform.x; activeTransform.y = constrainedPointerPosition.y - offset.y + this._passiveTransform.y; this._applyRootElementTransform(activeTransform.x, activeTransform.y); } if (this._moveEvents.observers.length) { this._ngZone.run(() => { this._moveEvents.next({ source: this, pointerPosition: constrainedPointerPosition, event, distance: this._getDragDistance(constrainedPointerPosition), delta: this._pointerDirectionDelta }); }); } }; _pointerUp = event => { this._endDragSequence(event); }; _endDragSequence(event) { if (!this._dragDropRegistry.isDragging(this)) { return; } this._removeListeners(); this._dragDropRegistry.stopDragging(this); this._toggleNativeDragInteractions(); if (this._handles) { this._rootElement.style.webkitTapHighlightColor = this._rootElementTapHighlight; } if (!this._hasStartedDragging()) { return; } this.released.next({ source: this, event }); if (this._dropContainer) { this._dropContainer._stopScrolling(); this._animatePreviewToPlaceholder().then(() => { this._cleanupDragArtifacts(event); this._cleanupCachedDimensions(); this._dragDropRegistry.stopDragging(this); }); } else { this._passiveTransform.x = this._activeTransform.x; const pointerPosition = this._getPointerPositionOnPage(event); this._passiveTransform.y = this._activeTransform.y; this._ngZone.run(() => { this.ended.next({ source: this, distance: this._getDragDistance(pointerPosition), dropPoint: pointerPosition, event }); }); this._cleanupCachedDimensions(); this._dragDropRegistry.stopDragging(this); } } _startDragSequence(event) { if (isTouchEvent(event)) { this._lastTouchEventTime = Date.now(); } this._toggleNativeDragInteractions(); const shadowRoot = this._getShadowRoot(); const dropContainer = this._dropContainer; if (shadowRoot) { this._ngZone.runOutsideAngular(() => { this._cleanupShadowRootSelectStart = this._renderer.listen(shadowRoot, 'selectstart', shadowDomSelectStart, activeCapturingEventOptions); }); } if (dropContainer) { const element = this._rootElement; const parent = element.parentNode; const placeholder = this._placeholder = this._createPlaceholderElement(); const marker = this._marker = this._marker || this._document.createComment(typeof ngDevMode === 'undefined' || ngDevMode ? 'cdk-drag-marker' : ''); parent.insertBefore(marker, element); this._initialTransform = element.style.transform || ''; this._preview = new PreviewRef(this._document, this._rootElement, this._direction, this._initialDomRect, this._previewTemplate || null, this.previewClass || null, this._pickupPositionOnPage, this._initialTransform, this._config.zIndex || 1000, this._renderer); this._preview.attach(this._getPreviewInsertionPoint(parent, shadowRoot)); toggleVisibility(element, false, dragImportantProperties); this._document.body.appendChild(parent.replaceChild(placeholder, element)); this.started.next({ source: this, event }); dropContainer.start(); this._initialContainer = dropContainer; this._initialIndex = dropContainer.getItemIndex(this); } else { this.started.next({ source: this, event }); this._initialContainer = this._initialIndex = undefined; } this._parentPositions.cache(dropContainer ? dropContainer.getScrollableParents() : []); } _initializeDragSequence(referenceElement, event) { if (this._parentDragRef) { event.stopPropagation(); } const isDragging = this.isDragging(); const isTouchSequence = isTouchEvent(event); const isAuxiliaryMouseButton = !isTouchSequence && event.button !== 0; const rootElement = this._rootElement; const target = (0,_shadow_dom_chunk_mjs__WEBPACK_IMPORTED_MODULE_10__._getEventTarget)(event); const isSyntheticEvent = !isTouchSequence && this._lastTouchEventTime && this._lastTouchEventTime + MOUSE_EVENT_IGNORE_TIME > Date.now(); const isFakeEvent = isTouchSequence ? (0,_fake_event_detection_chunk_mjs__WEBPACK_IMPORTED_MODULE_12__.isFakeTouchstartFromScreenReader)(event) : (0,_fake_event_detection_chunk_mjs__WEBPACK_IMPORTED_MODULE_12__.isFakeMousedownFromScreenReader)(event); if (target && target.draggable && event.type === 'mousedown') { event.preventDefault(); } if (isDragging || isAuxiliaryMouseButton || isSyntheticEvent || isFakeEvent) { return; } if (this._handles.length) { const rootStyles = rootElement.style; this._rootElementTapHighlight = rootStyles.webkitTapHighlightColor || ''; rootStyles.webkitTapHighlightColor = 'transparent'; } this._hasMoved = false; this._hasStartedDragging.set(this._hasMoved); this._removeListeners(); this._initialDomRect = this._rootElement.getBoundingClientRect(); this._pointerMoveSubscription = this._dragDropRegistry.pointerMove.subscribe(this._pointerMove); this._pointerUpSubscription = this._dragDropRegistry.pointerUp.subscribe(this._pointerUp); this._scrollSubscription = this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(scrollEvent => this._updateOnScroll(scrollEvent)); if (this._boundaryElement) { this._boundaryRect = getMutableClientRect(this._boundaryElement); } const previewTemplate = this._previewTemplate; this._pickupPositionInElement = previewTemplate && previewTemplate.template && !previewTemplate.matchSize ? { x: 0, y: 0 } : this._getPointerPositionInElement(this._initialDomRect, referenceElement, event); const pointerPosition = this._pickupPositionOnPage = this._lastKnownPointerPosition = this._getPointerPositionOnPage(event); this._pointerDirectionDelta = { x: 0, y: 0 }; this._pointerPositionAtLastDirectionChange = { x: pointerPosition.x, y: pointerPosition.y }; this._dragStartTime = Date.now(); this._dragDropRegistry.startDragging(this, event); } _cleanupDragArtifacts(event) { toggleVisibility(this._rootElement, true, dragImportantProperties); this._marker.parentNode.replaceChild(this._rootElement, this._marker); this._destroyPreview(); this._destroyPlaceholder(); this._initialDomRect = this._boundaryRect = this._previewRect = this._initialTransform = undefined; this._ngZone.run(() => { const container = this._dropContainer; const currentIndex = container.getItemIndex(this); const pointerPosition = this._getPointerPositionOnPage(event); const distance = this._getDragDistance(pointerPosition); const isPointerOverContainer = container._isOverContainer(pointerPosition.x, pointerPosition.y); this.ended.next({ source: this, distance, dropPoint: pointerPosition, event }); this.dropped.next({ item: this, currentIndex, previousIndex: this._initialIndex, container: container, previousContainer: this._initialContainer, isPointerOverContainer, distance, dropPoint: pointerPosition, event }); container.drop(this, currentIndex, this._initialIndex, this._initialContainer, isPointerOverContainer, distance, pointerPosition, event); this._dropContainer = this._initialContainer; }); } _updateActiveDropContainer({ x, y }, { x: rawX, y: rawY }) { let newContainer = this._initialContainer._getSiblingContainerFromPosition(this, x, y); if (!newContainer && this._dropContainer !== this._initialContainer && this._initialContainer._isOverContainer(x, y)) { newContainer = this._initialContainer; } if (newContainer && newContainer !== this._dropContainer) { this._ngZone.run(() => { const exitIndex = this._dropContainer.getItemIndex(this); const nextItemElement = this._dropContainer.getItemAtIndex(exitIndex + 1)?.getVisibleElement() || null; this.exited.next({ item: this, container: this._dropContainer }); this._dropContainer.exit(this); this._conditionallyInsertAnchor(newContainer, this._dropContainer, nextItemElement); this._dropContainer = newContainer; this._dropContainer.enter(this, x, y, newContainer === this._initialContainer && newContainer.sortingDisabled ? this._initialIndex : undefined); this.entered.next({ item: this, container: newContainer, currentIndex: newContainer.getItemIndex(this) }); }); } if (this.isDragging()) { this._dropContainer._startScrollingIfNecessary(rawX, rawY); this._dropContainer._sortItem(this, x, y, this._pointerDirectionDelta); if (this.constrainPosition) { this._applyPreviewTransform(x, y); } else { this._applyPreviewTransform(x - this._pickupPositionInElement.x, y - this._pickupPositionInElement.y); } } } _animatePreviewToPlaceholder() { if (!this._hasMoved) { return Promise.resolve(); } const placeholderRect = this._placeholder.getBoundingClientRect(); this._preview.addClass('cdk-drag-animating'); this._applyPreviewTransform(placeholderRect.left, placeholderRect.top); const duration = this._preview.getTransitionDuration(); if (duration === 0) { return Promise.resolve(); } return this._ngZone.runOutsideAngular(() => { return new Promise(resolve => { const handler = event => { if (!event || this._preview && (0,_shadow_dom_chunk_mjs__WEBPACK_IMPORTED_MODULE_10__._getEventTarget)(event) === this._preview.element && event.propertyName === 'transform') { cleanupListener(); resolve(); clearTimeout(timeout); } }; const timeout = setTimeout(handler, duration * 1.5); const cleanupListener = this._preview.addEventListener('transitionend', handler); }); }); } _createPlaceholderElement() { const placeholderConfig = this._placeholderTemplate; const placeholderTemplate = placeholderConfig ? placeholderConfig.template : null; let placeholder; if (placeholderTemplate) { this._placeholderRef = placeholderConfig.viewContainer.createEmbeddedView(placeholderTemplate, placeholderConfig.context); this._placeholderRef.detectChanges(); placeholder = getRootNode(this._placeholderRef, this._document); } else { placeholder = deepCloneNode(this._rootElement); } placeholder.style.pointerEvents = 'none'; placeholder.classList.add(PLACEHOLDER_CLASS); return placeholder; } _getPointerPositionInElement(elementRect, referenceElement, event) { const handleElement = referenceElement === this._rootElement ? null : referenceElement; const referenceRect = handleElement ? handleElement.getBoundingClientRect() : elementRect; const point = isTouchEvent(event) ? event.targetTouches[0] : event; const scrollPosition = this._getViewportScrollPosition(); const x = point.pageX - referenceRect.left - scrollPosition.left; const y = point.pageY - referenceRect.top - scrollPosition.top; return { x: referenceRect.left - elementRect.left + x, y: referenceRect.top - elementRect.top + y }; } _getPointerPositionOnPage(event) { const scrollPosition = this._getViewportScrollPosition(); const point = isTouchEvent(event) ? event.touches[0] || event.changedTouches[0] || { pageX: 0, pageY: 0 } : event; const x = point.pageX - scrollPosition.left; const y = point.pageY - scrollPosition.top; if (this._ownerSVGElement) { const svgMatrix = this._ownerSVGElement.getScreenCTM(); if (svgMatrix) { const svgPoint = this._ownerSVGElement.createSVGPoint(); svgPoint.x = x; svgPoint.y = y; return svgPoint.matrixTransform(svgMatrix.inverse()); } } return { x, y }; } _getConstrainedPointerPosition(point) { const dropContainerLock = this._dropContainer ? this._dropContainer.lockAxis : null; let { x, y } = this.constrainPosition ? this.constrainPosition(point, this, this._initialDomRect, this._pickupPositionInElement) : point; if (this.lockAxis === 'x' || dropContainerLock === 'x') { y = this._pickupPositionOnPage.y - (this.constrainPosition ? this._pickupPositionInElement.y : 0); } else if (this.lockAxis === 'y' || dropContainerLock === 'y') { x = this._pickupPositionOnPage.x - (this.constrainPosition ? this._pickupPositionInElement.x : 0); } if (this._boundaryRect) { const { x: pickupX, y: pickupY } = !this.constrainPosition ? this._pickupPositionInElement : { x: 0, y: 0 }; const boundaryRect = this._boundaryRect; const { width: previewWidth, height: previewHeight } = this._getPreviewRect(); const minY = boundaryRect.top + pickupY; const maxY = boundaryRect.bottom - (previewHeight - pickupY); const minX = boundaryRect.left + pickupX; const maxX = boundaryRect.right - (previewWidth - pickupX); x = clamp$1(x, minX, maxX); y = clamp$1(y, minY, maxY); } return { x, y }; } _updatePointerDirectionDelta(pointerPositionOnPage) { const { x, y } = pointerPositionOnPage; const delta = this._pointerDirectionDelta; const positionSinceLastChange = this._pointerPositionAtLastDirectionChange; const changeX = Math.abs(x - positionSinceLastChange.x); const changeY = Math.abs(y - positionSinceLastChange.y); if (changeX > this._config.pointerDirectionChangeThreshold) { delta.x = x > positionSinceLastChange.x ? 1 : -1; positionSinceLastChange.x = x; } if (changeY > this._config.pointerDirectionChangeThreshold) { delta.y = y > positionSinceLastChange.y ? 1 : -1; positionSinceLastChange.y = y; } return delta; } _toggleNativeDragInteractions() { if (!this._rootElement || !this._handles) { return; } const shouldEnable = this._handles.length > 0 || !this.isDragging(); if (shouldEnable !== this._nativeInteractionsEnabled) { this._nativeInteractionsEnabled = shouldEnable; toggleNativeDragInteractions(this._rootElement, shouldEnable); } } _removeRootElementListeners() { this._rootElementCleanups?.forEach(cleanup => cleanup()); this._rootElementCleanups = undefined; } _applyRootElementTransform(x, y) { const scale = 1 / this.scale; const transform = getTransform(x * scale, y * scale); const styles = this._rootElement.style; if (this._initialTransform == null) { this._initialTransform = styles.transform && styles.transform != 'none' ? styles.transform : ''; } styles.transform = combineTransforms(transform, this._initialTransform); } _applyPreviewTransform(x, y) { const initialTransform = this._previewTemplate?.template ? undefined : this._initialTransform; const transform = getTransform(x, y); this._preview.setTransform(combineTransforms(transform, initialTransform)); } _getDragDistance(currentPosition) { const pickupPosition = this._pickupPositionOnPage; if (pickupPosition) { return { x: currentPosition.x - pickupPosition.x, y: currentPosition.y - pickupPosition.y }; } return { x: 0, y: 0 }; } _cleanupCachedDimensions() { this._boundaryRect = this._previewRect = undefined; this._parentPositions.clear(); } _containInsideBoundaryOnResize() { let { x, y } = this._passiveTransform; if (x === 0 && y === 0 || this.isDragging() || !this._boundaryElement) { return; } const elementRect = this._rootElement.getBoundingClientRect(); const boundaryRect = this._boundaryElement.getBoundingClientRect(); if (boundaryRect.width === 0 && boundaryRect.height === 0 || elementRect.width === 0 && elementRect.height === 0) { return; } const leftOverflow = boundaryRect.left - elementRect.left; const rightOverflow = elementRect.right - boundaryRect.right; const topOverflow = boundaryRect.top - elementRect.top; const bottomOverflow = elementRect.bottom - boundaryRect.bottom; if (boundaryRect.width > elementRect.width) { if (leftOverflow > 0) { x += leftOverflow; } if (rightOverflow > 0) { x -= rightOverflow; } } else { x = 0; } if (boundaryRect.height > elementRect.height) { if (topOverflow > 0) { y += topOverflow; } if (bottomOverflow > 0) { y -= bottomOverflow; } } else { y = 0; } if (x !== this._passiveTransform.x || y !== this._passiveTransform.y) { this.setFreeDragPosition({ y, x }); } } _getDragStartDelay(event) { const value = this.dragStartDelay; if (typeof value === 'number') { return value; } else if (isTouchEvent(event)) { return value.touch; } return value ? value.mouse : 0; } _updateOnScroll(event) { const scrollDifference = this._parentPositions.handleScroll(event); if (scrollDifference) { const target = (0,_shadow_dom_chunk_mjs__WEBPACK_IMPORTED_MODULE_10__._getEventTarget)(event); if (this._boundaryRect && target !== this._boundaryElement && target.contains(this._boundaryElement)) { adjustDomRect(this._boundaryRect, scrollDifference.top, scrollDifference.left); } this._pickupPositionOnPage.x += scrollDifference.left; this._pickupPositionOnPage.y += scrollDifference.top; if (!this._dropContainer) { this._activeTransform.x -= scrollDifference.left; this._activeTransform.y -= scrollDifference.top; this._applyRootElementTransform(this._activeTransform.x, this._activeTransform.y); } } } _getViewportScrollPosition() { return this._parentPositions.positions.get(this._document)?.scrollPosition || this._parentPositions.getViewportScrollPosition(); } _getShadowRoot() { if (this._cachedShadowRoot === undefined) { this._cachedShadowRoot = (0,_shadow_dom_chunk_mjs__WEBPACK_IMPORTED_MODULE_10__._getShadowRoot)(this._rootElement); } return this._cachedShadowRoot; } _getPreviewInsertionPoint(initialParent, shadowRoot) { const previewContainer = this._previewContainer || 'global'; if (previewContainer === 'parent') { return initialParent; } if (previewContainer === 'global') { const documentRef = this._document; return shadowRoot || documentRef.fullscreenElement || documentRef.webkitFullscreenElement || documentRef.mozFullScreenElement || documentRef.msFullscreenElement || documentRef.body; } return (0,_element_chunk_mjs__WEBPACK_IMPORTED_MODULE_14__.coerceElement)(previewContainer); } _getPreviewRect() { if (!this._previewRect || !this._previewRect.width && !this._previewRect.height) { this._previewRect = this._preview ? this._preview.getBoundingClientRect() : this._initialDomRect; } return this._previewRect; } _nativeDragStart = event => { if (this._handles.length) { const targetHandle = this._getTargetHandle(event); if (targetHandle && !this._disabledHandles.has(targetHandle) && !this.disabled) { event.preventDefault(); } } else if (!this.disabled) { event.preventDefault(); } }; _getTargetHandle(event) { return this._handles.find(handle => { return event.target && (event.target === handle || handle.contains(event.target)); }); } _conditionallyInsertAnchor(newContainer, exitContainer, nextItemElement) { if (newContainer === this._initialContainer) { this._anchor?.remove(); this._anchor = null; } else if (exitContainer === this._initialContainer && exitContainer.hasAnchor) { const anchor = this._anchor ??= deepCloneNode(this._placeholder); anchor.classList.remove(PLACEHOLDER_CLASS); anchor.classList.add('cdk-drag-anchor'); anchor.style.transform = ''; if (nextItemElement) { nextItemElement.before(anchor); } else { (0,_element_chunk_mjs__WEBPACK_IMPORTED_MODULE_14__.coerceElement)(exitContainer.element).appendChild(anchor); } } } } function clamp$1(value, min, max) { return Math.max(min, Math.min(max, value)); } function isTouchEvent(event) { return event.type[0] === 't'; } function shadowDomSelectStart(event) { event.preventDefault(); } function moveItemInArray(array, fromIndex, toIndex) { const from = clamp(fromIndex, array.length - 1); const to = clamp(toIndex, array.length - 1); if (from === to) { return; } const target = array[from]; const delta = to < from ? -1 : 1; for (let i = from; i !== to; i += delta) { array[i] = array[i + delta]; } array[to] = target; } function transferArrayItem(currentArray, targetArray, currentIndex, targetIndex) { const from = clamp(currentIndex, currentArray.length - 1); const to = clamp(targetIndex, targetArray.length); if (currentArray.length) { targetArray.splice(to, 0, currentArray.splice(from, 1)[0]); } } function copyArrayItem(currentArray, targetArray, currentIndex, targetIndex) { const to = clamp(targetIndex, targetArray.length); if (currentArray.length) { targetArray.splice(to, 0, currentArray[currentIndex]); } } function clamp(value, max) { return Math.max(0, Math.min(max, value)); } class SingleAxisSortStrategy { _dragDropRegistry; _element; _sortPredicate; _itemPositions = []; _activeDraggables; orientation = 'vertical'; direction = 'ltr'; constructor(_dragDropRegistry) { this._dragDropRegistry = _dragDropRegistry; } _previousSwap = { drag: null, delta: 0, overlaps: false }; start(items) { this.withItems(items); } sort(item, pointerX, pointerY, pointerDelta) { const siblings = this._itemPositions; const newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY, pointerDelta); if (newIndex === -1 && siblings.length > 0) { return null; } const isHorizontal = this.orientation === 'horizontal'; const currentIndex = siblings.findIndex(currentItem => currentItem.drag === item); const siblingAtNewPosition = siblings[newIndex]; const currentPosition = siblings[currentIndex].clientRect; const newPosition = siblingAtNewPosition.clientRect; const delta = currentIndex > newIndex ? 1 : -1; const itemOffset = this._getItemOffsetPx(currentPosition, newPosition, delta); const siblingOffset = this._getSiblingOffsetPx(currentIndex, siblings, delta); const oldOrder = siblings.slice(); moveItemInArray(siblings, currentIndex, newIndex); siblings.forEach((sibling, index) => { if (oldOrder[index] === sibling) { return; } const isDraggedItem = sibling.drag === item; const offset = isDraggedItem ? itemOffset : siblingOffset; const elementToOffset = isDraggedItem ? item.getPlaceholderElement() : sibling.drag.getRootElement(); sibling.offset += offset; const transformAmount = Math.round(sibling.offset * (1 / sibling.drag.scale)); if (isHorizontal) { elementToOffset.style.transform = combineTransforms(`translate3d(${transformAmount}px, 0, 0)`, sibling.initialTransform); adjustDomRect(sibling.clientRect, 0, offset); } else { elementToOffset.style.transform = combineTransforms(`translate3d(0, ${transformAmount}px, 0)`, sibling.initialTransform); adjustDomRect(sibling.clientRect, offset, 0); } }); this._previousSwap.overlaps = isInsideClientRect(newPosition, pointerX, pointerY); this._previousSwap.drag = siblingAtNewPosition.drag; this._previousSwap.delta = isHorizontal ? pointerDelta.x : pointerDelta.y; return { previousIndex: currentIndex, currentIndex: newIndex }; } enter(item, pointerX, pointerY, index) { const newIndex = index == null || index < 0 ? this._getItemIndexFromPointerPosition(item, pointerX, pointerY) : index; const activeDraggables = this._activeDraggables; const currentIndex = activeDraggables.indexOf(item); const placeholder = item.getPlaceholderElement(); let newPositionReference = activeDraggables[newIndex]; if (newPositionReference === item) { newPositionReference = activeDraggables[newIndex + 1]; } if (!newPositionReference && (newIndex == null || newIndex === -1 || newIndex < activeDraggables.length - 1) && this._shouldEnterAsFirstChild(pointerX, pointerY)) { newPositionReference = activeDraggables[0]; } if (currentIndex > -1) { activeDraggables.splice(currentIndex, 1); } if (newPositionReference && !this._dragDropRegistry.isDragging(newPositionReference)) { const element = newPositionReference.getRootElement(); element.parentElement.insertBefore(placeholder, element); activeDraggables.splice(newIndex, 0, item); } else { this._element.appendChild(placeholder); activeDraggables.push(item); } placeholder.style.transform = ''; this._cacheItemPositions(); } withItems(items) { this._activeDraggables = items.slice(); this._cacheItemPositions(); } withSortPredicate(predicate) { this._sortPredicate = predicate; } reset() { this._activeDraggables?.forEach(item => { const rootElement = item.getRootElement(); if (rootElement) { const initialTransform = this._itemPositions.find(p => p.drag === item)?.initialTransform; rootElement.style.transform = initialTransform || ''; } }); this._itemPositions = []; this._activeDraggables = []; this._previousSwap.drag = null; this._previousSwap.delta = 0; this._previousSwap.overlaps = false; } getActiveItemsSnapshot() { return this._activeDraggables; } getItemIndex(item) { return this._getVisualItemPositions().findIndex(currentItem => currentItem.drag === item); } getItemAtIndex(index) { return this._getVisualItemPositions()[index]?.drag || null; } updateOnScroll(topDifference, leftDifference) { this._itemPositions.forEach(({ clientRect }) => { adjustDomRect(clientRect, topDifference, leftDifference); }); this._itemPositions.forEach(({ drag }) => { if (this._dragDropRegistry.isDragging(drag)) { drag._sortFromLastPointerPosition(); } }); } withElementContainer(container) { this._element = container; } _cacheItemPositions() { const isHorizontal = this.orientation === 'horizontal'; this._itemPositions = this._activeDraggables.map(drag => { const elementToMeasure = drag.getVisibleElement(); return { drag, offset: 0, initialTransform: elementToMeasure.style.transform || '', clientRect: getMutableClientRect(elementToMeasure) }; }).sort((a, b) => { return isHorizontal ? a.clientRect.left - b.clientRect.left : a.clientRect.top - b.clientRect.top; }); } _getVisualItemPositions() { return this.orientation === 'horizontal' && this.direction === 'rtl' ? this._itemPositions.slice().reverse() : this._itemPositions; } _getItemOffsetPx(currentPosition, newPosition, delta) { const isHorizontal = this.orientation === 'horizontal'; let itemOffset = isHorizontal ? newPosition.left - currentPosition.left : newPosition.top - currentPosition.top; if (delta === -1) { itemOffset += isHorizontal ? newPosition.width - currentPosition.width : newPosition.height - currentPosition.height; } return itemOffset; } _getSiblingOffsetPx(currentIndex, siblings, delta) { const isHorizontal = this.orientation === 'horizontal'; const currentPosition = siblings[currentIndex].clientRect; const immediateSibling = siblings[currentIndex + delta * -1]; let siblingOffset = currentPosition[isHorizontal ? 'width' : 'height'] * delta; if (immediateSibling) { const start = isHorizontal ? 'left' : 'top'; const end = isHorizontal ? 'right' : 'bottom'; if (delta === -1) { siblingOffset -= immediateSibling.clientRect[start] - currentPosition[end]; } else { siblingOffset += currentPosition[start] - immediateSibling.clientRect[end]; } } return siblingOffset; } _shouldEnterAsFirstChild(pointerX, pointerY) { if (!this._activeDraggables.length) { return false; } const itemPositions = this._itemPositions; const isHorizontal = this.orientation === 'horizontal'; const reversed = itemPositions[0].drag !== this._activeDraggables[0]; if (reversed) { const lastItemRect = itemPositions[itemPositions.length - 1].clientRect; return isHorizontal ? pointerX >= lastItemRect.right : pointerY >= lastItemRect.bottom; } else { const firstItemRect = itemPositions[0].clientRect; return isHorizontal ? pointerX <= firstItemRect.left : pointerY <= firstItemRect.top; } } _getItemIndexFromPointerPosition(item, pointerX, pointerY, delta) { const isHorizontal = this.orientation === 'horizontal'; const index = this._itemPositions.findIndex(({ drag, clientRect }) => { if (drag === item) { return false; } if (delta) { const direction = isHorizontal ? delta.x : delta.y; if (drag === this._previousSwap.drag && this._previousSwap.overlaps && direction === this._previousSwap.delta) { return false; } } return isHorizontal ? pointerX >= Math.floor(clientRect.left) && pointerX < Math.floor(clientRect.right) : pointerY >= Math.floor(clientRect.top) && pointerY < Math.floor(clientRect.bottom); }); return index === -1 || !this._sortPredicate(index, item) ? -1 : index; } } class MixedSortStrategy { _document; _dragDropRegistry; _element; _sortPredicate; _rootNode; _activeItems; _previousSwap = { drag: null, deltaX: 0, deltaY: 0, overlaps: false }; _relatedNodes = []; constructor(_document, _dragDropRegistry) { this._document = _document; this._dragDropRegistry = _dragDropRegistry; } start(items) { const childNodes = this._element.childNodes; this._relatedNodes = []; for (let i = 0; i < childNodes.length; i++) { const node = childNodes[i]; this._relatedNodes.push([node, node.nextSibling]); } this.withItems(items); } sort(item, pointerX, pointerY, pointerDelta) { const newIndex = this._getItemIndexFromPointerPosition(item, pointerX, pointerY); const previousSwap = this._previousSwap; if (newIndex === -1 || this._activeItems[newIndex] === item) { return null; } const toSwapWith = this._activeItems[newIndex]; if (previousSwap.drag === toSwapWith && previousSwap.overlaps && previousSwap.deltaX === pointerDelta.x && previousSwap.deltaY === pointerDelta.y) { return null; } const previousIndex = this.getItemIndex(item); const current = item.getPlaceholderElement(); const overlapElement = toSwapWith.getRootElement(); if (newIndex > previousIndex) { overlapElement.after(current); } else { overlapElement.before(current); } moveItemInArray(this._activeItems, previousIndex, newIndex); const newOverlapElement = this._getRootNode().elementFromPoint(pointerX, pointerY); previousSwap.deltaX = pointerDelta.x; previousSwap.deltaY = pointerDelta.y; previousSwap.drag = toSwapWith; previousSwap.overlaps = overlapElement === newOverlapElement || overlapElement.contains(newOverlapElement); return { previousIndex, currentIndex: newIndex }; } enter(item, pointerX, pointerY, index) { const currentIndex = this._activeItems.indexOf(item); if (currentIndex > -1) { this._activeItems.splice(currentIndex, 1); } let enterIndex = index == null || index < 0 ? this._getItemIndexFromPointerPosition(item, pointerX, pointerY) : index; if (enterIndex === -1) { enterIndex = this._getClosestItemIndexToPointer(item, pointerX, pointerY); } const targetItem = this._activeItems[enterIndex]; if (targetItem && !this._dragDropRegistry.isDragging(targetItem)) { this._activeItems.splice(enterIndex, 0, item); targetItem.getRootElement().before(item.getPlaceholderElement()); } else { this._activeItems.push(item); this._element.appendChild(item.getPlaceholderElement()); } } withItems(items) { this._activeItems = items.slice(); } withSortPredicate(predicate) { this._sortPredicate = predicate; } reset() { const root = this._element; const previousSwap = this._previousSwap; for (let i = this._relatedNodes.length - 1; i > -1; i--) { const [node, nextSibling] = this._relatedNodes[i]; if (node.parentNode === root && node.nextSibling !== nextSibling) { if (nextSibling === null) { root.appendChild(node); } else if (nextSibling.parentNode === root) { root.insertBefore(node, nextSibling); } } } this._relatedNodes = []; this._activeItems = []; previousSwap.drag = null; previousSwap.deltaX = previousSwap.deltaY = 0; previousSwap.overlaps = false; } getActiveItemsSnapshot() { return this._activeItems; } getItemIndex(item) { return this._activeItems.indexOf(item); } getItemAtIndex(index) { return this._activeItems[index] || null; } updateOnScroll() { this._activeItems.forEach(item => { if (this._dragDropRegistry.isDragging(item)) { item._sortFromLastPointerPosition(); } }); } withElementContainer(container) { if (container !== this._element) { this._element = container; this._rootNode = undefined; } } _getItemIndexFromPointerPosition(item, pointerX, pointerY) { const elementAtPoint = this._getRootNode().elementFromPoint(Math.floor(pointerX), Math.floor(pointerY)); const index = elementAtPoint ? this._activeItems.findIndex(item => { const root = item.getRootElement(); return elementAtPoint === root || root.contains(elementAtPoint); }) : -1; return index === -1 || !this._sortPredicate(index, item) ? -1 : index; } _getRootNode() { if (!this._rootNode) { this._rootNode = (0,_shadow_dom_chunk_mjs__WEBPACK_IMPORTED_MODULE_10__._getShadowRoot)(this._element) || this._document; } return this._rootNode; } _getClosestItemIndexToPointer(item, pointerX, pointerY) { if (this._activeItems.length === 0) { return -1; } if (this._activeItems.length === 1) { return 0; } let minDistance = Infinity; let minIndex = -1; for (let i = 0; i < this._activeItems.length; i++) { const current = this._activeItems[i]; if (current !== item) { const { x, y } = current.getRootElement().getBoundingClientRect(); const distance = Math.hypot(pointerX - x, pointerY - y); if (distance < minDistance) { minDistance = distance; minIndex = i; } } } return minIndex; } } const DROP_PROXIMITY_THRESHOLD = 0.05; const SCROLL_PROXIMITY_THRESHOLD = 0.05; var AutoScrollVerticalDirection; (function (AutoScrollVerticalDirection) { AutoScrollVerticalDirection[AutoScrollVerticalDirection["NONE"] = 0] = "NONE"; AutoScrollVerticalDirection[AutoScrollVerticalDirection["UP"] = 1] = "UP"; AutoScrollVerticalDirection[AutoScrollVerticalDirection["DOWN"] = 2] = "DOWN"; })(AutoScrollVerticalDirection || (AutoScrollVerticalDirection = {})); var AutoScrollHorizontalDirection; (function (AutoScrollHorizontalDirection) { AutoScrollHorizontalDirection[AutoScrollHorizontalDirection["NONE"] = 0] = "NONE"; AutoScrollHorizontalDirection[AutoScrollHorizontalDirection["LEFT"] = 1] = "LEFT"; AutoScrollHorizontalDirection[AutoScrollHorizontalDirection["RIGHT"] = 2] = "RIGHT"; })(AutoScrollHorizontalDirection || (AutoScrollHorizontalDirection = {})); function createDropListRef(injector, element) { return new DropListRef(element, injector.get(DragDropRegistry), injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT), injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone), injector.get(_scrolling_mjs__WEBPACK_IMPORTED_MODULE_13__.ViewportRuler)); } class DropListRef { _dragDropRegistry; _ngZone; _viewportRuler; element; disabled = false; sortingDisabled = false; lockAxis = null; autoScrollDisabled = false; autoScrollStep = 2; hasAnchor = false; enterPredicate = () => true; sortPredicate = () => true; beforeStarted = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); entered = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); exited = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); dropped = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); sorted = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); receivingStarted = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); receivingStopped = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); data; _container; _isDragging = false; _parentPositions; _sortStrategy; _domRect; _draggables = []; _siblings = []; _activeSiblings = new Set(); _viewportScrollSubscription = rxjs__WEBPACK_IMPORTED_MODULE_7__.Subscription.EMPTY; _verticalScrollDirection = AutoScrollVerticalDirection.NONE; _horizontalScrollDirection = AutoScrollHorizontalDirection.NONE; _scrollNode; _stopScrollTimers = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); _cachedShadowRoot = null; _document; _scrollableElements = []; _initialScrollSnap; _direction = 'ltr'; constructor(element, _dragDropRegistry, _document, _ngZone, _viewportRuler) { this._dragDropRegistry = _dragDropRegistry; this._ngZone = _ngZone; this._viewportRuler = _viewportRuler; const coercedElement = this.element = (0,_element_chunk_mjs__WEBPACK_IMPORTED_MODULE_14__.coerceElement)(element); this._document = _document; this.withOrientation('vertical').withElementContainer(coercedElement); _dragDropRegistry.registerDropContainer(this); this._parentPositions = new ParentPositionTracker(_document); } dispose() { this._stopScrolling(); this._stopScrollTimers.complete(); this._viewportScrollSubscription.unsubscribe(); this.beforeStarted.complete(); this.entered.complete(); this.exited.complete(); this.dropped.complete(); this.sorted.complete(); this.receivingStarted.complete(); this.receivingStopped.complete(); this._activeSiblings.clear(); this._scrollNode = null; this._parentPositions.clear(); this._dragDropRegistry.removeDropContainer(this); } isDragging() { return this._isDragging; } start() { this._draggingStarted(); this._notifyReceivingSiblings(); } enter(item, pointerX, pointerY, index) { this._draggingStarted(); if (index == null && this.sortingDisabled) { index = this._draggables.indexOf(item); } this._sortStrategy.enter(item, pointerX, pointerY, index); this._cacheParentPositions(); this._notifyReceivingSiblings(); this.entered.next({ item, container: this, currentIndex: this.getItemIndex(item) }); } exit(item) { this._reset(); this.exited.next({ item, container: this }); } drop(item, currentIndex, previousIndex, previousContainer, isPointerOverContainer, distance, dropPoint, event = {}) { this._reset(); this.dropped.next({ item, currentIndex, previousIndex, container: this, previousContainer, isPointerOverContainer, distance, dropPoint, event }); } withItems(items) { const previousItems = this._draggables; this._draggables = items; items.forEach(item => item._withDropContainer(this)); if (this.isDragging()) { const draggedItems = previousItems.filter(item => item.isDragging()); if (draggedItems.every(item => items.indexOf(item) === -1)) { this._reset(); } else { this._sortStrategy.withItems(this._draggables); } } return this; } withDirection(direction) { this._direction = direction; if (this._sortStrategy instanceof SingleAxisSortStrategy) { this._sortStrategy.direction = direction; } return this; } connectedTo(connectedTo) { this._siblings = connectedTo.slice(); return this; } withOrientation(orientation) { if (orientation === 'mixed') { this._sortStrategy = new MixedSortStrategy(this._document, this._dragDropRegistry); } else { const strategy = new SingleAxisSortStrategy(this._dragDropRegistry); strategy.direction = this._direction; strategy.orientation = orientation; this._sortStrategy = strategy; } this._sortStrategy.withElementContainer(this._container); this._sortStrategy.withSortPredicate((index, item) => this.sortPredicate(index, item, this)); return this; } withScrollableParents(elements) { const element = this._container; this._scrollableElements = elements.indexOf(element) === -1 ? [element, ...elements] : elements.slice(); return this; } withElementContainer(container) { if (container === this._container) { return this; } const element = (0,_element_chunk_mjs__WEBPACK_IMPORTED_MODULE_14__.coerceElement)(this.element); if ((typeof ngDevMode === 'undefined' || ngDevMode) && container !== element && !element.contains(container)) { throw new Error('Invalid DOM structure for drop list. Alternate container element must be a descendant of the drop list.'); } const oldContainerIndex = this._scrollableElements.indexOf(this._container); const newContainerIndex = this._scrollableElements.indexOf(container); if (oldContainerIndex > -1) { this._scrollableElements.splice(oldContainerIndex, 1); } if (newContainerIndex > -1) { this._scrollableElements.splice(newContainerIndex, 1); } if (this._sortStrategy) { this._sortStrategy.withElementContainer(container); } this._cachedShadowRoot = null; this._scrollableElements.unshift(container); this._container = container; return this; } getScrollableParents() { return this._scrollableElements; } getItemIndex(item) { return this._isDragging ? this._sortStrategy.getItemIndex(item) : this._draggables.indexOf(item); } getItemAtIndex(index) { return this._isDragging ? this._sortStrategy.getItemAtIndex(index) : this._draggables[index] || null; } isReceiving() { return this._activeSiblings.size > 0; } _sortItem(item, pointerX, pointerY, pointerDelta) { if (this.sortingDisabled || !this._domRect || !isPointerNearDomRect(this._domRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)) { return; } const result = this._sortStrategy.sort(item, pointerX, pointerY, pointerDelta); if (result) { this.sorted.next({ previousIndex: result.previousIndex, currentIndex: result.currentIndex, container: this, item }); } } _startScrollingIfNecessary(pointerX, pointerY) { if (this.autoScrollDisabled) { return; } let scrollNode; let verticalScrollDirection = AutoScrollVerticalDirection.NONE; let horizontalScrollDirection = AutoScrollHorizontalDirection.NONE; this._parentPositions.positions.forEach((position, element) => { if (element === this._document || !position.clientRect || scrollNode) { return; } if (isPointerNearDomRect(position.clientRect, DROP_PROXIMITY_THRESHOLD, pointerX, pointerY)) { [verticalScrollDirection, horizontalScrollDirection] = getElementScrollDirections(element, position.clientRect, this._direction, pointerX, pointerY); if (verticalScrollDirection || horizontalScrollDirection) { scrollNode = element; } } }); if (!verticalScrollDirection && !horizontalScrollDirection) { const { width, height } = this._viewportRuler.getViewportSize(); const domRect = { width, height, top: 0, right: width, bottom: height, left: 0 }; verticalScrollDirection = getVerticalScrollDirection(domRect, pointerY); horizontalScrollDirection = getHorizontalScrollDirection(domRect, pointerX); scrollNode = window; } if (scrollNode && (verticalScrollDirection !== this._verticalScrollDirection || horizontalScrollDirection !== this._horizontalScrollDirection || scrollNode !== this._scrollNode)) { this._verticalScrollDirection = verticalScrollDirection; this._horizontalScrollDirection = horizontalScrollDirection; this._scrollNode = scrollNode; if ((verticalScrollDirection || horizontalScrollDirection) && scrollNode) { this._ngZone.runOutsideAngular(this._startScrollInterval); } else { this._stopScrolling(); } } } _stopScrolling() { this._stopScrollTimers.next(); } _draggingStarted() { const styles = this._container.style; this.beforeStarted.next(); this._isDragging = true; if ((typeof ngDevMode === 'undefined' || ngDevMode) && this._container !== (0,_element_chunk_mjs__WEBPACK_IMPORTED_MODULE_14__.coerceElement)(this.element)) { for (const drag of this._draggables) { if (!drag.isDragging() && drag.getVisibleElement().parentNode !== this._container) { throw new Error('Invalid DOM structure for drop list. All items must be placed directly inside of the element container.'); } } } this._initialScrollSnap = styles.msScrollSnapType || styles.scrollSnapType || ''; styles.scrollSnapType = styles.msScrollSnapType = 'none'; this._sortStrategy.start(this._draggables); this._cacheParentPositions(); this._viewportScrollSubscription.unsubscribe(); this._listenToScrollEvents(); } _cacheParentPositions() { this._parentPositions.cache(this._scrollableElements); this._domRect = this._parentPositions.positions.get(this._container).clientRect; } _reset() { this._isDragging = false; const styles = this._container.style; styles.scrollSnapType = styles.msScrollSnapType = this._initialScrollSnap; this._siblings.forEach(sibling => sibling._stopReceiving(this)); this._sortStrategy.reset(); this._stopScrolling(); this._viewportScrollSubscription.unsubscribe(); this._parentPositions.clear(); } _startScrollInterval = () => { this._stopScrolling(); (0,rxjs__WEBPACK_IMPORTED_MODULE_8__.interval)(0, rxjs__WEBPACK_IMPORTED_MODULE_6__.animationFrameScheduler).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_19__.takeUntil)(this._stopScrollTimers)).subscribe(() => { const node = this._scrollNode; const scrollStep = this.autoScrollStep; if (this._verticalScrollDirection === AutoScrollVerticalDirection.UP) { node.scrollBy(0, -scrollStep); } else if (this._verticalScrollDirection === AutoScrollVerticalDirection.DOWN) { node.scrollBy(0, scrollStep); } if (this._horizontalScrollDirection === AutoScrollHorizontalDirection.LEFT) { node.scrollBy(-scrollStep, 0); } else if (this._horizontalScrollDirection === AutoScrollHorizontalDirection.RIGHT) { node.scrollBy(scrollStep, 0); } }); }; _isOverContainer(x, y) { return this._domRect != null && isInsideClientRect(this._domRect, x, y); } _getSiblingContainerFromPosition(item, x, y) { return this._siblings.find(sibling => sibling._canReceive(item, x, y)); } _canReceive(item, x, y) { if (!this._domRect || !isInsideClientRect(this._domRect, x, y) || !this.enterPredicate(item, this)) { return false; } const elementFromPoint = this._getShadowRoot().elementFromPoint(x, y); if (!elementFromPoint) { return false; } return elementFromPoint === this._container || this._container.contains(elementFromPoint); } _startReceiving(sibling, items) { const activeSiblings = this._activeSiblings; if (!activeSiblings.has(sibling) && items.every(item => { return this.enterPredicate(item, this) || this._draggables.indexOf(item) > -1; })) { activeSiblings.add(sibling); this._cacheParentPositions(); this._listenToScrollEvents(); this.receivingStarted.next({ initiator: sibling, receiver: this, items }); } } _stopReceiving(sibling) { this._activeSiblings.delete(sibling); this._viewportScrollSubscription.unsubscribe(); this.receivingStopped.next({ initiator: sibling, receiver: this }); } _listenToScrollEvents() { this._viewportScrollSubscription = this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(event => { if (this.isDragging()) { const scrollDifference = this._parentPositions.handleScroll(event); if (scrollDifference) { this._sortStrategy.updateOnScroll(scrollDifference.top, scrollDifference.left); } } else if (this.isReceiving()) { this._cacheParentPositions(); } }); } _getShadowRoot() { if (!this._cachedShadowRoot) { const shadowRoot = (0,_shadow_dom_chunk_mjs__WEBPACK_IMPORTED_MODULE_10__._getShadowRoot)(this._container); this._cachedShadowRoot = shadowRoot || this._document; } return this._cachedShadowRoot; } _notifyReceivingSiblings() { const draggedItems = this._sortStrategy.getActiveItemsSnapshot().filter(item => item.isDragging()); this._siblings.forEach(sibling => sibling._startReceiving(this, draggedItems)); } } function getVerticalScrollDirection(clientRect, pointerY) { const { top, bottom, height } = clientRect; const yThreshold = height * SCROLL_PROXIMITY_THRESHOLD; if (pointerY >= top - yThreshold && pointerY <= top + yThreshold) { return AutoScrollVerticalDirection.UP; } else if (pointerY >= bottom - yThreshold && pointerY <= bottom + yThreshold) { return AutoScrollVerticalDirection.DOWN; } return AutoScrollVerticalDirection.NONE; } function getHorizontalScrollDirection(clientRect, pointerX) { const { left, right, width } = clientRect; const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD; if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) { return AutoScrollHorizontalDirection.LEFT; } else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) { return AutoScrollHorizontalDirection.RIGHT; } return AutoScrollHorizontalDirection.NONE; } function getElementScrollDirections(element, clientRect, direction, pointerX, pointerY) { const computedVertical = getVerticalScrollDirection(clientRect, pointerY); const computedHorizontal = getHorizontalScrollDirection(clientRect, pointerX); let verticalScrollDirection = AutoScrollVerticalDirection.NONE; let horizontalScrollDirection = AutoScrollHorizontalDirection.NONE; if (computedVertical) { const scrollTop = element.scrollTop; if (computedVertical === AutoScrollVerticalDirection.UP) { if (scrollTop > 0) { verticalScrollDirection = AutoScrollVerticalDirection.UP; } } else if (element.scrollHeight - scrollTop > element.clientHeight) { verticalScrollDirection = AutoScrollVerticalDirection.DOWN; } } if (computedHorizontal) { const scrollLeft = element.scrollLeft; if (direction === 'rtl') { if (computedHorizontal === AutoScrollHorizontalDirection.RIGHT) { if (scrollLeft < 0) { horizontalScrollDirection = AutoScrollHorizontalDirection.RIGHT; } } else if (element.scrollWidth + scrollLeft > element.clientWidth) { horizontalScrollDirection = AutoScrollHorizontalDirection.LEFT; } } else { if (computedHorizontal === AutoScrollHorizontalDirection.LEFT) { if (scrollLeft > 0) { horizontalScrollDirection = AutoScrollHorizontalDirection.LEFT; } } else if (element.scrollWidth - scrollLeft > element.clientWidth) { horizontalScrollDirection = AutoScrollHorizontalDirection.RIGHT; } } } return [verticalScrollDirection, horizontalScrollDirection]; } class DragDrop { _injector = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.Injector); constructor() {} createDrag(element, config) { return createDragRef(this._injector, element, config); } createDropList(element) { return createDropListRef(this._injector, element); } static ɵfac = function DragDrop_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DragDrop)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: DragDrop, factory: DragDrop.ɵfac, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(DragDrop, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable, args: [{ providedIn: 'root' }] }], () => [], null); })(); const CDK_DRAG_PARENT = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('CDK_DRAG_PARENT'); function assertElementNode(node, name) { if (node.nodeType !== 1) { throw Error(`${name} must be attached to an element node. ` + `Currently attached to "${node.nodeName}".`); } } const CDK_DRAG_HANDLE = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('CdkDragHandle'); class CdkDragHandle { element = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef); _parentDrag = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(CDK_DRAG_PARENT, { optional: true, skipSelf: true }); _dragDropRegistry = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(DragDropRegistry); _stateChanges = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); get disabled() { return this._disabled; } set disabled(value) { this._disabled = value; this._stateChanges.next(this); } _disabled = false; constructor() { if (typeof ngDevMode === 'undefined' || ngDevMode) { assertElementNode(this.element.nativeElement, 'cdkDragHandle'); } this._parentDrag?._addHandle(this); } ngAfterViewInit() { if (!this._parentDrag) { let parent = this.element.nativeElement.parentElement; while (parent) { const ref = this._dragDropRegistry.getDragDirectiveForNode(parent); if (ref) { this._parentDrag = ref; ref._addHandle(this); break; } parent = parent.parentElement; } } } ngOnDestroy() { this._parentDrag?._removeHandle(this); this._stateChanges.complete(); } static ɵfac = function CdkDragHandle_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CdkDragHandle)(); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ type: CdkDragHandle, selectors: [["", "cdkDragHandle", ""]], hostAttrs: [1, "cdk-drag-handle"], inputs: { disabled: [2, "cdkDragHandleDisabled", "disabled", _angular_core__WEBPACK_IMPORTED_MODULE_2__.booleanAttribute] }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵProvidersFeature"]([{ provide: CDK_DRAG_HANDLE, useExisting: CdkDragHandle }])] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(CdkDragHandle, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Directive, args: [{ selector: '[cdkDragHandle]', host: { 'class': 'cdk-drag-handle' }, providers: [{ provide: CDK_DRAG_HANDLE, useExisting: CdkDragHandle }] }] }], () => [], { disabled: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: [{ alias: 'cdkDragHandleDisabled', transform: _angular_core__WEBPACK_IMPORTED_MODULE_2__.booleanAttribute }] }] }); })(); const CDK_DRAG_CONFIG = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('CDK_DRAG_CONFIG'); const CDK_DROP_LIST = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('CdkDropList'); class CdkDrag { element = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef); dropContainer = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(CDK_DROP_LIST, { optional: true, skipSelf: true }); _ngZone = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone); _viewContainerRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.ViewContainerRef); _dir = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_directionality_chunk_mjs__WEBPACK_IMPORTED_MODULE_21__.Directionality, { optional: true }); _changeDetectorRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.ChangeDetectorRef); _selfHandle = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(CDK_DRAG_HANDLE, { optional: true, self: true }); _parentDrag = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(CDK_DRAG_PARENT, { optional: true, skipSelf: true }); _dragDropRegistry = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(DragDropRegistry); _destroyed = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); _handles = new rxjs__WEBPACK_IMPORTED_MODULE_5__.BehaviorSubject([]); _previewTemplate = null; _placeholderTemplate = null; _dragRef; data; lockAxis = null; rootElementSelector; boundaryElement; dragStartDelay; freeDragPosition; get disabled() { return this._disabled || !!(this.dropContainer && this.dropContainer.disabled); } set disabled(value) { this._disabled = value; this._dragRef.disabled = this._disabled; } _disabled = false; constrainPosition; previewClass; previewContainer; scale = 1; started = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); released = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); ended = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); entered = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); exited = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); dropped = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); moved = new rxjs__WEBPACK_IMPORTED_MODULE_3__.Observable(observer => { const subscription = this._dragRef.moved.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_15__.map)(movedEvent => ({ source: this, pointerPosition: movedEvent.pointerPosition, event: movedEvent.event, delta: movedEvent.delta, distance: movedEvent.distance }))).subscribe(observer); return () => { subscription.unsubscribe(); }; }); _injector = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.Injector); constructor() { const dropContainer = this.dropContainer; const config = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(CDK_DRAG_CONFIG, { optional: true }); this._dragRef = createDragRef(this._injector, this.element, { dragStartThreshold: config && config.dragStartThreshold != null ? config.dragStartThreshold : 5, pointerDirectionChangeThreshold: config && config.pointerDirectionChangeThreshold != null ? config.pointerDirectionChangeThreshold : 5, zIndex: config?.zIndex }); this._dragRef.data = this; this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement, this); if (config) { this._assignDefaults(config); } if (dropContainer) { dropContainer.addItem(this); dropContainer._dropListRef.beforeStarted.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_19__.takeUntil)(this._destroyed)).subscribe(() => { this._dragRef.scale = this.scale; }); } this._syncInputs(this._dragRef); this._handleEvents(this._dragRef); } getPlaceholderElement() { return this._dragRef.getPlaceholderElement(); } getRootElement() { return this._dragRef.getRootElement(); } reset() { this._dragRef.reset(); } resetToBoundary() { this._dragRef.resetToBoundary(); } getFreeDragPosition() { return this._dragRef.getFreeDragPosition(); } setFreeDragPosition(value) { this._dragRef.setFreeDragPosition(value); } ngAfterViewInit() { (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.afterNextRender)(() => { this._updateRootElement(); this._setupHandlesListener(); this._dragRef.scale = this.scale; if (this.freeDragPosition) { this._dragRef.setFreeDragPosition(this.freeDragPosition); } }, { injector: this._injector }); } ngOnChanges(changes) { const rootSelectorChange = changes['rootElementSelector']; const positionChange = changes['freeDragPosition']; if (rootSelectorChange && !rootSelectorChange.firstChange) { this._updateRootElement(); } this._dragRef.scale = this.scale; if (positionChange && !positionChange.firstChange && this.freeDragPosition) { this._dragRef.setFreeDragPosition(this.freeDragPosition); } } ngOnDestroy() { if (this.dropContainer) { this.dropContainer.removeItem(this); } this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement); this._ngZone.runOutsideAngular(() => { this._handles.complete(); this._destroyed.next(); this._destroyed.complete(); this._dragRef.dispose(); }); } _addHandle(handle) { const handles = this._handles.getValue(); handles.push(handle); this._handles.next(handles); } _removeHandle(handle) { const handles = this._handles.getValue(); const index = handles.indexOf(handle); if (index > -1) { handles.splice(index, 1); this._handles.next(handles); } } _setPreviewTemplate(preview) { this._previewTemplate = preview; } _resetPreviewTemplate(preview) { if (preview === this._previewTemplate) { this._previewTemplate = null; } } _setPlaceholderTemplate(placeholder) { this._placeholderTemplate = placeholder; } _resetPlaceholderTemplate(placeholder) { if (placeholder === this._placeholderTemplate) { this._placeholderTemplate = null; } } _updateRootElement() { const element = this.element.nativeElement; let rootElement = element; if (this.rootElementSelector) { rootElement = element.closest !== undefined ? element.closest(this.rootElementSelector) : element.parentElement?.closest(this.rootElementSelector); } if (rootElement && (typeof ngDevMode === 'undefined' || ngDevMode)) { assertElementNode(rootElement, 'cdkDrag'); } this._dragRef.withRootElement(rootElement || element); } _getBoundaryElement() { const boundary = this.boundaryElement; if (!boundary) { return null; } if (typeof boundary === 'string') { return this.element.nativeElement.closest(boundary); } return (0,_element_chunk_mjs__WEBPACK_IMPORTED_MODULE_14__.coerceElement)(boundary); } _syncInputs(ref) { ref.beforeStarted.subscribe(() => { if (!ref.isDragging()) { const dir = this._dir; const dragStartDelay = this.dragStartDelay; const placeholder = this._placeholderTemplate ? { template: this._placeholderTemplate.templateRef, context: this._placeholderTemplate.data, viewContainer: this._viewContainerRef } : null; const preview = this._previewTemplate ? { template: this._previewTemplate.templateRef, context: this._previewTemplate.data, matchSize: this._previewTemplate.matchSize, viewContainer: this._viewContainerRef } : null; ref.disabled = this.disabled; ref.lockAxis = this.lockAxis; ref.scale = this.scale; ref.dragStartDelay = typeof dragStartDelay === 'object' && dragStartDelay ? dragStartDelay : (0,_element_chunk_mjs__WEBPACK_IMPORTED_MODULE_14__.coerceNumberProperty)(dragStartDelay); ref.constrainPosition = this.constrainPosition; ref.previewClass = this.previewClass; ref.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(placeholder).withPreviewTemplate(preview).withPreviewContainer(this.previewContainer || 'global'); if (dir) { ref.withDirection(dir.value); } } }); ref.beforeStarted.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.take)(1)).subscribe(() => { if (this._parentDrag) { ref.withParent(this._parentDrag._dragRef); return; } let parent = this.element.nativeElement.parentElement; while (parent) { const parentDrag = this._dragDropRegistry.getDragDirectiveForNode(parent); if (parentDrag) { ref.withParent(parentDrag._dragRef); break; } parent = parent.parentElement; } }); } _handleEvents(ref) { ref.started.subscribe(startEvent => { this.started.emit({ source: this, event: startEvent.event }); this._changeDetectorRef.markForCheck(); }); ref.released.subscribe(releaseEvent => { this.released.emit({ source: this, event: releaseEvent.event }); }); ref.ended.subscribe(endEvent => { this.ended.emit({ source: this, distance: endEvent.distance, dropPoint: endEvent.dropPoint, event: endEvent.event }); this._changeDetectorRef.markForCheck(); }); ref.entered.subscribe(enterEvent => { this.entered.emit({ container: enterEvent.container.data, item: this, currentIndex: enterEvent.currentIndex }); }); ref.exited.subscribe(exitEvent => { this.exited.emit({ container: exitEvent.container.data, item: this }); }); ref.dropped.subscribe(dropEvent => { this.dropped.emit({ previousIndex: dropEvent.previousIndex, currentIndex: dropEvent.currentIndex, previousContainer: dropEvent.previousContainer.data, container: dropEvent.container.data, isPointerOverContainer: dropEvent.isPointerOverContainer, item: this, distance: dropEvent.distance, dropPoint: dropEvent.dropPoint, event: dropEvent.event }); }); } _assignDefaults(config) { const { lockAxis, dragStartDelay, constrainPosition, previewClass, boundaryElement, draggingDisabled, rootElementSelector, previewContainer } = config; this.disabled = draggingDisabled == null ? false : draggingDisabled; this.dragStartDelay = dragStartDelay || 0; this.lockAxis = lockAxis || null; if (constrainPosition) { this.constrainPosition = constrainPosition; } if (previewClass) { this.previewClass = previewClass; } if (boundaryElement) { this.boundaryElement = boundaryElement; } if (rootElementSelector) { this.rootElementSelector = rootElementSelector; } if (previewContainer) { this.previewContainer = previewContainer; } } _setupHandlesListener() { this._handles.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_20__.tap)(handles => { const handleElements = handles.map(handle => handle.element); if (this._selfHandle && this.rootElementSelector) { handleElements.push(this.element); } this._dragRef.withHandles(handleElements); }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.switchMap)(handles => { return (0,rxjs__WEBPACK_IMPORTED_MODULE_9__.merge)(...handles.map(item => item._stateChanges.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.startWith)(item)))); }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_19__.takeUntil)(this._destroyed)).subscribe(handleInstance => { const dragRef = this._dragRef; const handle = handleInstance.element.nativeElement; handleInstance.disabled ? dragRef.disableHandle(handle) : dragRef.enableHandle(handle); }); } static ɵfac = function CdkDrag_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CdkDrag)(); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ type: CdkDrag, selectors: [["", "cdkDrag", ""]], hostAttrs: [1, "cdk-drag"], hostVars: 4, hostBindings: function CdkDrag_HostBindings(rf, ctx) { if (rf & 2) { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵclassProp"]("cdk-drag-disabled", ctx.disabled)("cdk-drag-dragging", ctx._dragRef.isDragging()); } }, inputs: { data: [0, "cdkDragData", "data"], lockAxis: [0, "cdkDragLockAxis", "lockAxis"], rootElementSelector: [0, "cdkDragRootElement", "rootElementSelector"], boundaryElement: [0, "cdkDragBoundary", "boundaryElement"], dragStartDelay: [0, "cdkDragStartDelay", "dragStartDelay"], freeDragPosition: [0, "cdkDragFreeDragPosition", "freeDragPosition"], disabled: [2, "cdkDragDisabled", "disabled", _angular_core__WEBPACK_IMPORTED_MODULE_2__.booleanAttribute], constrainPosition: [0, "cdkDragConstrainPosition", "constrainPosition"], previewClass: [0, "cdkDragPreviewClass", "previewClass"], previewContainer: [0, "cdkDragPreviewContainer", "previewContainer"], scale: [2, "cdkDragScale", "scale", _angular_core__WEBPACK_IMPORTED_MODULE_2__.numberAttribute] }, outputs: { started: "cdkDragStarted", released: "cdkDragReleased", ended: "cdkDragEnded", entered: "cdkDragEntered", exited: "cdkDragExited", dropped: "cdkDragDropped", moved: "cdkDragMoved" }, exportAs: ["cdkDrag"], features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵProvidersFeature"]([{ provide: CDK_DRAG_PARENT, useExisting: CdkDrag }]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵNgOnChangesFeature"]] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(CdkDrag, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Directive, args: [{ selector: '[cdkDrag]', exportAs: 'cdkDrag', host: { 'class': 'cdk-drag', '[class.cdk-drag-disabled]': 'disabled', '[class.cdk-drag-dragging]': '_dragRef.isDragging()' }, providers: [{ provide: CDK_DRAG_PARENT, useExisting: CdkDrag }] }] }], () => [], { data: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: ['cdkDragData'] }], lockAxis: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: ['cdkDragLockAxis'] }], rootElementSelector: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: ['cdkDragRootElement'] }], boundaryElement: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: ['cdkDragBoundary'] }], dragStartDelay: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: ['cdkDragStartDelay'] }], freeDragPosition: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: ['cdkDragFreeDragPosition'] }], disabled: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: [{ alias: 'cdkDragDisabled', transform: _angular_core__WEBPACK_IMPORTED_MODULE_2__.booleanAttribute }] }], constrainPosition: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: ['cdkDragConstrainPosition'] }], previewClass: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: ['cdkDragPreviewClass'] }], previewContainer: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: ['cdkDragPreviewContainer'] }], scale: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: [{ alias: 'cdkDragScale', transform: _angular_core__WEBPACK_IMPORTED_MODULE_2__.numberAttribute }] }], started: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Output, args: ['cdkDragStarted'] }], released: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Output, args: ['cdkDragReleased'] }], ended: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Output, args: ['cdkDragEnded'] }], entered: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Output, args: ['cdkDragEntered'] }], exited: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Output, args: ['cdkDragExited'] }], dropped: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Output, args: ['cdkDragDropped'] }], moved: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Output, args: ['cdkDragMoved'] }] }); })(); const CDK_DROP_LIST_GROUP = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('CdkDropListGroup'); class CdkDropListGroup { _items = new Set(); disabled = false; ngOnDestroy() { this._items.clear(); } static ɵfac = function CdkDropListGroup_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CdkDropListGroup)(); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ type: CdkDropListGroup, selectors: [["", "cdkDropListGroup", ""]], inputs: { disabled: [2, "cdkDropListGroupDisabled", "disabled", _angular_core__WEBPACK_IMPORTED_MODULE_2__.booleanAttribute] }, exportAs: ["cdkDropListGroup"], features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵProvidersFeature"]([{ provide: CDK_DROP_LIST_GROUP, useExisting: CdkDropListGroup }])] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(CdkDropListGroup, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Directive, args: [{ selector: '[cdkDropListGroup]', exportAs: 'cdkDropListGroup', providers: [{ provide: CDK_DROP_LIST_GROUP, useExisting: CdkDropListGroup }] }] }], null, { disabled: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: [{ alias: 'cdkDropListGroupDisabled', transform: _angular_core__WEBPACK_IMPORTED_MODULE_2__.booleanAttribute }] }] }); })(); class CdkDropList { element = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef); _changeDetectorRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.ChangeDetectorRef); _scrollDispatcher = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_scrolling_mjs__WEBPACK_IMPORTED_MODULE_13__.ScrollDispatcher); _dir = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_directionality_chunk_mjs__WEBPACK_IMPORTED_MODULE_21__.Directionality, { optional: true }); _group = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(CDK_DROP_LIST_GROUP, { optional: true, skipSelf: true }); _latestSortedRefs; _destroyed = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); _scrollableParentsResolved = false; static _dropLists = []; _dropListRef; connectedTo = []; data; orientation = 'vertical'; id = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_id_generator_chunk_mjs__WEBPACK_IMPORTED_MODULE_22__._IdGenerator).getId('cdk-drop-list-'); lockAxis = null; get disabled() { return this._disabled || !!this._group && this._group.disabled; } set disabled(value) { this._dropListRef.disabled = this._disabled = value; } _disabled = false; sortingDisabled = false; enterPredicate = () => true; sortPredicate = () => true; autoScrollDisabled = false; autoScrollStep; elementContainerSelector = null; hasAnchor = false; dropped = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); entered = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); exited = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); sorted = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter(); _unsortedItems = new Set(); constructor() { const config = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(CDK_DRAG_CONFIG, { optional: true }); const injector = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.Injector); if (typeof ngDevMode === 'undefined' || ngDevMode) { assertElementNode(this.element.nativeElement, 'cdkDropList'); } this._dropListRef = createDropListRef(injector, this.element); this._dropListRef.data = this; if (config) { this._assignDefaults(config); } this._dropListRef.enterPredicate = (drag, drop) => { return this.enterPredicate(drag.data, drop.data); }; this._dropListRef.sortPredicate = (index, drag, drop) => { return this.sortPredicate(index, drag.data, drop.data); }; this._setupInputSyncSubscription(this._dropListRef); this._handleEvents(this._dropListRef); CdkDropList._dropLists.push(this); if (this._group) { this._group._items.add(this); } } addItem(item) { this._unsortedItems.add(item); item._dragRef._withDropContainer(this._dropListRef); if (this._dropListRef.isDragging()) { this._syncItemsWithRef(this.getSortedItems().map(item => item._dragRef)); } } removeItem(item) { this._unsortedItems.delete(item); if (this._latestSortedRefs) { const index = this._latestSortedRefs.indexOf(item._dragRef); if (index > -1) { this._latestSortedRefs.splice(index, 1); this._syncItemsWithRef(this._latestSortedRefs); } } } getSortedItems() { return Array.from(this._unsortedItems).sort((a, b) => { const documentPosition = a._dragRef.getVisibleElement().compareDocumentPosition(b._dragRef.getVisibleElement()); return documentPosition & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1; }); } ngOnDestroy() { const index = CdkDropList._dropLists.indexOf(this); if (index > -1) { CdkDropList._dropLists.splice(index, 1); } if (this._group) { this._group._items.delete(this); } this._latestSortedRefs = undefined; this._unsortedItems.clear(); this._dropListRef.dispose(); this._destroyed.next(); this._destroyed.complete(); } _setupInputSyncSubscription(ref) { if (this._dir) { this._dir.change.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.startWith)(this._dir.value), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_19__.takeUntil)(this._destroyed)).subscribe(value => ref.withDirection(value)); } ref.beforeStarted.subscribe(() => { const siblings = (0,_array_chunk_mjs__WEBPACK_IMPORTED_MODULE_23__.coerceArray)(this.connectedTo).map(drop => { if (typeof drop === 'string') { const correspondingDropList = CdkDropList._dropLists.find(list => list.id === drop); if (!correspondingDropList && (typeof ngDevMode === 'undefined' || ngDevMode)) { console.warn(`CdkDropList could not find connected drop list with id "${drop}"`); } return correspondingDropList; } return drop; }); if (this._group) { this._group._items.forEach(drop => { if (siblings.indexOf(drop) === -1) { siblings.push(drop); } }); } if (!this._scrollableParentsResolved) { const scrollableParents = this._scrollDispatcher.getAncestorScrollContainers(this.element).map(scrollable => scrollable.getElementRef().nativeElement); this._dropListRef.withScrollableParents(scrollableParents); this._scrollableParentsResolved = true; } if (this.elementContainerSelector) { const container = this.element.nativeElement.querySelector(this.elementContainerSelector); if (!container && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw new Error(`CdkDropList could not find an element container matching the selector "${this.elementContainerSelector}"`); } ref.withElementContainer(container); } ref.disabled = this.disabled; ref.lockAxis = this.lockAxis; ref.sortingDisabled = this.sortingDisabled; ref.autoScrollDisabled = this.autoScrollDisabled; ref.autoScrollStep = (0,_element_chunk_mjs__WEBPACK_IMPORTED_MODULE_14__.coerceNumberProperty)(this.autoScrollStep, 2); ref.hasAnchor = this.hasAnchor; ref.connectedTo(siblings.filter(drop => drop && drop !== this).map(list => list._dropListRef)).withOrientation(this.orientation); }); } _handleEvents(ref) { ref.beforeStarted.subscribe(() => { this._syncItemsWithRef(this.getSortedItems().map(item => item._dragRef)); this._changeDetectorRef.markForCheck(); }); ref.entered.subscribe(event => { this.entered.emit({ container: this, item: event.item.data, currentIndex: event.currentIndex }); }); ref.exited.subscribe(event => { this.exited.emit({ container: this, item: event.item.data }); this._changeDetectorRef.markForCheck(); }); ref.sorted.subscribe(event => { this.sorted.emit({ previousIndex: event.previousIndex, currentIndex: event.currentIndex, container: this, item: event.item.data }); }); ref.dropped.subscribe(dropEvent => { this.dropped.emit({ previousIndex: dropEvent.previousIndex, currentIndex: dropEvent.currentIndex, previousContainer: dropEvent.previousContainer.data, container: dropEvent.container.data, item: dropEvent.item.data, isPointerOverContainer: dropEvent.isPointerOverContainer, distance: dropEvent.distance, dropPoint: dropEvent.dropPoint, event: dropEvent.event }); this._changeDetectorRef.markForCheck(); }); (0,rxjs__WEBPACK_IMPORTED_MODULE_9__.merge)(ref.receivingStarted, ref.receivingStopped).subscribe(() => this._changeDetectorRef.markForCheck()); } _assignDefaults(config) { const { lockAxis, draggingDisabled, sortingDisabled, listAutoScrollDisabled, listOrientation } = config; this.disabled = draggingDisabled == null ? false : draggingDisabled; this.sortingDisabled = sortingDisabled == null ? false : sortingDisabled; this.autoScrollDisabled = listAutoScrollDisabled == null ? false : listAutoScrollDisabled; this.orientation = listOrientation || 'vertical'; this.lockAxis = lockAxis || null; } _syncItemsWithRef(items) { this._latestSortedRefs = items; this._dropListRef.withItems(items); } static ɵfac = function CdkDropList_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CdkDropList)(); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ type: CdkDropList, selectors: [["", "cdkDropList", ""], ["cdk-drop-list"]], hostAttrs: [1, "cdk-drop-list"], hostVars: 7, hostBindings: function CdkDropList_HostBindings(rf, ctx) { if (rf & 2) { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵattribute"]("id", ctx.id); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵclassProp"]("cdk-drop-list-disabled", ctx.disabled)("cdk-drop-list-dragging", ctx._dropListRef.isDragging())("cdk-drop-list-receiving", ctx._dropListRef.isReceiving()); } }, inputs: { connectedTo: [0, "cdkDropListConnectedTo", "connectedTo"], data: [0, "cdkDropListData", "data"], orientation: [0, "cdkDropListOrientation", "orientation"], id: "id", lockAxis: [0, "cdkDropListLockAxis", "lockAxis"], disabled: [2, "cdkDropListDisabled", "disabled", _angular_core__WEBPACK_IMPORTED_MODULE_2__.booleanAttribute], sortingDisabled: [2, "cdkDropListSortingDisabled", "sortingDisabled", _angular_core__WEBPACK_IMPORTED_MODULE_2__.booleanAttribute], enterPredicate: [0, "cdkDropListEnterPredicate", "enterPredicate"], sortPredicate: [0, "cdkDropListSortPredicate", "sortPredicate"], autoScrollDisabled: [2, "cdkDropListAutoScrollDisabled", "autoScrollDisabled", _angular_core__WEBPACK_IMPORTED_MODULE_2__.booleanAttribute], autoScrollStep: [0, "cdkDropListAutoScrollStep", "autoScrollStep"], elementContainerSelector: [0, "cdkDropListElementContainer", "elementContainerSelector"], hasAnchor: [2, "cdkDropListHasAnchor", "hasAnchor", _angular_core__WEBPACK_IMPORTED_MODULE_2__.booleanAttribute] }, outputs: { dropped: "cdkDropListDropped", entered: "cdkDropListEntered", exited: "cdkDropListExited", sorted: "cdkDropListSorted" }, exportAs: ["cdkDropList"], features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵProvidersFeature"]([{ provide: CDK_DROP_LIST_GROUP, useValue: undefined }, { provide: CDK_DROP_LIST, useExisting: CdkDropList }])] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(CdkDropList, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Directive, args: [{ selector: '[cdkDropList], cdk-drop-list', exportAs: 'cdkDropList', providers: [{ provide: CDK_DROP_LIST_GROUP, useValue: undefined }, { provide: CDK_DROP_LIST, useExisting: CdkDropList }], host: { 'class': 'cdk-drop-list', '[attr.id]': 'id', '[class.cdk-drop-list-disabled]': 'disabled', '[class.cdk-drop-list-dragging]': '_dropListRef.isDragging()', '[class.cdk-drop-list-receiving]': '_dropListRef.isReceiving()' } }] }], () => [], { connectedTo: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: ['cdkDropListConnectedTo'] }], data: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: ['cdkDropListData'] }], orientation: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: ['cdkDropListOrientation'] }], id: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input }], lockAxis: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: ['cdkDropListLockAxis'] }], disabled: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: [{ alias: 'cdkDropListDisabled', transform: _angular_core__WEBPACK_IMPORTED_MODULE_2__.booleanAttribute }] }], sortingDisabled: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: [{ alias: 'cdkDropListSortingDisabled', transform: _angular_core__WEBPACK_IMPORTED_MODULE_2__.booleanAttribute }] }], enterPredicate: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: ['cdkDropListEnterPredicate'] }], sortPredicate: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: ['cdkDropListSortPredicate'] }], autoScrollDisabled: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: [{ alias: 'cdkDropListAutoScrollDisabled', transform: _angular_core__WEBPACK_IMPORTED_MODULE_2__.booleanAttribute }] }], autoScrollStep: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: ['cdkDropListAutoScrollStep'] }], elementContainerSelector: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: ['cdkDropListElementContainer'] }], hasAnchor: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: [{ alias: 'cdkDropListHasAnchor', transform: _angular_core__WEBPACK_IMPORTED_MODULE_2__.booleanAttribute }] }], dropped: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Output, args: ['cdkDropListDropped'] }], entered: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Output, args: ['cdkDropListEntered'] }], exited: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Output, args: ['cdkDropListExited'] }], sorted: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Output, args: ['cdkDropListSorted'] }] }); })(); const CDK_DRAG_PREVIEW = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('CdkDragPreview'); class CdkDragPreview { templateRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.TemplateRef); _drag = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(CDK_DRAG_PARENT, { optional: true }); data; matchSize = false; constructor() { this._drag?._setPreviewTemplate(this); } ngOnDestroy() { this._drag?._resetPreviewTemplate(this); } static ɵfac = function CdkDragPreview_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CdkDragPreview)(); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ type: CdkDragPreview, selectors: [["ng-template", "cdkDragPreview", ""]], inputs: { data: "data", matchSize: [2, "matchSize", "matchSize", _angular_core__WEBPACK_IMPORTED_MODULE_2__.booleanAttribute] }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵProvidersFeature"]([{ provide: CDK_DRAG_PREVIEW, useExisting: CdkDragPreview }])] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(CdkDragPreview, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Directive, args: [{ selector: 'ng-template[cdkDragPreview]', providers: [{ provide: CDK_DRAG_PREVIEW, useExisting: CdkDragPreview }] }] }], () => [], { data: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input }], matchSize: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: [{ transform: _angular_core__WEBPACK_IMPORTED_MODULE_2__.booleanAttribute }] }] }); })(); const CDK_DRAG_PLACEHOLDER = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('CdkDragPlaceholder'); class CdkDragPlaceholder { templateRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.TemplateRef); _drag = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(CDK_DRAG_PARENT, { optional: true }); data; constructor() { this._drag?._setPlaceholderTemplate(this); } ngOnDestroy() { this._drag?._resetPlaceholderTemplate(this); } static ɵfac = function CdkDragPlaceholder_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CdkDragPlaceholder)(); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ type: CdkDragPlaceholder, selectors: [["ng-template", "cdkDragPlaceholder", ""]], inputs: { data: "data" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵProvidersFeature"]([{ provide: CDK_DRAG_PLACEHOLDER, useExisting: CdkDragPlaceholder }])] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(CdkDragPlaceholder, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Directive, args: [{ selector: 'ng-template[cdkDragPlaceholder]', providers: [{ provide: CDK_DRAG_PLACEHOLDER, useExisting: CdkDragPlaceholder }] }] }], () => [], { data: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input }] }); })(); const DRAG_DROP_DIRECTIVES = [CdkDropList, CdkDropListGroup, CdkDrag, CdkDragHandle, CdkDragPreview, CdkDragPlaceholder]; class DragDropModule { static ɵfac = function DragDropModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DragDropModule)(); }; static ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ type: DragDropModule }); static ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({ providers: [DragDrop], imports: [_scrolling_mjs__WEBPACK_IMPORTED_MODULE_13__.CdkScrollableModule] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(DragDropModule, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgModule, args: [{ imports: DRAG_DROP_DIRECTIVES, exports: [_scrolling_mjs__WEBPACK_IMPORTED_MODULE_13__.CdkScrollableModule, ...DRAG_DROP_DIRECTIVES], providers: [DragDrop] }] }], null, null); })(); /***/ }, /***/ 67658 /*!**********************************************************!*\ !*** ./node_modules/@angular/cdk/fesm2022/scrolling.mjs ***! \**********************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CDK_VIRTUAL_SCROLL_VIEWPORT: () => (/* binding */ CDK_VIRTUAL_SCROLL_VIEWPORT), /* harmony export */ CdkFixedSizeVirtualScroll: () => (/* binding */ CdkFixedSizeVirtualScroll), /* harmony export */ CdkScrollable: () => (/* binding */ CdkScrollable), /* harmony export */ CdkScrollableModule: () => (/* binding */ CdkScrollableModule), /* harmony export */ CdkVirtualForOf: () => (/* binding */ CdkVirtualForOf), /* harmony export */ CdkVirtualScrollViewport: () => (/* binding */ CdkVirtualScrollViewport), /* harmony export */ CdkVirtualScrollable: () => (/* binding */ CdkVirtualScrollable), /* harmony export */ CdkVirtualScrollableElement: () => (/* binding */ CdkVirtualScrollableElement), /* harmony export */ CdkVirtualScrollableWindow: () => (/* binding */ CdkVirtualScrollableWindow), /* harmony export */ DEFAULT_RESIZE_TIME: () => (/* binding */ DEFAULT_RESIZE_TIME), /* harmony export */ DEFAULT_SCROLL_TIME: () => (/* binding */ DEFAULT_SCROLL_TIME), /* harmony export */ FixedSizeVirtualScrollStrategy: () => (/* binding */ FixedSizeVirtualScrollStrategy), /* harmony export */ ScrollDispatcher: () => (/* binding */ ScrollDispatcher), /* harmony export */ ScrollingModule: () => (/* binding */ ScrollingModule), /* harmony export */ VIRTUAL_SCROLLABLE: () => (/* binding */ VIRTUAL_SCROLLABLE), /* harmony export */ VIRTUAL_SCROLL_STRATEGY: () => (/* binding */ VIRTUAL_SCROLL_STRATEGY), /* harmony export */ ViewportRuler: () => (/* binding */ ViewportRuler), /* harmony export */ _fixedSizeVirtualScrollStrategyFactory: () => (/* binding */ _fixedSizeVirtualScrollStrategyFactory), /* harmony export */ "ɵɵDir": () => (/* reexport safe */ _bidi_mjs__WEBPACK_IMPORTED_MODULE_22__.Dir) /* harmony export */ }); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 40072); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 14975); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 36973); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 57417); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ 33242); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs */ 57811); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ 92809); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs */ 72737); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs */ 87946); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs */ 98241); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs/operators */ 16802); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs/operators */ 8102); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs/operators */ 59380); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rxjs/operators */ 90242); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! rxjs/operators */ 27588); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! rxjs/operators */ 9276); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! rxjs/operators */ 86110); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! rxjs/operators */ 53897); /* harmony import */ var _element_chunk_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./_element-chunk.mjs */ 53012); /* harmony import */ var _platform_chunk_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./_platform-chunk.mjs */ 44689); /* harmony import */ var _directionality_chunk_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./_directionality-chunk.mjs */ 63500); /* harmony import */ var _scrolling_chunk_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./_scrolling-chunk.mjs */ 81981); /* harmony import */ var _bidi_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./bidi.mjs */ 25863); /* harmony import */ var _recycle_view_repeater_strategy_chunk_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./_recycle-view-repeater-strategy-chunk.mjs */ 52978); /* harmony import */ var _data_source_chunk_mjs__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./_data-source-chunk.mjs */ 782); const _c0 = ["contentWrapper"]; const _c1 = ["*"]; const VIRTUAL_SCROLL_STRATEGY = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('VIRTUAL_SCROLL_STRATEGY'); class FixedSizeVirtualScrollStrategy { _scrolledIndexChange = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); scrolledIndexChange = this._scrolledIndexChange.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_11__.distinctUntilChanged)()); _viewport = null; _itemSize; _minBufferPx; _maxBufferPx; constructor(itemSize, minBufferPx, maxBufferPx) { this._itemSize = itemSize; this._minBufferPx = minBufferPx; this._maxBufferPx = maxBufferPx; } attach(viewport) { this._viewport = viewport; this._updateTotalContentSize(); this._updateRenderedRange(); } detach() { this._scrolledIndexChange.complete(); this._viewport = null; } updateItemAndBufferSize(itemSize, minBufferPx, maxBufferPx) { if (maxBufferPx < minBufferPx && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw Error('CDK virtual scroll: maxBufferPx must be greater than or equal to minBufferPx'); } this._itemSize = itemSize; this._minBufferPx = minBufferPx; this._maxBufferPx = maxBufferPx; this._updateTotalContentSize(); this._updateRenderedRange(); } onContentScrolled() { this._updateRenderedRange(); } onDataLengthChanged() { this._updateTotalContentSize(); this._updateRenderedRange(); } onContentRendered() {} onRenderedOffsetChanged() {} scrollToIndex(index, behavior) { if (this._viewport) { this._viewport.scrollToOffset(index * this._itemSize, behavior); } } _updateTotalContentSize() { if (!this._viewport) { return; } this._viewport.setTotalContentSize(this._viewport.getDataLength() * this._itemSize); } _updateRenderedRange() { if (!this._viewport) { return; } const renderedRange = this._viewport.getRenderedRange(); const newRange = { start: renderedRange.start, end: renderedRange.end }; const viewportSize = this._viewport.getViewportSize(); const dataLength = this._viewport.getDataLength(); let scrollOffset = this._viewport.measureScrollOffset(); let firstVisibleIndex = this._itemSize > 0 ? scrollOffset / this._itemSize : 0; if (newRange.end > dataLength) { const maxVisibleItems = Math.ceil(viewportSize / this._itemSize); const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems)); if (firstVisibleIndex != newVisibleIndex) { firstVisibleIndex = newVisibleIndex; scrollOffset = newVisibleIndex * this._itemSize; newRange.start = Math.floor(firstVisibleIndex); } newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems)); } const startBuffer = scrollOffset - newRange.start * this._itemSize; if (startBuffer < this._minBufferPx && newRange.start != 0) { const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize); newRange.start = Math.max(0, newRange.start - expandStart); newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize)); } else { const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize); if (endBuffer < this._minBufferPx && newRange.end != dataLength) { const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize); if (expandEnd > 0) { newRange.end = Math.min(dataLength, newRange.end + expandEnd); newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize)); } } } this._viewport.setRenderedRange(newRange); this._viewport.setRenderedContentOffset(Math.round(this._itemSize * newRange.start)); this._scrolledIndexChange.next(Math.floor(firstVisibleIndex)); } } function _fixedSizeVirtualScrollStrategyFactory(fixedSizeDir) { return fixedSizeDir._scrollStrategy; } class CdkFixedSizeVirtualScroll { get itemSize() { return this._itemSize; } set itemSize(value) { this._itemSize = (0,_element_chunk_mjs__WEBPACK_IMPORTED_MODULE_18__.coerceNumberProperty)(value); } _itemSize = 20; get minBufferPx() { return this._minBufferPx; } set minBufferPx(value) { this._minBufferPx = (0,_element_chunk_mjs__WEBPACK_IMPORTED_MODULE_18__.coerceNumberProperty)(value); } _minBufferPx = 100; get maxBufferPx() { return this._maxBufferPx; } set maxBufferPx(value) { this._maxBufferPx = (0,_element_chunk_mjs__WEBPACK_IMPORTED_MODULE_18__.coerceNumberProperty)(value); } _maxBufferPx = 200; _scrollStrategy = new FixedSizeVirtualScrollStrategy(this.itemSize, this.minBufferPx, this.maxBufferPx); ngOnChanges() { this._scrollStrategy.updateItemAndBufferSize(this.itemSize, this.minBufferPx, this.maxBufferPx); } static ɵfac = function CdkFixedSizeVirtualScroll_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CdkFixedSizeVirtualScroll)(); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ type: CdkFixedSizeVirtualScroll, selectors: [["cdk-virtual-scroll-viewport", "itemSize", ""]], inputs: { itemSize: "itemSize", minBufferPx: "minBufferPx", maxBufferPx: "maxBufferPx" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵProvidersFeature"]([{ provide: VIRTUAL_SCROLL_STRATEGY, useFactory: _fixedSizeVirtualScrollStrategyFactory, deps: [(0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(() => CdkFixedSizeVirtualScroll)] }]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵNgOnChangesFeature"]] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(CdkFixedSizeVirtualScroll, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Directive, args: [{ selector: 'cdk-virtual-scroll-viewport[itemSize]', providers: [{ provide: VIRTUAL_SCROLL_STRATEGY, useFactory: _fixedSizeVirtualScrollStrategyFactory, deps: [(0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(() => CdkFixedSizeVirtualScroll)] }] }] }], null, { itemSize: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input }], minBufferPx: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input }], maxBufferPx: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input }] }); })(); const DEFAULT_SCROLL_TIME = 20; class ScrollDispatcher { _ngZone = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone); _platform = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_platform_chunk_mjs__WEBPACK_IMPORTED_MODULE_19__.Platform); _renderer = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.RendererFactory2).createRenderer(null, null); _cleanupGlobalListener; constructor() {} _scrolled = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); _scrolledCount = 0; scrollContainers = new Map(); register(scrollable) { if (!this.scrollContainers.has(scrollable)) { this.scrollContainers.set(scrollable, scrollable.elementScrolled().subscribe(() => this._scrolled.next(scrollable))); } } deregister(scrollable) { const scrollableReference = this.scrollContainers.get(scrollable); if (scrollableReference) { scrollableReference.unsubscribe(); this.scrollContainers.delete(scrollable); } } scrolled(auditTimeInMs = DEFAULT_SCROLL_TIME) { if (!this._platform.isBrowser) { return (0,rxjs__WEBPACK_IMPORTED_MODULE_9__.of)(); } return new rxjs__WEBPACK_IMPORTED_MODULE_3__.Observable(observer => { if (!this._cleanupGlobalListener) { this._cleanupGlobalListener = this._ngZone.runOutsideAngular(() => this._renderer.listen('document', 'scroll', () => this._scrolled.next())); } const subscription = auditTimeInMs > 0 ? this._scrolled.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_10__.auditTime)(auditTimeInMs)).subscribe(observer) : this._scrolled.subscribe(observer); this._scrolledCount++; return () => { subscription.unsubscribe(); this._scrolledCount--; if (!this._scrolledCount) { this._cleanupGlobalListener?.(); this._cleanupGlobalListener = undefined; } }; }); } ngOnDestroy() { this._cleanupGlobalListener?.(); this._cleanupGlobalListener = undefined; this.scrollContainers.forEach((_, container) => this.deregister(container)); this._scrolled.complete(); } ancestorScrolled(elementOrElementRef, auditTimeInMs) { const ancestors = this.getAncestorScrollContainers(elementOrElementRef); return this.scrolled(auditTimeInMs).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.filter)(target => !target || ancestors.indexOf(target) > -1)); } getAncestorScrollContainers(elementOrElementRef) { const scrollingContainers = []; this.scrollContainers.forEach((_subscription, scrollable) => { if (this._scrollableContainsElement(scrollable, elementOrElementRef)) { scrollingContainers.push(scrollable); } }); return scrollingContainers; } _scrollableContainsElement(scrollable, elementOrElementRef) { let element = (0,_element_chunk_mjs__WEBPACK_IMPORTED_MODULE_18__.coerceElement)(elementOrElementRef); let scrollableElement = scrollable.getElementRef().nativeElement; do { if (element == scrollableElement) { return true; } } while (element = element.parentElement); return false; } static ɵfac = function ScrollDispatcher_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ScrollDispatcher)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: ScrollDispatcher, factory: ScrollDispatcher.ɵfac, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(ScrollDispatcher, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable, args: [{ providedIn: 'root' }] }], () => [], null); })(); class CdkScrollable { elementRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef); scrollDispatcher = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(ScrollDispatcher); ngZone = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone); dir = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_directionality_chunk_mjs__WEBPACK_IMPORTED_MODULE_20__.Directionality, { optional: true }); _scrollElement = this.elementRef.nativeElement; _destroyed = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); _renderer = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.Renderer2); _cleanupScroll; _elementScrolled = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); constructor() {} ngOnInit() { this._cleanupScroll = this.ngZone.runOutsideAngular(() => this._renderer.listen(this._scrollElement, 'scroll', event => this._elementScrolled.next(event))); this.scrollDispatcher.register(this); } ngOnDestroy() { this._cleanupScroll?.(); this._elementScrolled.complete(); this.scrollDispatcher.deregister(this); this._destroyed.next(); this._destroyed.complete(); } elementScrolled() { return this._elementScrolled; } getElementRef() { return this.elementRef; } scrollTo(options) { const el = this.elementRef.nativeElement; const isRtl = this.dir && this.dir.value == 'rtl'; if (options.left == null) { options.left = isRtl ? options.end : options.start; } if (options.right == null) { options.right = isRtl ? options.start : options.end; } if (options.bottom != null) { options.top = el.scrollHeight - el.clientHeight - options.bottom; } if (isRtl && (0,_scrolling_chunk_mjs__WEBPACK_IMPORTED_MODULE_21__.getRtlScrollAxisType)() != _scrolling_chunk_mjs__WEBPACK_IMPORTED_MODULE_21__.RtlScrollAxisType.NORMAL) { if (options.left != null) { options.right = el.scrollWidth - el.clientWidth - options.left; } if ((0,_scrolling_chunk_mjs__WEBPACK_IMPORTED_MODULE_21__.getRtlScrollAxisType)() == _scrolling_chunk_mjs__WEBPACK_IMPORTED_MODULE_21__.RtlScrollAxisType.INVERTED) { options.left = options.right; } else if ((0,_scrolling_chunk_mjs__WEBPACK_IMPORTED_MODULE_21__.getRtlScrollAxisType)() == _scrolling_chunk_mjs__WEBPACK_IMPORTED_MODULE_21__.RtlScrollAxisType.NEGATED) { options.left = options.right ? -options.right : options.right; } } else { if (options.right != null) { options.left = el.scrollWidth - el.clientWidth - options.right; } } this._applyScrollToOptions(options); } _applyScrollToOptions(options) { const el = this.elementRef.nativeElement; if ((0,_scrolling_chunk_mjs__WEBPACK_IMPORTED_MODULE_21__.supportsScrollBehavior)()) { el.scrollTo(options); } else { if (options.top != null) { el.scrollTop = options.top; } if (options.left != null) { el.scrollLeft = options.left; } } } measureScrollOffset(from) { const LEFT = 'left'; const RIGHT = 'right'; const el = this.elementRef.nativeElement; if (from == 'top') { return el.scrollTop; } if (from == 'bottom') { return el.scrollHeight - el.clientHeight - el.scrollTop; } const isRtl = this.dir && this.dir.value == 'rtl'; if (from == 'start') { from = isRtl ? RIGHT : LEFT; } else if (from == 'end') { from = isRtl ? LEFT : RIGHT; } if (isRtl && (0,_scrolling_chunk_mjs__WEBPACK_IMPORTED_MODULE_21__.getRtlScrollAxisType)() == _scrolling_chunk_mjs__WEBPACK_IMPORTED_MODULE_21__.RtlScrollAxisType.INVERTED) { if (from == LEFT) { return el.scrollWidth - el.clientWidth - el.scrollLeft; } else { return el.scrollLeft; } } else if (isRtl && (0,_scrolling_chunk_mjs__WEBPACK_IMPORTED_MODULE_21__.getRtlScrollAxisType)() == _scrolling_chunk_mjs__WEBPACK_IMPORTED_MODULE_21__.RtlScrollAxisType.NEGATED) { if (from == LEFT) { return el.scrollLeft + el.scrollWidth - el.clientWidth; } else { return -el.scrollLeft; } } else { if (from == LEFT) { return el.scrollLeft; } else { return el.scrollWidth - el.clientWidth - el.scrollLeft; } } } static ɵfac = function CdkScrollable_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CdkScrollable)(); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ type: CdkScrollable, selectors: [["", "cdk-scrollable", ""], ["", "cdkScrollable", ""]] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(CdkScrollable, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Directive, args: [{ selector: '[cdk-scrollable], [cdkScrollable]' }] }], () => [], null); })(); const DEFAULT_RESIZE_TIME = 20; class ViewportRuler { _platform = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_platform_chunk_mjs__WEBPACK_IMPORTED_MODULE_19__.Platform); _listeners; _viewportSize = null; _change = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); _document = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT); constructor() { const ngZone = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone); const renderer = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.RendererFactory2).createRenderer(null, null); ngZone.runOutsideAngular(() => { if (this._platform.isBrowser) { const changeListener = event => this._change.next(event); this._listeners = [renderer.listen('window', 'resize', changeListener), renderer.listen('window', 'orientationchange', changeListener)]; } this.change().subscribe(() => this._viewportSize = null); }); } ngOnDestroy() { this._listeners?.forEach(cleanup => cleanup()); this._change.complete(); } getViewportSize() { if (!this._viewportSize) { this._updateViewportSize(); } const output = { width: this._viewportSize.width, height: this._viewportSize.height }; if (!this._platform.isBrowser) { this._viewportSize = null; } return output; } getViewportRect() { const scrollPosition = this.getViewportScrollPosition(); const { width, height } = this.getViewportSize(); return { top: scrollPosition.top, left: scrollPosition.left, bottom: scrollPosition.top + height, right: scrollPosition.left + width, height, width }; } getViewportScrollPosition() { if (!this._platform.isBrowser) { return { top: 0, left: 0 }; } const document = this._document; const window = this._getWindow(); const documentElement = document.documentElement; const documentRect = documentElement.getBoundingClientRect(); const top = -documentRect.top || document.body?.scrollTop || window.scrollY || documentElement.scrollTop || 0; const left = -documentRect.left || document.body?.scrollLeft || window.scrollX || documentElement.scrollLeft || 0; return { top, left }; } change(throttleTime = DEFAULT_RESIZE_TIME) { return throttleTime > 0 ? this._change.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_10__.auditTime)(throttleTime)) : this._change; } _getWindow() { return this._document.defaultView || window; } _updateViewportSize() { const window = this._getWindow(); this._viewportSize = this._platform.isBrowser ? { width: window.innerWidth, height: window.innerHeight } : { width: 0, height: 0 }; } static ɵfac = function ViewportRuler_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ViewportRuler)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: ViewportRuler, factory: ViewportRuler.ɵfac, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(ViewportRuler, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable, args: [{ providedIn: 'root' }] }], () => [], null); })(); const VIRTUAL_SCROLLABLE = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('VIRTUAL_SCROLLABLE'); class CdkVirtualScrollable extends CdkScrollable { constructor() { super(); } measureViewportSize(orientation) { const viewportEl = this.elementRef.nativeElement; return orientation === 'horizontal' ? viewportEl.clientWidth : viewportEl.clientHeight; } static ɵfac = function CdkVirtualScrollable_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CdkVirtualScrollable)(); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ type: CdkVirtualScrollable, features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵInheritDefinitionFeature"]] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(CdkVirtualScrollable, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Directive }], () => [], null); })(); function rangesEqual(r1, r2) { return r1.start == r2.start && r1.end == r2.end; } const SCROLL_SCHEDULER = typeof requestAnimationFrame !== 'undefined' ? rxjs__WEBPACK_IMPORTED_MODULE_6__.animationFrameScheduler : rxjs__WEBPACK_IMPORTED_MODULE_5__.asapScheduler; const CDK_VIRTUAL_SCROLL_VIEWPORT = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('CDK_VIRTUAL_SCROLL_VIEWPORT'); class CdkVirtualScrollViewport extends CdkVirtualScrollable { elementRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef); _changeDetectorRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.ChangeDetectorRef); _scrollStrategy = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(VIRTUAL_SCROLL_STRATEGY, { optional: true }); scrollable = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(VIRTUAL_SCROLLABLE, { optional: true }); _platform = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_platform_chunk_mjs__WEBPACK_IMPORTED_MODULE_19__.Platform); _detachedSubject = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); _renderedRangeSubject = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); _renderedContentOffsetSubject = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); get orientation() { return this._orientation; } set orientation(orientation) { if (this._orientation !== orientation) { this._orientation = orientation; this._calculateSpacerSize(); } } _orientation = 'vertical'; appendOnly = false; scrolledIndexChange = new rxjs__WEBPACK_IMPORTED_MODULE_3__.Observable(observer => this._scrollStrategy.scrolledIndexChange.subscribe(index => Promise.resolve().then(() => this.ngZone.run(() => observer.next(index))))); _contentWrapper; renderedRangeStream = this._renderedRangeSubject; renderedContentOffset = this._renderedContentOffsetSubject.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.filter)(offset => offset !== null), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_11__.distinctUntilChanged)()); _totalContentSize = 0; _totalContentWidth = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.signal)('', ...(ngDevMode ? [{ debugName: "_totalContentWidth" }] : [])); _totalContentHeight = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.signal)('', ...(ngDevMode ? [{ debugName: "_totalContentHeight" }] : [])); _renderedContentTransform; _renderedRange = { start: 0, end: 0 }; _dataLength = 0; _viewportSize = 0; _forOf = null; _renderedContentOffset = 0; _renderedContentOffsetNeedsRewrite = false; _changeDetectionNeeded = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.signal)(false, ...(ngDevMode ? [{ debugName: "_changeDetectionNeeded" }] : [])); _runAfterChangeDetection = []; _viewportChanges = rxjs__WEBPACK_IMPORTED_MODULE_7__.Subscription.EMPTY; _injector = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.Injector); _isDestroyed = false; constructor() { super(); const viewportRuler = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(ViewportRuler); if (!this._scrollStrategy && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw Error('Error: cdk-virtual-scroll-viewport requires the "itemSize" property to be set.'); } this._viewportChanges = viewportRuler.change().subscribe(() => { this.checkViewportSize(); }); if (!this.scrollable) { this.elementRef.nativeElement.classList.add('cdk-virtual-scrollable'); this.scrollable = this; } const ref = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.effect)(() => { if (this._changeDetectionNeeded()) { this._doChangeDetection(); } }, { ...(ngDevMode ? { debugName: "ref" } : {}), injector: (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.ApplicationRef).injector }); (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.DestroyRef).onDestroy(() => void ref.destroy()); } ngOnInit() { if (!this._platform.isBrowser) { return; } if (this.scrollable === this) { super.ngOnInit(); } this.ngZone.runOutsideAngular(() => Promise.resolve().then(() => { this._measureViewportSize(); this._scrollStrategy.attach(this); this.scrollable.elementScrolled().pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_15__.startWith)(null), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_10__.auditTime)(0, SCROLL_SCHEDULER), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.takeUntil)(this._destroyed)).subscribe(() => this._scrollStrategy.onContentScrolled()); this._markChangeDetectionNeeded(); })); } ngOnDestroy() { this.detach(); this._scrollStrategy.detach(); this._renderedRangeSubject.complete(); this._detachedSubject.complete(); this._viewportChanges.unsubscribe(); this._isDestroyed = true; super.ngOnDestroy(); } attach(forOf) { if (this._forOf && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw Error('CdkVirtualScrollViewport is already attached.'); } this.ngZone.runOutsideAngular(() => { this._forOf = forOf; this._forOf.dataStream.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.takeUntil)(this._detachedSubject)).subscribe(data => { const newLength = data.length; if (newLength !== this._dataLength) { this._dataLength = newLength; this._scrollStrategy.onDataLengthChanged(); } this._doChangeDetection(); }); }); } detach() { this._forOf = null; this._detachedSubject.next(); } getDataLength() { return this._dataLength; } getViewportSize() { return this._viewportSize; } getRenderedRange() { return this._renderedRange; } measureBoundingClientRectWithScrollOffset(from) { return this.getElementRef().nativeElement.getBoundingClientRect()[from]; } setTotalContentSize(size) { if (this._totalContentSize !== size) { this._totalContentSize = size; this._calculateSpacerSize(); this._markChangeDetectionNeeded(); } } setRenderedRange(range) { if (!rangesEqual(this._renderedRange, range)) { if (this.appendOnly) { range = { start: 0, end: Math.max(this._renderedRange.end, range.end) }; } this._renderedRangeSubject.next(this._renderedRange = range); this._markChangeDetectionNeeded(() => this._scrollStrategy.onContentRendered()); } } getOffsetToRenderedContentStart() { return this._renderedContentOffsetNeedsRewrite ? null : this._renderedContentOffset; } setRenderedContentOffset(offset, to = 'to-start') { offset = this.appendOnly && to === 'to-start' ? 0 : offset; const isRtl = this.dir && this.dir.value == 'rtl'; const isHorizontal = this.orientation == 'horizontal'; const axis = isHorizontal ? 'X' : 'Y'; const axisDirection = isHorizontal && isRtl ? -1 : 1; let transform = `translate${axis}(${Number(axisDirection * offset)}px)`; this._renderedContentOffset = offset; if (to === 'to-end') { transform += ` translate${axis}(-100%)`; this._renderedContentOffsetNeedsRewrite = true; } if (this._renderedContentTransform != transform) { this._renderedContentTransform = transform; this._markChangeDetectionNeeded(() => { if (this._renderedContentOffsetNeedsRewrite) { this._renderedContentOffset -= this.measureRenderedContentSize(); this._renderedContentOffsetNeedsRewrite = false; this.setRenderedContentOffset(this._renderedContentOffset); } else { this._scrollStrategy.onRenderedOffsetChanged(); } }); } } scrollToOffset(offset, behavior = 'auto') { const options = { behavior }; if (this.orientation === 'horizontal') { options.start = offset; } else { options.top = offset; } this.scrollable.scrollTo(options); } scrollToIndex(index, behavior = 'auto') { this._scrollStrategy.scrollToIndex(index, behavior); } measureScrollOffset(from) { let measureScrollOffset; if (this.scrollable == this) { measureScrollOffset = _from => super.measureScrollOffset(_from); } else { measureScrollOffset = _from => this.scrollable.measureScrollOffset(_from); } return Math.max(0, measureScrollOffset(from ?? (this.orientation === 'horizontal' ? 'start' : 'top')) - this.measureViewportOffset()); } measureViewportOffset(from) { let fromRect; const LEFT = 'left'; const RIGHT = 'right'; const isRtl = this.dir?.value == 'rtl'; if (from == 'start') { fromRect = isRtl ? RIGHT : LEFT; } else if (from == 'end') { fromRect = isRtl ? LEFT : RIGHT; } else if (from) { fromRect = from; } else { fromRect = this.orientation === 'horizontal' ? 'left' : 'top'; } const scrollerClientRect = this.scrollable.measureBoundingClientRectWithScrollOffset(fromRect); const viewportClientRect = this.elementRef.nativeElement.getBoundingClientRect()[fromRect]; return viewportClientRect - scrollerClientRect; } measureRenderedContentSize() { const contentEl = this._contentWrapper.nativeElement; return this.orientation === 'horizontal' ? contentEl.offsetWidth : contentEl.offsetHeight; } measureRangeSize(range) { if (!this._forOf) { return 0; } return this._forOf.measureRangeSize(range, this.orientation); } checkViewportSize() { this._measureViewportSize(); this._scrollStrategy.onDataLengthChanged(); } _measureViewportSize() { this._viewportSize = this.scrollable.measureViewportSize(this.orientation); } _markChangeDetectionNeeded(runAfter) { if (runAfter) { this._runAfterChangeDetection.push(runAfter); } if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.untracked)(this._changeDetectionNeeded)) { return; } this.ngZone.runOutsideAngular(() => { Promise.resolve().then(() => { this.ngZone.run(() => { this._changeDetectionNeeded.set(true); }); }); }); } _doChangeDetection() { if (this._isDestroyed) { return; } this.ngZone.run(() => { this._changeDetectorRef.markForCheck(); this._contentWrapper.nativeElement.style.transform = this._renderedContentTransform; this._renderedContentOffsetSubject.next(this.getOffsetToRenderedContentStart()); (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.afterNextRender)(() => { this._changeDetectionNeeded.set(false); const runAfterChangeDetection = this._runAfterChangeDetection; this._runAfterChangeDetection = []; for (const fn of runAfterChangeDetection) { fn(); } }, { injector: this._injector }); }); } _calculateSpacerSize() { this._totalContentHeight.set(this.orientation === 'horizontal' ? '' : `${this._totalContentSize}px`); this._totalContentWidth.set(this.orientation === 'horizontal' ? `${this._totalContentSize}px` : ''); } static ɵfac = function CdkVirtualScrollViewport_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CdkVirtualScrollViewport)(); }; static ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({ type: CdkVirtualScrollViewport, selectors: [["cdk-virtual-scroll-viewport"]], viewQuery: function CdkVirtualScrollViewport_Query(rf, ctx) { if (rf & 1) { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵviewQuery"](_c0, 7); } if (rf & 2) { let _t; _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵloadQuery"]()) && (ctx._contentWrapper = _t.first); } }, hostAttrs: [1, "cdk-virtual-scroll-viewport"], hostVars: 4, hostBindings: function CdkVirtualScrollViewport_HostBindings(rf, ctx) { if (rf & 2) { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵclassProp"]("cdk-virtual-scroll-orientation-horizontal", ctx.orientation === "horizontal")("cdk-virtual-scroll-orientation-vertical", ctx.orientation !== "horizontal"); } }, inputs: { orientation: "orientation", appendOnly: [2, "appendOnly", "appendOnly", _angular_core__WEBPACK_IMPORTED_MODULE_2__.booleanAttribute] }, outputs: { scrolledIndexChange: "scrolledIndexChange" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵProvidersFeature"]([{ provide: CdkScrollable, useFactory: () => (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(VIRTUAL_SCROLLABLE, { optional: true }) || (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(CdkVirtualScrollViewport) }, { provide: CDK_VIRTUAL_SCROLL_VIEWPORT, useExisting: CdkVirtualScrollViewport }]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵInheritDefinitionFeature"]], ngContentSelectors: _c1, decls: 4, vars: 4, consts: [["contentWrapper", ""], [1, "cdk-virtual-scroll-content-wrapper"], [1, "cdk-virtual-scroll-spacer"]], template: function CdkVirtualScrollViewport_Template(rf, ctx) { if (rf & 1) { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵprojectionDef"](); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdomElementStart"](0, "div", 1, 0); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵprojection"](2); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdomElementEnd"](); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdomElement"](3, "div", 2); } if (rf & 2) { _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](3); _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵstyleProp"]("width", ctx._totalContentWidth())("height", ctx._totalContentHeight()); } }, styles: ["cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}\n"], encapsulation: 2, changeDetection: 0 }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(CdkVirtualScrollViewport, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Component, args: [{ selector: 'cdk-virtual-scroll-viewport', host: { 'class': 'cdk-virtual-scroll-viewport', '[class.cdk-virtual-scroll-orientation-horizontal]': 'orientation === "horizontal"', '[class.cdk-virtual-scroll-orientation-vertical]': 'orientation !== "horizontal"' }, encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ViewEncapsulation.None, changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ChangeDetectionStrategy.OnPush, providers: [{ provide: CdkScrollable, useFactory: () => (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(VIRTUAL_SCROLLABLE, { optional: true }) || (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(CdkVirtualScrollViewport) }, { provide: CDK_VIRTUAL_SCROLL_VIEWPORT, useExisting: CdkVirtualScrollViewport }], template: "\n
\n \n
\n\n
\n", styles: ["cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}\n"] }] }], () => [], { orientation: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input }], appendOnly: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input, args: [{ transform: _angular_core__WEBPACK_IMPORTED_MODULE_2__.booleanAttribute }] }], scrolledIndexChange: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Output }], _contentWrapper: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewChild, args: ['contentWrapper', { static: true }] }] }); })(); function getOffset(orientation, direction, node) { const el = node; if (!el.getBoundingClientRect) { return 0; } const rect = el.getBoundingClientRect(); if (orientation === 'horizontal') { return direction === 'start' ? rect.left : rect.right; } return direction === 'start' ? rect.top : rect.bottom; } class CdkVirtualForOf { _viewContainerRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.ViewContainerRef); _template = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.TemplateRef); _differs = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.IterableDiffers); _viewRepeater = new _recycle_view_repeater_strategy_chunk_mjs__WEBPACK_IMPORTED_MODULE_23__._RecycleViewRepeaterStrategy(); _viewport = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(CDK_VIRTUAL_SCROLL_VIEWPORT, { skipSelf: true }); viewChange = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); _dataSourceChanges = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); get cdkVirtualForOf() { return this._cdkVirtualForOf; } set cdkVirtualForOf(value) { this._cdkVirtualForOf = value; if ((0,_data_source_chunk_mjs__WEBPACK_IMPORTED_MODULE_24__.isDataSource)(value)) { this._dataSourceChanges.next(value); } else { this._dataSourceChanges.next(new _recycle_view_repeater_strategy_chunk_mjs__WEBPACK_IMPORTED_MODULE_23__.ArrayDataSource((0,rxjs__WEBPACK_IMPORTED_MODULE_8__.isObservable)(value) ? value : Array.from(value || []))); } } _cdkVirtualForOf; get cdkVirtualForTrackBy() { return this._cdkVirtualForTrackBy; } set cdkVirtualForTrackBy(fn) { this._needsUpdate = true; this._cdkVirtualForTrackBy = fn ? (index, item) => fn(index + (this._renderedRange ? this._renderedRange.start : 0), item) : undefined; } _cdkVirtualForTrackBy; set cdkVirtualForTemplate(value) { if (value) { this._needsUpdate = true; this._template = value; } } get cdkVirtualForTemplateCacheSize() { return this._viewRepeater.viewCacheSize; } set cdkVirtualForTemplateCacheSize(size) { this._viewRepeater.viewCacheSize = (0,_element_chunk_mjs__WEBPACK_IMPORTED_MODULE_18__.coerceNumberProperty)(size); } dataStream = this._dataSourceChanges.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_15__.startWith)(null), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.pairwise)(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.switchMap)(([prev, cur]) => this._changeDataSource(prev, cur)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_14__.shareReplay)(1)); _differ = null; _data = []; _renderedItems = []; _renderedRange = { start: 0, end: 0 }; _needsUpdate = false; _destroyed = new rxjs__WEBPACK_IMPORTED_MODULE_4__.Subject(); constructor() { const ngZone = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone); this.dataStream.subscribe(data => { this._data = data; this._onRenderedDataChange(); }); this._viewport.renderedRangeStream.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.takeUntil)(this._destroyed)).subscribe(range => { this._renderedRange = range; if (this.viewChange.observers.length) { ngZone.run(() => this.viewChange.next(this._renderedRange)); } this._onRenderedDataChange(); }); this._viewport.attach(this); } measureRangeSize(range, orientation) { if (range.start >= range.end) { return 0; } if ((range.start < this._renderedRange.start || range.end > this._renderedRange.end) && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw Error(`Error: attempted to measure an item that isn't rendered.`); } const renderedStartIndex = range.start - this._renderedRange.start; const rangeLen = range.end - range.start; let firstNode; let lastNode; for (let i = 0; i < rangeLen; i++) { const view = this._viewContainerRef.get(i + renderedStartIndex); if (view && view.rootNodes.length) { firstNode = lastNode = view.rootNodes[0]; break; } } for (let i = rangeLen - 1; i > -1; i--) { const view = this._viewContainerRef.get(i + renderedStartIndex); if (view && view.rootNodes.length) { lastNode = view.rootNodes[view.rootNodes.length - 1]; break; } } return firstNode && lastNode ? getOffset(orientation, 'end', lastNode) - getOffset(orientation, 'start', firstNode) : 0; } ngDoCheck() { if (this._differ && this._needsUpdate) { const changes = this._differ.diff(this._renderedItems); if (!changes) { this._updateContext(); } else { this._applyChanges(changes); } this._needsUpdate = false; } } ngOnDestroy() { this._viewport.detach(); this._dataSourceChanges.next(undefined); this._dataSourceChanges.complete(); this.viewChange.complete(); this._destroyed.next(); this._destroyed.complete(); this._viewRepeater.detach(); } _onRenderedDataChange() { if (!this._renderedRange) { return; } this._renderedItems = this._data.slice(this._renderedRange.start, this._renderedRange.end); if (!this._differ) { this._differ = this._differs.find(this._renderedItems).create((index, item) => { return this.cdkVirtualForTrackBy ? this.cdkVirtualForTrackBy(index, item) : item; }); } this._needsUpdate = true; } _changeDataSource(oldDs, newDs) { if (oldDs) { oldDs.disconnect(this); } this._needsUpdate = true; return newDs ? newDs.connect(this) : (0,rxjs__WEBPACK_IMPORTED_MODULE_9__.of)(); } _updateContext() { const count = this._data.length; let i = this._viewContainerRef.length; while (i--) { const view = this._viewContainerRef.get(i); view.context.index = this._renderedRange.start + i; view.context.count = count; this._updateComputedContextProperties(view.context); view.detectChanges(); } } _applyChanges(changes) { this._viewRepeater.applyChanges(changes, this._viewContainerRef, (record, _adjustedPreviousIndex, currentIndex) => this._getEmbeddedViewArgs(record, currentIndex), record => record.item); changes.forEachIdentityChange(record => { const view = this._viewContainerRef.get(record.currentIndex); view.context.$implicit = record.item; }); const count = this._data.length; let i = this._viewContainerRef.length; while (i--) { const view = this._viewContainerRef.get(i); view.context.index = this._renderedRange.start + i; view.context.count = count; this._updateComputedContextProperties(view.context); } } _updateComputedContextProperties(context) { context.first = context.index === 0; context.last = context.index === context.count - 1; context.even = context.index % 2 === 0; context.odd = !context.even; } _getEmbeddedViewArgs(record, index) { return { templateRef: this._template, context: { $implicit: record.item, cdkVirtualForOf: this._cdkVirtualForOf, index: -1, count: -1, first: false, last: false, odd: false, even: false }, index }; } static ngTemplateContextGuard(directive, context) { return true; } static ɵfac = function CdkVirtualForOf_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CdkVirtualForOf)(); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ type: CdkVirtualForOf, selectors: [["", "cdkVirtualFor", "", "cdkVirtualForOf", ""]], inputs: { cdkVirtualForOf: "cdkVirtualForOf", cdkVirtualForTrackBy: "cdkVirtualForTrackBy", cdkVirtualForTemplate: "cdkVirtualForTemplate", cdkVirtualForTemplateCacheSize: "cdkVirtualForTemplateCacheSize" } }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(CdkVirtualForOf, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Directive, args: [{ selector: '[cdkVirtualFor][cdkVirtualForOf]' }] }], () => [], { cdkVirtualForOf: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input }], cdkVirtualForTrackBy: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input }], cdkVirtualForTemplate: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input }], cdkVirtualForTemplateCacheSize: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input }] }); })(); class CdkVirtualScrollableElement extends CdkVirtualScrollable { constructor() { super(); } measureBoundingClientRectWithScrollOffset(from) { return this.getElementRef().nativeElement.getBoundingClientRect()[from] - this.measureScrollOffset(from); } static ɵfac = function CdkVirtualScrollableElement_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CdkVirtualScrollableElement)(); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ type: CdkVirtualScrollableElement, selectors: [["", "cdkVirtualScrollingElement", ""]], hostAttrs: [1, "cdk-virtual-scrollable"], features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵProvidersFeature"]([{ provide: VIRTUAL_SCROLLABLE, useExisting: CdkVirtualScrollableElement }]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵInheritDefinitionFeature"]] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(CdkVirtualScrollableElement, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Directive, args: [{ selector: '[cdkVirtualScrollingElement]', providers: [{ provide: VIRTUAL_SCROLLABLE, useExisting: CdkVirtualScrollableElement }], host: { 'class': 'cdk-virtual-scrollable' } }] }], () => [], null); })(); class CdkVirtualScrollableWindow extends CdkVirtualScrollable { constructor() { super(); const document = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT); this.elementRef = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef(document.documentElement); this._scrollElement = document; } measureBoundingClientRectWithScrollOffset(from) { return this.getElementRef().nativeElement.getBoundingClientRect()[from]; } static ɵfac = function CdkVirtualScrollableWindow_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CdkVirtualScrollableWindow)(); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ type: CdkVirtualScrollableWindow, selectors: [["cdk-virtual-scroll-viewport", "scrollWindow", ""]], features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵProvidersFeature"]([{ provide: VIRTUAL_SCROLLABLE, useExisting: CdkVirtualScrollableWindow }]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵInheritDefinitionFeature"]] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(CdkVirtualScrollableWindow, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Directive, args: [{ selector: 'cdk-virtual-scroll-viewport[scrollWindow]', providers: [{ provide: VIRTUAL_SCROLLABLE, useExisting: CdkVirtualScrollableWindow }] }] }], () => [], null); })(); class CdkScrollableModule { static ɵfac = function CdkScrollableModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CdkScrollableModule)(); }; static ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ type: CdkScrollableModule }); static ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({}); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(CdkScrollableModule, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgModule, args: [{ exports: [CdkScrollable], imports: [CdkScrollable] }] }], null, null); })(); class ScrollingModule { static ɵfac = function ScrollingModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ScrollingModule)(); }; static ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ type: ScrollingModule }); static ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({ imports: [_bidi_mjs__WEBPACK_IMPORTED_MODULE_22__.BidiModule, CdkScrollableModule, _bidi_mjs__WEBPACK_IMPORTED_MODULE_22__.BidiModule, CdkScrollableModule] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(ScrollingModule, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgModule, args: [{ imports: [_bidi_mjs__WEBPACK_IMPORTED_MODULE_22__.BidiModule, CdkScrollableModule, CdkVirtualScrollViewport, CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollableWindow, CdkVirtualScrollableElement], exports: [_bidi_mjs__WEBPACK_IMPORTED_MODULE_22__.BidiModule, CdkScrollableModule, CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport, CdkVirtualScrollableWindow, CdkVirtualScrollableElement] }] }], null, null); })(); /***/ }, /***/ 32229 /*!************************************************************************!*\ !*** ./node_modules/@angular/common/fesm2022/_common_module-chunk.mjs ***! \************************************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AsyncPipe: () => (/* binding */ AsyncPipe), /* harmony export */ CommonModule: () => (/* binding */ CommonModule), /* harmony export */ CurrencyPipe: () => (/* binding */ CurrencyPipe), /* harmony export */ DATE_PIPE_DEFAULT_OPTIONS: () => (/* binding */ DATE_PIPE_DEFAULT_OPTIONS), /* harmony export */ DATE_PIPE_DEFAULT_TIMEZONE: () => (/* binding */ DATE_PIPE_DEFAULT_TIMEZONE), /* harmony export */ DatePipe: () => (/* binding */ DatePipe), /* harmony export */ DecimalPipe: () => (/* binding */ DecimalPipe), /* harmony export */ FormStyle: () => (/* binding */ FormStyle), /* harmony export */ FormatWidth: () => (/* binding */ FormatWidth), /* harmony export */ HashLocationStrategy: () => (/* binding */ HashLocationStrategy), /* harmony export */ I18nPluralPipe: () => (/* binding */ I18nPluralPipe), /* harmony export */ I18nSelectPipe: () => (/* binding */ I18nSelectPipe), /* harmony export */ JsonPipe: () => (/* binding */ JsonPipe), /* harmony export */ KeyValuePipe: () => (/* binding */ KeyValuePipe), /* harmony export */ LowerCasePipe: () => (/* binding */ LowerCasePipe), /* harmony export */ NgClass: () => (/* binding */ NgClass), /* harmony export */ NgComponentOutlet: () => (/* binding */ NgComponentOutlet), /* harmony export */ NgForOf: () => (/* binding */ NgForOf), /* harmony export */ NgForOfContext: () => (/* binding */ NgForOfContext), /* harmony export */ NgIf: () => (/* binding */ NgIf), /* harmony export */ NgIfContext: () => (/* binding */ NgIfContext), /* harmony export */ NgLocaleLocalization: () => (/* binding */ NgLocaleLocalization), /* harmony export */ NgLocalization: () => (/* binding */ NgLocalization), /* harmony export */ NgPlural: () => (/* binding */ NgPlural), /* harmony export */ NgPluralCase: () => (/* binding */ NgPluralCase), /* harmony export */ NgStyle: () => (/* binding */ NgStyle), /* harmony export */ NgSwitch: () => (/* binding */ NgSwitch), /* harmony export */ NgSwitchCase: () => (/* binding */ NgSwitchCase), /* harmony export */ NgSwitchDefault: () => (/* binding */ NgSwitchDefault), /* harmony export */ NgTemplateOutlet: () => (/* binding */ NgTemplateOutlet), /* harmony export */ NumberFormatStyle: () => (/* binding */ NumberFormatStyle), /* harmony export */ NumberSymbol: () => (/* binding */ NumberSymbol), /* harmony export */ PercentPipe: () => (/* binding */ PercentPipe), /* harmony export */ Plural: () => (/* binding */ Plural), /* harmony export */ SlicePipe: () => (/* binding */ SlicePipe), /* harmony export */ TitleCasePipe: () => (/* binding */ TitleCasePipe), /* harmony export */ TranslationWidth: () => (/* binding */ TranslationWidth), /* harmony export */ UpperCasePipe: () => (/* binding */ UpperCasePipe), /* harmony export */ WeekDay: () => (/* binding */ WeekDay), /* harmony export */ formatCurrency: () => (/* binding */ formatCurrency), /* harmony export */ formatDate: () => (/* binding */ formatDate), /* harmony export */ formatNumber: () => (/* binding */ formatNumber), /* harmony export */ formatPercent: () => (/* binding */ formatPercent), /* harmony export */ getCurrencySymbol: () => (/* binding */ getCurrencySymbol), /* harmony export */ getLocaleCurrencyCode: () => (/* binding */ getLocaleCurrencyCode), /* harmony export */ getLocaleCurrencyName: () => (/* binding */ getLocaleCurrencyName), /* harmony export */ getLocaleCurrencySymbol: () => (/* binding */ getLocaleCurrencySymbol), /* harmony export */ getLocaleDateFormat: () => (/* binding */ getLocaleDateFormat), /* harmony export */ getLocaleDateTimeFormat: () => (/* binding */ getLocaleDateTimeFormat), /* harmony export */ getLocaleDayNames: () => (/* binding */ getLocaleDayNames), /* harmony export */ getLocaleDayPeriods: () => (/* binding */ getLocaleDayPeriods), /* harmony export */ getLocaleDirection: () => (/* binding */ getLocaleDirection), /* harmony export */ getLocaleEraNames: () => (/* binding */ getLocaleEraNames), /* harmony export */ getLocaleExtraDayPeriodRules: () => (/* binding */ getLocaleExtraDayPeriodRules), /* harmony export */ getLocaleExtraDayPeriods: () => (/* binding */ getLocaleExtraDayPeriods), /* harmony export */ getLocaleFirstDayOfWeek: () => (/* binding */ getLocaleFirstDayOfWeek), /* harmony export */ getLocaleId: () => (/* binding */ getLocaleId), /* harmony export */ getLocaleMonthNames: () => (/* binding */ getLocaleMonthNames), /* harmony export */ getLocaleNumberFormat: () => (/* binding */ getLocaleNumberFormat), /* harmony export */ getLocaleNumberSymbol: () => (/* binding */ getLocaleNumberSymbol), /* harmony export */ getLocalePluralCase: () => (/* binding */ getLocalePluralCase), /* harmony export */ getLocaleTimeFormat: () => (/* binding */ getLocaleTimeFormat), /* harmony export */ getLocaleWeekEndRange: () => (/* binding */ getLocaleWeekEndRange), /* harmony export */ getNumberOfCurrencyDigits: () => (/* binding */ getNumberOfCurrencyDigits) /* harmony export */ }); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 36973); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 40072); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 14975); /* harmony import */ var _location_chunk_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_location-chunk.mjs */ 25180); /* harmony import */ var _platform_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./_platform_location-chunk.mjs */ 51490); /** * @license Angular v21.1.2 * (c) 2010-2026 Google LLC. https://angular.dev/ * License: MIT */ class HashLocationStrategy extends _location_chunk_mjs__WEBPACK_IMPORTED_MODULE_3__.LocationStrategy { _platformLocation; _baseHref = ''; _removeListenerFns = []; constructor(_platformLocation, _baseHref) { super(); this._platformLocation = _platformLocation; if (_baseHref != null) { this._baseHref = _baseHref; } } ngOnDestroy() { while (this._removeListenerFns.length) { this._removeListenerFns.pop()(); } } onPopState(fn) { this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn)); } getBaseHref() { return this._baseHref; } path(includeHash = false) { const path = this._platformLocation.hash ?? '#'; return path.length > 0 ? path.substring(1) : path; } prepareExternalUrl(internal) { const url = (0,_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_3__.joinWithSlash)(this._baseHref, internal); return url.length > 0 ? '#' + url : url; } pushState(state, title, path, queryParams) { const url = this.prepareExternalUrl(path + (0,_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_3__.normalizeQueryParams)(queryParams)) || this._platformLocation.pathname; this._platformLocation.pushState(state, title, url); } replaceState(state, title, path, queryParams) { const url = this.prepareExternalUrl(path + (0,_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_3__.normalizeQueryParams)(queryParams)) || this._platformLocation.pathname; this._platformLocation.replaceState(state, title, url); } forward() { this._platformLocation.forward(); } back() { this._platformLocation.back(); } getState() { return this._platformLocation.getState(); } historyGo(relativePosition = 0) { this._platformLocation.historyGo?.(relativePosition); } static ɵfac = function HashLocationStrategy_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HashLocationStrategy)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_platform_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_4__.PlatformLocation), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_3__.APP_BASE_HREF, 8)); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: HashLocationStrategy, factory: HashLocationStrategy.ɵfac }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(HashLocationStrategy, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Injectable }], () => [{ type: _platform_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_4__.PlatformLocation }, { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Optional }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject, args: [_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_3__.APP_BASE_HREF] }] }], null); })(); const CURRENCIES_EN = { "ADP": [undefined, undefined, 0], "AFN": [undefined, "؋", 0], "ALL": [undefined, undefined, 0], "AMD": [undefined, "֏", 2], "AOA": [undefined, "Kz"], "ARS": [undefined, "$"], "AUD": ["A$", "$"], "AZN": [undefined, "₼"], "BAM": [undefined, "KM"], "BBD": [undefined, "$"], "BDT": [undefined, "৳"], "BHD": [undefined, undefined, 3], "BIF": [undefined, undefined, 0], "BMD": [undefined, "$"], "BND": [undefined, "$"], "BOB": [undefined, "Bs"], "BRL": ["R$"], "BSD": [undefined, "$"], "BWP": [undefined, "P"], "BYN": [undefined, undefined, 2], "BYR": [undefined, undefined, 0], "BZD": [undefined, "$"], "CAD": ["CA$", "$", 2], "CHF": [undefined, undefined, 2], "CLF": [undefined, undefined, 4], "CLP": [undefined, "$", 0], "CNY": ["CN¥", "¥"], "COP": [undefined, "$", 2], "CRC": [undefined, "₡", 2], "CUC": [undefined, "$"], "CUP": [undefined, "$"], "CZK": [undefined, "Kč", 2], "DJF": [undefined, undefined, 0], "DKK": [undefined, "kr", 2], "DOP": [undefined, "$"], "EGP": [undefined, "E£"], "ESP": [undefined, "₧", 0], "EUR": ["€"], "FJD": [undefined, "$"], "FKP": [undefined, "£"], "GBP": ["£"], "GEL": [undefined, "₾"], "GHS": [undefined, "GH₵"], "GIP": [undefined, "£"], "GNF": [undefined, "FG", 0], "GTQ": [undefined, "Q"], "GYD": [undefined, "$", 2], "HKD": ["HK$", "$"], "HNL": [undefined, "L"], "HRK": [undefined, "kn"], "HUF": [undefined, "Ft", 2], "IDR": [undefined, "Rp", 2], "ILS": ["₪"], "INR": ["₹"], "IQD": [undefined, undefined, 0], "IRR": [undefined, undefined, 0], "ISK": [undefined, "kr", 0], "ITL": [undefined, undefined, 0], "JMD": [undefined, "$"], "JOD": [undefined, undefined, 3], "JPY": ["¥", undefined, 0], "KGS": [undefined, "⃀"], "KHR": [undefined, "៛"], "KMF": [undefined, "CF", 0], "KPW": [undefined, "₩", 0], "KRW": ["₩", undefined, 0], "KWD": [undefined, undefined, 3], "KYD": [undefined, "$"], "KZT": [undefined, "₸"], "LAK": [undefined, "₭", 0], "LBP": [undefined, "L£", 0], "LKR": [undefined, "Rs"], "LRD": [undefined, "$"], "LTL": [undefined, "Lt"], "LUF": [undefined, undefined, 0], "LVL": [undefined, "Ls"], "LYD": [undefined, undefined, 3], "MGA": [undefined, "Ar", 0], "MGF": [undefined, undefined, 0], "MMK": [undefined, "K", 0], "MNT": [undefined, "₮", 2], "MRO": [undefined, undefined, 0], "MUR": [undefined, "Rs", 2], "MXN": ["MX$", "$"], "MYR": [undefined, "RM"], "NAD": [undefined, "$"], "NGN": [undefined, "₦"], "NIO": [undefined, "C$"], "NOK": [undefined, "kr", 2], "NPR": [undefined, "Rs"], "NZD": ["NZ$", "$"], "OMR": [undefined, undefined, 3], "PHP": ["₱"], "PKR": [undefined, "Rs", 2], "PLN": [undefined, "zł"], "PYG": [undefined, "₲", 0], "RON": [undefined, "lei"], "RSD": [undefined, undefined, 0], "RUB": [undefined, "₽"], "RWF": [undefined, "RF", 0], "SBD": [undefined, "$"], "SEK": [undefined, "kr", 2], "SGD": [undefined, "$"], "SHP": [undefined, "£"], "SLE": [undefined, undefined, 2], "SLL": [undefined, undefined, 0], "SOS": [undefined, undefined, 0], "SRD": [undefined, "$"], "SSP": [undefined, "£"], "STD": [undefined, undefined, 0], "STN": [undefined, "Db"], "SYP": [undefined, "£", 0], "THB": [undefined, "฿"], "TMM": [undefined, undefined, 0], "TND": [undefined, undefined, 3], "TOP": [undefined, "T$"], "TRL": [undefined, undefined, 0], "TRY": [undefined, "₺"], "TTD": [undefined, "$"], "TWD": ["NT$", "$", 2], "TZS": [undefined, undefined, 2], "UAH": [undefined, "₴"], "UGX": [undefined, undefined, 0], "USD": ["$"], "UYI": [undefined, undefined, 0], "UYU": [undefined, "$"], "UYW": [undefined, undefined, 4], "UZS": [undefined, undefined, 2], "VEF": [undefined, "Bs", 2], "VND": ["₫", undefined, 0], "VUV": [undefined, undefined, 0], "XAF": ["FCFA", undefined, 0], "XCD": ["EC$", "$"], "XCG": ["Cg."], "XOF": ["F CFA", undefined, 0], "XPF": ["CFPF", undefined, 0], "XXX": ["¤"], "YER": [undefined, undefined, 0], "ZAR": [undefined, "R"], "ZMK": [undefined, undefined, 0], "ZMW": [undefined, "ZK"], "ZWD": [undefined, undefined, 0] }; var NumberFormatStyle; (function (NumberFormatStyle) { NumberFormatStyle[NumberFormatStyle["Decimal"] = 0] = "Decimal"; NumberFormatStyle[NumberFormatStyle["Percent"] = 1] = "Percent"; NumberFormatStyle[NumberFormatStyle["Currency"] = 2] = "Currency"; NumberFormatStyle[NumberFormatStyle["Scientific"] = 3] = "Scientific"; })(NumberFormatStyle || (NumberFormatStyle = {})); var Plural; (function (Plural) { Plural[Plural["Zero"] = 0] = "Zero"; Plural[Plural["One"] = 1] = "One"; Plural[Plural["Two"] = 2] = "Two"; Plural[Plural["Few"] = 3] = "Few"; Plural[Plural["Many"] = 4] = "Many"; Plural[Plural["Other"] = 5] = "Other"; })(Plural || (Plural = {})); var FormStyle; (function (FormStyle) { FormStyle[FormStyle["Format"] = 0] = "Format"; FormStyle[FormStyle["Standalone"] = 1] = "Standalone"; })(FormStyle || (FormStyle = {})); var TranslationWidth; (function (TranslationWidth) { TranslationWidth[TranslationWidth["Narrow"] = 0] = "Narrow"; TranslationWidth[TranslationWidth["Abbreviated"] = 1] = "Abbreviated"; TranslationWidth[TranslationWidth["Wide"] = 2] = "Wide"; TranslationWidth[TranslationWidth["Short"] = 3] = "Short"; })(TranslationWidth || (TranslationWidth = {})); var FormatWidth; (function (FormatWidth) { FormatWidth[FormatWidth["Short"] = 0] = "Short"; FormatWidth[FormatWidth["Medium"] = 1] = "Medium"; FormatWidth[FormatWidth["Long"] = 2] = "Long"; FormatWidth[FormatWidth["Full"] = 3] = "Full"; })(FormatWidth || (FormatWidth = {})); const NumberSymbol = { Decimal: 0, Group: 1, List: 2, PercentSign: 3, PlusSign: 4, MinusSign: 5, Exponential: 6, SuperscriptingExponent: 7, PerMille: 8, Infinity: 9, NaN: 10, TimeSeparator: 11, CurrencyDecimal: 12, CurrencyGroup: 13 }; var WeekDay; (function (WeekDay) { WeekDay[WeekDay["Sunday"] = 0] = "Sunday"; WeekDay[WeekDay["Monday"] = 1] = "Monday"; WeekDay[WeekDay["Tuesday"] = 2] = "Tuesday"; WeekDay[WeekDay["Wednesday"] = 3] = "Wednesday"; WeekDay[WeekDay["Thursday"] = 4] = "Thursday"; WeekDay[WeekDay["Friday"] = 5] = "Friday"; WeekDay[WeekDay["Saturday"] = 6] = "Saturday"; })(WeekDay || (WeekDay = {})); function getLocaleId(locale) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.findLocaleData)(locale)[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.LocaleId]; } function getLocaleDayPeriods(locale, formStyle, width) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.findLocaleData)(locale); const amPmData = [data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.DayPeriodsFormat], data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.DayPeriodsStandalone]]; const amPm = getLastDefinedValue(amPmData, formStyle); return getLastDefinedValue(amPm, width); } function getLocaleDayNames(locale, formStyle, width) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.findLocaleData)(locale); const daysData = [data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.DaysFormat], data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.DaysStandalone]]; const days = getLastDefinedValue(daysData, formStyle); return getLastDefinedValue(days, width); } function getLocaleMonthNames(locale, formStyle, width) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.findLocaleData)(locale); const monthsData = [data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.MonthsFormat], data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.MonthsStandalone]]; const months = getLastDefinedValue(monthsData, formStyle); return getLastDefinedValue(months, width); } function getLocaleEraNames(locale, width) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.findLocaleData)(locale); const erasData = data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.Eras]; return getLastDefinedValue(erasData, width); } function getLocaleFirstDayOfWeek(locale) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.findLocaleData)(locale); return data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.FirstDayOfWeek]; } function getLocaleWeekEndRange(locale) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.findLocaleData)(locale); return data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.WeekendRange]; } function getLocaleDateFormat(locale, width) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.findLocaleData)(locale); return getLastDefinedValue(data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.DateFormat], width); } function getLocaleTimeFormat(locale, width) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.findLocaleData)(locale); return getLastDefinedValue(data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.TimeFormat], width); } function getLocaleDateTimeFormat(locale, width) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.findLocaleData)(locale); const dateTimeFormatData = data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.DateTimeFormat]; return getLastDefinedValue(dateTimeFormatData, width); } function getLocaleNumberSymbol(locale, symbol) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.findLocaleData)(locale); const res = data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.NumberSymbols][symbol]; if (typeof res === 'undefined') { if (symbol === NumberSymbol.CurrencyDecimal) { return data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.NumberSymbols][NumberSymbol.Decimal]; } else if (symbol === NumberSymbol.CurrencyGroup) { return data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.NumberSymbols][NumberSymbol.Group]; } } return res; } function getLocaleNumberFormat(locale, type) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.findLocaleData)(locale); return data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.NumberFormats][type]; } function getLocaleCurrencySymbol(locale) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.findLocaleData)(locale); return data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.CurrencySymbol] || null; } function getLocaleCurrencyName(locale) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.findLocaleData)(locale); return data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.CurrencyName] || null; } function getLocaleCurrencyCode(locale) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.getLocaleCurrencyCode)(locale); } function getLocaleCurrencies(locale) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.findLocaleData)(locale); return data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.Currencies]; } const getLocalePluralCase = _angular_core__WEBPACK_IMPORTED_MODULE_2__.getLocalePluralCase; function checkFullData(data) { if (!data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.ExtraData]) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2303, ngDevMode && `Missing extra locale data for the locale "${data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`); } } function getLocaleExtraDayPeriodRules(locale) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.findLocaleData)(locale); checkFullData(data); const rules = data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.ExtraData][2] || []; return rules.map(rule => { if (typeof rule === 'string') { return extractTime(rule); } return [extractTime(rule[0]), extractTime(rule[1])]; }); } function getLocaleExtraDayPeriods(locale, formStyle, width) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.findLocaleData)(locale); checkFullData(data); const dayPeriodsData = [data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.ExtraData][0], data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.ExtraData][1]]; const dayPeriods = getLastDefinedValue(dayPeriodsData, formStyle) || []; return getLastDefinedValue(dayPeriods, width) || []; } function getLocaleDirection(locale) { const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.findLocaleData)(locale); return data[_angular_core__WEBPACK_IMPORTED_MODULE_2__.LocaleDataIndex.Directionality]; } function getLastDefinedValue(data, index) { for (let i = index; i > -1; i--) { if (typeof data[i] !== 'undefined') { return data[i]; } } throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2304, ngDevMode && 'Locale data API: locale data undefined'); } function extractTime(time) { const [h, m] = time.split(':'); return { hours: +h, minutes: +m }; } function getCurrencySymbol(code, format, locale = 'en') { const currency = getLocaleCurrencies(locale)[code] || CURRENCIES_EN[code] || []; const symbolNarrow = currency[1]; if (format === 'narrow' && typeof symbolNarrow === 'string') { return symbolNarrow; } return currency[0] || code; } const DEFAULT_NB_OF_CURRENCY_DIGITS = 2; function getNumberOfCurrencyDigits(code) { let digits; const currency = CURRENCIES_EN[code]; if (currency) { digits = currency[2]; } return typeof digits === 'number' ? digits : DEFAULT_NB_OF_CURRENCY_DIGITS; } const ISO8601_DATE_REGEX = /^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/; const NAMED_FORMATS = {}; const DATE_FORMATS_SPLIT = /((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/; function formatDate(value, format, locale, timezone) { let date = toDate(value); const namedFormat = getNamedFormat(locale, format); format = namedFormat || format; let parts = []; let match; while (format) { match = DATE_FORMATS_SPLIT.exec(format); if (match) { parts = parts.concat(match.slice(1)); const part = parts.pop(); if (!part) { break; } format = part; } else { parts.push(format); break; } } if (typeof ngDevMode === 'undefined' || ngDevMode) { assertValidDateFormat(parts); } let dateTimezoneOffset = date.getTimezoneOffset(); if (timezone) { dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset); date = convertTimezoneToLocal(date, timezone); } let text = ''; parts.forEach(value => { const dateFormatter = getDateFormatter(value); text += dateFormatter ? dateFormatter(date, locale, dateTimezoneOffset) : value === "''" ? "'" : value.replace(/(^'|'$)/g, '').replace(/''/g, "'"); }); return text; } function assertValidDateFormat(parts) { if (parts.some(part => /^Y+$/.test(part)) && !parts.some(part => /^w+$/.test(part))) { const message = `Suspicious use of week-based year "Y" in date pattern "${parts.join('')}". Did you mean to use calendar year "y" instead?`; if (parts.length === 1) { console.error((0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.formatRuntimeError)(2300, message)); } else { throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2300, message); } } } function createDate(year, month, date) { const newDate = new Date(0); newDate.setFullYear(year, month, date); newDate.setHours(0, 0, 0); return newDate; } function getNamedFormat(locale, format) { const localeId = getLocaleId(locale); NAMED_FORMATS[localeId] ??= {}; if (NAMED_FORMATS[localeId][format]) { return NAMED_FORMATS[localeId][format]; } let formatValue = ''; switch (format) { case 'shortDate': formatValue = getLocaleDateFormat(locale, FormatWidth.Short); break; case 'mediumDate': formatValue = getLocaleDateFormat(locale, FormatWidth.Medium); break; case 'longDate': formatValue = getLocaleDateFormat(locale, FormatWidth.Long); break; case 'fullDate': formatValue = getLocaleDateFormat(locale, FormatWidth.Full); break; case 'shortTime': formatValue = getLocaleTimeFormat(locale, FormatWidth.Short); break; case 'mediumTime': formatValue = getLocaleTimeFormat(locale, FormatWidth.Medium); break; case 'longTime': formatValue = getLocaleTimeFormat(locale, FormatWidth.Long); break; case 'fullTime': formatValue = getLocaleTimeFormat(locale, FormatWidth.Full); break; case 'short': const shortTime = getNamedFormat(locale, 'shortTime'); const shortDate = getNamedFormat(locale, 'shortDate'); formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Short), [shortTime, shortDate]); break; case 'medium': const mediumTime = getNamedFormat(locale, 'mediumTime'); const mediumDate = getNamedFormat(locale, 'mediumDate'); formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Medium), [mediumTime, mediumDate]); break; case 'long': const longTime = getNamedFormat(locale, 'longTime'); const longDate = getNamedFormat(locale, 'longDate'); formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Long), [longTime, longDate]); break; case 'full': const fullTime = getNamedFormat(locale, 'fullTime'); const fullDate = getNamedFormat(locale, 'fullDate'); formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Full), [fullTime, fullDate]); break; } if (formatValue) { NAMED_FORMATS[localeId][format] = formatValue; } return formatValue; } function formatDateTime(str, opt_values) { if (opt_values) { str = str.replace(/\{([^}]+)}/g, function (match, key) { return opt_values != null && key in opt_values ? opt_values[key] : match; }); } return str; } function padNumber(num, digits, minusSign = '-', trim, negWrap) { let neg = ''; if (num < 0 || negWrap && num <= 0) { if (negWrap) { num = -num + 1; } else { num = -num; neg = minusSign; } } let strNum = String(num); while (strNum.length < digits) { strNum = '0' + strNum; } if (trim) { strNum = strNum.slice(strNum.length - digits); } return neg + strNum; } function formatFractionalSeconds(milliseconds, digits) { const strMs = padNumber(milliseconds, 3); return strMs.substring(0, digits); } function dateGetter(name, size, offset = 0, trim = false, negWrap = false) { return function (date, locale) { let part = getDatePart(name, date); if (offset > 0 || part > -offset) { part += offset; } if (name === 3) { if (part === 0 && offset === -12) { part = 12; } } else if (name === 6) { return formatFractionalSeconds(part, size); } const localeMinus = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign); return padNumber(part, size, localeMinus, trim, negWrap); }; } function getDatePart(part, date) { switch (part) { case 0: return date.getFullYear(); case 1: return date.getMonth(); case 2: return date.getDate(); case 3: return date.getHours(); case 4: return date.getMinutes(); case 5: return date.getSeconds(); case 6: return date.getMilliseconds(); case 7: return date.getDay(); default: throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2301, ngDevMode && `Unknown DateType value "${part}".`); } } function dateStrGetter(name, width, form = FormStyle.Format, extended = false) { return function (date, locale) { return getDateTranslation(date, locale, name, width, form, extended); }; } function getDateTranslation(date, locale, name, width, form, extended) { switch (name) { case 2: return getLocaleMonthNames(locale, form, width)[date.getMonth()]; case 1: return getLocaleDayNames(locale, form, width)[date.getDay()]; case 0: const currentHours = date.getHours(); const currentMinutes = date.getMinutes(); if (extended) { const rules = getLocaleExtraDayPeriodRules(locale); const dayPeriods = getLocaleExtraDayPeriods(locale, form, width); const index = rules.findIndex(rule => { if (Array.isArray(rule)) { const [from, to] = rule; const afterFrom = currentHours >= from.hours && currentMinutes >= from.minutes; const beforeTo = currentHours < to.hours || currentHours === to.hours && currentMinutes < to.minutes; if (from.hours < to.hours) { if (afterFrom && beforeTo) { return true; } } else if (afterFrom || beforeTo) { return true; } } else { if (rule.hours === currentHours && rule.minutes === currentMinutes) { return true; } } return false; }); if (index !== -1) { return dayPeriods[index]; } } return getLocaleDayPeriods(locale, form, width)[currentHours < 12 ? 0 : 1]; case 3: return getLocaleEraNames(locale, width)[date.getFullYear() <= 0 ? 0 : 1]; default: const unexpected = name; throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2302, ngDevMode && `unexpected translation type ${unexpected}`); } } function timeZoneGetter(width) { return function (date, locale, offset) { const zone = -1 * offset; const minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign); const hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60); switch (width) { case 0: return (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + padNumber(Math.abs(zone % 60), 2, minusSign); case 1: return 'GMT' + (zone >= 0 ? '+' : '') + padNumber(hours, 1, minusSign); case 2: return 'GMT' + (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + ':' + padNumber(Math.abs(zone % 60), 2, minusSign); case 3: if (offset === 0) { return 'Z'; } else { return (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + ':' + padNumber(Math.abs(zone % 60), 2, minusSign); } default: throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2310, ngDevMode && `Unknown zone width "${width}"`); } }; } const JANUARY = 0; const THURSDAY = 4; function getFirstThursdayOfYear(year) { const firstDayOfYear = createDate(year, JANUARY, 1).getDay(); return createDate(year, 0, 1 + (firstDayOfYear <= THURSDAY ? THURSDAY : THURSDAY + 7) - firstDayOfYear); } function getThursdayThisIsoWeek(datetime) { const currentDay = datetime.getDay(); const deltaToThursday = currentDay === 0 ? -3 : THURSDAY - currentDay; return createDate(datetime.getFullYear(), datetime.getMonth(), datetime.getDate() + deltaToThursday); } function weekGetter(size, monthBased = false) { return function (date, locale) { let result; if (monthBased) { const nbDaysBefore1stDayOfMonth = new Date(date.getFullYear(), date.getMonth(), 1).getDay() - 1; const today = date.getDate(); result = 1 + Math.floor((today + nbDaysBefore1stDayOfMonth) / 7); } else { const thisThurs = getThursdayThisIsoWeek(date); const firstThurs = getFirstThursdayOfYear(thisThurs.getFullYear()); const diff = thisThurs.getTime() - firstThurs.getTime(); result = 1 + Math.round(diff / 6.048e8); } return padNumber(result, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign)); }; } function weekNumberingYearGetter(size, trim = false) { return function (date, locale) { const thisThurs = getThursdayThisIsoWeek(date); const weekNumberingYear = thisThurs.getFullYear(); return padNumber(weekNumberingYear, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign), trim); }; } const DATE_FORMATS = {}; function getDateFormatter(format) { if (DATE_FORMATS[format]) { return DATE_FORMATS[format]; } let formatter; switch (format) { case 'G': case 'GG': case 'GGG': formatter = dateStrGetter(3, TranslationWidth.Abbreviated); break; case 'GGGG': formatter = dateStrGetter(3, TranslationWidth.Wide); break; case 'GGGGG': formatter = dateStrGetter(3, TranslationWidth.Narrow); break; case 'y': formatter = dateGetter(0, 1, 0, false, true); break; case 'yy': formatter = dateGetter(0, 2, 0, true, true); break; case 'yyy': formatter = dateGetter(0, 3, 0, false, true); break; case 'yyyy': formatter = dateGetter(0, 4, 0, false, true); break; case 'Y': formatter = weekNumberingYearGetter(1); break; case 'YY': formatter = weekNumberingYearGetter(2, true); break; case 'YYY': formatter = weekNumberingYearGetter(3); break; case 'YYYY': formatter = weekNumberingYearGetter(4); break; case 'M': case 'L': formatter = dateGetter(1, 1, 1); break; case 'MM': case 'LL': formatter = dateGetter(1, 2, 1); break; case 'MMM': formatter = dateStrGetter(2, TranslationWidth.Abbreviated); break; case 'MMMM': formatter = dateStrGetter(2, TranslationWidth.Wide); break; case 'MMMMM': formatter = dateStrGetter(2, TranslationWidth.Narrow); break; case 'LLL': formatter = dateStrGetter(2, TranslationWidth.Abbreviated, FormStyle.Standalone); break; case 'LLLL': formatter = dateStrGetter(2, TranslationWidth.Wide, FormStyle.Standalone); break; case 'LLLLL': formatter = dateStrGetter(2, TranslationWidth.Narrow, FormStyle.Standalone); break; case 'w': formatter = weekGetter(1); break; case 'ww': formatter = weekGetter(2); break; case 'W': formatter = weekGetter(1, true); break; case 'd': formatter = dateGetter(2, 1); break; case 'dd': formatter = dateGetter(2, 2); break; case 'c': case 'cc': formatter = dateGetter(7, 1); break; case 'ccc': formatter = dateStrGetter(1, TranslationWidth.Abbreviated, FormStyle.Standalone); break; case 'cccc': formatter = dateStrGetter(1, TranslationWidth.Wide, FormStyle.Standalone); break; case 'ccccc': formatter = dateStrGetter(1, TranslationWidth.Narrow, FormStyle.Standalone); break; case 'cccccc': formatter = dateStrGetter(1, TranslationWidth.Short, FormStyle.Standalone); break; case 'E': case 'EE': case 'EEE': formatter = dateStrGetter(1, TranslationWidth.Abbreviated); break; case 'EEEE': formatter = dateStrGetter(1, TranslationWidth.Wide); break; case 'EEEEE': formatter = dateStrGetter(1, TranslationWidth.Narrow); break; case 'EEEEEE': formatter = dateStrGetter(1, TranslationWidth.Short); break; case 'a': case 'aa': case 'aaa': formatter = dateStrGetter(0, TranslationWidth.Abbreviated); break; case 'aaaa': formatter = dateStrGetter(0, TranslationWidth.Wide); break; case 'aaaaa': formatter = dateStrGetter(0, TranslationWidth.Narrow); break; case 'b': case 'bb': case 'bbb': formatter = dateStrGetter(0, TranslationWidth.Abbreviated, FormStyle.Standalone, true); break; case 'bbbb': formatter = dateStrGetter(0, TranslationWidth.Wide, FormStyle.Standalone, true); break; case 'bbbbb': formatter = dateStrGetter(0, TranslationWidth.Narrow, FormStyle.Standalone, true); break; case 'B': case 'BB': case 'BBB': formatter = dateStrGetter(0, TranslationWidth.Abbreviated, FormStyle.Format, true); break; case 'BBBB': formatter = dateStrGetter(0, TranslationWidth.Wide, FormStyle.Format, true); break; case 'BBBBB': formatter = dateStrGetter(0, TranslationWidth.Narrow, FormStyle.Format, true); break; case 'h': formatter = dateGetter(3, 1, -12); break; case 'hh': formatter = dateGetter(3, 2, -12); break; case 'H': formatter = dateGetter(3, 1); break; case 'HH': formatter = dateGetter(3, 2); break; case 'm': formatter = dateGetter(4, 1); break; case 'mm': formatter = dateGetter(4, 2); break; case 's': formatter = dateGetter(5, 1); break; case 'ss': formatter = dateGetter(5, 2); break; case 'S': formatter = dateGetter(6, 1); break; case 'SS': formatter = dateGetter(6, 2); break; case 'SSS': formatter = dateGetter(6, 3); break; case 'Z': case 'ZZ': case 'ZZZ': formatter = timeZoneGetter(0); break; case 'ZZZZZ': formatter = timeZoneGetter(3); break; case 'O': case 'OO': case 'OOO': case 'z': case 'zz': case 'zzz': formatter = timeZoneGetter(1); break; case 'OOOO': case 'ZZZZ': case 'zzzz': formatter = timeZoneGetter(2); break; default: return null; } DATE_FORMATS[format] = formatter; return formatter; } function timezoneToOffset(timezone, fallback) { timezone = timezone.replace(/:/g, ''); const requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000; return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset; } function addDateMinutes(date, minutes) { date = new Date(date.getTime()); date.setMinutes(date.getMinutes() + minutes); return date; } function convertTimezoneToLocal(date, timezone, reverse) { const reverseValue = -1; const dateTimezoneOffset = date.getTimezoneOffset(); const timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset); return addDateMinutes(date, reverseValue * (timezoneOffset - dateTimezoneOffset)); } function toDate(value) { if (isDate(value)) { return value; } if (typeof value === 'number' && !isNaN(value)) { return new Date(value); } if (typeof value === 'string') { value = value.trim(); if (/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(value)) { const [y, m = 1, d = 1] = value.split('-').map(val => +val); return createDate(y, m - 1, d); } const parsedNb = parseFloat(value); if (!isNaN(value - parsedNb)) { return new Date(parsedNb); } let match; if (match = value.match(ISO8601_DATE_REGEX)) { return isoStringToDate(match); } } const date = new Date(value); if (!isDate(date)) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2311, ngDevMode && `Unable to convert "${value}" into a date`); } return date; } function isoStringToDate(match) { const date = new Date(0); let tzHour = 0; let tzMin = 0; const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear; const timeSetter = match[8] ? date.setUTCHours : date.setHours; if (match[9]) { tzHour = Number(match[9] + match[10]); tzMin = Number(match[9] + match[11]); } dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3])); const h = Number(match[4] || 0) - tzHour; const m = Number(match[5] || 0) - tzMin; const s = Number(match[6] || 0); const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000); timeSetter.call(date, h, m, s, ms); return date; } function isDate(value) { return value instanceof Date && !isNaN(value.valueOf()); } const NUMBER_FORMAT_REGEXP = /^(\d+)?\.((\d+)(-(\d+))?)?$/; const MAX_DIGITS = 22; const DECIMAL_SEP = '.'; const ZERO_CHAR = '0'; const PATTERN_SEP = ';'; const GROUP_SEP = ','; const DIGIT_CHAR = '#'; const CURRENCY_CHAR = '¤'; const PERCENT_CHAR = '%'; function formatNumberToLocaleString(value, pattern, locale, groupSymbol, decimalSymbol, digitsInfo, isPercent = false) { let formattedText = ''; let isZero = false; if (!isFinite(value)) { formattedText = getLocaleNumberSymbol(locale, NumberSymbol.Infinity); } else { let parsedNumber = parseNumber(value); if (isPercent) { parsedNumber = toPercent(parsedNumber); } let minInt = pattern.minInt; let minFraction = pattern.minFrac; let maxFraction = pattern.maxFrac; if (digitsInfo) { const parts = digitsInfo.match(NUMBER_FORMAT_REGEXP); if (parts === null) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2306, ngDevMode && `${digitsInfo} is not a valid digit info`); } const minIntPart = parts[1]; const minFractionPart = parts[3]; const maxFractionPart = parts[5]; if (minIntPart != null) { minInt = parseIntAutoRadix(minIntPart); } if (minFractionPart != null) { minFraction = parseIntAutoRadix(minFractionPart); } if (maxFractionPart != null) { maxFraction = parseIntAutoRadix(maxFractionPart); } else if (minFractionPart != null && minFraction > maxFraction) { maxFraction = minFraction; } } roundNumber(parsedNumber, minFraction, maxFraction); let digits = parsedNumber.digits; let integerLen = parsedNumber.integerLen; const exponent = parsedNumber.exponent; let decimals = []; isZero = digits.every(d => !d); for (; integerLen < minInt; integerLen++) { digits.unshift(0); } for (; integerLen < 0; integerLen++) { digits.unshift(0); } if (integerLen > 0) { decimals = digits.splice(integerLen, digits.length); } else { decimals = digits; digits = [0]; } const groups = []; if (digits.length >= pattern.lgSize) { groups.unshift(digits.splice(-pattern.lgSize, digits.length).join('')); } while (digits.length > pattern.gSize) { groups.unshift(digits.splice(-pattern.gSize, digits.length).join('')); } if (digits.length) { groups.unshift(digits.join('')); } formattedText = groups.join(getLocaleNumberSymbol(locale, groupSymbol)); if (decimals.length) { formattedText += getLocaleNumberSymbol(locale, decimalSymbol) + decimals.join(''); } if (exponent) { formattedText += getLocaleNumberSymbol(locale, NumberSymbol.Exponential) + '+' + exponent; } } if (value < 0 && !isZero) { formattedText = pattern.negPre + formattedText + pattern.negSuf; } else { formattedText = pattern.posPre + formattedText + pattern.posSuf; } return formattedText; } function formatCurrency(value, locale, currency, currencyCode, digitsInfo) { const format = getLocaleNumberFormat(locale, NumberFormatStyle.Currency); const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign)); pattern.minFrac = getNumberOfCurrencyDigits(currencyCode); pattern.maxFrac = pattern.minFrac; const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.CurrencyGroup, NumberSymbol.CurrencyDecimal, digitsInfo); return res.replace(CURRENCY_CHAR, currency).replace(CURRENCY_CHAR, '').trim(); } function formatPercent(value, locale, digitsInfo) { const format = getLocaleNumberFormat(locale, NumberFormatStyle.Percent); const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign)); const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo, true); return res.replace(new RegExp(PERCENT_CHAR, 'g'), getLocaleNumberSymbol(locale, NumberSymbol.PercentSign)); } function formatNumber(value, locale, digitsInfo) { const format = getLocaleNumberFormat(locale, NumberFormatStyle.Decimal); const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign)); return formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo); } function parseNumberFormat(format, minusSign = '-') { const p = { minInt: 1, minFrac: 0, maxFrac: 0, posPre: '', posSuf: '', negPre: '', negSuf: '', gSize: 0, lgSize: 0 }; const patternParts = format.split(PATTERN_SEP); const positive = patternParts[0]; const negative = patternParts[1]; const positiveParts = positive.indexOf(DECIMAL_SEP) !== -1 ? positive.split(DECIMAL_SEP) : [positive.substring(0, positive.lastIndexOf(ZERO_CHAR) + 1), positive.substring(positive.lastIndexOf(ZERO_CHAR) + 1)], integer = positiveParts[0], fraction = positiveParts[1] || ''; p.posPre = integer.substring(0, integer.indexOf(DIGIT_CHAR)); for (let i = 0; i < fraction.length; i++) { const ch = fraction.charAt(i); if (ch === ZERO_CHAR) { p.minFrac = p.maxFrac = i + 1; } else if (ch === DIGIT_CHAR) { p.maxFrac = i + 1; } else { p.posSuf += ch; } } const groups = integer.split(GROUP_SEP); p.gSize = groups[1] ? groups[1].length : 0; p.lgSize = groups[2] || groups[1] ? (groups[2] || groups[1]).length : 0; if (negative) { const trunkLen = positive.length - p.posPre.length - p.posSuf.length, pos = negative.indexOf(DIGIT_CHAR); p.negPre = negative.substring(0, pos).replace(/'/g, ''); p.negSuf = negative.slice(pos + trunkLen).replace(/'/g, ''); } else { p.negPre = minusSign + p.posPre; p.negSuf = p.posSuf; } return p; } function toPercent(parsedNumber) { if (parsedNumber.digits[0] === 0) { return parsedNumber; } const fractionLen = parsedNumber.digits.length - parsedNumber.integerLen; if (parsedNumber.exponent) { parsedNumber.exponent += 2; } else { if (fractionLen === 0) { parsedNumber.digits.push(0, 0); } else if (fractionLen === 1) { parsedNumber.digits.push(0); } parsedNumber.integerLen += 2; } return parsedNumber; } function parseNumber(num) { let numStr = Math.abs(num) + ''; let exponent = 0, digits, integerLen; let i, j, zeros; if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) { numStr = numStr.replace(DECIMAL_SEP, ''); } if ((i = numStr.search(/e/i)) > 0) { if (integerLen < 0) integerLen = i; integerLen += +numStr.slice(i + 1); numStr = numStr.substring(0, i); } else if (integerLen < 0) { integerLen = numStr.length; } for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) {} if (i === (zeros = numStr.length)) { digits = [0]; integerLen = 1; } else { zeros--; while (numStr.charAt(zeros) === ZERO_CHAR) zeros--; integerLen -= i; digits = []; for (j = 0; i <= zeros; i++, j++) { digits[j] = Number(numStr.charAt(i)); } } if (integerLen > MAX_DIGITS) { digits = digits.splice(0, MAX_DIGITS - 1); exponent = integerLen - 1; integerLen = 1; } return { digits, exponent, integerLen }; } function roundNumber(parsedNumber, minFrac, maxFrac) { if (minFrac > maxFrac) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2307, ngDevMode && `The minimum number of digits after fraction (${minFrac}) is higher than the maximum (${maxFrac}).`); } let digits = parsedNumber.digits; let fractionLen = digits.length - parsedNumber.integerLen; const fractionSize = Math.min(Math.max(minFrac, fractionLen), maxFrac); let roundAt = fractionSize + parsedNumber.integerLen; let digit = digits[roundAt]; if (roundAt > 0) { digits.splice(Math.max(parsedNumber.integerLen, roundAt)); for (let j = roundAt; j < digits.length; j++) { digits[j] = 0; } } else { fractionLen = Math.max(0, fractionLen); parsedNumber.integerLen = 1; digits.length = Math.max(1, roundAt = fractionSize + 1); digits[0] = 0; for (let i = 1; i < roundAt; i++) digits[i] = 0; } if (digit >= 5) { if (roundAt - 1 < 0) { for (let k = 0; k > roundAt; k--) { digits.unshift(0); parsedNumber.integerLen++; } digits.unshift(1); parsedNumber.integerLen++; } else { digits[roundAt - 1]++; } } for (; fractionLen < Math.max(0, fractionSize); fractionLen++) digits.push(0); let dropTrailingZeros = fractionSize !== 0; const minLen = minFrac + parsedNumber.integerLen; const carry = digits.reduceRight(function (carry, d, i, digits) { d = d + carry; digits[i] = d < 10 ? d : d - 10; if (dropTrailingZeros) { if (digits[i] === 0 && i >= minLen) { digits.pop(); } else { dropTrailingZeros = false; } } return d >= 10 ? 1 : 0; }, 0); if (carry) { digits.unshift(carry); parsedNumber.integerLen++; } } function parseIntAutoRadix(text) { const result = parseInt(text); if (isNaN(result)) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2305, ngDevMode && 'Invalid integer literal when parsing ' + text); } return result; } class NgLocalization { static ɵfac = function NgLocalization_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NgLocalization)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: NgLocalization, factory: () => (() => new NgLocaleLocalization((0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.LOCALE_ID)))(), providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(NgLocalization, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Injectable, args: [{ providedIn: 'root', useFactory: () => new NgLocaleLocalization((0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.LOCALE_ID)) }] }], null, null); })(); function getPluralCategory(value, cases, ngLocalization, locale) { let key = `=${value}`; if (cases.indexOf(key) > -1) { return key; } key = ngLocalization.getPluralCategory(value, locale); if (cases.indexOf(key) > -1) { return key; } if (cases.indexOf('other') > -1) { return 'other'; } throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2308, ngDevMode && `No plural message found for value "${value}"`); } class NgLocaleLocalization extends NgLocalization { locale; constructor(locale) { super(); this.locale = locale; } getPluralCategory(value, locale) { const plural = getLocalePluralCase(locale || this.locale)(value); switch (plural) { case Plural.Zero: return 'zero'; case Plural.One: return 'one'; case Plural.Two: return 'two'; case Plural.Few: return 'few'; case Plural.Many: return 'many'; default: return 'other'; } } static ɵfac = function NgLocaleLocalization_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NgLocaleLocalization)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.LOCALE_ID)); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: NgLocaleLocalization, factory: NgLocaleLocalization.ɵfac }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(NgLocaleLocalization, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Injectable }], () => [{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject, args: [_angular_core__WEBPACK_IMPORTED_MODULE_2__.LOCALE_ID] }] }], null); })(); const WS_REGEXP = /\s+/; const EMPTY_ARRAY = []; class NgClass { _ngEl; _renderer; initialClasses = EMPTY_ARRAY; rawClass; stateMap = new Map(); constructor(_ngEl, _renderer) { this._ngEl = _ngEl; this._renderer = _renderer; } set klass(value) { this.initialClasses = value != null ? value.trim().split(WS_REGEXP) : EMPTY_ARRAY; } set ngClass(value) { this.rawClass = typeof value === 'string' ? value.trim().split(WS_REGEXP) : value; } ngDoCheck() { for (const klass of this.initialClasses) { this._updateState(klass, true); } const rawClass = this.rawClass; if (Array.isArray(rawClass) || rawClass instanceof Set) { for (const klass of rawClass) { this._updateState(klass, true); } } else if (rawClass != null) { for (const klass of Object.keys(rawClass)) { this._updateState(klass, Boolean(rawClass[klass])); } } this._applyStateDiff(); } _updateState(klass, nextEnabled) { const state = this.stateMap.get(klass); if (state !== undefined) { if (state.enabled !== nextEnabled) { state.changed = true; state.enabled = nextEnabled; } state.touched = true; } else { this.stateMap.set(klass, { enabled: nextEnabled, changed: true, touched: true }); } } _applyStateDiff() { for (const stateEntry of this.stateMap) { const klass = stateEntry[0]; const state = stateEntry[1]; if (state.changed) { this._toggleClass(klass, state.enabled); state.changed = false; } else if (!state.touched) { if (state.enabled) { this._toggleClass(klass, false); } this.stateMap.delete(klass); } state.touched = false; } } _toggleClass(klass, enabled) { if (ngDevMode) { if (typeof klass !== 'string') { throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${(0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.stringify)(klass)}`); } } klass = klass.trim(); if (klass.length > 0) { klass.split(WS_REGEXP).forEach(klass => { if (enabled) { this._renderer.addClass(this._ngEl.nativeElement, klass); } else { this._renderer.removeClass(this._ngEl.nativeElement, klass); } }); } } static ɵfac = function NgClass_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NgClass)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.Renderer2)); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({ type: NgClass, selectors: [["", "ngClass", ""]], inputs: { klass: [0, "class", "klass"], ngClass: "ngClass" } }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(NgClass, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive, args: [{ selector: '[ngClass]' }] }], () => [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ElementRef }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Renderer2 }], { klass: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input, args: ['class'] }], ngClass: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input, args: ['ngClass'] }] }); })(); class NgComponentOutlet { _viewContainerRef; ngComponentOutlet = null; ngComponentOutletInputs; ngComponentOutletInjector; ngComponentOutletEnvironmentInjector; ngComponentOutletContent; ngComponentOutletNgModule; _componentRef; _moduleRef; _inputsUsed = new Map(); get componentInstance() { return this._componentRef?.instance ?? null; } constructor(_viewContainerRef) { this._viewContainerRef = _viewContainerRef; } _needToReCreateNgModuleInstance(changes) { return changes['ngComponentOutletNgModule'] !== undefined; } _needToReCreateComponentInstance(changes) { return changes['ngComponentOutlet'] !== undefined || changes['ngComponentOutletContent'] !== undefined || changes['ngComponentOutletInjector'] !== undefined || changes['ngComponentOutletEnvironmentInjector'] !== undefined || this._needToReCreateNgModuleInstance(changes); } ngOnChanges(changes) { if (this._needToReCreateComponentInstance(changes)) { this._viewContainerRef.clear(); this._inputsUsed.clear(); this._componentRef = undefined; if (this.ngComponentOutlet) { const injector = this.ngComponentOutletInjector || this._viewContainerRef.parentInjector; if (this._needToReCreateNgModuleInstance(changes)) { this._moduleRef?.destroy(); if (this.ngComponentOutletNgModule) { this._moduleRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.createNgModule)(this.ngComponentOutletNgModule, getParentInjector(injector)); } else { this._moduleRef = undefined; } } this._componentRef = this._viewContainerRef.createComponent(this.ngComponentOutlet, { injector, ngModuleRef: this._moduleRef, projectableNodes: this.ngComponentOutletContent, environmentInjector: this.ngComponentOutletEnvironmentInjector }); } } } ngDoCheck() { if (this._componentRef) { if (this.ngComponentOutletInputs) { for (const inputName of Object.keys(this.ngComponentOutletInputs)) { this._inputsUsed.set(inputName, true); } } this._applyInputStateDiff(this._componentRef); } } ngOnDestroy() { this._moduleRef?.destroy(); } _applyInputStateDiff(componentRef) { for (const [inputName, touched] of this._inputsUsed) { if (!touched) { componentRef.setInput(inputName, undefined); this._inputsUsed.delete(inputName); } else { componentRef.setInput(inputName, this.ngComponentOutletInputs[inputName]); this._inputsUsed.set(inputName, false); } } } static ɵfac = function NgComponentOutlet_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NgComponentOutlet)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewContainerRef)); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({ type: NgComponentOutlet, selectors: [["", "ngComponentOutlet", ""]], inputs: { ngComponentOutlet: "ngComponentOutlet", ngComponentOutletInputs: "ngComponentOutletInputs", ngComponentOutletInjector: "ngComponentOutletInjector", ngComponentOutletEnvironmentInjector: "ngComponentOutletEnvironmentInjector", ngComponentOutletContent: "ngComponentOutletContent", ngComponentOutletNgModule: "ngComponentOutletNgModule" }, exportAs: ["ngComponentOutlet"], features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵNgOnChangesFeature"]] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(NgComponentOutlet, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive, args: [{ selector: '[ngComponentOutlet]', exportAs: 'ngComponentOutlet' }] }], () => [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewContainerRef }], { ngComponentOutlet: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input }], ngComponentOutletInputs: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input }], ngComponentOutletInjector: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input }], ngComponentOutletEnvironmentInjector: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input }], ngComponentOutletContent: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input }], ngComponentOutletNgModule: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input }] }); })(); function getParentInjector(injector) { const parentNgModule = injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_2__.NgModuleRef$1); return parentNgModule.injector; } class NgForOfContext { $implicit; ngForOf; index; count; constructor($implicit, ngForOf, index, count) { this.$implicit = $implicit; this.ngForOf = ngForOf; this.index = index; this.count = count; } get first() { return this.index === 0; } get last() { return this.index === this.count - 1; } get even() { return this.index % 2 === 0; } get odd() { return !this.even; } } class NgForOf { _viewContainer; _template; _differs; set ngForOf(ngForOf) { this._ngForOf = ngForOf; this._ngForOfDirty = true; } set ngForTrackBy(fn) { if ((typeof ngDevMode === 'undefined' || ngDevMode) && fn != null && typeof fn !== 'function') { console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}. ` + `See https://angular.dev/api/common/NgForOf#change-propagation for more information.`); } this._trackByFn = fn; } get ngForTrackBy() { return this._trackByFn; } _ngForOf = null; _ngForOfDirty = true; _differ = null; _trackByFn; constructor(_viewContainer, _template, _differs) { this._viewContainer = _viewContainer; this._template = _template; this._differs = _differs; } set ngForTemplate(value) { if (value) { this._template = value; } } ngDoCheck() { if (this._ngForOfDirty) { this._ngForOfDirty = false; const value = this._ngForOf; if (!this._differ && value) { if (typeof ngDevMode === 'undefined' || ngDevMode) { try { this._differ = this._differs.find(value).create(this.ngForTrackBy); } catch { let errorMessage = `Cannot find a differ supporting object '${value}' of type '` + `${getTypeName(value)}'. NgFor only supports binding to Iterables, such as Arrays.`; if (typeof value === 'object') { errorMessage += ' Did you mean to use the keyvalue pipe?'; } throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(-2200, errorMessage); } } else { this._differ = this._differs.find(value).create(this.ngForTrackBy); } } } if (this._differ) { const changes = this._differ.diff(this._ngForOf); if (changes) this._applyChanges(changes); } } _applyChanges(changes) { const viewContainer = this._viewContainer; changes.forEachOperation((item, adjustedPreviousIndex, currentIndex) => { if (item.previousIndex == null) { viewContainer.createEmbeddedView(this._template, new NgForOfContext(item.item, this._ngForOf, -1, -1), currentIndex === null ? undefined : currentIndex); } else if (currentIndex == null) { viewContainer.remove(adjustedPreviousIndex === null ? undefined : adjustedPreviousIndex); } else if (adjustedPreviousIndex !== null) { const view = viewContainer.get(adjustedPreviousIndex); viewContainer.move(view, currentIndex); applyViewChange(view, item); } }); for (let i = 0, ilen = viewContainer.length; i < ilen; i++) { const viewRef = viewContainer.get(i); const context = viewRef.context; context.index = i; context.count = ilen; context.ngForOf = this._ngForOf; } changes.forEachIdentityChange(record => { const viewRef = viewContainer.get(record.currentIndex); applyViewChange(viewRef, record); }); } static ngTemplateContextGuard(dir, ctx) { return true; } static ɵfac = function NgForOf_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NgForOf)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.TemplateRef), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.IterableDiffers)); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({ type: NgForOf, selectors: [["", "ngFor", "", "ngForOf", ""]], inputs: { ngForOf: "ngForOf", ngForTrackBy: "ngForTrackBy", ngForTemplate: "ngForTemplate" } }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(NgForOf, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive, args: [{ selector: '[ngFor][ngForOf]' }] }], () => [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewContainerRef }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.TemplateRef }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.IterableDiffers }], { ngForOf: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input }], ngForTrackBy: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input }], ngForTemplate: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input }] }); })(); function applyViewChange(view, record) { view.context.$implicit = record.item; } function getTypeName(type) { return type['name'] || typeof type; } class NgIf { _viewContainer; _context = new NgIfContext(); _thenTemplateRef = null; _elseTemplateRef = null; _thenViewRef = null; _elseViewRef = null; constructor(_viewContainer, templateRef) { this._viewContainer = _viewContainer; this._thenTemplateRef = templateRef; } set ngIf(condition) { this._context.$implicit = this._context.ngIf = condition; this._updateView(); } set ngIfThen(templateRef) { assertTemplate(templateRef, (typeof ngDevMode === 'undefined' || ngDevMode) && 'ngIfThen'); this._thenTemplateRef = templateRef; this._thenViewRef = null; this._updateView(); } set ngIfElse(templateRef) { assertTemplate(templateRef, (typeof ngDevMode === 'undefined' || ngDevMode) && 'ngIfElse'); this._elseTemplateRef = templateRef; this._elseViewRef = null; this._updateView(); } _updateView() { if (this._context.$implicit) { if (!this._thenViewRef) { this._viewContainer.clear(); this._elseViewRef = null; if (this._thenTemplateRef) { this._thenViewRef = this._viewContainer.createEmbeddedView(this._thenTemplateRef, this._context); } } } else { if (!this._elseViewRef) { this._viewContainer.clear(); this._thenViewRef = null; if (this._elseTemplateRef) { this._elseViewRef = this._viewContainer.createEmbeddedView(this._elseTemplateRef, this._context); } } } } static ngIfUseIfTypeGuard; static ngTemplateGuard_ngIf; static ngTemplateContextGuard(dir, ctx) { return true; } static ɵfac = function NgIf_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NgIf)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.TemplateRef)); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({ type: NgIf, selectors: [["", "ngIf", ""]], inputs: { ngIf: "ngIf", ngIfThen: "ngIfThen", ngIfElse: "ngIfElse" } }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(NgIf, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive, args: [{ selector: '[ngIf]' }] }], () => [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewContainerRef }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.TemplateRef }], { ngIf: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input }], ngIfThen: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input }], ngIfElse: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input }] }); })(); class NgIfContext { $implicit = null; ngIf = null; } function assertTemplate(templateRef, property) { if (templateRef && !templateRef.createEmbeddedView) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2020, (typeof ngDevMode === 'undefined' || ngDevMode) && `${property} must be a TemplateRef, but received '${(0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.stringify)(templateRef)}'.`); } } class SwitchView { _viewContainerRef; _templateRef; _created = false; constructor(_viewContainerRef, _templateRef) { this._viewContainerRef = _viewContainerRef; this._templateRef = _templateRef; } create() { this._created = true; this._viewContainerRef.createEmbeddedView(this._templateRef); } destroy() { this._created = false; this._viewContainerRef.clear(); } enforceState(created) { if (created && !this._created) { this.create(); } else if (!created && this._created) { this.destroy(); } } } class NgSwitch { _defaultViews = []; _defaultUsed = false; _caseCount = 0; _lastCaseCheckIndex = 0; _lastCasesMatched = false; _ngSwitch; set ngSwitch(newValue) { this._ngSwitch = newValue; if (this._caseCount === 0) { this._updateDefaultCases(true); } } _addCase() { return this._caseCount++; } _addDefault(view) { this._defaultViews.push(view); } _matchCase(value) { const matched = value === this._ngSwitch; this._lastCasesMatched ||= matched; this._lastCaseCheckIndex++; if (this._lastCaseCheckIndex === this._caseCount) { this._updateDefaultCases(!this._lastCasesMatched); this._lastCaseCheckIndex = 0; this._lastCasesMatched = false; } return matched; } _updateDefaultCases(useDefault) { if (this._defaultViews.length > 0 && useDefault !== this._defaultUsed) { this._defaultUsed = useDefault; for (const defaultView of this._defaultViews) { defaultView.enforceState(useDefault); } } } static ɵfac = function NgSwitch_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NgSwitch)(); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({ type: NgSwitch, selectors: [["", "ngSwitch", ""]], inputs: { ngSwitch: "ngSwitch" } }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(NgSwitch, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive, args: [{ selector: '[ngSwitch]' }] }], null, { ngSwitch: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input }] }); })(); class NgSwitchCase { ngSwitch; _view; ngSwitchCase; constructor(viewContainer, templateRef, ngSwitch) { this.ngSwitch = ngSwitch; if ((typeof ngDevMode === 'undefined' || ngDevMode) && !ngSwitch) { throwNgSwitchProviderNotFoundError('ngSwitchCase', 'NgSwitchCase'); } ngSwitch._addCase(); this._view = new SwitchView(viewContainer, templateRef); } ngDoCheck() { this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase)); } static ɵfac = function NgSwitchCase_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NgSwitchCase)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.TemplateRef), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](NgSwitch, 9)); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({ type: NgSwitchCase, selectors: [["", "ngSwitchCase", ""]], inputs: { ngSwitchCase: "ngSwitchCase" } }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(NgSwitchCase, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive, args: [{ selector: '[ngSwitchCase]' }] }], () => [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewContainerRef }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.TemplateRef }, { type: NgSwitch, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Optional }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Host }] }], { ngSwitchCase: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input }] }); })(); class NgSwitchDefault { constructor(viewContainer, templateRef, ngSwitch) { if ((typeof ngDevMode === 'undefined' || ngDevMode) && !ngSwitch) { throwNgSwitchProviderNotFoundError('ngSwitchDefault', 'NgSwitchDefault'); } ngSwitch._addDefault(new SwitchView(viewContainer, templateRef)); } static ɵfac = function NgSwitchDefault_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NgSwitchDefault)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.TemplateRef), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](NgSwitch, 9)); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({ type: NgSwitchDefault, selectors: [["", "ngSwitchDefault", ""]] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(NgSwitchDefault, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive, args: [{ selector: '[ngSwitchDefault]' }] }], () => [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewContainerRef }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.TemplateRef }, { type: NgSwitch, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Optional }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Host }] }], null); })(); function throwNgSwitchProviderNotFoundError(attrName, directiveName) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2000, `An element with the "${attrName}" attribute ` + `(matching the "${directiveName}" directive) must be located inside an element with the "ngSwitch" attribute ` + `(matching "NgSwitch" directive)`); } class NgPlural { _localization; _activeView; _caseViews = {}; constructor(_localization) { this._localization = _localization; } set ngPlural(value) { this._updateView(value); } addCase(value, switchView) { this._caseViews[value] = switchView; } _updateView(switchValue) { this._clearViews(); const cases = Object.keys(this._caseViews); const key = getPluralCategory(switchValue, cases, this._localization); this._activateView(this._caseViews[key]); } _clearViews() { if (this._activeView) this._activeView.destroy(); } _activateView(view) { if (view) { this._activeView = view; this._activeView.create(); } } static ɵfac = function NgPlural_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NgPlural)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](NgLocalization)); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({ type: NgPlural, selectors: [["", "ngPlural", ""]], inputs: { ngPlural: "ngPlural" } }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(NgPlural, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive, args: [{ selector: '[ngPlural]' }] }], () => [{ type: NgLocalization }], { ngPlural: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input }] }); })(); class NgPluralCase { value; constructor(value, template, viewContainer, ngPlural) { this.value = value; const isANumber = !isNaN(Number(value)); ngPlural.addCase(isANumber ? `=${value}` : value, new SwitchView(viewContainer, template)); } static ɵfac = function NgPluralCase_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NgPluralCase)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinjectAttribute"]('ngPluralCase'), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.TemplateRef), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](NgPlural, 1)); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({ type: NgPluralCase, selectors: [["", "ngPluralCase", ""]] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(NgPluralCase, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive, args: [{ selector: '[ngPluralCase]' }] }], () => [{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Attribute, args: ['ngPluralCase'] }] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.TemplateRef }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewContainerRef }, { type: NgPlural, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Host }] }], null); })(); class NgStyle { _ngEl; _differs; _renderer; _ngStyle = null; _differ = null; constructor(_ngEl, _differs, _renderer) { this._ngEl = _ngEl; this._differs = _differs; this._renderer = _renderer; } set ngStyle(values) { this._ngStyle = values; if (!this._differ && values) { this._differ = this._differs.find(values).create(); } } ngDoCheck() { if (this._differ) { const changes = this._differ.diff(this._ngStyle); if (changes) { this._applyChanges(changes); } } } _setStyle(nameAndUnit, value) { const [name, unit] = nameAndUnit.split('.'); const flags = name.indexOf('-') === -1 ? undefined : _angular_core__WEBPACK_IMPORTED_MODULE_2__.RendererStyleFlags2.DashCase; if (value != null) { this._renderer.setStyle(this._ngEl.nativeElement, name, unit ? `${value}${unit}` : value, flags); } else { this._renderer.removeStyle(this._ngEl.nativeElement, name, flags); } } _applyChanges(changes) { changes.forEachRemovedItem(record => this._setStyle(record.key, null)); changes.forEachAddedItem(record => this._setStyle(record.key, record.currentValue)); changes.forEachChangedItem(record => this._setStyle(record.key, record.currentValue)); } static ɵfac = function NgStyle_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NgStyle)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.KeyValueDiffers), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.Renderer2)); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({ type: NgStyle, selectors: [["", "ngStyle", ""]], inputs: { ngStyle: "ngStyle" } }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(NgStyle, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive, args: [{ selector: '[ngStyle]' }] }], () => [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ElementRef }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.KeyValueDiffers }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Renderer2 }], { ngStyle: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input, args: ['ngStyle'] }] }); })(); class NgTemplateOutlet { _viewContainerRef; _viewRef = null; ngTemplateOutletContext = null; ngTemplateOutlet = null; ngTemplateOutletInjector = null; constructor(_viewContainerRef) { this._viewContainerRef = _viewContainerRef; } ngOnChanges(changes) { if (this._shouldRecreateView(changes)) { const viewContainerRef = this._viewContainerRef; if (this._viewRef) { viewContainerRef.remove(viewContainerRef.indexOf(this._viewRef)); } if (!this.ngTemplateOutlet) { this._viewRef = null; return; } const viewContext = this._createContextForwardProxy(); this._viewRef = viewContainerRef.createEmbeddedView(this.ngTemplateOutlet, viewContext, { injector: this.ngTemplateOutletInjector ?? undefined }); } } _shouldRecreateView(changes) { return !!changes['ngTemplateOutlet'] || !!changes['ngTemplateOutletInjector']; } _createContextForwardProxy() { return new Proxy({}, { set: (_target, prop, newValue) => { if (!this.ngTemplateOutletContext) { return false; } return Reflect.set(this.ngTemplateOutletContext, prop, newValue); }, get: (_target, prop, receiver) => { if (!this.ngTemplateOutletContext) { return undefined; } return Reflect.get(this.ngTemplateOutletContext, prop, receiver); } }); } static ɵfac = function NgTemplateOutlet_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NgTemplateOutlet)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewContainerRef)); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({ type: NgTemplateOutlet, selectors: [["", "ngTemplateOutlet", ""]], inputs: { ngTemplateOutletContext: "ngTemplateOutletContext", ngTemplateOutlet: "ngTemplateOutlet", ngTemplateOutletInjector: "ngTemplateOutletInjector" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵNgOnChangesFeature"]] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(NgTemplateOutlet, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive, args: [{ selector: '[ngTemplateOutlet]' }] }], () => [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewContainerRef }], { ngTemplateOutletContext: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input }], ngTemplateOutlet: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input }], ngTemplateOutletInjector: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input }] }); })(); const COMMON_DIRECTIVES = [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase]; function invalidPipeArgumentError(type, value) { return new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2100, ngDevMode && `InvalidPipeArgument: '${value}' for pipe '${(0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.stringify)(type)}'`); } class SubscribableStrategy { createSubscription(async, updateLatestValue, onError) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.untracked)(() => async.subscribe({ next: updateLatestValue, error: onError })); } dispose(subscription) { (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.untracked)(() => subscription.unsubscribe()); } } class PromiseStrategy { createSubscription(async, updateLatestValue, onError) { async.then(v => updateLatestValue?.(v), e => onError?.(e)); return { unsubscribe: () => { updateLatestValue = null; onError = null; } }; } dispose(subscription) { subscription.unsubscribe(); } } const _promiseStrategy = new PromiseStrategy(); const _subscribableStrategy = new SubscribableStrategy(); class AsyncPipe { _ref; _latestValue = null; markForCheckOnValueUpdate = true; _subscription = null; _obj = null; _strategy = null; applicationErrorHandler = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.INTERNAL_APPLICATION_ERROR_HANDLER); constructor(ref) { this._ref = ref; } ngOnDestroy() { if (this._subscription) { this._dispose(); } this._ref = null; } transform(obj) { if (!this._obj) { if (obj) { try { this.markForCheckOnValueUpdate = false; this._subscribe(obj); } finally { this.markForCheckOnValueUpdate = true; } } return this._latestValue; } if (obj !== this._obj) { this._dispose(); return this.transform(obj); } return this._latestValue; } _subscribe(obj) { this._obj = obj; this._strategy = this._selectStrategy(obj); this._subscription = this._strategy.createSubscription(obj, value => this._updateLatestValue(obj, value), e => this.applicationErrorHandler(e)); } _selectStrategy(obj) { if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.isPromise)(obj)) { return _promiseStrategy; } if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.isSubscribable)(obj)) { return _subscribableStrategy; } throw invalidPipeArgumentError(AsyncPipe, obj); } _dispose() { this._strategy.dispose(this._subscription); this._latestValue = null; this._subscription = null; this._obj = null; } _updateLatestValue(async, value) { if (async === this._obj) { this._latestValue = value; if (this.markForCheckOnValueUpdate) { this._ref?.markForCheck(); } } } static ɵfac = function AsyncPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AsyncPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef, 16)); }; static ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefinePipe"]({ name: "async", type: AsyncPipe, pure: false }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(AsyncPipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Pipe, args: [{ name: 'async', pure: false }] }], () => [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef }], null); })(); class LowerCasePipe { transform(value) { if (value == null) return null; if (typeof value !== 'string') { throw invalidPipeArgumentError(LowerCasePipe, value); } return value.toLowerCase(); } static ɵfac = function LowerCasePipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LowerCasePipe)(); }; static ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefinePipe"]({ name: "lowercase", type: LowerCasePipe, pure: true }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(LowerCasePipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Pipe, args: [{ name: 'lowercase' }] }], null, null); })(); const unicodeWordMatch = /(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\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\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\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\u0AF9\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-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\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-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\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-\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-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\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]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])\S*/g; class TitleCasePipe { transform(value) { if (value == null) return null; if (typeof value !== 'string') { throw invalidPipeArgumentError(TitleCasePipe, value); } return value.replace(unicodeWordMatch, txt => txt[0].toUpperCase() + txt.slice(1).toLowerCase()); } static ɵfac = function TitleCasePipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TitleCasePipe)(); }; static ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefinePipe"]({ name: "titlecase", type: TitleCasePipe, pure: true }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(TitleCasePipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Pipe, args: [{ name: 'titlecase' }] }], null, null); })(); class UpperCasePipe { transform(value) { if (value == null) return null; if (typeof value !== 'string') { throw invalidPipeArgumentError(UpperCasePipe, value); } return value.toUpperCase(); } static ɵfac = function UpperCasePipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || UpperCasePipe)(); }; static ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefinePipe"]({ name: "uppercase", type: UpperCasePipe, pure: true }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(UpperCasePipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Pipe, args: [{ name: 'uppercase' }] }], null, null); })(); const DEFAULT_DATE_FORMAT = 'mediumDate'; const DATE_PIPE_DEFAULT_TIMEZONE = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'DATE_PIPE_DEFAULT_TIMEZONE' : ''); const DATE_PIPE_DEFAULT_OPTIONS = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'DATE_PIPE_DEFAULT_OPTIONS' : ''); class DatePipe { locale; defaultTimezone; defaultOptions; constructor(locale, defaultTimezone, defaultOptions) { this.locale = locale; this.defaultTimezone = defaultTimezone; this.defaultOptions = defaultOptions; } transform(value, format, timezone, locale) { if (value == null || value === '' || value !== value) return null; try { const _format = format ?? this.defaultOptions?.dateFormat ?? DEFAULT_DATE_FORMAT; const _timezone = timezone ?? this.defaultOptions?.timezone ?? this.defaultTimezone ?? undefined; return formatDate(value, _format, locale || this.locale, _timezone); } catch (error) { throw invalidPipeArgumentError(DatePipe, error.message); } } static ɵfac = function DatePipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DatePipe)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.LOCALE_ID, 16), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](DATE_PIPE_DEFAULT_TIMEZONE, 24), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](DATE_PIPE_DEFAULT_OPTIONS, 24)); }; static ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefinePipe"]({ name: "date", type: DatePipe, pure: true }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(DatePipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Pipe, args: [{ name: 'date' }] }], () => [{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject, args: [_angular_core__WEBPACK_IMPORTED_MODULE_2__.LOCALE_ID] }] }, { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject, args: [DATE_PIPE_DEFAULT_TIMEZONE] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Optional }] }, { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject, args: [DATE_PIPE_DEFAULT_OPTIONS] }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Optional }] }], null); })(); const _INTERPOLATION_REGEXP = /#/g; class I18nPluralPipe { _localization; constructor(_localization) { this._localization = _localization; } transform(value, pluralMap, locale) { if (value == null) return ''; if (typeof pluralMap !== 'object' || pluralMap === null) { throw invalidPipeArgumentError(I18nPluralPipe, pluralMap); } const key = getPluralCategory(value, Object.keys(pluralMap), this._localization, locale); return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString()); } static ɵfac = function I18nPluralPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || I18nPluralPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](NgLocalization, 16)); }; static ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefinePipe"]({ name: "i18nPlural", type: I18nPluralPipe, pure: true }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(I18nPluralPipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Pipe, args: [{ name: 'i18nPlural' }] }], () => [{ type: NgLocalization }], null); })(); class I18nSelectPipe { transform(value, mapping) { if (value == null) return ''; if (typeof mapping !== 'object' || typeof value !== 'string') { throw invalidPipeArgumentError(I18nSelectPipe, mapping); } if (mapping.hasOwnProperty(value)) { return mapping[value]; } if (mapping.hasOwnProperty('other')) { return mapping['other']; } return ''; } static ɵfac = function I18nSelectPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || I18nSelectPipe)(); }; static ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefinePipe"]({ name: "i18nSelect", type: I18nSelectPipe, pure: true }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(I18nSelectPipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Pipe, args: [{ name: 'i18nSelect' }] }], null, null); })(); class JsonPipe { transform(value) { return JSON.stringify(value, null, 2); } static ɵfac = function JsonPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || JsonPipe)(); }; static ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefinePipe"]({ name: "json", type: JsonPipe, pure: false }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(JsonPipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Pipe, args: [{ name: 'json', pure: false }] }], null, null); })(); function makeKeyValuePair(key, value) { return { key: key, value: value }; } class KeyValuePipe { differs; constructor(differs) { this.differs = differs; } differ; keyValues = []; compareFn = defaultComparator; transform(input, compareFn = defaultComparator) { if (!input || !(input instanceof Map) && typeof input !== 'object') { return null; } this.differ ??= this.differs.find(input).create(); const differChanges = this.differ.diff(input); const compareFnChanged = compareFn !== this.compareFn; if (differChanges) { this.keyValues = []; differChanges.forEachItem(r => { this.keyValues.push(makeKeyValuePair(r.key, r.currentValue)); }); } if (differChanges || compareFnChanged) { if (compareFn) { this.keyValues.sort(compareFn); } this.compareFn = compareFn; } return this.keyValues; } static ɵfac = function KeyValuePipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || KeyValuePipe)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.KeyValueDiffers, 16)); }; static ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefinePipe"]({ name: "keyvalue", type: KeyValuePipe, pure: false }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(KeyValuePipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Pipe, args: [{ name: 'keyvalue', pure: false }] }], () => [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.KeyValueDiffers }], null); })(); function defaultComparator(keyValueA, keyValueB) { const a = keyValueA.key; const b = keyValueB.key; if (a === b) return 0; if (a == null) return 1; if (b == null) return -1; if (typeof a == 'string' && typeof b == 'string') { return a < b ? -1 : 1; } if (typeof a == 'number' && typeof b == 'number') { return a - b; } if (typeof a == 'boolean' && typeof b == 'boolean') { return a < b ? -1 : 1; } const aString = String(a); const bString = String(b); return aString == bString ? 0 : aString < bString ? -1 : 1; } class DecimalPipe { _locale; constructor(_locale) { this._locale = _locale; } transform(value, digitsInfo, locale) { if (!isValue(value)) return null; locale ||= this._locale; try { const num = strToNumber(value); return formatNumber(num, locale, digitsInfo); } catch (error) { throw invalidPipeArgumentError(DecimalPipe, error.message); } } static ɵfac = function DecimalPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || DecimalPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.LOCALE_ID, 16)); }; static ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefinePipe"]({ name: "number", type: DecimalPipe, pure: true }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(DecimalPipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Pipe, args: [{ name: 'number' }] }], () => [{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject, args: [_angular_core__WEBPACK_IMPORTED_MODULE_2__.LOCALE_ID] }] }], null); })(); class PercentPipe { _locale; constructor(_locale) { this._locale = _locale; } transform(value, digitsInfo, locale) { if (!isValue(value)) return null; locale ||= this._locale; try { const num = strToNumber(value); return formatPercent(num, locale, digitsInfo); } catch (error) { throw invalidPipeArgumentError(PercentPipe, error.message); } } static ɵfac = function PercentPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PercentPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.LOCALE_ID, 16)); }; static ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefinePipe"]({ name: "percent", type: PercentPipe, pure: true }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(PercentPipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Pipe, args: [{ name: 'percent' }] }], () => [{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject, args: [_angular_core__WEBPACK_IMPORTED_MODULE_2__.LOCALE_ID] }] }], null); })(); class CurrencyPipe { _locale; _defaultCurrencyCode; constructor(_locale, _defaultCurrencyCode = 'USD') { this._locale = _locale; this._defaultCurrencyCode = _defaultCurrencyCode; } transform(value, currencyCode = this._defaultCurrencyCode, display = 'symbol', digitsInfo, locale) { if (!isValue(value)) return null; locale ||= this._locale; if (typeof display === 'boolean') { if (typeof ngDevMode === 'undefined' || ngDevMode) { console.warn(`Warning: the currency pipe has been changed in Angular v5. The symbolDisplay option (third parameter) is now a string instead of a boolean. The accepted values are "code", "symbol" or "symbol-narrow".`); } display = display ? 'symbol' : 'code'; } let currency = currencyCode || this._defaultCurrencyCode; if (display !== 'code') { if (display === 'symbol' || display === 'symbol-narrow') { currency = getCurrencySymbol(currency, display === 'symbol' ? 'wide' : 'narrow', locale); } else { currency = display; } } try { const num = strToNumber(value); return formatCurrency(num, locale, currency, currencyCode, digitsInfo); } catch (error) { throw invalidPipeArgumentError(CurrencyPipe, error.message); } } static ɵfac = function CurrencyPipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CurrencyPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.LOCALE_ID, 16), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_CURRENCY_CODE, 16)); }; static ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefinePipe"]({ name: "currency", type: CurrencyPipe, pure: true }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(CurrencyPipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Pipe, args: [{ name: 'currency' }] }], () => [{ type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject, args: [_angular_core__WEBPACK_IMPORTED_MODULE_2__.LOCALE_ID] }] }, { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject, args: [_angular_core__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_CURRENCY_CODE] }] }], null); })(); function isValue(value) { return !(value == null || value === '' || value !== value); } function strToNumber(value) { if (typeof value === 'string' && !isNaN(Number(value) - parseFloat(value))) { return Number(value); } if (typeof value !== 'number') { throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2309, ngDevMode && `${value} is not a number`); } return value; } class SlicePipe { transform(value, start, end) { if (value == null) return null; const supports = typeof value === 'string' || Array.isArray(value); if (!supports) { throw invalidPipeArgumentError(SlicePipe, value); } return value.slice(start, end); } static ɵfac = function SlicePipe_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SlicePipe)(); }; static ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefinePipe"]({ name: "slice", type: SlicePipe, pure: false }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(SlicePipe, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Pipe, args: [{ name: 'slice', pure: false }] }], null, null); })(); const COMMON_PIPES = [AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe]; class CommonModule { static ɵfac = function CommonModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CommonModule)(); }; static ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineNgModule"]({ type: CommonModule }); static ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({}); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(CommonModule, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.NgModule, args: [{ imports: [COMMON_DIRECTIVES, COMMON_PIPES], exports: [COMMON_DIRECTIVES, COMMON_PIPES] }] }], null, null); })(); /***/ }, /***/ 25180 /*!*******************************************************************!*\ !*** ./node_modules/@angular/common/fesm2022/_location-chunk.mjs ***! \*******************************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ APP_BASE_HREF: () => (/* binding */ APP_BASE_HREF), /* harmony export */ Location: () => (/* binding */ Location), /* harmony export */ LocationStrategy: () => (/* binding */ LocationStrategy), /* harmony export */ PathLocationStrategy: () => (/* binding */ PathLocationStrategy), /* harmony export */ joinWithSlash: () => (/* binding */ joinWithSlash), /* harmony export */ normalizeQueryParams: () => (/* binding */ normalizeQueryParams) /* harmony export */ }); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 40072); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 14975); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 33242); /* harmony import */ var _platform_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./_platform_location-chunk.mjs */ 51490); /** * @license Angular v21.1.2 * (c) 2010-2026 Google LLC. https://angular.dev/ * License: MIT */ function joinWithSlash(start, end) { if (!start) return end; if (!end) return start; if (start.endsWith('/')) { return end.startsWith('/') ? start + end.slice(1) : start + end; } return end.startsWith('/') ? start + end : `${start}/${end}`; } function stripTrailingSlash(url) { const pathEndIdx = url.search(/#|\?|$/); return url[pathEndIdx - 1] === '/' ? url.slice(0, pathEndIdx - 1) + url.slice(pathEndIdx) : url; } function normalizeQueryParams(params) { return params && params[0] !== '?' ? `?${params}` : params; } class LocationStrategy { historyGo(relativePosition) { throw new Error(ngDevMode ? 'Not implemented' : ''); } static ɵfac = function LocationStrategy_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LocationStrategy)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: LocationStrategy, factory: () => (() => (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(PathLocationStrategy))(), providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(LocationStrategy, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable, args: [{ providedIn: 'root', useFactory: () => (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(PathLocationStrategy) }] }], null, null); })(); const APP_BASE_HREF = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'appBaseHref' : ''); class PathLocationStrategy extends LocationStrategy { _platformLocation; _baseHref; _removeListenerFns = []; constructor(_platformLocation, href) { super(); this._platformLocation = _platformLocation; this._baseHref = href ?? this._platformLocation.getBaseHrefFromDOM() ?? (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT).location?.origin ?? ''; } ngOnDestroy() { while (this._removeListenerFns.length) { this._removeListenerFns.pop()(); } } onPopState(fn) { this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn)); } getBaseHref() { return this._baseHref; } prepareExternalUrl(internal) { return joinWithSlash(this._baseHref, internal); } path(includeHash = false) { const pathname = this._platformLocation.pathname + normalizeQueryParams(this._platformLocation.search); const hash = this._platformLocation.hash; return hash && includeHash ? `${pathname}${hash}` : pathname; } pushState(state, title, url, queryParams) { const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams)); this._platformLocation.pushState(state, title, externalUrl); } replaceState(state, title, url, queryParams) { const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams)); this._platformLocation.replaceState(state, title, externalUrl); } forward() { this._platformLocation.forward(); } back() { this._platformLocation.back(); } getState() { return this._platformLocation.getState(); } historyGo(relativePosition = 0) { this._platformLocation.historyGo?.(relativePosition); } static ɵfac = function PathLocationStrategy_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PathLocationStrategy)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_platform_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_3__.PlatformLocation), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](APP_BASE_HREF, 8)); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: PathLocationStrategy, factory: PathLocationStrategy.ɵfac, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(PathLocationStrategy, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable, args: [{ providedIn: 'root' }] }], () => [{ type: _platform_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_3__.PlatformLocation }, { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Optional }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject, args: [APP_BASE_HREF] }] }], null); })(); class Location { _subject = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject(); _basePath; _locationStrategy; _urlChangeListeners = []; _urlChangeSubscription = null; constructor(locationStrategy) { this._locationStrategy = locationStrategy; const baseHref = this._locationStrategy.getBaseHref(); this._basePath = _stripOrigin(stripTrailingSlash(_stripIndexHtml(baseHref))); this._locationStrategy.onPopState(ev => { this._subject.next({ 'url': this.path(true), 'pop': true, 'state': ev.state, 'type': ev.type }); }); } ngOnDestroy() { this._urlChangeSubscription?.unsubscribe(); this._urlChangeListeners = []; } path(includeHash = false) { return this.normalize(this._locationStrategy.path(includeHash)); } getState() { return this._locationStrategy.getState(); } isCurrentPathEqualTo(path, query = '') { return this.path() == this.normalize(path + normalizeQueryParams(query)); } normalize(url) { return Location.stripTrailingSlash(_stripBasePath(this._basePath, _stripIndexHtml(url))); } prepareExternalUrl(url) { if (url && url[0] !== '/') { url = '/' + url; } return this._locationStrategy.prepareExternalUrl(url); } go(path, query = '', state = null) { this._locationStrategy.pushState(state, '', path, query); this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state); } replaceState(path, query = '', state = null) { this._locationStrategy.replaceState(state, '', path, query); this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state); } forward() { this._locationStrategy.forward(); } back() { this._locationStrategy.back(); } historyGo(relativePosition = 0) { this._locationStrategy.historyGo?.(relativePosition); } onUrlChange(fn) { this._urlChangeListeners.push(fn); this._urlChangeSubscription ??= this.subscribe(v => { this._notifyUrlChangeListeners(v.url, v.state); }); return () => { const fnIndex = this._urlChangeListeners.indexOf(fn); this._urlChangeListeners.splice(fnIndex, 1); if (this._urlChangeListeners.length === 0) { this._urlChangeSubscription?.unsubscribe(); this._urlChangeSubscription = null; } }; } _notifyUrlChangeListeners(url = '', state) { this._urlChangeListeners.forEach(fn => fn(url, state)); } subscribe(onNext, onThrow, onReturn) { return this._subject.subscribe({ next: onNext, error: onThrow ?? undefined, complete: onReturn ?? undefined }); } static normalizeQueryParams = normalizeQueryParams; static joinWithSlash = joinWithSlash; static stripTrailingSlash = stripTrailingSlash; static ɵfac = function Location_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Location)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](LocationStrategy)); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: Location, factory: () => createLocation(), providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(Location, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable, args: [{ providedIn: 'root', useFactory: createLocation }] }], () => [{ type: LocationStrategy }], null); })(); function createLocation() { return new Location((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(LocationStrategy)); } function _stripBasePath(basePath, url) { if (!basePath || !url.startsWith(basePath)) { return url; } const strippedUrl = url.substring(basePath.length); if (strippedUrl === '' || ['/', ';', '?', '#'].includes(strippedUrl[0])) { return strippedUrl; } return url; } function _stripIndexHtml(url) { return url.replace(/\/index.html$/, ''); } function _stripOrigin(baseHref) { const isAbsoluteUrl = new RegExp('^(https?:)?//').test(baseHref); if (isAbsoluteUrl) { const [, pathname] = baseHref.split(/\/\/[^\/]+/); return pathname; } return baseHref; } /***/ }, /***/ 19305 /*!*****************************************************************!*\ !*** ./node_modules/@angular/common/fesm2022/_module-chunk.mjs ***! \*****************************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FetchBackend: () => (/* binding */ FetchBackend), /* harmony export */ HTTP_INTERCEPTORS: () => (/* binding */ HTTP_INTERCEPTORS), /* harmony export */ HTTP_ROOT_INTERCEPTOR_FNS: () => (/* binding */ HTTP_ROOT_INTERCEPTOR_FNS), /* harmony export */ HttpBackend: () => (/* binding */ HttpBackend), /* harmony export */ HttpClient: () => (/* binding */ HttpClient), /* harmony export */ HttpClientJsonpModule: () => (/* binding */ HttpClientJsonpModule), /* harmony export */ HttpClientModule: () => (/* binding */ HttpClientModule), /* harmony export */ HttpClientXsrfModule: () => (/* binding */ HttpClientXsrfModule), /* harmony export */ HttpContext: () => (/* binding */ HttpContext), /* harmony export */ HttpContextToken: () => (/* binding */ HttpContextToken), /* harmony export */ HttpErrorResponse: () => (/* binding */ HttpErrorResponse), /* harmony export */ HttpEventType: () => (/* binding */ HttpEventType), /* harmony export */ HttpFeatureKind: () => (/* binding */ HttpFeatureKind), /* harmony export */ HttpHandler: () => (/* binding */ HttpHandler), /* harmony export */ HttpHeaderResponse: () => (/* binding */ HttpHeaderResponse), /* harmony export */ HttpHeaders: () => (/* binding */ HttpHeaders), /* harmony export */ HttpInterceptorHandler: () => (/* binding */ HttpInterceptorHandler), /* harmony export */ HttpParams: () => (/* binding */ HttpParams), /* harmony export */ HttpRequest: () => (/* binding */ HttpRequest), /* harmony export */ HttpResponse: () => (/* binding */ HttpResponse), /* harmony export */ HttpResponseBase: () => (/* binding */ HttpResponseBase), /* harmony export */ HttpStatusCode: () => (/* binding */ HttpStatusCode), /* harmony export */ HttpUrlEncodingCodec: () => (/* binding */ HttpUrlEncodingCodec), /* harmony export */ HttpXhrBackend: () => (/* binding */ HttpXhrBackend), /* harmony export */ HttpXsrfTokenExtractor: () => (/* binding */ HttpXsrfTokenExtractor), /* harmony export */ JsonpClientBackend: () => (/* binding */ JsonpClientBackend), /* harmony export */ JsonpInterceptor: () => (/* binding */ JsonpInterceptor), /* harmony export */ REQUESTS_CONTRIBUTE_TO_STABILITY: () => (/* binding */ REQUESTS_CONTRIBUTE_TO_STABILITY), /* harmony export */ provideHttpClient: () => (/* binding */ provideHttpClient), /* harmony export */ withFetch: () => (/* binding */ withFetch), /* harmony export */ withInterceptors: () => (/* binding */ withInterceptors), /* harmony export */ withInterceptorsFromDi: () => (/* binding */ withInterceptorsFromDi), /* harmony export */ withJsonpSupport: () => (/* binding */ withJsonpSupport), /* harmony export */ withNoXsrfProtection: () => (/* binding */ withNoXsrfProtection), /* harmony export */ withRequestsMadeViaParent: () => (/* binding */ withRequestsMadeViaParent), /* harmony export */ withXsrfConfiguration: () => (/* binding */ withXsrfConfiguration) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 40072); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 14975); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ 31050); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ 59380); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs/operators */ 88412); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs/operators */ 38442); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ 86110); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs */ 57417); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs */ 84356); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs */ 98241); /* harmony import */ var _xhr_chunk_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./_xhr-chunk.mjs */ 22153); /* harmony import */ var _platform_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./_platform_location-chunk.mjs */ 51490); /** * @license Angular v21.1.2 * (c) 2010-2026 Google LLC. https://angular.dev/ * License: MIT */ class HttpHeaders { headers; normalizedNames = new Map(); lazyInit; lazyUpdate = null; constructor(headers) { if (!headers) { this.headers = new Map(); } else if (typeof headers === 'string') { this.lazyInit = () => { this.headers = new Map(); headers.split('\n').forEach(line => { const index = line.indexOf(':'); if (index > 0) { const name = line.slice(0, index); const value = line.slice(index + 1).trim(); this.addHeaderEntry(name, value); } }); }; } else if (typeof Headers !== 'undefined' && headers instanceof Headers) { this.headers = new Map(); headers.forEach((value, name) => { this.addHeaderEntry(name, value); }); } else { this.lazyInit = () => { if (typeof ngDevMode === 'undefined' || ngDevMode) { assertValidHeaders(headers); } this.headers = new Map(); Object.entries(headers).forEach(([name, values]) => { this.setHeaderEntries(name, values); }); }; } } has(name) { this.init(); return this.headers.has(name.toLowerCase()); } get(name) { this.init(); const values = this.headers.get(name.toLowerCase()); return values && values.length > 0 ? values[0] : null; } keys() { this.init(); return Array.from(this.normalizedNames.values()); } getAll(name) { this.init(); return this.headers.get(name.toLowerCase()) || null; } append(name, value) { return this.clone({ name, value, op: 'a' }); } set(name, value) { return this.clone({ name, value, op: 's' }); } delete(name, value) { return this.clone({ name, value, op: 'd' }); } maybeSetNormalizedName(name, lcName) { if (!this.normalizedNames.has(lcName)) { this.normalizedNames.set(lcName, name); } } init() { if (!!this.lazyInit) { if (this.lazyInit instanceof HttpHeaders) { this.copyFrom(this.lazyInit); } else { this.lazyInit(); } this.lazyInit = null; if (!!this.lazyUpdate) { this.lazyUpdate.forEach(update => this.applyUpdate(update)); this.lazyUpdate = null; } } } copyFrom(other) { other.init(); Array.from(other.headers.keys()).forEach(key => { this.headers.set(key, other.headers.get(key)); this.normalizedNames.set(key, other.normalizedNames.get(key)); }); } clone(update) { const clone = new HttpHeaders(); clone.lazyInit = !!this.lazyInit && this.lazyInit instanceof HttpHeaders ? this.lazyInit : this; clone.lazyUpdate = (this.lazyUpdate || []).concat([update]); return clone; } applyUpdate(update) { const key = update.name.toLowerCase(); switch (update.op) { case 'a': case 's': let value = update.value; if (typeof value === 'string') { value = [value]; } if (value.length === 0) { return; } this.maybeSetNormalizedName(update.name, key); const base = (update.op === 'a' ? this.headers.get(key) : undefined) || []; base.push(...value); this.headers.set(key, base); break; case 'd': const toDelete = update.value; if (!toDelete) { this.headers.delete(key); this.normalizedNames.delete(key); } else { let existing = this.headers.get(key); if (!existing) { return; } existing = existing.filter(value => toDelete.indexOf(value) === -1); if (existing.length === 0) { this.headers.delete(key); this.normalizedNames.delete(key); } else { this.headers.set(key, existing); } } break; } } addHeaderEntry(name, value) { const key = name.toLowerCase(); this.maybeSetNormalizedName(name, key); if (this.headers.has(key)) { this.headers.get(key).push(value); } else { this.headers.set(key, [value]); } } setHeaderEntries(name, values) { const headerValues = (Array.isArray(values) ? values : [values]).map(value => value.toString()); const key = name.toLowerCase(); this.headers.set(key, headerValues); this.maybeSetNormalizedName(name, key); } forEach(fn) { this.init(); Array.from(this.normalizedNames.keys()).forEach(key => fn(this.normalizedNames.get(key), this.headers.get(key))); } } function assertValidHeaders(headers) { for (const [key, value] of Object.entries(headers)) { if (!(typeof value === 'string' || typeof value === 'number') && !Array.isArray(value)) { throw new Error(`Unexpected value of the \`${key}\` header provided. ` + `Expecting either a string, a number or an array, but got: \`${value}\`.`); } } } class HttpContextToken { defaultValue; constructor(defaultValue) { this.defaultValue = defaultValue; } } class HttpContext { map = new Map(); set(token, value) { this.map.set(token, value); return this; } get(token) { if (!this.map.has(token)) { this.map.set(token, token.defaultValue()); } return this.map.get(token); } delete(token) { this.map.delete(token); return this; } has(token) { return this.map.has(token); } keys() { return this.map.keys(); } } class HttpUrlEncodingCodec { encodeKey(key) { return standardEncoding(key); } encodeValue(value) { return standardEncoding(value); } decodeKey(key) { return decodeURIComponent(key); } decodeValue(value) { return decodeURIComponent(value); } } function paramParser(rawParams, codec) { const map = new Map(); if (rawParams.length > 0) { const params = rawParams.replace(/^\?/, '').split('&'); params.forEach(param => { const eqIdx = param.indexOf('='); const [key, val] = eqIdx == -1 ? [codec.decodeKey(param), ''] : [codec.decodeKey(param.slice(0, eqIdx)), codec.decodeValue(param.slice(eqIdx + 1))]; const list = map.get(key) || []; list.push(val); map.set(key, list); }); } return map; } const STANDARD_ENCODING_REGEX = /%(\d[a-f0-9])/gi; const STANDARD_ENCODING_REPLACEMENTS = { '40': '@', '3A': ':', '24': '$', '2C': ',', '3B': ';', '3D': '=', '3F': '?', '2F': '/' }; function standardEncoding(v) { return encodeURIComponent(v).replace(STANDARD_ENCODING_REGEX, (s, t) => STANDARD_ENCODING_REPLACEMENTS[t] ?? s); } function valueToString(value) { return `${value}`; } class HttpParams { map; encoder; updates = null; cloneFrom = null; constructor(options = {}) { this.encoder = options.encoder || new HttpUrlEncodingCodec(); if (options.fromString) { if (options.fromObject) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2805, ngDevMode && 'Cannot specify both fromString and fromObject.'); } this.map = paramParser(options.fromString, this.encoder); } else if (!!options.fromObject) { this.map = new Map(); Object.keys(options.fromObject).forEach(key => { const value = options.fromObject[key]; const values = Array.isArray(value) ? value.map(valueToString) : [valueToString(value)]; this.map.set(key, values); }); } else { this.map = null; } } has(param) { this.init(); return this.map.has(param); } get(param) { this.init(); const res = this.map.get(param); return !!res ? res[0] : null; } getAll(param) { this.init(); return this.map.get(param) || null; } keys() { this.init(); return Array.from(this.map.keys()); } append(param, value) { return this.clone({ param, value, op: 'a' }); } appendAll(params) { const updates = []; Object.keys(params).forEach(param => { const value = params[param]; if (Array.isArray(value)) { value.forEach(_value => { updates.push({ param, value: _value, op: 'a' }); }); } else { updates.push({ param, value: value, op: 'a' }); } }); return this.clone(updates); } set(param, value) { return this.clone({ param, value, op: 's' }); } delete(param, value) { return this.clone({ param, value, op: 'd' }); } toString() { this.init(); return this.keys().map(key => { const eKey = this.encoder.encodeKey(key); return this.map.get(key).map(value => eKey + '=' + this.encoder.encodeValue(value)).join('&'); }).filter(param => param !== '').join('&'); } clone(update) { const clone = new HttpParams({ encoder: this.encoder }); clone.cloneFrom = this.cloneFrom || this; clone.updates = (this.updates || []).concat(update); return clone; } init() { if (this.map === null) { this.map = new Map(); } if (this.cloneFrom !== null) { this.cloneFrom.init(); this.cloneFrom.keys().forEach(key => this.map.set(key, this.cloneFrom.map.get(key))); this.updates.forEach(update => { switch (update.op) { case 'a': case 's': const base = (update.op === 'a' ? this.map.get(update.param) : undefined) || []; base.push(valueToString(update.value)); this.map.set(update.param, base); break; case 'd': if (update.value !== undefined) { let base = this.map.get(update.param) || []; const idx = base.indexOf(valueToString(update.value)); if (idx !== -1) { base.splice(idx, 1); } if (base.length > 0) { this.map.set(update.param, base); } else { this.map.delete(update.param); } } else { this.map.delete(update.param); break; } } }); this.cloneFrom = this.updates = null; } } } function mightHaveBody(method) { switch (method) { case 'DELETE': case 'GET': case 'HEAD': case 'OPTIONS': case 'JSONP': return false; default: return true; } } function isArrayBuffer(value) { return typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer; } function isBlob(value) { return typeof Blob !== 'undefined' && value instanceof Blob; } function isFormData(value) { return typeof FormData !== 'undefined' && value instanceof FormData; } function isUrlSearchParams(value) { return typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams; } const CONTENT_TYPE_HEADER = 'Content-Type'; const ACCEPT_HEADER = 'Accept'; const TEXT_CONTENT_TYPE = 'text/plain'; const JSON_CONTENT_TYPE = 'application/json'; const ACCEPT_HEADER_VALUE = `${JSON_CONTENT_TYPE}, ${TEXT_CONTENT_TYPE}, */*`; class HttpRequest { url; body = null; headers; context; reportProgress = false; withCredentials = false; credentials; keepalive = false; cache; priority; mode; redirect; referrer; integrity; referrerPolicy; responseType = 'json'; method; params; urlWithParams; transferCache; timeout; constructor(method, url, third, fourth) { this.url = url; this.method = method.toUpperCase(); let options; if (mightHaveBody(this.method) || !!fourth) { this.body = third !== undefined ? third : null; options = fourth; } else { options = third; } if (options) { this.reportProgress = !!options.reportProgress; this.withCredentials = !!options.withCredentials; this.keepalive = !!options.keepalive; if (!!options.responseType) { this.responseType = options.responseType; } if (options.headers) { this.headers = options.headers; } if (options.context) { this.context = options.context; } if (options.params) { this.params = options.params; } if (options.priority) { this.priority = options.priority; } if (options.cache) { this.cache = options.cache; } if (options.credentials) { this.credentials = options.credentials; } if (typeof options.timeout === 'number') { if (options.timeout < 1 || !Number.isInteger(options.timeout)) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2822, ngDevMode ? '`timeout` must be a positive integer value' : ''); } this.timeout = options.timeout; } if (options.mode) { this.mode = options.mode; } if (options.redirect) { this.redirect = options.redirect; } if (options.integrity) { this.integrity = options.integrity; } if (options.referrer) { this.referrer = options.referrer; } if (options.referrerPolicy) { this.referrerPolicy = options.referrerPolicy; } this.transferCache = options.transferCache; } this.headers ??= new HttpHeaders(); this.context ??= new HttpContext(); if (!this.params) { this.params = new HttpParams(); this.urlWithParams = url; } else { const params = this.params.toString(); if (params.length === 0) { this.urlWithParams = url; } else { const qIdx = url.indexOf('?'); const sep = qIdx === -1 ? '?' : qIdx < url.length - 1 ? '&' : ''; this.urlWithParams = url + sep + params; } } } serializeBody() { if (this.body === null) { return null; } if (typeof this.body === 'string' || isArrayBuffer(this.body) || isBlob(this.body) || isFormData(this.body) || isUrlSearchParams(this.body)) { return this.body; } if (this.body instanceof HttpParams) { return this.body.toString(); } if (typeof this.body === 'object' || typeof this.body === 'boolean' || Array.isArray(this.body)) { return JSON.stringify(this.body); } return this.body.toString(); } detectContentTypeHeader() { if (this.body === null) { return null; } if (isFormData(this.body)) { return null; } if (isBlob(this.body)) { return this.body.type || null; } if (isArrayBuffer(this.body)) { return null; } if (typeof this.body === 'string') { return TEXT_CONTENT_TYPE; } if (this.body instanceof HttpParams) { return 'application/x-www-form-urlencoded;charset=UTF-8'; } if (typeof this.body === 'object' || typeof this.body === 'number' || typeof this.body === 'boolean') { return JSON_CONTENT_TYPE; } return null; } clone(update = {}) { const method = update.method || this.method; const url = update.url || this.url; const responseType = update.responseType || this.responseType; const keepalive = update.keepalive ?? this.keepalive; const priority = update.priority || this.priority; const cache = update.cache || this.cache; const mode = update.mode || this.mode; const redirect = update.redirect || this.redirect; const credentials = update.credentials || this.credentials; const referrer = update.referrer || this.referrer; const integrity = update.integrity || this.integrity; const referrerPolicy = update.referrerPolicy || this.referrerPolicy; const transferCache = update.transferCache ?? this.transferCache; const timeout = update.timeout ?? this.timeout; const body = update.body !== undefined ? update.body : this.body; const withCredentials = update.withCredentials ?? this.withCredentials; const reportProgress = update.reportProgress ?? this.reportProgress; let headers = update.headers || this.headers; let params = update.params || this.params; const context = update.context ?? this.context; if (update.setHeaders !== undefined) { headers = Object.keys(update.setHeaders).reduce((headers, name) => headers.set(name, update.setHeaders[name]), headers); } if (update.setParams) { params = Object.keys(update.setParams).reduce((params, param) => params.set(param, update.setParams[param]), params); } return new HttpRequest(method, url, body, { params, headers, context, reportProgress, responseType, withCredentials, transferCache, keepalive, cache, priority, timeout, mode, redirect, credentials, referrer, integrity, referrerPolicy }); } } var HttpEventType; (function (HttpEventType) { HttpEventType[HttpEventType["Sent"] = 0] = "Sent"; HttpEventType[HttpEventType["UploadProgress"] = 1] = "UploadProgress"; HttpEventType[HttpEventType["ResponseHeader"] = 2] = "ResponseHeader"; HttpEventType[HttpEventType["DownloadProgress"] = 3] = "DownloadProgress"; HttpEventType[HttpEventType["Response"] = 4] = "Response"; HttpEventType[HttpEventType["User"] = 5] = "User"; })(HttpEventType || (HttpEventType = {})); class HttpResponseBase { headers; status; statusText; url; ok; type; redirected; responseType; constructor(init, defaultStatus = 200, defaultStatusText = 'OK') { this.headers = init.headers || new HttpHeaders(); this.status = init.status !== undefined ? init.status : defaultStatus; this.statusText = init.statusText || defaultStatusText; this.url = init.url || null; this.redirected = init.redirected; this.responseType = init.responseType; this.ok = this.status >= 200 && this.status < 300; } } class HttpHeaderResponse extends HttpResponseBase { constructor(init = {}) { super(init); } type = HttpEventType.ResponseHeader; clone(update = {}) { return new HttpHeaderResponse({ headers: update.headers || this.headers, status: update.status !== undefined ? update.status : this.status, statusText: update.statusText || this.statusText, url: update.url || this.url || undefined }); } } class HttpResponse extends HttpResponseBase { body; constructor(init = {}) { super(init); this.body = init.body !== undefined ? init.body : null; } type = HttpEventType.Response; clone(update = {}) { return new HttpResponse({ body: update.body !== undefined ? update.body : this.body, headers: update.headers || this.headers, status: update.status !== undefined ? update.status : this.status, statusText: update.statusText || this.statusText, url: update.url || this.url || undefined, redirected: update.redirected ?? this.redirected, responseType: update.responseType ?? this.responseType }); } } class HttpErrorResponse extends HttpResponseBase { name = 'HttpErrorResponse'; message; error; ok = false; constructor(init) { super(init, 0, 'Unknown Error'); if (this.status >= 200 && this.status < 300) { this.message = `Http failure during parsing for ${init.url || '(unknown url)'}`; } else { this.message = `Http failure response for ${init.url || '(unknown url)'}: ${init.status} ${init.statusText}`; } this.error = init.error || null; } } const HTTP_STATUS_CODE_OK = 200; const HTTP_STATUS_CODE_NO_CONTENT = 204; var HttpStatusCode; (function (HttpStatusCode) { HttpStatusCode[HttpStatusCode["Continue"] = 100] = "Continue"; HttpStatusCode[HttpStatusCode["SwitchingProtocols"] = 101] = "SwitchingProtocols"; HttpStatusCode[HttpStatusCode["Processing"] = 102] = "Processing"; HttpStatusCode[HttpStatusCode["EarlyHints"] = 103] = "EarlyHints"; HttpStatusCode[HttpStatusCode["Ok"] = 200] = "Ok"; HttpStatusCode[HttpStatusCode["Created"] = 201] = "Created"; HttpStatusCode[HttpStatusCode["Accepted"] = 202] = "Accepted"; HttpStatusCode[HttpStatusCode["NonAuthoritativeInformation"] = 203] = "NonAuthoritativeInformation"; HttpStatusCode[HttpStatusCode["NoContent"] = 204] = "NoContent"; HttpStatusCode[HttpStatusCode["ResetContent"] = 205] = "ResetContent"; HttpStatusCode[HttpStatusCode["PartialContent"] = 206] = "PartialContent"; HttpStatusCode[HttpStatusCode["MultiStatus"] = 207] = "MultiStatus"; HttpStatusCode[HttpStatusCode["AlreadyReported"] = 208] = "AlreadyReported"; HttpStatusCode[HttpStatusCode["ImUsed"] = 226] = "ImUsed"; HttpStatusCode[HttpStatusCode["MultipleChoices"] = 300] = "MultipleChoices"; HttpStatusCode[HttpStatusCode["MovedPermanently"] = 301] = "MovedPermanently"; HttpStatusCode[HttpStatusCode["Found"] = 302] = "Found"; HttpStatusCode[HttpStatusCode["SeeOther"] = 303] = "SeeOther"; HttpStatusCode[HttpStatusCode["NotModified"] = 304] = "NotModified"; HttpStatusCode[HttpStatusCode["UseProxy"] = 305] = "UseProxy"; HttpStatusCode[HttpStatusCode["Unused"] = 306] = "Unused"; HttpStatusCode[HttpStatusCode["TemporaryRedirect"] = 307] = "TemporaryRedirect"; HttpStatusCode[HttpStatusCode["PermanentRedirect"] = 308] = "PermanentRedirect"; HttpStatusCode[HttpStatusCode["BadRequest"] = 400] = "BadRequest"; HttpStatusCode[HttpStatusCode["Unauthorized"] = 401] = "Unauthorized"; HttpStatusCode[HttpStatusCode["PaymentRequired"] = 402] = "PaymentRequired"; HttpStatusCode[HttpStatusCode["Forbidden"] = 403] = "Forbidden"; HttpStatusCode[HttpStatusCode["NotFound"] = 404] = "NotFound"; HttpStatusCode[HttpStatusCode["MethodNotAllowed"] = 405] = "MethodNotAllowed"; HttpStatusCode[HttpStatusCode["NotAcceptable"] = 406] = "NotAcceptable"; HttpStatusCode[HttpStatusCode["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired"; HttpStatusCode[HttpStatusCode["RequestTimeout"] = 408] = "RequestTimeout"; HttpStatusCode[HttpStatusCode["Conflict"] = 409] = "Conflict"; HttpStatusCode[HttpStatusCode["Gone"] = 410] = "Gone"; HttpStatusCode[HttpStatusCode["LengthRequired"] = 411] = "LengthRequired"; HttpStatusCode[HttpStatusCode["PreconditionFailed"] = 412] = "PreconditionFailed"; HttpStatusCode[HttpStatusCode["PayloadTooLarge"] = 413] = "PayloadTooLarge"; HttpStatusCode[HttpStatusCode["UriTooLong"] = 414] = "UriTooLong"; HttpStatusCode[HttpStatusCode["UnsupportedMediaType"] = 415] = "UnsupportedMediaType"; HttpStatusCode[HttpStatusCode["RangeNotSatisfiable"] = 416] = "RangeNotSatisfiable"; HttpStatusCode[HttpStatusCode["ExpectationFailed"] = 417] = "ExpectationFailed"; HttpStatusCode[HttpStatusCode["ImATeapot"] = 418] = "ImATeapot"; HttpStatusCode[HttpStatusCode["MisdirectedRequest"] = 421] = "MisdirectedRequest"; HttpStatusCode[HttpStatusCode["UnprocessableEntity"] = 422] = "UnprocessableEntity"; HttpStatusCode[HttpStatusCode["Locked"] = 423] = "Locked"; HttpStatusCode[HttpStatusCode["FailedDependency"] = 424] = "FailedDependency"; HttpStatusCode[HttpStatusCode["TooEarly"] = 425] = "TooEarly"; HttpStatusCode[HttpStatusCode["UpgradeRequired"] = 426] = "UpgradeRequired"; HttpStatusCode[HttpStatusCode["PreconditionRequired"] = 428] = "PreconditionRequired"; HttpStatusCode[HttpStatusCode["TooManyRequests"] = 429] = "TooManyRequests"; HttpStatusCode[HttpStatusCode["RequestHeaderFieldsTooLarge"] = 431] = "RequestHeaderFieldsTooLarge"; HttpStatusCode[HttpStatusCode["UnavailableForLegalReasons"] = 451] = "UnavailableForLegalReasons"; HttpStatusCode[HttpStatusCode["InternalServerError"] = 500] = "InternalServerError"; HttpStatusCode[HttpStatusCode["NotImplemented"] = 501] = "NotImplemented"; HttpStatusCode[HttpStatusCode["BadGateway"] = 502] = "BadGateway"; HttpStatusCode[HttpStatusCode["ServiceUnavailable"] = 503] = "ServiceUnavailable"; HttpStatusCode[HttpStatusCode["GatewayTimeout"] = 504] = "GatewayTimeout"; HttpStatusCode[HttpStatusCode["HttpVersionNotSupported"] = 505] = "HttpVersionNotSupported"; HttpStatusCode[HttpStatusCode["VariantAlsoNegotiates"] = 506] = "VariantAlsoNegotiates"; HttpStatusCode[HttpStatusCode["InsufficientStorage"] = 507] = "InsufficientStorage"; HttpStatusCode[HttpStatusCode["LoopDetected"] = 508] = "LoopDetected"; HttpStatusCode[HttpStatusCode["NotExtended"] = 510] = "NotExtended"; HttpStatusCode[HttpStatusCode["NetworkAuthenticationRequired"] = 511] = "NetworkAuthenticationRequired"; })(HttpStatusCode || (HttpStatusCode = {})); const XSSI_PREFIX$1 = /^\)\]\}',?\n/; const FETCH_BACKEND = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'FETCH_BACKEND' : ''); class FetchBackend { fetchImpl = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(FetchFactory, { optional: true })?.fetch ?? ((...args) => globalThis.fetch(...args)); ngZone = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.NgZone); destroyRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.DestroyRef); handle(request) { return new rxjs__WEBPACK_IMPORTED_MODULE_8__.Observable(observer => { const aborter = new AbortController(); this.doRequest(request, aborter.signal, observer).then(noop, error => observer.error(new HttpErrorResponse({ error }))); let timeoutId; if (request.timeout) { timeoutId = this.ngZone.runOutsideAngular(() => setTimeout(() => { if (!aborter.signal.aborted) { aborter.abort(new DOMException('signal timed out', 'TimeoutError')); } }, request.timeout)); } return () => { if (timeoutId !== undefined) { clearTimeout(timeoutId); } aborter.abort(); }; }); } doRequest(request, signal, observer) { var _this = this; return (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { const init = _this.createRequestInit(request); let response; try { const fetchPromise = _this.ngZone.runOutsideAngular(() => _this.fetchImpl(request.urlWithParams, { signal, ...init })); silenceSuperfluousUnhandledPromiseRejection(fetchPromise); observer.next({ type: HttpEventType.Sent }); response = yield fetchPromise; } catch (error) { observer.error(new HttpErrorResponse({ error, status: error.status ?? 0, statusText: error.statusText, url: request.urlWithParams, headers: error.headers })); return; } const headers = new HttpHeaders(response.headers); const statusText = response.statusText; const url = response.url || request.urlWithParams; let status = response.status; let body = null; if (request.reportProgress) { observer.next(new HttpHeaderResponse({ headers, status, statusText, url })); } if (response.body) { const contentLength = response.headers.get('content-length'); const chunks = []; const reader = response.body.getReader(); let receivedLength = 0; let decoder; let partialText; const reqZone = typeof Zone !== 'undefined' && Zone.current; let canceled = false; yield _this.ngZone.runOutsideAngular(/*#__PURE__*/(0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { while (true) { if (_this.destroyRef.destroyed) { yield reader.cancel(); canceled = true; break; } const { done, value } = yield reader.read(); if (done) { break; } chunks.push(value); receivedLength += value.length; if (request.reportProgress) { partialText = request.responseType === 'text' ? (partialText ?? '') + (decoder ??= new TextDecoder()).decode(value, { stream: true }) : undefined; const reportProgress = () => observer.next({ type: HttpEventType.DownloadProgress, total: contentLength ? +contentLength : undefined, loaded: receivedLength, partialText }); reqZone ? reqZone.run(reportProgress) : reportProgress(); } } })); if (canceled) { observer.complete(); return; } const chunksAll = _this.concatChunks(chunks, receivedLength); try { const contentType = response.headers.get(CONTENT_TYPE_HEADER) ?? ''; body = _this.parseBody(request, chunksAll, contentType, status); } catch (error) { observer.error(new HttpErrorResponse({ error, headers: new HttpHeaders(response.headers), status: response.status, statusText: response.statusText, url: response.url || request.urlWithParams })); return; } } if (status === 0) { status = body ? HTTP_STATUS_CODE_OK : 0; } const ok = status >= 200 && status < 300; const redirected = response.redirected; const responseType = response.type; if (ok) { observer.next(new HttpResponse({ body, headers, status, statusText, url, redirected, responseType })); observer.complete(); } else { observer.error(new HttpErrorResponse({ error: body, headers, status, statusText, url, redirected, responseType })); } })(); } parseBody(request, binContent, contentType, status) { switch (request.responseType) { case 'json': const text = new TextDecoder().decode(binContent).replace(XSSI_PREFIX$1, ''); if (text === '') { return null; } try { return JSON.parse(text); } catch (e) { if (status < 200 || status >= 300) { return text; } throw e; } case 'text': return new TextDecoder().decode(binContent); case 'blob': return new Blob([binContent], { type: contentType }); case 'arraybuffer': return binContent.buffer; } } createRequestInit(req) { const headers = {}; let credentials; credentials = req.credentials; if (req.withCredentials) { (typeof ngDevMode === 'undefined' || ngDevMode) && warningOptionsMessage(req); credentials = 'include'; } req.headers.forEach((name, values) => headers[name] = values.join(',')); if (!req.headers.has(ACCEPT_HEADER)) { headers[ACCEPT_HEADER] = ACCEPT_HEADER_VALUE; } if (!req.headers.has(CONTENT_TYPE_HEADER)) { const detectedType = req.detectContentTypeHeader(); if (detectedType !== null) { headers[CONTENT_TYPE_HEADER] = detectedType; } } return { body: req.serializeBody(), method: req.method, headers, credentials, keepalive: req.keepalive, cache: req.cache, priority: req.priority, mode: req.mode, redirect: req.redirect, referrer: req.referrer, integrity: req.integrity, referrerPolicy: req.referrerPolicy }; } concatChunks(chunks, totalLength) { const chunksAll = new Uint8Array(totalLength); let position = 0; for (const chunk of chunks) { chunksAll.set(chunk, position); position += chunk.length; } return chunksAll; } static ɵfac = function FetchBackend_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || FetchBackend)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: FetchBackend, factory: FetchBackend.ɵfac }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(FetchBackend, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Injectable }], null, null); })(); class FetchFactory {} function noop() {} function warningOptionsMessage(req) { if (req.credentials && req.withCredentials) { console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.formatRuntimeError)(2819, `Angular detected that a \`HttpClient\` request has both \`withCredentials: true\` and \`credentials: '${req.credentials}'\` options. The \`withCredentials\` option is overriding the explicit \`credentials\` setting to 'include'. Consider removing \`withCredentials\` and using \`credentials: '${req.credentials}'\` directly for clarity.`)); } } function silenceSuperfluousUnhandledPromiseRejection(promise) { promise.then(noop, noop); } const XSSI_PREFIX = /^\)\]\}',?\n/; function validateXhrCompatibility(req) { const unsupportedOptions = [{ property: 'keepalive', errorCode: 2813 }, { property: 'cache', errorCode: 2814 }, { property: 'priority', errorCode: 2815 }, { property: 'mode', errorCode: 2816 }, { property: 'redirect', errorCode: 2817 }, { property: 'credentials', errorCode: 2818 }, { property: 'integrity', errorCode: 2820 }, { property: 'referrer', errorCode: 2821 }, { property: 'referrerPolicy', errorCode: 2823 }]; for (const { property, errorCode } of unsupportedOptions) { if (req[property]) { console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.formatRuntimeError)(errorCode, `Angular detected that a \`HttpClient\` request with the \`${property}\` option was sent using XHR, which does not support it. To use the \`${property}\` option, enable Fetch API support by passing \`withFetch()\` as an argument to \`provideHttpClient()\`.`)); } } } class HttpXhrBackend { xhrFactory; tracingService = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.TracingService, { optional: true }); constructor(xhrFactory) { this.xhrFactory = xhrFactory; } maybePropagateTrace(fn) { return this.tracingService?.propagate ? this.tracingService.propagate(fn) : fn; } handle(req) { if (req.method === 'JSONP') { throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(-2800, (typeof ngDevMode === 'undefined' || ngDevMode) && `Cannot make a JSONP request without JSONP support. To fix the problem, either add the \`withJsonpSupport()\` call (if \`provideHttpClient()\` is used) or import the \`HttpClientJsonpModule\` in the root NgModule.`); } ngDevMode && validateXhrCompatibility(req); const xhrFactory = this.xhrFactory; const source = typeof ngServerMode !== 'undefined' && ngServerMode && xhrFactory.ɵloadImpl ? (0,rxjs__WEBPACK_IMPORTED_MODULE_9__.from)(xhrFactory.ɵloadImpl()) : (0,rxjs__WEBPACK_IMPORTED_MODULE_10__.of)(null); return source.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.switchMap)(() => { return new rxjs__WEBPACK_IMPORTED_MODULE_8__.Observable(observer => { const xhr = xhrFactory.build(); xhr.open(req.method, req.urlWithParams); if (req.withCredentials) { xhr.withCredentials = true; } req.headers.forEach((name, values) => xhr.setRequestHeader(name, values.join(','))); if (!req.headers.has(ACCEPT_HEADER)) { xhr.setRequestHeader(ACCEPT_HEADER, ACCEPT_HEADER_VALUE); } if (!req.headers.has(CONTENT_TYPE_HEADER)) { const detectedType = req.detectContentTypeHeader(); if (detectedType !== null) { xhr.setRequestHeader(CONTENT_TYPE_HEADER, detectedType); } } if (req.timeout) { xhr.timeout = req.timeout; } if (req.responseType) { const responseType = req.responseType.toLowerCase(); xhr.responseType = responseType !== 'json' ? responseType : 'text'; } const reqBody = req.serializeBody(); let headerResponse = null; const partialFromXhr = () => { if (headerResponse !== null) { return headerResponse; } const statusText = xhr.statusText || 'OK'; const headers = new HttpHeaders(xhr.getAllResponseHeaders()); const url = xhr.responseURL || req.url; headerResponse = new HttpHeaderResponse({ headers, status: xhr.status, statusText, url }); return headerResponse; }; const onLoad = this.maybePropagateTrace(() => { let { headers, status, statusText, url } = partialFromXhr(); let body = null; if (status !== HTTP_STATUS_CODE_NO_CONTENT) { body = typeof xhr.response === 'undefined' ? xhr.responseText : xhr.response; } if (status === 0) { status = !!body ? HTTP_STATUS_CODE_OK : 0; } let ok = status >= 200 && status < 300; if (req.responseType === 'json' && typeof body === 'string') { const originalBody = body; body = body.replace(XSSI_PREFIX, ''); try { body = body !== '' ? JSON.parse(body) : null; } catch (error) { body = originalBody; if (ok) { ok = false; body = { error, text: body }; } } } if (ok) { observer.next(new HttpResponse({ body, headers, status, statusText, url: url || undefined })); observer.complete(); } else { observer.error(new HttpErrorResponse({ error: body, headers, status, statusText, url: url || undefined })); } }); const onError = this.maybePropagateTrace(error => { const { url } = partialFromXhr(); const res = new HttpErrorResponse({ error, status: xhr.status || 0, statusText: xhr.statusText || 'Unknown Error', url: url || undefined }); observer.error(res); }); let onTimeout = onError; if (req.timeout) { onTimeout = this.maybePropagateTrace(_ => { const { url } = partialFromXhr(); const res = new HttpErrorResponse({ error: new DOMException('Request timed out', 'TimeoutError'), status: xhr.status || 0, statusText: xhr.statusText || 'Request timeout', url: url || undefined }); observer.error(res); }); } let sentHeaders = false; const onDownProgress = this.maybePropagateTrace(event => { if (!sentHeaders) { observer.next(partialFromXhr()); sentHeaders = true; } let progressEvent = { type: HttpEventType.DownloadProgress, loaded: event.loaded }; if (event.lengthComputable) { progressEvent.total = event.total; } if (req.responseType === 'text' && !!xhr.responseText) { progressEvent.partialText = xhr.responseText; } observer.next(progressEvent); }); const onUpProgress = this.maybePropagateTrace(event => { let progress = { type: HttpEventType.UploadProgress, loaded: event.loaded }; if (event.lengthComputable) { progress.total = event.total; } observer.next(progress); }); xhr.addEventListener('load', onLoad); xhr.addEventListener('error', onError); xhr.addEventListener('timeout', onTimeout); xhr.addEventListener('abort', onError); if (req.reportProgress) { xhr.addEventListener('progress', onDownProgress); if (reqBody !== null && xhr.upload) { xhr.upload.addEventListener('progress', onUpProgress); } } xhr.send(reqBody); observer.next({ type: HttpEventType.Sent }); return () => { xhr.removeEventListener('error', onError); xhr.removeEventListener('abort', onError); xhr.removeEventListener('load', onLoad); xhr.removeEventListener('timeout', onTimeout); if (req.reportProgress) { xhr.removeEventListener('progress', onDownProgress); if (reqBody !== null && xhr.upload) { xhr.upload.removeEventListener('progress', onUpProgress); } } if (xhr.readyState !== xhr.DONE) { xhr.abort(); } }; }); })); } static ɵfac = function HttpXhrBackend_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HttpXhrBackend)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_xhr_chunk_mjs__WEBPACK_IMPORTED_MODULE_11__.XhrFactory)); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: HttpXhrBackend, factory: HttpXhrBackend.ɵfac, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(HttpXhrBackend, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Injectable, args: [{ providedIn: 'root' }] }], () => [{ type: _xhr_chunk_mjs__WEBPACK_IMPORTED_MODULE_11__.XhrFactory }], null); })(); function interceptorChainEndFn(req, finalHandlerFn) { return finalHandlerFn(req); } function adaptLegacyInterceptorToChain(chainTailFn, interceptor) { return (initialRequest, finalHandlerFn) => interceptor.intercept(initialRequest, { handle: downstreamRequest => chainTailFn(downstreamRequest, finalHandlerFn) }); } function chainedInterceptorFn(chainTailFn, interceptorFn, injector) { return (initialRequest, finalHandlerFn) => (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.runInInjectionContext)(injector, () => interceptorFn(initialRequest, downstreamRequest => chainTailFn(downstreamRequest, finalHandlerFn))); } const HTTP_INTERCEPTORS = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'HTTP_INTERCEPTORS' : ''); const HTTP_INTERCEPTOR_FNS = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'HTTP_INTERCEPTOR_FNS' : '', { factory: () => [] }); const HTTP_ROOT_INTERCEPTOR_FNS = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'HTTP_ROOT_INTERCEPTOR_FNS' : ''); const REQUESTS_CONTRIBUTE_TO_STABILITY = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'REQUESTS_CONTRIBUTE_TO_STABILITY' : '', { factory: () => true }); function legacyInterceptorFnFactory() { let chain = null; return (req, handler) => { if (chain === null) { const interceptors = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(HTTP_INTERCEPTORS, { optional: true }) ?? []; chain = interceptors.reduceRight(adaptLegacyInterceptorToChain, interceptorChainEndFn); } const pendingTasks = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.PendingTasks); const contributeToStability = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(REQUESTS_CONTRIBUTE_TO_STABILITY); if (contributeToStability) { const removeTask = pendingTasks.add(); return chain(req, handler).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.finalize)(removeTask)); } else { return chain(req, handler); } }; } class HttpBackend { static ɵfac = function HttpBackend_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HttpBackend)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: HttpBackend, factory: function HttpBackend_Factory(__ngFactoryType__) { let __ngConditionalFactory__ = null; if (__ngFactoryType__) { __ngConditionalFactory__ = new (__ngFactoryType__ || HttpBackend)(); } else { __ngConditionalFactory__ = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](HttpXhrBackend); } return __ngConditionalFactory__; }, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(HttpBackend, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Injectable, args: [{ providedIn: 'root', useExisting: HttpXhrBackend }] }], null, null); })(); let fetchBackendWarningDisplayed = false; class HttpInterceptorHandler { backend; injector; chain = null; pendingTasks = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.PendingTasks); contributeToStability = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(REQUESTS_CONTRIBUTE_TO_STABILITY); constructor(backend, injector) { this.backend = backend; this.injector = injector; if ((typeof ngDevMode === 'undefined' || ngDevMode) && !fetchBackendWarningDisplayed) { const isTestingBackend = this.backend.isTestingBackend; if (typeof ngServerMode !== 'undefined' && ngServerMode && !(this.backend instanceof FetchBackend) && !isTestingBackend) { fetchBackendWarningDisplayed = true; injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_2__.Console).warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.formatRuntimeError)(2801, 'Angular detected that `HttpClient` is not configured ' + "to use `fetch` APIs. It's strongly recommended to " + 'enable `fetch` for applications that use Server-Side Rendering ' + 'for better performance and compatibility. ' + 'To enable `fetch`, add the `withFetch()` to the `provideHttpClient()` ' + 'call at the root of the application.')); } } } handle(initialRequest) { if (this.chain === null) { const dedupedInterceptorFns = Array.from(new Set([...this.injector.get(HTTP_INTERCEPTOR_FNS), ...this.injector.get(HTTP_ROOT_INTERCEPTOR_FNS, [])])); this.chain = dedupedInterceptorFns.reduceRight((nextSequencedFn, interceptorFn) => chainedInterceptorFn(nextSequencedFn, interceptorFn, this.injector), interceptorChainEndFn); } if (this.contributeToStability) { const removeTask = this.pendingTasks.add(); return this.chain(initialRequest, downstreamRequest => this.backend.handle(downstreamRequest)).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.finalize)(removeTask)); } else { return this.chain(initialRequest, downstreamRequest => this.backend.handle(downstreamRequest)); } } static ɵfac = function HttpInterceptorHandler_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HttpInterceptorHandler)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](HttpBackend), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.EnvironmentInjector)); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: HttpInterceptorHandler, factory: HttpInterceptorHandler.ɵfac, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(HttpInterceptorHandler, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Injectable, args: [{ providedIn: 'root' }] }], () => [{ type: HttpBackend }, { type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.EnvironmentInjector }], null); })(); class HttpHandler { static ɵfac = function HttpHandler_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HttpHandler)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: HttpHandler, factory: function HttpHandler_Factory(__ngFactoryType__) { let __ngConditionalFactory__ = null; if (__ngFactoryType__) { __ngConditionalFactory__ = new (__ngFactoryType__ || HttpHandler)(); } else { __ngConditionalFactory__ = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](HttpInterceptorHandler); } return __ngConditionalFactory__; }, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(HttpHandler, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Injectable, args: [{ providedIn: 'root', useExisting: HttpInterceptorHandler }] }], null, null); })(); function addBody(options, body) { return { body, headers: options.headers, context: options.context, observe: options.observe, params: options.params, reportProgress: options.reportProgress, responseType: options.responseType, withCredentials: options.withCredentials, credentials: options.credentials, transferCache: options.transferCache, timeout: options.timeout, keepalive: options.keepalive, priority: options.priority, cache: options.cache, mode: options.mode, redirect: options.redirect, integrity: options.integrity, referrer: options.referrer, referrerPolicy: options.referrerPolicy }; } class HttpClient { handler; constructor(handler) { this.handler = handler; } request(first, url, options = {}) { let req; if (first instanceof HttpRequest) { req = first; } else { let headers = undefined; if (options.headers instanceof HttpHeaders) { headers = options.headers; } else { headers = new HttpHeaders(options.headers); } let params = undefined; if (!!options.params) { if (options.params instanceof HttpParams) { params = options.params; } else { params = new HttpParams({ fromObject: options.params }); } } req = new HttpRequest(first, url, options.body !== undefined ? options.body : null, { headers, context: options.context, params, reportProgress: options.reportProgress, responseType: options.responseType || 'json', withCredentials: options.withCredentials, transferCache: options.transferCache, keepalive: options.keepalive, priority: options.priority, cache: options.cache, mode: options.mode, redirect: options.redirect, credentials: options.credentials, referrer: options.referrer, referrerPolicy: options.referrerPolicy, integrity: options.integrity, timeout: options.timeout }); } const events$ = (0,rxjs__WEBPACK_IMPORTED_MODULE_10__.of)(req).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.concatMap)(req => this.handler.handle(req))); if (first instanceof HttpRequest || options.observe === 'events') { return events$; } const res$ = events$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.filter)(event => event instanceof HttpResponse)); switch (options.observe || 'body') { case 'body': switch (req.responseType) { case 'arraybuffer': return res$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.map)(res => { if (res.body !== null && !(res.body instanceof ArrayBuffer)) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2806, ngDevMode && 'Response is not an ArrayBuffer.'); } return res.body; })); case 'blob': return res$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.map)(res => { if (res.body !== null && !(res.body instanceof Blob)) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2807, ngDevMode && 'Response is not a Blob.'); } return res.body; })); case 'text': return res$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.map)(res => { if (res.body !== null && typeof res.body !== 'string') { throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2808, ngDevMode && 'Response is not a string.'); } return res.body; })); case 'json': default: return res$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.map)(res => res.body)); } case 'response': return res$; default: throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2809, ngDevMode && `Unreachable: unhandled observe type ${options.observe}}`); } } delete(url, options = {}) { return this.request('DELETE', url, options); } get(url, options = {}) { return this.request('GET', url, options); } head(url, options = {}) { return this.request('HEAD', url, options); } jsonp(url, callbackParam) { return this.request('JSONP', url, { params: new HttpParams().append(callbackParam, 'JSONP_CALLBACK'), observe: 'body', responseType: 'json' }); } options(url, options = {}) { return this.request('OPTIONS', url, options); } patch(url, body, options = {}) { return this.request('PATCH', url, addBody(options, body)); } post(url, body, options = {}) { return this.request('POST', url, addBody(options, body)); } put(url, body, options = {}) { return this.request('PUT', url, addBody(options, body)); } static ɵfac = function HttpClient_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HttpClient)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](HttpHandler)); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: HttpClient, factory: HttpClient.ɵfac, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(HttpClient, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Injectable, args: [{ providedIn: 'root' }] }], () => [{ type: HttpHandler }], null); })(); let nextRequestId = 0; let foreignDocument; const JSONP_ERR_NO_CALLBACK = 'JSONP injected script did not invoke callback.'; const JSONP_ERR_WRONG_METHOD = 'JSONP requests must use JSONP request method.'; const JSONP_ERR_WRONG_RESPONSE_TYPE = 'JSONP requests must use Json response type.'; const JSONP_ERR_HEADERS_NOT_SUPPORTED = 'JSONP requests do not support headers.'; class JsonpCallbackContext {} function jsonpCallbackContext() { if (typeof window === 'object') { return window; } return {}; } class JsonpClientBackend { callbackMap; document; resolvedPromise = Promise.resolve(); constructor(callbackMap, document) { this.callbackMap = callbackMap; this.document = document; } nextCallback() { return `ng_jsonp_callback_${nextRequestId++}`; } handle(req) { if (req.method !== 'JSONP') { throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2810, ngDevMode && JSONP_ERR_WRONG_METHOD); } else if (req.responseType !== 'json') { throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2811, ngDevMode && JSONP_ERR_WRONG_RESPONSE_TYPE); } if (req.headers.keys().length > 0) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2812, ngDevMode && JSONP_ERR_HEADERS_NOT_SUPPORTED); } return new rxjs__WEBPACK_IMPORTED_MODULE_8__.Observable(observer => { const callback = this.nextCallback(); const url = req.urlWithParams.replace(/=JSONP_CALLBACK(&|$)/, `=${callback}$1`); const node = this.document.createElement('script'); node.src = url; let body = null; let finished = false; this.callbackMap[callback] = data => { delete this.callbackMap[callback]; body = data; finished = true; }; const cleanup = () => { node.removeEventListener('load', onLoad); node.removeEventListener('error', onError); node.remove(); delete this.callbackMap[callback]; }; const onLoad = () => { this.resolvedPromise.then(() => { cleanup(); if (!finished) { observer.error(new HttpErrorResponse({ url, status: 0, statusText: 'JSONP Error', error: new Error(JSONP_ERR_NO_CALLBACK) })); return; } observer.next(new HttpResponse({ body, status: HTTP_STATUS_CODE_OK, statusText: 'OK', url })); observer.complete(); }); }; const onError = error => { cleanup(); observer.error(new HttpErrorResponse({ error, status: 0, statusText: 'JSONP Error', url })); }; node.addEventListener('load', onLoad); node.addEventListener('error', onError); this.document.body.appendChild(node); observer.next({ type: HttpEventType.Sent }); return () => { if (!finished) { this.removeListeners(node); } cleanup(); }; }); } removeListeners(script) { foreignDocument ??= this.document.implementation.createHTMLDocument(); foreignDocument.adoptNode(script); } static ɵfac = function JsonpClientBackend_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || JsonpClientBackend)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](JsonpCallbackContext), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.DOCUMENT)); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: JsonpClientBackend, factory: JsonpClientBackend.ɵfac }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(JsonpClientBackend, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Injectable }], () => [{ type: JsonpCallbackContext }, { type: undefined, decorators: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject, args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__.DOCUMENT] }] }], null); })(); function jsonpInterceptorFn(req, next) { if (req.method === 'JSONP') { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(JsonpClientBackend).handle(req); } return next(req); } class JsonpInterceptor { injector; constructor(injector) { this.injector = injector; } intercept(initialRequest, next) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.runInInjectionContext)(this.injector, () => jsonpInterceptorFn(initialRequest, downstreamRequest => next.handle(downstreamRequest))); } static ɵfac = function JsonpInterceptor_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || JsonpInterceptor)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.EnvironmentInjector)); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: JsonpInterceptor, factory: JsonpInterceptor.ɵfac }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(JsonpInterceptor, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Injectable }], () => [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.EnvironmentInjector }], null); })(); const XSRF_ENABLED = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'XSRF_ENABLED' : '', { factory: () => true }); const XSRF_DEFAULT_COOKIE_NAME = 'XSRF-TOKEN'; const XSRF_COOKIE_NAME = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'XSRF_COOKIE_NAME' : '', { factory: () => XSRF_DEFAULT_COOKIE_NAME }); const XSRF_DEFAULT_HEADER_NAME = 'X-XSRF-TOKEN'; const XSRF_HEADER_NAME = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'XSRF_HEADER_NAME' : '', { factory: () => XSRF_DEFAULT_HEADER_NAME }); class HttpXsrfCookieExtractor { cookieName = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(XSRF_COOKIE_NAME); doc = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.DOCUMENT); lastCookieString = ''; lastToken = null; parseCount = 0; getToken() { if (typeof ngServerMode !== 'undefined' && ngServerMode) { return null; } const cookieString = this.doc.cookie || ''; if (cookieString !== this.lastCookieString) { this.parseCount++; this.lastToken = (0,_xhr_chunk_mjs__WEBPACK_IMPORTED_MODULE_11__.parseCookieValue)(cookieString, this.cookieName); this.lastCookieString = cookieString; } return this.lastToken; } static ɵfac = function HttpXsrfCookieExtractor_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HttpXsrfCookieExtractor)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: HttpXsrfCookieExtractor, factory: HttpXsrfCookieExtractor.ɵfac, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(HttpXsrfCookieExtractor, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Injectable, args: [{ providedIn: 'root' }] }], null, null); })(); class HttpXsrfTokenExtractor { static ɵfac = function HttpXsrfTokenExtractor_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HttpXsrfTokenExtractor)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: HttpXsrfTokenExtractor, factory: function HttpXsrfTokenExtractor_Factory(__ngFactoryType__) { let __ngConditionalFactory__ = null; if (__ngFactoryType__) { __ngConditionalFactory__ = new (__ngFactoryType__ || HttpXsrfTokenExtractor)(); } else { __ngConditionalFactory__ = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](HttpXsrfCookieExtractor); } return __ngConditionalFactory__; }, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(HttpXsrfTokenExtractor, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Injectable, args: [{ providedIn: 'root', useExisting: HttpXsrfCookieExtractor }] }], null, null); })(); function xsrfInterceptorFn(req, next) { if (!(0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(XSRF_ENABLED) || req.method === 'GET' || req.method === 'HEAD') { return next(req); } try { const locationHref = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_platform_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_12__.PlatformLocation).href; const { origin: locationOrigin } = new URL(locationHref); const { origin: requestOrigin } = new URL(req.url, locationOrigin); if (locationOrigin !== requestOrigin) { return next(req); } } catch { return next(req); } const token = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(HttpXsrfTokenExtractor).getToken(); const headerName = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(XSRF_HEADER_NAME); if (token != null && !req.headers.has(headerName)) { req = req.clone({ headers: req.headers.set(headerName, token) }); } return next(req); } class HttpXsrfInterceptor { injector = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.EnvironmentInjector); intercept(initialRequest, next) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.runInInjectionContext)(this.injector, () => xsrfInterceptorFn(initialRequest, downstreamRequest => next.handle(downstreamRequest))); } static ɵfac = function HttpXsrfInterceptor_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HttpXsrfInterceptor)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ token: HttpXsrfInterceptor, factory: HttpXsrfInterceptor.ɵfac }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(HttpXsrfInterceptor, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Injectable }], null, null); })(); var HttpFeatureKind; (function (HttpFeatureKind) { HttpFeatureKind[HttpFeatureKind["Interceptors"] = 0] = "Interceptors"; HttpFeatureKind[HttpFeatureKind["LegacyInterceptors"] = 1] = "LegacyInterceptors"; HttpFeatureKind[HttpFeatureKind["CustomXsrfConfiguration"] = 2] = "CustomXsrfConfiguration"; HttpFeatureKind[HttpFeatureKind["NoXsrfProtection"] = 3] = "NoXsrfProtection"; HttpFeatureKind[HttpFeatureKind["JsonpSupport"] = 4] = "JsonpSupport"; HttpFeatureKind[HttpFeatureKind["RequestsMadeViaParent"] = 5] = "RequestsMadeViaParent"; HttpFeatureKind[HttpFeatureKind["Fetch"] = 6] = "Fetch"; })(HttpFeatureKind || (HttpFeatureKind = {})); function makeHttpFeature(kind, providers) { return { ɵkind: kind, ɵproviders: providers }; } function provideHttpClient(...features) { if (ngDevMode) { const featureKinds = new Set(features.map(f => f.ɵkind)); if (featureKinds.has(HttpFeatureKind.NoXsrfProtection) && featureKinds.has(HttpFeatureKind.CustomXsrfConfiguration)) { throw new Error(ngDevMode ? `Configuration error: found both withXsrfConfiguration() and withNoXsrfProtection() in the same call to provideHttpClient(), which is a contradiction.` : ''); } } const providers = [HttpClient, HttpInterceptorHandler, { provide: HttpHandler, useExisting: HttpInterceptorHandler }, { provide: HttpBackend, useFactory: () => { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(FETCH_BACKEND, { optional: true }) ?? (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(HttpXhrBackend); } }, { provide: HTTP_INTERCEPTOR_FNS, useValue: xsrfInterceptorFn, multi: true }]; for (const feature of features) { providers.push(...feature.ɵproviders); } return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.makeEnvironmentProviders)(providers); } function withInterceptors(interceptorFns) { return makeHttpFeature(HttpFeatureKind.Interceptors, interceptorFns.map(interceptorFn => { return { provide: HTTP_INTERCEPTOR_FNS, useValue: interceptorFn, multi: true }; })); } const LEGACY_INTERCEPTOR_FN = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'LEGACY_INTERCEPTOR_FN' : ''); function withInterceptorsFromDi() { return makeHttpFeature(HttpFeatureKind.LegacyInterceptors, [{ provide: LEGACY_INTERCEPTOR_FN, useFactory: legacyInterceptorFnFactory }, { provide: HTTP_INTERCEPTOR_FNS, useExisting: LEGACY_INTERCEPTOR_FN, multi: true }]); } function withXsrfConfiguration({ cookieName, headerName }) { const providers = []; if (cookieName !== undefined) { providers.push({ provide: XSRF_COOKIE_NAME, useValue: cookieName }); } if (headerName !== undefined) { providers.push({ provide: XSRF_HEADER_NAME, useValue: headerName }); } return makeHttpFeature(HttpFeatureKind.CustomXsrfConfiguration, providers); } function withNoXsrfProtection() { return makeHttpFeature(HttpFeatureKind.NoXsrfProtection, [{ provide: XSRF_ENABLED, useValue: false }]); } function withJsonpSupport() { return makeHttpFeature(HttpFeatureKind.JsonpSupport, [JsonpClientBackend, { provide: JsonpCallbackContext, useFactory: jsonpCallbackContext }, { provide: HTTP_INTERCEPTOR_FNS, useValue: jsonpInterceptorFn, multi: true }]); } function withRequestsMadeViaParent() { return makeHttpFeature(HttpFeatureKind.RequestsMadeViaParent, [{ provide: HttpBackend, useFactory: () => { const handlerFromParent = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(HttpHandler, { skipSelf: true, optional: true }); if (ngDevMode && handlerFromParent === null) { throw new Error('withRequestsMadeViaParent() can only be used when the parent injector also configures HttpClient'); } return handlerFromParent; } }]); } function withFetch() { return makeHttpFeature(HttpFeatureKind.Fetch, [FetchBackend, { provide: FETCH_BACKEND, useExisting: FetchBackend }, { provide: HttpBackend, useExisting: FetchBackend }]); } class HttpClientXsrfModule { static disable() { return { ngModule: HttpClientXsrfModule, providers: [withNoXsrfProtection().ɵproviders] }; } static withOptions(options = {}) { return { ngModule: HttpClientXsrfModule, providers: withXsrfConfiguration(options).ɵproviders }; } static ɵfac = function HttpClientXsrfModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HttpClientXsrfModule)(); }; static ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineNgModule"]({ type: HttpClientXsrfModule }); static ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({ providers: [HttpXsrfInterceptor, { provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true }, { provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor }, withXsrfConfiguration({ cookieName: XSRF_DEFAULT_COOKIE_NAME, headerName: XSRF_DEFAULT_HEADER_NAME }).ɵproviders, { provide: XSRF_ENABLED, useValue: true }] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(HttpClientXsrfModule, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.NgModule, args: [{ providers: [HttpXsrfInterceptor, { provide: HTTP_INTERCEPTORS, useExisting: HttpXsrfInterceptor, multi: true }, { provide: HttpXsrfTokenExtractor, useClass: HttpXsrfCookieExtractor }, withXsrfConfiguration({ cookieName: XSRF_DEFAULT_COOKIE_NAME, headerName: XSRF_DEFAULT_HEADER_NAME }).ɵproviders, { provide: XSRF_ENABLED, useValue: true }] }] }], null, null); })(); class HttpClientModule { static ɵfac = function HttpClientModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HttpClientModule)(); }; static ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineNgModule"]({ type: HttpClientModule }); static ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({ providers: [provideHttpClient(withInterceptorsFromDi())] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(HttpClientModule, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.NgModule, args: [{ providers: [provideHttpClient(withInterceptorsFromDi())] }] }], null, null); })(); class HttpClientJsonpModule { static ɵfac = function HttpClientJsonpModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || HttpClientJsonpModule)(); }; static ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineNgModule"]({ type: HttpClientJsonpModule }); static ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({ providers: [withJsonpSupport().ɵproviders] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__.setClassMetadata(HttpClientJsonpModule, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.NgModule, args: [{ providers: [withJsonpSupport().ɵproviders] }] }], null, null); })(); /***/ }, /***/ 51490 /*!****************************************************************************!*\ !*** ./node_modules/@angular/common/fesm2022/_platform_location-chunk.mjs ***! \****************************************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ BrowserPlatformLocation: () => (/* binding */ BrowserPlatformLocation), /* harmony export */ DomAdapter: () => (/* binding */ DomAdapter), /* harmony export */ LOCATION_INITIALIZED: () => (/* binding */ LOCATION_INITIALIZED), /* harmony export */ PlatformLocation: () => (/* binding */ PlatformLocation), /* harmony export */ getDOM: () => (/* binding */ getDOM), /* harmony export */ setRootDomAdapter: () => (/* binding */ setRootDomAdapter) /* harmony export */ }); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 40072); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 14975); /** * @license Angular v21.1.2 * (c) 2010-2026 Google LLC. https://angular.dev/ * License: MIT */ let _DOM = null; function getDOM() { return _DOM; } function setRootDomAdapter(adapter) { _DOM ??= adapter; } class DomAdapter {} class PlatformLocation { historyGo(relativePosition) { throw new Error(ngDevMode ? 'Not implemented' : ''); } static ɵfac = function PlatformLocation_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PlatformLocation)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: PlatformLocation, factory: () => (() => (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(BrowserPlatformLocation))(), providedIn: 'platform' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(PlatformLocation, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable, args: [{ providedIn: 'platform', useFactory: () => (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(BrowserPlatformLocation) }] }], null, null); })(); const LOCATION_INITIALIZED = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'Location Initialized' : ''); class BrowserPlatformLocation extends PlatformLocation { _location; _history; _doc = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.DOCUMENT); constructor() { super(); this._location = window.location; this._history = window.history; } getBaseHrefFromDOM() { return getDOM().getBaseHref(this._doc); } onPopState(fn) { const window = getDOM().getGlobalEventTarget(this._doc, 'window'); window.addEventListener('popstate', fn, false); return () => window.removeEventListener('popstate', fn); } onHashChange(fn) { const window = getDOM().getGlobalEventTarget(this._doc, 'window'); window.addEventListener('hashchange', fn, false); return () => window.removeEventListener('hashchange', fn); } get href() { return this._location.href; } get protocol() { return this._location.protocol; } get hostname() { return this._location.hostname; } get port() { return this._location.port; } get pathname() { return this._location.pathname; } get search() { return this._location.search; } get hash() { return this._location.hash; } set pathname(newPath) { this._location.pathname = newPath; } pushState(state, title, url) { this._history.pushState(state, title, url); } replaceState(state, title, url) { this._history.replaceState(state, title, url); } forward() { this._history.forward(); } back() { this._history.back(); } historyGo(relativePosition = 0) { this._history.go(relativePosition); } getState() { return this._history.state; } static ɵfac = function BrowserPlatformLocation_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || BrowserPlatformLocation)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: BrowserPlatformLocation, factory: () => (() => new BrowserPlatformLocation())(), providedIn: 'platform' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(BrowserPlatformLocation, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable, args: [{ providedIn: 'platform', useFactory: () => new BrowserPlatformLocation() }] }], () => [], null); })(); /***/ }, /***/ 19557 /*!******************************************************************************!*\ !*** ./node_modules/@angular/common/fesm2022/_platform_navigation-chunk.mjs ***! \******************************************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ PRECOMMIT_HANDLER_SUPPORTED: () => (/* binding */ PRECOMMIT_HANDLER_SUPPORTED), /* harmony export */ PlatformNavigation: () => (/* binding */ PlatformNavigation) /* harmony export */ }); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 40072); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 14975); /** * @license Angular v21.1.2 * (c) 2010-2026 Google LLC. https://angular.dev/ * License: MIT */ const PRECOMMIT_HANDLER_SUPPORTED = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('', { factory: () => { return typeof window !== 'undefined' && typeof window.NavigationPrecommitController !== 'undefined'; } }); class PlatformNavigation { static ɵfac = function PlatformNavigation_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PlatformNavigation)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({ token: PlatformNavigation, factory: () => (() => window.navigation)(), providedIn: 'platform' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__.setClassMetadata(PlatformNavigation, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable, args: [{ providedIn: 'platform', useFactory: () => window.navigation }] }], null, null); })(); /***/ }, /***/ 22153 /*!**************************************************************!*\ !*** ./node_modules/@angular/common/fesm2022/_xhr-chunk.mjs ***! \**************************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ XhrFactory: () => (/* binding */ XhrFactory), /* harmony export */ parseCookieValue: () => (/* binding */ parseCookieValue) /* harmony export */ }); /** * @license Angular v21.1.2 * (c) 2010-2026 Google LLC. https://angular.dev/ * License: MIT */ function parseCookieValue(cookieStr, name) { name = encodeURIComponent(name); for (const cookie of cookieStr.split(';')) { const eqIndex = cookie.indexOf('='); const [cookieName, cookieValue] = eqIndex == -1 ? [cookie, ''] : [cookie.slice(0, eqIndex), cookie.slice(eqIndex + 1)]; if (cookieName.trim() === name) { return decodeURIComponent(cookieValue); } } return null; } class XhrFactory {} /***/ }, /***/ 13333 /*!**********************************************************!*\ !*** ./node_modules/@angular/common/fesm2022/common.mjs ***! \**********************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ APP_BASE_HREF: () => (/* reexport safe */ _location_chunk_mjs__WEBPACK_IMPORTED_MODULE_7__.APP_BASE_HREF), /* harmony export */ AsyncPipe: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.AsyncPipe), /* harmony export */ BrowserPlatformLocation: () => (/* reexport safe */ _platform_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_8__.BrowserPlatformLocation), /* harmony export */ CommonModule: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CommonModule), /* harmony export */ CurrencyPipe: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CurrencyPipe), /* harmony export */ DATE_PIPE_DEFAULT_OPTIONS: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DATE_PIPE_DEFAULT_OPTIONS), /* harmony export */ DATE_PIPE_DEFAULT_TIMEZONE: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DATE_PIPE_DEFAULT_TIMEZONE), /* harmony export */ DOCUMENT: () => (/* reexport safe */ _angular_core__WEBPACK_IMPORTED_MODULE_2__.DOCUMENT), /* harmony export */ DatePipe: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DatePipe), /* harmony export */ DecimalPipe: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DecimalPipe), /* harmony export */ FormStyle: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FormStyle), /* harmony export */ FormatWidth: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FormatWidth), /* harmony export */ HashLocationStrategy: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HashLocationStrategy), /* harmony export */ I18nPluralPipe: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.I18nPluralPipe), /* harmony export */ I18nSelectPipe: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.I18nSelectPipe), /* harmony export */ IMAGE_CONFIG: () => (/* reexport safe */ _angular_core__WEBPACK_IMPORTED_MODULE_3__.IMAGE_CONFIG), /* harmony export */ IMAGE_LOADER: () => (/* binding */ IMAGE_LOADER), /* harmony export */ JsonPipe: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.JsonPipe), /* harmony export */ KeyValuePipe: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.KeyValuePipe), /* harmony export */ LOCATION_INITIALIZED: () => (/* reexport safe */ _platform_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_8__.LOCATION_INITIALIZED), /* harmony export */ Location: () => (/* reexport safe */ _location_chunk_mjs__WEBPACK_IMPORTED_MODULE_7__.Location), /* harmony export */ LocationStrategy: () => (/* reexport safe */ _location_chunk_mjs__WEBPACK_IMPORTED_MODULE_7__.LocationStrategy), /* harmony export */ LowerCasePipe: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.LowerCasePipe), /* harmony export */ NgClass: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgClass), /* harmony export */ NgComponentOutlet: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgComponentOutlet), /* harmony export */ NgFor: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgForOf), /* harmony export */ NgForOf: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgForOf), /* harmony export */ NgForOfContext: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgForOfContext), /* harmony export */ NgIf: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgIf), /* harmony export */ NgIfContext: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgIfContext), /* harmony export */ NgLocaleLocalization: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgLocaleLocalization), /* harmony export */ NgLocalization: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgLocalization), /* harmony export */ NgOptimizedImage: () => (/* binding */ NgOptimizedImage), /* harmony export */ NgPlural: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgPlural), /* harmony export */ NgPluralCase: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgPluralCase), /* harmony export */ NgStyle: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgStyle), /* harmony export */ NgSwitch: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgSwitch), /* harmony export */ NgSwitchCase: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgSwitchCase), /* harmony export */ NgSwitchDefault: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgSwitchDefault), /* harmony export */ NgTemplateOutlet: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgTemplateOutlet), /* harmony export */ NumberFormatStyle: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NumberFormatStyle), /* harmony export */ NumberSymbol: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NumberSymbol), /* harmony export */ PRECONNECT_CHECK_BLOCKLIST: () => (/* binding */ PRECONNECT_CHECK_BLOCKLIST), /* harmony export */ PathLocationStrategy: () => (/* reexport safe */ _location_chunk_mjs__WEBPACK_IMPORTED_MODULE_7__.PathLocationStrategy), /* harmony export */ PercentPipe: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PercentPipe), /* harmony export */ PlatformLocation: () => (/* reexport safe */ _platform_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_8__.PlatformLocation), /* harmony export */ PlatformNavigation: () => (/* reexport safe */ _platform_navigation_chunk_mjs__WEBPACK_IMPORTED_MODULE_5__.PlatformNavigation), /* harmony export */ Plural: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.Plural), /* harmony export */ SlicePipe: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.SlicePipe), /* harmony export */ TitleCasePipe: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TitleCasePipe), /* harmony export */ TranslationWidth: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TranslationWidth), /* harmony export */ UpperCasePipe: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.UpperCasePipe), /* harmony export */ VERSION: () => (/* binding */ VERSION), /* harmony export */ ViewportScroller: () => (/* binding */ ViewportScroller), /* harmony export */ WeekDay: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.WeekDay), /* harmony export */ XhrFactory: () => (/* reexport safe */ _xhr_chunk_mjs__WEBPACK_IMPORTED_MODULE_6__.XhrFactory), /* harmony export */ formatCurrency: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.formatCurrency), /* harmony export */ formatDate: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.formatDate), /* harmony export */ formatNumber: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.formatNumber), /* harmony export */ formatPercent: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.formatPercent), /* harmony export */ getCurrencySymbol: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrencySymbol), /* harmony export */ getLocaleCurrencyCode: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocaleCurrencyCode), /* harmony export */ getLocaleCurrencyName: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocaleCurrencyName), /* harmony export */ getLocaleCurrencySymbol: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocaleCurrencySymbol), /* harmony export */ getLocaleDateFormat: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocaleDateFormat), /* harmony export */ getLocaleDateTimeFormat: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocaleDateTimeFormat), /* harmony export */ getLocaleDayNames: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocaleDayNames), /* harmony export */ getLocaleDayPeriods: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocaleDayPeriods), /* harmony export */ getLocaleDirection: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocaleDirection), /* harmony export */ getLocaleEraNames: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocaleEraNames), /* harmony export */ getLocaleExtraDayPeriodRules: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocaleExtraDayPeriodRules), /* harmony export */ getLocaleExtraDayPeriods: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocaleExtraDayPeriods), /* harmony export */ getLocaleFirstDayOfWeek: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocaleFirstDayOfWeek), /* harmony export */ getLocaleId: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocaleId), /* harmony export */ getLocaleMonthNames: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocaleMonthNames), /* harmony export */ getLocaleNumberFormat: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocaleNumberFormat), /* harmony export */ getLocaleNumberSymbol: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocaleNumberSymbol), /* harmony export */ getLocalePluralCase: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocalePluralCase), /* harmony export */ getLocaleTimeFormat: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocaleTimeFormat), /* harmony export */ getLocaleWeekEndRange: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLocaleWeekEndRange), /* harmony export */ getNumberOfCurrencyDigits: () => (/* reexport safe */ _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNumberOfCurrencyDigits), /* harmony export */ isPlatformBrowser: () => (/* binding */ isPlatformBrowser), /* harmony export */ isPlatformServer: () => (/* binding */ isPlatformServer), /* harmony export */ provideCloudflareLoader: () => (/* binding */ provideCloudflareLoader), /* harmony export */ provideCloudinaryLoader: () => (/* binding */ provideCloudinaryLoader), /* harmony export */ provideImageKitLoader: () => (/* binding */ provideImageKitLoader), /* harmony export */ provideImgixLoader: () => (/* binding */ provideImgixLoader), /* harmony export */ provideNetlifyLoader: () => (/* binding */ provideNetlifyLoader), /* harmony export */ registerLocaleData: () => (/* binding */ registerLocaleData), /* harmony export */ "ɵDomAdapter": () => (/* reexport safe */ _platform_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_8__.DomAdapter), /* harmony export */ "ɵNavigationAdapterForLocation": () => (/* binding */ NavigationAdapterForLocation), /* harmony export */ "ɵNullViewportScroller": () => (/* binding */ NullViewportScroller), /* harmony export */ "ɵPLATFORM_BROWSER_ID": () => (/* binding */ PLATFORM_BROWSER_ID), /* harmony export */ "ɵPLATFORM_SERVER_ID": () => (/* binding */ PLATFORM_SERVER_ID), /* harmony export */ "ɵPRECOMMIT_HANDLER_SUPPORTED": () => (/* reexport safe */ _platform_navigation_chunk_mjs__WEBPACK_IMPORTED_MODULE_5__.PRECOMMIT_HANDLER_SUPPORTED), /* harmony export */ "ɵgetDOM": () => (/* reexport safe */ _platform_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_8__.getDOM), /* harmony export */ "ɵnormalizeQueryParams": () => (/* reexport safe */ _location_chunk_mjs__WEBPACK_IMPORTED_MODULE_7__.normalizeQueryParams), /* harmony export */ "ɵparseCookieValue": () => (/* reexport safe */ _xhr_chunk_mjs__WEBPACK_IMPORTED_MODULE_6__.parseCookieValue), /* harmony export */ "ɵsetRootDomAdapter": () => (/* reexport safe */ _platform_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_8__.setRootDomAdapter) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _common_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_common_module-chunk.mjs */ 32229); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 40072); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 14975); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/core */ 36973); /* harmony import */ var _platform_navigation_chunk_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./_platform_navigation-chunk.mjs */ 19557); /* harmony import */ var _xhr_chunk_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_xhr-chunk.mjs */ 22153); /* harmony import */ var _location_chunk_mjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./_location-chunk.mjs */ 25180); /* harmony import */ var _platform_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./_platform_location-chunk.mjs */ 51490); /** * @license Angular v21.1.2 * (c) 2010-2026 Google LLC. https://angular.dev/ * License: MIT */ class NavigationAdapterForLocation extends _location_chunk_mjs__WEBPACK_IMPORTED_MODULE_7__.Location { navigation = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_platform_navigation_chunk_mjs__WEBPACK_IMPORTED_MODULE_5__.PlatformNavigation); destroyRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.DestroyRef); constructor() { super((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_7__.LocationStrategy)); this.registerNavigationListeners(); } registerNavigationListeners() { const currentEntryChangeListener = () => { this._notifyUrlChangeListeners(this.path(true), this.getState()); }; this.navigation.addEventListener('currententrychange', currentEntryChangeListener); this.destroyRef.onDestroy(() => { this.navigation.removeEventListener('currententrychange', currentEntryChangeListener); }); } getState() { return this.navigation.currentEntry?.getState(); } replaceState(path, query = '', state = null) { const url = this.prepareExternalUrl(path + (0,_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_7__.normalizeQueryParams)(query)); this.navigation.navigate(url, { state, history: 'replace' }); } go(path, query = '', state = null) { const url = this.prepareExternalUrl(path + (0,_location_chunk_mjs__WEBPACK_IMPORTED_MODULE_7__.normalizeQueryParams)(query)); this.navigation.navigate(url, { state, history: 'push' }); } back() { this.navigation.back(); } forward() { this.navigation.forward(); } onUrlChange(fn) { this._urlChangeListeners.push(fn); return () => { const fnIndex = this._urlChangeListeners.indexOf(fn); this._urlChangeListeners.splice(fnIndex, 1); }; } static ɵfac = function NavigationAdapterForLocation_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NavigationAdapterForLocation)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjectable"]({ token: NavigationAdapterForLocation, factory: NavigationAdapterForLocation.ɵfac }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_3__.setClassMetadata(NavigationAdapterForLocation, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Injectable }], () => [], null); })(); function registerLocaleData(data, localeId, extraData) { return (0,_angular_core__WEBPACK_IMPORTED_MODULE_3__.registerLocaleData)(data, localeId, extraData); } const PLATFORM_BROWSER_ID = 'browser'; const PLATFORM_SERVER_ID = 'server'; function isPlatformBrowser(platformId) { return platformId === PLATFORM_BROWSER_ID; } function isPlatformServer(platformId) { return platformId === PLATFORM_SERVER_ID; } const VERSION = /* @__PURE__ */new _angular_core__WEBPACK_IMPORTED_MODULE_2__.Version('21.1.2'); class ViewportScroller { static ɵprov = /* @__PURE__ */ (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjectable"])({ token: ViewportScroller, providedIn: 'root', factory: () => typeof ngServerMode !== 'undefined' && ngServerMode ? new NullViewportScroller() : new BrowserViewportScroller((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.DOCUMENT), window) }); } class BrowserViewportScroller { document; window; offset = () => [0, 0]; constructor(document, window) { this.document = document; this.window = window; } setOffset(offset) { if (Array.isArray(offset)) { this.offset = () => offset; } else { this.offset = offset; } } getScrollPosition() { return [this.window.scrollX, this.window.scrollY]; } scrollToPosition(position, options) { this.window.scrollTo({ ...options, left: position[0], top: position[1] }); } scrollToAnchor(target, options) { const elSelected = findAnchorFromDocument(this.document, target); if (elSelected) { this.scrollToElement(elSelected, options); elSelected.focus(); } } setHistoryScrollRestoration(scrollRestoration) { try { this.window.history.scrollRestoration = scrollRestoration; } catch { console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.formatRuntimeError)(2400, ngDevMode && 'Failed to set `window.history.scrollRestoration`. ' + 'This may occur when:\n' + '• The script is running inside a sandboxed iframe\n' + '• The window is partially navigated or inactive\n' + '• The script is executed in an untrusted or special context (e.g., test runners, browser extensions, or content previews)\n' + 'Scroll position may not be preserved across navigation.')); } } scrollToElement(el, options) { const rect = el.getBoundingClientRect(); const left = rect.left + this.window.pageXOffset; const top = rect.top + this.window.pageYOffset; const offset = this.offset(); this.window.scrollTo({ ...options, left: left - offset[0], top: top - offset[1] }); } } function findAnchorFromDocument(document, target) { const documentResult = document.getElementById(target) || document.getElementsByName(target)[0]; if (documentResult) { return documentResult; } if (typeof document.createTreeWalker === 'function' && document.body && typeof document.body.attachShadow === 'function') { const treeWalker = document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT); let currentNode = treeWalker.currentNode; while (currentNode) { const shadowRoot = currentNode.shadowRoot; if (shadowRoot) { const result = shadowRoot.getElementById(target) || shadowRoot.querySelector(`[name="${target}"]`); if (result) { return result; } } currentNode = treeWalker.nextNode(); } } return null; } class NullViewportScroller { setOffset(offset) {} getScrollPosition() { return [0, 0]; } scrollToPosition(position) {} scrollToAnchor(anchor) {} setHistoryScrollRestoration(scrollRestoration) {} } const PLACEHOLDER_QUALITY = '20'; function getUrl(src, win) { return isAbsoluteUrl(src) ? new URL(src) : new URL(src, win.location.href); } function isAbsoluteUrl(src) { return /^https?:\/\//.test(src); } function extractHostname(url) { return isAbsoluteUrl(url) ? new URL(url).hostname : url; } function isValidPath(path) { const isString = typeof path === 'string'; if (!isString || path.trim() === '') { return false; } try { const url = new URL(path); return true; } catch { return false; } } function normalizePath(path) { return path.endsWith('/') ? path.slice(0, -1) : path; } function normalizeSrc(src) { return src.startsWith('/') ? src.slice(1) : src; } const noopImageLoader = config => config.src; const IMAGE_LOADER = new _angular_core__WEBPACK_IMPORTED_MODULE_2__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'ImageLoader' : '', { factory: () => noopImageLoader }); function createImageLoader(buildUrlFn, exampleUrls) { return function provideImageLoader(path) { if (!isValidPath(path)) { throwInvalidPathError(path, exampleUrls || []); } path = normalizePath(path); const loaderFn = config => { if (isAbsoluteUrl(config.src)) { throwUnexpectedAbsoluteUrlError(path, config.src); } return buildUrlFn(path, { ...config, src: normalizeSrc(config.src) }); }; const providers = [{ provide: IMAGE_LOADER, useValue: loaderFn }]; return providers; }; } function throwInvalidPathError(path, exampleUrls) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2959, ngDevMode && `Image loader has detected an invalid path (\`${path}\`). ` + `To fix this, supply a path using one of the following formats: ${exampleUrls.join(' or ')}`); } function throwUnexpectedAbsoluteUrlError(path, url) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2959, ngDevMode && `Image loader has detected a \`\` tag with an invalid \`ngSrc\` attribute: ${url}. ` + `This image loader expects \`ngSrc\` to be a relative URL - ` + `however the provided value is an absolute URL. ` + `To fix this, provide \`ngSrc\` as a path relative to the base URL ` + `configured for this loader (\`${path}\`).`); } function normalizeLoaderTransform(transform, separator) { if (typeof transform === 'string') { return transform; } return Object.entries(transform).map(([key, value]) => `${key}${separator}${value}`).join(','); } const provideCloudflareLoader = createImageLoader(createCloudflareUrl, ngDevMode ? ['https:///cdn-cgi/image//'] : undefined); function createCloudflareUrl(path, config) { let params = `format=auto`; if (config.width) { params += `,width=${config.width}`; } if (config.isPlaceholder) { params += `,quality=${PLACEHOLDER_QUALITY}`; } if (config.loaderParams?.['transform']) { const transformStr = normalizeLoaderTransform(config.loaderParams['transform'], '='); params += `,${transformStr}`; } return `${path}/cdn-cgi/image/${params}/${config.src}`; } const cloudinaryLoaderInfo = { name: 'Cloudinary', testUrl: isCloudinaryUrl }; const CLOUDINARY_LOADER_REGEX = /https?\:\/\/[^\/]+\.cloudinary\.com\/.+/; function isCloudinaryUrl(url) { return CLOUDINARY_LOADER_REGEX.test(url); } const provideCloudinaryLoader = createImageLoader(createCloudinaryUrl, ngDevMode ? ['https://res.cloudinary.com/mysite', 'https://mysite.cloudinary.com', 'https://subdomain.mysite.com'] : undefined); function createCloudinaryUrl(path, config) { const quality = config.isPlaceholder ? 'q_auto:low' : 'q_auto'; let params = `f_auto,${quality}`; if (config.width) { params += `,w_${config.width}`; } if (config.loaderParams?.['rounded']) { params += `,r_max`; } if (config.loaderParams?.['transform']) { const transformStr = normalizeLoaderTransform(config.loaderParams['transform'], '_'); params += `,${transformStr}`; } return `${path}/image/upload/${params}/${config.src}`; } const imageKitLoaderInfo = { name: 'ImageKit', testUrl: isImageKitUrl }; const IMAGE_KIT_LOADER_REGEX = /https?\:\/\/[^\/]+\.imagekit\.io\/.+/; function isImageKitUrl(url) { return IMAGE_KIT_LOADER_REGEX.test(url); } const provideImageKitLoader = createImageLoader(createImagekitUrl, ngDevMode ? ['https://ik.imagekit.io/mysite', 'https://subdomain.mysite.com'] : undefined); function createImagekitUrl(path, config) { const { src, width } = config; const params = []; if (width) { params.push(`w-${width}`); } if (config.isPlaceholder) { params.push(`q-${PLACEHOLDER_QUALITY}`); } if (config.loaderParams?.['transform']) { const transformStr = normalizeLoaderTransform(config.loaderParams['transform'], '-'); params.push(transformStr); } const urlSegments = params.length ? [path, `tr:${params.join(',')}`, src] : [path, src]; const url = new URL(urlSegments.join('/')); return url.href; } const imgixLoaderInfo = { name: 'Imgix', testUrl: isImgixUrl }; const IMGIX_LOADER_REGEX = /https?\:\/\/[^\/]+\.imgix\.net\/.+/; function isImgixUrl(url) { return IMGIX_LOADER_REGEX.test(url); } const provideImgixLoader = createImageLoader(createImgixUrl, ngDevMode ? ['https://somepath.imgix.net/'] : undefined); function createImgixUrl(path, config) { const params = []; params.push('auto=format'); if (config.width) { params.push(`w=${config.width}`); } if (config.isPlaceholder) { params.push(`q=${PLACEHOLDER_QUALITY}`); } if (config.loaderParams?.['transform']) { const transform = normalizeLoaderTransform(config.loaderParams['transform'], '=').split(','); params.push(...transform); } const url = new URL(`${path}/${config.src}`); url.search = params.join('&'); return url.href; } const netlifyLoaderInfo = { name: 'Netlify', testUrl: isNetlifyUrl }; const NETLIFY_LOADER_REGEX = /https?\:\/\/[^\/]+\.netlify\.app\/.+/; function isNetlifyUrl(url) { return NETLIFY_LOADER_REGEX.test(url); } function provideNetlifyLoader(path) { if (path && !isValidPath(path)) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2959, ngDevMode && `Image loader has detected an invalid path (\`${path}\`). ` + `To fix this, supply either the full URL to the Netlify site, or leave it empty to use the current site.`); } if (path) { const url = new URL(path); path = url.origin; } const loaderFn = config => { return createNetlifyUrl(config, path); }; const providers = [{ provide: IMAGE_LOADER, useValue: loaderFn }]; return providers; } const validParams = new Map([['height', 'h'], ['fit', 'fit'], ['quality', 'q'], ['q', 'q'], ['position', 'position']]); function createNetlifyUrl(config, path) { const url = new URL(path ?? 'https://a/'); url.pathname = '/.netlify/images'; if (!isAbsoluteUrl(config.src) && !config.src.startsWith('/')) { config.src = '/' + config.src; } url.searchParams.set('url', config.src); if (config.width) { url.searchParams.set('w', config.width.toString()); } const configQuality = config.loaderParams?.['quality'] ?? config.loaderParams?.['q']; if (config.isPlaceholder && !configQuality) { url.searchParams.set('q', PLACEHOLDER_QUALITY); } for (const [param, value] of Object.entries(config.loaderParams ?? {})) { if (validParams.has(param)) { url.searchParams.set(validParams.get(param), value.toString()); } else { if (ngDevMode) { console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.formatRuntimeError)(2959, `The Netlify image loader has detected an \`\` tag with the unsupported attribute "\`${param}\`".`)); } } } return url.hostname === 'a' ? url.href.replace(url.origin, '') : url.href; } function imgDirectiveDetails(ngSrc, includeNgSrc = true) { const ngSrcInfo = includeNgSrc ? `(activated on an element with the \`ngSrc="${ngSrc}"\`) ` : ''; return `The NgOptimizedImage directive ${ngSrcInfo}has detected that`; } function assertDevMode(checkName) { if (!ngDevMode) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2958, `Unexpected invocation of the ${checkName} in the prod mode. ` + `Please make sure that the prod mode is enabled for production builds.`); } } class LCPImageObserver { images = new Map(); window = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.DOCUMENT).defaultView; observer = null; constructor() { assertDevMode('LCP checker'); if ((typeof ngServerMode === 'undefined' || !ngServerMode) && typeof PerformanceObserver !== 'undefined') { this.observer = this.initPerformanceObserver(); } } initPerformanceObserver() { const observer = new PerformanceObserver(entryList => { const entries = entryList.getEntries(); if (entries.length === 0) return; const lcpElement = entries[entries.length - 1]; const imgSrc = lcpElement.element?.src ?? ''; if (imgSrc.startsWith('data:') || imgSrc.startsWith('blob:')) return; const img = this.images.get(imgSrc); if (!img) return; if (!img.priority && !img.alreadyWarnedPriority) { img.alreadyWarnedPriority = true; logMissingPriorityError(imgSrc); } if (img.modified && !img.alreadyWarnedModified) { img.alreadyWarnedModified = true; logModifiedWarning(imgSrc); } }); observer.observe({ type: 'largest-contentful-paint', buffered: true }); return observer; } registerImage(rewrittenSrc, originalNgSrc, isPriority) { if (!this.observer) return; const newObservedImageState = { priority: isPriority, modified: false, alreadyWarnedModified: false, alreadyWarnedPriority: false }; this.images.set(getUrl(rewrittenSrc, this.window).href, newObservedImageState); } unregisterImage(rewrittenSrc) { if (!this.observer) return; this.images.delete(getUrl(rewrittenSrc, this.window).href); } updateImage(originalSrc, newSrc) { if (!this.observer) return; const originalUrl = getUrl(originalSrc, this.window).href; const img = this.images.get(originalUrl); if (img) { img.modified = true; this.images.set(getUrl(newSrc, this.window).href, img); this.images.delete(originalUrl); } } ngOnDestroy() { if (!this.observer) return; this.observer.disconnect(); this.images.clear(); } static ɵfac = function LCPImageObserver_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LCPImageObserver)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjectable"]({ token: LCPImageObserver, factory: LCPImageObserver.ɵfac, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_3__.setClassMetadata(LCPImageObserver, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Injectable, args: [{ providedIn: 'root' }] }], () => [], null); })(); function logMissingPriorityError(ngSrc) { const directiveDetails = imgDirectiveDetails(ngSrc); console.error((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.formatRuntimeError)(2955, `${directiveDetails} this image is the Largest Contentful Paint (LCP) ` + `element but was not marked "priority". This image should be marked ` + `"priority" in order to prioritize its loading. ` + `To fix this, add the "priority" attribute.`)); } function logModifiedWarning(ngSrc) { const directiveDetails = imgDirectiveDetails(ngSrc); console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.formatRuntimeError)(2964, `${directiveDetails} this image is the Largest Contentful Paint (LCP) ` + `element and has had its "ngSrc" attribute modified. This can cause ` + `slower loading performance. It is recommended not to modify the "ngSrc" ` + `property on any image which could be the LCP element.`)); } const INTERNAL_PRECONNECT_CHECK_BLOCKLIST = new Set(['localhost', '127.0.0.1', '0.0.0.0', '[::1]']); const PRECONNECT_CHECK_BLOCKLIST = new _angular_core__WEBPACK_IMPORTED_MODULE_2__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'PRECONNECT_CHECK_BLOCKLIST' : ''); class PreconnectLinkChecker { document = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.DOCUMENT); preconnectLinks = null; alreadySeen = new Set(); window = this.document.defaultView; blocklist = new Set(INTERNAL_PRECONNECT_CHECK_BLOCKLIST); constructor() { assertDevMode('preconnect link checker'); const blocklist = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(PRECONNECT_CHECK_BLOCKLIST, { optional: true }); if (blocklist) { this.populateBlocklist(blocklist); } } populateBlocklist(origins) { if (Array.isArray(origins)) { deepForEach(origins, origin => { this.blocklist.add(extractHostname(origin)); }); } else { this.blocklist.add(extractHostname(origins)); } } assertPreconnect(rewrittenSrc, originalNgSrc) { if (typeof ngServerMode !== 'undefined' && ngServerMode) return; const imgUrl = getUrl(rewrittenSrc, this.window); if (this.blocklist.has(imgUrl.hostname) || this.alreadySeen.has(imgUrl.origin)) return; this.alreadySeen.add(imgUrl.origin); this.preconnectLinks ??= this.queryPreconnectLinks(); if (!this.preconnectLinks.has(imgUrl.origin)) { console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.formatRuntimeError)(2956, `${imgDirectiveDetails(originalNgSrc)} there is no preconnect tag present for this ` + `image. Preconnecting to the origin(s) that serve priority images ensures that these ` + `images are delivered as soon as possible. To fix this, please add the following ` + `element into the of the document:\n` + ` `)); } } queryPreconnectLinks() { const preconnectUrls = new Set(); const links = this.document.querySelectorAll('link[rel=preconnect]'); for (const link of links) { const url = getUrl(link.href, this.window); preconnectUrls.add(url.origin); } return preconnectUrls; } ngOnDestroy() { this.preconnectLinks?.clear(); this.alreadySeen.clear(); } static ɵfac = function PreconnectLinkChecker_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PreconnectLinkChecker)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjectable"]({ token: PreconnectLinkChecker, factory: PreconnectLinkChecker.ɵfac, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_3__.setClassMetadata(PreconnectLinkChecker, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Injectable, args: [{ providedIn: 'root' }] }], () => [], null); })(); function deepForEach(input, fn) { for (let value of input) { Array.isArray(value) ? deepForEach(value, fn) : fn(value); } } const DEFAULT_PRELOADED_IMAGES_LIMIT = 5; const PRELOADED_IMAGES = new _angular_core__WEBPACK_IMPORTED_MODULE_2__.InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'NG_OPTIMIZED_PRELOADED_IMAGES' : '', { factory: () => new Set() }); class PreloadLinkCreator { preloadedImages = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(PRELOADED_IMAGES); document = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.DOCUMENT); errorShown = false; createPreloadLinkTag(renderer, src, srcset, sizes) { if (ngDevMode && !this.errorShown && this.preloadedImages.size >= DEFAULT_PRELOADED_IMAGES_LIMIT) { this.errorShown = true; console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.formatRuntimeError)(2961, `The \`NgOptimizedImage\` directive has detected that more than ` + `${DEFAULT_PRELOADED_IMAGES_LIMIT} images were marked as priority. ` + `This might negatively affect an overall performance of the page. ` + `To fix this, remove the "priority" attribute from images with less priority.`)); } if (this.preloadedImages.has(src)) { return; } this.preloadedImages.add(src); const preload = renderer.createElement('link'); renderer.setAttribute(preload, 'as', 'image'); renderer.setAttribute(preload, 'href', src); renderer.setAttribute(preload, 'rel', 'preload'); renderer.setAttribute(preload, 'fetchpriority', 'high'); if (sizes) { renderer.setAttribute(preload, 'imageSizes', sizes); } if (srcset) { renderer.setAttribute(preload, 'imageSrcset', srcset); } renderer.appendChild(this.document.head, preload); } static ɵfac = function PreloadLinkCreator_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PreloadLinkCreator)(); }; static ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjectable"]({ token: PreloadLinkCreator, factory: PreloadLinkCreator.ɵfac, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_3__.setClassMetadata(PreloadLinkCreator, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Injectable, args: [{ providedIn: 'root' }] }], null, null); })(); const BASE64_IMG_MAX_LENGTH_IN_ERROR = 50; const VALID_WIDTH_DESCRIPTOR_SRCSET = /^((\s*\d+w\s*(,|$)){1,})$/; const VALID_DENSITY_DESCRIPTOR_SRCSET = /^((\s*\d+(\.\d+)?x\s*(,|$)){1,})$/; const ABSOLUTE_SRCSET_DENSITY_CAP = 3; const RECOMMENDED_SRCSET_DENSITY_CAP = 2; const DENSITY_SRCSET_MULTIPLIERS = [1, 2]; const VIEWPORT_BREAKPOINT_CUTOFF = 640; const ASPECT_RATIO_TOLERANCE = 0.1; const OVERSIZED_IMAGE_TOLERANCE = 1000; const FIXED_SRCSET_WIDTH_LIMIT = 1920; const FIXED_SRCSET_HEIGHT_LIMIT = 1080; const PLACEHOLDER_DIMENSION_LIMIT = 1000; const DATA_URL_WARN_LIMIT = 4000; const DATA_URL_ERROR_LIMIT = 10000; const BUILT_IN_LOADERS = [imgixLoaderInfo, imageKitLoaderInfo, cloudinaryLoaderInfo, netlifyLoaderInfo]; const PRIORITY_COUNT_THRESHOLD = 10; let IMGS_WITH_PRIORITY_ATTR_COUNT = 0; class NgOptimizedImage { imageLoader = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(IMAGE_LOADER); config = processConfig((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_3__.IMAGE_CONFIG)); renderer = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_3__.Renderer2); imgElement = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_3__.ElementRef).nativeElement; injector = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.Injector); destroyRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.DestroyRef); lcpObserver; _renderedSrc = null; ngSrc; ngSrcset; sizes; width; height; decoding; loading; priority = false; loaderParams; disableOptimizedSrcset = false; fill = false; placeholder; placeholderConfig; src; srcset; constructor() { if (ngDevMode) { this.lcpObserver = this.injector.get(LCPImageObserver); this.destroyRef.onDestroy(() => { if (!this.priority && this._renderedSrc !== null) { this.lcpObserver.unregisterImage(this._renderedSrc); } }); } } ngOnInit() { (0,_angular_core__WEBPACK_IMPORTED_MODULE_3__.performanceMarkFeature)('NgOptimizedImage'); if (ngDevMode) { const ngZone = this.injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_2__.NgZone); assertNonEmptyInput(this, 'ngSrc', this.ngSrc); assertValidNgSrcset(this, this.ngSrcset); assertNoConflictingSrc(this); if (this.ngSrcset) { assertNoConflictingSrcset(this); } assertNotBase64Image(this); assertNotBlobUrl(this); if (this.fill) { assertEmptyWidthAndHeight(this); ngZone.runOutsideAngular(() => assertNonZeroRenderedHeight(this, this.imgElement, this.renderer, this.destroyRef)); } else { assertNonEmptyWidthAndHeight(this); if (this.height !== undefined) { assertGreaterThanZero(this, this.height, 'height'); } if (this.width !== undefined) { assertGreaterThanZero(this, this.width, 'width'); } ngZone.runOutsideAngular(() => assertNoImageDistortion(this, this.imgElement, this.renderer, this.destroyRef)); } assertValidLoadingInput(this); assertValidDecodingInput(this); if (!this.ngSrcset) { assertNoComplexSizes(this); } assertValidPlaceholder(this, this.imageLoader); assertNotMissingBuiltInLoader(this.ngSrc, this.imageLoader); assertNoNgSrcsetWithoutLoader(this, this.imageLoader); assertNoLoaderParamsWithoutLoader(this, this.imageLoader); ngZone.runOutsideAngular(() => { this.lcpObserver.registerImage(this.getRewrittenSrc(), this.ngSrc, this.priority); }); if (this.priority) { const checker = this.injector.get(PreconnectLinkChecker); checker.assertPreconnect(this.getRewrittenSrc(), this.ngSrc); if (typeof ngServerMode !== 'undefined' && !ngServerMode) { const applicationRef = this.injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_3__.ApplicationRef); assetPriorityCountBelowThreshold(applicationRef); } } } if (this.placeholder) { this.removePlaceholderOnLoad(this.imgElement); } this.setHostAttributes(); } setHostAttributes() { if (this.fill) { this.sizes ||= '100vw'; } else { this.setHostAttribute('width', this.width.toString()); this.setHostAttribute('height', this.height.toString()); } this.setHostAttribute('loading', this.getLoadingBehavior()); this.setHostAttribute('fetchpriority', this.getFetchPriority()); this.setHostAttribute('decoding', this.getDecoding()); this.setHostAttribute('ng-img', 'true'); const rewrittenSrcset = this.updateSrcAndSrcset(); if (this.sizes) { if (this.getLoadingBehavior() === 'lazy') { this.setHostAttribute('sizes', 'auto, ' + this.sizes); } else { this.setHostAttribute('sizes', this.sizes); } } else { if (this.ngSrcset && VALID_WIDTH_DESCRIPTOR_SRCSET.test(this.ngSrcset) && this.getLoadingBehavior() === 'lazy') { this.setHostAttribute('sizes', 'auto, 100vw'); } } if (typeof ngServerMode !== 'undefined' && ngServerMode && this.priority) { const preloadLinkCreator = this.injector.get(PreloadLinkCreator); preloadLinkCreator.createPreloadLinkTag(this.renderer, this.getRewrittenSrc(), rewrittenSrcset, this.sizes); } } ngOnChanges(changes) { if (ngDevMode) { assertNoPostInitInputChange(this, changes, ['ngSrcset', 'width', 'height', 'priority', 'fill', 'loading', 'sizes', 'loaderParams', 'disableOptimizedSrcset']); } if (changes['ngSrc'] && !changes['ngSrc'].isFirstChange()) { const oldSrc = this._renderedSrc; this.updateSrcAndSrcset(true); if (ngDevMode) { const newSrc = this._renderedSrc; if (oldSrc && newSrc && oldSrc !== newSrc) { const ngZone = this.injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_2__.NgZone); ngZone.runOutsideAngular(() => { this.lcpObserver.updateImage(oldSrc, newSrc); }); } } } if (ngDevMode && changes['placeholder']?.currentValue && typeof ngServerMode !== 'undefined' && !ngServerMode) { assertPlaceholderDimensions(this, this.imgElement); } } callImageLoader(configWithoutCustomParams) { let augmentedConfig = configWithoutCustomParams; if (this.loaderParams) { augmentedConfig.loaderParams = this.loaderParams; } return this.imageLoader(augmentedConfig); } getLoadingBehavior() { if (!this.priority && this.loading !== undefined) { return this.loading; } return this.priority ? 'eager' : 'lazy'; } getFetchPriority() { return this.priority ? 'high' : 'auto'; } getDecoding() { if (this.priority) { return 'sync'; } return this.decoding ?? 'auto'; } getRewrittenSrc() { if (!this._renderedSrc) { const imgConfig = { src: this.ngSrc }; this._renderedSrc = this.callImageLoader(imgConfig); } return this._renderedSrc; } getRewrittenSrcset() { const widthSrcSet = VALID_WIDTH_DESCRIPTOR_SRCSET.test(this.ngSrcset); const finalSrcs = this.ngSrcset.split(',').filter(src => src !== '').map(srcStr => { srcStr = srcStr.trim(); const width = widthSrcSet ? parseFloat(srcStr) : parseFloat(srcStr) * this.width; return `${this.callImageLoader({ src: this.ngSrc, width })} ${srcStr}`; }); return finalSrcs.join(', '); } getAutomaticSrcset() { if (this.sizes) { return this.getResponsiveSrcset(); } else { return this.getFixedSrcset(); } } getResponsiveSrcset() { const { breakpoints } = this.config; let filteredBreakpoints = breakpoints; if (this.sizes?.trim() === '100vw') { filteredBreakpoints = breakpoints.filter(bp => bp >= VIEWPORT_BREAKPOINT_CUTOFF); } const finalSrcs = filteredBreakpoints.map(bp => `${this.callImageLoader({ src: this.ngSrc, width: bp })} ${bp}w`); return finalSrcs.join(', '); } updateSrcAndSrcset(forceSrcRecalc = false) { if (forceSrcRecalc) { this._renderedSrc = null; } const rewrittenSrc = this.getRewrittenSrc(); this.setHostAttribute('src', rewrittenSrc); let rewrittenSrcset = undefined; if (this.ngSrcset) { rewrittenSrcset = this.getRewrittenSrcset(); } else if (this.shouldGenerateAutomaticSrcset()) { rewrittenSrcset = this.getAutomaticSrcset(); } if (rewrittenSrcset) { this.setHostAttribute('srcset', rewrittenSrcset); } return rewrittenSrcset; } getFixedSrcset() { const finalSrcs = DENSITY_SRCSET_MULTIPLIERS.map(multiplier => `${this.callImageLoader({ src: this.ngSrc, width: this.width * multiplier })} ${multiplier}x`); return finalSrcs.join(', '); } shouldGenerateAutomaticSrcset() { let oversizedImage = false; if (!this.sizes) { oversizedImage = this.width > FIXED_SRCSET_WIDTH_LIMIT || this.height > FIXED_SRCSET_HEIGHT_LIMIT; } return !this.disableOptimizedSrcset && !this.srcset && this.imageLoader !== noopImageLoader && !oversizedImage; } generatePlaceholder(placeholderInput) { const { placeholderResolution } = this.config; if (placeholderInput === true) { return `url(${this.callImageLoader({ src: this.ngSrc, width: placeholderResolution, isPlaceholder: true })})`; } else if (typeof placeholderInput === 'string') { return `url(${placeholderInput})`; } return null; } shouldBlurPlaceholder(placeholderConfig) { if (!placeholderConfig || !placeholderConfig.hasOwnProperty('blur')) { return true; } return Boolean(placeholderConfig.blur); } removePlaceholderOnLoad(img) { const callback = () => { const changeDetectorRef = this.injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_4__.ChangeDetectorRef); removeLoadListenerFn(); removeErrorListenerFn(); this.placeholder = false; changeDetectorRef.markForCheck(); }; const removeLoadListenerFn = this.renderer.listen(img, 'load', callback); const removeErrorListenerFn = this.renderer.listen(img, 'error', callback); this.destroyRef.onDestroy(() => { removeLoadListenerFn(); removeErrorListenerFn(); }); callOnLoadIfImageIsLoaded(img, callback); } setHostAttribute(name, value) { this.renderer.setAttribute(this.imgElement, name, value); } static ɵfac = function NgOptimizedImage_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || NgOptimizedImage)(); }; static ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineDirective"]({ type: NgOptimizedImage, selectors: [["img", "ngSrc", ""]], hostVars: 18, hostBindings: function NgOptimizedImage_HostBindings(rf, ctx) { if (rf & 2) { _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵstyleProp"]("position", ctx.fill ? "absolute" : null)("width", ctx.fill ? "100%" : null)("height", ctx.fill ? "100%" : null)("inset", ctx.fill ? "0" : null)("background-size", ctx.placeholder ? "cover" : null)("background-position", ctx.placeholder ? "50% 50%" : null)("background-repeat", ctx.placeholder ? "no-repeat" : null)("background-image", ctx.placeholder ? ctx.generatePlaceholder(ctx.placeholder) : null)("filter", ctx.placeholder && ctx.shouldBlurPlaceholder(ctx.placeholderConfig) ? "blur(15px)" : null); } }, inputs: { ngSrc: [2, "ngSrc", "ngSrc", unwrapSafeUrl], ngSrcset: "ngSrcset", sizes: "sizes", width: [2, "width", "width", _angular_core__WEBPACK_IMPORTED_MODULE_4__.numberAttribute], height: [2, "height", "height", _angular_core__WEBPACK_IMPORTED_MODULE_4__.numberAttribute], decoding: "decoding", loading: "loading", priority: [2, "priority", "priority", _angular_core__WEBPACK_IMPORTED_MODULE_4__.booleanAttribute], loaderParams: "loaderParams", disableOptimizedSrcset: [2, "disableOptimizedSrcset", "disableOptimizedSrcset", _angular_core__WEBPACK_IMPORTED_MODULE_4__.booleanAttribute], fill: [2, "fill", "fill", _angular_core__WEBPACK_IMPORTED_MODULE_4__.booleanAttribute], placeholder: [2, "placeholder", "placeholder", booleanOrUrlAttribute], placeholderConfig: "placeholderConfig", src: "src", srcset: "srcset" }, features: [_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵNgOnChangesFeature"]] }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_3__.setClassMetadata(NgOptimizedImage, [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Directive, args: [{ selector: 'img[ngSrc]', host: { '[style.position]': 'fill ? "absolute" : null', '[style.width]': 'fill ? "100%" : null', '[style.height]': 'fill ? "100%" : null', '[style.inset]': 'fill ? "0" : null', '[style.background-size]': 'placeholder ? "cover" : null', '[style.background-position]': 'placeholder ? "50% 50%" : null', '[style.background-repeat]': 'placeholder ? "no-repeat" : null', '[style.background-image]': 'placeholder ? generatePlaceholder(placeholder) : null', '[style.filter]': 'placeholder && shouldBlurPlaceholder(placeholderConfig) ? "blur(15px)" : null' } }] }], () => [], { ngSrc: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Input, args: [{ required: true, transform: unwrapSafeUrl }] }], ngSrcset: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Input }], sizes: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Input }], width: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Input, args: [{ transform: _angular_core__WEBPACK_IMPORTED_MODULE_4__.numberAttribute }] }], height: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Input, args: [{ transform: _angular_core__WEBPACK_IMPORTED_MODULE_4__.numberAttribute }] }], decoding: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Input }], loading: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Input }], priority: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Input, args: [{ transform: _angular_core__WEBPACK_IMPORTED_MODULE_4__.booleanAttribute }] }], loaderParams: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Input }], disableOptimizedSrcset: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Input, args: [{ transform: _angular_core__WEBPACK_IMPORTED_MODULE_4__.booleanAttribute }] }], fill: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Input, args: [{ transform: _angular_core__WEBPACK_IMPORTED_MODULE_4__.booleanAttribute }] }], placeholder: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Input, args: [{ transform: booleanOrUrlAttribute }] }], placeholderConfig: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Input }], src: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Input }], srcset: [{ type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Input }] }); })(); function processConfig(config) { let sortedBreakpoints = {}; if (config.breakpoints) { sortedBreakpoints.breakpoints = config.breakpoints.sort((a, b) => a - b); } return Object.assign({}, _angular_core__WEBPACK_IMPORTED_MODULE_3__.IMAGE_CONFIG_DEFAULTS, config, sortedBreakpoints); } function assertNoConflictingSrc(dir) { if (dir.src) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2950, `${imgDirectiveDetails(dir.ngSrc)} both \`src\` and \`ngSrc\` have been set. ` + `Supplying both of these attributes breaks lazy loading. ` + `The NgOptimizedImage directive sets \`src\` itself based on the value of \`ngSrc\`. ` + `To fix this, please remove the \`src\` attribute.`); } } function assertNoConflictingSrcset(dir) { if (dir.srcset) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2951, `${imgDirectiveDetails(dir.ngSrc)} both \`srcset\` and \`ngSrcset\` have been set. ` + `Supplying both of these attributes breaks lazy loading. ` + `The NgOptimizedImage directive sets \`srcset\` itself based on the value of ` + `\`ngSrcset\`. To fix this, please remove the \`srcset\` attribute.`); } } function assertNotBase64Image(dir) { let ngSrc = dir.ngSrc.trim(); if (ngSrc.startsWith('data:')) { if (ngSrc.length > BASE64_IMG_MAX_LENGTH_IN_ERROR) { ngSrc = ngSrc.substring(0, BASE64_IMG_MAX_LENGTH_IN_ERROR) + '...'; } throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc, false)} \`ngSrc\` is a Base64-encoded string ` + `(${ngSrc}). NgOptimizedImage does not support Base64-encoded strings. ` + `To fix this, disable the NgOptimizedImage directive for this element ` + `by removing \`ngSrc\` and using a standard \`src\` attribute instead.`); } } function assertNoComplexSizes(dir) { let sizes = dir.sizes; if (sizes?.match(/((\)|,)\s|^)\d+px/)) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc, false)} \`sizes\` was set to a string including ` + `pixel values. For automatic \`srcset\` generation, \`sizes\` must only include responsive ` + `values, such as \`sizes="50vw"\` or \`sizes="(min-width: 768px) 50vw, 100vw"\`. ` + `To fix this, modify the \`sizes\` attribute, or provide your own \`ngSrcset\` value directly.`); } } function assertValidPlaceholder(dir, imageLoader) { assertNoPlaceholderConfigWithoutPlaceholder(dir); assertNoRelativePlaceholderWithoutLoader(dir, imageLoader); assertNoOversizedDataUrl(dir); } function assertNoPlaceholderConfigWithoutPlaceholder(dir) { if (dir.placeholderConfig && !dir.placeholder) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc, false)} \`placeholderConfig\` options were provided for an ` + `image that does not use the \`placeholder\` attribute, and will have no effect.`); } } function assertNoRelativePlaceholderWithoutLoader(dir, imageLoader) { if (dir.placeholder === true && imageLoader === noopImageLoader) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2963, `${imgDirectiveDetails(dir.ngSrc)} the \`placeholder\` attribute is set to true but ` + `no image loader is configured (i.e. the default one is being used), ` + `which would result in the same image being used for the primary image and its placeholder. ` + `To fix this, provide a loader or remove the \`placeholder\` attribute from the image.`); } } function assertNoOversizedDataUrl(dir) { if (dir.placeholder && typeof dir.placeholder === 'string' && dir.placeholder.startsWith('data:')) { if (dir.placeholder.length > DATA_URL_ERROR_LIMIT) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2965, `${imgDirectiveDetails(dir.ngSrc)} the \`placeholder\` attribute is set to a data URL which is longer ` + `than ${DATA_URL_ERROR_LIMIT} characters. This is strongly discouraged, as large inline placeholders ` + `directly increase the bundle size of Angular and hurt page load performance. To fix this, generate ` + `a smaller data URL placeholder.`); } if (dir.placeholder.length > DATA_URL_WARN_LIMIT) { console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.formatRuntimeError)(2965, `${imgDirectiveDetails(dir.ngSrc)} the \`placeholder\` attribute is set to a data URL which is longer ` + `than ${DATA_URL_WARN_LIMIT} characters. This is discouraged, as large inline placeholders ` + `directly increase the bundle size of Angular and hurt page load performance. For better loading performance, ` + `generate a smaller data URL placeholder.`)); } } } function assertNotBlobUrl(dir) { const ngSrc = dir.ngSrc.trim(); if (ngSrc.startsWith('blob:')) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`ngSrc\` was set to a blob URL (${ngSrc}). ` + `Blob URLs are not supported by the NgOptimizedImage directive. ` + `To fix this, disable the NgOptimizedImage directive for this element ` + `by removing \`ngSrc\` and using a regular \`src\` attribute instead.`); } } function assertNonEmptyInput(dir, name, value) { const isString = typeof value === 'string'; const isEmptyString = isString && value.trim() === ''; if (!isString || isEmptyString) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`${name}\` has an invalid value ` + `(\`${value}\`). To fix this, change the value to a non-empty string.`); } } function assertValidNgSrcset(dir, value) { if (value == null) return; assertNonEmptyInput(dir, 'ngSrcset', value); const stringVal = value; const isValidWidthDescriptor = VALID_WIDTH_DESCRIPTOR_SRCSET.test(stringVal); const isValidDensityDescriptor = VALID_DENSITY_DESCRIPTOR_SRCSET.test(stringVal); if (isValidDensityDescriptor) { assertUnderDensityCap(dir, stringVal); } const isValidSrcset = isValidWidthDescriptor || isValidDensityDescriptor; if (!isValidSrcset) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`ngSrcset\` has an invalid value (\`${value}\`). ` + `To fix this, supply \`ngSrcset\` using a comma-separated list of one or more width ` + `descriptors (e.g. "100w, 200w") or density descriptors (e.g. "1x, 2x").`); } } function assertUnderDensityCap(dir, value) { const underDensityCap = value.split(',').every(num => num === '' || parseFloat(num) <= ABSOLUTE_SRCSET_DENSITY_CAP); if (!underDensityCap) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`ngSrcset\` contains an unsupported image density:` + `\`${value}\`. NgOptimizedImage generally recommends a max image density of ` + `${RECOMMENDED_SRCSET_DENSITY_CAP}x but supports image densities up to ` + `${ABSOLUTE_SRCSET_DENSITY_CAP}x. The human eye cannot distinguish between image densities ` + `greater than ${RECOMMENDED_SRCSET_DENSITY_CAP}x - which makes them unnecessary for ` + `most use cases. Images that will be pinch-zoomed are typically the primary use case for ` + `${ABSOLUTE_SRCSET_DENSITY_CAP}x images. Please remove the high density descriptor and try again.`); } } function postInitInputChangeError(dir, inputName) { let reason; if (inputName === 'width' || inputName === 'height') { reason = `Changing \`${inputName}\` may result in different attribute value ` + `applied to the underlying image element and cause layout shifts on a page.`; } else { reason = `Changing the \`${inputName}\` would have no effect on the underlying ` + `image element, because the resource loading has already occurred.`; } return new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2953, `${imgDirectiveDetails(dir.ngSrc)} \`${inputName}\` was updated after initialization. ` + `The NgOptimizedImage directive will not react to this input change. ${reason} ` + `To fix this, either switch \`${inputName}\` to a static value ` + `or wrap the image element in an @if that is gated on the necessary value.`); } function assertNoPostInitInputChange(dir, changes, inputs) { inputs.forEach(input => { const isUpdated = changes.hasOwnProperty(input); if (isUpdated && !changes[input].isFirstChange()) { if (input === 'ngSrc') { dir = { ngSrc: changes[input].previousValue }; } throw postInitInputChangeError(dir, input); } }); } function assertGreaterThanZero(dir, inputValue, inputName) { const validNumber = typeof inputValue === 'number' && inputValue > 0; const validString = typeof inputValue === 'string' && /^\d+$/.test(inputValue.trim()) && parseInt(inputValue) > 0; if (!validNumber && !validString) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} \`${inputName}\` has an invalid value. ` + `To fix this, provide \`${inputName}\` as a number greater than 0.`); } } function assertNoImageDistortion(dir, img, renderer, destroyRef) { const callback = () => { removeLoadListenerFn(); removeErrorListenerFn(); const computedStyle = window.getComputedStyle(img); let renderedWidth = parseFloat(computedStyle.getPropertyValue('width')); let renderedHeight = parseFloat(computedStyle.getPropertyValue('height')); const boxSizing = computedStyle.getPropertyValue('box-sizing'); if (boxSizing === 'border-box') { const paddingTop = computedStyle.getPropertyValue('padding-top'); const paddingRight = computedStyle.getPropertyValue('padding-right'); const paddingBottom = computedStyle.getPropertyValue('padding-bottom'); const paddingLeft = computedStyle.getPropertyValue('padding-left'); renderedWidth -= parseFloat(paddingRight) + parseFloat(paddingLeft); renderedHeight -= parseFloat(paddingTop) + parseFloat(paddingBottom); } const renderedAspectRatio = renderedWidth / renderedHeight; const nonZeroRenderedDimensions = renderedWidth !== 0 && renderedHeight !== 0; const intrinsicWidth = img.naturalWidth; const intrinsicHeight = img.naturalHeight; const intrinsicAspectRatio = intrinsicWidth / intrinsicHeight; const suppliedWidth = dir.width; const suppliedHeight = dir.height; const suppliedAspectRatio = suppliedWidth / suppliedHeight; const inaccurateDimensions = Math.abs(suppliedAspectRatio - intrinsicAspectRatio) > ASPECT_RATIO_TOLERANCE; const stylingDistortion = nonZeroRenderedDimensions && Math.abs(intrinsicAspectRatio - renderedAspectRatio) > ASPECT_RATIO_TOLERANCE; if (inaccurateDimensions) { console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.formatRuntimeError)(2952, `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the image does not match ` + `the aspect ratio indicated by the width and height attributes. ` + `\nIntrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h ` + `(aspect-ratio: ${round(intrinsicAspectRatio)}). \nSupplied width and height attributes: ` + `${suppliedWidth}w x ${suppliedHeight}h (aspect-ratio: ${round(suppliedAspectRatio)}). ` + `\nTo fix this, update the width and height attributes.`)); } else if (stylingDistortion) { console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.formatRuntimeError)(2952, `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the rendered image ` + `does not match the image's intrinsic aspect ratio. ` + `\nIntrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h ` + `(aspect-ratio: ${round(intrinsicAspectRatio)}). \nRendered image size: ` + `${renderedWidth}w x ${renderedHeight}h (aspect-ratio: ` + `${round(renderedAspectRatio)}). \nThis issue can occur if "width" and "height" ` + `attributes are added to an image without updating the corresponding ` + `image styling. To fix this, adjust image styling. In most cases, ` + `adding "height: auto" or "width: auto" to the image styling will fix ` + `this issue.`)); } else if (!dir.ngSrcset && nonZeroRenderedDimensions) { const recommendedWidth = RECOMMENDED_SRCSET_DENSITY_CAP * renderedWidth; const recommendedHeight = RECOMMENDED_SRCSET_DENSITY_CAP * renderedHeight; const oversizedWidth = intrinsicWidth - recommendedWidth >= OVERSIZED_IMAGE_TOLERANCE; const oversizedHeight = intrinsicHeight - recommendedHeight >= OVERSIZED_IMAGE_TOLERANCE; if (oversizedWidth || oversizedHeight) { console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.formatRuntimeError)(2960, `${imgDirectiveDetails(dir.ngSrc)} the intrinsic image is significantly ` + `larger than necessary. ` + `\nRendered image size: ${renderedWidth}w x ${renderedHeight}h. ` + `\nIntrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h. ` + `\nRecommended intrinsic image size: ${recommendedWidth}w x ${recommendedHeight}h. ` + `\nNote: Recommended intrinsic image size is calculated assuming a maximum DPR of ` + `${RECOMMENDED_SRCSET_DENSITY_CAP}. To improve loading time, resize the image ` + `or consider using the "ngSrcset" and "sizes" attributes.`)); } } }; const removeLoadListenerFn = renderer.listen(img, 'load', callback); const removeErrorListenerFn = renderer.listen(img, 'error', () => { removeLoadListenerFn(); removeErrorListenerFn(); }); destroyRef.onDestroy(() => { removeLoadListenerFn(); removeErrorListenerFn(); }); callOnLoadIfImageIsLoaded(img, callback); } function assertNonEmptyWidthAndHeight(dir) { let missingAttributes = []; if (dir.width === undefined) missingAttributes.push('width'); if (dir.height === undefined) missingAttributes.push('height'); if (missingAttributes.length > 0) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2954, `${imgDirectiveDetails(dir.ngSrc)} these required attributes ` + `are missing: ${missingAttributes.map(attr => `"${attr}"`).join(', ')}. ` + `Including "width" and "height" attributes will prevent image-related layout shifts. ` + `To fix this, include "width" and "height" attributes on the image tag or turn on ` + `"fill" mode with the \`fill\` attribute.`); } } function assertEmptyWidthAndHeight(dir) { if (dir.width || dir.height) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the attributes \`height\` and/or \`width\` are present ` + `along with the \`fill\` attribute. Because \`fill\` mode causes an image to fill its containing ` + `element, the size attributes have no effect and should be removed.`); } } function assertNonZeroRenderedHeight(dir, img, renderer, destroyRef) { const callback = () => { removeLoadListenerFn(); removeErrorListenerFn(); const renderedHeight = img.clientHeight; if (dir.fill && renderedHeight === 0) { console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.formatRuntimeError)(2952, `${imgDirectiveDetails(dir.ngSrc)} the height of the fill-mode image is zero. ` + `This is likely because the containing element does not have the CSS 'position' ` + `property set to one of the following: "relative", "fixed", or "absolute". ` + `To fix this problem, make sure the container element has the CSS 'position' ` + `property defined and the height of the element is not zero.`)); } }; const removeLoadListenerFn = renderer.listen(img, 'load', callback); const removeErrorListenerFn = renderer.listen(img, 'error', () => { removeLoadListenerFn(); removeErrorListenerFn(); }); destroyRef.onDestroy(() => { removeLoadListenerFn(); removeErrorListenerFn(); }); callOnLoadIfImageIsLoaded(img, callback); } function assertValidLoadingInput(dir) { if (dir.loading && dir.priority) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`loading\` attribute ` + `was used on an image that was marked "priority". ` + `Setting \`loading\` on priority images is not allowed ` + `because these images will always be eagerly loaded. ` + `To fix this, remove the “loading” attribute from the priority image.`); } const validInputs = ['auto', 'eager', 'lazy']; if (typeof dir.loading === 'string' && !validInputs.includes(dir.loading)) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`loading\` attribute ` + `has an invalid value (\`${dir.loading}\`). ` + `To fix this, provide a valid value ("lazy", "eager", or "auto").`); } } function assertValidDecodingInput(dir) { const validInputs = ['sync', 'async', 'auto']; if (typeof dir.decoding === 'string' && !validInputs.includes(dir.decoding)) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__.RuntimeError(2952, `${imgDirectiveDetails(dir.ngSrc)} the \`decoding\` attribute ` + `has an invalid value (\`${dir.decoding}\`). ` + `To fix this, provide a valid value ("sync", "async", or "auto").`); } } function assertNotMissingBuiltInLoader(ngSrc, imageLoader) { if (imageLoader === noopImageLoader) { let builtInLoaderName = ''; for (const loader of BUILT_IN_LOADERS) { if (loader.testUrl(ngSrc)) { builtInLoaderName = loader.name; break; } } if (builtInLoaderName) { console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.formatRuntimeError)(2962, `NgOptimizedImage: It looks like your images may be hosted on the ` + `${builtInLoaderName} CDN, but your app is not using Angular's ` + `built-in loader for that CDN. We recommend switching to use ` + `the built-in by calling \`provide${builtInLoaderName}Loader()\` ` + `in your \`providers\` and passing it your instance's base URL. ` + `If you don't want to use the built-in loader, define a custom ` + `loader function using IMAGE_LOADER to silence this warning.`)); } } } function assertNoNgSrcsetWithoutLoader(dir, imageLoader) { if (dir.ngSrcset && imageLoader === noopImageLoader) { console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.formatRuntimeError)(2963, `${imgDirectiveDetails(dir.ngSrc)} the \`ngSrcset\` attribute is present but ` + `no image loader is configured (i.e. the default one is being used), ` + `which would result in the same image being used for all configured sizes. ` + `To fix this, provide a loader or remove the \`ngSrcset\` attribute from the image.`)); } } function assertNoLoaderParamsWithoutLoader(dir, imageLoader) { if (dir.loaderParams && imageLoader === noopImageLoader) { console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.formatRuntimeError)(2963, `${imgDirectiveDetails(dir.ngSrc)} the \`loaderParams\` attribute is present but ` + `no image loader is configured (i.e. the default one is being used), ` + `which means that the loaderParams data will not be consumed and will not affect the URL. ` + `To fix this, provide a custom loader or remove the \`loaderParams\` attribute from the image.`)); } } function assetPriorityCountBelowThreshold(_x) { return _assetPriorityCountBelowThreshold.apply(this, arguments); } function _assetPriorityCountBelowThreshold() { _assetPriorityCountBelowThreshold = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (appRef) { if (IMGS_WITH_PRIORITY_ATTR_COUNT === 0) { IMGS_WITH_PRIORITY_ATTR_COUNT++; yield appRef.whenStable(); if (IMGS_WITH_PRIORITY_ATTR_COUNT > PRIORITY_COUNT_THRESHOLD) { console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.formatRuntimeError)(2966, `NgOptimizedImage: The "priority" attribute is set to true more than ${PRIORITY_COUNT_THRESHOLD} times (${IMGS_WITH_PRIORITY_ATTR_COUNT} times). ` + `Marking too many images as "high" priority can hurt your application's LCP (https://web.dev/lcp). ` + `"Priority" should only be set on the image expected to be the page's LCP element.`)); } } else { IMGS_WITH_PRIORITY_ATTR_COUNT++; } }); return _assetPriorityCountBelowThreshold.apply(this, arguments); } function assertPlaceholderDimensions(dir, imgElement) { const computedStyle = window.getComputedStyle(imgElement); let renderedWidth = parseFloat(computedStyle.getPropertyValue('width')); let renderedHeight = parseFloat(computedStyle.getPropertyValue('height')); if (renderedWidth > PLACEHOLDER_DIMENSION_LIMIT || renderedHeight > PLACEHOLDER_DIMENSION_LIMIT) { console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.formatRuntimeError)(2967, `${imgDirectiveDetails(dir.ngSrc)} it uses a placeholder image, but at least one ` + `of the dimensions attribute (height or width) exceeds the limit of ${PLACEHOLDER_DIMENSION_LIMIT}px. ` + `To fix this, use a smaller image as a placeholder.`)); } } function callOnLoadIfImageIsLoaded(img, callback) { if (img.complete && img.naturalWidth) { callback(); } } function round(input) { return Number.isInteger(input) ? input : input.toFixed(2); } function unwrapSafeUrl(value) { if (typeof value === 'string') { return value; } return (0,_angular_core__WEBPACK_IMPORTED_MODULE_3__.unwrapSafeValue)(value); } function booleanOrUrlAttribute(value) { if (typeof value === 'string' && value !== 'true' && value !== 'false' && value !== '') { return value; } return (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__.booleanAttribute)(value); } /***/ }, /***/ 88150 /*!********************************************************!*\ !*** ./node_modules/@angular/common/fesm2022/http.mjs ***! \********************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ FetchBackend: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.FetchBackend), /* harmony export */ HTTP_INTERCEPTORS: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HTTP_INTERCEPTORS), /* harmony export */ HTTP_TRANSFER_CACHE_ORIGIN_MAP: () => (/* binding */ HTTP_TRANSFER_CACHE_ORIGIN_MAP), /* harmony export */ HttpBackend: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpBackend), /* harmony export */ HttpClient: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpClient), /* harmony export */ HttpClientJsonpModule: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpClientJsonpModule), /* harmony export */ HttpClientModule: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpClientModule), /* harmony export */ HttpClientXsrfModule: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpClientXsrfModule), /* harmony export */ HttpContext: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpContext), /* harmony export */ HttpContextToken: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpContextToken), /* harmony export */ HttpErrorResponse: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpErrorResponse), /* harmony export */ HttpEventType: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpEventType), /* harmony export */ HttpFeatureKind: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpFeatureKind), /* harmony export */ HttpHandler: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpHandler), /* harmony export */ HttpHeaderResponse: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpHeaderResponse), /* harmony export */ HttpHeaders: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpHeaders), /* harmony export */ HttpParams: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpParams), /* harmony export */ HttpRequest: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpRequest), /* harmony export */ HttpResponse: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpResponse), /* harmony export */ HttpResponseBase: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpResponseBase), /* harmony export */ HttpStatusCode: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpStatusCode), /* harmony export */ HttpUrlEncodingCodec: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpUrlEncodingCodec), /* harmony export */ HttpXhrBackend: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpXhrBackend), /* harmony export */ HttpXsrfTokenExtractor: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpXsrfTokenExtractor), /* harmony export */ JsonpClientBackend: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.JsonpClientBackend), /* harmony export */ JsonpInterceptor: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.JsonpInterceptor), /* harmony export */ httpResource: () => (/* binding */ httpResource), /* harmony export */ provideHttpClient: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.provideHttpClient), /* harmony export */ withFetch: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.withFetch), /* harmony export */ withInterceptors: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.withInterceptors), /* harmony export */ withInterceptorsFromDi: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.withInterceptorsFromDi), /* harmony export */ withJsonpSupport: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.withJsonpSupport), /* harmony export */ withNoXsrfProtection: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.withNoXsrfProtection), /* harmony export */ withRequestsMadeViaParent: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.withRequestsMadeViaParent), /* harmony export */ withXsrfConfiguration: () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.withXsrfConfiguration), /* harmony export */ "ɵHTTP_ROOT_INTERCEPTOR_FNS": () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HTTP_ROOT_INTERCEPTOR_FNS), /* harmony export */ "ɵHttpInterceptingHandler": () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpInterceptorHandler), /* harmony export */ "ɵREQUESTS_CONTRIBUTE_TO_STABILITY": () => (/* reexport safe */ _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.REQUESTS_CONTRIBUTE_TO_STABILITY), /* harmony export */ "ɵwithHttpTransferCache": () => (/* binding */ withHttpTransferCache) /* harmony export */ }); /* harmony import */ var _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./_module-chunk.mjs */ 19305); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 40072); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 14975); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 39231); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ 98241); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs/operators */ 45541); /** * @license Angular v21.1.2 * (c) 2010-2026 Google LLC. https://angular.dev/ * License: MIT */ const httpResource = (() => { const jsonFn = makeHttpResourceFn('json'); jsonFn.arrayBuffer = makeHttpResourceFn('arraybuffer'); jsonFn.blob = makeHttpResourceFn('blob'); jsonFn.text = makeHttpResourceFn('text'); return jsonFn; })(); function makeHttpResourceFn(responseType) { return function httpResource(request, options) { if (ngDevMode && !options?.injector) { (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.assertInInjectionContext)(httpResource); } const injector = options?.injector ?? (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.Injector); return new HttpResourceImpl(injector, () => normalizeRequest(request, responseType), options?.defaultValue, options?.debugName, options?.parse, options?.equal); }; } function normalizeRequest(request, responseType) { let unwrappedRequest = typeof request === 'function' ? request() : request; if (unwrappedRequest === undefined) { return undefined; } else if (typeof unwrappedRequest === 'string') { unwrappedRequest = { url: unwrappedRequest }; } const headers = unwrappedRequest.headers instanceof _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpHeaders ? unwrappedRequest.headers : new _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpHeaders(unwrappedRequest.headers); const params = unwrappedRequest.params instanceof _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpParams ? unwrappedRequest.params : new _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpParams({ fromObject: unwrappedRequest.params }); return new _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpRequest(unwrappedRequest.method ?? 'GET', unwrappedRequest.url, unwrappedRequest.body ?? null, { headers, params, reportProgress: unwrappedRequest.reportProgress, withCredentials: unwrappedRequest.withCredentials, keepalive: unwrappedRequest.keepalive, cache: unwrappedRequest.cache, priority: unwrappedRequest.priority, mode: unwrappedRequest.mode, redirect: unwrappedRequest.redirect, responseType, context: unwrappedRequest.context, transferCache: unwrappedRequest.transferCache, credentials: unwrappedRequest.credentials, referrer: unwrappedRequest.referrer, referrerPolicy: unwrappedRequest.referrerPolicy, integrity: unwrappedRequest.integrity, timeout: unwrappedRequest.timeout }); } class HttpResourceImpl extends _angular_core__WEBPACK_IMPORTED_MODULE_3__.ResourceImpl { client; _headers = (0,_angular_core__WEBPACK_IMPORTED_MODULE_3__.linkedSignal)({ ...(ngDevMode ? { debugName: "_headers" } : {}), source: this.extRequest, computation: () => undefined }); _progress = (0,_angular_core__WEBPACK_IMPORTED_MODULE_3__.linkedSignal)({ ...(ngDevMode ? { debugName: "_progress" } : {}), source: this.extRequest, computation: () => undefined }); _statusCode = (0,_angular_core__WEBPACK_IMPORTED_MODULE_3__.linkedSignal)({ ...(ngDevMode ? { debugName: "_statusCode" } : {}), source: this.extRequest, computation: () => undefined }); headers = (0,_angular_core__WEBPACK_IMPORTED_MODULE_3__.computed)(() => this.status() === 'resolved' || this.status() === 'error' ? this._headers() : undefined, ...(ngDevMode ? [{ debugName: "headers" }] : [])); progress = this._progress.asReadonly(); statusCode = this._statusCode.asReadonly(); constructor(injector, request, defaultValue, debugName, parse, equal) { super(request, ({ params: request, abortSignal }) => { let sub; const onAbort = () => sub.unsubscribe(); abortSignal.addEventListener('abort', onAbort); const stream = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.signal)({ value: undefined }, ...(ngDevMode ? [{ debugName: "stream" }] : [])); let resolve; const promise = new Promise(r => resolve = r); const send = value => { stream.set(value); resolve?.(stream); resolve = undefined; }; sub = this.client.request(request).subscribe({ next: event => { switch (event.type) { case _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpEventType.Response: this._headers.set(event.headers); this._statusCode.set(event.status); try { send({ value: parse ? parse(event.body) : event.body }); } catch (error) { send({ error: (0,_angular_core__WEBPACK_IMPORTED_MODULE_3__.encapsulateResourceError)(error) }); } break; case _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpEventType.DownloadProgress: this._progress.set(event); break; } }, error: error => { if (error instanceof _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpErrorResponse) { this._headers.set(error.headers); this._statusCode.set(error.status); } send({ error }); abortSignal.removeEventListener('abort', onAbort); }, complete: () => { if (resolve) { send({ error: new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(991, ngDevMode && 'Resource completed before producing a value') }); } abortSignal.removeEventListener('abort', onAbort); } }); return promise; }, defaultValue, equal, debugName, injector); this.client = injector.get(_module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpClient); } set(value) { super.set(value); this._headers.set(undefined); this._progress.set(undefined); this._statusCode.set(undefined); } } const HTTP_TRANSFER_CACHE_ORIGIN_MAP = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'HTTP_TRANSFER_CACHE_ORIGIN_MAP' : ''); const BODY = 'b'; const HEADERS = 'h'; const STATUS = 's'; const STATUS_TEXT = 'st'; const REQ_URL = 'u'; const RESPONSE_TYPE = 'rt'; const CACHE_OPTIONS = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'HTTP_TRANSFER_STATE_CACHE_OPTIONS' : ''); const ALLOWED_METHODS = ['GET', 'HEAD']; function transferCacheInterceptorFn(req, next) { const { isCacheActive, ...globalOptions } = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(CACHE_OPTIONS); const { transferCache: requestOptions, method: requestMethod } = req; if (!isCacheActive || requestOptions === false || requestMethod === 'POST' && !globalOptions.includePostRequests && !requestOptions || requestMethod !== 'POST' && !ALLOWED_METHODS.includes(requestMethod) || !globalOptions.includeRequestsWithAuthHeaders && hasAuthHeaders(req) || globalOptions.filter?.(req) === false) { return next(req); } const transferState = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.TransferState); const originMap = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(HTTP_TRANSFER_CACHE_ORIGIN_MAP, { optional: true }); if (typeof ngServerMode !== 'undefined' && !ngServerMode && originMap) { throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2803, ngDevMode && 'Angular detected that the `HTTP_TRANSFER_CACHE_ORIGIN_MAP` token is configured and ' + 'present in the client side code. Please ensure that this token is only provided in the ' + 'server code of the application.'); } const requestUrl = typeof ngServerMode !== 'undefined' && ngServerMode && originMap ? mapRequestOriginUrl(req.url, originMap) : req.url; const storeKey = makeCacheKey(req, requestUrl); const response = transferState.get(storeKey, null); let headersToInclude = globalOptions.includeHeaders; if (typeof requestOptions === 'object' && requestOptions.includeHeaders) { headersToInclude = requestOptions.includeHeaders; } if (response) { const { [BODY]: undecodedBody, [RESPONSE_TYPE]: responseType, [HEADERS]: httpHeaders, [STATUS]: status, [STATUS_TEXT]: statusText, [REQ_URL]: url } = response; let body = undecodedBody; switch (responseType) { case 'arraybuffer': body = new TextEncoder().encode(undecodedBody).buffer; break; case 'blob': body = new Blob([undecodedBody]); break; } let headers = new _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpHeaders(httpHeaders); if (typeof ngDevMode === 'undefined' || ngDevMode) { headers = appendMissingHeadersDetection(req.url, headers, headersToInclude ?? []); } return (0,rxjs__WEBPACK_IMPORTED_MODULE_4__.of)(new _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpResponse({ body, headers, status, statusText, url })); } const event$ = next(req); if (typeof ngServerMode !== 'undefined' && ngServerMode) { return event$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.tap)(event => { if (event instanceof _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HttpResponse) { transferState.set(storeKey, { [BODY]: event.body, [HEADERS]: getFilteredHeaders(event.headers, headersToInclude), [STATUS]: event.status, [STATUS_TEXT]: event.statusText, [REQ_URL]: requestUrl, [RESPONSE_TYPE]: req.responseType }); } })); } return event$; } function hasAuthHeaders(req) { return req.headers.has('authorization') || req.headers.has('proxy-authorization'); } function getFilteredHeaders(headers, includeHeaders) { if (!includeHeaders) { return {}; } const headersMap = {}; for (const key of includeHeaders) { const values = headers.getAll(key); if (values !== null) { headersMap[key] = values; } } return headersMap; } function sortAndConcatParams(params) { return [...params.keys()].sort().map(k => `${k}=${params.getAll(k)}`).join('&'); } function makeCacheKey(request, mappedRequestUrl) { const { params, method, responseType } = request; const encodedParams = sortAndConcatParams(params); let serializedBody = request.serializeBody(); if (serializedBody instanceof URLSearchParams) { serializedBody = sortAndConcatParams(serializedBody); } else if (typeof serializedBody !== 'string') { serializedBody = ''; } const key = [method, responseType, mappedRequestUrl, serializedBody, encodedParams].join('|'); const hash = generateHash(key); return (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.makeStateKey)(hash); } function generateHash(value) { let hash = 0; for (const char of value) { hash = Math.imul(31, hash) + char.charCodeAt(0) << 0; } hash += 2147483647 + 1; return hash.toString(); } function withHttpTransferCache(cacheOptions) { return [{ provide: CACHE_OPTIONS, useFactory: () => { (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.performanceMarkFeature)('NgHttpTransferCache'); return { isCacheActive: true, ...cacheOptions }; } }, { provide: _module_chunk_mjs__WEBPACK_IMPORTED_MODULE_0__.HTTP_ROOT_INTERCEPTOR_FNS, useValue: transferCacheInterceptorFn, multi: true }, { provide: _angular_core__WEBPACK_IMPORTED_MODULE_2__.APP_BOOTSTRAP_LISTENER, multi: true, useFactory: () => { const appRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.ApplicationRef); const cacheState = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(CACHE_OPTIONS); return () => { appRef.whenStable().then(() => { cacheState.isCacheActive = false; }); }; } }]; } function appendMissingHeadersDetection(url, headers, headersToInclude) { const warningProduced = new Set(); return new Proxy(headers, { get(target, prop) { const value = Reflect.get(target, prop); const methods = new Set(['get', 'has', 'getAll']); if (typeof value !== 'function' || !methods.has(prop)) { return value; } return headerName => { const key = (prop + ':' + headerName).toLowerCase(); if (!headersToInclude.includes(headerName) && !warningProduced.has(key)) { warningProduced.add(key); const truncatedUrl = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.truncateMiddle)(url); console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.formatRuntimeError)(-2802, `Angular detected that the \`${headerName}\` header is accessed, but the value of the header ` + `was not transferred from the server to the client by the HttpTransferCache. ` + `To include the value of the \`${headerName}\` header for the \`${truncatedUrl}\` request, ` + `use the \`includeHeaders\` list. The \`includeHeaders\` can be defined either ` + `on a request level by adding the \`transferCache\` parameter, or on an application ` + `level by adding the \`httpCacheTransfer.includeHeaders\` argument to the ` + `\`provideClientHydration()\` call. `)); } return value.apply(target, [headerName]); }; } }); } function mapRequestOriginUrl(url, originMap) { const origin = new URL(url, 'resolve://').origin; const mappedOrigin = originMap[origin]; if (!mappedOrigin) { return url; } if (typeof ngDevMode === 'undefined' || ngDevMode) { verifyMappedOrigin(mappedOrigin); } return url.replace(origin, mappedOrigin); } function verifyMappedOrigin(url) { if (new URL(url, 'resolve://').pathname !== '/') { throw new _angular_core__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(2804, 'Angular detected a URL with a path segment in the value provided for the ' + `\`HTTP_TRANSFER_CACHE_ORIGIN_MAP\` token: ${url}. The map should only contain origins ` + 'without any other segments.'); } } /***/ }, /***/ 52349 /*!******************************************************************!*\ !*** ./node_modules/@angular/core/fesm2022/_attribute-chunk.mjs ***! \******************************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Attribute: () => (/* binding */ Attribute) /* harmony export */ }); /** * @license Angular v21.1.2 * (c) 2010-2026 Google LLC. https://angular.dev/ * License: MIT */ const Attribute = { JSACTION: 'jsaction' }; /***/ }, /***/ 14975 /*!*******************************************************************!*\ !*** ./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs ***! \*******************************************************************/ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AFTER_RENDER_PHASES: () => (/* binding */ AFTER_RENDER_PHASES), /* harmony export */ ANIMATIONS_DISABLED: () => (/* binding */ ANIMATIONS_DISABLED), /* harmony export */ ANIMATION_MODULE_TYPE: () => (/* binding */ ANIMATION_MODULE_TYPE), /* harmony export */ APP_BOOTSTRAP_LISTENER: () => (/* binding */ APP_BOOTSTRAP_LISTENER), /* harmony export */ APP_ID: () => (/* binding */ APP_ID), /* harmony export */ APP_INITIALIZER: () => (/* binding */ APP_INITIALIZER), /* harmony export */ AcxChangeDetectionStrategy: () => (/* binding */ AcxChangeDetectionStrategy), /* harmony export */ AcxViewEncapsulation: () => (/* binding */ AcxViewEncapsulation), /* harmony export */ AfterRenderImpl: () => (/* binding */ AfterRenderImpl), /* harmony export */ AfterRenderManager: () => (/* binding */ AfterRenderManager), /* harmony export */ AfterRenderSequence: () => (/* binding */ AfterRenderSequence), /* harmony export */ ApplicationInitStatus: () => (/* binding */ ApplicationInitStatus), /* harmony export */ ApplicationRef: () => (/* binding */ ApplicationRef), /* harmony export */ Attribute: () => (/* binding */ Attribute), /* harmony export */ COMPILER_OPTIONS: () => (/* binding */ COMPILER_OPTIONS), /* harmony export */ CONTAINERS: () => (/* binding */ CONTAINERS), /* harmony export */ CSP_NONCE: () => (/* binding */ CSP_NONCE), /* harmony export */ CUSTOM_ELEMENTS_SCHEMA: () => (/* binding */ CUSTOM_ELEMENTS_SCHEMA), /* harmony export */ ChangeDetectionSchedulerImpl: () => (/* binding */ ChangeDetectionSchedulerImpl), /* harmony export */ ChangeDetectionStrategy: () => (/* binding */ ChangeDetectionStrategy), /* harmony export */ Compiler: () => (/* binding */ Compiler), /* harmony export */ CompilerFactory: () => (/* binding */ CompilerFactory), /* harmony export */ Component: () => (/* binding */ Component), /* harmony export */ ComponentFactory: () => (/* binding */ ComponentFactory), /* harmony export */ ComponentFactory$1: () => (/* binding */ ComponentFactory$1), /* harmony export */ ComponentFactoryResolver: () => (/* binding */ ComponentFactoryResolver$1), /* harmony export */ ComponentRef: () => (/* binding */ ComponentRef$1), /* harmony export */ ComponentRef$1: () => (/* binding */ ComponentRef), /* harmony export */ Console: () => (/* binding */ Console), /* harmony export */ DEFAULT_CURRENCY_CODE: () => (/* binding */ DEFAULT_CURRENCY_CODE), /* harmony export */ DEFAULT_LOCALE_ID: () => (/* binding */ DEFAULT_LOCALE_ID), /* harmony export */ DEFER_BLOCK_CONFIG: () => (/* binding */ DEFER_BLOCK_CONFIG), /* harmony export */ DEFER_BLOCK_DEPENDENCY_INTERCEPTOR: () => (/* binding */ DEFER_BLOCK_DEPENDENCY_INTERCEPTOR), /* harmony export */ DEFER_BLOCK_ID: () => (/* binding */ DEFER_BLOCK_ID), /* harmony export */ DEFER_BLOCK_SSR_ID_ATTRIBUTE: () => (/* binding */ DEFER_BLOCK_SSR_ID_ATTRIBUTE), /* harmony export */ DEFER_BLOCK_STATE: () => (/* binding */ DEFER_BLOCK_STATE$1), /* harmony export */ DEFER_BLOCK_STATE$1: () => (/* binding */ DEFER_BLOCK_STATE), /* harmony export */ DEFER_HYDRATE_TRIGGERS: () => (/* binding */ DEFER_HYDRATE_TRIGGERS), /* harmony export */ DEFER_PARENT_BLOCK_ID: () => (/* binding */ DEFER_PARENT_BLOCK_ID), /* harmony export */ DEHYDRATED_BLOCK_REGISTRY: () => (/* binding */ DEHYDRATED_BLOCK_REGISTRY), /* harmony export */ DISCONNECTED_NODES: () => (/* binding */ DISCONNECTED_NODES), /* harmony export */ DebugElement: () => (/* binding */ DebugElement), /* harmony export */ DebugEventListener: () => (/* binding */ DebugEventListener), /* harmony export */ DebugNode: () => (/* binding */ DebugNode), /* harmony export */ DeferBlockBehavior: () => (/* binding */ DeferBlockBehavior), /* harmony export */ DeferBlockState: () => (/* binding */ DeferBlockState), /* harmony export */ DehydratedBlockRegistry: () => (/* binding */ DehydratedBlockRegistry), /* harmony export */ Directive: () => (/* binding */ Directive), /* harmony export */ ELEMENT_CONTAINERS: () => (/* binding */ ELEMENT_CONTAINERS), /* harmony export */ EVENT_REPLAY_ENABLED_DEFAULT: () => (/* binding */ EVENT_REPLAY_ENABLED_DEFAULT), /* harmony export */ EVENT_REPLAY_QUEUE: () => (/* binding */ EVENT_REPLAY_QUEUE), /* harmony export */ ElementRef: () => (/* binding */ ElementRef), /* harmony export */ EnvironmentNgModuleRefAdapter: () => (/* binding */ EnvironmentNgModuleRefAdapter), /* harmony export */ Host: () => (/* binding */ Host), /* harmony export */ HostBinding: () => (/* binding */ HostBinding), /* harmony export */ HostListener: () => (/* binding */ HostListener), /* harmony export */ HydrationStatus: () => (/* binding */ HydrationStatus), /* harmony export */ I18N_DATA: () => (/* binding */ I18N_DATA), /* harmony export */ IMAGE_CONFIG: () => (/* binding */ IMAGE_CONFIG), /* harmony export */ IMAGE_CONFIG_DEFAULTS: () => (/* binding */ IMAGE_CONFIG_DEFAULTS), /* harmony export */ IS_ENABLED_BLOCKING_INITIAL_NAVIGATION: () => (/* binding */ IS_ENABLED_BLOCKING_INITIAL_NAVIGATION), /* harmony export */ IS_EVENT_REPLAY_ENABLED: () => (/* binding */ IS_EVENT_REPLAY_ENABLED), /* harmony export */ IS_HYDRATION_DOM_REUSE_ENABLED: () => (/* binding */ IS_HYDRATION_DOM_REUSE_ENABLED), /* harmony export */ IS_I18N_HYDRATION_ENABLED: () => (/* binding */ IS_I18N_HYDRATION_ENABLED), /* harmony export */ IS_INCREMENTAL_HYDRATION_ENABLED: () => (/* binding */ IS_INCREMENTAL_HYDRATION_ENABLED), /* harmony export */ Inject: () => (/* binding */ Inject), /* harmony export */ Injectable: () => (/* binding */ Injectable), /* harmony export */ Input: () => (/* binding */ Input), /* harmony export */ JSACTION_BLOCK_ELEMENT_MAP: () => (/* binding */ JSACTION_BLOCK_ELEMENT_MAP), /* harmony export */ JSACTION_EVENT_CONTRACT: () => (/* binding */ JSACTION_EVENT_CONTRACT), /* harmony export */ LContext: () => (/* binding */ LContext), /* harmony export */ LOCALE_ID: () => (/* binding */ LOCALE_ID), /* harmony export */ LocaleDataIndex: () => (/* binding */ LocaleDataIndex), /* harmony export */ MAX_ANIMATION_TIMEOUT: () => (/* binding */ MAX_ANIMATION_TIMEOUT), /* harmony export */ MULTIPLIER: () => (/* binding */ MULTIPLIER), /* harmony export */ MissingTranslationStrategy: () => (/* binding */ MissingTranslationStrategy), /* harmony export */ ModuleWithComponentFactories: () => (/* binding */ ModuleWithComponentFactories), /* harmony export */ NGH_ATTR_NAME: () => (/* binding */ NGH_ATTR_NAME), /* harmony export */ NGH_DATA_KEY: () => (/* binding */ NGH_DATA_KEY), /* harmony export */ NGH_DEFER_BLOCKS_KEY: () => (/* binding */ NGH_DEFER_BLOCKS_KEY), /* harmony export */ NODES: () => (/* binding */ NODES), /* harmony export */ NOOP_AFTER_RENDER_REF: () => (/* binding */ NOOP_AFTER_RENDER_REF), /* harmony export */ NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR: () => (/* binding */ NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR), /* harmony export */ NO_CHANGE: () => (/* binding */ NO_CHANGE), /* harmony export */ NO_ERRORS_SCHEMA: () => (/* binding */ NO_ERRORS_SCHEMA), /* harmony export */ NUM_ROOT_NODES: () => (/* binding */ NUM_ROOT_NODES), /* harmony export */ NgModule: () => (/* binding */ NgModule), /* harmony export */ NgModuleFactory: () => (/* binding */ NgModuleFactory), /* harmony export */ NgModuleFactory$1: () => (/* binding */ NgModuleFactory$1), /* harmony export */ NgModuleRef: () => (/* binding */ NgModuleRef), /* harmony export */ NgModuleRef$1: () => (/* binding */ NgModuleRef$1), /* harmony export */ Optional: () => (/* binding */ Optional), /* harmony export */ Output: () => (/* binding */ Output), /* harmony export */ PLATFORM_ID: () => (/* binding */ PLATFORM_ID), /* harmony export */ PLATFORM_INITIALIZER: () => (/* binding */ PLATFORM_INITIALIZER), /* harmony export */ PRESERVE_HOST_CONTENT: () => (/* binding */ PRESERVE_HOST_CONTENT), /* harmony export */ Pipe: () => (/* binding */ Pipe), /* harmony export */ ProfilerEvent: () => (/* binding */ ProfilerEvent), /* harmony export */ QueryList: () => (/* binding */ QueryList), /* harmony export */ ReflectionCapabilities: () => (/* binding */ ReflectionCapabilities), /* harmony export */ Renderer2: () => (/* binding */ Renderer2), /* harmony export */ RendererFactory2: () => (/* binding */ RendererFactory2), /* harmony export */ RendererStyleFlags2: () => (/* binding */ RendererStyleFlags2), /* harmony export */ SKIP_HYDRATION_ATTR_NAME: () => (/* binding */ SKIP_HYDRATION_ATTR_NAME), /* harmony export */ SSR_CONTENT_INTEGRITY_MARKER: () => (/* binding */ SSR_CONTENT_INTEGRITY_MARKER), /* harmony export */ Sanitizer: () => (/* binding */ Sanitizer), /* harmony export */ SecurityContext: () => (/* binding */ SecurityContext), /* harmony export */ Self: () => (/* binding */ Self), /* harmony export */ SimpleChange: () => (/* binding */ SimpleChange), /* harmony export */ SkipSelf: () => (/* binding */ SkipSelf), /* harmony export */ TEMPLATES: () => (/* binding */ TEMPLATES), /* harmony export */ TEMPLATE_ID: () => (/* binding */ TEMPLATE_ID), /* harmony export */ TESTABILITY: () => (/* binding */ TESTABILITY), /* harmony export */ TESTABILITY_GETTER: () => (/* binding */ TESTABILITY_GETTER), /* harmony export */ TRANSLATIONS: () => (/* binding */ TRANSLATIONS), /* harmony export */ TRANSLATIONS_FORMAT: () => (/* binding */ TRANSLATIONS_FORMAT), /* harmony export */ TemplateRef: () => (/* binding */ TemplateRef), /* harmony export */ Testability: () => (/* binding */ Testability), /* harmony export */ TestabilityRegistry: () => (/* binding */ TestabilityRegistry), /* harmony export */ TimerScheduler: () => (/* binding */ TimerScheduler), /* harmony export */ TracingAction: () => (/* binding */ TracingAction), /* harmony export */ TracingService: () => (/* binding */ TracingService), /* harmony export */ TransferState: () => (/* binding */ TransferState), /* harmony export */ Type: () => (/* binding */ Type), /* harmony export */ UseExhaustiveCheckNoChanges: () => (/* binding */ UseExhaustiveCheckNoChanges), /* harmony export */ ViewContainerRef: () => (/* binding */ ViewContainerRef), /* harmony export */ ViewEncapsulation: () => (/* binding */ ViewEncapsulation), /* harmony export */ ViewRef: () => (/* binding */ ViewRef), /* harmony export */ _sanitizeHtml: () => (/* binding */ _sanitizeHtml), /* harmony export */ _sanitizeUrl: () => (/* binding */ _sanitizeUrl), /* harmony export */ afterEveryRender: () => (/* binding */ afterEveryRender), /* harmony export */ afterNextRender: () => (/* binding */ afterNextRender), /* harmony export */ allLeavingAnimations: () => (/* binding */ allLeavingAnimations), /* harmony export */ allowSanitizationBypassAndThrow: () => (/* binding */ allowSanitizationBypassAndThrow), /* harmony export */ angularCoreEnv: () => (/* binding */ angularCoreEnv), /* harmony export */ appendDeferBlocksToJSActionMap: () => (/* binding */ appendDeferBlocksToJSActionMap), /* harmony export */ asNativeElements: () => (/* binding */ asNativeElements), /* harmony export */ assertComponentDef: () => (/* binding */ assertComponentDef), /* harmony export */ assertStandaloneComponentType: () => (/* binding */ assertStandaloneComponentType), /* harmony export */ bypassSanitizationTrustHtml: () => (/* binding */ bypassSanitizationTrustHtml), /* harmony export */ bypassSanitizationTrustResourceUrl: () => (/* binding */ bypassSanitizationTrustResourceUrl), /* harmony export */ bypassSanitizationTrustScript: () => (/* binding */ bypassSanitizationTrustScript), /* harmony export */ bypassSanitizationTrustStyle: () => (/* binding */ bypassSanitizationTrustStyle), /* harmony export */ bypassSanitizationTrustUrl: () => (/* binding */ bypassSanitizationTrustUrl), /* harmony export */ calcPathForNode: () => (/* binding */ calcPathForNode), /* harmony export */ checkNoChangesInternal: () => (/* binding */ checkNoChangesInternal), /* harmony export */ cleanupDehydratedViews: () => (/* binding */ cleanupDehydratedViews), /* harmony export */ clearResolutionOfComponentResourcesQueue: () => (/* binding */ clearResolutionOfComponentResourcesQueue), /* harmony export */ collectNativeNodes: () => (/* binding */ collectNativeNodes), /* harmony export */ collectNativeNodesInLContainer: () => (/* binding */ collectNativeNodesInLContainer), /* harmony export */ compileComponent: () => (/* binding */ compileComponent), /* harmony export */ compileDirective: () => (/* binding */ compileDirective), /* harmony export */ compileNgModule: () => (/* binding */ compileNgModule), /* harmony export */ compileNgModuleDefs: () => (/* binding */ compileNgModuleDefs), /* harmony export */ compilePipe: () => (/* binding */ compilePipe), /* harmony export */ convertHydrateTriggersToJsAction: () => (/* binding */ convertHydrateTriggersToJsAction), /* harmony export */ countBlocksSkippedByHydration: () => (/* binding */ countBlocksSkippedByHydration), /* harmony export */ createEnvironmentInjector: () => (/* binding */ createEnvironmentInjector), /* harmony export */ createMultiResultQuerySignalFn: () => (/* binding */ createMultiResultQuerySignalFn), /* harmony export */ createNgModule: () => (/* binding */ createNgModule), /* harmony export */ createNgModuleRef: () => (/* binding */ createNgModuleRef), /* harmony export */ createNgModuleRefWithProviders: () => (/* binding */ createNgModuleRefWithProviders), /* harmony export */ createSingleResultOptionalQuerySignalFn: () => (/* binding */ createSingleResultOptionalQuerySignalFn), /* harmony export */ createSingleResultRequiredQuerySignalFn: () => (/* binding */ createSingleResultRequiredQuerySignalFn), /* harmony export */ depsTracker: () => (/* binding */ depsTracker), /* harmony export */ devModeEqual: () => (/* binding */ devModeEqual), /* harmony export */ enableApplyRootElementTransformImpl: () => (/* binding */ enableApplyRootElementTransformImpl), /* harmony export */ enableClaimDehydratedIcuCaseImpl: () => (/* binding */ enableClaimDehydratedIcuCaseImpl), /* harmony export */ enableFindMatchingDehydratedViewImpl: () => (/* binding */ enableFindMatchingDehydratedViewImpl), /* harmony export */ enableLocateOrCreateContainerAnchorImpl: () => (/* binding */ enableLocateOrCreateContainerAnchorImpl), /* harmony export */ enableLocateOrCreateContainerRefImpl: () => (/* binding */ enableLocateOrCreateContainerRefImpl), /* harmony export */ enableLocateOrCreateElementContainerNodeImpl: () => (/* binding */ enableLocateOrCreateElementContainerNodeImpl), /* harmony export */ enableLocateOrCreateElementNodeImpl: () => (/* binding */ enableLocateOrCreateElementNodeImpl), /* harmony export */ enableLocateOrCreateI18nNodeImpl: () => (/* binding */ enableLocateOrCreateI18nNodeImpl), /* harmony export */ enableLocateOrCreateTextNodeImpl: () => (/* binding */ enableLocateOrCreateTextNodeImpl), /* harmony export */ enablePrepareI18nBlockForHydrationImpl: () => (/* binding */ enablePrepareI18nBlockForHydrationImpl), /* harmony export */ enableProfiling: () => (/* binding */ enableProfiling), /* harmony export */ enableRetrieveDeferBlockDataImpl: () => (/* binding */ enableRetrieveDeferBlockDataImpl), /* harmony export */ enableRetrieveHydrationInfoImpl: () => (/* binding */ enableRetrieveHydrationInfoImpl), /* harmony export */ enableStashEventListenerImpl: () => (/* binding */ enableStashEventListenerImpl), /* harmony export */ findLocaleData: () => (/* binding */ findLocaleData), /* harmony export */ flushModuleScopingQueueAsMuchAsPossible: () => (/* binding */ flushModuleScopingQueueAsMuchAsPossible), /* harmony export */ gatherDeferBlocksCommentNodes: () => (/* binding */ gatherDeferBlocksCommentNodes), /* harmony export */ generateStandaloneInDeclarationsError: () => (/* binding */ generateStandaloneInDeclarationsError), /* harmony export */ getAsyncClassMetadataFn: () => (/* binding */ getAsyncClassMetadataFn), /* harmony export */ getCompilerFacade: () => (/* binding */ getCompilerFacade), /* harmony export */ getDebugNode: () => (/* binding */ getDebugNode), /* harmony export */ getDeferBlocks: () => (/* binding */ getDeferBlocks$1), /* harmony export */ getDirectives: () => (/* binding */ getDirectives), /* harmony export */ getDocument: () => (/* binding */ getDocument), /* harmony export */ getHostElement: () => (/* binding */ getHostElement), /* harmony export */ getLContext: () => (/* binding */ getLContext), /* harmony export */ getLDeferBlockDetails: () => (/* binding */ getLDeferBlockDetails), /* harmony export */ getLNodeForHydration: () => (/* binding */ getLNodeForHydration), /* harmony export */ getLocaleCurrencyCode: () => (/* binding */ getLocaleCurrencyCode), /* harmony export */ getLocalePluralCase: () => (/* binding */ getLocalePluralCase), /* harmony export */ getOrComputeI18nChildren: () => (/* binding */ getOrComputeI18nChildren), /* harmony export */ getRegisteredNgModuleType: () => (/* binding */ getRegisteredNgModuleType), /* harmony export */ getSanitizationBypassType: () => (/* binding */ getSanitizationBypassType), /* harmony export */ getTDeferBlockDetails: () => (/* binding */ getTDeferBlockDetails), /* harmony export */ getTransferState: () => (/* binding */ getTransferState), /* harmony export */ inferTagNameFromDefinition: () => (/* binding */ inferTagNameFromDefinition), /* harmony export */ inputBinding: () => (/* binding */ inputBinding), /* harmony export */ invokeListeners: () => (/* binding */ invokeListeners), /* harmony export */ isBoundToModule: () => (/* binding */ isBoundToModule), /* harmony export */ isComponentDefPendingResolution: () => (/* binding */ isComponentDefPendingResolution), /* harmony export */ isComponentResourceResolutionQueueEmpty: () => (/* binding */ isComponentResourceResolutionQueueEmpty), /* harmony export */ isDeferBlock: () => (/* binding */ isDeferBlock), /* harmony export */ isDetachedByI18n: () => (/* binding */ isDetachedByI18n), /* harmony export */ isDisconnectedNode: () => (/* binding */ isDisconnectedNode), /* harmony export */ isI18nHydrationEnabled: () => (/* binding */ isI18nHydrationEnabled), /* harmony export */ isI18nHydrationSupportEnabled: () => (/* binding */ isI18nHydrationSupportEnabled), /* harmony export */ isInSkipHydrationBlock: () => (/* binding */ isInSkipHydrationBlock), /* harmony export */ isIncrementalHydrationEnabled: () => (/* binding */ isIncrementalHydrationEnabled), /* harmony export */ isJsObject: () => (/* binding */ isJsObject), /* harmony export */ isLetDeclaration: () => (/* binding */ isLetDeclaration), /* harmony export */ isListLikeIterable: () => (/* binding */ isListLikeIterable), /* harmony export */ isNgModule: () => (/* binding */ isNgModule), /* harmony export */ isPromise: () => (/* binding */ isPromise), /* harmony export */ isSignal: () => (/* binding */ isSignal), /* harmony export */ isSubscribable: () => (/* binding */ isSubscribable), /* harmony export */ isTNodeShape: () => (/* binding */ isTNodeShape), /* harmony export */ isViewDirty: () => (/* binding */ isViewDirty), /* harmony export */ isWritableSignal: () => (/* binding */ isWritableSignal), /* harmony export */ iterateListLike: () => (/* binding */ iterateListLike), /* harmony export */ makePropDecorator: () => (/* binding */ makePropDecorator), /* harmony export */ makeStateKey: () => (/* binding */ makeStateKey), /* harmony export */ markForRefresh: () => (/* binding */ markForRefresh), /* harmony export */ noSideEffects: () => (/* binding */ noSideEffects), /* harmony export */ optionsReducer: () => (/* binding */ optionsReducer), /* harmony export */ outputBinding: () => (/* binding */ outputBinding), /* harmony export */ patchComponentDefWithScope: () => (/* binding */ patchComponentDefWithScope), /* harmony export */ performanceMarkFeature: () => (/* binding */ performanceMarkFeature), /* harmony export */ processAndInitTriggers: () => (/* binding */ processAndInitTriggers), /* harmony export */ processBlockData: () => (/* binding */ processBlockData), /* harmony export */ processTextNodeBeforeSerialization: () => (/* binding */ processTextNodeBeforeSerialization), /* harmony export */ profiler: () => (/* binding */ profiler), /* harmony export */ promiseWithResolvers: () => (/* binding */ promiseWithResolvers), /* harmony export */ provideAppInitializer: () => (/* binding */ provideAppInitializer), /* harmony export */ provideNgReflectAttributes: () => (/* binding */ provideNgReflectAttributes), /* harmony export */ provideZonelessChangeDetection: () => (/* binding */ provideZonelessChangeDetection), /* harmony export */ provideZonelessChangeDetectionInternal: () => (/* binding */ provideZonelessChangeDetectionInternal), /* harmony export */ publishDefaultGlobalUtils: () => (/* binding */ publishDefaultGlobalUtils), /* harmony export */ publishExternalGlobalUtil: () => (/* binding */ publishExternalGlobalUtil), /* harmony export */ publishSignalConfiguration: () => (/* binding */ publishSignalConfiguration), /* harmony export */ readHydrationInfo: () => (/* binding */ readHydrationInfo), /* harmony export */ readPatchedLView: () => (/* binding */ readPatchedLView), /* harmony export */ registerLocaleData: () => (/* binding */ registerLocaleData), /* harmony export */ registerNgModuleType: () => (/* binding */ registerNgModuleType), /* harmony export */ remove: () => (/* binding */ remove), /* harmony export */ removeListeners: () => (/* binding */ removeListeners), /* harmony export */ renderDeferBlockState: () => (/* binding */ renderDeferBlockState), /* harmony export */ resetCompiledComponents: () => (/* binding */ resetCompiledComponents), /* harmony export */ resetIncrementalHydrationEnabledWarnedForTests: () => (/* binding */ resetIncrementalHydrationEnabledWarnedForTests), /* harmony export */ resetJitOptions: () => (/* binding */ resetJitOptions), /* harmony export */ resolveComponentResources: () => (/* binding */ resolveComponentResources), /* harmony export */ restoreComponentResolutionQueue: () => (/* binding */ restoreComponentResolutionQueue), /* harmony export */ setAllowDuplicateNgModuleIdsForTest: () => (/* binding */ setAllowDuplicateNgModuleIdsForTest), /* harmony export */ setClassMetadata: () => (/* binding */ setClassMetadata), /* harmony export */ setClassMetadataAsync: () => (/* binding */ setClassMetadataAsync), /* harmony export */ setDocument: () => (/* binding */ setDocument), /* harmony export */ setIsI18nHydrationSupportEnabled: () => (/* binding */ setIsI18nHydrationSupportEnabled), /* harmony export */ setJSActionAttributes: () => (/* binding */ setJSActionAttributes), /* harmony export */ setJitOptions: () => (/* binding */ setJitOptions), /* harmony export */ setLocaleId: () => (/* binding */ setLocaleId), /* harmony export */ setStashFn: () => (/* binding */ setStashFn), /* harmony export */ setTestabilityGetter: () => (/* binding */ setTestabilityGetter), /* harmony export */ sharedMapFunction: () => (/* binding */ sharedMapFunction), /* harmony export */ sharedStashFunction: () => (/* binding */ sharedStashFunction), /* harmony export */ transitiveScopesFor: () => (/* binding */ transitiveScopesFor), /* harmony export */ triggerHydrationFromBlockName: () => (/* binding */ triggerHydrationFromBlockName), /* harmony export */ triggerResourceLoading: () => (/* binding */ triggerResourceLoading), /* harmony export */ trySerializeI18nBlock: () => (/* binding */ trySerializeI18nBlock), /* harmony export */ twoWayBinding: () => (/* binding */ twoWayBinding), /* harmony export */ unregisterAllLocaleData: () => (/* binding */ unregisterAllLocaleData), /* harmony export */ unsupportedProjectionOfDomNodes: () => (/* binding */ unsupportedProjectionOfDomNodes), /* harmony export */ unwrapSafeValue: () => (/* binding */ unwrapSafeValue), /* harmony export */ validAppIdInitializer: () => (/* binding */ validAppIdInitializer), /* harmony export */ validateMatchingNode: () => (/* binding */ validateMatchingNode), /* harmony export */ validateNodeExists: () => (/* binding */ validateNodeExists), /* harmony export */ verifySsrContentsIntegrity: () => (/* binding */ verifySsrContentsIntegrity), /* harmony export */ "ɵCONTROL": () => (/* binding */ ɵCONTROL), /* harmony export */ "ɵcontrolUpdate": () => (/* binding */ ɵcontrolUpdate), /* harmony export */ "ɵgetUnknownElementStrictMode": () => (/* binding */ ɵgetUnknownElementStrictMode), /* harmony export */ "ɵgetUnknownPropertyStrictMode": () => (/* binding */ ɵgetUnknownPropertyStrictMode), /* harmony export */ "ɵsetClassDebugInfo": () => (/* binding */ ɵsetClassDebugInfo), /* harmony export */ "ɵsetUnknownElementStrictMode": () => (/* binding */ ɵsetUnknownElementStrictMode), /* harmony export */ "ɵsetUnknownPropertyStrictMode": () => (/* binding */ ɵsetUnknownPropertyStrictMode), /* harmony export */ "ɵɵExternalStylesFeature": () => (/* binding */ ɵɵExternalStylesFeature), /* harmony export */ "ɵɵHostDirectivesFeature": () => (/* binding */ ɵɵHostDirectivesFeature), /* harmony export */ "ɵɵInheritDefinitionFeature": () => (/* binding */ ɵɵInheritDefinitionFeature), /* harmony export */ "ɵɵNgOnChangesFeature": () => (/* binding */ ɵɵNgOnChangesFeature), /* harmony export */ "ɵɵProvidersFeature": () => (/* binding */ ɵɵProvidersFeature), /* harmony export */ "ɵɵadvance": () => (/* binding */ ɵɵadvance), /* harmony export */ "ɵɵanimateEnter": () => (/* binding */ ɵɵanimateEnter), /* harmony export */ "ɵɵanimateEnterListener": () => (/* binding */ ɵɵanimateEnterListener), /* harmony export */ "ɵɵanimateLeave": () => (/* binding */ ɵɵanimateLeave), /* harmony export */ "ɵɵanimateLeaveListener": () => (/* binding */ ɵɵanimateLeaveListener), /* harmony export */ "ɵɵariaProperty": () => (/* binding */ ɵɵariaProperty), /* harmony export */ "ɵɵattachSourceLocations": () => (/* binding */ ɵɵattachSourceLocations), /* harmony export */ "ɵɵattribute": () => (/* binding */ ɵɵattribute), /* harmony export */ "ɵɵclassMap": () => (/* binding */ ɵɵclassMap), /* harmony export */ "ɵɵclassProp": () => (/* binding */ ɵɵclassProp), /* harmony export */ "ɵɵcomponentInstance": () => (/* binding */ ɵɵcomponentInstance), /* harmony export */ "ɵɵconditional": () => (/* binding */ ɵɵconditional), /* harmony export */ "ɵɵconditionalBranchCreate": () => (/* binding */ ɵɵconditionalBranchCreate), /* harmony export */ "ɵɵconditionalCreate": () => (/* binding */ ɵɵconditionalCreate), /* harmony export */ "ɵɵcontentQuery": () => (/* binding */ ɵɵcontentQuery), /* harmony export */ "ɵɵcontentQuerySignal": () => (/* binding */ ɵɵcontentQuerySignal), /* harmony export */ "ɵɵcontrol": () => (/* binding */ ɵɵcontrol), /* harmony export */ "ɵɵcontrolCreate": () => (/* binding */ ɵɵcontrolCreate), /* harmony export */ "ɵɵdeclareLet": () => (/* binding */ ɵɵdeclareLet), /* harmony export */ "ɵɵdefer": () => (/* binding */ ɵɵdefer), /* harmony export */ "ɵɵdeferEnableTimerScheduling": () => (/* binding */ ɵɵdeferEnableTimerScheduling), /* harmony export */ "ɵɵdeferHydrateNever": () => (/* binding */ ɵɵdeferHydrateNever), /* harmony export */ "ɵɵdeferHydrateOnHover": () => (/* binding */ ɵɵdeferHydrateOnHover), /* harmony export */ "ɵɵdeferHydrateOnIdle": () => (/* binding */ ɵɵdeferHydrateOnIdle), /* harmony export */ "ɵɵdeferHydrateOnImmediate": () => (/* binding */ ɵɵdeferHydrateOnImmediate), /* harmony export */ "ɵɵdeferHydrateOnInteraction": () => (/* binding */ ɵɵdeferHydrateOnInteraction), /* harmony export */ "ɵɵdeferHydrateOnTimer": () => (/* binding */ ɵɵdeferHydrateOnTimer), /* harmony export */ "ɵɵdeferHydrateOnViewport": () => (/* binding */ ɵɵdeferHydrateOnViewport), /* harmony export */ "ɵɵdeferHydrateWhen": () => (/* binding */ ɵɵdeferHydrateWhen), /* harmony export */ "ɵɵdeferOnHover": () => (/* binding */ ɵɵdeferOnHover), /* harmony export */ "ɵɵdeferOnIdle": () => (/* binding */ ɵɵdeferOnIdle), /* harmony export */ "ɵɵdeferOnImmediate": () => (/* binding */ ɵɵdeferOnImmediate), /* harmony export */ "ɵɵdeferOnInteraction": () => (/* binding */ ɵɵdeferOnInteraction), /* harmony export */ "ɵɵdeferOnTimer": () => (/* binding */ ɵɵdeferOnTimer), /* harmony export */ "ɵɵdeferOnViewport": () => (/* binding */ ɵɵdeferOnViewport), /* harmony export */ "ɵɵdeferPrefetchOnHover": () => (/* binding */ ɵɵdeferPrefetchOnHover), /* harmony export */ "ɵɵdeferPrefetchOnIdle": () => (/* binding */ ɵɵdeferPrefetchOnIdle), /* harmony export */ "ɵɵdeferPrefetchOnImmediate": () => (/* binding */ ɵɵdeferPrefetchOnImmediate), /* harmony export */ "ɵɵdeferPrefetchOnInteraction": () => (/* binding */ ɵɵdeferPrefetchOnInteraction), /* harmony export */ "ɵɵdeferPrefetchOnTimer": () => (/* binding */ ɵɵdeferPrefetchOnTimer), /* harmony export */ "ɵɵdeferPrefetchOnViewport": () => (/* binding */ ɵɵdeferPrefetchOnViewport), /* harmony export */ "ɵɵdeferPrefetchWhen": () => (/* binding */ ɵɵdeferPrefetchWhen), /* harmony export */ "ɵɵdeferWhen": () => (/* binding */ ɵɵdeferWhen), /* harmony export */ "ɵɵdefineComponent": () => (/* binding */ ɵɵdefineComponent), /* harmony export */ "ɵɵdefineDirective": () => (/* binding */ ɵɵdefineDirective), /* harmony export */ "ɵɵdefineNgModule": () => (/* binding */ ɵɵdefineNgModule), /* harmony export */ "ɵɵdefinePipe": () => (/* binding */ ɵɵdefinePipe), /* harmony export */ "ɵɵdirectiveInject": () => (/* binding */ ɵɵdirectiveInject), /* harmony export */ "ɵɵdomElement": () => (/* binding */ ɵɵdomElement), /* harmony export */ "ɵɵdomElementContainer": () => (/* binding */ ɵɵdomElementContainer), /* harmony export */ "ɵɵdomElementContainerEnd": () => (/* binding */ ɵɵdomElementContainerEnd), /* harmony export */ "ɵɵdomElementContainerStart": () => (/* binding */ ɵɵdomElementContainerStart), /* harmony export */ "ɵɵdomElementEnd": () => (/* binding */ ɵɵdomElementEnd), /* harmony export */ "ɵɵdomElementStart": () => (/* binding */ ɵɵdomElementStart), /* harmony export */ "ɵɵdomListener": () => (/* binding */ ɵɵdomListener), /* harmony export */ "ɵɵdomProperty": () => (/* binding */ ɵɵdomProperty), /* harmony export */ "ɵɵdomTemplate": () => (/* binding */ ɵɵdomTemplate), /* harmony export */ "ɵɵelement": () => (/* binding */ ɵɵelement), /* harmony export */ "ɵɵelementContainer": () => (/* binding */ ɵɵelementContainer), /* harmony export */ "ɵɵelementContainerEnd": () => (/* binding */ ɵɵelementContainerEnd), /* harmony export */ "ɵɵelementContainerStart": () => (/* binding */ ɵɵelementContainerStart), /* harmony export */ "ɵɵelementEnd": () => (/* binding */ ɵɵelementEnd), /* harmony export */ "ɵɵelementStart": () => (/* binding */ ɵɵelementStart), /* harmony export */ "ɵɵgetComponentDepsFactory": () => (/* binding */ ɵɵgetComponentDepsFactory), /* harmony export */ "ɵɵgetCurrentView": () => (/* binding */ ɵɵgetCurrentView), /* harmony export */ "ɵɵgetInheritedFactory": () => (/* binding */ ɵɵgetInheritedFactory), /* harmony export */ "ɵɵgetReplaceMetadataURL": () => (/* binding */ ɵɵgetReplaceMetadataURL), /* harmony export */ "ɵɵi18n": () => (/* binding */ ɵɵi18n), /* harmony export */ "ɵɵi18nApply": () => (/* binding */ ɵɵi18nApply), /* harmony export */ "ɵɵi18nAttributes": () => (/* binding */ ɵɵi18nAttributes), /* harmony export */ "ɵɵi18nEnd": () => (/* binding */ ɵɵi18nEnd), /* harmony export */ "ɵɵi18nExp": () => (/* binding */ ɵɵi18nExp), /* harmony export */ "ɵɵi18nPostprocess": () => (/* binding */ ɵɵi18nPostprocess), /* harmony export */ "ɵɵi18nStart": () => (/* binding */ ɵɵi18nStart), /* harmony export */ "ɵɵinjectAttribute": () => (/* binding */ ɵɵinjectAttribute), /* harmony export */ "ɵɵinterpolate": () => (/* binding */ ɵɵinterpolate), /* harmony export */ "ɵɵinterpolate1": () => (/* binding */ ɵɵinterpolate1), /* harmony export */ "ɵɵinterpolate2": () => (/* binding */ ɵɵinterpolate2), /* harmony export */ "ɵɵinterpolate3": () => (/* binding */ ɵɵinterpolate3), /* harmony export */ "ɵɵinterpolate4": () => (/* binding */ ɵɵinterpolate4), /* harmony export */ "ɵɵinterpolate5": () => (/* binding */ ɵɵinterpolate5), /* harmony export */ "ɵɵinterpolate6": () => (/* binding */ ɵɵinterpolate6), /* harmony export */ "ɵɵinterpolate7": () => (/* binding */ ɵɵinterpolate7), /* harmony export */ "ɵɵinterpolate8": () => (/* binding */ ɵɵinterpolate8), /* harmony export */ "ɵɵinterpolateV": () => (/* binding */ ɵɵinterpolateV), /* harmony export */ "ɵɵinvalidFactory": () => (/* binding */ ɵɵinvalidFactory), /* harmony export */ "ɵɵlistener": () => (/* binding */ ɵɵlistener), /* harmony export */ "ɵɵloadQuery": () => (/* binding */ ɵɵloadQuery), /* harmony export */ "ɵɵnextContext": () => (/* binding */ ɵɵnextContext), /* harmony export */ "ɵɵpipe": () => (/* binding */ ɵɵpipe), /* harmony export */ "ɵɵpipeBind1": () => (/* binding */ ɵɵpipeBind1), /* harmony export */ "ɵɵpipeBind2": () => (/* binding */ ɵɵpipeBind2), /* harmony export */ "ɵɵpipeBind3": () => (/* binding */ ɵɵpipeBind3), /* harmony export */ "ɵɵpipeBind4": () => (/* binding */ ɵɵpipeBind4), /* harmony export */ "ɵɵpipeBindV": () => (/* binding */ ɵɵpipeBindV), /* harmony export */ "ɵɵprojection": () => (/* binding */ ɵɵprojection), /* harmony export */ "ɵɵprojectionDef": () => (/* binding */ ɵɵprojectionDef), /* harmony export */ "ɵɵproperty": () => (/* binding */ ɵɵproperty), /* harmony export */ "ɵɵpureFunction0": () => (/* binding */ ɵɵpureFunction0), /* harmony export */ "ɵɵpureFunction1": () => (/* binding */ ɵɵpureFunction1), /* harmony export */ "ɵɵpureFunction2": () => (/* binding */ ɵɵpureFunction2), /* harmony export */ "ɵɵpureFunction3": () => (/* binding */ ɵɵpureFunction3), /* harmony export */ "ɵɵpureFunction4": () => (/* binding */ ɵɵpureFunction4), /* harmony export */ "ɵɵpureFunction5": () => (/* binding */ ɵɵpureFunction5), /* harmony export */ "ɵɵpureFunction6": () => (/* binding */ ɵɵpureFunction6), /* harmony export */ "ɵɵpureFunction7": () => (/* binding */ ɵɵpureFunction7), /* harmony export */ "ɵɵpureFunction8": () => (/* binding */ ɵɵpureFunction8), /* harmony export */ "ɵɵpureFunctionV": () => (/* binding */ ɵɵpureFunctionV), /* harmony export */ "ɵɵqueryAdvance": () => (/* binding */ ɵɵqueryAdvance), /* harmony export */ "ɵɵqueryRefresh": () => (/* binding */ ɵɵqueryRefresh), /* harmony export */ "ɵɵreadContextLet": () => (/* binding */ ɵɵreadContextLet), /* harmony export */ "ɵɵreference": () => (/* binding */ ɵɵreference), /* harmony export */ "ɵɵrepeater": () => (/* binding */ ɵɵrepeater), /* harmony export */ "ɵɵrepeaterCreate": () => (/* binding */ ɵɵrepeaterCreate), /* harmony export */ "ɵɵrepeaterTrackByIdentity": () => (/* binding */ ɵɵrepeaterTrackByIdentity), /* harmony export */ "ɵɵrepeaterTrackByIndex": () => (/* binding */ ɵɵrepeaterTrackByIndex), /* harmony export */ "ɵɵreplaceMetadata": () => (/* binding */ ɵɵreplaceMetadata), /* harmony export */ "ɵɵresolveBody": () => (/* binding */ ɵɵresolveBody), /* harmony export */ "ɵɵresolveDocument": () => (/* binding */ ɵɵresolveDocument), /* harmony export */ "ɵɵresolveWindow": () => (/* binding */ ɵɵresolveWindow), /* harmony export */ "ɵɵsanitizeHtml": () => (/* binding */ ɵɵsanitizeHtml), /* harmony export */ "ɵɵsanitizeResourceUrl": () => (/* binding */ ɵɵsanitizeResourceUrl), /* harmony export */ "ɵɵsanitizeScript": () => (/* binding */ ɵɵsanitizeScript), /* harmony export */ "ɵɵsanitizeStyle": () => (/* binding */ ɵɵsanitizeStyle), /* harmony export */ "ɵɵsanitizeUrl": () => (/* binding */ ɵɵsanitizeUrl), /* harmony export */ "ɵɵsanitizeUrlOrResourceUrl": () => (/* binding */ ɵɵsanitizeUrlOrResourceUrl), /* harmony export */ "ɵɵsetComponentScope": () => (/* binding */ ɵɵsetComponentScope), /* harmony export */ "ɵɵsetNgModuleScope": () => (/* binding */ ɵɵsetNgModuleScope), /* harmony export */ "ɵɵstoreLet": () => (/* binding */ ɵɵstoreLet), /* harmony export */ "ɵɵstyleMap": () => (/* binding */ ɵɵstyleMap), /* harmony export */ "ɵɵstyleProp": () => (/* binding */ ɵɵstyleProp), /* harmony export */ "ɵɵsyntheticHostListener": () => (/* binding */ ɵɵsyntheticHostListener), /* harmony export */ "ɵɵsyntheticHostProperty": () => (/* binding */ ɵɵsyntheticHostProperty), /* harmony export */ "ɵɵtemplate": () => (/* binding */ ɵɵtemplate), /* harmony export */ "ɵɵtemplateRefExtractor": () => (/* binding */ ɵɵtemplateRefExtractor), /* harmony export */ "ɵɵtext": () => (/* binding */ ɵɵtext), /* harmony export */ "ɵɵtextInterpolate": () => (/* binding */ ɵɵtextInterpolate), /* harmony export */ "ɵɵtextInterpolate1": () => (/* binding */ ɵɵtextInterpolate1), /* harmony export */ "ɵɵtextInterpolate2": () => (/* binding */ ɵɵtextInterpolate2), /* harmony export */ "ɵɵtextInterpolate3": () => (/* binding */ ɵɵtextInterpolate3), /* harmony export */ "ɵɵtextInterpolate4": () => (/* binding */ ɵɵtextInterpolate4), /* harmony export */ "ɵɵtextInterpolate5": () => (/* binding */ ɵɵtextInterpolate5), /* harmony export */ "ɵɵtextInterpolate6": () => (/* binding */ ɵɵtextInterpolate6), /* harmony export */ "ɵɵtextInterpolate7": () => (/* binding */ ɵɵtextInterpolate7), /* harmony export */ "ɵɵtextInterpolate8": () => (/* binding */ ɵɵtextInterpolate8), /* harmony export */ "ɵɵtextInterpolateV": () => (/* binding */ ɵɵtextInterpolateV), /* harmony export */ "ɵɵtrustConstantHtml": () => (/* binding */ ɵɵtrustConstantHtml), /* harmony export */ "ɵɵtrustConstantResourceUrl": () => (/* binding */ ɵɵtrustConstantResourceUrl), /* harmony export */ "ɵɵtwoWayBindingSet": () => (/* binding */ ɵɵtwoWayBindingSet), /* harmony export */ "ɵɵtwoWayListener": () => (/* binding */ ɵɵtwoWayListener), /* harmony export */ "ɵɵtwoWayProperty": () => (/* binding */ ɵɵtwoWayProperty), /* harmony export */ "ɵɵvalidateAttribute": () => (/* binding */ ɵɵvalidateAttribute), /* harmony export */ "ɵɵviewQuery": () => (/* binding */ ɵɵviewQuery), /* harmony export */ "ɵɵviewQuerySignal": () => (/* binding */ ɵɵviewQuerySignal) /* harmony export */ }); /* harmony import */ var _Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@angular-builders/custom-webpack/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 74349); /* harmony import */ var _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./_untracked-chunk.mjs */ 40072); /* harmony import */ var _effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core/primitives/signals */ 88180); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 33242); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ 72737); /* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs/operators */ 38442); /* harmony import */ var _attribute_chunk_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./_attribute-chunk.mjs */ 52349); /** * @license Angular v21.1.2 * (c) 2010-2026 Google LLC. https://angular.dev/ * License: MIT */ function noSideEffects(fn) { return { toString: fn }.toString(); } const ANNOTATIONS = '__annotations__'; const PARAMETERS = '__parameters__'; const PROP_METADATA = '__prop__metadata__'; function makeDecorator(name, props, parentClass, additionalProcessing, typeFn) { return noSideEffects(() => { const metaCtor = makeMetadataCtor(props); function DecoratorFactory(...args) { if (this instanceof DecoratorFactory) { metaCtor.call(this, ...args); return this; } const annotationInstance = new DecoratorFactory(...args); return function TypeDecorator(cls) { if (typeFn) typeFn(cls, ...args); const annotations = cls.hasOwnProperty(ANNOTATIONS) ? cls[ANNOTATIONS] : Object.defineProperty(cls, ANNOTATIONS, { value: [] })[ANNOTATIONS]; annotations.push(annotationInstance); return cls; }; } if (parentClass) { DecoratorFactory.prototype = Object.create(parentClass.prototype); } DecoratorFactory.prototype.ngMetadataName = name; DecoratorFactory.annotationCls = DecoratorFactory; return DecoratorFactory; }); } function makeMetadataCtor(props) { return function ctor(...args) { if (props) { const values = props(...args); for (const propName in values) { this[propName] = values[propName]; } } }; } function makeParamDecorator(name, props, parentClass) { return noSideEffects(() => { const metaCtor = makeMetadataCtor(props); function ParamDecoratorFactory(...args) { if (this instanceof ParamDecoratorFactory) { metaCtor.apply(this, args); return this; } const annotationInstance = new ParamDecoratorFactory(...args); ParamDecorator.annotation = annotationInstance; return ParamDecorator; function ParamDecorator(cls, unusedKey, index) { const parameters = cls.hasOwnProperty(PARAMETERS) ? cls[PARAMETERS] : Object.defineProperty(cls, PARAMETERS, { value: [] })[PARAMETERS]; while (parameters.length <= index) { parameters.push(null); } (parameters[index] = parameters[index] || []).push(annotationInstance); return cls; } } ParamDecoratorFactory.prototype.ngMetadataName = name; ParamDecoratorFactory.annotationCls = ParamDecoratorFactory; return ParamDecoratorFactory; }); } function makePropDecorator(name, props, parentClass, additionalProcessing) { return noSideEffects(() => { const metaCtor = makeMetadataCtor(props); function PropDecoratorFactory(...args) { if (this instanceof PropDecoratorFactory) { metaCtor.apply(this, args); return this; } const decoratorInstance = new PropDecoratorFactory(...args); function PropDecorator(target, name) { if (target === undefined) { throw new Error('Standard Angular field decorators are not supported in JIT mode.'); } const constructor = target.constructor; const meta = constructor.hasOwnProperty(PROP_METADATA) ? constructor[PROP_METADATA] : Object.defineProperty(constructor, PROP_METADATA, { value: {} })[PROP_METADATA]; meta[name] = meta.hasOwnProperty(name) && meta[name] || []; meta[name].unshift(decoratorInstance); } return PropDecorator; } if (parentClass) { PropDecoratorFactory.prototype = Object.create(parentClass.prototype); } PropDecoratorFactory.prototype.ngMetadataName = name; PropDecoratorFactory.annotationCls = PropDecoratorFactory; return PropDecoratorFactory; }); } const Inject = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.attachInjectFlag)(makeParamDecorator('Inject', token => ({ token })), -1); const Optional = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.attachInjectFlag)(makeParamDecorator('Optional'), 8); const Self = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.attachInjectFlag)(makeParamDecorator('Self'), 2); const SkipSelf = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.attachInjectFlag)(makeParamDecorator('SkipSelf'), 4); const Host = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.attachInjectFlag)(makeParamDecorator('Host'), 1); function getCompilerFacade(request) { const globalNg = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__._global['ng']; if (globalNg && globalNg.ɵcompilerFacade) { return globalNg.ɵcompilerFacade; } if (typeof ngDevMode === 'undefined' || ngDevMode) { console.error(`JIT compilation failed for ${request.kind}`, request.type); let message = `The ${request.kind} '${request.type.name}' needs to be compiled using the JIT compiler, but '@angular/compiler' is not available.\n\n`; if (request.usage === 1) { message += `The ${request.kind} is part of a library that has been partially compiled.\n`; message += `However, the Angular Linker has not processed the library such that JIT compilation is used as fallback.\n`; message += '\n'; message += `Ideally, the library is processed using the Angular Linker to become fully AOT compiled.\n`; } else { message += `JIT compilation is discouraged for production use-cases! Consider using AOT mode instead.\n`; } message += `Alternatively, the JIT compiler should be loaded by bootstrapping using '@angular/platform-browser-dynamic' or '@angular/platform-server',\n`; message += `or manually provide the compiler with 'import "@angular/compiler";' before bootstrapping.`; throw new Error(message); } else { throw new Error('JIT compiler unavailable'); } } const angularCoreDiEnv = { 'ɵɵdefineInjectable': _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"], 'ɵɵdefineInjector': _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"], 'ɵɵinject': _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"], 'ɵɵinvalidFactoryDep': _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵinvalidFactoryDep"], 'resolveForwardRef': _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.resolveForwardRef }; const Type = Function; function isType(v) { return typeof v === 'function'; } const ES5_DELEGATE_CTOR = /^function\s+\S+\(\)\s*{[\s\S]+\.apply\(this,\s*(arguments|(?:[^()]+\(\[\],)?[^()]+\(arguments\).*)\)/; const ES2015_INHERITED_CLASS = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{/; const ES2015_INHERITED_CLASS_WITH_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(/; const ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR = /^class\s+[A-Za-z\d$_]*\s*extends\s+[^{]+{[\s\S]*constructor\s*\(\)\s*{[^}]*super\(\.\.\.arguments\)/; function isDelegateCtor(typeStr) { return ES5_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS_WITH_DELEGATE_CTOR.test(typeStr) || ES2015_INHERITED_CLASS.test(typeStr) && !ES2015_INHERITED_CLASS_WITH_CTOR.test(typeStr); } class ReflectionCapabilities { _reflect; constructor(reflect) { this._reflect = reflect || _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__._global['Reflect']; } factory(t) { return (...args) => new t(...args); } _zipTypesAndAnnotations(paramTypes, paramAnnotations) { let result; if (typeof paramTypes === 'undefined') { result = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.newArray)(paramAnnotations.length); } else { result = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.newArray)(paramTypes.length); } for (let i = 0; i < result.length; i++) { if (typeof paramTypes === 'undefined') { result[i] = []; } else if (paramTypes[i] && paramTypes[i] != Object) { result[i] = [paramTypes[i]]; } else { result[i] = []; } if (paramAnnotations && paramAnnotations[i] != null) { result[i] = result[i].concat(paramAnnotations[i]); } } return result; } _ownParameters(type, parentCtor) { const typeStr = type.toString(); if (isDelegateCtor(typeStr)) { return null; } if (type.parameters && type.parameters !== parentCtor.parameters) { return type.parameters; } const tsickleCtorParams = type.ctorParameters; if (tsickleCtorParams && tsickleCtorParams !== parentCtor.ctorParameters) { const ctorParameters = typeof tsickleCtorParams === 'function' ? tsickleCtorParams() : tsickleCtorParams; const paramTypes = ctorParameters.map(ctorParam => ctorParam && ctorParam.type); const paramAnnotations = ctorParameters.map(ctorParam => ctorParam && convertTsickleDecoratorIntoMetadata(ctorParam.decorators)); return this._zipTypesAndAnnotations(paramTypes, paramAnnotations); } const paramAnnotations = type.hasOwnProperty(PARAMETERS) && type[PARAMETERS]; const paramTypes = this._reflect && this._reflect.getOwnMetadata && this._reflect.getOwnMetadata('design:paramtypes', type); if (paramTypes || paramAnnotations) { return this._zipTypesAndAnnotations(paramTypes, paramAnnotations); } return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.newArray)(type.length); } parameters(type) { if (!isType(type)) { return []; } const parentCtor = getParentCtor(type); let parameters = this._ownParameters(type, parentCtor); if (!parameters && parentCtor !== Object) { parameters = this.parameters(parentCtor); } return parameters || []; } _ownAnnotations(typeOrFunc, parentCtor) { if (typeOrFunc.annotations && typeOrFunc.annotations !== parentCtor.annotations) { let annotations = typeOrFunc.annotations; if (typeof annotations === 'function' && annotations.annotations) { annotations = annotations.annotations; } return annotations; } if (typeOrFunc.decorators && typeOrFunc.decorators !== parentCtor.decorators) { return convertTsickleDecoratorIntoMetadata(typeOrFunc.decorators); } if (typeOrFunc.hasOwnProperty(ANNOTATIONS)) { return typeOrFunc[ANNOTATIONS]; } return null; } annotations(typeOrFunc) { if (!isType(typeOrFunc)) { return []; } const parentCtor = getParentCtor(typeOrFunc); const ownAnnotations = this._ownAnnotations(typeOrFunc, parentCtor) || []; const parentAnnotations = parentCtor !== Object ? this.annotations(parentCtor) : []; return parentAnnotations.concat(ownAnnotations); } _ownPropMetadata(typeOrFunc, parentCtor) { if (typeOrFunc.propMetadata && typeOrFunc.propMetadata !== parentCtor.propMetadata) { let propMetadata = typeOrFunc.propMetadata; if (typeof propMetadata === 'function' && propMetadata.propMetadata) { propMetadata = propMetadata.propMetadata; } return propMetadata; } if (typeOrFunc.propDecorators && typeOrFunc.propDecorators !== parentCtor.propDecorators) { const propDecorators = typeOrFunc.propDecorators; const propMetadata = {}; Object.keys(propDecorators).forEach(prop => { propMetadata[prop] = convertTsickleDecoratorIntoMetadata(propDecorators[prop]); }); return propMetadata; } if (typeOrFunc.hasOwnProperty(PROP_METADATA)) { return typeOrFunc[PROP_METADATA]; } return null; } propMetadata(typeOrFunc) { if (!isType(typeOrFunc)) { return {}; } const parentCtor = getParentCtor(typeOrFunc); const propMetadata = {}; if (parentCtor !== Object) { const parentPropMetadata = this.propMetadata(parentCtor); Object.keys(parentPropMetadata).forEach(propName => { propMetadata[propName] = parentPropMetadata[propName]; }); } const ownPropMetadata = this._ownPropMetadata(typeOrFunc, parentCtor); if (ownPropMetadata) { Object.keys(ownPropMetadata).forEach(propName => { const decorators = []; if (propMetadata.hasOwnProperty(propName)) { decorators.push(...propMetadata[propName]); } decorators.push(...ownPropMetadata[propName]); propMetadata[propName] = decorators; }); } return propMetadata; } ownPropMetadata(typeOrFunc) { if (!isType(typeOrFunc)) { return {}; } return this._ownPropMetadata(typeOrFunc, getParentCtor(typeOrFunc)) || {}; } hasLifecycleHook(type, lcProperty) { return type instanceof Type && lcProperty in type.prototype; } } function convertTsickleDecoratorIntoMetadata(decoratorInvocations) { if (!decoratorInvocations) { return []; } return decoratorInvocations.map(decoratorInvocation => { const decoratorType = decoratorInvocation.type; const annotationCls = decoratorType.annotationCls; const annotationArgs = decoratorInvocation.args ? decoratorInvocation.args : []; return new annotationCls(...annotationArgs); }); } function getParentCtor(ctor) { const parentProto = ctor.prototype ? Object.getPrototypeOf(ctor.prototype) : null; const parentCtor = parentProto ? parentProto.constructor : null; return parentCtor || Object; } function applyValueToInputField(instance, inputSignalNode, privateName, value) { if (inputSignalNode !== null) { inputSignalNode.applyValueToInputSignal(inputSignalNode, value); } else { instance[privateName] = value; } } class SimpleChange { previousValue; currentValue; firstChange; constructor(previousValue, currentValue, firstChange) { this.previousValue = previousValue; this.currentValue = currentValue; this.firstChange = firstChange; } isFirstChange() { return this.firstChange; } } const ɵɵNgOnChangesFeature = /* @__PURE__ */(() => { const ɵɵNgOnChangesFeatureImpl = () => NgOnChangesFeatureImpl; ɵɵNgOnChangesFeatureImpl.ngInherit = true; return ɵɵNgOnChangesFeatureImpl; })(); function NgOnChangesFeatureImpl(definition) { if (definition.type.prototype.ngOnChanges) { definition.setInput = ngOnChangesSetInput; } return rememberChangeHistoryAndInvokeOnChangesHook; } function rememberChangeHistoryAndInvokeOnChangesHook() { const simpleChangesStore = getSimpleChangesStore(this); const current = simpleChangesStore?.current; if (current) { const previous = simpleChangesStore.previous; if (previous === _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ) { simpleChangesStore.previous = current; } else { for (let key in current) { previous[key] = current[key]; } } simpleChangesStore.current = null; this.ngOnChanges(current); } } function ngOnChangesSetInput(instance, inputSignalNode, value, publicName, privateName) { const declaredName = this.declaredInputs[publicName]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertString)(declaredName, 'Name of input in ngOnChanges has to be a string'); const simpleChangesStore = getSimpleChangesStore(instance) || setSimpleChangesStore(instance, { previous: _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, current: null }); const current = simpleChangesStore.current || (simpleChangesStore.current = {}); const previous = simpleChangesStore.previous; const previousChange = previous[declaredName]; current[declaredName] = new SimpleChange(previousChange && previousChange.currentValue, value, previous === _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ); applyValueToInputField(instance, inputSignalNode, privateName, value); } const SIMPLE_CHANGES_STORE = '__ngSimpleChanges__'; function getSimpleChangesStore(instance) { return instance[SIMPLE_CHANGES_STORE] || null; } function setSimpleChangesStore(instance, store) { return instance[SIMPLE_CHANGES_STORE] = store; } const profilerCallbacks = []; const NOOP_PROFILER_REMOVAL = () => {}; function removeProfiler(profiler) { const profilerIdx = profilerCallbacks.indexOf(profiler); if (profilerIdx !== -1) { profilerCallbacks.splice(profilerIdx, 1); } } function setProfiler(profiler) { if (profiler !== null) { if (!profilerCallbacks.includes(profiler)) { profilerCallbacks.push(profiler); } return () => removeProfiler(profiler); } else { profilerCallbacks.length = 0; return NOOP_PROFILER_REMOVAL; } } const profiler = function (event, instance = null, eventFn) { for (let i = 0; i < profilerCallbacks.length; i++) { const profilerCallback = profilerCallbacks[i]; profilerCallback(event, instance, eventFn); } }; var ProfilerEvent; (function (ProfilerEvent) { ProfilerEvent[ProfilerEvent["TemplateCreateStart"] = 0] = "TemplateCreateStart"; ProfilerEvent[ProfilerEvent["TemplateCreateEnd"] = 1] = "TemplateCreateEnd"; ProfilerEvent[ProfilerEvent["TemplateUpdateStart"] = 2] = "TemplateUpdateStart"; ProfilerEvent[ProfilerEvent["TemplateUpdateEnd"] = 3] = "TemplateUpdateEnd"; ProfilerEvent[ProfilerEvent["LifecycleHookStart"] = 4] = "LifecycleHookStart"; ProfilerEvent[ProfilerEvent["LifecycleHookEnd"] = 5] = "LifecycleHookEnd"; ProfilerEvent[ProfilerEvent["OutputStart"] = 6] = "OutputStart"; ProfilerEvent[ProfilerEvent["OutputEnd"] = 7] = "OutputEnd"; ProfilerEvent[ProfilerEvent["BootstrapApplicationStart"] = 8] = "BootstrapApplicationStart"; ProfilerEvent[ProfilerEvent["BootstrapApplicationEnd"] = 9] = "BootstrapApplicationEnd"; ProfilerEvent[ProfilerEvent["BootstrapComponentStart"] = 10] = "BootstrapComponentStart"; ProfilerEvent[ProfilerEvent["BootstrapComponentEnd"] = 11] = "BootstrapComponentEnd"; ProfilerEvent[ProfilerEvent["ChangeDetectionStart"] = 12] = "ChangeDetectionStart"; ProfilerEvent[ProfilerEvent["ChangeDetectionEnd"] = 13] = "ChangeDetectionEnd"; ProfilerEvent[ProfilerEvent["ChangeDetectionSyncStart"] = 14] = "ChangeDetectionSyncStart"; ProfilerEvent[ProfilerEvent["ChangeDetectionSyncEnd"] = 15] = "ChangeDetectionSyncEnd"; ProfilerEvent[ProfilerEvent["AfterRenderHooksStart"] = 16] = "AfterRenderHooksStart"; ProfilerEvent[ProfilerEvent["AfterRenderHooksEnd"] = 17] = "AfterRenderHooksEnd"; ProfilerEvent[ProfilerEvent["ComponentStart"] = 18] = "ComponentStart"; ProfilerEvent[ProfilerEvent["ComponentEnd"] = 19] = "ComponentEnd"; ProfilerEvent[ProfilerEvent["DeferBlockStateStart"] = 20] = "DeferBlockStateStart"; ProfilerEvent[ProfilerEvent["DeferBlockStateEnd"] = 21] = "DeferBlockStateEnd"; ProfilerEvent[ProfilerEvent["DynamicComponentStart"] = 22] = "DynamicComponentStart"; ProfilerEvent[ProfilerEvent["DynamicComponentEnd"] = 23] = "DynamicComponentEnd"; ProfilerEvent[ProfilerEvent["HostBindingsUpdateStart"] = 24] = "HostBindingsUpdateStart"; ProfilerEvent[ProfilerEvent["HostBindingsUpdateEnd"] = 25] = "HostBindingsUpdateEnd"; })(ProfilerEvent || (ProfilerEvent = {})); function registerPreOrderHooks(directiveIndex, directiveDef, tView) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertFirstCreatePass)(tView); const { ngOnChanges, ngOnInit, ngDoCheck } = directiveDef.type.prototype; if (ngOnChanges) { const wrappedOnChanges = NgOnChangesFeatureImpl(directiveDef); (tView.preOrderHooks ??= []).push(directiveIndex, wrappedOnChanges); (tView.preOrderCheckHooks ??= []).push(directiveIndex, wrappedOnChanges); } if (ngOnInit) { (tView.preOrderHooks ??= []).push(0 - directiveIndex, ngOnInit); } if (ngDoCheck) { (tView.preOrderHooks ??= []).push(directiveIndex, ngDoCheck); (tView.preOrderCheckHooks ??= []).push(directiveIndex, ngDoCheck); } } function registerPostOrderHooks(tView, tNode) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertFirstCreatePass)(tView); for (let i = tNode.directiveStart, end = tNode.directiveEnd; i < end; i++) { const directiveDef = tView.data[i]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(directiveDef, 'Expecting DirectiveDef'); const lifecycleHooks = directiveDef.type.prototype; const { ngAfterContentInit, ngAfterContentChecked, ngAfterViewInit, ngAfterViewChecked, ngOnDestroy } = lifecycleHooks; if (ngAfterContentInit) { (tView.contentHooks ??= []).push(-i, ngAfterContentInit); } if (ngAfterContentChecked) { (tView.contentHooks ??= []).push(i, ngAfterContentChecked); (tView.contentCheckHooks ??= []).push(i, ngAfterContentChecked); } if (ngAfterViewInit) { (tView.viewHooks ??= []).push(-i, ngAfterViewInit); } if (ngAfterViewChecked) { (tView.viewHooks ??= []).push(i, ngAfterViewChecked); (tView.viewCheckHooks ??= []).push(i, ngAfterViewChecked); } if (ngOnDestroy != null) { (tView.destroyHooks ??= []).push(i, ngOnDestroy); } } } function executeCheckHooks(lView, hooks, nodeIndex) { callHooks(lView, hooks, 3, nodeIndex); } function executeInitAndCheckHooks(lView, hooks, initPhase, nodeIndex) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNotEqual)(initPhase, 3, 'Init pre-order hooks should not be called more than once'); if ((lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] & 3) === initPhase) { callHooks(lView, hooks, initPhase, nodeIndex); } } function incrementInitPhaseFlags(lView, initPhase) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNotEqual)(initPhase, 3, 'Init hooks phase should not be incremented after all init hooks have been run.'); let flags = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS]; if ((flags & 3) === initPhase) { flags &= 16383; flags += 1; lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] = flags; } } function callHooks(currentView, arr, initPhase, currentNodeIndex) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isInCheckNoChangesMode)(), false, 'Hooks should never be run when in check no changes mode.'); const startIndex = currentNodeIndex !== undefined ? currentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PREORDER_HOOK_FLAGS] & 65535 : 0; const nodeIndexLimit = currentNodeIndex != null ? currentNodeIndex : -1; const max = arr.length - 1; let lastNodeIndexFound = 0; for (let i = startIndex; i < max; i++) { const hook = arr[i + 1]; if (typeof hook === 'number') { lastNodeIndexFound = arr[i]; if (currentNodeIndex != null && lastNodeIndexFound >= currentNodeIndex) { break; } } else { const isInitHook = arr[i] < 0; if (isInitHook) { currentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PREORDER_HOOK_FLAGS] += 65536; } if (lastNodeIndexFound < nodeIndexLimit || nodeIndexLimit == -1) { callHook(currentView, initPhase, arr, i); currentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PREORDER_HOOK_FLAGS] = (currentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PREORDER_HOOK_FLAGS] & 4294901760) + i + 2; } i++; } } } function callHookInternal(directive, hook) { profiler(ProfilerEvent.LifecycleHookStart, directive, hook); const prevConsumer = (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(null); try { hook.call(directive); } finally { (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(prevConsumer); profiler(ProfilerEvent.LifecycleHookEnd, directive, hook); } } function callHook(currentView, initPhase, arr, i) { const isInitHook = arr[i] < 0; const hook = arr[i + 1]; const directiveIndex = isInitHook ? -arr[i] : arr[i]; const directive = currentView[directiveIndex]; if (isInitHook) { const indexWithintInitPhase = currentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] >> 14; if (indexWithintInitPhase < currentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PREORDER_HOOK_FLAGS] >> 16 && (currentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] & 3) === initPhase) { currentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] += 16384; callHookInternal(directive, hook); } } else { callHookInternal(directive, hook); } } const NO_PARENT_INJECTOR = -1; class NodeInjectorFactory { factory; name; injectImpl; resolving = false; canSeeViewProviders; multi; componentProviders; index; providerFactory; constructor(factory, isViewProvider, injectImplementation, name) { this.factory = factory; this.name = name; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(factory, 'Factory not specified'); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(typeof factory, 'function', 'Expected factory function.'); this.canSeeViewProviders = isViewProvider; this.injectImpl = injectImplementation; } } function toTNodeTypeAsString(tNodeType) { let text = ''; tNodeType & 1 && (text += '|Text'); tNodeType & 2 && (text += '|Element'); tNodeType & 4 && (text += '|Container'); tNodeType & 8 && (text += '|ElementContainer'); tNodeType & 16 && (text += '|Projection'); tNodeType & 32 && (text += '|IcuContainer'); tNodeType & 64 && (text += '|Placeholder'); tNodeType & 128 && (text += '|LetDeclaration'); return text.length > 0 ? text.substring(1) : text; } function isTNodeShape(value) { return value != null && typeof value === 'object' && (value.insertBeforeIndex === null || typeof value.insertBeforeIndex === 'number' || Array.isArray(value.insertBeforeIndex)); } function isLetDeclaration(tNode) { return !!(tNode.type & 128); } function hasClassInput(tNode) { return (tNode.flags & 8) !== 0; } function hasStyleInput(tNode) { return (tNode.flags & 16) !== 0; } function assertTNodeType(tNode, expectedTypes, message) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(tNode, 'should be called with a TNode'); if ((tNode.type & expectedTypes) === 0) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)(message || `Expected [${toTNodeTypeAsString(expectedTypes)}] but got ${toTNodeTypeAsString(tNode.type)}.`); } } function assertPureTNodeType(type) { if (!(type === 2 || type === 1 || type === 4 || type === 8 || type === 32 || type === 16 || type === 64 || type === 128)) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)(`Expected TNodeType to have only a single type selected, but got ${toTNodeTypeAsString(type)}.`); } } function setUpAttributes(renderer, native, attrs) { let i = 0; while (i < attrs.length) { const value = attrs[i]; if (typeof value === 'number') { if (value !== 0) { break; } i++; const namespaceURI = attrs[i++]; const attrName = attrs[i++]; const attrVal = attrs[i++]; renderer.setAttribute(native, attrName, attrVal, namespaceURI); } else { const attrName = value; const attrVal = attrs[++i]; if (isAnimationProp(attrName)) { renderer.setProperty(native, attrName, attrVal); } else { renderer.setAttribute(native, attrName, attrVal); } i++; } } return i; } function isNameOnlyAttributeMarker(marker) { return marker === 3 || marker === 4 || marker === 6; } function isAnimationProp(name) { return name.charCodeAt(0) === 64; } function mergeHostAttrs(dst, src) { if (src === null || src.length === 0) ;else if (dst === null || dst.length === 0) { dst = src.slice(); } else { let srcMarker = -1; for (let i = 0; i < src.length; i++) { const item = src[i]; if (typeof item === 'number') { srcMarker = item; } else { if (srcMarker === 0) ;else if (srcMarker === -1 || srcMarker === 2) { mergeHostAttribute(dst, srcMarker, item, null, src[++i]); } else { mergeHostAttribute(dst, srcMarker, item, null, null); } } } } return dst; } function mergeHostAttribute(dst, marker, key1, key2, value) { let i = 0; let markerInsertPosition = dst.length; if (marker === -1) { markerInsertPosition = -1; } else { while (i < dst.length) { const dstValue = dst[i++]; if (typeof dstValue === 'number') { if (dstValue === marker) { markerInsertPosition = -1; break; } else if (dstValue > marker) { markerInsertPosition = i - 1; break; } } } } while (i < dst.length) { const item = dst[i]; if (typeof item === 'number') { break; } else if (item === key1) { { if (value !== null) { dst[i + 1] = value; } return; } } i++; if (value !== null) i++; } if (markerInsertPosition !== -1) { dst.splice(markerInsertPosition, 0, marker); i = markerInsertPosition + 1; } dst.splice(i++, 0, key1); if (value !== null) { dst.splice(i++, 0, value); } } function hasParentInjector(parentLocation) { return parentLocation !== NO_PARENT_INJECTOR; } function getParentInjectorIndex(parentLocation) { if (ngDevMode) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNumber)(parentLocation, 'Number expected'); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNotEqual)(parentLocation, -1, 'Not a valid state.'); const parentInjectorIndex = parentLocation & 32767; (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertGreaterThan)(parentInjectorIndex, _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET, 'Parent injector must be pointing past HEADER_OFFSET.'); } return parentLocation & 32767; } function getParentInjectorViewOffset(parentLocation) { return parentLocation >> 16; } function getParentInjectorView(location, startView) { let viewOffset = getParentInjectorViewOffset(location); let parentView = startView; while (viewOffset > 0) { parentView = parentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_VIEW]; viewOffset--; } return parentView; } let includeViewProviders = true; function setIncludeViewProviders(v) { const oldValue = includeViewProviders; includeViewProviders = v; return oldValue; } const BLOOM_SIZE = 256; const BLOOM_MASK = BLOOM_SIZE - 1; const BLOOM_BUCKET_BITS = 5; let nextNgElementId = 0; const NOT_FOUND = {}; function bloomAdd(injectorIndex, tView, type) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(tView.firstCreatePass, true, 'expected firstCreatePass to be true'); let id; if (typeof type === 'string') { id = type.charCodeAt(0) || 0; } else if (type.hasOwnProperty(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NG_ELEMENT_ID)) { id = type[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NG_ELEMENT_ID]; } if (id == null) { id = type[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NG_ELEMENT_ID] = nextNgElementId++; } const bloomHash = id & BLOOM_MASK; const mask = 1 << bloomHash; tView.data[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)] |= mask; } function getOrCreateNodeInjectorForNode(tNode, lView) { const existingInjectorIndex = getInjectorIndex(tNode, lView); if (existingInjectorIndex !== -1) { return existingInjectorIndex; } const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; if (tView.firstCreatePass) { tNode.injectorIndex = lView.length; insertBloom(tView.data, tNode); insertBloom(lView, null); insertBloom(tView.blueprint, null); } const parentLoc = getParentInjectorLocation(tNode, lView); const injectorIndex = tNode.injectorIndex; if (hasParentInjector(parentLoc)) { const parentIndex = getParentInjectorIndex(parentLoc); const parentLView = getParentInjectorView(parentLoc, lView); const parentData = parentLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW].data; for (let i = 0; i < 8; i++) { lView[injectorIndex + i] = parentLView[parentIndex + i] | parentData[parentIndex + i]; } } lView[injectorIndex + 8] = parentLoc; return injectorIndex; } function insertBloom(arr, footer) { arr.push(0, 0, 0, 0, 0, 0, 0, 0, footer); } function getInjectorIndex(tNode, lView) { if (tNode.injectorIndex === -1 || tNode.parent && tNode.parent.injectorIndex === tNode.injectorIndex || lView[tNode.injectorIndex + 8] === null) { return -1; } else { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertIndexInRange)(lView, tNode.injectorIndex); return tNode.injectorIndex; } } function getParentInjectorLocation(tNode, lView) { if (tNode.parent && tNode.parent.injectorIndex !== -1) { return tNode.parent.injectorIndex; } let declarationViewOffset = 0; let parentTNode = null; let lViewCursor = lView; while (lViewCursor !== null) { parentTNode = getTNodeFromLView(lViewCursor); if (parentTNode === null) { return NO_PARENT_INJECTOR; } ngDevMode && parentTNode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertTNodeForLView)(parentTNode, lViewCursor[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_VIEW]); declarationViewOffset++; lViewCursor = lViewCursor[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_VIEW]; if (parentTNode.injectorIndex !== -1) { return parentTNode.injectorIndex | declarationViewOffset << 16; } } return NO_PARENT_INJECTOR; } function diPublicInInjector(injectorIndex, tView, token) { bloomAdd(injectorIndex, tView, token); } function injectAttributeImpl(tNode, attrNameToInject) { ngDevMode && assertTNodeType(tNode, 12 | 3); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(tNode, 'expecting tNode'); if (attrNameToInject === 'class') { return tNode.classes; } if (attrNameToInject === 'style') { return tNode.styles; } const attrs = tNode.attrs; if (attrs) { const attrsLength = attrs.length; let i = 0; while (i < attrsLength) { const value = attrs[i]; if (isNameOnlyAttributeMarker(value)) break; if (value === 0) { i = i + 2; } else if (typeof value === 'number') { i++; while (i < attrsLength && typeof attrs[i] === 'string') { i++; } } else if (value === attrNameToInject) { return attrs[i + 1]; } else { i = i + 2; } } } return null; } function notFoundValueOrThrow(notFoundValue, token, flags) { if (flags & 8 || notFoundValue !== undefined) { return notFoundValue; } else { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwProviderNotFoundError)(token, 'NodeInjector'); } } function lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue) { if (flags & 8 && notFoundValue === undefined) { notFoundValue = null; } if ((flags & (2 | 1)) === 0) { const moduleInjector = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]; const previousInjectImplementation = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setInjectImplementation)(undefined); try { if (moduleInjector) { return moduleInjector.get(token, notFoundValue, flags & 8); } else { return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.injectRootLimpMode)(token, notFoundValue, flags & 8); } } finally { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setInjectImplementation)(previousInjectImplementation); } } return notFoundValueOrThrow(notFoundValue, token, flags); } function getOrCreateInjectable(tNode, lView, token, flags = 0, notFoundValue) { if (tNode !== null) { if (lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] & 2048 && !(flags & 2)) { const embeddedInjectorValue = lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, NOT_FOUND); if (embeddedInjectorValue !== NOT_FOUND) { return embeddedInjectorValue; } } const value = lookupTokenUsingNodeInjector(tNode, lView, token, flags, NOT_FOUND); if (value !== NOT_FOUND) { return value; } } return lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue); } function lookupTokenUsingNodeInjector(tNode, lView, token, flags, notFoundValue) { const bloomHash = bloomHashBitOrFactory(token); if (typeof bloomHash === 'function') { if (!(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.enterDI)(lView, tNode, flags)) { return flags & 1 ? notFoundValueOrThrow(notFoundValue, token, flags) : lookupTokenUsingModuleInjector(lView, token, flags, notFoundValue); } try { let value; if (ngDevMode) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.runInInjectorProfilerContext)(new NodeInjector((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(), (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)()), token, () => { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.emitInjectorToCreateInstanceEvent)(token); value = bloomHash(flags); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.emitInstanceCreatedByInjectorEvent)(value); }); } else { value = bloomHash(flags); } if (value == null && !(flags & 8)) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwProviderNotFoundError)(token); } else { return value; } } finally { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.leaveDI)(); } } else if (typeof bloomHash === 'number') { let previousTView = null; let injectorIndex = getInjectorIndex(tNode, lView); let parentLocation = NO_PARENT_INJECTOR; let hostTElementNode = flags & 1 ? lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_COMPONENT_VIEW][_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.T_HOST] : null; if (injectorIndex === -1 || flags & 4) { parentLocation = injectorIndex === -1 ? getParentInjectorLocation(tNode, lView) : lView[injectorIndex + 8]; if (parentLocation === NO_PARENT_INJECTOR || !shouldSearchParent(flags, false)) { injectorIndex = -1; } else { previousTView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; injectorIndex = getParentInjectorIndex(parentLocation); lView = getParentInjectorView(parentLocation, lView); } } while (injectorIndex !== -1) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNodeInjector)(lView, injectorIndex); const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertTNodeForLView)(tView.data[injectorIndex + 8], lView); if (bloomHasToken(bloomHash, injectorIndex, tView.data)) { const instance = searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode); if (instance !== NOT_FOUND) { return instance; } } parentLocation = lView[injectorIndex + 8]; if (parentLocation !== NO_PARENT_INJECTOR && shouldSearchParent(flags, lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW].data[injectorIndex + 8] === hostTElementNode) && bloomHasToken(bloomHash, injectorIndex, lView)) { previousTView = tView; injectorIndex = getParentInjectorIndex(parentLocation); lView = getParentInjectorView(parentLocation, lView); } else { injectorIndex = -1; } } } return notFoundValue; } function searchTokensOnInjector(injectorIndex, lView, token, previousTView, flags, hostTElementNode) { const currentTView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const tNode = currentTView.data[injectorIndex + 8]; const canAccessViewProviders = previousTView == null ? (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isComponentHost)(tNode) && includeViewProviders : previousTView != currentTView && (tNode.type & 3) !== 0; const isHostSpecialCase = flags & 1 && hostTElementNode === tNode; const injectableIdx = locateDirectiveOrProvider(tNode, currentTView, token, canAccessViewProviders, isHostSpecialCase); if (injectableIdx !== null) { return getNodeInjectable(lView, currentTView, injectableIdx, tNode, flags); } else { return NOT_FOUND; } } function locateDirectiveOrProvider(tNode, tView, token, canAccessViewProviders, isHostSpecialCase) { const nodeProviderIndexes = tNode.providerIndexes; const tInjectables = tView.data; const injectablesStart = nodeProviderIndexes & 1048575; const directivesStart = tNode.directiveStart; const directiveEnd = tNode.directiveEnd; const cptViewProvidersCount = nodeProviderIndexes >> 20; const startingIndex = canAccessViewProviders ? injectablesStart : injectablesStart + cptViewProvidersCount; const endIndex = isHostSpecialCase ? injectablesStart + cptViewProvidersCount : directiveEnd; for (let i = startingIndex; i < endIndex; i++) { const providerTokenOrDef = tInjectables[i]; if (i < directivesStart && token === providerTokenOrDef || i >= directivesStart && providerTokenOrDef.type === token) { return i; } } if (isHostSpecialCase) { const dirDef = tInjectables[directivesStart]; if (dirDef && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isComponentDef)(dirDef) && dirDef.type === token) { return directivesStart; } } return null; } let injectionPath = []; function getNodeInjectable(lView, tView, index, tNode, flags) { let value = lView[index]; const tData = tView.data; if (value instanceof NodeInjectorFactory) { const factory = value; ngDevMode && injectionPath.push(factory.name ?? 'unknown'); if (factory.resolving) { let token = ''; if (ngDevMode) { token = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(tData[index]); throw (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.cyclicDependencyErrorWithDetails)(token, injectionPath); } else { throw (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.cyclicDependencyError)(token); } } const previousIncludeViewProviders = setIncludeViewProviders(factory.canSeeViewProviders); factory.resolving = true; const token = tData[index].type || tData[index]; let prevInjectContext; if (ngDevMode) { const injector = new NodeInjector(tNode, lView); prevInjectContext = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setInjectorProfilerContext)({ injector, token }); } const previousInjectImplementation = factory.injectImpl ? (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setInjectImplementation)(factory.injectImpl) : null; const success = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.enterDI)(lView, tNode, 0); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(success, true, "Because flags do not contain `SkipSelf' we expect this to always succeed."); try { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.emitInjectorToCreateInstanceEvent)(token); value = lView[index] = factory.factory(undefined, flags, tData, lView, tNode); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.emitInstanceCreatedByInjectorEvent)(value); if (tView.firstCreatePass && index >= tNode.directiveStart) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDirectiveDef)(tData[index]); registerPreOrderHooks(index, tData[index], tView); } } finally { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setInjectorProfilerContext)(prevInjectContext); previousInjectImplementation !== null && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setInjectImplementation)(previousInjectImplementation); setIncludeViewProviders(previousIncludeViewProviders); factory.resolving = false; (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.leaveDI)(); ngDevMode && (injectionPath = []); } } return value; } function bloomHashBitOrFactory(token) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(token, 'token must be defined'); if (typeof token === 'string') { return token.charCodeAt(0) || 0; } const tokenId = token.hasOwnProperty(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NG_ELEMENT_ID) ? token[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NG_ELEMENT_ID] : undefined; if (typeof tokenId === 'number') { if (tokenId >= 0) { return tokenId & BLOOM_MASK; } else { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(tokenId, -1, 'Expecting to get Special Injector Id'); return createNodeInjector; } } else { return tokenId; } } function bloomHasToken(bloomHash, injectorIndex, injectorView) { const mask = 1 << bloomHash; const value = injectorView[injectorIndex + (bloomHash >> BLOOM_BUCKET_BITS)]; return !!(value & mask); } function shouldSearchParent(flags, isFirstHostTNode) { return !(flags & 2) && !(flags & 1 && isFirstHostTNode); } function getNodeInjectorLView(nodeInjector) { return nodeInjector._lView; } function getNodeInjectorTNode(nodeInjector) { return nodeInjector._tNode; } class NodeInjector { _tNode; _lView; constructor(_tNode, _lView) { this._tNode = _tNode; this._lView = _lView; } get(token, notFoundValue, flags) { return getOrCreateInjectable(this._tNode, this._lView, token, (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.convertToBitFlags)(flags), notFoundValue); } } function createNodeInjector() { return new NodeInjector((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(), (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)()); } function ɵɵgetInheritedFactory(type) { return noSideEffects(() => { const ownConstructor = type.prototype.constructor; const ownFactory = ownConstructor[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NG_FACTORY_DEF] || getFactoryOf(ownConstructor); const objectPrototype = Object.prototype; let parent = Object.getPrototypeOf(type.prototype).constructor; while (parent && parent !== objectPrototype) { const factory = parent[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NG_FACTORY_DEF] || getFactoryOf(parent); if (factory && factory !== ownFactory) { return factory; } parent = Object.getPrototypeOf(parent); } return t => new t(); }); } function getFactoryOf(type) { if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isForwardRef)(type)) { return () => { const factory = getFactoryOf((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.resolveForwardRef)(type)); return factory && factory(); }; } return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getFactoryDef)(type); } function lookupTokenUsingEmbeddedInjector(tNode, lView, token, flags, notFoundValue) { let currentTNode = tNode; let currentLView = lView; while (currentTNode !== null && currentLView !== null && currentLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] & 2048 && !(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isRootView)(currentLView)) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertTNodeForLView)(currentTNode, currentLView); const nodeInjectorValue = lookupTokenUsingNodeInjector(currentTNode, currentLView, token, flags | 2, NOT_FOUND); if (nodeInjectorValue !== NOT_FOUND) { return nodeInjectorValue; } let parentTNode = currentTNode.parent; if (!parentTNode) { const embeddedViewInjector = currentLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMBEDDED_VIEW_INJECTOR]; if (embeddedViewInjector) { const embeddedViewInjectorValue = embeddedViewInjector.get(token, NOT_FOUND, flags); if (embeddedViewInjectorValue !== NOT_FOUND) { return embeddedViewInjectorValue; } } parentTNode = getTNodeFromLView(currentLView); currentLView = currentLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_VIEW]; } currentTNode = parentTNode; } return notFoundValue; } function getTNodeFromLView(lView) { const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const tViewType = tView.type; if (tViewType === 2) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(tView.declTNode, 'Embedded TNodes should have declaration parents.'); return tView.declTNode; } else if (tViewType === 1) { return lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.T_HOST]; } return null; } function ɵɵinjectAttribute(attrNameToInject) { return injectAttributeImpl((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(), attrNameToInject); } const Attribute = makeParamDecorator('Attribute', attributeName => ({ attributeName, __NG_ELEMENT_ID__: () => ɵɵinjectAttribute(attributeName) })); let _reflect = null; function getReflect() { return _reflect = _reflect || new ReflectionCapabilities(); } function reflectDependencies(type) { return convertDependencies(getReflect().parameters(type)); } function convertDependencies(deps) { return deps.map(dep => reflectDependency(dep)); } function reflectDependency(dep) { const meta = { token: null, attribute: null, host: false, optional: false, self: false, skipSelf: false }; if (Array.isArray(dep) && dep.length > 0) { for (let j = 0; j < dep.length; j++) { const param = dep[j]; if (param === undefined) { continue; } const proto = Object.getPrototypeOf(param); if (param instanceof Optional || proto.ngMetadataName === 'Optional') { meta.optional = true; } else if (param instanceof SkipSelf || proto.ngMetadataName === 'SkipSelf') { meta.skipSelf = true; } else if (param instanceof Self || proto.ngMetadataName === 'Self') { meta.self = true; } else if (param instanceof Host || proto.ngMetadataName === 'Host') { meta.host = true; } else if (param instanceof Inject) { meta.token = param.token; } else if (param instanceof Attribute) { if (param.attributeName === undefined) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(204, ngDevMode && `Attribute name must be defined.`); } meta.attribute = param.attributeName; } else { meta.token = param; } } } else if (dep === undefined || Array.isArray(dep) && dep.length === 0) { meta.token = null; } else { meta.token = dep; } return meta; } function compileInjectable(type, meta) { let ngInjectableDef = null; let ngFactoryDef = null; if (!type.hasOwnProperty(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NG_PROV_DEF)) { Object.defineProperty(type, _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NG_PROV_DEF, { get: () => { if (ngInjectableDef === null) { const compiler = getCompilerFacade({ usage: 0, kind: 'injectable', type }); ngInjectableDef = compiler.compileInjectable(angularCoreDiEnv, `ng:///${type.name}/ɵprov.js`, getInjectableMetadata(type, meta)); } return ngInjectableDef; } }); } if (!type.hasOwnProperty(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NG_FACTORY_DEF)) { Object.defineProperty(type, _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NG_FACTORY_DEF, { get: () => { if (ngFactoryDef === null) { const compiler = getCompilerFacade({ usage: 0, kind: 'injectable', type }); ngFactoryDef = compiler.compileFactory(angularCoreDiEnv, `ng:///${type.name}/ɵfac.js`, { name: type.name, type, typeArgumentCount: 0, deps: reflectDependencies(type), target: compiler.FactoryTarget.Injectable }); } return ngFactoryDef; }, configurable: true }); } } const USE_VALUE = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getClosureSafeProperty)({ provide: String, useValue: _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getClosureSafeProperty }); function isUseClassProvider(meta) { return meta.useClass !== undefined; } function isUseValueProvider(meta) { return USE_VALUE in meta; } function isUseFactoryProvider(meta) { return meta.useFactory !== undefined; } function isUseExistingProvider(meta) { return meta.useExisting !== undefined; } function getInjectableMetadata(type, srcMeta) { const meta = srcMeta || { providedIn: null }; const compilerMeta = { name: type.name, type: type, typeArgumentCount: 0, providedIn: meta.providedIn }; if ((isUseClassProvider(meta) || isUseFactoryProvider(meta)) && meta.deps !== undefined) { compilerMeta.deps = convertDependencies(meta.deps); } if (isUseClassProvider(meta)) { compilerMeta.useClass = meta.useClass; } else if (isUseValueProvider(meta)) { compilerMeta.useValue = meta.useValue; } else if (isUseFactoryProvider(meta)) { compilerMeta.useFactory = meta.useFactory; } else if (isUseExistingProvider(meta)) { compilerMeta.useExisting = meta.useExisting; } return compilerMeta; } const Injectable = makeDecorator('Injectable', undefined, undefined, undefined, (type, meta) => compileInjectable(type, meta)); function injectElementRef() { return createElementRef((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(), (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)()); } function createElementRef(tNode, lView) { return new ElementRef((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode)(tNode, lView)); } class ElementRef { nativeElement; constructor(nativeElement) { this.nativeElement = nativeElement; } static __NG_ELEMENT_ID__ = injectElementRef; } function unwrapElementRef(value) { return value instanceof ElementRef ? value.nativeElement : value; } function symbolIterator() { return this._results[Symbol.iterator](); } class QueryList { _emitDistinctChangesOnly; dirty = true; _onDirty = undefined; _results = []; _changesDetected = false; _changes = undefined; length = 0; first = undefined; last = undefined; get changes() { return this._changes ??= new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject(); } constructor(_emitDistinctChangesOnly = false) { this._emitDistinctChangesOnly = _emitDistinctChangesOnly; } get(index) { return this._results[index]; } map(fn) { return this._results.map(fn); } filter(fn) { return this._results.filter(fn); } find(fn) { return this._results.find(fn); } reduce(fn, init) { return this._results.reduce(fn, init); } forEach(fn) { this._results.forEach(fn); } some(fn) { return this._results.some(fn); } toArray() { return this._results.slice(); } toString() { return this._results.toString(); } reset(resultsTree, identityAccessor) { this.dirty = false; const newResultFlat = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.flatten)(resultsTree); if (this._changesDetected = !(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.arrayEquals)(this._results, newResultFlat, identityAccessor)) { this._results = newResultFlat; this.length = newResultFlat.length; this.last = newResultFlat[this.length - 1]; this.first = newResultFlat[0]; } } notifyOnChanges() { if (this._changes !== undefined && (this._changesDetected || !this._emitDistinctChangesOnly)) this._changes.next(this); } onDirty(cb) { this._onDirty = cb; } setDirty() { this.dirty = true; this._onDirty?.(); } destroy() { if (this._changes !== undefined) { this._changes.complete(); this._changes.unsubscribe(); } } [Symbol.iterator] = (() => symbolIterator)(); } const SKIP_HYDRATION_ATTR_NAME = 'ngSkipHydration'; const SKIP_HYDRATION_ATTR_NAME_LOWER_CASE = 'ngskiphydration'; function hasSkipHydrationAttrOnTNode(tNode) { const attrs = tNode.mergedAttrs; if (attrs === null) return false; for (let i = 0; i < attrs.length; i += 2) { const value = attrs[i]; if (typeof value === 'number') return false; if (typeof value === 'string' && value.toLowerCase() === SKIP_HYDRATION_ATTR_NAME_LOWER_CASE) { return true; } } return false; } function hasSkipHydrationAttrOnRElement(rNode) { return rNode.hasAttribute(SKIP_HYDRATION_ATTR_NAME); } function hasInSkipHydrationBlockFlag(tNode) { return (tNode.flags & 128) === 128; } function isInSkipHydrationBlock(tNode) { if (hasInSkipHydrationBlockFlag(tNode)) { return true; } let currentTNode = tNode.parent; while (currentTNode) { if (hasInSkipHydrationBlockFlag(tNode) || hasSkipHydrationAttrOnTNode(currentTNode)) { return true; } currentTNode = currentTNode.parent; } return false; } function isI18nInSkipHydrationBlock(parentTNode) { return hasInSkipHydrationBlockFlag(parentTNode) || hasSkipHydrationAttrOnTNode(parentTNode) || isInSkipHydrationBlock(parentTNode); } var ChangeDetectionStrategy; (function (ChangeDetectionStrategy) { ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 0] = "OnPush"; ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 1] = "Default"; })(ChangeDetectionStrategy || (ChangeDetectionStrategy = {})); const TRACKED_LVIEWS = new Map(); let uniqueIdCounter = 0; function getUniqueLViewId() { return uniqueIdCounter++; } function registerLView(lView) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNumber)(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ID], 'LView must have an ID in order to be registered'); TRACKED_LVIEWS.set(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ID], lView); } function getLViewById(id) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNumber)(id, 'ID used for LView lookup must be a number'); return TRACKED_LVIEWS.get(id) || null; } function unregisterLView(lView) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNumber)(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ID], 'Cannot stop tracking an LView that does not have an ID'); TRACKED_LVIEWS.delete(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ID]); } function getTrackedLViews() { return TRACKED_LVIEWS; } class LContext { lViewId; nodeIndex; native; component; directives; localRefs; get lView() { return getLViewById(this.lViewId); } constructor(lViewId, nodeIndex, native) { this.lViewId = lViewId; this.nodeIndex = nodeIndex; this.native = native; } } function getLContext(target) { let mpValue = readPatchedData(target); if (mpValue) { if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLView)(mpValue)) { const lView = mpValue; let nodeIndex; let component = undefined; let directives = undefined; if (isComponentInstance(target)) { nodeIndex = findViaComponent(lView, target); if (nodeIndex == -1) { throw new Error('The provided component was not found in the application'); } component = target; } else if (isDirectiveInstance(target)) { nodeIndex = findViaDirective(lView, target); if (nodeIndex == -1) { throw new Error('The provided directive was not found in the application'); } directives = getDirectivesAtNodeIndex(nodeIndex, lView); } else { nodeIndex = findViaNativeElement(lView, target); if (nodeIndex == -1) { return null; } } const native = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(lView[nodeIndex]); const existingCtx = readPatchedData(native); const context = existingCtx && !Array.isArray(existingCtx) ? existingCtx : createLContext(lView, nodeIndex, native); if (component && context.component === undefined) { context.component = component; attachPatchData(context.component, context); } if (directives && context.directives === undefined) { context.directives = directives; for (let i = 0; i < directives.length; i++) { attachPatchData(directives[i], context); } } attachPatchData(context.native, context); mpValue = context; } } else { const rElement = target; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDomNode)(rElement); let parent = rElement; while (parent = parent.parentNode) { const parentContext = readPatchedData(parent); if (parentContext) { const lView = Array.isArray(parentContext) ? parentContext : parentContext.lView; if (!lView) { return null; } const index = findViaNativeElement(lView, rElement); if (index >= 0) { const native = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(lView[index]); const context = createLContext(lView, index, native); attachPatchData(native, context); mpValue = context; break; } } } } return mpValue || null; } function createLContext(lView, nodeIndex, native) { return new LContext(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ID], nodeIndex, native); } function getComponentViewByInstance(componentInstance) { let patchedData = readPatchedData(componentInstance); let lView; if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLView)(patchedData)) { const contextLView = patchedData; const nodeIndex = findViaComponent(contextLView, componentInstance); lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentLViewByIndex)(nodeIndex, contextLView); const context = createLContext(contextLView, nodeIndex, lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HOST]); context.component = componentInstance; attachPatchData(componentInstance, context); attachPatchData(context.native, context); } else { const context = patchedData; const contextLView = context.lView; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLView)(contextLView); lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentLViewByIndex)(context.nodeIndex, contextLView); } return lView; } const MONKEY_PATCH_KEY_NAME = '__ngContext__'; function attachPatchData(target, data) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(target, 'Target expected'); if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLView)(data)) { target[MONKEY_PATCH_KEY_NAME] = data[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ID]; registerLView(data); } else { target[MONKEY_PATCH_KEY_NAME] = data; } } function readPatchedData(target) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(target, 'Target expected'); const data = target[MONKEY_PATCH_KEY_NAME]; return typeof data === 'number' ? getLViewById(data) : data || null; } function readPatchedLView(target) { const value = readPatchedData(target); if (value) { return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLView)(value) ? value : value.lView; } return null; } function isComponentInstance(instance) { return instance && instance.constructor && instance.constructor.ɵcmp; } function isDirectiveInstance(instance) { return instance && instance.constructor && instance.constructor.ɵdir; } function findViaNativeElement(lView, target) { const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; for (let i = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET; i < tView.bindingStartIndex; i++) { if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(lView[i]) === target) { return i; } } return -1; } function traverseNextElement(tNode) { if (tNode.child) { return tNode.child; } else if (tNode.next) { return tNode.next; } else { while (tNode.parent && !tNode.parent.next) { tNode = tNode.parent; } return tNode.parent && tNode.parent.next; } } function findViaComponent(lView, componentInstance) { const componentIndices = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW].components; if (componentIndices) { for (let i = 0; i < componentIndices.length; i++) { const elementComponentIndex = componentIndices[i]; const componentView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentLViewByIndex)(elementComponentIndex, lView); if (componentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT] === componentInstance) { return elementComponentIndex; } } } else { const rootComponentView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentLViewByIndex)(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET, lView); const rootComponent = rootComponentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT]; if (rootComponent === componentInstance) { return _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET; } } return -1; } function findViaDirective(lView, directiveInstance) { let tNode = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW].firstChild; while (tNode) { const directiveIndexStart = tNode.directiveStart; const directiveIndexEnd = tNode.directiveEnd; for (let i = directiveIndexStart; i < directiveIndexEnd; i++) { if (lView[i] === directiveInstance) { return tNode.index; } } tNode = traverseNextElement(tNode); } return -1; } function getDirectivesAtNodeIndex(nodeIndex, lView) { const tNode = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW].data[nodeIndex]; if (tNode.directiveStart === 0) return _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARRAY; const results = []; for (let i = tNode.directiveStart; i < tNode.directiveEnd; i++) { const directiveInstance = lView[i]; if (!isComponentInstance(directiveInstance)) { results.push(directiveInstance); } } return results; } function getComponentAtNodeIndex(nodeIndex, lView) { const tNode = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW].data[nodeIndex]; return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isComponentHost)(tNode) ? lView[tNode.directiveStart + tNode.componentOffset] : null; } function discoverLocalRefs(lView, nodeIndex) { const tNode = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW].data[nodeIndex]; if (tNode && tNode.localNames) { const result = {}; let localIndex = tNode.index + 1; for (let i = 0; i < tNode.localNames.length; i += 2) { result[tNode.localNames[i]] = lView[localIndex]; localIndex++; } return result; } return null; } function getRootView(componentOrLView) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(componentOrLView, 'component'); let lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLView)(componentOrLView) ? componentOrLView : readPatchedLView(componentOrLView); while (lView && !(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isRootView)(lView)) { lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLViewParent)(lView); } ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLView)(lView); return lView; } function getRootContext(viewOrComponent) { const rootView = getRootView(viewOrComponent); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(rootView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT], 'Root view has no context. Perhaps it is disconnected?'); return rootView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT]; } function getFirstLContainer(lView) { return getNearestLContainer(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CHILD_HEAD]); } function getNextLContainer(container) { return getNearestLContainer(container[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NEXT]); } function getNearestLContainer(viewOrContainer) { while (viewOrContainer !== null && !(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLContainer)(viewOrContainer)) { viewOrContainer = viewOrContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NEXT]; } return viewOrContainer; } function getComponent(element) { ngDevMode && assertDomElement(element); const context = getLContext(element); if (context === null) return null; if (context.component === undefined) { const lView = context.lView; if (lView === null) { return null; } context.component = getComponentAtNodeIndex(context.nodeIndex, lView); } return context.component; } function getContext(element) { assertDomElement(element); const context = getLContext(element); const lView = context ? context.lView : null; return lView === null ? null : lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT]; } function getOwningComponent(elementOrDir) { const context = getLContext(elementOrDir); let lView = context ? context.lView : null; if (lView === null) return null; let parent; while (lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW].type === 2 && (parent = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLViewParent)(lView))) { lView = parent; } return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isRootView)(lView) ? null : lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT]; } function getRootComponents(elementOrDir) { const lView = readPatchedLView(elementOrDir); return lView !== null ? [getRootContext(lView)] : []; } function getInjector(elementOrDir) { const context = getLContext(elementOrDir); const lView = context ? context.lView : null; if (lView === null) return _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.Injector.NULL; const tNode = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW].data[context.nodeIndex]; return new NodeInjector(tNode, lView); } function getInjectionTokens(element) { const context = getLContext(element); const lView = context ? context.lView : null; if (lView === null) return []; const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const tNode = tView.data[context.nodeIndex]; const providerTokens = []; const startIndex = tNode.providerIndexes & 1048575; const endIndex = tNode.directiveEnd; for (let i = startIndex; i < endIndex; i++) { let value = tView.data[i]; if (isDirectiveDefHack(value)) { value = value.type; } providerTokens.push(value); } return providerTokens; } function getDirectives(node) { if (node instanceof Text) { return []; } const context = getLContext(node); const lView = context ? context.lView : null; if (lView === null) { return []; } const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const nodeIndex = context.nodeIndex; if (!tView?.data[nodeIndex]) { return []; } if (context.directives === undefined) { context.directives = getDirectivesAtNodeIndex(nodeIndex, lView); } return context.directives === null ? [] : [...context.directives]; } var AcxChangeDetectionStrategy; (function (AcxChangeDetectionStrategy) { AcxChangeDetectionStrategy[AcxChangeDetectionStrategy["Default"] = 0] = "Default"; AcxChangeDetectionStrategy[AcxChangeDetectionStrategy["OnPush"] = 1] = "OnPush"; })(AcxChangeDetectionStrategy || (AcxChangeDetectionStrategy = {})); var AcxViewEncapsulation; (function (AcxViewEncapsulation) { AcxViewEncapsulation[AcxViewEncapsulation["Emulated"] = 0] = "Emulated"; AcxViewEncapsulation[AcxViewEncapsulation["None"] = 1] = "None"; })(AcxViewEncapsulation || (AcxViewEncapsulation = {})); function getDirectiveMetadata$1(directiveOrComponentInstance) { const { constructor } = directiveOrComponentInstance; if (!constructor) { throw new Error('Unable to find the instance constructor'); } const componentDef = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentDef)(constructor); if (componentDef) { const inputs = extractInputDebugMetadata(componentDef.inputs); return { inputs, outputs: componentDef.outputs, encapsulation: componentDef.encapsulation, changeDetection: componentDef.onPush ? ChangeDetectionStrategy.OnPush : ChangeDetectionStrategy.Default }; } const directiveDef = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getDirectiveDef)(constructor); if (directiveDef) { const inputs = extractInputDebugMetadata(directiveDef.inputs); return { inputs, outputs: directiveDef.outputs }; } return null; } function getLocalRefs(target) { const context = getLContext(target); if (context === null) return {}; if (context.localRefs === undefined) { const lView = context.lView; if (lView === null) { return {}; } context.localRefs = discoverLocalRefs(lView, context.nodeIndex); } return context.localRefs || {}; } function getHostElement(componentOrDirective) { return getLContext(componentOrDirective).native; } function getListeners(element) { ngDevMode && assertDomElement(element); const lContext = getLContext(element); const lView = lContext === null ? null : lContext.lView; if (lView === null) return []; const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const lCleanup = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CLEANUP]; const tCleanup = tView.cleanup; const listeners = []; if (tCleanup && lCleanup) { for (let i = 0; i < tCleanup.length;) { const firstParam = tCleanup[i++]; const secondParam = tCleanup[i++]; if (typeof firstParam === 'string') { const name = firstParam; const listenerElement = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(lView[secondParam]); const callback = lCleanup[tCleanup[i++]]; const useCaptureOrIndx = tCleanup[i++]; const type = typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0 ? 'dom' : 'output'; const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false; if (element == listenerElement) { listeners.push({ element, name, callback, useCapture, type }); } } } } listeners.sort(sortListeners); return listeners; } function sortListeners(a, b) { if (a.name == b.name) return 0; return a.name < b.name ? -1 : 1; } function isDirectiveDefHack(obj) { return obj.type !== undefined && obj.declaredInputs !== undefined && obj.resolveHostDirectives !== undefined; } function assertDomElement(value) { if (typeof Element !== 'undefined' && !(value instanceof Element)) { throw new Error('Expecting instance of DOM Element'); } } function extractInputDebugMetadata(inputs) { const res = {}; for (const key in inputs) { if (inputs.hasOwnProperty(key)) { const value = inputs[key]; if (value !== undefined) { res[key] = value[0]; } } } return res; } let DOCUMENT = undefined; function setDocument(document) { DOCUMENT = document; } function getDocument() { if (DOCUMENT !== undefined) { return DOCUMENT; } else if (typeof document !== 'undefined') { return document; } throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(210, (typeof ngDevMode === 'undefined' || ngDevMode) && `The document object is not available in this context. Make sure the DOCUMENT injection token is provided.`); } const APP_ID = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'AppId' : '', { factory: () => DEFAULT_APP_ID }); const DEFAULT_APP_ID = 'ng'; const validAppIdInitializer = { provide: _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ENVIRONMENT_INITIALIZER, multi: true, useValue: () => { const appId = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(APP_ID); const isAlphanumeric = /^[a-zA-Z0-9\-_]+$/.test(appId); if (!isAlphanumeric) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(211, `APP_ID value "${appId}" is not alphanumeric. ` + `The APP_ID must be a string of alphanumeric characters. (a-zA-Z0-9), hyphens (-) and underscores (_) are allowed.`); } } }; const PLATFORM_INITIALIZER = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'Platform Initializer' : ''); const PLATFORM_ID = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'Platform ID' : '', { providedIn: 'platform', factory: () => 'unknown' }); const ANIMATION_MODULE_TYPE = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'AnimationModuleType' : ''); const CSP_NONCE = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'CSP nonce' : '', { factory: () => { return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DOCUMENT).body?.querySelector('[ngCspNonce]')?.getAttribute('ngCspNonce') || null; } }); const IMAGE_CONFIG_DEFAULTS = { breakpoints: [16, 32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840], placeholderResolution: 30, disableImageSizeWarning: false, disableImageLazyLoadWarning: false }; const IMAGE_CONFIG = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'ImageConfig' : '', { factory: () => IMAGE_CONFIG_DEFAULTS }); function makeStateKey(key) { return key; } class TransferState { static ɵprov = /* @__PURE__ */ (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ token: TransferState, providedIn: 'root', factory: () => { const transferState = new TransferState(); if (typeof ngServerMode === 'undefined' || !ngServerMode) { transferState.store = retrieveTransferredState((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DOCUMENT), (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(APP_ID)); } return transferState; } }); store = {}; onSerializeCallbacks = {}; get(key, defaultValue) { return this.store[key] !== undefined ? this.store[key] : defaultValue; } set(key, value) { this.store[key] = value; } remove(key) { delete this.store[key]; } hasKey(key) { return this.store.hasOwnProperty(key); } get isEmpty() { return Object.keys(this.store).length === 0; } onSerialize(key, callback) { this.onSerializeCallbacks[key] = callback; } toJson() { for (const key in this.onSerializeCallbacks) { if (this.onSerializeCallbacks.hasOwnProperty(key)) { try { this.store[key] = this.onSerializeCallbacks[key](); } catch (e) { console.warn('Exception in onSerialize callback: ', e); } } } return JSON.stringify(this.store).replace(/ PRESERVE_HOST_CONTENT_DEFAULT }); const IS_I18N_HYDRATION_ENABLED = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'IS_I18N_HYDRATION_ENABLED' : ''); const IS_EVENT_REPLAY_ENABLED = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'IS_EVENT_REPLAY_ENABLED' : ''); const EVENT_REPLAY_ENABLED_DEFAULT = false; const EVENT_REPLAY_QUEUE = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'EVENT_REPLAY_QUEUE' : '', { factory: () => [] }); const IS_INCREMENTAL_HYDRATION_ENABLED = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'IS_INCREMENTAL_HYDRATION_ENABLED' : ''); const JSACTION_BLOCK_ELEMENT_MAP = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'JSACTION_BLOCK_ELEMENT_MAP' : '', { factory: () => new Map() }); const IS_ENABLED_BLOCKING_INITIAL_NAVIGATION = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'IS_ENABLED_BLOCKING_INITIAL_NAVIGATION' : ''); const eventListenerOptions = { passive: true, capture: true }; const hoverTriggers = new WeakMap(); const interactionTriggers = new WeakMap(); const viewportTriggers = new WeakMap(); const interactionEventNames = ['click', 'keydown']; const hoverEventNames = ['mouseenter', 'mouseover', 'focusin']; const intersectionObservers = new Map(); class DeferEventEntry { callbacks = new Set(); listener = () => { for (const callback of this.callbacks) { callback(); } }; } function onInteraction(trigger, callback) { let entry = interactionTriggers.get(trigger); if (!entry) { entry = new DeferEventEntry(); interactionTriggers.set(trigger, entry); for (const name of interactionEventNames) { trigger.addEventListener(name, entry.listener, eventListenerOptions); } } entry.callbacks.add(callback); return () => { const { callbacks, listener } = entry; callbacks.delete(callback); if (callbacks.size === 0) { interactionTriggers.delete(trigger); for (const name of interactionEventNames) { trigger.removeEventListener(name, listener, eventListenerOptions); } } }; } function onHover(trigger, callback) { let entry = hoverTriggers.get(trigger); if (!entry) { entry = new DeferEventEntry(); hoverTriggers.set(trigger, entry); for (const name of hoverEventNames) { trigger.addEventListener(name, entry.listener, eventListenerOptions); } } entry.callbacks.add(callback); return () => { const { callbacks, listener } = entry; callbacks.delete(callback); if (callbacks.size === 0) { for (const name of hoverEventNames) { trigger.removeEventListener(name, listener, eventListenerOptions); } hoverTriggers.delete(trigger); } }; } function createIntersectionObserver(options) { const key = getIntersectionObserverKey(options); return new IntersectionObserver(entries => { for (const current of entries) { if (current.isIntersecting && viewportTriggers.has(current.target)) { viewportTriggers.get(current.target)?.get(key)?.listener(); } } }, options); } function onViewport(trigger, callback, observerFactoryFn, options) { const key = getIntersectionObserverKey(options); let entry = viewportTriggers.get(trigger)?.get(key); if (!intersectionObservers.has(key)) { intersectionObservers.set(key, { observer: observerFactoryFn(options), count: 0 }); } const config = intersectionObservers.get(key); if (!entry) { entry = new DeferEventEntry(); config.observer.observe(trigger); let triggerConfig = viewportTriggers.get(trigger); if (triggerConfig) { triggerConfig.set(key, entry); } else { triggerConfig = new Map(); viewportTriggers.set(trigger, triggerConfig); } triggerConfig.set(key, entry); config.count++; } entry.callbacks.add(callback); return () => { if (!viewportTriggers.get(trigger)?.has(key)) { return; } entry.callbacks.delete(callback); if (entry.callbacks.size === 0) { config.observer.unobserve(trigger); config.count--; const triggerConfig = viewportTriggers.get(trigger); if (triggerConfig) { triggerConfig.delete(key); if (triggerConfig.size === 0) { viewportTriggers.delete(trigger); } } } if (config.count === 0) { config.observer.disconnect(); intersectionObservers.delete(key); } }; } function getIntersectionObserverKey(options) { if (!options) { return ''; } return `${options.rootMargin}/${typeof options.threshold === 'number' ? options.threshold : options.threshold?.join('\n')}`; } const DEFER_BLOCK_SSR_ID_ATTRIBUTE = 'ngb'; function setJSActionAttributes(nativeElement, eventTypes, parentDeferBlockId = null) { if (eventTypes.length === 0 || nativeElement.nodeType !== Node.ELEMENT_NODE) { return; } const existingAttr = nativeElement.getAttribute(_attribute_chunk_mjs__WEBPACK_IMPORTED_MODULE_6__.Attribute.JSACTION); const parts = eventTypes.reduce((prev, curr) => { return (existingAttr?.indexOf(curr) ?? -1) === -1 ? prev + curr + ':;' : prev; }, ''); nativeElement.setAttribute(_attribute_chunk_mjs__WEBPACK_IMPORTED_MODULE_6__.Attribute.JSACTION, `${existingAttr ?? ''}${parts}`); const blockName = parentDeferBlockId ?? ''; if (blockName !== '' && parts.length > 0) { nativeElement.setAttribute(DEFER_BLOCK_SSR_ID_ATTRIBUTE, blockName); } } const sharedStashFunction = (rEl, eventType, listenerFn) => { const el = rEl; const eventListenerMap = el.__jsaction_fns ?? new Map(); const eventListeners = eventListenerMap.get(eventType) ?? []; eventListeners.push(listenerFn); eventListenerMap.set(eventType, eventListeners); el.__jsaction_fns = eventListenerMap; }; const sharedMapFunction = (rEl, jsActionMap) => { const el = rEl; let blockName = el.getAttribute(DEFER_BLOCK_SSR_ID_ATTRIBUTE) ?? ''; const blockSet = jsActionMap.get(blockName) ?? new Set(); if (!blockSet.has(el)) { blockSet.add(el); } jsActionMap.set(blockName, blockSet); }; function removeListenersFromBlocks(blockNames, jsActionMap) { if (blockNames.length > 0) { let blockList = []; for (let blockName of blockNames) { if (jsActionMap.has(blockName)) { blockList = [...blockList, ...jsActionMap.get(blockName)]; } } const replayList = new Set(blockList); replayList.forEach(removeListeners); } } const removeListeners = el => { el.removeAttribute(_attribute_chunk_mjs__WEBPACK_IMPORTED_MODULE_6__.Attribute.JSACTION); el.removeAttribute(DEFER_BLOCK_SSR_ID_ATTRIBUTE); el.__jsaction_fns = undefined; }; const JSACTION_EVENT_CONTRACT = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'EVENT_CONTRACT_DETAILS' : '', { factory: () => ({}) }); function invokeListeners(event, currentTarget) { const handlerFns = currentTarget?.__jsaction_fns?.get(event.type); if (!handlerFns || !currentTarget?.isConnected) { return; } for (const handler of handlerFns) { handler(event); } } const stashEventListeners = new Map(); function setStashFn(appId, fn) { stashEventListeners.set(appId, fn); return () => stashEventListeners.delete(appId); } let isStashEventListenerImplEnabled = false; let _stashEventListenerImpl = (lView, target, eventName, wrappedListener) => {}; function stashEventListenerImpl(lView, target, eventName, wrappedListener) { _stashEventListenerImpl(lView, target, eventName, wrappedListener); } function enableStashEventListenerImpl() { if (!isStashEventListenerImplEnabled) { _stashEventListenerImpl = (lView, target, eventName, wrappedListener) => { const appId = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1].get(APP_ID); const stashEventListener = stashEventListeners.get(appId); stashEventListener?.(target, eventName, wrappedListener); }; isStashEventListenerImplEnabled = true; } } const DEHYDRATED_BLOCK_REGISTRY = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'DEHYDRATED_BLOCK_REGISTRY' : ''); class DehydratedBlockRegistry { registry = new Map(); cleanupFns = new Map(); jsActionMap = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(JSACTION_BLOCK_ELEMENT_MAP); contract = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(JSACTION_EVENT_CONTRACT); add(blockId, info) { this.registry.set(blockId, info); if (this.awaitingCallbacks.has(blockId)) { const awaitingCallbacks = this.awaitingCallbacks.get(blockId); for (const cb of awaitingCallbacks) { cb(); } } } get(blockId) { return this.registry.get(blockId) ?? null; } has(blockId) { return this.registry.has(blockId); } cleanup(hydratedBlocks) { removeListenersFromBlocks(hydratedBlocks, this.jsActionMap); for (let blockId of hydratedBlocks) { this.registry.delete(blockId); this.jsActionMap.delete(blockId); this.invokeTriggerCleanupFns(blockId); this.hydrating.delete(blockId); this.awaitingCallbacks.delete(blockId); } if (this.size === 0) { this.contract.instance?.cleanUp(); } } get size() { return this.registry.size; } addCleanupFn(blockId, fn) { let cleanupFunctions = []; if (this.cleanupFns.has(blockId)) { cleanupFunctions = this.cleanupFns.get(blockId); } cleanupFunctions.push(fn); this.cleanupFns.set(blockId, cleanupFunctions); } invokeTriggerCleanupFns(blockId) { const fns = this.cleanupFns.get(blockId) ?? []; for (let fn of fns) { fn(); } this.cleanupFns.delete(blockId); } hydrating = new Map(); awaitingCallbacks = new Map(); awaitParentBlock(topmostParentBlock, callback) { const parentBlockAwaitCallbacks = this.awaitingCallbacks.get(topmostParentBlock) ?? []; parentBlockAwaitCallbacks.push(callback); this.awaitingCallbacks.set(topmostParentBlock, parentBlockAwaitCallbacks); } static ɵprov = /* @__PURE__ */ (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ token: DehydratedBlockRegistry, providedIn: null, factory: () => new DehydratedBlockRegistry() }); } function isDetachedByI18n(tNode) { return (tNode.flags & 32) === 32; } const TRANSFER_STATE_TOKEN_ID = '__nghData__'; const NGH_DATA_KEY = makeStateKey(TRANSFER_STATE_TOKEN_ID); const TRANSFER_STATE_DEFER_BLOCKS_INFO = '__nghDeferData__'; const NGH_DEFER_BLOCKS_KEY = makeStateKey(TRANSFER_STATE_DEFER_BLOCKS_INFO); function isInternalHydrationTransferStateKey(key) { return key === TRANSFER_STATE_TOKEN_ID || key === TRANSFER_STATE_DEFER_BLOCKS_INFO; } const NGH_ATTR_NAME = 'ngh'; const SSR_CONTENT_INTEGRITY_MARKER = 'nghm'; let _retrieveHydrationInfoImpl = () => null; function retrieveHydrationInfoImpl(rNode, injector, isRootView = false) { let nghAttrValue = rNode.getAttribute(NGH_ATTR_NAME); if (nghAttrValue == null) return null; const [componentViewNgh, rootViewNgh] = nghAttrValue.split('|'); nghAttrValue = isRootView ? rootViewNgh : componentViewNgh; if (!nghAttrValue) return null; const rootNgh = rootViewNgh ? `|${rootViewNgh}` : ''; const remainingNgh = isRootView ? componentViewNgh : rootNgh; let data = {}; if (nghAttrValue !== '') { const transferState = injector.get(TransferState, null, { optional: true }); if (transferState !== null) { const nghData = transferState.get(NGH_DATA_KEY, []); data = nghData[Number(nghAttrValue)]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(data, 'Unable to retrieve hydration info from the TransferState.'); } } const dehydratedView = { data, firstChild: rNode.firstChild ?? null }; if (isRootView) { dehydratedView.firstChild = rNode; setSegmentHead(dehydratedView, 0, rNode.nextSibling); } if (remainingNgh) { rNode.setAttribute(NGH_ATTR_NAME, remainingNgh); } else { rNode.removeAttribute(NGH_ATTR_NAME); } ngDevMode && markRNodeAsClaimedByHydration(rNode, false); ngDevMode && ngDevMode.hydratedComponents++; return dehydratedView; } function enableRetrieveHydrationInfoImpl() { _retrieveHydrationInfoImpl = retrieveHydrationInfoImpl; } function retrieveHydrationInfo(rNode, injector, isRootView = false) { return _retrieveHydrationInfoImpl(rNode, injector, isRootView); } function getLNodeForHydration(viewRef) { let lView = viewRef._lView; const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; if (tView.type === 2) { return null; } if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isRootView)(lView)) { lView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET]; } return lView; } function getTextNodeContent(node) { return node.textContent?.replace(/\s/gm, ''); } function processTextNodeMarkersBeforeHydration(node) { const doc = getDocument(); const commentNodesIterator = doc.createNodeIterator(node, NodeFilter.SHOW_COMMENT, { acceptNode(node) { const content = getTextNodeContent(node); const isTextNodeMarker = content === "ngetn" || content === "ngtns"; return isTextNodeMarker ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT; } }); let currentNode; const nodes = []; while (currentNode = commentNodesIterator.nextNode()) { nodes.push(currentNode); } for (const node of nodes) { if (node.textContent === "ngetn") { node.replaceWith(doc.createTextNode('')); } else { node.remove(); } } } var HydrationStatus; (function (HydrationStatus) { HydrationStatus["Hydrated"] = "hydrated"; HydrationStatus["Skipped"] = "skipped"; HydrationStatus["Mismatched"] = "mismatched"; })(HydrationStatus || (HydrationStatus = {})); const HYDRATION_INFO_KEY = '__ngDebugHydrationInfo__'; function patchHydrationInfo(node, info) { node[HYDRATION_INFO_KEY] = info; } function readHydrationInfo(node) { return node[HYDRATION_INFO_KEY] ?? null; } function markRNodeAsClaimedByHydration(node, checkIfAlreadyClaimed = true) { if (!ngDevMode) { throw new Error('Calling `markRNodeAsClaimedByHydration` in prod mode ' + 'is not supported and likely a mistake.'); } if (checkIfAlreadyClaimed && isRNodeClaimedForHydration(node)) { throw new Error('Trying to claim a node, which was claimed already.'); } patchHydrationInfo(node, { status: HydrationStatus.Hydrated }); ngDevMode.hydratedNodes++; } function markRNodeAsSkippedByHydration(node) { if (!ngDevMode) { throw new Error('Calling `markRNodeAsSkippedByHydration` in prod mode ' + 'is not supported and likely a mistake.'); } patchHydrationInfo(node, { status: HydrationStatus.Skipped }); ngDevMode.componentsSkippedHydration++; } function countBlocksSkippedByHydration(injector) { const transferState = injector.get(TransferState); const nghDeferData = transferState.get(NGH_DEFER_BLOCKS_KEY, {}); if (ngDevMode) { ngDevMode.deferBlocksWithIncrementalHydration = Object.keys(nghDeferData).length; } } function markRNodeAsHavingHydrationMismatch(node, expectedNodeDetails = null, actualNodeDetails = null) { if (!ngDevMode) { throw new Error('Calling `markRNodeAsMismatchedByHydration` in prod mode ' + 'is not supported and likely a mistake.'); } while (node && !getComponent(node)) { node = node?.parentNode; } if (node) { patchHydrationInfo(node, { status: HydrationStatus.Mismatched, expectedNodeDetails, actualNodeDetails }); } } function isRNodeClaimedForHydration(node) { return readHydrationInfo(node)?.status === HydrationStatus.Hydrated; } function setSegmentHead(hydrationInfo, index, node) { hydrationInfo.segmentHeads ??= {}; hydrationInfo.segmentHeads[index] = node; } function getSegmentHead(hydrationInfo, index) { return hydrationInfo.segmentHeads?.[index] ?? null; } function isIncrementalHydrationEnabled(injector) { return injector.get(IS_INCREMENTAL_HYDRATION_ENABLED, false, { optional: true }); } let incrementalHydrationEnabledWarned = false; function resetIncrementalHydrationEnabledWarnedForTests() { incrementalHydrationEnabledWarned = false; } function warnIncrementalHydrationNotConfigured() { if (!incrementalHydrationEnabledWarned) { incrementalHydrationEnabledWarned = true; console.warn((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.formatRuntimeError)(508, 'Angular has detected that some `@defer` blocks use `hydrate` triggers, ' + 'but incremental hydration was not enabled. Please ensure that the `withIncrementalHydration()` ' + 'call is added as an argument for the `provideClientHydration()` function call ' + 'in your application config.')); } } function assertSsrIdDefined(ssrUniqueId) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(ssrUniqueId, 'Internal error: expecting an SSR id for a defer block that should be hydrated, but the id is not present'); } function getNgContainerSize(hydrationInfo, index) { const data = hydrationInfo.data; let size = data[ELEMENT_CONTAINERS]?.[index] ?? null; if (size === null && data[CONTAINERS]?.[index]) { size = calcSerializedContainerSize(hydrationInfo, index); } return size; } function isSerializedElementContainer(hydrationInfo, index) { return hydrationInfo.data[ELEMENT_CONTAINERS]?.[index] !== undefined; } function getSerializedContainerViews(hydrationInfo, index) { return hydrationInfo.data[CONTAINERS]?.[index] ?? null; } function calcSerializedContainerSize(hydrationInfo, index) { const views = getSerializedContainerViews(hydrationInfo, index) ?? []; let numNodes = 0; for (let view of views) { numNodes += view[NUM_ROOT_NODES] * (view[MULTIPLIER] ?? 1); } return numNodes; } function initDisconnectedNodes(hydrationInfo) { if (typeof hydrationInfo.disconnectedNodes === 'undefined') { const nodeIds = hydrationInfo.data[DISCONNECTED_NODES]; hydrationInfo.disconnectedNodes = nodeIds ? new Set(nodeIds) : null; } return hydrationInfo.disconnectedNodes; } function isDisconnectedNode$1(hydrationInfo, index) { if (typeof hydrationInfo.disconnectedNodes === 'undefined') { const nodeIds = hydrationInfo.data[DISCONNECTED_NODES]; hydrationInfo.disconnectedNodes = nodeIds ? new Set(nodeIds) : null; } return !!initDisconnectedNodes(hydrationInfo)?.has(index); } function canHydrateNode(lView, tNode) { const hydrationInfo = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HYDRATION]; return hydrationInfo !== null && !(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isInSkipHydrationBlock)() && !isDetachedByI18n(tNode) && !isDisconnectedNode$1(hydrationInfo, tNode.index - _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET); } function processTextNodeBeforeSerialization(context, node) { const el = node; const corruptedTextNodes = context.corruptedTextNodes; if (el.textContent === '') { corruptedTextNodes.set(el, "ngetn"); } else if (el.nextSibling?.nodeType === Node.TEXT_NODE) { corruptedTextNodes.set(el, "ngtns"); } } function convertHydrateTriggersToJsAction(triggers) { let actionList = []; if (triggers !== null) { if (triggers.has(4)) { actionList.push(...hoverEventNames); } if (triggers.has(3)) { actionList.push(...interactionEventNames); } } return actionList; } function getParentBlockHydrationQueue(deferBlockId, injector) { const dehydratedBlockRegistry = injector.get(DEHYDRATED_BLOCK_REGISTRY); const transferState = injector.get(TransferState); const deferBlockParents = transferState.get(NGH_DEFER_BLOCKS_KEY, {}); let isTopMostDeferBlock = false; let currentBlockId = deferBlockId; let parentBlockPromise = null; const hydrationQueue = []; while (!isTopMostDeferBlock && currentBlockId) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(hydrationQueue.indexOf(currentBlockId), -1, 'Internal error: defer block hierarchy has a cycle.'); isTopMostDeferBlock = dehydratedBlockRegistry.has(currentBlockId); const hydratingParentBlock = dehydratedBlockRegistry.hydrating.get(currentBlockId); if (parentBlockPromise === null && hydratingParentBlock != null) { parentBlockPromise = hydratingParentBlock.promise; break; } hydrationQueue.unshift(currentBlockId); currentBlockId = deferBlockParents[currentBlockId][DEFER_PARENT_BLOCK_ID]; } return { parentBlockPromise, hydrationQueue }; } function gatherDeferBlocksByJSActionAttribute(doc) { const jsactionNodes = doc.body.querySelectorAll('[jsaction]'); const blockMap = new Set(); const eventTypes = [hoverEventNames.join(':;'), interactionEventNames.join(':;')].join('|'); for (let node of jsactionNodes) { const attr = node.getAttribute('jsaction'); const blockId = node.getAttribute('ngb'); if (attr?.match(eventTypes) && blockId !== null) { blockMap.add(node); } } return blockMap; } function appendDeferBlocksToJSActionMap(doc, injector) { const blockMap = gatherDeferBlocksByJSActionAttribute(doc); const jsActionMap = injector.get(JSACTION_BLOCK_ELEMENT_MAP); for (let rNode of blockMap) { sharedMapFunction(rNode, jsActionMap); } } let _retrieveDeferBlockDataImpl = () => { return {}; }; function retrieveDeferBlockDataImpl(injector) { const transferState = injector.get(TransferState, null, { optional: true }); if (transferState !== null) { const nghDeferData = transferState.get(NGH_DEFER_BLOCKS_KEY, {}); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(nghDeferData, 'Unable to retrieve defer block info from the TransferState.'); return nghDeferData; } return {}; } function enableRetrieveDeferBlockDataImpl() { _retrieveDeferBlockDataImpl = retrieveDeferBlockDataImpl; } function retrieveDeferBlockData(injector) { return _retrieveDeferBlockDataImpl(injector); } function isTimerTrigger(triggerInfo) { return typeof triggerInfo === 'object' && triggerInfo.trigger === 5; } function getHydrateTimerTrigger(blockData) { const trigger = blockData[DEFER_HYDRATE_TRIGGERS]?.find(t => isTimerTrigger(t)); return trigger?.delay ?? null; } function getHydrateViewportTrigger(blockData) { const details = blockData[DEFER_HYDRATE_TRIGGERS]; if (details) { for (const current of details) { if (current === 2) { return true; } else if (typeof current === 'object' && current.trigger === 2) { return current.intersectionObserverOptions || true; } } } return null; } function hasHydrateTrigger(blockData, trigger) { return blockData[DEFER_HYDRATE_TRIGGERS]?.includes(trigger) ?? false; } function createBlockSummary(blockInfo) { return { data: blockInfo, hydrate: { idle: hasHydrateTrigger(blockInfo, 0), immediate: hasHydrateTrigger(blockInfo, 1), timer: getHydrateTimerTrigger(blockInfo), viewport: getHydrateViewportTrigger(blockInfo) } }; } function processBlockData(injector) { const blockData = retrieveDeferBlockData(injector); let blockDetails = new Map(); for (let blockId in blockData) { blockDetails.set(blockId, createBlockSummary(blockData[blockId])); } return blockDetails; } function isSsrContentsIntegrity(node) { return !!node && node.nodeType === Node.COMMENT_NODE && node.textContent?.trim() === SSR_CONTENT_INTEGRITY_MARKER; } function skipTextNodes(node) { while (node && node.nodeType === Node.TEXT_NODE) { node = node.previousSibling; } return node; } function verifySsrContentsIntegrity(doc) { for (const node of doc.body.childNodes) { if (isSsrContentsIntegrity(node)) { return; } } const beforeBody = skipTextNodes(doc.body.previousSibling); if (isSsrContentsIntegrity(beforeBody)) { return; } let endOfHead = skipTextNodes(doc.head.lastChild); if (isSsrContentsIntegrity(endOfHead)) { return; } throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(-507, typeof ngDevMode !== 'undefined' && ngDevMode && 'Angular hydration logic detected that HTML content of this page was modified after it ' + 'was produced during server side rendering. Make sure that there are no optimizations ' + 'that remove comment nodes from HTML enabled on your CDN. Angular hydration ' + 'relies on HTML produced by the server, including whitespaces and comment nodes.'); } function refreshContentQueries(tView, lView) { const contentQueries = tView.contentQueries; if (contentQueries !== null) { const prevConsumer = (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(null); try { for (let i = 0; i < contentQueries.length; i += 2) { const queryStartIdx = contentQueries[i]; const directiveDefIdx = contentQueries[i + 1]; if (directiveDefIdx !== -1) { const directiveDef = tView.data[directiveDefIdx]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(directiveDef, 'DirectiveDef not found.'); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(directiveDef.contentQueries, 'contentQueries function should be defined'); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setCurrentQueryIndex)(queryStartIdx); directiveDef.contentQueries(2, lView[directiveDefIdx], directiveDefIdx); } } } finally { (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(prevConsumer); } } } function executeViewQueryFn(flags, viewQueryFn, component) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(viewQueryFn, 'View queries function to execute must be defined.'); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setCurrentQueryIndex)(0); const prevConsumer = (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(null); try { viewQueryFn(flags, component); } finally { (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(prevConsumer); } } function executeContentQueries(tView, tNode, lView) { if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isContentQueryHost)(tNode)) { const prevConsumer = (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(null); try { const start = tNode.directiveStart; const end = tNode.directiveEnd; for (let directiveIndex = start; directiveIndex < end; directiveIndex++) { const def = tView.data[directiveIndex]; if (def.contentQueries) { const directiveInstance = lView[directiveIndex]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(directiveIndex, 'Incorrect reference to a directive defining a content query'); def.contentQueries(1, directiveInstance, directiveIndex); } } } finally { (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(prevConsumer); } } } var ViewEncapsulation; (function (ViewEncapsulation) { ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated"; ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None"; ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom"; ViewEncapsulation[ViewEncapsulation["ExperimentalIsolatedShadowDom"] = 4] = "ExperimentalIsolatedShadowDom"; })(ViewEncapsulation || (ViewEncapsulation = {})); const CUSTOM_ELEMENTS_SCHEMA = { name: 'custom-elements' }; const NO_ERRORS_SCHEMA = { name: 'no-errors-schema' }; let shouldThrowErrorOnUnknownElement = false; function ɵsetUnknownElementStrictMode(shouldThrow) { shouldThrowErrorOnUnknownElement = shouldThrow; } function ɵgetUnknownElementStrictMode() { return shouldThrowErrorOnUnknownElement; } let shouldThrowErrorOnUnknownProperty = false; function ɵsetUnknownPropertyStrictMode(shouldThrow) { shouldThrowErrorOnUnknownProperty = shouldThrow; } function ɵgetUnknownPropertyStrictMode() { return shouldThrowErrorOnUnknownProperty; } function validateElementIsKnown(lView, tNode) { const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; if (tView.schemas === null) return; const tagName = tNode.value; if (!(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isDirectiveHost)(tNode) && tagName !== null) { const isUnknown = typeof HTMLUnknownElement !== 'undefined' && HTMLUnknownElement && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode)(tNode, lView) instanceof HTMLUnknownElement || typeof customElements !== 'undefined' && tagName.indexOf('-') > -1 && !customElements.get(tagName); if (isUnknown && !matchingSchemas(tView.schemas, tagName)) { const isHostStandalone = isHostComponentStandalone(lView); const templateLocation = getTemplateLocationDetails(lView); const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`; let message = `'${tagName}' is not a known element${templateLocation}:\n`; message += `1. If '${tagName}' is an Angular component, then verify that it is ${isHostStandalone ? "included in the '@Component.imports' of this component" : 'a part of an @NgModule where this component is declared'}.\n`; if (tagName && tagName.indexOf('-') > -1) { message += `2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the ${schemas} of this component to suppress this message.`; } else { message += `2. To allow any element add 'NO_ERRORS_SCHEMA' to the ${schemas} of this component.`; } if (shouldThrowErrorOnUnknownElement) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(304, message); } else { console.error((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.formatRuntimeError)(304, message)); } } } } function isPropertyValid(element, propName, tagName, schemas) { if (schemas === null) return true; if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) { return true; } return typeof Node === 'undefined' || Node === null || !(element instanceof Node); } function handleUnknownPropertyError(propName, tagName, nodeType, lView) { if (!tagName && nodeType === 4) { tagName = 'ng-template'; } const isHostStandalone = isHostComponentStandalone(lView); const templateLocation = getTemplateLocationDetails(lView); let message = `Can't bind to '${propName}' since it isn't a known property of '${tagName}'${templateLocation}.`; const schemas = `'${isHostStandalone ? '@Component' : '@NgModule'}.schemas'`; const importLocation = isHostStandalone ? "included in the '@Component.imports' of this component" : 'a part of an @NgModule where this component is declared'; if (KNOWN_CONTROL_FLOW_DIRECTIVES.has(propName)) { const correspondingImport = KNOWN_CONTROL_FLOW_DIRECTIVES.get(propName); message += `\nIf the '${propName}' is an Angular control flow directive, ` + `please make sure that either the '${correspondingImport}' directive or the 'CommonModule' is ${importLocation}.`; } else { message += `\n1. If '${tagName}' is an Angular component and it has the ` + `'${propName}' input, then verify that it is ${importLocation}.`; if (tagName && tagName.indexOf('-') > -1) { message += `\n2. If '${tagName}' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' ` + `to the ${schemas} of this component to suppress this message.`; message += `\n3. To allow any property add 'NO_ERRORS_SCHEMA' to ` + `the ${schemas} of this component.`; } else { message += `\n2. To allow any property add 'NO_ERRORS_SCHEMA' to ` + `the ${schemas} of this component.`; } } reportUnknownPropertyError(message); } function reportUnknownPropertyError(message) { if (shouldThrowErrorOnUnknownProperty) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(303, message); } else { console.error((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.formatRuntimeError)(303, message)); } } function getDeclarationComponentDef(lView) { !ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)('Must never be called in production mode'); const declarationLView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_COMPONENT_VIEW]; const context = declarationLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT]; if (!context) return null; return context.constructor ? (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentDef)(context.constructor) : null; } function isHostComponentStandalone(lView) { !ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)('Must never be called in production mode'); const componentDef = getDeclarationComponentDef(lView); return !!componentDef?.standalone; } function getTemplateLocationDetails(lView) { !ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)('Must never be called in production mode'); const hostComponentDef = getDeclarationComponentDef(lView); const componentClassName = hostComponentDef?.type?.name; return componentClassName ? ` (used in the '${componentClassName}' component template)` : ''; } const KNOWN_CONTROL_FLOW_DIRECTIVES = new Map([['ngIf', 'NgIf'], ['ngFor', 'NgFor'], ['ngSwitchCase', 'NgSwitchCase'], ['ngSwitchDefault', 'NgSwitchDefault']]); function matchingSchemas(schemas, tagName) { if (schemas !== null) { for (let i = 0; i < schemas.length; i++) { const schema = schemas[i]; if (schema === NO_ERRORS_SCHEMA || schema === CUSTOM_ELEMENTS_SCHEMA && tagName && tagName.indexOf('-') > -1) { return true; } } } return false; } let policy$1; function getPolicy$1() { if (policy$1 === undefined) { policy$1 = null; if (_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__._global.trustedTypes) { try { policy$1 = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__._global.trustedTypes.createPolicy('angular', { createHTML: s => s, createScript: s => s, createScriptURL: s => s }); } catch {} } } return policy$1; } function trustedHTMLFromString(html) { return getPolicy$1()?.createHTML(html) || html; } function trustedScriptURLFromString(url) { return getPolicy$1()?.createScriptURL(url) || url; } let policy; function getPolicy() { if (policy === undefined) { policy = null; if (_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__._global.trustedTypes) { try { policy = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__._global.trustedTypes.createPolicy('angular#unsafe-bypass', { createHTML: s => s, createScript: s => s, createScriptURL: s => s }); } catch {} } } return policy; } function trustedHTMLFromStringBypass(html) { return getPolicy()?.createHTML(html) || html; } function trustedScriptFromStringBypass(script) { return getPolicy()?.createScript(script) || script; } function trustedScriptURLFromStringBypass(url) { return getPolicy()?.createScriptURL(url) || url; } class SafeValueImpl { changingThisBreaksApplicationSecurity; constructor(changingThisBreaksApplicationSecurity) { this.changingThisBreaksApplicationSecurity = changingThisBreaksApplicationSecurity; } toString() { return `SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity}` + ` (see ${_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.XSS_SECURITY_URL})`; } } class SafeHtmlImpl extends SafeValueImpl { getTypeName() { return "HTML"; } } class SafeStyleImpl extends SafeValueImpl { getTypeName() { return "Style"; } } class SafeScriptImpl extends SafeValueImpl { getTypeName() { return "Script"; } } class SafeUrlImpl extends SafeValueImpl { getTypeName() { return "URL"; } } class SafeResourceUrlImpl extends SafeValueImpl { getTypeName() { return "ResourceURL"; } } function unwrapSafeValue(value) { return value instanceof SafeValueImpl ? value.changingThisBreaksApplicationSecurity : value; } function allowSanitizationBypassAndThrow(value, type) { const actualType = getSanitizationBypassType(value); if (actualType != null && actualType !== type) { if (actualType === "ResourceURL" && type === "URL") return true; throw new Error(`Required a safe ${type}, got a ${actualType} (see ${_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.XSS_SECURITY_URL})`); } return actualType === type; } function getSanitizationBypassType(value) { return value instanceof SafeValueImpl && value.getTypeName() || null; } function bypassSanitizationTrustHtml(trustedHtml) { return new SafeHtmlImpl(trustedHtml); } function bypassSanitizationTrustStyle(trustedStyle) { return new SafeStyleImpl(trustedStyle); } function bypassSanitizationTrustScript(trustedScript) { return new SafeScriptImpl(trustedScript); } function bypassSanitizationTrustUrl(trustedUrl) { return new SafeUrlImpl(trustedUrl); } function bypassSanitizationTrustResourceUrl(trustedResourceUrl) { return new SafeResourceUrlImpl(trustedResourceUrl); } function getInertBodyHelper(defaultDoc) { const inertDocumentHelper = new InertDocumentHelper(defaultDoc); return isDOMParserAvailable() ? new DOMParserHelper(inertDocumentHelper) : inertDocumentHelper; } class DOMParserHelper { inertDocumentHelper; constructor(inertDocumentHelper) { this.inertDocumentHelper = inertDocumentHelper; } getInertBodyElement(html) { html = '' + html; try { const body = new window.DOMParser().parseFromString(trustedHTMLFromString(html), 'text/html').body; if (body === null) { return this.inertDocumentHelper.getInertBodyElement(html); } body.firstChild?.remove(); return body; } catch { return null; } } } class InertDocumentHelper { defaultDoc; inertDocument; constructor(defaultDoc) { this.defaultDoc = defaultDoc; this.inertDocument = this.defaultDoc.implementation.createHTMLDocument('sanitization-inert'); } getInertBodyElement(html) { const templateEl = this.inertDocument.createElement('template'); templateEl.innerHTML = trustedHTMLFromString(html); return templateEl; } } function isDOMParserAvailable() { try { return !!new window.DOMParser().parseFromString(trustedHTMLFromString(''), 'text/html'); } catch { return false; } } const SAFE_URL_PATTERN = /^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i; function _sanitizeUrl(url) { url = String(url); if (url.match(SAFE_URL_PATTERN)) return url; if (typeof ngDevMode === 'undefined' || ngDevMode) { console.warn(`WARNING: sanitizing unsafe URL value ${url} (see ${_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.XSS_SECURITY_URL})`); } return 'unsafe:' + url; } function tagSet(tags) { const res = {}; for (const t of tags.split(',')) res[t] = true; return res; } function merge(...sets) { const res = {}; for (const s of sets) { for (const v in s) { if (s.hasOwnProperty(v)) res[v] = true; } } return res; } const VOID_ELEMENTS = tagSet('area,br,col,hr,img,wbr'); const OPTIONAL_END_TAG_BLOCK_ELEMENTS = tagSet('colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr'); const OPTIONAL_END_TAG_INLINE_ELEMENTS = tagSet('rp,rt'); const OPTIONAL_END_TAG_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, OPTIONAL_END_TAG_BLOCK_ELEMENTS); const BLOCK_ELEMENTS = merge(OPTIONAL_END_TAG_BLOCK_ELEMENTS, tagSet('address,article,' + 'aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,' + 'h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul')); const INLINE_ELEMENTS = merge(OPTIONAL_END_TAG_INLINE_ELEMENTS, tagSet('a,abbr,acronym,audio,b,' + 'bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,' + 'samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video')); const VALID_ELEMENTS = merge(VOID_ELEMENTS, BLOCK_ELEMENTS, INLINE_ELEMENTS, OPTIONAL_END_TAG_ELEMENTS); const URI_ATTRS = tagSet('background,cite,href,itemtype,longdesc,poster,src,xlink:href'); const HTML_ATTRS = tagSet('abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,' + 'compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,' + 'ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,' + 'scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,' + 'valign,value,vspace,width'); const ARIA_ATTRS = tagSet('aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,' + 'aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,' + 'aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,' + 'aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,' + 'aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,' + 'aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,' + 'aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext'); const VALID_ATTRS = merge(URI_ATTRS, HTML_ATTRS, ARIA_ATTRS); const SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS = tagSet('script,style,template'); class SanitizingHtmlSerializer { sanitizedSomething = false; buf = []; sanitizeChildren(el) { let current = el.firstChild; let traverseContent = true; let parentNodes = []; while (current) { if (current.nodeType === Node.ELEMENT_NODE) { traverseContent = this.startElement(current); } else if (current.nodeType === Node.TEXT_NODE) { this.chars(current.nodeValue); } else { this.sanitizedSomething = true; } if (traverseContent && current.firstChild) { parentNodes.push(current); current = getFirstChild(current); continue; } while (current) { if (current.nodeType === Node.ELEMENT_NODE) { this.endElement(current); } let next = getNextSibling(current); if (next) { current = next; break; } current = parentNodes.pop(); } } return this.buf.join(''); } startElement(element) { const tagName = getNodeName(element).toLowerCase(); if (!VALID_ELEMENTS.hasOwnProperty(tagName)) { this.sanitizedSomething = true; return !SKIP_TRAVERSING_CONTENT_IF_INVALID_ELEMENTS.hasOwnProperty(tagName); } this.buf.push('<'); this.buf.push(tagName); const elAttrs = element.attributes; for (let i = 0; i < elAttrs.length; i++) { const elAttr = elAttrs.item(i); const attrName = elAttr.name; const lower = attrName.toLowerCase(); if (!VALID_ATTRS.hasOwnProperty(lower)) { this.sanitizedSomething = true; continue; } let value = elAttr.value; if (URI_ATTRS[lower]) value = _sanitizeUrl(value); this.buf.push(' ', attrName, '="', encodeEntities(value), '"'); } this.buf.push('>'); return true; } endElement(current) { const tagName = getNodeName(current).toLowerCase(); if (VALID_ELEMENTS.hasOwnProperty(tagName) && !VOID_ELEMENTS.hasOwnProperty(tagName)) { this.buf.push(''); } } chars(chars) { this.buf.push(encodeEntities(chars)); } } function isClobberedElement(parentNode, childNode) { return (parentNode.compareDocumentPosition(childNode) & Node.DOCUMENT_POSITION_CONTAINED_BY) !== Node.DOCUMENT_POSITION_CONTAINED_BY; } function getNextSibling(node) { const nextSibling = node.nextSibling; if (nextSibling && node !== nextSibling.previousSibling) { throw clobberedElementError(nextSibling); } return nextSibling; } function getFirstChild(node) { const firstChild = node.firstChild; if (firstChild && isClobberedElement(node, firstChild)) { throw clobberedElementError(firstChild); } return firstChild; } function getNodeName(node) { const nodeName = node.nodeName; return typeof nodeName === 'string' ? nodeName : 'FORM'; } function clobberedElementError(node) { return new Error(`Failed to sanitize html because the element is clobbered: ${node.outerHTML}`); } const SURROGATE_PAIR_REGEXP = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g; const NON_ALPHANUMERIC_REGEXP = /([^\#-~ |!])/g; function encodeEntities(value) { return value.replace(/&/g, '&').replace(SURROGATE_PAIR_REGEXP, function (match) { const hi = match.charCodeAt(0); const low = match.charCodeAt(1); return '&#' + ((hi - 0xd800) * 0x400 + (low - 0xdc00) + 0x10000) + ';'; }).replace(NON_ALPHANUMERIC_REGEXP, function (match) { return '&#' + match.charCodeAt(0) + ';'; }).replace(//g, '>'); } let inertBodyHelper; function _sanitizeHtml(defaultDoc, unsafeHtmlInput) { let inertBodyElement = null; try { inertBodyHelper = inertBodyHelper || getInertBodyHelper(defaultDoc); let unsafeHtml = unsafeHtmlInput ? String(unsafeHtmlInput) : ''; inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml); let mXSSAttempts = 5; let parsedHtml = unsafeHtml; do { if (mXSSAttempts === 0) { throw new Error('Failed to sanitize html because the input is unstable'); } mXSSAttempts--; unsafeHtml = parsedHtml; parsedHtml = inertBodyElement.innerHTML; inertBodyElement = inertBodyHelper.getInertBodyElement(unsafeHtml); } while (unsafeHtml !== parsedHtml); const sanitizer = new SanitizingHtmlSerializer(); const safeHtml = sanitizer.sanitizeChildren(getTemplateContent(inertBodyElement) || inertBodyElement); if ((typeof ngDevMode === 'undefined' || ngDevMode) && sanitizer.sanitizedSomething) { console.warn(`WARNING: sanitizing HTML stripped some content, see ${_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.XSS_SECURITY_URL}`); } return trustedHTMLFromString(safeHtml); } finally { if (inertBodyElement) { const parent = getTemplateContent(inertBodyElement) || inertBodyElement; while (parent.firstChild) { parent.firstChild.remove(); } } } } function getTemplateContent(el) { return 'content' in el && isTemplateElement(el) ? el.content : null; } function isTemplateElement(el) { return el.nodeType === Node.ELEMENT_NODE && el.nodeName === 'TEMPLATE'; } const COMMENT_DISALLOWED = /^>|^->||--!>|)/g; const COMMENT_DELIMITER_ESCAPED = '\u200B$1\u200B'; function escapeCommentText(value) { return value.replace(COMMENT_DISALLOWED, text => text.replace(COMMENT_DELIMITER, COMMENT_DELIMITER_ESCAPED)); } function createTextNode(renderer, value) { return renderer.createText(value); } function updateTextNode(renderer, rNode, value) { renderer.setValue(rNode, value); } function createCommentNode(renderer, value) { return renderer.createComment(escapeCommentText(value)); } function createElementNode(renderer, name, namespace) { return renderer.createElement(name, namespace); } function nativeInsertBefore(renderer, parent, child, beforeNode, isMove) { renderer.insertBefore(parent, child, beforeNode, isMove); } function nativeAppendChild(renderer, parent, child) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(parent, 'parent node must be defined'); renderer.appendChild(parent, child); } function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove) { if (beforeNode !== null) { nativeInsertBefore(renderer, parent, child, beforeNode, isMove); } else { nativeAppendChild(renderer, parent, child); } } function nativeRemoveNode(renderer, rNode, isHostElement, requireSynchronousElementRemoval) { renderer.removeChild(null, rNode, isHostElement, requireSynchronousElementRemoval); } function clearElementContents(rElement) { rElement.textContent = ''; } function writeDirectStyle(renderer, element, newValue) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertString)(newValue, "'newValue' should be a string"); renderer.setAttribute(element, 'style', newValue); } function writeDirectClass(renderer, element, newValue) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertString)(newValue, "'newValue' should be a string"); if (newValue === '') { renderer.removeAttribute(element, 'class'); } else { renderer.setAttribute(element, 'class', newValue); } } function setupStaticAttributes(renderer, element, tNode) { const { mergedAttrs, classes, styles } = tNode; if (mergedAttrs !== null) { setUpAttributes(renderer, element, mergedAttrs); } if (classes !== null) { writeDirectClass(renderer, element, classes); } if (styles !== null) { writeDirectStyle(renderer, element, styles); } } function enforceIframeSecurity(iframe) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); iframe.src = ''; iframe.srcdoc = trustedHTMLFromString(''); nativeRemoveNode(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER], iframe); } var SecurityContext; (function (SecurityContext) { SecurityContext[SecurityContext["NONE"] = 0] = "NONE"; SecurityContext[SecurityContext["HTML"] = 1] = "HTML"; SecurityContext[SecurityContext["STYLE"] = 2] = "STYLE"; SecurityContext[SecurityContext["SCRIPT"] = 3] = "SCRIPT"; SecurityContext[SecurityContext["URL"] = 4] = "URL"; SecurityContext[SecurityContext["RESOURCE_URL"] = 5] = "RESOURCE_URL"; })(SecurityContext || (SecurityContext = {})); function ɵɵsanitizeHtml(unsafeHtml) { const sanitizer = getSanitizer(); if (sanitizer) { return trustedHTMLFromStringBypass(sanitizer.sanitize(SecurityContext.HTML, unsafeHtml) || ''); } if (allowSanitizationBypassAndThrow(unsafeHtml, "HTML")) { return trustedHTMLFromStringBypass(unwrapSafeValue(unsafeHtml)); } return _sanitizeHtml(getDocument(), (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.renderStringify)(unsafeHtml)); } function ɵɵsanitizeStyle(unsafeStyle) { const sanitizer = getSanitizer(); if (sanitizer) { return sanitizer.sanitize(SecurityContext.STYLE, unsafeStyle) || ''; } if (allowSanitizationBypassAndThrow(unsafeStyle, "Style")) { return unwrapSafeValue(unsafeStyle); } return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.renderStringify)(unsafeStyle); } function ɵɵsanitizeUrl(unsafeUrl) { const sanitizer = getSanitizer(); if (sanitizer) { return sanitizer.sanitize(SecurityContext.URL, unsafeUrl) || ''; } if (allowSanitizationBypassAndThrow(unsafeUrl, "URL")) { return unwrapSafeValue(unsafeUrl); } return _sanitizeUrl((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.renderStringify)(unsafeUrl)); } function ɵɵsanitizeResourceUrl(unsafeResourceUrl) { const sanitizer = getSanitizer(); if (sanitizer) { return trustedScriptURLFromStringBypass(sanitizer.sanitize(SecurityContext.RESOURCE_URL, unsafeResourceUrl) || ''); } if (allowSanitizationBypassAndThrow(unsafeResourceUrl, "ResourceURL")) { return trustedScriptURLFromStringBypass(unwrapSafeValue(unsafeResourceUrl)); } throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(904, ngDevMode && `unsafe value used in a resource URL context (see ${_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.XSS_SECURITY_URL})`); } function ɵɵsanitizeScript(unsafeScript) { const sanitizer = getSanitizer(); if (sanitizer) { return trustedScriptFromStringBypass(sanitizer.sanitize(SecurityContext.SCRIPT, unsafeScript) || ''); } if (allowSanitizationBypassAndThrow(unsafeScript, "Script")) { return trustedScriptFromStringBypass(unwrapSafeValue(unsafeScript)); } throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(905, ngDevMode && 'unsafe value used in a script context'); } function ɵɵtrustConstantHtml(html) { if (ngDevMode && (!Array.isArray(html) || !Array.isArray(html.raw) || html.length !== 1)) { throw new Error(`Unexpected interpolation in trusted HTML constant: ${html.join('?')}`); } return trustedHTMLFromString(html[0]); } function ɵɵtrustConstantResourceUrl(url) { if (ngDevMode && (!Array.isArray(url) || !Array.isArray(url.raw) || url.length !== 1)) { throw new Error(`Unexpected interpolation in trusted URL constant: ${url.join('?')}`); } return trustedScriptURLFromString(url[0]); } const SRC_RESOURCE_TAGS = new Set(['embed', 'frame', 'iframe', 'media', 'script']); const HREF_RESOURCE_TAGS = new Set(['base', 'link', 'script']); function getUrlSanitizer(tag, prop) { const isResource = prop === 'src' && SRC_RESOURCE_TAGS.has(tag) || prop === 'href' && HREF_RESOURCE_TAGS.has(tag) || prop === 'xlink:href' && tag === 'script'; return isResource ? ɵɵsanitizeResourceUrl : ɵɵsanitizeUrl; } function ɵɵsanitizeUrlOrResourceUrl(unsafeUrl, tag, prop) { return getUrlSanitizer(tag, prop)(unsafeUrl); } function validateAgainstEventProperties(name) { if (name.toLowerCase().startsWith('on')) { const errorMessage = `Binding to event property '${name}' is disallowed for security reasons, ` + `please use (${name.slice(2)})=...` + `\nIf '${name}' is a directive input, make sure the directive is imported by the` + ` current module.`; throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(306, errorMessage); } } function validateAgainstEventAttributes(name) { if (name.toLowerCase().startsWith('on')) { const errorMessage = `Binding to event attribute '${name}' is disallowed for security reasons, ` + `please use (${name.slice(2)})=...`; throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(306, errorMessage); } } function getSanitizer() { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); return lView && lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ENVIRONMENT].sanitizer; } const attributeName = new Set(['attributename']); const SECURITY_SENSITIVE_ELEMENTS = { 'iframe': new Set(['sandbox', 'allow', 'allowfullscreen', 'referrerpolicy', 'csp', 'fetchpriority']), 'animate': attributeName, 'set': attributeName, 'animatemotion': attributeName, 'animatetransform': attributeName }; function ɵɵvalidateAttribute(value, tagName, attributeName) { const lowerCaseTagName = tagName.toLowerCase(); const lowerCaseAttrName = attributeName.toLowerCase(); if (!SECURITY_SENSITIVE_ELEMENTS[lowerCaseTagName]?.has(lowerCaseAttrName)) { return value; } const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getSelectedTNode)(); if (tNode.type !== 2) { return value; } const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); if (lowerCaseTagName === 'iframe') { const element = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode)(tNode, lView); enforceIframeSecurity(element); } const errorMessage = ngDevMode && `Angular has detected that the \`${attributeName}\` was applied ` + `as a binding to the <${tagName}> element${getTemplateLocationDetails(lView)}. ` + `For security reasons, the \`${attributeName}\` can be set on the <${tagName}> element ` + `as a static attribute only. \n` + `To fix this, switch the \`${attributeName}\` binding to a static attribute ` + `in a template or in host bindings section.`; throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(-910, errorMessage); } const NG_REFLECT_ATTRS_FLAG_DEFAULT = false; const NG_REFLECT_ATTRS_FLAG = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'NG_REFLECT_FLAG' : '', { factory: () => NG_REFLECT_ATTRS_FLAG_DEFAULT }); function provideNgReflectAttributes() { const providers = typeof ngDevMode === 'undefined' || ngDevMode ? [{ provide: NG_REFLECT_ATTRS_FLAG, useValue: true }] : []; return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.makeEnvironmentProviders)(providers); } function normalizeDebugBindingName(name) { name = camelCaseToDashCase(name.replace(/[$@]/g, '_')); return `ng-reflect-${name}`; } const CAMEL_CASE_REGEXP = /([A-Z])/g; function camelCaseToDashCase(input) { return input.replace(CAMEL_CASE_REGEXP, (...m) => '-' + m[1].toLowerCase()); } function normalizeDebugBindingValue(value) { try { return value != null ? value.toString().slice(0, 30) : value; } catch (e) { return '[ERROR] Exception while trying to serialize the value'; } } function ɵɵresolveWindow(element) { return element.ownerDocument.defaultView; } function ɵɵresolveDocument(element) { return element.ownerDocument; } function ɵɵresolveBody(element) { return element.ownerDocument.body; } const INTERPOLATION_DELIMITER = `�`; function maybeUnwrapFn(value) { if (value instanceof Function) { return value(); } else { return value; } } const VALUE_STRING_LENGTH_LIMIT = 200; function assertStandaloneComponentType(type) { assertComponentDef(type); const componentDef = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentDef)(type); if (!componentDef.standalone) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(907, `The ${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(type)} component is not marked as standalone, ` + `but Angular expects to have a standalone component here. ` + `Please make sure the ${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(type)} component does not have ` + `the \`standalone: false\` flag in the decorator.`); } } function assertComponentDef(type) { if (!(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentDef)(type)) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(906, `The ${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(type)} is not an Angular component, ` + `make sure it has the \`@Component\` decorator.`); } } function throwMultipleComponentError(tNode, first, second) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(-300, `Multiple components match node with tagname ${tNode.value}: ` + `${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(first)} and ` + `${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(second)}`); } function throwErrorIfNoChangesMode(creationMode, oldValue, currValue, propName, lView) { const hostComponentDef = getDeclarationComponentDef(lView); const componentClassName = hostComponentDef?.type?.name; const field = propName ? ` for '${propName}'` : ''; let msg = `ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value${field}: '${formatValue(oldValue)}'. Current value: '${formatValue(currValue)}'.${componentClassName ? ` Expression location: ${componentClassName} component` : ''}`; if (creationMode) { msg += ` It seems like the view has been created after its parent and its children have been dirty checked.` + ` Has it been created in a change detection hook?`; } throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(-100, msg); } function formatValue(value) { let strValue = String(value); try { if (Array.isArray(value) || strValue === '[object Object]') { strValue = JSON.stringify(value); } } catch (error) {} return strValue.length > VALUE_STRING_LENGTH_LIMIT ? strValue.substring(0, VALUE_STRING_LENGTH_LIMIT) + '…' : strValue; } function constructDetailsForInterpolation(lView, rootIndex, expressionIndex, meta, changedValue) { const [propName, prefix, ...chunks] = meta.split(INTERPOLATION_DELIMITER); let oldValue = prefix, newValue = prefix; for (let i = 0; i < chunks.length; i++) { const slotIdx = rootIndex + i; oldValue += `${lView[slotIdx]}${chunks[i]}`; newValue += `${slotIdx === expressionIndex ? changedValue : lView[slotIdx]}${chunks[i]}`; } return { propName, oldValue, newValue }; } function getExpressionChangedErrorDetails(lView, bindingIndex, oldValue, newValue) { const tData = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW].data; const metadata = tData[bindingIndex]; if (typeof metadata === 'string') { if (metadata.indexOf(INTERPOLATION_DELIMITER) > -1) { return constructDetailsForInterpolation(lView, bindingIndex, bindingIndex, metadata, newValue); } return { propName: metadata, oldValue, newValue }; } if (metadata === null) { let idx = bindingIndex - 1; while (typeof tData[idx] !== 'string' && tData[idx + 1] === null) { idx--; } const meta = tData[idx]; if (typeof meta === 'string') { const matches = meta.match(new RegExp(INTERPOLATION_DELIMITER, 'g')); if (matches && matches.length - 1 > bindingIndex - idx) { return constructDetailsForInterpolation(lView, idx, bindingIndex, meta, newValue); } } } return { propName: undefined, oldValue, newValue }; } function classIndexOf(className, classToSearch, startingIndex) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNotEqual)(classToSearch, '', 'can not look for "" string.'); let end = className.length; while (true) { const foundIndex = className.indexOf(classToSearch, startingIndex); if (foundIndex === -1) return foundIndex; if (foundIndex === 0 || className.charCodeAt(foundIndex - 1) <= 32) { const length = classToSearch.length; if (foundIndex + length === end || className.charCodeAt(foundIndex + length) <= 32) { return foundIndex; } } startingIndex = foundIndex + 1; } } const NG_TEMPLATE_SELECTOR = 'ng-template'; function isCssClassMatching(tNode, attrs, cssClassToMatch, isProjectionMode) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(cssClassToMatch, cssClassToMatch.toLowerCase(), 'Class name expected to be lowercase.'); let i = 0; if (isProjectionMode) { for (; i < attrs.length && typeof attrs[i] === 'string'; i += 2) { if (attrs[i] === 'class' && classIndexOf(attrs[i + 1].toLowerCase(), cssClassToMatch, 0) !== -1) { return true; } } } else if (isInlineTemplate(tNode)) { return false; } i = attrs.indexOf(1, i); if (i > -1) { let item; while (++i < attrs.length && typeof (item = attrs[i]) === 'string') { if (item.toLowerCase() === cssClassToMatch) { return true; } } } return false; } function isInlineTemplate(tNode) { return tNode.type === 4 && tNode.value !== NG_TEMPLATE_SELECTOR; } function hasTagAndTypeMatch(tNode, currentSelector, isProjectionMode) { const tagNameToCompare = tNode.type === 4 && !isProjectionMode ? NG_TEMPLATE_SELECTOR : tNode.value; return currentSelector === tagNameToCompare; } function isNodeMatchingSelector(tNode, selector, isProjectionMode) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(selector[0], 'Selector should have a tag name'); let mode = 4; const nodeAttrs = tNode.attrs; const nameOnlyMarkerIdx = nodeAttrs !== null ? getNameOnlyMarkerIndex(nodeAttrs) : 0; let skipToNextSelector = false; for (let i = 0; i < selector.length; i++) { const current = selector[i]; if (typeof current === 'number') { if (!skipToNextSelector && !isPositive(mode) && !isPositive(current)) { return false; } if (skipToNextSelector && isPositive(current)) continue; skipToNextSelector = false; mode = current | mode & 1; continue; } if (skipToNextSelector) continue; if (mode & 4) { mode = 2 | mode & 1; if (current !== '' && !hasTagAndTypeMatch(tNode, current, isProjectionMode) || current === '' && selector.length === 1) { if (isPositive(mode)) return false; skipToNextSelector = true; } } else if (mode & 8) { if (nodeAttrs === null || !isCssClassMatching(tNode, nodeAttrs, current, isProjectionMode)) { if (isPositive(mode)) return false; skipToNextSelector = true; } } else { const selectorAttrValue = selector[++i]; const attrIndexInNode = findAttrIndexInNode(current, nodeAttrs, isInlineTemplate(tNode), isProjectionMode); if (attrIndexInNode === -1) { if (isPositive(mode)) return false; skipToNextSelector = true; continue; } if (selectorAttrValue !== '') { let nodeAttrValue; if (attrIndexInNode > nameOnlyMarkerIdx) { nodeAttrValue = ''; } else { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNotEqual)(nodeAttrs[attrIndexInNode], 0, 'We do not match directives on namespaced attributes'); nodeAttrValue = nodeAttrs[attrIndexInNode + 1].toLowerCase(); } if (mode & 2 && selectorAttrValue !== nodeAttrValue) { if (isPositive(mode)) return false; skipToNextSelector = true; } } } } return isPositive(mode) || skipToNextSelector; } function isPositive(mode) { return (mode & 1) === 0; } function findAttrIndexInNode(name, attrs, isInlineTemplate, isProjectionMode) { if (attrs === null) return -1; let i = 0; if (isProjectionMode || !isInlineTemplate) { let bindingsMode = false; while (i < attrs.length) { const maybeAttrName = attrs[i]; if (maybeAttrName === name) { return i; } else if (maybeAttrName === 3 || maybeAttrName === 6) { bindingsMode = true; } else if (maybeAttrName === 1 || maybeAttrName === 2) { let value = attrs[++i]; while (typeof value === 'string') { value = attrs[++i]; } continue; } else if (maybeAttrName === 4) { break; } else if (maybeAttrName === 0) { i += 4; continue; } i += bindingsMode ? 1 : 2; } return -1; } else { return matchTemplateAttribute(attrs, name); } } function isNodeMatchingSelectorList(tNode, selector, isProjectionMode = false) { for (let i = 0; i < selector.length; i++) { if (isNodeMatchingSelector(tNode, selector[i], isProjectionMode)) { return true; } } return false; } function getProjectAsAttrValue(tNode) { const nodeAttrs = tNode.attrs; if (nodeAttrs != null) { const ngProjectAsAttrIdx = nodeAttrs.indexOf(5); if ((ngProjectAsAttrIdx & 1) === 0) { return nodeAttrs[ngProjectAsAttrIdx + 1]; } } return null; } function getNameOnlyMarkerIndex(nodeAttrs) { for (let i = 0; i < nodeAttrs.length; i++) { const nodeAttr = nodeAttrs[i]; if (isNameOnlyAttributeMarker(nodeAttr)) { return i; } } return nodeAttrs.length; } function matchTemplateAttribute(attrs, name) { let i = attrs.indexOf(4); if (i > -1) { i++; while (i < attrs.length) { const attr = attrs[i]; if (typeof attr === 'number') return -1; if (attr === name) return i; i++; } } return -1; } function isSelectorInSelectorList(selector, list) { selectorListLoop: for (let i = 0; i < list.length; i++) { const currentSelectorInList = list[i]; if (selector.length !== currentSelectorInList.length) { continue; } for (let j = 0; j < selector.length; j++) { if (selector[j] !== currentSelectorInList[j]) { continue selectorListLoop; } } return true; } return false; } function maybeWrapInNotSelector(isNegativeMode, chunk) { return isNegativeMode ? ':not(' + chunk.trim() + ')' : chunk; } function stringifyCSSSelector(selector) { let result = selector[0]; let i = 1; let mode = 2; let currentChunk = ''; let isNegativeMode = false; while (i < selector.length) { let valueOrMarker = selector[i]; if (typeof valueOrMarker === 'string') { if (mode & 2) { const attrValue = selector[++i]; currentChunk += '[' + valueOrMarker + (attrValue.length > 0 ? '="' + attrValue + '"' : '') + ']'; } else if (mode & 8) { currentChunk += '.' + valueOrMarker; } else if (mode & 4) { currentChunk += ' ' + valueOrMarker; } } else { if (currentChunk !== '' && !isPositive(valueOrMarker)) { result += maybeWrapInNotSelector(isNegativeMode, currentChunk); currentChunk = ''; } mode = valueOrMarker; isNegativeMode = isNegativeMode || !isPositive(mode); } i++; } if (currentChunk !== '') { result += maybeWrapInNotSelector(isNegativeMode, currentChunk); } return result; } function stringifyCSSSelectorList(selectorList) { return selectorList.map(stringifyCSSSelector).join(','); } function extractAttrsAndClassesFromSelector(selector) { const attrs = []; const classes = []; let i = 1; let mode = 2; while (i < selector.length) { let valueOrMarker = selector[i]; if (typeof valueOrMarker === 'string') { if (mode === 2) { if (valueOrMarker !== '') { attrs.push(valueOrMarker, selector[++i]); } } else if (mode === 8) { classes.push(valueOrMarker); } } else { if (!isPositive(mode)) break; mode = valueOrMarker; } i++; } if (classes.length) { attrs.push(1, ...classes); } return attrs; } const NO_CHANGE = typeof ngDevMode === 'undefined' || ngDevMode ? { __brand__: 'NO_CHANGE' } : {}; function createTView(type, declTNode, templateFn, decls, vars, directives, pipes, viewQuery, schemas, constsOrFactory, ssrId) { const bindingStartIndex = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET + decls; const initialViewLength = bindingStartIndex + vars; const blueprint = createViewBlueprint(bindingStartIndex, initialViewLength); const consts = typeof constsOrFactory === 'function' ? constsOrFactory() : constsOrFactory; const tView = blueprint[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW] = { type: type, blueprint: blueprint, template: templateFn, queries: null, viewQuery: viewQuery, declTNode: declTNode, data: blueprint.slice().fill(null, bindingStartIndex), bindingStartIndex: bindingStartIndex, expandoStartIndex: initialViewLength, hostBindingOpCodes: null, firstCreatePass: true, firstUpdatePass: true, staticViewQueries: false, staticContentQueries: false, preOrderHooks: null, preOrderCheckHooks: null, contentHooks: null, contentCheckHooks: null, viewHooks: null, viewCheckHooks: null, destroyHooks: null, cleanup: null, contentQueries: null, components: null, directiveRegistry: typeof directives === 'function' ? directives() : directives, pipeRegistry: typeof pipes === 'function' ? pipes() : pipes, firstChild: null, schemas: schemas, consts: consts, incompleteFirstPass: false, ssrId }; if (ngDevMode) { Object.seal(tView); } return tView; } function createViewBlueprint(bindingStartIndex, initialViewLength) { const blueprint = []; for (let i = 0; i < initialViewLength; i++) { blueprint.push(i < bindingStartIndex ? null : NO_CHANGE); } return blueprint; } function getOrCreateComponentTView(def) { const tView = def.tView; if (tView === null || tView.incompleteFirstPass) { const declTNode = null; return def.tView = createTView(1, declTNode, def.template, def.decls, def.vars, def.directiveDefs, def.pipeDefs, def.viewQuery, def.schemas, def.consts, def.id); } return tView; } function createLView(parentLView, tView, context, flags, host, tHostNode, environment, renderer, injector, embeddedViewInjector, hydrationInfo) { const lView = tView.blueprint.slice(); lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HOST] = host; lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] = flags | 4 | 128 | 8 | 64 | 1024; if (embeddedViewInjector !== null || parentLView && parentLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] & 2048) { lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] |= 2048; } (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.resetPreOrderHookFlags)(lView); ngDevMode && tView.declTNode && parentLView && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertTNodeForLView)(tView.declTNode, parentLView); lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PARENT] = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_VIEW] = parentLView; lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT] = context; lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ENVIRONMENT] = environment || parentLView && parentLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ENVIRONMENT]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ENVIRONMENT], 'LViewEnvironment is required'); lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER] = renderer || parentLView && parentLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER], 'Renderer is required'); lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1] = injector || parentLView && parentLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1] || null; lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.T_HOST] = tHostNode; lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ID] = getUniqueLViewId(); lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HYDRATION] = hydrationInfo; lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMBEDDED_VIEW_INJECTOR] = embeddedViewInjector; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(tView.type == 2 ? parentLView !== null : true, true, 'Embedded views must have parentLView'); lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_COMPONENT_VIEW] = tView.type == 2 ? parentLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_COMPONENT_VIEW] : lView; return lView; } function createComponentLView(lView, hostTNode, def) { const native = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode)(hostTNode, lView); const tView = getOrCreateComponentTView(def); const rendererFactory = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ENVIRONMENT].rendererFactory; const componentView = addToEndOfViewTree(lView, createLView(lView, tView, null, getInitialLViewFlagsFromDef(def), native, hostTNode, null, rendererFactory.createRenderer(native, def), null, null, null)); return lView[hostTNode.index] = componentView; } function getInitialLViewFlagsFromDef(def) { let flags = 16; if (def.signals) { flags = 4096; } else if (def.onPush) { flags = 64; } return flags; } function allocExpando(tView, lView, numSlotsToAlloc, initialValue) { if (numSlotsToAlloc === 0) return -1; if (ngDevMode) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertFirstCreatePass)(tView); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertSame)(tView, lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], '`LView` must be associated with `TView`!'); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(tView.data.length, lView.length, 'Expecting LView to be same size as TView'); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(tView.data.length, tView.blueprint.length, 'Expecting Blueprint to be same size as TView'); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertFirstUpdatePass)(tView); } const allocIdx = lView.length; for (let i = 0; i < numSlotsToAlloc; i++) { lView.push(initialValue); tView.blueprint.push(initialValue); tView.data.push(null); } return allocIdx; } function addToEndOfViewTree(lView, lViewOrLContainer) { if (lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CHILD_HEAD]) { lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CHILD_TAIL][_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NEXT] = lViewOrLContainer; } else { lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CHILD_HEAD] = lViewOrLContainer; } lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CHILD_TAIL] = lViewOrLContainer; return lViewOrLContainer; } function ɵɵadvance(delta = 1) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertGreaterThan)(delta, 0, 'Can only advance forward'); selectIndexInternal((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTView)(), (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(), (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getSelectedIndex)() + delta, !!ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isInCheckNoChangesMode)()); } function selectIndexInternal(tView, lView, index, checkNoChangesMode) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertIndexInDeclRange)(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], index); if (!checkNoChangesMode) { const hooksInitPhaseCompleted = (lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] & 3) === 3; if (hooksInitPhaseCompleted) { const preOrderCheckHooks = tView.preOrderCheckHooks; if (preOrderCheckHooks !== null) { executeCheckHooks(lView, preOrderCheckHooks, index); } } else { const preOrderHooks = tView.preOrderHooks; if (preOrderHooks !== null) { executeInitAndCheckHooks(lView, preOrderHooks, 0, index); } } } (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setSelectedIndex)(index); } var InputFlags; (function (InputFlags) { InputFlags[InputFlags["None"] = 0] = "None"; InputFlags[InputFlags["SignalBased"] = 1] = "SignalBased"; InputFlags[InputFlags["HasDecoratorInputTransform"] = 2] = "HasDecoratorInputTransform"; })(InputFlags || (InputFlags = {})); function writeToDirectiveInput(def, instance, publicName, value) { const prevConsumer = (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(null); try { if (ngDevMode) { if (!def.inputs.hasOwnProperty(publicName)) { throw new Error(`ASSERTION ERROR: Directive ${def.type.name} does not have an input with a public name of "${publicName}"`); } if (instance instanceof NodeInjectorFactory) { throw new Error(`ASSERTION ERROR: Cannot write input to factory for type ${def.type.name}. Directive has not been created yet.`); } } const [privateName, flags, transform] = def.inputs[publicName]; let inputSignalNode = null; if ((flags & InputFlags.SignalBased) !== 0) { const field = instance[privateName]; inputSignalNode = field[_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.SIGNAL]; } if (inputSignalNode !== null && inputSignalNode.transformFn !== undefined) { value = inputSignalNode.transformFn(value); } else if (transform !== null) { value = transform.call(instance, value); } if (def.setInput !== null) { def.setInput(instance, inputSignalNode, value, publicName, privateName); } else { applyValueToInputField(instance, inputSignalNode, privateName, value); } } finally { (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(prevConsumer); } } var RendererStyleFlags2; (function (RendererStyleFlags2) { RendererStyleFlags2[RendererStyleFlags2["Important"] = 1] = "Important"; RendererStyleFlags2[RendererStyleFlags2["DashCase"] = 2] = "DashCase"; })(RendererStyleFlags2 || (RendererStyleFlags2 = {})); let _icuContainerIterate; function icuContainerIterate(tIcuContainerNode, lView) { return _icuContainerIterate(tIcuContainerNode, lView); } function ensureIcuContainerVisitorLoaded(loader) { if (_icuContainerIterate === undefined) { _icuContainerIterate = loader(); } } function parseCssTimeUnitsToMs(value) { if (!value) return 0; const multiplier = value.toLowerCase().indexOf('ms') > -1 ? 1 : 1000; return parseFloat(value) * multiplier; } function parseCssPropertyValue(computedStyle, name) { const value = computedStyle.getPropertyValue(name); return value.split(',').map(part => part.trim()); } function getLongestComputedTransition(computedStyle) { const transitionedProperties = parseCssPropertyValue(computedStyle, 'transition-property'); const rawDurations = parseCssPropertyValue(computedStyle, 'transition-duration'); const rawDelays = parseCssPropertyValue(computedStyle, 'transition-delay'); const longest = { propertyName: '', duration: 0, animationName: undefined }; for (let i = 0; i < transitionedProperties.length; i++) { const duration = parseCssTimeUnitsToMs(rawDelays[i]) + parseCssTimeUnitsToMs(rawDurations[i]); if (duration > longest.duration) { longest.propertyName = transitionedProperties[i]; longest.duration = duration; } } return longest; } function getLongestComputedAnimation(computedStyle) { const rawNames = parseCssPropertyValue(computedStyle, 'animation-name'); const rawDelays = parseCssPropertyValue(computedStyle, 'animation-delay'); const rawDurations = parseCssPropertyValue(computedStyle, 'animation-duration'); const longest = { animationName: '', propertyName: undefined, duration: 0 }; for (let i = 0; i < rawNames.length; i++) { const duration = parseCssTimeUnitsToMs(rawDelays[i]) + parseCssTimeUnitsToMs(rawDurations[i]); if (duration > longest.duration) { longest.animationName = rawNames[i]; longest.duration = duration; } } return longest; } function isShorterThanExistingAnimation(existing, longest) { return existing !== undefined && existing.duration > longest.duration; } function longestExists(longest) { return (longest.animationName != undefined || longest.propertyName != undefined) && longest.duration > 0; } function determineLongestAnimationFromComputedStyles(el, animationsMap) { const computedStyle = getComputedStyle(el); const longestAnimation = getLongestComputedAnimation(computedStyle); const longestTransition = getLongestComputedTransition(computedStyle); const longest = longestAnimation.duration > longestTransition.duration ? longestAnimation : longestTransition; if (isShorterThanExistingAnimation(animationsMap.get(el), longest)) return; if (longestExists(longest)) { animationsMap.set(el, longest); } } function determineLongestAnimation(el, animationsMap, areAnimationSupported) { if (!areAnimationSupported) return; const animations = el.getAnimations(); return animations.length === 0 ? determineLongestAnimationFromComputedStyles(el, animationsMap) : determineLongestAnimationFromElementAnimations(el, animationsMap, animations); } function determineLongestAnimationFromElementAnimations(el, animationsMap, animations) { let longest = { animationName: undefined, propertyName: undefined, duration: 0 }; for (const animation of animations) { const timing = animation.effect?.getTiming(); const animDuration = typeof timing?.duration === 'number' ? timing.duration : 0; let duration = (timing?.delay ?? 0) + animDuration; let propertyName; let animationName; if (animation.animationName) { animationName = animation.animationName; } else { propertyName = animation.transitionProperty; } if (duration >= longest.duration) { longest = { animationName, propertyName, duration }; } } if (isShorterThanExistingAnimation(animationsMap.get(el), longest)) return; if (longestExists(longest)) { animationsMap.set(el, longest); } } const allLeavingAnimations = new Set(); var TracingAction; (function (TracingAction) { TracingAction[TracingAction["CHANGE_DETECTION"] = 0] = "CHANGE_DETECTION"; TracingAction[TracingAction["AFTER_NEXT_RENDER"] = 1] = "AFTER_NEXT_RENDER"; })(TracingAction || (TracingAction = {})); const TracingService = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'TracingService' : ''); const markedFeatures = new Set(); function performanceMarkFeature(feature) { if (markedFeatures.has(feature)) { return; } markedFeatures.add(feature); performance?.mark?.('mark_feature_usage', { detail: { feature } }); } class AfterRenderManager { impl = null; execute() { this.impl?.execute(); } static ɵprov = /* @__PURE__ */ (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ token: AfterRenderManager, providedIn: 'root', factory: () => new AfterRenderManager() }); } const AFTER_RENDER_PHASES = /* @__PURE__ **/(() => [0, 1, 2, 3])(); class AfterRenderImpl { ngZone = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgZone); scheduler = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ChangeDetectionScheduler); errorHandler = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ErrorHandler, { optional: true }); sequences = new Set(); deferredRegistrations = new Set(); executing = false; constructor() { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(TracingService, { optional: true }); } execute() { const hasSequencesToExecute = this.sequences.size > 0; if (hasSequencesToExecute) { profiler(ProfilerEvent.AfterRenderHooksStart); } this.executing = true; for (const phase of AFTER_RENDER_PHASES) { for (const sequence of this.sequences) { if (sequence.erroredOrDestroyed || !sequence.hooks[phase]) { continue; } try { sequence.pipelinedValue = this.ngZone.runOutsideAngular(() => this.maybeTrace(() => { const hookFn = sequence.hooks[phase]; const value = hookFn(sequence.pipelinedValue); return value; }, sequence.snapshot)); } catch (err) { sequence.erroredOrDestroyed = true; this.errorHandler?.handleError(err); } } } this.executing = false; for (const sequence of this.sequences) { sequence.afterRun(); if (sequence.once) { this.sequences.delete(sequence); sequence.destroy(); } } for (const sequence of this.deferredRegistrations) { this.sequences.add(sequence); } if (this.deferredRegistrations.size > 0) { this.scheduler.notify(7); } this.deferredRegistrations.clear(); if (hasSequencesToExecute) { profiler(ProfilerEvent.AfterRenderHooksEnd); } } register(sequence) { const { view } = sequence; if (view !== undefined) { (view[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.AFTER_RENDER_SEQUENCES_TO_ADD] ??= []).push(sequence); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.markAncestorsForTraversal)(view); view[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] |= 8192; } else if (!this.executing) { this.addSequence(sequence); } else { this.deferredRegistrations.add(sequence); } } addSequence(sequence) { this.sequences.add(sequence); this.scheduler.notify(7); } unregister(sequence) { if (this.executing && this.sequences.has(sequence)) { sequence.erroredOrDestroyed = true; sequence.pipelinedValue = undefined; sequence.once = true; } else { this.sequences.delete(sequence); this.deferredRegistrations.delete(sequence); } } maybeTrace(fn, snapshot) { return snapshot ? snapshot.run(TracingAction.AFTER_NEXT_RENDER, fn) : fn(); } static ɵprov = /* @__PURE__ */ (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ token: AfterRenderImpl, providedIn: 'root', factory: () => new AfterRenderImpl() }); } class AfterRenderSequence { impl; hooks; view; once; snapshot; erroredOrDestroyed = false; pipelinedValue = undefined; unregisterOnDestroy; constructor(impl, hooks, view, once, destroyRef, snapshot = null) { this.impl = impl; this.hooks = hooks; this.view = view; this.once = once; this.snapshot = snapshot; this.unregisterOnDestroy = destroyRef?.onDestroy(() => this.destroy()); } afterRun() { this.erroredOrDestroyed = false; this.pipelinedValue = undefined; this.snapshot?.dispose(); this.snapshot = null; } destroy() { this.impl.unregister(this); this.unregisterOnDestroy?.(); const scheduled = this.view?.[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.AFTER_RENDER_SEQUENCES_TO_ADD]; if (scheduled) { this.view[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.AFTER_RENDER_SEQUENCES_TO_ADD] = scheduled.filter(s => s !== this); } } } function afterEveryRender(callbackOrSpec, options) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNotInReactiveContext)(afterEveryRender, 'Call `afterEveryRender` outside of a reactive context. For example, schedule the render ' + 'callback inside the component constructor`.'); if (ngDevMode && !options?.injector) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertInInjectionContext)(afterEveryRender); } const injector = options?.injector ?? (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.Injector); if (typeof ngServerMode !== 'undefined' && ngServerMode) { return NOOP_AFTER_RENDER_REF; } performanceMarkFeature('NgAfterRender'); return afterEveryRenderImpl(callbackOrSpec, injector, options, false); } function afterNextRender(callbackOrSpec, options) { if (ngDevMode && !options?.injector) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertInInjectionContext)(afterNextRender); } const injector = options?.injector ?? (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.Injector); if (typeof ngServerMode !== 'undefined' && ngServerMode) { return NOOP_AFTER_RENDER_REF; } performanceMarkFeature('NgAfterNextRender'); return afterEveryRenderImpl(callbackOrSpec, injector, options, true); } function getHooks(callbackOrSpec) { if (callbackOrSpec instanceof Function) { return [undefined, undefined, callbackOrSpec, undefined]; } else { return [callbackOrSpec.earlyRead, callbackOrSpec.write, callbackOrSpec.mixedReadWrite, callbackOrSpec.read]; } } function afterEveryRenderImpl(callbackOrSpec, injector, options, once) { const manager = injector.get(AfterRenderManager); manager.impl ??= injector.get(AfterRenderImpl); const tracing = injector.get(TracingService, null, { optional: true }); const destroyRef = options?.manualCleanup !== true ? injector.get(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DestroyRef) : null; const viewContext = injector.get(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ViewContext, null, { optional: true }); const sequence = new AfterRenderSequence(manager.impl, getHooks(callbackOrSpec), viewContext?.view, once, destroyRef, tracing?.snapshot(null)); manager.impl.register(sequence); return sequence; } const NOOP_AFTER_RENDER_REF = { destroy() {} }; const ANIMATION_QUEUE = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'AnimationQueue' : '', { factory: () => { return { queue: new Set(), isScheduled: false, scheduler: null, injector: (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EnvironmentInjector) }; } }); function addToAnimationQueue(injector, animationFns, animationData) { const animationQueue = injector.get(ANIMATION_QUEUE); if (Array.isArray(animationFns)) { for (const animateFn of animationFns) { animationQueue.queue.add(animateFn); animationData?.detachedLeaveAnimationFns?.push(animateFn); } } else { animationQueue.queue.add(animationFns); animationData?.detachedLeaveAnimationFns?.push(animationFns); } animationQueue.scheduler && animationQueue.scheduler(injector); } function removeFromAnimationQueue(injector, animationData) { const animationQueue = injector.get(ANIMATION_QUEUE); if (animationData.detachedLeaveAnimationFns) { for (const animationFn of animationData.detachedLeaveAnimationFns) { animationQueue.queue.delete(animationFn); } animationData.detachedLeaveAnimationFns = undefined; } } function scheduleAnimationQueue(injector) { const animationQueue = injector.get(ANIMATION_QUEUE); if (!animationQueue.isScheduled) { afterNextRender(() => { animationQueue.isScheduled = false; for (let animateFn of animationQueue.queue) { animateFn(); } animationQueue.queue.clear(); }, { injector: animationQueue.injector }); animationQueue.isScheduled = true; } } function initializeAnimationQueueScheduler(injector) { const animationQueue = injector.get(ANIMATION_QUEUE); animationQueue.scheduler = scheduleAnimationQueue; animationQueue.scheduler(injector); } function queueEnterAnimations(injector, enterAnimations) { for (const [_, nodeAnimations] of enterAnimations) { addToAnimationQueue(injector, nodeAnimations.animateFns); } } function maybeQueueEnterAnimation(parentLView, parent, tNode, injector) { const enterAnimations = parentLView?.[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ANIMATIONS]?.enter; if (parent !== null && enterAnimations && enterAnimations.has(tNode.index)) { queueEnterAnimations(injector, enterAnimations); } } function applyToElementOrContainer(action, renderer, injector, parent, lNodeToHandle, tNode, beforeNode, parentLView) { if (lNodeToHandle != null) { let lContainer; let isComponent = false; if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLContainer)(lNodeToHandle)) { lContainer = lNodeToHandle; } else if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLView)(lNodeToHandle)) { isComponent = true; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(lNodeToHandle[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HOST], 'HOST must be defined for a component LView'); lNodeToHandle = lNodeToHandle[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HOST]; } const rNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(lNodeToHandle); if (action === 0 && parent !== null) { maybeQueueEnterAnimation(parentLView, parent, tNode, injector); if (beforeNode == null) { nativeAppendChild(renderer, parent, rNode); } else { nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true); } } else if (action === 1 && parent !== null) { maybeQueueEnterAnimation(parentLView, parent, tNode, injector); nativeInsertBefore(renderer, parent, rNode, beforeNode || null, true); } else if (action === 2) { runLeaveAnimationsWithCallback(parentLView, tNode, injector, nodeHasLeaveAnimations => { nativeRemoveNode(renderer, rNode, isComponent, nodeHasLeaveAnimations); }); } else if (action === 3) { runLeaveAnimationsWithCallback(parentLView, tNode, injector, () => { renderer.destroyNode(rNode); }); } if (lContainer != null) { applyContainer(renderer, action, injector, lContainer, tNode, parent, beforeNode); } } } function removeViewFromDOM(tView, lView) { detachViewFromDOM(tView, lView); lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HOST] = null; lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.T_HOST] = null; } function addViewToDOM(tView, parentTNode, renderer, lView, parentNativeNode, beforeNode) { lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HOST] = parentNativeNode; lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.T_HOST] = parentTNode; applyView(tView, lView, renderer, 1, parentNativeNode, beforeNode); } function detachViewFromDOM(tView, lView) { lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ENVIRONMENT].changeDetectionScheduler?.notify(9); applyView(tView, lView, lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER], 2, null, null); } function destroyViewTree(rootView) { let lViewOrLContainer = rootView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CHILD_HEAD]; if (!lViewOrLContainer) { return cleanUpView(rootView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], rootView); } while (lViewOrLContainer) { let next = null; if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLView)(lViewOrLContainer)) { next = lViewOrLContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CHILD_HEAD]; } else { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLContainer)(lViewOrLContainer); const firstView = lViewOrLContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET]; if (firstView) next = firstView; } if (!next) { while (lViewOrLContainer && !lViewOrLContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NEXT] && lViewOrLContainer !== rootView) { if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLView)(lViewOrLContainer)) { cleanUpView(lViewOrLContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], lViewOrLContainer); } lViewOrLContainer = lViewOrLContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PARENT]; } if (lViewOrLContainer === null) lViewOrLContainer = rootView; if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLView)(lViewOrLContainer)) { cleanUpView(lViewOrLContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], lViewOrLContainer); } next = lViewOrLContainer && lViewOrLContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NEXT]; } lViewOrLContainer = next; } } function detachMovedView(declarationContainer, lView) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLContainer)(declarationContainer); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(declarationContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.MOVED_VIEWS], 'A projected view should belong to a non-empty projected views collection'); const movedViews = declarationContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.MOVED_VIEWS]; const declarationViewIndex = movedViews.indexOf(lView); movedViews.splice(declarationViewIndex, 1); } function destroyLView(tView, lView) { if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isDestroyed)(lView)) { return; } const renderer = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER]; if (renderer.destroyNode) { applyView(tView, lView, renderer, 3, null, null); } destroyViewTree(lView); } function cleanUpView(tView, lView) { if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isDestroyed)(lView)) { return; } const prevConsumer = (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(null); try { lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] &= ~128; lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] |= 256; lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.REACTIVE_TEMPLATE_CONSUMER] && (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.consumerDestroy)(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.REACTIVE_TEMPLATE_CONSUMER]); executeOnDestroys(tView, lView); processCleanups(tView, lView); if (lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW].type === 1) { lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER].destroy(); } const declarationContainer = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_LCONTAINER]; if (declarationContainer !== null && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLContainer)(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PARENT])) { if (declarationContainer !== lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PARENT]) { detachMovedView(declarationContainer, lView); } const lQueries = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.QUERIES]; if (lQueries !== null) { lQueries.detachView(tView); } } unregisterLView(lView); } finally { (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(prevConsumer); } } function runLeaveAnimationsWithCallback(lView, tNode, injector, callback) { const animations = lView?.[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ANIMATIONS]; if (animations == null || animations.leave == undefined || !animations.leave.has(tNode.index)) return callback(false); if (lView) allLeavingAnimations.add(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ID]); addToAnimationQueue(injector, () => { if (animations.leave && animations.leave.has(tNode.index)) { const leaveAnimationMap = animations.leave; const leaveAnimations = leaveAnimationMap.get(tNode.index); const runningAnimations = []; if (leaveAnimations) { for (let index = 0; index < leaveAnimations.animateFns.length; index++) { const animationFn = leaveAnimations.animateFns[index]; const { promise } = animationFn(); runningAnimations.push(promise); } animations.detachedLeaveAnimationFns = undefined; } animations.running = Promise.allSettled(runningAnimations); runAfterLeaveAnimations(lView, callback); } else { if (lView) allLeavingAnimations.delete(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ID]); callback(false); } }, animations); } function runAfterLeaveAnimations(lView, callback) { const runningAnimations = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ANIMATIONS]?.running; if (runningAnimations) { runningAnimations.then(() => { lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ANIMATIONS].running = undefined; allLeavingAnimations.delete(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ID]); callback(true); }); return; } callback(false); } function processCleanups(tView, lView) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNotReactive)(processCleanups.name); const tCleanup = tView.cleanup; const lCleanup = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CLEANUP]; if (tCleanup !== null) { for (let i = 0; i < tCleanup.length - 1; i += 2) { if (typeof tCleanup[i] === 'string') { const targetIdx = tCleanup[i + 3]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNumber)(targetIdx, 'cleanup target must be a number'); if (targetIdx >= 0) { lCleanup[targetIdx](); } else { lCleanup[-targetIdx].unsubscribe(); } i += 2; } else { const context = lCleanup[tCleanup[i + 1]]; tCleanup[i].call(context); } } } if (lCleanup !== null) { lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CLEANUP] = null; } const destroyHooks = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ON_DESTROY_HOOKS]; if (destroyHooks !== null) { lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ON_DESTROY_HOOKS] = null; for (let i = 0; i < destroyHooks.length; i++) { const destroyHooksFn = destroyHooks[i]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertFunction)(destroyHooksFn, 'Expecting destroy hook to be a function.'); destroyHooksFn(); } } const effects = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EFFECTS]; if (effects !== null) { lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EFFECTS] = null; for (const effect of effects) { effect.destroy(); } } } function executeOnDestroys(tView, lView) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNotReactive)(executeOnDestroys.name); let destroyHooks; if (tView != null && (destroyHooks = tView.destroyHooks) != null) { for (let i = 0; i < destroyHooks.length; i += 2) { const context = lView[destroyHooks[i]]; if (!(context instanceof NodeInjectorFactory)) { const toCall = destroyHooks[i + 1]; if (Array.isArray(toCall)) { for (let j = 0; j < toCall.length; j += 2) { const callContext = context[toCall[j]]; const hook = toCall[j + 1]; profiler(ProfilerEvent.LifecycleHookStart, callContext, hook); try { hook.call(callContext); } finally { profiler(ProfilerEvent.LifecycleHookEnd, callContext, hook); } } } else { profiler(ProfilerEvent.LifecycleHookStart, context, toCall); try { toCall.call(context); } finally { profiler(ProfilerEvent.LifecycleHookEnd, context, toCall); } } } } } } function getParentRElement(tView, tNode, lView) { return getClosestRElement(tView, tNode.parent, lView); } function getClosestRElement(tView, tNode, lView) { let parentTNode = tNode; while (parentTNode !== null && parentTNode.type & (8 | 32 | 128)) { tNode = parentTNode; parentTNode = tNode.parent; } if (parentTNode === null) { return lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HOST]; } else { ngDevMode && assertTNodeType(parentTNode, 3 | 4); if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isComponentHost)(parentTNode)) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertTNodeForLView)(parentTNode, lView); const { encapsulation } = tView.data[parentTNode.directiveStart + parentTNode.componentOffset]; if (encapsulation === ViewEncapsulation.None || encapsulation === ViewEncapsulation.Emulated) { return null; } } return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode)(parentTNode, lView); } } function getInsertInFrontOfRNode(parentTNode, currentTNode, lView) { return _getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView); } function getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView) { if (parentTNode.type & (8 | 32)) { return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode)(parentTNode, lView); } return null; } let _getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithNoI18n; let _processI18nInsertBefore; function setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore) { _getInsertInFrontOfRNodeWithI18n = getInsertInFrontOfRNodeWithI18n; _processI18nInsertBefore = processI18nInsertBefore; } function appendChild(tView, lView, childRNode, childTNode) { const parentRNode = getParentRElement(tView, childTNode, lView); const renderer = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER]; const parentTNode = childTNode.parent || lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.T_HOST]; const anchorNode = getInsertInFrontOfRNode(parentTNode, childTNode, lView); if (parentRNode != null) { if (Array.isArray(childRNode)) { for (let i = 0; i < childRNode.length; i++) { nativeAppendOrInsertBefore(renderer, parentRNode, childRNode[i], anchorNode, false); } } else { nativeAppendOrInsertBefore(renderer, parentRNode, childRNode, anchorNode, false); } } _processI18nInsertBefore !== undefined && _processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRNode); } function getFirstNativeNode(lView, tNode) { if (tNode !== null) { ngDevMode && assertTNodeType(tNode, 3 | 12 | 32 | 16 | 128); const tNodeType = tNode.type; if (tNodeType & 3) { return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode)(tNode, lView); } else if (tNodeType & 4) { return getBeforeNodeForView(-1, lView[tNode.index]); } else if (tNodeType & 8) { const elIcuContainerChild = tNode.child; if (elIcuContainerChild !== null) { return getFirstNativeNode(lView, elIcuContainerChild); } else { const rNodeOrLContainer = lView[tNode.index]; if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLContainer)(rNodeOrLContainer)) { return getBeforeNodeForView(-1, rNodeOrLContainer); } else { return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(rNodeOrLContainer); } } } else if (tNodeType & 128) { return getFirstNativeNode(lView, tNode.next); } else if (tNodeType & 32) { let nextRNode = icuContainerIterate(tNode, lView); let rNode = nextRNode(); return rNode || (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(lView[tNode.index]); } else { const projectionNodes = getProjectionNodes(lView, tNode); if (projectionNodes !== null) { if (Array.isArray(projectionNodes)) { return projectionNodes[0]; } const parentView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLViewParent)(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_COMPONENT_VIEW]); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertParentView)(parentView); return getFirstNativeNode(parentView, projectionNodes); } else { return getFirstNativeNode(lView, tNode.next); } } } return null; } function getProjectionNodes(lView, tNode) { if (tNode !== null) { const componentView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_COMPONENT_VIEW]; const componentHost = componentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.T_HOST]; const slotIdx = tNode.projection; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertProjectionSlots)(lView); return componentHost.projection[slotIdx]; } return null; } function getBeforeNodeForView(viewIndexInContainer, lContainer) { const nextViewIndex = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET + viewIndexInContainer + 1; if (nextViewIndex < lContainer.length) { const lView = lContainer[nextViewIndex]; const firstTNodeOfView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW].firstChild; if (firstTNodeOfView !== null) { return getFirstNativeNode(lView, firstTNodeOfView); } } return lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NATIVE]; } function applyNodes(renderer, action, tNode, lView, parentRElement, beforeNode, isProjection) { while (tNode != null) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertTNodeForLView)(tNode, lView); const injector = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]; if (tNode.type === 128) { tNode = tNode.next; continue; } ngDevMode && assertTNodeType(tNode, 3 | 12 | 16 | 32); const rawSlotValue = lView[tNode.index]; const tNodeType = tNode.type; if (isProjection) { if (action === 0) { rawSlotValue && attachPatchData((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(rawSlotValue), lView); tNode.flags |= 2; } } if (!isDetachedByI18n(tNode)) { if (tNodeType & 8) { applyNodes(renderer, action, tNode.child, lView, parentRElement, beforeNode, false); applyToElementOrContainer(action, renderer, injector, parentRElement, rawSlotValue, tNode, beforeNode, lView); } else if (tNodeType & 32) { const nextRNode = icuContainerIterate(tNode, lView); let rNode; while (rNode = nextRNode()) { applyToElementOrContainer(action, renderer, injector, parentRElement, rNode, tNode, beforeNode, lView); } applyToElementOrContainer(action, renderer, injector, parentRElement, rawSlotValue, tNode, beforeNode, lView); } else if (tNodeType & 16) { applyProjectionRecursive(renderer, action, lView, tNode, parentRElement, beforeNode); } else { ngDevMode && assertTNodeType(tNode, 3 | 4); applyToElementOrContainer(action, renderer, injector, parentRElement, rawSlotValue, tNode, beforeNode, lView); } } tNode = isProjection ? tNode.projectionNext : tNode.next; } } function applyView(tView, lView, renderer, action, parentRElement, beforeNode) { applyNodes(renderer, action, tView.firstChild, lView, parentRElement, beforeNode, false); } function applyProjection(tView, lView, tProjectionNode) { const renderer = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER]; const parentRNode = getParentRElement(tView, tProjectionNode, lView); const parentTNode = tProjectionNode.parent || lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.T_HOST]; let beforeNode = getInsertInFrontOfRNode(parentTNode, tProjectionNode, lView); applyProjectionRecursive(renderer, 0, lView, tProjectionNode, parentRNode, beforeNode); } function applyProjectionRecursive(renderer, action, lView, tProjectionNode, parentRElement, beforeNode) { const componentLView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_COMPONENT_VIEW]; const componentNode = componentLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.T_HOST]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(typeof tProjectionNode.projection, 'number', 'expecting projection index'); const nodeToProjectOrRNodes = componentNode.projection[tProjectionNode.projection]; if (Array.isArray(nodeToProjectOrRNodes)) { for (let i = 0; i < nodeToProjectOrRNodes.length; i++) { const rNode = nodeToProjectOrRNodes[i]; applyToElementOrContainer(action, renderer, lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1], parentRElement, rNode, tProjectionNode, beforeNode, lView); } } else { let nodeToProject = nodeToProjectOrRNodes; const projectedComponentLView = componentLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PARENT]; if (hasInSkipHydrationBlockFlag(tProjectionNode)) { nodeToProject.flags |= 128; } applyNodes(renderer, action, nodeToProject, projectedComponentLView, parentRElement, beforeNode, true); } } function applyContainer(renderer, action, injector, lContainer, tNode, parentRElement, beforeNode) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLContainer)(lContainer); const anchor = lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NATIVE]; const native = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(lContainer); if (anchor !== native) { applyToElementOrContainer(action, renderer, injector, parentRElement, anchor, tNode, beforeNode); } for (let i = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) { const lView = lContainer[i]; applyView(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], lView, renderer, action, parentRElement, anchor); } } function applyStyling(renderer, isClassBased, rNode, prop, value) { if (isClassBased) { if (!value) { renderer.removeClass(rNode, prop); } else { renderer.addClass(rNode, prop); } } else { let flags = prop.indexOf('-') === -1 ? undefined : RendererStyleFlags2.DashCase; if (value == null) { renderer.removeStyle(rNode, prop, flags); } else { const isImportant = typeof value === 'string' ? value.endsWith('!important') : false; if (isImportant) { value = value.slice(0, -10); flags |= RendererStyleFlags2.Important; } renderer.setStyle(rNode, prop, value, flags); } } } function executeTemplate(tView, lView, templateFn, rf, context) { const prevSelectedIndex = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getSelectedIndex)(); const isUpdatePhase = rf & 2; try { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setSelectedIndex)(-1); if (isUpdatePhase && lView.length > _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET) { selectIndexInternal(tView, lView, _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET, !!ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isInCheckNoChangesMode)()); } const preHookType = isUpdatePhase ? ProfilerEvent.TemplateUpdateStart : ProfilerEvent.TemplateCreateStart; profiler(preHookType, context, templateFn); templateFn(rf, context); } finally { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setSelectedIndex)(prevSelectedIndex); const postHookType = isUpdatePhase ? ProfilerEvent.TemplateUpdateEnd : ProfilerEvent.TemplateCreateEnd; profiler(postHookType, context, templateFn); } } function createDirectivesInstances(tView, lView, tNode) { instantiateAllDirectives(tView, lView, tNode); if ((tNode.flags & 64) === 64) { invokeDirectivesHostBindings(tView, lView, tNode); } } function saveResolvedLocalsInData(viewData, tNode, localRefExtractor = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode) { const localNames = tNode.localNames; if (localNames !== null) { let localIndex = tNode.index + 1; for (let i = 0; i < localNames.length; i += 2) { const index = localNames[i + 1]; const value = index === -1 ? localRefExtractor(tNode, viewData) : viewData[index]; viewData[localIndex++] = value; } } } function locateHostElement(renderer, elementOrSelector, encapsulation, injector) { const preserveHostContent = injector.get(PRESERVE_HOST_CONTENT, PRESERVE_HOST_CONTENT_DEFAULT); const preserveContent = preserveHostContent || encapsulation === ViewEncapsulation.ShadowDom || encapsulation === ViewEncapsulation.ExperimentalIsolatedShadowDom; const rootElement = renderer.selectRootElement(elementOrSelector, preserveContent); applyRootElementTransform(rootElement); return rootElement; } function applyRootElementTransform(rootElement) { _applyRootElementTransformImpl(rootElement); } let _applyRootElementTransformImpl = () => null; function applyRootElementTransformImpl(rootElement) { if (hasSkipHydrationAttrOnRElement(rootElement)) { clearElementContents(rootElement); } else { processTextNodeMarkersBeforeHydration(rootElement); } } function enableApplyRootElementTransformImpl() { _applyRootElementTransformImpl = applyRootElementTransformImpl; } function mapPropName(name) { if (name === 'class') return 'className'; if (name === 'for') return 'htmlFor'; if (name === 'formaction') return 'formAction'; if (name === 'innerHtml') return 'innerHTML'; if (name === 'readonly') return 'readOnly'; if (name === 'tabindex') return 'tabIndex'; return name; } function setPropertyAndInputs(tNode, lView, propName, value, renderer, sanitizer) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNotSame)(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.'); const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const hasSetInput = setAllInputsForProperty(tNode, tView, lView, propName, value); if (hasSetInput) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isComponentHost)(tNode) && markDirtyIfOnPush(lView, tNode.index); ngDevMode && setNgReflectProperties(lView, tView, tNode, propName, value); return; } if (tNode.type & 3) { propName = mapPropName(propName); } setDomProperty(tNode, lView, propName, value, renderer, sanitizer); } function setDomProperty(tNode, lView, propName, value, renderer, sanitizer) { if (tNode.type & 3) { const element = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode)(tNode, lView); if (ngDevMode) { validateAgainstEventProperties(propName); if (!isPropertyValid(element, propName, tNode.value, lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW].schemas)) { handleUnknownPropertyError(propName, tNode.value, tNode.type, lView); } } value = sanitizer != null ? sanitizer(value, tNode.value || '', propName) : value; renderer.setProperty(element, propName, value); } else if (tNode.type & 12) { if (ngDevMode && !matchingSchemas(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW].schemas, tNode.value)) { handleUnknownPropertyError(propName, tNode.value, tNode.type, lView); } } } function markDirtyIfOnPush(lView, viewIndex) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLView)(lView); const childComponentLView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentLViewByIndex)(viewIndex, lView); if (!(childComponentLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] & 16)) { childComponentLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] |= 64; } } function setNgReflectProperty(lView, tNode, attrName, value) { const environment = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ENVIRONMENT]; if (!environment.ngReflect) { return; } const element = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode)(tNode, lView); const renderer = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER]; attrName = normalizeDebugBindingName(attrName); const debugValue = normalizeDebugBindingValue(value); if (tNode.type & 3) { if (value == null) { renderer.removeAttribute(element, attrName); } else { renderer.setAttribute(element, attrName, debugValue); } } else { const textContent = escapeCommentText(`bindings=${JSON.stringify({ [attrName]: debugValue }, null, 2)}`); renderer.setValue(element, textContent); } } function setNgReflectProperties(lView, tView, tNode, publicName, value) { const environment = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ENVIRONMENT]; if (!environment.ngReflect || !(tNode.type & (3 | 4))) { return; } const inputConfig = tNode.inputs?.[publicName]; const hostInputConfig = tNode.hostDirectiveInputs?.[publicName]; if (hostInputConfig) { for (let i = 0; i < hostInputConfig.length; i += 2) { const index = hostInputConfig[i]; const publicName = hostInputConfig[i + 1]; const def = tView.data[index]; setNgReflectProperty(lView, tNode, def.inputs[publicName][0], value); } } if (inputConfig) { for (const index of inputConfig) { const def = tView.data[index]; setNgReflectProperty(lView, tNode, def.inputs[publicName][0], value); } } } function instantiateAllDirectives(tView, lView, tNode) { const start = tNode.directiveStart; const end = tNode.directiveEnd; if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isComponentHost)(tNode)) { ngDevMode && assertTNodeType(tNode, 3); createComponentLView(lView, tNode, tView.data[start + tNode.componentOffset]); } if (!tView.firstCreatePass) { getOrCreateNodeInjectorForNode(tNode, lView); } const initialInputs = tNode.initialInputs; for (let i = start; i < end; i++) { const def = tView.data[i]; const directive = getNodeInjectable(lView, tView, i, tNode); attachPatchData(directive, lView); if (initialInputs !== null) { setInputsFromAttrs(lView, i - start, directive, def, tNode, initialInputs); } if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isComponentDef)(def)) { const componentView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentLViewByIndex)(tNode.index, lView); componentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT] = getNodeInjectable(lView, tView, i, tNode); } } } function invokeDirectivesHostBindings(tView, lView, tNode) { const start = tNode.directiveStart; const end = tNode.directiveEnd; const elementIndex = tNode.index; const currentDirectiveIndex = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentDirectiveIndex)(); try { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setSelectedIndex)(elementIndex); for (let dirIndex = start; dirIndex < end; dirIndex++) { const def = tView.data[dirIndex]; const directive = lView[dirIndex]; (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setCurrentDirectiveIndex)(dirIndex); if (def.hostBindings !== null || def.hostVars !== 0 || def.hostAttrs !== null) { invokeHostBindingsInCreationMode(def, directive); } } } finally { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setSelectedIndex)(-1); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setCurrentDirectiveIndex)(currentDirectiveIndex); } } function invokeHostBindingsInCreationMode(def, directive) { if (def.hostBindings !== null) { def.hostBindings(1, directive); } } function findDirectiveDefMatches(tView, tNode) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertFirstCreatePass)(tView); ngDevMode && assertTNodeType(tNode, 3 | 12); const registry = tView.directiveRegistry; let matches = null; if (registry) { for (let i = 0; i < registry.length; i++) { const def = registry[i]; if (isNodeMatchingSelectorList(tNode, def.selectors, false)) { matches ??= []; if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isComponentDef)(def)) { if (ngDevMode) { assertTNodeType(tNode, 2, `"${tNode.value}" tags cannot be used as component hosts. ` + `Please use a different tag to activate the ${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringify)(def.type)} component.`); if (matches.length && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isComponentDef)(matches[0])) { throwMultipleComponentError(tNode, matches.find(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isComponentDef).type, def.type); } } matches.unshift(def); } else { matches.push(def); } } } } return matches; } function elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace) { if (ngDevMode) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNotSame)(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.'); validateAgainstEventAttributes(name); assertTNodeType(tNode, 2, `Attempted to set attribute \`${name}\` on a container node. ` + `Host bindings are not valid on ng-container or ng-template.`); } const element = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode)(tNode, lView); setElementAttribute(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER], element, namespace, tNode.value, name, value, sanitizer); } function setElementAttribute(renderer, element, namespace, tagName, name, value, sanitizer) { if (value == null) { renderer.removeAttribute(element, name, namespace); } else { const strValue = sanitizer == null ? (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.renderStringify)(value) : sanitizer(value, tagName || '', name); renderer.setAttribute(element, name, strValue, namespace); } } function setInputsFromAttrs(lView, directiveIndex, instance, def, tNode, initialInputData) { const initialInputs = initialInputData[directiveIndex]; if (initialInputs !== null) { for (let i = 0; i < initialInputs.length; i += 2) { const lookupName = initialInputs[i]; const value = initialInputs[i + 1]; writeToDirectiveInput(def, instance, lookupName, value); if (ngDevMode) { setNgReflectProperty(lView, tNode, def.inputs[lookupName][0], value); } } } } function elementLikeStartShared(tNode, lView, index, name, locateOrCreateNativeNode) { const adjustedIndex = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET + index; const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const native = locateOrCreateNativeNode(tView, lView, tNode, name, index); lView[adjustedIndex] = native; (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setCurrentTNode)(tNode, true); const isElement = tNode.type === 2; if (isElement) { setupStaticAttributes(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER], native, tNode); if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getElementDepthCount)() === 0 || (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isDirectiveHost)(tNode)) { attachPatchData(native, lView); } (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.increaseElementDepthCount)(); } else { attachPatchData(native, lView); } if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.wasLastNodeCreated)() && (!isElement || !isDetachedByI18n(tNode))) { appendChild(tView, lView, native, tNode); } return tNode; } function elementLikeEndShared(tNode) { let currentTNode = tNode; if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isCurrentTNodeParent)()) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setCurrentTNodeAsNotParent)(); } else { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertHasParent)((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)()); currentTNode = currentTNode.parent; (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setCurrentTNode)(currentTNode, false); } return currentTNode; } function storePropertyBindingMetadata(tData, tNode, propertyName, bindingIndex, ...interpolationParts) { if (tData[bindingIndex] === null) { if (!tNode.inputs?.[propertyName] && !tNode.hostDirectiveInputs?.[propertyName]) { const propBindingIdxs = tNode.propertyBindings || (tNode.propertyBindings = []); propBindingIdxs.push(bindingIndex); let bindingMetadata = propertyName; if (interpolationParts.length > 0) { bindingMetadata += INTERPOLATION_DELIMITER + interpolationParts.join(INTERPOLATION_DELIMITER); } tData[bindingIndex] = bindingMetadata; } } } function loadComponentRenderer(currentDef, tNode, lView) { if (currentDef === null || (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isComponentDef)(currentDef)) { lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapLView)(lView[tNode.index]); } return lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER]; } function handleUncaughtError(lView, error) { const injector = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]; if (!injector) { return; } let errorHandler; try { errorHandler = injector.get(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INTERNAL_APPLICATION_ERROR_HANDLER, null); } catch { errorHandler = null; } errorHandler?.(error); } function setAllInputsForProperty(tNode, tView, lView, publicName, value) { const inputs = tNode.inputs?.[publicName]; const hostDirectiveInputs = tNode.hostDirectiveInputs?.[publicName]; let hasMatch = false; if (hostDirectiveInputs) { for (let i = 0; i < hostDirectiveInputs.length; i += 2) { const index = hostDirectiveInputs[i]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertIndexInRange)(lView, index); const publicName = hostDirectiveInputs[i + 1]; const def = tView.data[index]; writeToDirectiveInput(def, lView[index], publicName, value); hasMatch = true; } } if (inputs) { for (const index of inputs) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertIndexInRange)(lView, index); const instance = lView[index]; const def = tView.data[index]; writeToDirectiveInput(def, instance, publicName, value); hasMatch = true; } } return hasMatch; } function setDirectiveInput(tNode, tView, lView, target, publicName, value) { let hostIndex = null; let hostDirectivesStart = null; let hostDirectivesEnd = null; let hasSet = false; if (ngDevMode && !tNode.directiveToIndex?.has(target.type)) { throw new Error(`Node does not have a directive with type ${target.type.name}`); } const data = tNode.directiveToIndex.get(target.type); if (typeof data === 'number') { hostIndex = data; } else { [hostIndex, hostDirectivesStart, hostDirectivesEnd] = data; } if (hostDirectivesStart !== null && hostDirectivesEnd !== null && tNode.hostDirectiveInputs?.hasOwnProperty(publicName)) { const hostDirectiveInputs = tNode.hostDirectiveInputs[publicName]; for (let i = 0; i < hostDirectiveInputs.length; i += 2) { const index = hostDirectiveInputs[i]; if (index >= hostDirectivesStart && index <= hostDirectivesEnd) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertIndexInRange)(lView, index); const def = tView.data[index]; const hostDirectivePublicName = hostDirectiveInputs[i + 1]; writeToDirectiveInput(def, lView[index], hostDirectivePublicName, value); hasSet = true; } else if (index > hostDirectivesEnd) { break; } } } if (hostIndex !== null && target.inputs.hasOwnProperty(publicName)) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertIndexInRange)(lView, hostIndex); writeToDirectiveInput(target, lView[hostIndex], publicName, value); hasSet = true; } return hasSet; } function renderComponent(hostLView, componentHostIdx) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isCreationMode)(hostLView), true, 'Should be run in creation mode'); const componentView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentLViewByIndex)(componentHostIdx, hostLView); const componentTView = componentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; syncViewWithBlueprint(componentTView, componentView); const hostRNode = componentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HOST]; if (hostRNode !== null && componentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HYDRATION] === null) { componentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HYDRATION] = retrieveHydrationInfo(hostRNode, componentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]); } profiler(ProfilerEvent.ComponentStart); try { renderView(componentTView, componentView, componentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT]); } finally { profiler(ProfilerEvent.ComponentEnd, componentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT]); } } function syncViewWithBlueprint(tView, lView) { for (let i = lView.length; i < tView.blueprint.length; i++) { lView.push(tView.blueprint[i]); } } function renderView(tView, lView, context) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isCreationMode)(lView), true, 'Should be run in creation mode'); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNotReactive)(renderView.name); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.enterView)(lView); try { const viewQuery = tView.viewQuery; if (viewQuery !== null) { executeViewQueryFn(1, viewQuery, context); } const templateFn = tView.template; if (templateFn !== null) { executeTemplate(tView, lView, templateFn, 1, context); } if (tView.firstCreatePass) { tView.firstCreatePass = false; } lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.QUERIES]?.finishViewCreation(tView); if (tView.staticContentQueries) { refreshContentQueries(tView, lView); } if (tView.staticViewQueries) { executeViewQueryFn(2, tView.viewQuery, context); } const components = tView.components; if (components !== null) { renderChildComponents(lView, components); } } catch (error) { if (tView.firstCreatePass) { tView.incompleteFirstPass = true; tView.firstCreatePass = false; } throw error; } finally { lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] &= ~4; (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.leaveView)(); } } function renderChildComponents(hostLView, components) { for (let i = 0; i < components.length; i++) { renderComponent(hostLView, components[i]); } } function createAndRenderEmbeddedLView(declarationLView, templateTNode, context, options) { const prevConsumer = (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(null); try { const embeddedTView = templateTNode.tView; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(embeddedTView, 'TView must be defined for a template node.'); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertTNodeForLView)(templateTNode, declarationLView); const isSignalView = declarationLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] & 4096; const viewFlags = isSignalView ? 4096 : 16; const embeddedLView = createLView(declarationLView, embeddedTView, context, viewFlags, null, templateTNode, null, null, options?.injector ?? null, options?.embeddedViewInjector ?? null, options?.dehydratedView ?? null); const declarationLContainer = declarationLView[templateTNode.index]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLContainer)(declarationLContainer); embeddedLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_LCONTAINER] = declarationLContainer; const declarationViewLQueries = declarationLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.QUERIES]; if (declarationViewLQueries !== null) { embeddedLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.QUERIES] = declarationViewLQueries.createEmbeddedView(embeddedTView); } renderView(embeddedTView, embeddedLView, context); return embeddedLView; } finally { (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(prevConsumer); } } function shouldAddViewToDom(tNode, dehydratedView) { return !dehydratedView || dehydratedView.firstChild === null || hasInSkipHydrationBlockFlag(tNode); } const USE_EXHAUSTIVE_CHECK_NO_CHANGES_DEFAULT = false; const UseExhaustiveCheckNoChanges = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'exhaustive checkNoChanges' : ''); function collectNativeNodes(tView, lView, tNode, result, isProjection = false) { while (tNode !== null) { if (tNode.type === 128) { tNode = isProjection ? tNode.projectionNext : tNode.next; continue; } ngDevMode && assertTNodeType(tNode, 3 | 12 | 16 | 32); const lNode = lView[tNode.index]; if (lNode !== null) { result.push((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(lNode)); } if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLContainer)(lNode)) { collectNativeNodesInLContainer(lNode, result); } const tNodeType = tNode.type; if (tNodeType & 8) { collectNativeNodes(tView, lView, tNode.child, result); } else if (tNodeType & 32) { const nextRNode = icuContainerIterate(tNode, lView); let rNode; while (rNode = nextRNode()) { result.push(rNode); } } else if (tNodeType & 16) { const nodesInSlot = getProjectionNodes(lView, tNode); if (Array.isArray(nodesInSlot)) { result.push(...nodesInSlot); } else { const parentView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLViewParent)(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_COMPONENT_VIEW]); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertParentView)(parentView); collectNativeNodes(parentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], parentView, nodesInSlot, result, true); } } tNode = isProjection ? tNode.projectionNext : tNode.next; } return result; } function collectNativeNodesInLContainer(lContainer, result) { for (let i = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) { const lViewInAContainer = lContainer[i]; const lViewFirstChildTNode = lViewInAContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW].firstChild; if (lViewFirstChildTNode !== null) { collectNativeNodes(lViewInAContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], lViewInAContainer, lViewFirstChildTNode, result); } } if (lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NATIVE] !== lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HOST]) { result.push(lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NATIVE]); } } function addAfterRenderSequencesForView(lView) { if (lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.AFTER_RENDER_SEQUENCES_TO_ADD] !== null) { for (const sequence of lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.AFTER_RENDER_SEQUENCES_TO_ADD]) { sequence.impl.addSequence(sequence); } lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.AFTER_RENDER_SEQUENCES_TO_ADD].length = 0; } } let freeConsumers = []; function getOrBorrowReactiveLViewConsumer(lView) { return lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.REACTIVE_TEMPLATE_CONSUMER] ?? borrowReactiveLViewConsumer(lView); } function borrowReactiveLViewConsumer(lView) { const consumer = freeConsumers.pop() ?? Object.create(REACTIVE_LVIEW_CONSUMER_NODE); consumer.lView = lView; return consumer; } function maybeReturnReactiveLViewConsumer(consumer) { if (consumer.lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.REACTIVE_TEMPLATE_CONSUMER] === consumer) { return; } consumer.lView = null; freeConsumers.push(consumer); } const REACTIVE_LVIEW_CONSUMER_NODE = { ..._effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.REACTIVE_NODE, consumerIsAlwaysLive: true, kind: 'template', consumerMarkedDirty: node => { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.markAncestorsForTraversal)(node.lView); }, consumerOnSignalRead() { this.lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.REACTIVE_TEMPLATE_CONSUMER] = this; } }; function getOrCreateTemporaryConsumer(lView) { const consumer = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.REACTIVE_TEMPLATE_CONSUMER] ?? Object.create(TEMPORARY_CONSUMER_NODE); consumer.lView = lView; return consumer; } const TEMPORARY_CONSUMER_NODE = { ..._effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.REACTIVE_NODE, consumerIsAlwaysLive: true, kind: 'template', consumerMarkedDirty: node => { let parent = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLViewParent)(node.lView); while (parent && !viewShouldHaveReactiveConsumer(parent[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW])) { parent = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLViewParent)(parent); } if (!parent) { return; } (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.markViewForRefresh)(parent); }, consumerOnSignalRead() { this.lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.REACTIVE_TEMPLATE_CONSUMER] = this; } }; function viewShouldHaveReactiveConsumer(tView) { return tView.type !== 2; } function isReactiveLViewConsumer(node) { return node.kind === 'template'; } function runEffectsInView(view) { if (view[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EFFECTS] === null) { return; } let tryFlushEffects = true; while (tryFlushEffects) { let foundDirtyEffect = false; for (const effect of view[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EFFECTS]) { if (!effect.dirty) { continue; } foundDirtyEffect = true; if (effect.zone === null || Zone.current === effect.zone) { effect.run(); } else { effect.zone.run(() => effect.run()); } } tryFlushEffects = foundDirtyEffect && !!(view[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] & 8192); } } const MAXIMUM_REFRESH_RERUNS$1 = 100; function detectChangesInternal(lView, mode = 0) { const environment = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ENVIRONMENT]; const rendererFactory = environment.rendererFactory; const checkNoChangesMode = !!ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isInCheckNoChangesMode)(); if (!checkNoChangesMode) { rendererFactory.begin?.(); } try { detectChangesInViewWhileDirty(lView, mode); } finally { if (!checkNoChangesMode) { rendererFactory.end?.(); } } } function detectChangesInViewWhileDirty(lView, mode) { const lastIsRefreshingViewsValue = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isRefreshingViews)(); try { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setIsRefreshingViews)(true); detectChangesInView(lView, mode); if (ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isExhaustiveCheckNoChanges)()) { return; } let retries = 0; while ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.requiresRefreshOrTraversal)(lView)) { if (retries === MAXIMUM_REFRESH_RERUNS$1) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(103, ngDevMode && 'Infinite change detection while trying to refresh views. ' + 'There may be components which each cause the other to require a refresh, ' + 'causing an infinite loop.'); } retries++; detectChangesInView(lView, 1); } } finally { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setIsRefreshingViews)(lastIsRefreshingViewsValue); } } function checkNoChangesInternal(lView, exhaustive) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setIsInCheckNoChangesMode)(exhaustive ? _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CheckNoChangesMode.Exhaustive : _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CheckNoChangesMode.OnlyDirtyViews); try { detectChangesInternal(lView); } finally { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setIsInCheckNoChangesMode)(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CheckNoChangesMode.Off); } } function refreshView(tView, lView, templateFn, context) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isCreationMode)(lView), false, 'Should be run in update mode'); if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isDestroyed)(lView)) return; const flags = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS]; const isInCheckNoChangesPass = ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isInCheckNoChangesMode)(); const isInExhaustiveCheckNoChangesPass = ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isExhaustiveCheckNoChanges)(); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.enterView)(lView); let returnConsumerToPool = true; let prevConsumer = null; let currentConsumer = null; if (!isInCheckNoChangesPass) { if (viewShouldHaveReactiveConsumer(tView)) { currentConsumer = getOrBorrowReactiveLViewConsumer(lView); prevConsumer = (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.consumerBeforeComputation)(currentConsumer); } else if ((0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.getActiveConsumer)() === null) { returnConsumerToPool = false; currentConsumer = getOrCreateTemporaryConsumer(lView); prevConsumer = (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.consumerBeforeComputation)(currentConsumer); } else if (lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.REACTIVE_TEMPLATE_CONSUMER]) { (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.consumerDestroy)(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.REACTIVE_TEMPLATE_CONSUMER]); lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.REACTIVE_TEMPLATE_CONSUMER] = null; } } try { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.resetPreOrderHookFlags)(lView); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setBindingIndex)(tView.bindingStartIndex); if (templateFn !== null) { executeTemplate(tView, lView, templateFn, 2, context); } const hooksInitPhaseCompleted = (flags & 3) === 3; if (!isInCheckNoChangesPass) { if (hooksInitPhaseCompleted) { const preOrderCheckHooks = tView.preOrderCheckHooks; if (preOrderCheckHooks !== null) { executeCheckHooks(lView, preOrderCheckHooks, null); } } else { const preOrderHooks = tView.preOrderHooks; if (preOrderHooks !== null) { executeInitAndCheckHooks(lView, preOrderHooks, 0, null); } incrementInitPhaseFlags(lView, 0); } } if (!isInExhaustiveCheckNoChangesPass) { markTransplantedViewsForRefresh(lView); } runEffectsInView(lView); detectChangesInEmbeddedViews(lView, 0); if (tView.contentQueries !== null) { refreshContentQueries(tView, lView); } if (!isInCheckNoChangesPass) { if (hooksInitPhaseCompleted) { const contentCheckHooks = tView.contentCheckHooks; if (contentCheckHooks !== null) { executeCheckHooks(lView, contentCheckHooks); } } else { const contentHooks = tView.contentHooks; if (contentHooks !== null) { executeInitAndCheckHooks(lView, contentHooks, 1); } incrementInitPhaseFlags(lView, 1); } } processHostBindingOpCodes(tView, lView); const components = tView.components; if (components !== null) { detectChangesInChildComponents(lView, components, 0); } const viewQuery = tView.viewQuery; if (viewQuery !== null) { executeViewQueryFn(2, viewQuery, context); } if (!isInCheckNoChangesPass) { if (hooksInitPhaseCompleted) { const viewCheckHooks = tView.viewCheckHooks; if (viewCheckHooks !== null) { executeCheckHooks(lView, viewCheckHooks); } } else { const viewHooks = tView.viewHooks; if (viewHooks !== null) { executeInitAndCheckHooks(lView, viewHooks, 2); } incrementInitPhaseFlags(lView, 2); } } if (tView.firstUpdatePass === true) { tView.firstUpdatePass = false; } if (lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EFFECTS_TO_SCHEDULE]) { for (const notifyEffect of lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EFFECTS_TO_SCHEDULE]) { notifyEffect(); } lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EFFECTS_TO_SCHEDULE] = null; } if (!isInCheckNoChangesPass) { addAfterRenderSequencesForView(lView); lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] &= ~(64 | 8); } } catch (e) { if (!isInCheckNoChangesPass) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.markAncestorsForTraversal)(lView); } throw e; } finally { if (currentConsumer !== null) { (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.consumerAfterComputation)(currentConsumer, prevConsumer); if (returnConsumerToPool) { maybeReturnReactiveLViewConsumer(currentConsumer); } } (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.leaveView)(); } } function detectChangesInEmbeddedViews(lView, mode) { for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) { for (let i = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) { const embeddedLView = lContainer[i]; detectChangesInViewIfAttached(embeddedLView, mode); } } } function markTransplantedViewsForRefresh(lView) { for (let lContainer = getFirstLContainer(lView); lContainer !== null; lContainer = getNextLContainer(lContainer)) { if (!(lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] & 2)) continue; const movedViews = lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.MOVED_VIEWS]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(movedViews, 'Transplanted View flags set but missing MOVED_VIEWS'); for (let i = 0; i < movedViews.length; i++) { const movedLView = movedViews[i]; (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.markViewForRefresh)(movedLView); } } } function detectChangesInComponent(hostLView, componentHostIdx, mode) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isCreationMode)(hostLView), false, 'Should be run in update mode'); profiler(ProfilerEvent.ComponentStart); const componentView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentLViewByIndex)(componentHostIdx, hostLView); try { detectChangesInViewIfAttached(componentView, mode); } finally { profiler(ProfilerEvent.ComponentEnd, componentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT]); } } function detectChangesInViewIfAttached(lView, mode) { if (!(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.viewAttachedToChangeDetector)(lView)) { return; } detectChangesInView(lView, mode); } function detectChangesInView(lView, mode) { const isInCheckNoChangesPass = ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isInCheckNoChangesMode)(); const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const flags = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS]; const consumer = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.REACTIVE_TEMPLATE_CONSUMER]; let shouldRefreshView = !!(mode === 0 && flags & 16); shouldRefreshView ||= !!(flags & 64 && mode === 0 && !isInCheckNoChangesPass); shouldRefreshView ||= !!(flags & 1024); shouldRefreshView ||= !!(consumer?.dirty && (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.consumerPollProducersForChange)(consumer)); shouldRefreshView ||= !!(ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isExhaustiveCheckNoChanges)()); if (consumer) { consumer.dirty = false; } lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] &= ~(8192 | 1024); if (shouldRefreshView) { refreshView(tView, lView, tView.template, lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT]); } else if (flags & 8192) { const prevConsumer = (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(null); try { if (!isInCheckNoChangesPass) { runEffectsInView(lView); } detectChangesInEmbeddedViews(lView, 1); const components = tView.components; if (components !== null) { detectChangesInChildComponents(lView, components, 1); } if (!isInCheckNoChangesPass) { addAfterRenderSequencesForView(lView); } } finally { (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(prevConsumer); } } } function detectChangesInChildComponents(hostLView, components, mode) { for (let i = 0; i < components.length; i++) { detectChangesInComponent(hostLView, components[i], mode); } } function processHostBindingOpCodes(tView, lView) { const hostBindingOpCodes = tView.hostBindingOpCodes; if (hostBindingOpCodes === null) return; try { for (let i = 0; i < hostBindingOpCodes.length; i++) { const opCode = hostBindingOpCodes[i]; if (opCode < 0) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setSelectedIndex)(~opCode); } else { const directiveIdx = opCode; const bindingRootIndx = hostBindingOpCodes[++i]; const hostBindingFn = hostBindingOpCodes[++i]; (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setBindingRootForHostBindings)(bindingRootIndx, directiveIdx); const context = lView[directiveIdx]; profiler(ProfilerEvent.HostBindingsUpdateStart, context); try { hostBindingFn(2, context); } finally { profiler(ProfilerEvent.HostBindingsUpdateEnd, context); } } } } finally { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setSelectedIndex)(-1); } } function markViewDirty(lView, source) { const dirtyBitsToUse = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isRefreshingViews)() ? 64 : 1024 | 64; lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ENVIRONMENT].changeDetectionScheduler?.notify(source); while (lView) { lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] |= dirtyBitsToUse; const parent = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLViewParent)(lView); if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isRootView)(lView) && !parent) { return lView; } lView = parent; } return null; } function createLContainer(hostNative, currentView, native, tNode) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLView)(currentView); const lContainer = [hostNative, true, 0, currentView, null, tNode, null, native, null, null]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(lContainer.length, _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET, 'Should allocate correct number of slots for LContainer header.'); return lContainer; } function getLViewFromLContainer(lContainer, index) { const adjustedIndex = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET + index; if (adjustedIndex < lContainer.length) { const lView = lContainer[adjustedIndex]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLView)(lView); return lView; } return undefined; } function addLViewToLContainer(lContainer, lView, index, addToDOM = true) { const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; insertView(tView, lView, lContainer, index); if (addToDOM) { const beforeNode = getBeforeNodeForView(index, lContainer); const renderer = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER]; const parentRNode = renderer.parentNode(lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NATIVE]); if (parentRNode !== null) { addViewToDOM(tView, lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.T_HOST], renderer, lView, parentRNode, beforeNode); } } const hydrationInfo = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HYDRATION]; if (hydrationInfo !== null && hydrationInfo.firstChild !== null) { hydrationInfo.firstChild = null; } } function removeLViewFromLContainer(lContainer, index) { const lView = detachView(lContainer, index); if (lView !== undefined) { destroyLView(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], lView); } return lView; } function detachView(lContainer, removeIndex) { if (lContainer.length <= _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET) return; const indexInContainer = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET + removeIndex; const viewToDetach = lContainer[indexInContainer]; if (viewToDetach) { const declarationLContainer = viewToDetach[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_LCONTAINER]; if (declarationLContainer !== null && declarationLContainer !== lContainer) { detachMovedView(declarationLContainer, viewToDetach); } if (removeIndex > 0) { lContainer[indexInContainer - 1][_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NEXT] = viewToDetach[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NEXT]; } const removedLView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.removeFromArray)(lContainer, _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET + removeIndex); removeViewFromDOM(viewToDetach[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], viewToDetach); const lQueries = removedLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.QUERIES]; if (lQueries !== null) { lQueries.detachView(removedLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]); } viewToDetach[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PARENT] = null; viewToDetach[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NEXT] = null; viewToDetach[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] &= ~128; } return viewToDetach; } function insertView(tView, lView, lContainer, index) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLView)(lView); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLContainer)(lContainer); const indexInContainer = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET + index; const containerLength = lContainer.length; if (index > 0) { lContainer[indexInContainer - 1][_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NEXT] = lView; } if (index < containerLength - _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET) { lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NEXT] = lContainer[indexInContainer]; (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.addToArray)(lContainer, _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET + index, lView); } else { lContainer.push(lView); lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NEXT] = null; } lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PARENT] = lContainer; const declarationLContainer = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_LCONTAINER]; if (declarationLContainer !== null && lContainer !== declarationLContainer) { trackMovedView(declarationLContainer, lView); } const lQueries = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.QUERIES]; if (lQueries !== null) { lQueries.insertView(tView); } (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.updateAncestorTraversalFlagsOnAttach)(lView); lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] |= 128; } function trackMovedView(declarationContainer, lView) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(lView, 'LView required'); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLContainer)(declarationContainer); const movedViews = declarationContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.MOVED_VIEWS]; const parent = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PARENT]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(parent, 'missing parent'); if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLView)(parent)) { declarationContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] |= 2; } else { const insertedComponentLView = parent[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PARENT][_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_COMPONENT_VIEW]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(insertedComponentLView, 'Missing insertedComponentLView'); const declaredComponentLView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_COMPONENT_VIEW]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(declaredComponentLView, 'Missing declaredComponentLView'); if (declaredComponentLView !== insertedComponentLView) { declarationContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] |= 2; } } if (movedViews === null) { declarationContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.MOVED_VIEWS] = [lView]; } else { movedViews.push(lView); } } class ViewRef { _lView; _cdRefInjectingView; _appRef = null; _attachedToViewContainer = false; exhaustive; get rootNodes() { const lView = this._lView; const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; return collectNativeNodes(tView, lView, tView.firstChild, []); } constructor(_lView, _cdRefInjectingView) { this._lView = _lView; this._cdRefInjectingView = _cdRefInjectingView; } get context() { return this._lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT]; } set context(value) { if (ngDevMode) { console.warn('Angular: Replacing the `context` object of an `EmbeddedViewRef` is deprecated.'); } this._lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT] = value; } get destroyed() { return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isDestroyed)(this._lView); } destroy() { if (this._appRef) { this._appRef.detachView(this); } else if (this._attachedToViewContainer) { const parent = this._lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PARENT]; if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLContainer)(parent)) { const viewRefs = parent[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.VIEW_REFS]; const index = viewRefs ? viewRefs.indexOf(this) : -1; if (index > -1) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(index, parent.indexOf(this._lView) - _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET, 'An attached view should be in the same position within its container as its ViewRef in the VIEW_REFS array.'); detachView(parent, index); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.removeFromArray)(viewRefs, index); } } this._attachedToViewContainer = false; } destroyLView(this._lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], this._lView); } onDestroy(callback) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.storeLViewOnDestroy)(this._lView, callback); } markForCheck() { markViewDirty(this._cdRefInjectingView || this._lView, 4); } detach() { this._lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] &= ~128; } reattach() { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.updateAncestorTraversalFlagsOnAttach)(this._lView); this._lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] |= 128; } detectChanges() { this._lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] |= 1024; detectChangesInternal(this._lView); } checkNoChanges() { if (ngDevMode) { try { this.exhaustive ??= this._lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1].get(UseExhaustiveCheckNoChanges, USE_EXHAUSTIVE_CHECK_NO_CHANGES_DEFAULT); } catch { this.exhaustive = USE_EXHAUSTIVE_CHECK_NO_CHANGES_DEFAULT; } checkNoChangesInternal(this._lView, this.exhaustive); } } attachToViewContainerRef() { if (this._appRef) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(902, ngDevMode && 'This view is already attached directly to the ApplicationRef!'); } this._attachedToViewContainer = true; } detachFromAppRef() { this._appRef = null; const isRoot = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isRootView)(this._lView); const declarationContainer = this._lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_LCONTAINER]; if (declarationContainer !== null && !isRoot) { detachMovedView(declarationContainer, this._lView); } detachViewFromDOM(this._lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], this._lView); } attachToAppRef(appRef) { if (this._attachedToViewContainer) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(902, ngDevMode && 'This view is already attached to a ViewContainer!'); } this._appRef = appRef; const isRoot = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isRootView)(this._lView); const declarationContainer = this._lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_LCONTAINER]; if (declarationContainer !== null && !isRoot) { trackMovedView(declarationContainer, this._lView); } (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.updateAncestorTraversalFlagsOnAttach)(this._lView); } } function isViewDirty(view) { return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.requiresRefreshOrTraversal)(view._lView) || !!(view._lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] & 64); } function markForRefresh(view) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.markViewForRefresh)(view._lView); } class TemplateRef { _declarationLView; _declarationTContainer; elementRef; static __NG_ELEMENT_ID__ = injectTemplateRef; constructor(_declarationLView, _declarationTContainer, elementRef) { this._declarationLView = _declarationLView; this._declarationTContainer = _declarationTContainer; this.elementRef = elementRef; } get ssrId() { return this._declarationTContainer.tView?.ssrId || null; } createEmbeddedView(context, injector) { return this.createEmbeddedViewImpl(context, injector); } createEmbeddedViewImpl(context, injector, dehydratedView) { const embeddedLView = createAndRenderEmbeddedLView(this._declarationLView, this._declarationTContainer, context, { embeddedViewInjector: injector, dehydratedView }); return new ViewRef(embeddedLView); } } function injectTemplateRef() { return createTemplateRef((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(), (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)()); } function createTemplateRef(hostTNode, hostLView) { if (hostTNode.type & 4) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(hostTNode.tView, 'TView must be allocated'); return new TemplateRef(hostLView, hostTNode, createElementRef(hostTNode, hostLView)); } return null; } const AT_THIS_LOCATION = '<-- AT THIS LOCATION'; function getFriendlyStringFromTNodeType(tNodeType) { switch (tNodeType) { case 4: return 'view container'; case 2: return 'element'; case 8: return 'ng-container'; case 32: return 'icu'; case 64: return 'i18n'; case 16: return 'projection'; case 1: return 'text'; case 128: return '@let'; default: return ''; } } function validateMatchingNode(node, nodeType, tagName, lView, tNode, isViewContainerAnchor = false) { if (!node || node.nodeType !== nodeType || node.nodeType === Node.ELEMENT_NODE && node.tagName.toLowerCase() !== tagName?.toLowerCase()) { const expectedNode = shortRNodeDescription(nodeType, tagName, null); let header = `During hydration Angular expected ${expectedNode} but `; const hostComponentDef = getDeclarationComponentDef(lView); const componentClassName = hostComponentDef?.type?.name; const expectedDom = describeExpectedDom(lView, tNode, isViewContainerAnchor); const expected = `Angular expected this DOM:\n\n${expectedDom}\n\n`; let actual = ''; const componentHostElement = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HOST]); if (!node) { header += `the node was not found.\n\n`; markRNodeAsHavingHydrationMismatch(componentHostElement, expectedDom); } else { const actualNode = shortRNodeDescription(node.nodeType, node.tagName ?? null, node.textContent ?? null); header += `found ${actualNode}.\n\n`; const actualDom = describeDomFromNode(node); actual = `Actual DOM is:\n\n${actualDom}\n\n`; markRNodeAsHavingHydrationMismatch(componentHostElement, expectedDom, actualDom); } const footer = getHydrationErrorFooter(componentClassName); const message = header + expected + actual + getHydrationAttributeNote() + footer; throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(-500, message); } } function validateSiblingNodeExists(node) { validateNodeExists(node); if (!node.nextSibling) { const header = 'During hydration Angular expected more sibling nodes to be present.\n\n'; const actual = `Actual DOM is:\n\n${describeDomFromNode(node)}\n\n`; const footer = getHydrationErrorFooter(); const message = header + actual + footer; markRNodeAsHavingHydrationMismatch(node, '', actual); throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(-501, message); } } function validateNodeExists(node, lView = null, tNode = null) { if (!node) { const header = 'During hydration, Angular expected an element to be present at this location.\n\n'; let expected = ''; let footer = ''; if (lView !== null && tNode !== null) { expected = describeExpectedDom(lView, tNode, false); footer = getHydrationErrorFooter(); markRNodeAsHavingHydrationMismatch((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HOST]), expected, ''); } throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(-502, `${header}${expected}\n\n${footer}`); } } function nodeNotFoundError(lView, tNode) { const header = 'During serialization, Angular was unable to find an element in the DOM:\n\n'; const expected = `${describeExpectedDom(lView, tNode, false)}\n\n`; const footer = getHydrationErrorFooter(); throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(-502, header + expected + footer); } function nodeNotFoundAtPathError(host, path) { const header = `During hydration Angular was unable to locate a node ` + `using the "${path}" path, starting from the ${describeRNode(host)} node.\n\n`; const footer = getHydrationErrorFooter(); markRNodeAsHavingHydrationMismatch(host); throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(-502, header + footer); } function unsupportedProjectionOfDomNodes(rNode) { const header = 'During serialization, Angular detected DOM nodes ' + 'that were created outside of Angular context and provided as projectable nodes ' + '(likely via `ViewContainerRef.createComponent` or `createComponent` APIs). ' + 'Hydration is not supported for such cases, consider refactoring the code to avoid ' + 'this pattern or using `ngSkipHydration` on the host element of the component.\n\n'; const actual = `${describeDomFromNode(rNode)}\n\n`; const message = header + actual + getHydrationAttributeNote(); return new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(-503, message); } function invalidSkipHydrationHost(rNode) { const header = 'The `ngSkipHydration` flag is applied on a node ' + "that doesn't act as a component host. Hydration can be " + 'skipped only on per-component basis.\n\n'; const actual = `${describeDomFromNode(rNode)}\n\n`; const footer = 'Please move the `ngSkipHydration` attribute to the component host element.\n\n'; const message = header + actual + footer; return new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(-504, message); } function stringifyTNodeAttrs(tNode) { const results = []; if (tNode.attrs) { for (let i = 0; i < tNode.attrs.length;) { const attrName = tNode.attrs[i++]; if (typeof attrName == 'number') { break; } const attrValue = tNode.attrs[i++]; results.push(`${attrName}="${shorten(attrValue)}"`); } } return results.join(' '); } const internalAttrs = new Set(['ngh', 'ng-version', 'ng-server-context']); function stringifyRNodeAttrs(rNode) { const results = []; for (let i = 0; i < rNode.attributes.length; i++) { const attr = rNode.attributes[i]; if (internalAttrs.has(attr.name)) continue; results.push(`${attr.name}="${shorten(attr.value)}"`); } return results.join(' '); } function describeTNode(tNode, innerContent = '…') { switch (tNode.type) { case 1: const content = tNode.value ? `(${tNode.value})` : ''; return `#text${content}`; case 2: const attrs = stringifyTNodeAttrs(tNode); const tag = tNode.value.toLowerCase(); return `<${tag}${attrs ? ' ' + attrs : ''}>${innerContent}`; case 8: return ''; case 4: return ''; default: const typeAsString = getFriendlyStringFromTNodeType(tNode.type); return `#node(${typeAsString})`; } } function describeRNode(rNode, innerContent = '…') { const node = rNode; switch (node.nodeType) { case Node.ELEMENT_NODE: const tag = node.tagName.toLowerCase(); const attrs = stringifyRNodeAttrs(node); return `<${tag}${attrs ? ' ' + attrs : ''}>${innerContent}`; case Node.TEXT_NODE: const content = node.textContent ? shorten(node.textContent) : ''; return `#text${content ? `(${content})` : ''}`; case Node.COMMENT_NODE: return ``; default: return `#node(${node.nodeType})`; } } function describeExpectedDom(lView, tNode, isViewContainerAnchor) { const spacer = ' '; let content = ''; if (tNode.prev) { content += spacer + '…\n'; content += spacer + describeTNode(tNode.prev) + '\n'; } else if (tNode.type && tNode.type & 12) { content += spacer + '…\n'; } if (isViewContainerAnchor) { content += spacer + describeTNode(tNode) + '\n'; content += spacer + ` ${AT_THIS_LOCATION}\n`; } else { content += spacer + describeTNode(tNode) + ` ${AT_THIS_LOCATION}\n`; } content += spacer + '…\n'; const parentRNode = tNode.type ? getParentRElement(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, lView) : null; if (parentRNode) { content = describeRNode(parentRNode, '\n' + content); } return content; } function describeDomFromNode(node) { const spacer = ' '; let content = ''; const currentNode = node; if (currentNode.previousSibling) { content += spacer + '…\n'; content += spacer + describeRNode(currentNode.previousSibling) + '\n'; } content += spacer + describeRNode(currentNode) + ` ${AT_THIS_LOCATION}\n`; if (node.nextSibling) { content += spacer + '…\n'; } if (node.parentNode) { content = describeRNode(currentNode.parentNode, '\n' + content); } return content; } function shortRNodeDescription(nodeType, tagName, textContent) { switch (nodeType) { case Node.ELEMENT_NODE: return `<${tagName.toLowerCase()}>`; case Node.TEXT_NODE: const content = textContent ? ` (with the "${shorten(textContent)}" content)` : ''; return `a text node${content}`; case Node.COMMENT_NODE: return 'a comment node'; default: return `#node(nodeType=${nodeType})`; } } function getHydrationErrorFooter(componentClassName) { const componentInfo = componentClassName ? `the "${componentClassName}"` : 'corresponding'; return `To fix this problem:\n` + ` * check ${componentInfo} component for hydration-related issues\n` + ` * check to see if your template has valid HTML structure\n` + ` * or skip hydration by adding the \`ngSkipHydration\` attribute ` + `to its host node in a template\n\n`; } function getHydrationAttributeNote() { return 'Note: attributes are only displayed to better represent the DOM' + ' but have no effect on hydration mismatches.\n\n'; } function stripNewlines(input) { return input.replace(/\s+/gm, ''); } function shorten(input, maxLength = 50) { if (!input) { return ''; } input = stripNewlines(input); return input.length > maxLength ? `${input.substring(0, maxLength - 1)}…` : input; } function getInsertInFrontOfRNodeWithI18n(parentTNode, currentTNode, lView) { const tNodeInsertBeforeIndex = currentTNode.insertBeforeIndex; const insertBeforeIndex = Array.isArray(tNodeInsertBeforeIndex) ? tNodeInsertBeforeIndex[0] : tNodeInsertBeforeIndex; if (insertBeforeIndex === null) { return getInsertInFrontOfRNodeWithNoI18n(parentTNode, currentTNode, lView); } else { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertIndexInRange)(lView, insertBeforeIndex); return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(lView[insertBeforeIndex]); } } function processI18nInsertBefore(renderer, childTNode, lView, childRNode, parentRElement) { const tNodeInsertBeforeIndex = childTNode.insertBeforeIndex; if (Array.isArray(tNodeInsertBeforeIndex)) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDomNode)(childRNode); let i18nParent = childRNode; let anchorRNode = null; if (!(childTNode.type & 3)) { anchorRNode = i18nParent; i18nParent = parentRElement; } if (i18nParent !== null && childTNode.componentOffset === -1) { for (let i = 1; i < tNodeInsertBeforeIndex.length; i++) { const i18nChild = lView[tNodeInsertBeforeIndex[i]]; nativeInsertBefore(renderer, i18nParent, i18nChild, anchorRNode, false); } } } } function getOrCreateTNode(tView, index, type, name, attrs) { ngDevMode && index !== 0 && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertGreaterThanOrEqual)(index, _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET, "TNodes can't be in the LView header."); ngDevMode && assertPureTNodeType(type); let tNode = tView.data[index]; if (tNode === null) { tNode = createTNodeAtIndex(tView, index, type, name, attrs); if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isInI18nBlock)()) { tNode.flags |= 32; } } else if (tNode.type & 64) { tNode.type = type; tNode.value = name; tNode.attrs = attrs; const parent = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentParentTNode)(); tNode.injectorIndex = parent === null ? -1 : parent.injectorIndex; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertTNodeForTView)(tNode, tView); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(index, tNode.index, 'Expecting same index'); } (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setCurrentTNode)(tNode, true); return tNode; } function createTNodeAtIndex(tView, index, type, name, attrs) { const currentTNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNodePlaceholderOk)(); const isParent = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isCurrentTNodeParent)(); const parent = isParent ? currentTNode : currentTNode && currentTNode.parent; const tNode = tView.data[index] = createTNode(tView, parent, type, index, name, attrs); linkTNodeInTView(tView, tNode, currentTNode, isParent); return tNode; } function linkTNodeInTView(tView, tNode, currentTNode, isParent) { if (tView.firstChild === null) { tView.firstChild = tNode; } if (currentTNode !== null) { if (isParent) { if (currentTNode.child == null && tNode.parent !== null) { currentTNode.child = tNode; } } else { if (currentTNode.next === null) { currentTNode.next = tNode; tNode.prev = currentTNode; } } } } function createTNode(tView, tParent, type, index, value, attrs) { ngDevMode && index !== 0 && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertGreaterThanOrEqual)(index, _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET, "TNodes can't be in the LView header."); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNotSame)(attrs, undefined, "'undefined' is not valid value for 'attrs'"); ngDevMode && tParent && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertTNodeForTView)(tParent, tView); let injectorIndex = tParent ? tParent.injectorIndex : -1; let flags = 0; if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isInSkipHydrationBlock)()) { flags |= 128; } const tNode = { type, index, insertBeforeIndex: null, injectorIndex, directiveStart: -1, directiveEnd: -1, directiveStylingLast: -1, componentOffset: -1, fieldIndex: -1, customControlIndex: -1, propertyBindings: null, flags, providerIndexes: 0, value: value, attrs: attrs, mergedAttrs: null, localNames: null, initialInputs: null, inputs: null, hostDirectiveInputs: null, outputs: null, hostDirectiveOutputs: null, directiveToIndex: null, tView: null, next: null, prev: null, projectionNext: null, child: null, parent: tParent, projection: null, styles: null, stylesWithoutHost: null, residualStyles: undefined, classes: null, classesWithoutHost: null, residualClasses: undefined, classBindings: 0, styleBindings: 0 }; if (ngDevMode) { Object.seal(tNode); } return tNode; } function addTNodeAndUpdateInsertBeforeIndex(previousTNodes, newTNode) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(newTNode.insertBeforeIndex, null, 'We expect that insertBeforeIndex is not set'); previousTNodes.push(newTNode); if (previousTNodes.length > 1) { for (let i = previousTNodes.length - 2; i >= 0; i--) { const existingTNode = previousTNodes[i]; if (!isI18nText(existingTNode)) { if (isNewTNodeCreatedBefore(existingTNode, newTNode) && getInsertBeforeIndex(existingTNode) === null) { setInsertBeforeIndex(existingTNode, newTNode.index); } } } } } function isI18nText(tNode) { return !(tNode.type & 64); } function isNewTNodeCreatedBefore(existingTNode, newTNode) { return isI18nText(newTNode) || existingTNode.index > newTNode.index; } function getInsertBeforeIndex(tNode) { const index = tNode.insertBeforeIndex; return Array.isArray(index) ? index[0] : index; } function setInsertBeforeIndex(tNode, value) { const index = tNode.insertBeforeIndex; if (Array.isArray(index)) { index[0] = value; } else { setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore); tNode.insertBeforeIndex = value; } } function getTIcu(tView, index) { const value = tView.data[index]; if (value === null || typeof value === 'string') return null; if (ngDevMode && !(value.hasOwnProperty('tView') || value.hasOwnProperty('currentCaseLViewIndex'))) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)("We expect to get 'null'|'TIcu'|'TIcuContainer', but got: " + value); } const tIcu = value.hasOwnProperty('currentCaseLViewIndex') ? value : value.value; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertTIcu)(tIcu); return tIcu; } function setTIcu(tView, index, tIcu) { const tNode = tView.data[index]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(tNode === null || tNode.hasOwnProperty('tView'), true, "We expect to get 'null'|'TIcuContainer'"); if (tNode === null) { tView.data[index] = tIcu; } else { ngDevMode && assertTNodeType(tNode, 32); tNode.value = tIcu; } } function setTNodeInsertBeforeIndex(tNode, index) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertTNode)(tNode); let insertBeforeIndex = tNode.insertBeforeIndex; if (insertBeforeIndex === null) { setI18nHandling(getInsertInFrontOfRNodeWithI18n, processI18nInsertBefore); insertBeforeIndex = tNode.insertBeforeIndex = [null, index]; } else { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(Array.isArray(insertBeforeIndex), true, 'Expecting array here'); insertBeforeIndex.push(index); } } function createTNodePlaceholder(tView, previousTNodes, index) { const tNode = createTNodeAtIndex(tView, index, 64, null, null); addTNodeAndUpdateInsertBeforeIndex(previousTNodes, tNode); return tNode; } function getCurrentICUCaseIndex(tIcu, lView) { const currentCase = lView[tIcu.currentCaseLViewIndex]; return currentCase === null ? currentCase : currentCase < 0 ? ~currentCase : currentCase; } function getParentFromIcuCreateOpCode(mergedCode) { return mergedCode >>> 17; } function getRefFromIcuCreateOpCode(mergedCode) { return (mergedCode & 131070) >>> 1; } function getInstructionFromIcuCreateOpCode(mergedCode) { return mergedCode & 1; } function icuCreateOpCode(opCode, parentIdx, refIdx) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertGreaterThanOrEqual)(parentIdx, 0, 'Missing parent index'); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertGreaterThan)(refIdx, 0, 'Missing ref index'); return opCode | parentIdx << 17 | refIdx << 1; } function isRootTemplateMessage(subTemplateIndex) { return subTemplateIndex === -1; } function enterIcu(state, tIcu, lView) { state.index = 0; const currentCase = getCurrentICUCaseIndex(tIcu, lView); if (currentCase !== null) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNumberInRange)(currentCase, 0, tIcu.cases.length - 1); state.removes = tIcu.remove[currentCase]; } else { state.removes = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARRAY; } } function icuContainerIteratorNext(state) { if (state.index < state.removes.length) { const removeOpCode = state.removes[state.index++]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNumber)(removeOpCode, 'Expecting OpCode number'); if (removeOpCode > 0) { const rNode = state.lView[removeOpCode]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDomNode)(rNode); return rNode; } else { state.stack.push(state.index, state.removes); const tIcuIndex = ~removeOpCode; const tIcu = state.lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW].data[tIcuIndex]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertTIcu)(tIcu); enterIcu(state, tIcu, state.lView); return icuContainerIteratorNext(state); } } else { if (state.stack.length === 0) { state.lView = undefined; return null; } else { state.removes = state.stack.pop(); state.index = state.stack.pop(); return icuContainerIteratorNext(state); } } } function loadIcuContainerVisitor() { const _state = { stack: [], index: -1 }; function icuContainerIteratorStart(tIcuContainerNode, lView) { _state.lView = lView; while (_state.stack.length) _state.stack.pop(); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertTNodeForLView)(tIcuContainerNode, lView); enterIcu(_state, tIcuContainerNode.value, lView); return icuContainerIteratorNext.bind(null, _state); } return icuContainerIteratorStart; } function createIcuIterator(tIcu, lView) { const state = { stack: [], index: -1, lView }; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertTIcu)(tIcu); enterIcu(state, tIcu, lView); return icuContainerIteratorNext.bind(null, state); } const REF_EXTRACTOR_REGEXP = /* @__PURE__ */(() => { return new RegExp(`^(\\d+)*(${REFERENCE_NODE_BODY}|${REFERENCE_NODE_HOST})*(.*)`); })(); function compressNodeLocation(referenceNode, path) { const result = [referenceNode]; for (const segment of path) { const lastIdx = result.length - 1; if (lastIdx > 0 && result[lastIdx - 1] === segment) { const value = result[lastIdx] || 1; result[lastIdx] = value + 1; } else { result.push(segment, ''); } } return result.join(''); } function decompressNodeLocation(path) { const matches = path.match(REF_EXTRACTOR_REGEXP); const [_, refNodeId, refNodeName, rest] = matches; const ref = refNodeId ? parseInt(refNodeId, 10) : refNodeName; const steps = []; for (const [_, step, count] of rest.matchAll(/(f|n)(\d*)/g)) { const repeat = parseInt(count, 10) || 1; steps.push(step, repeat); } return [ref, ...steps]; } function isFirstElementInNgContainer(tNode) { return !tNode.prev && tNode.parent?.type === 8; } function getNoOffsetIndex(tNode) { return tNode.index - _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET; } function isDisconnectedNode(tNode, lView) { return !(tNode.type & (16 | 128)) && !!lView[tNode.index] && isDisconnectedRNode((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(lView[tNode.index])); } function isDisconnectedRNode(rNode) { return !!rNode && !rNode.isConnected; } function locateI18nRNodeByIndex(hydrationInfo, noOffsetIndex) { const i18nNodes = hydrationInfo.i18nNodes; if (i18nNodes) { return i18nNodes.get(noOffsetIndex); } return undefined; } function tryLocateRNodeByPath(hydrationInfo, lView, noOffsetIndex) { const nodes = hydrationInfo.data[NODES]; const path = nodes?.[noOffsetIndex]; return path ? locateRNodeByPath(path, lView) : null; } function locateNextRNode(hydrationInfo, tView, lView, tNode) { const noOffsetIndex = getNoOffsetIndex(tNode); let native = locateI18nRNodeByIndex(hydrationInfo, noOffsetIndex); if (native === undefined) { const nodes = hydrationInfo.data[NODES]; if (nodes?.[noOffsetIndex]) { native = locateRNodeByPath(nodes[noOffsetIndex], lView); } else if (tView.firstChild === tNode) { native = hydrationInfo.firstChild; } else { const previousTNodeParent = tNode.prev === null; const previousTNode = tNode.prev ?? tNode.parent; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(previousTNode, 'Unexpected state: current TNode does not have a connection ' + 'to the previous node or a parent node.'); if (isFirstElementInNgContainer(tNode)) { const noOffsetParentIndex = getNoOffsetIndex(tNode.parent); native = getSegmentHead(hydrationInfo, noOffsetParentIndex); } else { let previousRElement = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode)(previousTNode, lView); if (previousTNodeParent) { native = previousRElement.firstChild; } else { const noOffsetPrevSiblingIndex = getNoOffsetIndex(previousTNode); const segmentHead = getSegmentHead(hydrationInfo, noOffsetPrevSiblingIndex); if (previousTNode.type === 2 && segmentHead) { const numRootNodesToSkip = calcSerializedContainerSize(hydrationInfo, noOffsetPrevSiblingIndex); const nodesToSkip = numRootNodesToSkip + 1; native = siblingAfter(nodesToSkip, segmentHead); } else { native = previousRElement.nextSibling; } } } } } return native; } function siblingAfter(skip, from) { let currentNode = from; for (let i = 0; i < skip; i++) { ngDevMode && validateSiblingNodeExists(currentNode); currentNode = currentNode.nextSibling; } return currentNode; } function stringifyNavigationInstructions(instructions) { const container = []; for (let i = 0; i < instructions.length; i += 2) { const step = instructions[i]; const repeat = instructions[i + 1]; for (let r = 0; r < repeat; r++) { container.push(step === NODE_NAVIGATION_STEP_FIRST_CHILD ? 'firstChild' : 'nextSibling'); } } return container.join('.'); } function navigateToNode(from, instructions) { let node = from; for (let i = 0; i < instructions.length; i += 2) { const step = instructions[i]; const repeat = instructions[i + 1]; for (let r = 0; r < repeat; r++) { if (ngDevMode && !node) { throw nodeNotFoundAtPathError(from, stringifyNavigationInstructions(instructions)); } switch (step) { case NODE_NAVIGATION_STEP_FIRST_CHILD: node = node.firstChild; break; case NODE_NAVIGATION_STEP_NEXT_SIBLING: node = node.nextSibling; break; } } } if (ngDevMode && !node) { throw nodeNotFoundAtPathError(from, stringifyNavigationInstructions(instructions)); } return node; } function locateRNodeByPath(path, lView) { const [referenceNode, ...navigationInstructions] = decompressNodeLocation(path); let ref; if (referenceNode === REFERENCE_NODE_HOST) { ref = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_COMPONENT_VIEW][_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HOST]; } else if (referenceNode === REFERENCE_NODE_BODY) { ref = ɵɵresolveBody(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_COMPONENT_VIEW][_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HOST]); } else { const parentElementId = Number(referenceNode); ref = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(lView[parentElementId + _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET]); } return navigateToNode(ref, navigationInstructions); } function navigateBetween(start, finish) { if (start === finish) { return []; } else if (start.parentElement == null || finish.parentElement == null) { return null; } else if (start.parentElement === finish.parentElement) { return navigateBetweenSiblings(start, finish); } else { const parent = finish.parentElement; const parentPath = navigateBetween(start, parent); const childPath = navigateBetween(parent.firstChild, finish); if (!parentPath || !childPath) return null; return [...parentPath, NODE_NAVIGATION_STEP_FIRST_CHILD, ...childPath]; } } function navigateBetweenSiblings(start, finish) { const nav = []; let node = null; for (node = start; node != null && node !== finish; node = node.nextSibling) { nav.push(NODE_NAVIGATION_STEP_NEXT_SIBLING); } return node == null ? null : nav; } function calcPathBetween(from, to, fromNodeName) { const path = navigateBetween(from, to); return path === null ? null : compressNodeLocation(fromNodeName, path); } function calcPathForNode(tNode, lView, excludedParentNodes) { let parentTNode = tNode.parent; let parentIndex; let parentRNode; let referenceNodeName; while (parentTNode !== null && (isDisconnectedNode(parentTNode, lView) || excludedParentNodes?.has(parentTNode.index))) { parentTNode = parentTNode.parent; } if (parentTNode === null || !(parentTNode.type & 3)) { parentIndex = referenceNodeName = REFERENCE_NODE_HOST; parentRNode = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_COMPONENT_VIEW][_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HOST]; } else { parentIndex = parentTNode.index; parentRNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(lView[parentIndex]); referenceNodeName = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.renderStringify)(parentIndex - _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET); } let rNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(lView[tNode.index]); if (tNode.type & (12 | 32)) { const firstRNode = getFirstNativeNode(lView, tNode); if (firstRNode) { rNode = firstRNode; } } let path = calcPathBetween(parentRNode, rNode, referenceNodeName); if (path === null && parentRNode !== rNode) { const body = parentRNode.ownerDocument.body; path = calcPathBetween(body, rNode, REFERENCE_NODE_BODY); if (path === null) { throw nodeNotFoundError(lView, tNode); } } return path; } function gatherDeferBlocksCommentNodes(doc, node) { const commentNodesIterator = doc.createNodeIterator(node, NodeFilter.SHOW_COMMENT, { acceptNode }); let currentNode; const nodesByBlockId = new Map(); while (currentNode = commentNodesIterator.nextNode()) { const nghPattern = 'ngh='; const content = currentNode?.textContent; const nghIdx = content?.indexOf(nghPattern) ?? -1; if (nghIdx > -1) { const nghValue = content.substring(nghIdx + nghPattern.length).trim(); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(nghValue.startsWith('d'), true, 'Invalid defer block id found in a comment node.'); nodesByBlockId.set(nghValue, currentNode); } } return nodesByBlockId; } function acceptNode(node) { return node.textContent?.trimStart().startsWith('ngh=') ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT; } let _isI18nHydrationSupportEnabled = false; let _prepareI18nBlockForHydrationImpl = () => {}; function setIsI18nHydrationSupportEnabled(enabled) { _isI18nHydrationSupportEnabled = enabled; } function isI18nHydrationSupportEnabled() { return _isI18nHydrationSupportEnabled; } function prepareI18nBlockForHydration(lView, index, parentTNode, subTemplateIndex) { _prepareI18nBlockForHydrationImpl(lView, index, parentTNode, subTemplateIndex); } function enablePrepareI18nBlockForHydrationImpl() { _prepareI18nBlockForHydrationImpl = prepareI18nBlockForHydrationImpl; } function isI18nHydrationEnabled(injector) { injector = injector ?? (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.Injector); return injector.get(IS_I18N_HYDRATION_ENABLED, false); } function getOrComputeI18nChildren(tView, context) { let i18nChildren = context.i18nChildren.get(tView); if (i18nChildren === undefined) { i18nChildren = collectI18nChildren(tView); context.i18nChildren.set(tView, i18nChildren); } return i18nChildren; } function collectI18nChildren(tView) { const children = new Set(); function collectI18nViews(node) { children.add(node.index); switch (node.kind) { case 1: case 2: { for (const childNode of node.children) { collectI18nViews(childNode); } break; } case 3: { for (const caseNodes of node.cases) { for (const caseNode of caseNodes) { collectI18nViews(caseNode); } } break; } } } for (let i = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET; i < tView.bindingStartIndex; i++) { const tI18n = tView.data[i]; if (!tI18n || !tI18n.ast) { continue; } for (const node of tI18n.ast) { collectI18nViews(node); } } return children.size === 0 ? null : children; } function trySerializeI18nBlock(lView, index, context) { if (!context.isI18nHydrationEnabled) { return null; } const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const tI18n = tView.data[index]; if (!tI18n || !tI18n.ast) { return null; } const parentTNode = tView.data[tI18n.parentTNodeIndex]; if (parentTNode && isI18nInSkipHydrationBlock(parentTNode)) { return null; } const serializedI18nBlock = { caseQueue: [], disconnectedNodes: new Set(), disjointNodes: new Set() }; serializeI18nBlock(lView, serializedI18nBlock, context, tI18n.ast); return serializedI18nBlock.caseQueue.length === 0 && serializedI18nBlock.disconnectedNodes.size === 0 && serializedI18nBlock.disjointNodes.size === 0 ? null : serializedI18nBlock; } function serializeI18nBlock(lView, serializedI18nBlock, context, nodes) { let prevRNode = null; for (const node of nodes) { const nextRNode = serializeI18nNode(lView, serializedI18nBlock, context, node); if (nextRNode) { if (isDisjointNode(prevRNode, nextRNode)) { serializedI18nBlock.disjointNodes.add(node.index - _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET); } prevRNode = nextRNode; } } return prevRNode; } function isDisjointNode(prevNode, nextNode) { return prevNode && prevNode.nextSibling !== nextNode; } function serializeI18nNode(lView, serializedI18nBlock, context, node) { const maybeRNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(lView[node.index]); if (!maybeRNode || isDisconnectedRNode(maybeRNode)) { serializedI18nBlock.disconnectedNodes.add(node.index - _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET); return null; } const rNode = maybeRNode; switch (node.kind) { case 0: { processTextNodeBeforeSerialization(context, rNode); break; } case 1: case 2: { serializeI18nBlock(lView, serializedI18nBlock, context, node.children); break; } case 3: { const currentCase = lView[node.currentCaseLViewIndex]; if (currentCase != null) { const caseIdx = currentCase < 0 ? ~currentCase : currentCase; serializedI18nBlock.caseQueue.push(caseIdx); serializeI18nBlock(lView, serializedI18nBlock, context, node.cases[caseIdx]); } break; } } return getFirstNativeNodeForI18nNode(lView, node); } function getFirstNativeNodeForI18nNode(lView, node) { const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const maybeTNode = tView.data[node.index]; if (isTNodeShape(maybeTNode)) { return getFirstNativeNode(lView, maybeTNode); } else if (node.kind === 3) { const icuIterator = createIcuIterator(maybeTNode, lView); let rNode = icuIterator(); return rNode ?? (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(lView[node.index]); } else { return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(lView[node.index]) ?? null; } } function setCurrentNode(state, node) { state.currentNode = node; } function appendI18nNodeToCollection(context, state, astNode) { const noOffsetIndex = astNode.index - _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET; const { disconnectedNodes } = context; const currentNode = state.currentNode; if (state.isConnected) { context.i18nNodes.set(noOffsetIndex, currentNode); disconnectedNodes.delete(noOffsetIndex); } else { disconnectedNodes.add(noOffsetIndex); } return currentNode; } function skipSiblingNodes(state, skip) { let currentNode = state.currentNode; for (let i = 0; i < skip; i++) { if (!currentNode) { break; } currentNode = currentNode?.nextSibling ?? null; } return currentNode; } function forkHydrationState(state, nextNode) { return { currentNode: nextNode, isConnected: state.isConnected }; } function prepareI18nBlockForHydrationImpl(lView, index, parentTNode, subTemplateIndex) { const hydrationInfo = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HYDRATION]; if (!hydrationInfo) { return; } if (!isI18nHydrationSupportEnabled() || parentTNode && (isI18nInSkipHydrationBlock(parentTNode) || isDisconnectedNode$1(hydrationInfo, parentTNode.index - _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET))) { return; } const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const tI18n = tView.data[index]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(tI18n, 'Expected i18n data to be present in a given TView slot during hydration'); function findHydrationRoot() { if (isRootTemplateMessage(subTemplateIndex)) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(parentTNode, 'Expected parent TNode while hydrating i18n root'); const rootNode = locateNextRNode(hydrationInfo, tView, lView, parentTNode); return parentTNode.type & 8 ? rootNode : rootNode.firstChild; } return hydrationInfo?.firstChild; } const currentNode = findHydrationRoot(); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(currentNode, 'Expected root i18n node during hydration'); const disconnectedNodes = initDisconnectedNodes(hydrationInfo) ?? new Set(); const i18nNodes = hydrationInfo.i18nNodes ??= new Map(); const caseQueue = hydrationInfo.data[I18N_DATA]?.[index - _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET] ?? []; const dehydratedIcuData = hydrationInfo.dehydratedIcuData ??= new Map(); collectI18nNodesFromDom({ hydrationInfo, lView, i18nNodes, disconnectedNodes, caseQueue, dehydratedIcuData }, { currentNode, isConnected: true }, tI18n.ast); hydrationInfo.disconnectedNodes = disconnectedNodes.size === 0 ? null : disconnectedNodes; } function collectI18nNodesFromDom(context, state, nodeOrNodes) { if (Array.isArray(nodeOrNodes)) { let nextState = state; for (const node of nodeOrNodes) { const targetNode = tryLocateRNodeByPath(context.hydrationInfo, context.lView, node.index - _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET); if (targetNode) { nextState = forkHydrationState(state, targetNode); } collectI18nNodesFromDom(context, nextState, node); } } else { if (context.disconnectedNodes.has(nodeOrNodes.index - _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET)) { return; } switch (nodeOrNodes.kind) { case 0: { const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes); setCurrentNode(state, currentNode?.nextSibling ?? null); break; } case 1: { collectI18nNodesFromDom(context, forkHydrationState(state, state.currentNode?.firstChild ?? null), nodeOrNodes.children); const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes); setCurrentNode(state, currentNode?.nextSibling ?? null); break; } case 2: { const noOffsetIndex = nodeOrNodes.index - _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET; const { hydrationInfo } = context; const containerSize = getNgContainerSize(hydrationInfo, noOffsetIndex); switch (nodeOrNodes.type) { case 0: { const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes); if (isSerializedElementContainer(hydrationInfo, noOffsetIndex)) { collectI18nNodesFromDom(context, state, nodeOrNodes.children); const nextNode = skipSiblingNodes(state, 1); setCurrentNode(state, nextNode); } else { collectI18nNodesFromDom(context, forkHydrationState(state, state.currentNode?.firstChild ?? null), nodeOrNodes.children); setCurrentNode(state, currentNode?.nextSibling ?? null); if (containerSize !== null) { const nextNode = skipSiblingNodes(state, containerSize + 1); setCurrentNode(state, nextNode); } } break; } case 1: { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNotEqual)(containerSize, null, 'Expected a container size while hydrating i18n subtemplate'); appendI18nNodeToCollection(context, state, nodeOrNodes); const nextNode = skipSiblingNodes(state, containerSize + 1); setCurrentNode(state, nextNode); break; } } break; } case 3: { const selectedCase = state.isConnected ? context.caseQueue.shift() : null; const childState = { currentNode: null, isConnected: false }; for (let i = 0; i < nodeOrNodes.cases.length; i++) { collectI18nNodesFromDom(context, i === selectedCase ? state : childState, nodeOrNodes.cases[i]); } if (selectedCase !== null) { context.dehydratedIcuData.set(nodeOrNodes.index, { case: selectedCase, node: nodeOrNodes }); } const currentNode = appendI18nNodeToCollection(context, state, nodeOrNodes); setCurrentNode(state, currentNode?.nextSibling ?? null); break; } } } } let _claimDehydratedIcuCaseImpl = () => {}; function claimDehydratedIcuCase(lView, icuIndex, caseIndex) { _claimDehydratedIcuCaseImpl(lView, icuIndex, caseIndex); } function enableClaimDehydratedIcuCaseImpl() { _claimDehydratedIcuCaseImpl = claimDehydratedIcuCaseImpl; } function claimDehydratedIcuCaseImpl(lView, icuIndex, caseIndex) { const dehydratedIcuDataMap = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HYDRATION]?.dehydratedIcuData; if (dehydratedIcuDataMap) { const dehydratedIcuData = dehydratedIcuDataMap.get(icuIndex); if (dehydratedIcuData?.case === caseIndex) { dehydratedIcuDataMap.delete(icuIndex); } } } function cleanupI18nHydrationData(lView) { const hydrationInfo = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HYDRATION]; if (hydrationInfo) { const { i18nNodes, dehydratedIcuData: dehydratedIcuDataMap } = hydrationInfo; if (i18nNodes && dehydratedIcuDataMap) { const renderer = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER]; for (const dehydratedIcuData of dehydratedIcuDataMap.values()) { cleanupDehydratedIcuData(renderer, i18nNodes, dehydratedIcuData); } } hydrationInfo.i18nNodes = undefined; hydrationInfo.dehydratedIcuData = undefined; } } function cleanupDehydratedIcuData(renderer, i18nNodes, dehydratedIcuData) { for (const node of dehydratedIcuData.node.cases[dehydratedIcuData.case]) { const rNode = i18nNodes.get(node.index - _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET); if (rNode) { nativeRemoveNode(renderer, rNode, false); } } } function removeDehydratedViews(lContainer) { const views = lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DEHYDRATED_VIEWS] ?? []; const parentLView = lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PARENT]; const renderer = parentLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER]; const retainedViews = []; for (const view of views) { if (view.data[DEFER_BLOCK_ID] !== undefined) { retainedViews.push(view); } else { removeDehydratedView(view, renderer); ngDevMode && ngDevMode.dehydratedViewsRemoved++; } } lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DEHYDRATED_VIEWS] = retainedViews; } function removeDehydratedViewList(deferBlock) { const { lContainer } = deferBlock; const dehydratedViews = lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DEHYDRATED_VIEWS]; if (dehydratedViews === null) return; const parentLView = lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PARENT]; const renderer = parentLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER]; for (const view of dehydratedViews) { removeDehydratedView(view, renderer); ngDevMode && ngDevMode.dehydratedViewsRemoved++; } } function removeDehydratedView(dehydratedView, renderer) { let nodesRemoved = 0; let currentRNode = dehydratedView.firstChild; if (currentRNode) { const numNodes = dehydratedView.data[NUM_ROOT_NODES]; while (nodesRemoved < numNodes) { ngDevMode && validateSiblingNodeExists(currentRNode); const nextSibling = currentRNode.nextSibling; nativeRemoveNode(renderer, currentRNode, false); currentRNode = nextSibling; nodesRemoved++; } } } function cleanupLContainer(lContainer) { removeDehydratedViews(lContainer); const hostLView = lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HOST]; if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLView)(hostLView)) { cleanupLView(hostLView); } for (let i = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET; i < lContainer.length; i++) { cleanupLView(lContainer[i]); } } function cleanupLView(lView) { cleanupI18nHydrationData(lView); const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; for (let i = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET; i < tView.bindingStartIndex; i++) { if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLContainer)(lView[i])) { const lContainer = lView[i]; cleanupLContainer(lContainer); } else if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLView)(lView[i])) { cleanupLView(lView[i]); } } } function cleanupDehydratedViews(appRef) { const viewRefs = appRef._views; for (const viewRef of viewRefs) { const lNode = getLNodeForHydration(viewRef); if (lNode !== null && lNode[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HOST] !== null) { if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLView)(lNode)) { cleanupLView(lNode); } else { cleanupLContainer(lNode); } ngDevMode && ngDevMode.dehydratedViewsCleanupRuns++; } } } function cleanupHydratedDeferBlocks(deferBlock, hydratedBlocks, registry, appRef) { if (deferBlock !== null) { registry.cleanup(hydratedBlocks); cleanupLContainer(deferBlock.lContainer); cleanupDehydratedViews(appRef); } } function locateDehydratedViewsInContainer(currentRNode, serializedViews) { const dehydratedViews = []; for (const serializedView of serializedViews) { for (let i = 0; i < (serializedView[MULTIPLIER] ?? 1); i++) { const view = { data: serializedView, firstChild: null }; if (serializedView[NUM_ROOT_NODES] > 0) { view.firstChild = currentRNode; currentRNode = siblingAfter(serializedView[NUM_ROOT_NODES], currentRNode); } dehydratedViews.push(view); } } return [currentRNode, dehydratedViews]; } let _findMatchingDehydratedViewImpl = () => null; let _findAndReconcileMatchingDehydratedViewsImpl = () => null; function enableFindMatchingDehydratedViewImpl() { _findMatchingDehydratedViewImpl = findMatchingDehydratedViewImpl; _findAndReconcileMatchingDehydratedViewsImpl = findAndReconcileMatchingDehydratedViewsImpl; } function findMatchingDehydratedViewImpl(lContainer, template) { if (hasMatchingDehydratedView(lContainer, template)) { return lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DEHYDRATED_VIEWS].shift(); } else { removeDehydratedViews(lContainer); return null; } } function findMatchingDehydratedView(lContainer, template) { return _findMatchingDehydratedViewImpl(lContainer, template); } function findAndReconcileMatchingDehydratedViewsImpl(lContainer, templateTNode, hostLView) { if (templateTNode.tView.ssrId === null) return null; const dehydratedView = findMatchingDehydratedView(lContainer, templateTNode.tView.ssrId); if (hostLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW].firstUpdatePass && dehydratedView === null) { removeStaleDehydratedBranch(hostLView, templateTNode); } return dehydratedView; } function findAndReconcileMatchingDehydratedViews(lContainer, templateTNode, hostLView) { return _findAndReconcileMatchingDehydratedViewsImpl(lContainer, templateTNode, hostLView); } function removeStaleDehydratedBranch(hostLView, tNode) { let currentTNode = tNode; while (currentTNode) { if (cleanupMatchingDehydratedViews(hostLView, currentTNode)) return; if ((currentTNode.flags & 256) === 256) { break; } currentTNode = currentTNode.prev; } currentTNode = tNode.next; while (currentTNode) { if ((currentTNode.flags & 512) !== 512) { break; } if (cleanupMatchingDehydratedViews(hostLView, currentTNode)) return; currentTNode = currentTNode.next; } } function hasMatchingDehydratedView(lContainer, template) { const views = lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DEHYDRATED_VIEWS]; if (!template || views === null || views.length === 0) { return false; } return views[0].data[TEMPLATE_ID] === template; } function cleanupMatchingDehydratedViews(hostLView, currentTNode) { const ssrId = currentTNode.tView?.ssrId; if (ssrId == null) return false; const container = hostLView[currentTNode.index]; if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLContainer)(container) && hasMatchingDehydratedView(container, ssrId)) { removeDehydratedViews(container); return true; } return false; } let ComponentRef$1 = class ComponentRef {}; let ComponentFactory$1 = class ComponentFactory {}; class _NullComponentFactoryResolver { resolveComponentFactory(component) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(917, typeof ngDevMode !== 'undefined' && ngDevMode && `No component factory found for ${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringify)(component)}.`); } } let ComponentFactoryResolver$1 = class ComponentFactoryResolver { static NULL = new _NullComponentFactoryResolver(); }; class RendererFactory2 {} class Renderer2 { destroyNode = null; static __NG_ELEMENT_ID__ = () => injectRenderer2(); } function injectRenderer2() { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); const nodeAtIndex = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentLViewByIndex)(tNode.index, lView); return ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLView)(nodeAtIndex) ? nodeAtIndex : lView)[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER]; } class Sanitizer { static ɵprov = /* @__PURE__ */ (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ token: Sanitizer, providedIn: 'root', factory: () => null }); } function isModuleWithProviders(value) { return value.ngModule !== undefined; } function isNgModule(value) { return !!(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNgModuleDef)(value); } function isPipe(value) { return !!(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getPipeDef)(value); } function isDirective(value) { return !!(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getDirectiveDef)(value); } function isComponent(value) { return !!(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentDef)(value); } function getDependencyTypeForError(type) { if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentDef)(type)) return 'component'; if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getDirectiveDef)(type)) return 'directive'; if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getPipeDef)(type)) return 'pipe'; return 'type'; } function verifyStandaloneImport(depType, importingType) { if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isForwardRef)(depType)) { depType = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.resolveForwardRef)(depType); if (!depType) { throw new Error(`Expected forwardRef function, imported from "${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(importingType)}", to return a standalone entity or NgModule but got "${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(depType) || depType}".`); } } if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNgModuleDef)(depType) == null) { const def = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentDef)(depType) || (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getDirectiveDef)(depType) || (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getPipeDef)(depType); if (def != null) { if (!def.standalone) { const type = getDependencyTypeForError(depType); throw new Error(`The "${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(depType)}" ${type}, imported from "${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(importingType)}", is not standalone. Does the ${type} have the standalone: false flag?`); } } else { if (isModuleWithProviders(depType)) { throw new Error(`A module with providers was imported from "${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(importingType)}". Modules with providers are not supported in standalone components imports.`); } else { throw new Error(`The "${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(depType)}" type, imported from "${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(importingType)}", must be a standalone component / directive / pipe or an NgModule. Did you forget to add the required @Component / @Directive / @Pipe or @NgModule annotation?`); } } } } class DepsTracker { ownerNgModule = new Map(); ngModulesWithSomeUnresolvedDecls = new Set(); ngModulesScopeCache = new Map(); standaloneComponentsScopeCache = new Map(); resolveNgModulesDecls() { if (this.ngModulesWithSomeUnresolvedDecls.size === 0) { return; } for (const moduleType of this.ngModulesWithSomeUnresolvedDecls) { const def = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNgModuleDef)(moduleType); if (def?.declarations) { for (const decl of maybeUnwrapFn(def.declarations)) { if (isComponent(decl)) { this.ownerNgModule.set(decl, moduleType); } } } } this.ngModulesWithSomeUnresolvedDecls.clear(); } getComponentDependencies(type, rawImports) { this.resolveNgModulesDecls(); const def = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentDef)(type); if (def === null) { throw new Error(`Attempting to get component dependencies for a type that is not a component: ${type}`); } if (def.standalone) { const scope = this.getStandaloneComponentScope(type, rawImports); if (scope.compilation.isPoisoned) { return { dependencies: [] }; } return { dependencies: [...scope.compilation.directives, ...scope.compilation.pipes, ...scope.compilation.ngModules] }; } else { if (!this.ownerNgModule.has(type)) { return { dependencies: [] }; } const scope = this.getNgModuleScope(this.ownerNgModule.get(type)); if (scope.compilation.isPoisoned) { return { dependencies: [] }; } return { dependencies: [...scope.compilation.directives, ...scope.compilation.pipes] }; } } registerNgModule(type, scopeInfo) { if (!isNgModule(type)) { throw new Error(`Attempting to register a Type which is not NgModule as NgModule: ${type}`); } this.ngModulesWithSomeUnresolvedDecls.add(type); } clearScopeCacheFor(type) { this.ngModulesScopeCache.delete(type); this.standaloneComponentsScopeCache.delete(type); } getNgModuleScope(type) { if (this.ngModulesScopeCache.has(type)) { return this.ngModulesScopeCache.get(type); } const scope = this.computeNgModuleScope(type); this.ngModulesScopeCache.set(type, scope); return scope; } computeNgModuleScope(type) { const def = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNgModuleDefOrThrow)(type); const scope = { exported: { directives: new Set(), pipes: new Set() }, compilation: { directives: new Set(), pipes: new Set() } }; for (const imported of maybeUnwrapFn(def.imports)) { if (isNgModule(imported)) { const importedScope = this.getNgModuleScope(imported); addSet(importedScope.exported.directives, scope.compilation.directives); addSet(importedScope.exported.pipes, scope.compilation.pipes); } else if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isStandalone)(imported)) { if (isDirective(imported) || isComponent(imported)) { scope.compilation.directives.add(imported); } else if (isPipe(imported)) { scope.compilation.pipes.add(imported); } else { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(980, 'The standalone imported type is neither a component nor a directive nor a pipe'); } } else { scope.compilation.isPoisoned = true; break; } } if (!scope.compilation.isPoisoned) { for (const decl of maybeUnwrapFn(def.declarations)) { if (isNgModule(decl) || (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isStandalone)(decl)) { scope.compilation.isPoisoned = true; break; } if (isPipe(decl)) { scope.compilation.pipes.add(decl); } else { scope.compilation.directives.add(decl); } } } for (const exported of maybeUnwrapFn(def.exports)) { if (isNgModule(exported)) { const exportedScope = this.getNgModuleScope(exported); addSet(exportedScope.exported.directives, scope.exported.directives); addSet(exportedScope.exported.pipes, scope.exported.pipes); addSet(exportedScope.exported.directives, scope.compilation.directives); addSet(exportedScope.exported.pipes, scope.compilation.pipes); } else if (isPipe(exported)) { scope.exported.pipes.add(exported); } else { scope.exported.directives.add(exported); } } return scope; } getStandaloneComponentScope(type, rawImports) { if (this.standaloneComponentsScopeCache.has(type)) { return this.standaloneComponentsScopeCache.get(type); } const ans = this.computeStandaloneComponentScope(type, rawImports); this.standaloneComponentsScopeCache.set(type, ans); return ans; } computeStandaloneComponentScope(type, rawImports) { const ans = { compilation: { directives: new Set([type]), pipes: new Set(), ngModules: new Set() } }; for (const rawImport of (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.flatten)(rawImports ?? [])) { const imported = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.resolveForwardRef)(rawImport); try { verifyStandaloneImport(imported, type); } catch (e) { ans.compilation.isPoisoned = true; return ans; } if (isNgModule(imported)) { ans.compilation.ngModules.add(imported); const importedScope = this.getNgModuleScope(imported); if (importedScope.exported.isPoisoned) { ans.compilation.isPoisoned = true; return ans; } addSet(importedScope.exported.directives, ans.compilation.directives); addSet(importedScope.exported.pipes, ans.compilation.pipes); } else if (isPipe(imported)) { ans.compilation.pipes.add(imported); } else if (isDirective(imported) || isComponent(imported)) { ans.compilation.directives.add(imported); } else { ans.compilation.isPoisoned = true; return ans; } } return ans; } isOrphanComponent(cmp) { const def = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentDef)(cmp); if (!def || def.standalone) { return false; } this.resolveNgModulesDecls(); return !this.ownerNgModule.has(cmp); } } function addSet(sourceSet, targetSet) { for (const m of sourceSet) { targetSet.add(m); } } const depsTracker = new DepsTracker(); const NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR = {}; class ChainedInjector { injector; parentInjector; constructor(injector, parentInjector) { this.injector = injector; this.parentInjector = parentInjector; } get(token, notFoundValue, options) { const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, options); if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR || notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) { return value; } return this.parentInjector.get(token, notFoundValue, options); } } function computeStaticStyling(tNode, attrs, writeToHost) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertFirstCreatePass)((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTView)(), 'Expecting to be called in first template pass only'); let styles = writeToHost ? tNode.styles : null; let classes = writeToHost ? tNode.classes : null; let mode = 0; if (attrs !== null) { for (let i = 0; i < attrs.length; i++) { const value = attrs[i]; if (typeof value === 'number') { mode = value; } else if (mode == 1) { classes = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.concatStringsWithSpace)(classes, value); } else if (mode == 2) { const style = value; const styleValue = attrs[++i]; styles = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.concatStringsWithSpace)(styles, style + ': ' + styleValue + ';'); } } } writeToHost ? tNode.styles = styles : tNode.stylesWithoutHost = styles; writeToHost ? tNode.classes = classes : tNode.classesWithoutHost = classes; } function ɵɵdirectiveInject(token, flags = 0) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); if (lView === null) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertInjectImplementationNotEqual)(ɵɵdirectiveInject); return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"])(token, flags); } const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); const value = getOrCreateInjectable(tNode, lView, (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.resolveForwardRef)(token), flags); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.emitInjectEvent)(token, value, flags); return value; } function ɵɵinvalidFactory() { const msg = ngDevMode ? `This constructor was not compatible with Dependency Injection.` : 'invalid'; throw new Error(msg); } function resolveDirectives(tView, lView, tNode, localRefs, directiveMatcher) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertFirstCreatePass)(tView); const exportsMap = localRefs === null ? null : { '': -1 }; const matchedDirectiveDefs = directiveMatcher(tView, tNode); if (matchedDirectiveDefs !== null) { let directiveDefs = matchedDirectiveDefs; let hostDirectiveDefs = null; let hostDirectiveRanges = null; for (const def of matchedDirectiveDefs) { if (def.resolveHostDirectives !== null) { [directiveDefs, hostDirectiveDefs, hostDirectiveRanges] = def.resolveHostDirectives(matchedDirectiveDefs); break; } } ngDevMode && assertNoDuplicateDirectives(directiveDefs); initializeDirectives(tView, lView, tNode, directiveDefs, exportsMap, hostDirectiveDefs, hostDirectiveRanges); } if (exportsMap !== null && localRefs !== null) { cacheMatchingLocalNames(tNode, localRefs, exportsMap); } } function cacheMatchingLocalNames(tNode, localRefs, exportsMap) { const localNames = tNode.localNames = []; for (let i = 0; i < localRefs.length; i += 2) { const index = exportsMap[localRefs[i + 1]]; if (index == null) throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(-301, ngDevMode && `Export of name '${localRefs[i + 1]}' not found!`); localNames.push(localRefs[i], index); } } function markAsComponentHost(tView, hostTNode, componentOffset) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertFirstCreatePass)(tView); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertGreaterThan)(componentOffset, -1, 'componentOffset must be great than -1'); hostTNode.componentOffset = componentOffset; (tView.components ??= []).push(hostTNode.index); } function initializeDirectives(tView, lView, tNode, directives, exportsMap, hostDirectiveDefs, hostDirectiveRanges) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertFirstCreatePass)(tView); const directivesLength = directives.length; let componentDef = null; for (let i = 0; i < directivesLength; i++) { const def = directives[i]; if (componentDef === null && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isComponentDef)(def)) { componentDef = def; markAsComponentHost(tView, tNode, i); } diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, lView), tView, def.type); } initTNodeFlags(tNode, tView.data.length, directivesLength); if (componentDef?.viewProvidersResolver) { componentDef.viewProvidersResolver(componentDef); } for (let i = 0; i < directivesLength; i++) { const def = directives[i]; if (def.providersResolver) { def.providersResolver(def); } } let preOrderHooksFound = false; let preOrderCheckHooksFound = false; let directiveIdx = allocExpando(tView, lView, directivesLength, null); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertSame)(directiveIdx, tNode.directiveStart, 'TNode.directiveStart should point to just allocated space'); if (directivesLength > 0) { tNode.directiveToIndex = new Map(); } for (let i = 0; i < directivesLength; i++) { const def = directives[i]; tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, def.hostAttrs); configureViewWithDirective(tView, tNode, lView, directiveIdx, def); saveNameToExportMap(directiveIdx, def, exportsMap); if (hostDirectiveRanges !== null && hostDirectiveRanges.has(def)) { const [start, end] = hostDirectiveRanges.get(def); tNode.directiveToIndex.set(def.type, [directiveIdx, start + tNode.directiveStart, end + tNode.directiveStart]); } else if (hostDirectiveDefs === null || !hostDirectiveDefs.has(def)) { tNode.directiveToIndex.set(def.type, directiveIdx); } if (def.contentQueries !== null) tNode.flags |= 4; if (def.hostBindings !== null || def.hostAttrs !== null || def.hostVars !== 0) tNode.flags |= 64; const lifeCycleHooks = def.type.prototype; if (!preOrderHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngOnInit || lifeCycleHooks.ngDoCheck)) { (tView.preOrderHooks ??= []).push(tNode.index); preOrderHooksFound = true; } if (!preOrderCheckHooksFound && (lifeCycleHooks.ngOnChanges || lifeCycleHooks.ngDoCheck)) { (tView.preOrderCheckHooks ??= []).push(tNode.index); preOrderCheckHooksFound = true; } directiveIdx++; } initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefs); } function initializeInputAndOutputAliases(tView, tNode, hostDirectiveDefs) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertFirstCreatePass)(tView); for (let index = tNode.directiveStart; index < tNode.directiveEnd; index++) { const directiveDef = tView.data[index]; if (hostDirectiveDefs === null || !hostDirectiveDefs.has(directiveDef)) { setupSelectorMatchedInputsOrOutputs(0, tNode, directiveDef, index); setupSelectorMatchedInputsOrOutputs(1, tNode, directiveDef, index); setupInitialInputs(tNode, index, false); } else { const hostDirectiveDef = hostDirectiveDefs.get(directiveDef); setupHostDirectiveInputsOrOutputs(0, tNode, hostDirectiveDef, index); setupHostDirectiveInputsOrOutputs(1, tNode, hostDirectiveDef, index); setupInitialInputs(tNode, index, true); } } } function setupSelectorMatchedInputsOrOutputs(mode, tNode, def, directiveIndex) { const aliasMap = mode === 0 ? def.inputs : def.outputs; for (const publicName in aliasMap) { if (aliasMap.hasOwnProperty(publicName)) { let bindings; if (mode === 0) { bindings = tNode.inputs ??= {}; } else { bindings = tNode.outputs ??= {}; } bindings[publicName] ??= []; bindings[publicName].push(directiveIndex); setShadowStylingInputFlags(tNode, publicName); } } } function setupHostDirectiveInputsOrOutputs(mode, tNode, config, directiveIndex) { const aliasMap = mode === 0 ? config.inputs : config.outputs; for (const initialName in aliasMap) { if (aliasMap.hasOwnProperty(initialName)) { const publicName = aliasMap[initialName]; let bindings; if (mode === 0) { bindings = tNode.hostDirectiveInputs ??= {}; } else { bindings = tNode.hostDirectiveOutputs ??= {}; } bindings[publicName] ??= []; bindings[publicName].push(directiveIndex, initialName); setShadowStylingInputFlags(tNode, publicName); } } } function setShadowStylingInputFlags(tNode, publicName) { if (publicName === 'class') { tNode.flags |= 8; } else if (publicName === 'style') { tNode.flags |= 16; } } function setupInitialInputs(tNode, directiveIndex, isHostDirective) { const { attrs, inputs, hostDirectiveInputs } = tNode; if (attrs === null || !isHostDirective && inputs === null || isHostDirective && hostDirectiveInputs === null || isInlineTemplate(tNode)) { tNode.initialInputs ??= []; tNode.initialInputs.push(null); return; } let inputsToStore = null; let i = 0; while (i < attrs.length) { const attrName = attrs[i]; if (attrName === 0) { i += 4; continue; } else if (attrName === 5) { i += 2; continue; } else if (typeof attrName === 'number') { break; } if (!isHostDirective && inputs.hasOwnProperty(attrName)) { const inputConfig = inputs[attrName]; for (const index of inputConfig) { if (index === directiveIndex) { inputsToStore ??= []; inputsToStore.push(attrName, attrs[i + 1]); break; } } } else if (isHostDirective && hostDirectiveInputs.hasOwnProperty(attrName)) { const config = hostDirectiveInputs[attrName]; for (let j = 0; j < config.length; j += 2) { if (config[j] === directiveIndex) { inputsToStore ??= []; inputsToStore.push(config[j + 1], attrs[i + 1]); break; } } } i += 2; } tNode.initialInputs ??= []; tNode.initialInputs.push(inputsToStore); } function configureViewWithDirective(tView, tNode, lView, directiveIndex, def) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertGreaterThanOrEqual)(directiveIndex, _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET, 'Must be in Expando section'); tView.data[directiveIndex] = def; const directiveFactory = def.factory || (def.factory = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getFactoryDef)(def.type, true)); const nodeInjectorFactory = new NodeInjectorFactory(directiveFactory, (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isComponentDef)(def), ɵɵdirectiveInject, ngDevMode ? def.type.name : null); tView.blueprint[directiveIndex] = nodeInjectorFactory; lView[directiveIndex] = nodeInjectorFactory; registerHostBindingOpCodes(tView, tNode, directiveIndex, allocExpando(tView, lView, def.hostVars, NO_CHANGE), def); } function registerHostBindingOpCodes(tView, tNode, directiveIdx, directiveVarsIdx, def) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertFirstCreatePass)(tView); const hostBindings = def.hostBindings; if (hostBindings) { let hostBindingOpCodes = tView.hostBindingOpCodes; if (hostBindingOpCodes === null) { hostBindingOpCodes = tView.hostBindingOpCodes = []; } const elementIndx = ~tNode.index; if (lastSelectedElementIdx(hostBindingOpCodes) != elementIndx) { hostBindingOpCodes.push(elementIndx); } hostBindingOpCodes.push(directiveIdx, directiveVarsIdx, hostBindings); } } function lastSelectedElementIdx(hostBindingOpCodes) { let i = hostBindingOpCodes.length; while (i > 0) { const value = hostBindingOpCodes[--i]; if (typeof value === 'number' && value < 0) { return value; } } return 0; } function saveNameToExportMap(directiveIdx, def, exportsMap) { if (exportsMap) { if (def.exportAs) { for (let i = 0; i < def.exportAs.length; i++) { exportsMap[def.exportAs[i]] = directiveIdx; } } if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isComponentDef)(def)) exportsMap[''] = directiveIdx; } } function initTNodeFlags(tNode, index, numberOfDirectives) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNotEqual)(numberOfDirectives, tNode.directiveEnd - tNode.directiveStart, 'Reached the max number of directives'); tNode.flags |= 1; tNode.directiveStart = index; tNode.directiveEnd = index + numberOfDirectives; tNode.providerIndexes = index; } function assertNoDuplicateDirectives(directives) { if (directives.length < 2) { return; } const seenDirectives = new Set(); for (const current of directives) { if (seenDirectives.has(current)) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(309, `Directive ${current.type.name} matches multiple times on the same element. ` + `Directives can only match an element once.`); } seenDirectives.add(current); } } function directiveHostFirstCreatePass(index, lView, type, name, directiveMatcher, bindingsEnabled, attrsIndex, localRefsIndex) { const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertFirstCreatePass)(tView); const tViewConsts = tView.consts; const attrs = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getConstant)(tViewConsts, attrsIndex); const tNode = getOrCreateTNode(tView, index, type, name, attrs); if (bindingsEnabled) { resolveDirectives(tView, lView, tNode, (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getConstant)(tViewConsts, localRefsIndex), directiveMatcher); } tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs); if (tNode.attrs !== null) { computeStaticStyling(tNode, tNode.attrs, false); } if (tNode.mergedAttrs !== null) { computeStaticStyling(tNode, tNode.mergedAttrs, true); } if (tView.queries !== null) { tView.queries.elementStart(tView, tNode); } return tNode; } function directiveHostEndFirstCreatePass(tView, tNode) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertFirstCreatePass)(tView); registerPostOrderHooks(tView, tNode); if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isContentQueryHost)(tNode)) { tView.queries.elementEnd(tNode); } } function domOnlyFirstCreatePass(index, tView, type, name, attrsIndex, localRefsIndex) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertFirstCreatePass)(tView); const tViewConsts = tView.consts; const attrs = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getConstant)(tViewConsts, attrsIndex); const tNode = getOrCreateTNode(tView, index, type, name, attrs); tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs); if (localRefsIndex != null) { const refs = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getConstant)(tViewConsts, localRefsIndex); tNode.localNames = []; for (let i = 0; i < refs.length; i += 2) { tNode.localNames.push(refs[i], -1); } } if (tNode.attrs !== null) { computeStaticStyling(tNode, tNode.attrs, false); } if (tNode.mergedAttrs !== null) { computeStaticStyling(tNode, tNode.mergedAttrs, true); } if (tView.queries !== null) { tView.queries.elementStart(tView, tNode); } return tNode; } function isListLikeIterable(obj) { if (!isJsObject(obj)) return false; return Array.isArray(obj) || !(obj instanceof Map) && Symbol.iterator in obj; } function areIterablesEqual(a, b, comparator) { const iterator1 = a[Symbol.iterator](); const iterator2 = b[Symbol.iterator](); while (true) { const item1 = iterator1.next(); const item2 = iterator2.next(); if (item1.done && item2.done) return true; if (item1.done || item2.done) return false; if (!comparator(item1.value, item2.value)) return false; } } function iterateListLike(obj, fn) { if (Array.isArray(obj)) { for (let i = 0; i < obj.length; i++) { fn(obj[i]); } } else { const iterator = obj[Symbol.iterator](); let item; while (!(item = iterator.next()).done) { fn(item.value); } } } function isJsObject(o) { return o !== null && (typeof o === 'function' || typeof o === 'object'); } function devModeEqual(a, b) { const isListLikeIterableA = isListLikeIterable(a); const isListLikeIterableB = isListLikeIterable(b); if (isListLikeIterableA && isListLikeIterableB) { return areIterablesEqual(a, b, devModeEqual); } else { const isAObject = a && (typeof a === 'object' || typeof a === 'function'); const isBObject = b && (typeof b === 'object' || typeof b === 'function'); if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) { return true; } else { return Object.is(a, b); } } } function updateBinding(lView, bindingIndex, value) { return lView[bindingIndex] = value; } function getBinding(lView, bindingIndex) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertIndexInRange)(lView, bindingIndex); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNotSame)(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.'); return lView[bindingIndex]; } function bindingUpdated(lView, bindingIndex, value) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLessThan)(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`); if (value === NO_CHANGE) { return false; } const oldValue = lView[bindingIndex]; if (Object.is(oldValue, value)) { return false; } else { if (ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isInCheckNoChangesMode)()) { const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined; if (!devModeEqual(oldValueToCompare, value)) { const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value); throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName, lView); } return false; } lView[bindingIndex] = value; return true; } } function bindingUpdated2(lView, bindingIndex, exp1, exp2) { const different = bindingUpdated(lView, bindingIndex, exp1); return bindingUpdated(lView, bindingIndex + 1, exp2) || different; } function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) { const different = bindingUpdated2(lView, bindingIndex, exp1, exp2); return bindingUpdated(lView, bindingIndex + 2, exp3) || different; } function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) { const different = bindingUpdated2(lView, bindingIndex, exp1, exp2); return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different; } const ɵCONTROL = Symbol('CONTROL'); function wrapListener(tNode, lView, listenerFn) { return function wrapListenerIn_markDirtyAndPreventDefault(event) { const startView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isComponentHost)(tNode) ? (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentLViewByIndex)(tNode.index, lView) : lView; markViewDirty(startView, 5); const context = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT]; let result = executeListenerWithErrorHandling(lView, context, listenerFn, event); let nextListenerFn = wrapListenerIn_markDirtyAndPreventDefault.__ngNextListenerFn__; while (nextListenerFn) { result = executeListenerWithErrorHandling(lView, context, nextListenerFn, event) && result; nextListenerFn = nextListenerFn.__ngNextListenerFn__; } return result; }; } function executeListenerWithErrorHandling(lView, context, listenerFn, e) { const prevConsumer = (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(null); try { profiler(ProfilerEvent.OutputStart, context, listenerFn); return listenerFn(e) !== false; } catch (error) { handleUncaughtError(lView, error); return false; } finally { profiler(ProfilerEvent.OutputEnd, context, listenerFn); (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(prevConsumer); } } function listenToDomEvent(tNode, tView, lView, eventTargetResolver, renderer, eventName, originalListener, wrappedListener) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNotSame)(wrappedListener, originalListener, 'Expected wrapped and original listeners to be different.'); const isTNodeDirectiveHost = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isDirectiveHost)(tNode); let hasCoalesced = false; let existingListener = null; if (!eventTargetResolver && isTNodeDirectiveHost) { existingListener = findExistingListener(tView, lView, eventName, tNode.index); } if (existingListener !== null) { const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener; lastListenerFn.__ngNextListenerFn__ = originalListener; existingListener.__ngLastListenerFn__ = originalListener; hasCoalesced = true; } else { const native = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode)(tNode, lView); const target = eventTargetResolver ? eventTargetResolver(native) : native; stashEventListenerImpl(lView, target, eventName, wrappedListener); const cleanupFn = renderer.listen(target, eventName, wrappedListener); if (!isAnimationEventType(eventName)) { const idxOrTargetGetter = eventTargetResolver ? _lView => eventTargetResolver((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(_lView[tNode.index])) : tNode.index; storeListenerCleanup(idxOrTargetGetter, tView, lView, eventName, wrappedListener, cleanupFn, false); } } return hasCoalesced; } function isAnimationEventType(eventName) { return eventName.startsWith('animation') || eventName.startsWith('transition'); } function findExistingListener(tView, lView, eventName, tNodeIndex) { const tCleanup = tView.cleanup; if (tCleanup != null) { for (let i = 0; i < tCleanup.length - 1; i += 2) { const cleanupEventName = tCleanup[i]; if (cleanupEventName === eventName && tCleanup[i + 1] === tNodeIndex) { const lCleanup = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CLEANUP]; const listenerIdxInLCleanup = tCleanup[i + 2]; return lCleanup && lCleanup.length > listenerIdxInLCleanup ? lCleanup[listenerIdxInLCleanup] : null; } if (typeof cleanupEventName === 'string') { i += 2; } } } return null; } function storeListenerCleanup(indexOrTargetGetter, tView, lView, eventName, listenerFn, cleanup, isOutput) { const tCleanup = tView.firstCreatePass ? (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getOrCreateTViewCleanup)(tView) : null; const lCleanup = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getOrCreateLViewCleanup)(lView); const index = lCleanup.length; lCleanup.push(listenerFn, cleanup); tCleanup && tCleanup.push(eventName, indexOrTargetGetter, index, (index + 1) * (isOutput ? -1 : 1)); } function createOutputListener(tNode, lView, listenerFn, targetDef, eventName) { const wrappedListener = wrapListener(tNode, lView, listenerFn); const hasBound = listenToDirectiveOutput(tNode, lView, targetDef, eventName, wrappedListener); if (!hasBound && ngDevMode) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(316, `${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(targetDef.type)} does not have an output with a public name of "${eventName}".`); } } function listenToDirectiveOutput(tNode, lView, target, eventName, listenerFn) { let hostIndex = null; let hostDirectivesStart = null; let hostDirectivesEnd = null; let hasOutput = false; if (ngDevMode && !tNode.directiveToIndex?.has(target.type)) { throw new Error(`Node does not have a directive with type ${target.type.name}`); } const data = tNode.directiveToIndex.get(target.type); if (typeof data === 'number') { hostIndex = data; } else { [hostIndex, hostDirectivesStart, hostDirectivesEnd] = data; } if (hostDirectivesStart !== null && hostDirectivesEnd !== null && tNode.hostDirectiveOutputs?.hasOwnProperty(eventName)) { const hostDirectiveOutputs = tNode.hostDirectiveOutputs[eventName]; for (let i = 0; i < hostDirectiveOutputs.length; i += 2) { const index = hostDirectiveOutputs[i]; if (index >= hostDirectivesStart && index <= hostDirectivesEnd) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertIndexInRange)(lView, index); hasOutput = true; listenToOutput(tNode, lView, index, hostDirectiveOutputs[i + 1], eventName, listenerFn); } else if (index > hostDirectivesEnd) { break; } } } if (target.outputs.hasOwnProperty(eventName)) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertIndexInRange)(lView, hostIndex); hasOutput = true; listenToOutput(tNode, lView, hostIndex, eventName, eventName, listenerFn); } return hasOutput; } function listenToOutput(tNode, lView, directiveIndex, lookupName, eventName, listenerFn) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertIndexInRange)(lView, directiveIndex); const instance = lView[directiveIndex]; const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const def = tView.data[directiveIndex]; const propertyName = def.outputs[lookupName]; const output = instance[propertyName]; if (ngDevMode && !isOutputSubscribable(output)) { throw new Error(`@Output ${propertyName} not initialized in '${instance.constructor.name}'.`); } const subscription = output.subscribe(listenerFn); storeListenerCleanup(tNode.index, tView, lView, eventName, listenerFn, subscription, true); } function isOutputSubscribable(value) { return value != null && typeof value.subscribe === 'function'; } const BINDING = /* @__PURE__ */Symbol('BINDING'); const INPUT_BINDING_METADATA = { kind: 'input', requiredVars: 1 }; const FIELD_BINDING_METADATA = { kind: 'field', requiredVars: 2 }; const OUTPUT_BINDING_METADATA = { kind: 'output', requiredVars: 0 }; function inputBindingUpdate(targetDirectiveIdx, publicName, value) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const bindingIndex = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.nextBindingIndex)(); if (bindingUpdated(lView, bindingIndex, value)) { const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getSelectedTNode)(); const componentLView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentLViewByIndex)(tNode.index, lView); markViewDirty(componentLView, 1); const targetDef = tView.directiveRegistry[targetDirectiveIdx]; if (ngDevMode && !targetDef) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(315, `Input binding to property "${publicName}" does not have a target.`); } const hasSet = setDirectiveInput(tNode, tView, lView, targetDef, publicName, value); if (ngDevMode) { if (!hasSet) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(315, `${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(targetDef.type)} does not have an input with a public name of "${publicName}".`); } storePropertyBindingMetadata(tView.data, tNode, publicName, bindingIndex); } } } function controlBinding(binding, tNode) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const directive = lView[tNode.directiveStart + binding.targetIdx]; return directive[ɵCONTROL]; } function inputBinding(publicName, value) { if (publicName === 'formField') { const binding = { [BINDING]: FIELD_BINDING_METADATA, create: () => { controlBinding(binding, (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)())?.create(); }, update: () => { inputBindingUpdate(binding.targetIdx, publicName, value()); controlBinding(binding, (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getSelectedTNode)())?.update(); } }; return binding; } const binding = { [BINDING]: INPUT_BINDING_METADATA, update: () => inputBindingUpdate(binding.targetIdx, publicName, value()) }; return binding; } function outputBinding(eventName, listener) { const binding = { [BINDING]: OUTPUT_BINDING_METADATA, create: () => { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const targetDef = tView.directiveRegistry[binding.targetIdx]; createOutputListener(tNode, lView, listener, targetDef, eventName); } }; return binding; } function twoWayBinding(publicName, value) { const input = inputBinding(publicName, value); const output = outputBinding(publicName + 'Change', eventValue => value.set(eventValue)); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNotDefined)(input.create, 'Unexpected `create` callback in inputBinding'); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNotDefined)(output.update, 'Unexpected `update` callback in outputBinding'); const binding = { [BINDING]: { kind: 'twoWay', requiredVars: input[BINDING].requiredVars + output[BINDING].requiredVars }, set targetIdx(idx) { input.targetIdx = idx; output.targetIdx = idx; }, create: output.create, update: input.update }; return binding; } class ComponentFactoryResolver extends ComponentFactoryResolver$1 { ngModule; constructor(ngModule) { super(); this.ngModule = ngModule; } resolveComponentFactory(component) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertComponentType)(component); const componentDef = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentDef)(component); return new ComponentFactory(componentDef, this.ngModule); } } function toInputRefArray(map) { return Object.keys(map).map(name => { const [propName, flags, transform] = map[name]; const inputData = { propName: propName, templateName: name, isSignal: (flags & InputFlags.SignalBased) !== 0 }; if (transform) { inputData.transform = transform; } return inputData; }); } function toOutputRefArray(map) { return Object.keys(map).map(name => ({ propName: map[name], templateName: name })); } function verifyNotAnOrphanComponent(componentDef) { if ((typeof ngJitMode === 'undefined' || ngJitMode) && componentDef.debugInfo?.forbidOrphanRendering) { if (depsTracker.isOrphanComponent(componentDef.type)) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(981, `Orphan component found! Trying to render the component ${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.debugStringifyTypeForError)(componentDef.type)} without first loading the NgModule that declares it. It is recommended to make this component standalone in order to avoid this error. If this is not possible now, import the component's NgModule in the appropriate NgModule, or the standalone component in which you are trying to render this component. If this is a lazy import, load the NgModule lazily as well and use its module injector.`); } } } function createRootViewInjector(componentDef, environmentInjector, injector) { let realEnvironmentInjector = environmentInjector instanceof _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EnvironmentInjector ? environmentInjector : environmentInjector?.injector; if (realEnvironmentInjector && componentDef.getStandaloneInjector !== null) { realEnvironmentInjector = componentDef.getStandaloneInjector(realEnvironmentInjector) || realEnvironmentInjector; } const rootViewInjector = realEnvironmentInjector ? new ChainedInjector(injector, realEnvironmentInjector) : injector; return rootViewInjector; } function createRootLViewEnvironment(rootLViewInjector) { const rendererFactory = rootLViewInjector.get(RendererFactory2, null); if (rendererFactory === null) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(407, ngDevMode && 'Angular was not able to inject a renderer (RendererFactory2). ' + 'Likely this is due to a broken DI hierarchy. ' + 'Make sure that any injector used to create this component has a correct parent.'); } const sanitizer = rootLViewInjector.get(Sanitizer, null); const changeDetectionScheduler = rootLViewInjector.get(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ChangeDetectionScheduler, null); let ngReflect = false; if (typeof ngDevMode === 'undefined' || ngDevMode) { ngReflect = rootLViewInjector.get(NG_REFLECT_ATTRS_FLAG, NG_REFLECT_ATTRS_FLAG_DEFAULT); } return { rendererFactory, sanitizer, changeDetectionScheduler, ngReflect }; } function createHostElement(componentDef, renderer) { const tagName = inferTagNameFromDefinition(componentDef); const namespace = tagName === 'svg' ? _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.SVG_NAMESPACE : tagName === 'math' ? _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.MATH_ML_NAMESPACE : null; return createElementNode(renderer, tagName, namespace); } function inferTagNameFromDefinition(componentDef) { return (componentDef.selectors[0][0] || 'div').toLowerCase(); } class ComponentFactory extends ComponentFactory$1 { componentDef; ngModule; selector; componentType; ngContentSelectors; isBoundToModule; cachedInputs = null; cachedOutputs = null; get inputs() { this.cachedInputs ??= toInputRefArray(this.componentDef.inputs); return this.cachedInputs; } get outputs() { this.cachedOutputs ??= toOutputRefArray(this.componentDef.outputs); return this.cachedOutputs; } constructor(componentDef, ngModule) { super(); this.componentDef = componentDef; this.ngModule = ngModule; this.componentType = componentDef.type; this.selector = stringifyCSSSelectorList(componentDef.selectors); this.ngContentSelectors = componentDef.ngContentSelectors ?? []; this.isBoundToModule = !!ngModule; } create(injector, projectableNodes, rootSelectorOrNode, environmentInjector, directives, componentBindings) { profiler(ProfilerEvent.DynamicComponentStart); const prevConsumer = (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(null); try { const cmpDef = this.componentDef; ngDevMode && verifyNotAnOrphanComponent(cmpDef); const rootTView = createRootTView(rootSelectorOrNode, cmpDef, componentBindings, directives); const rootViewInjector = createRootViewInjector(cmpDef, environmentInjector || this.ngModule, injector); const environment = createRootLViewEnvironment(rootViewInjector); const hostRenderer = environment.rendererFactory.createRenderer(null, cmpDef); const hostElement = rootSelectorOrNode ? locateHostElement(hostRenderer, rootSelectorOrNode, cmpDef.encapsulation, rootViewInjector) : createHostElement(cmpDef, hostRenderer); const hasInputBindings = componentBindings?.some(isInputBinding) || directives?.some(d => typeof d !== 'function' && d.bindings.some(isInputBinding)); const rootLView = createLView(null, rootTView, null, 512 | getInitialLViewFlagsFromDef(cmpDef), null, null, environment, hostRenderer, rootViewInjector, null, retrieveHydrationInfo(hostElement, rootViewInjector, true)); rootLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET] = hostElement; (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.enterView)(rootLView); let componentView = null; try { const hostTNode = directiveHostFirstCreatePass(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET, rootLView, 2, '#host', () => rootTView.directiveRegistry, true, 0); setupStaticAttributes(hostRenderer, hostElement, hostTNode); attachPatchData(hostElement, rootLView); createDirectivesInstances(rootTView, rootLView, hostTNode); executeContentQueries(rootTView, hostTNode, rootLView); directiveHostEndFirstCreatePass(rootTView, hostTNode); if (projectableNodes !== undefined) { projectNodes(hostTNode, this.ngContentSelectors, projectableNodes); } componentView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentLViewByIndex)(hostTNode.index, rootLView); rootLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT] = componentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT]; renderView(rootTView, rootLView, null); } catch (e) { if (componentView !== null) { unregisterLView(componentView); } unregisterLView(rootLView); throw e; } finally { profiler(ProfilerEvent.DynamicComponentEnd); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.leaveView)(); } return new ComponentRef(this.componentType, rootLView, !!hasInputBindings); } finally { (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(prevConsumer); } } } function createRootTView(rootSelectorOrNode, componentDef, componentBindings, directives) { const tAttributes = rootSelectorOrNode ? ['ng-version', '21.1.2'] : extractAttrsAndClassesFromSelector(componentDef.selectors[0]); let creationBindings = null; let updateBindings = null; let varsToAllocate = 0; if (componentBindings) { for (const binding of componentBindings) { varsToAllocate += binding[BINDING].requiredVars; if (binding.create) { binding.targetIdx = 0; (creationBindings ??= []).push(binding); } if (binding.update) { binding.targetIdx = 0; (updateBindings ??= []).push(binding); } } } if (directives) { for (let i = 0; i < directives.length; i++) { const directive = directives[i]; if (typeof directive !== 'function') { for (const binding of directive.bindings) { varsToAllocate += binding[BINDING].requiredVars; const targetDirectiveIdx = i + 1; if (binding.create) { binding.targetIdx = targetDirectiveIdx; (creationBindings ??= []).push(binding); } if (binding.update) { binding.targetIdx = targetDirectiveIdx; (updateBindings ??= []).push(binding); } } } } } const directivesToApply = [componentDef]; if (directives) { for (const directive of directives) { const directiveType = typeof directive === 'function' ? directive : directive.type; const directiveDef = ngDevMode ? (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getDirectiveDefOrThrow)(directiveType) : (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getDirectiveDef)(directiveType); if (ngDevMode && !directiveDef.standalone) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(907, `The ${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(directiveType)} directive must be standalone in ` + `order to be applied to a dynamically-created component.`); } directivesToApply.push(directiveDef); } } const rootTView = createTView(0, null, getRootTViewTemplate(creationBindings, updateBindings), 1, varsToAllocate, directivesToApply, null, null, null, [tAttributes], null); return rootTView; } function getRootTViewTemplate(creationBindings, updateBindings) { if (!creationBindings && !updateBindings) { return null; } return flags => { if (flags & 1 && creationBindings) { for (const binding of creationBindings) { binding.create(); } } if (flags & 2 && updateBindings) { for (const binding of updateBindings) { binding.update(); } } }; } function isInputBinding(binding) { const kind = binding[BINDING].kind; return kind === 'input' || kind === 'twoWay'; } class ComponentRef extends ComponentRef$1 { _rootLView; _hasInputBindings; instance; hostView; changeDetectorRef; componentType; location; previousInputValues = null; _tNode; constructor(componentType, _rootLView, _hasInputBindings) { super(); this._rootLView = _rootLView; this._hasInputBindings = _hasInputBindings; this._tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTNode)(_rootLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET); this.location = createElementRef(this._tNode, _rootLView); this.instance = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentLViewByIndex)(this._tNode.index, _rootLView)[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT]; this.hostView = this.changeDetectorRef = new ViewRef(_rootLView, undefined); this.componentType = componentType; } setInput(name, value) { if (this._hasInputBindings && ngDevMode) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(317, 'Cannot call `setInput` on a component that is using the `inputBinding` or `twoWayBinding` functions.'); } const tNode = this._tNode; this.previousInputValues ??= new Map(); if (this.previousInputValues.has(name) && Object.is(this.previousInputValues.get(name), value)) { return; } const lView = this._rootLView; const hasSetInput = setAllInputsForProperty(tNode, lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], lView, name, value); this.previousInputValues.set(name, value); const childComponentLView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentLViewByIndex)(tNode.index, lView); markViewDirty(childComponentLView, 1); if (ngDevMode && !hasSetInput) { const cmpNameForError = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(this.componentType); let message = `Can't set value of the '${name}' input on the '${cmpNameForError}' component. `; message += `Make sure that the '${name}' property is declared as an input using the input() or model() function or the @Input() decorator.`; reportUnknownPropertyError(message); } } get injector() { return new NodeInjector(this._tNode, this._rootLView); } destroy() { this.hostView.destroy(); } onDestroy(callback) { this.hostView.onDestroy(callback); } } function projectNodes(tNode, ngContentSelectors, projectableNodes) { const projection = tNode.projection = []; for (let i = 0; i < ngContentSelectors.length; i++) { const nodesforSlot = projectableNodes[i]; projection.push(nodesforSlot != null && nodesforSlot.length ? Array.from(nodesforSlot) : null); } } class ViewContainerRef { static __NG_ELEMENT_ID__ = injectViewContainerRef; } function injectViewContainerRef() { const previousTNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); return createContainerRef(previousTNode, (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)()); } const VE_ViewContainerRef = ViewContainerRef; const R3ViewContainerRef = class ViewContainerRef extends VE_ViewContainerRef { _lContainer; _hostTNode; _hostLView; constructor(_lContainer, _hostTNode, _hostLView) { super(); this._lContainer = _lContainer; this._hostTNode = _hostTNode; this._hostLView = _hostLView; } get element() { return createElementRef(this._hostTNode, this._hostLView); } get injector() { return new NodeInjector(this._hostTNode, this._hostLView); } get parentInjector() { const parentLocation = getParentInjectorLocation(this._hostTNode, this._hostLView); if (hasParentInjector(parentLocation)) { const parentView = getParentInjectorView(parentLocation, this._hostLView); const injectorIndex = getParentInjectorIndex(parentLocation); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNodeInjector)(parentView, injectorIndex); const parentTNode = parentView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW].data[injectorIndex + 8]; return new NodeInjector(parentTNode, parentView); } else { return new NodeInjector(null, this._hostLView); } } clear() { while (this.length > 0) { this.remove(this.length - 1); } } get(index) { const viewRefs = getViewRefs(this._lContainer); return viewRefs !== null && viewRefs[index] || null; } get length() { return this._lContainer.length - _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET; } createEmbeddedView(templateRef, context, indexOrOptions) { let index; let injector; if (typeof indexOrOptions === 'number') { index = indexOrOptions; } else if (indexOrOptions != null) { index = indexOrOptions.index; injector = indexOrOptions.injector; } const dehydratedView = findMatchingDehydratedView(this._lContainer, templateRef.ssrId); const viewRef = templateRef.createEmbeddedViewImpl(context || {}, injector, dehydratedView); this.insertImpl(viewRef, index, shouldAddViewToDom(this._hostTNode, dehydratedView)); return viewRef; } createComponent(componentFactoryOrType, indexOrOptions, injector, projectableNodes, environmentInjector, directives, bindings) { const isComponentFactory = componentFactoryOrType && !isType(componentFactoryOrType); let index; if (isComponentFactory) { if (ngDevMode) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(typeof indexOrOptions !== 'object', true, 'It looks like Component factory was provided as the first argument ' + 'and an options object as the second argument. This combination of arguments ' + 'is incompatible. You can either change the first argument to provide Component ' + 'type or change the second argument to be a number (representing an index at ' + "which to insert the new component's host view into this container)"); } index = indexOrOptions; } else { if (ngDevMode) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentDef)(componentFactoryOrType), `Provided Component class doesn't contain Component definition. ` + `Please check whether provided class has @Component decorator.`); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(typeof indexOrOptions !== 'number', true, 'It looks like Component type was provided as the first argument ' + "and a number (representing an index at which to insert the new component's " + 'host view into this container as the second argument. This combination of arguments ' + 'is incompatible. Please use an object as the second argument instead.'); } const options = indexOrOptions || {}; if (ngDevMode && options.environmentInjector && options.ngModuleRef) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)(`Cannot pass both environmentInjector and ngModuleRef options to createComponent().`); } index = options.index; injector = options.injector; projectableNodes = options.projectableNodes; environmentInjector = options.environmentInjector || options.ngModuleRef; directives = options.directives; bindings = options.bindings; } const componentFactory = isComponentFactory ? componentFactoryOrType : new ComponentFactory((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentDef)(componentFactoryOrType)); const contextInjector = injector || this.parentInjector; if (!environmentInjector && componentFactory.ngModule == null) { const _injector = isComponentFactory ? contextInjector : this.parentInjector; const result = _injector.get(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EnvironmentInjector, null); if (result) { environmentInjector = result; } } const componentDef = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentDef)(componentFactory.componentType ?? {}); const dehydratedView = findMatchingDehydratedView(this._lContainer, componentDef?.id ?? null); const rNode = dehydratedView?.firstChild ?? null; const componentRef = componentFactory.create(contextInjector, projectableNodes, rNode, environmentInjector, directives, bindings); this.insertImpl(componentRef.hostView, index, shouldAddViewToDom(this._hostTNode, dehydratedView)); return componentRef; } insert(viewRef, index) { return this.insertImpl(viewRef, index, true); } insertImpl(viewRef, index, addToDOM) { const lView = viewRef._lView; if (ngDevMode && viewRef.destroyed) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(922, ngDevMode && 'Cannot insert a destroyed View in a ViewContainer!'); } if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.viewAttachedToContainer)(lView)) { const prevIdx = this.indexOf(viewRef); if (prevIdx !== -1) { this.detach(prevIdx); } else { const prevLContainer = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PARENT]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLContainer)(prevLContainer), true, 'An attached view should have its PARENT point to a container.'); const prevVCRef = new R3ViewContainerRef(prevLContainer, prevLContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.T_HOST], prevLContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PARENT]); prevVCRef.detach(prevVCRef.indexOf(viewRef)); } } const adjustedIdx = this._adjustIndex(index); const lContainer = this._lContainer; addLViewToLContainer(lContainer, lView, adjustedIdx, addToDOM); viewRef.attachToViewContainerRef(); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.addToArray)(getOrCreateViewRefs(lContainer), adjustedIdx, viewRef); return viewRef; } move(viewRef, newIndex) { if (ngDevMode && viewRef.destroyed) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(923, ngDevMode && 'Cannot move a destroyed View in a ViewContainer!'); } return this.insert(viewRef, newIndex); } indexOf(viewRef) { const viewRefsArr = getViewRefs(this._lContainer); return viewRefsArr !== null ? viewRefsArr.indexOf(viewRef) : -1; } remove(index) { const adjustedIdx = this._adjustIndex(index, -1); const detachedView = detachView(this._lContainer, adjustedIdx); if (detachedView) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.removeFromArray)(getOrCreateViewRefs(this._lContainer), adjustedIdx); destroyLView(detachedView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], detachedView); } } detach(index) { const adjustedIdx = this._adjustIndex(index, -1); const view = detachView(this._lContainer, adjustedIdx); const wasDetached = view && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.removeFromArray)(getOrCreateViewRefs(this._lContainer), adjustedIdx) != null; return wasDetached ? new ViewRef(view) : null; } _adjustIndex(index, shift = 0) { if (index == null) { return this.length + shift; } if (ngDevMode) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertGreaterThan)(index, -1, `ViewRef index must be positive, got ${index}`); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLessThan)(index, this.length + 1 + shift, 'index'); } return index; } }; function getViewRefs(lContainer) { return lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.VIEW_REFS]; } function getOrCreateViewRefs(lContainer) { return lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.VIEW_REFS] || (lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.VIEW_REFS] = []); } function createContainerRef(hostTNode, hostLView) { ngDevMode && assertTNodeType(hostTNode, 12 | 3); let lContainer; const slotValue = hostLView[hostTNode.index]; if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLContainer)(slotValue)) { lContainer = slotValue; } else { lContainer = createLContainer(slotValue, hostLView, null, hostTNode); hostLView[hostTNode.index] = lContainer; addToEndOfViewTree(hostLView, lContainer); } _locateOrCreateAnchorNode(lContainer, hostLView, hostTNode, slotValue); return new R3ViewContainerRef(lContainer, hostTNode, hostLView); } function insertAnchorNode(hostLView, hostTNode) { const renderer = hostLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER]; const commentNode = renderer.createComment(ngDevMode ? 'container' : ''); const hostNative = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode)(hostTNode, hostLView); const parentOfHostNative = renderer.parentNode(hostNative); nativeInsertBefore(renderer, parentOfHostNative, commentNode, renderer.nextSibling(hostNative), false); return commentNode; } let _locateOrCreateAnchorNode = createAnchorNode; let _populateDehydratedViewsInLContainer = () => false; function populateDehydratedViewsInLContainer(lContainer, tNode, hostLView) { return _populateDehydratedViewsInLContainer(lContainer, tNode, hostLView); } function createAnchorNode(lContainer, hostLView, hostTNode, slotValue) { if (lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NATIVE]) return; let commentNode; if (hostTNode.type & 8) { commentNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.unwrapRNode)(slotValue); } else { commentNode = insertAnchorNode(hostLView, hostTNode); } lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NATIVE] = commentNode; } function populateDehydratedViewsInLContainerImpl(lContainer, tNode, hostLView) { if (lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NATIVE] && lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DEHYDRATED_VIEWS]) { return true; } const hydrationInfo = hostLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HYDRATION]; const noOffsetIndex = tNode.index - _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET; const isNodeCreationMode = !hydrationInfo || isInSkipHydrationBlock(tNode) || isDisconnectedNode$1(hydrationInfo, noOffsetIndex); if (isNodeCreationMode) { return false; } const currentRNode = getSegmentHead(hydrationInfo, noOffsetIndex); const serializedViews = hydrationInfo.data[CONTAINERS]?.[noOffsetIndex]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(serializedViews, 'Unexpected state: no hydration info available for a given TNode, ' + 'which represents a view container.'); const [commentNode, dehydratedViews] = locateDehydratedViewsInContainer(currentRNode, serializedViews); if (ngDevMode) { validateMatchingNode(commentNode, Node.COMMENT_NODE, null, hostLView, tNode, true); markRNodeAsClaimedByHydration(commentNode, false); } lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NATIVE] = commentNode; lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DEHYDRATED_VIEWS] = dehydratedViews; return true; } function locateOrCreateAnchorNode(lContainer, hostLView, hostTNode, slotValue) { if (!_populateDehydratedViewsInLContainer(lContainer, hostTNode, hostLView)) { createAnchorNode(lContainer, hostLView, hostTNode, slotValue); } } function enableLocateOrCreateContainerRefImpl() { _locateOrCreateAnchorNode = locateOrCreateAnchorNode; _populateDehydratedViewsInLContainer = populateDehydratedViewsInLContainerImpl; } class LQuery_ { queryList; matches = null; constructor(queryList) { this.queryList = queryList; } clone() { return new LQuery_(this.queryList); } setDirty() { this.queryList.setDirty(); } } class LQueries_ { queries; constructor(queries = []) { this.queries = queries; } createEmbeddedView(tView) { const tQueries = tView.queries; if (tQueries !== null) { const noOfInheritedQueries = tView.contentQueries !== null ? tView.contentQueries[0] : tQueries.length; const viewLQueries = []; for (let i = 0; i < noOfInheritedQueries; i++) { const tQuery = tQueries.getByIndex(i); const parentLQuery = this.queries[tQuery.indexInDeclarationView]; viewLQueries.push(parentLQuery.clone()); } return new LQueries_(viewLQueries); } return null; } insertView(tView) { this.dirtyQueriesWithMatches(tView); } detachView(tView) { this.dirtyQueriesWithMatches(tView); } finishViewCreation(tView) { this.dirtyQueriesWithMatches(tView); } dirtyQueriesWithMatches(tView) { for (let i = 0; i < this.queries.length; i++) { if (getTQuery(tView, i).matches !== null) { this.queries[i].setDirty(); } } } } class TQueryMetadata_ { flags; read; predicate; constructor(predicate, flags, read = null) { this.flags = flags; this.read = read; if (typeof predicate === 'string') { this.predicate = splitQueryMultiSelectors(predicate); } else { this.predicate = predicate; } } } class TQueries_ { queries; constructor(queries = []) { this.queries = queries; } elementStart(tView, tNode) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertFirstCreatePass)(tView, 'Queries should collect results on the first template pass only'); for (let i = 0; i < this.queries.length; i++) { this.queries[i].elementStart(tView, tNode); } } elementEnd(tNode) { for (let i = 0; i < this.queries.length; i++) { this.queries[i].elementEnd(tNode); } } embeddedTView(tNode) { let queriesForTemplateRef = null; for (let i = 0; i < this.length; i++) { const childQueryIndex = queriesForTemplateRef !== null ? queriesForTemplateRef.length : 0; const tqueryClone = this.getByIndex(i).embeddedTView(tNode, childQueryIndex); if (tqueryClone) { tqueryClone.indexInDeclarationView = i; if (queriesForTemplateRef !== null) { queriesForTemplateRef.push(tqueryClone); } else { queriesForTemplateRef = [tqueryClone]; } } } return queriesForTemplateRef !== null ? new TQueries_(queriesForTemplateRef) : null; } template(tView, tNode) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertFirstCreatePass)(tView, 'Queries should collect results on the first template pass only'); for (let i = 0; i < this.queries.length; i++) { this.queries[i].template(tView, tNode); } } getByIndex(index) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertIndexInRange)(this.queries, index); return this.queries[index]; } get length() { return this.queries.length; } track(tquery) { this.queries.push(tquery); } } class TQuery_ { metadata; matches = null; indexInDeclarationView = -1; crossesNgTemplate = false; _declarationNodeIndex; _appliesToNextNode = true; constructor(metadata, nodeIndex = -1) { this.metadata = metadata; this._declarationNodeIndex = nodeIndex; } elementStart(tView, tNode) { if (this.isApplyingToNode(tNode)) { this.matchTNode(tView, tNode); } } elementEnd(tNode) { if (this._declarationNodeIndex === tNode.index) { this._appliesToNextNode = false; } } template(tView, tNode) { this.elementStart(tView, tNode); } embeddedTView(tNode, childQueryIndex) { if (this.isApplyingToNode(tNode)) { this.crossesNgTemplate = true; this.addMatch(-tNode.index, childQueryIndex); return new TQuery_(this.metadata); } return null; } isApplyingToNode(tNode) { if (this._appliesToNextNode && (this.metadata.flags & 1) !== 1) { const declarationNodeIdx = this._declarationNodeIndex; let parent = tNode.parent; while (parent !== null && parent.type & 8 && parent.index !== declarationNodeIdx) { parent = parent.parent; } return declarationNodeIdx === (parent !== null ? parent.index : -1); } return this._appliesToNextNode; } matchTNode(tView, tNode) { const predicate = this.metadata.predicate; if (Array.isArray(predicate)) { for (let i = 0; i < predicate.length; i++) { const name = predicate[i]; this.matchTNodeWithReadOption(tView, tNode, getIdxOfMatchingSelector(tNode, name)); this.matchTNodeWithReadOption(tView, tNode, locateDirectiveOrProvider(tNode, tView, name, false, false)); } } else { if (predicate === TemplateRef) { if (tNode.type & 4) { this.matchTNodeWithReadOption(tView, tNode, -1); } } else { this.matchTNodeWithReadOption(tView, tNode, locateDirectiveOrProvider(tNode, tView, predicate, false, false)); } } } matchTNodeWithReadOption(tView, tNode, nodeMatchIdx) { if (nodeMatchIdx !== null) { const read = this.metadata.read; if (read !== null) { if (read === ElementRef || read === ViewContainerRef || read === TemplateRef && tNode.type & 4) { this.addMatch(tNode.index, -2); } else { const directiveOrProviderIdx = locateDirectiveOrProvider(tNode, tView, read, false, false); if (directiveOrProviderIdx !== null) { this.addMatch(tNode.index, directiveOrProviderIdx); } } } else { this.addMatch(tNode.index, nodeMatchIdx); } } } addMatch(tNodeIdx, matchIdx) { if (this.matches === null) { this.matches = [tNodeIdx, matchIdx]; } else { this.matches.push(tNodeIdx, matchIdx); } } } function getIdxOfMatchingSelector(tNode, selector) { const localNames = tNode.localNames; if (localNames !== null) { for (let i = 0; i < localNames.length; i += 2) { if (localNames[i] === selector) { return localNames[i + 1]; } } } return null; } function createResultByTNodeType(tNode, currentView) { if (tNode.type & (3 | 8)) { return createElementRef(tNode, currentView); } else if (tNode.type & 4) { return createTemplateRef(tNode, currentView); } return null; } function createResultForNode(lView, tNode, matchingIdx, read) { if (matchingIdx === -1) { return createResultByTNodeType(tNode, lView); } else if (matchingIdx === -2) { return createSpecialToken(lView, tNode, read); } else { return getNodeInjectable(lView, lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], matchingIdx, tNode); } } function createSpecialToken(lView, tNode, read) { if (read === ElementRef) { return createElementRef(tNode, lView); } else if (read === TemplateRef) { return createTemplateRef(tNode, lView); } else if (read === ViewContainerRef) { ngDevMode && assertTNodeType(tNode, 3 | 12); return createContainerRef(tNode, lView); } else { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)(`Special token to read should be one of ElementRef, TemplateRef or ViewContainerRef but got ${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringify)(read)}.`); } } function materializeViewResults(tView, lView, tQuery, queryIndex) { const lQuery = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.QUERIES].queries[queryIndex]; if (lQuery.matches === null) { const tViewData = tView.data; const tQueryMatches = tQuery.matches; const result = []; for (let i = 0; tQueryMatches !== null && i < tQueryMatches.length; i += 2) { const matchedNodeIdx = tQueryMatches[i]; if (matchedNodeIdx < 0) { result.push(null); } else { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertIndexInRange)(tViewData, matchedNodeIdx); const tNode = tViewData[matchedNodeIdx]; result.push(createResultForNode(lView, tNode, tQueryMatches[i + 1], tQuery.metadata.read)); } } lQuery.matches = result; } return lQuery.matches; } function collectQueryResults(tView, lView, queryIndex, result) { const tQuery = tView.queries.getByIndex(queryIndex); const tQueryMatches = tQuery.matches; if (tQueryMatches !== null) { const lViewResults = materializeViewResults(tView, lView, tQuery, queryIndex); for (let i = 0; i < tQueryMatches.length; i += 2) { const tNodeIdx = tQueryMatches[i]; if (tNodeIdx > 0) { result.push(lViewResults[i / 2]); } else { const childQueryIndex = tQueryMatches[i + 1]; const declarationLContainer = lView[-tNodeIdx]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLContainer)(declarationLContainer); for (let i = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET; i < declarationLContainer.length; i++) { const embeddedLView = declarationLContainer[i]; if (embeddedLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_LCONTAINER] === embeddedLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PARENT]) { collectQueryResults(embeddedLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], embeddedLView, childQueryIndex, result); } } if (declarationLContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.MOVED_VIEWS] !== null) { const embeddedLViews = declarationLContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.MOVED_VIEWS]; for (let i = 0; i < embeddedLViews.length; i++) { const embeddedLView = embeddedLViews[i]; collectQueryResults(embeddedLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], embeddedLView, childQueryIndex, result); } } } } } return result; } function loadQueryInternal(lView, queryIndex) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.QUERIES], 'LQueries should be defined when trying to load a query'); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertIndexInRange)(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.QUERIES].queries, queryIndex); return lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.QUERIES].queries[queryIndex].queryList; } function createLQuery(tView, lView, flags) { const queryList = new QueryList((flags & 4) === 4); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.storeCleanupWithContext)(tView, lView, queryList, queryList.destroy); const lQueries = (lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.QUERIES] ??= new LQueries_()).queries; return lQueries.push(new LQuery_(queryList)) - 1; } function createViewQuery(predicate, flags, read) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNumber)(flags, 'Expecting flags'); const tView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTView)(); if (tView.firstCreatePass) { createTQuery(tView, new TQueryMetadata_(predicate, flags, read), -1); if ((flags & 2) === 2) { tView.staticViewQueries = true; } } return createLQuery(tView, (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(), flags); } function createContentQuery(directiveIndex, predicate, flags, read) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNumber)(flags, 'Expecting flags'); const tView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTView)(); if (tView.firstCreatePass) { const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); createTQuery(tView, new TQueryMetadata_(predicate, flags, read), tNode.index); saveContentQueryAndDirectiveIndex(tView, directiveIndex); if ((flags & 2) === 2) { tView.staticContentQueries = true; } } return createLQuery(tView, (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(), flags); } function splitQueryMultiSelectors(locator) { return locator.split(',').map(s => s.trim()); } function createTQuery(tView, metadata, nodeIndex) { if (tView.queries === null) tView.queries = new TQueries_(); tView.queries.track(new TQuery_(metadata, nodeIndex)); } function saveContentQueryAndDirectiveIndex(tView, directiveIndex) { const tViewContentQueries = tView.contentQueries || (tView.contentQueries = []); const lastSavedDirectiveIndex = tViewContentQueries.length ? tViewContentQueries[tViewContentQueries.length - 1] : -1; if (directiveIndex !== lastSavedDirectiveIndex) { tViewContentQueries.push(tView.queries.length - 1, directiveIndex); } } function getTQuery(tView, index) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(tView.queries, 'TQueries must be defined to retrieve a TQuery'); return tView.queries.getByIndex(index); } function getQueryResults(lView, queryIndex) { const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const tQuery = getTQuery(tView, queryIndex); return tQuery.crossesNgTemplate ? collectQueryResults(tView, lView, queryIndex, []) : materializeViewResults(tView, lView, tQuery, queryIndex); } function createQuerySignalFn(firstOnly, required, opts) { let node; const signalFn = (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.createComputed)(() => { node._dirtyCounter(); const value = refreshSignalQuery(node, firstOnly); if (required && value === undefined) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(-951, ngDevMode && 'Child query result is required but no value is available.'); } return value; }); node = signalFn[_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.SIGNAL]; node._dirtyCounter = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.signal)(0); node._flatValue = undefined; if (ngDevMode) { signalFn.toString = () => `[Query Signal]`; node.debugName = opts?.debugName; } return signalFn; } function createSingleResultOptionalQuerySignalFn(opts) { return createQuerySignalFn(true, false, opts); } function createSingleResultRequiredQuerySignalFn(opts) { return createQuerySignalFn(true, true, opts); } function createMultiResultQuerySignalFn(opts) { return createQuerySignalFn(false, false, opts); } function bindQueryToSignal(target, queryIndex) { const node = target[_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.SIGNAL]; node._lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); node._queryIndex = queryIndex; node._queryList = loadQueryInternal(node._lView, queryIndex); node._queryList.onDirty(() => node._dirtyCounter.update(v => v + 1)); } function refreshSignalQuery(node, firstOnly) { const lView = node._lView; const queryIndex = node._queryIndex; if (lView === undefined || queryIndex === undefined || lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] & 4) { return firstOnly ? undefined : _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARRAY; } const queryList = loadQueryInternal(lView, queryIndex); const results = getQueryResults(lView, queryIndex); queryList.reset(results, unwrapElementRef); if (firstOnly) { return queryList.first; } else { const resultChanged = queryList._changesDetected; if (resultChanged || node._flatValue === undefined) { return node._flatValue = queryList.toArray(); } return node._flatValue; } } let componentResourceResolutionQueue = new Map(); const componentDefPendingResolution = new Set(); function resolveComponentResources(_x) { return _resolveComponentResources.apply(this, arguments); } function _resolveComponentResources() { _resolveComponentResources = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (resourceResolver) { const currentQueue = componentResourceResolutionQueue; componentResourceResolutionQueue = new Map(); const urlCache = new Map(); function cachedResourceResolve(url) { const promiseCached = urlCache.get(url); if (promiseCached) { return promiseCached; } const promise = resourceResolver(url).then(response => unwrapResponse(url, response)); urlCache.set(url, promise); return promise; } const resolutionPromises = Array.from(currentQueue).map(/*#__PURE__*/function () { var _ref = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* ([type, component]) { if (component.styleUrl && component.styleUrls?.length) { throw new Error('@Component cannot define both `styleUrl` and `styleUrls`. ' + 'Use `styleUrl` if the component has one stylesheet, or `styleUrls` if it has multiple'); } const componentTasks = []; if (component.templateUrl) { componentTasks.push(cachedResourceResolve(component.templateUrl).then(template => { component.template = template; })); } const styles = typeof component.styles === 'string' ? [component.styles] : component.styles ?? []; component.styles = styles; let { styleUrl, styleUrls } = component; if (styleUrl) { styleUrls = [styleUrl]; component.styleUrl = undefined; } if (styleUrls?.length) { const allFetched = Promise.all(styleUrls.map(url => cachedResourceResolve(url))).then(fetchedStyles => { styles.push(...fetchedStyles); component.styleUrls = undefined; }); componentTasks.push(allFetched); } yield Promise.all(componentTasks); componentDefPendingResolution.delete(type); }); return function (_x1) { return _ref.apply(this, arguments); }; }()); yield Promise.all(resolutionPromises); }); return _resolveComponentResources.apply(this, arguments); } function maybeQueueResolutionOfComponentResources(type, metadata) { if (componentNeedsResolution(metadata)) { componentResourceResolutionQueue.set(type, metadata); componentDefPendingResolution.add(type); } } function isComponentDefPendingResolution(type) { return componentDefPendingResolution.has(type); } function componentNeedsResolution(component) { return !!(component.templateUrl && !component.hasOwnProperty('template') || component.styleUrls?.length || component.styleUrl); } function clearResolutionOfComponentResourcesQueue() { const old = componentResourceResolutionQueue; componentResourceResolutionQueue = new Map(); return old; } function restoreComponentResolutionQueue(queue) { componentDefPendingResolution.clear(); for (const type of queue.keys()) { componentDefPendingResolution.add(type); } componentResourceResolutionQueue = queue; } function isComponentResourceResolutionQueueEmpty() { return componentResourceResolutionQueue.size === 0; } function unwrapResponse(_x2, _x3) { return _unwrapResponse.apply(this, arguments); } function _unwrapResponse() { _unwrapResponse = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (url, response) { if (typeof response === 'string') { return response; } if (response.status !== undefined && response.status !== 200) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(918, ngDevMode && `Could not load resource: ${url}. Response status: ${response.status}`); } return response.text(); }); return _unwrapResponse.apply(this, arguments); } const modules = new Map(); let checkForDuplicateNgModules = true; function assertSameOrNotExisting(id, type, incoming) { if (type && type !== incoming && checkForDuplicateNgModules) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(921, ngDevMode && `Duplicate module registered for ${id} - ${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringify)(type)} vs ${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringify)(type.name)}`); } } function registerNgModuleType(ngModuleType, id) { const existing = modules.get(id) || null; assertSameOrNotExisting(id, existing, ngModuleType); modules.set(id, ngModuleType); } function getRegisteredNgModuleType(id) { return modules.get(id); } function setAllowDuplicateNgModuleIdsForTest(allowDuplicates) { checkForDuplicateNgModules = !allowDuplicates; } let NgModuleRef$1 = class NgModuleRef {}; let NgModuleFactory$1 = class NgModuleFactory {}; function createNgModule(ngModule, parentInjector) { return new NgModuleRef(ngModule, parentInjector ?? null, []); } const createNgModuleRef = createNgModule; class NgModuleRef extends NgModuleRef$1 { ngModuleType; _parent; _bootstrapComponents = []; _r3Injector; instance; destroyCbs = []; componentFactoryResolver = new ComponentFactoryResolver(this); constructor(ngModuleType, _parent, additionalProviders, runInjectorInitializers = true) { super(); this.ngModuleType = ngModuleType; this._parent = _parent; const ngModuleDef = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNgModuleDef)(ngModuleType); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(ngModuleDef, `NgModule '${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringify)(ngModuleType)}' is not a subtype of 'NgModuleType'.`); this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap); this._r3Injector = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.createInjectorWithoutInjectorInstances)(ngModuleType, _parent, [{ provide: NgModuleRef$1, useValue: this }, { provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver }, ...additionalProviders], (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringify)(ngModuleType), new Set(['environment'])); if (runInjectorInitializers) { this.resolveInjectorInitializers(); } } resolveInjectorInitializers() { this._r3Injector.resolveInjectorInitializers(); this.instance = this._r3Injector.get(this.ngModuleType); } get injector() { return this._r3Injector; } destroy() { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(this.destroyCbs, 'NgModule already destroyed'); const injector = this._r3Injector; !injector.destroyed && injector.destroy(); this.destroyCbs.forEach(fn => fn()); this.destroyCbs = null; } onDestroy(callback) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(this.destroyCbs, 'NgModule already destroyed'); this.destroyCbs.push(callback); } } class NgModuleFactory extends NgModuleFactory$1 { moduleType; constructor(moduleType) { super(); this.moduleType = moduleType; } create(parentInjector) { return new NgModuleRef(this.moduleType, parentInjector, []); } } function createNgModuleRefWithProviders(moduleType, parentInjector, additionalProviders) { return new NgModuleRef(moduleType, parentInjector, additionalProviders, false); } class EnvironmentNgModuleRefAdapter extends NgModuleRef$1 { injector; componentFactoryResolver = new ComponentFactoryResolver(this); instance = null; constructor(config) { super(); const injector = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.R3Injector([...config.providers, { provide: NgModuleRef$1, useValue: this }, { provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver }], config.parent || (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNullInjector)(), config.debugName, new Set(['environment'])); this.injector = injector; if (config.runEnvironmentInitializers) { injector.resolveInjectorInitializers(); } } destroy() { this.injector.destroy(); } onDestroy(callback) { this.injector.onDestroy(callback); } } function createEnvironmentInjector(providers, parent, debugName = null) { const adapter = new EnvironmentNgModuleRefAdapter({ providers, parent, debugName, runEnvironmentInitializers: true }); return adapter.injector; } class StandaloneService { _injector; cachedInjectors = new Map(); constructor(_injector) { this._injector = _injector; } getOrCreateStandaloneInjector(componentDef) { if (!componentDef.standalone) { return null; } if (!this.cachedInjectors.has(componentDef)) { const providers = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.internalImportProvidersFrom)(false, componentDef.type); const standaloneInjector = providers.length > 0 ? createEnvironmentInjector([providers], this._injector, typeof ngDevMode !== 'undefined' && ngDevMode ? `Standalone[${componentDef.type.name}]` : '') : null; this.cachedInjectors.set(componentDef, standaloneInjector); } return this.cachedInjectors.get(componentDef); } ngOnDestroy() { try { for (const injector of this.cachedInjectors.values()) { if (injector !== null) { injector.destroy(); } } } finally { this.cachedInjectors.clear(); } } static ɵprov = /* @__PURE__ */ (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ token: StandaloneService, providedIn: 'environment', factory: () => new StandaloneService((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"])(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EnvironmentInjector)) }); } function ɵɵdefineComponent(componentDefinition) { return noSideEffects(() => { (typeof ngDevMode === 'undefined' || ngDevMode) && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.initNgDevMode)(); const baseDef = getNgDirectiveDef(componentDefinition); const def = { ...baseDef, decls: componentDefinition.decls, vars: componentDefinition.vars, template: componentDefinition.template, consts: componentDefinition.consts || null, ngContentSelectors: componentDefinition.ngContentSelectors, onPush: componentDefinition.changeDetection === ChangeDetectionStrategy.OnPush, directiveDefs: null, pipeDefs: null, dependencies: baseDef.standalone && componentDefinition.dependencies || null, getStandaloneInjector: baseDef.standalone ? parentInjector => { return parentInjector.get(StandaloneService).getOrCreateStandaloneInjector(def); } : null, getExternalStyles: null, signals: componentDefinition.signals ?? false, data: componentDefinition.data || {}, encapsulation: componentDefinition.encapsulation || ViewEncapsulation.Emulated, styles: componentDefinition.styles || _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARRAY, _: null, schemas: componentDefinition.schemas || null, tView: null, id: '' }; if (baseDef.standalone) { performanceMarkFeature('NgStandalone'); } initFeatures(def); const dependencies = componentDefinition.dependencies; def.directiveDefs = extractDefListOrFactory(dependencies, extractDirectiveDef); def.pipeDefs = extractDefListOrFactory(dependencies, _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getPipeDef); def.id = getComponentId(def); return def; }); } function extractDirectiveDef(type) { return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentDef)(type) || (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getDirectiveDef)(type); } function ɵɵdefineNgModule(def) { return noSideEffects(() => { const res = { type: def.type, bootstrap: def.bootstrap || _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARRAY, declarations: def.declarations || _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARRAY, imports: def.imports || _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARRAY, exports: def.exports || _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARRAY, transitiveCompileScopes: null, schemas: def.schemas || null, id: def.id || null }; return res; }); } function parseAndConvertInputsForDefinition(obj, declaredInputs) { if (obj == null) return _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; const newLookup = {}; for (const minifiedKey in obj) { if (obj.hasOwnProperty(minifiedKey)) { const value = obj[minifiedKey]; let publicName; let declaredName; let inputFlags; let transform; if (Array.isArray(value)) { inputFlags = value[0]; publicName = value[1]; declaredName = value[2] ?? publicName; transform = value[3] || null; } else { publicName = value; declaredName = value; inputFlags = InputFlags.None; transform = null; } newLookup[publicName] = [minifiedKey, inputFlags, transform]; declaredInputs[publicName] = declaredName; } } return newLookup; } function parseAndConvertOutputsForDefinition(obj) { if (obj == null) return _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; const newLookup = {}; for (const minifiedKey in obj) { if (obj.hasOwnProperty(minifiedKey)) { newLookup[obj[minifiedKey]] = minifiedKey; } } return newLookup; } function ɵɵdefineDirective(directiveDefinition) { return noSideEffects(() => { const def = getNgDirectiveDef(directiveDefinition); initFeatures(def); return def; }); } function ɵɵdefinePipe(pipeDef) { return { type: pipeDef.type, name: pipeDef.name, factory: null, pure: pipeDef.pure !== false, standalone: pipeDef.standalone ?? true, onDestroy: pipeDef.type.prototype.ngOnDestroy || null }; } function getNgDirectiveDef(directiveDefinition) { const declaredInputs = {}; return { type: directiveDefinition.type, providersResolver: null, viewProvidersResolver: null, factory: null, hostBindings: directiveDefinition.hostBindings || null, hostVars: directiveDefinition.hostVars || 0, hostAttrs: directiveDefinition.hostAttrs || null, contentQueries: directiveDefinition.contentQueries || null, declaredInputs: declaredInputs, inputConfig: directiveDefinition.inputs || _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, exportAs: directiveDefinition.exportAs || null, standalone: directiveDefinition.standalone ?? true, signals: directiveDefinition.signals === true, selectors: directiveDefinition.selectors || _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARRAY, viewQuery: directiveDefinition.viewQuery || null, features: directiveDefinition.features || null, setInput: null, resolveHostDirectives: null, hostDirectives: null, inputs: parseAndConvertInputsForDefinition(directiveDefinition.inputs, declaredInputs), outputs: parseAndConvertOutputsForDefinition(directiveDefinition.outputs), debugInfo: null }; } function initFeatures(definition) { definition.features?.forEach(fn => fn(definition)); } function extractDefListOrFactory(dependencies, defExtractor) { if (!dependencies) { return null; } return () => { const resolvedDependencies = typeof dependencies === 'function' ? dependencies() : dependencies; const result = []; for (const dep of resolvedDependencies) { const definition = defExtractor(dep); if (definition !== null) { result.push(definition); } } return result; }; } const GENERATED_COMP_IDS = new Map(); function getComponentId(componentDef) { let hash = 0; const componentDefConsts = typeof componentDef.consts === 'function' ? '' : componentDef.consts; const hashSelectors = [componentDef.selectors, componentDef.ngContentSelectors, componentDef.hostVars, componentDef.hostAttrs, componentDefConsts, componentDef.vars, componentDef.decls, componentDef.encapsulation, componentDef.standalone, componentDef.signals, componentDef.exportAs, JSON.stringify(componentDef.inputs), JSON.stringify(componentDef.outputs), Object.getOwnPropertyNames(componentDef.type.prototype), !!componentDef.contentQueries, !!componentDef.viewQuery]; if (typeof ngDevMode === 'undefined' || ngDevMode) { for (const item of hashSelectors) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertNotEqual)(typeof item, 'function', 'Internal error: attempting to use a function in component id computation logic.'); } } for (const char of hashSelectors.join('|')) { hash = Math.imul(31, hash) + char.charCodeAt(0) << 0; } hash += 2147483647 + 1; const compId = 'c' + hash; if ((typeof ngDevMode === 'undefined' || ngDevMode) && (typeof ngServerMode === 'undefined' || !ngServerMode)) { if (GENERATED_COMP_IDS.has(compId)) { const previousCompDefType = GENERATED_COMP_IDS.get(compId); if (previousCompDefType !== componentDef.type) { console.warn((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.formatRuntimeError)(-912, `Component ID generation collision detected. Components '${previousCompDefType.name}' and '${componentDef.type.name}' with selector '${stringifyCSSSelectorList(componentDef.selectors)}' generated the same component ID. To fix this, you can change the selector of one of those components or add an extra host attribute to force a different ID.`)); } } else { GENERATED_COMP_IDS.set(compId, componentDef.type); } } return compId; } function ɵɵHostDirectivesFeature(rawHostDirectives) { const feature = definition => { const isEager = Array.isArray(rawHostDirectives); if (definition.hostDirectives === null) { definition.resolveHostDirectives = resolveHostDirectives; definition.hostDirectives = isEager ? rawHostDirectives.map(createHostDirectiveDef) : [rawHostDirectives]; } else if (isEager) { definition.hostDirectives.unshift(...rawHostDirectives.map(createHostDirectiveDef)); } else { definition.hostDirectives.unshift(rawHostDirectives); } }; feature.ngInherit = true; return feature; } function resolveHostDirectives(matches) { const allDirectiveDefs = []; let hasComponent = false; let hostDirectiveDefs = null; let hostDirectiveRanges = null; for (let i = 0; i < matches.length; i++) { const def = matches[i]; if (def.hostDirectives !== null) { const start = allDirectiveDefs.length; hostDirectiveDefs ??= new Map(); hostDirectiveRanges ??= new Map(); findHostDirectiveDefs(def, allDirectiveDefs, hostDirectiveDefs); hostDirectiveRanges.set(def, [start, allDirectiveDefs.length - 1]); } if (i === 0 && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isComponentDef)(def)) { hasComponent = true; allDirectiveDefs.push(def); } } for (let i = hasComponent ? 1 : 0; i < matches.length; i++) { allDirectiveDefs.push(matches[i]); } return [allDirectiveDefs, hostDirectiveDefs, hostDirectiveRanges]; } function findHostDirectiveDefs(currentDef, matchedDefs, hostDirectiveDefs) { if (currentDef.hostDirectives !== null) { for (const configOrFn of currentDef.hostDirectives) { if (typeof configOrFn === 'function') { const resolved = configOrFn(); for (const config of resolved) { trackHostDirectiveDef(createHostDirectiveDef(config), matchedDefs, hostDirectiveDefs); } } else { trackHostDirectiveDef(configOrFn, matchedDefs, hostDirectiveDefs); } } } } function trackHostDirectiveDef(def, matchedDefs, hostDirectiveDefs) { const hostDirectiveDef = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getDirectiveDef)(def.directive); if (typeof ngDevMode === 'undefined' || ngDevMode) { validateHostDirective(def, hostDirectiveDef); } patchDeclaredInputs(hostDirectiveDef.declaredInputs, def.inputs); findHostDirectiveDefs(hostDirectiveDef, matchedDefs, hostDirectiveDefs); hostDirectiveDefs.set(hostDirectiveDef, def); matchedDefs.push(hostDirectiveDef); } function createHostDirectiveDef(config) { return typeof config === 'function' ? { directive: (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.resolveForwardRef)(config), inputs: _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ, outputs: _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ } : { directive: (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.resolveForwardRef)(config.directive), inputs: bindingArrayToMap(config.inputs), outputs: bindingArrayToMap(config.outputs) }; } function bindingArrayToMap(bindings) { if (bindings === undefined || bindings.length === 0) { return _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ; } const result = {}; for (let i = 0; i < bindings.length; i += 2) { result[bindings[i]] = bindings[i + 1]; } return result; } function patchDeclaredInputs(declaredInputs, exposedInputs) { for (const publicName in exposedInputs) { if (exposedInputs.hasOwnProperty(publicName)) { const remappedPublicName = exposedInputs[publicName]; const privateName = declaredInputs[publicName]; if ((typeof ngDevMode === 'undefined' || ngDevMode) && declaredInputs.hasOwnProperty(remappedPublicName)) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(declaredInputs[remappedPublicName], declaredInputs[publicName], `Conflicting host directive input alias ${publicName}.`); } declaredInputs[remappedPublicName] = privateName; } } } function validateHostDirective(hostDirectiveConfig, directiveDef) { const type = hostDirectiveConfig.directive; if (directiveDef === null) { if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentDef)(type) !== null) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(310, `Host directive ${type.name} cannot be a component.`); } throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(307, `Could not resolve metadata for host directive ${type.name}. ` + `Make sure that the ${type.name} class is annotated with an @Directive decorator.`); } if (!directiveDef.standalone) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(308, `Host directive ${directiveDef.type.name} must be standalone.`); } validateMappings('input', directiveDef, hostDirectiveConfig.inputs); validateMappings('output', directiveDef, hostDirectiveConfig.outputs); } function validateMappings(bindingType, def, hostDirectiveBindings) { const className = def.type.name; const bindings = bindingType === 'input' ? def.inputs : def.outputs; for (const publicName in hostDirectiveBindings) { if (hostDirectiveBindings.hasOwnProperty(publicName)) { if (!bindings.hasOwnProperty(publicName)) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(311, `Directive ${className} does not have an ${bindingType} with a public name of ${publicName}.`); } const remappedPublicName = hostDirectiveBindings[publicName]; if (bindings.hasOwnProperty(remappedPublicName) && remappedPublicName !== publicName) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(312, `Cannot alias ${bindingType} ${publicName} of host directive ${className} to ${remappedPublicName}, because it already has a different ${bindingType} with the same public name.`); } } } } function getSuperType(type) { return Object.getPrototypeOf(type.prototype).constructor; } function ɵɵInheritDefinitionFeature(definition) { let superType = getSuperType(definition.type); let shouldInheritFields = true; const inheritanceChain = [definition]; while (superType) { let superDef = undefined; if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isComponentDef)(definition)) { superDef = superType.ɵcmp || superType.ɵdir; } else { if (superType.ɵcmp) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(903, ngDevMode && `Directives cannot inherit Components. Directive ${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(definition.type)} is attempting to extend component ${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(superType)}`); } superDef = superType.ɵdir; } if (superDef) { if (shouldInheritFields) { inheritanceChain.push(superDef); const writeableDef = definition; writeableDef.inputs = maybeUnwrapEmpty(definition.inputs); writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs); writeableDef.outputs = maybeUnwrapEmpty(definition.outputs); const superHostBindings = superDef.hostBindings; superHostBindings && inheritHostBindings(definition, superHostBindings); const superViewQuery = superDef.viewQuery; const superContentQueries = superDef.contentQueries; superViewQuery && inheritViewQuery(definition, superViewQuery); superContentQueries && inheritContentQueries(definition, superContentQueries); mergeInputsWithTransforms(definition, superDef); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.fillProperties)(definition.outputs, superDef.outputs); if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isComponentDef)(superDef) && superDef.data.animation) { const defData = definition.data; defData.animation = (defData.animation || []).concat(superDef.data.animation); } } const features = superDef.features; if (features) { for (let i = 0; i < features.length; i++) { const feature = features[i]; if (feature && feature.ngInherit) { feature(definition); } if (feature === ɵɵInheritDefinitionFeature) { shouldInheritFields = false; } } } } superType = Object.getPrototypeOf(superType); } mergeHostAttrsAcrossInheritance(inheritanceChain); } function mergeInputsWithTransforms(target, source) { for (const key in source.inputs) { if (!source.inputs.hasOwnProperty(key)) { continue; } if (target.inputs.hasOwnProperty(key)) { continue; } const value = source.inputs[key]; if (value !== undefined) { target.inputs[key] = value; target.declaredInputs[key] = source.declaredInputs[key]; } } } function mergeHostAttrsAcrossInheritance(inheritanceChain) { let hostVars = 0; let hostAttrs = null; for (let i = inheritanceChain.length - 1; i >= 0; i--) { const def = inheritanceChain[i]; def.hostVars = hostVars += def.hostVars; def.hostAttrs = mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs)); } } function maybeUnwrapEmpty(value) { if (value === _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMPTY_OBJ) { return {}; } else if (value === _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EMPTY_ARRAY) { return []; } else { return value; } } function inheritViewQuery(definition, superViewQuery) { const prevViewQuery = definition.viewQuery; if (prevViewQuery) { definition.viewQuery = (rf, ctx) => { superViewQuery(rf, ctx); prevViewQuery(rf, ctx); }; } else { definition.viewQuery = superViewQuery; } } function inheritContentQueries(definition, superContentQueries) { const prevContentQueries = definition.contentQueries; if (prevContentQueries) { definition.contentQueries = (rf, ctx, directiveIndex) => { superContentQueries(rf, ctx, directiveIndex); prevContentQueries(rf, ctx, directiveIndex); }; } else { definition.contentQueries = superContentQueries; } } function inheritHostBindings(definition, superHostBindings) { const prevHostBindings = definition.hostBindings; if (prevHostBindings) { definition.hostBindings = (rf, ctx) => { superHostBindings(rf, ctx); prevHostBindings(rf, ctx); }; } else { definition.hostBindings = superHostBindings; } } function templateCreate(tNode, declarationLView, declarationTView, index, templateFn, decls, vars, flags) { if (declarationTView.firstCreatePass) { tNode.mergedAttrs = mergeHostAttrs(tNode.mergedAttrs, tNode.attrs); const embeddedTView = tNode.tView = createTView(2, tNode, templateFn, decls, vars, declarationTView.directiveRegistry, declarationTView.pipeRegistry, null, declarationTView.schemas, declarationTView.consts, null); if (declarationTView.queries !== null) { declarationTView.queries.template(declarationTView, tNode); embeddedTView.queries = declarationTView.queries.embeddedTView(tNode); } } if (flags) { tNode.flags |= flags; } (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setCurrentTNode)(tNode, false); const comment = _locateOrCreateContainerAnchor(declarationTView, declarationLView, tNode, index); if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.wasLastNodeCreated)()) { appendChild(declarationTView, declarationLView, comment, tNode); } attachPatchData(comment, declarationLView); const lContainer = createLContainer(comment, declarationLView, comment, tNode); declarationLView[index + _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET] = lContainer; addToEndOfViewTree(declarationLView, lContainer); populateDehydratedViewsInLContainer(lContainer, tNode, declarationLView); } function declareDirectiveHostTemplate(declarationLView, declarationTView, index, templateFn, decls, vars, tagName, attrs, flags, localRefsIndex, localRefExtractor) { const adjustedIndex = index + _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET; let tNode; if (declarationTView.firstCreatePass) { tNode = getOrCreateTNode(declarationTView, adjustedIndex, 4, tagName || null, attrs || null); if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getBindingsEnabled)()) { resolveDirectives(declarationTView, declarationLView, tNode, (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getConstant)(declarationTView.consts, localRefsIndex), findDirectiveDefMatches); } registerPostOrderHooks(declarationTView, tNode); } else { tNode = declarationTView.data[adjustedIndex]; } templateCreate(tNode, declarationLView, declarationTView, index, templateFn, decls, vars, flags); if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isDirectiveHost)(tNode)) { createDirectivesInstances(declarationTView, declarationLView, tNode); } if (localRefsIndex != null) { saveResolvedLocalsInData(declarationLView, tNode, localRefExtractor); } return tNode; } function declareNoDirectiveHostTemplate(declarationLView, declarationTView, index, templateFn, decls, vars, tagName, attrs, flags, localRefsIndex, localRefExtractor) { const adjustedIndex = index + _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET; let tNode; if (declarationTView.firstCreatePass) { tNode = getOrCreateTNode(declarationTView, adjustedIndex, 4, tagName || null, attrs || null); if (localRefsIndex != null) { const refs = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getConstant)(declarationTView.consts, localRefsIndex); tNode.localNames = []; for (let i = 0; i < refs.length; i += 2) { tNode.localNames.push(refs[i], -1); } } } else { tNode = declarationTView.data[adjustedIndex]; } templateCreate(tNode, declarationLView, declarationTView, index, templateFn, decls, vars, flags); if (localRefsIndex != null) { saveResolvedLocalsInData(declarationLView, tNode, localRefExtractor); } return tNode; } function ɵɵtemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTView)(); const attrs = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getConstant)(tView.consts, attrsIndex); declareDirectiveHostTemplate(lView, tView, index, templateFn, decls, vars, tagName, attrs, undefined, localRefsIndex, localRefExtractor); return ɵɵtemplate; } function ɵɵdomTemplate(index, templateFn, decls, vars, tagName, attrsIndex, localRefsIndex, localRefExtractor) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTView)(); const attrs = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getConstant)(tView.consts, attrsIndex); declareNoDirectiveHostTemplate(lView, tView, index, templateFn, decls, vars, tagName, attrs, undefined, localRefsIndex, localRefExtractor); return ɵɵdomTemplate; } let _locateOrCreateContainerAnchor = createContainerAnchorImpl; function createContainerAnchorImpl(tView, lView, tNode, index) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.lastNodeWasCreated)(true); return lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER].createComment(ngDevMode ? 'container' : ''); } function locateOrCreateContainerAnchorImpl(tView, lView, tNode, index) { const isNodeCreationMode = !canHydrateNode(lView, tNode); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.lastNodeWasCreated)(isNodeCreationMode); const ssrId = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HYDRATION]?.data[TEMPLATES]?.[index] ?? null; if (ssrId !== null && tNode.tView !== null) { if (tNode.tView.ssrId === null) { tNode.tView.ssrId = ssrId; } else { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(tNode.tView.ssrId, ssrId, 'Unexpected value of the `ssrId` for this TView'); } } if (isNodeCreationMode) { return createContainerAnchorImpl(tView, lView); } const hydrationInfo = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HYDRATION]; const currentRNode = locateNextRNode(hydrationInfo, tView, lView, tNode); ngDevMode && validateNodeExists(currentRNode, lView, tNode); setSegmentHead(hydrationInfo, index, currentRNode); const viewContainerSize = calcSerializedContainerSize(hydrationInfo, index); const comment = siblingAfter(viewContainerSize, currentRNode); if (ngDevMode) { validateMatchingNode(comment, Node.COMMENT_NODE, null, lView, tNode); markRNodeAsClaimedByHydration(comment); } return comment; } function enableLocateOrCreateContainerAnchorImpl() { _locateOrCreateContainerAnchor = locateOrCreateContainerAnchorImpl; } var DeferDependenciesLoadingState; (function (DeferDependenciesLoadingState) { DeferDependenciesLoadingState[DeferDependenciesLoadingState["NOT_STARTED"] = 0] = "NOT_STARTED"; DeferDependenciesLoadingState[DeferDependenciesLoadingState["IN_PROGRESS"] = 1] = "IN_PROGRESS"; DeferDependenciesLoadingState[DeferDependenciesLoadingState["COMPLETE"] = 2] = "COMPLETE"; DeferDependenciesLoadingState[DeferDependenciesLoadingState["FAILED"] = 3] = "FAILED"; })(DeferDependenciesLoadingState || (DeferDependenciesLoadingState = {})); const MINIMUM_SLOT = 0; const LOADING_AFTER_SLOT = 1; var DeferBlockState; (function (DeferBlockState) { DeferBlockState[DeferBlockState["Placeholder"] = 0] = "Placeholder"; DeferBlockState[DeferBlockState["Loading"] = 1] = "Loading"; DeferBlockState[DeferBlockState["Complete"] = 2] = "Complete"; DeferBlockState[DeferBlockState["Error"] = 3] = "Error"; })(DeferBlockState || (DeferBlockState = {})); var DeferBlockInternalState; (function (DeferBlockInternalState) { DeferBlockInternalState[DeferBlockInternalState["Initial"] = -1] = "Initial"; })(DeferBlockInternalState || (DeferBlockInternalState = {})); const NEXT_DEFER_BLOCK_STATE = 0; const DEFER_BLOCK_STATE = 1; const STATE_IS_FROZEN_UNTIL = 2; const LOADING_AFTER_CLEANUP_FN = 3; const TRIGGER_CLEANUP_FNS = 4; const PREFETCH_TRIGGER_CLEANUP_FNS = 5; const SSR_UNIQUE_ID = 6; const SSR_BLOCK_STATE = 7; const ON_COMPLETE_FNS = 8; const HYDRATE_TRIGGER_CLEANUP_FNS = 9; var DeferBlockBehavior; (function (DeferBlockBehavior) { DeferBlockBehavior[DeferBlockBehavior["Manual"] = 0] = "Manual"; DeferBlockBehavior[DeferBlockBehavior["Playthrough"] = 1] = "Playthrough"; })(DeferBlockBehavior || (DeferBlockBehavior = {})); function storeTriggerCleanupFn(type, lDetails, cleanupFn) { const key = getCleanupFnKeyByType(type); if (lDetails[key] === null) { lDetails[key] = []; } lDetails[key].push(cleanupFn); } function invokeTriggerCleanupFns(type, lDetails) { const key = getCleanupFnKeyByType(type); const cleanupFns = lDetails[key]; if (cleanupFns !== null) { for (const cleanupFn of cleanupFns) { cleanupFn(); } lDetails[key] = null; } } function invokeAllTriggerCleanupFns(lDetails) { invokeTriggerCleanupFns(1, lDetails); invokeTriggerCleanupFns(0, lDetails); invokeTriggerCleanupFns(2, lDetails); } function getCleanupFnKeyByType(type) { let key = TRIGGER_CLEANUP_FNS; if (type === 1) { key = PREFETCH_TRIGGER_CLEANUP_FNS; } else if (type === 2) { key = HYDRATE_TRIGGER_CLEANUP_FNS; } return key; } function getDeferBlockDataIndex(deferBlockIndex) { return deferBlockIndex + 1; } function getLDeferBlockDetails(lView, tNode) { const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const slotIndex = getDeferBlockDataIndex(tNode.index); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertIndexInDeclRange)(tView, slotIndex); return lView[slotIndex]; } function setLDeferBlockDetails(lView, deferBlockIndex, lDetails) { const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const slotIndex = getDeferBlockDataIndex(deferBlockIndex); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertIndexInDeclRange)(tView, slotIndex); lView[slotIndex] = lDetails; } function getTDeferBlockDetails(tView, tNode) { const slotIndex = getDeferBlockDataIndex(tNode.index); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertIndexInDeclRange)(tView, slotIndex); return tView.data[slotIndex]; } function setTDeferBlockDetails(tView, deferBlockIndex, deferBlockConfig) { const slotIndex = getDeferBlockDataIndex(deferBlockIndex); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertIndexInDeclRange)(tView, slotIndex); tView.data[slotIndex] = deferBlockConfig; } function getTemplateIndexForState(newState, hostLView, tNode) { const tView = hostLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const tDetails = getTDeferBlockDetails(tView, tNode); switch (newState) { case DeferBlockState.Complete: return tDetails.primaryTmplIndex; case DeferBlockState.Loading: return tDetails.loadingTmplIndex; case DeferBlockState.Error: return tDetails.errorTmplIndex; case DeferBlockState.Placeholder: return tDetails.placeholderTmplIndex; default: ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)(`Unexpected defer block state: ${newState}`); return null; } } function getMinimumDurationForState(tDetails, currentState) { if (currentState === DeferBlockState.Placeholder) { return tDetails.placeholderBlockConfig?.[MINIMUM_SLOT] ?? null; } else if (currentState === DeferBlockState.Loading) { return tDetails.loadingBlockConfig?.[MINIMUM_SLOT] ?? null; } return null; } function getLoadingBlockAfter(tDetails) { return tDetails.loadingBlockConfig?.[LOADING_AFTER_SLOT] ?? null; } function addDepsToRegistry(currentDeps, newDeps) { if (!currentDeps || currentDeps.length === 0) { return newDeps; } const currentDepSet = new Set(currentDeps); for (const dep of newDeps) { currentDepSet.add(dep); } return currentDeps.length === currentDepSet.size ? currentDeps : Array.from(currentDepSet); } function getPrimaryBlockTNode(tView, tDetails) { const adjustedIndex = tDetails.primaryTmplIndex + _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET; return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTNode)(tView, adjustedIndex); } function assertDeferredDependenciesLoaded(tDetails) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(tDetails.loadingState, DeferDependenciesLoadingState.COMPLETE, 'Expecting all deferred dependencies to be loaded.'); } function isTDeferBlockDetails(value) { return value !== null && typeof value === 'object' && typeof value.primaryTmplIndex === 'number'; } function isDeferBlock(tView, tNode) { let tDetails = null; const slotIndex = getDeferBlockDataIndex(tNode.index); if (_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET < slotIndex && slotIndex < tView.bindingStartIndex) { tDetails = getTDeferBlockDetails(tView, tNode); } return !!tDetails && isTDeferBlockDetails(tDetails); } function trackTriggerForDebugging(tView, tNode, textRepresentation) { const tDetails = getTDeferBlockDetails(tView, tNode); tDetails.debug ??= {}; tDetails.debug.triggers ??= new Set(); tDetails.debug.triggers.add(textRepresentation); } function onViewportWrapper(trigger, callback, injector, wrapperOptions) { const ngZone = injector.get(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgZone); return onViewport(trigger, () => ngZone.run(callback), options => ngZone.runOutsideAngular(() => createIntersectionObserver(options)), wrapperOptions); } function getTriggerLView(deferredHostLView, deferredTNode, walkUpTimes) { if (walkUpTimes == null) { return deferredHostLView; } if (walkUpTimes >= 0) { return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.walkUpViews)(walkUpTimes, deferredHostLView); } const deferredContainer = deferredHostLView[deferredTNode.index]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLContainer)(deferredContainer); const triggerLView = deferredContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET] ?? null; if (ngDevMode && triggerLView !== null) { const lDetails = getLDeferBlockDetails(deferredHostLView, deferredTNode); const renderedState = lDetails[DEFER_BLOCK_STATE]; (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertEqual)(renderedState, DeferBlockState.Placeholder, 'Expected a placeholder to be rendered in this defer block.'); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLView)(triggerLView); } return triggerLView; } function getTriggerElement(triggerLView, triggerIndex) { const element = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByIndex)(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET + triggerIndex, triggerLView); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertElement)(element); return element; } function registerDomTrigger(initialLView, tNode, triggerIndex, walkUpTimes, registerFn, callback, type, options) { const injector = initialLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]; const zone = injector.get(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgZone); let poll; function pollDomTrigger() { if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isDestroyed)(initialLView)) { poll.destroy(); return; } const lDetails = getLDeferBlockDetails(initialLView, tNode); const renderedState = lDetails[DEFER_BLOCK_STATE]; if (renderedState !== DeferBlockInternalState.Initial && renderedState !== DeferBlockState.Placeholder) { poll.destroy(); return; } const triggerLView = getTriggerLView(initialLView, tNode, walkUpTimes); if (!triggerLView) { return; } poll.destroy(); if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isDestroyed)(triggerLView)) { return; } const element = getTriggerElement(triggerLView, triggerIndex); const cleanup = registerFn(element, () => { zone.run(() => { if (initialLView !== triggerLView) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.removeLViewOnDestroy)(triggerLView, cleanup); } callback(); }); }, injector, options); if (initialLView !== triggerLView) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.storeLViewOnDestroy)(triggerLView, cleanup); } storeTriggerCleanupFn(type, lDetails, cleanup); } poll = afterEveryRender({ read: pollDomTrigger }, { injector }); } function onIdle(callback, injector) { const scheduler = injector.get(IdleScheduler); const cleanupFn = () => scheduler.remove(callback); scheduler.add(callback); return cleanupFn; } const _requestIdleCallback = () => typeof requestIdleCallback !== 'undefined' ? requestIdleCallback : setTimeout; const _cancelIdleCallback = () => typeof requestIdleCallback !== 'undefined' ? cancelIdleCallback : clearTimeout; class IdleScheduler { executingCallbacks = false; idleId = null; current = new Set(); deferred = new Set(); ngZone = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgZone); requestIdleCallbackFn = _requestIdleCallback().bind(globalThis); cancelIdleCallbackFn = _cancelIdleCallback().bind(globalThis); add(callback) { const target = this.executingCallbacks ? this.deferred : this.current; target.add(callback); if (this.idleId === null) { this.scheduleIdleCallback(); } } remove(callback) { const { current, deferred } = this; current.delete(callback); deferred.delete(callback); if (current.size === 0 && deferred.size === 0) { this.cancelIdleCallback(); } } scheduleIdleCallback() { const callback = () => { this.cancelIdleCallback(); this.executingCallbacks = true; for (const callback of this.current) { callback(); } this.current.clear(); this.executingCallbacks = false; if (this.deferred.size > 0) { for (const callback of this.deferred) { this.current.add(callback); } this.deferred.clear(); this.scheduleIdleCallback(); } }; this.idleId = this.requestIdleCallbackFn(() => this.ngZone.run(callback)); } cancelIdleCallback() { if (this.idleId !== null) { this.cancelIdleCallbackFn(this.idleId); this.idleId = null; } } ngOnDestroy() { this.cancelIdleCallback(); this.current.clear(); this.deferred.clear(); } static ɵprov = /* @__PURE__ */ (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ token: IdleScheduler, providedIn: 'root', factory: () => new IdleScheduler() }); } function onTimer(delay) { return (callback, injector) => scheduleTimerTrigger(delay, callback, injector); } function scheduleTimerTrigger(delay, callback, injector) { const scheduler = injector.get(TimerScheduler); const ngZone = injector.get(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgZone); const cleanupFn = () => scheduler.remove(callback); scheduler.add(delay, callback, ngZone); return cleanupFn; } class TimerScheduler { executingCallbacks = false; timeoutId = null; invokeTimerAt = null; current = []; deferred = []; add(delay, callback, ngZone) { const target = this.executingCallbacks ? this.deferred : this.current; this.addToQueue(target, Date.now() + delay, callback); this.scheduleTimer(ngZone); } remove(callback) { const { current, deferred } = this; const callbackIndex = this.removeFromQueue(current, callback); if (callbackIndex === -1) { this.removeFromQueue(deferred, callback); } if (current.length === 0 && deferred.length === 0) { this.clearTimeout(); } } addToQueue(target, invokeAt, callback) { let insertAtIndex = target.length; for (let i = 0; i < target.length; i += 2) { const invokeQueuedCallbackAt = target[i]; if (invokeQueuedCallbackAt > invokeAt) { insertAtIndex = i; break; } } (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.arrayInsert2)(target, insertAtIndex, invokeAt, callback); } removeFromQueue(target, callback) { let index = -1; for (let i = 0; i < target.length; i += 2) { const queuedCallback = target[i + 1]; if (queuedCallback === callback) { index = i; break; } } if (index > -1) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.arraySplice)(target, index, 2); } return index; } scheduleTimer(ngZone) { const callback = () => { this.clearTimeout(); this.executingCallbacks = true; const current = [...this.current]; const now = Date.now(); for (let i = 0; i < current.length; i += 2) { const invokeAt = current[i]; const callback = current[i + 1]; if (invokeAt <= now) { callback(); } else { break; } } let lastCallbackIndex = -1; for (let i = 0; i < this.current.length; i += 2) { const invokeAt = this.current[i]; if (invokeAt <= now) { lastCallbackIndex = i + 1; } else { break; } } if (lastCallbackIndex >= 0) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.arraySplice)(this.current, 0, lastCallbackIndex + 1); } this.executingCallbacks = false; if (this.deferred.length > 0) { for (let i = 0; i < this.deferred.length; i += 2) { const invokeAt = this.deferred[i]; const callback = this.deferred[i + 1]; this.addToQueue(this.current, invokeAt, callback); } this.deferred.length = 0; } this.scheduleTimer(ngZone); }; const FRAME_DURATION_MS = 16; if (this.current.length > 0) { const now = Date.now(); const invokeAt = this.current[0]; if (this.timeoutId === null || this.invokeTimerAt && this.invokeTimerAt - invokeAt > FRAME_DURATION_MS) { this.clearTimeout(); const timeout = Math.max(invokeAt - now, FRAME_DURATION_MS); this.invokeTimerAt = invokeAt; this.timeoutId = ngZone.runOutsideAngular(() => { return setTimeout(() => ngZone.run(callback), timeout); }); } } } clearTimeout() { if (this.timeoutId !== null) { clearTimeout(this.timeoutId); this.timeoutId = null; } } ngOnDestroy() { this.clearTimeout(); this.current.length = 0; this.deferred.length = 0; } static ɵprov = /* @__PURE__ */ (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ token: TimerScheduler, providedIn: 'root', factory: () => new TimerScheduler() }); } class CachedInjectorService { cachedInjectors = new Map(); getOrCreateInjector(key, parentInjector, providers, debugName) { if (!this.cachedInjectors.has(key)) { const injector = providers.length > 0 ? createEnvironmentInjector(providers, parentInjector, debugName) : null; this.cachedInjectors.set(key, injector); } return this.cachedInjectors.get(key); } ngOnDestroy() { try { for (const injector of this.cachedInjectors.values()) { if (injector !== null) { injector.destroy(); } } } finally { this.cachedInjectors.clear(); } } static ɵprov = /* @__PURE__ */ (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ token: CachedInjectorService, providedIn: 'environment', factory: () => new CachedInjectorService() }); } const DEFER_BLOCK_DEPENDENCY_INTERCEPTOR = /* @__PURE__ */new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken('DEFER_BLOCK_DEPENDENCY_INTERCEPTOR'); const DEFER_BLOCK_CONFIG = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'DEFER_BLOCK_CONFIG' : ''); function getOrCreateEnvironmentInjector(parentInjector, tDetails, providers) { return parentInjector.get(CachedInjectorService).getOrCreateInjector(tDetails, parentInjector, providers, ngDevMode ? 'DeferBlock Injector' : ''); } function createDeferBlockInjector(parentInjector, tDetails, providers) { if (parentInjector instanceof ChainedInjector) { const origInjector = parentInjector.injector; const parentEnvInjector = parentInjector.parentInjector; const envInjector = getOrCreateEnvironmentInjector(parentEnvInjector, tDetails, providers); return new ChainedInjector(origInjector, envInjector); } const parentEnvInjector = parentInjector.get(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EnvironmentInjector); if (parentEnvInjector !== parentInjector) { const envInjector = getOrCreateEnvironmentInjector(parentEnvInjector, tDetails, providers); return new ChainedInjector(parentInjector, envInjector); } return getOrCreateEnvironmentInjector(parentInjector, tDetails, providers); } function renderDeferBlockState(newState, tNode, lContainer, skipTimerScheduling = false) { const hostLView = lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PARENT]; const hostTView = hostLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isDestroyed)(hostLView)) return; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertTNodeForLView)(tNode, hostLView); const lDetails = getLDeferBlockDetails(hostLView, tNode); ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(lDetails, 'Expected a defer block state defined'); const currentState = lDetails[DEFER_BLOCK_STATE]; const ssrState = lDetails[SSR_BLOCK_STATE]; if (ssrState !== null && newState < ssrState) { return; } if (isValidStateChange(currentState, newState) && isValidStateChange(lDetails[NEXT_DEFER_BLOCK_STATE] ?? -1, newState)) { const tDetails = getTDeferBlockDetails(hostTView, tNode); const needsScheduling = !skipTimerScheduling && (typeof ngServerMode === 'undefined' || !ngServerMode) && (getLoadingBlockAfter(tDetails) !== null || getMinimumDurationForState(tDetails, DeferBlockState.Loading) !== null || getMinimumDurationForState(tDetails, DeferBlockState.Placeholder)); if (ngDevMode && needsScheduling) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(applyDeferBlockStateWithSchedulingImpl, 'Expected scheduling function to be defined'); } const applyStateFn = needsScheduling ? applyDeferBlockStateWithSchedulingImpl : applyDeferBlockState; try { applyStateFn(newState, lDetails, lContainer, tNode, hostLView); } catch (error) { handleUncaughtError(hostLView, error); } } } function findMatchingDehydratedViewForDeferBlock(lContainer, lDetails) { const dehydratedViewIx = lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DEHYDRATED_VIEWS]?.findIndex(view => view.data[DEFER_BLOCK_STATE$1] === lDetails[DEFER_BLOCK_STATE]) ?? -1; const dehydratedView = dehydratedViewIx > -1 ? lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DEHYDRATED_VIEWS][dehydratedViewIx] : null; return { dehydratedView, dehydratedViewIx }; } function applyDeferBlockState(newState, lDetails, lContainer, tNode, hostLView) { profiler(ProfilerEvent.DeferBlockStateStart); const stateTmplIndex = getTemplateIndexForState(newState, hostLView, tNode); if (stateTmplIndex !== null) { lDetails[DEFER_BLOCK_STATE] = newState; const hostTView = hostLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const adjustedIndex = stateTmplIndex + _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET; const activeBlockTNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTNode)(hostTView, adjustedIndex); const viewIndex = 0; removeLViewFromLContainer(lContainer, viewIndex); let injector; if (newState === DeferBlockState.Complete) { const tDetails = getTDeferBlockDetails(hostTView, tNode); const providers = tDetails.providers; if (providers && providers.length > 0) { injector = createDeferBlockInjector(hostLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1], tDetails, providers); } } const { dehydratedView, dehydratedViewIx } = findMatchingDehydratedViewForDeferBlock(lContainer, lDetails); const embeddedLView = createAndRenderEmbeddedLView(hostLView, activeBlockTNode, null, { injector, dehydratedView }); addLViewToLContainer(lContainer, embeddedLView, viewIndex, shouldAddViewToDom(activeBlockTNode, dehydratedView)); markViewDirty(embeddedLView, 2); if (dehydratedViewIx > -1) { lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DEHYDRATED_VIEWS]?.splice(dehydratedViewIx, 1); } if ((newState === DeferBlockState.Complete || newState === DeferBlockState.Error) && Array.isArray(lDetails[ON_COMPLETE_FNS])) { for (const callback of lDetails[ON_COMPLETE_FNS]) { callback(); } lDetails[ON_COMPLETE_FNS] = null; } } profiler(ProfilerEvent.DeferBlockStateEnd); } function applyDeferBlockStateWithScheduling(newState, lDetails, lContainer, tNode, hostLView) { const now = Date.now(); const hostTView = hostLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const tDetails = getTDeferBlockDetails(hostTView, tNode); if (lDetails[STATE_IS_FROZEN_UNTIL] === null || lDetails[STATE_IS_FROZEN_UNTIL] <= now) { lDetails[STATE_IS_FROZEN_UNTIL] = null; const loadingAfter = getLoadingBlockAfter(tDetails); const inLoadingAfterPhase = lDetails[LOADING_AFTER_CLEANUP_FN] !== null; if (newState === DeferBlockState.Loading && loadingAfter !== null && !inLoadingAfterPhase) { lDetails[NEXT_DEFER_BLOCK_STATE] = newState; const cleanupFn = scheduleDeferBlockUpdate(loadingAfter, lDetails, tNode, lContainer, hostLView); lDetails[LOADING_AFTER_CLEANUP_FN] = cleanupFn; } else { if (newState > DeferBlockState.Loading && inLoadingAfterPhase) { lDetails[LOADING_AFTER_CLEANUP_FN](); lDetails[LOADING_AFTER_CLEANUP_FN] = null; lDetails[NEXT_DEFER_BLOCK_STATE] = null; } applyDeferBlockState(newState, lDetails, lContainer, tNode, hostLView); const duration = getMinimumDurationForState(tDetails, newState); if (duration !== null) { lDetails[STATE_IS_FROZEN_UNTIL] = now + duration; scheduleDeferBlockUpdate(duration, lDetails, tNode, lContainer, hostLView); } } } else { lDetails[NEXT_DEFER_BLOCK_STATE] = newState; } } function scheduleDeferBlockUpdate(timeout, lDetails, tNode, lContainer, hostLView) { const callback = () => { const nextState = lDetails[NEXT_DEFER_BLOCK_STATE]; lDetails[STATE_IS_FROZEN_UNTIL] = null; lDetails[NEXT_DEFER_BLOCK_STATE] = null; if (nextState !== null) { renderDeferBlockState(nextState, tNode, lContainer); } }; return scheduleTimerTrigger(timeout, callback, hostLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]); } function isValidStateChange(currentState, newState) { return currentState < newState; } function renderPlaceholder(lView, tNode) { const lContainer = lView[tNode.index]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLContainer)(lContainer); renderDeferBlockState(DeferBlockState.Placeholder, tNode, lContainer); } function renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(tDetails.loadingPromise, 'Expected loading Promise to exist on this defer block'); tDetails.loadingPromise.then(() => { if (tDetails.loadingState === DeferDependenciesLoadingState.COMPLETE) { ngDevMode && assertDeferredDependenciesLoaded(tDetails); renderDeferBlockState(DeferBlockState.Complete, tNode, lContainer); } else if (tDetails.loadingState === DeferDependenciesLoadingState.FAILED) { renderDeferBlockState(DeferBlockState.Error, tNode, lContainer); } }); } let applyDeferBlockStateWithSchedulingImpl = null; function ɵɵdeferEnableTimerScheduling(tView, tDetails, placeholderConfigIndex, loadingConfigIndex) { const tViewConsts = tView.consts; if (placeholderConfigIndex != null) { tDetails.placeholderBlockConfig = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getConstant)(tViewConsts, placeholderConfigIndex); } if (loadingConfigIndex != null) { tDetails.loadingBlockConfig = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getConstant)(tViewConsts, loadingConfigIndex); } if (applyDeferBlockStateWithSchedulingImpl === null) { applyDeferBlockStateWithSchedulingImpl = applyDeferBlockStateWithScheduling; } } const ASYNC_COMPONENT_METADATA_FN = '__ngAsyncComponentMetadataFn__'; function getAsyncClassMetadataFn(type) { const componentClass = type; return componentClass[ASYNC_COMPONENT_METADATA_FN] ?? null; } function setClassMetadataAsync(type, dependencyLoaderFn, metadataSetterFn) { const componentClass = type; componentClass[ASYNC_COMPONENT_METADATA_FN] = () => Promise.all(dependencyLoaderFn()).then(dependencies => { metadataSetterFn(...dependencies); componentClass[ASYNC_COMPONENT_METADATA_FN] = null; return dependencies; }); return componentClass[ASYNC_COMPONENT_METADATA_FN]; } function setClassMetadata(type, decorators, ctorParameters, propDecorators) { return noSideEffects(() => { const clazz = type; if (decorators !== null) { if (clazz.hasOwnProperty('decorators') && clazz.decorators !== undefined) { clazz.decorators.push(...decorators); } else { clazz.decorators = decorators; } } if (ctorParameters !== null) { clazz.ctorParameters = ctorParameters; } if (propDecorators !== null) { if (clazz.hasOwnProperty('propDecorators') && clazz.propDecorators !== undefined) { clazz.propDecorators = { ...clazz.propDecorators, ...propDecorators }; } else { clazz.propDecorators = propDecorators; } } }); } class Console { log(message) { console.log(message); } warn(message) { console.warn(message); } static ɵfac = function Console_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Console)(); }; static ɵprov = /*@__PURE__*/(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ token: Console, factory: Console.ɵfac, providedIn: 'platform' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Console, [{ type: Injectable, args: [{ providedIn: 'platform' }] }], null, null); })(); class DIDebugData { resolverToTokenToDependencies = new WeakMap(); resolverToProviders = new WeakMap(); resolverToEffects = new WeakMap(); standaloneInjectorToComponent = new WeakMap(); reset() { this.resolverToTokenToDependencies = new WeakMap(); this.resolverToProviders = new WeakMap(); this.standaloneInjectorToComponent = new WeakMap(); } } let frameworkDIDebugData = new DIDebugData(); function getFrameworkDIDebugData() { return frameworkDIDebugData; } function setupFrameworkInjectorProfiler() { frameworkDIDebugData.reset(); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setInjectorProfiler)(injectorProfilerEventHandler); } function injectorProfilerEventHandler(injectorProfilerEvent) { const { context, type } = injectorProfilerEvent; if (type === 0) { handleInjectEvent(context, injectorProfilerEvent.service); } else if (type === 1) { handleInstanceCreatedByInjectorEvent(context, injectorProfilerEvent.instance); } else if (type === 2) { handleProviderConfiguredEvent(context, injectorProfilerEvent.providerRecord); } else if (type === 3) { handleEffectCreatedEvent(context, injectorProfilerEvent.effect); } else if (type === 4) { handleEffectCreatedEvent(context, injectorProfilerEvent.effectPhase); } } function handleEffectCreatedEvent(context, effect) { const diResolver = getDIResolver(context.injector); if (diResolver === null) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)('An EffectCreated event must be run within an injection context.'); } const { resolverToEffects } = frameworkDIDebugData; const cleanupContainer = effect instanceof _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EffectRefImpl ? effect[_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.SIGNAL] : effect.sequence; let trackedEffects = resolverToEffects.get(diResolver); if (!trackedEffects) { trackedEffects = []; resolverToEffects.set(diResolver, trackedEffects); } trackedEffects.push(effect); cleanupContainer.onDestroyFns ??= []; cleanupContainer.onDestroyFns.push(() => { const index = trackedEffects.indexOf(effect); if (index > -1) { trackedEffects.splice(index, 1); } }); } function handleInjectEvent(context, data) { const diResolver = getDIResolver(context.injector); if (diResolver === null) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)('An Inject event must be run within an injection context.'); } const diResolverToInstantiatedToken = frameworkDIDebugData.resolverToTokenToDependencies; if (!diResolverToInstantiatedToken.has(diResolver)) { diResolverToInstantiatedToken.set(diResolver, new WeakMap()); } if (!canBeHeldWeakly(context.token)) { return; } const instantiatedTokenToDependencies = diResolverToInstantiatedToken.get(diResolver); if (!instantiatedTokenToDependencies.has(context.token)) { instantiatedTokenToDependencies.set(context.token, []); } const { token, value, flags } = data; (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(context.token, 'Injector profiler context token is undefined.'); const dependencies = instantiatedTokenToDependencies.get(context.token); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(dependencies, 'Could not resolve dependencies for token.'); if (context.injector instanceof NodeInjector) { dependencies.push({ token, value, flags, injectedIn: getNodeInjectorContext(context.injector) }); } else { dependencies.push({ token, value, flags }); } } function getNodeInjectorContext(injector) { if (!(injector instanceof NodeInjector)) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)('getNodeInjectorContext must be called with a NodeInjector'); } const lView = getNodeInjectorLView(injector); const tNode = getNodeInjectorTNode(injector); if (tNode === null) { return; } (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertTNodeForLView)(tNode, lView); return { lView, tNode }; } function handleInstanceCreatedByInjectorEvent(context, data) { const { value } = data; if (data.value == null) { return; } if (getDIResolver(context.injector) === null) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)('An InjectorCreatedInstance event must be run within an injection context.'); } let standaloneComponent = undefined; if (typeof value === 'object') { standaloneComponent = value?.constructor; } if (standaloneComponent == undefined || !isStandaloneComponent(standaloneComponent)) { return; } const environmentInjector = context.injector.get(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EnvironmentInjector, null, { optional: true }); if (environmentInjector === null) { return; } const { standaloneInjectorToComponent } = frameworkDIDebugData; if (standaloneInjectorToComponent.has(environmentInjector)) { return; } standaloneInjectorToComponent.set(environmentInjector, standaloneComponent); } function isStandaloneComponent(value) { const def = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentDef)(value); return !!def?.standalone; } function handleProviderConfiguredEvent(context, data) { const { resolverToProviders } = frameworkDIDebugData; let diResolver; if (context?.injector instanceof NodeInjector) { diResolver = getNodeInjectorTNode(context.injector); } else { diResolver = context.injector; } if (diResolver === null) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)('A ProviderConfigured event must be run within an injection context.'); } if (!resolverToProviders.has(diResolver)) { resolverToProviders.set(diResolver, []); } resolverToProviders.get(diResolver).push(data); } function getDIResolver(injector) { let diResolver = null; if (injector === undefined) { return diResolver; } if (injector instanceof NodeInjector) { diResolver = getNodeInjectorLView(injector); } else { diResolver = injector; } return diResolver; } function canBeHeldWeakly(value) { return value !== null && (typeof value === 'object' || typeof value === 'function' || typeof value === 'symbol'); } function isSignal(value) { return typeof value === 'function' && value[_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.SIGNAL] !== undefined; } function isWritableSignal(value) { return isSignal(value) && typeof value.set === 'function'; } function applyChanges(component) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(component, 'component'); markViewDirty(getComponentViewByInstance(component), 3); getRootComponents(component).forEach(rootComponent => detectChanges(rootComponent)); } function detectChanges(component) { const view = getComponentViewByInstance(component); view[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.FLAGS] |= 1024; detectChangesInternal(view); } function getDeferBlocks$1(lView, deferBlocks) { const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; for (let i = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET; i < tView.bindingStartIndex; i++) { if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLContainer)(lView[i])) { const lContainer = lView[i]; const isLast = i === tView.bindingStartIndex - 1; if (!isLast) { const tNode = tView.data[i]; const tDetails = getTDeferBlockDetails(tView, tNode); if (isTDeferBlockDetails(tDetails)) { deferBlocks.push({ lContainer, lView, tNode, tDetails }); continue; } } if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLView)(lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HOST])) { getDeferBlocks$1(lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HOST], deferBlocks); } for (let j = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET; j < lContainer.length; j++) { getDeferBlocks$1(lContainer[j], deferBlocks); } } else if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLView)(lView[i])) { getDeferBlocks$1(lView[i], deferBlocks); } } } function getDeferBlocks(node) { const results = []; const lView = getLContext(node)?.lView; if (lView) { findDeferBlocks(node, lView, results); } return results; } function findDeferBlocks(node, lView, results) { const viewInjector = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]; const registry = viewInjector.get(DEHYDRATED_BLOCK_REGISTRY, null, { optional: true }); const blocks = []; getDeferBlocks$1(lView, blocks); const transferState = viewInjector.get(TransferState); const deferBlockParents = transferState.get(NGH_DEFER_BLOCKS_KEY, {}); for (const details of blocks) { const native = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode)(details.tNode, details.lView); const lDetails = getLDeferBlockDetails(details.lView, details.tNode); if (!node.contains(native)) { continue; } const tDetails = details.tDetails; const renderedLView = getRendererLView(details); const rootNodes = []; const hydrationState = inferHydrationState(tDetails, lDetails, registry); if (renderedLView !== null) { collectNativeNodes(renderedLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], renderedLView, renderedLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW].firstChild, rootNodes); } else if (hydrationState === 'dehydrated') { const deferId = lDetails[SSR_UNIQUE_ID]; const deferData = deferBlockParents[deferId]; const numberOfRootNodes = deferData[NUM_ROOT_NODES]; let collectedNodeCount = 0; const deferBlockCommentNode = details.lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NATIVE]; let currentNode = deferBlockCommentNode.previousSibling; while (collectedNodeCount < numberOfRootNodes && currentNode) { rootNodes.unshift(currentNode); currentNode = currentNode.previousSibling; collectedNodeCount++; } } const data = { state: stringifyState(lDetails[DEFER_BLOCK_STATE]), incrementalHydrationState: hydrationState, hasErrorBlock: tDetails.errorTmplIndex !== null, loadingBlock: { exists: tDetails.loadingTmplIndex !== null, minimumTime: tDetails.loadingBlockConfig?.[MINIMUM_SLOT] ?? null, afterTime: tDetails.loadingBlockConfig?.[LOADING_AFTER_SLOT] ?? null }, placeholderBlock: { exists: tDetails.placeholderTmplIndex !== null, minimumTime: tDetails.placeholderBlockConfig?.[MINIMUM_SLOT] ?? null }, triggers: tDetails.debug?.triggers ? Array.from(tDetails.debug.triggers).sort() : [], rootNodes }; results.push(data); if (renderedLView !== null) { findDeferBlocks(node, renderedLView, results); } } } function stringifyState(state) { switch (state) { case DeferBlockState.Complete: return 'complete'; case DeferBlockState.Loading: return 'loading'; case DeferBlockState.Placeholder: return 'placeholder'; case DeferBlockState.Error: return 'error'; case DeferBlockInternalState.Initial: return 'initial'; default: throw new Error(`Unrecognized state ${state}`); } } function inferHydrationState(tDetails, lDetails, registry) { if (registry === null || lDetails[SSR_UNIQUE_ID] === null || tDetails.hydrateTriggers === null || tDetails.hydrateTriggers.has(7)) { return 'not-configured'; } return registry.has(lDetails[SSR_UNIQUE_ID]) ? 'dehydrated' : 'hydrated'; } function getRendererLView(details) { if (details.lContainer.length <= _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET) { return null; } const lView = details.lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTAINER_HEADER_OFFSET]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLView)(lView); return lView; } function getDependenciesFromInjectable(injector, token) { const instance = injector.get(token, null, { self: true, optional: true }); if (instance === null) { throw new Error(`Unable to determine instance of ${token} in given injector`); } const unformattedDependencies = getDependenciesForTokenInInjector(token, injector); const resolutionPath = getInjectorResolutionPath(injector); const dependencies = unformattedDependencies.map(dep => { const formattedDependency = { value: dep.value }; const flags = dep.flags; formattedDependency.flags = { optional: (8 & flags) === 8, host: (1 & flags) === 1, self: (2 & flags) === 2, skipSelf: (4 & flags) === 4 }; for (let i = 0; i < resolutionPath.length; i++) { const injectorToCheck = resolutionPath[i]; if (i === 0 && formattedDependency.flags.skipSelf) { continue; } if (formattedDependency.flags.host && injectorToCheck instanceof _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EnvironmentInjector) { break; } const instance = injectorToCheck.get(dep.token, null, { self: true, optional: true }); if (instance !== null) { if (formattedDependency.flags.host) { const firstInjector = resolutionPath[0]; const lookupFromFirstInjector = firstInjector.get(dep.token, null, { ...formattedDependency.flags, optional: true }); if (lookupFromFirstInjector !== null) { formattedDependency.providedIn = injectorToCheck; } break; } formattedDependency.providedIn = injectorToCheck; break; } if (i === 0 && formattedDependency.flags.self) { break; } } if (dep.token) formattedDependency.token = dep.token; return formattedDependency; }); return { instance, dependencies }; } function getDependenciesForTokenInInjector(token, injector) { const { resolverToTokenToDependencies } = getFrameworkDIDebugData(); if (!(injector instanceof NodeInjector)) { return resolverToTokenToDependencies.get(injector)?.get?.(token) ?? []; } const lView = getNodeInjectorLView(injector); const tokenDependencyMap = resolverToTokenToDependencies.get(lView); const dependencies = tokenDependencyMap?.get(token) ?? []; return dependencies.filter(dependency => { const dependencyNode = dependency.injectedIn?.tNode; if (dependencyNode === undefined) { return false; } const instanceNode = getNodeInjectorTNode(injector); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertTNode)(dependencyNode); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertTNode)(instanceNode); return dependencyNode === instanceNode; }); } function getProviderImportsContainer(injector) { const { standaloneInjectorToComponent } = getFrameworkDIDebugData(); if (standaloneInjectorToComponent.has(injector)) { return standaloneInjectorToComponent.get(injector); } const defTypeRef = injector.get(NgModuleRef$1, null, { self: true, optional: true }); if (defTypeRef === null) { return null; } if (defTypeRef.instance === null) { return null; } return defTypeRef.instance.constructor; } function getNodeInjectorProviders(injector) { const diResolver = getNodeInjectorTNode(injector); const { resolverToProviders } = getFrameworkDIDebugData(); return resolverToProviders.get(diResolver) ?? []; } function getProviderImportPaths(providerImportsContainer) { const providerToPath = new Map(); const visitedContainers = new Set(); const visitor = walkProviderTreeToDiscoverImportPaths(providerToPath, visitedContainers); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.walkProviderTree)(providerImportsContainer, visitor, [], new Set()); return providerToPath; } function walkProviderTreeToDiscoverImportPaths(providerToPath, visitedContainers) { return (provider, container) => { if (!providerToPath.has(provider)) { providerToPath.set(provider, [container]); } if (!visitedContainers.has(container)) { for (const prov of providerToPath.keys()) { const existingImportPath = providerToPath.get(prov); let containerDef = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getInjectorDef)(container); if (!containerDef) { const ngModule = container.ngModule; containerDef = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getInjectorDef)(ngModule); } if (!containerDef) { return; } const lastContainerAddedToPath = existingImportPath[0]; let isNextStepInPath = false; (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.deepForEach)(containerDef.imports, moduleImport => { if (isNextStepInPath) { return; } isNextStepInPath = moduleImport.ngModule === lastContainerAddedToPath || moduleImport === lastContainerAddedToPath; if (isNextStepInPath) { providerToPath.get(prov)?.unshift(container); } }); } } visitedContainers.add(container); }; } function getEnvironmentInjectorProviders(injector) { const providerRecordsWithoutImportPaths = getFrameworkDIDebugData().resolverToProviders.get(injector) ?? []; if (isPlatformInjector(injector)) { return providerRecordsWithoutImportPaths; } const providerImportsContainer = getProviderImportsContainer(injector); if (providerImportsContainer === null) { return providerRecordsWithoutImportPaths; } const providerToPath = getProviderImportPaths(providerImportsContainer); const providerRecords = []; for (const providerRecord of providerRecordsWithoutImportPaths) { const provider = providerRecord.provider; const token = provider.provide; if (token === _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ENVIRONMENT_INITIALIZER || token === _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR_DEF_TYPES) { continue; } let importPath = providerToPath.get(provider) ?? []; const def = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentDef)(providerImportsContainer); const isStandaloneComponent = !!def?.standalone; if (isStandaloneComponent) { importPath = [providerImportsContainer, ...importPath]; } providerRecords.push({ ...providerRecord, importPath }); } return providerRecords; } function isPlatformInjector(injector) { return injector instanceof _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.R3Injector && injector.scopes.has('platform'); } function getInjectorProviders(injector) { if (injector instanceof NodeInjector) { return getNodeInjectorProviders(injector); } else if (injector instanceof _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EnvironmentInjector) { return getEnvironmentInjectorProviders(injector); } (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)('getInjectorProviders only supports NodeInjector and EnvironmentInjector'); } function getInjectorMetadata(injector) { if (injector instanceof NodeInjector) { const lView = getNodeInjectorLView(injector); const tNode = getNodeInjectorTNode(injector); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertTNodeForLView)(tNode, lView); return { type: 'element', source: (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode)(tNode, lView) }; } if (injector instanceof _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.R3Injector) { return { type: 'environment', source: injector.source ?? null }; } if (injector instanceof _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NullInjector) { return { type: 'null', source: null }; } return null; } function getInjectorResolutionPath(injector) { const resolutionPath = [injector]; getInjectorResolutionPathHelper(injector, resolutionPath); return resolutionPath; } function getInjectorResolutionPathHelper(injector, resolutionPath) { const parent = getInjectorParent(injector); if (parent === null) { if (injector instanceof NodeInjector) { const firstInjector = resolutionPath[0]; if (firstInjector instanceof NodeInjector) { const moduleInjector = getModuleInjectorOfNodeInjector(firstInjector); if (moduleInjector === null) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)('NodeInjector must have some connection to the module injector tree'); } resolutionPath.push(moduleInjector); getInjectorResolutionPathHelper(moduleInjector, resolutionPath); } return resolutionPath; } } else { resolutionPath.push(parent); getInjectorResolutionPathHelper(parent, resolutionPath); } return resolutionPath; } function getInjectorParent(injector) { if (injector instanceof _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.R3Injector) { return injector.parent; } let tNode; let lView; if (injector instanceof NodeInjector) { tNode = getNodeInjectorTNode(injector); lView = getNodeInjectorLView(injector); } else if (injector instanceof _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NullInjector) { return null; } else if (injector instanceof ChainedInjector) { return injector.parentInjector; } else { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)('getInjectorParent only support injectors of type R3Injector, NodeInjector, NullInjector'); } const parentLocation = getParentInjectorLocation(tNode, lView); if (hasParentInjector(parentLocation)) { const parentInjectorIndex = getParentInjectorIndex(parentLocation); const parentLView = getParentInjectorView(parentLocation, lView); const parentTView = parentLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const parentTNode = parentTView.data[parentInjectorIndex + 8]; return new NodeInjector(parentTNode, parentLView); } else { const chainedInjector = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]; const injectorParent = chainedInjector.injector?.parent; if (injectorParent instanceof NodeInjector) { return injectorParent; } } return null; } function getModuleInjectorOfNodeInjector(injector) { let lView; if (injector instanceof NodeInjector) { lView = getNodeInjectorLView(injector); } else { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)('getModuleInjectorOfNodeInjector must be called with a NodeInjector'); } const inj = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]; const moduleInjector = inj instanceof ChainedInjector ? inj.parentInjector : inj.parent; if (!moduleInjector) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)('NodeInjector must have some connection to the module injector tree'); } return moduleInjector; } function isComputedNode(node) { return node.kind === 'computed'; } function isTemplateEffectNode(node) { return node.kind === 'template'; } function isSignalNode(node) { return node.kind === 'signal'; } function getTemplateConsumer(injector) { const tNode = getNodeInjectorTNode(injector); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertTNode)(tNode); const lView = getNodeInjectorLView(injector); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLView)(lView); const templateLView = lView[tNode.index]; if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isLView)(templateLView)) { return templateLView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.REACTIVE_TEMPLATE_CONSUMER] ?? null; } return null; } const signalDebugMap = new WeakMap(); let counter$1 = 0; function getNodesAndEdgesFromSignalMap(signalMap) { const nodes = Array.from(signalMap.keys()); const debugSignalGraphNodes = []; const edges = []; for (const [consumer, producers] of signalMap.entries()) { const consumerIndex = nodes.indexOf(consumer); let id = signalDebugMap.get(consumer); if (!id) { counter$1++; id = counter$1.toString(); signalDebugMap.set(consumer, id); } if (isComputedNode(consumer)) { debugSignalGraphNodes.push({ label: consumer.debugName, value: consumer.value, kind: consumer.kind, epoch: consumer.version, debuggableFn: consumer.computation, id }); } else if (isSignalNode(consumer)) { debugSignalGraphNodes.push({ label: consumer.debugName, value: consumer.value, kind: consumer.kind, epoch: consumer.version, id }); } else if (isTemplateEffectNode(consumer)) { debugSignalGraphNodes.push({ label: consumer.debugName ?? consumer.lView?.[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HOST]?.tagName?.toLowerCase?.(), kind: consumer.kind, epoch: consumer.version, debuggableFn: consumer.lView?.[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT]?.constructor, id }); } else { debugSignalGraphNodes.push({ label: consumer.debugName, kind: consumer.kind, epoch: consumer.version, id }); } for (const producer of producers) { edges.push({ consumer: consumerIndex, producer: nodes.indexOf(producer) }); } } return { nodes: debugSignalGraphNodes, edges }; } function extractEffectsFromInjector(injector) { let diResolver = injector; if (injector instanceof NodeInjector) { const lView = getNodeInjectorLView(injector); diResolver = lView; } const resolverToEffects = getFrameworkDIDebugData().resolverToEffects; const effects = resolverToEffects.get(diResolver) ?? []; return effects.map(effect => { if (effect instanceof _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EffectRefImpl) { return effect[_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.SIGNAL]; } else { return effect.signal[_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.SIGNAL]; } }); } function extractSignalNodesAndEdgesFromRoots(nodes, signalDependenciesMap = new Map()) { for (const node of nodes) { if (signalDependenciesMap.has(node)) { continue; } const producerNodes = []; for (let link = node.producers; link !== undefined; link = link.nextProducer) { const producer = link.producer; producerNodes.push(producer); } signalDependenciesMap.set(node, producerNodes); extractSignalNodesAndEdgesFromRoots(producerNodes, signalDependenciesMap); } return signalDependenciesMap; } function getSignalGraph(injector) { let templateConsumer = null; if (!(injector instanceof NodeInjector) && !(injector instanceof _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.R3Injector)) { return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)('getSignalGraph must be called with a NodeInjector or R3Injector'); } if (injector instanceof NodeInjector) { templateConsumer = getTemplateConsumer(injector); } const nonTemplateEffectNodes = extractEffectsFromInjector(injector); const signalNodes = templateConsumer ? [templateConsumer, ...nonTemplateEffectNodes] : nonTemplateEffectNodes; const signalDependenciesMap = extractSignalNodesAndEdgesFromRoots(signalNodes); return getNodesAndEdgesFromSignalMap(signalDependenciesMap); } let changeDetectionRuns = 0; let changeDetectionSyncRuns = 0; let counter = 0; const eventsStack = []; function measureStart(startEvent) { eventsStack.push([startEvent, counter]); console.timeStamp('Event_' + startEvent + '_' + counter++); } function measureEnd(startEvent, entryName, color) { let top; do { top = eventsStack.pop(); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(top, 'Profiling error: could not find start event entry ' + startEvent); } while (top[0] !== startEvent); console.timeStamp(entryName, 'Event_' + top[0] + '_' + top[1], undefined, '\u{1F170}\uFE0F Angular', undefined, color); } const chromeDevToolsInjectorProfiler = event => { const eventType = event.type; if (eventType === 5) { measureStart(100); } else if (eventType === 1) { const token = event.context.token; measureEnd(100, getProviderTokenMeasureName(token), 'tertiary-dark'); } }; const devToolsProfiler = (event, instance, eventFn) => { switch (event) { case ProfilerEvent.BootstrapApplicationStart: case ProfilerEvent.BootstrapComponentStart: case ProfilerEvent.ChangeDetectionStart: case ProfilerEvent.ChangeDetectionSyncStart: case ProfilerEvent.AfterRenderHooksStart: case ProfilerEvent.ComponentStart: case ProfilerEvent.DeferBlockStateStart: case ProfilerEvent.DynamicComponentStart: case ProfilerEvent.TemplateCreateStart: case ProfilerEvent.LifecycleHookStart: case ProfilerEvent.TemplateUpdateStart: case ProfilerEvent.HostBindingsUpdateStart: case ProfilerEvent.OutputStart: { measureStart(event); break; } case ProfilerEvent.BootstrapApplicationEnd: { measureEnd(ProfilerEvent.BootstrapApplicationStart, 'Bootstrap application', 'primary-dark'); break; } case ProfilerEvent.BootstrapComponentEnd: { measureEnd(ProfilerEvent.BootstrapComponentStart, 'Bootstrap component', 'primary-dark'); break; } case ProfilerEvent.ChangeDetectionEnd: { changeDetectionSyncRuns = 0; measureEnd(ProfilerEvent.ChangeDetectionStart, 'Change detection ' + changeDetectionRuns++, 'primary-dark'); break; } case ProfilerEvent.ChangeDetectionSyncEnd: { measureEnd(ProfilerEvent.ChangeDetectionSyncStart, 'Synchronization ' + changeDetectionSyncRuns++, 'primary'); break; } case ProfilerEvent.AfterRenderHooksEnd: { measureEnd(ProfilerEvent.AfterRenderHooksStart, 'After render hooks', 'primary'); break; } case ProfilerEvent.ComponentEnd: { const typeName = getComponentMeasureName(instance); measureEnd(ProfilerEvent.ComponentStart, typeName, 'primary-light'); break; } case ProfilerEvent.DeferBlockStateEnd: { measureEnd(ProfilerEvent.DeferBlockStateStart, 'Defer block', 'primary-dark'); break; } case ProfilerEvent.DynamicComponentEnd: { measureEnd(ProfilerEvent.DynamicComponentStart, 'Dynamic component creation', 'primary-dark'); break; } case ProfilerEvent.TemplateUpdateEnd: { measureEnd(ProfilerEvent.TemplateUpdateStart, (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(eventFn) + ' (update)', 'secondary-dark'); break; } case ProfilerEvent.TemplateCreateEnd: { measureEnd(ProfilerEvent.TemplateCreateStart, (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(eventFn) + ' (create)', 'secondary'); break; } case ProfilerEvent.HostBindingsUpdateEnd: { measureEnd(ProfilerEvent.HostBindingsUpdateStart, 'HostBindings', 'secondary-dark'); break; } case ProfilerEvent.LifecycleHookEnd: { const typeName = getComponentMeasureName(instance); measureEnd(ProfilerEvent.LifecycleHookStart, `${typeName}:${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(eventFn)}`, 'tertiary'); break; } case ProfilerEvent.OutputEnd: { measureEnd(ProfilerEvent.OutputStart, (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringifyForError)(eventFn), 'tertiary-light'); break; } default: { throw new Error('Unexpected profiling event type: ' + event); } } }; function getComponentMeasureName(instance) { return instance.constructor.name; } function getProviderTokenMeasureName(token) { if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isTypeProvider)(token)) { return token.name; } else if (token.provide != null) { return getProviderTokenMeasureName(token.provide); } return token.toString(); } function enableProfiling() { performanceMarkFeature('Chrome DevTools profiling'); if (typeof ngDevMode !== 'undefined' && ngDevMode) { const removeInjectorProfiler = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.setInjectorProfiler)(chromeDevToolsInjectorProfiler); const removeProfiler = setProfiler(devToolsProfiler); return () => { removeInjectorProfiler(); removeProfiler(); }; } return () => {}; } function getTransferState(injector) { const doc = injector.get(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DOCUMENT); const appId = injector.get(APP_ID); const transferState = retrieveTransferredState(doc, appId); const filteredEntries = {}; for (const [key, value] of Object.entries(transferState)) { if (!isInternalHydrationTransferStateKey(key)) { filteredEntries[key] = value; } } return filteredEntries; } const GLOBAL_PUBLISH_EXPANDO_KEY = 'ng'; const globalUtilsFunctions = { 'ɵgetDependenciesFromInjectable': getDependenciesFromInjectable, 'ɵgetInjectorProviders': getInjectorProviders, 'ɵgetInjectorResolutionPath': getInjectorResolutionPath, 'ɵgetInjectorMetadata': getInjectorMetadata, 'ɵsetProfiler': setProfiler, 'ɵgetSignalGraph': getSignalGraph, 'ɵgetDeferBlocks': getDeferBlocks, 'ɵgetTransferState': getTransferState, 'getDirectiveMetadata': getDirectiveMetadata$1, 'getComponent': getComponent, 'getContext': getContext, 'getListeners': getListeners, 'getOwningComponent': getOwningComponent, 'getHostElement': getHostElement, 'getInjector': getInjector, 'getRootComponents': getRootComponents, 'getDirectives': getDirectives, 'applyChanges': applyChanges, 'isSignal': isSignal, 'enableProfiling': enableProfiling }; let _published = false; function publishDefaultGlobalUtils$1() { if (!_published) { _published = true; if (typeof window !== 'undefined') { setupFrameworkInjectorProfiler(); } for (const [methodName, method] of Object.entries(globalUtilsFunctions)) { publishGlobalUtil(methodName, method); } } } function publishGlobalUtil(name, fn) { publishUtil(name, fn); } function publishExternalGlobalUtil(name, fn) { publishUtil(name, fn); } function publishUtil(name, fn) { if (typeof COMPILED === 'undefined' || !COMPILED) { const w = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__._global; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(fn, 'function not defined'); w[GLOBAL_PUBLISH_EXPANDO_KEY] ??= {}; w[GLOBAL_PUBLISH_EXPANDO_KEY][name] = fn; } } const TESTABILITY = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(''); const TESTABILITY_GETTER = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(''); class Testability { _ngZone; registry; _isZoneStable = true; _callbacks = []; _taskTrackingZone = null; _destroyRef; constructor(_ngZone, registry, testabilityGetter) { this._ngZone = _ngZone; this.registry = registry; if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isInInjectionContext)()) { this._destroyRef = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DestroyRef, { optional: true }) ?? undefined; } if (!_testabilityGetter) { setTestabilityGetter(testabilityGetter); testabilityGetter.addToWindow(registry); } this._watchAngularEvents(); _ngZone.run(() => { this._taskTrackingZone = typeof Zone == 'undefined' ? null : Zone.current.get('TaskTrackingZone'); }); } _watchAngularEvents() { const onUnstableSubscription = this._ngZone.onUnstable.subscribe({ next: () => { this._isZoneStable = false; } }); const onStableSubscription = this._ngZone.runOutsideAngular(() => this._ngZone.onStable.subscribe({ next: () => { _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgZone.assertNotInAngularZone(); queueMicrotask(() => { this._isZoneStable = true; this._runCallbacksIfReady(); }); } })); this._destroyRef?.onDestroy(() => { onUnstableSubscription.unsubscribe(); onStableSubscription.unsubscribe(); }); } isStable() { return this._isZoneStable && !this._ngZone.hasPendingMacrotasks; } _runCallbacksIfReady() { if (this.isStable()) { queueMicrotask(() => { while (this._callbacks.length !== 0) { let cb = this._callbacks.pop(); clearTimeout(cb.timeoutId); cb.doneCb(); } }); } else { let pending = this.getPendingTasks(); this._callbacks = this._callbacks.filter(cb => { if (cb.updateCb && cb.updateCb(pending)) { clearTimeout(cb.timeoutId); return false; } return true; }); } } getPendingTasks() { if (!this._taskTrackingZone) { return []; } return this._taskTrackingZone.macroTasks.map(t => { return { source: t.source, creationLocation: t.creationLocation, data: t.data }; }); } addCallback(cb, timeout, updateCb) { let timeoutId = -1; if (timeout && timeout > 0) { timeoutId = setTimeout(() => { this._callbacks = this._callbacks.filter(cb => cb.timeoutId !== timeoutId); cb(); }, timeout); } this._callbacks.push({ doneCb: cb, timeoutId: timeoutId, updateCb: updateCb }); } whenStable(doneCb, timeout, updateCb) { if (updateCb && !this._taskTrackingZone) { throw new Error('Task tracking zone is required when passing an update callback to ' + 'whenStable(). Is "zone.js/plugins/task-tracking" loaded?'); } this.addCallback(doneCb, timeout, updateCb); this._runCallbacksIfReady(); } registerApplication(token) { this.registry.registerApplication(token, this); } unregisterApplication(token) { this.registry.unregisterApplication(token); } findProviders(using, provider, exactMatch) { return []; } static ɵfac = function Testability_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Testability)((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"])(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgZone), (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"])(TestabilityRegistry), (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"])(TESTABILITY_GETTER)); }; static ɵprov = /*@__PURE__*/(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ token: Testability, factory: Testability.ɵfac }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Testability, [{ type: Injectable }], () => [{ type: _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgZone }, { type: TestabilityRegistry }, { type: undefined, decorators: [{ type: Inject, args: [TESTABILITY_GETTER] }] }], null); })(); class TestabilityRegistry { _applications = new Map(); registerApplication(token, testability) { this._applications.set(token, testability); } unregisterApplication(token) { this._applications.delete(token); } unregisterAllApplications() { this._applications.clear(); } getTestability(elem) { return this._applications.get(elem) || null; } getAllTestabilities() { return Array.from(this._applications.values()); } getAllRootElements() { return Array.from(this._applications.keys()); } findTestabilityInTree(elem, findInAncestors = true) { return _testabilityGetter?.findTestabilityInTree(this, elem, findInAncestors) ?? null; } static ɵfac = function TestabilityRegistry_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TestabilityRegistry)(); }; static ɵprov = /*@__PURE__*/(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ token: TestabilityRegistry, factory: TestabilityRegistry.ɵfac, providedIn: 'platform' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TestabilityRegistry, [{ type: Injectable, args: [{ providedIn: 'platform' }] }], null, null); })(); function setTestabilityGetter(getter) { _testabilityGetter = getter; } let _testabilityGetter; function isPromise(obj) { return !!obj && typeof obj.then === 'function'; } function isSubscribable(obj) { return !!obj && typeof obj.subscribe === 'function'; } const APP_INITIALIZER = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(ngDevMode ? 'Application Initializer' : ''); function provideAppInitializer(initializerFn) { return (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.makeEnvironmentProviders)([{ provide: APP_INITIALIZER, multi: true, useValue: initializerFn }]); } class ApplicationInitStatus { resolve; reject; initialized = false; done = false; donePromise = new Promise((res, rej) => { this.resolve = res; this.reject = rej; }); appInits = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(APP_INITIALIZER, { optional: true }) ?? []; injector = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.Injector); constructor() { if ((typeof ngDevMode === 'undefined' || ngDevMode) && !Array.isArray(this.appInits)) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(-209, 'Unexpected type of the `APP_INITIALIZER` token value ' + `(expected an array, but got ${typeof this.appInits}). ` + 'Please check that the `APP_INITIALIZER` token is configured as a ' + '`multi: true` provider.'); } } runInitializers() { if (this.initialized) { return; } const asyncInitPromises = []; for (const appInits of this.appInits) { const initResult = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.runInInjectionContext)(this.injector, appInits); if (isPromise(initResult)) { asyncInitPromises.push(initResult); } else if (isSubscribable(initResult)) { const observableAsPromise = new Promise((resolve, reject) => { initResult.subscribe({ complete: resolve, error: reject }); }); asyncInitPromises.push(observableAsPromise); } } const complete = () => { this.done = true; this.resolve(); }; Promise.all(asyncInitPromises).then(() => { complete(); }).catch(e => { this.reject(e); }); if (asyncInitPromises.length === 0) { complete(); } this.initialized = true; } static ɵfac = function ApplicationInitStatus_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ApplicationInitStatus)(); }; static ɵprov = /*@__PURE__*/(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ token: ApplicationInitStatus, factory: ApplicationInitStatus.ɵfac, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationInitStatus, [{ type: Injectable, args: [{ providedIn: 'root' }] }], () => [], null); })(); const APP_BOOTSTRAP_LISTENER = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(ngDevMode ? 'appBootstrapListener' : ''); function publishDefaultGlobalUtils() { ngDevMode && publishDefaultGlobalUtils$1(); } function publishSignalConfiguration() { (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setThrowInvalidWriteToSignalError)(() => { let errorMessage = ''; if (ngDevMode) { const activeConsumer = (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.getActiveConsumer)(); errorMessage = activeConsumer && isReactiveLViewConsumer(activeConsumer) ? 'Writing to signals is not allowed while Angular renders the template (eg. interpolations)' : 'Writing to signals is not allowed in a `computed`'; } throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(600, errorMessage); }); } function isBoundToModule(cf) { return cf.isBoundToModule; } const MAXIMUM_REFRESH_RERUNS = 10; function optionsReducer(dst, objs) { if (Array.isArray(objs)) { return objs.reduce(optionsReducer, dst); } return { ...dst, ...objs }; } class ApplicationRef { _runningTick = false; _destroyed = false; _destroyListeners = []; _views = []; internalErrorHandler = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INTERNAL_APPLICATION_ERROR_HANDLER); afterRenderManager = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(AfterRenderManager); zonelessEnabled = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ZONELESS_ENABLED); rootEffectScheduler = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EffectScheduler); dirtyFlags = 0; tracingSnapshot = null; allTestViews = new Set(); autoDetectTestViews = new Set(); includeAllTestViews = false; afterTick = new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject(); get allViews() { return [...(this.includeAllTestViews ? this.allTestViews : this.autoDetectTestViews).keys(), ...this._views]; } get destroyed() { return this._destroyed; } componentTypes = []; components = []; internalPendingTask = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PendingTasksInternal); get isStable() { return this.internalPendingTask.hasPendingTasksObservable.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(pending => !pending)); } constructor() { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(TracingService, { optional: true }); } whenStable() { let subscription; return new Promise(resolve => { subscription = this.isStable.subscribe({ next: stable => { if (stable) { resolve(); } } }); }).finally(() => { subscription.unsubscribe(); }); } _injector = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.inject)(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.EnvironmentInjector); _rendererFactory = null; get injector() { return this._injector; } bootstrap(componentOrFactory, rootSelectorOrNode) { return this.bootstrapImpl(componentOrFactory, rootSelectorOrNode); } bootstrapImpl(componentOrFactory, rootSelectorOrNode, injector = _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.Injector.NULL) { const ngZone = this._injector.get(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgZone); return ngZone.run(() => { profiler(ProfilerEvent.BootstrapComponentStart); (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed); const isComponentFactory = componentOrFactory instanceof ComponentFactory$1; const initStatus = this._injector.get(ApplicationInitStatus); if (!initStatus.done) { let errorMessage = ''; if (typeof ngDevMode === 'undefined' || ngDevMode) { const standalone = !isComponentFactory && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isStandalone)(componentOrFactory); errorMessage = 'Cannot bootstrap as there are still asynchronous initializers running.' + (standalone ? '' : ' Bootstrap components in the `ngDoBootstrap` method of the root module.'); } throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(405, errorMessage); } let componentFactory; if (isComponentFactory) { componentFactory = componentOrFactory; } else { const resolver = this._injector.get(ComponentFactoryResolver$1); componentFactory = resolver.resolveComponentFactory(componentOrFactory); } this.componentTypes.push(componentFactory.componentType); const ngModule = isBoundToModule(componentFactory) ? undefined : this._injector.get(NgModuleRef$1); const selectorOrNode = rootSelectorOrNode || componentFactory.selector; const compRef = componentFactory.create(injector, [], selectorOrNode, ngModule); const nativeElement = compRef.location.nativeElement; const testability = compRef.injector.get(TESTABILITY, null); testability?.registerApplication(nativeElement); compRef.onDestroy(() => { this.detachView(compRef.hostView); remove(this.components, compRef); testability?.unregisterApplication(nativeElement); }); this._loadComponent(compRef); if (typeof ngDevMode === 'undefined' || ngDevMode) { const _console = this._injector.get(Console); _console.log(`Angular is running in development mode.`); } profiler(ProfilerEvent.BootstrapComponentEnd, compRef); return compRef; }); } tick() { if (!this.zonelessEnabled) { this.dirtyFlags |= 1; } this._tick(); } _tick() { profiler(ProfilerEvent.ChangeDetectionStart); if (this.tracingSnapshot !== null) { this.tracingSnapshot.run(TracingAction.CHANGE_DETECTION, this.tickImpl); } else { this.tickImpl(); } } tickImpl = () => { (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed); if (this._runningTick) { profiler(ProfilerEvent.ChangeDetectionEnd); throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(101, ngDevMode && 'ApplicationRef.tick is called recursively'); } const prevConsumer = (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(null); try { this._runningTick = true; this.synchronize(); if (typeof ngDevMode === 'undefined' || ngDevMode) { for (let view of this.allViews) { view.checkNoChanges(); } } } finally { this._runningTick = false; this.tracingSnapshot?.dispose(); this.tracingSnapshot = null; (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(prevConsumer); this.afterTick.next(); profiler(ProfilerEvent.ChangeDetectionEnd); } }; synchronize() { if (this._rendererFactory === null && !this._injector.destroyed) { this._rendererFactory = this._injector.get(RendererFactory2, null, { optional: true }); } let runs = 0; while (this.dirtyFlags !== 0 && runs++ < MAXIMUM_REFRESH_RERUNS) { profiler(ProfilerEvent.ChangeDetectionSyncStart); try { this.synchronizeOnce(); } finally { profiler(ProfilerEvent.ChangeDetectionSyncEnd); } } if ((typeof ngDevMode === 'undefined' || ngDevMode) && runs >= MAXIMUM_REFRESH_RERUNS) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(103, ngDevMode && 'Infinite change detection while refreshing application views. ' + 'Ensure views are not calling `markForCheck` on every template execution or ' + 'that afterRender hooks always mark views for check.'); } } synchronizeOnce() { if (this.dirtyFlags & 16) { this.dirtyFlags &= ~16; this.rootEffectScheduler.flush(); } let ranDetectChanges = false; if (this.dirtyFlags & 7) { const useGlobalCheck = Boolean(this.dirtyFlags & 1); this.dirtyFlags &= ~7; this.dirtyFlags |= 8; for (let { _lView } of this.allViews) { if (!useGlobalCheck && !(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.requiresRefreshOrTraversal)(_lView)) { continue; } const mode = useGlobalCheck && !this.zonelessEnabled ? 0 : 1; detectChangesInternal(_lView, mode); ranDetectChanges = true; } this.dirtyFlags &= ~4; this.syncDirtyFlagsWithViews(); if (this.dirtyFlags & (7 | 16)) { return; } } if (!ranDetectChanges) { this._rendererFactory?.begin?.(); this._rendererFactory?.end?.(); } if (this.dirtyFlags & 8) { this.dirtyFlags &= ~8; this.afterRenderManager.execute(); } this.syncDirtyFlagsWithViews(); } syncDirtyFlagsWithViews() { if (this.allViews.some(({ _lView }) => (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.requiresRefreshOrTraversal)(_lView))) { this.dirtyFlags |= 2; return; } else { this.dirtyFlags &= ~7; } } attachView(viewRef) { (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed); const view = viewRef; this._views.push(view); view.attachToAppRef(this); } detachView(viewRef) { (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed); const view = viewRef; remove(this._views, view); view.detachFromAppRef(); } _loadComponent(componentRef) { this.attachView(componentRef.hostView); try { this.tick(); } catch (e) { this.internalErrorHandler(e); } this.components.push(componentRef); const listeners = this._injector.get(APP_BOOTSTRAP_LISTENER, []); if (ngDevMode && !Array.isArray(listeners)) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(-209, 'Unexpected type of the `APP_BOOTSTRAP_LISTENER` token value ' + `(expected an array, but got ${typeof listeners}). ` + 'Please check that the `APP_BOOTSTRAP_LISTENER` token is configured as a ' + '`multi: true` provider.'); } listeners.forEach(listener => listener(componentRef)); } ngOnDestroy() { if (this._destroyed) return; try { this._destroyListeners.forEach(listener => listener()); this._views.slice().forEach(view => view.destroy()); } finally { this._destroyed = true; this._views = []; this._destroyListeners = []; } } onDestroy(callback) { (typeof ngDevMode === 'undefined' || ngDevMode) && warnIfDestroyed(this._destroyed); this._destroyListeners.push(callback); return () => remove(this._destroyListeners, callback); } destroy() { if (this._destroyed) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(406, ngDevMode && 'This instance of the `ApplicationRef` has already been destroyed.'); } const injector = this._injector; if (injector.destroy && !injector.destroyed) { injector.destroy(); } } get viewCount() { return this._views.length; } static ɵfac = function ApplicationRef_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ApplicationRef)(); }; static ɵprov = /*@__PURE__*/(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"])({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' }); } (() => { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{ type: Injectable, args: [{ providedIn: 'root' }] }], () => [], null); })(); function warnIfDestroyed(destroyed) { if (destroyed) { console.warn((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.formatRuntimeError)(406, 'This instance of the `ApplicationRef` has already been destroyed.')); } } function remove(list, el) { const index = list.indexOf(el); if (index > -1) { list.splice(index, 1); } } function promiseWithResolvers() { let resolve; let reject; const promise = new Promise((res, rej) => { resolve = res; reject = rej; }); return { promise, resolve, reject }; } function scheduleDelayedTrigger(scheduleFn) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); renderPlaceholder(lView, tNode); if (!shouldTriggerDeferBlock(0, lView)) return; const injector = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]; const lDetails = getLDeferBlockDetails(lView, tNode); const cleanupFn = scheduleFn(() => triggerDeferBlock(0, lView, tNode), injector); storeTriggerCleanupFn(0, lDetails, cleanupFn); } function scheduleDelayedPrefetching(scheduleFn) { if (typeof ngServerMode !== 'undefined' && ngServerMode) return; const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const injector = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]; const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const tDetails = getTDeferBlockDetails(tView, tNode); if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) { const lDetails = getLDeferBlockDetails(lView, tNode); const prefetch = () => triggerPrefetching(tDetails, lView, tNode); const cleanupFn = scheduleFn(prefetch, injector); storeTriggerCleanupFn(1, lDetails, cleanupFn); } } function scheduleDelayedHydrating(scheduleFn, lView, tNode) { if (typeof ngServerMode !== 'undefined' && ngServerMode) return; const injector = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]; const lDetails = getLDeferBlockDetails(lView, tNode); const ssrUniqueId = lDetails[SSR_UNIQUE_ID]; ngDevMode && assertSsrIdDefined(ssrUniqueId); const cleanupFn = scheduleFn(() => triggerHydrationFromBlockName(injector, ssrUniqueId), injector); storeTriggerCleanupFn(2, lDetails, cleanupFn); } function triggerPrefetching(tDetails, lView, tNode) { triggerResourceLoading(tDetails, lView, tNode); } function triggerResourceLoading(tDetails, lView, tNode) { const injector = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]; const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; if (tDetails.loadingState !== DeferDependenciesLoadingState.NOT_STARTED) { return tDetails.loadingPromise ?? Promise.resolve(); } const lDetails = getLDeferBlockDetails(lView, tNode); const primaryBlockTNode = getPrimaryBlockTNode(tView, tDetails); tDetails.loadingState = DeferDependenciesLoadingState.IN_PROGRESS; invokeTriggerCleanupFns(1, lDetails); let dependenciesFn = tDetails.dependencyResolverFn; if (ngDevMode) { const deferDependencyInterceptor = injector.get(DEFER_BLOCK_DEPENDENCY_INTERCEPTOR, null, { optional: true }); if (deferDependencyInterceptor) { dependenciesFn = deferDependencyInterceptor.intercept(dependenciesFn); } } const removeTask = injector.get(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PendingTasks).add(); if (!dependenciesFn) { tDetails.loadingPromise = Promise.resolve().then(() => { tDetails.loadingPromise = null; tDetails.loadingState = DeferDependenciesLoadingState.COMPLETE; removeTask(); }); return tDetails.loadingPromise; } tDetails.loadingPromise = Promise.allSettled(dependenciesFn()).then(results => { let failed = false; const directiveDefs = []; const pipeDefs = []; for (const result of results) { if (result.status === 'fulfilled') { const dependency = result.value; const directiveDef = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getComponentDef)(dependency) || (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getDirectiveDef)(dependency); if (directiveDef) { directiveDefs.push(directiveDef); } else { const pipeDef = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getPipeDef)(dependency); if (pipeDef) { pipeDefs.push(pipeDef); } } } else { failed = true; break; } } if (failed) { tDetails.loadingState = DeferDependenciesLoadingState.FAILED; if (tDetails.errorTmplIndex === null) { const templateLocation = ngDevMode ? getTemplateLocationDetails(lView) : ''; const error = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(-750, ngDevMode && 'Loading dependencies for `@defer` block failed, ' + `but no \`@error\` block was configured${templateLocation}. ` + 'Consider using the `@error` block to render an error state.'); handleUncaughtError(lView, error); } } else { tDetails.loadingState = DeferDependenciesLoadingState.COMPLETE; const primaryBlockTView = primaryBlockTNode.tView; if (directiveDefs.length > 0) { primaryBlockTView.directiveRegistry = addDepsToRegistry(primaryBlockTView.directiveRegistry, directiveDefs); const directiveTypes = directiveDefs.map(def => def.type); const providers = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.internalImportProvidersFrom)(false, ...directiveTypes); tDetails.providers = providers; } if (pipeDefs.length > 0) { primaryBlockTView.pipeRegistry = addDepsToRegistry(primaryBlockTView.pipeRegistry, pipeDefs); } } }); return tDetails.loadingPromise.finally(() => { tDetails.loadingPromise = null; removeTask(); }); } function shouldTriggerDeferBlock(triggerType, lView) { if (triggerType === 0 && typeof ngServerMode !== 'undefined' && ngServerMode) { return false; } const injector = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]; const config = injector.get(DEFER_BLOCK_CONFIG, null, { optional: true }); if (config?.behavior === DeferBlockBehavior.Manual) { return false; } return true; } function triggerDeferBlock(triggerType, lView, tNode) { const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const lContainer = lView[tNode.index]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertLContainer)(lContainer); if (!shouldTriggerDeferBlock(triggerType, lView)) return; const lDetails = getLDeferBlockDetails(lView, tNode); const tDetails = getTDeferBlockDetails(tView, tNode); invokeAllTriggerCleanupFns(lDetails); switch (tDetails.loadingState) { case DeferDependenciesLoadingState.NOT_STARTED: renderDeferBlockState(DeferBlockState.Loading, tNode, lContainer); triggerResourceLoading(tDetails, lView, tNode); if (tDetails.loadingState === DeferDependenciesLoadingState.IN_PROGRESS) { renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer); } break; case DeferDependenciesLoadingState.IN_PROGRESS: renderDeferBlockState(DeferBlockState.Loading, tNode, lContainer); renderDeferStateAfterResourceLoading(tDetails, tNode, lContainer); break; case DeferDependenciesLoadingState.COMPLETE: ngDevMode && assertDeferredDependenciesLoaded(tDetails); renderDeferBlockState(DeferBlockState.Complete, tNode, lContainer); break; case DeferDependenciesLoadingState.FAILED: renderDeferBlockState(DeferBlockState.Error, tNode, lContainer); break; default: if (ngDevMode) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.throwError)('Unknown defer block state'); } } } function triggerHydrationFromBlockName(_x4, _x5, _x6) { return _triggerHydrationFromBlockName.apply(this, arguments); } function _triggerHydrationFromBlockName() { _triggerHydrationFromBlockName = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (injector, blockName, replayQueuedEventsFn) { const dehydratedBlockRegistry = injector.get(DEHYDRATED_BLOCK_REGISTRY); const blocksBeingHydrated = dehydratedBlockRegistry.hydrating; if (blocksBeingHydrated.has(blockName)) { return; } const { parentBlockPromise, hydrationQueue } = getParentBlockHydrationQueue(blockName, injector); if (hydrationQueue.length === 0) return; if (parentBlockPromise !== null) { hydrationQueue.shift(); } populateHydratingStateForQueue(dehydratedBlockRegistry, hydrationQueue); if (parentBlockPromise !== null) { yield parentBlockPromise; } const topmostParentBlock = hydrationQueue[0]; if (dehydratedBlockRegistry.has(topmostParentBlock)) { yield triggerHydrationForBlockQueue(injector, hydrationQueue, replayQueuedEventsFn); } else { dehydratedBlockRegistry.awaitParentBlock(topmostParentBlock, /*#__PURE__*/(0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { return yield triggerHydrationForBlockQueue(injector, hydrationQueue, replayQueuedEventsFn); })); } }); return _triggerHydrationFromBlockName.apply(this, arguments); } function triggerHydrationForBlockQueue(_x7, _x8, _x9) { return _triggerHydrationForBlockQueue.apply(this, arguments); } function _triggerHydrationForBlockQueue() { _triggerHydrationForBlockQueue = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (injector, hydrationQueue, replayQueuedEventsFn) { const dehydratedBlockRegistry = injector.get(DEHYDRATED_BLOCK_REGISTRY); const blocksBeingHydrated = dehydratedBlockRegistry.hydrating; const pendingTasks = injector.get(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.PendingTasksInternal); const taskId = pendingTasks.add(); for (let blockQueueIdx = 0; blockQueueIdx < hydrationQueue.length; blockQueueIdx++) { const dehydratedBlockId = hydrationQueue[blockQueueIdx]; const dehydratedDeferBlock = dehydratedBlockRegistry.get(dehydratedBlockId); if (dehydratedDeferBlock != null) { yield triggerResourceLoadingForHydration(dehydratedDeferBlock); yield nextRender(injector); if (deferBlockHasErrored(dehydratedDeferBlock)) { removeDehydratedViewList(dehydratedDeferBlock); cleanupRemainingHydrationQueue(hydrationQueue.slice(blockQueueIdx), dehydratedBlockRegistry); break; } blocksBeingHydrated.get(dehydratedBlockId).resolve(); } else { cleanupParentContainer(blockQueueIdx, hydrationQueue, dehydratedBlockRegistry); cleanupRemainingHydrationQueue(hydrationQueue.slice(blockQueueIdx), dehydratedBlockRegistry); break; } } const lastBlockName = hydrationQueue[hydrationQueue.length - 1]; yield blocksBeingHydrated.get(lastBlockName)?.promise; pendingTasks.remove(taskId); if (replayQueuedEventsFn) { replayQueuedEventsFn(hydrationQueue); } cleanupHydratedDeferBlocks(dehydratedBlockRegistry.get(lastBlockName), hydrationQueue, dehydratedBlockRegistry, injector.get(ApplicationRef)); }); return _triggerHydrationForBlockQueue.apply(this, arguments); } function deferBlockHasErrored(deferBlock) { return getLDeferBlockDetails(deferBlock.lView, deferBlock.tNode)[DEFER_BLOCK_STATE] === DeferBlockState.Error; } function cleanupParentContainer(currentBlockIdx, hydrationQueue, dehydratedBlockRegistry) { const parentDeferBlockIdx = currentBlockIdx - 1; const parentDeferBlock = parentDeferBlockIdx > -1 ? dehydratedBlockRegistry.get(hydrationQueue[parentDeferBlockIdx]) : null; if (parentDeferBlock) { cleanupLContainer(parentDeferBlock.lContainer); } } function cleanupRemainingHydrationQueue(hydrationQueue, dehydratedBlockRegistry) { const blocksBeingHydrated = dehydratedBlockRegistry.hydrating; for (const dehydratedBlockId in hydrationQueue) { blocksBeingHydrated.get(dehydratedBlockId)?.reject(); } dehydratedBlockRegistry.cleanup(hydrationQueue); } function populateHydratingStateForQueue(registry, queue) { for (let blockId of queue) { registry.hydrating.set(blockId, promiseWithResolvers()); } } function nextRender(injector) { return new Promise(resolveFn => afterNextRender(resolveFn, { injector })); } function triggerResourceLoadingForHydration(_x0) { return _triggerResourceLoadingForHydration.apply(this, arguments); } function _triggerResourceLoadingForHydration() { _triggerResourceLoadingForHydration = (0,_Users_jakewalsh_Documents_projects_tomoverse_tvct_clinical_node_modules_angular_builders_custom_webpack_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (dehydratedBlock) { const { tNode, lView } = dehydratedBlock; const lDetails = getLDeferBlockDetails(lView, tNode); return new Promise(resolve => { onDeferBlockCompletion(lDetails, resolve); triggerDeferBlock(2, lView, tNode); }); }); return _triggerResourceLoadingForHydration.apply(this, arguments); } function onDeferBlockCompletion(lDetails, callback) { if (!Array.isArray(lDetails[ON_COMPLETE_FNS])) { lDetails[ON_COMPLETE_FNS] = []; } lDetails[ON_COMPLETE_FNS].push(callback); } function shouldAttachTrigger(triggerType, lView, tNode) { if (triggerType === 0) { return shouldAttachRegularTrigger(lView, tNode); } else if (triggerType === 2) { return !shouldAttachRegularTrigger(lView, tNode); } return !(typeof ngServerMode !== 'undefined' && ngServerMode); } function hasHydrateTriggers(flags) { return flags != null && (flags & 1) === 1; } function shouldAttachRegularTrigger(lView, tNode) { const injector = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]; const tDetails = getTDeferBlockDetails(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode); const incrementalHydrationEnabled = isIncrementalHydrationEnabled(injector); const _hasHydrateTriggers = hasHydrateTriggers(tDetails.flags); if (typeof ngServerMode !== 'undefined' && ngServerMode) { return !incrementalHydrationEnabled || !_hasHydrateTriggers; } const lDetails = getLDeferBlockDetails(lView, tNode); const wasServerSideRendered = lDetails[SSR_UNIQUE_ID] !== null; if (_hasHydrateTriggers && wasServerSideRendered && incrementalHydrationEnabled) { return false; } return true; } function getHydrateTriggers(tView, tNode) { const tDetails = getTDeferBlockDetails(tView, tNode); return tDetails.hydrateTriggers ??= new Map(); } function processAndInitTriggers(injector, blockData, nodes) { const idleElements = []; const timerElements = []; const viewportElements = []; const immediateElements = []; for (let [blockId, blockSummary] of blockData) { const commentNode = nodes.get(blockId); if (commentNode !== undefined) { const numRootNodes = blockSummary.data[NUM_ROOT_NODES]; let currentNode = commentNode; for (let i = 0; i < numRootNodes; i++) { currentNode = currentNode.previousSibling; if (currentNode.nodeType !== Node.ELEMENT_NODE) { continue; } const elementTrigger = { el: currentNode, blockName: blockId }; if (blockSummary.hydrate.idle) { idleElements.push(elementTrigger); } if (blockSummary.hydrate.immediate) { immediateElements.push(elementTrigger); } if (blockSummary.hydrate.timer !== null) { elementTrigger.delay = blockSummary.hydrate.timer; timerElements.push(elementTrigger); } if (blockSummary.hydrate.viewport) { if (typeof blockSummary.hydrate.viewport !== 'boolean') { elementTrigger.intersectionObserverOptions = blockSummary.hydrate.viewport; } viewportElements.push(elementTrigger); } } } } setIdleTriggers(injector, idleElements); setImmediateTriggers(injector, immediateElements); setViewportTriggers(injector, viewportElements); setTimerTriggers(injector, timerElements); } function setIdleTriggers(injector, elementTriggers) { for (const elementTrigger of elementTriggers) { const registry = injector.get(DEHYDRATED_BLOCK_REGISTRY); const onInvoke = () => triggerHydrationFromBlockName(injector, elementTrigger.blockName); const cleanupFn = onIdle(onInvoke, injector); registry.addCleanupFn(elementTrigger.blockName, cleanupFn); } } function setViewportTriggers(injector, elementTriggers) { if (elementTriggers.length > 0) { const registry = injector.get(DEHYDRATED_BLOCK_REGISTRY); for (let elementTrigger of elementTriggers) { const cleanupFn = onViewportWrapper(elementTrigger.el, () => triggerHydrationFromBlockName(injector, elementTrigger.blockName), injector, elementTrigger.intersectionObserverOptions); registry.addCleanupFn(elementTrigger.blockName, cleanupFn); } } } function setTimerTriggers(injector, elementTriggers) { for (const elementTrigger of elementTriggers) { const registry = injector.get(DEHYDRATED_BLOCK_REGISTRY); const onInvoke = () => triggerHydrationFromBlockName(injector, elementTrigger.blockName); const timerFn = onTimer(elementTrigger.delay); const cleanupFn = timerFn(onInvoke, injector); registry.addCleanupFn(elementTrigger.blockName, cleanupFn); } } function setImmediateTriggers(injector, elementTriggers) { for (const elementTrigger of elementTriggers) { triggerHydrationFromBlockName(injector, elementTrigger.blockName); } } let _hmrWarningProduced = false; function logHmrWarning(injector) { if (!_hmrWarningProduced) { _hmrWarningProduced = true; const console = injector.get(Console); console.log((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.formatRuntimeError)(-751, 'Angular has detected that this application contains `@defer` blocks ' + 'and the hot module replacement (HMR) mode is enabled. All `@defer` ' + 'block dependencies will be loaded eagerly.')); } } function ɵɵdefer(index, primaryTmplIndex, dependencyResolverFn, loadingTmplIndex, placeholderTmplIndex, errorTmplIndex, loadingConfigIndex, placeholderConfigIndex, enableTimerScheduling, flags) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTView)(); const adjustedIndex = index + _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.HEADER_OFFSET; const tNode = declareNoDirectiveHostTemplate(lView, tView, index, null, 0, 0); const injector = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]; const incrementalHydrationEnabled = isIncrementalHydrationEnabled(injector); if (tView.firstCreatePass) { performanceMarkFeature('NgDefer'); if (ngDevMode) { if (typeof ngHmrMode !== 'undefined' && ngHmrMode) { logHmrWarning(injector); } if (hasHydrateTriggers(flags) && !incrementalHydrationEnabled) { warnIncrementalHydrationNotConfigured(); } } const tDetails = { primaryTmplIndex, loadingTmplIndex: loadingTmplIndex ?? null, placeholderTmplIndex: placeholderTmplIndex ?? null, errorTmplIndex: errorTmplIndex ?? null, placeholderBlockConfig: null, loadingBlockConfig: null, dependencyResolverFn: dependencyResolverFn ?? null, loadingState: DeferDependenciesLoadingState.NOT_STARTED, loadingPromise: null, providers: null, hydrateTriggers: null, debug: null, flags: flags ?? 0 }; enableTimerScheduling?.(tView, tDetails, placeholderConfigIndex, loadingConfigIndex); setTDeferBlockDetails(tView, adjustedIndex, tDetails); } const lContainer = lView[adjustedIndex]; populateDehydratedViewsInLContainer(lContainer, tNode, lView); let ssrBlockState = null; let ssrUniqueId = null; if (lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DEHYDRATED_VIEWS]?.length > 0) { const info = lContainer[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DEHYDRATED_VIEWS][0].data; ssrUniqueId = info[DEFER_BLOCK_ID] ?? null; ssrBlockState = info[DEFER_BLOCK_STATE$1]; } const lDetails = [null, DeferBlockInternalState.Initial, null, null, null, null, ssrUniqueId, ssrBlockState, null, null]; setLDeferBlockDetails(lView, adjustedIndex, lDetails); let registry = null; if (ssrUniqueId !== null && incrementalHydrationEnabled) { registry = injector.get(DEHYDRATED_BLOCK_REGISTRY); registry.add(ssrUniqueId, { lView, tNode, lContainer }); } const onLViewDestroy = () => { invokeAllTriggerCleanupFns(lDetails); if (ssrUniqueId !== null) { registry?.cleanup([ssrUniqueId]); } }; storeTriggerCleanupFn(0, lDetails, () => (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.removeLViewOnDestroy)(lView, onLViewDestroy)); (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.storeLViewOnDestroy)(lView, onLViewDestroy); } function ɵɵdeferWhen(rawValue) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getSelectedTNode)(); if (ngDevMode) { trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, 'when '); } if (!shouldAttachTrigger(0, lView, tNode)) return; const bindingIndex = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.nextBindingIndex)(); if (bindingUpdated(lView, bindingIndex, rawValue)) { const prevConsumer = (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(null); try { const value = Boolean(rawValue); const lDetails = getLDeferBlockDetails(lView, tNode); const renderedState = lDetails[DEFER_BLOCK_STATE]; if (value === false && renderedState === DeferBlockInternalState.Initial) { renderPlaceholder(lView, tNode); } else if (value === true && (renderedState === DeferBlockInternalState.Initial || renderedState === DeferBlockState.Placeholder)) { triggerDeferBlock(0, lView, tNode); } } finally { (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(prevConsumer); } } } function ɵɵdeferPrefetchWhen(rawValue) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getSelectedTNode)(); if (ngDevMode) { trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, 'prefetch when '); } if (!shouldAttachTrigger(1, lView, tNode)) return; const bindingIndex = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.nextBindingIndex)(); if (bindingUpdated(lView, bindingIndex, rawValue)) { const prevConsumer = (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(null); try { const value = Boolean(rawValue); const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const tDetails = getTDeferBlockDetails(tView, tNode); if (value === true && tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) { triggerPrefetching(tDetails, lView, tNode); } } finally { (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(prevConsumer); } } } function ɵɵdeferHydrateWhen(rawValue) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getSelectedTNode)(); if (ngDevMode) { trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, 'hydrate when '); } if (!shouldAttachTrigger(2, lView, tNode)) return; const bindingIndex = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.nextBindingIndex)(); const tView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTView)(); const hydrateTriggers = getHydrateTriggers(tView, tNode); hydrateTriggers.set(6, null); if (bindingUpdated(lView, bindingIndex, rawValue)) { if (typeof ngServerMode !== 'undefined' && ngServerMode) { triggerDeferBlock(2, lView, tNode); } else { const injector = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]; const prevConsumer = (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(null); try { const value = Boolean(rawValue); if (value === true) { const lDetails = getLDeferBlockDetails(lView, tNode); const ssrUniqueId = lDetails[SSR_UNIQUE_ID]; ngDevMode && assertSsrIdDefined(ssrUniqueId); triggerHydrationFromBlockName(injector, ssrUniqueId); } } finally { (0,_effect_chunk_mjs__WEBPACK_IMPORTED_MODULE_2__.setActiveConsumer)(prevConsumer); } } } } function ɵɵdeferHydrateNever() { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); if (ngDevMode) { trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, 'hydrate never'); } if (!shouldAttachTrigger(2, lView, tNode)) return; const hydrateTriggers = getHydrateTriggers((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTView)(), tNode); hydrateTriggers.set(7, null); if (typeof ngServerMode !== 'undefined' && ngServerMode) { triggerDeferBlock(2, lView, tNode); } } function ɵɵdeferOnIdle() { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); if (ngDevMode) { trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, 'on idle'); } if (!shouldAttachTrigger(0, lView, tNode)) return; scheduleDelayedTrigger(onIdle); } function ɵɵdeferPrefetchOnIdle() { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); if (ngDevMode) { trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, 'prefetch on idle'); } if (!shouldAttachTrigger(1, lView, tNode)) return; scheduleDelayedPrefetching(onIdle); } function ɵɵdeferHydrateOnIdle() { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); if (ngDevMode) { trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, 'hydrate on idle'); } if (!shouldAttachTrigger(2, lView, tNode)) return; const hydrateTriggers = getHydrateTriggers((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTView)(), tNode); hydrateTriggers.set(0, null); if (typeof ngServerMode !== 'undefined' && ngServerMode) { triggerDeferBlock(2, lView, tNode); } else { scheduleDelayedHydrating(onIdle, lView, tNode); } } function ɵɵdeferOnImmediate() { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); if (ngDevMode) { trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, 'on immediate'); } if (!shouldAttachTrigger(0, lView, tNode)) return; const tDetails = getTDeferBlockDetails(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode); if (tDetails.loadingTmplIndex === null) { renderPlaceholder(lView, tNode); } triggerDeferBlock(0, lView, tNode); } function ɵɵdeferPrefetchOnImmediate() { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); if (ngDevMode) { trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, 'prefetch on immediate'); } if (!shouldAttachTrigger(1, lView, tNode)) return; const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const tDetails = getTDeferBlockDetails(tView, tNode); if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) { triggerResourceLoading(tDetails, lView, tNode); } } function ɵɵdeferHydrateOnImmediate() { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); if (ngDevMode) { trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, 'hydrate on immediate'); } if (!shouldAttachTrigger(2, lView, tNode)) return; const hydrateTriggers = getHydrateTriggers((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTView)(), tNode); hydrateTriggers.set(1, null); if (typeof ngServerMode !== 'undefined' && ngServerMode) { triggerDeferBlock(2, lView, tNode); } else { const injector = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]; const lDetails = getLDeferBlockDetails(lView, tNode); const ssrUniqueId = lDetails[SSR_UNIQUE_ID]; ngDevMode && assertSsrIdDefined(ssrUniqueId); triggerHydrationFromBlockName(injector, ssrUniqueId); } } function ɵɵdeferOnTimer(delay) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); if (ngDevMode) { trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, `on timer(${delay}ms)`); } if (!shouldAttachTrigger(0, lView, tNode)) return; scheduleDelayedTrigger(onTimer(delay)); } function ɵɵdeferPrefetchOnTimer(delay) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); if (ngDevMode) { trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, `prefetch on timer(${delay}ms)`); } if (!shouldAttachTrigger(1, lView, tNode)) return; scheduleDelayedPrefetching(onTimer(delay)); } function ɵɵdeferHydrateOnTimer(delay) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); if (ngDevMode) { trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, `hydrate on timer(${delay}ms)`); } if (!shouldAttachTrigger(2, lView, tNode)) return; const hydrateTriggers = getHydrateTriggers((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTView)(), tNode); hydrateTriggers.set(5, { type: 5, delay }); if (typeof ngServerMode !== 'undefined' && ngServerMode) { triggerDeferBlock(2, lView, tNode); } else { scheduleDelayedHydrating(onTimer(delay), lView, tNode); } } function ɵɵdeferOnHover(triggerIndex, walkUpTimes) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); if (ngDevMode) { trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, `on hover${walkUpTimes === -1 ? '' : '()'}`); } if (!shouldAttachTrigger(0, lView, tNode)) return; renderPlaceholder(lView, tNode); if (!(typeof ngServerMode !== 'undefined' && ngServerMode)) { registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onHover, () => triggerDeferBlock(0, lView, tNode), 0); } } function ɵɵdeferPrefetchOnHover(triggerIndex, walkUpTimes) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); if (ngDevMode) { trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, `prefetch on hover${walkUpTimes === -1 ? '' : '()'}`); } if (!shouldAttachTrigger(1, lView, tNode)) return; const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const tDetails = getTDeferBlockDetails(tView, tNode); if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) { registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onHover, () => triggerPrefetching(tDetails, lView, tNode), 1); } } function ɵɵdeferHydrateOnHover() { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); if (ngDevMode) { trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, 'hydrate on hover'); } if (!shouldAttachTrigger(2, lView, tNode)) return; const hydrateTriggers = getHydrateTriggers((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTView)(), tNode); hydrateTriggers.set(4, null); if (typeof ngServerMode !== 'undefined' && ngServerMode) { triggerDeferBlock(2, lView, tNode); } } function ɵɵdeferOnInteraction(triggerIndex, walkUpTimes) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); if (ngDevMode) { trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, `on interaction${walkUpTimes === -1 ? '' : '()'}`); } if (!shouldAttachTrigger(0, lView, tNode)) return; renderPlaceholder(lView, tNode); if (!(typeof ngServerMode !== 'undefined' && ngServerMode)) { registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onInteraction, () => triggerDeferBlock(0, lView, tNode), 0); } } function ɵɵdeferPrefetchOnInteraction(triggerIndex, walkUpTimes) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); if (ngDevMode) { trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, `prefetch on interaction${walkUpTimes === -1 ? '' : '()'}`); } if (!shouldAttachTrigger(1, lView, tNode)) return; const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const tDetails = getTDeferBlockDetails(tView, tNode); if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) { registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onInteraction, () => triggerPrefetching(tDetails, lView, tNode), 1); } } function ɵɵdeferHydrateOnInteraction() { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); if (ngDevMode) { trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, 'hydrate on interaction'); } if (!shouldAttachTrigger(2, lView, tNode)) return; const hydrateTriggers = getHydrateTriggers((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTView)(), tNode); hydrateTriggers.set(3, null); if (typeof ngServerMode !== 'undefined' && ngServerMode) { triggerDeferBlock(2, lView, tNode); } } function ɵɵdeferOnViewport(triggerIndex, walkUpTimes, options) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); if (ngDevMode) { const args = []; if (walkUpTimes !== undefined && walkUpTimes !== -1) { args.push(''); } if (options) { args.push(JSON.stringify(options)); } trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, `on viewport${args.length === 0 ? '' : `(${args.join(', ')})`}`); } if (!shouldAttachTrigger(0, lView, tNode)) return; renderPlaceholder(lView, tNode); if (!(typeof ngServerMode !== 'undefined' && ngServerMode)) { registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onViewportWrapper, () => triggerDeferBlock(0, lView, tNode), 0, options); } } function ɵɵdeferPrefetchOnViewport(triggerIndex, walkUpTimes, options) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); if (ngDevMode) { const args = []; if (walkUpTimes !== undefined && walkUpTimes !== -1) { args.push(''); } if (options) { args.push(JSON.stringify(options)); } trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, `prefetch on viewport${args.length === 0 ? '' : `(${args.join(', ')})`}`); } if (!shouldAttachTrigger(1, lView, tNode)) return; const tView = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW]; const tDetails = getTDeferBlockDetails(tView, tNode); if (tDetails.loadingState === DeferDependenciesLoadingState.NOT_STARTED) { registerDomTrigger(lView, tNode, triggerIndex, walkUpTimes, onViewportWrapper, () => triggerPrefetching(tDetails, lView, tNode), 1, options); } } function ɵɵdeferHydrateOnViewport(options) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); if (ngDevMode) { trackTriggerForDebugging(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.TVIEW], tNode, `hydrate on viewport${options ? `(${JSON.stringify(options)})` : ''}`); } if (!shouldAttachTrigger(2, lView, tNode)) return; const hydrateTriggers = getHydrateTriggers((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTView)(), tNode); hydrateTriggers.set(2, options ? { type: 2, intersectionObserverOptions: options } : null); if (typeof ngServerMode !== 'undefined' && ngServerMode) { triggerDeferBlock(2, lView, tNode); } } function ɵɵariaProperty(name, value) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const bindingIndex = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.nextBindingIndex)(); if (bindingUpdated(lView, bindingIndex, value)) { const tView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getSelectedTNode)(); const hasSetInput = setAllInputsForProperty(tNode, tView, lView, name, value); if (hasSetInput) { (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isComponentHost)(tNode) && markDirtyIfOnPush(lView, tNode.index); ngDevMode && setNgReflectProperties(lView, tView, tNode, name, value); } else { ngDevMode && assertTNodeType(tNode, 2); const element = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode)(tNode, lView); setElementAttribute(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER], element, null, tNode.value, name, value, null); } ngDevMode && storePropertyBindingMetadata(tView.data, tNode, name, bindingIndex); } return ɵɵariaProperty; } function ɵɵattribute(name, value, sanitizer, namespace) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const bindingIndex = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.nextBindingIndex)(); if (bindingUpdated(lView, bindingIndex, value)) { const tView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getSelectedTNode)(); elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace); ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex); } return ɵɵattribute; } const ANIMATIONS_DISABLED = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'AnimationsDisabled' : '', { factory: () => false }); const MAX_ANIMATION_TIMEOUT = new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'MaxAnimationTimeout' : '', { factory: () => MAX_ANIMATION_TIMEOUT_DEFAULT }); const MAX_ANIMATION_TIMEOUT_DEFAULT = 4000; const DEFAULT_ANIMATIONS_DISABLED = false; const areAnimationSupported = (typeof ngServerMode === 'undefined' || !ngServerMode) && typeof document !== 'undefined' && typeof document?.documentElement?.getAnimations === 'function'; function areAnimationsDisabled(lView) { const injector = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]; return injector.get(ANIMATIONS_DISABLED, DEFAULT_ANIMATIONS_DISABLED); } function assertAnimationTypes(value, instruction) { if (value == null || typeof value !== 'string' && typeof value !== 'function') { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(650, `'${instruction}' value must be a string of CSS classes or an animation function, got ${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringify)(value)}`); } } function assertElementNodes(nativeElement, instruction) { if (nativeElement.nodeType !== Node.ELEMENT_NODE) { throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(650, `'${instruction}' can only be used on an element node, got ${(0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.stringify)(nativeElement.nodeType)}`); } } function trackEnterClasses(el, classList, cleanupFns) { const elementData = enterClassMap.get(el); if (elementData) { for (const klass of classList) { elementData.classList.push(klass); } for (const fn of cleanupFns) { elementData.cleanupFns.push(fn); } } else { enterClassMap.set(el, { classList, cleanupFns }); } } function cleanupEnterClassData(element) { const elementData = enterClassMap.get(element); if (elementData) { for (const fn of elementData.cleanupFns) { fn(); } enterClassMap.delete(element); } longestAnimations.delete(element); } const noOpAnimationComplete = () => {}; const enterClassMap = new WeakMap(); const longestAnimations = new WeakMap(); const leavingNodes = new WeakMap(); function clearLeavingNodes(tNode, el) { const nodes = leavingNodes.get(tNode); if (nodes && nodes.length > 0) { const ix = nodes.findIndex(node => node === el); if (ix > -1) nodes.splice(ix, 1); } if (nodes?.length === 0) { leavingNodes.delete(tNode); } } function cancelLeavingNodes(tNode, lView) { const leavingEl = leavingNodes.get(tNode)?.shift(); const lContainer = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_LCONTAINER]; if (lContainer) { const beforeNode = getBeforeNodeForView(tNode.index, lContainer); const previousNode = beforeNode?.previousSibling; if (leavingEl && previousNode && leavingEl === previousNode) { leavingEl.dispatchEvent(new CustomEvent('animationend', { detail: { cancel: true } })); } } } function trackLeavingNodes(tNode, el) { if (leavingNodes.has(tNode)) { leavingNodes.get(tNode)?.push(el); } else { leavingNodes.set(tNode, [el]); } } function getLViewEnterAnimations(lView) { const animationData = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ANIMATIONS] ??= {}; return animationData.enter ??= new Map(); } function getLViewLeaveAnimations(lView) { const animationData = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ANIMATIONS] ??= {}; return animationData.leave ??= new Map(); } function getClassListFromValue(value) { const classes = typeof value === 'function' ? value() : value; let classList = Array.isArray(classes) ? classes : null; if (typeof classes === 'string') { classList = classes.trim().split(/\s+/).filter(k => k); } return classList; } function cancelAnimationsIfRunning(element, renderer) { if (!areAnimationSupported) return; const elementData = enterClassMap.get(element); if (elementData && elementData.classList.length > 0 && elementHasClassList(element, elementData.classList)) { for (const klass of elementData.classList) { renderer.removeClass(element, klass); } } cleanupEnterClassData(element); } function elementHasClassList(element, classList) { for (const className of classList) { if (element.classList.contains(className)) return true; } return false; } function isLongestAnimation(event, nativeElement) { const longestAnimation = longestAnimations.get(nativeElement); if (longestAnimation === undefined) return true; return nativeElement === event.target && (longestAnimation.animationName !== undefined && event.animationName === longestAnimation.animationName || longestAnimation.propertyName !== undefined && event.propertyName === longestAnimation.propertyName); } function addAnimationToLView(animations, tNode, fn) { const nodeAnimations = animations.get(tNode.index) ?? { animateFns: [] }; nodeAnimations.animateFns.push(fn); animations.set(tNode.index, nodeAnimations); } function cleanupAfterLeaveAnimations(resolvers, cleanupFns) { if (resolvers) { for (const fn of resolvers) { fn(); } } for (const fn of cleanupFns) { fn(); } } function clearLViewNodeAnimationResolvers(lView, tNode) { const nodeAnimations = getLViewLeaveAnimations(lView).get(tNode.index); if (nodeAnimations) nodeAnimations.resolvers = undefined; } function leaveAnimationFunctionCleanup(lView, tNode, nativeElement, resolvers, cleanupFns) { clearLeavingNodes(tNode, nativeElement); cleanupAfterLeaveAnimations(resolvers, cleanupFns); clearLViewNodeAnimationResolvers(lView, tNode); } function ɵɵanimateEnter(value) { performanceMarkFeature('NgAnimateEnter'); if (typeof ngServerMode !== 'undefined' && ngServerMode || !areAnimationSupported) { return ɵɵanimateEnter; } ngDevMode && assertAnimationTypes(value, 'animate.enter'); const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); if (areAnimationsDisabled(lView)) { return ɵɵanimateEnter; } const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); cancelLeavingNodes(tNode, lView); addAnimationToLView(getLViewEnterAnimations(lView), tNode, () => runEnterAnimation(lView, tNode, value)); initializeAnimationQueueScheduler(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]); queueEnterAnimations(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1], getLViewEnterAnimations(lView)); return ɵɵanimateEnter; } function runEnterAnimation(lView, tNode, value) { const nativeElement = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode)(tNode, lView); ngDevMode && assertElementNodes(nativeElement, 'animate.enter'); const renderer = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER]; const ngZone = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1].get(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgZone); const activeClasses = getClassListFromValue(value); const cleanupFns = []; const handleEnterAnimationStart = event => { if (event.target !== nativeElement) return; const eventName = event instanceof AnimationEvent ? 'animationend' : 'transitionend'; ngZone.runOutsideAngular(() => { renderer.listen(nativeElement, eventName, handleEnterAnimationEnd); }); }; const handleEnterAnimationEnd = event => { if (event.target !== nativeElement) return; enterAnimationEnd(event, nativeElement, renderer); }; if (activeClasses && activeClasses.length > 0) { ngZone.runOutsideAngular(() => { cleanupFns.push(renderer.listen(nativeElement, 'animationstart', handleEnterAnimationStart)); cleanupFns.push(renderer.listen(nativeElement, 'transitionstart', handleEnterAnimationStart)); }); trackEnterClasses(nativeElement, activeClasses, cleanupFns); for (const klass of activeClasses) { renderer.addClass(nativeElement, klass); } ngZone.runOutsideAngular(() => { requestAnimationFrame(() => { determineLongestAnimation(nativeElement, longestAnimations, areAnimationSupported); if (!longestAnimations.has(nativeElement)) { for (const klass of activeClasses) { renderer.removeClass(nativeElement, klass); } cleanupEnterClassData(nativeElement); } }); }); } } function enterAnimationEnd(event, nativeElement, renderer) { const elementData = enterClassMap.get(nativeElement); if (event.target !== nativeElement || !elementData) return; if (isLongestAnimation(event, nativeElement)) { event.stopImmediatePropagation(); for (const klass of elementData.classList) { renderer.removeClass(nativeElement, klass); } cleanupEnterClassData(nativeElement); } } function ɵɵanimateEnterListener(value) { performanceMarkFeature('NgAnimateEnter'); if (typeof ngServerMode !== 'undefined' && ngServerMode || !areAnimationSupported) { return ɵɵanimateEnterListener; } ngDevMode && assertAnimationTypes(value, 'animate.enter'); const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); if (areAnimationsDisabled(lView)) { return ɵɵanimateEnterListener; } const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); cancelLeavingNodes(tNode, lView); addAnimationToLView(getLViewEnterAnimations(lView), tNode, () => runEnterAnimationFunction(lView, tNode, value)); initializeAnimationQueueScheduler(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]); queueEnterAnimations(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1], getLViewEnterAnimations(lView)); return ɵɵanimateEnterListener; } function runEnterAnimationFunction(lView, tNode, value) { const nativeElement = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode)(tNode, lView); ngDevMode && assertElementNodes(nativeElement, 'animate.enter'); value.call(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT], { target: nativeElement, animationComplete: noOpAnimationComplete }); } function ɵɵanimateLeave(value) { performanceMarkFeature('NgAnimateLeave'); if (typeof ngServerMode !== 'undefined' && ngServerMode || !areAnimationSupported) { return ɵɵanimateLeave; } ngDevMode && assertAnimationTypes(value, 'animate.leave'); const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const animationsDisabled = areAnimationsDisabled(lView); if (animationsDisabled) { return ɵɵanimateLeave; } const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); cancelLeavingNodes(tNode, lView); addAnimationToLView(getLViewLeaveAnimations(lView), tNode, () => runLeaveAnimations(lView, tNode, value)); initializeAnimationQueueScheduler(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]); return ɵɵanimateLeave; } function runLeaveAnimations(lView, tNode, value) { const { promise, resolve } = promiseWithResolvers(); const nativeElement = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode)(tNode, lView); ngDevMode && assertElementNodes(nativeElement, 'animate.leave'); const renderer = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER]; const ngZone = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1].get(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgZone); allLeavingAnimations.add(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ID]); (getLViewLeaveAnimations(lView).get(tNode.index).resolvers ??= []).push(resolve); const activeClasses = getClassListFromValue(value); if (activeClasses && activeClasses.length > 0) { animateLeaveClassRunner(nativeElement, tNode, lView, activeClasses, renderer, ngZone); } else { resolve(); } return { promise, resolve }; } function animateLeaveClassRunner(el, tNode, lView, classList, renderer, ngZone) { cancelAnimationsIfRunning(el, renderer); const cleanupFns = []; const resolvers = getLViewLeaveAnimations(lView).get(tNode.index)?.resolvers; const handleOutAnimationEnd = event => { if (event.target !== el) return; if (event instanceof CustomEvent || isLongestAnimation(event, el)) { event.stopImmediatePropagation(); longestAnimations.delete(el); clearLeavingNodes(tNode, el); if (Array.isArray(tNode.projection)) { for (const item of classList) { renderer.removeClass(el, item); } } cleanupAfterLeaveAnimations(resolvers, cleanupFns); clearLViewNodeAnimationResolvers(lView, tNode); } }; ngZone.runOutsideAngular(() => { cleanupFns.push(renderer.listen(el, 'animationend', handleOutAnimationEnd)); cleanupFns.push(renderer.listen(el, 'transitionend', handleOutAnimationEnd)); }); trackLeavingNodes(tNode, el); for (const item of classList) { renderer.addClass(el, item); } ngZone.runOutsideAngular(() => { requestAnimationFrame(() => { determineLongestAnimation(el, longestAnimations, areAnimationSupported); if (!longestAnimations.has(el)) { clearLeavingNodes(tNode, el); cleanupAfterLeaveAnimations(resolvers, cleanupFns); clearLViewNodeAnimationResolvers(lView, tNode); } }); }); } function ɵɵanimateLeaveListener(value) { performanceMarkFeature('NgAnimateLeave'); if (typeof ngServerMode !== 'undefined' && ngServerMode || !areAnimationSupported) { return ɵɵanimateLeaveListener; } ngDevMode && assertAnimationTypes(value, 'animate.leave'); const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); cancelLeavingNodes(tNode, lView); allLeavingAnimations.add(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.ID]); addAnimationToLView(getLViewLeaveAnimations(lView), tNode, () => runLeaveAnimationFunction(lView, tNode, value)); initializeAnimationQueueScheduler(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1]); return ɵɵanimateLeaveListener; } function runLeaveAnimationFunction(lView, tNode, value) { const { promise, resolve } = promiseWithResolvers(); const nativeElement = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getNativeByTNode)(tNode, lView); ngDevMode && assertElementNodes(nativeElement, 'animate.leave'); const cleanupFns = []; const renderer = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER]; const animationsDisabled = areAnimationsDisabled(lView); const ngZone = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1].get(_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.NgZone); const maxAnimationTimeout = lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.INJECTOR$1].get(MAX_ANIMATION_TIMEOUT); (getLViewLeaveAnimations(lView).get(tNode.index).resolvers ??= []).push(resolve); const resolvers = getLViewLeaveAnimations(lView).get(tNode.index)?.resolvers; if (animationsDisabled) { leaveAnimationFunctionCleanup(lView, tNode, nativeElement, resolvers, cleanupFns); } else { const timeoutId = setTimeout(() => leaveAnimationFunctionCleanup(lView, tNode, nativeElement, resolvers, cleanupFns), maxAnimationTimeout); const event = { target: nativeElement, animationComplete: () => { leaveAnimationFunctionCleanup(lView, tNode, nativeElement, resolvers, cleanupFns); clearTimeout(timeoutId); } }; trackLeavingNodes(tNode, nativeElement); ngZone.runOutsideAngular(() => { cleanupFns.push(renderer.listen(nativeElement, 'animationend', () => { leaveAnimationFunctionCleanup(lView, tNode, nativeElement, resolvers, cleanupFns); clearTimeout(timeoutId); }, { once: true })); }); value.call(lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT], event); } return { promise, resolve }; } function ɵɵcomponentInstance() { const instance = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)()[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.DECLARATION_COMPONENT_VIEW][_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.CONTEXT]; ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertDefined)(instance, 'Expected component instance to be defined'); return instance; } function ɵɵcontrolCreate() { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getCurrentTNode)(); if (tView.firstCreatePass) { initializeControlFirstCreatePass(tView, tNode, lView); } const fieldDirective = getFieldDirective(tNode, lView); if (!fieldDirective) { return; } performanceMarkFeature('NgSignalForms'); if (tNode.flags & 1024) { initializeCustomControl(lView, tNode, fieldDirective, 'value'); } else if (tNode.flags & 2048) { initializeCustomControl(lView, tNode, fieldDirective, 'checked'); } else if (tNode.flags & 4096) { initializeInteropControl(fieldDirective); } else if (tNode.flags & 8192) { initializeNativeControl(lView, tNode, fieldDirective); } fieldDirective.registerAsBinding(getCustomControl(tNode, lView)); } function ɵɵcontrol(value, name, sanitizer) { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getSelectedTNode)(); const bindingIndex = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.nextBindingIndex)(); if (bindingUpdated(lView, bindingIndex, value)) { const tView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getTView)(); setPropertyAndInputs(tNode, lView, name, value, lView[_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RENDERER], sanitizer); ngDevMode && storePropertyBindingMetadata(tView.data, tNode, name, bindingIndex); } updateControl(lView, tNode); } function ɵcontrolUpdate() { const lView = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getLView)(); const tNode = (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.getSelectedTNode)(); updateControl(lView, tNode); } function updateControl(lView, tNode) { const fieldDirective = getFieldDirective(tNode, lView); if (fieldDirective) { updateControlClasses(lView, tNode, fieldDirective); if (tNode.flags & 1024) { updateCustomControl(tNode, lView, fieldDirective, 'value'); } else if (tNode.flags & 2048) { updateCustomControl(tNode, lView, fieldDirective, 'checked'); } else if (tNode.flags & 4096) { updateInteropControl(tNode, lView, fieldDirective); } else { updateNativeControl(tNode, lView, fieldDirective); } } (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.nextBindingIndex)(); } function initializeControlFirstCreatePass(tView, tNode, lView) { ngDevMode && (0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.assertFirstCreatePass)(tView); const directiveIndices = tNode.inputs?.['formField']; if (!directiveIndices) { return; } if ((0,_untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.isComponentHost)(tNode) && directiveIndices.includes(tNode.directiveStart + tNode.componentOffset)) { return; } const controlIndex = directiveIndices.find(index => ɵCONTROL in lView[index]); if (controlIndex === undefined) { return; } tNode.fieldIndex = controlIndex; const foundControl = isInteropControlFirstCreatePass(tNode, lView) || isCustomControlFirstCreatePass(tView, tNode); if (isNativeControlFirstCreatePass(tNode) || foundControl) { return; } throw new _untracked_chunk_mjs__WEBPACK_IMPORTED_MODULE_1__.RuntimeError(318, ngDevMode && `${describeElement(tView, tNode)} is an invalid [formField] directive host. The host must be a native form control ` + `(such as ', '