UNPKG

@webwriter/branching-scenario

Version:

Create adaptable learning experiences by authoring a gamebook, where you present the student with choices on how to continue.

1,138 lines (1,116 loc) 1.14 MB
var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name); var __typeError = (msg2) => { throw TypeError(msg2); }; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); var __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; }; var __commonJS = (cb, mod) => function __require() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __decoratorStart = (base) => [, , , __create(base?.[__knownSymbol("metadata")] ?? null)]; var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"]; var __expectFn = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError("Function expected") : fn; var __decoratorContext = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null)) }); var __decoratorMetadata = (array, target) => __defNormalProp(target, __knownSymbol("metadata"), array[3]); var __runInitializers = (array, flags, self2, value) => { for (var i9 = 0, fns = array[flags >> 1], n12 = fns && fns.length; i9 < n12; i9++) flags & 1 ? fns[i9].call(self2) : value = fns[i9].call(self2, value); return value; }; var __decorateElement = (array, flags, name, decorators, target, extra) => { var fn, it, done, ctx, access, k3 = flags & 7, s9 = !!(flags & 8), p5 = !!(flags & 16); var j3 = k3 > 3 ? array.length + 1 : k3 ? s9 ? 1 : 2 : 0, key = __decoratorStrings[k3 + 5]; var initializers = k3 > 3 && (array[j3 - 1] = []), extraInitializers = array[j3] || (array[j3] = []); var desc = k3 && (!p5 && !s9 && (target = target.prototype), k3 < 5 && (k3 > 3 || !p5) && __getOwnPropDesc(k3 < 4 ? target : { get [name]() { return __privateGet(this, extra); }, set [name](x3) { return __privateSet(this, extra, x3); } }, name)); k3 ? p5 && k3 < 4 && __name(extra, (k3 > 2 ? "set " : k3 > 1 ? "get " : "") + name) : __name(target, name); for (var i9 = decorators.length - 1; i9 >= 0; i9--) { ctx = __decoratorContext(k3, name, done = {}, array[3], extraInitializers); if (k3) { ctx.static = s9, ctx.private = p5, access = ctx.access = { has: p5 ? (x3) => __privateIn(target, x3) : (x3) => name in x3 }; if (k3 ^ 3) access.get = p5 ? (x3) => (k3 ^ 1 ? __privateGet : __privateMethod)(x3, target, k3 ^ 4 ? extra : desc.get) : (x3) => x3[name]; if (k3 > 2) access.set = p5 ? (x3, y4) => __privateSet(x3, target, y4, k3 ^ 4 ? extra : desc.set) : (x3, y4) => x3[name] = y4; } it = (0, decorators[i9])(k3 ? k3 < 4 ? p5 ? extra : desc[key] : k3 > 4 ? void 0 : { get: desc.get, set: desc.set } : target, ctx), done._ = 1; if (k3 ^ 4 || it === void 0) __expectFn(it) && (k3 > 4 ? initializers.unshift(it) : k3 ? p5 ? extra = it : desc[key] = it : target = it); else if (typeof it !== "object" || it === null) __typeError("Object expected"); else __expectFn(fn = it.get) && (desc.get = fn), __expectFn(fn = it.set) && (desc.set = fn), __expectFn(fn = it.init) && initializers.unshift(fn); } return k3 || __decoratorMetadata(array, target), desc && __defProp(target, name, desc), p5 ? k3 ^ 4 ? extra : desc : target; }; var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); var __accessCheck = (obj, member, msg2) => member.has(obj) || __typeError("Cannot " + msg2); var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use the "in" operator on this value') : member.has(obj); var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value); var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); // node_modules/@lit/reactive-element/css-tag.js var t, e, s, o, n, r, i, S, c; var init_css_tag = __esm({ "node_modules/@lit/reactive-element/css-tag.js"() { t = globalThis; e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype; s = Symbol(); o = /* @__PURE__ */ new WeakMap(); n = class { constructor(t10, e15, o17) { if (this._$cssResult$ = true, o17 !== s) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead."); this.cssText = t10, this.t = e15; } get styleSheet() { let t10 = this.o; const s9 = this.t; if (e && void 0 === t10) { const e15 = void 0 !== s9 && 1 === s9.length; e15 && (t10 = o.get(s9)), void 0 === t10 && ((this.o = t10 = new CSSStyleSheet()).replaceSync(this.cssText), e15 && o.set(s9, t10)); } return t10; } toString() { return this.cssText; } }; r = (t10) => new n("string" == typeof t10 ? t10 : t10 + "", void 0, s); i = (t10, ...e15) => { const o17 = 1 === t10.length ? t10[0] : e15.reduce((e16, s9, o18) => e16 + ((t11) => { if (true === t11._$cssResult$) return t11.cssText; if ("number" == typeof t11) return t11; throw Error("Value passed to 'css' function must be a 'css' function result: " + t11 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security."); })(s9) + t10[o18 + 1], t10[0]); return new n(o17, t10, s); }; S = (s9, o17) => { if (e) s9.adoptedStyleSheets = o17.map((t10) => t10 instanceof CSSStyleSheet ? t10 : t10.styleSheet); else for (const e15 of o17) { const o18 = document.createElement("style"), n12 = t.litNonce; void 0 !== n12 && o18.setAttribute("nonce", n12), o18.textContent = e15.cssText, s9.appendChild(o18); } }; c = e ? (t10) => t10 : (t10) => t10 instanceof CSSStyleSheet ? ((t11) => { let e15 = ""; for (const s9 of t11.cssRules) e15 += s9.cssText; return r(e15); })(t10) : t10; } }); // node_modules/@lit/reactive-element/reactive-element.js var i2, e2, r2, h, o2, n2, a, c2, l, p, d, u, f, y, b; var init_reactive_element = __esm({ "node_modules/@lit/reactive-element/reactive-element.js"() { init_css_tag(); init_css_tag(); ({ is: i2, defineProperty: e2, getOwnPropertyDescriptor: r2, getOwnPropertyNames: h, getOwnPropertySymbols: o2, getPrototypeOf: n2 } = Object); a = globalThis; c2 = a.trustedTypes; l = c2 ? c2.emptyScript : ""; p = a.reactiveElementPolyfillSupport; d = (t10, s9) => t10; u = { toAttribute(t10, s9) { switch (s9) { case Boolean: t10 = t10 ? l : null; break; case Object: case Array: t10 = null == t10 ? t10 : JSON.stringify(t10); } return t10; }, fromAttribute(t10, s9) { let i9 = t10; switch (s9) { case Boolean: i9 = null !== t10; break; case Number: i9 = null === t10 ? null : Number(t10); break; case Object: case Array: try { i9 = JSON.parse(t10); } catch (t11) { i9 = null; } } return i9; } }; f = (t10, s9) => !i2(t10, s9); y = { attribute: true, type: String, converter: u, reflect: false, hasChanged: f }; Symbol.metadata ??= Symbol("metadata"), a.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap(); b = class extends HTMLElement { static addInitializer(t10) { this._$Ei(), (this.l ??= []).push(t10); } static get observedAttributes() { return this.finalize(), this._$Eh && [...this._$Eh.keys()]; } static createProperty(t10, s9 = y) { if (s9.state && (s9.attribute = false), this._$Ei(), this.elementProperties.set(t10, s9), !s9.noAccessor) { const i9 = Symbol(), r13 = this.getPropertyDescriptor(t10, i9, s9); void 0 !== r13 && e2(this.prototype, t10, r13); } } static getPropertyDescriptor(t10, s9, i9) { const { get: e15, set: h6 } = r2(this.prototype, t10) ?? { get() { return this[s9]; }, set(t11) { this[s9] = t11; } }; return { get() { return e15?.call(this); }, set(s10) { const r13 = e15?.call(this); h6.call(this, s10), this.requestUpdate(t10, r13, i9); }, configurable: true, enumerable: true }; } static getPropertyOptions(t10) { return this.elementProperties.get(t10) ?? y; } static _$Ei() { if (this.hasOwnProperty(d("elementProperties"))) return; const t10 = n2(this); t10.finalize(), void 0 !== t10.l && (this.l = [...t10.l]), this.elementProperties = new Map(t10.elementProperties); } static finalize() { if (this.hasOwnProperty(d("finalized"))) return; if (this.finalized = true, this._$Ei(), this.hasOwnProperty(d("properties"))) { const t11 = this.properties, s9 = [...h(t11), ...o2(t11)]; for (const i9 of s9) this.createProperty(i9, t11[i9]); } const t10 = this[Symbol.metadata]; if (null !== t10) { const s9 = litPropertyMetadata.get(t10); if (void 0 !== s9) for (const [t11, i9] of s9) this.elementProperties.set(t11, i9); } this._$Eh = /* @__PURE__ */ new Map(); for (const [t11, s9] of this.elementProperties) { const i9 = this._$Eu(t11, s9); void 0 !== i9 && this._$Eh.set(i9, t11); } this.elementStyles = this.finalizeStyles(this.styles); } static finalizeStyles(s9) { const i9 = []; if (Array.isArray(s9)) { const e15 = new Set(s9.flat(1 / 0).reverse()); for (const s10 of e15) i9.unshift(c(s10)); } else void 0 !== s9 && i9.push(c(s9)); return i9; } static _$Eu(t10, s9) { const i9 = s9.attribute; return false === i9 ? void 0 : "string" == typeof i9 ? i9 : "string" == typeof t10 ? t10.toLowerCase() : void 0; } constructor() { super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev(); } _$Ev() { this._$ES = new Promise((t10) => this.enableUpdating = t10), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach((t10) => t10(this)); } addController(t10) { (this._$EO ??= /* @__PURE__ */ new Set()).add(t10), void 0 !== this.renderRoot && this.isConnected && t10.hostConnected?.(); } removeController(t10) { this._$EO?.delete(t10); } _$E_() { const t10 = /* @__PURE__ */ new Map(), s9 = this.constructor.elementProperties; for (const i9 of s9.keys()) this.hasOwnProperty(i9) && (t10.set(i9, this[i9]), delete this[i9]); t10.size > 0 && (this._$Ep = t10); } createRenderRoot() { const t10 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions); return S(t10, this.constructor.elementStyles), t10; } connectedCallback() { this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach((t10) => t10.hostConnected?.()); } enableUpdating(t10) { } disconnectedCallback() { this._$EO?.forEach((t10) => t10.hostDisconnected?.()); } attributeChangedCallback(t10, s9, i9) { this._$AK(t10, i9); } _$EC(t10, s9) { const i9 = this.constructor.elementProperties.get(t10), e15 = this.constructor._$Eu(t10, i9); if (void 0 !== e15 && true === i9.reflect) { const r13 = (void 0 !== i9.converter?.toAttribute ? i9.converter : u).toAttribute(s9, i9.type); this._$Em = t10, null == r13 ? this.removeAttribute(e15) : this.setAttribute(e15, r13), this._$Em = null; } } _$AK(t10, s9) { const i9 = this.constructor, e15 = i9._$Eh.get(t10); if (void 0 !== e15 && this._$Em !== e15) { const t11 = i9.getPropertyOptions(e15), r13 = "function" == typeof t11.converter ? { fromAttribute: t11.converter } : void 0 !== t11.converter?.fromAttribute ? t11.converter : u; this._$Em = e15, this[e15] = r13.fromAttribute(s9, t11.type), this._$Em = null; } } requestUpdate(t10, s9, i9) { if (void 0 !== t10) { if (i9 ??= this.constructor.getPropertyOptions(t10), !(i9.hasChanged ?? f)(this[t10], s9)) return; this.P(t10, s9, i9); } false === this.isUpdatePending && (this._$ES = this._$ET()); } P(t10, s9, i9) { this._$AL.has(t10) || this._$AL.set(t10, s9), true === i9.reflect && this._$Em !== t10 && (this._$Ej ??= /* @__PURE__ */ new Set()).add(t10); } async _$ET() { this.isUpdatePending = true; try { await this._$ES; } catch (t11) { Promise.reject(t11); } const t10 = this.scheduleUpdate(); return null != t10 && await t10, !this.isUpdatePending; } scheduleUpdate() { return this.performUpdate(); } performUpdate() { if (!this.isUpdatePending) return; if (!this.hasUpdated) { if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) { for (const [t12, s10] of this._$Ep) this[t12] = s10; this._$Ep = void 0; } const t11 = this.constructor.elementProperties; if (t11.size > 0) for (const [s10, i9] of t11) true !== i9.wrapped || this._$AL.has(s10) || void 0 === this[s10] || this.P(s10, this[s10], i9); } let t10 = false; const s9 = this._$AL; try { t10 = this.shouldUpdate(s9), t10 ? (this.willUpdate(s9), this._$EO?.forEach((t11) => t11.hostUpdate?.()), this.update(s9)) : this._$EU(); } catch (s10) { throw t10 = false, this._$EU(), s10; } t10 && this._$AE(s9); } willUpdate(t10) { } _$AE(t10) { this._$EO?.forEach((t11) => t11.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t10)), this.updated(t10); } _$EU() { this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false; } get updateComplete() { return this.getUpdateComplete(); } getUpdateComplete() { return this._$ES; } shouldUpdate(t10) { return true; } update(t10) { this._$Ej &&= this._$Ej.forEach((t11) => this._$EC(t11, this[t11])), this._$EU(); } updated(t10) { } firstUpdated(t10) { } }; b.elementStyles = [], b.shadowRootOptions = { mode: "open" }, b[d("elementProperties")] = /* @__PURE__ */ new Map(), b[d("finalized")] = /* @__PURE__ */ new Map(), p?.({ ReactiveElement: b }), (a.reactiveElementVersions ??= []).push("2.0.4"); } }); // node_modules/lit-html/lit-html.js function P(t10, i9) { if (!a2(t10) || !t10.hasOwnProperty("raw")) throw Error("invalid template strings array"); return void 0 !== s2 ? s2.createHTML(i9) : i9; } function S2(t10, i9, s9 = t10, e15) { if (i9 === T) return i9; let h6 = void 0 !== e15 ? s9._$Co?.[e15] : s9._$Cl; const o17 = c3(i9) ? void 0 : i9._$litDirective$; return h6?.constructor !== o17 && (h6?._$AO?.(false), void 0 === o17 ? h6 = void 0 : (h6 = new o17(t10), h6._$AT(t10, s9, e15)), void 0 !== e15 ? (s9._$Co ??= [])[e15] = h6 : s9._$Cl = h6), void 0 !== h6 && (i9 = S2(t10, h6._$AS(t10, i9.values), h6, e15)), i9; } var t2, i3, s2, e3, h2, o3, n3, r3, l2, c3, a2, u2, d2, f2, v, _, m, p2, g, $, y2, x, b2, w, T, E, A, C, V, N, M, R, k, H, I, L, z, Z, j, B; var init_lit_html = __esm({ "node_modules/lit-html/lit-html.js"() { t2 = globalThis; i3 = t2.trustedTypes; s2 = i3 ? i3.createPolicy("lit-html", { createHTML: (t10) => t10 }) : void 0; e3 = "$lit$"; h2 = `lit$${Math.random().toFixed(9).slice(2)}$`; o3 = "?" + h2; n3 = `<${o3}>`; r3 = document; l2 = () => r3.createComment(""); c3 = (t10) => null === t10 || "object" != typeof t10 && "function" != typeof t10; a2 = Array.isArray; u2 = (t10) => a2(t10) || "function" == typeof t10?.[Symbol.iterator]; d2 = "[ \n\f\r]"; f2 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g; v = /-->/g; _ = />/g; m = RegExp(`>|${d2}(?:([^\\s"'>=/]+)(${d2}*=${d2}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`, "g"); p2 = /'/g; g = /"/g; $ = /^(?:script|style|textarea|title)$/i; y2 = (t10) => (i9, ...s9) => ({ _$litType$: t10, strings: i9, values: s9 }); x = y2(1); b2 = y2(2); w = y2(3); T = Symbol.for("lit-noChange"); E = Symbol.for("lit-nothing"); A = /* @__PURE__ */ new WeakMap(); C = r3.createTreeWalker(r3, 129); V = (t10, i9) => { const s9 = t10.length - 1, o17 = []; let r13, l6 = 2 === i9 ? "<svg>" : 3 === i9 ? "<math>" : "", c9 = f2; for (let i10 = 0; i10 < s9; i10++) { const s10 = t10[i10]; let a5, u7, d4 = -1, y4 = 0; for (; y4 < s10.length && (c9.lastIndex = y4, u7 = c9.exec(s10), null !== u7); ) y4 = c9.lastIndex, c9 === f2 ? "!--" === u7[1] ? c9 = v : void 0 !== u7[1] ? c9 = _ : void 0 !== u7[2] ? ($.test(u7[2]) && (r13 = RegExp("</" + u7[2], "g")), c9 = m) : void 0 !== u7[3] && (c9 = m) : c9 === m ? ">" === u7[0] ? (c9 = r13 ?? f2, d4 = -1) : void 0 === u7[1] ? d4 = -2 : (d4 = c9.lastIndex - u7[2].length, a5 = u7[1], c9 = void 0 === u7[3] ? m : '"' === u7[3] ? g : p2) : c9 === g || c9 === p2 ? c9 = m : c9 === v || c9 === _ ? c9 = f2 : (c9 = m, r13 = void 0); const x3 = c9 === m && t10[i10 + 1].startsWith("/>") ? " " : ""; l6 += c9 === f2 ? s10 + n3 : d4 >= 0 ? (o17.push(a5), s10.slice(0, d4) + e3 + s10.slice(d4) + h2 + x3) : s10 + h2 + (-2 === d4 ? i10 : x3); } return [P(t10, l6 + (t10[s9] || "<?>") + (2 === i9 ? "</svg>" : 3 === i9 ? "</math>" : "")), o17]; }; N = class _N { constructor({ strings: t10, _$litType$: s9 }, n12) { let r13; this.parts = []; let c9 = 0, a5 = 0; const u7 = t10.length - 1, d4 = this.parts, [f6, v4] = V(t10, s9); if (this.el = _N.createElement(f6, n12), C.currentNode = this.el.content, 2 === s9 || 3 === s9) { const t11 = this.el.content.firstChild; t11.replaceWith(...t11.childNodes); } for (; null !== (r13 = C.nextNode()) && d4.length < u7; ) { if (1 === r13.nodeType) { if (r13.hasAttributes()) for (const t11 of r13.getAttributeNames()) if (t11.endsWith(e3)) { const i9 = v4[a5++], s10 = r13.getAttribute(t11).split(h2), e15 = /([.?@])?(.*)/.exec(i9); d4.push({ type: 1, index: c9, name: e15[2], strings: s10, ctor: "." === e15[1] ? H : "?" === e15[1] ? I : "@" === e15[1] ? L : k }), r13.removeAttribute(t11); } else t11.startsWith(h2) && (d4.push({ type: 6, index: c9 }), r13.removeAttribute(t11)); if ($.test(r13.tagName)) { const t11 = r13.textContent.split(h2), s10 = t11.length - 1; if (s10 > 0) { r13.textContent = i3 ? i3.emptyScript : ""; for (let i9 = 0; i9 < s10; i9++) r13.append(t11[i9], l2()), C.nextNode(), d4.push({ type: 2, index: ++c9 }); r13.append(t11[s10], l2()); } } } else if (8 === r13.nodeType) if (r13.data === o3) d4.push({ type: 2, index: c9 }); else { let t11 = -1; for (; -1 !== (t11 = r13.data.indexOf(h2, t11 + 1)); ) d4.push({ type: 7, index: c9 }), t11 += h2.length - 1; } c9++; } } static createElement(t10, i9) { const s9 = r3.createElement("template"); return s9.innerHTML = t10, s9; } }; M = class { constructor(t10, i9) { this._$AV = [], this._$AN = void 0, this._$AD = t10, this._$AM = i9; } get parentNode() { return this._$AM.parentNode; } get _$AU() { return this._$AM._$AU; } u(t10) { const { el: { content: i9 }, parts: s9 } = this._$AD, e15 = (t10?.creationScope ?? r3).importNode(i9, true); C.currentNode = e15; let h6 = C.nextNode(), o17 = 0, n12 = 0, l6 = s9[0]; for (; void 0 !== l6; ) { if (o17 === l6.index) { let i10; 2 === l6.type ? i10 = new R(h6, h6.nextSibling, this, t10) : 1 === l6.type ? i10 = new l6.ctor(h6, l6.name, l6.strings, this, t10) : 6 === l6.type && (i10 = new z(h6, this, t10)), this._$AV.push(i10), l6 = s9[++n12]; } o17 !== l6?.index && (h6 = C.nextNode(), o17++); } return C.currentNode = r3, e15; } p(t10) { let i9 = 0; for (const s9 of this._$AV) void 0 !== s9 && (void 0 !== s9.strings ? (s9._$AI(t10, s9, i9), i9 += s9.strings.length - 2) : s9._$AI(t10[i9])), i9++; } }; R = class _R { get _$AU() { return this._$AM?._$AU ?? this._$Cv; } constructor(t10, i9, s9, e15) { this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = t10, this._$AB = i9, this._$AM = s9, this.options = e15, this._$Cv = e15?.isConnected ?? true; } get parentNode() { let t10 = this._$AA.parentNode; const i9 = this._$AM; return void 0 !== i9 && 11 === t10?.nodeType && (t10 = i9.parentNode), t10; } get startNode() { return this._$AA; } get endNode() { return this._$AB; } _$AI(t10, i9 = this) { t10 = S2(this, t10, i9), c3(t10) ? t10 === E || null == t10 || "" === t10 ? (this._$AH !== E && this._$AR(), this._$AH = E) : t10 !== this._$AH && t10 !== T && this._(t10) : void 0 !== t10._$litType$ ? this.$(t10) : void 0 !== t10.nodeType ? this.T(t10) : u2(t10) ? this.k(t10) : this._(t10); } O(t10) { return this._$AA.parentNode.insertBefore(t10, this._$AB); } T(t10) { this._$AH !== t10 && (this._$AR(), this._$AH = this.O(t10)); } _(t10) { this._$AH !== E && c3(this._$AH) ? this._$AA.nextSibling.data = t10 : this.T(r3.createTextNode(t10)), this._$AH = t10; } $(t10) { const { values: i9, _$litType$: s9 } = t10, e15 = "number" == typeof s9 ? this._$AC(t10) : (void 0 === s9.el && (s9.el = N.createElement(P(s9.h, s9.h[0]), this.options)), s9); if (this._$AH?._$AD === e15) this._$AH.p(i9); else { const t11 = new M(e15, this), s10 = t11.u(this.options); t11.p(i9), this.T(s10), this._$AH = t11; } } _$AC(t10) { let i9 = A.get(t10.strings); return void 0 === i9 && A.set(t10.strings, i9 = new N(t10)), i9; } k(t10) { a2(this._$AH) || (this._$AH = [], this._$AR()); const i9 = this._$AH; let s9, e15 = 0; for (const h6 of t10) e15 === i9.length ? i9.push(s9 = new _R(this.O(l2()), this.O(l2()), this, this.options)) : s9 = i9[e15], s9._$AI(h6), e15++; e15 < i9.length && (this._$AR(s9 && s9._$AB.nextSibling, e15), i9.length = e15); } _$AR(t10 = this._$AA.nextSibling, i9) { for (this._$AP?.(false, true, i9); t10 && t10 !== this._$AB; ) { const i10 = t10.nextSibling; t10.remove(), t10 = i10; } } setConnected(t10) { void 0 === this._$AM && (this._$Cv = t10, this._$AP?.(t10)); } }; k = class { get tagName() { return this.element.tagName; } get _$AU() { return this._$AM._$AU; } constructor(t10, i9, s9, e15, h6) { this.type = 1, this._$AH = E, this._$AN = void 0, this.element = t10, this.name = i9, this._$AM = e15, this.options = h6, s9.length > 2 || "" !== s9[0] || "" !== s9[1] ? (this._$AH = Array(s9.length - 1).fill(new String()), this.strings = s9) : this._$AH = E; } _$AI(t10, i9 = this, s9, e15) { const h6 = this.strings; let o17 = false; if (void 0 === h6) t10 = S2(this, t10, i9, 0), o17 = !c3(t10) || t10 !== this._$AH && t10 !== T, o17 && (this._$AH = t10); else { const e16 = t10; let n12, r13; for (t10 = h6[0], n12 = 0; n12 < h6.length - 1; n12++) r13 = S2(this, e16[s9 + n12], i9, n12), r13 === T && (r13 = this._$AH[n12]), o17 ||= !c3(r13) || r13 !== this._$AH[n12], r13 === E ? t10 = E : t10 !== E && (t10 += (r13 ?? "") + h6[n12 + 1]), this._$AH[n12] = r13; } o17 && !e15 && this.j(t10); } j(t10) { t10 === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t10 ?? ""); } }; H = class extends k { constructor() { super(...arguments), this.type = 3; } j(t10) { this.element[this.name] = t10 === E ? void 0 : t10; } }; I = class extends k { constructor() { super(...arguments), this.type = 4; } j(t10) { this.element.toggleAttribute(this.name, !!t10 && t10 !== E); } }; L = class extends k { constructor(t10, i9, s9, e15, h6) { super(t10, i9, s9, e15, h6), this.type = 5; } _$AI(t10, i9 = this) { if ((t10 = S2(this, t10, i9, 0) ?? E) === T) return; const s9 = this._$AH, e15 = t10 === E && s9 !== E || t10.capture !== s9.capture || t10.once !== s9.once || t10.passive !== s9.passive, h6 = t10 !== E && (s9 === E || e15); e15 && this.element.removeEventListener(this.name, this, s9), h6 && this.element.addEventListener(this.name, this, t10), this._$AH = t10; } handleEvent(t10) { "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t10) : this._$AH.handleEvent(t10); } }; z = class { constructor(t10, i9, s9) { this.element = t10, this.type = 6, this._$AN = void 0, this._$AM = i9, this.options = s9; } get _$AU() { return this._$AM._$AU; } _$AI(t10) { S2(this, t10); } }; Z = { M: e3, P: h2, A: o3, C: 1, L: V, R: M, D: u2, V: S2, I: R, H: k, N: I, U: L, B: H, F: z }; j = t2.litHtmlPolyfillSupport; j?.(N, R), (t2.litHtmlVersions ??= []).push("3.2.1"); B = (t10, i9, s9) => { const e15 = s9?.renderBefore ?? i9; let h6 = e15._$litPart$; if (void 0 === h6) { const t11 = s9?.renderBefore ?? null; e15._$litPart$ = h6 = new R(i9.insertBefore(l2(), t11), t11, void 0, s9 ?? {}); } return h6._$AI(t10), h6; }; } }); // node_modules/lit-element/lit-element.js var r4, i4; var init_lit_element = __esm({ "node_modules/lit-element/lit-element.js"() { init_reactive_element(); init_reactive_element(); init_lit_html(); init_lit_html(); r4 = class extends b { constructor() { super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0; } createRenderRoot() { const t10 = super.createRenderRoot(); return this.renderOptions.renderBefore ??= t10.firstChild, t10; } update(t10) { const s9 = this.render(); this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t10), this._$Do = B(s9, this.renderRoot, this.renderOptions); } connectedCallback() { super.connectedCallback(), this._$Do?.setConnected(true); } disconnectedCallback() { super.disconnectedCallback(), this._$Do?.setConnected(false); } render() { return T; } }; r4._$litElement$ = true, r4["finalized"] = true, globalThis.litElementHydrateSupport?.({ LitElement: r4 }); i4 = globalThis.litElementPolyfillSupport; i4?.({ LitElement: r4 }); (globalThis.litElementVersions ??= []).push("4.1.1"); } }); // node_modules/lit-html/is-server.js var init_is_server = __esm({ "node_modules/lit-html/is-server.js"() { } }); // node_modules/lit/index.js var init_lit = __esm({ "node_modules/lit/index.js"() { init_reactive_element(); init_lit_html(); init_lit_element(); init_is_server(); } }); // node_modules/@lit/localize/internal/locale-status-event.js var LOCALE_STATUS_EVENT; var init_locale_status_event = __esm({ "node_modules/@lit/localize/internal/locale-status-event.js"() { LOCALE_STATUS_EVENT = "lit-localize-status"; } }); // node_modules/@lit/localize/internal/str-tag.js var _str, str, isStrTagged, joinStringsAndValues; var init_str_tag = __esm({ "node_modules/@lit/localize/internal/str-tag.js"() { _str = (strings, ...values) => ({ strTag: true, strings, values }); str = _str; isStrTagged = (val) => typeof val !== "string" && "strTag" in val; joinStringsAndValues = (strings, values, valueOrder) => { let concat = strings[0]; for (let i9 = 1; i9 < strings.length; i9++) { concat += values[valueOrder ? valueOrder[i9 - 1] : i9 - 1]; concat += strings[i9]; } return concat; }; } }); // node_modules/@lit/localize/internal/types.js var init_types = __esm({ "node_modules/@lit/localize/internal/types.js"() { } }); // node_modules/@lit/localize/internal/default-msg.js var defaultMsg; var init_default_msg = __esm({ "node_modules/@lit/localize/internal/default-msg.js"() { init_str_tag(); defaultMsg = (template) => isStrTagged(template) ? joinStringsAndValues(template.strings, template.values) : template; } }); // node_modules/@lit/localize/init/install.js function _installMsgImplementation(impl) { if (installed) { throw new Error("lit-localize can only be configured once"); } msg = impl; installed = true; } var msg, installed; var init_install = __esm({ "node_modules/@lit/localize/init/install.js"() { init_default_msg(); msg = defaultMsg; installed = false; } }); // node_modules/@lit/localize/internal/localized-controller.js var LocalizeController, _updateWhenLocaleChanges, updateWhenLocaleChanges; var init_localized_controller = __esm({ "node_modules/@lit/localize/internal/localized-controller.js"() { init_locale_status_event(); LocalizeController = class { constructor(host) { this.__litLocalizeEventHandler = (event) => { if (event.detail.status === "ready") { this.host.requestUpdate(); } }; this.host = host; } hostConnected() { window.addEventListener(LOCALE_STATUS_EVENT, this.__litLocalizeEventHandler); } hostDisconnected() { window.removeEventListener(LOCALE_STATUS_EVENT, this.__litLocalizeEventHandler); } }; _updateWhenLocaleChanges = (host) => host.addController(new LocalizeController(host)); updateWhenLocaleChanges = _updateWhenLocaleChanges; } }); // node_modules/@lit/localize/internal/localized-decorator.js var localized; var init_localized_decorator = __esm({ "node_modules/@lit/localize/internal/localized-decorator.js"() { init_localized_controller(); localized = () => (clazz, _context) => { clazz.addInitializer(updateWhenLocaleChanges); return clazz; }; } }); // node_modules/@lit/localize/internal/deferred.js var Deferred; var init_deferred = __esm({ "node_modules/@lit/localize/internal/deferred.js"() { Deferred = class { constructor() { this.settled = false; this.promise = new Promise((resolve, reject) => { this._resolve = resolve; this._reject = reject; }); } resolve(value) { this.settled = true; this._resolve(value); } reject(error) { this.settled = true; this._reject(error); } }; } }); // node_modules/@lit/localize/internal/fnv1a64.js function fnv1a64(str4) { let t0 = 0, v0 = 8997, t1 = 0, v1 = 33826, t22 = 0, v22 = 40164, t32 = 0, v32 = 52210; for (let i9 = 0; i9 < str4.length; i9++) { v0 ^= str4.charCodeAt(i9); t0 = v0 * 435; t1 = v1 * 435; t22 = v22 * 435; t32 = v32 * 435; t22 += v0 << 8; t32 += v1 << 8; t1 += t0 >>> 16; v0 = t0 & 65535; t22 += t1 >>> 16; v1 = t1 & 65535; v32 = t32 + (t22 >>> 16) & 65535; v22 = t22 & 65535; } return hl[v32 >> 8] + hl[v32 & 255] + hl[v22 >> 8] + hl[v22 & 255] + hl[v1 >> 8] + hl[v1 & 255] + hl[v0 >> 8] + hl[v0 & 255]; } var hl; var init_fnv1a64 = __esm({ "node_modules/@lit/localize/internal/fnv1a64.js"() { hl = []; for (let i9 = 0; i9 < 256; i9++) { hl[i9] = (i9 >> 4 & 15).toString(16) + (i9 & 15).toString(16); } } }); // node_modules/@lit/localize/internal/id-generation.js function generateMsgId(strings, isHtmlTagged) { return (isHtmlTagged ? HTML_PREFIX : STRING_PREFIX) + fnv1a64(typeof strings === "string" ? strings : strings.join(HASH_DELIMITER)); } var HASH_DELIMITER, HTML_PREFIX, STRING_PREFIX; var init_id_generation = __esm({ "node_modules/@lit/localize/internal/id-generation.js"() { init_fnv1a64(); HASH_DELIMITER = ""; HTML_PREFIX = "h"; STRING_PREFIX = "s"; } }); // node_modules/@lit/localize/internal/runtime-msg.js function runtimeMsg(templates3, template, options) { if (templates3) { const id3 = options?.id ?? generateId(template); const localized2 = templates3[id3]; if (localized2) { if (typeof localized2 === "string") { return localized2; } else if ("strTag" in localized2) { return joinStringsAndValues( localized2.strings, // Cast `template` because its type wasn't automatically narrowed (but // we know it must be the same type as `localized`). template.values, localized2.values ); } else { let order = expressionOrders.get(localized2); if (order === void 0) { order = localized2.values; expressionOrders.set(localized2, order); } return { ...localized2, values: order.map((i9) => template.values[i9]) }; } } } return defaultMsg(template); } function generateId(template) { const strings = typeof template === "string" ? template : template.strings; let id3 = hashCache.get(strings); if (id3 === void 0) { id3 = generateMsgId(strings, typeof template !== "string" && !("strTag" in template)); hashCache.set(strings, id3); } return id3; } var expressionOrders, hashCache; var init_runtime_msg = __esm({ "node_modules/@lit/localize/internal/runtime-msg.js"() { init_default_msg(); init_str_tag(); init_id_generation(); expressionOrders = /* @__PURE__ */ new WeakMap(); hashCache = /* @__PURE__ */ new Map(); } }); // node_modules/@lit/localize/init/runtime.js function dispatchStatusEvent(detail) { window.dispatchEvent(new CustomEvent(LOCALE_STATUS_EVENT, { detail })); } var activeLocale, loadingLocale, sourceLocale, validLocales, loadLocale, templates, loading, requestId, configureLocalization, getLocale, setLocale; var init_runtime = __esm({ "node_modules/@lit/localize/init/runtime.js"() { init_deferred(); init_locale_status_event(); init_runtime_msg(); init_install(); activeLocale = ""; loading = new Deferred(); loading.resolve(); requestId = 0; configureLocalization = (config) => { _installMsgImplementation((template, options) => runtimeMsg(templates, template, options)); activeLocale = sourceLocale = config.sourceLocale; validLocales = new Set(config.targetLocales); validLocales.add(config.sourceLocale); loadLocale = config.loadLocale; return { getLocale, setLocale }; }; getLocale = () => { return activeLocale; }; setLocale = (newLocale) => { if (newLocale === (loadingLocale ?? activeLocale)) { return loading.promise; } if (!validLocales || !loadLocale) { throw new Error("Internal error"); } if (!validLocales.has(newLocale)) { throw new Error("Invalid locale code"); } requestId++; const thisRequestId = requestId; loadingLocale = newLocale; if (loading.settled) { loading = new Deferred(); } dispatchStatusEvent({ status: "loading", loadingLocale: newLocale }); const localePromise = newLocale === sourceLocale ? ( // We could switch to the source locale synchronously, but we prefer to // queue it on a microtask so that switching locales is consistently // asynchronous. Promise.resolve({ templates: void 0 }) ) : loadLocale(newLocale); localePromise.then((mod) => { if (requestId === thisRequestId) { activeLocale = newLocale; loadingLocale = void 0; templates = mod.templates; dispatchStatusEvent({ status: "ready", readyLocale: newLocale }); loading.resolve(); } }, (err) => { if (requestId === thisRequestId) { dispatchStatusEvent({ status: "error", errorLocale: newLocale, errorMessage: err.toString() }); loading.reject(err); } }); return loading.promise; }; } }); // node_modules/@lit/localize/init/transform.js var init_transform = __esm({ "node_modules/@lit/localize/init/transform.js"() { init_default_msg(); init_install(); } }); // node_modules/@lit/localize/lit-localize.js var init_lit_localize = __esm({ "node_modules/@lit/localize/lit-localize.js"() { init_locale_status_event(); init_str_tag(); init_types(); init_install(); init_localized_controller(); init_localized_decorator(); init_runtime(); init_transform(); } }); // src/generated/locales/de.ts var de_exports = {}; __export(de_exports, { templates: () => templates2 }); var templates2; var init_de = __esm({ "src/generated/locales/de.ts"() { init_lit(); init_lit_localize(); templates2 = { "h753ba5217e074fe6": x` Verwenden Sie die <strong>Suchleiste</strong> um Knoten zu finden nach <strong>Titel</strong>, <strong>Typ</strong>, und <strong>Inhalt</strong>. <br><br> <em>Tipp:</em> Durch Anklicken der Suchleiste wird ein <strong>Liste mit allen Knoten</strong>. Klicken Sie auf einen beliebigen Knoten in der Liste um <strong>ihn im Knoteneditor</strong> auszuwählen. `, "h7eb8e051be10e053": x` Fügt ein vordefiniertes <strong>Muster</strong> aus mehreren <strong>verbundenen Knoten</strong> in den Knoteneditor.<br><br> Auf diese Weise können Sie schnell einen strukturierten Satz von Knoten hinzufügen ohne manuelle Platzierung. `, "s03acb46b5470e0c9": `Geben Sie dem neuen`, "s0491e53d9de2e899": `Abbrechen`, "s060e481b4a246a3e": `Start Seite`, "s081de6398e897576": `Vergr\xF6\xDFern/Verkleinern`, "s09134f2a8084426d": `Zugriff auf`, "s0b52f3ea315aa9be": `Seiten Knoten`, "s0c17144a11b9576e": ` Verbinden Sie einen Knoten um Regeln basierend auf dessen Inhalt zu erstellen!`, "s1a30b9a78d158c62": str`Unbenannte Verzweigung ${0}`, "s26d236d09a66a620": `Regeln`, "s291e8cf07019837e": `Knoten suchen...`, "s2ceb11be2290bb1b": `Abbrechen`, "s2e192b19ed15fcf6": `Seite`, "s3687049d1af562c4": `Kopieren`, "s3b151ca64eb26ec1": `Ausklappen`, "s42657469b069bee8": `Erste Seite`, "s443fac2814907e18": str`Ausgänge (${0})`, "s46d93e3b43f99a6f": `Unbenanntes Gamebook`, "s487473fdf35474ff": `Verzweigungs Knoten`, "s4993444bfd3f3e5e": `Einklappen`, "s51cf605b81d7c915": `Verbindung ziehen`, "s524638d3ef766239": `Keine Verzweigungsregeln`, "s57f8d0db44da6177": `Ausgang l\xF6schen`, "s5b01e19e4efa5a9e": `Schlie\xDFen verhindern`, "s5c17e8980e6b5b18": `Klicken Sie auf einen Knoten um dessen Inhalt zu sehen`, "s5f2f575fee43e7f8": `Einzelne Knoten`, "s5f7ab55b6ba8729c": `Schreiben Sie hier...`, "s5fc4562bab5298a4": str` Eingehend (${0})`, "s603d69217de4e83b": `Keine Knoten gefunden`, "s629e3dc56b1d35e9": `einen Namen!`, "s6abd1339f5659d50": `Mehrere Knoten`, "s6ac0c20ddc5c15ff": `Seiten`, "s6fd70a9a8c6d8355": str`Unbenannte Seite ${0}`, "s75d83fc3f0cfab40": `Kopfzeile`, "s7984347f31306aca": `Popup zu Seiten`, "s7a07940a2b62f185": `Verzweigung`, "s7aaa8587048ed4d9": `Element ausw\xE4hlen`, "s7e617fb8024f45f4": `Quiz Verzweigung zu Seiten`, "s7f747127243108b9": `Popup zu Popups`, "s801ca3f7c573aebd": `Nicht verbunden`, "s9e1a091f1c7c53b0": str`Unbenanntes Popup ${0}`, "sa805b1e63ef896e4": str` Sie sind im Begriff den Ausgang ${0} zu löschen, obwohl dieser eine Verbindung hat. Wollen Sie fortfahren?`, "sac7bd907d39a570e": `Graphen L\xF6schen`, "sad9ce781382a9f6e": `Wenn keine Regel erf\xFCllt ist, gehe zu`, "sae5d9ee99fe0a8f5": `Erfordert`, "sb4f1dffbb6be6302": `L\xF6schen`, "sb5a5848245f9e0e8": `Zur Start Seite machen`, "sb89f410de72cb268": `Knoten hinzuf\xFCgen`, "sc7aeb596f1dcb1bd": `Popup`, "sd0182c6d73eaa2be": `Bedingung`, "sd374c80e17e18808": `Einf\xFCgen`, "sd8c7b6a9132e593b": `M\xF6chten Sie den Inhalt des Graphen l\xF6schen? Ihr gesamter Fortschritt geht verloren.`, "sd9bdfc0f95188eea": `Knoten l\xF6schen`, "sdc3d2121c3bc5907": `Popup Knoten`, "sdc673e73b5c13aea": `L\xF6schen`, "secf2ae437afa81c6": `Erstellen Sie Regeln to diktieren wie ihr Gamebook weitergeht. Die erste Regel die erf\xFCllt ist, wird angewendet.`, "sf80fa7d9bacf0a78": str`Sie sind dabei, den Knoten ${0} zu löschen. Wollen Sie fortfahren?`, "sf9aee319a006c9b4": `Hinzuf\xFCgen`, "sfc63e31ac7c956ed": `Ausw\xE4hlen` }; } }); // node_modules/drawflow/dist/drawflow.min.js var require_drawflow_min = __commonJS({ "node_modules/drawflow/dist/drawflow.min.js"(exports, module) { !function(e15, t10) { "object" == typeof exports && "object" == typeof module ? module.exports = t10() : "function" == typeof define && define.amd ? define([], t10) : "object" == typeof exports ? exports.Drawflow = t10() : e15.Drawflow = t10(); }("undefined" != typeof self ? self : exports, function() { return function(e15) { var t10 = {}; function n12(i9) { if (t10[i9]) return t10[i9].exports; var s9 = t10[i9] = { i: i9, l: false, exports: {} }; return e15[i9].call(s9.exports, s9, s9.exports, n12), s9.l = true, s9.exports; } return n12.m = e15, n12.c = t10, n12.d = function(e16, t11, i9) { n12.o(e16, t11) || Object.defineProperty(e16, t11, { enumerable: true, get: i9 }); }, n12.r = function(e16) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e16, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e16, "__esModule", { value: true }); }, n12.t = function(e16, t11) { if (1 & t11 && (e16 = n12(e16)), 8 & t11) return e16; if (4 & t11 && "object" == typeof e16 && e16 && e16.__esModule) return e16; var i9 = /* @__PURE__ */ Object.create(null); if (n12.r(i9), Object.defineProperty(i9, "default", { enumerable: true, value: e16 }), 2 & t11 && "string" != typeof e16) for (var s9 in e16) n12.d(i9, s9, function(t12) { return e16[t12]; }.bind(null, s9)); return i9; }, n12.n = function(e16) { var t11 = e16 && e16.__esModule ? function() { return e16.default; } : function() { return e16; }; return n12.d(t11, "a", t11), t11; }, n12.o = function(e16, t11) { return Object.prototype.hasOwnProperty.call(e16, t11); }, n12.p = "", n12(n12.s = 0); }([function(e15, t10, n12) { "use strict"; n12.r(t10), n12.d(t10, "default", function() { return i9; }); class i9 { constructor(e16, t11 = null, n13 = null) { this.events = {}, this.container = e16, this.precanvas = null, this.nodeId = 1, this.ele_selected = null, this.node_selected = null, this.drag = false, this.reroute = false, this.reroute_fix_curvature = false, this.curvature = 0.5, this.reroute_curvature_start_end = 0.5, this.reroute_curvature = 0.5, this.reroute_width = 6, this.drag_point = false, this.editor_selected = false, this.connection = false, this.connection_ele = null, this.connection_selected = null, this.canvas_x = 0, this.canvas_y = 0, this.pos_x = 0, this.pos_x_start = 0, this.pos_y = 0, this.pos_y_start = 0, this.mouse_x = 0, this.mouse_y = 0, this.line_path = 5, this.first_click = null, this.force_first_input = false, this.draggable_inputs = true, this.useuuid = false, this.parent = n13, this.noderegister = {}, this.render = t11, this.drawflow = { drawflow: { Home: { data: {} } } }, this.module = "Home", this.editor_mode = "edit", this.zoom = 1, this.zoom_max = 1.6, this.zoom_min = 0.5, this.zoom_value = 0.1, this.zoom_last_value = 1, this.evCache = new Array(), this.prevDiff = -1; } start() { this.container.classList.add("parent-drawflow"), this.container.tabIndex = 0, this.precanvas = document.createElement("div"), this.precanvas.classList.add("drawflow"), this.container.appendChild(this.precanvas), this.container.addEventListener("mouseup", this.dragEnd.bind(this)), this.container.addEventListener("mousemove", this.position.bind(this)), this.container.addEventListener("mousedown", this.click.bind(this)), this.container.addEventListener("touchend", this.dragEnd.bind(this)), this.container.addEventListener("touchmove", this.position.bind(this)), this.container.addEventListener("touchstart", this.click.bind(this)), this.container.addEventListener("contextmenu", this.contextmenu.bind(this)), this.container.addEventListener("keydown", this.key.bind(this)), this.container.addEventListener("wheel", this.zoom_enter.bind(this)), this.container.addEventListener("input", this.updateNodeValue.bind(this)), this.container.addEventListener("dblclick", this.dblclick.bind(this)), this.container.onpointerdown = this.pointerdown_handler.bind(this), this.container.onpointermove = this.pointermove_handler.bind(this), this.container.onpointerup = this.pointerup_handler.bind(this), this.container.onpointercancel = this.pointerup_handler.bind(this), this.container.onpointerout = this.pointerup_handler.bind(this), this.container.onpointerleave = this.pointerup_handler.bind(this), this.load(); } pointerdown_handler(e16) { this.evCache.push(e16); } pointermove_handler(e16) { for (var t11 = 0; t11 < this.evCache.length; t11++) if (e16.pointerId == this.evCache[t11].pointerId) { this.evCache[t11] = e16; break; } if (2 == this.evCache.length) { var n13 = Math.abs(this.evCache[0].clientX - this.evCache[1].clientX); this.prevDiff > 100 && (n13 > this.prevDiff && this.zoom_in(), n13 < this.prevDiff && this.zoom_out()), this.prevDiff = n13; } } pointerup_handler(e16) { this.remove_event(e16), this.evCache.length < 2 && (this.prevDiff = -1); } remove_event(e16) { for (var t11 = 0; t11 < this.evCache.length; t11++) if (this.evCache[t11].pointerId == e16.pointerId) { this.evCache.splice(t11, 1); break; } } load() { for (var e16 in this.drawflow.drawflow[this.module].data) this.addNodeImport(this.drawflow.drawflow[this.module].data[e16], this.precanvas); if (this.reroute) for (var e16 in this.drawflow.drawflow[this.mo